diff --git a/README.md b/README.md index a37896f8..ed64d2fd 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,12 @@ **🍔MaiCore 是一个基于大语言模型的可交互智能体** -- 💭 **智能对话系统**:基于 LLM 的自然语言交互,聊天时机控制。 -- 🤔 **实时思维系统**:模拟人类思考过程。 -- 🧠 **表达学习功能**:学习群友的说话风格和表达方式 -- 💝 **情感表达系统**:情绪系统和表情包系统。 -- 🔌 **强大插件系统**:提供API和事件系统,可编写强大插件。 +- 💭 **拟人构建的prompt**:使用自然语言风格构建回复器的prompt,实现近似人类言语习惯的回复。 +- 💭 **行为规划**:在合适的时间说话,使用合适的动作 +- 🧠 **表达学习**:学习群友的说话风格和表达方式,学会真实人类的说话风格 +- 🤔 **黑话学习**:自主的学习没有见过的词语,尝试理解并认知含义 +- 🔌 **插件系统**:提供API和事件系统,可编写丰富插件。 +- 💝 **情感表达**:情绪系统和表情包系统。
@@ -44,7 +45,7 @@ ## 🔥 更新和安装 -**最新版本: v0.11.3** ([更新日志](changelogs/changelog.md)) +**最新版本: v0.11.6** ([更新日志](changelogs/changelog.md)) 可前往 [Release](https://github.com/MaiM-with-u/MaiBot/releases/) 页面下载最新版本 可前往 [启动器发布页面](https://github.com/MaiM-with-u/mailauncher/releases/)下载最新启动器 @@ -60,15 +61,10 @@ > [!WARNING] > - 项目处于活跃开发阶段,功能和 API 可能随时调整。 -> - 有问题可以提交 Issue 或者 Discussion。 +> - 有问题可以提交 Issue 。 > - QQ 机器人存在被限制风险,请自行了解,谨慎使用。 > - 由于程序处于开发中,可能消耗较多 token。 -## 麦麦MC项目MaiCraft(早期开发) -[让麦麦玩MC](https://github.com/MaiM-with-u/Maicraft) - -交流群:1058573197 - ## 💬 讨论 **技术交流群:** @@ -80,7 +76,7 @@ **聊天吹水群:** - [麦麦之闲聊群](https://qm.qq.com/q/JxvHZnxyec) -**插件开发测试版群:** +**插件开发/测试版讨论群:** - [插件开发群](https://qm.qq.com/q/1036092828) ## 📚 文档 @@ -89,7 +85,22 @@ - [📚 核心 Wiki 文档](https://docs.mai-mai.org) - 项目最全面的文档中心,你可以了解麦麦有关的一切。 -### 设计理念(原始时代的火花) + +## 📚 衍生项目 + +### MaiCraft(早期开发) +[MaiCraft](https://github.com/MaiM-with-u/Maicraft) +> 让麦麦具有玩MC能力的项目 +> 交流群:1058573197 + +### MoFox_Bot +[MoFox - 仓库地址](https://github.com/MoFox-Studio/MoFox-Core) +> MoFox_Bot 是一个基于 MaiCore 0.10.0 snapshot.5 的增强型 fork 项目 +> 我们保留了原项目几乎所有核心功能,并在此基础上进行了深度优化与功能扩展,致力于打造一个更稳定、更智能、更具趣味性的 AI 智能体。 + + + +## 设计理念(原始时代的火花) > **千石可乐说:** > - 这个项目最初只是为了给牛牛 bot 添加一点额外的功能,但是功能越写越多,最后决定重写。其目的是为了创造一个活跃在 QQ 群聊的"生命体"。目的并不是为了写一个功能齐全的机器人,而是一个尽可能让人感知到真实的类人存在。 diff --git a/bot.py b/bot.py index 38894b29..7ba9af4b 100644 --- a/bot.py +++ b/bot.py @@ -1,7 +1,6 @@ import asyncio import hashlib import os -import sys import time import platform import traceback @@ -30,7 +29,7 @@ else: raise # 最早期初始化日志系统,确保所有后续模块都使用正确的日志格式 -from src.common.logger import initialize_logging, get_logger, shutdown_logging #noqa +from src.common.logger import initialize_logging, get_logger, shutdown_logging # noqa initialize_logging() @@ -212,9 +211,10 @@ if __name__ == "__main__": # 创建事件循环 loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) - + # 初始化 WebSocket 日志推送 from src.common.logger import initialize_ws_handler + initialize_ws_handler(loop) try: @@ -251,7 +251,7 @@ if __name__ == "__main__": print(f"关闭日志系统时出错: {e}") print("[主程序] 准备退出...") - + # 使用 os._exit() 强制退出,避免被阻塞 # 由于已经在 graceful_shutdown() 中完成了所有清理工作,这是安全的 os._exit(exit_code) diff --git a/changelogs/changelog.md b/changelogs/changelog.md index a0e64dd8..ba6921be 100644 --- a/changelogs/changelog.md +++ b/changelogs/changelog.md @@ -1,6 +1,47 @@ # Changelog +## [0.11.5] - 2025-11-21 -## [0.11.3] - 2025-11-17 +## [0.11.4] - 2025-11-20 +### 🌟 主要更新内容 +- **首个官方 Web 管理界面上线**:在此版本之前,MaiBot 没有 WebUI,所有配置需手动编辑 TOML 文件 +- **认证系统**:Token 安全登录(支持系统生成 64 位随机令牌 / 自定义 Token),首次配置向导 +- **配置管理(可视化编辑,无需手动改 TOML)**: + - 麦麦主程序配置:基础设置、人格、表情、黑话、情绪等 + - 模型提供商配置:OpenAI、Anthropic、DeepSeek、Qwen、Ollama 等 + - 模型配置:对话/视觉/嵌入模型分配 +- **资源管理**: + - 表情包管理:查看、搜索、注册、封禁 + - 表达方式管理:查看麦麦的表达记录 + - 人物信息管理:查看联系人列表 +- **插件系统**: + - 插件市场浏览 + - 一键安装/卸载/更新 + - 版本兼容性检查 + - 实时安装进度推送 +- **日志查看器**: + - WebSocket 实时日志流 + - 日志级别过滤(DEBUG/INFO/WARNING/ERROR/CRITICAL) + - 搜索功能 +- **主题定制**: + - 浅色/深色/跟随系统 + - 12 种主题色(6 单色 + 6 渐变色) + - 自定义颜色选择器 +- **全局搜索**:Cmd/Ctrl + K 快捷键,快速跳转任意页面 + +### 细节 +- **技术栈**: + - 前端: React 19 + TypeScript + Vite + TanStack Router + shadcn/ui + - 后端: FastAPI + Uvicorn + WebSocket + - 特点: SPA 单页应用,前后端同端口,静态文件托管 +- **使用方式**:参照 template.env 文件更新 .env 文件,添加两个字段: + - `WEBUI_ENABLED=true` + - `WEBUI_MODE=production` +- **WebUI 开源协议**:GPLv3 +- **WebUI 地址**:https://github.com/Mai-with-u/MaiBot-Dashboard + +告别手动编辑配置文件,享受现代化图形界面! + +## [0.11.3] - 2025-11-19 ### 功能更改和修复 - 优化记忆提取策略 - 优化黑话提取 diff --git a/scripts/build_io_pairs.py b/scripts/build_io_pairs.py index f934566a..944d7671 100644 --- a/scripts/build_io_pairs.py +++ b/scripts/build_io_pairs.py @@ -16,8 +16,6 @@ if PROJECT_ROOT not in sys.path: sys.path.insert(0, PROJECT_ROOT) - - SECONDS_5_MINUTES = 5 * 60 diff --git a/scripts/expression_scatter_analysis.py b/scripts/expression_scatter_analysis.py index b022c94e..3cb22f71 100644 --- a/scripts/expression_scatter_analysis.py +++ b/scripts/expression_scatter_analysis.py @@ -12,7 +12,6 @@ project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, project_root) - # 设置中文字体 plt.rcParams["font.sans-serif"] = ["SimHei", "Microsoft YaHei", "DejaVu Sans"] plt.rcParams["axes.unicode_minus"] = False diff --git a/scripts/mmipkg_tool.py b/scripts/mmipkg_tool.py index 6f14ae5b..3b5369ac 100644 --- a/scripts/mmipkg_tool.py +++ b/scripts/mmipkg_tool.py @@ -57,8 +57,8 @@ from src.common.database.database import db from src.common.database.database_model import Emoji # 常量定义 -MAGIC = b'MMIP' -FOOTER_MAGIC = b'MMFF' +MAGIC = b"MMIP" +FOOTER_MAGIC = b"MMFF" VERSION = 1 FOOTER_VERSION = 1 @@ -67,7 +67,7 @@ MAX_MANIFEST_SIZE = 200 * 1024 * 1024 # 200 MB MAX_PAYLOAD_SIZE = 10 * 1024 * 1024 * 1024 # 10 GB # 支持的图片格式 -SUPPORTED_FORMATS = {'.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp'} +SUPPORTED_FORMATS = {".jpg", ".jpeg", ".png", ".gif", ".webp", ".avif", ".bmp"} # 创建控制台对象 console = Console() @@ -75,6 +75,7 @@ console = Console() class MMIPKGError(Exception): """MMIPKG 相关错误""" + pass @@ -97,56 +98,56 @@ def get_image_info(file_path: str) -> Tuple[int, int, str]: try: with Image.open(file_path) as img: width, height = img.size - format_lower = img.format.lower() if img.format else 'unknown' + format_lower = img.format.lower() if img.format else "unknown" mime_map = { - 'jpeg': 'image/jpeg', - 'jpg': 'image/jpeg', - 'png': 'image/png', - 'gif': 'image/gif', - 'webp': 'image/webp', - 'avif': 'image/avif', - 'bmp': 'image/bmp' + "jpeg": "image/jpeg", + "jpg": "image/jpeg", + "png": "image/png", + "gif": "image/gif", + "webp": "image/webp", + "avif": "image/avif", + "bmp": "image/bmp", } - mime_type = mime_map.get(format_lower, f'image/{format_lower}') + mime_type = mime_map.get(format_lower, f"image/{format_lower}") return width, height, mime_type except Exception as e: print(f"警告: 无法读取图片信息 {file_path}: {e}") - return 0, 0, 'image/unknown' + return 0, 0, "image/unknown" -def reencode_image(file_path: str, output_format: str = 'webp', quality: int = 80) -> bytes: +def reencode_image(file_path: str, output_format: str = "webp", quality: int = 80) -> bytes: """重新编码图片""" try: with Image.open(file_path) as img: # 转换为 RGB(如果需要) - if img.mode in ('RGBA', 'LA', 'P'): - if output_format.lower() == 'jpeg': + if img.mode in ("RGBA", "LA", "P"): + if output_format.lower() == "jpeg": # JPEG 不支持透明度,转为白色背景 - background = Image.new('RGB', img.size, (255, 255, 255)) - if img.mode == 'P': - img = img.convert('RGBA') - background.paste(img, mask=img.split()[-1] if img.mode == 'RGBA' else None) + background = Image.new("RGB", img.size, (255, 255, 255)) + if img.mode == "P": + img = img.convert("RGBA") + background.paste(img, mask=img.split()[-1] if img.mode == "RGBA" else None) img = background - elif output_format.lower() == 'webp': + elif output_format.lower() == "webp": # WebP 支持透明度 - if img.mode == 'P': - img = img.convert('RGBA') - elif img.mode not in ('RGB', 'RGBA'): - img = img.convert('RGB') - + if img.mode == "P": + img = img.convert("RGBA") + elif img.mode not in ("RGB", "RGBA"): + img = img.convert("RGB") + # 编码图片 output = io.BytesIO() - save_kwargs = {'format': output_format.upper()} - - if output_format.lower() in {'jpeg', 'jpg'}: - save_kwargs['quality'] = quality - save_kwargs['optimize'] = True - elif output_format.lower() == 'webp': - save_kwargs['quality'] = quality - save_kwargs['method'] = 6 # 更好的压缩 - elif output_format.lower() == 'png': - save_kwargs['optimize'] = True - + save_kwargs = {"format": output_format.upper()} + + if output_format.lower() in {"jpeg", "jpg"}: + save_kwargs["quality"] = quality + save_kwargs["optimize"] = True + elif output_format.lower() == "webp": + save_kwargs["quality"] = quality + save_kwargs["method"] = 6 # 更好的压缩 + elif output_format.lower() == "png": + save_kwargs["optimize"] = True + img.save(output, **save_kwargs) return output.getvalue() except Exception as e: @@ -155,25 +156,28 @@ def reencode_image(file_path: str, output_format: str = 'webp', quality: int = 8 class MMIPKGPacker: """MMIPKG 打包器""" - - def __init__(self, - use_compression: bool = True, - zstd_level: int = 3, - reencode: Optional[str] = None, - reencode_quality: int = 80): + + def __init__( + self, + use_compression: bool = True, + zstd_level: int = 3, + reencode: Optional[str] = None, + reencode_quality: int = 80, + ): self.use_compression = use_compression and zstd is not None self.zstd_level = zstd_level self.reencode = reencode self.reencode_quality = reencode_quality - + if use_compression and zstd is None: print("警告: zstandard 未安装,将不使用压缩") self.use_compression = False - - def pack_from_db(self, output_path: str, pack_name: Optional[str] = None, - custom_manifest: Optional[Dict] = None) -> bool: + + def pack_from_db( + self, output_path: str, pack_name: Optional[str] = None, custom_manifest: Optional[Dict] = None + ) -> bool: """从数据库导出已注册的表情包 - + Args: output_path: 输出文件路径 pack_name: 包名称 @@ -183,21 +187,21 @@ class MMIPKGPacker: # 连接数据库 if db.is_closed(): db.connect() - + # 查询所有已注册的表情包 emojis = Emoji.select().where(Emoji.is_registered) emoji_count = emojis.count() - + if emoji_count == 0: print("错误: 数据库中没有已注册的表情包") return False - + print(f"找到 {emoji_count} 个已注册的表情包") - + # 准备 items items = [] image_data_list = [] - + # 使用进度条处理表情包 with Progress( SpinnerColumn(), @@ -205,37 +209,39 @@ class MMIPKGPacker: BarColumn(), TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), TimeElapsedColumn(), - console=console + console=console, ) as progress: task = progress.add_task("[cyan]扫描表情包...", total=emoji_count) - + for idx, emoji in enumerate(emojis, 1): - progress.update(task, description=f"[cyan]处理 {idx}/{emoji_count}: {os.path.basename(emoji.full_path)}") - + progress.update( + task, description=f"[cyan]处理 {idx}/{emoji_count}: {os.path.basename(emoji.full_path)}" + ) + # 检查文件是否存在 if not os.path.exists(emoji.full_path): console.print(" [yellow]警告: 文件不存在,跳过[/yellow]") progress.advance(task) continue - + # 读取或重新编码图片 if self.reencode: try: img_bytes = reencode_image(emoji.full_path, self.reencode, self.reencode_quality) except Exception as e: console.print(f" [yellow]警告: 重新编码失败,使用原始文件: {e}[/yellow]") - with open(emoji.full_path, 'rb') as f: + with open(emoji.full_path, "rb") as f: img_bytes = f.read() else: - with open(emoji.full_path, 'rb') as f: + with open(emoji.full_path, "rb") as f: img_bytes = f.read() - + # 计算 SHA256 img_sha = calculate_sha256(img_bytes) - + # 获取图片信息 width, height, mime_type = get_image_info(emoji.full_path) - + # 构建 item(使用短字段名) filename = os.path.basename(emoji.full_path) item = { @@ -259,95 +265,97 @@ class MMIPKGPacker: "emoji_hash": emoji.emoji_hash or "", "is_registered": True, "is_banned": emoji.is_banned or False, - } + }, } - + items.append(item) image_data_list.append(img_bytes) progress.advance(task) - + if not items: print("错误: 没有有效的表情包可以打包") return False - + print(f"找到 {len(items)} 个表情包可以打包...") - + # 准备打包 pack_id = str(uuid.uuid4()) if pack_name is None: pack_name = f"MaiBot_Emojis_{datetime.now().strftime('%Y%m%d_%H%M%S')}" - + manifest = { "p": pack_id, # pack_id "n": pack_name, # pack_name "t": datetime.now().isoformat(), # created_at - "a": items # items array + "a": items, # items array } - + # 添加自定义字段 if custom_manifest: for key, value in custom_manifest.items(): if key not in manifest: # 不覆盖核心字段 manifest[key] = value - + # 序列化 manifest manifest_bytes = msgpack.packb(manifest, use_bin_type=True) manifest_len = len(manifest_bytes) - + # 计算 payload 大小 payload_size = 4 + manifest_len # manifest_len + manifest_bytes for img_bytes in image_data_list: payload_size += 4 + len(img_bytes) # img_len + img_bytes - + print(f"Manifest 大小: {manifest_len / 1024:.2f} KB") print(f"Payload 未压缩大小: {payload_size / 1024 / 1024:.2f} MB") - + # 写入文件 return self._write_package(output_path, manifest_bytes, image_data_list, payload_size) - + except Exception as e: print(f"打包失败: {e}") import traceback + traceback.print_exc() return False finally: if not db.is_closed(): db.close() - - def _write_package(self, output_path: str, manifest_bytes: bytes, - image_data_list: List[bytes], payload_size: int) -> bool: + + def _write_package( + self, output_path: str, manifest_bytes: bytes, image_data_list: List[bytes], payload_size: int + ) -> bool: """写入打包文件""" try: - with open(output_path, 'wb') as f: + with open(output_path, "wb") as f: # 写入 Header (32 bytes) flags = 0x01 if self.use_compression else 0x00 header = MAGIC # 4 bytes - header += struct.pack('B', VERSION) # 1 byte - header += struct.pack('B', flags) # 1 byte - header += b'\x00\x00' # 2 bytes reserved - header += struct.pack('>Q', payload_size) # 8 bytes - header += struct.pack('>Q', len(manifest_bytes)) # 8 bytes - header += b'\x00' * 8 # 8 bytes reserved - + header += struct.pack("B", VERSION) # 1 byte + header += struct.pack("B", flags) # 1 byte + header += b"\x00\x00" # 2 bytes reserved + header += struct.pack(">Q", payload_size) # 8 bytes + header += struct.pack(">Q", len(manifest_bytes)) # 8 bytes + header += b"\x00" * 8 # 8 bytes reserved + assert len(header) == 32, f"Header size mismatch: {len(header)}" f.write(header) - + # 准备 payload 并计算 SHA256 payload_sha = hashlib.sha256() - + # 写入 payload(可能压缩) if self.use_compression: console.print(f"[cyan]使用 Zstd 压缩 (level={self.zstd_level})...[/cyan]") compressor = zstd.ZstdCompressor(level=self.zstd_level) - + with compressor.stream_writer(f, closefd=False) as writer: # 写入 manifest - manifest_len_bytes = struct.pack('>I', len(manifest_bytes)) + manifest_len_bytes = struct.pack(">I", len(manifest_bytes)) writer.write(manifest_len_bytes) writer.write(manifest_bytes) payload_sha.update(manifest_len_bytes) payload_sha.update(manifest_bytes) - + # 使用进度条写入所有图片 with Progress( SpinnerColumn(), @@ -355,13 +363,13 @@ class MMIPKGPacker: BarColumn(), TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), TimeRemainingColumn(), - console=console + console=console, ) as progress: task = progress.add_task("[green]压缩写入图片...", total=len(image_data_list)) - + for idx, img_bytes in enumerate(image_data_list, 1): progress.update(task, description=f"[green]压缩写入 {idx}/{len(image_data_list)}") - img_len_bytes = struct.pack('>I', len(img_bytes)) + img_len_bytes = struct.pack(">I", len(img_bytes)) writer.write(img_len_bytes) writer.write(img_bytes) payload_sha.update(img_len_bytes) @@ -370,12 +378,12 @@ class MMIPKGPacker: else: # 不压缩,直接写入 # 写入 manifest - manifest_len_bytes = struct.pack('>I', len(manifest_bytes)) + manifest_len_bytes = struct.pack(">I", len(manifest_bytes)) f.write(manifest_len_bytes) f.write(manifest_bytes) payload_sha.update(manifest_len_bytes) payload_sha.update(manifest_bytes) - + # 使用进度条写入所有图片 with Progress( SpinnerColumn(), @@ -383,29 +391,29 @@ class MMIPKGPacker: BarColumn(), TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), TimeRemainingColumn(), - console=console + console=console, ) as progress: task = progress.add_task("[green]写入图片...", total=len(image_data_list)) - + for idx, img_bytes in enumerate(image_data_list, 1): progress.update(task, description=f"[green]写入 {idx}/{len(image_data_list)}") - img_len_bytes = struct.pack('>I', len(img_bytes)) + img_len_bytes = struct.pack(">I", len(img_bytes)) f.write(img_len_bytes) f.write(img_bytes) payload_sha.update(img_len_bytes) payload_sha.update(img_bytes) progress.advance(task) - + # 写入 Footer (40 bytes) file_sha256 = payload_sha.digest() footer = FOOTER_MAGIC # 4 bytes footer += file_sha256 # 32 bytes - footer += struct.pack('B', FOOTER_VERSION) # 1 byte - footer += b'\x00' * 3 # 3 bytes reserved - + footer += struct.pack("B", FOOTER_VERSION) # 1 byte + footer += b"\x00" * 3 # 3 bytes reserved + assert len(footer) == 40, f"Footer size mismatch: {len(footer)}" f.write(footer) - + file_size = f.tell() print("\n打包完成!") print(f"输出文件: {output_path}") @@ -413,100 +421,100 @@ class MMIPKGPacker: if self.use_compression: ratio = (1 - file_size / (payload_size + 32 + 40)) * 100 print(f"压缩率: {ratio:.1f}%") - + return True - + except Exception as e: print(f"写入文件失败: {e}") import traceback + traceback.print_exc() return False class MMIPKGUnpacker: """MMIPKG 解包器""" - + def __init__(self, verify_sha: bool = True): self.verify_sha = verify_sha - - def import_to_db(self, package_path: str, - output_dir: Optional[str] = None, - replace_existing: bool = False, - batch_size: int = 500) -> bool: + + def import_to_db( + self, package_path: str, output_dir: Optional[str] = None, replace_existing: bool = False, batch_size: int = 500 + ) -> bool: """导入到数据库""" try: if not os.path.exists(package_path): print(f"错误: 文件不存在: {package_path}") return False - + # 连接数据库 if db.is_closed(): db.connect() - + # 如果未指定输出目录,使用默认的已注册表情包目录 if output_dir is None: output_dir = os.path.join(PROJECT_ROOT, "data", "emoji_registed") - + os.makedirs(output_dir, exist_ok=True) - + print(f"正在读取包: {package_path}") - - with open(package_path, 'rb') as f: + + with open(package_path, "rb") as f: # 读取 Header header = f.read(32) if len(header) != 32: raise MMIPKGError("Header 大小不正确") - + magic = header[:4] if magic != MAGIC: raise MMIPKGError(f"无效的 MAGIC: {magic}") - - version = struct.unpack('B', header[4:5])[0] + + version = struct.unpack("B", header[4:5])[0] if version != VERSION: print(f"警告: 包版本 {version} 与当前版本 {VERSION} 不匹配") - - flags = struct.unpack('B', header[5:6])[0] + + flags = struct.unpack("B", header[5:6])[0] is_compressed = bool(flags & 0x01) - - payload_uncompressed_len = struct.unpack('>Q', header[8:16])[0] - manifest_uncompressed_len = struct.unpack('>Q', header[16:24])[0] - + + payload_uncompressed_len = struct.unpack(">Q", header[8:16])[0] + manifest_uncompressed_len = struct.unpack(">Q", header[16:24])[0] + # 安全检查 if manifest_uncompressed_len > MAX_MANIFEST_SIZE: raise MMIPKGError(f"Manifest 过大: {manifest_uncompressed_len} bytes") if payload_uncompressed_len > MAX_PAYLOAD_SIZE: raise MMIPKGError(f"Payload 过大: {payload_uncompressed_len} bytes") - + print(f"压缩: {'是' if is_compressed else '否'}") print(f"Payload 大小: {payload_uncompressed_len / 1024 / 1024:.2f} MB") - + # 读取 payload payload_start = f.tell() - + # 找到 footer 位置 f.seek(-40, 2) # 从文件末尾向前 40 bytes footer = f.read(40) - + if footer[:4] != FOOTER_MAGIC: raise MMIPKGError("无效的 Footer MAGIC") - + expected_sha = footer[4:36] - + # 回到 payload 开始 f.seek(payload_start) - + # 读取整个 payload(用于计算 SHA) footer_start = os.path.getsize(package_path) - 40 payload_data_size = footer_start - payload_start - + # 解压或直接读取 if is_compressed: if zstd is None: raise MMIPKGError("需要 zstandard 库来解压此包") - + print("解压 payload...") compressed_data = f.read(payload_data_size) - + # 使用流式解压,不需要预知解压后大小 decompressor = zstd.ZstdDecompressor() try: @@ -519,60 +527,63 @@ class MMIPKGUnpacker: # 方法2:如果流式失败,尝试直接解压(兼容旧格式) print(f" 流式解压失败,尝试直接解压: {e}") try: - payload_data = decompressor.decompress(compressed_data, max_output_size=payload_uncompressed_len) + payload_data = decompressor.decompress( + compressed_data, max_output_size=payload_uncompressed_len + ) except Exception as e2: raise MMIPKGError(f"解压失败: {e2}") from e2 else: payload_data = f.read(payload_data_size) - + # 验证 SHA256 actual_sha = calculate_sha256(payload_data) if self.verify_sha and actual_sha != expected_sha: raise MMIPKGError("SHA256 校验失败!") if self.verify_sha: print("✓ SHA256 校验通过") - + # 解析 payload payload_stream = io.BytesIO(payload_data) - + # 读取 manifest manifest_len_bytes = payload_stream.read(4) - manifest_len = struct.unpack('>I', manifest_len_bytes)[0] + manifest_len = struct.unpack(">I", manifest_len_bytes)[0] manifest_bytes = payload_stream.read(manifest_len) manifest = msgpack.unpackb(manifest_bytes, raw=False) - + pack_id = manifest.get("p", "unknown") pack_name = manifest.get("n", "unknown") created_at = manifest.get("t", "unknown") items = manifest.get("a", []) - + print("\n包信息:") print(f" ID: {pack_id}") print(f" 名称: {pack_name}") print(f" 创建时间: {created_at}") print(f" 表情包数量: {len(items)}") - + # 导入表情包 - return self._import_items(payload_stream, items, output_dir, - replace_existing, batch_size) - + return self._import_items(payload_stream, items, output_dir, replace_existing, batch_size) + except Exception as e: print(f"导入失败: {e}") import traceback + traceback.print_exc() return False finally: if not db.is_closed(): db.close() - - def _import_items(self, payload_stream: BinaryIO, items: List[Dict], - output_dir: str, replace_existing: bool, batch_size: int) -> bool: + + def _import_items( + self, payload_stream: BinaryIO, items: List[Dict], output_dir: str, replace_existing: bool, batch_size: int + ) -> bool: """导入 items 到数据库""" try: imported_count = 0 skipped_count = 0 error_count = 0 - + # 开始事务,使用进度条 with db.atomic(): with Progress( @@ -581,14 +592,14 @@ class MMIPKGUnpacker: BarColumn(), TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), TimeRemainingColumn(), - console=console + console=console, ) as progress: task = progress.add_task("[cyan]导入表情包...", total=len(items)) - + for idx, item in enumerate(items, 1): try: progress.update(task, description=f"[cyan]导入 {idx}/{len(items)}") - + # 读取图片数据 img_len_bytes = payload_stream.read(4) if len(img_len_bytes) != 4: @@ -596,16 +607,16 @@ class MMIPKGUnpacker: error_count += 1 progress.advance(task) continue - - img_len = struct.unpack('>I', img_len_bytes)[0] + + img_len = struct.unpack(">I", img_len_bytes)[0] img_bytes = payload_stream.read(img_len) - + if len(img_bytes) != img_len: console.print(f"[red]错误: 图片数据不完整 (item {idx})[/red]") error_count += 1 progress.advance(task) continue - + # 验证图片 SHA if self.verify_sha and (expected_sha := item.get("h")): actual_sha = calculate_sha256(img_bytes) @@ -614,24 +625,24 @@ class MMIPKGUnpacker: error_count += 1 progress.advance(task) continue - + # 获取元数据 opt = item.get("opt", {}) # 使用 or 提供回退值,如果 emoji_hash 为空则使用后续计算的值 emoji_hash = opt.get("emoji_hash") or calculate_sha256(img_bytes).hex() - + # 检查是否已存在 existing = Emoji.get_or_none(Emoji.emoji_hash == emoji_hash) - + if existing and not replace_existing: skipped_count += 1 progress.advance(task) continue - + # 保存图片文件 filename = item.get("fn", f"{emoji_hash[:8]}.{opt.get('format', 'png')}") file_path = os.path.join(output_dir, filename) - + # 如果文件已存在且不替换,生成新文件名 if os.path.exists(file_path) and not replace_existing: base, ext = os.path.splitext(filename) @@ -640,14 +651,14 @@ class MMIPKGUnpacker: filename = f"{base}_{counter}{ext}" file_path = os.path.join(output_dir, filename) counter += 1 - - with open(file_path, 'wb') as img_file: + + with open(file_path, "wb") as img_file: img_file.write(img_bytes) - + # 准备数据库记录 current_time = time.time() emotion_str = opt.get("emotion", "") - + if existing and replace_existing: # 更新现有记录 - 恢复完整的数据库信息 existing.full_path = file_path @@ -678,28 +689,29 @@ class MMIPKGUnpacker: is_registered=opt.get("is_registered", True), is_banned=opt.get("is_banned", False), ) - + imported_count += 1 progress.advance(task) - + except Exception as e: console.print(f"[red]处理 item {idx} 时出错: {e}[/red]") error_count += 1 progress.advance(task) continue - + # 输出统计 - + console.print(f"\n[green]✓ 成功导入 {imported_count} 个表情包[/green]") console.print(f" [yellow]跳过 {skipped_count} 个[/yellow]") if error_count > 0: console.print(f" [red]错误 {error_count} 个[/red]") - + return error_count == 0 - + except Exception as e: console.print(f"[red]导入 items 失败: {e}[/red]") import traceback + traceback.print_exc() return False @@ -719,26 +731,27 @@ def print_menu(): console.print(" [2] [bold]导入表情包[/bold] (从 .mmipkg 文件导入到数据库)") console.print(" [0] [bold]退出[/bold]") console.print() -def get_input(prompt: str, default: Optional[str] = None, - choices: Optional[List[str]] = None) -> str: + + +def get_input(prompt: str, default: Optional[str] = None, choices: Optional[List[str]] = None) -> str: """获取用户输入""" if default: prompt = f"{prompt} (默认: {default})" - + while True: try: value = input(f"{prompt}: ").strip() - + if not value: if default: return default console.print(" [yellow]⚠ 输入不能为空,请重新输入[/yellow]") continue - + if choices and value not in choices: console.print(f" [yellow]⚠ 无效的选择,请选择: {', '.join(choices)}[/yellow]") continue - + return value except KeyboardInterrupt: console.print("\n[yellow]操作已取消[/yellow]") @@ -756,13 +769,13 @@ def get_yes_no(prompt: str, default: bool = False) -> bool: while True: try: value = input(f"{prompt} ({default_str}): ").strip().lower() - + if not value: return default - - if value in ('y', 'yes', '是'): + + if value in ("y", "yes", "是"): return True - elif value in ('n', 'no', '否'): + elif value in ("n", "no", "否"): return False else: console.print(" [yellow]⚠ 请输入 y/yes/是 或 n/no/否[/yellow]") @@ -778,10 +791,10 @@ def get_int(prompt: str, default: int, min_val: int = 1, max_val: int = 100) -> while True: try: value = input(f"{prompt} (默认: {default}, 范围: {min_val}-{max_val}): ").strip() - + if not value: return default - + try: num = int(value) if min_val <= num <= max_val: @@ -818,15 +831,15 @@ def interactive_export(): console.print("\n[cyan]" + "-" * 70 + "[/cyan]") console.print("[bold]导出表情包到 .mmipkg 文件[/bold]") console.print("[cyan]" + "-" * 70 + "[/cyan]") - + # 检查数据库 try: if db.is_closed(): db.connect() - + emoji_count = Emoji.select().where(Emoji.is_registered).count() console.print(f"\n[green]✓ 找到 {emoji_count} 个已注册的表情包[/green]") - + if emoji_count == 0: console.print("[red]✗ 数据库中没有已注册的表情包,无法导出[/red]") return False @@ -836,27 +849,25 @@ def interactive_export(): finally: if not db.is_closed(): db.close() - + # 获取输出文件路径 console.print("\n[yellow]1. 输出文件设置[/yellow]") default_filename = f"maibot_emojis_{datetime.now().strftime('%Y%m%d_%H%M%S')}.mmipkg" output_path = get_input(" 输出文件路径", default_filename) - + # 确保有 .mmipkg 扩展名 - if not output_path.endswith('.mmipkg'): - output_path += '.mmipkg' - + if not output_path.endswith(".mmipkg"): + output_path += ".mmipkg" + # 获取包名称 default_pack_name = f"MaiBot表情包_{datetime.now().strftime('%Y%m%d')}" pack_name = get_input(" 包名称", default_pack_name) - + # 自定义 manifest console.print("\n[yellow]2. 包信息设置(可选)[/yellow]") if get_yes_no(" 是否添加包的作者和介绍信息", False): - custom_manifest = { - "author": author - } if (author := input(" 作者名称(可选): ").strip()) else {} - + custom_manifest = {"author": author} if (author := input(" 作者名称(可选): ").strip()) else {} + # 介绍信息 console.print(" 包介绍(限制 100 字以内):") if description := input(" > ").strip(): @@ -864,23 +875,23 @@ def interactive_export(): console.print(f" [yellow]⚠ 介绍过长({len(description)} 字),已截断至 100 字[/yellow]") description = description[:100] custom_manifest["description"] = description - + if not custom_manifest: custom_manifest = None else: console.print(" [green]✓ 已添加包信息[/green]") else: custom_manifest = None - + # 压缩设置 console.print("\n[yellow]3. 压缩设置[/yellow]") use_compression = get_yes_no(" 使用 Zstd 压缩", True) - + zstd_level = 3 if use_compression: print_compression_level_info() zstd_level = get_int(" 选择压缩级别", 3, 1, 22) - + # 重新编码设置 console.print("\n[yellow]4. 图片编码设置[/yellow]") if get_yes_no(" 是否重新编码图片(可显著减小文件大小)", False): @@ -888,13 +899,13 @@ def interactive_export(): console.print(" webp: 推荐,体积小且支持透明度") console.print(" jpeg: 最小体积,但不支持透明度") console.print(" png: 无损,文件较大") - reencode = get_input(" 选择格式", "webp", ['webp', 'jpeg', 'png']) - - quality = get_int(" 编码质量", 80, 1, 100) if reencode in ('webp', 'jpeg') else 80 + reencode = get_input(" 选择格式", "webp", ["webp", "jpeg", "png"]) + + quality = get_int(" 编码质量", 80, 1, 100) if reencode in ("webp", "jpeg") else 80 else: reencode = None quality = 80 - + # 确认导出 console.print("\n[cyan]" + "-" * 70 + "[/cyan]") console.print("[bold]导出配置:[/bold]") @@ -912,27 +923,24 @@ def interactive_export(): console.print(f" 编码质量: {quality}") console.print(f" 表情包数量: {emoji_count}") console.print("[cyan]" + "-" * 70 + "[/cyan]") - + if not get_yes_no("\n确认导出", True): console.print("[red]✗ 已取消导出[/red]") return False - + # 开始导出 console.print("\n[cyan]开始导出...[/cyan]") packer = MMIPKGPacker( - use_compression=use_compression, - zstd_level=zstd_level, - reencode=reencode, - reencode_quality=quality + use_compression=use_compression, zstd_level=zstd_level, reencode=reencode, reencode_quality=quality ) - + success = packer.pack_from_db(output_path, pack_name, custom_manifest) - + if success: console.print(f"\n[green]✓ 导出成功: {output_path}[/green]") else: console.print("\n[red]✗ 导出失败[/red]") - + return success @@ -941,37 +949,37 @@ def interactive_import(): console.print("\n[cyan]" + "-" * 70 + "[/cyan]") console.print("[bold]从 .mmipkg 文件导入表情包[/bold]") console.print("[cyan]" + "-" * 70 + "[/cyan]") - + # 选择导入模式 print_import_mode_selection() - import_mode = get_input("请选择", "1", ['1', '2']) - + import_mode = get_input("请选择", "1", ["1", "2"]) + input_files = [] - - if import_mode == '1': + + if import_mode == "1": # 自动扫描模式 import_dir = os.path.join(PROJECT_ROOT, "data", "import_emoji") os.makedirs(import_dir, exist_ok=True) - + console.print(f"\n[cyan]扫描目录: {import_dir}[/cyan]") - + # 查找所有 .mmipkg 文件 for file in os.listdir(import_dir): - if file.endswith('.mmipkg'): + if file.endswith(".mmipkg"): file_path = os.path.join(import_dir, file) if os.path.isfile(file_path): input_files.append(file_path) - + if not input_files: console.print("[red]✗ 目录中没有找到 .mmipkg 文件[/red]") console.print(f" 请将表情包文件放入: {import_dir}") return False - + console.print(f"\n[green]找到 {len(input_files)} 个文件:[/green]") for i, file_path in enumerate(input_files, 1): file_size = os.path.getsize(file_path) / 1024 / 1024 console.print(f" [{i}] {os.path.basename(file_path)} ({file_size:.2f} MB)") - + if not get_yes_no(f"\n确认导入这 {len(input_files)} 个文件", True): console.print("[red]✗ 已取消导入[/red]") return False @@ -979,23 +987,23 @@ def interactive_import(): # 手动输入模式 console.print("\n[yellow]1. 输入文件设置[/yellow]") input_path = get_input(" 输入文件路径 (.mmipkg)") - + if not os.path.exists(input_path): console.print(f"[red]✗ 文件不存在: {input_path}[/red]") return False - + input_files.append(input_path) - + # 获取输出目录 console.print("\n[yellow]2. 输出目录设置[/yellow]") default_output_dir = os.path.join(PROJECT_ROOT, "data", "emoji_registed") output_dir = get_input(" 输出目录", default_output_dir) - + # 导入选项 console.print("\n[yellow]3. 导入选项[/yellow]") replace_existing = get_yes_no(" 替换已存在的表情包", False) verify_sha = get_yes_no(" 验证 SHA256 完整性(推荐)", True) - + # 批量大小 console.print("\n[yellow]4. 性能设置[/yellow]") console.print(" [cyan]批量大小说明:[/cyan]") @@ -1003,7 +1011,7 @@ def interactive_import(): console.print(" 500-1000: 快速导入大量表情包") console.print(" 1000+: 极速模式,但内存占用更高") batch_size = get_int(" 批量提交大小", 500, 100, 5000) - + # 确认导入 console.print("\n[cyan]" + "-" * 70 + "[/cyan]") console.print("[bold]导入配置:[/bold]") @@ -1014,17 +1022,17 @@ def interactive_import(): console.print(f" SHA256 验证: {'是' if verify_sha else '否'}") console.print(f" 批量大小: {batch_size}") console.print("[cyan]" + "-" * 70 + "[/cyan]") - + if not get_yes_no("\n确认导入", True): console.print("[red]✗ 已取消导入[/red]") return False - + # 开始导入 unpacker = MMIPKGUnpacker(verify_sha=verify_sha) - + total_success = 0 total_failed = 0 - + # 使用进度条处理多个文件 with Progress( SpinnerColumn(), @@ -1032,31 +1040,28 @@ def interactive_import(): BarColumn(), TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), TimeElapsedColumn(), - console=console + console=console, ) as progress: task = progress.add_task("[cyan]导入文件...", total=len(input_files)) - + for i, input_path in enumerate(input_files, 1): progress.update(task, description=f"[cyan]导入 [{i}/{len(input_files)}]: {os.path.basename(input_path)}") - + console.print(f"\n[bold]{'=' * 70}[/bold]") console.print(f"[bold]导入文件 [{i}/{len(input_files)}]: {os.path.basename(input_path)}[/bold]") console.print(f"[bold]{'=' * 70}[/bold]") - + success = unpacker.import_to_db( - input_path, - output_dir=output_dir, - replace_existing=replace_existing, - batch_size=batch_size + input_path, output_dir=output_dir, replace_existing=replace_existing, batch_size=batch_size ) - + if success: total_success += 1 else: total_failed += 1 - + progress.advance(task) - + # 总结 console.print(f"\n[bold]{'=' * 70}[/bold]") console.print("[bold]导入总结:[/bold]") @@ -1064,28 +1069,28 @@ def interactive_import(): if total_failed > 0: console.print(f" [red]失败: {total_failed} 个文件[/red]") console.print(f"[bold]{'=' * 70}[/bold]") - + return total_failed == 0 def main(): """主函数 - 交互式界面""" print_header() - + try: while True: print_menu() try: - choice = get_input("请选择", "1", ['0', '1', '2']) + choice = get_input("请选择", "1", ["0", "1", "2"]) except KeyboardInterrupt: console.print("\n[green]再见![/green]") return 0 - - if choice == '0': + + if choice == "0": console.print("\n[green]再见![/green]") return 0 - - elif choice == '1': + + elif choice == "1": try: interactive_export() except KeyboardInterrupt: @@ -1093,14 +1098,15 @@ def main(): except Exception as e: console.print(f"\n[red]✗ 发生错误: {e}[/red]") import traceback + traceback.print_exc() - + try: input("\n按 Enter 键继续...") except (KeyboardInterrupt, EOFError): pass - - elif choice == '2': + + elif choice == "2": try: interactive_import() except KeyboardInterrupt: @@ -1108,8 +1114,9 @@ def main(): except Exception as e: console.print(f"\n[red]✗ 发生错误: {e}[/red]") import traceback + traceback.print_exc() - + try: input("\n按 Enter 键继续...") except (KeyboardInterrupt, EOFError): @@ -1117,9 +1124,9 @@ def main(): except KeyboardInterrupt: console.print("\n[green]再见![/green]") return 0 - + return 0 -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(main()) diff --git a/src/chat/heart_flow/heartFC_chat.py b/src/chat/heart_flow/heartFC_chat.py index 707c44bd..dbbd39ef 100644 --- a/src/chat/heart_flow/heartFC_chat.py +++ b/src/chat/heart_flow/heartFC_chat.py @@ -333,7 +333,6 @@ class HeartFChatting: # 重置连续 no_reply 计数 self.consecutive_no_reply_count = 0 reason = "" - await database_api.store_action_info( chat_stream=self.chat_stream, diff --git a/src/chat/knowledge/__init__.py b/src/chat/knowledge/__init__.py index b9c96708..a570277c 100644 --- a/src/chat/knowledge/__init__.py +++ b/src/chat/knowledge/__init__.py @@ -30,9 +30,11 @@ DATA_PATH = os.path.join(ROOT_PATH, "data") qa_manager = None inspire_manager = None + def get_qa_manager(): return qa_manager + def lpmm_start_up(): # sourcery skip: extract-duplicate-method # 检查LPMM知识库是否启用 if global_config.lpmm_knowledge.enable: diff --git a/src/chat/knowledge/qa_manager.py b/src/chat/knowledge/qa_manager.py index 66a6e4d1..9988dc22 100644 --- a/src/chat/knowledge/qa_manager.py +++ b/src/chat/knowledge/qa_manager.py @@ -128,11 +128,10 @@ class QAManager: selected_knowledge = knowledge[:limit] formatted_knowledge = [ - f"第{i + 1}条知识:{k[0]}\n 该条知识对于问题的相关性:{k[1]}" - for i, k in enumerate(selected_knowledge) + f"第{i + 1}条知识:{k[0]}\n 该条知识对于问题的相关性:{k[1]}" for i, k in enumerate(selected_knowledge) ] # if max_score is not None: - # formatted_knowledge.insert(0, f"最高相关系数:{max_score}") + # formatted_knowledge.insert(0, f"最高相关系数:{max_score}") found_knowledge = "\n".join(formatted_knowledge) if len(found_knowledge) > MAX_KNOWLEDGE_LENGTH: diff --git a/src/chat/replyer/group_generator.py b/src/chat/replyer/group_generator.py index 3019ca0d..cc948db1 100644 --- a/src/chat/replyer/group_generator.py +++ b/src/chat/replyer/group_generator.py @@ -226,7 +226,9 @@ class DefaultReplyer: traceback.print_exc() return False, llm_response - async def build_expression_habits(self, chat_history: str, target: str, reply_reason: str = "") -> Tuple[str, List[int]]: + async def build_expression_habits( + self, chat_history: str, target: str, reply_reason: str = "" + ) -> Tuple[str, List[int]]: # sourcery skip: for-append-to-extend """构建表达习惯块 @@ -1094,10 +1096,10 @@ class DefaultReplyer: if not global_config.lpmm_knowledge.enable: logger.debug("LPMM知识库未启用,跳过获取知识库内容") return "" - + if global_config.lpmm_knowledge.lpmm_mode == "agent": return "" - + time_now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) bot_name = global_config.bot.nickname @@ -1115,10 +1117,10 @@ class DefaultReplyer: model_config=model_config.model_task_config.tool_use, tool_options=[SearchKnowledgeFromLPMMTool.get_tool_definition()], ) - + # logger.info(f"工具调用提示词: {prompt}") # logger.info(f"工具调用: {tool_calls}") - + if tool_calls: result = await self.tool_executor.execute_tool_call(tool_calls[0], SearchKnowledgeFromLPMMTool()) end_time = time.time() diff --git a/src/chat/replyer/private_generator.py b/src/chat/replyer/private_generator.py index 76eedf8c..74b04f6e 100644 --- a/src/chat/replyer/private_generator.py +++ b/src/chat/replyer/private_generator.py @@ -241,7 +241,9 @@ class PrivateReplyer: return f"{sender_relation}" - async def build_expression_habits(self, chat_history: str, target: str, reply_reason: str = "") -> Tuple[str, List[int]]: + async def build_expression_habits( + self, chat_history: str, target: str, reply_reason: str = "" + ) -> Tuple[str, List[int]]: # sourcery skip: for-append-to-extend """构建表达习惯块 @@ -1032,10 +1034,10 @@ class PrivateReplyer: if not global_config.lpmm_knowledge.enable: logger.debug("LPMM知识库未启用,跳过获取知识库内容") return "" - + if global_config.lpmm_knowledge.lpmm_mode == "agent": return "" - + time_now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) bot_name = global_config.bot.nickname diff --git a/src/chat/utils/chat_history_summarizer.py b/src/chat/utils/chat_history_summarizer.py index 36bb5ff0..f471781d 100644 --- a/src/chat/utils/chat_history_summarizer.py +++ b/src/chat/utils/chat_history_summarizer.py @@ -106,7 +106,7 @@ class ChatHistorySummarizer: await self._check_and_package(current_time) self.last_check_time = current_time return - + logger.info( f"{self.log_prefix} 开始处理聊天概括,时间窗口: {self.last_check_time:.2f} -> {current_time:.2f}" ) diff --git a/src/common/logger.py b/src/common/logger.py index 9e7e08d4..4cf40398 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -72,16 +72,16 @@ def get_ws_handler(): def initialize_ws_handler(loop): """初始化 WebSocket handler 的事件循环 - + Args: loop: asyncio 事件循环 """ handler = get_ws_handler() handler.set_loop(loop) - + # 为 WebSocket handler 设置 JSON 格式化器(与文件格式相同) handler.setFormatter(file_formatter) - + # 添加到根日志记录器 root_logger = logging.getLogger() if handler not in root_logger.handlers: @@ -177,43 +177,44 @@ class TimestampedFileHandler(logging.Handler): class WebSocketLogHandler(logging.Handler): """WebSocket 日志处理器 - 将日志实时推送到前端""" - + _log_counter = 0 # 类级别计数器,确保 ID 唯一性 - + def __init__(self, loop=None): super().__init__() self.loop = loop self._initialized = False - + def set_loop(self, loop): """设置事件循环""" self.loop = loop self._initialized = True - + def emit(self, record): """发送日志到 WebSocket 客户端""" if not self._initialized or self.loop is None: return - + try: # 获取格式化后的消息 # 对于 structlog,formatted message 包含完整的日志信息 formatted_msg = self.format(record) if self.formatter else record.getMessage() - + # 如果是 JSON 格式(文件格式化器),解析它 message = formatted_msg try: import json + log_dict = json.loads(formatted_msg) - message = log_dict.get('event', formatted_msg) + message = log_dict.get("event", formatted_msg) except (json.JSONDecodeError, ValueError): # 不是 JSON,直接使用消息 message = formatted_msg - + # 生成唯一 ID: 时间戳毫秒 + 自增计数器 WebSocketLogHandler._log_counter += 1 log_id = f"{int(record.created * 1000)}_{WebSocketLogHandler._log_counter}" - + # 格式化日志数据 log_data = { "id": log_id, @@ -222,20 +223,17 @@ class WebSocketLogHandler(logging.Handler): "module": record.name, "message": message, } - + # 异步广播日志(不阻塞日志记录) try: import asyncio from src.webui.logs_ws import broadcast_log - - asyncio.run_coroutine_threadsafe( - broadcast_log(log_data), - self.loop - ) + + asyncio.run_coroutine_threadsafe(broadcast_log(log_data), self.loop) except Exception: # WebSocket 推送失败不影响日志记录 pass - + except Exception: # 不要让 WebSocket 错误影响日志系统 self.handleError(record) @@ -255,7 +253,7 @@ def close_handlers(): if _console_handler: _console_handler.close() _console_handler = None - + if _ws_handler: _ws_handler.close() _ws_handler = None diff --git a/src/config/official_configs.py b/src/config/official_configs.py index 795b38cb..454f6976 100644 --- a/src/config/official_configs.py +++ b/src/config/official_configs.py @@ -647,7 +647,7 @@ class LPMMKnowledgeConfig(ConfigBase): enable: bool = True """是否启用LPMM知识库""" - + lpmm_mode: Literal["classic", "agent"] = "classic" """LPMM知识库模式,可选:classic经典模式,agent 模式,结合最新的记忆一同使用""" @@ -690,4 +690,4 @@ class JargonConfig(ConfigBase): """Jargon配置类""" all_global: bool = False - """是否将所有新增的jargon项目默认为全局(is_global=True),chat_id记录第一次存储时的id""" \ No newline at end of file + """是否将所有新增的jargon项目默认为全局(is_global=True),chat_id记录第一次存储时的id""" diff --git a/src/express/expression_learner.py b/src/express/expression_learner.py index 3bc14142..57c03e77 100644 --- a/src/express/expression_learner.py +++ b/src/express/expression_learner.py @@ -467,11 +467,7 @@ class ExpressionLearner: up_content: str, current_time: float, ) -> None: - expr_obj = ( - Expression.select() - .where((Expression.chat_id == self.chat_id) & (Expression.style == style)) - .first() - ) + expr_obj = Expression.select().where((Expression.chat_id == self.chat_id) & (Expression.style == style)).first() if expr_obj: await self._update_existing_expression( diff --git a/src/express/expression_selector.py b/src/express/expression_selector.py index 66c49def..b4e25f36 100644 --- a/src/express/expression_selector.py +++ b/src/express/expression_selector.py @@ -42,8 +42,6 @@ def init_prompt(): Prompt(expression_evaluation_prompt, "expression_evaluation_prompt") - - class ExpressionSelector: def __init__(self): self.llm_model = LLMRequest( @@ -238,9 +236,9 @@ class ExpressionSelector: else: target_message_str = "" target_message_extra_block = "" - + chat_context = f"以下是正在进行的聊天内容:{chat_info}" - + # 构建reply_reason块 if reply_reason: reply_reason_block = f"你的回复理由是:{reply_reason}" @@ -262,9 +260,8 @@ class ExpressionSelector: # 4. 调用LLM content, (reasoning_content, model_name, _) = await self.llm_model.generate_response_async(prompt=prompt) - # print(prompt) - + if not content: logger.warning("LLM返回空结果") return [], [] diff --git a/src/jargon/jargon_miner.py b/src/jargon/jargon_miner.py index 59d79df5..db1b79f9 100644 --- a/src/jargon/jargon_miner.py +++ b/src/jargon/jargon_miner.py @@ -36,10 +36,7 @@ def _contains_bot_self_name(content: str) -> bool: target = content.strip().lower() nickname = str(getattr(bot_config, "nickname", "") or "").strip().lower() - alias_names = [ - str(alias or "").strip().lower() - for alias in getattr(bot_config, "alias_names", []) or [] - ] + alias_names = [str(alias or "").strip().lower() for alias in getattr(bot_config, "alias_names", []) or []] candidates = [name for name in [nickname, *alias_names] if name] @@ -149,7 +146,7 @@ async def _enrich_raw_content_if_needed( ) -> List[str]: """ 检查raw_content是否只包含黑话本身,如果是,则获取该消息的前三条消息作为原始内容 - + Args: content: 黑话内容 raw_content_list: 原始raw_content列表 @@ -157,22 +154,22 @@ async def _enrich_raw_content_if_needed( messages: 当前时间窗口内的消息列表 extraction_start_time: 提取开始时间 extraction_end_time: 提取结束时间 - + Returns: 处理后的raw_content列表 """ enriched_list = [] - + for raw_content in raw_content_list: # 检查raw_content是否只包含黑话本身(去除空白字符后比较) raw_content_clean = raw_content.strip() content_clean = content.strip() - + # 如果raw_content只包含黑话本身(可能有一些标点或空白),则尝试获取上下文 # 去除所有空白字符后比较,确保只包含黑话本身 raw_content_normalized = raw_content_clean.replace(" ", "").replace("\n", "").replace("\t", "") content_normalized = content_clean.replace(" ", "").replace("\n", "").replace("\t", "") - + if raw_content_normalized == content_normalized: # 在消息列表中查找只包含该黑话的消息(去除空白后比较) target_message = None @@ -183,22 +180,20 @@ async def _enrich_raw_content_if_needed( if msg_content_normalized == content_normalized: target_message = msg break - + if target_message and target_message.time: # 获取该消息的前三条消息 try: previous_messages = get_raw_msg_before_timestamp_with_chat( - chat_id=chat_id, - timestamp=target_message.time, - limit=3 + chat_id=chat_id, timestamp=target_message.time, limit=3 ) - + if previous_messages: # 将前三条消息和当前消息一起格式化 context_messages = previous_messages + [target_message] # 按时间排序 context_messages.sort(key=lambda x: x.time or 0) - + # 格式化为可读消息 formatted_context, _ = await build_readable_messages_with_list( context_messages, @@ -206,7 +201,7 @@ async def _enrich_raw_content_if_needed( timestamp_mode="relative", truncate=False, ) - + if formatted_context.strip(): enriched_list.append(formatted_context.strip()) logger.warning(f"为黑话 {content} 补充了上下文消息") @@ -226,7 +221,7 @@ async def _enrich_raw_content_if_needed( else: # raw_content包含更多内容,直接使用 enriched_list.append(raw_content) - + return enriched_list @@ -240,31 +235,31 @@ def _should_infer_meaning(jargon_obj: Jargon) -> bool: # 如果已完成所有推断,不再推断 if jargon_obj.is_complete: return False - + count = jargon_obj.count or 0 last_inference = jargon_obj.last_inference_count or 0 - + # 阈值列表:3,6, 10, 20, 40, 60, 100 - thresholds = [3,6, 10, 20, 40, 60, 100] - + thresholds = [3, 6, 10, 20, 40, 60, 100] + if count < thresholds[0]: return False - + # 如果count没有超过上次判定值,不需要判定 if count <= last_inference: return False - + # 找到第一个大于last_inference的阈值 next_threshold = None for threshold in thresholds: if threshold > last_inference: next_threshold = threshold break - + # 如果没有找到下一个阈值,说明已经超过100,不应该再推断 if next_threshold is None: return False - + # 检查count是否达到或超过这个阈值 return count >= next_threshold @@ -275,13 +270,13 @@ class JargonMiner: self.last_learning_time: float = time.time() # 频率控制,可按需调整 self.min_messages_for_learning: int = 10 - self.min_learning_interval: float = 20 + self.min_learning_interval: float = 20 self.llm = LLMRequest( model_set=model_config.model_task_config.utils, request_type="jargon.extract", ) - + # 初始化stream_name作为类属性,避免重复提取 chat_manager = get_chat_manager() stream_name = chat_manager.get_stream_name(self.chat_id) @@ -306,17 +301,19 @@ class JargonMiner: try: content = jargon_obj.content raw_content_str = jargon_obj.raw_content or "" - + # 解析raw_content列表 raw_content_list = [] if raw_content_str: try: - raw_content_list = json.loads(raw_content_str) if isinstance(raw_content_str, str) else raw_content_str + raw_content_list = ( + json.loads(raw_content_str) if isinstance(raw_content_str, str) else raw_content_str + ) if not isinstance(raw_content_list, list): raw_content_list = [raw_content_list] if raw_content_list else [] except (json.JSONDecodeError, TypeError): raw_content_list = [raw_content_str] if raw_content_str else [] - + if not raw_content_list: logger.warning(f"jargon {content} 没有raw_content,跳过推断") return @@ -328,12 +325,12 @@ class JargonMiner: content=content, raw_content_list=raw_content_text, ) - + response1, _ = await self.llm.generate_response_async(prompt1, temperature=0.3) if not response1: logger.warning(f"jargon {content} 推断1失败:无响应") return - + # 解析推断1结果 inference1 = None try: @@ -349,7 +346,7 @@ class JargonMiner: except Exception as e: logger.error(f"jargon {content} 推断1解析失败: {e}") return - + # 检查推断1是否表示信息不足无法推断 no_info = inference1.get("no_info", False) meaning1 = inference1.get("meaning", "").strip() @@ -360,18 +357,17 @@ class JargonMiner: jargon_obj.save() return - # 步骤2: 仅基于content推断 prompt2 = await global_prompt_manager.format_prompt( "jargon_inference_content_only_prompt", content=content, ) - + response2, _ = await self.llm.generate_response_async(prompt2, temperature=0.3) if not response2: logger.warning(f"jargon {content} 推断2失败:无响应") return - + # 解析推断2结果 inference2 = None try: @@ -387,13 +383,12 @@ class JargonMiner: except Exception as e: logger.error(f"jargon {content} 推断2解析失败: {e}") return - logger.info(f"jargon {content} 推断2提示词: {prompt2}") logger.info(f"jargon {content} 推断2结果: {response2}") logger.info(f"jargon {content} 推断1提示词: {prompt1}") logger.info(f"jargon {content} 推断1结果: {response1}") - + if global_config.debug.show_jargon_prompt: logger.info(f"jargon {content} 推断2提示词: {prompt2}") logger.info(f"jargon {content} 推断2结果: {response2}") @@ -404,22 +399,22 @@ class JargonMiner: logger.debug(f"jargon {content} 推断2结果: {response2}") logger.debug(f"jargon {content} 推断1提示词: {prompt1}") logger.debug(f"jargon {content} 推断1结果: {response1}") - + # 步骤3: 比较两个推断结果 prompt3 = await global_prompt_manager.format_prompt( "jargon_compare_inference_prompt", inference1=json.dumps(inference1, ensure_ascii=False), inference2=json.dumps(inference2, ensure_ascii=False), ) - + if global_config.debug.show_jargon_prompt: logger.info(f"jargon {content} 比较提示词: {prompt3}") - + response3, _ = await self.llm.generate_response_async(prompt3, temperature=0.3) if not response3: logger.warning(f"jargon {content} 比较失败:无响应") return - + # 解析比较结果 comparison = None try: @@ -439,7 +434,7 @@ class JargonMiner: # 判断是否为黑话 is_similar = comparison.get("is_similar", False) is_jargon = not is_similar # 如果相似,说明不是黑话;如果有差异,说明是黑话 - + # 更新数据库记录 jargon_obj.is_jargon = is_jargon if is_jargon: @@ -448,17 +443,19 @@ class JargonMiner: else: # 不是黑话,也记录含义(使用推断2的结果,因为含义明确) jargon_obj.meaning = inference2.get("meaning", "") - + # 更新最后一次判定的count值,避免重启后重复判定 jargon_obj.last_inference_count = jargon_obj.count or 0 - + # 如果count>=100,标记为完成,不再进行推断 if (jargon_obj.count or 0) >= 100: jargon_obj.is_complete = True - + jargon_obj.save() - logger.debug(f"jargon {content} 推断完成: is_jargon={is_jargon}, meaning={jargon_obj.meaning}, last_inference_count={jargon_obj.last_inference_count}, is_complete={jargon_obj.is_complete}") - + logger.debug( + f"jargon {content} 推断完成: is_jargon={is_jargon}, meaning={jargon_obj.meaning}, last_inference_count={jargon_obj.last_inference_count}, is_complete={jargon_obj.is_complete}" + ) + # 固定输出推断结果,格式化为可读形式 if is_jargon: # 是黑话,输出格式:[聊天名]xxx的含义是 xxxxxxxxxxx @@ -471,10 +468,11 @@ class JargonMiner: else: # 不是黑话,输出格式:[聊天名]xxx 不是黑话 logger.info(f"[{self.stream_name}]{content} 不是黑话") - + except Exception as e: logger.error(f"jargon推断失败: {e}") import traceback + traceback.print_exc() def should_trigger(self) -> bool: @@ -502,7 +500,7 @@ class JargonMiner: # 记录本次提取的时间窗口,避免重复提取 extraction_start_time = self.last_learning_time extraction_end_time = time.time() - + # 拉取学习窗口内的消息 messages = get_raw_msg_by_timestamp_with_chat_inclusive( chat_id=self.chat_id, @@ -525,7 +523,7 @@ class JargonMiner: response, _ = await self.llm.generate_response_async(prompt, temperature=0.2) if not response: return - + if global_config.debug.show_jargon_prompt: logger.info(f"jargon提取提示词: {prompt}") logger.info(f"jargon提取结果: {response}") @@ -555,7 +553,7 @@ class JargonMiner: continue content = str(item.get("content", "")).strip() raw_content_value = item.get("raw_content", "") - + # 处理raw_content:可能是字符串或列表 raw_content_list = [] if isinstance(raw_content_value, list): @@ -566,15 +564,12 @@ class JargonMiner: raw_content_str = raw_content_value.strip() if raw_content_str: raw_content_list = [raw_content_str] - + if content and raw_content_list: if _contains_bot_self_name(content): logger.debug(f"解析阶段跳过包含机器人昵称/别名的词条: {content}") continue - entries.append({ - "content": content, - "raw_content": raw_content_list - }) + entries.append({"content": content, "raw_content": raw_content_list}) except Exception as e: logger.error(f"解析jargon JSON失败: {e}; 原始: {response}") return @@ -591,13 +586,13 @@ class JargonMiner: if content_key not in seen: seen.add(content_key) uniq_entries.append(entry) - + saved = 0 updated = 0 for entry in uniq_entries: content = entry["content"] raw_content_list = entry["raw_content"] # 已经是列表 - + # 检查并补充raw_content:如果只包含黑话本身,则获取前三条消息作为上下文 raw_content_list = await _enrich_raw_content_if_needed( content=content, @@ -607,60 +602,53 @@ class JargonMiner: extraction_start_time=extraction_start_time, extraction_end_time=extraction_end_time, ) - + try: # 根据all_global配置决定查询逻辑 if global_config.jargon.all_global: # 开启all_global:无视chat_id,查询所有content匹配的记录(所有记录都是全局的) - query = ( - Jargon.select() - .where(Jargon.content == content) - ) + query = Jargon.select().where(Jargon.content == content) else: # 关闭all_global:只查询chat_id匹配的记录(不考虑is_global) - query = ( - Jargon.select() - .where( - (Jargon.chat_id == self.chat_id) & - (Jargon.content == content) - ) - ) - + query = Jargon.select().where((Jargon.chat_id == self.chat_id) & (Jargon.content == content)) + if query.exists(): obj = query.get() try: obj.count = (obj.count or 0) + 1 except Exception: obj.count = 1 - + # 合并raw_content列表:读取现有列表,追加新值,去重 existing_raw_content = [] if obj.raw_content: try: - existing_raw_content = json.loads(obj.raw_content) if isinstance(obj.raw_content, str) else obj.raw_content + existing_raw_content = ( + json.loads(obj.raw_content) if isinstance(obj.raw_content, str) else obj.raw_content + ) if not isinstance(existing_raw_content, list): existing_raw_content = [existing_raw_content] if existing_raw_content else [] except (json.JSONDecodeError, TypeError): existing_raw_content = [obj.raw_content] if obj.raw_content else [] - + # 合并并去重 merged_list = list(dict.fromkeys(existing_raw_content + raw_content_list)) obj.raw_content = json.dumps(merged_list, ensure_ascii=False) - + # 开启all_global时,确保记录标记为is_global=True if global_config.jargon.all_global: obj.is_global = True # 关闭all_global时,保持原有is_global不变(不修改) - + obj.save() - + # 检查是否需要推断(达到阈值且超过上次判定值) if _should_infer_meaning(obj): # 异步触发推断,不阻塞主流程 # 重新加载对象以确保数据最新 jargon_id = obj.id asyncio.create_task(self._infer_meaning_by_id(jargon_id)) - + updated += 1 else: # 没找到匹配记录,创建新记录 @@ -670,13 +658,13 @@ class JargonMiner: else: # 关闭all_global:新记录is_global=False is_global_new = False - + Jargon.create( content=content, raw_content=json.dumps(raw_content_list, ensure_ascii=False), chat_id=self.chat_id, is_global=is_global_new, - count=1 + count=1, ) saved += 1 except Exception as e: @@ -688,13 +676,13 @@ class JargonMiner: # 收集所有提取的jargon内容 jargon_list = [entry["content"] for entry in uniq_entries] jargon_str = ",".join(jargon_list) - + # 输出格式化的结果(使用logger.info会自动应用jargon模块的颜色) logger.info(f"[{self.stream_name}]疑似黑话: {jargon_str}") - + # 更新为本次提取的结束时间,确保不会重复提取相同的消息窗口 self.last_learning_time = extraction_end_time - + if saved or updated: logger.info(f"jargon写入: 新增 {saved} 条,更新 {updated} 条,chat_id={self.chat_id}") except Exception as e: @@ -720,15 +708,11 @@ async def extract_and_store_jargon(chat_id: str) -> None: def search_jargon( - keyword: str, - chat_id: Optional[str] = None, - limit: int = 10, - case_sensitive: bool = False, - fuzzy: bool = True + keyword: str, chat_id: Optional[str] = None, limit: int = 10, case_sensitive: bool = False, fuzzy: bool = True ) -> List[Dict[str, str]]: """ 搜索jargon,支持大小写不敏感和模糊搜索 - + Args: keyword: 搜索关键词 chat_id: 可选的聊天ID @@ -737,21 +721,18 @@ def search_jargon( limit: 返回结果数量限制,默认10 case_sensitive: 是否大小写敏感,默认False(不敏感) fuzzy: 是否模糊搜索,默认True(使用LIKE匹配) - + Returns: List[Dict[str, str]]: 包含content, meaning的字典列表 """ if not keyword or not keyword.strip(): return [] - + keyword = keyword.strip() - + # 构建查询 - query = Jargon.select( - Jargon.content, - Jargon.meaning - ) - + query = Jargon.select(Jargon.content, Jargon.meaning) + # 构建搜索条件 if case_sensitive: # 大小写敏感 @@ -760,7 +741,7 @@ def search_jargon( search_condition = Jargon.content.contains(keyword) else: # 精确匹配 - search_condition = (Jargon.content == keyword) + search_condition = Jargon.content == keyword else: # 大小写不敏感 if fuzzy: @@ -768,10 +749,10 @@ def search_jargon( search_condition = fn.LOWER(Jargon.content).contains(keyword.lower()) else: # 精确匹配(使用LOWER函数) - search_condition = (fn.LOWER(Jargon.content) == keyword.lower()) - + search_condition = fn.LOWER(Jargon.content) == keyword.lower() + query = query.where(search_condition) - + # 根据all_global配置决定查询逻辑 if global_config.jargon.all_global: # 开启all_global:所有记录都是全局的,查询所有is_global=True的记录(无视chat_id) @@ -779,35 +760,28 @@ def search_jargon( else: # 关闭all_global:如果提供了chat_id,优先搜索该聊天或global的jargon if chat_id: - query = query.where( - (Jargon.chat_id == chat_id) | Jargon.is_global - ) - + query = query.where((Jargon.chat_id == chat_id) | Jargon.is_global) + # 只返回有meaning的记录 - query = query.where( - (Jargon.meaning.is_null(False)) & (Jargon.meaning != "") - ) - + query = query.where((Jargon.meaning.is_null(False)) & (Jargon.meaning != "")) + # 按count降序排序,优先返回出现频率高的 query = query.order_by(Jargon.count.desc()) - + # 限制结果数量 query = query.limit(limit) - + # 执行查询并返回结果 results = [] for jargon in query: - results.append({ - "content": jargon.content or "", - "meaning": jargon.meaning or "" - }) - + results.append({"content": jargon.content or "", "meaning": jargon.meaning or ""}) + return results async def store_jargon_from_answer(jargon_keyword: str, answer: str, chat_id: str) -> None: """将黑话存入jargon系统 - + Args: jargon_keyword: 黑话关键词 answer: 答案内容(将概括为raw_content) @@ -820,53 +794,52 @@ async def store_jargon_from_answer(jargon_keyword: str, answer: str, chat_id: st 答案:{answer} 只输出概括后的内容,不要输出其他内容:""" - + success, summary, _, _ = await llm_api.generate_with_model( summary_prompt, model_config=model_config.model_task_config.utils_small, request_type="memory.summarize_jargon", ) - + logger.info(f"概括答案提示: {summary_prompt}") logger.info(f"概括答案: {summary}") - + if not success: logger.warning(f"概括答案失败,使用原始答案: {summary}") summary = answer[:100] # 截取前100字符作为备用 - + raw_content = summary.strip()[:200] # 限制长度 - + # 检查是否已存在 if global_config.jargon.all_global: query = Jargon.select().where(Jargon.content == jargon_keyword) else: - query = Jargon.select().where( - (Jargon.chat_id == chat_id) & - (Jargon.content == jargon_keyword) - ) - + query = Jargon.select().where((Jargon.chat_id == chat_id) & (Jargon.content == jargon_keyword)) + if query.exists(): # 更新现有记录 obj = query.get() obj.count = (obj.count or 0) + 1 - + # 合并raw_content列表 existing_raw_content = [] if obj.raw_content: try: - existing_raw_content = json.loads(obj.raw_content) if isinstance(obj.raw_content, str) else obj.raw_content + existing_raw_content = ( + json.loads(obj.raw_content) if isinstance(obj.raw_content, str) else obj.raw_content + ) if not isinstance(existing_raw_content, list): existing_raw_content = [existing_raw_content] if existing_raw_content else [] except (json.JSONDecodeError, TypeError): existing_raw_content = [obj.raw_content] if obj.raw_content else [] - + # 合并并去重 merged_list = list(dict.fromkeys(existing_raw_content + [raw_content])) obj.raw_content = json.dumps(merged_list, ensure_ascii=False) - + if global_config.jargon.all_global: obj.is_global = True - + obj.save() logger.info(f"更新jargon记录: {jargon_keyword}") else: @@ -877,11 +850,9 @@ async def store_jargon_from_answer(jargon_keyword: str, answer: str, chat_id: st raw_content=json.dumps([raw_content], ensure_ascii=False), chat_id=chat_id, is_global=is_global_new, - count=1 + count=1, ) logger.info(f"创建新jargon记录: {jargon_keyword}") - + except Exception as e: logger.error(f"存储jargon失败: {e}") - - diff --git a/src/llm_models/model_client/gemini_client.py b/src/llm_models/model_client/gemini_client.py index 444c5671..b3fafca0 100644 --- a/src/llm_models/model_client/gemini_client.py +++ b/src/llm_models/model_client/gemini_client.py @@ -147,7 +147,7 @@ def _convert_tool_options(tool_options: list[ToolOption]) -> list[FunctionDeclar param_type_value = tool_option_param.param_type.value if param_type_value == "bool": param_type_value = "boolean" - + return_dict: dict[str, Any] = { "type": param_type_value, "description": tool_option_param.description, diff --git a/src/llm_models/model_client/openai_client.py b/src/llm_models/model_client/openai_client.py index 01e12588..f573d33e 100644 --- a/src/llm_models/model_client/openai_client.py +++ b/src/llm_models/model_client/openai_client.py @@ -122,7 +122,7 @@ def _convert_tool_options(tool_options: list[ToolOption]) -> list[dict[str, Any] param_type_value = tool_option_param.param_type.value if param_type_value == "bool": param_type_value = "boolean" - + return_dict: dict[str, Any] = { "type": param_type_value, "description": tool_option_param.description, diff --git a/src/llm_models/payload_content/message.py b/src/llm_models/payload_content/message.py index ddcdf57f..960de08b 100644 --- a/src/llm_models/payload_content/message.py +++ b/src/llm_models/payload_content/message.py @@ -116,9 +116,7 @@ class MessageBuilder: 构建消息对象 :return: Message对象 """ - if len(self.__content) == 0 and not ( - self.__role == RoleType.Assistant and self.__tool_calls - ): + if len(self.__content) == 0 and not (self.__role == RoleType.Assistant and self.__tool_calls): raise ValueError("内容不能为空") if self.__role == RoleType.Tool and self.__tool_call_id is None: raise ValueError("Tool角色的工具调用ID不能为空") diff --git a/src/llm_models/utils_model.py b/src/llm_models/utils_model.py index 28f63c11..1ed74e03 100644 --- a/src/llm_models/utils_model.py +++ b/src/llm_models/utils_model.py @@ -166,7 +166,7 @@ class LLMRequest: time_cost=time.time() - start_time, ) return content or "", (reasoning_content, model_info.name, tool_calls) - + async def generate_response_with_message_async( self, message_factory: Callable[[BaseClient], List[Message]], diff --git a/src/main.py b/src/main.py index a75d4d26..b442f29d 100644 --- a/src/main.py +++ b/src/main.py @@ -36,10 +36,10 @@ class MainSystem: # 使用消息API替代直接的FastAPI实例 self.app: MessageServer = get_global_api() self.server: Server = get_global_server() - + # 注册 WebUI API 路由 self._register_webui_routes() - + # 设置 WebUI(开发/生产模式) self._setup_webui() @@ -47,6 +47,7 @@ class MainSystem: """注册 WebUI API 路由""" try: from src.webui.routes import router as webui_router + self.server.register_router(webui_router) logger.info("WebUI API 路由已注册") except Exception as e: @@ -55,15 +56,17 @@ class MainSystem: def _setup_webui(self): """设置 WebUI(根据环境变量决定模式)""" import os + webui_enabled = os.getenv("WEBUI_ENABLED", "false").lower() == "true" if not webui_enabled: logger.info("WebUI 已禁用") return - + webui_mode = os.getenv("WEBUI_MODE", "production").lower() - + try: from src.webui.manager import setup_webui + setup_webui(mode=webui_mode) except Exception as e: logger.error(f"设置 WebUI 失败: {e}") diff --git a/src/memory_system/memory_retrieval.py b/src/memory_system/memory_retrieval.py index e1562b6e..e9187eb0 100644 --- a/src/memory_system/memory_retrieval.py +++ b/src/memory_system/memory_retrieval.py @@ -17,26 +17,23 @@ from src.llm_models.payload_content.message import MessageBuilder, RoleType, Mes logger = get_logger("memory_retrieval") THINKING_BACK_NOT_FOUND_RETENTION_SECONDS = 3600 # 未找到答案记录保留时长 -THINKING_BACK_CLEANUP_INTERVAL_SECONDS = 300 # 清理频率 +THINKING_BACK_CLEANUP_INTERVAL_SECONDS = 300 # 清理频率 _last_not_found_cleanup_ts: float = 0.0 def _cleanup_stale_not_found_thinking_back() -> None: """定期清理过期的未找到答案记录""" global _last_not_found_cleanup_ts - + now = time.time() if now - _last_not_found_cleanup_ts < THINKING_BACK_CLEANUP_INTERVAL_SECONDS: return - + threshold_time = now - THINKING_BACK_NOT_FOUND_RETENTION_SECONDS try: deleted_rows = ( ThinkingBack.delete() - .where( - (ThinkingBack.found_answer == 0) & - (ThinkingBack.update_time < threshold_time) - ) + .where((ThinkingBack.found_answer == 0) & (ThinkingBack.update_time < threshold_time)) .execute() ) if deleted_rows: @@ -45,11 +42,12 @@ def _cleanup_stale_not_found_thinking_back() -> None: except Exception as e: logger.error(f"清理未找到答案的thinking_back记录失败: {e}") + def init_memory_retrieval_prompt(): """初始化记忆检索相关的 prompt 模板和工具""" # 首先注册所有工具 init_all_tools() - + # 第一步:问题生成prompt Prompt( """ @@ -102,7 +100,7 @@ def init_memory_retrieval_prompt(): """, name="memory_retrieval_question_prompt", ) - + # 第二步:ReAct Agent prompt(使用function calling,要求先思考再行动) Prompt( """你的名字是{bot_name}。现在是{time_now}。 @@ -140,7 +138,7 @@ def init_memory_retrieval_prompt(): """, name="memory_retrieval_react_prompt_head", ) - + # 额外,如果最后一轮迭代:ReAct Agent prompt(使用function calling,要求先思考再行动) Prompt( """你的名字是{bot_name}。现在是{time_now}。 @@ -170,10 +168,10 @@ def init_memory_retrieval_prompt(): def _parse_react_response(response: str) -> Optional[Dict[str, Any]]: """解析ReAct Agent的响应 - + Args: response: LLM返回的响应 - + Returns: Dict[str, Any]: 解析后的动作信息,如果解析失败返回None 格式: {"thought": str, "actions": List[Dict[str, Any]]} @@ -183,90 +181,75 @@ def _parse_react_response(response: str) -> Optional[Dict[str, Any]]: # 尝试提取JSON(可能包含在```json代码块中) json_pattern = r"```json\s*(.*?)\s*```" matches = re.findall(json_pattern, response, re.DOTALL) - + if matches: json_str = matches[0] else: # 尝试直接解析整个响应 json_str = response.strip() - + # 修复可能的JSON错误 repaired_json = repair_json(json_str) - + # 解析JSON action_info = json.loads(repaired_json) - + if not isinstance(action_info, dict): logger.warning(f"解析的JSON不是对象格式: {action_info}") return None - + # 确保actions字段存在且为列表 if "actions" not in action_info: logger.warning(f"响应中缺少actions字段: {action_info}") return None - + if not isinstance(action_info["actions"], list): logger.warning(f"actions字段不是数组格式: {action_info['actions']}") return None - + # 确保actions不为空 if len(action_info["actions"]) == 0: logger.warning("actions数组为空") return None - + return action_info - + except Exception as e: logger.error(f"解析ReAct响应失败: {e}, 响应内容: {response[:200]}...") return None -async def _retrieve_concepts_with_jargon( - concepts: List[str], - chat_id: str -) -> str: +async def _retrieve_concepts_with_jargon(concepts: List[str], chat_id: str) -> str: """对概念列表进行jargon检索 - + Args: concepts: 概念列表 chat_id: 聊天ID - + Returns: str: 检索结果字符串 """ if not concepts: return "" - + from src.jargon.jargon_miner import search_jargon - + results = [] for concept in concepts: concept = concept.strip() if not concept: continue - + # 先尝试精确匹配 - jargon_results = search_jargon( - keyword=concept, - chat_id=chat_id, - limit=10, - case_sensitive=False, - fuzzy=False - ) - + jargon_results = search_jargon(keyword=concept, chat_id=chat_id, limit=10, case_sensitive=False, fuzzy=False) + is_fuzzy_match = False - + # 如果精确匹配未找到,尝试模糊搜索 if not jargon_results: - jargon_results = search_jargon( - keyword=concept, - chat_id=chat_id, - limit=10, - case_sensitive=False, - fuzzy=True - ) + jargon_results = search_jargon(keyword=concept, chat_id=chat_id, limit=10, case_sensitive=False, fuzzy=True) is_fuzzy_match = True - + if jargon_results: # 找到结果 if is_fuzzy_match: @@ -291,28 +274,24 @@ async def _retrieve_concepts_with_jargon( else: # 未找到,不返回占位信息,只记录日志 logger.info(f"在jargon库中未找到匹配: {concept}") - + if results: return "【概念检索结果】\n" + "\n".join(results) + "\n" return "" async def _react_agent_solve_question( - question: str, - chat_id: str, - max_iterations: int = 5, - timeout: float = 30.0, - initial_info: str = "" + question: str, chat_id: str, max_iterations: int = 5, timeout: float = 30.0, initial_info: str = "" ) -> Tuple[bool, str, List[Dict[str, Any]], bool]: """使用ReAct架构的Agent来解决问题 - + Args: question: 要回答的问题 chat_id: 聊天ID max_iterations: 最大迭代次数 timeout: 超时时间(秒) initial_info: 初始信息(如概念检索结果),将作为collected_info的初始值 - + Returns: Tuple[bool, str, List[Dict[str, Any]], bool]: (是否找到答案, 答案内容, 思考步骤列表, 是否超时) """ @@ -321,34 +300,35 @@ async def _react_agent_solve_question( thinking_steps = [] is_timeout = False conversation_messages: List[Message] = [] - + for iteration in range(max_iterations): # 检查超时 if time.time() - start_time > timeout: logger.warning(f"ReAct Agent超时,已迭代{iteration}次") is_timeout = True break - + # 获取工具注册器 tool_registry = get_tool_registry() - + # 获取bot_name bot_name = global_config.bot.nickname - + # 获取当前时间 time_now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) - + # 计算剩余迭代次数 current_iteration = iteration + 1 remaining_iterations = max_iterations - current_iteration is_final_iteration = current_iteration >= max_iterations - - + if is_final_iteration: # 最后一次迭代,使用最终prompt tool_definitions = [] - logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代,问题: {question}|可用工具数量: 0(最后一次迭代,不提供工具调用)") - + logger.info( + f"ReAct Agent 第 {iteration + 1} 次迭代,问题: {question}|可用工具数量: 0(最后一次迭代,不提供工具调用)" + ) + prompt = await global_prompt_manager.format_prompt( "memory_retrieval_react_final_prompt", bot_name=bot_name, @@ -359,7 +339,7 @@ async def _react_agent_solve_question( remaining_iterations=remaining_iterations, max_iterations=max_iterations, ) - + logger.info(f"ReAct Agent 第 {iteration + 1} 次Prompt: {prompt}") success, response, reasoning_content, model_name, tool_calls = await llm_api.generate_with_model_with_tools( prompt, @@ -370,7 +350,9 @@ async def _react_agent_solve_question( else: # 非最终迭代,使用head_prompt tool_definitions = tool_registry.get_tool_definitions() - logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代,问题: {question}|可用工具数量: {len(tool_definitions)}") + logger.info( + f"ReAct Agent 第 {iteration + 1} 次迭代,问题: {question}|可用工具数量: {len(tool_definitions)}" + ) head_prompt = await global_prompt_manager.format_prompt( "memory_retrieval_react_prompt_head", @@ -397,12 +379,12 @@ async def _react_agent_solve_question( messages.append(system_builder.build()) messages.extend(_conversation_messages) - + # 优化日志展示 - 合并所有消息到一条日志 log_lines = [] for idx, msg in enumerate(messages, 1): - role_name = msg.role.value if hasattr(msg.role, 'value') else str(msg.role) - + role_name = msg.role.value if hasattr(msg.role, "value") else str(msg.role) + # 处理内容 - 显示完整内容,不截断 if isinstance(msg.content, str): full_content = msg.content @@ -415,37 +397,45 @@ async def _react_agent_solve_question( else: full_content = str(msg.content) content_type = "未知" - + # 构建单条消息的日志信息 msg_info = f"\n[消息 {idx}] 角色: {role_name} 内容类型: {content_type}\n========================================" - + if full_content: msg_info += f"\n{full_content}" - + if msg.tool_calls: msg_info += f"\n 工具调用: {len(msg.tool_calls)}个" for tool_call in msg.tool_calls: msg_info += f"\n - {tool_call}" - + if msg.tool_call_id: msg_info += f"\n 工具调用ID: {msg.tool_call_id}" - + log_lines.append(msg_info) - + # 合并所有消息为一条日志输出 logger.info(f"消息列表 (共{len(messages)}条):{''.join(log_lines)}") return messages - success, response, reasoning_content, model_name, tool_calls = await llm_api.generate_with_model_with_tools_by_message_factory( + ( + success, + response, + reasoning_content, + model_name, + tool_calls, + ) = await llm_api.generate_with_model_with_tools_by_message_factory( message_factory, model_config=model_config.model_task_config.tool_use, tool_options=tool_definitions, request_type="memory.react", ) - - logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代 模型: {model_name} ,调用工具数量: {len(tool_calls) if tool_calls else 0} ,调用工具响应: {response}") - + + logger.info( + f"ReAct Agent 第 {iteration + 1} 次迭代 模型: {model_name} ,调用工具数量: {len(tool_calls) if tool_calls else 0} ,调用工具响应: {response}" + ) + if not success: logger.error(f"ReAct Agent LLM调用失败: {response}") break @@ -463,105 +453,108 @@ async def _react_agent_solve_question( assistant_builder.set_role(RoleType.Assistant) assistant_builder.add_text_content(response) assistant_message = assistant_builder.build() - + # 记录思考步骤 - step = { - "iteration": iteration + 1, - "thought": response, - "actions": [], - "observations": [] - } - + step = {"iteration": iteration + 1, "thought": response, "actions": [], "observations": []} + # 优先从思考内容中提取found_answer或not_enough_info def extract_quoted_content(text, func_name, param_name): """从文本中提取函数调用中参数的值,支持单引号和双引号 - + Args: text: 要搜索的文本 func_name: 函数名,如 'found_answer' param_name: 参数名,如 'answer' - + Returns: 提取的参数值,如果未找到则返回None """ if not text: return None - + # 查找函数调用位置(不区分大小写) func_pattern = func_name.lower() text_lower = text.lower() func_pos = text_lower.find(func_pattern) if func_pos == -1: return None - + # 查找参数名和等号 - param_pattern = f'{param_name}=' + param_pattern = f"{param_name}=" param_pos = text_lower.find(param_pattern, func_pos) if param_pos == -1: return None - + # 跳过参数名、等号和空白 start_pos = param_pos + len(param_pattern) - while start_pos < len(text) and text[start_pos] in ' \t\n': + while start_pos < len(text) and text[start_pos] in " \t\n": start_pos += 1 - + if start_pos >= len(text): return None - + # 确定引号类型 quote_char = text[start_pos] if quote_char not in ['"', "'"]: return None - + # 查找匹配的结束引号(考虑转义) end_pos = start_pos + 1 while end_pos < len(text): if text[end_pos] == quote_char: # 检查是否是转义的引号 - if end_pos > start_pos + 1 and text[end_pos - 1] == '\\': + if end_pos > start_pos + 1 and text[end_pos - 1] == "\\": end_pos += 1 continue # 找到匹配的引号 - content = text[start_pos + 1:end_pos] + content = text[start_pos + 1 : end_pos] # 处理转义字符 - content = content.replace('\\"', '"').replace("\\'", "'").replace('\\\\', '\\') + content = content.replace('\\"', '"').replace("\\'", "'").replace("\\\\", "\\") return content end_pos += 1 - + return None - + # 从LLM的直接输出内容中提取found_answer或not_enough_info found_answer_content = None not_enough_info_reason = None - + # 只检查response(LLM的直接输出内容),不检查reasoning_content if response: - found_answer_content = extract_quoted_content(response, 'found_answer', 'answer') + found_answer_content = extract_quoted_content(response, "found_answer", "answer") if not found_answer_content: - not_enough_info_reason = extract_quoted_content(response, 'not_enough_info', 'reason') - + not_enough_info_reason = extract_quoted_content(response, "not_enough_info", "reason") + # 如果从输出内容中找到了答案,直接返回 if found_answer_content: step["actions"].append({"action_type": "found_answer", "action_params": {"answer": found_answer_content}}) step["observations"] = ["从LLM输出内容中检测到found_answer"] thinking_steps.append(step) - logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代 从LLM输出内容中检测到found_answer: {found_answer_content[:100]}...") + logger.info( + f"ReAct Agent 第 {iteration + 1} 次迭代 从LLM输出内容中检测到found_answer: {found_answer_content[:100]}..." + ) return True, found_answer_content, thinking_steps, False - + if not_enough_info_reason: - step["actions"].append({"action_type": "not_enough_info", "action_params": {"reason": not_enough_info_reason}}) + step["actions"].append( + {"action_type": "not_enough_info", "action_params": {"reason": not_enough_info_reason}} + ) step["observations"] = ["从LLM输出内容中检测到not_enough_info"] thinking_steps.append(step) - logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代 从LLM输出内容中检测到not_enough_info: {not_enough_info_reason[:100]}...") + logger.info( + f"ReAct Agent 第 {iteration + 1} 次迭代 从LLM输出内容中检测到not_enough_info: {not_enough_info_reason[:100]}..." + ) return False, not_enough_info_reason, thinking_steps, False - + if is_final_iteration: - step["actions"].append({"action_type": "not_enough_info", "action_params": {"reason": "已到达最后一次迭代,无法找到答案"}}) + step["actions"].append( + {"action_type": "not_enough_info", "action_params": {"reason": "已到达最后一次迭代,无法找到答案"}} + ) step["observations"] = ["已到达最后一次迭代,无法找到答案"] thinking_steps.append(step) logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代 已到达最后一次迭代,无法找到答案") return False, "已到达最后一次迭代,无法找到答案", thinking_steps, False - + if assistant_message: conversation_messages.append(assistant_message) @@ -570,7 +563,7 @@ async def _react_agent_solve_question( thought_summary = reasoning_content or (response[:200] if response else "") if thought_summary: collected_info += f"\n[思考] {thought_summary}\n" - + # 处理工具调用 if not tool_calls: # 没有工具调用,说明LLM在思考中已经给出了答案(已在前面检查),或者需要继续查询 @@ -588,28 +581,31 @@ async def _react_agent_solve_question( step["observations"] = ["无响应且无工具调用"] thinking_steps.append(step) break - + # 处理工具调用 tool_tasks = [] - + for i, tool_call in enumerate(tool_calls): tool_name = tool_call.func_name tool_args = tool_call.args or {} - - logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代 工具调用 {i+1}/{len(tool_calls)}: {tool_name}({tool_args})") - + + logger.info( + f"ReAct Agent 第 {iteration + 1} 次迭代 工具调用 {i + 1}/{len(tool_calls)}: {tool_name}({tool_args})" + ) + # 普通工具调用 tool = tool_registry.get_tool(tool_name) if tool: # 准备工具参数(需要添加chat_id如果工具需要) tool_params = tool_args.copy() - + # 如果工具函数签名需要chat_id,添加它 import inspect + sig = inspect.signature(tool.execute_func) if "chat_id" in sig.parameters: tool_params["chat_id"] = chat_id - + # 创建异步任务 async def execute_single_tool(tool_instance, params, tool_name_str, iter_num): try: @@ -620,23 +616,23 @@ async def _react_agent_solve_question( error_msg = f"工具执行失败: {str(e)}" logger.error(f"ReAct Agent 第 {iter_num + 1} 次迭代 工具 {tool_name_str} {error_msg}") return f"查询{tool_name_str}失败: {error_msg}" - + tool_tasks.append(execute_single_tool(tool, tool_params, tool_name, iteration)) step["actions"].append({"action_type": tool_name, "action_params": tool_args}) else: error_msg = f"未知的工具类型: {tool_name}" - logger.warning(f"ReAct Agent 第 {iteration + 1} 次迭代 工具 {i+1}/{len(tool_calls)} {error_msg}") + logger.warning(f"ReAct Agent 第 {iteration + 1} 次迭代 工具 {i + 1}/{len(tool_calls)} {error_msg}") tool_tasks.append(asyncio.create_task(asyncio.sleep(0, result=f"查询{tool_name}失败: {error_msg}"))) - + # 并行执行所有工具 if tool_tasks: observations = await asyncio.gather(*tool_tasks, return_exceptions=True) - + # 处理执行结果 for i, (tool_call_item, observation) in enumerate(zip(tool_calls, observations, strict=False)): if isinstance(observation, Exception): observation = f"工具执行异常: {str(observation)}" - logger.error(f"ReAct Agent 第 {iteration + 1} 次迭代 工具 {i+1} 执行异常: {observation}") + logger.error(f"ReAct Agent 第 {iteration + 1} 次迭代 工具 {i + 1} 执行异常: {observation}") observation_text = observation if isinstance(observation, str) else str(observation) step["observations"].append(observation_text) @@ -648,14 +644,16 @@ async def _react_agent_solve_question( tool_builder.add_tool_call(tool_call_item.call_id) conversation_messages.append(tool_builder.build()) # logger.info(f"ReAct Agent 第 {iteration + 1} 次迭代 工具 {i+1} 执行结果: {observation_text}") - + thinking_steps.append(step) - + # 达到最大迭代次数或超时,但Agent没有明确返回found_answer # 迭代超时应该直接视为not_enough_info,而不是使用已有信息 # 只有Agent明确返回found_answer时,才认为找到了答案 if collected_info: - logger.warning(f"ReAct Agent达到最大迭代次数或超时,但未明确返回found_answer。已收集信息: {collected_info[:100]}...") + logger.warning( + f"ReAct Agent达到最大迭代次数或超时,但未明确返回found_answer。已收集信息: {collected_info[:100]}..." + ) if is_timeout: logger.warning("ReAct Agent超时,直接视为not_enough_info") else: @@ -665,35 +663,32 @@ async def _react_agent_solve_question( def _get_recent_query_history(chat_id: str, time_window_seconds: float = 300.0) -> str: """获取最近一段时间内的查询历史 - + Args: chat_id: 聊天ID time_window_seconds: 时间窗口(秒),默认10分钟 - + Returns: str: 格式化的查询历史字符串 """ try: current_time = time.time() start_time = current_time - time_window_seconds - + # 查询最近时间窗口内的记录,按更新时间倒序 records = ( ThinkingBack.select() - .where( - (ThinkingBack.chat_id == chat_id) & - (ThinkingBack.update_time >= start_time) - ) + .where((ThinkingBack.chat_id == chat_id) & (ThinkingBack.update_time >= start_time)) .order_by(ThinkingBack.update_time.desc()) .limit(5) # 最多返回5条最近的记录 ) - + if not records.exists(): return "" - + history_lines = [] history_lines.append("最近已查询的问题和结果:") - + for record in records: status = "✓ 已找到答案" if record.found_answer else "✗ 未找到答案" answer_preview = "" @@ -703,15 +698,15 @@ def _get_recent_query_history(chat_id: str, time_window_seconds: float = 300.0) answer_preview = record.answer[:100] if len(record.answer) > 100: answer_preview += "..." - + history_lines.append(f"- 问题:{record.question}") history_lines.append(f" 状态:{status}") if answer_preview: history_lines.append(f" 答案:{answer_preview}") history_lines.append("") # 空行分隔 - + return "\n".join(history_lines) - + except Exception as e: logger.error(f"获取查询历史失败: {e}") return "" @@ -719,40 +714,40 @@ def _get_recent_query_history(chat_id: str, time_window_seconds: float = 300.0) def _get_cached_memories(chat_id: str, time_window_seconds: float = 300.0) -> List[str]: """获取最近一段时间内缓存的记忆(只返回找到答案的记录) - + Args: chat_id: 聊天ID time_window_seconds: 时间窗口(秒),默认300秒(5分钟) - + Returns: List[str]: 格式化的记忆列表,每个元素格式为 "问题:xxx\n答案:xxx" """ try: current_time = time.time() start_time = current_time - time_window_seconds - + # 查询最近时间窗口内找到答案的记录,按更新时间倒序 records = ( ThinkingBack.select() .where( - (ThinkingBack.chat_id == chat_id) & - (ThinkingBack.update_time >= start_time) & - (ThinkingBack.found_answer == 1) + (ThinkingBack.chat_id == chat_id) + & (ThinkingBack.update_time >= start_time) + & (ThinkingBack.found_answer == 1) ) .order_by(ThinkingBack.update_time.desc()) .limit(5) # 最多返回5条最近的记录 ) - + if not records.exists(): return [] - + cached_memories = [] for record in records: if record.answer: cached_memories.append(f"问题:{record.question}\n答案:{record.answer}") - + return cached_memories - + except Exception as e: logger.error(f"获取缓存记忆失败: {e}") return [] @@ -760,11 +755,11 @@ def _get_cached_memories(chat_id: str, time_window_seconds: float = 300.0) -> Li def _query_thinking_back(chat_id: str, question: str) -> Optional[Tuple[bool, str]]: """从thinking_back数据库中查询是否有现成的答案 - + Args: chat_id: 聊天ID question: 问题 - + Returns: Optional[Tuple[bool, str]]: 如果找到记录,返回(found_answer, answer),否则返回None found_answer: 是否找到答案(True表示found_answer=1,False表示found_answer=0) @@ -775,23 +770,20 @@ def _query_thinking_back(chat_id: str, question: str) -> Optional[Tuple[bool, st # 按更新时间倒序,获取最新的记录 records = ( ThinkingBack.select() - .where( - (ThinkingBack.chat_id == chat_id) & - (ThinkingBack.question == question) - ) + .where((ThinkingBack.chat_id == chat_id) & (ThinkingBack.question == question)) .order_by(ThinkingBack.update_time.desc()) .limit(1) ) - + if records.exists(): record = records.get() found_answer = bool(record.found_answer) answer = record.answer or "" logger.info(f"在thinking_back中找到记录,问题: {question[:50]}...,found_answer: {found_answer}") return found_answer, answer - + return None - + except Exception as e: logger.error(f"查询thinking_back失败: {e}") return None @@ -799,7 +791,7 @@ def _query_thinking_back(chat_id: str, question: str) -> Optional[Tuple[bool, st async def _analyze_question_answer(question: str, answer: str, chat_id: str) -> None: """异步分析问题和答案的类别,并存储到相应系统 - + Args: question: 问题 answer: 答案 @@ -826,41 +818,42 @@ async def _analyze_question_answer(question: str, answer: str, chat_id: str) -> }} 只输出JSON,不要输出其他内容:""" - + success, response, _, _ = await llm_api.generate_with_model( analysis_prompt, model_config=model_config.model_task_config.utils, request_type="memory.analyze_qa", ) - + if not success: logger.error(f"分析问题和答案失败: {response}") return - + # 解析JSON响应 try: json_pattern = r"```json\s*(.*?)\s*```" matches = re.findall(json_pattern, response, re.DOTALL) - + if matches: json_str = matches[0] else: json_str = response.strip() - + repaired_json = repair_json(json_str) analysis_result = json.loads(repaired_json) - + category = analysis_result.get("category", "").strip() - + if category == "黑话": # 处理黑话 jargon_keyword = analysis_result.get("jargon_keyword", "").strip() if jargon_keyword: from src.jargon.jargon_miner import store_jargon_from_answer + await store_jargon_from_answer(jargon_keyword, answer, chat_id) else: logger.warning(f"分析为黑话但未提取到关键词,问题: {question[:50]}...") - + elif category == "人物信息": # 处理人物信息 # person_name = analysis_result.get("person_name", "").strip() @@ -871,28 +864,22 @@ async def _analyze_question_answer(question: str, answer: str, chat_id: str) -> # else: # logger.warning(f"分析为人物信息但未提取到人物名称或记忆内容,问题: {question[:50]}...") pass # 功能暂时禁用 - + else: logger.info(f"问题和答案类别为'其他',不进行存储,问题: {question[:50]}...") - + except Exception as e: logger.error(f"解析分析结果失败: {e}, 响应: {response[:200]}...") - + except Exception as e: logger.error(f"分析问题和答案时发生异常: {e}") - def _store_thinking_back( - chat_id: str, - question: str, - context: str, - found_answer: bool, - answer: str, - thinking_steps: List[Dict[str, Any]] + chat_id: str, question: str, context: str, found_answer: bool, answer: str, thinking_steps: List[Dict[str, Any]] ) -> None: """存储或更新思考过程到数据库(如果已存在则更新,否则创建) - + Args: chat_id: 聊天ID question: 问题 @@ -903,18 +890,15 @@ def _store_thinking_back( """ try: now = time.time() - + # 先查询是否已存在相同chat_id和问题的记录 existing = ( ThinkingBack.select() - .where( - (ThinkingBack.chat_id == chat_id) & - (ThinkingBack.question == question) - ) + .where((ThinkingBack.chat_id == chat_id) & (ThinkingBack.question == question)) .order_by(ThinkingBack.update_time.desc()) .limit(1) ) - + if existing.exists(): # 更新现有记录 record = existing.get() @@ -935,27 +919,22 @@ def _store_thinking_back( answer=answer, thinking_steps=json.dumps(thinking_steps, ensure_ascii=False), create_time=now, - update_time=now + update_time=now, ) logger.info(f"已创建思考过程到数据库,问题: {question[:50]}...") except Exception as e: logger.error(f"存储思考过程失败: {e}") -async def _process_single_question( - question: str, - chat_id: str, - context: str, - initial_info: str = "" -) -> Optional[str]: +async def _process_single_question(question: str, chat_id: str, context: str, initial_info: str = "") -> Optional[str]: """处理单个问题的查询(包含缓存检查逻辑) - + Args: question: 要查询的问题 chat_id: 聊天ID context: 上下文信息 initial_info: 初始信息(如概念检索结果),将传递给ReAct Agent - + Returns: Optional[str]: 如果找到答案,返回格式化的结果字符串,否则返回None """ @@ -978,20 +957,20 @@ async def _process_single_question( logger.info(f"LPMM预查询未命中或未找到信息,问题: {question[:50]}...") except Exception as e: logger.error(f"LPMM预查询失败,问题: {question[:50]}... 错误: {e}") - + # 先检查thinking_back数据库中是否有现成答案 cached_result = _query_thinking_back(chat_id, question) should_requery = False - + if cached_result: cached_found_answer, cached_answer = cached_result - + if cached_found_answer: # found_answer == 1 (True) # found_answer == 1:20%概率重新查询 if random.random() < 0.5: should_requery = True logger.info(f"found_answer=1,触发20%概率重新查询,问题: {question[:50]}...") - + if not should_requery and cached_answer: logger.info(f"从thinking_back缓存中获取答案,问题: {question[:50]}...") return f"问题:{question}\n答案:{cached_answer}" @@ -1002,22 +981,22 @@ async def _process_single_question( # found_answer == 0:不使用缓存,直接重新查询 should_requery = True logger.info(f"thinking_back存在但未找到答案,忽略缓存重新查询,问题: {question[:50]}...") - + # 如果没有缓存答案或需要重新查询,使用ReAct Agent查询 if not cached_result or should_requery: if should_requery: logger.info(f"概率触发重新查询,使用ReAct Agent查询,问题: {question[:50]}...") else: logger.info(f"未找到缓存答案,使用ReAct Agent查询,问题: {question[:50]}...") - + found_answer, answer, thinking_steps, is_timeout = await _react_agent_solve_question( question=question, chat_id=chat_id, max_iterations=global_config.memory.max_agent_iterations, timeout=120.0, - initial_info=question_initial_info + initial_info=question_initial_info, ) - + # 存储到数据库(超时时不存储) if not is_timeout: _store_thinking_back( @@ -1026,16 +1005,16 @@ async def _process_single_question( context=context, found_answer=found_answer, answer=answer, - thinking_steps=thinking_steps + thinking_steps=thinking_steps, ) else: logger.info(f"ReAct Agent超时,不存储到数据库,问题: {question[:50]}...") - + if found_answer and answer: # 创建异步任务分析问题和答案 asyncio.create_task(_analyze_question_answer(question, answer, chat_id)) return f"问题:{question}\n答案:{answer}" - + return None @@ -1048,30 +1027,30 @@ async def build_memory_retrieval_prompt( ) -> str: """构建记忆检索提示 使用两段式查询:第一步生成问题,第二步使用ReAct Agent查询答案 - + Args: message: 聊天历史记录 sender: 发送者名称 target: 目标消息内容 chat_stream: 聊天流对象 tool_executor: 工具执行器(保留参数以兼容接口) - + Returns: str: 记忆检索结果字符串 """ start_time = time.time() - + logger.info(f"检测是否需要回忆,元消息:{message[:30]}...,消息长度: {len(message)}") try: time_now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) bot_name = global_config.bot.nickname chat_id = chat_stream.stream_id - + # 获取最近查询历史(最近1小时内的查询) recent_query_history = _get_recent_query_history(chat_id, time_window_seconds=300.0) if not recent_query_history: recent_query_history = "最近没有查询记录。" - + # 第一步:生成问题 question_prompt = await global_prompt_manager.format_prompt( "memory_retrieval_question_prompt", @@ -1082,25 +1061,25 @@ async def build_memory_retrieval_prompt( sender=sender, target_message=target, ) - + success, response, reasoning_content, model_name = await llm_api.generate_with_model( question_prompt, model_config=model_config.model_task_config.tool_use, request_type="memory.question", ) - + logger.info(f"记忆检索问题生成提示词: {question_prompt}") logger.info(f"记忆检索问题生成响应: {response}") - + if not success: logger.error(f"LLM生成问题失败: {response}") return "" - + # 解析概念列表和问题列表 concepts, questions = _parse_questions_json(response) logger.info(f"解析到 {len(concepts)} 个概念: {concepts}") logger.info(f"解析到 {len(questions)} 个问题: {questions}") - + # 对概念进行jargon检索,作为初始信息 initial_info = "" if concepts: @@ -1111,11 +1090,10 @@ async def build_memory_retrieval_prompt( logger.info(f"概念检索完成,结果: {concept_info[:200]}...") else: logger.info("概念检索未找到任何结果") - - + # 获取缓存的记忆(与question时使用相同的时间窗口和数量限制) cached_memories = _get_cached_memories(chat_id, time_window_seconds=300.0) - + if not questions: logger.debug("模型认为不需要检索记忆或解析失败") # 即使没有当次查询,也返回缓存的记忆和概念检索结果 @@ -1124,7 +1102,7 @@ async def build_memory_retrieval_prompt( all_results.append(initial_info.strip()) if cached_memories: all_results.extend(cached_memories) - + if all_results: retrieved_memory = "\n\n".join(all_results) end_time = time.time() @@ -1132,27 +1110,22 @@ async def build_memory_retrieval_prompt( return f"你回忆起了以下信息:\n{retrieved_memory}\n如果与回复内容相关,可以参考这些回忆的信息。\n" else: return "" - + logger.info(f"解析到 {len(questions)} 个问题: {questions}") - + # 第二步:并行处理所有问题(使用配置的最大迭代次数/120秒超时) max_iterations = global_config.memory.max_agent_iterations logger.info(f"问题数量: {len(questions)},设置最大迭代次数: {max_iterations},超时时间: 120秒") - + # 并行处理所有问题,将概念检索结果作为初始信息传递 question_tasks = [ - _process_single_question( - question=question, - chat_id=chat_id, - context=message, - initial_info=initial_info - ) + _process_single_question(question=question, chat_id=chat_id, context=message, initial_info=initial_info) for question in questions ] - + # 并行执行所有查询任务 results = await asyncio.gather(*question_tasks, return_exceptions=True) - + # 收集所有有效结果 all_results = [] current_questions = set() # 用于去重,避免缓存和当次查询重复 @@ -1165,7 +1138,7 @@ async def build_memory_retrieval_prompt( if result.startswith("问题:"): question = result.split("\n")[0].replace("问题:", "").strip() current_questions.add(question) - + # 将缓存的记忆添加到结果中(排除当次查询已包含的问题,避免重复) for cached_memory in cached_memories: if cached_memory.startswith("问题:"): @@ -1174,17 +1147,19 @@ async def build_memory_retrieval_prompt( if question not in current_questions: all_results.append(cached_memory) logger.debug(f"添加缓存记忆: {question[:50]}...") - + end_time = time.time() - + if all_results: retrieved_memory = "\n\n".join(all_results) - logger.info(f"记忆检索成功,耗时: {(end_time - start_time):.3f}秒,包含 {len(all_results)} 条记忆(含缓存)") + logger.info( + f"记忆检索成功,耗时: {(end_time - start_time):.3f}秒,包含 {len(all_results)} 条记忆(含缓存)" + ) return f"你回忆起了以下信息:\n{retrieved_memory}\n如果与回复内容相关,可以参考这些回忆的信息。\n" else: logger.debug("所有问题均未找到答案,且无缓存记忆") return "" - + except Exception as e: logger.error(f"记忆检索时发生异常: {str(e)}") return "" @@ -1192,10 +1167,10 @@ async def build_memory_retrieval_prompt( def _parse_questions_json(response: str) -> Tuple[List[str], List[str]]: """解析问题JSON,返回概念列表和问题列表 - + Args: response: LLM返回的响应 - + Returns: Tuple[List[str], List[str]]: (概念列表, 问题列表) """ @@ -1203,39 +1178,39 @@ def _parse_questions_json(response: str) -> Tuple[List[str], List[str]]: # 尝试提取JSON(可能包含在```json代码块中) json_pattern = r"```json\s*(.*?)\s*```" matches = re.findall(json_pattern, response, re.DOTALL) - + if matches: json_str = matches[0] else: # 尝试直接解析整个响应 json_str = response.strip() - + # 修复可能的JSON错误 repaired_json = repair_json(json_str) - + # 解析JSON parsed = json.loads(repaired_json) - + # 只支持新格式:包含concepts和questions的对象 if not isinstance(parsed, dict): logger.warning(f"解析的JSON不是对象格式: {parsed}") return [], [] - + concepts_raw = parsed.get("concepts", []) questions_raw = parsed.get("questions", []) - + # 确保是列表 if not isinstance(concepts_raw, list): concepts_raw = [] if not isinstance(questions_raw, list): questions_raw = [] - + # 确保所有元素都是字符串 concepts = [c for c in concepts_raw if isinstance(c, str) and c.strip()] questions = [q for q in questions_raw if isinstance(q, str) and q.strip()] - + return concepts, questions - + except Exception as e: logger.error(f"解析问题JSON失败: {e}, 响应内容: {response[:200]}...") return [], [] diff --git a/src/memory_system/memory_utils.py b/src/memory_system/memory_utils.py index af16456b..bff39f95 100644 --- a/src/memory_system/memory_utils.py +++ b/src/memory_system/memory_utils.py @@ -3,6 +3,7 @@ 记忆系统工具函数 包含模糊查找、相似度计算等工具函数 """ + import json import re from datetime import datetime @@ -14,6 +15,7 @@ from src.common.logger import get_logger logger = get_logger("memory_utils") + def parse_md_json(json_text: str) -> list[str]: """从Markdown格式的内容中提取JSON对象和推理内容""" json_objects = [] @@ -52,14 +54,15 @@ def parse_md_json(json_text: str) -> list[str]: return json_objects, reasoning_content + def calculate_similarity(text1: str, text2: str) -> float: """ 计算两个文本的相似度 - + Args: text1: 第一个文本 text2: 第二个文本 - + Returns: float: 相似度分数 (0-1) """ @@ -67,16 +70,16 @@ def calculate_similarity(text1: str, text2: str) -> float: # 预处理文本 text1 = preprocess_text(text1) text2 = preprocess_text(text2) - + # 使用SequenceMatcher计算相似度 similarity = SequenceMatcher(None, text1, text2).ratio() - + # 如果其中一个文本包含另一个,提高相似度 if text1 in text2 or text2 in text1: similarity = max(similarity, 0.8) - + return similarity - + except Exception as e: logger.error(f"计算相似度时出错: {e}") return 0.0 @@ -85,31 +88,30 @@ def calculate_similarity(text1: str, text2: str) -> float: def preprocess_text(text: str) -> str: """ 预处理文本,提高匹配准确性 - + Args: text: 原始文本 - + Returns: str: 预处理后的文本 """ try: # 转换为小写 text = text.lower() - + # 移除标点符号和特殊字符 - text = re.sub(r'[^\w\s]', '', text) - + text = re.sub(r"[^\w\s]", "", text) + # 移除多余空格 - text = re.sub(r'\s+', ' ', text).strip() - + text = re.sub(r"\s+", " ", text).strip() + return text - + except Exception as e: logger.error(f"预处理文本时出错: {e}") return text - def parse_datetime_to_timestamp(value: str) -> float: """ 接受多种常见格式并转换为时间戳(秒) @@ -143,25 +145,24 @@ def parse_datetime_to_timestamp(value: str) -> float: def parse_time_range(time_range: str) -> Tuple[float, float]: """ 解析时间范围字符串,返回开始和结束时间戳 - + Args: time_range: 时间范围字符串,格式:"YYYY-MM-DD HH:MM:SS - YYYY-MM-DD HH:MM:SS" - + Returns: Tuple[float, float]: (开始时间戳, 结束时间戳) """ if " - " not in time_range: raise ValueError(f"时间范围格式错误,应为 '开始时间 - 结束时间': {time_range}") - + parts = time_range.split(" - ", 1) if len(parts) != 2: raise ValueError(f"时间范围格式错误: {time_range}") - + start_str = parts[0].strip() end_str = parts[1].strip() - + start_timestamp = parse_datetime_to_timestamp(start_str) end_timestamp = parse_datetime_to_timestamp(end_str) - - return start_timestamp, end_timestamp + return start_timestamp, end_timestamp diff --git a/src/memory_system/retrieval_tools/__init__.py b/src/memory_system/retrieval_tools/__init__.py index e02875be..4b5c40c0 100644 --- a/src/memory_system/retrieval_tools/__init__.py +++ b/src/memory_system/retrieval_tools/__init__.py @@ -17,6 +17,7 @@ from .query_lpmm_knowledge import register_tool as register_lpmm_knowledge from .query_person_info import register_tool as register_query_person_info from src.config.config import global_config + def init_all_tools(): """初始化并注册所有记忆检索工具""" register_query_jargon() diff --git a/src/memory_system/retrieval_tools/query_chat_history.py b/src/memory_system/retrieval_tools/query_chat_history.py index 900426ee..407bba05 100644 --- a/src/memory_system/retrieval_tools/query_chat_history.py +++ b/src/memory_system/retrieval_tools/query_chat_history.py @@ -15,13 +15,10 @@ logger = get_logger("memory_retrieval_tools") async def query_chat_history( - chat_id: str, - keyword: Optional[str] = None, - time_range: Optional[str] = None, - fuzzy: bool = True + chat_id: str, keyword: Optional[str] = None, time_range: Optional[str] = None, fuzzy: bool = True ) -> str: """根据时间或关键词在chat_history表中查询聊天记录概述 - + Args: chat_id: 聊天ID keyword: 关键词(可选,支持多个关键词,可用空格、逗号等分隔) @@ -31,7 +28,7 @@ async def query_chat_history( fuzzy: 是否使用模糊匹配模式(默认True) - True: 模糊匹配,只要包含任意一个关键词即匹配(OR关系) - False: 全匹配,必须包含所有关键词才匹配(AND关系) - + Returns: str: 查询结果 """ @@ -39,10 +36,10 @@ async def query_chat_history( # 检查参数 if not keyword and not time_range: return "未指定查询参数(需要提供keyword或time_range之一)" - + # 构建查询条件 query = ChatHistory.select().where(ChatHistory.chat_id == chat_id) - + # 时间过滤条件 if time_range: # 判断是时间点还是时间范围 @@ -50,79 +47,79 @@ async def query_chat_history( # 时间范围:查询与时间范围有交集的记录 start_timestamp, end_timestamp = parse_time_range(time_range) # 交集条件:start_time < end_timestamp AND end_time > start_timestamp - time_filter = ( - (ChatHistory.start_time < end_timestamp) & - (ChatHistory.end_time > start_timestamp) - ) + time_filter = (ChatHistory.start_time < end_timestamp) & (ChatHistory.end_time > start_timestamp) else: # 时间点:查询包含该时间点的记录(start_time <= time_point <= end_time) target_timestamp = parse_datetime_to_timestamp(time_range) - time_filter = ( - (ChatHistory.start_time <= target_timestamp) & - (ChatHistory.end_time >= target_timestamp) - ) + time_filter = (ChatHistory.start_time <= target_timestamp) & (ChatHistory.end_time >= target_timestamp) query = query.where(time_filter) - + # 执行查询 records = list(query.order_by(ChatHistory.start_time.desc()).limit(50)) - + # 如果有关键词,进一步过滤 if keyword: # 解析多个关键词(支持空格、逗号等分隔符) keywords_list = parse_keywords_string(keyword) if not keywords_list: keywords_list = [keyword.strip()] if keyword.strip() else [] - + # 转换为小写以便匹配 keywords_lower = [kw.lower() for kw in keywords_list if kw.strip()] - + if not keywords_lower: return "关键词为空" - + filtered_records = [] - + for record in records: # 在theme、keywords、summary、original_text中搜索 theme = (record.theme or "").lower() summary = (record.summary or "").lower() original_text = (record.original_text or "").lower() - + # 解析record中的keywords JSON record_keywords_list = [] if record.keywords: try: - keywords_data = json.loads(record.keywords) if isinstance(record.keywords, str) else record.keywords + keywords_data = ( + json.loads(record.keywords) if isinstance(record.keywords, str) else record.keywords + ) if isinstance(keywords_data, list): record_keywords_list = [str(k).lower() for k in keywords_data] except (json.JSONDecodeError, TypeError, ValueError): pass - + # 根据匹配模式检查关键词 matched = False if fuzzy: # 模糊匹配:只要包含任意一个关键词即匹配(OR关系) for kw in keywords_lower: - if (kw in theme or - kw in summary or - kw in original_text or - any(kw in k for k in record_keywords_list)): + if ( + kw in theme + or kw in summary + or kw in original_text + or any(kw in k for k in record_keywords_list) + ): matched = True break else: # 全匹配:必须包含所有关键词才匹配(AND关系) matched = True for kw in keywords_lower: - kw_matched = (kw in theme or - kw in summary or - kw in original_text or - any(kw in k for k in record_keywords_list)) + kw_matched = ( + kw in theme + or kw in summary + or kw in original_text + or any(kw in k for k in record_keywords_list) + ) if not kw_matched: matched = False break - + if matched: filtered_records.append(record) - + if not filtered_records: keywords_str = "、".join(keywords_list) match_mode = "包含任意一个关键词" if fuzzy else "包含所有关键词" @@ -130,9 +127,9 @@ async def query_chat_history( return f"未找到{match_mode}'{keywords_str}'且在指定时间范围内的聊天记录概述" else: return f"未找到{match_mode}'{keywords_str}'的聊天记录概述" - + records = filtered_records - + # 如果没有记录(可能是时间范围查询但没有匹配的记录) if not records: if time_range: @@ -148,22 +145,23 @@ async def query_chat_history( record.count = (record.count or 0) + 1 except Exception as update_error: logger.error(f"更新聊天记录概述计数失败: {update_error}") - + # 构建结果文本 results = [] for record in records_to_use: # 最多返回3条记录 result_parts = [] - + # 添加主题 if record.theme: result_parts.append(f"主题:{record.theme}") - + # 添加时间范围 from datetime import datetime + start_str = datetime.fromtimestamp(record.start_time).strftime("%Y-%m-%d %H:%M:%S") end_str = datetime.fromtimestamp(record.end_time).strftime("%Y-%m-%d %H:%M:%S") result_parts.append(f"时间:{start_str} - {end_str}") - + # 添加概括(优先使用summary,如果没有则使用original_text的前200字符) if record.summary: result_parts.append(f"概括:{record.summary}") @@ -172,18 +170,18 @@ async def query_chat_history( if len(record.original_text) > 200: text_preview += "..." result_parts.append(f"内容:{text_preview}") - + results.append("\n".join(result_parts)) - + if not results: return "未找到相关聊天记录概述" - + response_text = "\n\n---\n\n".join(results) if len(records) > len(records_to_use): omitted_count = len(records) - len(records_to_use) response_text += f"\n\n(还有{omitted_count}条历史记录已省略)" return response_text - + except Exception as e: logger.error(f"查询聊天历史概述失败: {e}") return f"查询失败: {str(e)}" @@ -199,20 +197,20 @@ def register_tool(): "name": "keyword", "type": "string", "description": "关键词(可选,支持多个关键词,可用空格、逗号、斜杠等分隔,如:'麦麦 百度网盘' 或 '麦麦,百度网盘'。用于在主题、关键词、概括、原文中搜索)", - "required": False + "required": False, }, { "name": "time_range", "type": "string", "description": "时间范围或时间点(可选)。格式:'YYYY-MM-DD HH:MM:SS - YYYY-MM-DD HH:MM:SS'(时间范围,查询与时间范围有交集的记录)或 'YYYY-MM-DD HH:MM:SS'(时间点,查询包含该时间点的记录)", - "required": False + "required": False, }, { "name": "fuzzy", "type": "boolean", "description": "是否使用模糊匹配模式(默认True)。True表示模糊匹配(只要包含任意一个关键词即匹配,OR关系),False表示全匹配(必须包含所有关键词才匹配,AND关系)", - "required": False - } + "required": False, + }, ], - execute_func=query_chat_history + execute_func=query_chat_history, ) diff --git a/src/memory_system/retrieval_tools/query_lpmm_knowledge.py b/src/memory_system/retrieval_tools/query_lpmm_knowledge.py index 20664eea..c1f39270 100644 --- a/src/memory_system/retrieval_tools/query_lpmm_knowledge.py +++ b/src/memory_system/retrieval_tools/query_lpmm_knowledge.py @@ -73,5 +73,3 @@ def register_tool(): ], execute_func=query_lpmm_knowledge, ) - - diff --git a/src/memory_system/retrieval_tools/query_person_info.py b/src/memory_system/retrieval_tools/query_person_info.py index 878daf4d..bc192722 100644 --- a/src/memory_system/retrieval_tools/query_person_info.py +++ b/src/memory_system/retrieval_tools/query_person_info.py @@ -14,23 +14,25 @@ logger = get_logger("memory_retrieval_tools") def _format_group_nick_names(group_nick_name_field) -> str: """格式化群昵称信息 - + Args: group_nick_name_field: 群昵称字段(可能是字符串JSON或None) - + Returns: str: 格式化后的群昵称信息字符串 """ if not group_nick_name_field: return "" - + try: # 解析JSON格式的群昵称列表 - group_nick_names_data = json.loads(group_nick_name_field) if isinstance(group_nick_name_field, str) else group_nick_name_field - + group_nick_names_data = ( + json.loads(group_nick_name_field) if isinstance(group_nick_name_field, str) else group_nick_name_field + ) + if not isinstance(group_nick_names_data, list) or not group_nick_names_data: return "" - + # 格式化群昵称列表 group_nick_list = [] for item in group_nick_names_data: @@ -41,7 +43,7 @@ def _format_group_nick_names(group_nick_name_field) -> str: elif isinstance(item, str): # 兼容旧格式(如果存在) group_nick_list.append(f" - {item}") - + if group_nick_list: return "群昵称:\n" + "\n".join(group_nick_list) return "" @@ -58,10 +60,10 @@ def _format_group_nick_names(group_nick_name_field) -> str: async def query_person_info(person_name: str) -> str: """根据person_name查询用户信息,使用模糊查询 - + Args: person_name: 用户名称(person_name字段) - + Returns: str: 查询结果,包含用户的所有信息 """ @@ -69,37 +71,35 @@ async def query_person_info(person_name: str) -> str: person_name = str(person_name).strip() if not person_name: return "用户名称为空" - + # 构建查询条件(使用模糊查询) - query = PersonInfo.select().where( - PersonInfo.person_name.contains(person_name) - ) - + query = PersonInfo.select().where(PersonInfo.person_name.contains(person_name)) + # 执行查询 records = list(query.limit(20)) # 最多返回20条记录 - + if not records: return f"未找到模糊匹配'{person_name}'的用户信息" - + # 区分精确匹配和模糊匹配的结果 exact_matches = [] fuzzy_matches = [] - + for record in records: # 检查是否是精确匹配 if record.person_name and record.person_name.strip() == person_name: exact_matches.append(record) else: fuzzy_matches.append(record) - + # 构建结果文本 results = [] - + # 先处理精确匹配的结果 for record in exact_matches: result_parts = [] result_parts.append("【精确匹配】") # 标注为精确匹配 - + # 基本信息 if record.person_name: result_parts.append(f"用户名称:{record.person_name}") @@ -111,19 +111,19 @@ async def query_person_info(person_name: str) -> str: result_parts.append(f"平台:{record.platform}") if record.user_id: result_parts.append(f"平台用户ID:{record.user_id}") - + # 群昵称信息 group_nick_name_str = _format_group_nick_names(getattr(record, "group_nick_name", None)) if group_nick_name_str: result_parts.append(group_nick_name_str) - + # 名称设定原因 if record.name_reason: result_parts.append(f"名称设定原因:{record.name_reason}") - + # 认识状态 result_parts.append(f"是否已认识:{'是' if record.is_known else '否'}") - + # 时间信息 if record.know_since: know_since_str = datetime.fromtimestamp(record.know_since).strftime("%Y-%m-%d %H:%M:%S") @@ -133,11 +133,15 @@ async def query_person_info(person_name: str) -> str: result_parts.append(f"最后认识时间:{last_know_str}") if record.know_times: result_parts.append(f"认识次数:{int(record.know_times)}") - + # 记忆点(memory_points) if record.memory_points: try: - memory_points_data = json.loads(record.memory_points) if isinstance(record.memory_points, str) else record.memory_points + memory_points_data = ( + json.loads(record.memory_points) + if isinstance(record.memory_points, str) + else record.memory_points + ) if isinstance(memory_points_data, list) and memory_points_data: # 解析记忆点格式:category:content:weight memory_list = [] @@ -151,7 +155,7 @@ async def query_person_info(person_name: str) -> str: memory_list.append(f" - [{category}] {content} (权重: {weight})") else: memory_list.append(f" - {memory_point}") - + if memory_list: result_parts.append("记忆点:\n" + "\n".join(memory_list)) except (json.JSONDecodeError, TypeError, ValueError) as e: @@ -161,14 +165,14 @@ async def query_person_info(person_name: str) -> str: if len(str(record.memory_points)) > 200: memory_preview += "..." result_parts.append(f"记忆点(原始数据):{memory_preview}") - + results.append("\n".join(result_parts)) - + # 再处理模糊匹配的结果 for record in fuzzy_matches: result_parts = [] result_parts.append("【模糊匹配】") # 标注为模糊匹配 - + # 基本信息 if record.person_name: result_parts.append(f"用户名称:{record.person_name}") @@ -180,19 +184,19 @@ async def query_person_info(person_name: str) -> str: result_parts.append(f"平台:{record.platform}") if record.user_id: result_parts.append(f"平台用户ID:{record.user_id}") - + # 群昵称信息 group_nick_name_str = _format_group_nick_names(getattr(record, "group_nick_name", None)) if group_nick_name_str: result_parts.append(group_nick_name_str) - + # 名称设定原因 if record.name_reason: result_parts.append(f"名称设定原因:{record.name_reason}") - + # 认识状态 result_parts.append(f"是否已认识:{'是' if record.is_known else '否'}") - + # 时间信息 if record.know_since: know_since_str = datetime.fromtimestamp(record.know_since).strftime("%Y-%m-%d %H:%M:%S") @@ -202,11 +206,15 @@ async def query_person_info(person_name: str) -> str: result_parts.append(f"最后认识时间:{last_know_str}") if record.know_times: result_parts.append(f"认识次数:{int(record.know_times)}") - + # 记忆点(memory_points) if record.memory_points: try: - memory_points_data = json.loads(record.memory_points) if isinstance(record.memory_points, str) else record.memory_points + memory_points_data = ( + json.loads(record.memory_points) + if isinstance(record.memory_points, str) + else record.memory_points + ) if isinstance(memory_points_data, list) and memory_points_data: # 解析记忆点格式:category:content:weight memory_list = [] @@ -220,7 +228,7 @@ async def query_person_info(person_name: str) -> str: memory_list.append(f" - [{category}] {content} (权重: {weight})") else: memory_list.append(f" - {memory_point}") - + if memory_list: result_parts.append("记忆点:\n" + "\n".join(memory_list)) except (json.JSONDecodeError, TypeError, ValueError) as e: @@ -230,20 +238,20 @@ async def query_person_info(person_name: str) -> str: if len(str(record.memory_points)) > 200: memory_preview += "..." result_parts.append(f"记忆点(原始数据):{memory_preview}") - + results.append("\n".join(result_parts)) - + # 组合所有结果 if not results: return f"未找到匹配'{person_name}'的用户信息" - + response_text = "\n\n---\n\n".join(results) - + # 添加统计信息 total_count = len(records) exact_count = len(exact_matches) fuzzy_count = len(fuzzy_matches) - + # 显示精确匹配和模糊匹配的统计 if exact_count > 0 or fuzzy_count > 0: stats_parts = [] @@ -257,13 +265,13 @@ async def query_person_info(person_name: str) -> str: response_text = f"找到 {total_count} 条匹配的用户信息:\n\n{response_text}" else: response_text = f"找到用户信息:\n\n{response_text}" - + # 如果结果数量达到限制,添加提示 if total_count >= 20: response_text += "\n\n(已显示前20条结果,可能还有更多匹配记录)" - + return response_text - + except Exception as e: logger.error(f"查询用户信息失败: {e}") return f"查询失败: {str(e)}" @@ -275,13 +283,7 @@ def register_tool(): name="query_person_info", description="根据查询某个用户的所有信息。名称、昵称、平台、用户ID、qq号、群昵称等", parameters=[ - { - "name": "person_name", - "type": "string", - "description": "用户名称,用于查询用户信息", - "required": True - } + {"name": "person_name", "type": "string", "description": "用户名称,用于查询用户信息", "required": True} ], - execute_func=query_person_info + execute_func=query_person_info, ) - diff --git a/src/memory_system/retrieval_tools/tool_registry.py b/src/memory_system/retrieval_tools/tool_registry.py index 143666ab..1e1fa62b 100644 --- a/src/memory_system/retrieval_tools/tool_registry.py +++ b/src/memory_system/retrieval_tools/tool_registry.py @@ -47,10 +47,10 @@ class MemoryRetrievalTool: async def execute(self, **kwargs) -> str: """执行工具""" return await self.execute_func(**kwargs) - + def get_tool_definition(self) -> Dict[str, Any]: """获取工具定义,用于LLM function calling - + Returns: Dict[str, Any]: 工具定义字典,格式与BaseTool一致 格式: {"name": str, "description": str, "parameters": List[Tuple]} @@ -58,14 +58,14 @@ class MemoryRetrievalTool: # 转换参数格式为元组列表,格式与BaseTool一致 # 格式: [("param_name", ToolParamType, "description", required, enum_values)] param_tuples = [] - + for param in self.parameters: param_name = param.get("name", "") param_type_str = param.get("type", "string").lower() param_desc = param.get("description", "") is_required = param.get("required", False) enum_values = param.get("enum", None) - + # 转换类型字符串到ToolParamType type_mapping = { "string": ToolParamType.STRING, @@ -76,18 +76,14 @@ class MemoryRetrievalTool: "bool": ToolParamType.BOOLEAN, } param_type = type_mapping.get(param_type_str, ToolParamType.STRING) - + # 构建参数元组 param_tuple = (param_name, param_type, param_desc, is_required, enum_values) param_tuples.append(param_tuple) - + # 构建工具定义,格式与BaseTool.get_tool_definition()一致 - tool_def = { - "name": self.name, - "description": self.description, - "parameters": param_tuples - } - + tool_def = {"name": self.name, "description": self.description, "parameters": param_tuples} + return tool_def @@ -126,10 +122,10 @@ class MemoryRetrievalToolRegistry: action_types.append("final_answer") action_types.append("no_answer") return " 或 ".join([f'"{at}"' for at in action_types]) - + def get_tool_definitions(self) -> List[Dict[str, Any]]: """获取所有工具的定义列表,用于LLM function calling - + Returns: List[Dict[str, Any]]: 工具定义列表,每个元素是一个工具定义字典 """ diff --git a/src/person_info/person_info.py b/src/person_info/person_info.py index bbc3fb99..f5cfdcd0 100644 --- a/src/person_info/person_info.py +++ b/src/person_info/person_info.py @@ -162,7 +162,12 @@ def levenshtein_distance(s1: str, s2: str) -> int: class Person: @classmethod def register_person( - cls, platform: str, user_id: str, nickname: str, group_id: Optional[str] = None, group_nick_name: Optional[str] = None + cls, + platform: str, + user_id: str, + nickname: str, + group_id: Optional[str] = None, + group_nick_name: Optional[str] = None, ): """ 注册新用户的类方法 @@ -727,7 +732,7 @@ person_info_manager = PersonInfoManager() async def store_person_memory_from_answer(person_name: str, memory_content: str, chat_id: str) -> None: """将人物信息存入person_info的memory_points - + Args: person_name: 人物名称 memory_content: 记忆内容 @@ -739,13 +744,13 @@ async def store_person_memory_from_answer(person_name: str, memory_content: str, if not chat_stream: logger.warning(f"无法获取chat_stream for chat_id: {chat_id}") return - + platform = chat_stream.platform - + # 尝试从person_name查找person_id # 首先尝试通过person_name查找 person_id = get_person_id_by_person_name(person_name) - + if not person_id: # 如果通过person_name找不到,尝试从chat_stream获取user_info if chat_stream.user_info: @@ -754,25 +759,25 @@ async def store_person_memory_from_answer(person_name: str, memory_content: str, else: logger.warning(f"无法确定person_id for person_name: {person_name}, chat_id: {chat_id}") return - + # 创建或获取Person对象 person = Person(person_id=person_id) - + if not person.is_known: logger.warning(f"用户 {person_name} (person_id: {person_id}) 尚未认识,无法存储记忆") return - + # 确定记忆分类(可以根据memory_content判断,这里使用通用分类) category = "其他" # 默认分类,可以根据需要调整 - + # 记忆点格式:category:content:weight weight = "1.0" # 默认权重 memory_point = f"{category}:{memory_content}:{weight}" - + # 添加到memory_points if not person.memory_points: person.memory_points = [] - + # 检查是否已存在相似的记忆点(避免重复) is_duplicate = False for existing_point in person.memory_points: @@ -781,16 +786,20 @@ async def store_person_memory_from_answer(person_name: str, memory_content: str, if len(parts) >= 2: existing_content = parts[1].strip() # 简单相似度检查(如果内容相同或非常相似,则跳过) - if existing_content == memory_content or memory_content in existing_content or existing_content in memory_content: + if ( + existing_content == memory_content + or memory_content in existing_content + or existing_content in memory_content + ): is_duplicate = True break - + if not is_duplicate: person.memory_points.append(memory_point) person.sync_to_database() logger.info(f"成功添加记忆点到 {person_name} (person_id: {person_id}): {memory_point}") else: logger.debug(f"记忆点已存在,跳过: {memory_point}") - + except Exception as e: logger.error(f"存储人物记忆失败: {e}") diff --git a/src/plugin_system/core/tool_use.py b/src/plugin_system/core/tool_use.py index 12c11795..915ed7aa 100644 --- a/src/plugin_system/core/tool_use.py +++ b/src/plugin_system/core/tool_use.py @@ -124,7 +124,6 @@ class ToolExecutor: response, (reasoning_content, model_name, tool_calls) = await self.llm_model.generate_response_async( prompt=prompt, tools=tools, raise_when_empty=False ) - # 执行工具调用 tool_results, used_tools = await self.execute_tool_calls(tool_calls) diff --git a/src/plugins/built_in/emoji_plugin/emoji.py b/src/plugins/built_in/emoji_plugin/emoji.py index 7078a817..3783886a 100644 --- a/src/plugins/built_in/emoji_plugin/emoji.py +++ b/src/plugins/built_in/emoji_plugin/emoji.py @@ -102,13 +102,13 @@ class EmojiAction(BaseAction): # 5. 调用LLM models = llm_api.get_available_models() - chat_model_config = models.get("replyer") # 使用字典访问方式 + chat_model_config = models.get("utils") # 使用字典访问方式 if not chat_model_config: - logger.error(f"{self.log_prefix} 未找到'replyer'模型配置,无法调用LLM") - return False, "未找到'replyer'模型配置" + logger.error(f"{self.log_prefix} 未找到'utils'模型配置,无法调用LLM") + return False, "未找到'utils'模型配置" success, chosen_emotion, _, _ = await llm_api.generate_with_model( - prompt, model_config=chat_model_config, request_type="emoji" + prompt, model_config=chat_model_config, request_type="emoji.select" ) if not success: diff --git a/src/webui/config_routes.py b/src/webui/config_routes.py index 03a4643f..c4a4d417 100644 --- a/src/webui/config_routes.py +++ b/src/webui/config_routes.py @@ -51,7 +51,7 @@ def _update_dict_preserve_comments(target: Any, source: Any) -> None: """ 递归合并字典,保留 target 中的注释和格式 将 source 的值更新到 target 中(仅更新已存在的键) - + Args: target: 目标字典(tomlkit 对象,包含注释) source: 源字典(普通 dict 或 list) @@ -59,7 +59,7 @@ def _update_dict_preserve_comments(target: Any, source: Any) -> None: # 如果 source 是列表,直接替换(数组表没有注释保留的意义) if isinstance(source, list): return # 调用者需要直接赋值 - + # 如果都是字典,递归合并 if isinstance(source, dict) and isinstance(target, dict): for key, value in source.items(): diff --git a/src/webui/emoji_routes.py b/src/webui/emoji_routes.py index 18603258..2deaa6e6 100644 --- a/src/webui/emoji_routes.py +++ b/src/webui/emoji_routes.py @@ -1,4 +1,5 @@ """表情包管理 API 路由""" + from fastapi import APIRouter, HTTPException, Header, Query from fastapi.responses import FileResponse from pydantic import BaseModel @@ -18,6 +19,7 @@ router = APIRouter(prefix="/emoji", tags=["Emoji"]) class EmojiResponse(BaseModel): """表情包响应""" + id: int full_path: str format: str @@ -35,6 +37,7 @@ class EmojiResponse(BaseModel): class EmojiListResponse(BaseModel): """表情包列表响应""" + success: bool total: int page: int @@ -44,12 +47,14 @@ class EmojiListResponse(BaseModel): class EmojiDetailResponse(BaseModel): """表情包详情响应""" + success: bool data: EmojiResponse class EmojiUpdateRequest(BaseModel): """表情包更新请求""" + description: Optional[str] = None is_registered: Optional[bool] = None is_banned: Optional[bool] = None @@ -58,6 +63,7 @@ class EmojiUpdateRequest(BaseModel): class EmojiUpdateResponse(BaseModel): """表情包更新响应""" + success: bool message: str data: Optional[EmojiResponse] = None @@ -65,21 +71,38 @@ class EmojiUpdateResponse(BaseModel): class EmojiDeleteResponse(BaseModel): """表情包删除响应""" + success: bool message: str +class BatchDeleteRequest(BaseModel): + """批量删除请求""" + + emoji_ids: List[int] + + +class BatchDeleteResponse(BaseModel): + """批量删除响应""" + + success: bool + message: str + deleted_count: int + failed_count: int + failed_ids: List[int] = [] + + def verify_auth_token(authorization: Optional[str]) -> bool: """验证认证 Token""" if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="Token 无效或已过期") - + return True @@ -120,11 +143,11 @@ async def get_emoji_list( is_registered: Optional[bool] = Query(None, description="是否已注册筛选"), is_banned: Optional[bool] = Query(None, description="是否被禁用筛选"), format: Optional[str] = Query(None, description="格式筛选"), - authorization: Optional[str] = Header(None) + authorization: Optional[str] = Header(None), ): """ 获取表情包列表 - + Args: page: 页码 (从 1 开始) page_size: 每页数量 (1-100) @@ -133,61 +156,51 @@ async def get_emoji_list( is_banned: 是否被禁用筛选 format: 格式筛选 authorization: Authorization header - + Returns: 表情包列表 """ try: verify_auth_token(authorization) - + # 构建查询 query = Emoji.select() - + # 搜索过滤 if search: - query = query.where( - (Emoji.description.contains(search)) | - (Emoji.emoji_hash.contains(search)) - ) - + query = query.where((Emoji.description.contains(search)) | (Emoji.emoji_hash.contains(search))) + # 注册状态过滤 if is_registered is not None: query = query.where(Emoji.is_registered == is_registered) - + # 禁用状态过滤 if is_banned is not None: query = query.where(Emoji.is_banned == is_banned) - + # 格式过滤 if format: query = query.where(Emoji.format == format) - + # 排序:使用次数倒序,然后按记录时间倒序 from peewee import Case + query = query.order_by( - Emoji.usage_count.desc(), - Case(None, [(Emoji.record_time.is_null(), 1)], 0), - Emoji.record_time.desc() + Emoji.usage_count.desc(), Case(None, [(Emoji.record_time.is_null(), 1)], 0), Emoji.record_time.desc() ) - + # 获取总数 total = query.count() - + # 分页 offset = (page - 1) * page_size emojis = query.offset(offset).limit(page_size) - + # 转换为响应对象 data = [emoji_to_response(emoji) for emoji in emojis] - - return EmojiListResponse( - success=True, - total=total, - page=page, - page_size=page_size, - data=data - ) - + + return EmojiListResponse(success=True, total=total, page=page, page_size=page_size, data=data) + except HTTPException: raise except Exception as e: @@ -196,33 +209,27 @@ async def get_emoji_list( @router.get("/{emoji_id}", response_model=EmojiDetailResponse) -async def get_emoji_detail( - emoji_id: int, - authorization: Optional[str] = Header(None) -): +async def get_emoji_detail(emoji_id: int, authorization: Optional[str] = Header(None)): """ 获取表情包详细信息 - + Args: emoji_id: 表情包ID authorization: Authorization header - + Returns: 表情包详细信息 """ try: verify_auth_token(authorization) - + emoji = Emoji.get_or_none(Emoji.id == emoji_id) - + if not emoji: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {emoji_id} 的表情包") - - return EmojiDetailResponse( - success=True, - data=emoji_to_response(emoji) - ) - + + return EmojiDetailResponse(success=True, data=emoji_to_response(emoji)) + except HTTPException: raise except Exception as e: @@ -231,61 +238,55 @@ async def get_emoji_detail( @router.patch("/{emoji_id}", response_model=EmojiUpdateResponse) -async def update_emoji( - emoji_id: int, - request: EmojiUpdateRequest, - authorization: Optional[str] = Header(None) -): +async def update_emoji(emoji_id: int, request: EmojiUpdateRequest, authorization: Optional[str] = Header(None)): """ 增量更新表情包(只更新提供的字段) - + Args: emoji_id: 表情包ID request: 更新请求(只包含需要更新的字段) authorization: Authorization header - + Returns: 更新结果 """ try: verify_auth_token(authorization) - + emoji = Emoji.get_or_none(Emoji.id == emoji_id) - + if not emoji: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {emoji_id} 的表情包") - + # 只更新提供的字段 update_data = request.model_dump(exclude_unset=True) - + if not update_data: raise HTTPException(status_code=400, detail="未提供任何需要更新的字段") - + # 处理情感标签(转换为 JSON) - if 'emotion' in update_data: - if update_data['emotion'] is None: - update_data['emotion'] = None + if "emotion" in update_data: + if update_data["emotion"] is None: + update_data["emotion"] = None else: - update_data['emotion'] = json.dumps(update_data['emotion'], ensure_ascii=False) - + update_data["emotion"] = json.dumps(update_data["emotion"], ensure_ascii=False) + # 如果注册状态从 False 变为 True,记录注册时间 - if 'is_registered' in update_data and update_data['is_registered'] and not emoji.is_registered: - update_data['register_time'] = time.time() - + if "is_registered" in update_data and update_data["is_registered"] and not emoji.is_registered: + update_data["register_time"] = time.time() + # 执行更新 for field, value in update_data.items(): setattr(emoji, field, value) - + emoji.save() - + logger.info(f"表情包已更新: ID={emoji_id}, 字段: {list(update_data.keys())}") - + return EmojiUpdateResponse( - success=True, - message=f"成功更新 {len(update_data)} 个字段", - data=emoji_to_response(emoji) + success=True, message=f"成功更新 {len(update_data)} 个字段", data=emoji_to_response(emoji) ) - + except HTTPException: raise except Exception as e: @@ -294,41 +295,35 @@ async def update_emoji( @router.delete("/{emoji_id}", response_model=EmojiDeleteResponse) -async def delete_emoji( - emoji_id: int, - authorization: Optional[str] = Header(None) -): +async def delete_emoji(emoji_id: int, authorization: Optional[str] = Header(None)): """ 删除表情包 - + Args: emoji_id: 表情包ID authorization: Authorization header - + Returns: 删除结果 """ try: verify_auth_token(authorization) - + emoji = Emoji.get_or_none(Emoji.id == emoji_id) - + if not emoji: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {emoji_id} 的表情包") - + # 记录删除信息 emoji_hash = emoji.emoji_hash - + # 执行删除 emoji.delete_instance() - + logger.info(f"表情包已删除: ID={emoji_id}, hash={emoji_hash}") - - return EmojiDeleteResponse( - success=True, - message=f"成功删除表情包: {emoji_hash}" - ) - + + return EmojiDeleteResponse(success=True, message=f"成功删除表情包: {emoji_hash}") + except HTTPException: raise except Exception as e: @@ -337,31 +332,29 @@ async def delete_emoji( @router.get("/stats/summary") -async def get_emoji_stats( - authorization: Optional[str] = Header(None) -): +async def get_emoji_stats(authorization: Optional[str] = Header(None)): """ 获取表情包统计数据 - + Args: authorization: Authorization header - + Returns: 统计数据 """ try: verify_auth_token(authorization) - + total = Emoji.select().count() registered = Emoji.select().where(Emoji.is_registered).count() banned = Emoji.select().where(Emoji.is_banned).count() - + # 按格式统计 formats = {} for emoji in Emoji.select(Emoji.format): fmt = emoji.format formats[fmt] = formats.get(fmt, 0) + 1 - + # 获取最常用的表情包(前10) top_used = Emoji.select().order_by(Emoji.usage_count.desc()).limit(10) top_used_list = [ @@ -369,11 +362,11 @@ async def get_emoji_stats( "id": emoji.id, "emoji_hash": emoji.emoji_hash, "description": emoji.description, - "usage_count": emoji.usage_count + "usage_count": emoji.usage_count, } for emoji in top_used ] - + return { "success": True, "data": { @@ -382,10 +375,10 @@ async def get_emoji_stats( "banned": banned, "unregistered": total - registered, "formats": formats, - "top_used": top_used_list - } + "top_used": top_used_list, + }, } - + except HTTPException: raise except Exception as e: @@ -394,47 +387,40 @@ async def get_emoji_stats( @router.post("/{emoji_id}/register", response_model=EmojiUpdateResponse) -async def register_emoji( - emoji_id: int, - authorization: Optional[str] = Header(None) -): +async def register_emoji(emoji_id: int, authorization: Optional[str] = Header(None)): """ 注册表情包(快捷操作) - + Args: emoji_id: 表情包ID authorization: Authorization header - + Returns: 更新结果 """ try: verify_auth_token(authorization) - + emoji = Emoji.get_or_none(Emoji.id == emoji_id) - + if not emoji: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {emoji_id} 的表情包") - + if emoji.is_registered: raise HTTPException(status_code=400, detail="该表情包已经注册") - + if emoji.is_banned: raise HTTPException(status_code=400, detail="该表情包已被禁用,无法注册") - + # 注册表情包 emoji.is_registered = True emoji.register_time = time.time() emoji.save() - + logger.info(f"表情包已注册: ID={emoji_id}") - - return EmojiUpdateResponse( - success=True, - message="表情包注册成功", - data=emoji_to_response(emoji) - ) - + + return EmojiUpdateResponse(success=True, message="表情包注册成功", data=emoji_to_response(emoji)) + except HTTPException: raise except Exception as e: @@ -443,41 +429,34 @@ async def register_emoji( @router.post("/{emoji_id}/ban", response_model=EmojiUpdateResponse) -async def ban_emoji( - emoji_id: int, - authorization: Optional[str] = Header(None) -): +async def ban_emoji(emoji_id: int, authorization: Optional[str] = Header(None)): """ 禁用表情包(快捷操作) - + Args: emoji_id: 表情包ID authorization: Authorization header - + Returns: 更新结果 """ try: verify_auth_token(authorization) - + emoji = Emoji.get_or_none(Emoji.id == emoji_id) - + if not emoji: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {emoji_id} 的表情包") - + # 禁用表情包(同时取消注册) emoji.is_banned = True emoji.is_registered = False emoji.save() - + logger.info(f"表情包已禁用: ID={emoji_id}") - - return EmojiUpdateResponse( - success=True, - message="表情包禁用成功", - data=emoji_to_response(emoji) - ) - + + return EmojiUpdateResponse(success=True, message="表情包禁用成功", data=emoji_to_response(emoji)) + except HTTPException: raise except Exception as e: @@ -489,16 +468,16 @@ async def ban_emoji( async def get_emoji_thumbnail( emoji_id: int, token: Optional[str] = Query(None, description="访问令牌"), - authorization: Optional[str] = Header(None) + authorization: Optional[str] = Header(None), ): """ 获取表情包缩略图 - + Args: emoji_id: 表情包ID token: 访问令牌(通过 query parameter) authorization: Authorization header - + Returns: 表情包图片文件 """ @@ -511,37 +490,88 @@ async def get_emoji_thumbnail( else: # 如果没有 query token,则验证 Authorization header verify_auth_token(authorization) - + emoji = Emoji.get_or_none(Emoji.id == emoji_id) - + if not emoji: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {emoji_id} 的表情包") - + # 检查文件是否存在 if not os.path.exists(emoji.full_path): raise HTTPException(status_code=404, detail="表情包文件不存在") - + # 根据格式设置 MIME 类型 mime_types = { - 'png': 'image/png', - 'jpg': 'image/jpeg', - 'jpeg': 'image/jpeg', - 'gif': 'image/gif', - 'webp': 'image/webp', - 'bmp': 'image/bmp' + "png": "image/png", + "jpg": "image/jpeg", + "jpeg": "image/jpeg", + "gif": "image/gif", + "webp": "image/webp", + "bmp": "image/bmp", } - - media_type = mime_types.get(emoji.format.lower(), 'application/octet-stream') - - return FileResponse( - path=emoji.full_path, - media_type=media_type, - filename=f"{emoji.emoji_hash}.{emoji.format}" - ) - + + media_type = mime_types.get(emoji.format.lower(), "application/octet-stream") + + return FileResponse(path=emoji.full_path, media_type=media_type, filename=f"{emoji.emoji_hash}.{emoji.format}") + except HTTPException: raise except Exception as e: logger.exception(f"获取表情包缩略图失败: {e}") raise HTTPException(status_code=500, detail=f"获取表情包缩略图失败: {str(e)}") from e + +@router.post("/batch/delete", response_model=BatchDeleteResponse) +async def batch_delete_emojis(request: BatchDeleteRequest, authorization: Optional[str] = Header(None)): + """ + 批量删除表情包 + + Args: + request: 包含emoji_ids列表的请求 + authorization: Authorization header + + Returns: + 批量删除结果 + """ + try: + verify_auth_token(authorization) + + if not request.emoji_ids: + raise HTTPException(status_code=400, detail="未提供要删除的表情包ID") + + deleted_count = 0 + failed_count = 0 + failed_ids = [] + + for emoji_id in request.emoji_ids: + try: + emoji = Emoji.get_or_none(Emoji.id == emoji_id) + if emoji: + emoji.delete_instance() + deleted_count += 1 + logger.info(f"批量删除表情包: {emoji_id}") + else: + failed_count += 1 + failed_ids.append(emoji_id) + except Exception as e: + logger.error(f"删除表情包 {emoji_id} 失败: {e}") + failed_count += 1 + failed_ids.append(emoji_id) + + message = f"成功删除 {deleted_count} 个表情包" + if failed_count > 0: + message += f",{failed_count} 个失败" + + return BatchDeleteResponse( + success=True, + message=message, + deleted_count=deleted_count, + failed_count=failed_count, + failed_ids=failed_ids, + ) + + except HTTPException: + raise + except Exception as e: + logger.exception(f"批量删除表情包失败: {e}") + raise HTTPException(status_code=500, detail=f"批量删除失败: {str(e)}") from e diff --git a/src/webui/expression_routes.py b/src/webui/expression_routes.py index de2594ee..983918cf 100644 --- a/src/webui/expression_routes.py +++ b/src/webui/expression_routes.py @@ -1,4 +1,5 @@ """表达方式管理 API 路由""" + from fastapi import APIRouter, HTTPException, Header, Query from pydantic import BaseModel from typing import Optional, List @@ -15,6 +16,7 @@ router = APIRouter(prefix="/expression", tags=["Expression"]) class ExpressionResponse(BaseModel): """表达方式响应""" + id: int situation: str style: str @@ -27,6 +29,7 @@ class ExpressionResponse(BaseModel): class ExpressionListResponse(BaseModel): """表达方式列表响应""" + success: bool total: int page: int @@ -36,12 +39,14 @@ class ExpressionListResponse(BaseModel): class ExpressionDetailResponse(BaseModel): """表达方式详情响应""" + success: bool data: ExpressionResponse class ExpressionCreateRequest(BaseModel): """表达方式创建请求""" + situation: str style: str context: Optional[str] = None @@ -51,6 +56,7 @@ class ExpressionCreateRequest(BaseModel): class ExpressionUpdateRequest(BaseModel): """表达方式更新请求""" + situation: Optional[str] = None style: Optional[str] = None context: Optional[str] = None @@ -60,6 +66,7 @@ class ExpressionUpdateRequest(BaseModel): class ExpressionUpdateResponse(BaseModel): """表达方式更新响应""" + success: bool message: str data: Optional[ExpressionResponse] = None @@ -67,12 +74,14 @@ class ExpressionUpdateResponse(BaseModel): class ExpressionDeleteResponse(BaseModel): """表达方式删除响应""" + success: bool message: str class ExpressionCreateResponse(BaseModel): """表达方式创建响应""" + success: bool message: str data: ExpressionResponse @@ -82,13 +91,13 @@ def verify_auth_token(authorization: Optional[str]) -> bool: """验证认证 Token""" if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="Token 无效或已过期") - + return True @@ -112,64 +121,58 @@ async def get_expression_list( page_size: int = Query(20, ge=1, le=100, description="每页数量"), search: Optional[str] = Query(None, description="搜索关键词"), chat_id: Optional[str] = Query(None, description="聊天ID筛选"), - authorization: Optional[str] = Header(None) + authorization: Optional[str] = Header(None), ): """ 获取表达方式列表 - + Args: page: 页码 (从 1 开始) page_size: 每页数量 (1-100) search: 搜索关键词 (匹配 situation, style, context) chat_id: 聊天ID筛选 authorization: Authorization header - + Returns: 表达方式列表 """ try: verify_auth_token(authorization) - + # 构建查询 query = Expression.select() - + # 搜索过滤 if search: query = query.where( - (Expression.situation.contains(search)) | - (Expression.style.contains(search)) | - (Expression.context.contains(search)) + (Expression.situation.contains(search)) + | (Expression.style.contains(search)) + | (Expression.context.contains(search)) ) - + # 聊天ID过滤 if chat_id: query = query.where(Expression.chat_id == chat_id) - + # 排序:最后活跃时间倒序(NULL 值放在最后) from peewee import Case + query = query.order_by( - Case(None, [(Expression.last_active_time.is_null(), 1)], 0), - Expression.last_active_time.desc() + Case(None, [(Expression.last_active_time.is_null(), 1)], 0), Expression.last_active_time.desc() ) - + # 获取总数 total = query.count() - + # 分页 offset = (page - 1) * page_size expressions = query.offset(offset).limit(page_size) - + # 转换为响应对象 data = [expression_to_response(expr) for expr in expressions] - - return ExpressionListResponse( - success=True, - total=total, - page=page, - page_size=page_size, - data=data - ) - + + return ExpressionListResponse(success=True, total=total, page=page, page_size=page_size, data=data) + except HTTPException: raise except Exception as e: @@ -178,33 +181,27 @@ async def get_expression_list( @router.get("/{expression_id}", response_model=ExpressionDetailResponse) -async def get_expression_detail( - expression_id: int, - authorization: Optional[str] = Header(None) -): +async def get_expression_detail(expression_id: int, authorization: Optional[str] = Header(None)): """ 获取表达方式详细信息 - + Args: expression_id: 表达方式ID authorization: Authorization header - + Returns: 表达方式详细信息 """ try: verify_auth_token(authorization) - + expression = Expression.get_or_none(Expression.id == expression_id) - + if not expression: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {expression_id} 的表达方式") - - return ExpressionDetailResponse( - success=True, - data=expression_to_response(expression) - ) - + + return ExpressionDetailResponse(success=True, data=expression_to_response(expression)) + except HTTPException: raise except Exception as e: @@ -213,25 +210,22 @@ async def get_expression_detail( @router.post("/", response_model=ExpressionCreateResponse) -async def create_expression( - request: ExpressionCreateRequest, - authorization: Optional[str] = Header(None) -): +async def create_expression(request: ExpressionCreateRequest, authorization: Optional[str] = Header(None)): """ 创建新的表达方式 - + Args: request: 创建请求 authorization: Authorization header - + Returns: 创建结果 """ try: verify_auth_token(authorization) - + current_time = time.time() - + # 创建表达方式 expression = Expression.create( situation=request.situation, @@ -242,15 +236,13 @@ async def create_expression( last_active_time=current_time, create_date=current_time, ) - + logger.info(f"表达方式已创建: ID={expression.id}, situation={request.situation}") - + return ExpressionCreateResponse( - success=True, - message="表达方式创建成功", - data=expression_to_response(expression) + success=True, message="表达方式创建成功", data=expression_to_response(expression) ) - + except HTTPException: raise except Exception as e: @@ -260,52 +252,48 @@ async def create_expression( @router.patch("/{expression_id}", response_model=ExpressionUpdateResponse) async def update_expression( - expression_id: int, - request: ExpressionUpdateRequest, - authorization: Optional[str] = Header(None) + expression_id: int, request: ExpressionUpdateRequest, authorization: Optional[str] = Header(None) ): """ 增量更新表达方式(只更新提供的字段) - + Args: expression_id: 表达方式ID request: 更新请求(只包含需要更新的字段) authorization: Authorization header - + Returns: 更新结果 """ try: verify_auth_token(authorization) - + expression = Expression.get_or_none(Expression.id == expression_id) - + if not expression: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {expression_id} 的表达方式") - + # 只更新提供的字段 update_data = request.model_dump(exclude_unset=True) - + if not update_data: raise HTTPException(status_code=400, detail="未提供任何需要更新的字段") - + # 更新最后活跃时间 - update_data['last_active_time'] = time.time() - + update_data["last_active_time"] = time.time() + # 执行更新 for field, value in update_data.items(): setattr(expression, field, value) - + expression.save() - + logger.info(f"表达方式已更新: ID={expression_id}, 字段: {list(update_data.keys())}") - + return ExpressionUpdateResponse( - success=True, - message=f"成功更新 {len(update_data)} 个字段", - data=expression_to_response(expression) + success=True, message=f"成功更新 {len(update_data)} 个字段", data=expression_to_response(expression) ) - + except HTTPException: raise except Exception as e: @@ -314,41 +302,35 @@ async def update_expression( @router.delete("/{expression_id}", response_model=ExpressionDeleteResponse) -async def delete_expression( - expression_id: int, - authorization: Optional[str] = Header(None) -): +async def delete_expression(expression_id: int, authorization: Optional[str] = Header(None)): """ 删除表达方式 - + Args: expression_id: 表达方式ID authorization: Authorization header - + Returns: 删除结果 """ try: verify_auth_token(authorization) - + expression = Expression.get_or_none(Expression.id == expression_id) - + if not expression: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {expression_id} 的表达方式") - + # 记录删除信息 situation = expression.situation - + # 执行删除 expression.delete_instance() - + logger.info(f"表达方式已删除: ID={expression_id}, situation={situation}") - - return ExpressionDeleteResponse( - success=True, - message=f"成功删除表达方式: {situation}" - ) - + + return ExpressionDeleteResponse(success=True, message=f"成功删除表达方式: {situation}") + except HTTPException: raise except Exception as e: @@ -356,47 +338,93 @@ async def delete_expression( raise HTTPException(status_code=500, detail=f"删除表达方式失败: {str(e)}") from e +class BatchDeleteRequest(BaseModel): + """批量删除请求""" + + ids: List[int] + + +@router.post("/batch/delete", response_model=ExpressionDeleteResponse) +async def batch_delete_expressions(request: BatchDeleteRequest, authorization: Optional[str] = Header(None)): + """ + 批量删除表达方式 + + Args: + request: 包含要删除的ID列表的请求 + authorization: Authorization header + + Returns: + 删除结果 + """ + try: + verify_auth_token(authorization) + + if not request.ids: + raise HTTPException(status_code=400, detail="未提供要删除的表达方式ID") + + # 查找所有要删除的表达方式 + expressions = Expression.select().where(Expression.id.in_(request.ids)) + found_ids = [expr.id for expr in expressions] + + # 检查是否有未找到的ID + not_found_ids = set(request.ids) - set(found_ids) + if not_found_ids: + logger.warning(f"部分表达方式未找到: {not_found_ids}") + + # 执行批量删除 + deleted_count = Expression.delete().where(Expression.id.in_(found_ids)).execute() + + logger.info(f"批量删除了 {deleted_count} 个表达方式") + + return ExpressionDeleteResponse(success=True, message=f"成功删除 {deleted_count} 个表达方式") + + except HTTPException: + raise + except Exception as e: + logger.exception(f"批量删除表达方式失败: {e}") + raise HTTPException(status_code=500, detail=f"批量删除表达方式失败: {str(e)}") from e + + @router.get("/stats/summary") -async def get_expression_stats( - authorization: Optional[str] = Header(None) -): +async def get_expression_stats(authorization: Optional[str] = Header(None)): """ 获取表达方式统计数据 - + Args: authorization: Authorization header - + Returns: 统计数据 """ try: verify_auth_token(authorization) - + total = Expression.select().count() - + # 按 chat_id 统计 chat_stats = {} for expr in Expression.select(Expression.chat_id): chat_id = expr.chat_id chat_stats[chat_id] = chat_stats.get(chat_id, 0) + 1 - + # 获取最近创建的记录数(7天内) seven_days_ago = time.time() - (7 * 24 * 60 * 60) - recent = Expression.select().where( - (Expression.create_date.is_null(False)) & - (Expression.create_date >= seven_days_ago) - ).count() - + recent = ( + Expression.select() + .where((Expression.create_date.is_null(False)) & (Expression.create_date >= seven_days_ago)) + .count() + ) + return { "success": True, "data": { "total": total, "recent_7days": recent, "chat_count": len(chat_stats), - "top_chats": dict(sorted(chat_stats.items(), key=lambda x: x[1], reverse=True)[:10]) - } + "top_chats": dict(sorted(chat_stats.items(), key=lambda x: x[1], reverse=True)[:10]), + }, } - + except HTTPException: raise except Exception as e: diff --git a/src/webui/git_mirror_service.py b/src/webui/git_mirror_service.py index 02645f70..df00cde9 100644 --- a/src/webui/git_mirror_service.py +++ b/src/webui/git_mirror_service.py @@ -1,4 +1,5 @@ """Git 镜像源服务 - 支持多镜像源、错误重试、Git 克隆和 Raw 文件获取""" + from typing import Optional, List, Dict, Any from enum import Enum import httpx @@ -15,6 +16,7 @@ logger = get_logger("webui.git_mirror") # 导入进度更新函数(避免循环导入) _update_progress = None + def set_update_progress_callback(callback): """设置进度更新回调函数""" global _update_progress @@ -23,6 +25,7 @@ def set_update_progress_callback(callback): class MirrorType(str, Enum): """镜像源类型""" + GH_PROXY = "gh-proxy" # gh-proxy 主节点 HK_GH_PROXY = "hk-gh-proxy" # gh-proxy 香港节点 CDN_GH_PROXY = "cdn-gh-proxy" # gh-proxy CDN 节点 @@ -34,10 +37,10 @@ class MirrorType(str, Enum): class GitMirrorConfig: """Git 镜像源配置管理""" - + # 配置文件路径 CONFIG_FILE = Path("data/webui.json") - + # 默认镜像源配置 DEFAULT_MIRRORS = [ { @@ -47,7 +50,7 @@ class GitMirrorConfig: "clone_prefix": "https://gh-proxy.org/https://github.com", "enabled": True, "priority": 1, - "created_at": None + "created_at": None, }, { "id": "hk-gh-proxy", @@ -56,7 +59,7 @@ class GitMirrorConfig: "clone_prefix": "https://hk.gh-proxy.org/https://github.com", "enabled": True, "priority": 2, - "created_at": None + "created_at": None, }, { "id": "cdn-gh-proxy", @@ -65,7 +68,7 @@ class GitMirrorConfig: "clone_prefix": "https://cdn.gh-proxy.org/https://github.com", "enabled": True, "priority": 3, - "created_at": None + "created_at": None, }, { "id": "edgeone-gh-proxy", @@ -74,7 +77,7 @@ class GitMirrorConfig: "clone_prefix": "https://edgeone.gh-proxy.org/https://github.com", "enabled": True, "priority": 4, - "created_at": None + "created_at": None, }, { "id": "meyzh-github", @@ -83,7 +86,7 @@ class GitMirrorConfig: "clone_prefix": "https://meyzh.github.io/https://github.com", "enabled": True, "priority": 5, - "created_at": None + "created_at": None, }, { "id": "github", @@ -92,23 +95,23 @@ class GitMirrorConfig: "clone_prefix": "https://github.com", "enabled": True, "priority": 999, - "created_at": None - } + "created_at": None, + }, ] - + def __init__(self): """初始化配置管理器""" self.config_file = self.CONFIG_FILE self.mirrors: List[Dict[str, Any]] = [] self._load_config() - + def _load_config(self) -> None: """加载配置文件""" try: if self.config_file.exists(): - with open(self.config_file, 'r', encoding='utf-8') as f: + with open(self.config_file, "r", encoding="utf-8") as f: data = json.load(f) - + # 检查是否有镜像源配置 if "git_mirrors" not in data or not data["git_mirrors"]: logger.info("配置文件中未找到镜像源配置,使用默认配置") @@ -122,59 +125,59 @@ class GitMirrorConfig: except Exception as e: logger.error(f"加载配置文件失败: {e}") self._init_default_mirrors() - + def _init_default_mirrors(self) -> None: """初始化默认镜像源""" current_time = datetime.now().isoformat() self.mirrors = [] - + for mirror in self.DEFAULT_MIRRORS: mirror_copy = mirror.copy() mirror_copy["created_at"] = current_time self.mirrors.append(mirror_copy) - + self._save_config() logger.info(f"已初始化 {len(self.mirrors)} 个默认镜像源") - + def _save_config(self) -> None: """保存配置到文件""" try: # 确保目录存在 self.config_file.parent.mkdir(parents=True, exist_ok=True) - + # 读取现有配置 existing_data = {} if self.config_file.exists(): - with open(self.config_file, 'r', encoding='utf-8') as f: + with open(self.config_file, "r", encoding="utf-8") as f: existing_data = json.load(f) - + # 更新镜像源配置 existing_data["git_mirrors"] = self.mirrors - + # 写入文件 - with open(self.config_file, 'w', encoding='utf-8') as f: + with open(self.config_file, "w", encoding="utf-8") as f: json.dump(existing_data, f, indent=2, ensure_ascii=False) - + logger.debug(f"配置已保存到 {self.config_file}") except Exception as e: logger.error(f"保存配置文件失败: {e}") - + def get_all_mirrors(self) -> List[Dict[str, Any]]: """获取所有镜像源""" return self.mirrors.copy() - + def get_enabled_mirrors(self) -> List[Dict[str, Any]]: """获取所有启用的镜像源,按优先级排序""" enabled = [m for m in self.mirrors if m.get("enabled", False)] return sorted(enabled, key=lambda x: x.get("priority", 999)) - + def get_mirror_by_id(self, mirror_id: str) -> Optional[Dict[str, Any]]: """根据 ID 获取镜像源""" for mirror in self.mirrors: if mirror.get("id") == mirror_id: return mirror.copy() return None - + def add_mirror( self, mirror_id: str, @@ -182,26 +185,26 @@ class GitMirrorConfig: raw_prefix: str, clone_prefix: str, enabled: bool = True, - priority: Optional[int] = None + priority: Optional[int] = None, ) -> Dict[str, Any]: """ 添加新的镜像源 - + Returns: 添加的镜像源配置 - + Raises: ValueError: 如果镜像源 ID 已存在 """ # 检查 ID 是否已存在 if self.get_mirror_by_id(mirror_id): raise ValueError(f"镜像源 ID 已存在: {mirror_id}") - + # 如果未指定优先级,使用最大优先级 + 1 if priority is None: max_priority = max((m.get("priority", 0) for m in self.mirrors), default=0) priority = max_priority + 1 - + new_mirror = { "id": mirror_id, "name": name, @@ -209,15 +212,15 @@ class GitMirrorConfig: "clone_prefix": clone_prefix, "enabled": enabled, "priority": priority, - "created_at": datetime.now().isoformat() + "created_at": datetime.now().isoformat(), } - + self.mirrors.append(new_mirror) self._save_config() - + logger.info(f"已添加镜像源: {mirror_id} - {name}") return new_mirror.copy() - + def update_mirror( self, mirror_id: str, @@ -225,11 +228,11 @@ class GitMirrorConfig: raw_prefix: Optional[str] = None, clone_prefix: Optional[str] = None, enabled: Optional[bool] = None, - priority: Optional[int] = None + priority: Optional[int] = None, ) -> Optional[Dict[str, Any]]: """ 更新镜像源配置 - + Returns: 更新后的镜像源配置,如果不存在则返回 None """ @@ -245,19 +248,19 @@ class GitMirrorConfig: mirror["enabled"] = enabled if priority is not None: mirror["priority"] = priority - + mirror["updated_at"] = datetime.now().isoformat() self._save_config() - + logger.info(f"已更新镜像源: {mirror_id}") return mirror.copy() - + return None - + def delete_mirror(self, mirror_id: str) -> bool: """ 删除镜像源 - + Returns: True 如果删除成功,False 如果镜像源不存在 """ @@ -267,9 +270,9 @@ class GitMirrorConfig: self._save_config() logger.info(f"已删除镜像源: {mirror_id}") return True - + return False - + def get_default_priority_list(self) -> List[str]: """获取默认优先级列表(仅启用的镜像源 ID)""" enabled = self.get_enabled_mirrors() @@ -278,16 +281,11 @@ class GitMirrorConfig: class GitMirrorService: """Git 镜像源服务""" - - def __init__( - self, - max_retries: int = 3, - timeout: int = 30, - config: Optional[GitMirrorConfig] = None - ): + + def __init__(self, max_retries: int = 3, timeout: int = 30, config: Optional[GitMirrorConfig] = None): """ 初始化 Git 镜像源服务 - + Args: max_retries: 最大重试次数 timeout: 请求超时时间(秒) @@ -297,16 +295,16 @@ class GitMirrorService: self.timeout = timeout self.config = config or GitMirrorConfig() logger.info(f"Git镜像源服务初始化完成,已加载 {len(self.config.get_enabled_mirrors())} 个启用的镜像源") - + def get_mirror_config(self) -> GitMirrorConfig: """获取镜像源配置管理器""" return self.config - + @staticmethod def check_git_installed() -> Dict[str, Any]: """ 检查本机是否安装了 Git - + Returns: Dict 包含: - installed: bool - 是否已安装 Git @@ -316,54 +314,33 @@ class GitMirrorService: """ import subprocess import shutil - + try: # 查找 git 可执行文件路径 git_path = shutil.which("git") - + if not git_path: logger.warning("未找到 Git 可执行文件") - return { - "installed": False, - "error": "系统中未找到 Git,请先安装 Git" - } - + return {"installed": False, "error": "系统中未找到 Git,请先安装 Git"} + # 获取 Git 版本 - result = subprocess.run( - ["git", "--version"], - capture_output=True, - text=True, - timeout=5 - ) - + result = subprocess.run(["git", "--version"], capture_output=True, text=True, timeout=5) + if result.returncode == 0: version = result.stdout.strip() logger.info(f"检测到 Git: {version} at {git_path}") - return { - "installed": True, - "version": version, - "path": git_path - } + return {"installed": True, "version": version, "path": git_path} else: logger.warning(f"Git 命令执行失败: {result.stderr}") - return { - "installed": False, - "error": f"Git 命令执行失败: {result.stderr}" - } - + return {"installed": False, "error": f"Git 命令执行失败: {result.stderr}"} + except subprocess.TimeoutExpired: logger.error("Git 版本检测超时") - return { - "installed": False, - "error": "Git 版本检测超时" - } + return {"installed": False, "error": "Git 版本检测超时"} except Exception as e: logger.error(f"检测 Git 时发生错误: {e}") - return { - "installed": False, - "error": f"检测 Git 时发生错误: {str(e)}" - } - + return {"installed": False, "error": f"检测 Git 时发生错误: {str(e)}"} + async def fetch_raw_file( self, owner: str, @@ -371,11 +348,11 @@ class GitMirrorService: branch: str, file_path: str, mirror_id: Optional[str] = None, - custom_url: Optional[str] = None + custom_url: Optional[str] = None, ) -> Dict[str, Any]: """ 获取 GitHub 仓库的 Raw 文件内容 - + Args: owner: 仓库所有者 repo: 仓库名称 @@ -383,7 +360,7 @@ class GitMirrorService: file_path: 文件路径 mirror_id: 指定的镜像源 ID custom_url: 自定义完整 URL(如果提供,将忽略其他参数) - + Returns: Dict 包含: - success: bool - 是否成功 @@ -393,29 +370,24 @@ class GitMirrorService: - attempts: int - 尝试次数 """ logger.info(f"开始获取 Raw 文件: {owner}/{repo}/{branch}/{file_path}") - + if custom_url: # 使用自定义 URL return await self._fetch_with_url(custom_url, "custom") - + # 确定要使用的镜像源列表 if mirror_id: # 使用指定的镜像源 mirror = self.config.get_mirror_by_id(mirror_id) if not mirror: - return { - "success": False, - "error": f"未找到镜像源: {mirror_id}", - "mirror_used": None, - "attempts": 0 - } + return {"success": False, "error": f"未找到镜像源: {mirror_id}", "mirror_used": None, "attempts": 0} mirrors_to_try = [mirror] else: # 使用所有启用的镜像源 mirrors_to_try = self.config.get_enabled_mirrors() - + total_mirrors = len(mirrors_to_try) - + # 依次尝试每个镜像源 for index, mirror in enumerate(mirrors_to_try, 1): # 推送进度:正在尝试第 N 个镜像源 @@ -427,15 +399,13 @@ class GitMirrorService: progress=progress, message=f"正在尝试镜像源 {index}/{total_mirrors}: {mirror['name']}", total_plugins=0, - loaded_plugins=0 + loaded_plugins=0, ) except Exception as e: logger.warning(f"推送进度失败: {e}") - - result = await self._fetch_raw_from_mirror( - owner, repo, branch, file_path, mirror - ) - + + result = await self._fetch_raw_from_mirror(owner, repo, branch, file_path, mirror) + if result["success"]: # 成功,推送进度 if _update_progress: @@ -445,15 +415,15 @@ class GitMirrorService: progress=70, message=f"成功从 {mirror['name']} 获取数据", total_plugins=0, - loaded_plugins=0 + loaded_plugins=0, ) except Exception as e: logger.warning(f"推送进度失败: {e}") return result - + # 失败,记录日志并推送失败信息 logger.warning(f"镜像源 {mirror['id']} 失败: {result.get('error')}") - + if _update_progress and index < total_mirrors: try: await _update_progress( @@ -461,39 +431,29 @@ class GitMirrorService: progress=30 + int(index / total_mirrors * 40), message=f"镜像源 {mirror['name']} 失败,尝试下一个...", total_plugins=0, - loaded_plugins=0 + loaded_plugins=0, ) except Exception as e: logger.warning(f"推送进度失败: {e}") - + # 所有镜像源都失败 - return { - "success": False, - "error": "所有镜像源均失败", - "mirror_used": None, - "attempts": len(mirrors_to_try) - } - + return {"success": False, "error": "所有镜像源均失败", "mirror_used": None, "attempts": len(mirrors_to_try)} + async def _fetch_raw_from_mirror( - self, - owner: str, - repo: str, - branch: str, - file_path: str, - mirror: Dict[str, Any] + self, owner: str, repo: str, branch: str, file_path: str, mirror: Dict[str, Any] ) -> Dict[str, Any]: """从指定镜像源获取文件""" # 构建 URL raw_prefix = mirror["raw_prefix"] url = f"{raw_prefix}/{owner}/{repo}/{branch}/{file_path}" - + return await self._fetch_with_url(url, mirror["id"]) - + async def _fetch_with_url(self, url: str, mirror_type: str) -> Dict[str, Any]: """使用指定 URL 获取文件,支持重试""" attempts = 0 last_error = None - + for attempt in range(self.max_retries): attempts += 1 try: @@ -501,14 +461,14 @@ class GitMirrorService: async with httpx.AsyncClient(timeout=self.timeout) as client: response = await client.get(url) response.raise_for_status() - + logger.info(f"成功获取文件: {url}") return { "success": True, "data": response.text, "mirror_used": mirror_type, "attempts": attempts, - "url": url + "url": url, } except httpx.HTTPStatusError as e: last_error = f"HTTP {e.response.status_code}: {e}" @@ -519,15 +479,9 @@ class GitMirrorService: except Exception as e: last_error = f"未知错误: {e}" logger.error(f"错误 (尝试 {attempt + 1}/{self.max_retries}): {last_error}") - - return { - "success": False, - "error": last_error, - "mirror_used": mirror_type, - "attempts": attempts, - "url": url - } - + + return {"success": False, "error": last_error, "mirror_used": mirror_type, "attempts": attempts, "url": url} + async def clone_repository( self, owner: str, @@ -536,11 +490,11 @@ class GitMirrorService: branch: Optional[str] = None, mirror_id: Optional[str] = None, custom_url: Optional[str] = None, - depth: Optional[int] = None + depth: Optional[int] = None, ) -> Dict[str, Any]: """ 克隆 GitHub 仓库 - + Args: owner: 仓库所有者 repo: 仓库名称 @@ -549,7 +503,7 @@ class GitMirrorService: mirror_id: 指定的镜像源 ID custom_url: 自定义克隆 URL depth: 克隆深度(浅克隆) - + Returns: Dict 包含: - success: bool - 是否成功 @@ -559,44 +513,32 @@ class GitMirrorService: - attempts: int - 尝试次数 """ logger.info(f"开始克隆仓库: {owner}/{repo} 到 {target_path}") - + if custom_url: # 使用自定义 URL return await self._clone_with_url(custom_url, target_path, branch, depth, "custom") - + # 确定要使用的镜像源列表 if mirror_id: # 使用指定的镜像源 mirror = self.config.get_mirror_by_id(mirror_id) if not mirror: - return { - "success": False, - "error": f"未找到镜像源: {mirror_id}", - "mirror_used": None, - "attempts": 0 - } + return {"success": False, "error": f"未找到镜像源: {mirror_id}", "mirror_used": None, "attempts": 0} mirrors_to_try = [mirror] else: # 使用所有启用的镜像源 mirrors_to_try = self.config.get_enabled_mirrors() - + # 依次尝试每个镜像源 for mirror in mirrors_to_try: - result = await self._clone_from_mirror( - owner, repo, target_path, branch, depth, mirror - ) + result = await self._clone_from_mirror(owner, repo, target_path, branch, depth, mirror) if result["success"]: return result logger.warning(f"镜像源 {mirror['id']} 克隆失败: {result.get('error')}") - + # 所有镜像源都失败 - return { - "success": False, - "error": "所有镜像源克隆均失败", - "mirror_used": None, - "attempts": len(mirrors_to_try) - } - + return {"success": False, "error": "所有镜像源克隆均失败", "mirror_used": None, "attempts": len(mirrors_to_try)} + async def _clone_from_mirror( self, owner: str, @@ -604,52 +546,47 @@ class GitMirrorService: target_path: Path, branch: Optional[str], depth: Optional[int], - mirror: Dict[str, Any] + mirror: Dict[str, Any], ) -> Dict[str, Any]: """从指定镜像源克隆仓库""" # 构建克隆 URL clone_prefix = mirror["clone_prefix"] url = f"{clone_prefix}/{owner}/{repo}.git" - + return await self._clone_with_url(url, target_path, branch, depth, mirror["id"]) - + async def _clone_with_url( - self, - url: str, - target_path: Path, - branch: Optional[str], - depth: Optional[int], - mirror_type: str + self, url: str, target_path: Path, branch: Optional[str], depth: Optional[int], mirror_type: str ) -> Dict[str, Any]: """使用指定 URL 克隆仓库,支持重试""" attempts = 0 last_error = None - + for attempt in range(self.max_retries): attempts += 1 - + try: # 确保目标路径不存在 if target_path.exists(): logger.warning(f"目标路径已存在,删除: {target_path}") shutil.rmtree(target_path, ignore_errors=True) - + # 构建 git clone 命令 cmd = ["git", "clone"] - + # 添加分支参数 if branch: cmd.extend(["-b", branch]) - + # 添加深度参数(浅克隆) if depth: cmd.extend(["--depth", str(depth)]) - + # 添加 URL 和目标路径 cmd.extend([url, str(target_path)]) - + logger.info(f"尝试克隆 #{attempt + 1}: {' '.join(cmd)}") - + # 推送进度 if _update_progress: try: @@ -657,24 +594,24 @@ class GitMirrorService: stage="loading", progress=20 + attempt * 10, message=f"正在克隆仓库 (尝试 {attempt + 1}/{self.max_retries})...", - operation="install" + operation="install", ) except Exception as e: logger.warning(f"推送进度失败: {e}") - + # 执行 git clone(在线程池中运行以避免阻塞) loop = asyncio.get_event_loop() - + def run_git_clone(): return subprocess.run( cmd, capture_output=True, text=True, - timeout=300 # 5分钟超时 + timeout=300, # 5分钟超时 ) - + process = await loop.run_in_executor(None, run_git_clone) - + if process.returncode == 0: logger.info(f"成功克隆仓库: {url} -> {target_path}") return { @@ -683,40 +620,34 @@ class GitMirrorService: "mirror_used": mirror_type, "attempts": attempts, "url": url, - "branch": branch or "default" + "branch": branch or "default", } else: last_error = f"Git 克隆失败: {process.stderr}" logger.warning(f"克隆失败 (尝试 {attempt + 1}/{self.max_retries}): {last_error}") - + except subprocess.TimeoutExpired: last_error = "克隆超时(超过 5 分钟)" logger.warning(f"克隆超时 (尝试 {attempt + 1}/{self.max_retries})") - + # 清理可能的部分克隆 if target_path.exists(): shutil.rmtree(target_path, ignore_errors=True) - + except FileNotFoundError: last_error = "Git 未安装或不在 PATH 中" logger.error(f"Git 未找到: {last_error}") break # Git 不存在,不需要重试 - + except Exception as e: last_error = f"未知错误: {e}" logger.error(f"克隆错误 (尝试 {attempt + 1}/{self.max_retries}): {last_error}") - + # 清理可能的部分克隆 if target_path.exists(): shutil.rmtree(target_path, ignore_errors=True) - - return { - "success": False, - "error": last_error, - "mirror_used": mirror_type, - "attempts": attempts, - "url": url - } + + return {"success": False, "error": last_error, "mirror_used": mirror_type, "attempts": attempts, "url": url} # 全局服务实例 diff --git a/src/webui/logs_ws.py b/src/webui/logs_ws.py index d8ef65aa..e0e0a9a1 100644 --- a/src/webui/logs_ws.py +++ b/src/webui/logs_ws.py @@ -1,4 +1,5 @@ """WebSocket 日志推送模块""" + from fastapi import APIRouter, WebSocket, WebSocketDisconnect from typing import Set import json @@ -14,30 +15,30 @@ active_connections: Set[WebSocket] = set() def load_recent_logs(limit: int = 100) -> list[dict]: """从日志文件中加载最近的日志 - + Args: limit: 返回的最大日志条数 - + Returns: 日志列表 """ logs = [] log_dir = Path("logs") - + if not log_dir.exists(): return logs - + # 获取所有日志文件,按修改时间排序 log_files = sorted(log_dir.glob("app_*.log.jsonl"), key=lambda f: f.stat().st_mtime, reverse=True) - + # 用于生成唯一 ID 的计数器 log_counter = 0 - + # 从最新的文件开始读取 for log_file in log_files: if len(logs) >= limit: break - + try: with open(log_file, "r", encoding="utf-8") as f: lines = f.readlines() @@ -49,7 +50,9 @@ def load_recent_logs(limit: int = 100) -> list[dict]: log_entry = json.loads(line.strip()) # 转换为前端期望的格式 # 使用时间戳 + 计数器生成唯一 ID - timestamp_id = log_entry.get("timestamp", "0").replace("-", "").replace(" ", "").replace(":", "") + timestamp_id = ( + log_entry.get("timestamp", "0").replace("-", "").replace(" ", "").replace(":", "") + ) formatted_log = { "id": f"{timestamp_id}_{log_counter}", "timestamp": log_entry.get("timestamp", ""), @@ -64,7 +67,7 @@ def load_recent_logs(limit: int = 100) -> list[dict]: except Exception as e: logger.error(f"读取日志文件失败 {log_file}: {e}") continue - + # 反转列表,使其按时间顺序排列(旧到新) return list(reversed(logs)) @@ -72,35 +75,35 @@ def load_recent_logs(limit: int = 100) -> list[dict]: @router.websocket("/ws/logs") async def websocket_logs(websocket: WebSocket): """WebSocket 日志推送端点 - + 客户端连接后会持续接收服务器端的日志消息 """ await websocket.accept() active_connections.add(websocket) logger.info(f"📡 WebSocket 客户端已连接,当前连接数: {len(active_connections)}") - + # 连接建立后,立即发送历史日志 try: recent_logs = load_recent_logs(limit=100) logger.info(f"发送 {len(recent_logs)} 条历史日志到客户端") - + for log_entry in recent_logs: await websocket.send_text(json.dumps(log_entry, ensure_ascii=False)) except Exception as e: logger.error(f"发送历史日志失败: {e}") - + try: # 保持连接,等待客户端消息或断开 while True: # 接收客户端消息(用于心跳或控制指令) data = await websocket.receive_text() - + # 可以处理客户端的控制消息,例如: # - "ping" -> 心跳检测 # - {"filter": "ERROR"} -> 设置日志级别过滤 if data == "ping": await websocket.send_text("pong") - + except WebSocketDisconnect: active_connections.discard(websocket) logger.info(f"📡 WebSocket 客户端已断开,当前连接数: {len(active_connections)}") @@ -111,19 +114,19 @@ async def websocket_logs(websocket: WebSocket): async def broadcast_log(log_data: dict): """广播日志到所有连接的 WebSocket 客户端 - + Args: log_data: 日志数据字典 """ if not active_connections: return - + # 格式化为 JSON message = json.dumps(log_data, ensure_ascii=False) - + # 记录需要断开的连接 disconnected = set() - + # 广播到所有客户端 for connection in active_connections: try: @@ -131,7 +134,7 @@ async def broadcast_log(log_data: dict): except Exception: # 发送失败,标记为断开 disconnected.add(connection) - + # 清理断开的连接 if disconnected: active_connections.difference_update(disconnected) diff --git a/src/webui/manager.py b/src/webui/manager.py index 3919df17..4dc472e2 100644 --- a/src/webui/manager.py +++ b/src/webui/manager.py @@ -1,4 +1,5 @@ """WebUI 管理器 - 处理开发/生产环境的 WebUI 启动""" + import os from pathlib import Path from src.common.logger import get_logger @@ -10,10 +11,10 @@ logger = get_logger("webui") def setup_webui(mode: str = "production") -> bool: """ 设置 WebUI - + Args: mode: 运行模式,"development" 或 "production" - + Returns: bool: 是否成功设置 """ @@ -22,7 +23,7 @@ def setup_webui(mode: str = "production") -> bool: current_token = token_manager.get_token() logger.info(f"🔑 WebUI Access Token: {current_token}") logger.info("💡 请使用此 Token 登录 WebUI") - + if mode == "development": return setup_dev_mode() else: @@ -33,12 +34,12 @@ def setup_dev_mode() -> bool: """设置开发模式 - 仅启用 CORS,前端自行启动""" from src.common.server import get_global_server from .logs_ws import router as logs_router - + # 注册 WebSocket 日志路由(开发模式也需要) server = get_global_server() server.register_router(logs_router) logger.info("✅ WebSocket 日志推送路由已注册") - + logger.info("📝 WebUI 开发模式已启用") logger.info("🌐 请手动启动前端开发服务器: cd webui && npm run dev") logger.info("💡 前端将运行在 http://localhost:7999") @@ -52,33 +53,33 @@ def setup_production_mode() -> bool: from starlette.responses import FileResponse from .logs_ws import router as logs_router import mimetypes - + # 确保正确的 MIME 类型映射 mimetypes.init() - mimetypes.add_type('application/javascript', '.js') - mimetypes.add_type('application/javascript', '.mjs') - mimetypes.add_type('text/css', '.css') - mimetypes.add_type('application/json', '.json') - + mimetypes.add_type("application/javascript", ".js") + mimetypes.add_type("application/javascript", ".mjs") + mimetypes.add_type("text/css", ".css") + mimetypes.add_type("application/json", ".json") + server = get_global_server() - + # 注册 WebSocket 日志路由 server.register_router(logs_router) logger.info("✅ WebSocket 日志推送路由已注册") - + base_dir = Path(__file__).parent.parent.parent static_path = base_dir / "webui" / "dist" - + if not static_path.exists(): logger.warning(f"❌ WebUI 静态文件目录不存在: {static_path}") logger.warning("💡 请先构建前端: cd webui && npm run build") return False - + if not (static_path / "index.html").exists(): logger.warning(f"❌ 未找到 index.html: {static_path / 'index.html'}") logger.warning("💡 请确认前端已正确构建") return False - + # 处理 SPA 路由 @server.app.get("/{full_path:path}") async def serve_spa(full_path: str): @@ -86,23 +87,23 @@ def setup_production_mode() -> bool: # API 路由不处理 if full_path.startswith("api/"): return None - + # 检查文件是否存在 file_path = static_path / full_path if file_path.is_file(): # 自动检测 MIME 类型 media_type = mimetypes.guess_type(str(file_path))[0] return FileResponse(file_path, media_type=media_type) - + # 返回 index.html(SPA 路由) return FileResponse(static_path / "index.html", media_type="text/html") - + host = os.getenv("HOST", "127.0.0.1") port = os.getenv("PORT", "8000") logger.info("✅ WebUI 生产模式已挂载") logger.info(f"🌐 访问 http://{host}:{port} 查看 WebUI") return True - + except Exception as e: logger.error(f"挂载 WebUI 静态文件失败: {e}") return False diff --git a/src/webui/person_routes.py b/src/webui/person_routes.py index a5488d49..5935a2fa 100644 --- a/src/webui/person_routes.py +++ b/src/webui/person_routes.py @@ -1,4 +1,5 @@ """人物信息管理 API 路由""" + from fastapi import APIRouter, HTTPException, Header, Query from pydantic import BaseModel from typing import Optional, List, Dict @@ -16,6 +17,7 @@ router = APIRouter(prefix="/person", tags=["Person"]) class PersonInfoResponse(BaseModel): """人物信息响应""" + id: int is_known: bool person_id: str @@ -33,6 +35,7 @@ class PersonInfoResponse(BaseModel): class PersonListResponse(BaseModel): """人物列表响应""" + success: bool total: int page: int @@ -42,12 +45,14 @@ class PersonListResponse(BaseModel): class PersonDetailResponse(BaseModel): """人物详情响应""" + success: bool data: PersonInfoResponse class PersonUpdateRequest(BaseModel): """人物信息更新请求""" + person_name: Optional[str] = None name_reason: Optional[str] = None nickname: Optional[str] = None @@ -57,6 +62,7 @@ class PersonUpdateRequest(BaseModel): class PersonUpdateResponse(BaseModel): """人物信息更新响应""" + success: bool message: str data: Optional[PersonInfoResponse] = None @@ -64,21 +70,38 @@ class PersonUpdateResponse(BaseModel): class PersonDeleteResponse(BaseModel): """人物删除响应""" + success: bool message: str +class BatchDeleteRequest(BaseModel): + """批量删除请求""" + + person_ids: List[str] + + +class BatchDeleteResponse(BaseModel): + """批量删除响应""" + + success: bool + message: str + deleted_count: int + failed_count: int + failed_ids: List[str] = [] + + def verify_auth_token(authorization: Optional[str]) -> bool: """验证认证 Token""" if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="Token 无效或已过期") - + return True @@ -118,11 +141,11 @@ async def get_person_list( search: Optional[str] = Query(None, description="搜索关键词"), is_known: Optional[bool] = Query(None, description="是否已认识筛选"), platform: Optional[str] = Query(None, description="平台筛选"), - authorization: Optional[str] = Header(None) + authorization: Optional[str] = Header(None), ): """ 获取人物信息列表 - + Args: page: 页码 (从 1 开始) page_size: 每页数量 (1-100) @@ -130,58 +153,50 @@ async def get_person_list( is_known: 是否已认识筛选 platform: 平台筛选 authorization: Authorization header - + Returns: 人物信息列表 """ try: verify_auth_token(authorization) - + # 构建查询 query = PersonInfo.select() - + # 搜索过滤 if search: query = query.where( - (PersonInfo.person_name.contains(search)) | - (PersonInfo.nickname.contains(search)) | - (PersonInfo.user_id.contains(search)) + (PersonInfo.person_name.contains(search)) + | (PersonInfo.nickname.contains(search)) + | (PersonInfo.user_id.contains(search)) ) - + # 已认识状态过滤 if is_known is not None: query = query.where(PersonInfo.is_known == is_known) - + # 平台过滤 if platform: query = query.where(PersonInfo.platform == platform) - + # 排序:最后更新时间倒序(NULL 值放在最后) # Peewee 不支持 nulls_last,使用 CASE WHEN 来实现 from peewee import Case - query = query.order_by( - Case(None, [(PersonInfo.last_know.is_null(), 1)], 0), - PersonInfo.last_know.desc() - ) - + + query = query.order_by(Case(None, [(PersonInfo.last_know.is_null(), 1)], 0), PersonInfo.last_know.desc()) + # 获取总数 total = query.count() - + # 分页 offset = (page - 1) * page_size persons = query.offset(offset).limit(page_size) - + # 转换为响应对象 data = [person_to_response(person) for person in persons] - - return PersonListResponse( - success=True, - total=total, - page=page, - page_size=page_size, - data=data - ) - + + return PersonListResponse(success=True, total=total, page=page, page_size=page_size, data=data) + except HTTPException: raise except Exception as e: @@ -190,33 +205,27 @@ async def get_person_list( @router.get("/{person_id}", response_model=PersonDetailResponse) -async def get_person_detail( - person_id: str, - authorization: Optional[str] = Header(None) -): +async def get_person_detail(person_id: str, authorization: Optional[str] = Header(None)): """ 获取人物详细信息 - + Args: person_id: 人物唯一 ID authorization: Authorization header - + Returns: 人物详细信息 """ try: verify_auth_token(authorization) - + person = PersonInfo.get_or_none(PersonInfo.person_id == person_id) - + if not person: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {person_id} 的人物信息") - - return PersonDetailResponse( - success=True, - data=person_to_response(person) - ) - + + return PersonDetailResponse(success=True, data=person_to_response(person)) + except HTTPException: raise except Exception as e: @@ -225,53 +234,47 @@ async def get_person_detail( @router.patch("/{person_id}", response_model=PersonUpdateResponse) -async def update_person( - person_id: str, - request: PersonUpdateRequest, - authorization: Optional[str] = Header(None) -): +async def update_person(person_id: str, request: PersonUpdateRequest, authorization: Optional[str] = Header(None)): """ 增量更新人物信息(只更新提供的字段) - + Args: person_id: 人物唯一 ID request: 更新请求(只包含需要更新的字段) authorization: Authorization header - + Returns: 更新结果 """ try: verify_auth_token(authorization) - + person = PersonInfo.get_or_none(PersonInfo.person_id == person_id) - + if not person: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {person_id} 的人物信息") - + # 只更新提供的字段 update_data = request.model_dump(exclude_unset=True) - + if not update_data: raise HTTPException(status_code=400, detail="未提供任何需要更新的字段") - + # 更新最后修改时间 - update_data['last_know'] = time.time() - + update_data["last_know"] = time.time() + # 执行更新 for field, value in update_data.items(): setattr(person, field, value) - + person.save() - + logger.info(f"人物信息已更新: {person_id}, 字段: {list(update_data.keys())}") - + return PersonUpdateResponse( - success=True, - message=f"成功更新 {len(update_data)} 个字段", - data=person_to_response(person) + success=True, message=f"成功更新 {len(update_data)} 个字段", data=person_to_response(person) ) - + except HTTPException: raise except Exception as e: @@ -280,41 +283,35 @@ async def update_person( @router.delete("/{person_id}", response_model=PersonDeleteResponse) -async def delete_person( - person_id: str, - authorization: Optional[str] = Header(None) -): +async def delete_person(person_id: str, authorization: Optional[str] = Header(None)): """ 删除人物信息 - + Args: person_id: 人物唯一 ID authorization: Authorization header - + Returns: 删除结果 """ try: verify_auth_token(authorization) - + person = PersonInfo.get_or_none(PersonInfo.person_id == person_id) - + if not person: raise HTTPException(status_code=404, detail=f"未找到 ID 为 {person_id} 的人物信息") - + # 记录删除信息 person_name = person.person_name or person.nickname or person.user_id - + # 执行删除 person.delete_instance() - + logger.info(f"人物信息已删除: {person_id} ({person_name})") - - return PersonDeleteResponse( - success=True, - message=f"成功删除人物信息: {person_name}" - ) - + + return PersonDeleteResponse(success=True, message=f"成功删除人物信息: {person_name}") + except HTTPException: raise except Exception as e: @@ -323,43 +320,89 @@ async def delete_person( @router.get("/stats/summary") -async def get_person_stats( - authorization: Optional[str] = Header(None) -): +async def get_person_stats(authorization: Optional[str] = Header(None)): """ 获取人物信息统计数据 - + Args: authorization: Authorization header - + Returns: 统计数据 """ try: verify_auth_token(authorization) - + total = PersonInfo.select().count() known = PersonInfo.select().where(PersonInfo.is_known).count() unknown = total - known - + # 按平台统计 platforms = {} for person in PersonInfo.select(PersonInfo.platform): platform = person.platform platforms[platform] = platforms.get(platform, 0) + 1 - - return { - "success": True, - "data": { - "total": total, - "known": known, - "unknown": unknown, - "platforms": platforms - } - } - + + return {"success": True, "data": {"total": total, "known": known, "unknown": unknown, "platforms": platforms}} + except HTTPException: raise except Exception as e: logger.exception(f"获取统计数据失败: {e}") raise HTTPException(status_code=500, detail=f"获取统计数据失败: {str(e)}") from e + + +@router.post("/batch/delete", response_model=BatchDeleteResponse) +async def batch_delete_persons(request: BatchDeleteRequest, authorization: Optional[str] = Header(None)): + """ + 批量删除人物信息 + + Args: + request: 包含person_ids列表的请求 + authorization: Authorization header + + Returns: + 批量删除结果 + """ + try: + verify_auth_token(authorization) + + if not request.person_ids: + raise HTTPException(status_code=400, detail="未提供要删除的人物ID") + + deleted_count = 0 + failed_count = 0 + failed_ids = [] + + for person_id in request.person_ids: + try: + person = PersonInfo.get_or_none(PersonInfo.person_id == person_id) + if person: + person.delete_instance() + deleted_count += 1 + logger.info(f"批量删除: {person_id}") + else: + failed_count += 1 + failed_ids.append(person_id) + except Exception as e: + logger.error(f"删除 {person_id} 失败: {e}") + failed_count += 1 + failed_ids.append(person_id) + + message = f"成功删除 {deleted_count} 个人物" + if failed_count > 0: + message += f",{failed_count} 个失败" + + return BatchDeleteResponse( + success=True, + message=message, + deleted_count=deleted_count, + failed_count=failed_count, + failed_ids=failed_ids, + ) + + except HTTPException: + raise + except Exception as e: + logger.exception(f"批量删除人物信息失败: {e}") + raise HTTPException(status_code=500, detail=f"批量删除失败: {str(e)}") from e diff --git a/src/webui/plugin_progress_ws.py b/src/webui/plugin_progress_ws.py index 927dbb13..7e0fb647 100644 --- a/src/webui/plugin_progress_ws.py +++ b/src/webui/plugin_progress_ws.py @@ -1,4 +1,5 @@ """WebSocket 插件加载进度推送模块""" + from fastapi import APIRouter, WebSocket, WebSocketDisconnect from typing import Set, Dict, Any import json @@ -22,7 +23,7 @@ current_progress: Dict[str, Any] = { "error": None, "plugin_id": None, # 当前操作的插件 ID "total_plugins": 0, - "loaded_plugins": 0 + "loaded_plugins": 0, } @@ -30,20 +31,20 @@ async def broadcast_progress(progress_data: Dict[str, Any]): """广播进度更新到所有连接的客户端""" global current_progress current_progress = progress_data.copy() - + if not active_connections: return - + message = json.dumps(progress_data, ensure_ascii=False) disconnected = set() - + for websocket in active_connections: try: await websocket.send_text(message) except Exception as e: logger.error(f"发送进度更新失败: {e}") disconnected.add(websocket) - + # 移除断开的连接 for websocket in disconnected: active_connections.discard(websocket) @@ -57,10 +58,10 @@ async def update_progress( error: str = None, plugin_id: str = None, total_plugins: int = 0, - loaded_plugins: int = 0 + loaded_plugins: int = 0, ): """更新并广播进度 - + Args: stage: 阶段 (idle, loading, success, error) progress: 进度百分比 (0-100) @@ -80,9 +81,9 @@ async def update_progress( "plugin_id": plugin_id, "total_plugins": total_plugins, "loaded_plugins": loaded_plugins, - "timestamp": asyncio.get_event_loop().time() + "timestamp": asyncio.get_event_loop().time(), } - + await broadcast_progress(progress_data) logger.debug(f"进度更新: [{operation}] {stage} - {progress}% - {message}") @@ -90,30 +91,30 @@ async def update_progress( @router.websocket("/ws/plugin-progress") async def websocket_plugin_progress(websocket: WebSocket): """WebSocket 插件加载进度推送端点 - + 客户端连接后会立即收到当前进度状态 """ await websocket.accept() active_connections.add(websocket) logger.info(f"📡 插件进度 WebSocket 客户端已连接,当前连接数: {len(active_connections)}") - + try: # 发送当前进度状态 await websocket.send_text(json.dumps(current_progress, ensure_ascii=False)) - + # 保持连接并处理客户端消息 while True: try: data = await websocket.receive_text() - + # 处理客户端心跳 if data == "ping": await websocket.send_text("pong") - + except Exception as e: logger.error(f"处理客户端消息时出错: {e}") break - + except WebSocketDisconnect: active_connections.discard(websocket) logger.info(f"📡 插件进度 WebSocket 客户端已断开,当前连接数: {len(active_connections)}") diff --git a/src/webui/plugin_routes.py b/src/webui/plugin_routes.py index 5054a391..cb559fb7 100644 --- a/src/webui/plugin_routes.py +++ b/src/webui/plugin_routes.py @@ -21,22 +21,22 @@ set_update_progress_callback(update_progress) def parse_version(version_str: str) -> tuple[int, int, int]: """ 解析版本号字符串 - + 支持格式: - 0.11.2 -> (0, 11, 2) - 0.11.2.snapshot.2 -> (0, 11, 2) - + Returns: (major, minor, patch) 三元组 """ # 移除 snapshot 等后缀 - base_version = version_str.split('.snapshot')[0].split('.dev')[0].split('.alpha')[0].split('.beta')[0] - - parts = base_version.split('.') + base_version = version_str.split(".snapshot")[0].split(".dev")[0].split(".alpha")[0].split(".beta")[0] + + parts = base_version.split(".") if len(parts) < 3: # 补齐到 3 位 - parts.extend(['0'] * (3 - len(parts))) - + parts.extend(["0"] * (3 - len(parts))) + try: major = int(parts[0]) minor = int(parts[1]) @@ -49,8 +49,10 @@ def parse_version(version_str: str) -> tuple[int, int, int]: # ============ 请求/响应模型 ============ + class FetchRawFileRequest(BaseModel): """获取 Raw 文件请求""" + owner: str = Field(..., description="仓库所有者", example="MaiM-with-u") repo: str = Field(..., description="仓库名称", example="plugin-repo") branch: str = Field(..., description="分支名称", example="main") @@ -61,6 +63,7 @@ class FetchRawFileRequest(BaseModel): class FetchRawFileResponse(BaseModel): """获取 Raw 文件响应""" + success: bool = Field(..., description="是否成功") data: Optional[str] = Field(None, description="文件内容") error: Optional[str] = Field(None, description="错误信息") @@ -71,6 +74,7 @@ class FetchRawFileResponse(BaseModel): class CloneRepositoryRequest(BaseModel): """克隆仓库请求""" + owner: str = Field(..., description="仓库所有者", example="MaiM-with-u") repo: str = Field(..., description="仓库名称", example="plugin-repo") target_path: str = Field(..., description="目标路径(相对于插件目录)") @@ -82,6 +86,7 @@ class CloneRepositoryRequest(BaseModel): class CloneRepositoryResponse(BaseModel): """克隆仓库响应""" + success: bool = Field(..., description="是否成功") path: Optional[str] = Field(None, description="克隆路径") error: Optional[str] = Field(None, description="错误信息") @@ -93,6 +98,7 @@ class CloneRepositoryResponse(BaseModel): class MirrorConfigResponse(BaseModel): """镜像源配置响应""" + id: str = Field(..., description="镜像源 ID") name: str = Field(..., description="镜像源名称") raw_prefix: str = Field(..., description="Raw 文件前缀") @@ -103,12 +109,14 @@ class MirrorConfigResponse(BaseModel): class AvailableMirrorsResponse(BaseModel): """可用镜像源列表响应""" + mirrors: List[MirrorConfigResponse] = Field(..., description="镜像源列表") default_priority: List[str] = Field(..., description="默认优先级顺序(ID 列表)") class AddMirrorRequest(BaseModel): """添加镜像源请求""" + id: str = Field(..., description="镜像源 ID", example="custom-mirror") name: str = Field(..., description="镜像源名称", example="自定义镜像源") raw_prefix: str = Field(..., description="Raw 文件前缀", example="https://example.com/raw") @@ -119,6 +127,7 @@ class AddMirrorRequest(BaseModel): class UpdateMirrorRequest(BaseModel): """更新镜像源请求""" + name: Optional[str] = Field(None, description="镜像源名称") raw_prefix: Optional[str] = Field(None, description="Raw 文件前缀") clone_prefix: Optional[str] = Field(None, description="克隆前缀") @@ -128,6 +137,7 @@ class UpdateMirrorRequest(BaseModel): class GitStatusResponse(BaseModel): """Git 安装状态响应""" + installed: bool = Field(..., description="是否已安装 Git") version: Optional[str] = Field(None, description="Git 版本号") path: Optional[str] = Field(None, description="Git 可执行文件路径") @@ -136,6 +146,7 @@ class GitStatusResponse(BaseModel): class InstallPluginRequest(BaseModel): """安装插件请求""" + plugin_id: str = Field(..., description="插件 ID") repository_url: str = Field(..., description="插件仓库 URL") branch: Optional[str] = Field("main", description="分支名称") @@ -144,6 +155,7 @@ class InstallPluginRequest(BaseModel): class VersionResponse(BaseModel): """麦麦版本响应""" + version: str = Field(..., description="麦麦版本号") version_major: int = Field(..., description="主版本号") version_minor: int = Field(..., description="次版本号") @@ -152,11 +164,13 @@ class VersionResponse(BaseModel): class UninstallPluginRequest(BaseModel): """卸载插件请求""" + plugin_id: str = Field(..., description="插件 ID") class UpdatePluginRequest(BaseModel): """更新插件请求""" + plugin_id: str = Field(..., description="插件 ID") repository_url: str = Field(..., description="插件仓库 URL") branch: Optional[str] = Field("main", description="分支名称") @@ -165,40 +179,34 @@ class UpdatePluginRequest(BaseModel): # ============ API 路由 ============ + @router.get("/version", response_model=VersionResponse) async def get_maimai_version() -> VersionResponse: """ 获取麦麦版本信息 - + 此接口无需认证,用于前端检查插件兼容性 """ major, minor, patch = parse_version(MMC_VERSION) - - return VersionResponse( - version=MMC_VERSION, - version_major=major, - version_minor=minor, - version_patch=patch - ) + + return VersionResponse(version=MMC_VERSION, version_major=major, version_minor=minor, version_patch=patch) @router.get("/git-status", response_model=GitStatusResponse) async def check_git_status() -> GitStatusResponse: """ 检查本机 Git 安装状态 - + 此接口无需认证,用于前端快速检测是否可以使用插件安装功能 """ service = get_git_mirror_service() result = service.check_git_installed() - + return GitStatusResponse(**result) @router.get("/mirrors", response_model=AvailableMirrorsResponse) -async def get_available_mirrors( - authorization: Optional[str] = Header(None) -) -> AvailableMirrorsResponse: +async def get_available_mirrors(authorization: Optional[str] = Header(None)) -> AvailableMirrorsResponse: """ 获取所有可用的镜像源配置 """ @@ -207,10 +215,10 @@ async def get_available_mirrors( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + service = get_git_mirror_service() config = service.get_mirror_config() - + all_mirrors = config.get_all_mirrors() mirrors = [ MirrorConfigResponse( @@ -219,22 +227,16 @@ async def get_available_mirrors( raw_prefix=m["raw_prefix"], clone_prefix=m["clone_prefix"], enabled=m["enabled"], - priority=m["priority"] + priority=m["priority"], ) for m in all_mirrors ] - - return AvailableMirrorsResponse( - mirrors=mirrors, - default_priority=config.get_default_priority_list() - ) + + return AvailableMirrorsResponse(mirrors=mirrors, default_priority=config.get_default_priority_list()) @router.post("/mirrors", response_model=MirrorConfigResponse) -async def add_mirror( - request: AddMirrorRequest, - authorization: Optional[str] = Header(None) -) -> MirrorConfigResponse: +async def add_mirror(request: AddMirrorRequest, authorization: Optional[str] = Header(None)) -> MirrorConfigResponse: """ 添加新的镜像源 """ @@ -243,27 +245,27 @@ async def add_mirror( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + try: service = get_git_mirror_service() config = service.get_mirror_config() - + mirror = config.add_mirror( mirror_id=request.id, name=request.name, raw_prefix=request.raw_prefix, clone_prefix=request.clone_prefix, enabled=request.enabled, - priority=request.priority + priority=request.priority, ) - + return MirrorConfigResponse( id=mirror["id"], name=mirror["name"], raw_prefix=mirror["raw_prefix"], clone_prefix=mirror["clone_prefix"], enabled=mirror["enabled"], - priority=mirror["priority"] + priority=mirror["priority"], ) except ValueError as e: raise HTTPException(status_code=400, detail=str(e)) from e @@ -274,9 +276,7 @@ async def add_mirror( @router.put("/mirrors/{mirror_id}", response_model=MirrorConfigResponse) async def update_mirror( - mirror_id: str, - request: UpdateMirrorRequest, - authorization: Optional[str] = Header(None) + mirror_id: str, request: UpdateMirrorRequest, authorization: Optional[str] = Header(None) ) -> MirrorConfigResponse: """ 更新镜像源配置 @@ -286,30 +286,30 @@ async def update_mirror( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + try: service = get_git_mirror_service() config = service.get_mirror_config() - + mirror = config.update_mirror( mirror_id=mirror_id, name=request.name, raw_prefix=request.raw_prefix, clone_prefix=request.clone_prefix, enabled=request.enabled, - priority=request.priority + priority=request.priority, ) - + if not mirror: raise HTTPException(status_code=404, detail=f"未找到镜像源: {mirror_id}") - + return MirrorConfigResponse( id=mirror["id"], name=mirror["name"], raw_prefix=mirror["raw_prefix"], clone_prefix=mirror["clone_prefix"], enabled=mirror["enabled"], - priority=mirror["priority"] + priority=mirror["priority"], ) except HTTPException: raise @@ -319,10 +319,7 @@ async def update_mirror( @router.delete("/mirrors/{mirror_id}") -async def delete_mirror( - mirror_id: str, - authorization: Optional[str] = Header(None) -) -> Dict[str, Any]: +async def delete_mirror(mirror_id: str, authorization: Optional[str] = Header(None)) -> Dict[str, Any]: """ 删除镜像源 """ @@ -331,57 +328,53 @@ async def delete_mirror( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + service = get_git_mirror_service() config = service.get_mirror_config() - + success = config.delete_mirror(mirror_id) - + if not success: raise HTTPException(status_code=404, detail=f"未找到镜像源: {mirror_id}") - - return { - "success": True, - "message": f"已删除镜像源: {mirror_id}" - } + + return {"success": True, "message": f"已删除镜像源: {mirror_id}"} @router.post("/fetch-raw", response_model=FetchRawFileResponse) async def fetch_raw_file( - request: FetchRawFileRequest, - authorization: Optional[str] = Header(None) + request: FetchRawFileRequest, authorization: Optional[str] = Header(None) ) -> FetchRawFileResponse: """ 获取 GitHub 仓库的 Raw 文件内容 - + 支持多镜像源自动切换和错误重试 - + 注意:此接口可公开访问,用于获取插件仓库等公开资源 """ # Token 验证(可选,用于日志记录) token = authorization.replace("Bearer ", "") if authorization else None token_manager = get_token_manager() is_authenticated = token and token_manager.verify_token(token) - + # 对于公开仓库的访问,不强制要求认证 # 只在日志中记录是否认证 logger.info( f"收到获取 Raw 文件请求 (认证: {is_authenticated}): " f"{request.owner}/{request.repo}/{request.branch}/{request.file_path}" ) - + # 发送开始加载进度 await update_progress( stage="loading", progress=10, message=f"正在获取插件列表: {request.file_path}", total_plugins=0, - loaded_plugins=0 + loaded_plugins=0, ) - + try: service = get_git_mirror_service() - + # git_mirror_service 会自动推送 30%-70% 的详细镜像源尝试进度 result = await service.fetch_raw_file( owner=request.owner, @@ -389,69 +382,56 @@ async def fetch_raw_file( branch=request.branch, file_path=request.file_path, mirror_id=request.mirror_id, - custom_url=request.custom_url + custom_url=request.custom_url, ) - + if result.get("success"): # 更新进度:成功获取 await update_progress( - stage="loading", - progress=70, - message="正在解析插件数据...", - total_plugins=0, - loaded_plugins=0 + stage="loading", progress=70, message="正在解析插件数据...", total_plugins=0, loaded_plugins=0 ) - + # 尝试解析插件数量 try: import json + data = json.loads(result.get("data", "[]")) total = len(data) if isinstance(data, list) else 0 - + # 发送成功状态 await update_progress( stage="success", progress=100, message=f"成功加载 {total} 个插件", total_plugins=total, - loaded_plugins=total + loaded_plugins=total, ) except Exception: # 如果解析失败,仍然发送成功状态 await update_progress( - stage="success", - progress=100, - message="加载完成", - total_plugins=0, - loaded_plugins=0 + stage="success", progress=100, message="加载完成", total_plugins=0, loaded_plugins=0 ) - + return FetchRawFileResponse(**result) - + except Exception as e: logger.error(f"获取 Raw 文件失败: {e}") - + # 发送错误进度 await update_progress( - stage="error", - progress=0, - message="加载失败", - error=str(e), - total_plugins=0, - loaded_plugins=0 + stage="error", progress=0, message="加载失败", error=str(e), total_plugins=0, loaded_plugins=0 ) - + raise HTTPException(status_code=500, detail=f"服务器错误: {str(e)}") from e @router.post("/clone", response_model=CloneRepositoryResponse) async def clone_repository( - request: CloneRepositoryRequest, - authorization: Optional[str] = Header(None) + request: CloneRepositoryRequest, authorization: Optional[str] = Header(None) ) -> CloneRepositoryResponse: """ 克隆 GitHub 仓库到本地 - + 支持多镜像源自动切换和错误重试 """ # Token 验证 @@ -459,17 +439,15 @@ async def clone_repository( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - - logger.info( - f"收到克隆仓库请求: {request.owner}/{request.repo} -> {request.target_path}" - ) - + + logger.info(f"收到克隆仓库请求: {request.owner}/{request.repo} -> {request.target_path}") + try: # TODO: 验证 target_path 的安全性,防止路径遍历攻击 # TODO: 确定实际的插件目录基路径 base_plugin_path = Path("./plugins") # 临时路径 target_path = base_plugin_path / request.target_path - + service = get_git_mirror_service() result = await service.clone_repository( owner=request.owner, @@ -478,24 +456,21 @@ async def clone_repository( branch=request.branch, mirror_id=request.mirror_id, custom_url=request.custom_url, - depth=request.depth + depth=request.depth, ) - + return CloneRepositoryResponse(**result) - + except Exception as e: logger.error(f"克隆仓库失败: {e}") raise HTTPException(status_code=500, detail=f"服务器错误: {str(e)}") from e @router.post("/install") -async def install_plugin( - request: InstallPluginRequest, - authorization: Optional[str] = Header(None) -) -> Dict[str, Any]: +async def install_plugin(request: InstallPluginRequest, authorization: Optional[str] = Header(None)) -> Dict[str, Any]: """ 安装插件 - + 从 Git 仓库克隆插件到本地插件目录 """ # Token 验证 @@ -503,9 +478,9 @@ async def install_plugin( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + logger.info(f"收到安装插件请求: {request.plugin_id}") - + try: # 推送进度:开始安装 await update_progress( @@ -513,80 +488,75 @@ async def install_plugin( progress=5, message=f"开始安装插件: {request.plugin_id}", operation="install", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 1. 解析仓库 URL # repository_url 格式: https://github.com/owner/repo - repo_url = request.repository_url.rstrip('/') - if repo_url.endswith('.git'): + repo_url = request.repository_url.rstrip("/") + if repo_url.endswith(".git"): repo_url = repo_url[:-4] - - parts = repo_url.split('/') + + parts = repo_url.split("/") if len(parts) < 2: raise HTTPException(status_code=400, detail="无效的仓库 URL") - + owner = parts[-2] repo = parts[-1] - + await update_progress( stage="loading", progress=10, message=f"解析仓库信息: {owner}/{repo}", operation="install", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 2. 确定插件安装路径 plugins_dir = Path("plugins") plugins_dir.mkdir(exist_ok=True) - + target_path = plugins_dir / request.plugin_id - + # 检查插件是否已安装 if target_path.exists(): await update_progress( stage="error", progress=0, - message=f"插件已存在", + message="插件已存在", operation="install", plugin_id=request.plugin_id, - error="插件已安装,请先卸载" + error="插件已安装,请先卸载", ) raise HTTPException(status_code=400, detail="插件已安装") - + await update_progress( stage="loading", progress=15, message=f"准备克隆到: {target_path}", operation="install", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 3. 克隆仓库(这里会自动推送 20%-80% 的进度) service = get_git_mirror_service() - + # 如果是 GitHub 仓库,使用镜像源 - if 'github.com' in repo_url: + if "github.com" in repo_url: result = await service.clone_repository( owner=owner, repo=repo, target_path=target_path, branch=request.branch, mirror_id=request.mirror_id, - depth=1 # 浅克隆,节省时间和空间 + depth=1, # 浅克隆,节省时间和空间 ) else: # 自定义仓库,直接使用 URL result = await service.clone_repository( - owner=owner, - repo=repo, - target_path=target_path, - branch=request.branch, - custom_url=repo_url, - depth=1 + owner=owner, repo=repo, target_path=target_path, branch=request.branch, custom_url=repo_url, depth=1 ) - + if not result.get("success"): error_msg = result.get("error", "克隆失败") await update_progress( @@ -595,113 +565,107 @@ async def install_plugin( message="克隆仓库失败", operation="install", plugin_id=request.plugin_id, - error=error_msg + error=error_msg, ) raise HTTPException(status_code=500, detail=error_msg) - + # 4. 验证插件完整性 await update_progress( - stage="loading", - progress=85, - message="验证插件文件...", - operation="install", - plugin_id=request.plugin_id + stage="loading", progress=85, message="验证插件文件...", operation="install", plugin_id=request.plugin_id ) - + manifest_path = target_path / "_manifest.json" if not manifest_path.exists(): # 清理失败的安装 import shutil + shutil.rmtree(target_path, ignore_errors=True) - + await update_progress( stage="error", progress=0, message="插件缺少 _manifest.json", operation="install", plugin_id=request.plugin_id, - error="无效的插件格式" + error="无效的插件格式", ) raise HTTPException(status_code=400, detail="无效的插件:缺少 _manifest.json") - + # 5. 读取并验证 manifest await update_progress( - stage="loading", - progress=90, - message="读取插件配置...", - operation="install", - plugin_id=request.plugin_id + stage="loading", progress=90, message="读取插件配置...", operation="install", plugin_id=request.plugin_id ) - + try: import json as json_module - with open(manifest_path, 'r', encoding='utf-8') as f: + + with open(manifest_path, "r", encoding="utf-8") as f: manifest = json_module.load(f) - + # 基本验证 - required_fields = ['manifest_version', 'name', 'version', 'author'] + required_fields = ["manifest_version", "name", "version", "author"] for field in required_fields: if field not in manifest: raise ValueError(f"缺少必需字段: {field}") - + except Exception as e: # 清理失败的安装 import shutil + shutil.rmtree(target_path, ignore_errors=True) - + await update_progress( stage="error", progress=0, message="_manifest.json 无效", operation="install", plugin_id=request.plugin_id, - error=str(e) + error=str(e), ) raise HTTPException(status_code=400, detail=f"无效的 _manifest.json: {e}") from e - + # 6. 安装成功 await update_progress( stage="success", progress=100, message=f"成功安装插件: {manifest['name']} v{manifest['version']}", operation="install", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + return { "success": True, "message": "插件安装成功", "plugin_id": request.plugin_id, - "plugin_name": manifest['name'], - "version": manifest['version'], - "path": str(target_path) + "plugin_name": manifest["name"], + "version": manifest["version"], + "path": str(target_path), } - + except HTTPException: raise except Exception as e: logger.error(f"安装插件失败: {e}", exc_info=True) - + await update_progress( stage="error", progress=0, message="安装失败", operation="install", plugin_id=request.plugin_id, - error=str(e) + error=str(e), ) - + raise HTTPException(status_code=500, detail=f"服务器错误: {str(e)}") from e @router.post("/uninstall") async def uninstall_plugin( - request: UninstallPluginRequest, - authorization: Optional[str] = Header(None) + request: UninstallPluginRequest, authorization: Optional[str] = Header(None) ) -> Dict[str, Any]: """ 卸载插件 - + 删除插件目录及其所有文件 """ # Token 验证 @@ -709,9 +673,9 @@ async def uninstall_plugin( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + logger.info(f"收到卸载插件请求: {request.plugin_id}") - + try: # 推送进度:开始卸载 await update_progress( @@ -719,13 +683,13 @@ async def uninstall_plugin( progress=10, message=f"开始卸载插件: {request.plugin_id}", operation="uninstall", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 1. 检查插件是否存在 plugins_dir = Path("plugins") plugin_path = plugins_dir / request.plugin_id - + if not plugin_path.exists(): await update_progress( stage="error", @@ -733,107 +697,101 @@ async def uninstall_plugin( message="插件不存在", operation="uninstall", plugin_id=request.plugin_id, - error="插件未安装或已被删除" + error="插件未安装或已被删除", ) raise HTTPException(status_code=404, detail="插件未安装") - + await update_progress( stage="loading", progress=30, message=f"正在删除插件文件: {plugin_path}", operation="uninstall", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 2. 读取插件信息(用于日志) manifest_path = plugin_path / "_manifest.json" plugin_name = request.plugin_id - + if manifest_path.exists(): try: import json as json_module - with open(manifest_path, 'r', encoding='utf-8') as f: + + with open(manifest_path, "r", encoding="utf-8") as f: manifest = json_module.load(f) plugin_name = manifest.get("name", request.plugin_id) except Exception: pass # 如果读取失败,使用插件 ID 作为名称 - + await update_progress( stage="loading", progress=50, message=f"正在删除 {plugin_name}...", operation="uninstall", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 3. 删除插件目录 import shutil import stat - + def remove_readonly(func, path, _): """清除只读属性并删除文件""" import os + os.chmod(path, stat.S_IWRITE) func(path) - + shutil.rmtree(plugin_path, onerror=remove_readonly) - + logger.info(f"成功卸载插件: {request.plugin_id} ({plugin_name})") - + # 4. 推送成功状态 await update_progress( stage="success", progress=100, message=f"成功卸载插件: {plugin_name}", operation="uninstall", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - - return { - "success": True, - "message": "插件卸载成功", - "plugin_id": request.plugin_id, - "plugin_name": plugin_name - } - + + return {"success": True, "message": "插件卸载成功", "plugin_id": request.plugin_id, "plugin_name": plugin_name} + except HTTPException: raise except PermissionError as e: logger.error(f"卸载插件失败(权限错误): {e}") - + await update_progress( stage="error", progress=0, message="卸载失败", operation="uninstall", plugin_id=request.plugin_id, - error="权限不足,无法删除插件文件" + error="权限不足,无法删除插件文件", ) - + raise HTTPException(status_code=500, detail="权限不足,无法删除插件文件") from e except Exception as e: logger.error(f"卸载插件失败: {e}", exc_info=True) - + await update_progress( stage="error", progress=0, message="卸载失败", operation="uninstall", plugin_id=request.plugin_id, - error=str(e) + error=str(e), ) - + raise HTTPException(status_code=500, detail=f"服务器错误: {str(e)}") from e @router.post("/update") -async def update_plugin( - request: UpdatePluginRequest, - authorization: Optional[str] = Header(None) -) -> Dict[str, Any]: +async def update_plugin(request: UpdatePluginRequest, authorization: Optional[str] = Header(None)) -> Dict[str, Any]: """ 更新插件 - + 删除旧版本,重新克隆新版本 """ # Token 验证 @@ -841,9 +799,9 @@ async def update_plugin( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + logger.info(f"收到更新插件请求: {request.plugin_id}") - + try: # 推送进度:开始更新 await update_progress( @@ -851,13 +809,13 @@ async def update_plugin( progress=5, message=f"开始更新插件: {request.plugin_id}", operation="update", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 1. 检查插件是否已安装 plugins_dir = Path("plugins") plugin_path = plugins_dir / request.plugin_id - + if not plugin_path.exists(): await update_progress( stage="error", @@ -865,97 +823,90 @@ async def update_plugin( message="插件不存在", operation="update", plugin_id=request.plugin_id, - error="插件未安装,请先安装" + error="插件未安装,请先安装", ) raise HTTPException(status_code=404, detail="插件未安装") - + # 2. 读取旧版本信息 manifest_path = plugin_path / "_manifest.json" old_version = "unknown" plugin_name = request.plugin_id - + if manifest_path.exists(): try: import json as json_module - with open(manifest_path, 'r', encoding='utf-8') as f: + + with open(manifest_path, "r", encoding="utf-8") as f: manifest = json_module.load(f) old_version = manifest.get("version", "unknown") - plugin_name = manifest.get("name", request.plugin_id) + _plugin_name = manifest.get("name", request.plugin_id) except Exception: pass - + await update_progress( stage="loading", progress=10, message=f"当前版本: {old_version},准备更新...", operation="update", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + # 3. 删除旧版本 await update_progress( - stage="loading", - progress=20, - message="正在删除旧版本...", - operation="update", - plugin_id=request.plugin_id + stage="loading", progress=20, message="正在删除旧版本...", operation="update", plugin_id=request.plugin_id ) - + import shutil import stat - + def remove_readonly(func, path, _): """清除只读属性并删除文件""" import os + os.chmod(path, stat.S_IWRITE) func(path) - + shutil.rmtree(plugin_path, onerror=remove_readonly) - + logger.info(f"已删除旧版本: {request.plugin_id} v{old_version}") - + # 4. 解析仓库 URL await update_progress( stage="loading", progress=30, message="正在准备下载新版本...", operation="update", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - - repo_url = request.repository_url.rstrip('/') - if repo_url.endswith('.git'): + + repo_url = request.repository_url.rstrip("/") + if repo_url.endswith(".git"): repo_url = repo_url[:-4] - - parts = repo_url.split('/') + + parts = repo_url.split("/") if len(parts) < 2: raise HTTPException(status_code=400, detail="无效的仓库 URL") - + owner = parts[-2] repo = parts[-1] - + # 5. 克隆新版本(这里会推送 35%-85% 的进度) service = get_git_mirror_service() - - if 'github.com' in repo_url: + + if "github.com" in repo_url: result = await service.clone_repository( owner=owner, repo=repo, target_path=plugin_path, branch=request.branch, mirror_id=request.mirror_id, - depth=1 + depth=1, ) else: result = await service.clone_repository( - owner=owner, - repo=repo, - target_path=plugin_path, - branch=request.branch, - custom_url=repo_url, - depth=1 + owner=owner, repo=repo, target_path=plugin_path, branch=request.branch, custom_url=repo_url, depth=1 ) - + if not result.get("success"): error_msg = result.get("error", "克隆失败") await update_progress( @@ -964,106 +915,96 @@ async def update_plugin( message="下载新版本失败", operation="update", plugin_id=request.plugin_id, - error=error_msg + error=error_msg, ) raise HTTPException(status_code=500, detail=error_msg) - + # 6. 验证新版本 await update_progress( - stage="loading", - progress=90, - message="验证新版本...", - operation="update", - plugin_id=request.plugin_id + stage="loading", progress=90, message="验证新版本...", operation="update", plugin_id=request.plugin_id ) - + new_manifest_path = plugin_path / "_manifest.json" if not new_manifest_path.exists(): # 清理失败的更新 def remove_readonly(func, path, _): """清除只读属性并删除文件""" import os + os.chmod(path, stat.S_IWRITE) func(path) - + shutil.rmtree(plugin_path, onerror=remove_readonly) - + await update_progress( stage="error", progress=0, message="新版本缺少 _manifest.json", operation="update", plugin_id=request.plugin_id, - error="无效的插件格式" + error="无效的插件格式", ) raise HTTPException(status_code=400, detail="无效的插件:缺少 _manifest.json") - + # 7. 读取新版本信息 try: - with open(new_manifest_path, 'r', encoding='utf-8') as f: + with open(new_manifest_path, "r", encoding="utf-8") as f: new_manifest = json_module.load(f) - + new_version = new_manifest.get("version", "unknown") new_name = new_manifest.get("name", request.plugin_id) - + logger.info(f"成功更新插件: {request.plugin_id} {old_version} → {new_version}") - + # 8. 推送成功状态 await update_progress( stage="success", progress=100, message=f"成功更新 {new_name}: {old_version} → {new_version}", operation="update", - plugin_id=request.plugin_id + plugin_id=request.plugin_id, ) - + return { "success": True, "message": "插件更新成功", "plugin_id": request.plugin_id, "plugin_name": new_name, "old_version": old_version, - "new_version": new_version + "new_version": new_version, } - + except Exception as e: # 清理失败的更新 shutil.rmtree(plugin_path, ignore_errors=True) - + await update_progress( stage="error", progress=0, message="_manifest.json 无效", operation="update", plugin_id=request.plugin_id, - error=str(e) + error=str(e), ) raise HTTPException(status_code=400, detail=f"无效的 _manifest.json: {e}") from e - + except HTTPException: raise except Exception as e: logger.error(f"更新插件失败: {e}", exc_info=True) - + await update_progress( - stage="error", - progress=0, - message="更新失败", - operation="update", - plugin_id=request.plugin_id, - error=str(e) + stage="error", progress=0, message="更新失败", operation="update", plugin_id=request.plugin_id, error=str(e) ) - + raise HTTPException(status_code=500, detail=f"服务器错误: {str(e)}") from e @router.get("/installed") -async def get_installed_plugins( - authorization: Optional[str] = Header(None) -) -> Dict[str, Any]: +async def get_installed_plugins(authorization: Optional[str] = Header(None)) -> Dict[str, Any]: """ 获取已安装的插件列表 - + 扫描 plugins 目录,返回所有已安装插件的 ID 和基本信息 """ # Token 验证 @@ -1071,75 +1012,71 @@ async def get_installed_plugins( token_manager = get_token_manager() if not token or not token_manager.verify_token(token): raise HTTPException(status_code=401, detail="未授权:无效的访问令牌") - + logger.info("收到获取已安装插件列表请求") - + try: plugins_dir = Path("plugins") - + # 如果插件目录不存在,返回空列表 if not plugins_dir.exists(): logger.info("插件目录不存在,创建目录") plugins_dir.mkdir(exist_ok=True) - return { - "success": True, - "plugins": [] - } - + return {"success": True, "plugins": []} + installed_plugins = [] - + # 遍历插件目录 for plugin_path in plugins_dir.iterdir(): # 只处理目录 if not plugin_path.is_dir(): continue - + # 目录名即为插件 ID plugin_id = plugin_path.name - + # 跳过隐藏目录和特殊目录 - if plugin_id.startswith('.') or plugin_id.startswith('__'): + if plugin_id.startswith(".") or plugin_id.startswith("__"): continue - + # 读取 _manifest.json manifest_path = plugin_path / "_manifest.json" - + if not manifest_path.exists(): logger.warning(f"插件 {plugin_id} 缺少 _manifest.json,跳过") continue - + try: import json as json_module - with open(manifest_path, 'r', encoding='utf-8') as f: + + with open(manifest_path, "r", encoding="utf-8") as f: manifest = json_module.load(f) - + # 基本验证 - if 'name' not in manifest or 'version' not in manifest: + if "name" not in manifest or "version" not in manifest: logger.warning(f"插件 {plugin_id} 的 _manifest.json 格式无效,跳过") continue - + # 添加到已安装列表(返回完整的 manifest 信息) - installed_plugins.append({ - "id": plugin_id, - "manifest": manifest, # 返回完整的 manifest 对象 - "path": str(plugin_path.absolute()) - }) - + installed_plugins.append( + { + "id": plugin_id, + "manifest": manifest, # 返回完整的 manifest 对象 + "path": str(plugin_path.absolute()), + } + ) + except json.JSONDecodeError as e: logger.warning(f"插件 {plugin_id} 的 _manifest.json 解析失败: {e}") continue except Exception as e: logger.error(f"读取插件 {plugin_id} 信息时出错: {e}") continue - + logger.info(f"找到 {len(installed_plugins)} 个已安装插件") - - return { - "success": True, - "plugins": installed_plugins, - "total": len(installed_plugins) - } - + + return {"success": True, "plugins": installed_plugins, "total": len(installed_plugins)} + except Exception as e: logger.error(f"获取已安装插件列表失败: {e}", exc_info=True) raise HTTPException(status_code=500, detail=f"服务器错误: {str(e)}") from e diff --git a/src/webui/routers/system.py b/src/webui/routers/system.py new file mode 100644 index 00000000..fb203f79 --- /dev/null +++ b/src/webui/routers/system.py @@ -0,0 +1,97 @@ +""" +系统控制路由 + +提供系统重启、状态查询等功能 +""" + +import os +import sys +import time +from datetime import datetime +from fastapi import APIRouter, HTTPException +from pydantic import BaseModel +from src.config.config import MMC_VERSION + +router = APIRouter(prefix="/system", tags=["system"]) + +# 记录启动时间 +_start_time = time.time() + + +class RestartResponse(BaseModel): + """重启响应""" + + success: bool + message: str + + +class StatusResponse(BaseModel): + """状态响应""" + + running: bool + uptime: float + version: str + start_time: str + + +@router.post("/restart", response_model=RestartResponse) +async def restart_maibot(): + """ + 重启麦麦主程序 + + 使用 os.execv 重启当前进程,配置更改将在重启后生效。 + 注意:此操作会使麦麦暂时离线。 + """ + try: + # 记录重启操作 + print(f"[{datetime.now()}] WebUI 触发重启操作") + + # 使用 os.execv 重启当前进程 + # 这会替换当前进程,保持相同的 PID + python = sys.executable + args = [python] + sys.argv + + # 返回成功响应(实际上这个响应可能不会发送,因为进程会立即重启) + # 但我们仍然返回它以保持 API 一致性 + os.execv(python, args) + + return RestartResponse(success=True, message="麦麦正在重启中...") + except Exception as e: + raise HTTPException(status_code=500, detail=f"重启失败: {str(e)}") from e + + +@router.get("/status", response_model=StatusResponse) +async def get_maibot_status(): + """ + 获取麦麦运行状态 + + 返回麦麦的运行状态、运行时长和版本信息。 + """ + try: + uptime = time.time() - _start_time + + # 尝试获取版本信息(需要根据实际情况调整) + version = MMC_VERSION # 可以从配置或常量中读取 + + return StatusResponse( + running=True, uptime=uptime, version=version, start_time=datetime.fromtimestamp(_start_time).isoformat() + ) + except Exception as e: + raise HTTPException(status_code=500, detail=f"获取状态失败: {str(e)}") from e + + +# 可选:添加更多系统控制功能 + + +@router.post("/reload-config") +async def reload_config(): + """ + 热重载配置(不重启进程) + + 仅重新加载配置文件,某些配置可能需要重启才能生效。 + 此功能需要在主程序中实现配置热重载逻辑。 + """ + # 这里需要调用主程序的配置重载函数 + # 示例:await app_instance.reload_config() + + return {"success": True, "message": "配置重载功能待实现"} diff --git a/src/webui/routes.py b/src/webui/routes.py index b52dede6..3eb7e673 100644 --- a/src/webui/routes.py +++ b/src/webui/routes.py @@ -1,4 +1,5 @@ """WebUI API 路由""" + from fastapi import APIRouter, HTTPException, Header from pydantic import BaseModel, Field from typing import Optional @@ -11,6 +12,7 @@ from .expression_routes import router as expression_router from .emoji_routes import router as emoji_router from .plugin_routes import router as plugin_router from .plugin_progress_ws import get_progress_router +from .routers.system import router as system_router logger = get_logger("webui.api") @@ -31,32 +33,39 @@ router.include_router(emoji_router) router.include_router(plugin_router) # 注册插件进度 WebSocket 路由 router.include_router(get_progress_router()) +# 注册系统控制路由 +router.include_router(system_router) class TokenVerifyRequest(BaseModel): """Token 验证请求""" + token: str = Field(..., description="访问令牌") class TokenVerifyResponse(BaseModel): """Token 验证响应""" + valid: bool = Field(..., description="Token 是否有效") message: str = Field(..., description="验证结果消息") class TokenUpdateRequest(BaseModel): """Token 更新请求""" + new_token: str = Field(..., description="新的访问令牌", min_length=10) class TokenUpdateResponse(BaseModel): """Token 更新响应""" + success: bool = Field(..., description="是否更新成功") message: str = Field(..., description="更新结果消息") class TokenRegenerateResponse(BaseModel): """Token 重新生成响应""" + success: bool = Field(..., description="是否生成成功") token: str = Field(..., description="新生成的令牌") message: str = Field(..., description="生成结果消息") @@ -64,18 +73,21 @@ class TokenRegenerateResponse(BaseModel): class FirstSetupStatusResponse(BaseModel): """首次配置状态响应""" + is_first_setup: bool = Field(..., description="是否为首次配置") message: str = Field(..., description="状态消息") class CompleteSetupResponse(BaseModel): """完成配置响应""" + success: bool = Field(..., description="是否成功") message: str = Field(..., description="结果消息") class ResetSetupResponse(BaseModel): """重置配置响应""" + success: bool = Field(..., description="是否成功") message: str = Field(..., description="结果消息") @@ -90,44 +102,35 @@ async def health_check(): async def verify_token(request: TokenVerifyRequest): """ 验证访问令牌 - + Args: request: 包含 token 的验证请求 - + Returns: 验证结果 """ try: token_manager = get_token_manager() is_valid = token_manager.verify_token(request.token) - + if is_valid: - return TokenVerifyResponse( - valid=True, - message="Token 验证成功" - ) + return TokenVerifyResponse(valid=True, message="Token 验证成功") else: - return TokenVerifyResponse( - valid=False, - message="Token 无效或已过期" - ) + return TokenVerifyResponse(valid=False, message="Token 无效或已过期") except Exception as e: logger.error(f"Token 验证失败: {e}") raise HTTPException(status_code=500, detail="Token 验证失败") from e @router.post("/auth/update", response_model=TokenUpdateResponse) -async def update_token( - request: TokenUpdateRequest, - authorization: Optional[str] = Header(None) -): +async def update_token(request: TokenUpdateRequest, authorization: Optional[str] = Header(None)): """ 更新访问令牌(需要当前有效的 token) - + Args: request: 包含新 token 的更新请求 authorization: Authorization header (Bearer token) - + Returns: 更新结果 """ @@ -135,20 +138,17 @@ async def update_token( # 验证当前 token if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + current_token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(current_token): raise HTTPException(status_code=401, detail="当前 Token 无效") - + # 更新 token success, message = token_manager.update_token(request.new_token) - - return TokenUpdateResponse( - success=success, - message=message - ) + + return TokenUpdateResponse(success=success, message=message) except HTTPException: raise except Exception as e: @@ -160,10 +160,10 @@ async def update_token( async def regenerate_token(authorization: Optional[str] = Header(None)): """ 重新生成访问令牌(需要当前有效的 token) - + Args: authorization: Authorization header (Bearer token) - + Returns: 新生成的 token """ @@ -171,21 +171,17 @@ async def regenerate_token(authorization: Optional[str] = Header(None)): # 验证当前 token if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + current_token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(current_token): raise HTTPException(status_code=401, detail="当前 Token 无效") - + # 重新生成 token new_token = token_manager.regenerate_token() - - return TokenRegenerateResponse( - success=True, - token=new_token, - message="Token 已重新生成" - ) + + return TokenRegenerateResponse(success=True, token=new_token, message="Token 已重新生成") except HTTPException: raise except Exception as e: @@ -197,10 +193,10 @@ async def regenerate_token(authorization: Optional[str] = Header(None)): async def get_setup_status(authorization: Optional[str] = Header(None)): """ 获取首次配置状态 - + Args: authorization: Authorization header (Bearer token) - + Returns: 首次配置状态 """ @@ -208,20 +204,17 @@ async def get_setup_status(authorization: Optional[str] = Header(None)): # 验证 token if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + current_token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(current_token): raise HTTPException(status_code=401, detail="Token 无效") - + # 检查是否为首次配置 is_first = token_manager.is_first_setup() - - return FirstSetupStatusResponse( - is_first_setup=is_first, - message="首次配置" if is_first else "已完成配置" - ) + + return FirstSetupStatusResponse(is_first_setup=is_first, message="首次配置" if is_first else "已完成配置") except HTTPException: raise except Exception as e: @@ -233,10 +226,10 @@ async def get_setup_status(authorization: Optional[str] = Header(None)): async def complete_setup(authorization: Optional[str] = Header(None)): """ 标记首次配置完成 - + Args: authorization: Authorization header (Bearer token) - + Returns: 完成结果 """ @@ -244,20 +237,17 @@ async def complete_setup(authorization: Optional[str] = Header(None)): # 验证 token if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + current_token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(current_token): raise HTTPException(status_code=401, detail="Token 无效") - + # 标记配置完成 success = token_manager.mark_setup_completed() - - return CompleteSetupResponse( - success=success, - message="配置已完成" if success else "标记失败" - ) + + return CompleteSetupResponse(success=success, message="配置已完成" if success else "标记失败") except HTTPException: raise except Exception as e: @@ -269,10 +259,10 @@ async def complete_setup(authorization: Optional[str] = Header(None)): async def reset_setup(authorization: Optional[str] = Header(None)): """ 重置首次配置状态,允许重新进入配置向导 - + Args: authorization: Authorization header (Bearer token) - + Returns: 重置结果 """ @@ -280,20 +270,17 @@ async def reset_setup(authorization: Optional[str] = Header(None)): # 验证 token if not authorization or not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="未提供有效的认证信息") - + current_token = authorization.replace("Bearer ", "") token_manager = get_token_manager() - + if not token_manager.verify_token(current_token): raise HTTPException(status_code=401, detail="Token 无效") - + # 重置配置状态 success = token_manager.reset_setup_status() - - return ResetSetupResponse( - success=success, - message="配置状态已重置" if success else "重置失败" - ) + + return ResetSetupResponse(success=success, message="配置状态已重置" if success else "重置失败") except HTTPException: raise except Exception as e: diff --git a/src/webui/statistics_routes.py b/src/webui/statistics_routes.py index 01d5ea28..b0a3664c 100644 --- a/src/webui/statistics_routes.py +++ b/src/webui/statistics_routes.py @@ -1,9 +1,10 @@ """统计数据 API 路由""" + from fastapi import APIRouter, HTTPException from pydantic import BaseModel, Field from typing import Dict, Any, List from datetime import datetime, timedelta -from collections import defaultdict +from peewee import fn from src.common.logger import get_logger from src.common.database.database_model import LLMUsage, OnlineTime, Messages @@ -15,6 +16,7 @@ router = APIRouter(prefix="/statistics", tags=["statistics"]) class StatisticsSummary(BaseModel): """统计数据摘要""" + total_requests: int = Field(0, description="总请求数") total_cost: float = Field(0.0, description="总花费") total_tokens: int = Field(0, description="总token数") @@ -28,6 +30,7 @@ class StatisticsSummary(BaseModel): class ModelStatistics(BaseModel): """模型统计""" + model_name: str request_count: int total_cost: float @@ -37,6 +40,7 @@ class ModelStatistics(BaseModel): class TimeSeriesData(BaseModel): """时间序列数据""" + timestamp: str requests: int = 0 cost: float = 0.0 @@ -45,6 +49,7 @@ class TimeSeriesData(BaseModel): class DashboardData(BaseModel): """仪表盘数据""" + summary: StatisticsSummary model_stats: List[ModelStatistics] hourly_data: List[TimeSeriesData] @@ -56,39 +61,39 @@ class DashboardData(BaseModel): async def get_dashboard_data(hours: int = 24): """ 获取仪表盘统计数据 - + Args: hours: 统计时间范围(小时),默认24小时 - + Returns: 仪表盘数据 """ try: now = datetime.now() start_time = now - timedelta(hours=hours) - + # 获取摘要数据 summary = await _get_summary_statistics(start_time, now) - + # 获取模型统计 model_stats = await _get_model_statistics(start_time) - + # 获取小时级时间序列数据 hourly_data = await _get_hourly_statistics(start_time, now) - + # 获取日级时间序列数据(最近7天) daily_start = now - timedelta(days=7) daily_data = await _get_daily_statistics(daily_start, now) - + # 获取最近活动 recent_activity = await _get_recent_activity(limit=10) - + return DashboardData( summary=summary, model_stats=model_stats, hourly_data=hourly_data, daily_data=daily_data, - recent_activity=recent_activity + recent_activity=recent_activity, ) except Exception as e: logger.error(f"获取仪表盘数据失败: {e}") @@ -96,200 +101,176 @@ async def get_dashboard_data(hours: int = 24): async def _get_summary_statistics(start_time: datetime, end_time: datetime) -> StatisticsSummary: - """获取摘要统计数据""" + """获取摘要统计数据(优化:使用数据库聚合)""" summary = StatisticsSummary() - - # 查询 LLM 使用记录 - llm_records = list( - LLMUsage.select() - .where(LLMUsage.timestamp >= start_time) - .where(LLMUsage.timestamp <= end_time) - ) - - total_time_cost = 0.0 - time_cost_count = 0 - - for record in llm_records: - summary.total_requests += 1 - summary.total_cost += record.cost or 0.0 - summary.total_tokens += (record.prompt_tokens or 0) + (record.completion_tokens or 0) - - if record.time_cost and record.time_cost > 0: - total_time_cost += record.time_cost - time_cost_count += 1 - - # 计算平均响应时间 - if time_cost_count > 0: - summary.avg_response_time = total_time_cost / time_cost_count - - # 查询在线时间 + + # 使用聚合查询替代全量加载 + query = LLMUsage.select( + fn.COUNT(LLMUsage.id).alias("total_requests"), + fn.COALESCE(fn.SUM(LLMUsage.cost), 0).alias("total_cost"), + fn.COALESCE(fn.SUM(LLMUsage.prompt_tokens + LLMUsage.completion_tokens), 0).alias("total_tokens"), + fn.COALESCE(fn.AVG(LLMUsage.time_cost), 0).alias("avg_response_time"), + ).where((LLMUsage.timestamp >= start_time) & (LLMUsage.timestamp <= end_time)) + + result = query.dicts().get() + summary.total_requests = result["total_requests"] + summary.total_cost = result["total_cost"] + summary.total_tokens = result["total_tokens"] + summary.avg_response_time = result["avg_response_time"] or 0.0 + + # 查询在线时间 - 这个数据量通常不大,保留原逻辑 online_records = list( - OnlineTime.select() - .where( - (OnlineTime.start_timestamp >= start_time) | - (OnlineTime.end_timestamp >= start_time) - ) + OnlineTime.select().where((OnlineTime.start_timestamp >= start_time) | (OnlineTime.end_timestamp >= start_time)) ) - + for record in online_records: start = max(record.start_timestamp, start_time) end = min(record.end_timestamp, end_time) if end > start: summary.online_time += (end - start).total_seconds() - - # 查询消息数量 - messages = list( - Messages.select() - .where(Messages.time >= start_time.timestamp()) - .where(Messages.time <= end_time.timestamp()) + + # 查询消息数量 - 使用聚合优化 + messages_query = Messages.select(fn.COUNT(Messages.id).alias("total")).where( + (Messages.time >= start_time.timestamp()) & (Messages.time <= end_time.timestamp()) ) - - summary.total_messages = len(messages) - # 简单统计:如果 reply_to 不为空,则认为是回复 - summary.total_replies = len([m for m in messages if m.reply_to]) - + summary.total_messages = messages_query.scalar() or 0 + + # 统计回复数量 + replies_query = Messages.select(fn.COUNT(Messages.id).alias("total")).where( + (Messages.time >= start_time.timestamp()) + & (Messages.time <= end_time.timestamp()) + & (Messages.reply_to.is_null(False)) + ) + summary.total_replies = replies_query.scalar() or 0 + # 计算派生指标 if summary.online_time > 0: online_hours = summary.online_time / 3600.0 summary.cost_per_hour = summary.total_cost / online_hours summary.tokens_per_hour = summary.total_tokens / online_hours - + return summary async def _get_model_statistics(start_time: datetime) -> List[ModelStatistics]: - """获取模型统计数据""" - model_data = defaultdict(lambda: { - 'request_count': 0, - 'total_cost': 0.0, - 'total_tokens': 0, - 'time_costs': [] - }) - - records = list( - LLMUsage.select() + """获取模型统计数据(优化:使用数据库聚合和分组)""" + # 使用GROUP BY聚合,避免全量加载 + query = ( + LLMUsage.select( + fn.COALESCE(LLMUsage.model_assign_name, LLMUsage.model_name, "unknown").alias("model_name"), + fn.COUNT(LLMUsage.id).alias("request_count"), + fn.COALESCE(fn.SUM(LLMUsage.cost), 0).alias("total_cost"), + fn.COALESCE(fn.SUM(LLMUsage.prompt_tokens + LLMUsage.completion_tokens), 0).alias("total_tokens"), + fn.COALESCE(fn.AVG(LLMUsage.time_cost), 0).alias("avg_response_time"), + ) .where(LLMUsage.timestamp >= start_time) + .group_by(fn.COALESCE(LLMUsage.model_assign_name, LLMUsage.model_name, "unknown")) + .order_by(fn.COUNT(LLMUsage.id).desc()) + .limit(10) # 只取前10个 ) - - for record in records: - model_name = record.model_assign_name or record.model_name or "unknown" - model_data[model_name]['request_count'] += 1 - model_data[model_name]['total_cost'] += record.cost or 0.0 - model_data[model_name]['total_tokens'] += (record.prompt_tokens or 0) + (record.completion_tokens or 0) - - if record.time_cost and record.time_cost > 0: - model_data[model_name]['time_costs'].append(record.time_cost) - - # 转换为列表并排序 + result = [] - for model_name, data in model_data.items(): - avg_time = sum(data['time_costs']) / len(data['time_costs']) if data['time_costs'] else 0.0 - result.append(ModelStatistics( - model_name=model_name, - request_count=data['request_count'], - total_cost=data['total_cost'], - total_tokens=data['total_tokens'], - avg_response_time=avg_time - )) - - # 按请求数排序 - result.sort(key=lambda x: x.request_count, reverse=True) - return result[:10] # 返回前10个 + for row in query.dicts(): + result.append( + ModelStatistics( + model_name=row["model_name"], + request_count=row["request_count"], + total_cost=row["total_cost"], + total_tokens=row["total_tokens"], + avg_response_time=row["avg_response_time"] or 0.0, + ) + ) + + return result async def _get_hourly_statistics(start_time: datetime, end_time: datetime) -> List[TimeSeriesData]: - """获取小时级统计数据""" - # 创建小时桶 - hourly_buckets = defaultdict(lambda: {'requests': 0, 'cost': 0.0, 'tokens': 0}) - - records = list( - LLMUsage.select() - .where(LLMUsage.timestamp >= start_time) - .where(LLMUsage.timestamp <= end_time) + """获取小时级统计数据(优化:使用数据库聚合)""" + # SQLite的日期时间函数进行小时分组 + # 使用strftime将timestamp格式化为小时级别 + query = ( + LLMUsage.select( + fn.strftime("%Y-%m-%dT%H:00:00", LLMUsage.timestamp).alias("hour"), + fn.COUNT(LLMUsage.id).alias("requests"), + fn.COALESCE(fn.SUM(LLMUsage.cost), 0).alias("cost"), + fn.COALESCE(fn.SUM(LLMUsage.prompt_tokens + LLMUsage.completion_tokens), 0).alias("tokens"), + ) + .where((LLMUsage.timestamp >= start_time) & (LLMUsage.timestamp <= end_time)) + .group_by(fn.strftime("%Y-%m-%dT%H:00:00", LLMUsage.timestamp)) ) - - for record in records: - # 获取小时键(去掉分钟和秒) - hour_key = record.timestamp.replace(minute=0, second=0, microsecond=0) - hour_str = hour_key.isoformat() - - hourly_buckets[hour_str]['requests'] += 1 - hourly_buckets[hour_str]['cost'] += record.cost or 0.0 - hourly_buckets[hour_str]['tokens'] += (record.prompt_tokens or 0) + (record.completion_tokens or 0) - + + # 转换为字典以快速查找 + data_dict = {row["hour"]: row for row in query.dicts()} + # 填充所有小时(包括没有数据的) result = [] current = start_time.replace(minute=0, second=0, microsecond=0) while current <= end_time: - hour_str = current.isoformat() - data = hourly_buckets.get(hour_str, {'requests': 0, 'cost': 0.0, 'tokens': 0}) - result.append(TimeSeriesData( - timestamp=hour_str, - requests=data['requests'], - cost=data['cost'], - tokens=data['tokens'] - )) + hour_str = current.strftime("%Y-%m-%dT%H:00:00") + if hour_str in data_dict: + row = data_dict[hour_str] + result.append( + TimeSeriesData(timestamp=hour_str, requests=row["requests"], cost=row["cost"], tokens=row["tokens"]) + ) + else: + result.append(TimeSeriesData(timestamp=hour_str, requests=0, cost=0.0, tokens=0)) current += timedelta(hours=1) - + return result async def _get_daily_statistics(start_time: datetime, end_time: datetime) -> List[TimeSeriesData]: - """获取日级统计数据""" - daily_buckets = defaultdict(lambda: {'requests': 0, 'cost': 0.0, 'tokens': 0}) - - records = list( - LLMUsage.select() - .where(LLMUsage.timestamp >= start_time) - .where(LLMUsage.timestamp <= end_time) + """获取日级统计数据(优化:使用数据库聚合)""" + # 使用strftime按日期分组 + query = ( + LLMUsage.select( + fn.strftime("%Y-%m-%dT00:00:00", LLMUsage.timestamp).alias("day"), + fn.COUNT(LLMUsage.id).alias("requests"), + fn.COALESCE(fn.SUM(LLMUsage.cost), 0).alias("cost"), + fn.COALESCE(fn.SUM(LLMUsage.prompt_tokens + LLMUsage.completion_tokens), 0).alias("tokens"), + ) + .where((LLMUsage.timestamp >= start_time) & (LLMUsage.timestamp <= end_time)) + .group_by(fn.strftime("%Y-%m-%dT00:00:00", LLMUsage.timestamp)) ) - - for record in records: - # 获取日期键 - day_key = record.timestamp.replace(hour=0, minute=0, second=0, microsecond=0) - day_str = day_key.isoformat() - - daily_buckets[day_str]['requests'] += 1 - daily_buckets[day_str]['cost'] += record.cost or 0.0 - daily_buckets[day_str]['tokens'] += (record.prompt_tokens or 0) + (record.completion_tokens or 0) - + + # 转换为字典 + data_dict = {row["day"]: row for row in query.dicts()} + # 填充所有天 result = [] current = start_time.replace(hour=0, minute=0, second=0, microsecond=0) while current <= end_time: - day_str = current.isoformat() - data = daily_buckets.get(day_str, {'requests': 0, 'cost': 0.0, 'tokens': 0}) - result.append(TimeSeriesData( - timestamp=day_str, - requests=data['requests'], - cost=data['cost'], - tokens=data['tokens'] - )) + day_str = current.strftime("%Y-%m-%dT00:00:00") + if day_str in data_dict: + row = data_dict[day_str] + result.append( + TimeSeriesData(timestamp=day_str, requests=row["requests"], cost=row["cost"], tokens=row["tokens"]) + ) + else: + result.append(TimeSeriesData(timestamp=day_str, requests=0, cost=0.0, tokens=0)) current += timedelta(days=1) - + return result async def _get_recent_activity(limit: int = 10) -> List[Dict[str, Any]]: """获取最近活动""" - records = list( - LLMUsage.select() - .order_by(LLMUsage.timestamp.desc()) - .limit(limit) - ) - + records = list(LLMUsage.select().order_by(LLMUsage.timestamp.desc()).limit(limit)) + activities = [] for record in records: - activities.append({ - 'timestamp': record.timestamp.isoformat(), - 'model': record.model_assign_name or record.model_name, - 'request_type': record.request_type, - 'tokens': (record.prompt_tokens or 0) + (record.completion_tokens or 0), - 'cost': record.cost or 0.0, - 'time_cost': record.time_cost or 0.0, - 'status': record.status - }) - + activities.append( + { + "timestamp": record.timestamp.isoformat(), + "model": record.model_assign_name or record.model_name, + "request_type": record.request_type, + "tokens": (record.prompt_tokens or 0) + (record.completion_tokens or 0), + "cost": record.cost or 0.0, + "time_cost": record.time_cost or 0.0, + "status": record.status, + } + ) + return activities @@ -297,7 +278,7 @@ async def _get_recent_activity(limit: int = 10) -> List[Dict[str, Any]]: async def get_summary(hours: int = 24): """ 获取统计摘要 - + Args: hours: 统计时间范围(小时) """ @@ -315,7 +296,7 @@ async def get_summary(hours: int = 24): async def get_model_stats(hours: int = 24): """ 获取模型统计 - + Args: hours: 统计时间范围(小时) """ diff --git a/src/webui/token_manager.py b/src/webui/token_manager.py index 7ab16d75..69abf1d8 100644 --- a/src/webui/token_manager.py +++ b/src/webui/token_manager.py @@ -19,7 +19,7 @@ class TokenManager: def __init__(self, config_path: Optional[Path] = None): """ 初始化 Token 管理器 - + Args: config_path: 配置文件路径,默认为项目根目录的 data/webui.json """ @@ -27,10 +27,10 @@ class TokenManager: # 获取项目根目录 (src/webui -> src -> 根目录) project_root = Path(__file__).parent.parent.parent config_path = project_root / "data" / "webui.json" - + self.config_path = config_path self.config_path.parent.mkdir(parents=True, exist_ok=True) - + # 确保配置文件存在并包含有效的 token self._ensure_config() @@ -75,22 +75,23 @@ class TokenManager: """生成新的 64 位随机 token""" # 生成 64 位十六进制字符串 (32 字节 = 64 hex 字符) token = secrets.token_hex(32) - + config = { "access_token": token, "created_at": self._get_current_timestamp(), "updated_at": self._get_current_timestamp(), - "first_setup_completed": False # 标记首次配置未完成 + "first_setup_completed": False, # 标记首次配置未完成 } - + self._save_config(config) logger.info(f"新的 WebUI Token 已生成: {token[:8]}...") - + return token def _get_current_timestamp(self) -> str: """获取当前时间戳字符串""" from datetime import datetime + return datetime.now().isoformat() def get_token(self) -> str: @@ -101,38 +102,38 @@ class TokenManager: def verify_token(self, token: str) -> bool: """ 验证 token 是否有效 - + Args: token: 待验证的 token - + Returns: bool: token 是否有效 """ if not token: return False - + current_token = self.get_token() if not current_token: logger.error("系统中没有有效的 token") return False - + # 使用 secrets.compare_digest 防止时序攻击 is_valid = secrets.compare_digest(token, current_token) - + if is_valid: logger.debug("Token 验证成功") else: logger.warning("Token 验证失败") - + return is_valid def update_token(self, new_token: str) -> tuple[bool, str]: """ 更新 token - + Args: new_token: 新的 token (最少 10 位,必须包含大小写字母和特殊符号) - + Returns: tuple[bool, str]: (是否更新成功, 错误消息) """ @@ -141,17 +142,17 @@ class TokenManager: if not is_valid: logger.error(f"Token 格式无效: {error_msg}") return False, error_msg - + try: config = self._load_config() old_token = config.get("access_token", "")[:8] - + config["access_token"] = new_token config["updated_at"] = self._get_current_timestamp() - + self._save_config(config) logger.info(f"Token 已更新: {old_token}... -> {new_token[:8]}...") - + return True, "Token 更新成功" except Exception as e: logger.error(f"更新 Token 失败: {e}") @@ -160,7 +161,7 @@ class TokenManager: def regenerate_token(self) -> str: """ 重新生成 token - + Returns: str: 新生成的 token """ @@ -170,20 +171,20 @@ class TokenManager: def _validate_token_format(self, token: str) -> bool: """ 验证 token 格式是否正确(旧的 64 位十六进制验证,保留用于系统生成的 token) - + Args: token: 待验证的 token - + Returns: bool: 格式是否正确 """ if not token or not isinstance(token, str): return False - + # 必须是 64 位十六进制字符串 if len(token) != 64: return False - + # 验证是否为有效的十六进制字符串 try: int(token, 16) @@ -194,48 +195,48 @@ class TokenManager: def _validate_custom_token(self, token: str) -> tuple[bool, str]: """ 验证自定义 token 格式 - + 要求: - 最少 10 位 - 包含大写字母 - 包含小写字母 - 包含特殊符号 - + Args: token: 待验证的 token - + Returns: tuple[bool, str]: (是否有效, 错误消息) """ if not token or not isinstance(token, str): return False, "Token 不能为空" - + # 检查长度 if len(token) < 10: return False, "Token 长度至少为 10 位" - + # 检查是否包含大写字母 has_upper = any(c.isupper() for c in token) if not has_upper: return False, "Token 必须包含大写字母" - + # 检查是否包含小写字母 has_lower = any(c.islower() for c in token) if not has_lower: return False, "Token 必须包含小写字母" - + # 检查是否包含特殊符号 special_chars = "!@#$%^&*()_+-=[]{}|;:,.<>?/" has_special = any(c in special_chars for c in token) if not has_special: return False, f"Token 必须包含特殊符号 ({special_chars})" - + return True, "Token 格式正确" def is_first_setup(self) -> bool: """ 检查是否为首次配置 - + Returns: bool: 是否为首次配置 """ @@ -245,7 +246,7 @@ class TokenManager: def mark_setup_completed(self) -> bool: """ 标记首次配置已完成 - + Returns: bool: 是否标记成功 """ @@ -263,7 +264,7 @@ class TokenManager: def reset_setup_status(self) -> bool: """ 重置首次配置状态,允许重新进入配置向导 - + Returns: bool: 是否重置成功 """ diff --git a/webui/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 b/webui/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 new file mode 100644 index 00000000..0acaaff0 Binary files /dev/null and b/webui/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 differ diff --git a/webui/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff b/webui/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff new file mode 100644 index 00000000..b804d7b3 Binary files /dev/null and b/webui/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff differ diff --git a/webui/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf b/webui/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf new file mode 100644 index 00000000..c6f9a5e7 Binary files /dev/null and b/webui/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf differ diff --git a/webui/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf b/webui/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf new file mode 100644 index 00000000..9ff4a5e0 Binary files /dev/null and b/webui/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf differ diff --git a/webui/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff b/webui/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff new file mode 100644 index 00000000..9759710d Binary files /dev/null and b/webui/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff differ diff --git a/webui/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 b/webui/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 new file mode 100644 index 00000000..f390922e Binary files /dev/null and b/webui/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 differ diff --git a/webui/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff b/webui/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff new file mode 100644 index 00000000..9bdd534f Binary files /dev/null and b/webui/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff differ diff --git a/webui/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 b/webui/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 new file mode 100644 index 00000000..75344a1f Binary files /dev/null and b/webui/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 differ diff --git a/webui/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf b/webui/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf new file mode 100644 index 00000000..f522294f Binary files /dev/null and b/webui/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf differ diff --git a/webui/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf b/webui/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf new file mode 100644 index 00000000..4e98259c Binary files /dev/null and b/webui/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf differ diff --git a/webui/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff b/webui/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff new file mode 100644 index 00000000..e7730f66 Binary files /dev/null and b/webui/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff differ diff --git a/webui/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 b/webui/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 new file mode 100644 index 00000000..395f28be Binary files /dev/null and b/webui/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 differ diff --git a/webui/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf b/webui/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf new file mode 100644 index 00000000..b8461b27 Binary files /dev/null and b/webui/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf differ diff --git a/webui/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 b/webui/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 new file mode 100644 index 00000000..735f6948 Binary files /dev/null and b/webui/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 differ diff --git a/webui/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff b/webui/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff new file mode 100644 index 00000000..acab069f Binary files /dev/null and b/webui/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff differ diff --git a/webui/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 b/webui/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 new file mode 100644 index 00000000..ab2ad21d Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 differ diff --git a/webui/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff b/webui/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff new file mode 100644 index 00000000..f38136ac Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff differ diff --git a/webui/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf b/webui/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf new file mode 100644 index 00000000..4060e627 Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf differ diff --git a/webui/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 b/webui/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 new file mode 100644 index 00000000..5931794d Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 differ diff --git a/webui/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf b/webui/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf new file mode 100644 index 00000000..dc007977 Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf differ diff --git a/webui/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff b/webui/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff new file mode 100644 index 00000000..67807b0b Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff differ diff --git a/webui/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf b/webui/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf new file mode 100644 index 00000000..0e9b0f35 Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf differ diff --git a/webui/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff b/webui/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff new file mode 100644 index 00000000..6f43b594 Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff differ diff --git a/webui/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 b/webui/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 new file mode 100644 index 00000000..b50920e1 Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 differ diff --git a/webui/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 b/webui/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 new file mode 100644 index 00000000..eb24a7ba Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 differ diff --git a/webui/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff b/webui/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff new file mode 100644 index 00000000..21f58129 Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff differ diff --git a/webui/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf b/webui/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf new file mode 100644 index 00000000..dd45e1ed Binary files /dev/null and b/webui/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf differ diff --git a/webui/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf b/webui/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf new file mode 100644 index 00000000..728ce7a1 Binary files /dev/null and b/webui/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf differ diff --git a/webui/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 b/webui/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 new file mode 100644 index 00000000..29657023 Binary files /dev/null and b/webui/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 differ diff --git a/webui/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff b/webui/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff new file mode 100644 index 00000000..0ae390d7 Binary files /dev/null and b/webui/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff differ diff --git a/webui/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff b/webui/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff new file mode 100644 index 00000000..eb5159d4 Binary files /dev/null and b/webui/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff differ diff --git a/webui/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf b/webui/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf new file mode 100644 index 00000000..70d559b4 Binary files /dev/null and b/webui/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf differ diff --git a/webui/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 b/webui/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 new file mode 100644 index 00000000..215c143f Binary files /dev/null and b/webui/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf b/webui/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf new file mode 100644 index 00000000..2f65a8a3 Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 b/webui/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 new file mode 100644 index 00000000..cfaa3bda Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff b/webui/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff new file mode 100644 index 00000000..8d47c02d Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 b/webui/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 new file mode 100644 index 00000000..349c06dc Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff b/webui/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff new file mode 100644 index 00000000..7e02df96 Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf b/webui/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf new file mode 100644 index 00000000..d5850df9 Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf b/webui/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf new file mode 100644 index 00000000..537279f6 Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff b/webui/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff new file mode 100644 index 00000000..31b84829 Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff differ diff --git a/webui/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 b/webui/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 new file mode 100644 index 00000000..a90eea85 Binary files /dev/null and b/webui/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 differ diff --git a/webui/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf b/webui/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf new file mode 100644 index 00000000..fd679bf3 Binary files /dev/null and b/webui/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf differ diff --git a/webui/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 b/webui/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 new file mode 100644 index 00000000..b3048fc1 Binary files /dev/null and b/webui/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 differ diff --git a/webui/dist/assets/KaTeX_Script-Regular-D5yQViql.woff b/webui/dist/assets/KaTeX_Script-Regular-D5yQViql.woff new file mode 100644 index 00000000..0e7da821 Binary files /dev/null and b/webui/dist/assets/KaTeX_Script-Regular-D5yQViql.woff differ diff --git a/webui/dist/assets/KaTeX_Size1-Regular-C195tn64.woff b/webui/dist/assets/KaTeX_Size1-Regular-C195tn64.woff new file mode 100644 index 00000000..7f292d91 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size1-Regular-C195tn64.woff differ diff --git a/webui/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf b/webui/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf new file mode 100644 index 00000000..871fd7d1 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf differ diff --git a/webui/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 b/webui/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 new file mode 100644 index 00000000..c5a8462f Binary files /dev/null and b/webui/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 differ diff --git a/webui/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf b/webui/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf new file mode 100644 index 00000000..7a212caf Binary files /dev/null and b/webui/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf differ diff --git a/webui/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 b/webui/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 new file mode 100644 index 00000000..e1bccfe2 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 differ diff --git a/webui/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff b/webui/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff new file mode 100644 index 00000000..d241d9be Binary files /dev/null and b/webui/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff differ diff --git a/webui/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff b/webui/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff new file mode 100644 index 00000000..e6e9b658 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff differ diff --git a/webui/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf b/webui/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf new file mode 100644 index 00000000..00bff349 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf differ diff --git a/webui/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff b/webui/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff new file mode 100644 index 00000000..e1ec5457 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff differ diff --git a/webui/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf b/webui/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf new file mode 100644 index 00000000..74f08921 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf differ diff --git a/webui/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 b/webui/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 new file mode 100644 index 00000000..680c1308 Binary files /dev/null and b/webui/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 differ diff --git a/webui/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff b/webui/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff new file mode 100644 index 00000000..2432419f Binary files /dev/null and b/webui/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff differ diff --git a/webui/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 b/webui/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 new file mode 100644 index 00000000..771f1af7 Binary files /dev/null and b/webui/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 differ diff --git a/webui/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf b/webui/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf new file mode 100644 index 00000000..c83252c5 Binary files /dev/null and b/webui/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf differ diff --git a/webui/dist/assets/charts-DU5SeejN.js b/webui/dist/assets/charts-DU5SeejN.js new file mode 100644 index 00000000..4b6aaf32 --- /dev/null +++ b/webui/dist/assets/charts-DU5SeejN.js @@ -0,0 +1,65 @@ +import{r as N,R as S,i as Qt}from"./router-BWgTyY51.js";import{c as vi,g as oe}from"./react-vendor-Dtc2IqVY.js";function zb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}return Ho=t,Ho}var Ko,Op;function PO(){if(Op)return Ko;Op=1;var e=ja();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ko=t,Ko}var Go,_p;function Ma(){if(_p)return Go;_p=1;var e=OO(),t=_O(),r=AO(),n=SO(),i=PO();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u0?1:-1},Gt=function(t){return er(t)&&t.indexOf("%")===t.length-1},q=function(t){return XO(t)&&!oi(t)},YO=function(t){return Y(t)},Ae=function(t){return q(t)||er(t)},ZO=0,Zr=function(t){var r=++ZO;return"".concat(t||"").concat(r)},Ie=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&!er(t))return n;var a;if(Gt(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return oi(a)&&(a=n),i&&a>r&&(a=r),a},Mt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},JO=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function a_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ml(e){"@babel/helpers - typeof";return ml=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ml(e)}var Zp={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},bt=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Jp=null,bu=null,Kf=function e(t){if(t===Jp&&Array.isArray(bu))return bu;var r=[];return N.Children.forEach(t,function(n){Y(n)||(HO.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),bu=r,Jp=t,r};function Ke(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return bt(i)}):n=[bt(t)],Kf(e).forEach(function(i){var a=He(i,"type.displayName")||He(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function We(e,t){var r=Ke(e,t);return r&&r[0]}var Qp=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!q(n)||n<=0||!q(i)||i<=0)},o_=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],u_=function(t){return t&&t.type&&er(t.type)&&o_.indexOf(t.type)>=0},c_=function(t){return t&&ml(t)==="object"&&"clipDot"in t},s_=function(t,r,n,i){var a,o=(a=gu?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!X(t)&&(i&&o.includes(r)||t_.includes(r))||n&&Hf.includes(r)},H=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!Yr(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;s_((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},gl=function e(t,r){if(t===r)return!0;var n=N.Children.count(t);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return ed(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function d_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xl(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=p_(e,h_),f=i||{width:r,height:n,x:0,y:0},l=J("recharts-surface",a);return S.createElement("svg",bl({},H(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),S.createElement("title",null,u),S.createElement("desc",null,c),t)}var v_=["children","className"];function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var te=S.forwardRef(function(e,t){var r=e.children,n=e.className,i=y_(e,v_),a=J("recharts-layer",n);return S.createElement("g",wl({className:a},H(i,!0),{ref:t}),r)}),it=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return wu=t,wu}var Ou,id;function Zb(){if(id)return Ou;id=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function c(s){return u.test(s)}return Ou=c,Ou}var _u,ad;function x_(){if(ad)return _u;ad=1;function e(t){return t.split("")}return _u=e,_u}var Au,od;function w_(){if(od)return Au;od=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",s="(?:"+u+"|"+c+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",y=s+"?",v="["+a+"]?",p="(?:"+d+"(?:"+[f,l,h].join("|")+")"+v+y+")*",g=v+y+p,x="(?:"+[f+u+"?",u,l,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+x+g,"g");function O(m){return m.match(w)||[]}return Au=O,Au}var Su,ud;function O_(){if(ud)return Su;ud=1;var e=x_(),t=Zb(),r=w_();function n(i){return t(i)?r(i):e(i)}return Su=n,Su}var Pu,cd;function __(){if(cd)return Pu;cd=1;var e=b_(),t=Zb(),r=O_(),n=Gb();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,c=u?u[0]:o.charAt(0),s=u?e(u,1).join(""):o.slice(1);return c[a]()+s}}return Pu=i,Pu}var Tu,sd;function A_(){if(sd)return Tu;sd=1;var e=__(),t=e("toUpperCase");return Tu=t,Tu}var S_=A_();const Ia=oe(S_);function se(e){return function(){return e}}const Jb=Math.cos,Ci=Math.sin,at=Math.sqrt,Ii=Math.PI,ka=2*Ii,Ol=Math.PI,_l=2*Ol,Ut=1e-6,P_=_l-Ut;function Qb(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Qb;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iUt)if(!(Math.abs(l*c-s*f)>Ut)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-o,y=i-u,v=c*c+s*s,p=d*d+y*y,g=Math.sqrt(v),x=Math.sqrt(h),w=a*Math.tan((Ol-Math.acos((v+h-p)/(2*g*x)))/2),O=w/x,m=w/g;Math.abs(O-1)>Ut&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*d>f*y)},${this._x1=t+m*c},${this._y1=r+m*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Ut||Math.abs(this._y1-f)>Ut)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%_l+_l),h>P_?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:h>Ut&&this._append`A${n},${n},0,${+(h>=Ol)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Gf(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new E_(t)}function Vf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function e0(e){this._context=e}e0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ra(e){return new e0(e)}function t0(e){return e[0]}function r0(e){return e[1]}function n0(e,t){var r=se(!0),n=null,i=Ra,a=null,o=Gf(u);e=typeof e=="function"?e:e===void 0?t0:se(e),t=typeof t=="function"?t:t===void 0?r0:se(t);function u(c){var s,f=(c=Vf(c)).length,l,h=!1,d;for(n==null&&(a=i(d=o())),s=0;s<=f;++s)!(s=d;--y)u.point(w[y],O[y]);u.lineEnd(),u.areaEnd()}g&&(w[h]=+e(p,h,l),O[h]=+t(p,h,l),u.point(n?+n(p,h,l):w[h],r?+r(p,h,l):O[h]))}if(x)return u=null,x+""||null}function f(){return n0().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:se(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:se(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:se(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:se(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:se(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:se(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:se(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class i0{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function j_(e){return new i0(e,!0)}function M_(e){return new i0(e,!1)}const Xf={draw(e,t){const r=at(t/Ii);e.moveTo(r,0),e.arc(0,0,r,0,ka)}},$_={draw(e,t){const r=at(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},a0=at(1/3),C_=a0*2,I_={draw(e,t){const r=at(t/C_),n=r*a0;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},k_={draw(e,t){const r=at(t),n=-r/2;e.rect(n,n,r,r)}},R_=.8908130915292852,o0=Ci(Ii/10)/Ci(7*Ii/10),D_=Ci(ka/10)*o0,N_=-Jb(ka/10)*o0,q_={draw(e,t){const r=at(t*R_),n=D_*r,i=N_*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=ka*a/5,u=Jb(o),c=Ci(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},Eu=at(3),L_={draw(e,t){const r=-at(t/(Eu*3));e.moveTo(0,r*2),e.lineTo(-Eu*r,-r),e.lineTo(Eu*r,-r),e.closePath()}},Ge=-.5,Ve=at(3)/2,Al=1/at(12),B_=(Al/2+1)*3,F_={draw(e,t){const r=at(t/B_),n=r/2,i=r*Al,a=n,o=r*Al+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(Ge*n-Ve*i,Ve*n+Ge*i),e.lineTo(Ge*a-Ve*o,Ve*a+Ge*o),e.lineTo(Ge*u-Ve*c,Ve*u+Ge*c),e.lineTo(Ge*n+Ve*i,Ge*i-Ve*n),e.lineTo(Ge*a+Ve*o,Ge*o-Ve*a),e.lineTo(Ge*u+Ve*c,Ge*c-Ve*u),e.closePath()}};function W_(e,t){let r=null,n=Gf(i);e=typeof e=="function"?e:se(e||Xf),t=typeof t=="function"?t:se(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:se(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:se(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ki(){}function Ri(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function u0(e){this._context=e}u0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ri(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ri(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function z_(e){return new u0(e)}function c0(e){this._context=e}c0.prototype={areaStart:ki,areaEnd:ki,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ri(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function U_(e){return new c0(e)}function s0(e){this._context=e}s0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ri(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function H_(e){return new s0(e)}function l0(e){this._context=e}l0.prototype={areaStart:ki,areaEnd:ki,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function K_(e){return new l0(e)}function ld(e){return e<0?-1:1}function fd(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(ld(a)+ld(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function hd(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function ju(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Di(e){this._context=e}Di.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ju(this,this._t0,hd(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ju(this,hd(this,r=fd(this,e,t)),r);break;default:ju(this,this._t0,r=fd(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function f0(e){this._context=new h0(e)}(f0.prototype=Object.create(Di.prototype)).point=function(e,t){Di.prototype.point.call(this,t,e)};function h0(e){this._context=e}h0.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function G_(e){return new Di(e)}function V_(e){return new f0(e)}function p0(e){this._context=e}p0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=pd(e),i=pd(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Y_(e){return new Da(e,.5)}function Z_(e){return new Da(e,0)}function J_(e){return new Da(e,1)}function Ar(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function Q_(e,t){return e[t]}function e1(e){const t=[];return t.key=e,t}function t1(){var e=se([]),t=Sl,r=Ar,n=Q_;function i(a){var o=Array.from(e.apply(this,arguments),e1),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var d0={symbolCircle:Xf,symbolCross:$_,symbolDiamond:I_,symbolSquare:k_,symbolStar:q_,symbolTriangle:L_,symbolWye:F_},f1=Math.PI/180,h1=function(t){var r="symbol".concat(Ia(t));return d0[r]||Xf},p1=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*f1;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},d1=function(t,r){d0["symbol".concat(Ia(t))]=r},Yf=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=s1(t,a1),s=vd(vd({},c),{},{type:n,size:a,sizeType:u}),f=function(){var p=h1(n),g=W_().type(p).size(p1(a,u,n));return g()},l=s.className,h=s.cx,d=s.cy,y=H(s,!0);return h===+h&&d===+d&&a===+a?S.createElement("path",Pl({},y,{className:J("recharts-symbols",l),transform:"translate(".concat(h,", ").concat(d,")"),d:f()})):null};Yf.registerSymbol=d1;function Sr(e){"@babel/helpers - typeof";return Sr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sr(e)}function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=d.inactive?s:d.color;return S.createElement("li",Tl({className:p,style:l,key:"legend-item-".concat(y)},tr(n.props,d,y)),S.createElement(xl,{width:o,height:o,viewBox:f,style:h},n.renderIcon(d)),S.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(g,d,y):g))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(N.PureComponent);Sn(Zf,"displayName","Legend");Sn(Zf,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Mu,md;function A1(){if(md)return Mu;md=1;var e=Ma();function t(){this.__data__=new e,this.size=0}return Mu=t,Mu}var $u,gd;function S1(){if(gd)return $u;gd=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return $u=e,$u}var Cu,bd;function P1(){if(bd)return Cu;bd=1;function e(t){return this.__data__.get(t)}return Cu=e,Cu}var Iu,xd;function T1(){if(xd)return Iu;xd=1;function e(t){return this.__data__.has(t)}return Iu=e,Iu}var ku,wd;function E1(){if(wd)return ku;wd=1;var e=Ma(),t=Ff(),r=Wf(),n=200;function i(a,o){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.lengthd))return!1;var v=l.get(o),p=l.get(u);if(v&&p)return v==u&&p==o;var g=-1,x=!0,w=c&i?new e:void 0;for(l.set(o,u),l.set(u,o);++g-1&&n%1==0&&n-1&&r%1==0&&r<=e}return rc=t,rc}var nc,Hd;function F1(){if(Hd)return nc;Hd=1;var e=St(),t=th(),r=Pt(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",s="[object Map]",f="[object Number]",l="[object Object]",h="[object RegExp]",d="[object Set]",y="[object String]",v="[object WeakMap]",p="[object ArrayBuffer]",g="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",m="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",T="[object Uint16Array]",M="[object Uint32Array]",P={};P[x]=P[w]=P[O]=P[m]=P[b]=P[_]=P[A]=P[T]=P[M]=!0,P[n]=P[i]=P[p]=P[a]=P[g]=P[o]=P[u]=P[c]=P[s]=P[f]=P[l]=P[h]=P[d]=P[y]=P[v]=!1;function E(j){return r(j)&&t(j.length)&&!!P[e(j)]}return nc=E,nc}var ic,Kd;function A0(){if(Kd)return ic;Kd=1;function e(t){return function(r){return t(r)}}return ic=e,ic}var vn={exports:{}};vn.exports;var Gd;function W1(){return Gd||(Gd=1,(function(e,t){var r=Ub(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(vn,vn.exports)),vn.exports}var ac,Vd;function S0(){if(Vd)return ac;Vd=1;var e=F1(),t=A0(),r=W1(),n=r&&r.isTypedArray,i=n?t(n):e;return ac=i,ac}var oc,Xd;function z1(){if(Xd)return oc;Xd=1;var e=q1(),t=Qf(),r=qe(),n=_0(),i=eh(),a=S0(),o=Object.prototype,u=o.hasOwnProperty;function c(s,f){var l=r(s),h=!l&&t(s),d=!l&&!h&&n(s),y=!l&&!h&&!d&&a(s),v=l||h||d||y,p=v?e(s.length,String):[],g=p.length;for(var x in s)(f||u.call(s,x))&&!(v&&(x=="length"||d&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,g)))&&p.push(x);return p}return oc=c,oc}var uc,Yd;function U1(){if(Yd)return uc;Yd=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return uc=t,uc}var cc,Zd;function P0(){if(Zd)return cc;Zd=1;function e(t,r){return function(n){return t(r(n))}}return cc=e,cc}var sc,Jd;function H1(){if(Jd)return sc;Jd=1;var e=P0(),t=e(Object.keys,Object);return sc=t,sc}var lc,Qd;function K1(){if(Qd)return lc;Qd=1;var e=U1(),t=H1(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return lc=i,lc}var fc,ev;function ui(){if(ev)return fc;ev=1;var e=Lf(),t=th();function r(n){return n!=null&&t(n.length)&&!e(n)}return fc=r,fc}var hc,tv;function Na(){if(tv)return hc;tv=1;var e=z1(),t=K1(),r=ui();function n(i){return r(i)?e(i):t(i)}return hc=n,hc}var pc,rv;function G1(){if(rv)return pc;rv=1;var e=k1(),t=N1(),r=Na();function n(i){return e(i,r,t)}return pc=n,pc}var dc,nv;function V1(){if(nv)return dc;nv=1;var e=G1(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,c,s,f){var l=u&t,h=e(a),d=h.length,y=e(o),v=y.length;if(d!=v&&!l)return!1;for(var p=d;p--;){var g=h[p];if(!(l?g in o:n.call(o,g)))return!1}var x=f.get(a),w=f.get(o);if(x&&w)return x==o&&w==a;var O=!0;f.set(a,o),f.set(o,a);for(var m=l;++p-1}return Bc=t,Bc}var Fc,Mv;function dA(){if(Mv)return Fc;Mv=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var g=s?null:i(c);if(g)return a(g);y=!1,h=n,p=new e}else p=s?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function MA(e){return e.value}function $A(e,t){if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return S.createElement(e,t);t.ref;var r=EA(t,xA);return S.createElement(Zf,r)}var qv=1,wr=(function(e){function t(){var r;wA(this,t);for(var n=arguments.length,i=new Array(n),a=0;aqv||Math.abs(i.height-this.lastBoundingBox.height)>qv)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?pt({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();l={left:((s||0)-d.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();h={top:((f||0)-y.height)/2}}else h=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return pt(pt({},l),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=pt(pt({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return S.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(d){n.wrapperNode=d}},$A(a,pt(pt({},this.props),{},{payload:$0(f,s,MA)})))}}],[{key:"getWithHeight",value:function(n,i){var a=pt(pt({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&q(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);qa(wr,"displayName","Legend");qa(wr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Kc,Lv;function CA(){if(Lv)return Kc;Lv=1;var e=ai(),t=Qf(),r=qe(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return Kc=i,Kc}var Gc,Bv;function k0(){if(Bv)return Gc;Bv=1;var e=O0(),t=CA();function r(n,i,a,o,u){var c=-1,s=n.length;for(a||(a=t),u||(u=[]);++c0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return Gc=r,Gc}var Vc,Fv;function IA(){if(Fv)return Vc;Fv=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var s=u[t?c:++a];if(n(o[s],s,o)===!1)break}return r}}return Vc=e,Vc}var Xc,Wv;function kA(){if(Wv)return Xc;Wv=1;var e=IA(),t=e();return Xc=t,Xc}var Yc,zv;function R0(){if(zv)return Yc;zv=1;var e=kA(),t=Na();function r(n,i){return n&&e(n,i,t)}return Yc=r,Yc}var Zc,Uv;function RA(){if(Uv)return Zc;Uv=1;var e=ui();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++un||u&&c&&f&&!s&&!l||a&&c&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=s)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return rs=t,rs}var ns,Yv;function LA(){if(Yv)return ns;Yv=1;var e=zf(),t=Uf(),r=ht(),n=D0(),i=DA(),a=A0(),o=qA(),u=Jr(),c=qe();function s(f,l,h){l.length?l=e(l,function(v){return c(v)?function(p){return t(p,v.length===1?v[0]:v)}:v}):l=[u];var d=-1;l=e(l,a(r));var y=n(f,function(v,p,g){var x=e(l,function(w){return w(v)});return{criteria:x,index:++d,value:v}});return i(y,function(v,p){return o(v,p,h)})}return ns=s,ns}var is,Zv;function BA(){if(Zv)return is;Zv=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return is=e,is}var as,Jv;function FA(){if(Jv)return as;Jv=1;var e=BA(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=t(o.length-i,0),s=Array(c);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return ss=n,ss}var ls,ny;function HA(){if(ny)return ls;ny=1;var e=zA(),t=UA(),r=t(e);return ls=r,ls}var fs,iy;function KA(){if(iy)return fs;iy=1;var e=Jr(),t=FA(),r=HA();function n(i,a){return r(t(i,a,e),i+"")}return fs=n,fs}var hs,ay;function La(){if(ay)return hs;ay=1;var e=Bf(),t=ui(),r=eh(),n=It();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?t(u)&&r(o,u.length):c=="string"&&o in u)?e(u[o],a):!1}return hs=i,hs}var ps,oy;function GA(){if(oy)return ps;oy=1;var e=k0(),t=LA(),r=KA(),n=La(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return ps=i,ps}var VA=GA();const ih=oe(VA);function Pn(e){"@babel/helpers - typeof";return Pn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(e)}function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(an,"-left"),q(r)&&t&&q(t.x)&&r=t.y),"".concat(an,"-top"),q(n)&&t&&q(t.y)&&nv?Math.max(f,c[n]):Math.max(l,c[n])}function sS(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function lS(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,c=e.viewBox,s,f,l;return o.height>0&&o.width>0&&r?(f=sy({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),l=sy({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=sS({translateX:f,translateY:l,useTranslate3d:u})):s=uS,{cssProperties:s,cssClasses:cS({translateX:f,translateY:l,coordinate:r})}}function Tr(e){"@babel/helpers - typeof";return Tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(e)}function ly(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fy(e){for(var t=1;thy||Math.abs(n.height-this.state.lastBoundingBox.height)>hy)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,s=i.children,f=i.coordinate,l=i.hasPayload,h=i.isAnimationActive,d=i.offset,y=i.position,v=i.reverseDirection,p=i.useTranslate3d,g=i.viewBox,x=i.wrapperStyle,w=lS({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:d,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:g}),O=w.cssClasses,m=w.cssProperties,b=fy(fy({transition:h&&a?"transform ".concat(u,"ms ").concat(c):void 0},m),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},x);return S.createElement("div",{tabIndex:-1,className:O,style:b,ref:function(A){n.wrapperNode=A}},s)}}])})(N.PureComponent),xS=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},or={isSsr:xS()};function Er(e){"@babel/helpers - typeof";return Er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(e)}function py(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dy(e){for(var t=1;t0;return S.createElement(bS,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:h,active:a,coordinate:f,hasPayload:b,offset:d,position:p,reverseDirection:g,useTranslate3d:x,viewBox:w,wrapperStyle:O},MS(s,dy(dy({},this.props),{},{payload:m})))}}])})(N.PureComponent);ah(dt,"displayName","Tooltip");ah(dt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!or.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var vs,vy;function $S(){if(vy)return vs;vy=1;var e=ft(),t=function(){return e.Date.now()};return vs=t,vs}var ys,yy;function CS(){if(yy)return ys;yy=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return ys=t,ys}var ms,my;function IS(){if(my)return ms;my=1;var e=CS(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return ms=r,ms}var gs,gy;function W0(){if(gy)return gs;gy=1;var e=IS(),t=It(),r=Xr(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function c(s){if(typeof s=="number")return s;if(r(s))return n;if(t(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=t(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=e(s);var l=a.test(s);return l||o.test(s)?u(s.slice(2),l?2:8):i.test(s)?n:+s}return gs=c,gs}var bs,by;function kS(){if(by)return bs;by=1;var e=It(),t=$S(),r=W0(),n="Expected a function",i=Math.max,a=Math.min;function o(u,c,s){var f,l,h,d,y,v,p=0,g=!1,x=!1,w=!0;if(typeof u!="function")throw new TypeError(n);c=r(c)||0,e(s)&&(g=!!s.leading,x="maxWait"in s,h=x?i(r(s.maxWait)||0,c):h,w="trailing"in s?!!s.trailing:w);function O(j){var C=f,$=l;return f=l=void 0,p=j,d=u.apply($,C),d}function m(j){return p=j,y=setTimeout(A,c),g?O(j):d}function b(j){var C=j-v,$=j-p,k=c-C;return x?a(k,h-$):k}function _(j){var C=j-v,$=j-p;return v===void 0||C>=c||C<0||x&&$>=h}function A(){var j=t();if(_(j))return T(j);y=setTimeout(A,b(j))}function T(j){return y=void 0,w&&f?O(j):(f=l=void 0,d)}function M(){y!==void 0&&clearTimeout(y),p=0,f=v=l=y=void 0}function P(){return y===void 0?d:T(t())}function E(){var j=t(),C=_(j);if(f=arguments,l=this,v=j,C){if(y===void 0)return m(v);if(x)return clearTimeout(y),y=setTimeout(A,c),O(v)}return y===void 0&&(y=setTimeout(A,c)),d}return E.cancel=M,E.flush=P,E}return bs=o,bs}var xs,xy;function RS(){if(xy)return xs;xy=1;var e=kS(),t=It(),r="Expected a function";function n(i,a,o){var u=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:u,maxWait:a,trailing:c})}return xs=n,xs}var DS=RS();const z0=oe(DS);function En(e){"@babel/helpers - typeof";return En=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},En(e)}function wy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gi(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(j=z0(j,v,{trailing:!0,leading:!1}));var C=new ResizeObserver(j),$=m.current.getBoundingClientRect(),k=$.width,R=$.height;return P(k,R),C.observe(m.current),function(){C.disconnect()}},[P,v]);var E=N.useMemo(function(){var j=T.containerWidth,C=T.containerHeight;if(j<0||C<0)return null;it(Gt(o)||Gt(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,c),it(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=Gt(o)?j:o,k=Gt(c)?C:c;r&&r>0&&($?k=$/r:k&&($=k*r),h&&k>h&&(k=h)),it($>0||k>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,$,k,o,c,f,l,r);var R=!Array.isArray(d)&&bt(d.type).endsWith("Chart");return S.Children.map(d,function(L){return S.isValidElement(L)?N.cloneElement(L,gi({width:$,height:k},R?{style:gi({height:"100%",width:"100%",maxHeight:k,maxWidth:$},L.props.style)}:{})):L})},[r,d,c,h,l,f,T,o]);return S.createElement("div",{id:p?"".concat(p):void 0,className:J("recharts-responsive-container",g),style:gi(gi({},O),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:h}),ref:m},E)}),oh=function(t){return null};oh.displayName="Cell";function jn(e){"@babel/helpers - typeof";return jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(e)}function _y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kl(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||or.isSsr)return{width:0,height:0};var n=YS(r),i=JSON.stringify({text:t,copyStyle:n});if(fr.widthCache[i])return fr.widthCache[i];try{var a=document.getElementById(Ay);a||(a=document.createElement("span"),a.setAttribute("id",Ay),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=kl(kl({},XS),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return fr.widthCache[i]=c,++fr.cacheCount>VS&&(fr.cacheCount=0,fr.widthCache={}),c}catch{return{width:0,height:0}}},ZS=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Mn(e){"@babel/helpers - typeof";return Mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(e)}function Fi(e,t){return tP(e)||eP(e,t)||QS(e,t)||JS()}function JS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QS(e,t){if(e){if(typeof e=="string")return Sy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sy(e,t)}}function Sy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $y(e,t){return bP(e)||gP(e,t)||mP(e,t)||yP()}function yP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mP(e,t){if(e){if(typeof e=="string")return Cy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cy(e,t)}}function Cy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(k,R){var L=R.word,B=R.width,U=k[k.length-1];if(U&&(i==null||a||U.width+B+nR.width?k:R})};if(!f)return d;for(var v="…",p=function($){var k=l.slice(0,$),R=G0({breakAll:s,style:c,children:k+v}).wordsWithComputedWidth,L=h(R),B=L.length>o||y(L).width>Number(i);return[B,L]},g=0,x=l.length-1,w=0,O;g<=x&&w<=l.length-1;){var m=Math.floor((g+x)/2),b=m-1,_=p(b),A=$y(_,2),T=A[0],M=A[1],P=p(m),E=$y(P,1),j=E[0];if(!T&&!j&&(g=m+1),T&&j&&(x=m-1),!T&&j){O=M;break}w++}return O||d},Iy=function(t){var r=Y(t)?[]:t.toString().split(K0);return[{words:r}]},wP=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!or.isSsr){var c,s,f=G0({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,h=f.spaceWidth;c=l,s=h}else return Iy(i);return xP({breakAll:o,children:i,maxLines:u,style:a},c,s,r,n)}return Iy(i)},ky="#808080",rr=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,c=t.capHeight,s=c===void 0?"0.71em":c,f=t.scaleToFit,l=f===void 0?!1:f,h=t.textAnchor,d=h===void 0?"start":h,y=t.verticalAnchor,v=y===void 0?"end":y,p=t.fill,g=p===void 0?ky:p,x=My(t,pP),w=N.useMemo(function(){return wP({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:l,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,l,x.style,x.width]),O=x.dx,m=x.dy,b=x.angle,_=x.className,A=x.breakAll,T=My(x,dP);if(!Ae(n)||!Ae(a))return null;var M=n+(q(O)?O:0),P=a+(q(m)?m:0),E;switch(v){case"start":E=ws("calc(".concat(s,")"));break;case"middle":E=ws("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(s," / 2))"));break;default:E=ws("calc(".concat(w.length-1," * -").concat(u,")"));break}var j=[];if(l){var C=w[0].width,$=x.width;j.push("scale(".concat((q($)?$/C:1)/C,")"))}return b&&j.push("rotate(".concat(b,", ").concat(M,", ").concat(P,")")),j.length&&(T.transform=j.join(" ")),S.createElement("text",Rl({},H(T,!0),{x:M,y:P,className:J("recharts-text",_),textAnchor:d,fill:g.includes("url")?ky:g}),w.map(function(k,R){var L=k.words.join(A?"":" ");return S.createElement("tspan",{x:M,dy:R===0?E:u,key:"".concat(L,"-").concat(R)},L)}))};function Ct(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function OP(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function uh(e){let t,r,n;e.length!==2?(t=Ct,r=(u,c)=>Ct(e(u),c),n=(u,c)=>e(u)-c):(t=e===Ct||e===OP?e:_P,r=e,n=e);function i(u,c,s=0,f=u.length){if(s>>1;r(u[l],c)<0?s=l+1:f=l}while(s>>1;r(u[l],c)<=0?s=l+1:f=l}while(ss&&n(u[l-1],c)>-n(u[l],c)?l-1:l}return{left:i,center:o,right:a}}function _P(){return 0}function V0(e){return e===null?NaN:+e}function*AP(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const SP=uh(Ct),ci=SP.right;uh(V0).center;class Ry extends Map{constructor(t,r=EP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Dy(this,t))}has(t){return super.has(Dy(this,t))}set(t,r){return super.set(PP(this,t),r)}delete(t){return super.delete(TP(this,t))}}function Dy({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function PP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function TP({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function EP(e){return e!==null&&typeof e=="object"?e.valueOf():e}function jP(e=Ct){if(e===Ct)return X0;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function X0(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const MP=Math.sqrt(50),$P=Math.sqrt(10),CP=Math.sqrt(2);function Wi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=MP?10:a>=$P?5:a>=CP?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),c=Math.round(t*s),u/st&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),c=Math.round(t/s),u*st&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(r=n);return r}function qy(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Y0(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?X0:jP(i);n>r;){if(n-r>600){const c=n-r+1,s=t-r+1,f=Math.log(c),l=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*l*(c-l)/c)*(s-c/2<0?-1:1),d=Math.max(r,Math.floor(t-s*l/c+h)),y=Math.min(n,Math.floor(t+(c-s)*l/c+h));Y0(e,t,d,y,i)}const a=e[t];let o=r,u=n;for(on(e,r,t),i(e[n],a)>0&&on(e,r,n);o0;)--u}i(e[r],a)===0?on(e,r,u):(++u,on(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function on(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function IP(e,t,r){if(e=Float64Array.from(AP(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return qy(e);if(t>=1)return Ny(e);var n,i=(n-1)*t,a=Math.floor(i),o=Ny(Y0(e,a).subarray(0,a+1)),u=qy(e.subarray(a+1));return o+(u-o)*(i-a)}}function kP(e,t,r=V0){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function RP(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?xi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?xi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=NP.exec(e))?new Ne(t[1],t[2],t[3],1):(t=qP.exec(e))?new Ne(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LP.exec(e))?xi(t[1],t[2],t[3],t[4]):(t=BP.exec(e))?xi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=FP.exec(e))?Hy(t[1],t[2]/100,t[3]/100,1):(t=WP.exec(e))?Hy(t[1],t[2]/100,t[3]/100,t[4]):Ly.hasOwnProperty(e)?Wy(Ly[e]):e==="transparent"?new Ne(NaN,NaN,NaN,0):null}function Wy(e){return new Ne(e>>16&255,e>>8&255,e&255,1)}function xi(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ne(e,t,r,n)}function HP(e){return e instanceof si||(e=kn(e)),e?(e=e.rgb(),new Ne(e.r,e.g,e.b,e.opacity)):new Ne}function Bl(e,t,r,n){return arguments.length===1?HP(e):new Ne(e,t,r,n??1)}function Ne(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}sh(Ne,Bl,J0(si,{brighter(e){return e=e==null?zi:Math.pow(zi,e),new Ne(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new Ne(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ne(Zt(this.r),Zt(this.g),Zt(this.b),Ui(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zy,formatHex:zy,formatHex8:KP,formatRgb:Uy,toString:Uy}));function zy(){return`#${Vt(this.r)}${Vt(this.g)}${Vt(this.b)}`}function KP(){return`#${Vt(this.r)}${Vt(this.g)}${Vt(this.b)}${Vt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Uy(){const e=Ui(this.opacity);return`${e===1?"rgb(":"rgba("}${Zt(this.r)}, ${Zt(this.g)}, ${Zt(this.b)}${e===1?")":`, ${e})`}`}function Ui(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vt(e){return e=Zt(e),(e<16?"0":"")+e.toString(16)}function Hy(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new nt(e,t,r,n)}function Q0(e){if(e instanceof nt)return new nt(e.h,e.s,e.l,e.opacity);if(e instanceof si||(e=kn(e)),!e)return new nt;if(e instanceof nt)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&c<1?0:o,new nt(o,u,c,e.opacity)}function GP(e,t,r,n){return arguments.length===1?Q0(e):new nt(e,t,r,n??1)}function nt(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}sh(nt,GP,J0(si,{brighter(e){return e=e==null?zi:Math.pow(zi,e),new nt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new nt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ne(Os(e>=240?e-240:e+120,i,n),Os(e,i,n),Os(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new nt(Ky(this.h),wi(this.s),wi(this.l),Ui(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ui(this.opacity);return`${e===1?"hsl(":"hsla("}${Ky(this.h)}, ${wi(this.s)*100}%, ${wi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ky(e){return e=(e||0)%360,e<0?e+360:e}function wi(e){return Math.max(0,Math.min(1,e||0))}function Os(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const lh=e=>()=>e;function VP(e,t){return function(r){return e+r*t}}function XP(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function YP(e){return(e=+e)==1?ex:function(t,r){return r-t?XP(t,r,e):lh(isNaN(t)?r:t)}}function ex(e,t){var r=t-e;return r?VP(e,r):lh(isNaN(e)?t:e)}const Gy=(function e(t){var r=YP(t);function n(i,a){var o=r((i=Bl(i)).r,(a=Bl(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),s=ex(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=c(f),i.opacity=s(f),i+""}}return n.gamma=e,n})(1);function ZP(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:Hi(n,i)})),r=_s.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function cT(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?sT:cT,c=s=null,l}function l(h){return h==null||isNaN(h=+h)?a:(c||(c=u(e.map(n),t,r)))(n(o(h)))}return l.invert=function(h){return o(i((s||(s=u(t,e.map(n),Hi)))(h)))},l.domain=function(h){return arguments.length?(e=Array.from(h,Ki),f()):e.slice()},l.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},l.rangeRound=function(h){return t=Array.from(h),r=fh,f()},l.clamp=function(h){return arguments.length?(o=h?!0:ke,f()):o!==ke},l.interpolate=function(h){return arguments.length?(r=h,f()):r},l.unknown=function(h){return arguments.length?(a=h,l):a},function(h,d){return n=h,i=d,f()}}function hh(){return Ba()(ke,ke)}function lT(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Gi(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function jr(e){return e=Gi(Math.abs(e)),e?e[1]:NaN}function fT(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function hT(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var pT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rn(e){if(!(t=pT.exec(e)))throw new Error("invalid format: "+e);var t;return new ph({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Rn.prototype=ph.prototype;function ph(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ph.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function dT(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var tx;function vT(e,t){var r=Gi(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(tx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Gi(e,Math.max(0,t+a-1))[0]}function Xy(e,t){var r=Gi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Yy={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lT,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Xy(e*100,t),r:Xy,s:vT,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Zy(e){return e}var Jy=Array.prototype.map,Qy=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yT(e){var t=e.grouping===void 0||e.thousands===void 0?Zy:fT(Jy.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Zy:hT(Jy.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(l){l=Rn(l);var h=l.fill,d=l.align,y=l.sign,v=l.symbol,p=l.zero,g=l.width,x=l.comma,w=l.precision,O=l.trim,m=l.type;m==="n"?(x=!0,m="g"):Yy[m]||(w===void 0&&(w=12),O=!0,m="g"),(p||h==="0"&&d==="=")&&(p=!0,h="0",d="=");var b=v==="$"?r:v==="#"&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",_=v==="$"?n:/[%p]/.test(m)?o:"",A=Yy[m],T=/[defgprs%]/.test(m);w=w===void 0?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(P){var E=b,j=_,C,$,k;if(m==="c")j=A(P)+j,P="";else{P=+P;var R=P<0||1/P<0;if(P=isNaN(P)?c:A(Math.abs(P),w),O&&(P=dT(P)),R&&+P==0&&y!=="+"&&(R=!1),E=(R?y==="("?y:u:y==="-"||y==="("?"":y)+E,j=(m==="s"?Qy[8+tx/3]:"")+j+(R&&y==="("?")":""),T){for(C=-1,$=P.length;++C<$;)if(k=P.charCodeAt(C),48>k||k>57){j=(k===46?i+P.slice(C+1):P.slice(C))+j,P=P.slice(0,C);break}}}x&&!p&&(P=t(P,1/0));var L=E.length+P.length+j.length,B=L>1)+E+P+j+B.slice(L);break;default:P=B+E+P+j;break}return a(P)}return M.toString=function(){return l+""},M}function f(l,h){var d=s((l=Rn(l),l.type="f",l)),y=Math.max(-8,Math.min(8,Math.floor(jr(h)/3)))*3,v=Math.pow(10,-y),p=Qy[8+y/3];return function(g){return d(v*g)+p}}return{format:s,formatPrefix:f}}var Oi,dh,rx;mT({thousands:",",grouping:[3],currency:["$",""]});function mT(e){return Oi=yT(e),dh=Oi.format,rx=Oi.formatPrefix,Oi}function gT(e){return Math.max(0,-jr(Math.abs(e)))}function bT(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jr(t)/3)))*3-jr(Math.abs(e)))}function xT(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jr(t)-jr(e))+1}function nx(e,t,r,n){var i=ql(e,t,r),a;switch(n=Rn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=bT(i,o))&&(n.precision=a),rx(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=xT(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=gT(i))&&(n.precision=a-(n.type==="%")*2);break}}return dh(n)}function kt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Dl(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return nx(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],c,s,f=10;for(u0;){if(s=Nl(o,u,r),s===c)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function Vi(){var e=hh();return e.copy=function(){return li(e,Vi())},Qe.apply(e,arguments),kt(e)}function ix(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Ki),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return ix(e).unknown(t)},e=arguments.length?Array.from(e,Ki):[0,1],kt(r)}function ax(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function ST(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function rm(e){return(t,r)=>-e(-t,r)}function vh(e){const t=e(em,tm),r=t.domain;let n=10,i,a;function o(){return i=ST(n),a=AT(n),r()[0]<0?(i=rm(i),a=rm(a),e(wT,OT)):e(em,tm),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const c=r();let s=c[0],f=c[c.length-1];const l=f0){for(;h<=d;++h)for(y=1;yf)break;g.push(v)}}else for(;h<=d;++h)for(y=n-1;y>=1;--y)if(v=h>0?y/a(-h):y*a(h),!(vf)break;g.push(v)}g.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Rn(c)).precision==null&&(c.trim=!0),c=dh(c)),u===1/0)return c;const s=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(ax(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function ox(){const e=vh(Ba()).domain([1,10]);return e.copy=()=>li(e,ox()).base(e.base()),Qe.apply(e,arguments),e}function nm(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function im(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function yh(e){var t=1,r=e(nm(t),im(t));return r.constant=function(n){return arguments.length?e(nm(t=+n),im(t)):t},kt(r)}function ux(){var e=yh(Ba());return e.copy=function(){return li(e,ux()).constant(e.constant())},Qe.apply(e,arguments)}function am(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function PT(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function TT(e){return e<0?-e*e:e*e}function mh(e){var t=e(ke,ke),r=1;function n(){return r===1?e(ke,ke):r===.5?e(PT,TT):e(am(r),am(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},kt(t)}function gh(){var e=mh(Ba());return e.copy=function(){return li(e,gh()).exponent(e.exponent())},Qe.apply(e,arguments),e}function ET(){return gh.apply(null,arguments).exponent(.5)}function om(e){return Math.sign(e)*e*e}function jT(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cx(){var e=hh(),t=[0,1],r=!1,n;function i(a){var o=jT(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(om(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Ki)).map(om)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return cx(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Qe.apply(i,arguments),kt(i)}function sx(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return lx().domain([e,t]).range(i).unknown(a)},Qe.apply(kt(o),arguments)}function fx(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[ci(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return fx().domain(e).range(t).unknown(r)},Qe.apply(i,arguments)}const As=new Date,Ss=new Date;function Se(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return c;let s;do c.push(s=new Date(+a)),t(a,u),e(a);while(sSe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(As.setTime(+a),Ss.setTime(+o),e(As),e(Ss),Math.floor(r(As,Ss))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Xi=Se(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Se(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Xi);Xi.range;const yt=1e3,Ze=yt*60,mt=Ze*60,Ot=mt*24,bh=Ot*7,um=Ot*30,Ps=Ot*365,Xt=Se(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getUTCSeconds());Xt.range;const xh=Se(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getMinutes());xh.range;const wh=Se(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getUTCMinutes());wh.range;const Oh=Se(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt-e.getMinutes()*Ze)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getHours());Oh.range;const _h=Se(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getUTCHours());_h.range;const fi=Se(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ze)/Ot,e=>e.getDate()-1);fi.range;const Fa=Se(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>e.getUTCDate()-1);Fa.range;const hx=Se(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>Math.floor(e/Ot));hx.range;function ur(e){return Se(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ze)/bh)}const Wa=ur(0),Yi=ur(1),MT=ur(2),$T=ur(3),Mr=ur(4),CT=ur(5),IT=ur(6);Wa.range;Yi.range;MT.range;$T.range;Mr.range;CT.range;IT.range;function cr(e){return Se(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/bh)}const za=cr(0),Zi=cr(1),kT=cr(2),RT=cr(3),$r=cr(4),DT=cr(5),NT=cr(6);za.range;Zi.range;kT.range;RT.range;$r.range;DT.range;NT.range;const Ah=Se(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ah.range;const Sh=Se(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Sh.range;const _t=Se(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_t.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Se(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});_t.range;const At=Se(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());At.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Se(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});At.range;function px(e,t,r,n,i,a){const o=[[Xt,1,yt],[Xt,5,5*yt],[Xt,15,15*yt],[Xt,30,30*yt],[a,1,Ze],[a,5,5*Ze],[a,15,15*Ze],[a,30,30*Ze],[i,1,mt],[i,3,3*mt],[i,6,6*mt],[i,12,12*mt],[n,1,Ot],[n,2,2*Ot],[r,1,bh],[t,1,um],[t,3,3*um],[e,1,Ps]];function u(s,f,l){const h=fp).right(o,h);if(d===o.length)return e.every(ql(s/Ps,f/Ps,l));if(d===0)return Xi.every(Math.max(ql(s,f,l),1));const[y,v]=o[h/o[d-1][2]53)return null;"w"in D||(D.w=1),"Z"in D?(ee=Es(un(D.y,0,1)),be=ee.getUTCDay(),ee=be>4||be===0?Zi.ceil(ee):Zi(ee),ee=Fa.offset(ee,(D.V-1)*7),D.y=ee.getUTCFullYear(),D.m=ee.getUTCMonth(),D.d=ee.getUTCDate()+(D.w+6)%7):(ee=Ts(un(D.y,0,1)),be=ee.getDay(),ee=be>4||be===0?Yi.ceil(ee):Yi(ee),ee=fi.offset(ee,(D.V-1)*7),D.y=ee.getFullYear(),D.m=ee.getMonth(),D.d=ee.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),be="Z"in D?Es(un(D.y,0,1)).getUTCDay():Ts(un(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(be+5)%7:D.w+D.U*7-(be+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Es(D)):Ts(D)}}function A(F,Z,Q,D){for(var de=0,ee=Z.length,be=Q.length,xe,De;de=be)return-1;if(xe=Z.charCodeAt(de++),xe===37){if(xe=Z.charAt(de++),De=m[xe in cm?Z.charAt(de++):xe],!De||(D=De(F,Q,D))<0)return-1}else if(xe!=Q.charCodeAt(D++))return-1}return D}function T(F,Z,Q){var D=s.exec(Z.slice(Q));return D?(F.p=f.get(D[0].toLowerCase()),Q+D[0].length):-1}function M(F,Z,Q){var D=d.exec(Z.slice(Q));return D?(F.w=y.get(D[0].toLowerCase()),Q+D[0].length):-1}function P(F,Z,Q){var D=l.exec(Z.slice(Q));return D?(F.w=h.get(D[0].toLowerCase()),Q+D[0].length):-1}function E(F,Z,Q){var D=g.exec(Z.slice(Q));return D?(F.m=x.get(D[0].toLowerCase()),Q+D[0].length):-1}function j(F,Z,Q){var D=v.exec(Z.slice(Q));return D?(F.m=p.get(D[0].toLowerCase()),Q+D[0].length):-1}function C(F,Z,Q){return A(F,t,Z,Q)}function $(F,Z,Q){return A(F,r,Z,Q)}function k(F,Z,Q){return A(F,n,Z,Q)}function R(F){return o[F.getDay()]}function L(F){return a[F.getDay()]}function B(F){return c[F.getMonth()]}function U(F){return u[F.getMonth()]}function G(F){return i[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function V(F){return o[F.getUTCDay()]}function fe(F){return a[F.getUTCDay()]}function ye(F){return c[F.getUTCMonth()]}function Le(F){return u[F.getUTCMonth()]}function qt(F){return i[+(F.getUTCHours()>=12)]}function Re(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var Z=b(F+="",w);return Z.toString=function(){return F},Z},parse:function(F){var Z=_(F+="",!1);return Z.toString=function(){return F},Z},utcFormat:function(F){var Z=b(F+="",O);return Z.toString=function(){return F},Z},utcParse:function(F){var Z=_(F+="",!0);return Z.toString=function(){return F},Z}}}var cm={"-":"",_:" ",0:"0"},Ee=/^\s*\d+/,zT=/^%/,UT=/[\\^$*+?|[\]().{}]/g;function re(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function KT(e,t,r){var n=Ee.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function GT(e,t,r){var n=Ee.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function VT(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function XT(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function YT(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function sm(e,t,r){var n=Ee.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function lm(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ZT(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function JT(e,t,r){var n=Ee.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function QT(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function fm(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function eE(e,t,r){var n=Ee.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function hm(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function tE(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function rE(e,t,r){var n=Ee.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function nE(e,t,r){var n=Ee.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function iE(e,t,r){var n=Ee.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function aE(e,t,r){var n=zT.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function oE(e,t,r){var n=Ee.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function uE(e,t,r){var n=Ee.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function pm(e,t){return re(e.getDate(),t,2)}function cE(e,t){return re(e.getHours(),t,2)}function sE(e,t){return re(e.getHours()%12||12,t,2)}function lE(e,t){return re(1+fi.count(_t(e),e),t,3)}function dx(e,t){return re(e.getMilliseconds(),t,3)}function fE(e,t){return dx(e,t)+"000"}function hE(e,t){return re(e.getMonth()+1,t,2)}function pE(e,t){return re(e.getMinutes(),t,2)}function dE(e,t){return re(e.getSeconds(),t,2)}function vE(e){var t=e.getDay();return t===0?7:t}function yE(e,t){return re(Wa.count(_t(e)-1,e),t,2)}function vx(e){var t=e.getDay();return t>=4||t===0?Mr(e):Mr.ceil(e)}function mE(e,t){return e=vx(e),re(Mr.count(_t(e),e)+(_t(e).getDay()===4),t,2)}function gE(e){return e.getDay()}function bE(e,t){return re(Yi.count(_t(e)-1,e),t,2)}function xE(e,t){return re(e.getFullYear()%100,t,2)}function wE(e,t){return e=vx(e),re(e.getFullYear()%100,t,2)}function OE(e,t){return re(e.getFullYear()%1e4,t,4)}function _E(e,t){var r=e.getDay();return e=r>=4||r===0?Mr(e):Mr.ceil(e),re(e.getFullYear()%1e4,t,4)}function AE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function dm(e,t){return re(e.getUTCDate(),t,2)}function SE(e,t){return re(e.getUTCHours(),t,2)}function PE(e,t){return re(e.getUTCHours()%12||12,t,2)}function TE(e,t){return re(1+Fa.count(At(e),e),t,3)}function yx(e,t){return re(e.getUTCMilliseconds(),t,3)}function EE(e,t){return yx(e,t)+"000"}function jE(e,t){return re(e.getUTCMonth()+1,t,2)}function ME(e,t){return re(e.getUTCMinutes(),t,2)}function $E(e,t){return re(e.getUTCSeconds(),t,2)}function CE(e){var t=e.getUTCDay();return t===0?7:t}function IE(e,t){return re(za.count(At(e)-1,e),t,2)}function mx(e){var t=e.getUTCDay();return t>=4||t===0?$r(e):$r.ceil(e)}function kE(e,t){return e=mx(e),re($r.count(At(e),e)+(At(e).getUTCDay()===4),t,2)}function RE(e){return e.getUTCDay()}function DE(e,t){return re(Zi.count(At(e)-1,e),t,2)}function NE(e,t){return re(e.getUTCFullYear()%100,t,2)}function qE(e,t){return e=mx(e),re(e.getUTCFullYear()%100,t,2)}function LE(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function BE(e,t){var r=e.getUTCDay();return e=r>=4||r===0?$r(e):$r.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function FE(){return"+0000"}function vm(){return"%"}function ym(e){return+e}function mm(e){return Math.floor(+e/1e3)}var hr,gx,bx;WE({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function WE(e){return hr=WT(e),gx=hr.format,hr.parse,bx=hr.utcFormat,hr.utcParse,hr}function zE(e){return new Date(e)}function UE(e){return e instanceof Date?+e:+new Date(+e)}function Ph(e,t,r,n,i,a,o,u,c,s){var f=hh(),l=f.invert,h=f.domain,d=s(".%L"),y=s(":%S"),v=s("%I:%M"),p=s("%I %p"),g=s("%a %d"),x=s("%b %d"),w=s("%B"),O=s("%Y");function m(b){return(c(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>IP(e,a/n))},r.copy=function(){return _x(t).domain(e)},Tt.apply(r,arguments)}function Ha(){var e=0,t=.5,r=1,n=1,i,a,o,u,c,s=ke,f,l=!1,h;function d(v){return isNaN(v=+v)?h:(v=.5+((v=+f(v))-a)*(n*vr}return Ms=e,Ms}var $s,wm;function XE(){if(wm)return $s;wm=1;var e=Ka(),t=Tx(),r=Jr();function n(i){return i&&i.length?e(i,r,t):void 0}return $s=n,$s}var YE=XE();const Ga=oe(YE);var Cs,Om;function Ex(){if(Om)return Cs;Om=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};z.decimalPlaces=z.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*he;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};z.dividedBy=z.div=function(e){return xt(this,new this.constructor(e))};z.dividedToIntegerBy=z.idiv=function(e){var t=this,r=t.constructor;return ue(xt(t,new r(e),0,1),r.precision)};z.equals=z.eq=function(e){return!this.cmp(e)};z.exponent=function(){return ge(this)};z.greaterThan=z.gt=function(e){return this.cmp(e)>0};z.greaterThanOrEqualTo=z.gte=function(e){return this.cmp(e)>=0};z.isInteger=z.isint=function(){return this.e>this.d.length-2};z.isNegative=z.isneg=function(){return this.s<0};z.isPositive=z.ispos=function(){return this.s>0};z.isZero=function(){return this.s===0};z.lessThan=z.lt=function(e){return this.cmp(e)<0};z.lessThanOrEqualTo=z.lte=function(e){return this.cmp(e)<1};z.logarithm=z.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ue))throw Error(Je+"NaN");if(r.s<1)throw Error(Je+(r.s?"NaN":"-Infinity"));return r.eq(Ue)?new n(0):(pe=!1,t=xt(Dn(r,a),Dn(e,a),a),pe=!0,ue(t,i))};z.minus=z.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Cx(t,e):Mx(t,(e.s=-e.s,e))};z.modulo=z.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Je+"NaN");return r.s?(pe=!1,t=xt(r,e,0,1).times(e),pe=!0,r.minus(t)):ue(new n(r),i)};z.naturalExponential=z.exp=function(){return $x(this)};z.naturalLogarithm=z.ln=function(){return Dn(this)};z.negated=z.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};z.plus=z.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Mx(t,e):Cx(t,(e.s=-e.s,e))};z.precision=z.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Jt+e);if(t=ge(i)+1,n=i.d.length-1,r=n*he+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};z.squareRoot=z.sqrt=function(){var e,t,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(Je+"NaN")}for(e=ge(u),pe=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=ot(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=tn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(xt(u,a,o+2)).times(.5),ot(a.d).slice(0,o)===(t=ot(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ue(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return pe=!0,ue(n,r)};z.times=z.mul=function(e){var t,r,n,i,a,o,u,c,s,f=this,l=f.constructor,h=f.d,d=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,s=d.length,c=0;){for(t=0,i=c+n;i>n;)u=a[i]+d[n]*h[i-n-1]+t,a[i--]=u%Pe|0,t=u/Pe|0;a[i]=(a[i]+t)%Pe|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,pe?ue(e,l.precision):e};z.toDecimalPlaces=z.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(st(e,0,en),t===void 0?t=n.rounding:st(t,0,8),ue(r,e+ge(r)+1,t))};z.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=nr(n,!0):(st(e,0,en),t===void 0?t=i.rounding:st(t,0,8),n=ue(new i(n),e+1,t),r=nr(n,!0,e+1)),r};z.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?nr(i):(st(e,0,en),t===void 0?t=a.rounding:st(t,0,8),n=ue(new a(i),e+ge(i)+1,t),r=nr(n.abs(),!1,e+ge(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};z.toInteger=z.toint=function(){var e=this,t=e.constructor;return ue(new t(e),ge(e)+1,t.rounding)};z.toNumber=function(){return+this};z.toPower=z.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,s=12,f=+(e=new c(e));if(!e.s)return new c(Ue);if(u=new c(u),!u.s){if(e.s<1)throw Error(Je+"Infinity");return u}if(u.eq(Ue))return u;if(n=c.precision,e.eq(Ue))return ue(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=jx){for(i=new c(Ue),t=Math.ceil(n/he+4),pe=!1;r%2&&(i=i.times(u),Em(i.d,t)),r=tn(r/2),r!==0;)u=u.times(u),Em(u.d,t);return pe=!0,e.s<0?new c(Ue).div(i):ue(i,n)}}else if(a<0)throw Error(Je+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,pe=!1,i=e.times(Dn(u,n+s)),pe=!0,i=$x(i),i.s=a,i};z.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=ge(i),n=nr(i,r<=a.toExpNeg||r>=a.toExpPos)):(st(e,1,en),t===void 0?t=a.rounding:st(t,0,8),i=ue(new a(i),e,t),r=ge(i),n=nr(i,e<=r||r<=a.toExpNeg,e)),n};z.toSignificantDigits=z.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(st(e,1,en),t===void 0?t=n.rounding:st(t,0,8)),ue(new n(r),e,t)};z.toString=z.valueOf=z.val=z.toJSON=z[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ge(e),r=e.constructor;return nr(e,t<=r.toExpNeg||t>=r.toExpPos)};function Mx(e,t){var r,n,i,a,o,u,c,s,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),pe?ue(t,l):t;if(c=e.d,s=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=s.length):(n=s,i=o,u=c.length),o=Math.ceil(l/he),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=s.length,u-a<0&&(a=u,n=s,s=c,c=n),r=0;a;)r=(c[--a]=c[a]+s[a]+r)/Pe|0,c[a]%=Pe;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return t.d=c,t.e=i,pe?ue(t,l):t}function st(e,t,r){if(e!==~~e||er)throw Error(Jt+e)}function ot(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=c=0;ui[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,c,s,f,l,h,d,y,v,p,g,x,w,O,m,b,_,A,T=n.constructor,M=n.s==i.s?1:-1,P=n.d,E=i.d;if(!n.s)return new T(n);if(!i.s)throw Error(Je+"Division by zero");for(c=n.e-i.e,_=E.length,m=P.length,d=new T(M),y=d.d=[],s=0;E[s]==(P[s]||0);)++s;if(E[s]>(P[s]||0)&&--c,a==null?x=a=T.precision:o?x=a+(ge(n)-ge(i))+1:x=a,x<0)return new T(0);if(x=x/he+2|0,s=0,_==1)for(f=0,E=E[0],x++;(s1&&(E=e(E,f),P=e(P,f),_=E.length,m=P.length),O=_,v=P.slice(0,_),p=v.length;p<_;)v[p++]=0;A=E.slice(),A.unshift(0),b=E[0],E[1]>=Pe/2&&++b;do f=0,u=t(E,v,_,p),u<0?(g=v[0],_!=p&&(g=g*Pe+(v[1]||0)),f=g/b|0,f>1?(f>=Pe&&(f=Pe-1),l=e(E,f),h=l.length,p=v.length,u=t(l,v,h,p),u==1&&(f--,r(l,_16)throw Error(jh+ge(e));if(!e.s)return new f(Ue);for(pe=!1,u=l,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(Ht(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new f(Ue),f.precision=u;;){if(i=ue(i.times(e),u),r=r.times(++c),o=a.plus(xt(i,r,u)),ot(o.d).slice(0,u)===ot(a.d).slice(0,u)){for(;s--;)a=ue(a.times(a),u);return f.precision=l,t==null?(pe=!0,ue(a,l)):a}a=o}}function ge(e){for(var t=e.e*he,r=e.d[0];r>=10;r/=10)t++;return t}function Ns(e,t,r){if(t>e.LN10.sd())throw pe=!0,r&&(e.precision=r),Error(Je+"LN10 precision limit exceeded");return ue(new e(e.LN10),t)}function jt(e){for(var t="";e--;)t+="0";return t}function Dn(e,t){var r,n,i,a,o,u,c,s,f,l=1,h=10,d=e,y=d.d,v=d.constructor,p=v.precision;if(d.s<1)throw Error(Je+(d.s?"NaN":"-Infinity"));if(d.eq(Ue))return new v(0);if(t==null?(pe=!1,s=p):s=t,d.eq(10))return t==null&&(pe=!0),Ns(v,s);if(s+=h,v.precision=s,r=ot(y),n=r.charAt(0),a=ge(d),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=ot(d.d),n=r.charAt(0),l++;a=ge(d),n>1?(d=new v("0."+r),a++):d=new v(n+"."+r.slice(1))}else return c=Ns(v,s+2,p).times(a+""),d=Dn(new v(n+"."+r.slice(1)),s-h).plus(c),v.precision=p,t==null?(pe=!0,ue(d,p)):d;for(u=o=d=xt(d.minus(Ue),d.plus(Ue),s),f=ue(d.times(d),s),i=3;;){if(o=ue(o.times(f),s),c=u.plus(xt(o,new v(i),s)),ot(c.d).slice(0,s)===ot(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Ns(v,s+2,p).times(a+""))),u=xt(u,new v(l),s),v.precision=p,t==null?(pe=!0,ue(u,p)):u;u=c,i+=2}}function Tm(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=tn(r/he),e.d=[],n=(r+1)%he,r<0&&(n+=he),nJi||e.e<-Ji))throw Error(jh+r)}else e.s=0,e.e=0,e.d=[0];return e}function ue(e,t,r){var n,i,a,o,u,c,s,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=he,i=t,s=l[f=0];else{if(f=Math.ceil((n+1)/he),a=l.length,f>=a)return e;for(s=a=l[f],o=1;a>=10;a/=10)o++;n%=he,i=n-he+o}if(r!==void 0&&(a=Ht(10,o-i-1),u=s/a%10|0,c=t<0||l[f+1]!==void 0||s%a,c=r<4?(u||c)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?s/Ht(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return c?(a=ge(e),l.length=1,t=t-a-1,l[0]=Ht(10,(he-t%he)%he),e.e=tn(-t/he)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Ht(10,he-n),l[f]=i>0?(s/Ht(10,o-i)%Ht(10,i)|0)*a:0),c)for(;;)if(f==0){(l[0]+=a)==Pe&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=Pe)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(pe&&(e.e>Ji||e.e<-Ji))throw Error(jh+ge(e));return e}function Cx(e,t){var r,n,i,a,o,u,c,s,f,l,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),pe?ue(t,d):t;if(c=e.d,l=t.d,n=t.e,s=e.e,c=c.slice(),o=s-n,o){for(f=o<0,f?(r=c,o=-o,u=l.length):(r=l,n=s,u=c.length),i=Math.max(Math.ceil(d/he),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=l.length,f=i0;--i)c[u++]=0;for(i=l.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+jt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+jt(-i-1)+a,r&&(n=r-o)>0&&(a+=jt(n))):i>=o?(a+=jt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+jt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=jt(n))),e.s<0?"-"+a:a}function Em(e,t){if(e.length>t)return e.length=t,!0}function Ix(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Jt+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Tm(o,a.toString())}else if(typeof a!="string")throw Error(Jt+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,oj.test(a))Tm(o,a);else throw Error(Jt+a)}if(i.prototype=z,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Ix,i.config=i.set=uj,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Jt+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Jt+r+": "+n);return this}var Mh=Ix(aj);Ue=new Mh(1);const ae=Mh;function cj(e){return hj(e)||fj(e)||lj(e)||sj()}function sj(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lj(e,t){if(e){if(typeof e=="string")return zl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zl(e,t)}}function fj(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function hj(e){if(Array.isArray(e))return zl(e)}function zl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,jm(function(){for(var u=arguments.length,c=new Array(u),s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function Tj(e){if(Array.isArray(e))return e}function qx(e){var t=Nn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function Lx(e,t,r){if(e.lte(0))return new ae(0);var n=Ya.getDigitCount(e.toNumber()),i=new ae(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new ae(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=u.mul(i);return t?c:new ae(Math.ceil(c))}function Ej(e,t,r){var n=1,i=new ae(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new ae(10).pow(Ya.getDigitCount(e)-1),i=new ae(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new ae(Math.floor(e)))}else e===0?i=new ae(Math.floor((t-1)/2)):r||(i=new ae(Math.floor(e)));var o=Math.floor((t-1)/2),u=yj(vj(function(c){return i.add(new ae(c-o).mul(n)).toNumber()}),Ul);return u(0,t)}function Bx(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ae(0),tickMin:new ae(0),tickMax:new ae(0)};var a=Lx(new ae(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new ae(0):(o=new ae(e).add(t).div(2),o=o.sub(new ae(o).mod(a)));var u=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new ae(t).sub(o).div(a).toNumber()),s=u+c+1;return s>r?Bx(e,t,r,n,i+1):(s0?c+(r-s):c,u=t>0?u:u+(r-s)),{step:a,tickMin:o.sub(new ae(u).mul(a)),tickMax:o.add(new ae(c).mul(a))})}function jj(e){var t=Nn(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=qx([r,n]),c=Nn(u,2),s=c[0],f=c[1];if(s===-1/0||f===1/0){var l=f===1/0?[s].concat(Kl(Ul(0,i-1).map(function(){return 1/0}))):[].concat(Kl(Ul(0,i-1).map(function(){return-1/0})),[f]);return r>n?Hl(l):l}if(s===f)return Ej(s,i,a);var h=Bx(s,f,o,a),d=h.step,y=h.tickMin,v=h.tickMax,p=Ya.rangeStep(y,v.add(new ae(.1).mul(d)),d);return r>n?Hl(p):p}function Mj(e,t){var r=Nn(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=qx([n,i]),u=Nn(o,2),c=u[0],s=u[1];if(c===-1/0||s===1/0)return[n,i];if(c===s)return[c];var f=Math.max(t,2),l=Lx(new ae(s).sub(c).div(f-1),a,0),h=[].concat(Kl(Ya.rangeStep(new ae(c),new ae(s).sub(new ae(.99).mul(l)),l)),[s]);return n>i?Hl(h):h}var $j=Dx(jj),Cj=Dx(Mj),Ij=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Cr(e){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bj(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Fj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wj(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,s=0;s0?i[s-1].coordinate:i[u-1].coordinate,l=i[s].coordinate,h=s>=u-1?i[0].coordinate:i[s+1].coordinate,d=void 0;if(Ce(l-f)!==Ce(h-l)){var y=[];if(Ce(h-l)===Ce(c[1]-c[0])){d=h;var v=l+c[1]-c[0];y[0]=Math.min(v,(v+f)/2),y[1]=Math.max(v,(v+f)/2)}else{d=f;var p=h+c[1]-c[0];y[0]=Math.min(l,(p+l)/2),y[1]=Math.max(l,(p+l)/2)}var g=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(t>g[0]&&t<=g[1]||t>=y[0]&&t<=y[1]){o=i[s].index;break}}else{var x=Math.min(f,h),w=Math.max(f,h);if(t>(x+l)/2&&t<=(w+l)/2){o=i[s].index;break}}}else for(var O=0;O0&&O(n[O].coordinate+n[O-1].coordinate)/2&&t<=(n[O].coordinate+n[O+1].coordinate)/2||O===u-1&&t>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},$h=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?ve(ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,u=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:u;break;default:c=u;break}return c},aM=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),c=0,s=u.length;c=0});if(g&&g.length){var x=g[0].type.defaultProps,w=x!==void 0?ve(ve({},x),g[0].props):g[0].props,O=w.barSize,m=w[p];o[m]||(o[m]=[]);var b=Y(O)?r:O;o[m].push({item:g[0],stackList:g.slice(1),barSize:Y(b)?void 0:Ie(b,n,0)})}}return o},oM=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,u=t.maxBarSize,c=o.length;if(c<1)return null;var s=Ie(r,i,0,!0),f,l=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/c,y=o.reduce(function(O,m){return O+m.barSize||0},0);y+=(c-1)*s,y>=i&&(y-=(c-1)*s,s=0),y>=i&&d>0&&(h=!0,d*=.9,y=c*d);var v=(i-y)/2>>0,p={offset:v-s,size:0};f=o.reduce(function(O,m){var b={item:m.item,position:{offset:p.offset+p.size+s,size:h?d:m.barSize}},_=[].concat(Cm(O),[b]);return p=_[_.length-1].position,m.stackList&&m.stackList.length&&m.stackList.forEach(function(A){_.push({item:A,position:p})}),_},l)}else{var g=Ie(n,i,0,!0);i-2*g-(c-1)*s<=0&&(s=0);var x=(i-2*g-(c-1)*s)/c;x>1&&(x>>=0);var w=u===+u?Math.min(x,u):x;f=o.reduce(function(O,m,b){var _=[].concat(Cm(O),[{item:m.item,position:{offset:g+(x+s)*b+(x-w)/2,size:w}}]);return m.stackList&&m.stackList.length&&m.stackList.forEach(function(A){_.push({item:A,position:_[_.length-1].position})}),_},l)}return f},uM=function(t,r,n,i){var a=n.children,o=n.width,u=n.margin,c=o-(u.left||0)-(u.right||0),s=Ux({children:a,legendWidth:c});if(s){var f=i||{},l=f.width,h=f.height,d=s.align,y=s.verticalAlign,v=s.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&d!=="center"&&q(t[d]))return ve(ve({},t),{},_r({},d,t[d]+(l||0)));if((v==="horizontal"||v==="vertical"&&d==="center")&&y!=="middle"&&q(t[y]))return ve(ve({},t),{},_r({},y,t[y]+(h||0)))}return t},cM=function(t,r,n){return Y(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Hx=function(t,r,n,i,a){var o=r.props.children,u=Ke(o,pi).filter(function(s){return cM(i,a,s.props.direction)});if(u&&u.length){var c=u.map(function(s){return s.props.dataKey});return t.reduce(function(s,f){var l=_e(f,n);if(Y(l))return s;var h=Array.isArray(l)?[Va(l),Ga(l)]:[l,l],d=c.reduce(function(y,v){var p=_e(f,v,0),g=h[0]-Math.abs(Array.isArray(p)?p[0]:p),x=h[1]+Math.abs(Array.isArray(p)?p[1]:p);return[Math.min(g,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(d[0],s[0]),Math.max(d[1],s[1])]},[1/0,-1/0])}return null},sM=function(t,r,n,i,a){var o=r.map(function(u){return Hx(t,u,n,a,i)}).filter(function(u){return!Y(u)});return o&&o.length?o.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]):null},Kx=function(t,r,n,i,a){var o=r.map(function(c){var s=c.props.dataKey;return n==="number"&&s&&Hx(t,c,s,i)||bn(t,s,n,a)});if(n==="number")return o.reduce(function(c,s){return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]);var u={};return o.reduce(function(c,s){for(var f=0,l=s.length;f=2?Ce(u[0]-u[1])*2*s:s,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(l){var h=a?a.indexOf(l):l;return{coordinate:i(h)+s,value:l,offset:s}});return f.filter(function(l){return!oi(l.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(l,h){return{coordinate:i(l)+s,value:l,index:h,offset:s}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(l){return{coordinate:i(l)+s,value:l,offset:s}}):i.domain().map(function(l,h){return{coordinate:i(l)+s,value:a?a[l]:l,index:h,offset:s}})},qs=new WeakMap,_i=function(t,r){if(typeof r!="function")return t;qs.has(t)||qs.set(t,new WeakMap);var n=qs.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},Xx=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,u=t.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:$n(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:Vi(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:gn(),realScaleType:"point"}:a==="category"?{scale:$n(),realScaleType:"band"}:{scale:Vi(),realScaleType:"linear"};if(er(i)){var c="scale".concat(Ia(i));return{scale:(gm[c]||gn)(),realScaleType:gm[c]?c:"point"}}return X(i)?{scale:i}:{scale:gn(),realScaleType:"point"}},km=1e-4,Yx=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-km,o=Math.max(i[0],i[1])+km,u=t(r[0]),c=t(r[n-1]);(uo||co)&&t.domain([r[0],r[n-1]])}},lM=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+c,a=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+c,o=t[u][n][1])}},pM=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+u,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},dM={sign:hM,expand:r1,none:Ar,silhouette:n1,wiggle:i1,positive:pM},vM=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=dM[n],o=t1().keys(i).value(function(u,c){return+_e(u,c,0)}).order(Sl).offset(a);return o(t)},yM=function(t,r,n,i,a,o){if(!t)return null;var u=o?r.reverse():r,c={},s=u.reduce(function(l,h){var d,y=(d=h.type)!==null&&d!==void 0&&d.defaultProps?ve(ve({},h.type.defaultProps),h.props):h.props,v=y.stackId,p=y.hide;if(p)return l;var g=y[n],x=l[g]||{hasStack:!1,stackGroups:{}};if(Ae(v)){var w=x.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[v]=w}else x.stackGroups[Zr("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return ve(ve({},l),{},_r({},g,x))},c),f={};return Object.keys(s).reduce(function(l,h){var d=s[h];if(d.hasStack){var y={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(v,p){var g=d.stackGroups[p];return ve(ve({},v),{},_r({},p,{numericAxisId:n,cateAxisId:i,items:g.items,stackedData:vM(t,g.items,a)}))},y)}return ve(ve({},l),{},_r({},h,d))},f)},Zx=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var s=t.domain();if(!s.length)return null;var f=$j(s,a,u);return t.domain([Va(f),Ga(f)]),{niceTicks:f}}if(a&&i==="number"){var l=t.domain(),h=Cj(l,a,u);return{niceTicks:h}}return null};function Rm(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Y(i[t.dataKey])){var u=Mi(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=_e(i,Y(o)?t.dataKey:o);return Y(c)?null:t.scale(c)}var Dm=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var c=_e(o,r.dataKey,r.domain[u]);return Y(c)?null:r.scale(c)-a/2+i},mM=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},gM=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ve(ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ae(a)){var o=r[a];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},bM=function(t){return t.reduce(function(r,n){return[Va(n.concat([r[0]]).filter(q)),Ga(n.concat([r[1]]).filter(q))]},[1/0,-1/0])},Jx=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],u=o.stackedData,c=u.reduce(function(s,f){var l=bM(f.slice(r,n+1));return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Nm=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qm=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Yl=function(t,r,n){if(X(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(q(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(Nm.test(t[0])){var a=+Nm.exec(t[0])[1];i[0]=r[0]-a}else X(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(q(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(qm.test(t[1])){var o=+qm.exec(t[1])[1];i[1]=r[1]+o}else X(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},ta=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=ih(r,function(l){return l.coordinate}),o=1/0,u=1,c=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},EM=function(t,r,n,i,a){var o=t.width,u=t.height,c=t.startAngle,s=t.endAngle,f=Ie(t.cx,o,o/2),l=Ie(t.cy,u,u/2),h=tw(o,u,n),d=Ie(t.innerRadius,h,0),y=Ie(t.outerRadius,h,h*.8),v=Object.keys(r);return v.reduce(function(p,g){var x=r[g],w=x.domain,O=x.reversed,m;if(Y(x.range))i==="angleAxis"?m=[c,s]:i==="radiusAxis"&&(m=[d,y]),O&&(m=[m[1],m[0]]);else{m=x.range;var b=m,_=OM(b,2);c=_[0],s=_[1]}var A=Xx(x,a),T=A.realScaleType,M=A.scale;M.domain(w).range(m),Yx(M);var P=Zx(M,vt(vt({},x),{},{realScaleType:T})),E=vt(vt(vt({},x),P),{},{range:m,radius:y,realScaleType:T,scale:M,cx:f,cy:l,innerRadius:d,outerRadius:y,startAngle:c,endAngle:s});return vt(vt({},p),{},ew({},g,E))},{})},jM=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},MM=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,u=jM({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var c=(n-a)/u,s=Math.acos(c);return i>o&&(s=2*Math.PI-s),{radius:u,angle:TM(s),angleInRadian:s}},$M=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},CM=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return t+u*360},Wm=function(t,r){var n=t.x,i=t.y,a=MM({x:n,y:i},r),o=a.radius,u=a.angle,c=r.innerRadius,s=r.outerRadius;if(os)return!1;if(o===0)return!0;var f=$M(r),l=f.startAngle,h=f.endAngle,d=u,y;if(l<=h){for(;d>h;)d-=360;for(;d=l&&d<=h}else{for(;d>l;)d-=360;for(;d=h&&d<=l}return y?vt(vt({},r),{},{radius:o,angle:CM(d,r)}):null},rw=function(t){return!N.isValidElement(t)&&!X(t)&&typeof t!="boolean"?t.className:""};function Fn(e){"@babel/helpers - typeof";return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(e)}var IM=["offset"];function kM(e){return qM(e)||NM(e)||DM(e)||RM()}function RM(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DM(e,t){if(e){if(typeof e=="string")return Zl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zl(e,t)}}function NM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qM(e){if(Array.isArray(e))return Zl(e)}function Zl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t=0?1:-1,w,O;i==="insideStart"?(w=d+x*o,O=v):i==="insideEnd"?(w=y-x*o,O=!v):i==="end"&&(w=y+x*o,O=v),O=g<=0?O:!O;var m=le(s,f,p,w),b=le(s,f,p,w+(O?1:-1)*359),_="M".concat(m.x,",").concat(m.y,` + A`).concat(p,",").concat(p,",0,1,").concat(O?0:1,`, + `).concat(b.x,",").concat(b.y),A=Y(t.id)?Zr("recharts-radial-line-"):t.id;return S.createElement("text",Wn({},n,{dominantBaseline:"central",className:J("recharts-radial-bar-label",u)}),S.createElement("defs",null,S.createElement("path",{id:A,d:_})),S.createElement("textPath",{xlinkHref:"#".concat(A)},r))},GM=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,u=a.cy,c=a.innerRadius,s=a.outerRadius,f=a.startAngle,l=a.endAngle,h=(f+l)/2;if(i==="outside"){var d=le(o,u,s+n,h),y=d.x,v=d.y;return{x:y,y:v,textAnchor:y>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var p=(c+s)/2,g=le(o,u,p,h),x=g.x,w=g.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},VM=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,u=o.x,c=o.y,s=o.width,f=o.height,l=f>=0?1:-1,h=l*i,d=l>0?"end":"start",y=l>0?"start":"end",v=s>=0?1:-1,p=v*i,g=v>0?"end":"start",x=v>0?"start":"end";if(a==="top"){var w={x:u+s/2,y:c-l*i,textAnchor:"middle",verticalAnchor:d};return Oe(Oe({},w),n?{height:Math.max(c-n.y,0),width:s}:{})}if(a==="bottom"){var O={x:u+s/2,y:c+f+h,textAnchor:"middle",verticalAnchor:y};return Oe(Oe({},O),n?{height:Math.max(n.y+n.height-(c+f),0),width:s}:{})}if(a==="left"){var m={x:u-p,y:c+f/2,textAnchor:g,verticalAnchor:"middle"};return Oe(Oe({},m),n?{width:Math.max(m.x-n.x,0),height:f}:{})}if(a==="right"){var b={x:u+s+p,y:c+f/2,textAnchor:x,verticalAnchor:"middle"};return Oe(Oe({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:f}:{})}var _=n?{width:s,height:f}:{};return a==="insideLeft"?Oe({x:u+p,y:c+f/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?Oe({x:u+s-p,y:c+f/2,textAnchor:g,verticalAnchor:"middle"},_):a==="insideTop"?Oe({x:u+s/2,y:c+h,textAnchor:"middle",verticalAnchor:y},_):a==="insideBottom"?Oe({x:u+s/2,y:c+f-h,textAnchor:"middle",verticalAnchor:d},_):a==="insideTopLeft"?Oe({x:u+p,y:c+h,textAnchor:x,verticalAnchor:y},_):a==="insideTopRight"?Oe({x:u+s-p,y:c+h,textAnchor:g,verticalAnchor:y},_):a==="insideBottomLeft"?Oe({x:u+p,y:c+f-h,textAnchor:x,verticalAnchor:d},_):a==="insideBottomRight"?Oe({x:u+s-p,y:c+f-h,textAnchor:g,verticalAnchor:d},_):Yr(a)&&(q(a.x)||Gt(a.x))&&(q(a.y)||Gt(a.y))?Oe({x:u+Ie(a.x,s),y:c+Ie(a.y,f),textAnchor:"end",verticalAnchor:"end"},_):Oe({x:u+s/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},XM=function(t){return"cx"in t&&q(t.cx)};function Te(e){var t=e.offset,r=t===void 0?5:t,n=LM(e,IM),i=Oe({offset:r},n),a=i.viewBox,o=i.position,u=i.value,c=i.children,s=i.content,f=i.className,l=f===void 0?"":f,h=i.textBreakAll;if(!a||Y(u)&&Y(c)&&!N.isValidElement(s)&&!X(s))return null;if(N.isValidElement(s))return N.cloneElement(s,i);var d;if(X(s)){if(d=N.createElement(s,i),N.isValidElement(d))return d}else d=UM(i);var y=XM(a),v=H(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return KM(i,d,v);var p=y?GM(i):VM(i);return S.createElement(rr,Wn({className:J("recharts-label",l)},v,p,{breakAll:h}),d)}Te.displayName="Label";var nw=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,u=t.r,c=t.radius,s=t.innerRadius,f=t.outerRadius,l=t.x,h=t.y,d=t.top,y=t.left,v=t.width,p=t.height,g=t.clockWise,x=t.labelViewBox;if(x)return x;if(q(v)&&q(p)){if(q(l)&&q(h))return{x:l,y:h,width:v,height:p};if(q(d)&&q(y))return{x:d,y,width:v,height:p}}return q(l)&&q(h)?{x:l,y:h,width:0,height:0}:q(r)&&q(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:s||0,outerRadius:f||c||u||0,clockWise:g}:t.viewBox?t.viewBox:{}},YM=function(t,r){return t?t===!0?S.createElement(Te,{key:"label-implicit",viewBox:r}):Ae(t)?S.createElement(Te,{key:"label-implicit",viewBox:r,value:t}):N.isValidElement(t)?t.type===Te?N.cloneElement(t,{key:"label-implicit",viewBox:r}):S.createElement(Te,{key:"label-implicit",content:t,viewBox:r}):X(t)?S.createElement(Te,{key:"label-implicit",content:t,viewBox:r}):Yr(t)?S.createElement(Te,Wn({viewBox:r},t,{key:"label-implicit"})):null:null},ZM=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=nw(t),o=Ke(i,Te).map(function(c,s){return N.cloneElement(c,{viewBox:r||a,key:"label-".concat(s)})});if(!n)return o;var u=YM(t.label,r||a);return[u].concat(kM(o))};Te.parseViewBox=nw;Te.renderCallByParent=ZM;var Ls,Um;function JM(){if(Um)return Ls;Um=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ls=e,Ls}var QM=JM();const e$=oe(QM);function zn(e){"@babel/helpers - typeof";return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zn(e)}var t$=["valueAccessor"],r$=["data","dataKey","clockWise","id","textBreakAll"];function n$(e){return u$(e)||o$(e)||a$(e)||i$()}function i$(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a$(e,t){if(e){if(typeof e=="string")return Jl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jl(e,t)}}function o$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function u$(e){if(Array.isArray(e))return Jl(e)}function Jl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f$(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var h$=function(t){return Array.isArray(t.value)?e$(t.value):t.value};function wt(e){var t=e.valueAccessor,r=t===void 0?h$:t,n=Gm(e,t$),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,c=n.textBreakAll,s=Gm(n,r$);return!i||!i.length?null:S.createElement(te,{className:"recharts-label-list"},i.map(function(f,l){var h=Y(a)?r(f,l):_e(f&&f.payload,a),d=Y(u)?{}:{id:"".concat(u,"-").concat(l)};return S.createElement(Te,na({},H(f,!0),s,d,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:Te.parseViewBox(Y(o)?f:Km(Km({},f),{},{clockWise:o})),key:"label-".concat(l),index:l}))}))}wt.displayName="LabelList";function p$(e,t){return e?e===!0?S.createElement(wt,{key:"labelList-implicit",data:t}):S.isValidElement(e)||X(e)?S.createElement(wt,{key:"labelList-implicit",data:t,content:e}):Yr(e)?S.createElement(wt,na({data:t},e,{key:"labelList-implicit"})):null:null}function d$(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ke(n,wt).map(function(o,u){return N.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=p$(e.label,t);return[a].concat(n$(i))}wt.renderCallByParent=d$;function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>s),`, + `).concat(l.x,",").concat(l.y,` + `);if(i>0){var d=le(r,n,i,o),y=le(r,n,i,s);h+="L ".concat(y.x,",").concat(y.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(c)>180),",").concat(+(o<=s),`, + `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},b$=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,c=t.cornerIsExternal,s=t.startAngle,f=t.endAngle,l=Ce(f-s),h=Ai({cx:r,cy:n,radius:a,angle:s,sign:l,cornerRadius:o,cornerIsExternal:c}),d=h.circleTangency,y=h.lineTangency,v=h.theta,p=Ai({cx:r,cy:n,radius:a,angle:f,sign:-l,cornerRadius:o,cornerIsExternal:c}),g=p.circleTangency,x=p.lineTangency,w=p.theta,O=c?Math.abs(s-f):Math.abs(s-f)-v-w;if(O<0)return u?"M ".concat(y.x,",").concat(y.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):iw({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:s,endAngle:f});var m="M ".concat(y.x,",").concat(y.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(d.x,",").concat(d.y,` + A`).concat(a,",").concat(a,",0,").concat(+(O>180),",").concat(+(l<0),",").concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(x.x,",").concat(x.y,` + `);if(i>0){var b=Ai({cx:r,cy:n,radius:i,angle:s,sign:l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=b.circleTangency,A=b.lineTangency,T=b.theta,M=Ai({cx:r,cy:n,radius:i,angle:f,sign:-l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=M.circleTangency,E=M.lineTangency,j=M.theta,C=c?Math.abs(s-f):Math.abs(s-f)-T-j;if(C<0&&o===0)return"".concat(m,"L").concat(r,",").concat(n,"Z");m+="L".concat(E.x,",").concat(E.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(P.x,",").concat(P.y,` + A`).concat(i,",").concat(i,",0,").concat(+(C>180),",").concat(+(l>0),",").concat(_.x,",").concat(_.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(A.x,",").concat(A.y,"Z")}else m+="L".concat(r,",").concat(n,"Z");return m},x$={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},aw=function(t){var r=Xm(Xm({},x$),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,c=r.forceCornerRadius,s=r.cornerIsExternal,f=r.startAngle,l=r.endAngle,h=r.className;if(o0&&Math.abs(f-l)<360?p=b$({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,y/2),forceCornerRadius:c,cornerIsExternal:s,startAngle:f,endAngle:l}):p=iw({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:l}),S.createElement("path",Ql({},H(r,!0),{className:d,d:p,role:"img"}))};function Hn(e){"@babel/helpers - typeof";return Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(e)}function ef(){return ef=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function L$(e,t){return sr(e.getTime(),t.getTime())}function B$(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function F$(e,t){return e===t}function og(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,u,c=0;(o=a.next())&&!o.done;){for(var s=t.entries(),f=!1,l=0;(u=s.next())&&!u.done;){if(i[l]){l++;continue}var h=o.value,d=u.value;if(r.equals(h[0],d[0],c,l,e,t,r)&&r.equals(h[1],d[1],h[0],d[0],e,t,r)){f=i[l]=!0;break}l++}if(!f)return!1;c++}return!0}var W$=sr;function z$(e,t,r){var n=ag(e),i=n.length;if(ag(t).length!==i)return!1;for(;i-- >0;)if(!ow(e,t,r,n[i]))return!1;return!0}function hn(e,t,r){var n=ng(e),i=n.length;if(ng(t).length!==i)return!1;for(var a,o,u;i-- >0;)if(a=n[i],!ow(e,t,r,a)||(o=ig(e,a),u=ig(t,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function U$(e,t){return sr(e.valueOf(),t.valueOf())}function H$(e,t){return e.source===t.source&&e.flags===t.flags}function ug(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,u;(o=a.next())&&!o.done;){for(var c=t.values(),s=!1,f=0;(u=c.next())&&!u.done;){if(!i[f]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){s=i[f]=!0;break}f++}if(!s)return!1}return!0}function K$(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function G$(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ow(e,t,r,n){return(n===N$||n===D$||n===R$)&&(e.$$typeof||t.$$typeof)?!0:k$(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var V$="[object Arguments]",X$="[object Boolean]",Y$="[object Date]",Z$="[object Error]",J$="[object Map]",Q$="[object Number]",eC="[object Object]",tC="[object RegExp]",rC="[object Set]",nC="[object String]",iC="[object URL]",aC=Array.isArray,cg=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,sg=Object.assign,oC=Object.prototype.toString.call.bind(Object.prototype.toString);function uC(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,u=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,s=e.areRegExpsEqual,f=e.areSetsEqual,l=e.areTypedArraysEqual,h=e.areUrlsEqual,d=e.unknownTagComparators;return function(v,p,g){if(v===p)return!0;if(v==null||p==null)return!1;var x=typeof v;if(x!==typeof p)return!1;if(x!=="object")return x==="number"?o(v,p,g):x==="function"?i(v,p,g):!1;var w=v.constructor;if(w!==p.constructor)return!1;if(w===Object)return u(v,p,g);if(aC(v))return t(v,p,g);if(cg!=null&&cg(v))return l(v,p,g);if(w===Date)return r(v,p,g);if(w===RegExp)return s(v,p,g);if(w===Map)return a(v,p,g);if(w===Set)return f(v,p,g);var O=oC(v);if(O===Y$)return r(v,p,g);if(O===tC)return s(v,p,g);if(O===J$)return a(v,p,g);if(O===rC)return f(v,p,g);if(O===eC)return typeof v.then!="function"&&typeof p.then!="function"&&u(v,p,g);if(O===iC)return h(v,p,g);if(O===Z$)return n(v,p,g);if(O===V$)return u(v,p,g);if(O===X$||O===Q$||O===nC)return c(v,p,g);if(d){var m=d[O];if(!m){var b=I$(v);b&&(m=d[b])}if(m)return m(v,p,g)}return!1}}function cC(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?hn:q$,areDatesEqual:L$,areErrorsEqual:B$,areFunctionsEqual:F$,areMapsEqual:n?rg(og,hn):og,areNumbersEqual:W$,areObjectsEqual:n?hn:z$,arePrimitiveWrappersEqual:U$,areRegExpsEqual:H$,areSetsEqual:n?rg(ug,hn):ug,areTypedArraysEqual:n?hn:K$,areUrlsEqual:G$,unknownTagComparators:void 0};if(r&&(i=sg({},i,r(i))),t){var a=Pi(i.areArraysEqual),o=Pi(i.areMapsEqual),u=Pi(i.areObjectsEqual),c=Pi(i.areSetsEqual);i=sg({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:u,areSetsEqual:c})}return i}function sC(e){return function(t,r,n,i,a,o,u){return e(t,r,u)}}function lC(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,s){var f=n(),l=f.cache,h=l===void 0?t?new WeakMap:void 0:l,d=f.meta;return r(c,s,{cache:h,equals:i,meta:d,strict:a})};if(t)return function(c,s){return r(c,s,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,s){return r(c,s,o)}}var fC=Dt();Dt({strict:!0});Dt({circular:!0});Dt({circular:!0,strict:!0});Dt({createInternalComparator:function(){return sr}});Dt({strict:!0,createInternalComparator:function(){return sr}});Dt({circular:!0,createInternalComparator:function(){return sr}});Dt({circular:!0,createInternalComparator:function(){return sr},strict:!0});function Dt(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,u=cC(e),c=uC(u),s=n?n(c):sC(c);return lC({circular:r,comparator:c,createState:i,equals:s,strict:o})}function hC(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function lg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):hC(i)};requestAnimationFrame(n)}function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function pC(e){return mC(e)||yC(e)||vC(e)||dC()}function dC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vC(e,t){if(e){if(typeof e=="string")return fg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fg(e,t)}}function fg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:g<0?0:g},v=function(g){for(var x=g>1?1:g,w=x,O=0;O<8;++O){var m=l(w)-x,b=d(w);if(Math.abs(m-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?17:o,c=function(f,l,h){var d=-(f-l)*n,y=h*a,v=h+(d-y)*u/1e3,p=h*u/1e3+f;return Math.abs(p-l)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VC(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function zs(e){return JC(e)||ZC(e)||YC(e)||XC()}function XC(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YC(e,t){if(e){if(typeof e=="string")return uf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uf(e,t)}}function ZC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JC(e){if(Array.isArray(e))return uf(e)}function uf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ua(e){return ua=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ua(e)}var lt=(function(e){nI(r,e);var t=iI(r);function r(n,i){var a;QC(this,r),a=t.call(this,n,i);var o=a.props,u=o.isActive,c=o.attributeName,s=o.from,f=o.to,l=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(lf(a)),a.changeStyle=a.changeStyle.bind(lf(a)),!u||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),sf(a);if(l&&l.length)a.state={style:l[0].style};else if(s){if(typeof h=="function")return a.state={style:s},sf(a);a.state={style:c?yn({},c,s):s}}else a.state={style:{}};return a}return tI(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,c=a.attributeName,s=a.shouldReAnimate,f=a.to,l=a.from,h=this.state.style;if(u){if(!o){var d={style:c?yn({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(d);return}if(!(fC(i.to,f)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||s?l:i.to;if(this.state&&h){var p={style:c?yn({},c,v):v};(c&&h[c]!==v||!c&&h!==v)&&this.setState(p)}this.runAnimation(et(et({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,c=i.duration,s=i.easing,f=i.begin,l=i.onAnimationEnd,h=i.onAnimationStart,d=HC(o,u,kC(s),c,this.changeStyle),y=function(){a.stopJSAnimation=d()};this.manager.start([h,f,y,c,l])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,c=i.onAnimationStart,s=o[0],f=s.style,l=s.duration,h=l===void 0?0:l,d=function(v,p,g){if(g===0)return v;var x=p.duration,w=p.easing,O=w===void 0?"ease":w,m=p.style,b=p.properties,_=p.onAnimationEnd,A=g>0?o[g-1]:p,T=b||Object.keys(m);if(typeof O=="function"||O==="spring")return[].concat(zs(v),[a.runJSAnimation.bind(a,{from:A.style,to:m,duration:x,easing:O}),x]);var M=dg(T,x,O),P=et(et(et({},A.style),m),{},{transition:M});return[].concat(zs(v),[P,x,_]).filter(OC)};return this.manager.start([c].concat(zs(o.reduce(d,[f,Math.max(h,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=gC());var a=i.begin,o=i.duration,u=i.attributeName,c=i.to,s=i.easing,f=i.onAnimationStart,l=i.onAnimationEnd,h=i.steps,d=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof s=="function"||typeof d=="function"||s==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var v=u?yn({},u,c):c,p=dg(Object.keys(v),o,s);y.start([f,a,et(et({},v),{},{transition:p}),o,l])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=GC(i,KC),s=N.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!u||s===0||o<=0)return a;var l=function(d){var y=d.props,v=y.style,p=v===void 0?{}:v,g=y.className,x=N.cloneElement(d,et(et({},c),{},{style:et(et({},p),f),className:g}));return x};return s===1?l(N.Children.only(a)):S.createElement("div",null,N.Children.map(a,function(h){return l(h)}))}}]),r})(N.PureComponent);lt.displayName="Animate";lt.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};lt.propTypes={from:ie.oneOfType([ie.object,ie.string]),to:ie.oneOfType([ie.object,ie.string]),attributeName:ie.string,duration:ie.number,begin:ie.number,easing:ie.oneOfType([ie.string,ie.func]),steps:ie.arrayOf(ie.shape({duration:ie.number.isRequired,style:ie.object.isRequired,easing:ie.oneOfType([ie.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ie.func]),properties:ie.arrayOf("string"),onAnimationEnd:ie.func})),children:ie.oneOfType([ie.node,ie.func]),isActive:ie.bool,canBegin:ie.bool,onAnimationEnd:ie.func,shouldReAnimate:ie.bool,onAnimationStart:ie.func,onAnimationReStart:ie.func};function Vn(e){"@babel/helpers - typeof";return Vn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vn(e)}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,s=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var l=[0,0,0,0],h=0,d=4;ho?o:a[h];f="M".concat(t,",").concat(r+u*l[0]),l[0]>0&&(f+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(s,",").concat(t+c*l[0],",").concat(r)),f+="L ".concat(t+n-c*l[1],",").concat(r),l[1]>0&&(f+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(s,`, + `).concat(t+n,",").concat(r+u*l[1])),f+="L ".concat(t+n,",").concat(r+i-u*l[2]),l[2]>0&&(f+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(s,`, + `).concat(t+n-c*l[2],",").concat(r+i)),f+="L ".concat(t+c*l[3],",").concat(r+i),l[3]>0&&(f+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(s,`, + `).concat(t,",").concat(r+i-u*l[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var y=Math.min(o,a);f="M ".concat(t,",").concat(r+u*y,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+c*y,",").concat(r,` + L `).concat(t+n-c*y,",").concat(r,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n,",").concat(r+u*y,` + L `).concat(t+n,",").concat(r+i-u*y,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n-c*y,",").concat(r+i,` + L `).concat(t+c*y,",").concat(r+i,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t,",").concat(r+i-u*y," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},dI=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,u=r.width,c=r.height;if(Math.abs(u)>0&&Math.abs(c)>0){var s=Math.min(a,a+u),f=Math.max(a,a+u),l=Math.min(o,o+c),h=Math.max(o,o+c);return n>=s&&n<=f&&i>=l&&i<=h}return!1},vI={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ch=function(t){var r=Og(Og({},vI),t),n=N.useRef(),i=N.useState(-1),a=oI(i,2),o=a[0],u=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&u(O)}catch{}},[]);var c=r.x,s=r.y,f=r.width,l=r.height,h=r.radius,d=r.className,y=r.animationEasing,v=r.animationDuration,p=r.animationBegin,g=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||s!==+s||f!==+f||l!==+l||f===0||l===0)return null;var w=J("recharts-rectangle",d);return x?S.createElement(lt,{canBegin:o>0,from:{width:f,height:l,x:c,y:s},to:{width:f,height:l,x:c,y:s},duration:v,animationEasing:y,isActive:x},function(O){var m=O.width,b=O.height,_=O.x,A=O.y;return S.createElement(lt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,isActive:g,easing:y},S.createElement("path",ca({},H(r,!0),{className:w,d:_g(_,A,m,b,h),ref:n})))}):S.createElement("path",ca({},H(r,!0),{className:w,d:_g(c,s,f,l,h)}))},yI=["points","className","baseLinePoints","connectNulls"];function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ag(e){return OI(e)||wI(e)||xI(e)||bI()}function bI(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xI(e,t){if(e){if(typeof e=="string")return ff(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ff(e,t)}}function wI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OI(e){if(Array.isArray(e))return ff(e)}function ff(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Sg(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Sg(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},wn=function(t,r){var n=_I(t);r&&(n=[n.reduce(function(a,o){return[].concat(Ag(a),Ag(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,u,c){return"".concat(o).concat(c===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},AI=function(t,r,n){var i=wn(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(wn(r.reverse(),n).slice(1))},SI=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=mI(t,yI);if(!r||!r.length)return null;var u=J("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",s=AI(r,i,a);return S.createElement("g",{className:u},S.createElement("path",yr({},H(o,!0),{fill:s.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:s})),c?S.createElement("path",yr({},H(o,!0),{fill:"none",d:wn(r,a)})):null,c?S.createElement("path",yr({},H(o,!0),{fill:"none",d:wn(i,a)})):null)}var f=wn(r,a);return S.createElement("path",yr({},H(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:u,d:f}))};function hf(){return hf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function CI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var II=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},kI=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,u=o===void 0?0:o,c=t.left,s=c===void 0?0:c,f=t.width,l=f===void 0?0:f,h=t.height,d=h===void 0?0:h,y=t.className,v=$I(t,PI),p=TI({x:n,y:a,top:u,left:s,width:l,height:d},v);return!q(n)||!q(a)||!q(l)||!q(d)||!q(u)||!q(s)?null:S.createElement("path",pf({},H(p,!0),{className:J("recharts-cross",y),d:II(n,a,l,d,u,s)}))},Us,Tg;function RI(){if(Tg)return Us;Tg=1;var e=Ka(),t=Tx(),r=ht();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return Us=n,Us}var DI=RI();const NI=oe(DI);var Hs,Eg;function qI(){if(Eg)return Hs;Eg=1;var e=Ka(),t=ht(),r=Ex();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return Hs=n,Hs}var LI=qI();const BI=oe(LI);var FI=["cx","cy","angle","ticks","axisLine"],WI=["ticks","tick","angle","tickFormatter","stroke"];function kr(e){"@babel/helpers - typeof";return kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(e)}function On(){return On=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function UI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $g(e,t){for(var r=0;rkg?o=i==="outer"?"start":"end":a<-kg?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,u=n.axisLine,c=n.axisLineType,s=zt(zt({},H(this.props,!1)),{},{fill:"none"},H(u,!1));if(c==="circle")return S.createElement(Za,Kt({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:a,r:o}));var f=this.props.ticks,l=f.map(function(h){return le(i,a,o,h.coordinate)});return S.createElement(SI,Kt({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,u=i.tickLine,c=i.tickFormatter,s=i.stroke,f=H(this.props,!1),l=H(o,!1),h=zt(zt({},f),{},{fill:"none"},H(u,!1)),d=a.map(function(y,v){var p=n.getTickLineCoord(y),g=n.getTickTextAnchor(y),x=zt(zt(zt({textAnchor:g},f),{},{stroke:"none",fill:s},l),{},{index:v,payload:y,x:p.x2,y:p.y2});return S.createElement(te,Kt({className:J("recharts-polar-angle-axis-tick",rw(o)),key:"tick-".concat(y.coordinate)},tr(n.props,y,v)),u&&S.createElement("line",Kt({className:"recharts-polar-angle-axis-tick-line"},h,p)),o&&t.renderTickItem(o,x,c?c(y.value,v):y.value))});return S.createElement(te,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:S.createElement(te,{className:J("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return S.isValidElement(n)?o=S.cloneElement(n,i):X(n)?o=n(i):o=S.createElement(rr,Kt({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(N.PureComponent);eo(to,"displayName","PolarAngleAxis");eo(to,"axisType","angleAxis");eo(to,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Ks,Rg;function ak(){if(Rg)return Ks;Rg=1;var e=P0(),t=e(Object.getPrototypeOf,Object);return Ks=t,Ks}var Gs,Dg;function ok(){if(Dg)return Gs;Dg=1;var e=St(),t=ak(),r=Pt(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,u=a.hasOwnProperty,c=o.call(Object);function s(f){if(!r(f)||e(f)!=n)return!1;var l=t(f);if(l===null)return!0;var h=u.call(l,"constructor")&&l.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==c}return Gs=s,Gs}var uk=ok();const ck=oe(uk);var Vs,Ng;function sk(){if(Ng)return Vs;Ng=1;var e=St(),t=Pt(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return Vs=n,Vs}var lk=sk();const fk=oe(lk);function Yn(e){"@babel/helpers - typeof";return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function fa(){return fa=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:s},to:{upperWidth:f,lowerWidth:l,height:h,x:c,y:s},duration:v,animationEasing:y,isActive:g},function(w){var O=w.upperWidth,m=w.lowerWidth,b=w.height,_=w.x,A=w.y;return S.createElement(lt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,easing:y},S.createElement("path",fa({},H(r,!0),{className:x,d:Fg(_,A,O,m,b),ref:n})))}):S.createElement("g",null,S.createElement("path",fa({},H(r,!0),{className:x,d:Fg(c,s,f,l,h)})))},Ok=["option","shapeType","propTransformer","activeClassName","isActive"];function Zn(e){"@babel/helpers - typeof";return Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(e)}function _k(e,t){if(e==null)return{};var r=Ak(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ak(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ha(e){for(var t=1;t0?He(w,"paddingAngle",0):0;if(m){var _=ze(m.endAngle-m.startAngle,w.endAngle-w.startAngle),A=ce(ce({},w),{},{startAngle:x+b,endAngle:x+_(v)+b});p.push(A),x=A.endAngle}else{var T=w.endAngle,M=w.startAngle,P=ze(0,T-M),E=P(v),j=ce(ce({},w),{},{startAngle:x+b,endAngle:x+E+b});p.push(j),x=j.endAngle}}),S.createElement(te,null,n.renderSectorsStatically(p))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!hi(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,u=i.className,c=i.label,s=i.cx,f=i.cy,l=i.innerRadius,h=i.outerRadius,d=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!q(s)||!q(f)||!q(l)||!q(h))return null;var v=J("recharts-pie",u);return S.createElement(te,{tabIndex:this.props.rootTabIndex,className:v,ref:function(g){n.pieRef=g}},this.renderSectors(),c&&this.renderLabels(o),Te.renderCallByParent(this.props,null,!1),(!d||y)&&wt.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?x:x-1)*c,O=p-x*d-w,m=i.reduce(function(A,T){var M=_e(T,g,0);return A+(q(M)?M:0)},0),b;if(m>0){var _;b=i.map(function(A,T){var M=_e(A,g,0),P=_e(A,f,T),E=(q(M)?M:0)/m,j;T?j=_.endAngle+Ce(v)*c*(M!==0?1:0):j=o;var C=j+Ce(v)*((M!==0?d:0)+E*O),$=(j+C)/2,k=(y.innerRadius+y.outerRadius)/2,R=[{name:P,value:M,payload:A,dataKey:g,type:h}],L=le(y.cx,y.cy,k,$);return _=ce(ce(ce({percent:E,cornerRadius:a,name:P,tooltipPayload:R,midAngle:$,middleRadius:k,tooltipPosition:L},A),y),{},{value:_e(A,g),startAngle:j,endAngle:C,payload:A,paddingAngle:Ce(v)*c}),_})}return ce(ce({},y),{},{sectors:b,data:i})});var Xs,Kg;function Hk(){if(Kg)return Xs;Kg=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var u=-1,c=t(e((i-n)/(a||1)),0),s=Array(c);c--;)s[o?c:++u]=n,n+=a;return s}return Xs=r,Xs}var Ys,Gg;function xw(){if(Gg)return Ys;Gg=1;var e=W0(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*r}return i===i?i:0}return Ys=n,Ys}var Zs,Vg;function Kk(){if(Vg)return Zs;Vg=1;var e=Hk(),t=La(),r=xw();function n(i){return function(a,o,u){return u&&typeof u!="number"&&t(a,o,u)&&(o=u=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),u=u===void 0?a0&&n.handleDrag(i.changedTouches[0])}),Fe(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o?.({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),Fe(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Fe(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Fe(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Fe(n,"handleSlideDragStart",function(i){var a=eb(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return iR(t,e),eR(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,c=u.gap,s=u.data,f=s.length-1,l=Math.min(i,a),h=Math.max(i,a),d=t.getIndexInRange(o,l),y=t.getIndexInRange(o,h);return{startIndex:d-d%c,endIndex:y===f?f:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,c=_e(a[n],u,n);return X(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,c=this.props,s=c.x,f=c.width,l=c.travellerWidth,h=c.startIndex,d=c.endIndex,y=c.onChange,v=n.pageX-a;v>0?v=Math.min(v,s+f-l-u,s+f-l-o):v<0&&(v=Math.max(v,s-o,s-u));var p=this.getIndex({startX:o+v,endX:u+v});(p.startIndex!==h||p.endIndex!==d)&&y&&y(p),this.setState({startX:o+v,endX:u+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=eb(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,c=i.startX,s=this.state[o],f=this.props,l=f.x,h=f.width,d=f.travellerWidth,y=f.onChange,v=f.gap,p=f.data,g={startX:this.state.startX,endX:this.state.endX},x=n.pageX-a;x>0?x=Math.min(x,l+h-d-s):x<0&&(x=Math.max(x,l-s)),g[o]=s+x;var w=this.getIndex(g),O=w.startIndex,m=w.endIndex,b=function(){var A=p.length-1;return o==="startX"&&(u>c?O%v===0:m%v===0)||uc?m%v===0:O%v===0)||u>c&&m===A};this.setState(Fe(Fe({},o,s+x),"brushMoveStartX",n.pageX),function(){y&&b()&&y(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,c=o.startX,s=o.endX,f=this.state[i],l=u.indexOf(f);if(l!==-1){var h=l+n;if(!(h===-1||h>=u.length)){var d=u[h];i==="startX"&&d>=s||i==="endX"&&d<=c||this.setState(Fe({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.fill,s=n.stroke;return S.createElement("rect",{stroke:s,fill:c,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.data,s=n.children,f=n.padding,l=N.Children.only(s);return l?S.cloneElement(l,{x:i,y:a,width:o,height:u,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,c=this.props,s=c.y,f=c.travellerWidth,l=c.height,h=c.traveller,d=c.ariaLabel,y=c.data,v=c.startIndex,p=c.endIndex,g=Math.max(n,this.props.x),x=Qs(Qs({},H(this.props,!1)),{},{x:g,y:s,width:f,height:l}),w=d||"Min value: ".concat((a=y[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[p])===null||o===void 0?void 0:o.name);return S.createElement(te,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(m){["ArrowLeft","ArrowRight"].includes(m.key)&&(m.preventDefault(),m.stopPropagation(),u.handleTravellerMoveKeyboard(m.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,c=a.stroke,s=a.travellerWidth,f=Math.min(n,i)+s,l=Math.max(Math.abs(i-n)-s,0);return S.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:l,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,c=n.travellerWidth,s=n.stroke,f=this.state,l=f.startX,h=f.endX,d=5,y={pointerEvents:"none",fill:s};return S.createElement(te,{className:"recharts-brush-texts"},S.createElement(rr,va({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,h)-d,y:o+u/2},y),this.getTextOfTick(i)),S.createElement(rr,va({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,h)+c+d,y:o+u/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,c=n.y,s=n.width,f=n.height,l=n.alwaysShowText,h=this.state,d=h.startX,y=h.endX,v=h.isTextActive,p=h.isSlideMoving,g=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!q(u)||!q(c)||!q(s)||!q(f)||s<=0||f<=0)return null;var w=J("recharts-brush",a),O=S.Children.count(o)===1,m=Jk("userSelect","none");return S.createElement(te,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:m},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(d,y),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(y,"endX"),(v||p||g||x||l)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,c=n.stroke,s=Math.floor(a+u/2)-1;return S.createElement(S.Fragment,null,S.createElement("rect",{x:i,y:a,width:o,height:u,fill:c,stroke:"none"}),S.createElement("line",{x1:i+1,y1:s,x2:i+o-1,y2:s,fill:"none",stroke:"#fff"}),S.createElement("line",{x1:i+1,y1:s+2,x2:i+o-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return S.isValidElement(n)?a=S.cloneElement(n,i):X(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,c=n.travellerWidth,s=n.updateId,f=n.startIndex,l=n.endIndex;if(a!==i.prevData||s!==i.prevUpdateId)return Qs({prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o},a&&a.length?oR({data:a,width:o,x:u,travellerWidth:c,startIndex:f,endIndex:l}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([u,u+o-c]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var c=Math.floor((o+u)/2);n[c]>i?u=c:o=c}return i>=n[u]?u:o}}])})(N.PureComponent);Fe(qr,"displayName","Brush");Fe(qr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var el,tb;function uR(){if(tb)return el;tb=1;var e=nh();function t(r,n){var i;return e(r,function(a,o,u){return i=n(a,o,u),!i}),!!i}return el=t,el}var tl,rb;function cR(){if(rb)return tl;rb=1;var e=b0(),t=ht(),r=uR(),n=qe(),i=La();function a(o,u,c){var s=n(o)?e:r;return c&&i(o,u,c)&&(u=void 0),s(o,t(u,3))}return tl=a,tl}var sR=cR();const lR=oe(sR);var ct=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},rl,nb;function fR(){if(nb)return rl;nb=1;var e=N0();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return rl=t,rl}var nl,ib;function hR(){if(ib)return nl;ib=1;var e=fR(),t=R0(),r=ht();function n(i,a){var o={};return a=r(a,3),t(i,function(u,c,s){e(o,c,a(u,c,s))}),o}return nl=n,nl}var pR=hR();const dR=oe(pR);var il,ab;function vR(){if(ab)return il;ab=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function AR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function SR(e,t){var r=e.x,n=e.y,i=_R(e,bR),a="".concat(r),o=parseInt(a,10),u="".concat(n),c=parseInt(u,10),s="".concat(t.height||i.height),f=parseInt(s,10),l="".concat(t.width||i.width),h=parseInt(l,10);return pn(pn(pn(pn(pn({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function sb(e){return S.createElement(mw,gf({shapeType:"rectangle",propTransformer:SR,activeClassName:"recharts-active-bar"},e))}var PR=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=q(n)||YO(n);return a?t(n,i):(a||Qt(!1),r)}},TR=["value","background"],Sw;function Lr(e){"@babel/helpers - typeof";return Lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}function ER(e,t){if(e==null)return{};var r=jR(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ma(){return ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(C)0&&(j=Math.min((fe||0)-(C[ye-1]||0),j))}),Number.isFinite(j)){var $=j/E,k=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(_=$*k/2),v.padding==="no-gap"){var R=Ie(t.barCategoryGap,$*k),L=$*k/2;_=L-R-(L-R)/k*R}}}i==="xAxis"?A=[n.left+(w.left||0)+(_||0),n.left+n.width-(w.right||0)-(_||0)]:i==="yAxis"?A=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(_||0),n.top+n.height-(w.bottom||0)-(_||0)]:A=v.range,m&&(A=[A[1],A[0]]);var B=Xx(v,a,h),U=B.scale,G=B.realScaleType;U.domain(g).range(A),Yx(U);var W=Zx(U,tt(tt({},v),{},{realScaleType:G}));i==="xAxis"?(P=p==="top"&&!O||p==="bottom"&&O,T=n.left,M=l[b]-P*v.height):i==="yAxis"&&(P=p==="left"&&!O||p==="right"&&O,T=l[b]-P*v.width,M=n.top);var V=tt(tt(tt({},v),W),{},{realScaleType:G,x:T,y:M,scale:U,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return V.bandSize=ta(V,W),!v.hide&&i==="xAxis"?l[b]+=(P?-1:1)*V.height:v.hide||(l[b]+=(P?-1:1)*V.width),tt(tt({},d),{},io({},y,V))},{})},Mw=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},BR=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return Mw({x:r,y:n},{x:i,y:a})},$w=(function(){function e(t){NR(this,e),this.scale=t}return qR(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();io($w,"EPS",1e-4);var Ih=function(t){var r=Object.keys(t).reduce(function(n,i){return tt(tt({},n),{},io({},i,$w.create(t[i])))},{});return tt(tt({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return dR(i,function(c,s){return r[s].apply(c,{bandAware:o,position:u})})},isInRange:function(i){return Aw(i,function(a,o){return r[o].isInRange(a)})}})};function FR(e){return(e%180+180)%180}var WR=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=FR(i),o=a*Math.PI/180,u=Math.atan(n/r),c=o>u&&o-1?c[s?a[f]:f]:void 0}}return ul=n,ul}var cl,vb;function UR(){if(vb)return cl;vb=1;var e=xw();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return cl=t,cl}var sl,yb;function HR(){if(yb)return sl;yb=1;var e=M0(),t=ht(),r=UR(),n=Math.max;function i(a,o,u){var c=a==null?0:a.length;if(!c)return-1;var s=u==null?0:r(u);return s<0&&(s=n(c+s,0)),e(a,t(o,3),s)}return sl=i,sl}var ll,mb;function KR(){if(mb)return ll;mb=1;var e=zR(),t=HR(),r=e(t);return ll=r,ll}var GR=KR();const VR=oe(GR);var XR=Kb();const YR=oe(XR);var ZR=YR(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),kh=N.createContext(void 0),Rh=N.createContext(void 0),Cw=N.createContext(void 0),Iw=N.createContext({}),kw=N.createContext(void 0),Rw=N.createContext(0),Dw=N.createContext(0),gb=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,u=t.children,c=t.width,s=t.height,f=ZR(a);return S.createElement(kh.Provider,{value:n},S.createElement(Rh.Provider,{value:i},S.createElement(Iw.Provider,{value:a},S.createElement(Cw.Provider,{value:f},S.createElement(kw.Provider,{value:o},S.createElement(Rw.Provider,{value:s},S.createElement(Dw.Provider,{value:c},u)))))))},JR=function(){return N.useContext(kw)},Nw=function(t){var r=N.useContext(kh);r==null&&Qt(!1);var n=r[t];return n==null&&Qt(!1),n},QR=function(){var t=N.useContext(kh);return Mt(t)},eD=function(){var t=N.useContext(Rh),r=VR(t,function(n){return Aw(n.domain,Number.isFinite)});return r||Mt(t)},qw=function(t){var r=N.useContext(Rh);r==null&&Qt(!1);var n=r[t];return n==null&&Qt(!1),n},tD=function(){var t=N.useContext(Cw);return t},rD=function(){return N.useContext(Iw)},Dh=function(){return N.useContext(Dw)},Nh=function(){return N.useContext(Rw)};function Br(e){"@babel/helpers - typeof";return Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(e)}function nD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iD(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function LD(e,t){return Hw(e,t+1)}function BD(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,c=0,s=1,f=o,l=function(){var y=n?.[c];if(y===void 0)return{v:Hw(n,s)};var v=c,p,g=function(){return p===void 0&&(p=r(y,v)),p},x=y.coordinate,w=c===0||Oa(e,x,g,f,u);w||(c=0,f=o,s+=1),w&&(f=x+e*(g()/2+i),c+=s)},h;s<=a.length;)if(h=l(),h)return h.v;return[]}function ri(e){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(e)}function Pb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t0?d.coordinate-p*e:d.coordinate})}else a[h]=d=Me(Me({},d),{},{tickCoord:d.coordinate});var g=Oa(e,d.tickCoord,v,u,c);g&&(c=d.tickCoord-e*(v()/2+i),a[h]=Me(Me({},d),{},{isShow:!0}))},f=o-1;f>=0;f--)s(f);return a}function HD(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,c=t.start,s=t.end;if(a){var f=n[u-1],l=r(f,u-1),h=e*(f.coordinate+e*l/2-s);o[u-1]=f=Me(Me({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var d=Oa(e,f.tickCoord,function(){return l},c,s);d&&(s=f.tickCoord-e*(l/2+i),o[u-1]=Me(Me({},f),{},{isShow:!0}))}for(var y=a?u-1:u,v=function(x){var w=o[x],O,m=function(){return O===void 0&&(O=r(w,x)),O};if(x===0){var b=e*(w.coordinate-e*m()/2-c);o[x]=w=Me(Me({},w),{},{tickCoord:b<0?w.coordinate-b*e:w.coordinate})}else o[x]=w=Me(Me({},w),{},{tickCoord:w.coordinate});var _=Oa(e,w.tickCoord,m,c,s);_&&(c=w.tickCoord+e*(m()/2+i),o[x]=Me(Me({},w),{},{isShow:!0}))},p=0;p=2?Ce(i[1].coordinate-i[0].coordinate):1,g=qD(a,p,d);return c==="equidistantPreserveStart"?BD(p,g,v,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=HD(p,g,v,i,o,c==="preserveStartEnd"):h=UD(p,g,v,i,o),h.filter(function(x){return x.isShow}))}var KD=["viewBox"],GD=["viewBox"],VD=["ticks"];function zr(e){"@babel/helpers - typeof";return zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(e)}function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function YD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eb(e,t){for(var r=0;r0?c(this.props):c(d)),o<=0||u<=0||!y||!y.length?null:S.createElement(te,{className:J("recharts-cartesian-axis",s),ref:function(p){n.layerReference=p}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Te.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,u=J(i.className,"recharts-cartesian-axis-tick-value");return S.isValidElement(n)?o=S.cloneElement(n,we(we({},i),{},{className:u})):X(n)?o=n(we(we({},i),{},{className:u})):o=S.createElement(rr,gr({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(N.Component);Fh(nn,"displayName","CartesianAxis");Fh(nn,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var nN=["x1","y1","x2","y2","key"],iN=["offset"];function ir(e){"@babel/helpers - typeof";return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ir(e)}function jb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var sN=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,u=t.height,c=t.ry;return S.createElement("rect",{x:i,y:a,ry:c,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Vw(e,t){var r;if(S.isValidElement(e))r=S.cloneElement(e,t);else if(X(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,u=t.key,c=Mb(t,nN),s=H(c,!1);s.offset;var f=Mb(s,iN);r=S.createElement("line",Yt({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:u}))}return r}function lN(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=$e($e({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(c),index:c});return Vw(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function fN(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=$e($e({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(c),index:c});return Vw(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function hN(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,u=e.horizontalPoints,c=e.horizontal,s=c===void 0?!0:c;if(!s||!t||!t.length)return null;var f=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,d){return h-d});i!==f[0]&&f.unshift(0);var l=f.map(function(h,d){var y=!f[d+1],v=y?i+o-h:f[d+1]-h;if(v<=0)return null;var p=d%t.length;return S.createElement("rect",{key:"react-".concat(d),y:h,x:n,height:v,width:a,stroke:"none",fill:t[p],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function pN(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,u=e.width,c=e.height,s=e.verticalPoints;if(!r||!n||!n.length)return null;var f=s.map(function(h){return Math.round(h+a-a)}).sort(function(h,d){return h-d});a!==f[0]&&f.unshift(0);var l=f.map(function(h,d){var y=!f[d+1],v=y?a+u-h:f[d+1]-h;if(v<=0)return null;var p=d%n.length;return S.createElement("rect",{key:"react-".concat(d),x:h,y:o,width:v,height:c,stroke:"none",fill:n[p],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var dN=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return Vx(Bh($e($e($e({},nn.defaultProps),n),{},{ticks:gt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},vN=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return Vx(Bh($e($e($e({},nn.defaultProps),n),{},{ticks:gt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},pr={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function yN(e){var t,r,n,i,a,o,u=Dh(),c=Nh(),s=rD(),f=$e($e({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:pr.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:pr.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:pr.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:pr.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:pr.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:pr.verticalFill,x:q(e.x)?e.x:s.left,y:q(e.y)?e.y:s.top,width:q(e.width)?e.width:s.width,height:q(e.height)?e.height:s.height}),l=f.x,h=f.y,d=f.width,y=f.height,v=f.syncWithTicks,p=f.horizontalValues,g=f.verticalValues,x=QR(),w=eD();if(!q(d)||d<=0||!q(y)||y<=0||!q(l)||l!==+l||!q(h)||h!==+h)return null;var O=f.verticalCoordinatesGenerator||dN,m=f.horizontalCoordinatesGenerator||vN,b=f.horizontalPoints,_=f.verticalPoints;if((!b||!b.length)&&X(m)){var A=p&&p.length,T=m({yAxis:w?$e($e({},w),{},{ticks:A?p:w.ticks}):void 0,width:u,height:c,offset:s},A?!0:v);it(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ir(T),"]")),Array.isArray(T)&&(b=T)}if((!_||!_.length)&&X(O)){var M=g&&g.length,P=O({xAxis:x?$e($e({},x),{},{ticks:M?g:x.ticks}):void 0,width:u,height:c,offset:s},M?!0:v);it(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ir(P),"]")),Array.isArray(P)&&(_=P)}return S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(sN,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),S.createElement(lN,Yt({},f,{offset:s,horizontalPoints:b,xAxis:x,yAxis:w})),S.createElement(fN,Yt({},f,{offset:s,verticalPoints:_,xAxis:x,yAxis:w})),S.createElement(hN,Yt({},f,{horizontalPoints:b})),S.createElement(pN,Yt({},f,{verticalPoints:_})))}yN.displayName="CartesianGrid";var mN=["type","layout","connectNulls","ref"],gN=["key"];function Ur(e){"@babel/helpers - typeof";return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(e)}function $b(e,t){if(e==null)return{};var r=bN(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rl){d=[].concat(dr(c.slice(0,y)),[l-v]);break}var p=d.length%2===0?[0,h]:[h];return[].concat(dr(t.repeat(c,f)),dr(d),p).map(function(g){return"".concat(g,"px")}).join(", ")}),rt(r,"id",Zr("recharts-line-")),rt(r,"pathRef",function(o){r.mainCurve=o}),rt(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),rt(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return jN(t,e),SN(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,u=a.xAxis,c=a.yAxis,s=a.layout,f=a.children,l=Ke(f,pi);if(!l)return null;var h=function(v,p){return{x:v.x,y:v.y,value:v.value,errorVal:_e(v.payload,p)}},d={clipPath:n?"url(#clipPath-".concat(i,")"):null};return S.createElement(te,d,l.map(function(y){return S.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:o,xAxis:u,yAxis:c,layout:s,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,c=u.dot,s=u.points,f=u.dataKey,l=H(this.props,!1),h=H(c,!0),d=s.map(function(v,p){var g=Be(Be(Be({key:"dot-".concat(p),r:3},l),h),{},{index:p,cx:v.x,cy:v.y,value:v.value,dataKey:f,payload:v.payload,points:s});return t.renderDotItem(c,g)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return S.createElement(te,_n({className:"recharts-line-dots",key:"dots"},y),d)}},{key:"renderCurveStatically",value:function(n,i,a,o){var u=this.props,c=u.type,s=u.layout,f=u.connectNulls;u.ref;var l=$b(u,mN),h=Be(Be(Be({},H(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:s,connectNulls:f});return S.createElement(ia,_n({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,u=o.points,c=o.strokeDasharray,s=o.isAnimationActive,f=o.animationBegin,l=o.animationDuration,h=o.animationEasing,d=o.animationId,y=o.animateNewValues,v=o.width,p=o.height,g=this.state,x=g.prevPoints,w=g.totalLength;return S.createElement(lt,{begin:f,duration:l,isActive:s,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var m=O.t;if(x){var b=x.length/u.length,_=u.map(function(E,j){var C=Math.floor(j*b);if(x[C]){var $=x[C],k=ze($.x,E.x),R=ze($.y,E.y);return Be(Be({},E),{},{x:k(m),y:R(m)})}if(y){var L=ze(v*2,E.x),B=ze(p/2,E.y);return Be(Be({},E),{},{x:L(m),y:B(m)})}return Be(Be({},E),{},{x:E.x,y:E.y})});return a.renderCurveStatically(_,n,i)}var A=ze(0,w),T=A(m),M;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});M=a.getStrokeDasharray(T,w,P)}else M=a.generateSimpleStrokeDasharray(w,T);return a.renderCurveStatically(u,n,i,{strokeDasharray:M})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,u=a.isAnimationActive,c=this.state,s=c.prevPoints,f=c.totalLength;return u&&o&&o.length&&(!s&&f>0||!hi(s,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,u=i.points,c=i.className,s=i.xAxis,f=i.yAxis,l=i.top,h=i.left,d=i.width,y=i.height,v=i.isAnimationActive,p=i.id;if(a||!u||!u.length)return null;var g=this.state.isAnimationFinished,x=u.length===1,w=J("recharts-line",c),O=s&&s.allowDataOverflow,m=f&&f.allowDataOverflow,b=O||m,_=Y(p)?this.id:p,A=(n=H(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},T=A.r,M=T===void 0?3:T,P=A.strokeWidth,E=P===void 0?2:P,j=c_(o)?o:{},C=j.clipDot,$=C===void 0?!0:C,k=M*2+E;return S.createElement(te,{className:w},O||m?S.createElement("defs",null,S.createElement("clipPath",{id:"clipPath-".concat(_)},S.createElement("rect",{x:O?h:h-d/2,y:m?l:l-y/2,width:O?d:d*2,height:m?y:y*2})),!$&&S.createElement("clipPath",{id:"clipPath-dots-".concat(_)},S.createElement("rect",{x:h-k/2,y:l-k/2,width:d+k,height:y+k}))):null,!x&&this.renderCurve(b,_),this.renderErrorBar(b,_),(x||o)&&this.renderDots(b,$,_),(!v||g)&&wt.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(dr(n),[0]):n,o=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function b2(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function x2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w2(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&q(i)&&q(a)?t.slice(i,a+1):[]};function sO(e){return e==="number"?[0,"auto"]:void 0}var Nf=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=ho(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=l===void 0?u:l;h=Mi(d,o.dataKey,i)}else h=l&&l[n]||u[n];return h?[].concat(Vr(c),[Qx(s,h)]):c},[])},Bb=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=I2(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=iM(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,h=Nf(t,r,f,l),d=k2(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:h,activeCoordinate:d}}return null},R2=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=t.stackOffset,d=Gx(f,a);return n.reduce(function(y,v){var p,g=v.type.defaultProps!==void 0?I(I({},v.type.defaultProps),v.props):v.props,x=g.type,w=g.dataKey,O=g.allowDataOverflow,m=g.allowDuplicatedCategory,b=g.scale,_=g.ticks,A=g.includeHidden,T=g[o];if(y[T])return y;var M=ho(t.data,{graphicalItems:i.filter(function(W){var V,fe=o in W.props?W.props[o]:(V=W.type.defaultProps)===null||V===void 0?void 0:V[o];return fe===T}),dataStartIndex:c,dataEndIndex:s}),P=M.length,E,j,C;u2(g.domain,O,x)&&(E=Yl(g.domain,null,O),d&&(x==="number"||b!=="auto")&&(C=bn(M,w,"category")));var $=sO(x);if(!E||E.length===0){var k,R=(k=g.domain)!==null&&k!==void 0?k:$;if(w){if(E=bn(M,w,x),x==="category"&&d){var L=JO(E);m&&L?(j=E,E=da(0,P)):m||(E=Lm(R,E,v).reduce(function(W,V){return W.indexOf(V)>=0?W:[].concat(Vr(W),[V])},[]))}else if(x==="category")m?E=E.filter(function(W){return W!==""&&!Y(W)}):E=Lm(R,E,v).reduce(function(W,V){return W.indexOf(V)>=0||V===""||Y(V)?W:[].concat(Vr(W),[V])},[]);else if(x==="number"){var B=sM(M,i.filter(function(W){var V,fe,ye=o in W.props?W.props[o]:(V=W.type.defaultProps)===null||V===void 0?void 0:V[o],Le="hide"in W.props?W.props.hide:(fe=W.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return ye===T&&(A||!Le)}),w,a,f);B&&(E=B)}d&&(x==="number"||b!=="auto")&&(C=bn(M,w,"category"))}else d?E=da(0,P):u&&u[T]&&u[T].hasStack&&x==="number"?E=h==="expand"?[0,1]:Jx(u[T].stackGroups,c,s):E=Kx(M,i.filter(function(W){var V=o in W.props?W.props[o]:W.type.defaultProps[o],fe="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return V===T&&(A||!fe)}),x,f,!0);if(x==="number")E=kf(l,E,T,a,_),R&&(E=Yl(R,E,O));else if(x==="category"&&R){var U=R,G=E.every(function(W){return U.indexOf(W)>=0});G&&(E=U)}}return I(I({},y),{},K({},T,I(I({},g),{},{axisType:a,domain:E,categoricalDomain:C,duplicateDomain:j,originalDomain:(p=g.domain)!==null&&p!==void 0?p:$,isCategorical:d,layout:f})))},{})},D2=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=ho(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),d=h.length,y=Gx(f,a),v=-1;return n.reduce(function(p,g){var x=g.type.defaultProps!==void 0?I(I({},g.type.defaultProps),g.props):g.props,w=x[o],O=sO("number");if(!p[w]){v++;var m;return y?m=da(0,d):u&&u[w]&&u[w].hasStack?(m=Jx(u[w].stackGroups,c,s),m=kf(l,m,w,a)):(m=Yl(O,Kx(h,n.filter(function(b){var _,A,T=o in b.props?b.props[o]:(_=b.type.defaultProps)===null||_===void 0?void 0:_[o],M="hide"in b.props?b.props.hide:(A=b.type.defaultProps)===null||A===void 0?void 0:A.hide;return T===w&&!M}),"number",f),i.defaultProps.allowDataOverflow),m=kf(l,m,w,a)),I(I({},p),{},K({},w,I(I({axisType:a},i.defaultProps),{},{hide:!0,orientation:He($2,"".concat(a,".").concat(v%2),null),domain:m,originalDomain:O,isCategorical:y,layout:f})))}return p},{})},N2=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),h=Ke(f,a),d={};return h&&h.length?d=R2(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(d=D2(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),d},q2=function(t){var r=Mt(t),n=gt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:ih(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ta(r,n)}},Fb=function(t){var r=t.children,n=t.defaultShowTooltip,i=We(r,qr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},L2=function(t){return!t||!t.length?!1:t.some(function(r){var n=bt(r&&r.type);return n&&n.indexOf("Bar")>=0})},Wb=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},B2=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,h=n.margin||{},d=We(l,qr),y=We(l,wr),v=Object.keys(c).reduce(function(m,b){var _=c[b],A=_.orientation;return!_.mirror&&!_.hide?I(I({},m),{},K({},A,m[A]+_.width)):m},{left:h.left||0,right:h.right||0}),p=Object.keys(o).reduce(function(m,b){var _=o[b],A=_.orientation;return!_.mirror&&!_.hide?I(I({},m),{},K({},A,He(m,"".concat(A))+_.height)):m},{top:h.top||0,bottom:h.bottom||0}),g=I(I({},p),v),x=g.bottom;d&&(g.bottom+=d.props.height||qr.defaultProps.height),y&&r&&(g=uM(g,i,n,r));var w=s-g.left-g.right,O=f-g.top-g.bottom;return I(I({brushBottom:x},g),{},{width:Math.max(w,0),height:Math.max(O,0)})},F2=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Wh=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,h=function(g,x){var w=x.graphicalItems,O=x.stackGroups,m=x.offset,b=x.updateId,_=x.dataStartIndex,A=x.dataEndIndex,T=g.barSize,M=g.layout,P=g.barGap,E=g.barCategoryGap,j=g.maxBarSize,C=Wb(M),$=C.numericAxisName,k=C.cateAxisName,R=L2(w),L=[];return w.forEach(function(B,U){var G=ho(g.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:A}),W=B.type.defaultProps!==void 0?I(I({},B.type.defaultProps),B.props):B.props,V=W.dataKey,fe=W.maxBarSize,ye=W["".concat($,"Id")],Le=W["".concat(k,"Id")],qt={},Re=c.reduce(function(Lt,Bt){var po=x["".concat(Bt.axisType,"Map")],zh=W["".concat(Bt.axisType,"Id")];po&&po[zh]||Bt.axisType==="zAxis"||Qt(!1);var Uh=po[zh];return I(I({},Lt),{},K(K({},Bt.axisType,Uh),"".concat(Bt.axisType,"Ticks"),gt(Uh)))},qt),F=Re[k],Z=Re["".concat(k,"Ticks")],Q=O&&O[ye]&&O[ye].hasStack&&gM(B,O[ye].stackGroups),D=bt(B.type).indexOf("Bar")>=0,de=ta(F,Z),ee=[],be=R&&aM({barSize:T,stackGroups:O,totalSize:F2(Re,k)});if(D){var xe,De,Et=Y(fe)?j:fe,lr=(xe=(De=ta(F,Z,!0))!==null&&De!==void 0?De:Et)!==null&&xe!==void 0?xe:0;ee=oM({barGap:P,barCategoryGap:E,bandSize:lr!==de?lr:de,sizeList:be[Le],maxBarSize:Et}),lr!==de&&(ee=ee.map(function(Lt){return I(I({},Lt),{},{position:I(I({},Lt.position),{},{offset:Lt.position.offset-lr/2})})}))}var di=B&&B.type&&B.type.getComposedData;di&&L.push({props:I(I({},di(I(I({},Re),{},{displayedData:G,props:g,dataKey:V,item:B,bandSize:de,barPosition:ee,offset:m,stackedData:Q,layout:M,dataStartIndex:_,dataEndIndex:A}))),{},K(K(K({key:B.key||"item-".concat(U)},$,Re[$]),k,Re[k]),"animationId",b)),childIndex:f_(B,g.children),item:B})}),L},d=function(g,x){var w=g.props,O=g.dataStartIndex,m=g.dataEndIndex,b=g.updateId;if(!Qp({props:w}))return null;var _=w.children,A=w.layout,T=w.stackOffset,M=w.data,P=w.reverseStackOrder,E=Wb(A),j=E.numericAxisName,C=E.cateAxisName,$=Ke(_,n),k=yM(M,$,"".concat(j,"Id"),"".concat(C,"Id"),T,P),R=c.reduce(function(W,V){var fe="".concat(V.axisType,"Map");return I(I({},W),{},K({},fe,N2(w,I(I({},V),{},{graphicalItems:$,stackGroups:V.axisType===j&&k,dataStartIndex:O,dataEndIndex:m}))))},{}),L=B2(I(I({},R),{},{props:w,graphicalItems:$}),x?.legendBBox);Object.keys(R).forEach(function(W){R[W]=f(w,R[W],L,W.replace("Map",""),r)});var B=R["".concat(C,"Map")],U=q2(B),G=h(w,I(I({},R),{},{dataStartIndex:O,dataEndIndex:m,updateId:b,graphicalItems:$,stackGroups:k,offset:L}));return I(I({formattedGraphicalItems:G,graphicalItems:$,offset:L,stackGroups:k},U),R)},y=(function(p){function g(x){var w,O,m;return x2(this,g),m=_2(this,g,[x]),K(m,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),K(m,"accessibilityManager",new o2),K(m,"handleLegendBBoxUpdate",function(b){if(b){var _=m.state,A=_.dataStartIndex,T=_.dataEndIndex,M=_.updateId;m.setState(I({legendBBox:b},d({props:m.props,dataStartIndex:A,dataEndIndex:T,updateId:M},I(I({},m.state),{},{legendBBox:b}))))}}),K(m,"handleReceiveSyncEvent",function(b,_,A){if(m.props.syncId===b){if(A===m.eventEmitterSymbol&&typeof m.props.syncMethod!="function")return;m.applySyncEvent(_)}}),K(m,"handleBrushChange",function(b){var _=b.startIndex,A=b.endIndex;if(_!==m.state.dataStartIndex||A!==m.state.dataEndIndex){var T=m.state.updateId;m.setState(function(){return I({dataStartIndex:_,dataEndIndex:A},d({props:m.props,dataStartIndex:_,dataEndIndex:A,updateId:T},m.state))}),m.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),K(m,"handleMouseEnter",function(b){var _=m.getMouseInfo(b);if(_){var A=I(I({},_),{},{isTooltipActive:!0});m.setState(A),m.triggerSyncEvent(A);var T=m.props.onMouseEnter;X(T)&&T(A,b)}}),K(m,"triggeredAfterMouseMove",function(b){var _=m.getMouseInfo(b),A=_?I(I({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};m.setState(A),m.triggerSyncEvent(A);var T=m.props.onMouseMove;X(T)&&T(A,b)}),K(m,"handleItemMouseEnter",function(b){m.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),K(m,"handleItemMouseLeave",function(){m.setState(function(){return{isTooltipActive:!1}})}),K(m,"handleMouseMove",function(b){b.persist(),m.throttleTriggeredAfterMouseMove(b)}),K(m,"handleMouseLeave",function(b){m.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};m.setState(_),m.triggerSyncEvent(_);var A=m.props.onMouseLeave;X(A)&&A(_,b)}),K(m,"handleOuterEvent",function(b){var _=l_(b),A=He(m.props,"".concat(_));if(_&&X(A)){var T,M;/.*touch.*/i.test(_)?M=m.getMouseInfo(b.changedTouches[0]):M=m.getMouseInfo(b),A((T=M)!==null&&T!==void 0?T:{},b)}}),K(m,"handleClick",function(b){var _=m.getMouseInfo(b);if(_){var A=I(I({},_),{},{isTooltipActive:!0});m.setState(A),m.triggerSyncEvent(A);var T=m.props.onClick;X(T)&&T(A,b)}}),K(m,"handleMouseDown",function(b){var _=m.props.onMouseDown;if(X(_)){var A=m.getMouseInfo(b);_(A,b)}}),K(m,"handleMouseUp",function(b){var _=m.props.onMouseUp;if(X(_)){var A=m.getMouseInfo(b);_(A,b)}}),K(m,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&m.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),K(m,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&m.handleMouseDown(b.changedTouches[0])}),K(m,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&m.handleMouseUp(b.changedTouches[0])}),K(m,"handleDoubleClick",function(b){var _=m.props.onDoubleClick;if(X(_)){var A=m.getMouseInfo(b);_(A,b)}}),K(m,"handleContextMenu",function(b){var _=m.props.onContextMenu;if(X(_)){var A=m.getMouseInfo(b);_(A,b)}}),K(m,"triggerSyncEvent",function(b){m.props.syncId!==void 0&&pl.emit(dl,m.props.syncId,b,m.eventEmitterSymbol)}),K(m,"applySyncEvent",function(b){var _=m.props,A=_.layout,T=_.syncMethod,M=m.state.updateId,P=b.dataStartIndex,E=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)m.setState(I({dataStartIndex:P,dataEndIndex:E},d({props:m.props,dataStartIndex:P,dataEndIndex:E,updateId:M},m.state)));else if(b.activeTooltipIndex!==void 0){var j=b.chartX,C=b.chartY,$=b.activeTooltipIndex,k=m.state,R=k.offset,L=k.tooltipTicks;if(!R)return;if(typeof T=="function")$=T(L,b);else if(T==="value"){$=-1;for(var B=0;B=0){var Q,D;if(j.dataKey&&!j.allowDuplicatedCategory){var de=typeof j.dataKey=="function"?Z:"payload.".concat(j.dataKey.toString());Q=Mi(B,de,$),D=U&&G&&Mi(G,de,$)}else Q=B?.[C],D=U&&G&&G[C];if(Le||ye){var ee=b.props.activeIndex!==void 0?b.props.activeIndex:C;return[N.cloneElement(b,I(I(I({},T.props),Re),{},{activeIndex:ee})),null,null]}if(!Y(Q))return[F].concat(Vr(m.renderActivePoints({item:T,activePoint:Q,basePoint:D,childIndex:C,isRange:U})))}else{var be,xe=(be=m.getItemByXY(m.state.activeCoordinate))!==null&&be!==void 0?be:{graphicalItem:F},De=xe.graphicalItem,Et=De.item,lr=Et===void 0?b:Et,di=De.childIndex,Lt=I(I(I({},T.props),Re),{},{activeIndex:di});return[N.cloneElement(lr,Lt),null,null]}return U?[F,null,null]:[F,null]}),K(m,"renderCustomized",function(b,_,A){return N.cloneElement(b,I(I({key:"recharts-customized-".concat(A)},m.props),m.state))}),K(m,"renderMap",{CartesianGrid:{handler:Ei,once:!0},ReferenceArea:{handler:m.renderReferenceElement},ReferenceLine:{handler:Ei},ReferenceDot:{handler:m.renderReferenceElement},XAxis:{handler:Ei},YAxis:{handler:Ei},Brush:{handler:m.renderBrush,once:!0},Bar:{handler:m.renderGraphicChild},Line:{handler:m.renderGraphicChild},Area:{handler:m.renderGraphicChild},Radar:{handler:m.renderGraphicChild},RadialBar:{handler:m.renderGraphicChild},Scatter:{handler:m.renderGraphicChild},Pie:{handler:m.renderGraphicChild},Funnel:{handler:m.renderGraphicChild},Tooltip:{handler:m.renderCursor,once:!0},PolarGrid:{handler:m.renderPolarGrid,once:!0},PolarAngleAxis:{handler:m.renderPolarAxis},PolarRadiusAxis:{handler:m.renderPolarAxis},Customized:{handler:m.renderCustomized}}),m.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:Zr("recharts"),"-clip"),m.throttleTriggeredAfterMouseMove=z0(m.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),m.state={},m}return P2(g,p),O2(g,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,m=w.data,b=w.height,_=w.layout,A=We(O,dt);if(A){var T=A.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var M=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,P=Nf(this.state,m,T,M),E=this.state.tooltipTicks[T].coordinate,j=(this.state.offset.top+b)/2,C=_==="horizontal",$=C?{x:E,y:j}:{y:E,x:j},k=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});k&&($=I(I({},$),k.props.points[T].tooltipPosition),P=k.props.points[T].tooltipPayload);var R={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:M,activePayload:P,activeCoordinate:$};this.setState(R),this.renderCursor(A),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var m,b;this.accessibilityManager.setDetails({offset:{left:(m=this.props.margin.left)!==null&&m!==void 0?m:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(w){gl([We(w.children,dt)],[We(this.props.children,dt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=We(this.props.children,dt);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,m=O.getBoundingClientRect(),b=ZS(m),_={chartX:Math.round(w.pageX-b.left),chartY:Math.round(w.pageY-b.top)},A=m.width/O.offsetWidth||1,T=this.inRange(_.chartX,_.chartY,A);if(!T)return null;var M=this.state,P=M.xAxisMap,E=M.yAxisMap,j=this.getTooltipEventType(),C=Bb(this.state,this.props.data,this.props.layout,T);if(j!=="axis"&&P&&E){var $=Mt(P).scale,k=Mt(E).scale,R=$&&$.invert?$.invert(_.chartX):null,L=k&&k.invert?k.invert(_.chartY):null;return I(I({},_),{},{xValue:R,yValue:L},C)}return C?I(I({},_),C):null}},{key:"inRange",value:function(w,O){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,_=w/m,A=O/m;if(b==="horizontal"||b==="vertical"){var T=this.state.offset,M=_>=T.left&&_<=T.left+T.width&&A>=T.top&&A<=T.top+T.height;return M?{x:_,y:A}:null}var P=this.state,E=P.angleAxisMap,j=P.radiusAxisMap;if(E&&j){var C=Mt(E);return Wm({x:_,y:A},C)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),m=We(w,dt),b={};m&&O==="axis"&&(m.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=$i(this.props,this.handleOuterEvent);return I(I({},_),b)}},{key:"addListener",value:function(){pl.on(dl,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){pl.removeListener(dl,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,m){for(var b=this.state.formattedGraphicalItems,_=0,A=b.length;_t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},r=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),v=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=n.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:s,iconNode:k,...h},i)=>n.createElement("svg",{ref:i,...m,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:r("lucide",y),...!s&&!v(h)&&{"aria-hidden":"true"},...h},[...k.map(([l,p])=>n.createElement(l,p)),...Array.isArray(s)?s:[s]]));const e=(t,a)=>{const c=n.forwardRef(({className:o,...y},s)=>n.createElement(x,{ref:s,iconNode:a,className:r(`lucide-${_(d(t))}`,`lucide-${t}`,o),...y}));return c.displayName=d(t),c};const u=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],T1=e("activity",u);const g=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],F1=e("arrow-left",g);const $=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],O1=e("arrow-right",$);const N=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],I1=e("ban",N);const f=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],K1=e("book-open",f);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],W1=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Q1=e("boxes",z);const C=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],X1=e("calendar",C);const q=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],G1=e("chart-column",q);const b=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],J1=e("check",b);const j=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Y1=e("chevron-down",j);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],e2=e("chevron-left",A);const V=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],a2=e("chevron-right",V);const H=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],t2=e("chevron-up",H);const L=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],c2=e("chevrons-left",L);const S=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],o2=e("chevrons-right",S);const P=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],s2=e("chevrons-up-down",P);const U=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],n2=e("circle-alert",U);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],y2=e("circle-check",R);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],h2=e("circle-question-mark",E);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],d2=e("circle-user",B);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],r2=e("circle-x",Z);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],k2=e("circle",D);const T=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],i2=e("clock",T);const F=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],l2=e("copy",F);const O=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],p2=e("database",O);const I=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],_2=e("dollar-sign",I);const K=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],M2=e("download",K);const W=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],v2=e("external-link",W);const Q=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],m2=e("eye-off",Q);const X=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],x2=e("eye",X);const G=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],u2=e("file-search",G);const J=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],g2=e("file-text",J);const Y=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],$2=e("funnel",Y);const e1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],N2=e("hash",e1);const a1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],f2=e("house",a1);const t1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],w2=e("info",t1);const c1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],z2=e("key",c1);const o1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],C2=e("loader-circle",o1);const s1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],q2=e("lock",s1);const n1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],b2=e("log-out",n1);const y1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],j2=e("menu",y1);const h1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],A2=e("message-square",h1);const d1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],V2=e("moon",d1);const r1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],H2=e("package",r1);const k1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],L2=e("palette",k1);const i1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],S2=e("pause",i1);const l1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],P2=e("pencil",l1);const p1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],U2=e("play",p1);const _1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],R2=e("plus",_1);const M1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],E2=e("power",M1);const v1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B2=e("refresh-cw",v1);const m1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Z2=e("rotate-ccw",m1);const x1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],D2=e("rotate-cw",x1);const u1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],T2=e("save",u1);const g1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F2=e("search",g1);const $1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],O2=e("server",$1);const N1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],I2=e("settings-2",N1);const f1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],K2=e("settings",f1);const w1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],W2=e("shield",w1);const z1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],Q2=e("skip-forward",z1);const C1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],X2=e("sliders-vertical",C1);const q1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],G2=e("smile",q1);const b1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],J2=e("sparkles",b1);const j1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Y2=e("square-pen",j1);const A1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],e0=e("star",A1);const V1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],a0=e("sun",V1);const H1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],t0=e("terminal",H1);const L1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],c0=e("trash-2",L1);const S1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],o0=e("trending-up",S1);const P1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],s0=e("triangle-alert",P1);const U1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],n0=e("upload",U1);const R1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],y0=e("user",R1);const E1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],h0=e("users",E1);const B1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],d0=e("x",B1);const Z1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],r0=e("zap",Z1);export{M2 as $,T1 as A,W1 as B,i2 as C,_2 as D,m2 as E,g2 as F,c0 as G,f2 as H,w2 as I,u2 as J,z2 as K,q2 as L,A2 as M,P2 as N,c2 as O,L2 as P,e2 as Q,B2 as R,W2 as S,o0 as T,y0 as U,a2 as V,o2 as W,d0 as X,s2 as Y,r0 as Z,n0 as _,p2 as a,$2 as a0,Y2 as a1,I1 as a2,N2 as a3,h0 as a4,X1 as a5,S2 as a6,U2 as a7,I2 as a8,e0 as a9,v2 as aa,H2 as ab,O2 as ac,Q1 as ad,d2 as ae,G1 as af,k2 as ag,X2 as ah,j2 as ai,K1 as aj,b2 as ak,D2 as al,K2 as b,s0 as c,J1 as d,l2 as e,x2 as f,y2 as g,r2 as h,Z2 as i,a0 as j,V2 as k,n2 as l,h2 as m,t0 as n,J2 as o,G2 as p,Q2 as q,O1 as r,F2 as s,F1 as t,Y1 as u,t2 as v,C2 as w,T2 as x,E2 as y,R2 as z}; diff --git a/webui/dist/assets/index-B2bHZpg3.css b/webui/dist/assets/index-B2bHZpg3.css deleted file mode 100644 index 04780e74..00000000 --- a/webui/dist/assets/index-B2bHZpg3.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[250px\]{height:250px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/4{width:25%}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[1px\]{width:1px}.w-\[70px\]{width:70px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600\/20{background-color:#dc262633}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:top-auto{top:auto}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:h-\[calc\(100vh-320px\)\]{height:calc(100vh - 320px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-\[420px\]{max-width:420px}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:whitespace-normal{white-space:normal}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:h-\[calc\(100vh-400px\)\]{height:calc(100vh - 400px)}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[150px\]{width:150px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[80px\]{width:80px}.lg\:w-auto{width:auto}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-4{padding:1rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:opacity-0{opacity:0}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent} diff --git a/webui/dist/assets/index-C_Xpfn5c.css b/webui/dist/assets/index-C_Xpfn5c.css new file mode 100644 index 00000000..c53a20a4 --- /dev/null +++ b/webui/dist/assets/index-C_Xpfn5c.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[250px\]{height:250px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/4{width:25%}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[1px\]{width:1px}.w-\[70px\]{width:70px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:top-auto{top:auto}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:h-\[calc\(100vh-320px\)\]{height:calc(100vh - 320px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-\[420px\]{max-width:420px}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:whitespace-normal{white-space:normal}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:h-\[calc\(100vh-400px\)\]{height:calc(100vh - 400px)}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[150px\]{width:150px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[80px\]{width:80px}.lg\:w-auto{width:auto}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-4{padding:1rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:opacity-0{opacity:0}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/webui/dist/assets/index-_H5_gB__.js b/webui/dist/assets/index-_H5_gB__.js deleted file mode 100644 index 33578d16..00000000 --- a/webui/dist/assets/index-_H5_gB__.js +++ /dev/null @@ -1,157 +0,0 @@ -function UV(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var xp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b0={exports:{}},Ud={};var zk;function HV(){if(zk)return Ud;zk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Ud.Fragment=t,Ud.jsx=n,Ud.jsxs=n,Ud}var qk;function WV(){return qk||(qk=1,b0.exports=HV()),b0.exports}var i=WV(),w0={exports:{}},Ve={};var Fk;function VV(){if(Fk)return Ve;Fk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function x($){return $===null||typeof $!="object"?null:($=g&&$[g]||$["@@iterator"],typeof $=="function"?$:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function N($,B,Y){this.props=$,this.context=B,this.refs=w,this.updater=Y||j}N.prototype.isReactComponent={},N.prototype.setState=function($,B){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,$,B,"setState")},N.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function A(){}A.prototype=N.prototype;function E($,B,Y){this.props=$,this.context=B,this.refs=w,this.updater=Y||j}var T=E.prototype=new A;T.constructor=E,b(T,N.prototype),T.isPureReactComponent=!0;var C=Array.isArray;function k(){}var O={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function I($,B,Y){var ne=Y.ref;return{$$typeof:e,type:$,key:B,ref:ne!==void 0?ne:null,props:Y}}function z($,B){return I($.type,B,$.props)}function D($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function H($){var B={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(Y){return B[Y]})}var V=/\/+/g;function F($,B){return typeof $=="object"&&$!==null&&$.key!=null?H(""+$.key):B.toString(36)}function G($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(k,k):($.status="pending",$.then(function(B){$.status==="pending"&&($.status="fulfilled",$.value=B)},function(B){$.status==="pending"&&($.status="rejected",$.reason=B)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function L($,B,Y,ne,oe){var xe=typeof $;(xe==="undefined"||xe==="boolean")&&($=null);var ee=!1;if($===null)ee=!0;else switch(xe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch($.$$typeof){case e:case t:ee=!0;break;case m:return ee=$._init,L(ee($._payload),B,Y,ne,oe)}}if(ee)return oe=oe($),ee=ne===""?"."+F($,0):ne,C(oe)?(Y="",ee!=null&&(Y=ee.replace(V,"$&/")+"/"),L(oe,B,Y,"",function(pe){return pe})):oe!=null&&(D(oe)&&(oe=z(oe,Y+(oe.key==null||$&&$.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+ee)),B.push(oe)),1;ee=0;var ae=ne===""?".":ne+":";if(C($))for(var Z=0;Z<$.length;Z++)ne=$[Z],xe=ae+F(ne,Z),ee+=L(ne,B,Y,xe,oe);else if(Z=x($),typeof Z=="function")for($=Z.call($),Z=0;!(ne=$.next()).done;)ne=ne.value,xe=ae+F(ne,Z++),ee+=L(ne,B,Y,xe,oe);else if(xe==="object"){if(typeof $.then=="function")return L(G($),B,Y,ne,oe);throw B=String($),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ee}function R($,B,Y){if($==null)return $;var ne=[],oe=0;return L($,ne,"","",function(xe){return B.call(Y,xe,oe++)}),ne}function U($){if($._status===-1){var B=$._result;B=B(),B.then(function(Y){($._status===0||$._status===-1)&&($._status=1,$._result=Y)},function(Y){($._status===0||$._status===-1)&&($._status=2,$._result=Y)}),$._status===-1&&($._status=0,$._result=B)}if($._status===1)return $._result.default;throw $._result}var K=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},te={map:R,forEach:function($,B,Y){R($,function(){B.apply(this,arguments)},Y)},count:function($){var B=0;return R($,function(){B++}),B},toArray:function($){return R($,function(B){return B})||[]},only:function($){if(!D($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return Ve.Activity=p,Ve.Children=te,Ve.Component=N,Ve.Fragment=n,Ve.Profiler=a,Ve.PureComponent=E,Ve.StrictMode=r,Ve.Suspense=d,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ve.__COMPILER_RUNTIME={__proto__:null,c:function($){return O.H.useMemoCache($)}},Ve.cache=function($){return function(){return $.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function($,B,Y){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var ne=b({},$.props),oe=$.key;if(B!=null)for(xe in B.key!==void 0&&(oe=""+B.key),B)!M.call(B,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&B.ref===void 0||(ne[xe]=B[xe]);var xe=arguments.length-2;if(xe===1)ne.children=Y;else if(1>>1,te=L[K];if(0>>1;K<$;){var B=2*(K+1)-1,Y=L[B],ne=B+1,oe=L[ne];if(0>a(Y,U))nea(oe,Y)?(L[K]=oe,L[ne]=U,K=ne):(L[K]=Y,L[B]=U,K=B);else if(nea(oe,U))L[K]=oe,L[ne]=U,K=ne;else break e}}return R}function a(L,R){var U=L.sortIndex-R.sortIndex;return U!==0?U:L.id-R.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,x=!1,j=!1,b=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(L){for(var R=n(f);R!==null;){if(R.callback===null)r(f);else if(R.startTime<=L)r(f),R.sortIndex=R.expirationTime,t(d,R);else break;R=n(f)}}function C(L){if(b=!1,T(L),!j)if(n(d)!==null)j=!0,k||(k=!0,H());else{var R=n(f);R!==null&&G(C,R.startTime-L)}}var k=!1,O=-1,M=5,I=-1;function z(){return w?!0:!(e.unstable_now()-IL&&z());){var K=p.callback;if(typeof K=="function"){p.callback=null,g=p.priorityLevel;var te=K(p.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){p.callback=te,T(L),R=!0;break t}p===n(d)&&r(d),T(L)}else r(d);p=n(d)}if(p!==null)R=!0;else{var $=n(f);$!==null&&G(C,$.startTime-L),R=!1}}break e}finally{p=null,g=U,x=!1}R=void 0}}finally{R?H():k=!1}}}var H;if(typeof E=="function")H=function(){E(D)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,F=V.port2;V.port1.onmessage=D,H=function(){F.postMessage(null)}}else H=function(){N(D,0)};function G(L,R){O=N(function(){L(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125K?(L.sortIndex=U,t(f,L),n(d)===null&&L===n(f)&&(b?(A(O),O=-1):b=!0,G(C,U-K))):(L.sortIndex=te,t(d,L),j||x||(j=!0,k||(k=!0,H()))),L},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(L){var R=g;return function(){var U=g;g=R;try{return L.apply(this,arguments)}finally{g=U}}}})(_0)),_0}var Wk;function YV(){return Wk||(Wk=1,S0.exports=GV()),S0.exports}var N0={exports:{}},ir={};var Vk;function KV(){if(Vk)return ir;Vk=1;var e=wh();function t(d){var f="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),N0.exports=KV(),N0.exports}var Yk;function XV(){if(Yk)return Hd;Yk=1;var e=YV(),t=wh(),n=HL();function r(s){var c="https://react.dev/errors/"+s;if(1te||(s.current=K[te],K[te]=null,te--)}function Y(s,c){te++,K[te]=s.current,s.current=c}var ne=$(null),oe=$(null),xe=$(null),ee=$(null);function ae(s,c){switch(Y(xe,c),Y(oe,s),Y(ne,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?ck(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=ck(c),s=uk(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(ne),Y(ne,s)}function Z(){B(ne),B(oe),B(xe)}function pe(s){s.memoizedState!==null&&Y(ee,s);var c=ne.current,h=uk(c,s.type);c!==h&&(Y(oe,s),Y(ne,h))}function je(s){oe.current===s&&(B(ne),B(oe)),ee.current===s&&(B(ee),Bd._currentValue=U)}var le,Re;function _e(s){if(le===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);le=c&&c[1]||"",Re=-1)":-1S||X[v]!==se[S]){var ge=` -`+X[v].replace(" at new "," at ");return s.displayName&&ge.includes("")&&(ge=ge.replace("",s.displayName)),ge}while(1<=v&&0<=S);break}}}finally{me=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?_e(h):""}function Le(s,c){switch(s.tag){case 26:case 27:case 5:return _e(s.type);case 16:return _e("Lazy");case 13:return s.child!==c&&c!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ve(s.type,!1);case 11:return ve(s.type.render,!1);case 1:return ve(s.type,!0);case 31:return _e("Activity");default:return""}}function It(s){try{var c="",h=null;do c+=Le(s,h),h=s,s=s.return;while(s);return c}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var Cn=Object.prototype.hasOwnProperty,vr=e.unstable_scheduleCallback,rr=e.unstable_cancelCallback,gr=e.unstable_shouldYield,ct=e.unstable_requestPaint,rt=e.unstable_now,$n=e.unstable_getCurrentPriorityLevel,gs=e.unstable_ImmediatePriority,im=e.unstable_UserBlockingPriority,Rl=e.unstable_NormalPriority,ax=e.unstable_LowPriority,om=e.unstable_IdlePriority,ix=e.log,ox=e.unstable_setDisableYieldValue,ys=null,yr=null;function Ka(s){if(typeof ix=="function"&&ox(s),yr&&typeof yr.setStrictMode=="function")try{yr.setStrictMode(ys,s)}catch{}}var ar=Math.clz32?Math.clz32:zt,sx=Math.log,et=Math.LN2;function zt(s){return s>>>=0,s===0?32:31-(sx(s)/et|0)|0}var He=256,gt=262144,In=4194304;function tt(s){var c=s&42;if(c!==0)return c;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Dl(s,c,h){var v=s.pendingLanes;if(v===0)return 0;var S=0,_=s.suspendedLanes,P=s.pingedLanes;s=s.warmLanes;var q=v&134217727;return q!==0?(v=q&~_,v!==0?S=tt(v):(P&=q,P!==0?S=tt(P):h||(h=q&~s,h!==0&&(S=tt(h))))):(q=v&~_,q!==0?S=tt(q):P!==0?S=tt(P):h||(h=v&~s,h!==0&&(S=tt(h)))),S===0?0:c!==0&&c!==S&&(c&_)===0&&(_=S&-S,h=c&-c,_>=h||_===32&&(h&4194048)!==0)?c:S}function xs(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function lx(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $l(){var s=In;return In<<=1,(In&62914560)===0&&(In=4194304),s}function bs(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Ju(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function kW(s,c,h,v,S,_){var P=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var q=s.entanglements,X=s.expirationTimes,se=s.hiddenUpdates;for(h=P&~h;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var IW=/[\n"\\]/g;function la(s){return s.replace(IW,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function mx(s,c,h,v,S,_,P,q){s.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.type=P:s.removeAttribute("type"),c!=null?P==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+sa(c)):s.value!==""+sa(c)&&(s.value=""+sa(c)):P!=="submit"&&P!=="reset"||s.removeAttribute("value"),c!=null?px(s,P,sa(c)):h!=null?px(s,P,sa(h)):v!=null&&s.removeAttribute("value"),S==null&&_!=null&&(s.defaultChecked=!!_),S!=null&&(s.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.name=""+sa(q):s.removeAttribute("name")}function rA(s,c,h,v,S,_,P,q){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),c!=null||h!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){hx(s);return}h=h!=null?""+sa(h):"",c=c!=null?""+sa(c):h,q||c===s.value||(s.value=c),s.defaultValue=c}v=v??S,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=q?s.checked:!!v,s.defaultChecked=!!v,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(s.name=P),hx(s)}function px(s,c,h){c==="number"&&cm(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Fl(s,c,h,v){if(s=s.options,c){c={};for(var S=0;S"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bx=!1;if(Ci)try{var rd={};Object.defineProperty(rd,"passive",{get:function(){bx=!0}}),window.addEventListener("test",rd,rd),window.removeEventListener("test",rd,rd)}catch{bx=!1}var po=null,wx=null,dm=null;function uA(){if(dm)return dm;var s,c=wx,h=c.length,v,S="value"in po?po.value:po.textContent,_=S.length;for(s=0;s=od),vA=" ",gA=!1;function yA(s,c){switch(s){case"keyup":return d7.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xA(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Vl=!1;function h7(s,c){switch(s){case"compositionend":return xA(c);case"keypress":return c.which!==32?null:(gA=!0,vA);case"textInput":return s=c.data,s===vA&&gA?null:s;default:return null}}function m7(s,c){if(Vl)return s==="compositionend"||!Cx&&yA(s,c)?(s=uA(),dm=wx=po=null,Vl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-s};s=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=OA(h)}}function AA(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?AA(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function TA(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=cm(s.document);c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=cm(s.document)}return c}function Ax(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var j7=Ci&&"documentMode"in document&&11>=document.documentMode,Gl=null,Tx=null,ud=null,kx=!1;function kA(s,c,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;kx||Gl==null||Gl!==cm(v)||(v=Gl,"selectionStart"in v&&Ax(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),ud&&cd(ud,v)||(ud=v,v=ap(Tx,"onSelect"),0>=P,S-=P,Xa=1<<32-ar(c)+S|h<Je?(dt=De,De=null):dt=De.sibling;var mt=ce(re,De,ie[Je],be);if(mt===null){De===null&&(De=dt);break}s&&De&&mt.alternate===null&&c(re,De),Q=_(mt,Q,Je),ht===null?Ie=mt:ht.sibling=mt,ht=mt,De=dt}if(Je===ie.length)return h(re,De),ft&&Ei(re,Je),Ie;if(De===null){for(;JeJe?(dt=De,De=null):dt=De.sibling;var Io=ce(re,De,mt.value,be);if(Io===null){De===null&&(De=dt);break}s&&De&&Io.alternate===null&&c(re,De),Q=_(Io,Q,Je),ht===null?Ie=Io:ht.sibling=Io,ht=Io,De=dt}if(mt.done)return h(re,De),ft&&Ei(re,Je),Ie;if(De===null){for(;!mt.done;Je++,mt=ie.next())mt=we(re,mt.value,be),mt!==null&&(Q=_(mt,Q,Je),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return ft&&Ei(re,Je),Ie}for(De=v(De);!mt.done;Je++,mt=ie.next())mt=he(De,re,Je,mt.value,be),mt!==null&&(s&&mt.alternate!==null&&De.delete(mt.key===null?Je:mt.key),Q=_(mt,Q,Je),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return s&&De.forEach(function(FV){return c(re,FV)}),ft&&Ei(re,Je),Ie}function Pt(re,Q,ie,be){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Ie=ie.key;Q!==null;){if(Q.key===Ie){if(Ie=ie.type,Ie===b){if(Q.tag===7){h(re,Q.sibling),be=S(Q,ie.props.children),be.return=re,re=be;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===M&&ks(Ie)===Q.type){h(re,Q.sibling),be=S(Q,ie.props),vd(be,ie),be.return=re,re=be;break e}h(re,Q);break}else c(re,Q);Q=Q.sibling}ie.type===b?(be=Cs(ie.props.children,re.mode,be,ie.key),be.return=re,re=be):(be=wm(ie.type,ie.key,ie.props,null,re.mode,be),vd(be,ie),be.return=re,re=be)}return P(re);case j:e:{for(Ie=ie.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===ie.containerInfo&&Q.stateNode.implementation===ie.implementation){h(re,Q.sibling),be=S(Q,ie.children||[]),be.return=re,re=be;break e}else{h(re,Q);break}else c(re,Q);Q=Q.sibling}be=Lx(ie,re.mode,be),be.return=re,re=be}return P(re);case M:return ie=ks(ie),Pt(re,Q,ie,be)}if(G(ie))return Ae(re,Q,ie,be);if(H(ie)){if(Ie=H(ie),typeof Ie!="function")throw Error(r(150));return ie=Ie.call(ie),ze(re,Q,ie,be)}if(typeof ie.then=="function")return Pt(re,Q,Em(ie),be);if(ie.$$typeof===E)return Pt(re,Q,_m(re,ie),be);Am(re,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Q!==null&&Q.tag===6?(h(re,Q.sibling),be=S(Q,ie),be.return=re,re=be):(h(re,Q),be=Ix(ie,re.mode,be),be.return=re,re=be),P(re)):h(re,Q)}return function(re,Q,ie,be){try{pd=0;var Ie=Pt(re,Q,ie,be);return ac=null,Ie}catch(De){if(De===rc||De===Cm)throw De;var ht=qr(29,De,null,re.mode);return ht.lanes=be,ht.return=re,ht}finally{}}}var Ps=eT(!0),tT=eT(!1),bo=!1;function Xx(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zx(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function wo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function jo(s,c,h){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(yt&2)!==0){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,c=bm(s),LA(s,null,h),c}return xm(s,v,c,h),bm(s)}function gd(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var v=c.lanes;v&=s.pendingLanes,h|=v,c.lanes=h,VE(s,h)}}function Qx(s,c){var h=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var S=null,_=null;if(h=h.firstBaseUpdate,h!==null){do{var P={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};_===null?S=_=P:_=_.next=P,h=h.next}while(h!==null);_===null?S=_=c:_=_.next=c}else S=_=c;h={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:_,shared:v.shared,callbacks:v.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}var Jx=!1;function yd(){if(Jx){var s=nc;if(s!==null)throw s}}function xd(s,c,h,v){Jx=!1;var S=s.updateQueue;bo=!1;var _=S.firstBaseUpdate,P=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var X=q,se=X.next;X.next=null,P===null?_=se:P.next=se,P=X;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,q=ge.lastBaseUpdate,q!==P&&(q===null?ge.firstBaseUpdate=se:q.next=se,ge.lastBaseUpdate=X))}if(_!==null){var we=S.baseState;P=0,ge=se=X=null,q=_;do{var ce=q.lane&-536870913,he=ce!==q.lane;if(he?(ut&ce)===ce:(v&ce)===ce){ce!==0&&ce===tc&&(Jx=!0),ge!==null&&(ge=ge.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ae=s,ze=q;ce=c;var Pt=h;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){we=Ae.call(Pt,we,ce);break e}we=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ce=typeof Ae=="function"?Ae.call(Pt,we,ce):Ae,ce==null)break e;we=p({},we,ce);break e;case 2:bo=!0}}ce=q.callback,ce!==null&&(s.flags|=64,he&&(s.flags|=8192),he=S.callbacks,he===null?S.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ge===null?(se=ge=he,X=we):ge=ge.next=he,P|=ce;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;he=q,q=he.next,he.next=null,S.lastBaseUpdate=he,S.shared.pending=null}}while(!0);ge===null&&(X=we),S.baseState=X,S.firstBaseUpdate=se,S.lastBaseUpdate=ge,_===null&&(S.shared.lanes=0),Oo|=P,s.lanes=P,s.memoizedState=we}}function nT(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function rT(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s_?_:8;var P=L.T,q={};L.T=q,yb(s,!1,c,h);try{var X=S(),se=L.S;if(se!==null&&se(q,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=k7(X,v);jd(s,c,ge,Vr(s))}else jd(s,c,v,Vr(s))}catch(we){jd(s,c,{then:function(){},status:"rejected",reason:we},Vr())}finally{R.p=_,P!==null&&q.types!==null&&(P.types=q.types),L.T=P}}function I7(){}function vb(s,c,h,v){if(s.tag!==5)throw Error(r(476));var S=DT(s).queue;RT(s,S,c,U,h===null?I7:function(){return $T(s),h(v)})}function DT(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:U},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function $T(s){var c=DT(s);c.next===null&&(c=s.alternate.memoizedState),jd(s,c.next.queue,{},Vr())}function gb(){return Xn(Bd)}function IT(){return un().memoizedState}function LT(){return un().memoizedState}function L7(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=Vr();s=wo(h);var v=jo(c,s,h);v!==null&&(Tr(v,c,h),gd(v,c,h)),c={cache:Vx()},s.payload=c;return}c=c.return}}function B7(s,c,h){var v=Vr();h={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Bm(s)?zT(c,h):(h=Dx(s,c,h,v),h!==null&&(Tr(h,s,v),qT(h,c,v)))}function BT(s,c,h){var v=Vr();jd(s,c,h,v)}function jd(s,c,h,v){var S={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Bm(s))zT(c,S);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var P=c.lastRenderedState,q=_(P,h);if(S.hasEagerState=!0,S.eagerState=q,zr(q,P))return xm(s,c,S,0),Lt===null&&ym(),!1}catch{}finally{}if(h=Dx(s,c,S,v),h!==null)return Tr(h,s,v),qT(h,c,v),!0}return!1}function yb(s,c,h,v){if(v={lane:2,revertLane:Xb(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Bm(s)){if(c)throw Error(r(479))}else c=Dx(s,h,v,2),c!==null&&Tr(c,s,2)}function Bm(s){var c=s.alternate;return s===Ke||c!==null&&c===Ke}function zT(s,c){oc=Mm=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function qT(s,c,h){if((h&4194048)!==0){var v=c.lanes;v&=s.pendingLanes,h|=v,c.lanes=h,VE(s,h)}}var Sd={readContext:Xn,use:Dm,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useLayoutEffect:rn,useInsertionEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useSyncExternalStore:rn,useId:rn,useHostTransitionStatus:rn,useFormState:rn,useActionState:rn,useOptimistic:rn,useMemoCache:rn,useCacheRefresh:rn};Sd.useEffectEvent=rn;var FT={readContext:Xn,use:Dm,useCallback:function(s,c){return xr().memoizedState=[s,c===void 0?null:c],s},useContext:Xn,useEffect:NT,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,Im(4194308,4,AT.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Im(4194308,4,s,c)},useInsertionEffect:function(s,c){Im(4,2,s,c)},useMemo:function(s,c){var h=xr();c=c===void 0?null:c;var v=s();if(Rs){Ka(!0);try{s()}finally{Ka(!1)}}return h.memoizedState=[v,c],v},useReducer:function(s,c,h){var v=xr();if(h!==void 0){var S=h(c);if(Rs){Ka(!0);try{h(c)}finally{Ka(!1)}}}else S=c;return v.memoizedState=v.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},v.queue=s,s=s.dispatch=B7.bind(null,Ke,s),[v.memoizedState,s]},useRef:function(s){var c=xr();return s={current:s},c.memoizedState=s},useState:function(s){s=db(s);var c=s.queue,h=BT.bind(null,Ke,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:mb,useDeferredValue:function(s,c){var h=xr();return pb(h,s,c)},useTransition:function(){var s=db(!1);return s=RT.bind(null,Ke,s.queue,!0,!1),xr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var v=Ke,S=xr();if(ft){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Lt===null)throw Error(r(349));(ut&127)!==0||cT(v,c,h)}S.memoizedState=h;var _={value:h,getSnapshot:c};return S.queue=_,NT(dT.bind(null,v,_,s),[s]),v.flags|=2048,lc(9,{destroy:void 0},uT.bind(null,v,_,h,c),null),h},useId:function(){var s=xr(),c=Lt.identifierPrefix;if(ft){var h=Za,v=Xa;h=(v&~(1<<32-ar(v)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Pm++,0<\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof v.is=="string"?P.createElement("select",{is:v.is}):P.createElement("select"),v.multiple?_.multiple=!0:v.size&&(_.size=v.size);break;default:_=typeof v.is=="string"?P.createElement(S,{is:v.is}):P.createElement(S)}}_[Yn]=c,_[_r]=v;e:for(P=c.child;P!==null;){if(P.tag===5||P.tag===6)_.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===c)break e;for(;P.sibling===null;){if(P.return===null||P.return===c)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}c.stateNode=_;e:switch(Qn(_,S,v),S){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Ri(c)}}return Kt(c),Mb(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==v&&Ri(c);else{if(typeof v!="string"&&c.stateNode===null)throw Error(r(166));if(s=xe.current,Jl(c)){if(s=c.stateNode,h=c.memoizedProps,v=null,S=Kn,S!==null)switch(S.tag){case 27:case 5:v=S.memoizedProps}s[Yn]=c,s=!!(s.nodeValue===h||v!==null&&v.suppressHydrationWarning===!0||sk(s.nodeValue,h)),s||yo(c,!0)}else s=ip(s).createTextNode(v),s[Yn]=c,c.stateNode=s}return Kt(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(v=Jl(c),h!==null){if(s===null){if(!v)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Yn]=c}else Os(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Kt(c),s=!1}else h=Fx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(Ur(c),c):(Ur(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Kt(c),null;case 13:if(v=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=Jl(c),v!==null&&v.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Yn]=c}else Os(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Kt(c),S=!1}else S=Fx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=S),S=!0;if(!S)return c.flags&256?(Ur(c),c):(Ur(c),null)}return Ur(c),(c.flags&128)!==0?(c.lanes=h,c):(h=v!==null,s=s!==null&&s.memoizedState!==null,h&&(v=c.child,S=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(S=v.alternate.memoizedState.cachePool.pool),_=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(_=v.memoizedState.cachePool.pool),_!==S&&(v.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),Hm(c,c.updateQueue),Kt(c),null);case 4:return Z(),s===null&&e0(c.stateNode.containerInfo),Kt(c),null;case 10:return Ti(c.type),Kt(c),null;case 19:if(B(cn),v=c.memoizedState,v===null)return Kt(c),null;if(S=(c.flags&128)!==0,_=v.rendering,_===null)if(S)Nd(v,!1);else{if(an!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(_=km(s),_!==null){for(c.flags|=128,Nd(v,!1),s=_.updateQueue,c.updateQueue=s,Hm(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)BA(h,s),h=h.sibling;return Y(cn,cn.current&1|2),ft&&Ei(c,v.treeForkCount),c.child}s=s.sibling}v.tail!==null&&rt()>Km&&(c.flags|=128,S=!0,Nd(v,!1),c.lanes=4194304)}else{if(!S)if(s=km(_),s!==null){if(c.flags|=128,S=!0,s=s.updateQueue,c.updateQueue=s,Hm(c,s),Nd(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!ft)return Kt(c),null}else 2*rt()-v.renderingStartTime>Km&&h!==536870912&&(c.flags|=128,S=!0,Nd(v,!1),c.lanes=4194304);v.isBackwards?(_.sibling=c.child,c.child=_):(s=v.last,s!==null?s.sibling=_:c.child=_,v.last=_)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=rt(),s.sibling=null,h=cn.current,Y(cn,S?h&1|2:h&1),ft&&Ei(c,v.treeForkCount),s):(Kt(c),null);case 22:case 23:return Ur(c),tb(),v=c.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(c.flags|=8192):v&&(c.flags|=8192),v?(h&536870912)!==0&&(c.flags&128)===0&&(Kt(c),c.subtreeFlags&6&&(c.flags|=8192)):Kt(c),h=c.updateQueue,h!==null&&Hm(c,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==h&&(c.flags|=2048),s!==null&&B(Ts),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),Ti(dn),Kt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function H7(s,c){switch(zx(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ti(dn),Z(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return je(c),null;case 31:if(c.memoizedState!==null){if(Ur(c),c.alternate===null)throw Error(r(340));Os()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Ur(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Os()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return B(cn),null;case 4:return Z(),null;case 10:return Ti(c.type),null;case 22:case 23:return Ur(c),tb(),s!==null&&B(Ts),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Ti(dn),null;case 25:return null;default:return null}}function f2(s,c){switch(zx(c),c.tag){case 3:Ti(dn),Z();break;case 26:case 27:case 5:je(c);break;case 4:Z();break;case 31:c.memoizedState!==null&&Ur(c);break;case 13:Ur(c);break;case 19:B(cn);break;case 10:Ti(c.type);break;case 22:case 23:Ur(c),tb(),s!==null&&B(Ts);break;case 24:Ti(dn)}}function Cd(s,c){try{var h=c.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var S=v.next;h=S;do{if((h.tag&s)===s){v=void 0;var _=h.create,P=h.inst;v=_(),P.destroy=v}h=h.next}while(h!==S)}}catch(q){Nt(c,c.return,q)}}function No(s,c,h){try{var v=c.updateQueue,S=v!==null?v.lastEffect:null;if(S!==null){var _=S.next;v=_;do{if((v.tag&s)===s){var P=v.inst,q=P.destroy;if(q!==void 0){P.destroy=void 0,S=c;var X=h,se=q;try{se()}catch(ge){Nt(S,X,ge)}}}v=v.next}while(v!==_)}}catch(ge){Nt(c,c.return,ge)}}function h2(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{rT(c,h)}catch(v){Nt(s,s.return,v)}}}function m2(s,c,h){h.props=Ds(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(v){Nt(s,c,v)}}function Od(s,c){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof h=="function"?s.refCleanup=h(v):h.current=v}}catch(S){Nt(s,c,S)}}function Qa(s,c){var h=s.ref,v=s.refCleanup;if(h!==null)if(typeof v=="function")try{v()}catch(S){Nt(s,c,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){Nt(s,c,S)}else h.current=null}function p2(s){var c=s.type,h=s.memoizedProps,v=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&v.focus();break e;case"img":h.src?v.src=h.src:h.srcSet&&(v.srcset=h.srcSet)}}catch(S){Nt(s,s.return,S)}}function Pb(s,c,h){try{var v=s.stateNode;fV(v,s.type,h,c),v[_r]=c}catch(S){Nt(s,s.return,S)}}function v2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Mo(s.type)||s.tag===4}function Rb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||v2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Mo(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Db(s,c,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(s),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=Ni));else if(v!==4&&(v===27&&Mo(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(Db(s,c,h),s=s.sibling;s!==null;)Db(s,c,h),s=s.sibling}function Wm(s,c,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(v!==4&&(v===27&&Mo(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Wm(s,c,h),s=s.sibling;s!==null;)Wm(s,c,h),s=s.sibling}function g2(s){var c=s.stateNode,h=s.memoizedProps;try{for(var v=s.type,S=c.attributes;S.length;)c.removeAttributeNode(S[0]);Qn(c,v,h),c[Yn]=s,c[_r]=h}catch(_){Nt(s,s.return,_)}}var Di=!1,mn=!1,$b=!1,y2=typeof WeakSet=="function"?WeakSet:Set,Bn=null;function W7(s,c){if(s=s.containerInfo,r0=fp,s=TA(s),Ax(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var S=v.anchorOffset,_=v.focusNode;v=v.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var P=0,q=-1,X=-1,se=0,ge=0,we=s,ce=null;t:for(;;){for(var he;we!==h||S!==0&&we.nodeType!==3||(q=P+S),we!==_||v!==0&&we.nodeType!==3||(X=P+v),we.nodeType===3&&(P+=we.nodeValue.length),(he=we.firstChild)!==null;)ce=we,we=he;for(;;){if(we===s)break t;if(ce===h&&++se===S&&(q=P),ce===_&&++ge===v&&(X=P),(he=we.nextSibling)!==null)break;we=ce,ce=we.parentNode}we=he}h=q===-1||X===-1?null:{start:q,end:X}}else h=null}h=h||{start:0,end:0}}else h=null;for(a0={focusedElem:s,selectionRange:h},fp=!1,Bn=c;Bn!==null;)if(c=Bn,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Bn=s;else for(;Bn!==null;){switch(c=Bn,_=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h title"))),Qn(_,v,h),_[Yn]=s,Ln(_),v=_;break e;case"link":var P=_k("link","href",S).get(v+(h.href||""));if(P){for(var q=0;qPt&&(P=Pt,Pt=ze,ze=P);var re=EA(q,ze),Q=EA(q,Pt);if(re&&Q&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==Q.node||he.focusOffset!==Q.offset)){var ie=we.createRange();ie.setStart(re.node,re.offset),he.removeAllRanges(),ze>Pt?(he.addRange(ie),he.extend(Q.node,Q.offset)):(ie.setEnd(Q.node,Q.offset),he.addRange(ie))}}}}for(we=[],he=q;he=he.parentNode;)he.nodeType===1&&we.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;qh?32:h,L.T=null,h=Ub,Ub=null;var _=Ao,P=zi;if(On=0,hc=Ao=null,zi=0,(yt&6)!==0)throw Error(r(331));var q=yt;if(yt|=4,A2(_.current),C2(_,_.current,P,h),yt=q,Pd(0,!1),yr&&typeof yr.onPostCommitFiberRoot=="function")try{yr.onPostCommitFiberRoot(ys,_)}catch{}return!0}finally{R.p=S,L.T=v,G2(s,c)}}function K2(s,c,h){c=ua(h,c),c=jb(s.stateNode,c,2),s=jo(s,c,2),s!==null&&(Ju(s,2),Ja(s))}function Nt(s,c,h){if(s.tag===3)K2(s,s,h);else for(;c!==null;){if(c.tag===3){K2(c,s,h);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Eo===null||!Eo.has(v))){s=ua(h,s),h=XT(2),v=jo(c,h,2),v!==null&&(ZT(h,v,c,s),Ju(v,2),Ja(v));break}}c=c.return}}function Gb(s,c,h){var v=s.pingCache;if(v===null){v=s.pingCache=new Y7;var S=new Set;v.set(c,S)}else S=v.get(c),S===void 0&&(S=new Set,v.set(c,S));S.has(h)||(Bb=!0,S.add(h),s=J7.bind(null,s,c,h),c.then(s,s))}function J7(s,c,h){var v=s.pingCache;v!==null&&v.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Lt===s&&(ut&h)===h&&(an===4||an===3&&(ut&62914560)===ut&&300>rt()-Ym?(yt&2)===0&&mc(s,0):zb|=h,fc===ut&&(fc=0)),Ja(s)}function X2(s,c){c===0&&(c=$l()),s=Ns(s,c),s!==null&&(Ju(s,c),Ja(s))}function eV(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),X2(s,h)}function tV(s,c){var h=0;switch(s.tag){case 31:case 13:var v=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(c),X2(s,h)}function nV(s,c){return vr(s,c)}var tp=null,vc=null,Yb=!1,np=!1,Kb=!1,ko=0;function Ja(s){s!==vc&&s.next===null&&(vc===null?tp=vc=s:vc=vc.next=s),np=!0,Yb||(Yb=!0,aV())}function Pd(s,c){if(!Kb&&np){Kb=!0;do for(var h=!1,v=tp;v!==null;){if(s!==0){var S=v.pendingLanes;if(S===0)var _=0;else{var P=v.suspendedLanes,q=v.pingedLanes;_=(1<<31-ar(42|s)+1)-1,_&=S&~(P&~q),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(h=!0,ek(v,_))}else _=ut,_=Dl(v,v===Lt?_:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(_&3)===0||xs(v,_)||(h=!0,ek(v,_));v=v.next}while(h);Kb=!1}}function rV(){Z2()}function Z2(){np=Yb=!1;var s=0;ko!==0&&mV()&&(s=ko);for(var c=rt(),h=null,v=tp;v!==null;){var S=v.next,_=Q2(v,c);_===0?(v.next=null,h===null?tp=S:h.next=S,S===null&&(vc=h)):(h=v,(s!==0||(_&3)!==0)&&(np=!0)),v=S}On!==0&&On!==5||Pd(s),ko!==0&&(ko=0)}function Q2(s,c){for(var h=s.suspendedLanes,v=s.pingedLanes,S=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var P=31-ar(_),q=1<q)break;var ge=X.transferSize,we=X.initiatorType;ge&&lk(we)&&(X=X.responseEnd,P+=ge*(X"u"?null:document;function bk(s,c,h){var v=gc;if(v&&typeof c=="string"&&c){var S=la(c);S='link[rel="'+s+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),xk.has(S)||(xk.add(S),s={rel:s,crossOrigin:h,href:c},v.querySelector(S)===null&&(c=v.createElement("link"),Qn(c,"link",s),Ln(c),v.head.appendChild(c)))}}function SV(s){qi.D(s),bk("dns-prefetch",s,null)}function _V(s,c){qi.C(s,c),bk("preconnect",s,c)}function NV(s,c,h){qi.L(s,c,h);var v=gc;if(v&&s&&c){var S='link[rel="preload"][as="'+la(c)+'"]';c==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+la(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+la(h.imageSizes)+'"]')):S+='[href="'+la(s)+'"]';var _=S;switch(c){case"style":_=yc(s);break;case"script":_=xc(s)}va.has(_)||(s=p({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:s,as:c},h),va.set(_,s),v.querySelector(S)!==null||c==="style"&&v.querySelector(Id(_))||c==="script"&&v.querySelector(Ld(_))||(c=v.createElement("link"),Qn(c,"link",s),Ln(c),v.head.appendChild(c)))}}function CV(s,c){qi.m(s,c);var h=gc;if(h&&s){var v=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+la(v)+'"][href="'+la(s)+'"]',_=S;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=xc(s)}if(!va.has(_)&&(s=p({rel:"modulepreload",href:s},c),va.set(_,s),h.querySelector(S)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Ld(_)))return}v=h.createElement("link"),Qn(v,"link",s),Ln(v),h.head.appendChild(v)}}}function OV(s,c,h){qi.S(s,c,h);var v=gc;if(v&&s){var S=zl(v).hoistableStyles,_=yc(s);c=c||"default";var P=S.get(_);if(!P){var q={loading:0,preload:null};if(P=v.querySelector(Id(_)))q.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":c},h),(h=va.get(_))&&d0(s,h);var X=P=v.createElement("link");Ln(X),Qn(X,"link",s),X._p=new Promise(function(se,ge){X.onload=se,X.onerror=ge}),X.addEventListener("load",function(){q.loading|=1}),X.addEventListener("error",function(){q.loading|=2}),q.loading|=4,sp(P,c,v)}P={type:"stylesheet",instance:P,count:1,state:q},S.set(_,P)}}}function EV(s,c){qi.X(s,c);var h=gc;if(h&&s){var v=zl(h).hoistableScripts,S=xc(s),_=v.get(S);_||(_=h.querySelector(Ld(S)),_||(s=p({src:s,async:!0},c),(c=va.get(S))&&f0(s,c),_=h.createElement("script"),Ln(_),Qn(_,"link",s),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function AV(s,c){qi.M(s,c);var h=gc;if(h&&s){var v=zl(h).hoistableScripts,S=xc(s),_=v.get(S);_||(_=h.querySelector(Ld(S)),_||(s=p({src:s,async:!0,type:"module"},c),(c=va.get(S))&&f0(s,c),_=h.createElement("script"),Ln(_),Qn(_,"link",s),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function wk(s,c,h,v){var S=(S=xe.current)?op(S):null;if(!S)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=yc(h.href),h=zl(S).hoistableStyles,v=h.get(c),v||(v={type:"style",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=yc(h.href);var _=zl(S).hoistableStyles,P=_.get(s);if(P||(S=S.ownerDocument||S,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,P),(_=S.querySelector(Id(s)))&&!_._p&&(P.instance=_,P.state.loading=5),va.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},va.set(s,h),_||TV(S,s,h,P.state))),c&&v===null)throw Error(r(528,""));return P}if(c&&v!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=xc(h),h=zl(S).hoistableScripts,v=h.get(c),v||(v={type:"script",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function yc(s){return'href="'+la(s)+'"'}function Id(s){return'link[rel="stylesheet"]['+s+"]"}function jk(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function TV(s,c,h,v){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?v.loading=1:(c=s.createElement("link"),v.preload=c,c.addEventListener("load",function(){return v.loading|=1}),c.addEventListener("error",function(){return v.loading|=2}),Qn(c,"link",h),Ln(c),s.head.appendChild(c))}function xc(s){return'[src="'+la(s)+'"]'}function Ld(s){return"script[async]"+s}function Sk(s,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var v=s.querySelector('style[data-href~="'+la(h.href)+'"]');if(v)return c.instance=v,Ln(v),v;var S=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),Ln(v),Qn(v,"style",S),sp(v,h.precedence,s),c.instance=v;case"stylesheet":S=yc(h.href);var _=s.querySelector(Id(S));if(_)return c.state.loading|=4,c.instance=_,Ln(_),_;v=jk(h),(S=va.get(S))&&d0(v,S),_=(s.ownerDocument||s).createElement("link"),Ln(_);var P=_;return P._p=new Promise(function(q,X){P.onload=q,P.onerror=X}),Qn(_,"link",v),c.state.loading|=4,sp(_,h.precedence,s),c.instance=_;case"script":return _=xc(h.src),(S=s.querySelector(Ld(_)))?(c.instance=S,Ln(S),S):(v=h,(S=va.get(_))&&(v=p({},h),f0(v,S)),s=s.ownerDocument||s,S=s.createElement("script"),Ln(S),Qn(S,"link",v),s.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(v=c.instance,c.state.loading|=4,sp(v,h.precedence,s));return c.instance}function sp(s,c,h){for(var v=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=v.length?v[v.length-1]:null,_=S,P=0;P title"):null)}function kV(s,c,h){if(h===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function Ck(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function MV(s,c,h,v){if(h.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=yc(v.href),_=c.querySelector(Id(S));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=cp.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=_,Ln(_);return}_=c.ownerDocument||c,v=jk(v),(S=va.get(S))&&d0(v,S),_=_.createElement("link"),Ln(_);var P=_;P._p=new Promise(function(q,X){P.onload=q,P.onerror=X}),Qn(_,"link",v),h.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=cp.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var h0=0;function PV(s,c){return s.stylesheets&&s.count===0&&dp(s,s.stylesheets),0h0?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(S)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dp(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var up=null;function dp(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,up=new Map,c.forEach(RV,s),up=null,cp.call(s))}function RV(s,c){if(!(c.state.loading&4)){var h=up.get(s);if(h)var v=h.get(null);else{h=new Map,up.set(s,h);for(var S=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),j0.exports=XV(),j0.exports}var QV=ZV();const c_=new WeakMap,JV=new WeakMap,dv={current:[]};let C0=!1,gf=0;const lf=new Set,bp=new Map;function WL(e){for(const t of e){if(dv.current.includes(t))continue;dv.current.push(t),t.recompute();const n=JV.get(t);if(n)for(const r of n){const a=c_.get(r);a?.length&&WL(a)}}}function eG(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function tG(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function VL(e){if(gf>0&&!bp.has(e)&&bp.set(e,e.prevState),lf.add(e),!(gf>0)&&!C0)try{for(C0=!0;lf.size>0;){const t=Array.from(lf);lf.clear();for(const n of t){const r=bp.get(n)??n.prevState;n.prevState=r,eG(n)}for(const n of t){const r=c_.get(n);r&&(dv.current.push(n),WL(r))}for(const n of t){const r=c_.get(n);if(r)for(const a of r)tG(a)}}}finally{C0=!1,dv.current=[],bp.clear()}}function yf(e){gf++;try{e()}finally{if(gf--,gf===0){const t=lf.values().next().value;t&&VL(t)}}}function nG(e){return typeof e=="function"}class rG{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var a,o;this.listeners.add(r);const l=(o=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:o.call(a,r,this);return()=>{this.listeners.delete(r),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,a;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):nG(t)?this.state=t(this.prevState):this.state=t,(a=(r=this.options)==null?void 0:r.onUpdate)==null||a.call(r),VL(this)}}const Go="__TSR_index",Xk="popstate",Zk="beforeunload";function aG(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},a=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},o=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const m=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&p)for(const g of m){const x=fv(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const f=t.state[Go];u=Qk(f+1,u),o({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Go];u=Qk(f,u),o({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{o({task:()=>{e.go(l),a({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{o({task:()=>{e.back(l?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{o({task:()=>{e.forward(l?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Go]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Qk(e,t){t||(t={});const n=SC();return{...t,key:n,__TSR_key:n,[Go]:e}}function iG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let a=[];const o=()=>a,l=M=>a=M,u=(M=>M),d=(()=>fv(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const M=SC();t.history.replaceState({[Go]:0,key:M,__TSR_key:M},"")}let f=d(),m,p=!1,g=!1,x=!1,j=!1;const b=()=>f;let w,N;const A=()=>{w&&(O._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),O._ignoreSubscribers=!1,w=void 0,N=void 0,m=void 0)},E=(M,I,z)=>{const D=u(I);N||(m=f),f=fv(I,z),w={href:D,state:z,isPush:w?.isPush||M==="push"},N||(N=Promise.resolve().then(()=>A()))},T=M=>{f=d(),O.notify({type:M})},C=async()=>{if(g){g=!1;return}const M=d(),I=M.state[Go]-f.state[Go],z=I===1,D=I===-1,H=!z&&!D||p;p=!1;const V=H?"GO":D?"BACK":"FORWARD",F=H?{type:"GO",index:I}:{type:D?"BACK":"FORWARD"};if(x)x=!1;else{const G=o();if(typeof document<"u"&&G.length){for(const L of G)if(await L.blockerFn({currentLocation:f,nextLocation:M,action:V})){g=!0,t.history.go(1),O.notify(F);return}}}f=d(),O.notify(F)},k=M=>{if(j){j=!1;return}let I=!1;const z=o();if(typeof document<"u"&&z.length)for(const D of z){const H=D.enableBeforeUnload??!0;if(H===!0){I=!0;break}if(typeof H=="function"&&H()===!0){I=!0;break}}if(I)return M.preventDefault(),M.returnValue=""},O=aG({getLocation:b,getLength:()=>t.history.length,pushState:(M,I)=>E("push",M,I),replaceState:(M,I)=>E("replace",M,I),back:M=>(M&&(x=!0),j=!0,t.history.back()),forward:M=>{M&&(x=!0),j=!0,t.history.forward()},go:M=>{p=!0,t.history.go(M)},createHref:M=>u(M),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Zk,k,{capture:!0}),t.removeEventListener(Xk,C)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:o,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Zk,k,{capture:!0}),t.addEventListener(Xk,C),t.history.pushState=function(...M){const I=n.apply(t.history,M);return O._ignoreSubscribers||T("PUSH"),I},t.history.replaceState=function(...M){const I=r.apply(t.history,M);return O._ignoreSubscribers||T("REPLACE"),I},O}function fv(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),a=SC();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[Go]:0,key:a,__TSR_key:a}}}function SC(){return(Math.random()+1).toString(36).substring(7)}function u_(e){return e[e.length-1]}function oG(e){return typeof e=="function"}function Qs(e,t){return oG(e)?e(t):e}const sG=Object.prototype.hasOwnProperty;function wa(e,t){if(e===t)return e;const n=t,r=tM(e)&&tM(n);if(!r&&!(hv(e)&&hv(n)))return n;const a=r?e:Jk(e);if(!a)return n;const o=r?n:Jk(n);if(!o)return n;const l=a.length,u=o.length,d=r?new Array(u):{};let f=0;for(let m=0;m"u")return!0;const n=t.prototype;return!(!eM(n)||!n.hasOwnProperty("isPrototypeOf"))}function eM(e){return Object.prototype.toString.call(e)==="[object Object]"}function tM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Js(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,a=e.length;ra||!Js(e[l],t[l],n)))return!1;return a===o}return!1}function Qc(e){let t,n;const r=new Promise((a,o)=>{t=a,n=o});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,t(a),e?.(a)},r.reject=a=>{r.status="rejected",n(a)},r}function Yo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const lG=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function nM(e,t=lG){function n(a,o,l=0){for(let u=l;u{try{return decodeURI(u)}catch{return u}})}}if(e===""||!/%[0-9A-Fa-f]{2}/g.test(e))return e;const r=e.replaceAll(/%[0-9a-f]{2}/g,a=>a.toUpperCase());return n(r,t)}var cG="Invariant failed";function ur(e,t){if(!e)throw new Error(cG)}const di=0,ll=1,Jc=2,eu=3;function Qi(e){return _C(e.filter(t=>t!==void 0).join("/"))}function _C(e){return e.replace(/\/{2,}/g,"/")}function NC(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ko(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Qp(e){return Ko(NC(e))}function mv(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function uG(e,t,n){return mv(e,n)===mv(t,n)}function dG(e){const{type:t,value:n}=e;if(t===di)return n;const{prefixSegment:r,suffixSegment:a}=e;if(t===ll){const o=n.substring(1);if(r&&a)return`${r}{$${o}}${a}`;if(r)return`${r}{$${o}}`;if(a)return`{$${o}}${a}`}if(t===eu){const o=n.substring(1);return r&&a?`${r}{-$${o}}${a}`:r?`${r}{-$${o}}`:a?`{-$${o}}${a}`:`{-$${o}}`}if(t===Jc){if(r&&a)return`${r}{$}${a}`;if(r)return`${r}{$}`;if(a)return`{$}${a}`}return n}function fG({base:e,to:t,trailingSlash:n="never",parseCache:r}){let a=tu(e,r).slice();const o=tu(t,r);a.length>1&&u_(a)?.value==="/"&&a.pop();for(let d=0,f=o.length;d1&&(u_(a).value==="/"?n==="never"&&a.pop():n==="always"&&a.push({type:di,value:"/"}));const l=a.map(dG);return Qi(l)}const tu=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const r=yG(e);return t?.set(e,r),r},hG=/^\$.{1,}$/,mG=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,pG=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,vG=/^\$$/,gG=/^(.*?)\{\$\}(.*)$/;function yG(e){e=_C(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:di,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>{const a=r.match(gG);if(a){const u=a[1],d=a[2];return{type:Jc,value:"$",prefixSegment:u||void 0,suffixSegment:d||void 0}}const o=r.match(pG);if(o){const u=o[1],d=o[2],f=o[3];return{type:eu,value:d,prefixSegment:u||void 0,suffixSegment:f||void 0}}const l=r.match(mG);if(l){const u=l[1],d=l[2],f=l[3];return{type:ll,value:""+d,prefixSegment:u||void 0,suffixSegment:f||void 0}}if(hG.test(r)){const u=r.substring(1);return{type:ll,value:"$"+u,prefixSegment:void 0,suffixSegment:void 0}}return vG.test(r)?{type:Jc,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:di,value:r}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:di,value:"/"})),t}function O0({path:e,params:t,decodeCharMap:n,parseCache:r}){const a=tu(e,r);function o(f){const m=t[f],p=typeof m=="string";return f==="*"||f==="_splat"?p?encodeURI(m):m:p?xG(m,n):m}let l=!1;const u={},d=Qi(a.map(f=>{if(f.type===di)return f.value;if(f.type===Jc){u._splat=t._splat,u["*"]=t._splat;const m=f.prefixSegment||"",p=f.suffixSegment||"";if(!t._splat)return l=!0,m||p?`${m}${p}`:void 0;const g=o("_splat");return`${m}${g}${p}`}if(f.type===ll){const m=f.value.substring(1);!l&&!(m in t)&&(l=!0),u[m]=t[m];const p=f.prefixSegment||"",g=f.suffixSegment||"";return`${p}${o(m)??"undefined"}${g}`}if(f.type===eu){const m=f.value.substring(1),p=f.prefixSegment||"",g=f.suffixSegment||"";return!(m in t)||t[m]==null?p||g?`${p}${g}`:void 0:(u[m]=t[m],`${p}${o(m)??""}${g}`)}return f.value}));return{usedParams:u,interpolatedPath:d,isMissingParams:l}}function xG(e,t){let n=encodeURIComponent(e);if(t)for(const[r,a]of t)n=n.replaceAll(r,a);return n}function d_(e,t,n){const r=bG(e,t,n);if(!(t.to&&!r))return r??{}}function bG(e,{to:t,fuzzy:n,caseSensitive:r},a){const o=t,l=tu(e.startsWith("/")?e:`/${e}`,a),u=tu(o.startsWith("/")?o:`/${o}`,a),d={};return wG(l,u,d,n,r)?d:void 0}function wG(e,t,n,r,a){let o=0,l=0;for(;ob.value)));p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),m=j}else m=decodeURI(Qi(f.map(p=>p.value)));return n["*"]=m,n._splat=m,!0}if(d.type===di){if(d.value==="/"&&!u?.value){l++;continue}if(u){if(a){if(d.value!==u.value)return!1}else if(d.value.toLowerCase()!==u.value.toLowerCase())return!1;o++,l++;continue}else return!1}if(d.type===ll){if(!u||u.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if(p&&!x.startsWith(p)||g&&!x.endsWith(g))return!1;let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}else f=decodeURIComponent(u.value),m=!0;m&&(n[d.value.substring(1)]=f,o++),l++;continue}if(d.type===eu){if(!u){l++;continue}if(u.value==="/"){l++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if((!p||x.startsWith(p))&&(!g||x.endsWith(g))){let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}}else{let p=!0;for(let g=l+1;g=t.length)return n["**"]=Qi(e.slice(o).map(f=>f.value)),!!r&&t[t.length-1]?.value!=="/";if(l=e.length){for(let f=l;f{if(r.isRoot||!r.path)return;const o=NC(r.fullPath);let l=tu(o),u=0;for(;l.length>u+1&&l[u]?.value==="/";)u++;u>0&&(l=l.slice(u));let d=0,f=!1;const m=l.map((p,g)=>{if(p.value==="/")return jG;if(p.type===di)return SG;let x;p.type===ll?x=_G:p.type===eu?(x=NG,d++):x=CG;for(let j=g+1;j{const o=Math.min(r.scores.length,a.scores.length);for(let l=0;la.parsed[l].value?1:-1;return r.index-a.index}).map((r,a)=>(r.child.rank=a,r.child))}function MG({routeTree:e,initRoute:t}){const n={},r={},a=l=>{l.forEach((u,d)=>{t?.(u,d);const f=n[u.id];if(ur(!f,`Duplicate routes found with id: ${String(u.id)}`),n[u.id]=u,!u.isRoot&&u.path){const p=Ko(u.fullPath);(!r[p]||u.fullPath.endsWith("/"))&&(r[p]=u)}const m=u.children;m?.length&&a(m)})};a([e]);const o=kG(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function Fa(e){return!!e?.isNotFound}function PG(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const pv="tsr-scroll-restoration-v1_3",RG=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function DG(){const e=PG();if(!e)return null;const t=e.getItem(pv);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=Qs(r,n)||n,e.setItem(pv,JSON.stringify(n)))}}const wp=DG(),f_=e=>e.state.__TSR_key||e.href;function $G(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let vv=!1;function GL({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:a,location:o}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];vv=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const p in d){const g=d[p];if(p==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(p){const x=document.querySelector(p);x&&(x.scrollLeft=g.scrollX,x.scrollTop=g.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const g=document.getElementById(f);g&&g.scrollIntoView(p)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),a)for(const p of a){if(p==="window")continue;const g=typeof p=="function"?p():document.querySelector(p);g&&g.scrollTo(m)}}vv=!1}function IG(e,t){if(!wp&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!wp))return;e.isScrollRestorationSetup=!0,vv=!1;const r=e.options.getScrollRestorationKey||f_;window.history.scrollRestoration="manual";const a=o=>{if(vv||!e.isScrollRestoring)return;let l="";if(o.target===document||o.target===window)l="window";else{const d=o.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=$G(o.target)}const u=r(e.state.location);wp.set(d=>{const f=d[u]||={},m=f[l]||={};if(l==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(l){const p=document.querySelector(l);p&&(m.scrollX=p.scrollLeft||0,m.scrollY=p.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",RG(a,100),!0),e.subscribe("onRendered",o=>{const l=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(GL({storageKey:pv,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&wp.set(u=>(u[l]||={},u)))})}function LG(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function BG(e,t=String){const n=new URLSearchParams;for(const r in e){const a=e[r];a!==void 0&&n.set(r,t(a))}return n.toString()}function E0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zG(e){const t=new URLSearchParams(e),n={};for(const[r,a]of t.entries()){const o=n[r];o==null?n[r]=E0(a):Array.isArray(o)?o.push(E0(a)):n[r]=[o,E0(a)]}return n}const qG=UG(JSON.parse),FG=HG(JSON.stringify,JSON.parse);function UG(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=zG(t);for(const r in n){const a=n[r];if(typeof a=="string")try{n[r]=e(a)}catch{}}return n}}function HG(e,t){const n=typeof t=="function";function r(a){if(typeof a=="object"&&a!==null)try{return e(a)}catch{}else if(n&&typeof a=="string")try{return t(a),e(a)}catch{}return a}return a=>{const o=BG(a,r);return o?`?${o}`:""}}const Zr="__root__";function YL(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function oi(e){return e instanceof Response&&!!e.options}function WG(e){const t=new Map;let n,r;const a=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const l=t.get(o);if(l)return a(l),l.value},set(o,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(o);if(u)u.value=l,a(u);else{const d={key:o,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const Jp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Dg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),KL=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ur(n.options.notFoundComponent);const r=e.matches.find(a=>a.routeId===n.id);ur(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,a=>({...a,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,KL(e,t))},Uo=(e,t,n)=>{if(!(!oi(n)&&!Fa(n))){if(oi(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=oi(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:r,isFetching:!1,error:n})),Fa(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw oi(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(KL(e,n),n)}},XL=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Wd=(e,t,n,r)=>{const{id:a,routeId:o}=e.matches[t],l=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Uo(e,e.router.getMatch(a),n);try{l.options.onError?.(n)}catch(u){n=u,Uo(e,e.router.getMatch(a),n)}e.updateMatch(a,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},VG=(e,t,n,r)=>{const a=e.router.getMatch(t),o=e.matches[n-1]?.id,l=o?e.router.getMatch(o):void 0;if(e.router.isShell()){a.ssr=r.id===Zr;return}if(l?.ssr===!1){a.ssr=!1;return}const u=x=>x===!0&&l?.ssr==="data-only"?"data-only":x,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=u(d);return}if(typeof r.options.ssr!="function"){a.ssr=u(r.options.ssr);return}const{search:f,params:m}=a,p={search:jp(f,a.searchError),params:jp(m,a.paramsError),location:e.location,matches:e.matches.map(x=>({index:x.index,pathname:x.pathname,fullPath:x.fullPath,staticData:x.staticData,id:x.id,routeId:x.routeId,search:jp(x.search,x.searchError),params:jp(x.params,x.paramsError),ssr:x.ssr}))},g=r.options.ssr(p);if(Yo(g))return g.then(x=>{a.ssr=u(x??d)});a.ssr=u(g??d)},ZL=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const a=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Dg(e,t)&&(n.options.loader||n.options.beforeLoad||e5(n))&&typeof a=="number"&&a!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{Jp(e)},a);r._nonReactive.pendingTimeout=l}},GG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ZL(e,t,n,r);const a=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Uo(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},YG=(e,t,n,r)=>{const a=e.router.getMatch(t),o=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Qc(()=>{o?.resolve()});const{paramsError:l,searchError:u}=a;l&&Wd(e,n,l,"PARSE_PARAMS"),u&&Wd(e,n,u,"VALIDATE_SEARCH"),ZL(e,t,r,a);const d=new AbortController,f=e.matches[n-1]?.id,g={...(f?e.router.getMatch(f):void 0)?.context??e.router.options.context??void 0,...a.__routeContext};let x=!1;const j=()=>{x||(x=!0,e.updateMatch(t,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:d,context:g})))},b=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){yf(()=>{j(),b()});return}a._nonReactive.beforeLoadPromise=Qc();const{search:w,params:N,cause:A}=a,E=Dg(e,t),T={search:w,abortController:d,params:N,preload:E,context:g,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:E?"preload":A,matches:e.matches,...e.router.options.additionalContext},C=O=>{if(O===void 0){yf(()=>{j(),b()});return}(oi(O)||Fa(O))&&(j(),Wd(e,n,O,"BEFORE_LOAD")),yf(()=>{j(),e.updateMatch(t,M=>({...M,__beforeLoadContext:O,context:{...M.context,...O}})),b()})};let k;try{if(k=r.options.beforeLoad(T),Yo(k))return j(),k.catch(O=>{Wd(e,n,O,"BEFORE_LOAD")}).then(C)}catch(O){j(),Wd(e,n,O,"BEFORE_LOAD")}C(k)},KG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],a=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=VG(e,n,t,a);if(Yo(d))return d.then(u)}return u()},l=()=>YG(e,n,t,a),u=()=>{if(XL(e,n))return;const d=GG(e,n,a);return Yo(d)?d.then(l):l()};return o()},xf=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const a={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(a),n.options.scripts?.(a),n.options.headers?.(a)]).then(([o,l,u])=>{const d=o?.meta,f=o?.links,m=o?.scripts,p=o?.styles;return{meta:d,links:f,headScripts:m,headers:u,scripts:l,styles:p}})},QL=(e,t,n,r)=>{const a=e.matchPromises[n-1],{params:o,loaderDeps:l,abortController:u,cause:d}=e.router.getMatch(t);let f=e.router.options.context??{};for(let p=0;p<=n;p++){const g=e.matches[p];if(!g)continue;const x=e.router.getMatch(g.id);x&&(f={...f,...x.__routeContext??{},...x.__beforeLoadContext??{}})}const m=Dg(e,t);return{params:o,deps:l,preload:!!m,parentMatchPromise:a,abortController:u,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:m?"preload":d,route:r,...e.router.options.additionalContext}},oM=async(e,t,n,r)=>{try{const a=e.router.getMatch(t);try{(!e.router.isServer||a.ssr===!0)&&JL(r);const o=r.options.loader?.(QL(e,t,n,r)),l=r.options.loader&&Yo(o);if(!!(l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),r.options.loader){const p=l?await o:o;Uo(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}r._lazyPromise&&await r._lazyPromise;const d=xf(e,t,r),f=d?await d:void 0,m=a._nonReactive.minPendingPromise;m&&await m,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(o){let l=o;const u=a._nonReactive.minPendingPromise;u&&await u,Fa(o)&&await r.options.notFoundComponent?.preload?.(),Uo(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(m){l=m,Uo(e,e.router.getMatch(t),m)}const d=xf(e,t,r),f=d?await d:void 0;e.updateMatch(t,m=>({...m,error:l,status:"error",isFetching:!1,...f}))}}catch(a){const o=e.router.getMatch(t);if(o){const l=xf(e,t,r);if(l){const u=await l;e.updateMatch(t,d=>({...d,...u}))}o._nonReactive.loaderPromise=void 0}Uo(e,o,a)}},XG=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let a=!1,o=!1;const l=e.router.looseRoutesById[r];if(XL(e,n)){if(e.router.isServer){const f=xf(e,n,l);if(f){const m=await f;e.updateMatch(n,p=>({...p,...m}))}return e.router.getMatch(n)}}else{const f=e.router.getMatch(n);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const m=e.router.getMatch(n),p=m._nonReactive.error||m.error;p&&Uo(e,m,p)}else{const m=Date.now()-f.updatedAt,p=Dg(e,n),g=p?l.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.router.options.defaultStaleTime??0,x=l.options.shouldReload,j=typeof x=="function"?x(QL(e,n,t,l)):x,b=!!p&&!e.router.state.matches.some(E=>E.id===n),w=e.router.getMatch(n);w._nonReactive.loaderPromise=Qc(),b!==w.preload&&e.updateMatch(n,E=>({...E,preload:b}));const{status:N,invalid:A}=w;if(a=N==="success"&&(A||(j??m>g)),!(p&&l.options.preload===!1))if(a&&!e.sync)o=!0,(async()=>{try{await oM(e,n,t,l);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){oi(E)&&await e.router.navigate(E.options)}})();else if(N!=="success"||a&&e.sync)await oM(e,n,t,l);else{const E=xf(e,n,l);if(E){const T=await E;e.updateMatch(n,C=>({...C,...T}))}}}}const u=e.router.getMatch(n);o||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,o||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=o?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):u};async function sM(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&Jp(t);try{for(let a=0;a{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of t5){const a=e.options[r]?.preload;a&&n.push(a())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function jp(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function e5(e){for(const t of t5)if(e.options[t]?.preload)return!0;return!1}const t5=["component","errorComponent","pendingComponent","notFoundComponent"];function ZG(e){return{input:({url:t})=>{for(const n of e)t=n5(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=r5(e[n],t);return t}}}function QG(e){const t=Qp(e.basepath),n=`/${t}`,r=`${n}/`,a=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===a?l.pathname="/":u.startsWith(o)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Qi(["/",t,l.pathname]),l)}}function n5(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function r5(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function el(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,a=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:a,hashChanged:o}}class JG{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,a=this.basepath??r?.basepath??"/",o=this.basepath===void 0,l=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=iG())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new rG(tY(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),IG(this));let u=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(o||a!==d||l!==f){this.basepath=d;const g=[];Qp(d)!==""&&g.push(QG({basepath:d})),f&&g.push(f),this.rewrite=g.length===0?void 0:g.length===1?g[0]:ZG(g),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:a}=MG({routeTree:this.routeTree,initRoute:(l,u)=>{l.init({originalIndex:u})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=a;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)},this.subscribe=(n,r)=>{const a={eventType:n,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const a=({href:d,state:f})=>{const m=new URL(d,this.origin),p=n5(this.rewrite,m),g=this.options.parseSearch(p.search),x=this.options.stringifySearch(g);p.search=x;const j=p.href.replace(p.origin,""),{pathname:b,hash:w}=p;return{href:j,publicHref:d,url:p.href,pathname:nM(b),searchStr:x,search:wa(r?.search,g),hash:w.split("#").reverse()[0]??"",state:wa(r?.state,f)}},o=a(n),{__tempLocation:l,__tempKey:u}=o.state;if(l&&(!u||u===this.tempLocationKey)){const d=a(l);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>fG({base:n,to:_C(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,a)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},a):this.matchRoutesInternal(n,r),this.parsePathnameCache=WG(1e3),this.getMatchedRoutes=(n,r)=>nY({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const r=(o={})=>{const l=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutes(l,{_buildLocation:!0}),d=u_(u);o.from;const f=o.unsafeRelative==="path"?l.pathname:o.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,g={...d.params},x=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),j=o.params===!1||o.params===null?{}:(o.params??!0)===!0?g:Object.assign(g,Qs(o.params,g)),b=O0({path:x,params:j,parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(b,void 0,{_buildLocation:!0}).map(z=>this.looseRoutesById[z.routeId]);if(Object.keys(j).length>0)for(const z of w){const D=z.options.params?.stringify??z.options.stringifyParams;D&&Object.assign(j,D(j))}const N=n.leaveParams?x:nM(O0({path:x,params:j,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let A=p;if(n._includeValidateSearch&&this.options.search?.strict){const z={};w.forEach(D=>{if(D.options.validateSearch)try{Object.assign(z,h_(D.options.validateSearch,{...z,...A}))}catch{}}),A=z}A=rY({search:A,dest:o,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),A=wa(p,A);const E=this.options.stringifySearch(A),T=o.hash===!0?l.hash:o.hash?Qs(o.hash,l.hash):void 0,C=T?`#${T}`:"";let k=o.state===!0?l.state:o.state?Qs(o.state,l.state):{};k=wa(l.state,k);const O=`${N}${E}${C}`,M=new URL(O,this.origin),I=r5(this.rewrite,M);return{publicHref:I.pathname+I.search+I.hash,href:O,url:I.href,pathname:N,search:A,searchStr:E,state:k,hash:T??"",unmaskOnReload:o.unmaskOnReload}},a=(o={},l)=>{const u=r(o);let d=l?r(l):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(p=>{const g=d_(u.pathname,{to:p.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return g?(f=g,!0):!1});if(m){const{from:p,...g}=m;l={from:n.from,...g,params:f},d=r(l)}}return d&&(u.maskedLocation=d),u};return n.mask?a(n,{from:n.from,...n.mask}):a(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...a})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const f=Js(a.state,this.latestLocation.state);return d.forEach(m=>{delete a.state[m]}),f},l=Ko(this.latestLocation.href)===Ko(a.href),u=this.commitLocationPromise;if(this.commitLocationPromise=Qc(()=>{u?.resolve()}),l&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...m}=a;d&&(m={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:a,viewTransition:o,ignoreBlocker:l,href:u,...d}={})=>{if(u){const p=this.history.location.state.__TSR_index,g=fv(u,{__TSR_index:n?p:p+1});d.to=g.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const m=this.commitLocation({...f,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=({to:n,reloadDocument:r,href:a,...o})=>{if(!r&&a)try{new URL(`${a}`),r=!0}catch{}return r?(a||(a=this.buildLocation({to:n,...o}).url),o.replace?window.location.replace(a):window.location.href=a,Promise.resolve()):this.buildAndCommitLocation({...o,href:a,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),a=o=>{try{return encodeURI(decodeURI(o))}catch{return o}};if(Qp(a(this.latestLocation.href))!==Qp(a(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),YL({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(a=>!n.some(o=>o.id===a.id))}))},this.load=async n=>{let r,a,o;for(o=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...el({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...el({resolvedLocation:f,location:d})}),await sM({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],p=[],g=[];yf(()=>{this.__store.setState(x=>{const j=x.matches,b=x.pendingMatches||x.matches;return m=j.filter(w=>!b.some(N=>N.id===w.id)),p=b.filter(w=>!j.some(N=>N.id===w.id)),g=b.filter(w=>j.some(N=>N.id===w.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...m.filter(w=>w.status!=="error")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[p,"onEnter"],[g,"onStay"]].forEach(([x,j])=>{x.forEach(b=>{this.looseRoutesById[b.routeId].options[j]?.(b)})})})})}})}catch(d){oi(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Fa(d)&&(a=d),this.__store.setState(f=>({...f,statusCode:r?r.status:a?404:f.matches.some(m=>m.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,l=this.state.resolvedLocation,u=typeof r.types=="function"?r.types(el({resolvedLocation:l,location:o})):r.types;if(u===!1){n();return}a={update:n,types:u}}else a=n;document.startViewTransition(a)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";a&&this.__store.setState(o=>({...o,[a]:o[a]?.map(l=>l.id===n?r(l):l)}))})},this.getMatch=n=>{const r=a=>a.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=a=>n?.filter?.(a)??!0?{...a,invalid:!0,...n?.forcePending||a.status==="error"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(r),cachedMatches:a.cachedMatches.map(r),pendingMatches:a.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let a=r.url;this.origin&&a.startsWith(this.origin)&&(a=a.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",a)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(o=>!r(o))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const a=this.looseRoutesById[r.routeId];if(!a.options.loader)return!0;const o=(r.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=JL,this.preloadRoute=async n=>{const r=this.buildLocation(n);let a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...o,...this.state.cachedMatches.map(u=>u.id)]);yf(()=>{a.forEach(u=>{l.has(u.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,u]}))})});try{return a=await sM({router:this,matches:a,location:r,preload:!0,updateMatch:(u,d)=>{o.has(u)?a=a.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)}}),a}catch(u){if(oi(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});Fa(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const a={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(a);if(r?.pending&&this.state.status!=="pending")return!1;const u=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=d_(u.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!Js(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?Js(u.search,o.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??FG,parseSearch:t.parseSearch??qG}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:a,routeParams:o}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let l=!1;(r?r.path!=="/"&&o["**"]:Ko(t.pathname))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):l=!0);const u=(()=>{if(l){if(this.options.notFoundMode!=="root")for(let m=a.length-1;m>=0;m--){const p=a[m];if(p.children)return p.id}return Zr}})(),d=[],f=m=>m?.id?m.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((m,p)=>{const g=d[p-1],[x,j,b]=(()=>{const H=g?.search??t.search,V=g?._strictSearch??void 0;try{const F=h_(m.options.validateSearch,{...H})??void 0;return[{...H,...F},{...V,...F},void 0]}catch(F){let G=F;if(F instanceof gv||(G=new gv(F.message,{cause:F})),n?.throwOnError)throw G;return[H,{},G]}})(),w=m.options.loaderDeps?.({search:x})??"",N=w?JSON.stringify(w):"",{interpolatedPath:A,usedParams:E}=O0({path:m.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),T=m.id+A+N,C=this.getMatch(T),k=this.state.matches.find(H=>H.routeId===m.id),O=C?._strictParams??E;let M;if(!C){const H=m.options.params?.parse??m.options.parseParams;if(H)try{Object.assign(O,H(O))}catch(V){if(M=new eY(V.message,{cause:V}),n?.throwOnError)throw M}}Object.assign(o,O);const I=k?"stay":"enter";let z;if(C)z={...C,cause:I,params:k?wa(k.params,o):o,_strictParams:O,search:wa(k?k.search:C.search,x),_strictSearch:j};else{const H=m.options.loader||m.options.beforeLoad||m.lazyFn||e5(m)?"pending":"success";z={id:T,index:p,routeId:m.id,params:k?wa(k.params,o):o,_strictParams:O,pathname:A,updatedAt:Date.now(),search:k?wa(k.search,x):x,_strictSearch:j,searchError:void 0,status:H,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:Qc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:I,loaderDeps:k?wa(k.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(z.globalNotFound=u===m.id),z.searchError=b;const D=f(g);z.context={...D,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((m,p)=>{const g=this.looseRoutesById[m.routeId];if(!this.getMatch(m.id)&&n?._buildLocation!==!0){const j=d[p-1],b=f(j);if(g.options.context){const w={deps:m.loaderDeps,params:m.params,context:b??{},location:t,navigate:N=>this.navigate({...N,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d};m.__routeContext=g.options.context(w)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}),d}}class gv extends Error{}class eY extends Error{}function tY(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function h_(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new gv("Async validation not supported");if(n.issues)throw new gv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function nY({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:a,flatRoutes:o,parseCache:l}){let u={};const d=Ko(e),f=x=>d_(d,{to:x.fullPath,caseSensitive:x.options?.caseSensitive??n,fuzzy:!0},l);let m=t!==void 0?r[t]:void 0;if(m)u=f(m);else{let x;for(const j of o){const b=f(j);if(b)if(j.path!=="/"&&b["**"])x||(x={foundRoute:j,routeParams:b});else{m=j,u=b;break}}!m&&x&&(m=x.foundRoute,u=x.routeParams)}let p=m||a[Zr];const g=[p];for(;p.parentRoute;)p=p.parentRoute,g.push(p);return g.reverse(),{matchedRoutes:g,routeParams:u,foundRoute:m}}function rY({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const a=n.reduce((u,d)=>{const f=[];if("search"in d.options)d.options.search?.middlewares&&f.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const m=({search:p,next:g})=>{let x=p;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(x=d.options.preSearchFilters.reduce((b,w)=>w(b),p));const j=g(x);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((b,w)=>w(b),j):j};f.push(m)}if(r&&d.options.validateSearch){const m=({search:p,next:g})=>{const x=g(p);try{return{...x,...h_(d.options.validateSearch,x)??void 0}}catch{return x}};f.push(m)}return u.concat(f)},[])??[],o=({search:u})=>t.search?t.search===!0?u:Qs(t.search,u):{};a.push(o);const l=(u,d)=>{if(u>=a.length)return d;const f=a[u];return f({search:d,next:p=>l(u+1,p)})};return l(0,e)}const aY="Error preloading route! ☝️";class a5{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Zr:this.parentRoute||ur(!1);let o=a?Zr:r?.path;o&&o!=="/"&&(o=NC(o));const l=r?.id||o;let u=a?Zr:Qi([this.parentRoute.id===Zr?"":this.parentRoute.id,l]);o===Zr&&(o="/"),u!==Zr&&(u=Qi(["/",u]));const d=u===Zr?"/":Qi([this.parentRoute.fullPath,o]);this._path=o,this._id=u,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class iY extends a5{constructor(t){super(t)}}function CC(e){const t=e.errorComponent??$g;return i.jsx(oY,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}class oY extends y.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function $g({error:e}){const[t,n]=y.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function sY({children:e,fallback:t=null}){return lY()?i.jsx(W.Fragment,{children:e}):i.jsx(W.Fragment,{children:t})}function lY(){return W.useSyncExternalStore(cY,()=>!0,()=>!1)}function cY(){return()=>{}}var A0={exports:{}},T0={},k0={exports:{}},M0={};var lM;function uY(){if(lM)return M0;lM=1;var e=wh();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(p,g){var x=g(),j=r({inst:{value:x,getSnapshot:g}}),b=j[0].inst,w=j[1];return o(function(){b.value=x,b.getSnapshot=g,d(b)&&w({inst:b})},[p,x,g]),a(function(){return d(b)&&w({inst:b}),p(function(){d(b)&&w({inst:b})})},[p]),l(x),x}function d(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!n(p,x)}catch{return!0}}function f(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return M0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,M0}var cM;function dY(){return cM||(cM=1,k0.exports=uY()),k0.exports}var uM;function fY(){if(uM)return T0;uM=1;var e=wh(),t=dY();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return T0.useSyncExternalStoreWithSelector=function(f,m,p,g,x){var j=o(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function N(k){if(!A){if(A=!0,E=k,k=g(k),x!==void 0&&b.hasValue){var O=b.value;if(x(O,k))return T=O}return T=k}if(O=T,r(E,k))return O;var M=g(k);return x!==void 0&&x(O,M)?(E=k,O):(E=k,T=M)}var A=!1,E,T,C=p===void 0?null:p;return[function(){return N(m())},C===null?void 0:function(){return N(C())}]},[m,p,g,x]);var w=a(f,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},T0}var dM;function hY(){return dM||(dM=1,A0.exports=fY()),A0.exports}var mY=hY();function pY(e,t=r=>r,n={}){const r=n.equal??vY;return mY.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function vY(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!t.has(r)||!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=fM(e);if(n.length!==fM(t).length)return!1;for(let r=0;r"u"?P0:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=P0,P0)}function Ir(e){const t=y.useContext(i5());return e?.warn,t}function Sr(e){const t=Ir({warn:e?.router===void 0}),n=e?.router||t,r=y.useRef(void 0);return pY(n.__store,a=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=wa(r.current,e.select(a));return r.current=o,o}return e.select(a)}return a})}const Ig=y.createContext(void 0),gY=y.createContext(void 0);function pi(e){const t=y.useContext(e.from?gY:Ig);return Sr({select:r=>{const a=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(ur(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function OC(e){return pi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function EC(e){const{select:t,...n}=e;return pi({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function AC(e){return pi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function TC(e){return pi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function oa(e){const t=Ir();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var wl=HL();const yY=St(wl),Sp=typeof window<"u"?y.useLayoutEffect:y.useEffect;function R0(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function xY(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([o])=>{t(o)},n);return a.observe(e.current),()=>{a.disconnect()}},[t,n,r.disabled,e])}function bY(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}function wY(e,t){const n=Ir(),[r,a]=y.useState(!1),o=y.useRef(!1),l=bY(t),{activeProps:u,inactiveProps:d,activeOptions:f,to:m,preload:p,preloadDelay:g,hashScrollIntoView:x,replace:j,startTransition:b,resetScroll:w,viewTransition:N,children:A,target:E,disabled:T,style:C,className:k,onClick:O,onFocus:M,onMouseEnter:I,onMouseLeave:z,onTouchStart:D,ignoreBlocker:H,params:V,search:F,hash:G,state:L,mask:R,reloadDocument:U,unsafeRelative:K,from:te,_fromLocation:$,...B}=e,Y=Sr({select:ct=>ct.location.search,structuralSharing:!0}),ne=e.from,oe=y.useMemo(()=>({...e,from:ne}),[n,Y,ne,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),xe=y.useMemo(()=>n.buildLocation({...oe}),[n,oe]),ee=y.useMemo(()=>{if(T)return;let ct=xe.maskedLocation?xe.maskedLocation.url:xe.url,rt=!1;return n.origin&&(ct.startsWith(n.origin)?ct=n.history.createHref(ct.replace(n.origin,""))||"/":rt=!0),{href:ct,external:rt}},[T,xe.maskedLocation,xe.url,n.origin,n.history]),ae=y.useMemo(()=>{if(ee?.external)return ee.href;try{return new URL(m),m}catch{}},[m,ee]),Z=e.reloadDocument||ae?!1:p??n.options.defaultPreload,pe=g??n.options.defaultPreloadDelay??0,je=Sr({select:ct=>{if(ae)return!1;if(f?.exact){if(!uG(ct.location.pathname,xe.pathname,n.basepath))return!1}else{const rt=mv(ct.location.pathname,n.basepath),$n=mv(xe.pathname,n.basepath);if(!(rt.startsWith($n)&&(rt.length===$n.length||rt[$n.length]==="/")))return!1}return(f?.includeSearch??!0)&&!Js(ct.location.search,xe.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?ct.location.hash===xe.hash:!0}}),le=y.useCallback(()=>{n.preloadRoute({...oe}).catch(ct=>{console.warn(ct),console.warn(aY)})},[n,oe]),Re=y.useCallback(ct=>{ct?.isIntersecting&&le()},[le]);xY(l,Re,CY,{disabled:!!T||Z!=="viewport"}),y.useEffect(()=>{o.current||!T&&Z==="render"&&(le(),o.current=!0)},[T,le,Z]);const _e=ct=>{const rt=ct.currentTarget.getAttribute("target"),$n=E!==void 0?E:rt;if(!T&&!OY(ct)&&!ct.defaultPrevented&&(!$n||$n==="_self")&&ct.button===0){ct.preventDefault(),wl.flushSync(()=>{a(!0)});const gs=n.subscribe("onResolved",()=>{gs(),a(!1)});n.navigate({...oe,replace:j,resetScroll:w,hashScrollIntoView:x,startTransition:b,viewTransition:N,ignoreBlocker:H})}};if(ae)return{...B,ref:l,href:ae,...A&&{children:A},...E&&{target:E},...T&&{disabled:T},...C&&{style:C},...k&&{className:k},...O&&{onClick:O},...M&&{onFocus:M},...I&&{onMouseEnter:I},...z&&{onMouseLeave:z},...D&&{onTouchStart:D}};const me=ct=>{T||Z&&le()},ve=me,Le=ct=>{if(!(T||!Z))if(!pe)le();else{const rt=ct.target;if(Vd.has(rt))return;const $n=setTimeout(()=>{Vd.delete(rt),le()},pe);Vd.set(rt,$n)}},It=ct=>{if(T||!Z||!pe)return;const rt=ct.target,$n=Vd.get(rt);$n&&(clearTimeout($n),Vd.delete(rt))},Cn=je?Qs(u,{})??jY:D0,vr=je?D0:Qs(d,{})??D0,rr=[k,Cn.className,vr.className].filter(Boolean).join(" "),gr=(C||Cn.style||vr.style)&&{...C,...Cn.style,...vr.style};return{...B,...Cn,...vr,href:ee?.href,ref:l,onClick:Gd([O,_e]),onFocus:Gd([M,me]),onMouseEnter:Gd([I,Le]),onMouseLeave:Gd([z,It]),onTouchStart:Gd([D,ve]),disabled:!!T,target:E,...gr&&{style:gr},...rr&&{className:rr},...T&&SY,...je&&_Y,...r&&NY}}const D0={},jY={className:"active"},SY={role:"link","aria-disabled":!0},_Y={"data-status":"active","aria-current":"page"},NY={"data-transitioning":"transitioning"},Vd=new WeakMap,CY={rootMargin:"100px"},Gd=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},kC=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:a,ref:o,...l}=wY(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;return n===void 0&&delete l.disabled,y.createElement(n||"a",{...l,ref:o},u)});function OY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class EY extends a5{constructor(t){super(t),this.useMatch=n=>pi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>pi({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>TC({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>AC({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>EC({...n,from:this.id}),this.useLoaderData=n=>OC({...n,from:this.id}),this.useNavigate=()=>oa({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>i.jsx(kC,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function fr(e){return new EY(e)}class AY extends iY{constructor(t){super(t),this.useMatch=n=>pi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>pi({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>TC({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>AC({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>EC({...n,from:this.id}),this.useLoaderData=n=>OC({...n,from:this.id}),this.useNavigate=()=>oa({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>i.jsx(kC,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function TY(e){return new AY(e)}function hM(e){return typeof e=="object"?new mM(e,{silent:!0}).createRoute(e):new mM(e,{silent:!0}).createRoute}class mM{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const a=fr(r);return a.isRoot=!1,a},this.silent=n?.silent}}class pM{constructor(t){this.useMatch=n=>pi({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>pi({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>TC({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>AC({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>EC({...n,from:this.options.id}),this.useLoaderData=n=>OC({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ir();return oa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function vM(e){return typeof e=="object"?new pM(e):t=>new pM({id:e,...t})}function kY(){const e=Ir(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),{hasPendingMatches:a,isLoading:o}=Sr({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=R0(o),u=o||n||a,d=R0(u),f=o||a,m=R0(f);return e.startTransition=p=>{r(!0),y.startTransition(()=>{p(),r(!1)})},y.useEffect(()=>{const p=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ko(e.latestLocation.href)!==Ko(g.href)&&e.commitLocation({...g,replace:!0}),()=>{p()}},[e,e.history]),Sp(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),Sp(()=>{l&&!o&&e.emit({type:"onLoad",...el(e.state)})},[l,e,o]),Sp(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...el(e.state)})},[f,m,e]),Sp(()=>{d&&!u&&(e.emit({type:"onResolved",...el(e.state)}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),LG(e))},[u,d,e]),null}function MY(e){const t=Sr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return i.jsx(CC,{getResetKey:()=>t,onCatch:(n,r)=>{if(Fa(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Fa(n))return e.fallback?.(n);throw n},children:e.children})}function PY(){return i.jsx("p",{children:"Not Found"})}function kc(e){return i.jsx(i.Fragment,{children:e.children})}function o5(e,t,n){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{data:n}):i.jsx(PY,{})}function RY({children:e}){const t=Ir();return t.isServer?i.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(` -`)+";$_TSR.c()"}}):null}function DY(){const e=Ir();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||f_)(e.latestLocation),r=n!==f_(e.latestLocation)?n:void 0,a={storageKey:pv,shouldScrollRestoration:!0};return r&&(a.key=r),i.jsx(RY,{children:`(${GL.toString()})(${JSON.stringify(a)})`})}const s5=y.memo(function({matchId:t}){const n=Ir(),r=Sr({select:N=>{const A=N.matches.find(E=>E.id===t);return ur(A),{routeId:A.routeId,ssr:A.ssr,_displayPending:A._displayPending}},structuralSharing:!0}),a=n.routesById[r.routeId],o=a.options.pendingComponent??n.options.defaultPendingComponent,l=o?i.jsx(o,{}):null,u=a.options.errorComponent??n.options.defaultErrorComponent,d=a.options.onCatch??n.options.defaultOnCatch,f=a.isRoot?a.options.notFoundComponent??n.options.notFoundRoute?.options.component:a.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!a.isRoot||a.options.wrapInSuspense||m)&&(a.options.wrapInSuspense??o??(a.options.errorComponent?.preload||m))?y.Suspense:kc,g=u?CC:kc,x=f?MY:kc,j=Sr({select:N=>N.loadedAt}),b=Sr({select:N=>{const A=N.matches.findIndex(E=>E.id===t);return N.matches[A-1]?.routeId}}),w=a.isRoot?a.options.shellComponent??kc:kc;return i.jsxs(w,{children:[i.jsx(Ig.Provider,{value:t,children:i.jsx(p,{fallback:l,children:i.jsx(g,{getResetKey:()=>j,errorComponent:u||$g,onCatch:(N,A)=>{if(Fa(N))throw N;d?.(N,A)},children:i.jsx(x,{fallback:N=>{if(!f||N.routeId&&N.routeId!==r.routeId||!N.routeId&&!a.isRoot)throw N;return y.createElement(f,N)},children:m||r._displayPending?i.jsx(sY,{fallback:l,children:i.jsx(gM,{matchId:t})}):i.jsx(gM,{matchId:t})})})})}),b===Zr&&n.options.scrollRestoration?i.jsxs(i.Fragment,{children:[i.jsx($Y,{}),i.jsx(DY,{})]}):null]})});function $Y(){const e=Ir(),t=y.useRef(void 0);return i.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...el(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gM=y.memo(function({matchId:t}){const n=Ir(),{match:r,key:a,routeId:o}=Sr({select:d=>{const f=d.matches.find(j=>j.id===t),m=f.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[o],u=y.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?i.jsx(d,{},a):i.jsx(MC,{})},[a,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!n.isServer){const m=Qc();f._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return ur(Fa(r.error)),o5(n,l,r.error);if(r.status==="redirected")throw ur(oi(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(l.options.errorComponent??n.options.defaultErrorComponent)||$g;return i.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return u}),MC=y.memo(function(){const t=Ir(),n=y.useContext(Ig),r=Sr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),a=t.routesById[r],o=Sr({select:f=>{const p=f.matches.find(g=>g.id===n);return ur(p),p.globalNotFound}}),l=Sr({select:f=>{const m=f.matches,p=m.findIndex(g=>g.id===n);return m[p+1]?.id}}),u=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(o)return o5(t,a,void 0);if(!l)return null;const d=i.jsx(s5,{matchId:l});return r===Zr?i.jsx(y.Suspense,{fallback:u,children:d}):d});function IY(){const e=Ir(),n=e.routesById[Zr].options.pendingComponent??e.options.defaultPendingComponent,r=n?i.jsx(n,{}):null,a=e.isServer||typeof document<"u"&&e.ssr?kc:y.Suspense,o=i.jsxs(a,{fallback:r,children:[!e.isServer&&i.jsx(kY,{}),i.jsx(LY,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:o}):o}function LY(){const e=Ir(),t=Sr({select:a=>a.matches[0]?.id}),n=Sr({select:a=>a.loadedAt}),r=t?i.jsx(s5,{matchId:t}):null;return i.jsx(Ig.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:i.jsx(CC,{getResetKey:()=>n,errorComponent:$g,onCatch:a=>{a.message||a.toString()},children:r})})}function BY(){const e=Ir();return Sr({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),y.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o,...l}=t;return e.matchRoute(l,{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o})},[e])}const zY=e=>new qY(e);class qY extends JG{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=hM,globalThis.createLazyFileRoute=vM):typeof window<"u"&&(window.createFileRoute=hM,window.createLazyFileRoute=vM);function FY({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=i5(),a=i.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:a}):a}function UY({router:e,...t}){return i.jsx(FY,{router:e,...t,children:i.jsx(IY,{})})}function l5(e,t){return function(){return e.apply(t,arguments)}}const{toString:HY}=Object.prototype,{getPrototypeOf:PC}=Object,{iterator:Lg,toStringTag:c5}=Symbol,Bg=(e=>t=>{const n=HY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Va=e=>(e=e.toLowerCase(),t=>Bg(t)===e),zg=e=>t=>typeof t===e,{isArray:Ru}=Array,nu=zg("undefined");function jh(e){return e!==null&&!nu(e)&&e.constructor!==null&&!nu(e.constructor)&&Mr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const u5=Va("ArrayBuffer");function WY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&u5(e.buffer),t}const VY=zg("string"),Mr=zg("function"),d5=zg("number"),Sh=e=>e!==null&&typeof e=="object",GY=e=>e===!0||e===!1,ev=e=>{if(Bg(e)!=="object")return!1;const t=PC(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(c5 in e)&&!(Lg in e)},YY=e=>{if(!Sh(e)||jh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},KY=Va("Date"),XY=Va("File"),ZY=Va("Blob"),QY=Va("FileList"),JY=e=>Sh(e)&&Mr(e.pipe),eK=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Mr(e.append)&&((t=Bg(e))==="formdata"||t==="object"&&Mr(e.toString)&&e.toString()==="[object FormData]"))},tK=Va("URLSearchParams"),[nK,rK,aK,iK]=["ReadableStream","Request","Response","Headers"].map(Va),oK=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _h(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Ru(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Vs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,h5=e=>!nu(e)&&e!==Vs;function m_(){const{caseless:e,skipUndefined:t}=h5(this)&&this||{},n={},r=(a,o)=>{const l=e&&f5(n,o)||o;ev(n[l])&&ev(a)?n[l]=m_(n[l],a):ev(a)?n[l]=m_({},a):Ru(a)?n[l]=a.slice():(!t||!nu(a))&&(n[l]=a)};for(let a=0,o=arguments.length;a(_h(t,(a,o)=>{n&&Mr(a)?e[o]=l5(a,n):e[o]=a},{allOwnKeys:r}),e),lK=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),cK=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},uK=(e,t,n,r)=>{let a,o,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)l=a[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&PC(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dK=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},fK=e=>{if(!e)return null;if(Ru(e))return e;let t=e.length;if(!d5(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},hK=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&PC(Uint8Array)),mK=(e,t)=>{const r=(e&&e[Lg]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},pK=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},vK=Va("HTMLFormElement"),gK=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),yM=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yK=Va("RegExp"),m5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_h(n,(a,o)=>{let l;(l=t(a,o,e))!==!1&&(r[o]=l||a)}),Object.defineProperties(e,r)},xK=e=>{m5(e,(t,n)=>{if(Mr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Mr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},bK=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return Ru(e)?r(e):r(String(e).split(t)),n},wK=()=>{},jK=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function SK(e){return!!(e&&Mr(e.append)&&e[c5]==="FormData"&&e[Lg])}const _K=e=>{const t=new Array(10),n=(r,a)=>{if(Sh(r)){if(t.indexOf(r)>=0)return;if(jh(r))return r;if(!("toJSON"in r)){t[a]=r;const o=Ru(r)?[]:{};return _h(r,(l,u)=>{const d=n(l,a+1);!nu(d)&&(o[u]=d)}),t[a]=void 0,o}}return r};return n(e,0)},NK=Va("AsyncFunction"),CK=e=>e&&(Sh(e)||Mr(e))&&Mr(e.then)&&Mr(e.catch),p5=((e,t)=>e?setImmediate:t?((n,r)=>(Vs.addEventListener("message",({source:a,data:o})=>{a===Vs&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Vs.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Mr(Vs.postMessage)),OK=typeof queueMicrotask<"u"?queueMicrotask.bind(Vs):typeof process<"u"&&process.nextTick||p5,EK=e=>e!=null&&Mr(e[Lg]),fe={isArray:Ru,isArrayBuffer:u5,isBuffer:jh,isFormData:eK,isArrayBufferView:WY,isString:VY,isNumber:d5,isBoolean:GY,isObject:Sh,isPlainObject:ev,isEmptyObject:YY,isReadableStream:nK,isRequest:rK,isResponse:aK,isHeaders:iK,isUndefined:nu,isDate:KY,isFile:XY,isBlob:ZY,isRegExp:yK,isFunction:Mr,isStream:JY,isURLSearchParams:tK,isTypedArray:hK,isFileList:QY,forEach:_h,merge:m_,extend:sK,trim:oK,stripBOM:lK,inherits:cK,toFlatObject:uK,kindOf:Bg,kindOfTest:Va,endsWith:dK,toArray:fK,forEachEntry:mK,matchAll:pK,isHTMLForm:vK,hasOwnProperty:yM,hasOwnProp:yM,reduceDescriptors:m5,freezeMethods:xK,toObjectSet:bK,toCamelCase:gK,noop:wK,toFiniteNumber:jK,findKey:f5,global:Vs,isContextDefined:h5,isSpecCompliantForm:SK,toJSONObject:_K,isAsyncFn:NK,isThenable:CK,setImmediate:p5,asap:OK,isIterable:EK};function Xe(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}fe.inherits(Xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const v5=Xe.prototype,g5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{g5[e]={value:e}});Object.defineProperties(Xe,g5);Object.defineProperty(v5,"isAxiosError",{value:!0});Xe.from=(e,t,n,r,a,o)=>{const l=Object.create(v5);fe.toFlatObject(e,l,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Xe.call(l,u,d,n,r,a),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",o&&Object.assign(l,o),l};const AK=null;function p_(e){return fe.isPlainObject(e)||fe.isArray(e)}function y5(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function xM(e,t,n){return e?e.concat(t).map(function(a,o){return a=y5(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function TK(e){return fe.isArray(e)&&!e.some(p_)}const kK=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function qg(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!fe.isUndefined(w[b])});const r=n.metaTokens,a=n.visitor||m,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(a))throw new TypeError("visitor must be a function");function f(j){if(j===null)return"";if(fe.isDate(j))return j.toISOString();if(fe.isBoolean(j))return j.toString();if(!d&&fe.isBlob(j))throw new Xe("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(j)||fe.isTypedArray(j)?d&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function m(j,b,w){let N=j;if(j&&!w&&typeof j=="object"){if(fe.endsWith(b,"{}"))b=r?b:b.slice(0,-2),j=JSON.stringify(j);else if(fe.isArray(j)&&TK(j)||(fe.isFileList(j)||fe.endsWith(b,"[]"))&&(N=fe.toArray(j)))return b=y5(b),N.forEach(function(E,T){!(fe.isUndefined(E)||E===null)&&t.append(l===!0?xM([b],T,o):l===null?b:b+"[]",f(E))}),!1}return p_(j)?!0:(t.append(xM(w,b,o),f(j)),!1)}const p=[],g=Object.assign(kK,{defaultVisitor:m,convertValue:f,isVisitable:p_});function x(j,b){if(!fe.isUndefined(j)){if(p.indexOf(j)!==-1)throw Error("Circular reference detected in "+b.join("."));p.push(j),fe.forEach(j,function(N,A){(!(fe.isUndefined(N)||N===null)&&a.call(t,N,fe.isString(A)?A.trim():A,b,g))===!0&&x(N,b?b.concat(A):[A])}),p.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return x(e),t}function bM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function RC(e,t){this._pairs=[],e&&qg(e,this,t)}const x5=RC.prototype;x5.append=function(t,n){this._pairs.push([t,n])};x5.toString=function(t){const n=t?function(r){return t.call(this,r,bM)}:bM;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function MK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function b5(e,t,n){if(!t)return e;const r=n&&n.encode||MK;fe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(a?o=a(t,n):o=fe.isURLSearchParams(t)?t.toString():new RC(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class wM{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const w5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},PK=typeof URLSearchParams<"u"?URLSearchParams:RC,RK=typeof FormData<"u"?FormData:null,DK=typeof Blob<"u"?Blob:null,$K={isBrowser:!0,classes:{URLSearchParams:PK,FormData:RK,Blob:DK},protocols:["http","https","file","blob","url","data"]},DC=typeof window<"u"&&typeof document<"u",v_=typeof navigator=="object"&&navigator||void 0,IK=DC&&(!v_||["ReactNative","NativeScript","NS"].indexOf(v_.product)<0),LK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",BK=DC&&window.location.href||"http://localhost",zK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:DC,hasStandardBrowserEnv:IK,hasStandardBrowserWebWorkerEnv:LK,navigator:v_,origin:BK},Symbol.toStringTag,{value:"Module"})),cr={...zK,...$K};function qK(e,t){return qg(e,new cr.classes.URLSearchParams,{visitor:function(n,r,a,o){return cr.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function FK(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function UK(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r=n.length;return l=!l&&fe.isArray(a)?a.length:l,d?(fe.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!fe.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],o)&&fe.isArray(a[l])&&(a[l]=UK(a[l])),!u)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,a)=>{t(FK(r),a,n,0)}),n}return null}function HK(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Nh={transitional:w5,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return a?JSON.stringify(j5(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qK(t,this.formSerializer).toString();if((u=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return qg(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),HK(t)):t}],transformResponse:[function(t){const n=this.transitional||Nh.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Xe.from(u,Xe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cr.classes.FormData,Blob:cr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{Nh.headers[e]={}});const WK=fe.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"]),VK=e=>{const t={};let n,r,a;return e&&e.split(` -`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&WK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},jM=Symbol("internals");function Yd(e){return e&&String(e).trim().toLowerCase()}function tv(e){return e===!1||e==null?e:fe.isArray(e)?e.map(tv):String(e)}function GK(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const YK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function $0(e,t,n,r,a){if(fe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function KK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function XK(e,t){const n=fe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,o,l){return this[r].call(this,t,a,o,l)},configurable:!0})})}let Pr=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(u,d,f){const m=Yd(d);if(!m)throw new Error("header name must be a non-empty string");const p=fe.findKey(a,m);(!p||a[p]===void 0||f===!0||f===void 0&&a[p]!==!1)&&(a[p||d]=tv(u))}const l=(u,d)=>fe.forEach(u,(f,m)=>o(f,m,d));if(fe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(fe.isString(t)&&(t=t.trim())&&!YK(t))l(VK(t),n);else if(fe.isObject(t)&&fe.isIterable(t)){let u={},d,f;for(const m of t){if(!fe.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[f=m[0]]=(d=u[f])?fe.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}l(u,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Yd(t),t){const r=fe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return GK(a);if(fe.isFunction(n))return n.call(this,a,r);if(fe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Yd(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||$0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(l){if(l=Yd(l),l){const u=fe.findKey(r,l);u&&(!n||$0(r,r[u],u,n))&&(delete r[u],a=!0)}}return fe.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||$0(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return fe.forEach(this,(a,o)=>{const l=fe.findKey(r,o);if(l){n[l]=tv(a),delete n[o];return}const u=t?KK(o):String(o).trim();u!==o&&delete n[o],n[u]=tv(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&fe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[jM]=this[jM]={accessors:{}}).accessors,a=this.prototype;function o(l){const u=Yd(l);r[u]||(XK(a,l),r[u]=!0)}return fe.isArray(t)?t.forEach(o):o(t),this}};Pr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(Pr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(Pr);function I0(e,t){const n=this||Nh,r=t||n,a=Pr.from(r.headers);let o=r.data;return fe.forEach(e,function(u){o=u.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function S5(e){return!!(e&&e.__CANCEL__)}function Du(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits(Du,Xe,{__CANCEL__:!0});function _5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ZK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function QK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[o];l||(l=f),n[a]=d,r[a]=f;let p=o,g=0;for(;p!==a;)g+=n[p++],p=p%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-l{n=m,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-n;p>=r?l(f,m):(a=f,o||(o=setTimeout(()=>{o=null,l(a)},r-p)))},()=>a&&l(a)]}const yv=(e,t,n=3)=>{let r=0;const a=QK(50,250);return JK(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=a(d),m=l<=u;r=l;const p={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&m?(u-l)/f:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(p)},n)},SM=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_M=e=>(...t)=>fe.asap(()=>e(...t)),eX=cr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,cr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(cr.origin),cr.navigator&&/(msie|trident)/i.test(cr.navigator.userAgent)):()=>!0,tX=cr.hasStandardBrowserEnv?{write(e,t,n,r,a,o,l){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];fe.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),fe.isString(r)&&u.push(`path=${r}`),fe.isString(a)&&u.push(`domain=${a}`),o===!0&&u.push("secure"),fe.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function nX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function rX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function N5(e,t,n){let r=!nX(t);return e&&(r||n==!1)?rX(e,t):t}const NM=e=>e instanceof Pr?{...e}:e;function cl(e,t){t=t||{};const n={};function r(f,m,p,g){return fe.isPlainObject(f)&&fe.isPlainObject(m)?fe.merge.call({caseless:g},f,m):fe.isPlainObject(m)?fe.merge({},m):fe.isArray(m)?m.slice():m}function a(f,m,p,g){if(fe.isUndefined(m)){if(!fe.isUndefined(f))return r(void 0,f,p,g)}else return r(f,m,p,g)}function o(f,m){if(!fe.isUndefined(m))return r(void 0,m)}function l(f,m){if(fe.isUndefined(m)){if(!fe.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function u(f,m,p){if(p in t)return r(f,m);if(p in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,m,p)=>a(NM(f),NM(m),p,!0)};return fe.forEach(Object.keys({...e,...t}),function(m){const p=d[m]||a,g=p(e[m],t[m],m);fe.isUndefined(g)&&p!==u||(n[m]=g)}),n}const C5=e=>{const t=cl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=Pr.from(l),t.url=b5(N5(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),fe.isFormData(n)){if(cr.hasStandardBrowserEnv||cr.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(fe.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,p])=>{f.includes(m.toLowerCase())&&l.set(m,p)})}}if(cr.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&eX(t.url))){const d=a&&o&&tX.read(o);d&&l.set(a,d)}return t},aX=typeof XMLHttpRequest<"u",iX=aX&&function(e){return new Promise(function(n,r){const a=C5(e);let o=a.data;const l=Pr.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=a,m,p,g,x,j;function b(){x&&x(),j&&j(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function N(){if(!w)return;const E=Pr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),C={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:e,request:w};_5(function(O){n(O),b()},function(O){r(O),b()},C),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(N)},w.onabort=function(){w&&(r(new Xe("Request aborted",Xe.ECONNABORTED,e,w)),w=null)},w.onerror=function(T){const C=T&&T.message?T.message:"Network Error",k=new Xe(C,Xe.ERR_NETWORK,e,w);k.event=T||null,r(k),w=null},w.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const C=a.transitional||w5;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),r(new Xe(T,C.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,w)),w=null},o===void 0&&l.setContentType(null),"setRequestHeader"in w&&fe.forEach(l.toJSON(),function(T,C){w.setRequestHeader(C,T)}),fe.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),u&&u!=="json"&&(w.responseType=a.responseType),f&&([g,j]=yv(f,!0),w.addEventListener("progress",g)),d&&w.upload&&([p,x]=yv(d),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",x)),(a.cancelToken||a.signal)&&(m=E=>{w&&(r(!E||E.type?new Du(null,e,w):E),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const A=ZK(a.url);if(A&&cr.protocols.indexOf(A)===-1){r(new Xe("Unsupported protocol "+A+":",Xe.ERR_BAD_REQUEST,e));return}w.send(o||null)})},oX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(f){if(!a){a=!0,u();const m=f instanceof Error?f:this.reason;r.abort(m instanceof Xe?m:new Du(m instanceof Error?m.message:m))}};let l=t&&setTimeout(()=>{l=null,o(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>fe.asap(u),d}},sX=function*(e,t){let n=e.byteLength;if(n{const a=lX(e,t);let o=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await a.next();if(f){u(),d.close();return}let p=m.byteLength;if(n){let g=o+=p;n(g)}d.enqueue(new Uint8Array(m))}catch(f){throw u(f),f}},cancel(d){return u(d),a.return()}},{highWaterMark:2})},OM=64*1024,{isFunction:_p}=fe,uX=(({Request:e,Response:t})=>({Request:e,Response:t}))(fe.global),{ReadableStream:EM,TextEncoder:AM}=fe.global,TM=(e,...t)=>{try{return!!e(...t)}catch{return!1}},dX=e=>{e=fe.merge.call({skipUndefined:!0},uX,e);const{fetch:t,Request:n,Response:r}=e,a=t?_p(t):typeof fetch=="function",o=_p(n),l=_p(r);if(!a)return!1;const u=a&&_p(EM),d=a&&(typeof AM=="function"?(j=>b=>j.encode(b))(new AM):async j=>new Uint8Array(await new n(j).arrayBuffer())),f=o&&u&&TM(()=>{let j=!1;const b=new n(cr.origin,{body:new EM,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!b}),m=l&&u&&TM(()=>fe.isReadableStream(new r("").body)),p={stream:m&&(j=>j.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!p[j]&&(p[j]=(b,w)=>{let N=b&&b[j];if(N)return N.call(b);throw new Xe(`Response type '${j}' is not supported`,Xe.ERR_NOT_SUPPORT,w)})});const g=async j=>{if(j==null)return 0;if(fe.isBlob(j))return j.size;if(fe.isSpecCompliantForm(j))return(await new n(cr.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(j)||fe.isArrayBuffer(j))return j.byteLength;if(fe.isURLSearchParams(j)&&(j=j+""),fe.isString(j))return(await d(j)).byteLength},x=async(j,b)=>{const w=fe.toFiniteNumber(j.getContentLength());return w??g(b)};return async j=>{let{url:b,method:w,data:N,signal:A,cancelToken:E,timeout:T,onDownloadProgress:C,onUploadProgress:k,responseType:O,headers:M,withCredentials:I="same-origin",fetchOptions:z}=C5(j),D=t||fetch;O=O?(O+"").toLowerCase():"text";let H=oX([A,E&&E.toAbortSignal()],T),V=null;const F=H&&H.unsubscribe&&(()=>{H.unsubscribe()});let G;try{if(k&&f&&w!=="get"&&w!=="head"&&(G=await x(M,N))!==0){let $=new n(b,{method:"POST",body:N,duplex:"half"}),B;if(fe.isFormData(N)&&(B=$.headers.get("content-type"))&&M.setContentType(B),$.body){const[Y,ne]=SM(G,yv(_M(k)));N=CM($.body,OM,Y,ne)}}fe.isString(I)||(I=I?"include":"omit");const L=o&&"credentials"in n.prototype,R={...z,signal:H,method:w.toUpperCase(),headers:M.normalize().toJSON(),body:N,duplex:"half",credentials:L?I:void 0};V=o&&new n(b,R);let U=await(o?D(V,z):D(b,R));const K=m&&(O==="stream"||O==="response");if(m&&(C||K&&F)){const $={};["status","statusText","headers"].forEach(oe=>{$[oe]=U[oe]});const B=fe.toFiniteNumber(U.headers.get("content-length")),[Y,ne]=C&&SM(B,yv(_M(C),!0))||[];U=new r(CM(U.body,OM,Y,()=>{ne&&ne(),F&&F()}),$)}O=O||"text";let te=await p[fe.findKey(p,O)||"text"](U,j);return!K&&F&&F(),await new Promise(($,B)=>{_5($,B,{data:te,headers:Pr.from(U.headers),status:U.status,statusText:U.statusText,config:j,request:V})})}catch(L){throw F&&F(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,j,V),{cause:L.cause||L}):Xe.from(L,L&&L.code,j,V)}}},fX=new Map,O5=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let l=o.length,u=l,d,f,m=fX;for(;u--;)d=o[u],f=m.get(d),f===void 0&&m.set(d,f=u?new Map:dX(t)),m=f;return f};O5();const $C={http:AK,xhr:iX,fetch:{get:O5}};fe.forEach($C,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const kM=e=>`- ${e}`,hX=e=>fe.isFunction(e)||e===null||e===!1;function mX(e,t){e=fe.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let l=0;l`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since : -`+l.map(kM).join(` -`):" "+kM(l[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a}const E5={getAdapter:mX,adapters:$C};function L0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Du(null,e)}function MM(e){return L0(e),e.headers=Pr.from(e.headers),e.data=I0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),E5.getAdapter(e.adapter||Nh.adapter,e)(e).then(function(r){return L0(e),r.data=I0.call(e,e.transformResponse,r),r.headers=Pr.from(r.headers),r},function(r){return S5(r)||(L0(e),r&&r.response&&(r.response.data=I0.call(e,e.transformResponse,r.response),r.response.headers=Pr.from(r.response.headers))),Promise.reject(r)})}const A5="1.13.2",Fg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Fg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const PM={};Fg.transitional=function(t,n,r){function a(o,l){return"[Axios v"+A5+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new Xe(a(l," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!PM[l]&&(PM[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Fg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function pX(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new Xe("option "+o+" must be "+d,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+o,Xe.ERR_BAD_OPTION)}}const nv={assertOptions:pX,validators:Fg},ei=nv.validators;let tl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new wM,response:new wM}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=cl(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&nv.assertOptions(r,{silentJSONParsing:ei.transitional(ei.boolean),forcedJSONParsing:ei.transitional(ei.boolean),clarifyTimeoutError:ei.transitional(ei.boolean)},!1),a!=null&&(fe.isFunction(a)?n.paramsSerializer={serialize:a}:nv.assertOptions(a,{encode:ei.function,serialize:ei.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),nv.assertOptions(n,{baseUrl:ei.spelling("baseURL"),withXsrfToken:ei.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&fe.merge(o.common,o[n.method]);o&&fe.forEach(["delete","get","head","post","put","patch","common"],j=>{delete o[j]}),n.headers=Pr.concat(l,o);const u=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const f=[];this.interceptors.response.forEach(function(b){f.push(b.fulfilled,b.rejected)});let m,p=0,g;if(!d){const j=[MM.bind(this),void 0];for(j.unshift(...u),j.push(...f),g=j.length,m=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(a);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new Du(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new T5(function(a){t=a}),cancel:t}}};function gX(e){return function(n){return e.apply(null,n)}}function yX(e){return fe.isObject(e)&&e.isAxiosError===!0}const g_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(g_).forEach(([e,t])=>{g_[t]=e});function k5(e){const t=new tl(e),n=l5(tl.prototype.request,t);return fe.extend(n,tl.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return k5(cl(e,a))},n}const ln=k5(Nh);ln.Axios=tl;ln.CanceledError=Du;ln.CancelToken=vX;ln.isCancel=S5;ln.VERSION=A5;ln.toFormData=qg;ln.AxiosError=Xe;ln.Cancel=ln.CanceledError;ln.all=function(t){return Promise.all(t)};ln.spread=gX;ln.isAxiosError=yX;ln.mergeConfig=cl;ln.AxiosHeaders=Pr;ln.formToJSON=e=>j5(fe.isHTMLForm(e)?new FormData(e):e);ln.getAdapter=E5.getAdapter;ln.HttpStatusCode=g_;ln.default=ln;const{Axios:fAe,AxiosError:hAe,CanceledError:mAe,isCancel:pAe,CancelToken:vAe,VERSION:gAe,all:yAe,Cancel:xAe,isAxiosError:bAe,spread:wAe,toFormData:jAe,AxiosHeaders:SAe,HttpStatusCode:_Ae,formToJSON:NAe,getAdapter:CAe,mergeConfig:OAe}=ln;function M5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),P5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xv="-",RM=[],wX="arbitrary..",jX=e=>{const t=_X(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return SX(l);const u=l.split(xv),d=u[0]===""&&u.length>1?1:0;return R5(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?xX(f,d):d:f||RM}return n[l]||RM}}},R5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const f=R5(e,t+1,o);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(xv):e.slice(t).join(xv),d=l.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?wX+r:void 0})(),_X=e=>{const{theme:t,classGroups:n}=e;return NX(n,t)},NX=(e,t)=>{const n=P5();for(const r in e){const a=e[r];IC(a,n,r,t)}return n},IC=(e,t,n,r)=>{const a=e.length;for(let o=0;o{if(typeof e=="string"){OX(e,t,n);return}if(typeof e=="function"){EX(e,t,n,r);return}AX(e,t,n,r)},OX=(e,t,n)=>{const r=e===""?t:D5(t,e);r.classGroupId=n},EX=(e,t,n,r)=>{if(TX(e)){IC(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(bX(n,e))},AX=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l{let n=e;const r=t.split(xv),a=r.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,kX=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},y_="!",DM=":",MX=[],$M=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),PX=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,u=0,d=0,f;const m=a.length;for(let b=0;bd?f-d:void 0;return $M(o,x,g,j)};if(t){const a=t+DM,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):$M(MX,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},RX=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},DX=e=>({cache:kX(e.cacheSize),parseClassName:PX(e),sortModifiers:RX(e),...jX(e)}),$X=/\s+/,IX=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],u=e.trim().split($X);let d="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:p,modifiers:g,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let w=!!b,N=r(w?j.substring(0,b):j);if(!N){if(!w){d=m+(d.length>0?" "+d:d);continue}if(N=r(j),!N){d=m+(d.length>0?" "+d:d);continue}w=!1}const A=g.length===0?"":g.length===1?g[0]:o(g).join(":"),E=x?A+y_:A,T=E+N;if(l.indexOf(T)>-1)continue;l.push(T);const C=a(N,w);for(let k=0;k0?" "+d:d)}return d},LX=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,o;const l=d=>{const f=t.reduce((m,p)=>p(m),e());return n=DX(f),r=n.cache.get,a=n.cache.set,o=u,u(d)},u=d=>{const f=r(d);if(f)return f;const m=IX(d,n);return a(d,m),m};return o=l,(...d)=>o(LX(...d))},zX=[],En=e=>{const t=n=>n[e]||zX;return t.isThemeGetter=!0,t},I5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,L5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qX=/^\d+\/\d+$/,FX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,UX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,HX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,WX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wc=e=>qX.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>!!e&&Number.isInteger(Number(e)),B0=e=>e.endsWith("%")&&nt(e.slice(0,-1)),Fi=e=>FX.test(e),GX=()=>!0,YX=e=>UX.test(e)&&!HX.test(e),B5=()=>!1,KX=e=>WX.test(e),XX=e=>VX.test(e),ZX=e=>!Te(e)&&!ke(e),QX=e=>$u(e,F5,B5),Te=e=>I5.test(e),Ls=e=>$u(e,U5,YX),z0=e=>$u(e,rZ,nt),IM=e=>$u(e,z5,B5),JX=e=>$u(e,q5,XX),Np=e=>$u(e,H5,KX),ke=e=>L5.test(e),Kd=e=>Iu(e,U5),eZ=e=>Iu(e,aZ),LM=e=>Iu(e,z5),tZ=e=>Iu(e,F5),nZ=e=>Iu(e,q5),Cp=e=>Iu(e,H5,!0),$u=(e,t,n)=>{const r=I5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Iu=(e,t,n=!1)=>{const r=L5.exec(e);return r?r[1]?t(r[1]):n:!1},z5=e=>e==="position"||e==="percentage",q5=e=>e==="image"||e==="url",F5=e=>e==="length"||e==="size"||e==="bg-size",U5=e=>e==="length",rZ=e=>e==="number",aZ=e=>e==="family-name",H5=e=>e==="shadow",iZ=()=>{const e=En("color"),t=En("font"),n=En("text"),r=En("font-weight"),a=En("tracking"),o=En("leading"),l=En("breakpoint"),u=En("container"),d=En("spacing"),f=En("radius"),m=En("shadow"),p=En("inset-shadow"),g=En("text-shadow"),x=En("drop-shadow"),j=En("blur"),b=En("perspective"),w=En("aspect"),N=En("ease"),A=En("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...T(),ke,Te],k=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[ke,Te,d],I=()=>[wc,"full","auto",...M()],z=()=>[Lo,"none","subgrid",ke,Te],D=()=>["auto",{span:["full",Lo,ke,Te]},Lo,ke,Te],H=()=>[Lo,"auto",ke,Te],V=()=>["auto","min","max","fr",ke,Te],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...M()],R=()=>[wc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],U=()=>[e,ke,Te],K=()=>[...T(),LM,IM,{position:[ke,Te]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",tZ,QX,{size:[ke,Te]}],B=()=>[B0,Kd,Ls],Y=()=>["","none","full",f,ke,Te],ne=()=>["",nt,Kd,Ls],oe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[nt,B0,LM,IM],ae=()=>["","none",j,ke,Te],Z=()=>["none",nt,ke,Te],pe=()=>["none",nt,ke,Te],je=()=>[nt,ke,Te],le=()=>[wc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fi],breakpoint:[Fi],color:[GX],container:[Fi],"drop-shadow":[Fi],ease:["in","out","in-out"],font:[ZX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fi],shadow:[Fi],spacing:["px",nt],text:[Fi],"text-shadow":[Fi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wc,Te,ke,w]}],container:["container"],columns:[{columns:[nt,Te,ke,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Lo,"auto",ke,Te]}],basis:[{basis:[wc,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,wc,"auto","initial","none",Te]}],grow:[{grow:["",nt,ke,Te]}],shrink:[{shrink:["",nt,ke,Te]}],order:[{order:[Lo,"first","last","none",ke,Te]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[u,"screen",...R()]}],"min-w":[{"min-w":[u,"screen","none",...R()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",n,Kd,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,z0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",B0,Te]}],"font-family":[{font:[eZ,Te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ke,Te]}],"line-clamp":[{"line-clamp":[nt,"none",ke,z0]}],leading:[{leading:[o,...M()]}],"list-image":[{"list-image":["none",ke,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",ke,Ls]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[nt,"auto",ke,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Lo,ke,Te],radial:["",ke,Te],conic:[Lo,ke,Te]},nZ,JX]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,ke,Te]}],"outline-w":[{outline:["",nt,Kd,Ls]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",m,Cp,Np]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",p,Cp,Np]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[nt,Ls]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",g,Cp,Np]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[nt,ke,Te]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[ke,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Te]}],filter:[{filter:["","none",ke,Te]}],blur:[{blur:ae()}],brightness:[{brightness:[nt,ke,Te]}],contrast:[{contrast:[nt,ke,Te]}],"drop-shadow":[{"drop-shadow":["","none",x,Cp,Np]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",nt,ke,Te]}],"hue-rotate":[{"hue-rotate":[nt,ke,Te]}],invert:[{invert:["",nt,ke,Te]}],saturate:[{saturate:[nt,ke,Te]}],sepia:[{sepia:["",nt,ke,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Te]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[nt,ke,Te]}],"backdrop-contrast":[{"backdrop-contrast":[nt,ke,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,ke,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,ke,Te]}],"backdrop-invert":[{"backdrop-invert":["",nt,ke,Te]}],"backdrop-opacity":[{"backdrop-opacity":[nt,ke,Te]}],"backdrop-saturate":[{"backdrop-saturate":[nt,ke,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,ke,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",ke,Te]}],ease:[{ease:["linear","initial",N,ke,Te]}],delay:[{delay:[nt,ke,Te]}],animate:[{animate:["none",A,ke,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,Te]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[ke,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,Te]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[nt,Kd,Ls,z0]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},oZ=BX(iZ);function de(...e){return oZ(Ye(e))}const st=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:de("rounded-xl border bg-card text-card-foreground shadow",e),...t}));st.displayName="Card";const qt=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:de("flex flex-col space-y-1.5 p-6",e),...t}));qt.displayName="CardHeader";const Ft=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:de("font-semibold leading-none tracking-tight",e),...t}));Ft.displayName="CardTitle";const er=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:de("text-sm text-muted-foreground",e),...t}));er.displayName="CardDescription";const on=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:de("p-6 pt-0",e),...t}));on.displayName="CardContent";const W5=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:de("flex items-center p-6 pt-0",e),...t}));W5.displayName="CardFooter";function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function sZ(e,t){const n=y.createContext(t),r=o=>{const{children:l,...u}=o,d=y.useMemo(()=>u,Object.values(u));return i.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(o){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function hr(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l),d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return i.jsx(b.Provider,{value:w,children:x})};f.displayName=o+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{const o=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,lZ(a,...t)]}function lZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function BM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rr(...e){return t=>{let n=!1;const r=e.map(a=>{const o=BM(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(dZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function cZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=hZ(a),u=fZ(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uZ=Symbol("radix.slottable");function dZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uZ}function fZ(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function hZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ch(e){const t=e+"CollectionProvider",[n,r]=hr(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:N}=b,A=W.useRef(null),E=W.useRef(new Map).current;return i.jsx(a,{scope:w,itemMap:E,collectionRef:A,children:N})};l.displayName=t;const u=e+"CollectionSlot",d=zM(u),f=W.forwardRef((b,w)=>{const{scope:N,children:A}=b,E=o(u,N),T=qe(w,E.collectionRef);return i.jsx(d,{ref:T,children:A})});f.displayName=u;const m=e+"CollectionItemSlot",p="data-radix-collection-item",g=zM(m),x=W.forwardRef((b,w)=>{const{scope:N,children:A,...E}=b,T=W.useRef(null),C=qe(w,T),k=o(m,N);return W.useEffect(()=>(k.itemMap.set(T,{ref:T,...E}),()=>void k.itemMap.delete(T))),i.jsx(g,{[p]:"",ref:C,children:A})});x.displayName=m;function j(b){const w=o(e+"CollectionConsumer",b);return W.useCallback(()=>{const A=w.collectionRef.current;if(!A)return[];const E=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((k,O)=>E.indexOf(k.ref.current)-E.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},j,r]}var Un=globalThis?.document?y.useLayoutEffect:()=>{},mZ=jC[" useId ".trim().toString()]||(()=>{}),pZ=0;function Fn(e){const[t,n]=y.useState(mZ());return Un(()=>{n(r=>r??String(pZ++))},[e]),t?`radix-${t}`:""}function vZ(e){const t=gZ(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(xZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function gZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=wZ(a),u=bZ(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yZ=Symbol("radix.slottable");function xZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yZ}function bZ(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function wZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=jZ.reduce((e,t)=>{const n=vZ(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function LC(e,t){e&&wl.flushSync(()=>e.dispatchEvent(t))}function nn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var SZ=jC[" useInsertionEffect ".trim().toString()]||Un;function Na({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,l]=_Z({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,r])}const f=y.useCallback(m=>{if(u){const p=NZ(m)?m(e):m;p!==e&&l.current?.(p)}else o(m)},[u,e,o,l]);return[d,f]}function _Z({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),o=y.useRef(t);return SZ(()=>{o.current=t},[t]),y.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function NZ(e){return typeof e=="function"}var CZ=y.createContext(void 0);function Lu(e){const t=y.useContext(CZ);return e||t||"ltr"}var q0="rovingFocusGroup.onEntryFocus",OZ={bubbles:!1,cancelable:!0},Oh="RovingFocusGroup",[x_,V5,EZ]=Ch(Oh),[AZ,Ug]=hr(Oh,[EZ]),[TZ,kZ]=AZ(Oh),G5=y.forwardRef((e,t)=>i.jsx(x_.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(x_.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(MZ,{...e,ref:t})})}));G5.displayName=Oh;var MZ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=e,g=y.useRef(null),x=qe(t,g),j=Lu(o),[b,w]=Na({prop:l,defaultProp:u??null,onChange:d,caller:Oh}),[N,A]=y.useState(!1),E=nn(f),T=V5(n),C=y.useRef(!1),[k,O]=y.useState(0);return y.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(q0,E),()=>M.removeEventListener(q0,E)},[E]),i.jsx(TZ,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:y.useCallback(M=>w(M),[w]),onItemShiftTab:y.useCallback(()=>A(!0),[]),onFocusableItemAdd:y.useCallback(()=>O(M=>M+1),[]),onFocusableItemRemove:y.useCallback(()=>O(M=>M-1),[]),children:i.jsx(Pe.div,{tabIndex:N||k===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{C.current=!0}),onFocus:Se(e.onFocus,M=>{const I=!C.current;if(M.target===M.currentTarget&&I&&!N){const z=new CustomEvent(q0,OZ);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const D=T().filter(L=>L.focusable),H=D.find(L=>L.active),V=D.find(L=>L.id===b),G=[H,V,...D].filter(Boolean).map(L=>L.ref.current);X5(G,m)}}C.current=!1}),onBlur:Se(e.onBlur,()=>A(!1))})})}),Y5="RovingFocusGroupItem",K5=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:l,...u}=e,d=Fn(),f=o||d,m=kZ(Y5,n),p=m.currentTabStopId===f,g=V5(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=m;return y.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),i.jsx(x_.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:i.jsx(Pe.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Se(e.onMouseDown,w=>{r?m.onItemFocus(f):w.preventDefault()}),onFocus:Se(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Se(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=DZ(w,m.orientation,m.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=g().filter(T=>T.focusable).map(T=>T.ref.current);if(N==="last")E.reverse();else if(N==="prev"||N==="next"){N==="prev"&&E.reverse();const T=E.indexOf(w.currentTarget);E=m.loop?$Z(E,T+1):E.slice(T+1)}setTimeout(()=>X5(E))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:b!=null}):l})})});K5.displayName=Y5;var PZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DZ(e,t,n){const r=RZ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return PZ[r]}function X5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $Z(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Z5=G5,Q5=K5;function IZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Rn=e=>{const{present:t,children:n}=e,r=LZ(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=qe(r.ref,BZ(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:o}):null};Rn.displayName="Presence";function LZ(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=IZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Op(r.current);o.current=u==="mounted"?f:"none"},[u]),Un(()=>{const f=r.current,m=a.current;if(m!==e){const g=o.current,x=Op(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Un(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=x=>{const b=Op(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(o.current=Op(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Op(e){return e?.animationName||"none"}function BZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Hg="Tabs",[zZ]=hr(Hg,[Ug]),J5=Ug(),[qZ,BC]=zZ(Hg),eB=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,m=Lu(u),[p,g]=Na({prop:r,onChange:a,defaultProp:o??"",caller:Hg});return i.jsx(qZ,{scope:n,baseId:Fn(),value:p,onValueChange:g,orientation:l,dir:m,activationMode:d,children:i.jsx(Pe.div,{dir:m,"data-orientation":l,...f,ref:t})})});eB.displayName=Hg;var tB="TabsList",nB=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=BC(tB,n),l=J5(n);return i.jsx(Z5,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:i.jsx(Pe.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});nB.displayName=tB;var rB="TabsTrigger",aB=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,l=BC(rB,n),u=J5(n),d=sB(l.baseId,r),f=lB(l.baseId,r),m=r===l.value;return i.jsx(Q5,{asChild:!0,...u,focusable:!a,active:m,children:i.jsx(Pe.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...o,ref:t,onMouseDown:Se(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:Se(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:Se(e.onFocus,()=>{const p=l.activationMode!=="manual";!m&&!a&&p&&l.onValueChange(r)})})})});aB.displayName=rB;var iB="TabsContent",oB=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...l}=e,u=BC(iB,n),d=sB(u.baseId,r),f=lB(u.baseId,r),m=r===u.value,p=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),i.jsx(Rn,{present:a||m,children:({present:g})=>i.jsx(Pe.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});oB.displayName=iB;function sB(e,t){return`${e}-trigger-${t}`}function lB(e,t){return`${e}-content-${t}`}var FZ=eB,cB=nB,uB=aB,dB=oB;const ul=FZ,Qo=y.forwardRef(({className:e,...t},n)=>i.jsx(cB,{ref:n,className:de("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Qo.displayName=cB.displayName;const Ot=y.forwardRef(({className:e,...t},n)=>i.jsx(uB,{ref:n,className:de("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Ot.displayName=uB.displayName;const en=y.forwardRef(({className:e,...t},n)=>i.jsx(dB,{ref:n,className:de("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));en.displayName=dB.displayName;function Ef(e,[t,n]){return Math.min(n,Math.max(t,e))}function UZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var zC="ScrollArea",[fB]=hr(zC),[HZ,Oa]=fB(zC),hB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...l}=e,[u,d]=y.useState(null),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,A]=y.useState(0),[E,T]=y.useState(0),[C,k]=y.useState(!1),[O,M]=y.useState(!1),I=qe(t,D=>d(D)),z=Lu(a);return i.jsx(HZ,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:u,viewport:f,onViewportChange:m,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:C,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:O,onScrollbarYEnabledChange:M,onCornerWidthChange:A,onCornerHeightChange:T,children:i.jsx(Pe.div,{dir:z,...l,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});hB.displayName=zC;var mB="ScrollAreaViewport",pB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,l=Oa(mB,n),u=y.useRef(null),d=qe(t,u,l.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),i.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});pB.displayName=mB;var xi="ScrollAreaScrollbar",qC=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(xi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),a.type==="hover"?i.jsx(WZ,{...r,ref:t,forceMount:n}):a.type==="scroll"?i.jsx(VZ,{...r,ref:t,forceMount:n}):a.type==="auto"?i.jsx(vB,{...r,ref:t,forceMount:n}):a.type==="always"?i.jsx(FC,{...r,ref:t}):null});qC.displayName=xi;var WZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(xi,e.__scopeScrollArea),[o,l]=y.useState(!1);return y.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},m=()=>{d=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),i.jsx(Rn,{present:n||o,children:i.jsx(vB,{"data-state":o?"visible":"hidden",...r,ref:t})})}),VZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(xi,e.__scopeScrollArea),o=e.orientation==="horizontal",l=Vg(()=>d("SCROLL_END"),100),[u,d]=UZ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,a.scrollHideDelay,d]),y.useEffect(()=>{const f=a.viewport,m=o?"scrollLeft":"scrollTop";if(f){let p=f[m];const g=()=>{const x=f[m];p!==x&&(d("SCROLL"),l()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,o,d,l]),i.jsx(Rn,{present:n||u!=="hidden",children:i.jsx(FC,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Se(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Se(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),vB=y.forwardRef((e,t)=>{const n=Oa(xi,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,l]=y.useState(!1),u=e.orientation==="horizontal",d=Vg(()=>{if(n.viewport){const f=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Oa(xi,e.__scopeScrollArea),o=y.useRef(null),l=y.useRef(0),[u,d]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=wB(u.viewport,u.content),m={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function p(g,x){return QZ(g,l.current,u,x)}return n==="horizontal"?i.jsx(GZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollLeft,x=qM(g,u,a.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?i.jsx(YZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollTop,x=qM(g,u);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),GZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Oa(xi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,o.onScrollbarXChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(yB,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(o.viewport){const g=o.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),SB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:wv(l.paddingLeft),paddingEnd:wv(l.paddingRight)}})}})}),YZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Oa(xi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,o.onScrollbarYChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(yB,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(o.viewport){const g=o.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),SB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:wv(l.paddingTop),paddingEnd:wv(l.paddingBottom)}})}})}),[KZ,gB]=fB(xi),yB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:p,...g}=e,x=Oa(xi,n),[j,b]=y.useState(null),w=qe(t,I=>b(I)),N=y.useRef(null),A=y.useRef(""),E=x.viewport,T=r.content-r.viewport,C=nn(m),k=nn(d),O=Vg(p,10);function M(I){if(N.current){const z=I.clientX-N.current.left,D=I.clientY-N.current.top;f({x:z,y:D})}}return y.useEffect(()=>{const I=z=>{const D=z.target;j?.contains(D)&&C(z,T)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,j,T,C]),y.useEffect(k,[r,k]),ru(j,O),ru(x.content,O),i.jsx(KZ,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:nn(o),onThumbPointerUp:nn(l),onThumbPositionChange:k,onThumbPointerDown:nn(u),children:i.jsx(Pe.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Se(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),N.current=j.getBoundingClientRect(),A.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),M(I))}),onPointerMove:Se(e.onPointerMove,M),onPointerUp:Se(e.onPointerUp,I=>{const z=I.target;z.hasPointerCapture(I.pointerId)&&z.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=A.current,x.viewport&&(x.viewport.style.scrollBehavior=""),N.current=null})})})}),bv="ScrollAreaThumb",xB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=gB(bv,e.__scopeScrollArea);return i.jsx(Rn,{present:n||a.hasThumb,children:i.jsx(XZ,{ref:t,...r})})}),XZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Oa(bv,n),l=gB(bv,n),{onThumbPositionChange:u}=l,d=qe(t,p=>l.onThumbChange(p)),f=y.useRef(void 0),m=Vg(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const p=o.viewport;if(p){const g=()=>{if(m(),!f.current){const x=JZ(p,u);f.current=x,u()}};return u(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,m,u]),i.jsx(Pe.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Se(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;l.onThumbPointerDown({x:j,y:b})}),onPointerUp:Se(e.onPointerUp,l.onThumbPointerUp)})});xB.displayName=bv;var UC="ScrollAreaCorner",bB=y.forwardRef((e,t)=>{const n=Oa(UC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(ZZ,{...e,ref:t}):null});bB.displayName=UC;var ZZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Oa(UC,n),[o,l]=y.useState(0),[u,d]=y.useState(0),f=!!(o&&u);return ru(a.scrollbarX,()=>{const m=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(m),d(m)}),ru(a.scrollbarY,()=>{const m=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(m),l(m)}),f?i.jsx(Pe.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function wv(e){return e?parseInt(e,10):0}function wB(e,t){const n=e/t;return isNaN(n)?0:n}function Wg(e){const t=wB(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function QZ(e,t,n,r="ltr"){const a=Wg(n),o=a/2,l=t||o,u=a-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return jB([d,f],p)(e)}function qM(e,t,n="ltr"){const r=Wg(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,l=t.content-t.viewport,u=o-r,d=n==="ltr"?[0,l]:[l*-1,0],f=Ef(e,d);return jB([0,l],[0,u])(f)}function jB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function SB(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Vg(e,t){const n=nn(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ru(e,t){const n=nn(t);Un(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var _B=hB,eQ=pB,tQ=bB;const Vt=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(_B,{ref:r,className:de("relative overflow-hidden",e),...n,children:[i.jsx(eQ,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(NB,{}),i.jsx(tQ,{})]}));Vt.displayName=_B.displayName;const NB=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(qC,{ref:r,orientation:t,className:de("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(xB,{className:"relative flex-1 rounded-full bg-border"})}));NB.displayName=qC.displayName;function FM({className:e,...t}){return i.jsx("div",{className:de("animate-pulse rounded-md bg-primary/10",e),...t})}var F0,UM;function Lr(){if(UM)return F0;UM=1;var e=Array.isArray;return F0=e,F0}var U0,HM;function CB(){if(HM)return U0;HM=1;var e=typeof xp=="object"&&xp&&xp.Object===Object&&xp;return U0=e,U0}var H0,WM;function bi(){if(WM)return H0;WM=1;var e=CB(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return H0=n,H0}var W0,VM;function Eh(){if(VM)return W0;VM=1;var e=bi(),t=e.Symbol;return W0=t,W0}var V0,GM;function nQ(){if(GM)return V0;GM=1;var e=Eh(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function o(l){var u=n.call(l,a),d=l[a];try{l[a]=void 0;var f=!0}catch{}var m=r.call(l);return f&&(u?l[a]=d:delete l[a]),m}return V0=o,V0}var G0,YM;function rQ(){if(YM)return G0;YM=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return G0=n,G0}var Y0,KM;function lo(){if(KM)return Y0;KM=1;var e=Eh(),t=nQ(),n=rQ(),r="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:r:o&&o in Object(u)?t(u):n(u)}return Y0=l,Y0}var K0,XM;function co(){if(XM)return K0;XM=1;function e(t){return t!=null&&typeof t=="object"}return K0=e,K0}var X0,ZM;function Bu(){if(ZM)return X0;ZM=1;var e=lo(),t=co(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return X0=r,X0}var Z0,QM;function HC(){if(QM)return Z0;QM=1;var e=Lr(),t=Bu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return Z0=a,Z0}var Q0,JM;function os(){if(JM)return Q0;JM=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Q0=e,Q0}var J0,eP;function WC(){if(eP)return J0;eP=1;var e=lo(),t=os(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==a||d==n||d==o}return J0=l,J0}var ew,tP;function aQ(){if(tP)return ew;tP=1;var e=bi(),t=e["__core-js_shared__"];return ew=t,ew}var tw,nP;function iQ(){if(nP)return tw;nP=1;var e=aQ(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return tw=n,tw}var nw,rP;function OB(){if(rP)return nw;rP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return nw=n,nw}var rw,aP;function oQ(){if(aP)return rw;aP=1;var e=WC(),t=iQ(),n=os(),r=OB(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,f=u.hasOwnProperty,m=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var x=e(g)?m:o;return x.test(r(g))}return rw=p,rw}var aw,iP;function sQ(){if(iP)return aw;iP=1;function e(t,n){return t?.[n]}return aw=e,aw}var iw,oP;function jl(){if(oP)return iw;oP=1;var e=oQ(),t=sQ();function n(r,a){var o=t(r,a);return e(o)?o:void 0}return iw=n,iw}var ow,sP;function Gg(){if(sP)return ow;sP=1;var e=jl(),t=e(Object,"create");return ow=t,ow}var sw,lP;function lQ(){if(lP)return sw;lP=1;var e=Gg();function t(){this.__data__=e?e(null):{},this.size=0}return sw=t,sw}var lw,cP;function cQ(){if(cP)return lw;cP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return lw=e,lw}var cw,uP;function uQ(){if(uP)return cw;uP=1;var e=Gg(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(o){var l=this.__data__;if(e){var u=l[o];return u===t?void 0:u}return r.call(l,o)?l[o]:void 0}return cw=a,cw}var uw,dP;function dQ(){if(dP)return uw;dP=1;var e=Gg(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var o=this.__data__;return e?o[a]!==void 0:n.call(o,a)}return uw=r,uw}var dw,fP;function fQ(){if(fP)return dw;fP=1;var e=Gg(),t="__lodash_hash_undefined__";function n(r,a){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&a===void 0?t:a,this}return dw=n,dw}var fw,hP;function hQ(){if(hP)return fw;hP=1;var e=lQ(),t=cQ(),n=uQ(),r=dQ(),a=fQ();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u-1}return yw=t,yw}var xw,bP;function yQ(){if(bP)return xw;bP=1;var e=Yg();function t(n,r){var a=this.__data__,o=e(a,n);return o<0?(++this.size,a.push([n,r])):a[o][1]=r,this}return xw=t,xw}var bw,wP;function Kg(){if(wP)return bw;wP=1;var e=mQ(),t=pQ(),n=vQ(),r=gQ(),a=yQ();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u0?1:-1},Gs=function(t){return dl(t)&&t.indexOf("%")===t.length-1},Ce=function(t){return qQ(t)&&!Ah(t)},FQ=function(t){return Ge(t)},Mn=function(t){return Ce(t)||dl(t)},UQ=0,qu=function(t){var n=++UQ;return"".concat(t||"").concat(n)},wr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(t)&&!dl(t))return r;var o;if(Gs(t)){var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return Ah(o)&&(o=r),a&&o>n&&(o=n),o},Fo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},HQ=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function w_(e){"@babel/helpers - typeof";return w_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w_(e)}var KP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ji=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},XP=null,Vw=null,QC=function e(t){if(t===XP&&Array.isArray(Vw))return Vw;var n=[];return y.Children.forEach(t,function(r){Ge(r)||(IQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Vw=n,XP=t,n};function na(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Ji(a)}):r=[Ji(t)],QC(e).forEach(function(a){var o=ta(a,"type.displayName")||ta(a,"type.name");r.indexOf(o)!==-1&&n.push(a)}),n}function Kr(e,t){var n=na(e,t);return n&&n[0]}var ZP=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Ce(r)||r<=0||!Ce(a)||a<=0)},QQ=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],JQ=function(t){return t&&t.type&&dl(t.type)&&QQ.indexOf(t.type)>=0},eJ=function(t){return t&&w_(t)==="object"&&"clipDot"in t},tJ=function(t,n,r,a){var o,l=(o=Ww?.[a])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!We(t)&&(a&&l.includes(n)||GQ.includes(n))||r&&ZC.includes(n)},Be=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(y.isValidElement(t)&&(a=t.props),!zu(a))return null;var o={};return Object.keys(a).forEach(function(l){var u;tJ((u=a)===null||u===void 0?void 0:u[l],l,n,r)&&(o[l]=a[l])}),o},j_=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return QP(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function __(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,d=e.desc,f=iJ(e,aJ),m=a||{width:n,height:r,x:0,y:0},p=Ye("recharts-surface",o);return W.createElement("svg",S_({},Be(f,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),W.createElement("title",null,u),W.createElement("desc",null,d),t)}var sJ=["children","className"];function N_(){return N_=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var pt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=lJ(e,sJ),o=Ye("recharts-layer",r);return W.createElement("g",N_({className:o},Be(a,!0),{ref:t}),n)}),qa=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;oo?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(o);++a=o?n:e(n,r,a)}return Yw=t,Yw}var Kw,nR;function PB(){if(nR)return Kw;nR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+o+"]");function d(f){return u.test(f)}return Kw=d,Kw}var Xw,rR;function fJ(){if(rR)return Xw;rR=1;function e(t){return t.split("")}return Xw=e,Xw}var Zw,aR;function hJ(){if(aR)return Zw;aR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+d+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+o+"]?",w="(?:"+x+"(?:"+[m,p,g].join("|")+")"+b+j+")*",N=b+j+w,A="(?:"+[m+u+"?",u,p,g,l].join("|")+")",E=RegExp(d+"(?="+d+")|"+A+N,"g");function T(C){return C.match(E)||[]}return Zw=T,Zw}var Qw,iR;function mJ(){if(iR)return Qw;iR=1;var e=fJ(),t=PB(),n=hJ();function r(a){return t(a)?n(a):e(a)}return Qw=r,Qw}var Jw,oR;function pJ(){if(oR)return Jw;oR=1;var e=dJ(),t=PB(),n=mJ(),r=AB();function a(o){return function(l){l=r(l);var u=t(l)?n(l):void 0,d=u?u[0]:l.charAt(0),f=u?e(u,1).join(""):l.slice(1);return d[o]()+f}}return Jw=a,Jw}var ej,sR;function vJ(){if(sR)return ej;sR=1;var e=pJ(),t=e("toUpperCase");return ej=t,ej}var gJ=vJ();const Qg=St(gJ);function Ht(e){return function(){return e}}const RB=Math.cos,_v=Math.sin,Ga=Math.sqrt,Nv=Math.PI,Jg=2*Nv,C_=Math.PI,O_=2*C_,Fs=1e-6,yJ=O_-Fs;function DB(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return DB;const n=10**t;return function(r){this._+=r[0];for(let a=1,o=r.length;aFs)if(!(Math.abs(p*d-f*m)>Fs)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,j=a-u,b=d*d+f*f,w=x*x+j*j,N=Math.sqrt(b),A=Math.sqrt(g),E=o*Math.tan((C_-Math.acos((b+g-w)/(2*N*A)))/2),T=E/A,C=E/N;Math.abs(T-1)>Fs&&this._append`L${t+T*m},${n+T*p}`,this._append`A${o},${o},0,0,${+(p*x>m*j)},${this._x1=t+C*d},${this._y1=n+C*f}`}}arc(t,n,r,a,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(a),d=r*Math.sin(a),f=t+u,m=n+d,p=1^l,g=l?a-o:o-a;this._x1===null?this._append`M${f},${m}`:(Math.abs(this._x1-f)>Fs||Math.abs(this._y1-m)>Fs)&&this._append`L${f},${m}`,r&&(g<0&&(g=g%O_+O_),g>yJ?this._append`A${r},${r},0,1,${p},${t-u},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=m}`:g>Fs&&this._append`A${r},${r},0,${+(g>=C_)},${p},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function JC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new bJ(t)}function eO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $B(e){this._context=e}$B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ey(e){return new $B(e)}function IB(e){return e[0]}function LB(e){return e[1]}function BB(e,t){var n=Ht(!0),r=null,a=ey,o=null,l=JC(u);e=typeof e=="function"?e:e===void 0?IB:Ht(e),t=typeof t=="function"?t:t===void 0?LB:Ht(t);function u(d){var f,m=(d=eO(d)).length,p,g=!1,x;for(r==null&&(o=a(x=l())),f=0;f<=m;++f)!(f=x;--j)u.point(E[j],T[j]);u.lineEnd(),u.areaEnd()}N&&(E[g]=+e(w,g,p),T[g]=+t(w,g,p),u.point(r?+r(w,g,p):E[g],n?+n(w,g,p):T[g]))}if(A)return u=null,A+""||null}function m(){return BB().defined(a).curve(l).context(o)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:Ht(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Ht(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Ht(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:Ht(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Ht(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Ht(+p),f):n},f.lineX0=f.lineY0=function(){return m().x(e).y(t)},f.lineY1=function(){return m().x(e).y(n)},f.lineX1=function(){return m().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:Ht(!!p),f):a},f.curve=function(p){return arguments.length?(l=p,o!=null&&(u=l(o)),f):l},f.context=function(p){return arguments.length?(p==null?o=u=null:u=l(o=p),f):o},f}class zB{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function wJ(e){return new zB(e,!0)}function jJ(e){return new zB(e,!1)}const tO={draw(e,t){const n=Ga(t/Nv);e.moveTo(n,0),e.arc(0,0,n,0,Jg)}},SJ={draw(e,t){const n=Ga(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},qB=Ga(1/3),_J=qB*2,NJ={draw(e,t){const n=Ga(t/_J),r=n*qB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},CJ={draw(e,t){const n=Ga(t),r=-n/2;e.rect(r,r,n,n)}},OJ=.8908130915292852,FB=_v(Nv/10)/_v(7*Nv/10),EJ=_v(Jg/10)*FB,AJ=-RB(Jg/10)*FB,TJ={draw(e,t){const n=Ga(t*OJ),r=EJ*n,a=AJ*n;e.moveTo(0,-n),e.lineTo(r,a);for(let o=1;o<5;++o){const l=Jg*o/5,u=RB(l),d=_v(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*a,d*r+u*a)}e.closePath()}},tj=Ga(3),kJ={draw(e,t){const n=-Ga(t/(tj*3));e.moveTo(0,n*2),e.lineTo(-tj*n,-n),e.lineTo(tj*n,-n),e.closePath()}},ga=-.5,ya=Ga(3)/2,E_=1/Ga(12),MJ=(E_/2+1)*3,PJ={draw(e,t){const n=Ga(t/MJ),r=n/2,a=n*E_,o=r,l=n*E_+n,u=-o,d=l;e.moveTo(r,a),e.lineTo(o,l),e.lineTo(u,d),e.lineTo(ga*r-ya*a,ya*r+ga*a),e.lineTo(ga*o-ya*l,ya*o+ga*l),e.lineTo(ga*u-ya*d,ya*u+ga*d),e.lineTo(ga*r+ya*a,ga*a-ya*r),e.lineTo(ga*o+ya*l,ga*l-ya*o),e.lineTo(ga*u+ya*d,ga*d-ya*u),e.closePath()}};function RJ(e,t){let n=null,r=JC(a);e=typeof e=="function"?e:Ht(e||tO),t=typeof t=="function"?t:Ht(t===void 0?64:+t);function a(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return a.type=function(o){return arguments.length?(e=typeof o=="function"?o:Ht(o),a):e},a.size=function(o){return arguments.length?(t=typeof o=="function"?o:Ht(+o),a):t},a.context=function(o){return arguments.length?(n=o??null,a):n},a}function Cv(){}function Ov(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function UB(e){this._context=e}UB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ov(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ov(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DJ(e){return new UB(e)}function HB(e){this._context=e}HB.prototype={areaStart:Cv,areaEnd:Cv,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ov(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $J(e){return new HB(e)}function WB(e){this._context=e}WB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ov(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IJ(e){return new WB(e)}function VB(e){this._context=e}VB.prototype={areaStart:Cv,areaEnd:Cv,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function LJ(e){return new VB(e)}function lR(e){return e<0?-1:1}function cR(e,t,n){var r=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(r||a<0&&-0),l=(n-e._y1)/(a||r<0&&-0),u=(o*a+l*r)/(r+a);return(lR(o)+lR(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function uR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function nj(e,t,n){var r=e._x0,a=e._y0,o=e._x1,l=e._y1,u=(o-r)/3;e._context.bezierCurveTo(r+u,a+u*t,o-u,l-u*n,o,l)}function Ev(e){this._context=e}Ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:nj(this,this._t0,uR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,nj(this,uR(this,n=cR(this,e,t)),n);break;default:nj(this,this._t0,n=cR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function GB(e){this._context=new YB(e)}(GB.prototype=Object.create(Ev.prototype)).point=function(e,t){Ev.prototype.point.call(this,t,e)};function YB(e){this._context=e}YB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,o){this._context.bezierCurveTo(t,e,r,n,o,a)}};function BJ(e){return new Ev(e)}function zJ(e){return new GB(e)}function KB(e){this._context=e}KB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=dR(e),a=dR(t),o=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/o[t];for(o[n-1]=(e[n]+a[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function FJ(e){return new ty(e,.5)}function UJ(e){return new ty(e,0)}function HJ(e){return new ty(e,1)}function au(e,t){if((l=e.length)>1)for(var n=1,r,a,o=e[t[0]],l,u=o.length;n=0;)n[t]=t;return n}function WJ(e,t){return e[t]}function VJ(e){const t=[];return t.key=e,t}function GJ(){var e=Ht([]),t=A_,n=au,r=WJ;function a(o){var l=Array.from(e.apply(this,arguments),VJ),u,d=l.length,f=-1,m;for(const p of o)for(u=0,++f;u0){for(var n,r,a=0,o=e[0].length,l;a0){for(var n=0,r=e[t[0]],a,o=r.length;n0)||!((o=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,o,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var XB={symbolCircle:tO,symbolCross:SJ,symbolDiamond:NJ,symbolSquare:CJ,symbolStar:TJ,symbolTriangle:kJ,symbolWye:PJ},ree=Math.PI/180,aee=function(t){var n="symbol".concat(Qg(t));return XB[n]||tO},iee=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*ree;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},oee=function(t,n){XB["symbol".concat(Qg(t))]=n},nO=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,o=a===void 0?64:a,l=t.sizeType,u=l===void 0?"area":l,d=tee(t,ZJ),f=hR(hR({},d),{},{type:r,size:o,sizeType:u}),m=function(){var w=aee(r),N=RJ().type(w).size(iee(o,u,r));return N()},p=f.className,g=f.cx,x=f.cy,j=Be(f,!0);return g===+g&&x===+x&&o===+o?W.createElement("path",T_({},j,{className:Ye("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:m()})):null};nO.registerSymbol=oee;function iu(e){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iu(e)}function k_(){return k_=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var A=x.inactive?f:x.color;return W.createElement("li",k_({className:w,style:p,key:"legend-item-".concat(j)},fl(r.props,x,j)),W.createElement(__,{width:l,height:l,viewBox:m,style:g},r.renderIcon(x)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:A}},b?b(N,x,j):N))})}},{key:"render",value:function(){var r=this.props,a=r.payload,o=r.layout,l=r.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?l:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(y.PureComponent);Tf(rO,"displayName","Legend");Tf(rO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var rj,pR;function vee(){if(pR)return rj;pR=1;var e=Kg();function t(){this.__data__=new e,this.size=0}return rj=t,rj}var aj,vR;function gee(){if(vR)return aj;vR=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return aj=e,aj}var ij,gR;function yee(){if(gR)return ij;gR=1;function e(t){return this.__data__.get(t)}return ij=e,ij}var oj,yR;function xee(){if(yR)return oj;yR=1;function e(t){return this.__data__.has(t)}return oj=e,oj}var sj,xR;function bee(){if(xR)return sj;xR=1;var e=Kg(),t=GC(),n=YC(),r=200;function a(o,l){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthx))return!1;var b=p.get(l),w=p.get(u);if(b&&w)return b==u&&w==l;var N=-1,A=!0,E=d&a?new e:void 0;for(p.set(l,u),p.set(u,l);++N-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Aj=t,Aj}var Tj,UR;function Pee(){if(UR)return Tj;UR=1;var e=lo(),t=sO(),n=co(),r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object RegExp]",x="[object Set]",j="[object String]",b="[object WeakMap]",w="[object ArrayBuffer]",N="[object DataView]",A="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",C="[object Int16Array]",k="[object Int32Array]",O="[object Uint8Array]",M="[object Uint8ClampedArray]",I="[object Uint16Array]",z="[object Uint32Array]",D={};D[A]=D[E]=D[T]=D[C]=D[k]=D[O]=D[M]=D[I]=D[z]=!0,D[r]=D[a]=D[w]=D[o]=D[N]=D[l]=D[u]=D[d]=D[f]=D[m]=D[p]=D[g]=D[x]=D[j]=D[b]=!1;function H(V){return n(V)&&t(V.length)&&!!D[e(V)]}return Tj=H,Tj}var kj,HR;function oz(){if(HR)return kj;HR=1;function e(t){return function(n){return t(n)}}return kj=e,kj}var uf={exports:{}};uf.exports;var WR;function Ree(){return WR||(WR=1,(function(e,t){var n=CB(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,l=o&&n.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(uf,uf.exports)),uf.exports}var Mj,VR;function sz(){if(VR)return Mj;VR=1;var e=Pee(),t=oz(),n=Ree(),r=n&&n.isTypedArray,a=r?t(r):e;return Mj=a,Mj}var Pj,GR;function Dee(){if(GR)return Pj;GR=1;var e=Tee(),t=iO(),n=Lr(),r=iz(),a=oO(),o=sz(),l=Object.prototype,u=l.hasOwnProperty;function d(f,m){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&o(f),b=p||g||x||j,w=b?e(f.length,String):[],N=w.length;for(var A in f)(m||u.call(f,A))&&!(b&&(A=="length"||x&&(A=="offset"||A=="parent")||j&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,N)))&&w.push(A);return w}return Pj=d,Pj}var Rj,YR;function $ee(){if(YR)return Rj;YR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Rj=t,Rj}var Dj,KR;function lz(){if(KR)return Dj;KR=1;function e(t,n){return function(r){return t(n(r))}}return Dj=e,Dj}var $j,XR;function Iee(){if(XR)return $j;XR=1;var e=lz(),t=e(Object.keys,Object);return $j=t,$j}var Ij,ZR;function Lee(){if(ZR)return Ij;ZR=1;var e=$ee(),t=Iee(),n=Object.prototype,r=n.hasOwnProperty;function a(o){if(!e(o))return t(o);var l=[];for(var u in Object(o))r.call(o,u)&&u!="constructor"&&l.push(u);return l}return Ij=a,Ij}var Lj,QR;function Th(){if(QR)return Lj;QR=1;var e=WC(),t=sO();function n(r){return r!=null&&t(r.length)&&!e(r)}return Lj=n,Lj}var Bj,JR;function ny(){if(JR)return Bj;JR=1;var e=Dee(),t=Lee(),n=Th();function r(a){return n(a)?e(a):t(a)}return Bj=r,Bj}var zj,eD;function Bee(){if(eD)return zj;eD=1;var e=Cee(),t=Aee(),n=ny();function r(a){return e(a,n,t)}return zj=r,zj}var qj,tD;function zee(){if(tD)return qj;tD=1;var e=Bee(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(o,l,u,d,f,m){var p=u&t,g=e(o),x=g.length,j=e(l),b=j.length;if(x!=b&&!p)return!1;for(var w=x;w--;){var N=g[w];if(!(p?N in l:r.call(l,N)))return!1}var A=m.get(o),E=m.get(l);if(A&&E)return A==l&&E==o;var T=!0;m.set(o,l),m.set(l,o);for(var C=p;++w-1}return h1=t,h1}var m1,ED;function ote(){if(ED)return m1;ED=1;function e(t,n,r){for(var a=-1,o=t==null?0:t.length;++a=l){var N=f?null:a(d);if(N)return o(N);j=!1,g=r,w=new e}else w=f?[]:b;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jte(e){return e.value}function Ste(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=bte(t,fte);return W.createElement(rO,n)}var $D=1,nl=(function(e){function t(){var n;hte(this,t);for(var r=arguments.length,a=new Array(r),o=0;o$D||Math.abs(a.height-this.lastBoundingBox.height)>$D)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ui({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,o=a.layout,l=a.align,u=a.verticalAlign,d=a.margin,f=a.chartWidth,m=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&o==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(u==="middle"){var j=this.getBBoxSnapshot();g={top:((m||0)-j.height)/2}}else g=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ui(Ui({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,o=a.content,l=a.width,u=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,m=a.payload,p=Ui(Ui({position:"absolute",width:l||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},Ste(o,Ui(Ui({},this.props),{},{payload:hz(m,f,jte)})))}}],[{key:"getWithHeight",value:function(r,a){var o=Ui(Ui({},this.defaultProps),r.props),l=o.layout;return l==="vertical"&&Ce(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||a}:null}}])})(y.PureComponent);ry(nl,"displayName","Legend");ry(nl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var x1,ID;function _te(){if(ID)return x1;ID=1;var e=Eh(),t=iO(),n=Lr(),r=e?e.isConcatSpreadable:void 0;function a(o){return n(o)||t(o)||!!(r&&o&&o[r])}return x1=a,x1}var b1,LD;function vz(){if(LD)return b1;LD=1;var e=az(),t=_te();function n(r,a,o,l,u){var d=-1,f=r.length;for(o||(o=t),u||(u=[]);++d0&&o(m)?a>1?n(m,a-1,o,l,u):e(u,m):l||(u[u.length]=m)}return u}return b1=n,b1}var w1,BD;function Nte(){if(BD)return w1;BD=1;function e(t){return function(n,r,a){for(var o=-1,l=Object(n),u=a(n),d=u.length;d--;){var f=u[t?d:++o];if(r(l[f],f,l)===!1)break}return n}}return w1=e,w1}var j1,zD;function Cte(){if(zD)return j1;zD=1;var e=Nte(),t=e();return j1=t,j1}var S1,qD;function gz(){if(qD)return S1;qD=1;var e=Cte(),t=ny();function n(r,a){return r&&e(r,a,t)}return S1=n,S1}var _1,FD;function Ote(){if(FD)return _1;FD=1;var e=Th();function t(n,r){return function(a,o){if(a==null)return a;if(!e(a))return n(a,o);for(var l=a.length,u=r?l:-1,d=Object(a);(r?u--:++ur||u&&d&&m&&!f&&!p||o&&d&&m||!a&&m||!l)return 1;if(!o&&!u&&!p&&n=f)return m;var p=a[o];return m*(p=="desc"?-1:1)}}return n.index-r.index}return A1=t,A1}var T1,YD;function kte(){if(YD)return T1;YD=1;var e=KC(),t=XC(),n=wi(),r=yz(),a=Ete(),o=oz(),l=Tte(),u=Fu(),d=Lr();function f(m,p,g){p.length?p=e(p,function(b){return d(b)?function(w){return t(w,b.length===1?b[0]:b)}:b}):p=[u];var x=-1;p=e(p,o(n));var j=r(m,function(b,w,N){var A=e(p,function(E){return E(b)});return{criteria:A,index:++x,value:b}});return a(j,function(b,w){return l(b,w,g)})}return T1=f,T1}var k1,KD;function Mte(){if(KD)return k1;KD=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return k1=e,k1}var M1,XD;function Pte(){if(XD)return M1;XD=1;var e=Mte(),t=Math.max;function n(r,a,o){return a=t(a===void 0?r.length-1:a,0),function(){for(var l=arguments,u=-1,d=t(l.length-a,0),f=Array(d);++u0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return $1=r,$1}var I1,t4;function Ite(){if(t4)return I1;t4=1;var e=Dte(),t=$te(),n=t(e);return I1=n,I1}var L1,n4;function Lte(){if(n4)return L1;n4=1;var e=Fu(),t=Pte(),n=Ite();function r(a,o){return n(t(a,o,e),a+"")}return L1=r,L1}var B1,r4;function ay(){if(r4)return B1;r4=1;var e=VC(),t=Th(),n=oO(),r=os();function a(o,l,u){if(!r(u))return!1;var d=typeof l;return(d=="number"?t(u)&&n(l,u.length):d=="string"&&l in u)?e(u[l],o):!1}return B1=a,B1}var z1,a4;function Bte(){if(a4)return z1;a4=1;var e=vz(),t=kte(),n=Lte(),r=ay(),a=n(function(o,l){if(o==null)return[];var u=l.length;return u>1&&r(o,l[0],l[1])?l=[]:u>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(o,e(l,1),[])});return z1=a,z1}var zte=Bte();const uO=St(zte);function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function R_(){return R_=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Xd,"-left"),Ce(n)&&t&&Ce(t.x)&&n=t.y),"".concat(Xd,"-top"),Ce(r)&&t&&Ce(t.y)&&rb?Math.max(m,d[r]):Math.max(p,d[r])}function tne(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function nne(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,f,m,p;return l.height>0&&l.width>0&&n?(m=s4({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),p=s4({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),f=tne({translateX:m,translateY:p,useTranslate3d:u})):f=Jte,{cssProperties:f,cssClasses:ene({translateX:m,translateY:p,coordinate:n})}}function su(e){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(e)}function l4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function c4(e){for(var t=1;tu4||Math.abs(r.height-this.state.lastBoundingBox.height)>u4)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,o=a.active,l=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,f=a.children,m=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,x=a.offset,j=a.position,b=a.reverseDirection,w=a.useTranslate3d,N=a.viewBox,A=a.wrapperStyle,E=nne({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:N}),T=E.cssClasses,C=E.cssProperties,k=c4(c4({transition:g&&o?"transform ".concat(u,"ms ").concat(d):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},A);return W.createElement("div",{tabIndex:-1,className:T,style:k,ref:function(M){r.wrapperNode=M}},f)}}])})(y.PureComponent),fne=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Sl={isSsr:fne()};function lu(e){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lu(e)}function d4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function f4(e){for(var t=1;t0;return W.createElement(dne,{allowEscapeViewBox:l,animationDuration:u,animationEasing:d,isAnimationActive:g,active:o,coordinate:m,hasPayload:k,offset:x,position:w,reverseDirection:N,useTranslate3d:A,viewBox:E,wrapperStyle:T},jne(f,f4(f4({},this.props),{},{payload:C})))}}])})(y.PureComponent);dO(ni,"displayName","Tooltip");dO(ni,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Sl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var F1,h4;function Sne(){if(h4)return F1;h4=1;var e=bi(),t=function(){return e.Date.now()};return F1=t,F1}var U1,m4;function _ne(){if(m4)return U1;m4=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return U1=t,U1}var H1,p4;function Nne(){if(p4)return H1;p4=1;var e=_ne(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return H1=n,H1}var W1,v4;function _z(){if(v4)return W1;v4=1;var e=Nne(),t=os(),n=Bu(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var m=typeof f.valueOf=="function"?f.valueOf():f;f=t(m)?m+"":m}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=o.test(f);return p||l.test(f)?u(f.slice(2),p?2:8):a.test(f)?r:+f}return W1=d,W1}var V1,g4;function Cne(){if(g4)return V1;g4=1;var e=os(),t=Sne(),n=_z(),r="Expected a function",a=Math.max,o=Math.min;function l(u,d,f){var m,p,g,x,j,b,w=0,N=!1,A=!1,E=!0;if(typeof u!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(N=!!f.leading,A="maxWait"in f,g=A?a(n(f.maxWait)||0,d):g,E="trailing"in f?!!f.trailing:E);function T(V){var F=m,G=p;return m=p=void 0,w=V,x=u.apply(G,F),x}function C(V){return w=V,j=setTimeout(M,d),N?T(V):x}function k(V){var F=V-b,G=V-w,L=d-F;return A?o(L,g-G):L}function O(V){var F=V-b,G=V-w;return b===void 0||F>=d||F<0||A&&G>=g}function M(){var V=t();if(O(V))return I(V);j=setTimeout(M,k(V))}function I(V){return j=void 0,E&&m?T(V):(m=p=void 0,x)}function z(){j!==void 0&&clearTimeout(j),w=0,m=b=p=j=void 0}function D(){return j===void 0?x:I(t())}function H(){var V=t(),F=O(V);if(m=arguments,p=this,b=V,F){if(j===void 0)return C(b);if(A)return clearTimeout(j),j=setTimeout(M,d),T(b)}return j===void 0&&(j=setTimeout(M,d)),x}return H.cancel=z,H.flush=D,H}return V1=l,V1}var G1,y4;function One(){if(y4)return G1;y4=1;var e=Cne(),t=os(),n="Expected a function";function r(a,o,l){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(l)&&(u="leading"in l?!!l.leading:u,d="trailing"in l?!!l.trailing:d),e(a,o,{leading:u,maxWait:o,trailing:d})}return G1=r,G1}var Ene=One();const Nz=St(Ene);function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function x4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Tp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(V=Nz(V,b,{trailing:!0,leading:!1}));var F=new ResizeObserver(V),G=C.current.getBoundingClientRect(),L=G.width,R=G.height;return D(L,R),F.observe(C.current),function(){F.disconnect()}},[D,b]);var H=y.useMemo(function(){var V=I.containerWidth,F=I.containerHeight;if(V<0||F<0)return null;qa(Gs(l)||Gs(d),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,l,d),qa(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=Gs(l)?V:l,L=Gs(d)?F:d;n&&n>0&&(G?L=G/n:L&&(G=L*n),g&&L>g&&(L=g)),qa(G>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,G,L,l,d,m,p,n);var R=!Array.isArray(x)&&Ji(x.type).endsWith("Chart");return W.Children.map(x,function(U){return W.isValidElement(U)?y.cloneElement(U,Tp({width:G,height:L},R?{style:Tp({height:"100%",width:"100%",maxHeight:L,maxWidth:G},U.props.style)}:{})):U})},[n,x,d,g,p,m,I,l]);return W.createElement("div",{id:w?"".concat(w):void 0,className:Ye("recharts-responsive-container",N),style:Tp(Tp({},T),{},{width:l,height:d,minWidth:m,minHeight:p,maxHeight:g}),ref:C},H)}),iy=function(t){return null};iy.displayName="Cell";function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function w4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function L_(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Sl.isSsr)return{width:0,height:0};var r=Une(n),a=JSON.stringify({text:t,copyStyle:r});if(jc.widthCache[a])return jc.widthCache[a];try{var o=document.getElementById(j4);o||(o=document.createElement("span"),o.setAttribute("id",j4),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var l=L_(L_({},Fne),r);Object.assign(o.style,l),o.textContent="".concat(t);var u=o.getBoundingClientRect(),d={width:u.width,height:u.height};return jc.widthCache[a]=d,++jc.cacheCount>qne&&(jc.cacheCount=0,jc.widthCache={}),d}catch{return{width:0,height:0}}},Hne=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Df(e){"@babel/helpers - typeof";return Df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Df(e)}function Pv(e,t){return Yne(e)||Gne(e,t)||Vne(e,t)||Wne()}function Wne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vne(e,t){if(e){if(typeof e=="string")return S4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S4(e,t)}}function S4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function A4(e,t){return fre(e)||dre(e,t)||ure(e,t)||cre()}function cre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ure(e,t){if(e){if(typeof e=="string")return T4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T4(e,t)}}function T4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(L,R){var U=R.word,K=R.width,te=L[L.length-1];if(te&&(a==null||o||te.width+K+rR.width?L:R})};if(!m)return x;for(var b="…",w=function(G){var L=p.slice(0,G),R=Az({breakAll:f,style:d,children:L+b}).wordsWithComputedWidth,U=g(R),K=U.length>l||j(U).width>Number(a);return[K,U]},N=0,A=p.length-1,E=0,T;N<=A&&E<=p.length-1;){var C=Math.floor((N+A)/2),k=C-1,O=w(k),M=A4(O,2),I=M[0],z=M[1],D=w(C),H=A4(D,1),V=H[0];if(!I&&!V&&(N=C+1),I&&V&&(A=C-1),!I&&V){T=z;break}E++}return T||x},k4=function(t){var n=Ge(t)?[]:t.toString().split(Ez);return[{words:n}]},mre=function(t){var n=t.width,r=t.scaleToFit,a=t.children,o=t.style,l=t.breakAll,u=t.maxLines;if((n||r)&&!Sl.isSsr){var d,f,m=Az({breakAll:l,children:a,style:o});if(m){var p=m.wordsWithComputedWidth,g=m.spaceWidth;d=p,f=g}else return k4(a);return hre({breakAll:l,children:a,maxLines:u,style:o},d,f,n,r)}return k4(a)},M4="#808080",hl=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,l=t.lineHeight,u=l===void 0?"1em":l,d=t.capHeight,f=d===void 0?"0.71em":d,m=t.scaleToFit,p=m===void 0?!1:m,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,w=t.fill,N=w===void 0?M4:w,A=E4(t,ore),E=y.useMemo(function(){return mre({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:p,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,p,A.style,A.width]),T=A.dx,C=A.dy,k=A.angle,O=A.className,M=A.breakAll,I=E4(A,sre);if(!Mn(r)||!Mn(o))return null;var z=r+(Ce(T)?T:0),D=o+(Ce(C)?C:0),H;switch(b){case"start":H=Y1("calc(".concat(f,")"));break;case"middle":H=Y1("calc(".concat((E.length-1)/2," * -").concat(u," + (").concat(f," / 2))"));break;default:H=Y1("calc(".concat(E.length-1," * -").concat(u,")"));break}var V=[];if(p){var F=E[0].width,G=A.width;V.push("scale(".concat((Ce(G)?G/F:1)/F,")"))}return k&&V.push("rotate(".concat(k,", ").concat(z,", ").concat(D,")")),V.length&&(I.transform=V.join(" ")),W.createElement("text",B_({},Be(I,!0),{x:z,y:D,className:Ye("recharts-text",O),textAnchor:x,fill:N.includes("url")?M4:N}),E.map(function(L,R){var U=L.words.join(M?"":" ");return W.createElement("tspan",{x:z,dy:R===0?H:u,key:"".concat(U,"-").concat(R)},U)}))};function Xo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function pre(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function fO(e){let t,n,r;e.length!==2?(t=Xo,n=(u,d)=>Xo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Xo||e===pre?e:vre,n=e,r=e);function a(u,d,f=0,m=u.length){if(f>>1;n(u[p],d)<0?f=p+1:m=p}while(f>>1;n(u[p],d)<=0?f=p+1:m=p}while(ff&&r(u[p-1],d)>-r(u[p],d)?p-1:p}return{left:a,center:l,right:o}}function vre(){return 0}function Tz(e){return e===null?NaN:+e}function*gre(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const yre=fO(Xo),kh=yre.right;fO(Tz).center;class P4 extends Map{constructor(t,n=wre){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(R4(this,t))}has(t){return super.has(R4(this,t))}set(t,n){return super.set(xre(this,t),n)}delete(t){return super.delete(bre(this,t))}}function R4({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function xre({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function bre({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function wre(e){return e!==null&&typeof e=="object"?e.valueOf():e}function jre(e=Xo){if(e===Xo)return kz;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function kz(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Sre=Math.sqrt(50),_re=Math.sqrt(10),Nre=Math.sqrt(2);function Rv(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),o=r/Math.pow(10,a),l=o>=Sre?10:o>=_re?5:o>=Nre?2:1;let u,d,f;return a<0?(f=Math.pow(10,-a)/l,u=Math.round(e*f),d=Math.round(t*f),u/ft&&--d,f=-f):(f=Math.pow(10,a)*l,u=Math.round(e/f),d=Math.round(t/f),u*ft&&--d),d0))return[];if(e===t)return[e];const r=t=a))return[];const u=o-a+1,d=new Array(u);if(r)if(l<0)for(let f=0;f=r)&&(n=r);return n}function $4(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Mz(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?kz:jre(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,m=Math.log(d),p=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));Mz(e,t,x,j,a)}const o=e[t];let l=n,u=r;for(Zd(e,n,t),a(e[r],o)>0&&Zd(e,n,r);l0;)--u}a(e[n],o)===0?Zd(e,n,u):(++u,Zd(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Zd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Cre(e,t,n){if(e=Float64Array.from(gre(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return $4(e);if(t>=1)return D4(e);var r,a=(r-1)*t,o=Math.floor(a),l=D4(Mz(e,o).subarray(0,o+1)),u=$4(e.subarray(o+1));return l+(u-l)*(a-o)}}function Ore(e,t,n=Tz){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,o=Math.floor(a),l=+n(e[o],o,e),u=+n(e[o+1],o+1,e);return l+(u-l)*(a-o)}}function Ere(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(a);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Mp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Mp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Tre.exec(e))?new kr(t[1],t[2],t[3],1):(t=kre.exec(e))?new kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mre.exec(e))?Mp(t[1],t[2],t[3],t[4]):(t=Pre.exec(e))?Mp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Rre.exec(e))?U4(t[1],t[2]/100,t[3]/100,1):(t=Dre.exec(e))?U4(t[1],t[2]/100,t[3]/100,t[4]):I4.hasOwnProperty(e)?z4(I4[e]):e==="transparent"?new kr(NaN,NaN,NaN,0):null}function z4(e){return new kr(e>>16&255,e>>8&255,e&255,1)}function Mp(e,t,n,r){return r<=0&&(e=t=n=NaN),new kr(e,t,n,r)}function Lre(e){return e instanceof Mh||(e=Bf(e)),e?(e=e.rgb(),new kr(e.r,e.g,e.b,e.opacity)):new kr}function H_(e,t,n,r){return arguments.length===1?Lre(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mO(kr,H_,Rz(Mh,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?If:Math.pow(If,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kr(rl(this.r),rl(this.g),rl(this.b),$v(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:q4,formatHex:q4,formatHex8:Bre,formatRgb:F4,toString:F4}));function q4(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}`}function Bre(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}${Ys((isNaN(this.opacity)?1:this.opacity)*255)}`}function F4(){const e=$v(this.opacity);return`${e===1?"rgb(":"rgba("}${rl(this.r)}, ${rl(this.g)}, ${rl(this.b)}${e===1?")":`, ${e})`}`}function $v(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ys(e){return e=rl(e),(e<16?"0":"")+e.toString(16)}function U4(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,r)}function Dz(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof Mh||(e=Bf(e)),!e)return new Ba;if(e instanceof Ba)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-a,d=(o+a)/2;return u?(t===o?l=(n-r)/u+(n0&&d<1?0:l,new Ba(l,u,d,e.opacity)}function zre(e,t,n,r){return arguments.length===1?Dz(e):new Ba(e,t,n,r??1)}function Ba(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mO(Ba,zre,Rz(Mh,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?If:Math.pow(If,e),new Ba(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new kr(K1(e>=240?e-240:e+120,a,r),K1(e,a,r),K1(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ba(H4(this.h),Pp(this.s),Pp(this.l),$v(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=$v(this.opacity);return`${e===1?"hsl(":"hsla("}${H4(this.h)}, ${Pp(this.s)*100}%, ${Pp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function H4(e){return e=(e||0)%360,e<0?e+360:e}function Pp(e){return Math.max(0,Math.min(1,e||0))}function K1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pO=e=>()=>e;function qre(e,t){return function(n){return e+n*t}}function Fre(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Ure(e){return(e=+e)==1?$z:function(t,n){return n-t?Fre(t,n,e):pO(isNaN(t)?n:t)}}function $z(e,t){var n=t-e;return n?qre(e,n):pO(isNaN(e)?t:e)}const W4=(function e(t){var n=Ure(t);function r(a,o){var l=n((a=H_(a)).r,(o=H_(o)).r),u=n(a.g,o.g),d=n(a.b,o.b),f=$z(a.opacity,o.opacity);return function(m){return a.r=l(m),a.g=u(m),a.b=d(m),a.opacity=f(m),a+""}}return r.gamma=e,r})(1);function Hre(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(o){for(a=0;an&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:Iv(r,a)})),n=X1.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function tae(e,t,n){var r=e[0],a=e[1],o=t[0],l=t[1];return a2?nae:tae,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?o:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return p.invert=function(g){return l(a((f||(f=u(t,e.map(r),Iv)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Lv),m()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=vO,m()},p.clamp=function(g){return arguments.length?(l=g?!0:jr,m()):l!==jr},p.interpolate=function(g){return arguments.length?(n=g,m()):n},p.unknown=function(g){return arguments.length?(o=g,p):o},function(g,x){return r=g,a=x,m()}}function gO(){return oy()(jr,jr)}function rae(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cu(e){return e=Bv(Math.abs(e)),e?e[1]:NaN}function aae(e,t){return function(n,r){for(var a=n.length,o=[],l=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),o.push(n.substring(a-=u,a+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}function iae(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var oae=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zf(e){if(!(t=oae.exec(e)))throw new Error("invalid format: "+e);var t;return new yO({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}zf.prototype=yO.prototype;function yO(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}yO.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sae(e){e:for(var t=e.length,n=1,r=-1,a;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Iz;function lae(e,t){var n=Bv(e,t);if(!n)return e+"";var r=n[0],a=n[1],o=a-(Iz=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Bv(e,Math.max(0,t+o-1))[0]}function G4(e,t){var n=Bv(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const Y4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rae,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>G4(e*100,t),r:G4,s:lae,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function K4(e){return e}var X4=Array.prototype.map,Z4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cae(e){var t=e.grouping===void 0||e.thousands===void 0?K4:aae(X4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?K4:iae(X4.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p){p=zf(p);var g=p.fill,x=p.align,j=p.sign,b=p.symbol,w=p.zero,N=p.width,A=p.comma,E=p.precision,T=p.trim,C=p.type;C==="n"?(A=!0,C="g"):Y4[C]||(E===void 0&&(E=12),T=!0,C="g"),(w||g==="0"&&x==="=")&&(w=!0,g="0",x="=");var k=b==="$"?n:b==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",O=b==="$"?r:/[%p]/.test(C)?l:"",M=Y4[C],I=/[defgprs%]/.test(C);E=E===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function z(D){var H=k,V=O,F,G,L;if(C==="c")V=M(D)+V,D="";else{D=+D;var R=D<0||1/D<0;if(D=isNaN(D)?d:M(Math.abs(D),E),T&&(D=sae(D)),R&&+D==0&&j!=="+"&&(R=!1),H=(R?j==="("?j:u:j==="-"||j==="("?"":j)+H,V=(C==="s"?Z4[8+Iz/3]:"")+V+(R&&j==="("?")":""),I){for(F=-1,G=D.length;++FL||L>57){V=(L===46?a+D.slice(F+1):D.slice(F))+V,D=D.slice(0,F);break}}}A&&!w&&(D=t(D,1/0));var U=H.length+D.length+V.length,K=U>1)+H+D+V+K.slice(U);break;default:D=K+H+D+V;break}return o(D)}return z.toString=function(){return p+""},z}function m(p,g){var x=f((p=zf(p),p.type="f",p)),j=Math.max(-8,Math.min(8,Math.floor(cu(g)/3)))*3,b=Math.pow(10,-j),w=Z4[8+j/3];return function(N){return x(b*N)+w}}return{format:f,formatPrefix:m}}var Rp,xO,Lz;uae({thousands:",",grouping:[3],currency:["$",""]});function uae(e){return Rp=cae(e),xO=Rp.format,Lz=Rp.formatPrefix,Rp}function dae(e){return Math.max(0,-cu(Math.abs(e)))}function fae(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(cu(t)/3)))*3-cu(Math.abs(e)))}function hae(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cu(t)-cu(e))+1}function Bz(e,t,n,r){var a=F_(e,t,n),o;switch(r=zf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=fae(a,l))&&(r.precision=o),Lz(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=hae(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=dae(a))&&(r.precision=o-(r.type==="%")*2);break}}return xO(r)}function ss(e){var t=e.domain;return e.ticks=function(n){var r=t();return z_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return Bz(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,o=r.length-1,l=r[a],u=r[o],d,f,m=10;for(u0;){if(f=q_(l,u,n),f===d)return r[a]=l,r[o]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function zv(){var e=gO();return e.copy=function(){return Ph(e,zv())},Ea.apply(e,arguments),ss(e)}function zz(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Lv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return zz(e).unknown(t)},e=arguments.length?Array.from(e,Lv):[0,1],ss(n)}function qz(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],o=e[r],l;return oMath.pow(e,t)}function yae(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function e$(e){return(t,n)=>-e(-t,n)}function bO(e){const t=e(Q4,J4),n=t.domain;let r=10,a,o;function l(){return a=yae(r),o=gae(r),n()[0]<0?(a=e$(a),o=e$(o),e(mae,pae)):e(Q4,J4),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],m=d[d.length-1];const p=m0){for(;g<=x;++g)for(j=1;jm)break;N.push(b)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/o(-g):j*o(g),!(bm)break;N.push(b)}N.length*2{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=zf(d)).precision==null&&(d.trim=!0),d=xO(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return m=>{let p=m/o(Math.round(a(m)));return p*rn(qz(n(),{floor:u=>o(Math.floor(a(u))),ceil:u=>o(Math.ceil(a(u)))})),t}function Fz(){const e=bO(oy()).domain([1,10]);return e.copy=()=>Ph(e,Fz()).base(e.base()),Ea.apply(e,arguments),e}function t$(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function n$(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wO(e){var t=1,n=e(t$(t),n$(t));return n.constant=function(r){return arguments.length?e(t$(t=+r),n$(t)):t},ss(n)}function Uz(){var e=wO(oy());return e.copy=function(){return Ph(e,Uz()).constant(e.constant())},Ea.apply(e,arguments)}function r$(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function xae(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function bae(e){return e<0?-e*e:e*e}function jO(e){var t=e(jr,jr),n=1;function r(){return n===1?e(jr,jr):n===.5?e(xae,bae):e(r$(n),r$(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},ss(t)}function SO(){var e=jO(oy());return e.copy=function(){return Ph(e,SO()).exponent(e.exponent())},Ea.apply(e,arguments),e}function wae(){return SO.apply(null,arguments).exponent(.5)}function a$(e){return Math.sign(e)*e*e}function jae(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Hz(){var e=gO(),t=[0,1],n=!1,r;function a(o){var l=jae(e(o));return isNaN(l)?r:n?Math.round(l):l}return a.invert=function(o){return e.invert(a$(o))},a.domain=function(o){return arguments.length?(e.domain(o),a):e.domain()},a.range=function(o){return arguments.length?(e.range((t=Array.from(o,Lv)).map(a$)),a):t.slice()},a.rangeRound=function(o){return a.range(o).round(!0)},a.round=function(o){return arguments.length?(n=!!o,a):n},a.clamp=function(o){return arguments.length?(e.clamp(o),a):e.clamp()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return Hz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ea.apply(a,arguments),ss(a)}function Wz(){var e=[],t=[],n=[],r;function a(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l0?n[u-1]:e[0],u=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(o=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return Vz().domain([e,t]).range(a).unknown(o)},Ea.apply(ss(l),arguments)}function Gz(){var e=[.5],t=[0,1],n,r=1;function a(o){return o!=null&&o<=o?t[kh(e,o,0,r)]:n}return a.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return Gz().domain(e).range(t).unknown(n)},Ea.apply(a,arguments)}const Z1=new Date,Q1=new Date;function Dn(e,t,n,r){function a(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return a.floor=o=>(e(o=new Date(+o)),o),a.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),a.round=o=>{const l=a(o),u=a.ceil(o);return o-l(t(o=new Date(+o),l==null?1:Math.floor(l)),o),a.range=(o,l,u)=>{const d=[];if(o=a.ceil(o),u=u==null?1:Math.floor(u),!(o0))return d;let f;do d.push(f=new Date(+o)),t(o,u),e(o);while(fDn(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),n&&(a.count=(o,l)=>(Z1.setTime(+o),Q1.setTime(+l),e(Z1),e(Q1),Math.floor(n(Z1,Q1))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(r?l=>r(l)%o===0:l=>a.count(0,l)%o===0):a)),a}const qv=Dn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);qv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Dn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):qv);qv.range;const Gi=1e3,Sa=Gi*60,Yi=Sa*60,no=Yi*24,_O=no*7,i$=no*30,J1=no*365,Ks=Dn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getUTCSeconds());Ks.range;const NO=Dn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gi)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getMinutes());NO.range;const CO=Dn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getUTCMinutes());CO.range;const OO=Dn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gi-e.getMinutes()*Sa)},(e,t)=>{e.setTime(+e+t*Yi)},(e,t)=>(t-e)/Yi,e=>e.getHours());OO.range;const EO=Dn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Yi)},(e,t)=>(t-e)/Yi,e=>e.getUTCHours());EO.range;const Rh=Dn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Sa)/no,e=>e.getDate()-1);Rh.range;const sy=Dn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/no,e=>e.getUTCDate()-1);sy.range;const Yz=Dn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/no,e=>Math.floor(e/no));Yz.range;function _l(e){return Dn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Sa)/_O)}const ly=_l(0),Fv=_l(1),Sae=_l(2),_ae=_l(3),uu=_l(4),Nae=_l(5),Cae=_l(6);ly.range;Fv.range;Sae.range;_ae.range;uu.range;Nae.range;Cae.range;function Nl(e){return Dn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/_O)}const cy=Nl(0),Uv=Nl(1),Oae=Nl(2),Eae=Nl(3),du=Nl(4),Aae=Nl(5),Tae=Nl(6);cy.range;Uv.range;Oae.range;Eae.range;du.range;Aae.range;Tae.range;const AO=Dn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());AO.range;const TO=Dn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());TO.range;const ro=Dn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ro.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ro.range;const ao=Dn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ao.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ao.range;function Kz(e,t,n,r,a,o){const l=[[Ks,1,Gi],[Ks,5,5*Gi],[Ks,15,15*Gi],[Ks,30,30*Gi],[o,1,Sa],[o,5,5*Sa],[o,15,15*Sa],[o,30,30*Sa],[a,1,Yi],[a,3,3*Yi],[a,6,6*Yi],[a,12,12*Yi],[r,1,no],[r,2,2*no],[n,1,_O],[t,1,i$],[t,3,3*i$],[e,1,J1]];function u(f,m,p){const g=mw).right(l,g);if(x===l.length)return e.every(F_(f/J1,m/J1,p));if(x===0)return qv.every(Math.max(F_(f,m,p),1));const[j,b]=l[g/l[x-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(_e=tS(Qd(le.y,0,1)),me=_e.getUTCDay(),_e=me>4||me===0?Uv.ceil(_e):Uv(_e),_e=sy.offset(_e,(le.V-1)*7),le.y=_e.getUTCFullYear(),le.m=_e.getUTCMonth(),le.d=_e.getUTCDate()+(le.w+6)%7):(_e=eS(Qd(le.y,0,1)),me=_e.getDay(),_e=me>4||me===0?Fv.ceil(_e):Fv(_e),_e=Rh.offset(_e,(le.V-1)*7),le.y=_e.getFullYear(),le.m=_e.getMonth(),le.d=_e.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),me="Z"in le?tS(Qd(le.y,0,1)).getUTCDay():eS(Qd(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(me+5)%7:le.w+le.U*7-(me+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,tS(le)):eS(le)}}function M(Z,pe,je,le){for(var Re=0,_e=pe.length,me=je.length,ve,Le;Re<_e;){if(le>=me)return-1;if(ve=pe.charCodeAt(Re++),ve===37){if(ve=pe.charAt(Re++),Le=C[ve in o$?pe.charAt(Re++):ve],!Le||(le=Le(Z,je,le))<0)return-1}else if(ve!=je.charCodeAt(le++))return-1}return le}function I(Z,pe,je){var le=f.exec(pe.slice(je));return le?(Z.p=m.get(le[0].toLowerCase()),je+le[0].length):-1}function z(Z,pe,je){var le=x.exec(pe.slice(je));return le?(Z.w=j.get(le[0].toLowerCase()),je+le[0].length):-1}function D(Z,pe,je){var le=p.exec(pe.slice(je));return le?(Z.w=g.get(le[0].toLowerCase()),je+le[0].length):-1}function H(Z,pe,je){var le=N.exec(pe.slice(je));return le?(Z.m=A.get(le[0].toLowerCase()),je+le[0].length):-1}function V(Z,pe,je){var le=b.exec(pe.slice(je));return le?(Z.m=w.get(le[0].toLowerCase()),je+le[0].length):-1}function F(Z,pe,je){return M(Z,t,pe,je)}function G(Z,pe,je){return M(Z,n,pe,je)}function L(Z,pe,je){return M(Z,r,pe,je)}function R(Z){return l[Z.getDay()]}function U(Z){return o[Z.getDay()]}function K(Z){return d[Z.getMonth()]}function te(Z){return u[Z.getMonth()]}function $(Z){return a[+(Z.getHours()>=12)]}function B(Z){return 1+~~(Z.getMonth()/3)}function Y(Z){return l[Z.getUTCDay()]}function ne(Z){return o[Z.getUTCDay()]}function oe(Z){return d[Z.getUTCMonth()]}function xe(Z){return u[Z.getUTCMonth()]}function ee(Z){return a[+(Z.getUTCHours()>=12)]}function ae(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var pe=k(Z+="",E);return pe.toString=function(){return Z},pe},parse:function(Z){var pe=O(Z+="",!1);return pe.toString=function(){return Z},pe},utcFormat:function(Z){var pe=k(Z+="",T);return pe.toString=function(){return Z},pe},utcParse:function(Z){var pe=O(Z+="",!0);return pe.toString=function(){return Z},pe}}}var o$={"-":"",_:" ",0:"0"},Gn=/^\s*\d+/,$ae=/^%/,Iae=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",o=a.length;return r+(o[t.toLowerCase(),n]))}function Bae(e,t,n){var r=Gn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function zae(e,t,n){var r=Gn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function qae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Fae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Uae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function s$(e,t,n){var r=Gn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function l$(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Hae(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Wae(e,t,n){var r=Gn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Vae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function c$(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Gae(e,t,n){var r=Gn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function u$(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Yae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Kae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Xae(e,t,n){var r=Gn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Zae(e,t,n){var r=Gn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Qae(e,t,n){var r=$ae.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Jae(e,t,n){var r=Gn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function eie(e,t,n){var r=Gn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function d$(e,t){return vt(e.getDate(),t,2)}function tie(e,t){return vt(e.getHours(),t,2)}function nie(e,t){return vt(e.getHours()%12||12,t,2)}function rie(e,t){return vt(1+Rh.count(ro(e),e),t,3)}function Xz(e,t){return vt(e.getMilliseconds(),t,3)}function aie(e,t){return Xz(e,t)+"000"}function iie(e,t){return vt(e.getMonth()+1,t,2)}function oie(e,t){return vt(e.getMinutes(),t,2)}function sie(e,t){return vt(e.getSeconds(),t,2)}function lie(e){var t=e.getDay();return t===0?7:t}function cie(e,t){return vt(ly.count(ro(e)-1,e),t,2)}function Zz(e){var t=e.getDay();return t>=4||t===0?uu(e):uu.ceil(e)}function uie(e,t){return e=Zz(e),vt(uu.count(ro(e),e)+(ro(e).getDay()===4),t,2)}function die(e){return e.getDay()}function fie(e,t){return vt(Fv.count(ro(e)-1,e),t,2)}function hie(e,t){return vt(e.getFullYear()%100,t,2)}function mie(e,t){return e=Zz(e),vt(e.getFullYear()%100,t,2)}function pie(e,t){return vt(e.getFullYear()%1e4,t,4)}function vie(e,t){var n=e.getDay();return e=n>=4||n===0?uu(e):uu.ceil(e),vt(e.getFullYear()%1e4,t,4)}function gie(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function f$(e,t){return vt(e.getUTCDate(),t,2)}function yie(e,t){return vt(e.getUTCHours(),t,2)}function xie(e,t){return vt(e.getUTCHours()%12||12,t,2)}function bie(e,t){return vt(1+sy.count(ao(e),e),t,3)}function Qz(e,t){return vt(e.getUTCMilliseconds(),t,3)}function wie(e,t){return Qz(e,t)+"000"}function jie(e,t){return vt(e.getUTCMonth()+1,t,2)}function Sie(e,t){return vt(e.getUTCMinutes(),t,2)}function _ie(e,t){return vt(e.getUTCSeconds(),t,2)}function Nie(e){var t=e.getUTCDay();return t===0?7:t}function Cie(e,t){return vt(cy.count(ao(e)-1,e),t,2)}function Jz(e){var t=e.getUTCDay();return t>=4||t===0?du(e):du.ceil(e)}function Oie(e,t){return e=Jz(e),vt(du.count(ao(e),e)+(ao(e).getUTCDay()===4),t,2)}function Eie(e){return e.getUTCDay()}function Aie(e,t){return vt(Uv.count(ao(e)-1,e),t,2)}function Tie(e,t){return vt(e.getUTCFullYear()%100,t,2)}function kie(e,t){return e=Jz(e),vt(e.getUTCFullYear()%100,t,2)}function Mie(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function Pie(e,t){var n=e.getUTCDay();return e=n>=4||n===0?du(e):du.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function Rie(){return"+0000"}function h$(){return"%"}function m$(e){return+e}function p$(e){return Math.floor(+e/1e3)}var Sc,e6,t6;Die({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Die(e){return Sc=Dae(e),e6=Sc.format,Sc.parse,t6=Sc.utcFormat,Sc.utcParse,Sc}function $ie(e){return new Date(e)}function Iie(e){return e instanceof Date?+e:+new Date(+e)}function kO(e,t,n,r,a,o,l,u,d,f){var m=gO(),p=m.invert,g=m.domain,x=f(".%L"),j=f(":%S"),b=f("%I:%M"),w=f("%I %p"),N=f("%a %d"),A=f("%b %d"),E=f("%B"),T=f("%Y");function C(k){return(d(k)t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,o)=>Cre(e,o/r))},n.copy=function(){return i6(t).domain(e)},uo.apply(n,arguments)}function dy(){var e=0,t=.5,n=1,r=1,a,o,l,u,d,f=jr,m,p=!1,g;function x(b){return isNaN(b=+b)?g:(b=.5+((b=+m(b))-o)*(r*bn}return rS=e,rS}var aS,x$;function Fie(){if(x$)return aS;x$=1;var e=fy(),t=c6(),n=Fu();function r(a){return a&&a.length?e(a,n,t):void 0}return aS=r,aS}var Uie=Fie();const hy=St(Uie);var iS,b$;function u6(){if(b$)return iS;b$=1;function e(t,n){return te.e^o.s<0?1:-1;for(r=o.d.length,a=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===a?0:r>a^o.s<0?1:-1};Ee.decimalPlaces=Ee.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Xt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ee.dividedBy=Ee.div=function(e){return eo(this,new this.constructor(e))};Ee.dividedToIntegerBy=Ee.idiv=function(e){var t=this,n=t.constructor;return Bt(eo(t,new n(e),0,1),n.precision)};Ee.equals=Ee.eq=function(e){return!this.cmp(e)};Ee.exponent=function(){return gn(this)};Ee.greaterThan=Ee.gt=function(e){return this.cmp(e)>0};Ee.greaterThanOrEqualTo=Ee.gte=function(e){return this.cmp(e)>=0};Ee.isInteger=Ee.isint=function(){return this.e>this.d.length-2};Ee.isNegative=Ee.isneg=function(){return this.s<0};Ee.isPositive=Ee.ispos=function(){return this.s>0};Ee.isZero=function(){return this.s===0};Ee.lessThan=Ee.lt=function(e){return this.cmp(e)<0};Ee.lessThanOrEqualTo=Ee.lte=function(e){return this.cmp(e)<1};Ee.logarithm=Ee.log=function(e){var t,n=this,r=n.constructor,a=r.precision,o=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ea))throw Error(Ca+"NaN");if(n.s<1)throw Error(Ca+(n.s?"NaN":"-Infinity"));return n.eq(ea)?new r(0):(Qt=!1,t=eo(qf(n,o),qf(e,o),o),Qt=!0,Bt(t,a))};Ee.minus=Ee.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?m6(t,e):f6(t,(e.s=-e.s,e))};Ee.modulo=Ee.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ca+"NaN");return n.s?(Qt=!1,t=eo(n,e,0,1).times(e),Qt=!0,n.minus(t)):Bt(new r(n),a)};Ee.naturalExponential=Ee.exp=function(){return h6(this)};Ee.naturalLogarithm=Ee.ln=function(){return qf(this)};Ee.negated=Ee.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ee.plus=Ee.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?f6(t,e):m6(t,(e.s=-e.s,e))};Ee.precision=Ee.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(al+e);if(t=gn(a)+1,r=a.d.length-1,n=r*Xt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ee.squareRoot=Ee.sqrt=function(){var e,t,n,r,a,o,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Ca+"NaN")}for(e=gn(u),Qt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=si(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Wu((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=l=n+3;;)if(o=r,r=o.plus(eo(u,o,l+2)).times(.5),si(o.d).slice(0,l)===(t=si(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(Bt(o,n+1,0),o.times(o).eq(u)){r=o;break}}else if(t!="9999")break;l+=4}return Qt=!0,Bt(r,n)};Ee.times=Ee.mul=function(e){var t,n,r,a,o,l,u,d,f,m=this,p=m.constructor,g=m.d,x=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,d=g.length,f=x.length,d=0;){for(t=0,a=d+r;a>r;)u=o[a]+x[r]*g[a-r-1]+t,o[a--]=u%zn|0,t=u/zn|0;o[a]=(o[a]+t)%zn|0}for(;!o[--l];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Qt?Bt(e,p.precision):e};Ee.toDecimalPlaces=Ee.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(vi(e,0,Hu),t===void 0?t=r.rounding:vi(t,0,8),Bt(n,e+gn(n)+1,t))};Ee.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=ml(r,!0):(vi(e,0,Hu),t===void 0?t=a.rounding:vi(t,0,8),r=Bt(new a(r),e+1,t),n=ml(r,!0,e+1)),n};Ee.toFixed=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?ml(a):(vi(e,0,Hu),t===void 0?t=o.rounding:vi(t,0,8),r=Bt(new o(a),e+gn(a)+1,t),n=ml(r.abs(),!1,e+gn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ee.toInteger=Ee.toint=function(){var e=this,t=e.constructor;return Bt(new t(e),gn(e)+1,t.rounding)};Ee.toNumber=function(){return+this};Ee.toPower=Ee.pow=function(e){var t,n,r,a,o,l,u=this,d=u.constructor,f=12,m=+(e=new d(e));if(!e.s)return new d(ea);if(u=new d(u),!u.s){if(e.s<1)throw Error(Ca+"Infinity");return u}if(u.eq(ea))return u;if(r=d.precision,e.eq(ea))return Bt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,o=u.s,l){if((n=m<0?-m:m)<=d6){for(a=new d(ea),t=Math.ceil(r/Xt+4),Qt=!1;n%2&&(a=a.times(u),C$(a.d,t)),n=Wu(n/2),n!==0;)u=u.times(u),C$(u.d,t);return Qt=!0,e.s<0?new d(ea).div(a):Bt(a,r)}}else if(o<0)throw Error(Ca+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,Qt=!1,a=e.times(qf(u,r+f)),Qt=!0,a=h6(a),a.s=o,a};Ee.toPrecision=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?(n=gn(a),r=ml(a,n<=o.toExpNeg||n>=o.toExpPos)):(vi(e,1,Hu),t===void 0?t=o.rounding:vi(t,0,8),a=Bt(new o(a),e,t),n=gn(a),r=ml(a,e<=n||n<=o.toExpNeg,e)),r};Ee.toSignificantDigits=Ee.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(vi(e,1,Hu),t===void 0?t=r.rounding:vi(t,0,8)),Bt(new r(n),e,t)};Ee.toString=Ee.valueOf=Ee.val=Ee.toJSON=Ee[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=gn(e),n=e.constructor;return ml(e,t<=n.toExpNeg||t>=n.toExpPos)};function f6(e,t){var n,r,a,o,l,u,d,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Qt?Bt(t,p):t;if(d=e.d,f=t.d,l=e.e,a=t.e,d=d.slice(),o=l-a,o){for(o<0?(r=d,o=-o,u=f.length):(r=f,a=l,u=d.length),l=Math.ceil(p/Xt),u=l>u?l+1:u+1,o>u&&(o=u,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(u=d.length,o=f.length,u-o<0&&(o=u,r=f,f=d,d=r),n=0;o;)n=(d[--o]=d[o]+f[o]+n)/zn|0,d[o]%=zn;for(n&&(d.unshift(n),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Qt?Bt(t,p):t}function vi(e,t,n){if(e!==~~e||en)throw Error(al+e)}function si(e){var t,n,r,a=e.length-1,o="",l=e[0];if(a>0){for(o+=l,t=1;tl?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function n(r,a,o){for(var l=0;o--;)r[o]-=l,l=r[o]1;)r.shift()}return function(r,a,o,l){var u,d,f,m,p,g,x,j,b,w,N,A,E,T,C,k,O,M,I=r.constructor,z=r.s==a.s?1:-1,D=r.d,H=a.d;if(!r.s)return new I(r);if(!a.s)throw Error(Ca+"Division by zero");for(d=r.e-a.e,O=H.length,C=D.length,x=new I(z),j=x.d=[],f=0;H[f]==(D[f]||0);)++f;if(H[f]>(D[f]||0)&&--d,o==null?A=o=I.precision:l?A=o+(gn(r)-gn(a))+1:A=o,A<0)return new I(0);if(A=A/Xt+2|0,f=0,O==1)for(m=0,H=H[0],A++;(f1&&(H=e(H,m),D=e(D,m),O=H.length,C=D.length),T=O,b=D.slice(0,O),w=b.length;w=zn/2&&++k;do m=0,u=t(H,b,O,w),u<0?(N=b[0],O!=w&&(N=N*zn+(b[1]||0)),m=N/k|0,m>1?(m>=zn&&(m=zn-1),p=e(H,m),g=p.length,w=b.length,u=t(p,b,g,w),u==1&&(m--,n(p,O16)throw Error(RO+gn(e));if(!e.s)return new m(ea);for(Qt=!1,u=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Us(2,f))/Math.LN10*2+5|0,u+=r,n=a=o=new m(ea),m.precision=u;;){if(a=Bt(a.times(e),u),n=n.times(++d),l=o.plus(eo(a,n,u)),si(l.d).slice(0,u)===si(o.d).slice(0,u)){for(;f--;)o=Bt(o.times(o),u);return m.precision=p,t==null?(Qt=!0,Bt(o,p)):o}o=l}}function gn(e){for(var t=e.e*Xt,n=e.d[0];n>=10;n/=10)t++;return t}function uS(e,t,n){if(t>e.LN10.sd())throw Qt=!0,n&&(e.precision=n),Error(Ca+"LN10 precision limit exceeded");return Bt(new e(e.LN10),t)}function qo(e){for(var t="";e--;)t+="0";return t}function qf(e,t){var n,r,a,o,l,u,d,f,m,p=1,g=10,x=e,j=x.d,b=x.constructor,w=b.precision;if(x.s<1)throw Error(Ca+(x.s?"NaN":"-Infinity"));if(x.eq(ea))return new b(0);if(t==null?(Qt=!1,f=w):f=t,x.eq(10))return t==null&&(Qt=!0),uS(b,f);if(f+=g,b.precision=f,n=si(j),r=n.charAt(0),o=gn(x),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=si(x.d),r=n.charAt(0),p++;o=gn(x),r>1?(x=new b("0."+n),o++):x=new b(r+"."+n.slice(1))}else return d=uS(b,f+2,w).times(o+""),x=qf(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=w,t==null?(Qt=!0,Bt(x,w)):x;for(u=l=x=eo(x.minus(ea),x.plus(ea),f),m=Bt(x.times(x),f),a=3;;){if(l=Bt(l.times(m),f),d=u.plus(eo(l,new b(a),f)),si(d.d).slice(0,f)===si(u.d).slice(0,f))return u=u.times(2),o!==0&&(u=u.plus(uS(b,f+2,w).times(o+""))),u=eo(u,new b(p),f),b.precision=w,t==null?(Qt=!0,Bt(u,w)):u;u=d,a+=2}}function N$(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Wu(n/Xt),e.d=[],r=(n+1)%Xt,n<0&&(r+=Xt),rHv||e.e<-Hv))throw Error(RO+n)}else e.s=0,e.e=0,e.d=[0];return e}function Bt(e,t,n){var r,a,o,l,u,d,f,m,p=e.d;for(l=1,o=p[0];o>=10;o/=10)l++;if(r=t-l,r<0)r+=Xt,a=t,f=p[m=0];else{if(m=Math.ceil((r+1)/Xt),o=p.length,m>=o)return e;for(f=o=p[m],l=1;o>=10;o/=10)l++;r%=Xt,a=r-Xt+l}if(n!==void 0&&(o=Us(10,l-a-1),u=f/o%10|0,d=t<0||p[m+1]!==void 0||f%o,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?a>0?f/Us(10,l-a):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=gn(e),p.length=1,t=t-o-1,p[0]=Us(10,(Xt-t%Xt)%Xt),e.e=Wu(-t/Xt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,o=1,m--):(p.length=m+1,o=Us(10,Xt-r),p[m]=a>0?(f/Us(10,l-a)%Us(10,a)|0)*o:0),d)for(;;)if(m==0){(p[0]+=o)==zn&&(p[0]=1,++e.e);break}else{if(p[m]+=o,p[m]!=zn)break;p[m--]=0,o=1}for(r=p.length;p[--r]===0;)p.pop();if(Qt&&(e.e>Hv||e.e<-Hv))throw Error(RO+gn(e));return e}function m6(e,t){var n,r,a,o,l,u,d,f,m,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Qt?Bt(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(m=l<0,m?(n=d,l=-l,u=p.length):(n=p,r=f,u=d.length),a=Math.max(Math.ceil(x/Xt),u)+2,l>a&&(l=a,n.length=1),n.reverse(),a=l;a--;)n.push(0);n.reverse()}else{for(a=d.length,u=p.length,m=a0;--a)d[u++]=0;for(a=p.length;a>l;){if(d[--a]0?o=o.charAt(0)+"."+o.slice(1)+qo(r):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+qo(-a-1)+o,n&&(r=n-l)>0&&(o+=qo(r))):a>=l?(o+=qo(a+1-l),n&&(r=n-a-1)>0&&(o=o+"."+qo(r))):((r=a+1)0&&(a+1===l&&(o+="."),o+=qo(r))),e.s<0?"-"+o:o}function C$(e,t){if(e.length>t)return e.length=t,!0}function p6(e){var t,n,r;function a(o){var l=this;if(!(l instanceof a))return new a(o);if(l.constructor=a,o instanceof a){l.s=o.s,l.e=o.e,l.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(al+o);if(o>0)l.s=1;else if(o<0)o=-o,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(o===~~o&&o<1e7){l.e=0,l.d=[o];return}return N$(l,o.toString())}else if(typeof o!="string")throw Error(al+o);if(o.charCodeAt(0)===45?(o=o.slice(1),l.s=-1):l.s=1,Jie.test(o))N$(l,o);else throw Error(al+o)}if(a.prototype=Ee,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=p6,a.config=a.set=eoe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(al+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(al+n+": "+r);return this}var DO=p6(Qie);ea=new DO(1);const Rt=DO;function toe(e){return ioe(e)||aoe(e)||roe(e)||noe()}function noe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function roe(e,t){if(e){if(typeof e=="string")return G_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G_(e,t)}}function aoe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ioe(e){if(Array.isArray(e))return G_(e)}function G_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,a):e(t-l,O$(function(){for(var u=arguments.length,d=new Array(u),f=0;fe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,o=void 0;try{for(var l=e[Symbol.iterator](),u;!(r=(u=l.next()).done)&&(n.push(u.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,o=d}finally{try{!r&&l.return!=null&&l.return()}finally{if(a)throw o}}return n}}function boe(e){if(Array.isArray(e))return e}function b6(e){var t=Ff(e,2),n=t[0],r=t[1],a=n,o=r;return n>r&&(a=r,o=n),[a,o]}function w6(e,t,n){if(e.lte(0))return new Rt(0);var r=vy.getDigitCount(e.toNumber()),a=new Rt(10).pow(r),o=e.div(a),l=r!==1?.05:.1,u=new Rt(Math.ceil(o.div(l).toNumber())).add(n).mul(l),d=u.mul(a);return t?d:new Rt(Math.ceil(d))}function woe(e,t,n){var r=1,a=new Rt(e);if(!a.isint()&&n){var o=Math.abs(e);o<1?(r=new Rt(10).pow(vy.getDigitCount(e)-1),a=new Rt(Math.floor(a.div(r).toNumber())).mul(r)):o>1&&(a=new Rt(Math.floor(e)))}else e===0?a=new Rt(Math.floor((t-1)/2)):n||(a=new Rt(Math.floor(e)));var l=Math.floor((t-1)/2),u=coe(loe(function(d){return a.add(new Rt(d-l).mul(r)).toNumber()}),Y_);return u(0,t)}function j6(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Rt(0),tickMin:new Rt(0),tickMax:new Rt(0)};var o=w6(new Rt(t).sub(e).div(n-1),r,a),l;e<=0&&t>=0?l=new Rt(0):(l=new Rt(e).add(t).div(2),l=l.sub(new Rt(l).mod(o)));var u=Math.ceil(l.sub(e).div(o).toNumber()),d=Math.ceil(new Rt(t).sub(l).div(o).toNumber()),f=u+d+1;return f>n?j6(e,t,n,r,a+1):(f0?d+(n-f):d,u=t>0?u:u+(n-f)),{step:o,tickMin:l.sub(new Rt(u).mul(o)),tickMax:l.add(new Rt(d).mul(o))})}function joe(e){var t=Ff(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),u=b6([n,r]),d=Ff(u,2),f=d[0],m=d[1];if(f===-1/0||m===1/0){var p=m===1/0?[f].concat(X_(Y_(0,a-1).map(function(){return 1/0}))):[].concat(X_(Y_(0,a-1).map(function(){return-1/0})),[m]);return n>r?K_(p):p}if(f===m)return woe(f,a,o);var g=j6(f,m,l,o),x=g.step,j=g.tickMin,b=g.tickMax,w=vy.rangeStep(j,b.add(new Rt(.1).mul(x)),x);return n>r?K_(w):w}function Soe(e,t){var n=Ff(e,2),r=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=b6([r,a]),u=Ff(l,2),d=u[0],f=u[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var m=Math.max(t,2),p=w6(new Rt(f).sub(d).div(m-1),o,0),g=[].concat(X_(vy.rangeStep(new Rt(d),new Rt(f).sub(new Rt(.99).mul(p)),p)),[f]);return r>a?K_(g):g}var _oe=y6(joe),Noe=y6(Soe),Coe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(e)}function Wv(){return Wv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Poe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Roe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Doe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,l=-1,u=(n=r?.length)!==null&&n!==void 0?n:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var d=o.range,f=0;f0?a[f-1].coordinate:a[u-1].coordinate,p=a[f].coordinate,g=f>=u-1?a[0].coordinate:a[f+1].coordinate,x=void 0;if(br(p-m)!==br(g-p)){var j=[];if(br(g-p)===br(d[1]-d[0])){x=g;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+m)/2),j[1]=Math.max(b,(b+m)/2)}else{x=m;var w=g+d[1]-d[0];j[0]=Math.min(p,(w+p)/2),j[1]=Math.max(p,(w+p)/2)}var N=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>N[0]&&t<=N[1]||t>=j[0]&&t<=j[1]){l=a[f].index;break}}else{var A=Math.min(m,g),E=Math.max(m,g);if(t>(A+p)/2&&t<=(E+p)/2){l=a[f].index;break}}}else for(var T=0;T0&&T(r[T].coordinate+r[T-1].coordinate)/2&&t<=(r[T].coordinate+r[T+1].coordinate)/2||T===u-1&&t>(r[T].coordinate+r[T-1].coordinate)/2){l=r[T].index;break}return l},$O=function(t){var n,r=t,a=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?sn(sn({},t.type.defaultProps),t.props):t.props,l=o.stroke,u=o.fill,d;switch(a){case"Line":d=l;break;case"Area":case"Radar":d=l&&l!=="none"?l:u;break;default:d=u;break}return d},Qoe=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,o=a===void 0?{}:a;if(!o)return{};for(var l={},u=Object.keys(o),d=0,f=u.length;d=0});if(N&&N.length){var A=N[0].type.defaultProps,E=A!==void 0?sn(sn({},A),N[0].props):N[0].props,T=E.barSize,C=E[w];l[C]||(l[C]=[]);var k=Ge(T)?n:T;l[C].push({item:N[0],stackList:N.slice(1),barSize:Ge(k)?void 0:wr(k,r,0)})}}return l},Joe=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,o=t.sizeList,l=o===void 0?[]:o,u=t.maxBarSize,d=l.length;if(d<1)return null;var f=wr(n,a,0,!0),m,p=[];if(l[0].barSize===+l[0].barSize){var g=!1,x=a/d,j=l.reduce(function(T,C){return T+C.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&x>0&&(g=!0,x*=.9,j=d*x);var b=(a-j)/2>>0,w={offset:b-f,size:0};m=l.reduce(function(T,C){var k={item:C.item,position:{offset:w.offset+w.size+f,size:g?x:C.barSize}},O=[].concat(T$(T),[k]);return w=O[O.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(M){O.push({item:M,position:w})}),O},p)}else{var N=wr(r,a,0,!0);a-2*N-(d-1)*f<=0&&(f=0);var A=(a-2*N-(d-1)*f)/d;A>1&&(A>>=0);var E=u===+u?Math.min(A,u):A;m=l.reduce(function(T,C,k){var O=[].concat(T$(T),[{item:C.item,position:{offset:N+(A+f)*k+(A-E)/2,size:E}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(M){O.push({item:M,position:O[O.length-1].position})}),O},p)}return m},ese=function(t,n,r,a){var o=r.children,l=r.width,u=r.margin,d=l-(u.left||0)-(u.right||0),f=C6({children:o,legendWidth:d});if(f){var m=a||{},p=m.width,g=m.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&Ce(t[x]))return sn(sn({},t),{},Wc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&Ce(t[j]))return sn(sn({},t),{},Wc({},j,t[j]+(g||0)))}return t},tse=function(t,n,r){return Ge(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},O6=function(t,n,r,a,o){var l=n.props.children,u=na(l,$h).filter(function(f){return tse(a,o,f.props.direction)});if(u&&u.length){var d=u.map(function(f){return f.props.dataKey});return t.reduce(function(f,m){var p=kn(m,r);if(Ge(p))return f;var g=Array.isArray(p)?[my(p),hy(p)]:[p,p],x=d.reduce(function(j,b){var w=kn(m,b,0),N=g[0]-Math.abs(Array.isArray(w)?w[0]:w),A=g[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(N,j[0]),Math.max(A,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},nse=function(t,n,r,a,o){var l=n.map(function(u){return O6(t,u,r,o,a)}).filter(function(u){return!Ge(u)});return l&&l.length?l.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},E6=function(t,n,r,a,o){var l=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&O6(t,d,f,a)||jf(t,f,r,o)});if(r==="number")return l.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var u={};return l.reduce(function(d,f){for(var m=0,p=f.length;m=2?br(u[0]-u[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var m=(t.ticks||t.niceTicks).map(function(p){var g=o?o.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return m.filter(function(p){return!Ah(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:o?o[p]:p,index:g,offset:f}})},dS=new WeakMap,Dp=function(t,n){if(typeof n!="function")return t;dS.has(t)||dS.set(t,new WeakMap);var r=dS.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},k6=function(t,n,r){var a=t.scale,o=t.type,l=t.layout,u=t.axisType;if(a==="auto")return l==="radial"&&u==="radiusAxis"?{scale:$f(),realScaleType:"band"}:l==="radial"&&u==="angleAxis"?{scale:zv(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:wf(),realScaleType:"point"}:o==="category"?{scale:$f(),realScaleType:"band"}:{scale:zv(),realScaleType:"linear"};if(dl(a)){var d="scale".concat(Qg(a));return{scale:(v$[d]||wf)(),realScaleType:v$[d]?d:"point"}}return We(a)?{scale:a}:{scale:wf(),realScaleType:"point"}},M$=1e-4,M6=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),o=Math.min(a[0],a[1])-M$,l=Math.max(a[0],a[1])+M$,u=t(n[0]),d=t(n[r-1]);(ul||dl)&&t.domain([n[0],n[r-1]])}},rse=function(t,n){if(!t)return null;for(var r=0,a=t.length;ra)&&(o[1]=a),o[0]>a&&(o[0]=a),o[1]=0?(t[u][r][0]=o,t[u][r][1]=o+d,o=t[u][r][1]):(t[u][r][0]=l,t[u][r][1]=l+d,l=t[u][r][1])}},ose=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r=0?(t[l][r][0]=o,t[l][r][1]=o+u,o=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},sse={sign:ise,expand:YJ,none:au,silhouette:KJ,wiggle:XJ,positive:ose},lse=function(t,n,r){var a=n.map(function(u){return u.props.dataKey}),o=sse[r],l=GJ().keys(a).value(function(u,d){return+kn(u,d,0)}).order(A_).offset(o);return l(t)},cse=function(t,n,r,a,o,l){if(!t)return null;var u=l?n.reverse():n,d={},f=u.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?sn(sn({},g.type.defaultProps),g.props):g.props,b=j.stackId,w=j.hide;if(w)return p;var N=j[r],A=p[N]||{hasStack:!1,stackGroups:{}};if(Mn(b)){var E=A.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};E.items.push(g),A.hasStack=!0,A.stackGroups[b]=E}else A.stackGroups[qu("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return sn(sn({},p),{},Wc({},N,A))},d),m={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,w){var N=x.stackGroups[w];return sn(sn({},b),{},Wc({},w,{numericAxisId:r,cateAxisId:a,items:N.items,stackedData:lse(t,N.items,o)}))},j)}return sn(sn({},p),{},Wc({},g,x))},m)},P6=function(t,n){var r=n.realScaleType,a=n.type,o=n.tickCount,l=n.originalDomain,u=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(o&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var f=t.domain();if(!f.length)return null;var m=_oe(f,o,u);return t.domain([my(m),hy(m)]),{niceTicks:m}}if(o&&a==="number"){var p=t.domain(),g=Noe(p,o,u);return{niceTicks:g}}return null};function P$(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,o=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(a[t.dataKey])){var u=jv(n,"value",a[t.dataKey]);if(u)return u.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var d=kn(a,Ge(l)?t.dataKey:l);return Ge(d)?null:t.scale(d)}var R$=function(t){var n=t.axis,r=t.ticks,a=t.offset,o=t.bandSize,l=t.entry,u=t.index;if(n.type==="category")return r[u]?r[u].coordinate+a:null;var d=kn(l,n.dataKey,n.domain[u]);return Ge(d)?null:n.scale(d)-o/2+a},use=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return a<=0&&o>=0?0:o<0?o:a}return r[0]},dse=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?sn(sn({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(Mn(o)){var l=n[o];if(l){var u=l.items.indexOf(t);return u>=0?l.stackedData[u]:null}}return null},fse=function(t){return t.reduce(function(n,r){return[my(r.concat([n[0]]).filter(Ce)),hy(r.concat([n[1]]).filter(Ce))]},[1/0,-1/0])},R6=function(t,n,r){return Object.keys(t).reduce(function(a,o){var l=t[o],u=l.stackedData,d=u.reduce(function(f,m){var p=fse(m.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},D$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eN=function(t,n,r){if(We(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Ce(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(D$.test(t[0])){var o=+D$.exec(t[0])[1];a[0]=n[0]-o}else We(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Ce(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if($$.test(t[1])){var l=+$$.exec(t[1])[1];a[1]=n[1]+l}else We(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Gv=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var o=uO(n,function(p){return p.coordinate}),l=1/0,u=1,d=o.length;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},wse=function(t,n,r,a,o){var l=t.width,u=t.height,d=t.startAngle,f=t.endAngle,m=wr(t.cx,l,l/2),p=wr(t.cy,u,u/2),g=I6(l,u,r),x=wr(t.innerRadius,g,0),j=wr(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(w,N){var A=n[N],E=A.domain,T=A.reversed,C;if(Ge(A.range))a==="angleAxis"?C=[d,f]:a==="radiusAxis"&&(C=[x,j]),T&&(C=[C[1],C[0]]);else{C=A.range;var k=C,O=pse(k,2);d=O[0],f=O[1]}var M=k6(A,o),I=M.realScaleType,z=M.scale;z.domain(E).range(C),M6(z);var D=P6(z,Wi(Wi({},A),{},{realScaleType:I})),H=Wi(Wi(Wi({},A),D),{},{range:C,radius:j,realScaleType:I,scale:z,cx:m,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return Wi(Wi({},w),{},$6({},N,H))},{})},jse=function(t,n){var r=t.x,a=t.y,o=n.x,l=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(a-l,2))},Sse=function(t,n){var r=t.x,a=t.y,o=n.cx,l=n.cy,u=jse({x:r,y:a},{x:o,y:l});if(u<=0)return{radius:u};var d=(r-o)/u,f=Math.acos(d);return a>l&&(f=2*Math.PI-f),{radius:u,angle:bse(f),angleInRadian:f}},_se=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),o=Math.floor(r/360),l=Math.min(a,o);return{startAngle:n-l*360,endAngle:r-l*360}},Nse=function(t,n){var r=n.startAngle,a=n.endAngle,o=Math.floor(r/360),l=Math.floor(a/360),u=Math.min(o,l);return t+u*360},z$=function(t,n){var r=t.x,a=t.y,o=Sse({x:r,y:a},n),l=o.radius,u=o.angle,d=n.innerRadius,f=n.outerRadius;if(lf)return!1;if(l===0)return!0;var m=_se(n),p=m.startAngle,g=m.endAngle,x=u,j;if(p<=g){for(;x>g;)x-=360;for(;x=p&&x<=g}else{for(;x>p;)x-=360;for(;x=g&&x<=p}return j?Wi(Wi({},n),{},{radius:l,angle:Nse(x,n)}):null},L6=function(t){return!y.isValidElement(t)&&!We(t)&&typeof t!="boolean"?t.className:""};function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}var Cse=["offset"];function Ose(e){return kse(e)||Tse(e)||Ase(e)||Ese()}function Ese(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ase(e,t){if(e){if(typeof e=="string")return tN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tN(e,t)}}function Tse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kse(e){if(Array.isArray(e))return tN(e)}function tN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function q$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t=0?1:-1,E,T;a==="insideStart"?(E=x+A*l,T=b):a==="insideEnd"?(E=j-A*l,T=!b):a==="end"&&(E=j+A*l,T=b),T=N<=0?T:!T;var C=Gt(f,m,w,E),k=Gt(f,m,w,E+(T?1:-1)*359),O="M".concat(C.x,",").concat(C.y,` - A`).concat(w,",").concat(w,",0,1,").concat(T?0:1,`, - `).concat(k.x,",").concat(k.y),M=Ge(t.id)?qu("recharts-radial-line-"):t.id;return W.createElement("text",Gf({},r,{dominantBaseline:"central",className:Ye("recharts-radial-bar-label",u)}),W.createElement("defs",null,W.createElement("path",{id:M,d:O})),W.createElement("textPath",{xlinkHref:"#".concat(M)},n))},zse=function(t){var n=t.viewBox,r=t.offset,a=t.position,o=n,l=o.cx,u=o.cy,d=o.innerRadius,f=o.outerRadius,m=o.startAngle,p=o.endAngle,g=(m+p)/2;if(a==="outside"){var x=Gt(l,u,f+r,g),j=x.x,b=x.y;return{x:j,y:b,textAnchor:j>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(d+f)/2,N=Gt(l,u,w,g),A=N.x,E=N.y;return{x:A,y:E,textAnchor:"middle",verticalAnchor:"middle"}},qse=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,o=t.position,l=n,u=l.x,d=l.y,f=l.width,m=l.height,p=m>=0?1:-1,g=p*a,x=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,w=b*a,N=b>0?"end":"start",A=b>0?"start":"end";if(o==="top"){var E={x:u+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:x};return Tn(Tn({},E),r?{height:Math.max(d-r.y,0),width:f}:{})}if(o==="bottom"){var T={x:u+f/2,y:d+m+g,textAnchor:"middle",verticalAnchor:j};return Tn(Tn({},T),r?{height:Math.max(r.y+r.height-(d+m),0),width:f}:{})}if(o==="left"){var C={x:u-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"};return Tn(Tn({},C),r?{width:Math.max(C.x-r.x,0),height:m}:{})}if(o==="right"){var k={x:u+f+w,y:d+m/2,textAnchor:A,verticalAnchor:"middle"};return Tn(Tn({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:m}:{})}var O=r?{width:f,height:m}:{};return o==="insideLeft"?Tn({x:u+w,y:d+m/2,textAnchor:A,verticalAnchor:"middle"},O):o==="insideRight"?Tn({x:u+f-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"},O):o==="insideTop"?Tn({x:u+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},O):o==="insideBottom"?Tn({x:u+f/2,y:d+m-g,textAnchor:"middle",verticalAnchor:x},O):o==="insideTopLeft"?Tn({x:u+w,y:d+g,textAnchor:A,verticalAnchor:j},O):o==="insideTopRight"?Tn({x:u+f-w,y:d+g,textAnchor:N,verticalAnchor:j},O):o==="insideBottomLeft"?Tn({x:u+w,y:d+m-g,textAnchor:A,verticalAnchor:x},O):o==="insideBottomRight"?Tn({x:u+f-w,y:d+m-g,textAnchor:N,verticalAnchor:x},O):zu(o)&&(Ce(o.x)||Gs(o.x))&&(Ce(o.y)||Gs(o.y))?Tn({x:u+wr(o.x,f),y:d+wr(o.y,m),textAnchor:"end",verticalAnchor:"end"},O):Tn({x:u+f/2,y:d+m/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Fse=function(t){return"cx"in t&&Ce(t.cx)};function qn(e){var t=e.offset,n=t===void 0?5:t,r=Mse(e,Cse),a=Tn({offset:n},r),o=a.viewBox,l=a.position,u=a.value,d=a.children,f=a.content,m=a.className,p=m===void 0?"":m,g=a.textBreakAll;if(!o||Ge(u)&&Ge(d)&&!y.isValidElement(f)&&!We(f))return null;if(y.isValidElement(f))return y.cloneElement(f,a);var x;if(We(f)){if(x=y.createElement(f,a),y.isValidElement(x))return x}else x=Ise(a);var j=Fse(o),b=Be(a,!0);if(j&&(l==="insideStart"||l==="insideEnd"||l==="end"))return Bse(a,x,b);var w=j?zse(a):qse(a);return W.createElement(hl,Gf({className:Ye("recharts-label",p)},b,w,{breakAll:g}),x)}qn.displayName="Label";var B6=function(t){var n=t.cx,r=t.cy,a=t.angle,o=t.startAngle,l=t.endAngle,u=t.r,d=t.radius,f=t.innerRadius,m=t.outerRadius,p=t.x,g=t.y,x=t.top,j=t.left,b=t.width,w=t.height,N=t.clockWise,A=t.labelViewBox;if(A)return A;if(Ce(b)&&Ce(w)){if(Ce(p)&&Ce(g))return{x:p,y:g,width:b,height:w};if(Ce(x)&&Ce(j))return{x,y:j,width:b,height:w}}return Ce(p)&&Ce(g)?{x:p,y:g,width:0,height:0}:Ce(n)&&Ce(r)?{cx:n,cy:r,startAngle:o||a||0,endAngle:l||a||0,innerRadius:f||0,outerRadius:m||d||u||0,clockWise:N}:t.viewBox?t.viewBox:{}},Use=function(t,n){return t?t===!0?W.createElement(qn,{key:"label-implicit",viewBox:n}):Mn(t)?W.createElement(qn,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===qn?y.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(qn,{key:"label-implicit",content:t,viewBox:n}):We(t)?W.createElement(qn,{key:"label-implicit",content:t,viewBox:n}):zu(t)?W.createElement(qn,Gf({viewBox:n},t,{key:"label-implicit"})):null:null},Hse=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,o=B6(t),l=na(a,qn).map(function(d,f){return y.cloneElement(d,{viewBox:n||o,key:"label-".concat(f)})});if(!r)return l;var u=Use(t.label,n||o);return[u].concat(Ose(l))};qn.parseViewBox=B6;qn.renderCallByParent=Hse;var fS,F$;function Wse(){if(F$)return fS;F$=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return fS=e,fS}var Vse=Wse();const Gse=St(Vse);function Yf(e){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(e)}var Yse=["valueAccessor"],Kse=["data","dataKey","clockWise","id","textBreakAll"];function Xse(e){return ele(e)||Jse(e)||Qse(e)||Zse()}function Zse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qse(e,t){if(e){if(typeof e=="string")return nN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nN(e,t)}}function Jse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ele(e){if(Array.isArray(e))return nN(e)}function nN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ale(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ile=function(t){return Array.isArray(t.value)?Gse(t.value):t.value};function to(e){var t=e.valueAccessor,n=t===void 0?ile:t,r=W$(e,Yse),a=r.data,o=r.dataKey,l=r.clockWise,u=r.id,d=r.textBreakAll,f=W$(r,Kse);return!a||!a.length?null:W.createElement(pt,{className:"recharts-label-list"},a.map(function(m,p){var g=Ge(o)?n(m,p):kn(m&&m.payload,o),x=Ge(u)?{}:{id:"".concat(u,"-").concat(p)};return W.createElement(qn,Kv({},Be(m,!0),f,x,{parentViewBox:m.parentViewBox,value:g,textBreakAll:d,viewBox:qn.parseViewBox(Ge(l)?m:H$(H$({},m),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}to.displayName="LabelList";function ole(e,t){return e?e===!0?W.createElement(to,{key:"labelList-implicit",data:t}):W.isValidElement(e)||We(e)?W.createElement(to,{key:"labelList-implicit",data:t,content:e}):zu(e)?W.createElement(to,Kv({data:t},e,{key:"labelList-implicit"})):null:null}function sle(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=na(r,to).map(function(l,u){return y.cloneElement(l,{data:t,key:"labelList-".concat(u)})});if(!n)return a;var o=ole(e.label,t);return[o].concat(Xse(a))}to.renderCallByParent=sle;function Kf(e){"@babel/helpers - typeof";return Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kf(e)}function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>f),`, - `).concat(p.x,",").concat(p.y,` - `);if(a>0){var x=Gt(n,r,a,l),j=Gt(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,` - A `).concat(a,",").concat(a,`,0, - `).concat(+(Math.abs(d)>180),",").concat(+(l<=f),`, - `).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},fle=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,l=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,m=t.endAngle,p=br(m-f),g=$p({cx:n,cy:r,radius:o,angle:f,sign:p,cornerRadius:l,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,b=g.theta,w=$p({cx:n,cy:r,radius:o,angle:m,sign:-p,cornerRadius:l,cornerIsExternal:d}),N=w.circleTangency,A=w.lineTangency,E=w.theta,T=d?Math.abs(f-m):Math.abs(f-m)-b-E;if(T<0)return u?"M ".concat(j.x,",").concat(j.y,` - a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 - a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 - `):z6({cx:n,cy:r,innerRadius:a,outerRadius:o,startAngle:f,endAngle:m});var C="M ".concat(j.x,",").concat(j.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,` - A`).concat(o,",").concat(o,",0,").concat(+(T>180),",").concat(+(p<0),",").concat(N.x,",").concat(N.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(A.x,",").concat(A.y,` - `);if(a>0){var k=$p({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),O=k.circleTangency,M=k.lineTangency,I=k.theta,z=$p({cx:n,cy:r,radius:a,angle:m,sign:-p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),D=z.circleTangency,H=z.lineTangency,V=z.theta,F=d?Math.abs(f-m):Math.abs(f-m)-I-V;if(F<0&&l===0)return"".concat(C,"L").concat(n,",").concat(r,"Z");C+="L".concat(H.x,",").concat(H.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(D.x,",").concat(D.y,` - A`).concat(a,",").concat(a,",0,").concat(+(F>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(M.x,",").concat(M.y,"Z")}else C+="L".concat(n,",").concat(r,"Z");return C},hle={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},q6=function(t){var n=G$(G$({},hle),t),r=n.cx,a=n.cy,o=n.innerRadius,l=n.outerRadius,u=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,m=n.startAngle,p=n.endAngle,g=n.className;if(l0&&Math.abs(m-p)<360?w=fle({cx:r,cy:a,innerRadius:o,outerRadius:l,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:m,endAngle:p}):w=z6({cx:r,cy:a,innerRadius:o,outerRadius:l,startAngle:m,endAngle:p}),W.createElement("path",rN({},Be(n,!0),{className:x,d:w,role:"img"}))};function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function aN(){return aN=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Mle(e,t){return Cl(e.getTime(),t.getTime())}function Ple(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Rle(e,t){return e===t}function a3(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),o=e.entries(),l,u,d=0;(l=o.next())&&!l.done;){for(var f=t.entries(),m=!1,p=0;(u=f.next())&&!u.done;){if(a[p]){p++;continue}var g=l.value,x=u.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){m=a[p]=!0;break}p++}if(!m)return!1;d++}return!0}var Dle=Cl;function $le(e,t,n){var r=r3(e),a=r.length;if(r3(t).length!==a)return!1;for(;a-- >0;)if(!F6(e,t,n,r[a]))return!1;return!0}function rf(e,t,n){var r=t3(e),a=r.length;if(t3(t).length!==a)return!1;for(var o,l,u;a-- >0;)if(o=r[a],!F6(e,t,n,o)||(l=n3(e,o),u=n3(t,o),(l||u)&&(!l||!u||l.configurable!==u.configurable||l.enumerable!==u.enumerable||l.writable!==u.writable)))return!1;return!0}function Ile(e,t){return Cl(e.valueOf(),t.valueOf())}function Lle(e,t){return e.source===t.source&&e.flags===t.flags}function i3(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),o=e.values(),l,u;(l=o.next())&&!l.done;){for(var d=t.values(),f=!1,m=0;(u=d.next())&&!u.done;){if(!a[m]&&n.equals(l.value,u.value,l.value,u.value,e,t,n)){f=a[m]=!0;break}m++}if(!f)return!1}return!0}function Ble(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function zle(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function F6(e,t,n,r){return(r===Tle||r===Ale||r===Ele)&&(e.$$typeof||t.$$typeof)?!0:Ole(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var qle="[object Arguments]",Fle="[object Boolean]",Ule="[object Date]",Hle="[object Error]",Wle="[object Map]",Vle="[object Number]",Gle="[object Object]",Yle="[object RegExp]",Kle="[object Set]",Xle="[object String]",Zle="[object URL]",Qle=Array.isArray,o3=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,s3=Object.assign,Jle=Object.prototype.toString.call.bind(Object.prototype.toString);function ece(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,o=e.areMapsEqual,l=e.areNumbersEqual,u=e.areObjectsEqual,d=e.arePrimitiveWrappersEqual,f=e.areRegExpsEqual,m=e.areSetsEqual,p=e.areTypedArraysEqual,g=e.areUrlsEqual,x=e.unknownTagComparators;return function(b,w,N){if(b===w)return!0;if(b==null||w==null)return!1;var A=typeof b;if(A!==typeof w)return!1;if(A!=="object")return A==="number"?l(b,w,N):A==="function"?a(b,w,N):!1;var E=b.constructor;if(E!==w.constructor)return!1;if(E===Object)return u(b,w,N);if(Qle(b))return t(b,w,N);if(o3!=null&&o3(b))return p(b,w,N);if(E===Date)return n(b,w,N);if(E===RegExp)return f(b,w,N);if(E===Map)return o(b,w,N);if(E===Set)return m(b,w,N);var T=Jle(b);if(T===Ule)return n(b,w,N);if(T===Yle)return f(b,w,N);if(T===Wle)return o(b,w,N);if(T===Kle)return m(b,w,N);if(T===Gle)return typeof b.then!="function"&&typeof w.then!="function"&&u(b,w,N);if(T===Zle)return g(b,w,N);if(T===Hle)return r(b,w,N);if(T===qle)return u(b,w,N);if(T===Fle||T===Vle||T===Xle)return d(b,w,N);if(x){var C=x[T];if(!C){var k=Cle(b);k&&(C=x[k])}if(C)return C(b,w,N)}return!1}}function tce(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?rf:kle,areDatesEqual:Mle,areErrorsEqual:Ple,areFunctionsEqual:Rle,areMapsEqual:r?e3(a3,rf):a3,areNumbersEqual:Dle,areObjectsEqual:r?rf:$le,arePrimitiveWrappersEqual:Ile,areRegExpsEqual:Lle,areSetsEqual:r?e3(i3,rf):i3,areTypedArraysEqual:r?rf:Ble,areUrlsEqual:zle,unknownTagComparators:void 0};if(n&&(a=s3({},a,n(a))),t){var o=Lp(a.areArraysEqual),l=Lp(a.areMapsEqual),u=Lp(a.areObjectsEqual),d=Lp(a.areSetsEqual);a=s3({},a,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:u,areSetsEqual:d})}return a}function nce(e){return function(t,n,r,a,o,l,u){return e(t,n,u)}}function rce(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,o=e.strict;if(r)return function(d,f){var m=r(),p=m.cache,g=p===void 0?t?new WeakMap:void 0:p,x=m.meta;return n(d,f,{cache:g,equals:a,meta:x,strict:o})};if(t)return function(d,f){return n(d,f,{cache:new WeakMap,equals:a,meta:void 0,strict:o})};var l={cache:void 0,equals:a,meta:void 0,strict:o};return function(d,f){return n(d,f,l)}}var ace=cs();cs({strict:!0});cs({circular:!0});cs({circular:!0,strict:!0});cs({createInternalComparator:function(){return Cl}});cs({strict:!0,createInternalComparator:function(){return Cl}});cs({circular:!0,createInternalComparator:function(){return Cl}});cs({circular:!0,createInternalComparator:function(){return Cl},strict:!0});function cs(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,o=e.strict,l=o===void 0?!1:o,u=tce(e),d=ece(u),f=r?r(d):nce(d);return rce({circular:n,comparator:d,createState:a,equals:f,strict:l})}function ice(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function l3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(o){n<0&&(n=o),o-n>t?(e(o),n=-1):ice(a)};requestAnimationFrame(r)}function iN(e){"@babel/helpers - typeof";return iN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iN(e)}function oce(e){return uce(e)||cce(e)||lce(e)||sce()}function sce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lce(e,t){if(e){if(typeof e=="string")return c3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c3(e,t)}}function c3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:N<0?0:N},b=function(N){for(var A=N>1?1:N,E=A,T=0;T<8;++T){var C=p(E)-A,k=x(E);if(Math.abs(C-A)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,o=a===void 0?8:a,l=t.dt,u=l===void 0?17:l,d=function(m,p,g){var x=-(m-p)*r,j=g*o,b=g+(x-j)*u/1e3,w=g*u/1e3+m;return Math.abs(w-p)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qce(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}function vS(e){return Wce(e)||Hce(e)||Uce(e)||Fce()}function Fce(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uce(e,t){if(e){if(typeof e=="string")return uN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uN(e,t)}}function Hce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wce(e){if(Array.isArray(e))return uN(e)}function uN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jv(e){return Jv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jv(e)}var gi=(function(e){Xce(n,e);var t=Zce(n);function n(r,a){var o;Vce(this,n),o=t.call(this,r,a);var l=o.props,u=l.isActive,d=l.attributeName,f=l.from,m=l.to,p=l.steps,g=l.children,x=l.duration;if(o.handleStyleChange=o.handleStyleChange.bind(hN(o)),o.changeStyle=o.changeStyle.bind(hN(o)),!u||x<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:m}),fN(o);if(p&&p.length)o.state={style:p[0].style};else if(f){if(typeof g=="function")return o.state={style:f},fN(o);o.state={style:d?df({},d,f):f}}else o.state={style:{}};return o}return Yce(n,[{key:"componentDidMount",value:function(){var a=this.props,o=a.isActive,l=a.canBegin;this.mounted=!0,!(!o||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var o=this.props,l=o.isActive,u=o.canBegin,d=o.attributeName,f=o.shouldReAnimate,m=o.to,p=o.from,g=this.state.style;if(u){if(!l){var x={style:d?df({},d,m):m};this.state&&g&&(d&&g[d]!==m||!d&&g!==m)&&this.setState(x);return}if(!(ace(a.to,m)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&g){var w={style:d?df({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(w)}this.runAnimation(Pa(Pa({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var o=this,l=a.from,u=a.to,d=a.duration,f=a.easing,m=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,x=Lce(l,u,Oce(f),d,this.changeStyle),j=function(){o.stopJSAnimation=x()};this.manager.start([g,m,j,d,p])}},{key:"runStepAnimation",value:function(a){var o=this,l=a.steps,u=a.begin,d=a.onAnimationStart,f=l[0],m=f.style,p=f.duration,g=p===void 0?0:p,x=function(b,w,N){if(N===0)return b;var A=w.duration,E=w.easing,T=E===void 0?"ease":E,C=w.style,k=w.properties,O=w.onAnimationEnd,M=N>0?l[N-1]:w,I=k||Object.keys(C);if(typeof T=="function"||T==="spring")return[].concat(vS(b),[o.runJSAnimation.bind(o,{from:M.style,to:C,duration:A,easing:T}),A]);var z=f3(I,A,T),D=Pa(Pa(Pa({},M.style),C),{},{transition:z});return[].concat(vS(b),[D,A,O]).filter(pce)};return this.manager.start([d].concat(vS(l.reduce(x,[m,Math.max(g,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=dce());var o=a.begin,l=a.duration,u=a.attributeName,d=a.to,f=a.easing,m=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,x=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var b=u?df({},u,d):d,w=f3(Object.keys(b),l,f);j.start([m,o,Pa(Pa({},b),{},{transition:w}),l,p])}},{key:"render",value:function(){var a=this.props,o=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=zce(a,Bce),f=y.Children.count(o),m=this.state.style;if(typeof o=="function")return o(m);if(!u||f===0||l<=0)return o;var p=function(x){var j=x.props,b=j.style,w=b===void 0?{}:b,N=j.className,A=y.cloneElement(x,Pa(Pa({},d),{},{style:Pa(Pa({},w),m),className:N}));return A};return f===1?p(y.Children.only(o)):W.createElement("div",null,y.Children.map(o,function(g){return p(g)}))}}]),n})(y.PureComponent);gi.displayName="Animate";gi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};gi.propTypes={from:bt.oneOfType([bt.object,bt.string]),to:bt.oneOfType([bt.object,bt.string]),attributeName:bt.string,duration:bt.number,begin:bt.number,easing:bt.oneOfType([bt.string,bt.func]),steps:bt.arrayOf(bt.shape({duration:bt.number.isRequired,style:bt.object.isRequired,easing:bt.oneOfType([bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),bt.func]),properties:bt.arrayOf("string"),onAnimationEnd:bt.func})),children:bt.oneOfType([bt.node,bt.func]),isActive:bt.bool,canBegin:bt.bool,onAnimationEnd:bt.func,shouldReAnimate:bt.bool,onAnimationStart:bt.func,onAnimationReStart:bt.func};function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function eg(){return eg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,m;if(l>0&&o instanceof Array){for(var p=[0,0,0,0],g=0,x=4;gl?l:o[g];m="M".concat(t,",").concat(n+u*p[0]),p[0]>0&&(m+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),m+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(m+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`, - `).concat(t+r,",").concat(n+u*p[1])),m+="L ".concat(t+r,",").concat(n+a-u*p[2]),p[2]>0&&(m+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`, - `).concat(t+r-d*p[2],",").concat(n+a)),m+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(m+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`, - `).concat(t,",").concat(n+a-u*p[3])),m+="Z"}else if(l>0&&o===+o&&o>0){var j=Math.min(l,o);m="M ".concat(t,",").concat(n+u*j,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,` - L `).concat(t+r-d*j,",").concat(n,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+u*j,` - L `).concat(t+r,",").concat(n+a-u*j,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,` - L `).concat(t+d*j,",").concat(n+a,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-u*j," Z")}else m="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return m},sue=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,o=n.x,l=n.y,u=n.width,d=n.height;if(Math.abs(u)>0&&Math.abs(d)>0){var f=Math.min(o,o+u),m=Math.max(o,o+u),p=Math.min(l,l+d),g=Math.max(l,l+d);return r>=f&&r<=m&&a>=p&&a<=g}return!1},lue={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},IO=function(t){var n=b3(b3({},lue),t),r=y.useRef(),a=y.useState(-1),o=Jce(a,2),l=o[0],u=o[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var T=r.current.getTotalLength();T&&u(T)}catch{}},[]);var d=n.x,f=n.y,m=n.width,p=n.height,g=n.radius,x=n.className,j=n.animationEasing,b=n.animationDuration,w=n.animationBegin,N=n.isAnimationActive,A=n.isUpdateAnimationActive;if(d!==+d||f!==+f||m!==+m||p!==+p||m===0||p===0)return null;var E=Ye("recharts-rectangle",x);return A?W.createElement(gi,{canBegin:l>0,from:{width:m,height:p,x:d,y:f},to:{width:m,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:A},function(T){var C=T.width,k=T.height,O=T.x,M=T.y;return W.createElement(gi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,isActive:N,easing:j},W.createElement("path",eg({},Be(n,!0),{className:E,d:w3(O,M,C,k,g),ref:r})))}):W.createElement("path",eg({},Be(n,!0),{className:E,d:w3(d,f,m,p,g)}))},cue=["points","className","baseLinePoints","connectNulls"];function Bc(){return Bc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function due(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function j3(e){return pue(e)||mue(e)||hue(e)||fue()}function fue(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hue(e,t){if(e){if(typeof e=="string")return mN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mN(e,t)}}function mue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pue(e){if(Array.isArray(e))return mN(e)}function mN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){S3(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),S3(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},_f=function(t,n){var r=vue(t);n&&(r=[r.reduce(function(o,l){return[].concat(j3(o),j3(l))},[])]);var a=r.map(function(o){return o.reduce(function(l,u,d){return"".concat(l).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},gue=function(t,n,r){var a=_f(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(_f(n.reverse(),r).slice(1))},yue=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,o=t.connectNulls,l=uue(t,cue);if(!n||!n.length)return null;var u=Ye("recharts-polygon",r);if(a&&a.length){var d=l.stroke&&l.stroke!=="none",f=gue(n,a,o);return W.createElement("g",{className:u},W.createElement("path",Bc({},Be(l,!0),{fill:f.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:f})),d?W.createElement("path",Bc({},Be(l,!0),{fill:"none",d:_f(n,o)})):null,d?W.createElement("path",Bc({},Be(l,!0),{fill:"none",d:_f(a,o)})):null)}var m=_f(n,o);return W.createElement("path",Bc({},Be(l,!0),{fill:m.slice(-1)==="Z"?l.fill:"none",className:u,d:m}))};function pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Cue=function(t,n,r,a,o,l){return"M".concat(t,",").concat(o,"v").concat(a,"M").concat(l,",").concat(n,"h").concat(r)},Oue=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,l=t.top,u=l===void 0?0:l,d=t.left,f=d===void 0?0:d,m=t.width,p=m===void 0?0:m,g=t.height,x=g===void 0?0:g,j=t.className,b=_ue(t,xue),w=bue({x:r,y:o,top:u,left:f,width:p,height:x},b);return!Ce(r)||!Ce(o)||!Ce(p)||!Ce(x)||!Ce(u)||!Ce(f)?null:W.createElement("path",vN({},Be(w,!0),{className:Ye("recharts-cross",j),d:Cue(r,o,p,x,u,f)}))},gS,N3;function Eue(){if(N3)return gS;N3=1;var e=fy(),t=c6(),n=wi();function r(a,o){return a&&a.length?e(a,n(o,2),t):void 0}return gS=r,gS}var Aue=Eue();const Tue=St(Aue);var yS,C3;function kue(){if(C3)return yS;C3=1;var e=fy(),t=wi(),n=u6();function r(a,o){return a&&a.length?e(a,t(o,2),n):void 0}return yS=r,yS}var Mue=kue();const Pue=St(Mue);var Rue=["cx","cy","angle","ticks","axisLine"],Due=["ticks","tick","angle","tickFormatter","stroke"];function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $ue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A3(e,t){for(var n=0;nM3?l=a==="outer"?"start":"end":o<-M3?l=a==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,o=r.cy,l=r.radius,u=r.axisLine,d=r.axisLineType,f=qs(qs({},Be(this.props,!1)),{},{fill:"none"},Be(u,!1));if(d==="circle")return W.createElement(gy,Ws({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:o,r:l}));var m=this.props.ticks,p=m.map(function(g){return Gt(a,o,l,g.coordinate)});return W.createElement(yue,Ws({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,o=a.ticks,l=a.tick,u=a.tickLine,d=a.tickFormatter,f=a.stroke,m=Be(this.props,!1),p=Be(l,!1),g=qs(qs({},m),{},{fill:"none"},Be(u,!1)),x=o.map(function(j,b){var w=r.getTickLineCoord(j),N=r.getTickTextAnchor(j),A=qs(qs(qs({textAnchor:N},m),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:w.x2,y:w.y2});return W.createElement(pt,Ws({className:Ye("recharts-polar-angle-axis-tick",L6(l)),key:"tick-".concat(j.coordinate)},fl(r.props,j,b)),u&&W.createElement("line",Ws({className:"recharts-polar-angle-axis-tick-line"},g,w)),l&&t.renderTickItem(l,A,d?d(j.value,b):j.value))});return W.createElement(pt,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,a=r.ticks,o=r.radius,l=r.axisLine;return o<=0||!a||!a.length?null:W.createElement(pt,{className:Ye("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,o){var l;return W.isValidElement(r)?l=W.cloneElement(r,a):We(r)?l=r(a):l=W.createElement(hl,Ws({},a,{className:"recharts-polar-angle-axis-tick-value"}),o),l}}])})(y.PureComponent);by(wy,"displayName","PolarAngleAxis");by(wy,"axisType","angleAxis");by(wy,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var xS,P3;function Que(){if(P3)return xS;P3=1;var e=lz(),t=e(Object.getPrototypeOf,Object);return xS=t,xS}var bS,R3;function Jue(){if(R3)return bS;R3=1;var e=lo(),t=Que(),n=co(),r="[object Object]",a=Function.prototype,o=Object.prototype,l=a.toString,u=o.hasOwnProperty,d=l.call(Object);function f(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var g=u.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==d}return bS=f,bS}var ede=Jue();const tde=St(ede);var wS,D3;function nde(){if(D3)return wS;D3=1;var e=lo(),t=co(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return wS=r,wS}var rde=nde();const ade=St(rde);function th(e){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(e)}function rg(){return rg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:m,lowerWidth:p,height:g,x:d,y:f},duration:b,animationEasing:j,isActive:N},function(E){var T=E.upperWidth,C=E.lowerWidth,k=E.height,O=E.x,M=E.y;return W.createElement(gi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,easing:j},W.createElement("path",rg({},Be(n,!0),{className:A,d:B3(O,M,T,C,k),ref:r})))}):W.createElement("g",null,W.createElement("path",rg({},Be(n,!0),{className:A,d:B3(d,f,m,p,g)})))},pde=["option","shapeType","propTransformer","activeClassName","isActive"];function nh(e){"@babel/helpers - typeof";return nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nh(e)}function vde(e,t){if(e==null)return{};var n=gde(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ag(e){for(var t=1;t0?ta(E,"paddingAngle",0):0;if(C){var O=Qr(C.endAngle-C.startAngle,E.endAngle-E.startAngle),M=Ut(Ut({},E),{},{startAngle:A+k,endAngle:A+O(b)+k});w.push(M),A=M.endAngle}else{var I=E.endAngle,z=E.startAngle,D=Qr(0,I-z),H=D(b),V=Ut(Ut({},E),{},{startAngle:A+k,endAngle:A+H+k});w.push(V),A=V.endAngle}}),W.createElement(pt,null,r.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var l=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,o=r.isAnimationActive,l=this.state.prevSectors;return o&&a&&a.length&&(!l||!Dh(l,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,o=a.hide,l=a.sectors,u=a.className,d=a.label,f=a.cx,m=a.cy,p=a.innerRadius,g=a.outerRadius,x=a.isAnimationActive,j=this.state.isAnimationFinished;if(o||!l||!l.length||!Ce(f)||!Ce(m)||!Ce(p)||!Ce(g))return null;var b=Ye("recharts-pie",u);return W.createElement(pt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(N){r.pieRef=N}},this.renderSectors(),d&&this.renderLabels(l),qn.renderCallByParent(this.props,null,!1),(!x||j)&&to.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?A:A-1)*d,T=w-A*x-E,C=a.reduce(function(M,I){var z=kn(I,N,0);return M+(Ce(z)?z:0)},0),k;if(C>0){var O;k=a.map(function(M,I){var z=kn(M,N,0),D=kn(M,m,I),H=(Ce(z)?z:0)/C,V;I?V=O.endAngle+br(b)*d*(z!==0?1:0):V=l;var F=V+br(b)*((z!==0?x:0)+H*T),G=(V+F)/2,L=(j.innerRadius+j.outerRadius)/2,R=[{name:D,value:z,payload:M,dataKey:N,type:g}],U=Gt(j.cx,j.cy,L,G);return O=Ut(Ut(Ut({percent:H,cornerRadius:o,name:D,tooltipPayload:R,midAngle:G,middleRadius:L,tooltipPosition:U},M),j),{},{value:kn(M,N),startAngle:V,endAngle:F,payload:M,paddingAngle:br(b)*d}),O})}return Ut(Ut({},j),{},{sectors:k,data:a})});var jS,H3;function Lde(){if(H3)return jS;H3=1;var e=Math.ceil,t=Math.max;function n(r,a,o,l){for(var u=-1,d=t(e((a-r)/(o||1)),0),f=Array(d);d--;)f[l?d:++u]=r,r+=o;return f}return jS=n,jS}var SS,W3;function nq(){if(W3)return SS;W3=1;var e=_z(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var o=a<0?-1:1;return o*n}return a===a?a:0}return SS=r,SS}var _S,V3;function Bde(){if(V3)return _S;V3=1;var e=Lde(),t=ay(),n=nq();function r(a){return function(o,l,u){return u&&typeof u!="number"&&t(o,l,u)&&(l=u=void 0),o=n(o),l===void 0?(l=o,o=0):l=n(l),u=u===void 0?o0&&r.handleDrag(a.changedTouches[0])}),Yr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,o=a.endIndex,l=a.onDragEnd,u=a.startIndex;l?.({endIndex:o,startIndex:u})}),r.detachDragEndListener()}),Yr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Yr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Yr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Yr(r,"handleSlideDragStart",function(a){var o=Q3(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Zde(t,e),Gde(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,o=r.endX,l=this.state.scaleValues,u=this.props,d=u.gap,f=u.data,m=f.length-1,p=Math.min(a,o),g=Math.max(a,o),x=t.getIndexInRange(l,p),j=t.getIndexInRange(l,g);return{startIndex:x-x%d,endIndex:j===m?m:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,o=a.data,l=a.tickFormatter,u=a.dataKey,d=kn(o[r],u,r);return We(l)?l(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,o=a.slideMoveStartX,l=a.startX,u=a.endX,d=this.props,f=d.x,m=d.width,p=d.travellerWidth,g=d.startIndex,x=d.endIndex,j=d.onChange,b=r.pageX-o;b>0?b=Math.min(b,f+m-p-u,f+m-p-l):b<0&&(b=Math.max(b,f-l,f-u));var w=this.getIndex({startX:l+b,endX:u+b});(w.startIndex!==g||w.endIndex!==x)&&j&&j(w),this.setState({startX:l+b,endX:u+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var o=Q3(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,o=a.brushMoveStartX,l=a.movingTravellerId,u=a.endX,d=a.startX,f=this.state[l],m=this.props,p=m.x,g=m.width,x=m.travellerWidth,j=m.onChange,b=m.gap,w=m.data,N={startX:this.state.startX,endX:this.state.endX},A=r.pageX-o;A>0?A=Math.min(A,p+g-x-f):A<0&&(A=Math.max(A,p-f)),N[l]=f+A;var E=this.getIndex(N),T=E.startIndex,C=E.endIndex,k=function(){var M=w.length-1;return l==="startX"&&(u>d?T%b===0:C%b===0)||ud?C%b===0:T%b===0)||u>d&&C===M};this.setState(Yr(Yr({},l,f+A),"brushMoveStartX",r.pageX),function(){j&&k()&&j(E)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var o=this,l=this.state,u=l.scaleValues,d=l.startX,f=l.endX,m=this.state[a],p=u.indexOf(m);if(p!==-1){var g=p+r;if(!(g===-1||g>=u.length)){var x=u[g];a==="startX"&&x>=f||a==="endX"&&x<=d||this.setState(Yr({},a,x),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,o=r.y,l=r.width,u=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:o,width:l,height:u})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,o=r.y,l=r.width,u=r.height,d=r.data,f=r.children,m=r.padding,p=y.Children.only(f);return p?W.cloneElement(p,{x:a,y:o,width:l,height:u,margin:m,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var o,l,u=this,d=this.props,f=d.y,m=d.travellerWidth,p=d.height,g=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,w=d.endIndex,N=Math.max(r,this.props.x),A=CS(CS({},Be(this.props,!1)),{},{x:N,y:f,width:m,height:p}),E=x||"Min value: ".concat((o=j[b])===null||o===void 0?void 0:o.name,", Max value: ").concat((l=j[w])===null||l===void 0?void 0:l.name);return W.createElement(pt,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),u.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,A))}},{key:"renderSlide",value:function(r,a){var o=this.props,l=o.y,u=o.height,d=o.stroke,f=o.travellerWidth,m=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:m,y:l,width:p,height:u})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,o=r.endIndex,l=r.y,u=r.height,d=r.travellerWidth,f=r.stroke,m=this.state,p=m.startX,g=m.endX,x=5,j={pointerEvents:"none",fill:f};return W.createElement(pt,{className:"recharts-brush-texts"},W.createElement(hl,sg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:l+u/2},j),this.getTextOfTick(a)),W.createElement(hl,sg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,y:l+u/2},j),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,a=r.data,o=r.className,l=r.children,u=r.x,d=r.y,f=r.width,m=r.height,p=r.alwaysShowText,g=this.state,x=g.startX,j=g.endX,b=g.isTextActive,w=g.isSlideMoving,N=g.isTravellerMoving,A=g.isTravellerFocused;if(!a||!a.length||!Ce(u)||!Ce(d)||!Ce(f)||!Ce(m)||f<=0||m<=0)return null;var E=Ye("recharts-brush",o),T=W.Children.count(l)===1,C=Wde("userSelect","none");return W.createElement(pt,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(b||w||N||A||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,o=r.y,l=r.width,u=r.height,d=r.stroke,f=Math.floor(o+u/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:o,width:l,height:u,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+l-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+l-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):We(r)?o=r(a):o=t.renderDefaultTraveller(a),o}},{key:"getDerivedStateFromProps",value:function(r,a){var o=r.data,l=r.width,u=r.x,d=r.travellerWidth,f=r.updateId,m=r.startIndex,p=r.endIndex;if(o!==a.prevData||f!==a.prevUpdateId)return CS({prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l},o&&o.length?Jde({data:o,width:l,x:u,travellerWidth:d,startIndex:m,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+l-d]);var g=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var o=r.length,l=0,u=o-1;u-l>1;){var d=Math.floor((l+u)/2);r[d]>a?u=d:l=d}return a>=r[u]?u:l}}])})(y.PureComponent);Yr(yu,"displayName","Brush");Yr(yu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var OS,J3;function efe(){if(J3)return OS;J3=1;var e=cO();function t(n,r){var a;return e(n,function(o,l,u){return a=r(o,l,u),!a}),!!a}return OS=t,OS}var ES,eI;function tfe(){if(eI)return ES;eI=1;var e=tz(),t=wi(),n=efe(),r=Lr(),a=ay();function o(l,u,d){var f=r(l)?e:n;return d&&a(l,u,d)&&(u=void 0),f(l,t(u,3))}return ES=o,ES}var nfe=tfe();const rfe=St(nfe);var hi=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},AS,tI;function afe(){if(tI)return AS;tI=1;var e=xz();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return AS=t,AS}var TS,nI;function ife(){if(nI)return TS;nI=1;var e=afe(),t=gz(),n=wi();function r(a,o){var l={};return o=n(o,3),t(a,function(u,d,f){e(l,d,o(u,d,f))}),l}return TS=r,TS}var ofe=ife();const sfe=St(ofe);var kS,rI;function lfe(){if(rI)return kS;rI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yfe(e,t){var n=e.x,r=e.y,a=vfe(e,ffe),o="".concat(n),l=parseInt(o,10),u="".concat(r),d=parseInt(u,10),f="".concat(t.height||a.height),m=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return af(af(af(af(af({},t),a),l?{x:l}:{}),d?{y:d}:{}),{},{height:m,width:g,name:t.name,radius:t.radius})}function sI(e){return W.createElement(J6,wN({shapeType:"rectangle",propTransformer:yfe,activeClassName:"recharts-active-bar"},e))}var xfe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var o=Ce(r)||FQ(r);return o?t(r,a):(o||ur(!1),n)}},bfe=["value","background"],sq;function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function wfe(e,t){if(e==null)return{};var n=jfe(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cg(){return cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(F)0&&(V=Math.min((ne||0)-(F[oe-1]||0),V))}),Number.isFinite(V)){var G=V/H,L=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=G*L/2),b.padding==="no-gap"){var R=wr(t.barCategoryGap,G*L),U=G*L/2;O=U-R-(U-R)/L*R}}}a==="xAxis"?M=[r.left+(E.left||0)+(O||0),r.left+r.width-(E.right||0)-(O||0)]:a==="yAxis"?M=d==="horizontal"?[r.top+r.height-(E.bottom||0),r.top+(E.top||0)]:[r.top+(E.top||0)+(O||0),r.top+r.height-(E.bottom||0)-(O||0)]:M=b.range,C&&(M=[M[1],M[0]]);var K=k6(b,o,g),te=K.scale,$=K.realScaleType;te.domain(N).range(M),M6(te);var B=P6(te,Ia(Ia({},b),{},{realScaleType:$}));a==="xAxis"?(D=w==="top"&&!T||w==="bottom"&&T,I=r.left,z=p[k]-D*b.height):a==="yAxis"&&(D=w==="left"&&!T||w==="right"&&T,I=p[k]-D*b.width,z=r.top);var Y=Ia(Ia(Ia({},b),B),{},{realScaleType:$,x:I,y:z,scale:te,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return Y.bandSize=Gv(Y,B),!b.hide&&a==="xAxis"?p[k]+=(D?-1:1)*Y.height:b.hide||(p[k]+=(D?-1:1)*Y.width),Ia(Ia({},x),{},_y({},j,Y))},{})},fq=function(t,n){var r=t.x,a=t.y,o=n.x,l=n.y;return{x:Math.min(r,o),y:Math.min(a,l),width:Math.abs(o-r),height:Math.abs(l-a)}},Pfe=function(t){var n=t.x1,r=t.y1,a=t.x2,o=t.y2;return fq({x:n,y:r},{x:a,y:o})},hq=(function(){function e(t){Tfe(this,e),this.scale=t}return kfe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(n)+u}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],o=r[r.length-1];return a<=o?n>=a&&n<=o:n>=o&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();_y(hq,"EPS",1e-4);var LO=function(t){var n=Object.keys(t).reduce(function(r,a){return Ia(Ia({},r),{},_y({},a,hq.create(t[a])))},{});return Ia(Ia({},n),{},{apply:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.bandAware,u=o.position;return sfe(a,function(d,f){return n[f].apply(d,{bandAware:l,position:u})})},isInRange:function(a){return oq(a,function(o,l){return n[l].isInRange(o)})}})};function Rfe(e){return(e%180+180)%180}var Dfe=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Rfe(a),l=o*Math.PI/180,u=Math.atan(r/n),d=l>u&&l-1?d[f?o[m]:m]:void 0}}return RS=r,RS}var DS,hI;function Ife(){if(hI)return DS;hI=1;var e=nq();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return DS=t,DS}var $S,mI;function Lfe(){if(mI)return $S;mI=1;var e=fz(),t=wi(),n=Ife(),r=Math.max;function a(o,l,u){var d=o==null?0:o.length;if(!d)return-1;var f=u==null?0:n(u);return f<0&&(f=r(d+f,0)),e(o,t(l,3),f)}return $S=a,$S}var IS,pI;function Bfe(){if(pI)return IS;pI=1;var e=$fe(),t=Lfe(),n=e(t);return IS=n,IS}var zfe=Bfe();const qfe=St(zfe);var Ffe=EB();const Ufe=St(Ffe);var Hfe=Ufe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),BO=y.createContext(void 0),zO=y.createContext(void 0),mq=y.createContext(void 0),pq=y.createContext({}),vq=y.createContext(void 0),gq=y.createContext(0),yq=y.createContext(0),vI=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,o=n.offset,l=t.clipPathId,u=t.children,d=t.width,f=t.height,m=Hfe(o);return W.createElement(BO.Provider,{value:r},W.createElement(zO.Provider,{value:a},W.createElement(pq.Provider,{value:o},W.createElement(mq.Provider,{value:m},W.createElement(vq.Provider,{value:l},W.createElement(gq.Provider,{value:f},W.createElement(yq.Provider,{value:d},u)))))))},Wfe=function(){return y.useContext(vq)},xq=function(t){var n=y.useContext(BO);n==null&&ur(!1);var r=n[t];return r==null&&ur(!1),r},Vfe=function(){var t=y.useContext(BO);return Fo(t)},Gfe=function(){var t=y.useContext(zO),n=qfe(t,function(r){return oq(r.domain,Number.isFinite)});return n||Fo(t)},bq=function(t){var n=y.useContext(zO);n==null&&ur(!1);var r=n[t];return r==null&&ur(!1),r},Yfe=function(){var t=y.useContext(mq);return t},Kfe=function(){return y.useContext(pq)},qO=function(){return y.useContext(yq)},FO=function(){return y.useContext(gq)};function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function Xfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zfe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-a)<=0}function Mhe(e,t){return Oq(e,t+1)}function Phe(e,t,n,r,a){for(var o=(r||[]).slice(),l=t.start,u=t.end,d=0,f=1,m=l,p=function(){var j=r?.[d];if(j===void 0)return{v:Oq(r,f)};var b=d,w,N=function(){return w===void 0&&(w=n(j,b)),w},A=j.coordinate,E=d===0||mg(e,A,N,m,u);E||(d=0,m=l,f+=1),E&&(m=A+e*(N()/2+a),d+=f)},g;f<=o.length;)if(g=p(),g)return g.v;return[]}function sh(e){"@babel/helpers - typeof";return sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sh(e)}function _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function or(e){for(var t=1;t0?x.coordinate-w*e:x.coordinate})}else o[g]=x=or(or({},x),{},{tickCoord:x.coordinate});var N=mg(e,x.tickCoord,b,u,d);N&&(d=x.tickCoord-e*(b()/2+a),o[g]=or(or({},x),{},{isShow:!0}))},m=l-1;m>=0;m--)f(m);return o}function Lhe(e,t,n,r,a,o){var l=(r||[]).slice(),u=l.length,d=t.start,f=t.end;if(o){var m=r[u-1],p=n(m,u-1),g=e*(m.coordinate+e*p/2-f);l[u-1]=m=or(or({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate});var x=mg(e,m.tickCoord,function(){return p},d,f);x&&(f=m.tickCoord-e*(p/2+a),l[u-1]=or(or({},m),{},{isShow:!0}))}for(var j=o?u-1:u,b=function(A){var E=l[A],T,C=function(){return T===void 0&&(T=n(E,A)),T};if(A===0){var k=e*(E.coordinate-e*C()/2-d);l[A]=E=or(or({},E),{},{tickCoord:k<0?E.coordinate-k*e:E.coordinate})}else l[A]=E=or(or({},E),{},{tickCoord:E.coordinate});var O=mg(e,E.tickCoord,C,d,f);O&&(d=E.tickCoord+e*(C()/2+a),l[A]=or(or({},E),{},{isShow:!0}))},w=0;w=2?br(a[1].coordinate-a[0].coordinate):1,N=khe(o,w,x);return d==="equidistantPreserveStart"?Phe(w,N,b,a,l):(d==="preserveStart"||d==="preserveStartEnd"?g=Lhe(w,N,b,a,l,d==="preserveStartEnd"):g=Ihe(w,N,b,a,l),g.filter(function(A){return A.isShow}))}var Bhe=["viewBox"],zhe=["viewBox"],qhe=["ticks"];function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fhe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Uhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CI(e,t){for(var n=0;n0?d(this.props):d(x)),l<=0||u<=0||!j||!j.length?null:W.createElement(pt,{className:Ye("recharts-cartesian-axis",f),ref:function(w){r.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),qn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,o){var l,u=Ye(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?l=W.cloneElement(r,An(An({},a),{},{className:u})):We(r)?l=r(An(An({},a),{},{className:u})):l=W.createElement(hl,qc({},a,{className:"recharts-cartesian-axis-tick-value"}),o),l}}])})(y.Component);VO(Vu,"displayName","CartesianAxis");VO(Vu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Xhe=["x1","y1","x2","y2","key"],Zhe=["offset"];function pl(e){"@babel/helpers - typeof";return pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pl(e)}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tme(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var nme=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,o=t.y,l=t.width,u=t.height,d=t.ry;return W.createElement("rect",{x:a,y:o,ry:d,width:l,height:u,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Tq(e,t){var n;if(W.isValidElement(e))n=W.cloneElement(e,t);else if(We(e))n=e(t);else{var r=t.x1,a=t.y1,o=t.x2,l=t.y2,u=t.key,d=EI(t,Xhe),f=Be(d,!1);f.offset;var m=EI(f,Zhe);n=W.createElement("line",Xs({},m,{x1:r,y1:a,x2:o,y2:l,fill:"none",key:u}))}return n}function rme(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,o=e.horizontalPoints;if(!a||!o||!o.length)return null;var l=o.map(function(u,d){var f=lr(lr({},e),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return Tq(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function ame(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,o=e.verticalPoints;if(!a||!o||!o.length)return null;var l=o.map(function(u,d){var f=lr(lr({},e),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return Tq(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function ime(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,o=e.width,l=e.height,u=e.horizontalPoints,d=e.horizontal,f=d===void 0?!0:d;if(!f||!t||!t.length)return null;var m=u.map(function(g){return Math.round(g+a-a)}).sort(function(g,x){return g-x});a!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?a+l-g:m[x+1]-g;if(b<=0)return null;var w=x%t.length;return W.createElement("rect",{key:"react-".concat(x),y:g,x:r,height:b,width:o,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function ome(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,o=e.x,l=e.y,u=e.width,d=e.height,f=e.verticalPoints;if(!n||!r||!r.length)return null;var m=f.map(function(g){return Math.round(g+o-o)}).sort(function(g,x){return g-x});o!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?o+u-g:m[x+1]-g;if(b<=0)return null;var w=x%r.length;return W.createElement("rect",{key:"react-".concat(x),x:g,y:l,width:b,height:d,stroke:"none",fill:r[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var sme=function(t,n){var r=t.xAxis,a=t.width,o=t.height,l=t.offset;return T6(WO(lr(lr(lr({},Vu.defaultProps),r),{},{ticks:Ki(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),l.left,l.left+l.width,n)},lme=function(t,n){var r=t.yAxis,a=t.width,o=t.height,l=t.offset;return T6(WO(lr(lr(lr({},Vu.defaultProps),r),{},{ticks:Ki(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),l.top,l.top+l.height,n)},_c={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function ff(e){var t,n,r,a,o,l,u=qO(),d=FO(),f=Kfe(),m=lr(lr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:_c.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:_c.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:_c.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:_c.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:_c.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:_c.verticalFill,x:Ce(e.x)?e.x:f.left,y:Ce(e.y)?e.y:f.top,width:Ce(e.width)?e.width:f.width,height:Ce(e.height)?e.height:f.height}),p=m.x,g=m.y,x=m.width,j=m.height,b=m.syncWithTicks,w=m.horizontalValues,N=m.verticalValues,A=Vfe(),E=Gfe();if(!Ce(x)||x<=0||!Ce(j)||j<=0||!Ce(p)||p!==+p||!Ce(g)||g!==+g)return null;var T=m.verticalCoordinatesGenerator||sme,C=m.horizontalCoordinatesGenerator||lme,k=m.horizontalPoints,O=m.verticalPoints;if((!k||!k.length)&&We(C)){var M=w&&w.length,I=C({yAxis:E?lr(lr({},E),{},{ticks:M?w:E.ticks}):void 0,width:u,height:d,offset:f},M?!0:b);qa(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(pl(I),"]")),Array.isArray(I)&&(k=I)}if((!O||!O.length)&&We(T)){var z=N&&N.length,D=T({xAxis:A?lr(lr({},A),{},{ticks:z?N:A.ticks}):void 0,width:u,height:d,offset:f},z?!0:b);qa(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(pl(D),"]")),Array.isArray(D)&&(O=D)}return W.createElement("g",{className:"recharts-cartesian-grid"},W.createElement(nme,{fill:m.fill,fillOpacity:m.fillOpacity,x:m.x,y:m.y,width:m.width,height:m.height,ry:m.ry}),W.createElement(rme,Xs({},m,{offset:f,horizontalPoints:k,xAxis:A,yAxis:E})),W.createElement(ame,Xs({},m,{offset:f,verticalPoints:O,xAxis:A,yAxis:E})),W.createElement(ime,Xs({},m,{horizontalPoints:k})),W.createElement(ome,Xs({},m,{verticalPoints:O})))}ff.displayName="CartesianGrid";var cme=["type","layout","connectNulls","ref"],ume=["key"];function _u(e){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_u(e)}function AI(e,t){if(e==null)return{};var n=dme(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dme(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Cf(){return Cf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);np){x=[].concat(Nc(d.slice(0,j)),[p-b]);break}var w=x.length%2===0?[0,g]:[g];return[].concat(Nc(t.repeat(d,m)),Nc(x),w).map(function(N){return"".concat(N,"px")}).join(", ")}),La(n,"id",qu("recharts-line-")),La(n,"pathRef",function(l){n.mainCurve=l}),La(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),La(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return wme(t,e),gme(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.points,u=o.xAxis,d=o.yAxis,f=o.layout,m=o.children,p=na(m,$h);if(!p)return null;var g=function(b,w){return{x:b.x,y:b.y,value:b.value,errorVal:kn(b.payload,w)}},x={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(pt,x,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:l,xAxis:u,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,o){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,f=u.points,m=u.dataKey,p=Be(this.props,!1),g=Be(d,!0),x=f.map(function(b,w){var N=Gr(Gr(Gr({key:"dot-".concat(w),r:3},p),g),{},{index:w,cx:b.x,cy:b.y,value:b.value,dataKey:m,payload:b.payload,points:f});return t.renderDotItem(d,N)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(o,")"):null};return W.createElement(pt,Cf({className:"recharts-line-dots",key:"dots"},j),x)}},{key:"renderCurveStatically",value:function(r,a,o,l){var u=this.props,d=u.type,f=u.layout,m=u.connectNulls;u.ref;var p=AI(u,cme),g=Gr(Gr(Gr({},Be(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(o,")"):null,points:r},l),{},{type:d,layout:f,connectNulls:m});return W.createElement(Xv,Cf({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var o=this,l=this.props,u=l.points,d=l.strokeDasharray,f=l.isAnimationActive,m=l.animationBegin,p=l.animationDuration,g=l.animationEasing,x=l.animationId,j=l.animateNewValues,b=l.width,w=l.height,N=this.state,A=N.prevPoints,E=N.totalLength;return W.createElement(gi,{begin:m,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(T){var C=T.t;if(A){var k=A.length/u.length,O=u.map(function(H,V){var F=Math.floor(V*k);if(A[F]){var G=A[F],L=Qr(G.x,H.x),R=Qr(G.y,H.y);return Gr(Gr({},H),{},{x:L(C),y:R(C)})}if(j){var U=Qr(b*2,H.x),K=Qr(w/2,H.y);return Gr(Gr({},H),{},{x:U(C),y:K(C)})}return Gr(Gr({},H),{},{x:H.x,y:H.y})});return o.renderCurveStatically(O,r,a)}var M=Qr(0,E),I=M(C),z;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function(H){return parseFloat(H)});z=o.getStrokeDasharray(I,E,D)}else z=o.generateSimpleStrokeDasharray(E,I);return o.renderCurveStatically(u,r,a,{strokeDasharray:z})})}},{key:"renderCurve",value:function(r,a){var o=this.props,l=o.points,u=o.isAnimationActive,d=this.state,f=d.prevPoints,m=d.totalLength;return u&&l&&l.length&&(!f&&m>0||!Dh(f,l))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(l,r,a)}},{key:"render",value:function(){var r,a=this.props,o=a.hide,l=a.dot,u=a.points,d=a.className,f=a.xAxis,m=a.yAxis,p=a.top,g=a.left,x=a.width,j=a.height,b=a.isAnimationActive,w=a.id;if(o||!u||!u.length)return null;var N=this.state.isAnimationFinished,A=u.length===1,E=Ye("recharts-line",d),T=f&&f.allowDataOverflow,C=m&&m.allowDataOverflow,k=T||C,O=Ge(w)?this.id:w,M=(r=Be(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},I=M.r,z=I===void 0?3:I,D=M.strokeWidth,H=D===void 0?2:D,V=eJ(l)?l:{},F=V.clipDot,G=F===void 0?!0:F,L=z*2+H;return W.createElement(pt,{className:E},T||C?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(O)},W.createElement("rect",{x:T?g:g-x/2,y:C?p:p-j/2,width:T?x:x*2,height:C?j:j*2})),!G&&W.createElement("clipPath",{id:"clipPath-dots-".concat(O)},W.createElement("rect",{x:g-L/2,y:p-L/2,width:x+L,height:j+L}))):null,!A&&this.renderCurve(k,O),this.renderErrorBar(k,O),(A||l)&&this.renderDots(k,G,O),(!b||N)&&to.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var o=r.length%2!==0?[].concat(Nc(r),[0]):r,l=[],u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dpe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hpe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&Ce(a)&&Ce(o)?t.slice(a,o+1):[]};function Wq(e){return e==="number"?[0,"auto"]:void 0}var zN=function(t,n,r,a){var o=t.graphicalItems,l=t.tooltipAxis,u=Ay(n,t);return r<0||!o||!o.length||r>=u.length?null:o.reduce(function(d,f){var m,p=(m=f.props.data)!==null&&m!==void 0?m:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var x=p===void 0?u:p;g=jv(x,l.dataKey,a)}else g=p&&p[r]||u[r];return g?[].concat(Eu(d),[D6(f,g)]):d},[])},LI=function(t,n,r,a){var o=a||{x:t.chartX,y:t.chartY},l=Npe(o,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,m=Zoe(l,u,f,d);if(m>=0&&f){var p=f[m]&&f[m].value,g=zN(t,n,m,p),x=Cpe(r,u,m,o);return{activeTooltipIndex:m,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},Ope=function(t,n){var r=n.axes,a=n.graphicalItems,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=t.stackOffset,x=A6(m,o);return r.reduce(function(j,b){var w,N=b.type.defaultProps!==void 0?ye(ye({},b.type.defaultProps),b.props):b.props,A=N.type,E=N.dataKey,T=N.allowDataOverflow,C=N.allowDuplicatedCategory,k=N.scale,O=N.ticks,M=N.includeHidden,I=N[l];if(j[I])return j;var z=Ay(t.data,{graphicalItems:a.filter(function(B){var Y,ne=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l];return ne===I}),dataStartIndex:d,dataEndIndex:f}),D=z.length,H,V,F;Jme(N.domain,T,A)&&(H=eN(N.domain,null,T),x&&(A==="number"||k!=="auto")&&(F=jf(z,E,"category")));var G=Wq(A);if(!H||H.length===0){var L,R=(L=N.domain)!==null&&L!==void 0?L:G;if(E){if(H=jf(z,E,A),A==="category"&&x){var U=HQ(H);C&&U?(V=H,H=og(0,D)):C||(H=I$(R,H,b).reduce(function(B,Y){return B.indexOf(Y)>=0?B:[].concat(Eu(B),[Y])},[]))}else if(A==="category")C?H=H.filter(function(B){return B!==""&&!Ge(B)}):H=I$(R,H,b).reduce(function(B,Y){return B.indexOf(Y)>=0||Y===""||Ge(Y)?B:[].concat(Eu(B),[Y])},[]);else if(A==="number"){var K=nse(z,a.filter(function(B){var Y,ne,oe=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l],xe="hide"in B.props?B.props.hide:(ne=B.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return oe===I&&(M||!xe)}),E,o,m);K&&(H=K)}x&&(A==="number"||k!=="auto")&&(F=jf(z,E,"category"))}else x?H=og(0,D):u&&u[I]&&u[I].hasStack&&A==="number"?H=g==="expand"?[0,1]:R6(u[I].stackGroups,d,f):H=E6(z,a.filter(function(B){var Y=l in B.props?B.props[l]:B.type.defaultProps[l],ne="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Y===I&&(M||!ne)}),A,m,!0);if(A==="number")H=IN(p,H,I,o,O),R&&(H=eN(R,H,T));else if(A==="category"&&R){var te=R,$=H.every(function(B){return te.indexOf(B)>=0});$&&(H=te)}}return ye(ye({},j),{},Fe({},I,ye(ye({},N),{},{axisType:o,domain:H,categoricalDomain:F,duplicateDomain:V,originalDomain:(w=N.domain)!==null&&w!==void 0?w:G,isCategorical:x,layout:m})))},{})},Epe=function(t,n){var r=n.graphicalItems,a=n.Axis,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=Ay(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=A6(m,o),b=-1;return r.reduce(function(w,N){var A=N.type.defaultProps!==void 0?ye(ye({},N.type.defaultProps),N.props):N.props,E=A[l],T=Wq("number");if(!w[E]){b++;var C;return j?C=og(0,x):u&&u[E]&&u[E].hasStack?(C=R6(u[E].stackGroups,d,f),C=IN(p,C,E,o)):(C=eN(T,E6(g,r.filter(function(k){var O,M,I=l in k.props?k.props[l]:(O=k.type.defaultProps)===null||O===void 0?void 0:O[l],z="hide"in k.props?k.props.hide:(M=k.type.defaultProps)===null||M===void 0?void 0:M.hide;return I===E&&!z}),"number",m),a.defaultProps.allowDataOverflow),C=IN(p,C,E,o)),ye(ye({},w),{},Fe({},E,ye(ye({axisType:o},a.defaultProps),{},{hide:!0,orientation:ta(Spe,"".concat(o,".").concat(b%2),null),domain:C,originalDomain:T,isCategorical:j,layout:m})))}return w},{})},Ape=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,o=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.children,p="".concat(a,"Id"),g=na(m,o),x={};return g&&g.length?x=Ope(t,{axes:g,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f}):l&&l.length&&(x=Epe(t,{Axis:o,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f})),x},Tpe=function(t){var n=Fo(t),r=Ki(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:uO(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Gv(n,r)}},BI=function(t){var n=t.children,r=t.defaultShowTooltip,a=Kr(n,yu),o=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(o=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},kpe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ji(n&&n.type);return r&&r.indexOf("Bar")>=0})},zI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Mpe=function(t,n){var r=t.props,a=t.graphicalItems,o=t.xAxisMap,l=o===void 0?{}:o,u=t.yAxisMap,d=u===void 0?{}:u,f=r.width,m=r.height,p=r.children,g=r.margin||{},x=Kr(p,yu),j=Kr(p,nl),b=Object.keys(d).reduce(function(C,k){var O=d[k],M=O.orientation;return!O.mirror&&!O.hide?ye(ye({},C),{},Fe({},M,C[M]+O.width)):C},{left:g.left||0,right:g.right||0}),w=Object.keys(l).reduce(function(C,k){var O=l[k],M=O.orientation;return!O.mirror&&!O.hide?ye(ye({},C),{},Fe({},M,ta(C,"".concat(M))+O.height)):C},{top:g.top||0,bottom:g.bottom||0}),N=ye(ye({},w),b),A=N.bottom;x&&(N.bottom+=x.props.height||yu.defaultProps.height),j&&n&&(N=ese(N,a,r,n));var E=f-N.left-N.right,T=m-N.top-N.bottom;return ye(ye({brushBottom:A},N),{},{width:Math.max(E,0),height:Math.max(T,0)})},Ppe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},GO=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,o=a===void 0?"axis":a,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,f=t.legendContent,m=t.formatAxisMap,p=t.defaultProps,g=function(N,A){var E=A.graphicalItems,T=A.stackGroups,C=A.offset,k=A.updateId,O=A.dataStartIndex,M=A.dataEndIndex,I=N.barSize,z=N.layout,D=N.barGap,H=N.barCategoryGap,V=N.maxBarSize,F=zI(z),G=F.numericAxisName,L=F.cateAxisName,R=kpe(E),U=[];return E.forEach(function(K,te){var $=Ay(N.data,{graphicalItems:[K],dataStartIndex:O,dataEndIndex:M}),B=K.type.defaultProps!==void 0?ye(ye({},K.type.defaultProps),K.props):K.props,Y=B.dataKey,ne=B.maxBarSize,oe=B["".concat(G,"Id")],xe=B["".concat(L,"Id")],ee={},ae=d.reduce(function(rr,gr){var ct=A["".concat(gr.axisType,"Map")],rt=B["".concat(gr.axisType,"Id")];ct&&ct[rt]||gr.axisType==="zAxis"||ur(!1);var $n=ct[rt];return ye(ye({},rr),{},Fe(Fe({},gr.axisType,$n),"".concat(gr.axisType,"Ticks"),Ki($n)))},ee),Z=ae[L],pe=ae["".concat(L,"Ticks")],je=T&&T[oe]&&T[oe].hasStack&&dse(K,T[oe].stackGroups),le=Ji(K.type).indexOf("Bar")>=0,Re=Gv(Z,pe),_e=[],me=R&&Qoe({barSize:I,stackGroups:T,totalSize:Ppe(ae,L)});if(le){var ve,Le,It=Ge(ne)?V:ne,Cn=(ve=(Le=Gv(Z,pe,!0))!==null&&Le!==void 0?Le:It)!==null&&ve!==void 0?ve:0;_e=Joe({barGap:D,barCategoryGap:H,bandSize:Cn!==Re?Cn:Re,sizeList:me[xe],maxBarSize:It}),Cn!==Re&&(_e=_e.map(function(rr){return ye(ye({},rr),{},{position:ye(ye({},rr.position),{},{offset:rr.position.offset-Cn/2})})}))}var vr=K&&K.type&&K.type.getComposedData;vr&&U.push({props:ye(ye({},vr(ye(ye({},ae),{},{displayedData:$,props:N,dataKey:Y,item:K,bandSize:Re,barPosition:_e,offset:C,stackedData:je,layout:z,dataStartIndex:O,dataEndIndex:M}))),{},Fe(Fe(Fe({key:K.key||"item-".concat(te)},G,ae[G]),L,ae[L]),"animationId",k)),childIndex:rJ(K,N.children),item:K})}),U},x=function(N,A){var E=N.props,T=N.dataStartIndex,C=N.dataEndIndex,k=N.updateId;if(!ZP({props:E}))return null;var O=E.children,M=E.layout,I=E.stackOffset,z=E.data,D=E.reverseStackOrder,H=zI(M),V=H.numericAxisName,F=H.cateAxisName,G=na(O,r),L=cse(z,G,"".concat(V,"Id"),"".concat(F,"Id"),I,D),R=d.reduce(function(B,Y){var ne="".concat(Y.axisType,"Map");return ye(ye({},B),{},Fe({},ne,Ape(E,ye(ye({},Y),{},{graphicalItems:G,stackGroups:Y.axisType===V&&L,dataStartIndex:T,dataEndIndex:C}))))},{}),U=Mpe(ye(ye({},R),{},{props:E,graphicalItems:G}),A?.legendBBox);Object.keys(R).forEach(function(B){R[B]=m(E,R[B],U,B.replace("Map",""),n)});var K=R["".concat(F,"Map")],te=Tpe(K),$=g(E,ye(ye({},R),{},{dataStartIndex:T,dataEndIndex:C,updateId:k,graphicalItems:G,stackGroups:L,offset:U}));return ye(ye({formattedGraphicalItems:$,graphicalItems:G,offset:U,stackGroups:L},te),R)},j=(function(w){function N(A){var E,T,C;return fpe(this,N),C=ppe(this,N,[A]),Fe(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(C,"accessibilityManager",new Qme),Fe(C,"handleLegendBBoxUpdate",function(k){if(k){var O=C.state,M=O.dataStartIndex,I=O.dataEndIndex,z=O.updateId;C.setState(ye({legendBBox:k},x({props:C.props,dataStartIndex:M,dataEndIndex:I,updateId:z},ye(ye({},C.state),{},{legendBBox:k}))))}}),Fe(C,"handleReceiveSyncEvent",function(k,O,M){if(C.props.syncId===k){if(M===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(O)}}),Fe(C,"handleBrushChange",function(k){var O=k.startIndex,M=k.endIndex;if(O!==C.state.dataStartIndex||M!==C.state.dataEndIndex){var I=C.state.updateId;C.setState(function(){return ye({dataStartIndex:O,dataEndIndex:M},x({props:C.props,dataStartIndex:O,dataEndIndex:M,updateId:I},C.state))}),C.triggerSyncEvent({dataStartIndex:O,dataEndIndex:M})}}),Fe(C,"handleMouseEnter",function(k){var O=C.getMouseInfo(k);if(O){var M=ye(ye({},O),{},{isTooltipActive:!0});C.setState(M),C.triggerSyncEvent(M);var I=C.props.onMouseEnter;We(I)&&I(M,k)}}),Fe(C,"triggeredAfterMouseMove",function(k){var O=C.getMouseInfo(k),M=O?ye(ye({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(M),C.triggerSyncEvent(M);var I=C.props.onMouseMove;We(I)&&I(M,k)}),Fe(C,"handleItemMouseEnter",function(k){C.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Fe(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),Fe(C,"handleMouseMove",function(k){k.persist(),C.throttleTriggeredAfterMouseMove(k)}),Fe(C,"handleMouseLeave",function(k){C.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};C.setState(O),C.triggerSyncEvent(O);var M=C.props.onMouseLeave;We(M)&&M(O,k)}),Fe(C,"handleOuterEvent",function(k){var O=nJ(k),M=ta(C.props,"".concat(O));if(O&&We(M)){var I,z;/.*touch.*/i.test(O)?z=C.getMouseInfo(k.changedTouches[0]):z=C.getMouseInfo(k),M((I=z)!==null&&I!==void 0?I:{},k)}}),Fe(C,"handleClick",function(k){var O=C.getMouseInfo(k);if(O){var M=ye(ye({},O),{},{isTooltipActive:!0});C.setState(M),C.triggerSyncEvent(M);var I=C.props.onClick;We(I)&&I(M,k)}}),Fe(C,"handleMouseDown",function(k){var O=C.props.onMouseDown;if(We(O)){var M=C.getMouseInfo(k);O(M,k)}}),Fe(C,"handleMouseUp",function(k){var O=C.props.onMouseUp;if(We(O)){var M=C.getMouseInfo(k);O(M,k)}}),Fe(C,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Fe(C,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.handleMouseDown(k.changedTouches[0])}),Fe(C,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.handleMouseUp(k.changedTouches[0])}),Fe(C,"handleDoubleClick",function(k){var O=C.props.onDoubleClick;if(We(O)){var M=C.getMouseInfo(k);O(M,k)}}),Fe(C,"handleContextMenu",function(k){var O=C.props.onContextMenu;if(We(O)){var M=C.getMouseInfo(k);O(M,k)}}),Fe(C,"triggerSyncEvent",function(k){C.props.syncId!==void 0&&zS.emit(qS,C.props.syncId,k,C.eventEmitterSymbol)}),Fe(C,"applySyncEvent",function(k){var O=C.props,M=O.layout,I=O.syncMethod,z=C.state.updateId,D=k.dataStartIndex,H=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)C.setState(ye({dataStartIndex:D,dataEndIndex:H},x({props:C.props,dataStartIndex:D,dataEndIndex:H,updateId:z},C.state)));else if(k.activeTooltipIndex!==void 0){var V=k.chartX,F=k.chartY,G=k.activeTooltipIndex,L=C.state,R=L.offset,U=L.tooltipTicks;if(!R)return;if(typeof I=="function")G=I(U,k);else if(I==="value"){G=-1;for(var K=0;K=0){var je,le;if(V.dataKey&&!V.allowDuplicatedCategory){var Re=typeof V.dataKey=="function"?pe:"payload.".concat(V.dataKey.toString());je=jv(K,Re,G),le=te&&$&&jv($,Re,G)}else je=K?.[F],le=te&&$&&$[F];if(xe||oe){var _e=k.props.activeIndex!==void 0?k.props.activeIndex:F;return[y.cloneElement(k,ye(ye(ye({},I.props),ae),{},{activeIndex:_e})),null,null]}if(!Ge(je))return[Z].concat(Eu(C.renderActivePoints({item:I,activePoint:je,basePoint:le,childIndex:F,isRange:te})))}else{var me,ve=(me=C.getItemByXY(C.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:Z},Le=ve.graphicalItem,It=Le.item,Cn=It===void 0?k:It,vr=Le.childIndex,rr=ye(ye(ye({},I.props),ae),{},{activeIndex:vr});return[y.cloneElement(Cn,rr),null,null]}return te?[Z,null,null]:[Z,null]}),Fe(C,"renderCustomized",function(k,O,M){return y.cloneElement(k,ye(ye({key:"recharts-customized-".concat(M)},C.props),C.state))}),Fe(C,"renderMap",{CartesianGrid:{handler:zp,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:zp},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:zp},YAxis:{handler:zp},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((E=A.id)!==null&&E!==void 0?E:qu("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=Nz(C.triggeredAfterMouseMove,(T=A.throttleDelay)!==null&&T!==void 0?T:1e3/60),C.state={},C}return ype(N,w),mpe(N,[{key:"componentDidMount",value:function(){var E,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,T=E.children,C=E.data,k=E.height,O=E.layout,M=Kr(T,ni);if(M){var I=M.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,D=zN(this.state,C,I,z),H=this.state.tooltipTicks[I].coordinate,V=(this.state.offset.top+k)/2,F=O==="horizontal",G=F?{x:H,y:V}:{y:H,x:V},L=this.state.formattedGraphicalItems.find(function(U){var K=U.item;return K.type.name==="Scatter"});L&&(G=ye(ye({},G),L.props.points[I].tooltipPosition),D=L.props.points[I].tooltipPayload);var R={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:z,activePayload:D,activeCoordinate:G};this.setState(R),this.renderCursor(M),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var C,k;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(E){j_([Kr(E.children,ni)],[Kr(this.props.children,ni)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=Kr(this.props.children,ni);if(E&&typeof E.props.shared=="boolean"){var T=E.props.shared?"axis":"item";return u.indexOf(T)>=0?T:o}return o}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var T=this.container,C=T.getBoundingClientRect(),k=Hne(C),O={chartX:Math.round(E.pageX-k.left),chartY:Math.round(E.pageY-k.top)},M=C.width/T.offsetWidth||1,I=this.inRange(O.chartX,O.chartY,M);if(!I)return null;var z=this.state,D=z.xAxisMap,H=z.yAxisMap,V=this.getTooltipEventType(),F=LI(this.state,this.props.data,this.props.layout,I);if(V!=="axis"&&D&&H){var G=Fo(D).scale,L=Fo(H).scale,R=G&&G.invert?G.invert(O.chartX):null,U=L&&L.invert?L.invert(O.chartY):null;return ye(ye({},O),{},{xValue:R,yValue:U},F)}return F?ye(ye({},O),F):null}},{key:"inRange",value:function(E,T){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,O=E/C,M=T/C;if(k==="horizontal"||k==="vertical"){var I=this.state.offset,z=O>=I.left&&O<=I.left+I.width&&M>=I.top&&M<=I.top+I.height;return z?{x:O,y:M}:null}var D=this.state,H=D.angleAxisMap,V=D.radiusAxisMap;if(H&&V){var F=Fo(H);return z$({x:O,y:M},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,T=this.getTooltipEventType(),C=Kr(E,ni),k={};C&&T==="axis"&&(C.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Sv(this.props,this.handleOuterEvent);return ye(ye({},O),k)}},{key:"addListener",value:function(){zS.on(qS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zS.removeListener(qS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,T,C){for(var k=this.state.formattedGraphicalItems,O=0,M=k.length;O");return e}const Mc=y.forwardRef(({id:e,className:t,children:n,config:r,...a},o)=>{const l=y.useId(),u=`chart-${e||l.replace(/:/g,"")}`;return i.jsx(Vq.Provider,{value:{config:r},children:i.jsxs("div",{"data-chart":u,ref:o,className:de("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[i.jsx(Ipe,{id:u,config:r}),i.jsx(Ine,{children:n})]})})});Mc.displayName="Chart";const Ipe=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?i.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries($pe).map(([r,a])=>` -${a} [data-chart=${e}] { -${n.map(([o,l])=>{const u=l.theme?.[r]||l.color;return u?` --color-${o}: ${u};`:null}).join(` -`)} -} -`).join(` -`)}}):null},of=ni,Pc=y.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:o=!1,label:l,labelFormatter:u,labelClassName:d,formatter:f,color:m,nameKey:p,labelKey:g},x)=>{const{config:j}=Gq(),b=y.useMemo(()=>{if(a||!t?.length)return null;const[N]=t,A=`${g||N?.dataKey||N?.name||"value"}`,E=qN(j,N,A),T=!g&&typeof l=="string"?j[l]?.label||l:E?.label;return u?i.jsx("div",{className:de("font-medium",d),children:u(T,t)}):T?i.jsx("div",{className:de("font-medium",d),children:T}):null},[l,u,t,a,d,j,g]);if(!e||!t?.length)return null;const w=t.length===1&&r!=="dot";return i.jsxs("div",{ref:x,className:de("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[w?null:b,i.jsx("div",{className:"grid gap-1.5",children:t.filter(N=>N.type!=="none").map((N,A)=>{const E=`${p||N.name||N.dataKey||"value"}`,T=qN(j,N,E),C=m||N.payload.fill||N.color;return i.jsx("div",{className:de("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:f&&N?.value!==void 0&&N.name?f(N.value,N.name,N,A,N.payload):i.jsxs(i.Fragment,{children:[T?.icon?i.jsx(T.icon,{}):!o&&i.jsx("div",{className:de("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":w&&r==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),i.jsxs("div",{className:de("flex flex-1 justify-between leading-none",w?"items-end":"items-center"),children:[i.jsxs("div",{className:"grid gap-1.5",children:[w?b:null,i.jsx("span",{className:"text-muted-foreground",children:T?.label||N.name})]}),N.value&&i.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:N.value.toLocaleString()})]})]})},N.dataKey)})})]})});Pc.displayName="ChartTooltip";const Lpe=nl,Yq=y.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:a},o)=>{const{config:l}=Gq();return n?.length?i.jsx("div",{ref:o,className:de("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.filter(u=>u.type!=="none").map(u=>{const d=`${a||u.dataKey||"value"}`,f=qN(l,u,d);return i.jsxs("div",{className:de("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?i.jsx(f.icon,{}):i.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:u.color}}),f?.label]},u.value)})}):null});Yq.displayName="ChartLegend";function qN(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let a=n;return n in t&&typeof t[n]=="string"?a=t[n]:r&&n in r&&typeof r[n]=="string"&&(a=r[n]),a in e?e[a]:e[n]}const Bpe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zpe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),qI=e=>{const t=zpe(e);return t.charAt(0).toUpperCase()+t.slice(1)},Kq=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),qpe=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Fpe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Upe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...Fpe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kq("lucide",a),...!o&&!qpe(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,m])=>y.createElement(f,m)),...Array.isArray(o)?o:[o]]));const Oe=(e,t)=>{const n=y.forwardRef(({className:r,...a},o)=>y.createElement(Upe,{ref:o,iconNode:t,className:Kq(`lucide-${Bpe(qI(e))}`,`lucide-${e}`,r),...a}));return n.displayName=qI(e),n};const Hpe=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Wpe=Oe("activity",Hpe);const Vpe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Xq=Oe("arrow-left",Vpe);const Gpe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ype=Oe("arrow-right",Gpe);const Kpe=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],FI=Oe("ban",Kpe);const Xpe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Zpe=Oe("book-open",Xpe);const Qpe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Jpe=Oe("bot",Qpe);const eve=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Zq=Oe("boxes",eve);const tve=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],UI=Oe("calendar",tve);const nve=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],rve=Oe("chart-column",nve);const ave=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],il=Oe("check",ave);const ive=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uh=Oe("chevron-down",ive);const ove=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],YO=Oe("chevron-left",ove);const sve=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],KO=Oe("chevron-right",sve);const lve=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],FN=Oe("chevron-up",lve);const cve=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],uve=Oe("chevrons-up-down",cve);const dve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],bg=Oe("circle-alert",dve);const fve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vo=Oe("circle-check",fve);const hve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mve=Oe("circle-question-mark",hve);const pve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Qq=Oe("circle-user",pve);const vve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],UN=Oe("circle-x",vve);const gve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],yve=Oe("circle",gve);const xve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ol=Oe("clock",xve);const bve=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],HN=Oe("copy",bve);const wve=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jve=Oe("database",wve);const Sve=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],_ve=Oe("dollar-sign",Sve);const Nve=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],WN=Oe("download",Nve);const Cve=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],av=Oe("external-link",Cve);const Ove=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],VN=Oe("eye-off",Ove);const Eve=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ua=Oe("eye",Eve);const Ave=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],wg=Oe("file-search",Ave);const Tve=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],XO=Oe("file-text",Tve);const kve=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],GN=Oe("funnel",kve);const Mve=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],jg=Oe("hash",Mve);const Pve=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Sg=Oe("house",Pve);const Rve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],YN=Oe("info",Rve);const Dve=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],$ve=Oe("key",Dve);const Ive=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],KN=Oe("loader-circle",Ive);const Lve=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],HI=Oe("lock",Lve);const Bve=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],WI=Oe("log-out",Bve);const zve=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],qve=Oe("menu",zve);const Fve=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Lh=Oe("message-square",Fve);const Uve=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],XN=Oe("moon",Uve);const Hve=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Jq=Oe("package",Hve);const Wve=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],eF=Oe("palette",Wve);const Vve=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Gve=Oe("pause",Vve);const Yve=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Au=Oe("pencil",Yve);const Kve=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Xve=Oe("play",Kve);const Zve=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tr=Oe("plus",Zve);const Qve=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],sl=Oe("refresh-cw",Qve);const Jve=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ege=Oe("rotate-ccw",Jve);const tge=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],nge=Oe("rotate-cw",tge);const rge=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],ZO=Oe("save",rge);const age=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dr=Oe("search",age);const ige=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],tF=Oe("server",ige);const oge=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],sge=Oe("settings-2",oge);const lge=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vc=Oe("settings",lge);const cge=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],uge=Oe("shield",cge);const dge=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],fge=Oe("skip-forward",dge);const hge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],QO=Oe("smile",hge);const mge=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],pge=Oe("sparkles",mge);const vge=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Tu=Oe("square-pen",vge);const gge=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],VI=Oe("star",gge);const yge=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ZN=Oe("sun",yge);const xge=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bge=Oe("terminal",xge);const wge=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Tt=Oe("trash-2",wge);const jge=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Sge=Oe("trending-up",jge);const _ge=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Gc=Oe("triangle-alert",_ge);const Nge=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],nF=Oe("user",Nge);const Cge=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Oge=Oe("users",Cge);const Ege=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bh=Oe("x",Ege);const Age=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],dh=Oe("zap",Age);var Tge=Symbol.for("react.lazy"),_g=jC[" use ".trim().toString()];function kge(e){return typeof e=="object"&&e!==null&&"then"in e}function rF(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Tge&&"_payload"in e&&kge(e._payload)}function zh(e){const t=Pge(e),n=y.forwardRef((r,a)=>{let{children:o,...l}=r;rF(o)&&typeof _g=="function"&&(o=_g(o._payload));const u=y.Children.toArray(o),d=u.find(Dge);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var Mge=zh("Slot");function Pge(e){const t=y.forwardRef((n,r)=>{let{children:a,...o}=n;if(rF(a)&&typeof _g=="function"&&(a=_g(a._payload)),y.isValidElement(a)){const l=Ige(a),u=$ge(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rge=Symbol("radix.slottable");function Dge(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rge}function $ge(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Ige(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const GI=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,YI=Ye,qh=(e,t)=>n=>{var r;if(t?.variants==null)return YI(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(f=>{const m=n?.[f],p=o?.[f];if(m===null)return null;const g=GI(m)||GI(p);return a[f][g]}),u=n&&Object.entries(n).reduce((f,m)=>{let[p,g]=m;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:g,...x}=m;return Object.entries(x).every(j=>{let[b,w]=j;return Array.isArray(w)?w.includes({...o,...u}[b]):{...o,...u}[b]===w})?[...f,p,g]:f},[]);return YI(e,l,d,n?.class,n?.className)},fh=qh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ue=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const l=r?Mge:"button";return i.jsx(l,{className:de(fh({variant:t,size:n,className:e})),ref:o,...a})});ue.displayName="Button";function Lge(){const[e,t]=y.useState(null),[n,r]=y.useState(!0),[a,o]=y.useState(24),[l,u]=y.useState(!0),[d,f]=y.useState(null),[m,p]=y.useState(!0),g=y.useCallback(async()=>{try{p(!0);const O=await ln.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");f({hitokoto:O.data.hitokoto,from:O.data.from||O.data.from_who||"未知"})}catch(O){console.error("获取一言失败:",O),f({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{p(!1)}},[]),x=y.useCallback(async()=>{try{const O=localStorage.getItem("token"),M=await ln.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${O}`}});t(M.data),r(!1)}catch(O){console.error("Failed to fetch dashboard data:",O),r(!1)}},[a]);if(y.useEffect(()=>{x(),g()},[x,g]),y.useEffect(()=>{if(!l)return;const O=setInterval(()=>{x()},3e4);return()=>clearInterval(O)},[l,x]),n||!e)return i.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:i.jsxs("div",{className:"text-center space-y-4",children:[i.jsx(sl,{className:"h-12 w-12 animate-spin mx-auto text-muted-foreground"}),i.jsx("p",{className:"text-muted-foreground",children:"加载统计数据中..."})]})});const{summary:j,model_stats:b,hourly_data:w,daily_data:N,recent_activity:A}=e,E=O=>{const M=Math.floor(O/3600),I=Math.floor(O%3600/60);return`${M}小时${I}分钟`},T=O=>new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),C=b.slice(0,6).map(O=>({name:O.model_name,value:O.request_count,fill:`hsl(var(--chart-${b.indexOf(O)%5+1}))`})),k={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return i.jsx(Vt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(ul,{value:a.toString(),onValueChange:O=>o(Number(O)),children:i.jsxs(Qo,{className:"grid grid-cols-3 w-full sm:w-auto",children:[i.jsx(Ot,{value:"24",children:"24小时"}),i.jsx(Ot,{value:"168",children:"7天"}),i.jsx(Ot,{value:"720",children:"30天"})]})}),i.jsxs(ue,{variant:l?"default":"outline",size:"sm",onClick:()=>u(!l),className:"gap-2",children:[i.jsx(sl,{className:`h-4 w-4 ${l?"animate-spin":""}`}),i.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),i.jsx(ue,{variant:"outline",size:"sm",onClick:x,children:i.jsx(sl,{className:"h-4 w-4"})})]})]}),i.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"总请求数"}),i.jsx(Wpe,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(on,{children:[i.jsx("div",{className:"text-2xl font-bold",children:j.total_requests.toLocaleString()}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"总花费"}),i.jsx(_ve,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(on,{children:[i.jsxs("div",{className:"text-2xl font-bold",children:["¥",j.total_cost.toFixed(2)]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:j.cost_per_hour>0?`¥${j.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"Token消耗"}),i.jsx(jve,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(on,{children:[i.jsxs("div",{className:"text-2xl font-bold",children:[(j.total_tokens/1e3).toFixed(1),"K"]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:j.tokens_per_hour>0?`${(j.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"平均响应"}),i.jsx(dh,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(on,{children:[i.jsxs("div",{className:"text-2xl font-bold",children:[j.avg_response_time.toFixed(2),"s"]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),i.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"在线时长"}),i.jsx(ol,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsx(on,{children:i.jsx("div",{className:"text-xl font-bold",children:E(j.online_time)})})]}),i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"消息处理"}),i.jsx(Lh,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(on,{children:[i.jsx("div",{className:"text-xl font-bold",children:j.total_messages.toLocaleString()}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",j.total_replies.toLocaleString()," 条"]})]})]}),i.jsxs(st,{children:[i.jsxs(qt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Ft,{className:"text-sm font-medium",children:"成本效率"}),i.jsx(Sge,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(on,{children:[i.jsx("div",{className:"text-xl font-bold",children:j.total_messages>0?`¥${(j.total_cost/j.total_messages*100).toFixed(2)}`:"¥0.00"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),i.jsxs(ul,{defaultValue:"trends",className:"space-y-4",children:[i.jsxs(Qo,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[i.jsx(Ot,{value:"trends",children:"趋势"}),i.jsx(Ot,{value:"models",children:"模型"}),i.jsx(Ot,{value:"activity",children:"活动"}),i.jsx(Ot,{value:"daily",children:"日统计"})]}),i.jsxs(en,{value:"trends",className:"space-y-4",children:[i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"请求趋势"}),i.jsxs(er,{children:["最近",a,"小时的请求量变化"]})]}),i.jsx(on,{children:i.jsx(Mc,{config:k,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:i.jsxs(Rpe,{data:w,children:[i.jsx(ff,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>T(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Vi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(of,{content:i.jsx(Pc,{labelFormatter:O=>T(O)})}),i.jsx(Ih,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),i.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"花费趋势"}),i.jsx(er,{children:"API调用成本变化"})]}),i.jsx(on,{children:i.jsx(Mc,{config:k,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:i.jsxs(US,{data:w,children:[i.jsx(ff,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>T(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Vi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(of,{content:i.jsx(Pc,{labelFormatter:O=>T(O)})}),i.jsx(li,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"Token消耗"}),i.jsx(er,{children:"Token使用量变化"})]}),i.jsx(on,{children:i.jsx(Mc,{config:k,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:i.jsxs(US,{data:w,children:[i.jsx(ff,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>T(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Vi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(of,{content:i.jsx(Pc,{labelFormatter:O=>T(O)})}),i.jsx(li,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),i.jsx(en,{value:"models",className:"space-y-4",children:i.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"模型请求分布"}),i.jsx(er,{children:"各模型使用占比"})]}),i.jsx(on,{children:i.jsx(Mc,{config:Object.fromEntries(b.slice(0,6).map((O,M)=>[O.model_name,{label:O.model_name,color:`hsl(var(--chart-${M%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:i.jsxs(Dpe,{children:[i.jsx(of,{content:i.jsx(Pc,{})}),i.jsx(fo,{data:C,cx:"50%",cy:"50%",labelLine:!1,label:({name:O,percent:M})=>`${O} ${M?(M*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:C.map((O,M)=>i.jsx(iy,{fill:O.fill},`cell-${M}`))})]})})})]}),i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"模型详细统计"}),i.jsx(er,{children:"请求数、花费和性能"})]}),i.jsx(on,{children:i.jsx(Vt,{className:"h-[300px] sm:h-[400px]",children:i.jsx("div",{className:"space-y-3",children:b.map((O,M)=>i.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:O.model_name}),i.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${M%5+1}))`}})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),i.jsx("span",{className:"ml-1 font-medium",children:O.request_count.toLocaleString()})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"花费:"}),i.jsxs("span",{className:"ml-1 font-medium",children:["¥",O.total_cost.toFixed(2)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),i.jsxs("span",{className:"ml-1 font-medium",children:[(O.total_tokens/1e3).toFixed(1),"K"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),i.jsxs("span",{className:"ml-1 font-medium",children:[O.avg_response_time.toFixed(2),"s"]})]})]})]},M))})})})]})]})}),i.jsx(en,{value:"activity",children:i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"最近活动"}),i.jsx(er,{children:"最新的API调用记录"})]}),i.jsx(on,{children:i.jsx(Vt,{className:"h-[400px] sm:h-[500px]",children:i.jsx("div",{className:"space-y-2",children:A.map((O,M)=>i.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm truncate",children:O.model}),i.jsx("div",{className:"text-xs text-muted-foreground",children:O.request_type})]}),i.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:T(O.timestamp)})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),i.jsx("span",{className:"ml-1",children:O.tokens})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"花费:"}),i.jsxs("span",{className:"ml-1",children:["¥",O.cost.toFixed(4)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),i.jsxs("span",{className:"ml-1",children:[O.time_cost.toFixed(2),"s"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"状态:"}),i.jsx("span",{className:`ml-1 ${O.status==="success"?"text-green-600":"text-red-600"}`,children:O.status})]})]})]},M))})})})]})}),i.jsx(en,{value:"daily",children:i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"每日统计"}),i.jsx(er,{children:"最近7天的数据汇总"})]}),i.jsx(on,{children:i.jsx(Mc,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:i.jsxs(US,{data:N,children:[i.jsx(ff,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>{const M=new Date(O);return`${M.getMonth()+1}/${M.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Vi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Vi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(of,{content:i.jsx(Pc,{labelFormatter:O=>new Date(O).toLocaleDateString("zh-CN")})}),i.jsx(Lpe,{content:i.jsx(Yq,{})}),i.jsx(li,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),i.jsx(li,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),i.jsxs(st,{className:"border-2 border-primary/20",children:[i.jsx(qt,{className:"pb-3",children:i.jsx(Ft,{className:"text-lg",children:"每日一言"})}),i.jsx(on,{children:m?i.jsxs("div",{className:"space-y-2",children:[i.jsx(FM,{className:"h-6 w-3/4"}),i.jsx(FM,{className:"h-4 w-1/4"})]}):d?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',d.hitokoto,'"']}),i.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",d.from]})]}):null})]})]})})}const Bge={theme:"system",setTheme:()=>null},aF=y.createContext(Bge),JO=()=>{const e=y.useContext(aF);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},zge=(e,t,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){t(e);return}const a=n.clientX,o=n.clientY,l=Math.hypot(Math.max(a,innerWidth-a),Math.max(o,innerHeight-o));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${o}px)`,`circle(${l}px at ${a}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},iF=y.createContext(void 0),oF=()=>{const e=y.useContext(iF);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};function Ty(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ky(e){const[t,n]=y.useState(void 0);return Un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var My="Switch",[qge]=hr(My),[Fge,Uge]=qge(My),sF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:f,form:m,...p}=e,[g,x]=y.useState(null),j=qe(t,E=>x(E)),b=y.useRef(!1),w=g?m||!!g.closest("form"):!0,[N,A]=Na({prop:a,defaultProp:o??!1,onChange:f,caller:My});return i.jsxs(Fge,{scope:n,checked:N,disabled:u,children:[i.jsx(Pe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":l,"data-state":dF(N),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:j,onClick:Se(e.onClick,E=>{A(T=>!T),w&&(b.current=E.isPropagationStopped(),b.current||E.stopPropagation())})}),w&&i.jsx(uF,{control:g,bubbles:!b.current,name:r,value:d,checked:N,required:l,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});sF.displayName=My;var lF="SwitchThumb",cF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Uge(lF,n);return i.jsx(Pe.span,{"data-state":dF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});cF.displayName=lF;var Hge="SwitchBubbleInput",uF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const l=y.useRef(null),u=qe(l,o),d=Ty(n),f=ky(t);return y.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(m,n),m.dispatchEvent(j)}},[d,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});uF.displayName=Hge;function dF(e){return e?"checked":"unchecked"}var fF=sF,Wge=cF;const at=y.forwardRef(({className:e,...t},n)=>i.jsx(fF,{className:de("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:i.jsx(Wge,{className:de("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));at.displayName=fF.displayName;var Vge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gge=Vge.reduce((e,t)=>{const n=zh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Yge="Label",hF=y.forwardRef((e,t)=>i.jsx(Gge.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));hF.displayName=Yge;var mF=hF;const Kge=qh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),J=y.forwardRef(({className:e,...t},n)=>i.jsx(mF,{ref:n,className:de(Kge(),e),...t}));J.displayName=mF.displayName;const Ne=y.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:de("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ne.displayName="Input";const Xge=1,Zge=1e6;let HS=0;function Qge(){return HS=(HS+1)%Number.MAX_SAFE_INTEGER,HS.toString()}const WS=new Map,KI=e=>{if(WS.has(e))return;const t=setTimeout(()=>{WS.delete(e),Of({type:"REMOVE_TOAST",toastId:e})},Zge);WS.set(e,t)},Jge=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Xge)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?KI(n):e.toasts.forEach(r=>{KI(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},iv=[];let ov={toasts:[]};function Of(e){ov=Jge(ov,e),iv.forEach(t=>{t(ov)})}function eye({...e}){const t=Qge(),n=a=>Of({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Of({type:"DISMISS_TOAST",toastId:t});return Of({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function mr(){const[e,t]=y.useState(ov);return y.useEffect(()=>(iv.push(t),()=>{const n=iv.indexOf(t);n>-1&&iv.splice(n,1)}),[e]),{...e,toast:eye,dismiss:n=>Of({type:"DISMISS_TOAST",toastId:n})}}const tye=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function nye(e){const t=tye.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(e)}));return{isValid:t.every(r=>r.passed),rules:t}}const eE="0.11.5 Beta",tE="MaiBot Dashboard",rye=`${tE} v${eE}`,aye=(e="v")=>`${e}${eE}`;function iye(e,t=globalThis?.document){const n=nn(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var oye="DismissableLayer",QN="dismissableLayer.update",sye="dismissableLayer.pointerDownOutside",lye="dismissableLayer.focusOutside",XI,pF=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ol=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(pF),[m,p]=y.useState(null),g=m?.ownerDocument??globalThis?.document,[,x]=y.useState({}),j=qe(t,O=>p(O)),b=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(w),A=m?b.indexOf(m):-1,E=f.layersWithOutsidePointerEventsDisabled.size>0,T=A>=N,C=uye(O=>{const M=O.target,I=[...f.branches].some(z=>z.contains(M));!T||I||(a?.(O),l?.(O),O.defaultPrevented||u?.())},g),k=dye(O=>{const M=O.target;[...f.branches].some(z=>z.contains(M))||(o?.(O),l?.(O),O.defaultPrevented||u?.())},g);return iye(O=>{A===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},g),y.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(XI=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),ZI(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=XI)}},[m,g,n,f]),y.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),ZI())},[m,f]),y.useEffect(()=>{const O=()=>x({});return document.addEventListener(QN,O),()=>document.removeEventListener(QN,O)},[]),i.jsx(Pe.div,{...d,ref:j,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,C.onPointerDownCapture)})});Ol.displayName=oye;var cye="DismissableLayerBranch",vF=y.forwardRef((e,t)=>{const n=y.useContext(pF),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(Pe.div,{...e,ref:a})});vF.displayName=cye;function uye(e,t=globalThis?.document){const n=nn(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){gF(sye,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function dye(e,t=globalThis?.document){const n=nn(e),r=y.useRef(!1);return y.useEffect(()=>{const a=o=>{o.target&&!r.current&&gF(lye,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ZI(){const e=new CustomEvent(QN);document.dispatchEvent(e)}function gF(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?LC(a,o):a.dispatchEvent(o)}var fye=Ol,hye=vF,VS="focusScope.autoFocusOnMount",GS="focusScope.autoFocusOnUnmount",QI={bubbles:!1,cancelable:!0},mye="FocusScope",Fh=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[u,d]=y.useState(null),f=nn(a),m=nn(o),p=y.useRef(null),g=qe(t,b=>d(b)),x=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let b=function(E){if(x.paused||!u)return;const T=E.target;u.contains(T)?p.current=T:zo(p.current,{select:!0})},w=function(E){if(x.paused||!u)return;const T=E.relatedTarget;T!==null&&(u.contains(T)||zo(p.current,{select:!0}))},N=function(E){if(document.activeElement===document.body)for(const C of E)C.removedNodes.length>0&&zo(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const A=new MutationObserver(N);return u&&A.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),A.disconnect()}}},[r,u,x.paused]),y.useEffect(()=>{if(u){eL.add(x);const b=document.activeElement;if(!u.contains(b)){const N=new CustomEvent(VS,QI);u.addEventListener(VS,f),u.dispatchEvent(N),N.defaultPrevented||(pye(bye(yF(u)),{select:!0}),document.activeElement===b&&zo(u))}return()=>{u.removeEventListener(VS,f),setTimeout(()=>{const N=new CustomEvent(GS,QI);u.addEventListener(GS,m),u.dispatchEvent(N),N.defaultPrevented||zo(b??document.body,{select:!0}),u.removeEventListener(GS,m),eL.remove(x)},0)}}},[u,f,m,x]);const j=y.useCallback(b=>{if(!n&&!r||x.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(w&&N){const A=b.currentTarget,[E,T]=vye(A);E&&T?!b.shiftKey&&N===T?(b.preventDefault(),n&&zo(E,{select:!0})):b.shiftKey&&N===E&&(b.preventDefault(),n&&zo(T,{select:!0})):N===A&&b.preventDefault()}},[n,r,x.paused]);return i.jsx(Pe.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});Fh.displayName=mye;function pye(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zo(r,{select:t}),document.activeElement!==n)return}function vye(e){const t=yF(e),n=JI(t,e),r=JI(t.reverse(),e);return[n,r]}function yF(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JI(e,t){for(const n of e)if(!gye(n,{upTo:t}))return n}function gye(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yye(e){return e instanceof HTMLInputElement&&"select"in e}function zo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yye(e)&&t&&e.select()}}var eL=xye();function xye(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=tL(e,t),e.unshift(t)},remove(t){e=tL(e,t),e[0]?.resume()}}}function tL(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bye(e){return e.filter(t=>t.tagName!=="A")}var wye="Portal",El=y.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=y.useState(!1);Un(()=>o(!0),[]);const l=n||a&&globalThis?.document?.body;return l?yY.createPortal(i.jsx(Pe.div,{...r,ref:t}),l):null});El.displayName=wye;var YS=0;function Py(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nL()),document.body.insertAdjacentElement("beforeend",e[1]??nL()),YS++,()=>{YS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),YS--}},[])}function nL(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ri=function(){return ri=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return Lye;var t=Bye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qye=jF(),Yc="data-scroll-locked",Fye=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Sye,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(u,"px ").concat(r,`; - } - body[`).concat(Yc,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(a,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(l,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(sv,` { - right: `).concat(u,"px ").concat(r,`; - } - - .`).concat(lv,` { - margin-right: `).concat(u,"px ").concat(r,`; - } - - .`).concat(sv," .").concat(sv,` { - right: 0 `).concat(r,`; - } - - .`).concat(lv," .").concat(lv,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Yc,`] { - `).concat(_ye,": ").concat(u,`px; - } -`)},aL=function(){var e=parseInt(document.body.getAttribute(Yc)||"0",10);return isFinite(e)?e:0},Uye=function(){y.useEffect(function(){return document.body.setAttribute(Yc,(aL()+1).toString()),function(){var e=aL()-1;e<=0?document.body.removeAttribute(Yc):document.body.setAttribute(Yc,e.toString())}},[])},Hye=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Uye();var o=y.useMemo(function(){return zye(a)},[a]);return y.createElement(qye,{styles:Fye(o,!t,a,n?"":"!important")})},JN=!1;if(typeof window<"u")try{var qp=Object.defineProperty({},"passive",{get:function(){return JN=!0,!0}});window.addEventListener("test",qp,qp),window.removeEventListener("test",qp,qp)}catch{JN=!1}var Cc=JN?{passive:!1}:!1,Wye=function(e){return e.tagName==="TEXTAREA"},SF=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wye(e)&&n[t]==="visible")},Vye=function(e){return SF(e,"overflowY")},Gye=function(e){return SF(e,"overflowX")},iL=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=_F(e,r);if(a){var o=NF(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Yye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Kye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_F=function(e,t){return e==="v"?Vye(t):Gye(t)},NF=function(e,t){return e==="v"?Yye(t):Kye(t)},Xye=function(e,t){return e==="h"&&t==="rtl"?-1:1},Zye=function(e,t,n,r,a){var o=Xye(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),f=!1,m=l>0,p=0,g=0;do{if(!u)break;var x=NF(e,u),j=x[0],b=x[1],w=x[2],N=b-w-o*j;(j||N)&&_F(e,u)&&(p+=N,g+=j);var A=u.parentNode;u=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(f=!0),f},Fp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oL=function(e){return[e.deltaX,e.deltaY]},sL=function(e){return e&&"current"in e?e.current:e},Qye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jye=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},exe=0,Oc=[];function txe(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(exe++)[0],o=y.useState(jF)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=jye([e.lockRef.current],(e.shards||[]).map(sL),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var N=Fp(b),A=n.current,E="deltaX"in b?b.deltaX:A[0]-N[0],T="deltaY"in b?b.deltaY:A[1]-N[1],C,k=b.target,O=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in b&&O==="h"&&k.type==="range")return!1;var M=iL(O,k);if(!M)return!0;if(M?C=O:(C=O==="v"?"h":"v",M=iL(O,k)),!M)return!1;if(!r.current&&"changedTouches"in b&&(E||T)&&(r.current=C),!C)return!0;var I=r.current||C;return Zye(I,w,b,I==="h"?E:T)},[]),d=y.useCallback(function(b){var w=b;if(!(!Oc.length||Oc[Oc.length-1]!==o)){var N="deltaY"in w?oL(w):Fp(w),A=t.current.filter(function(C){return C.name===w.type&&(C.target===w.target||w.target===C.shadowParent)&&Qye(C.delta,N)})[0];if(A&&A.should){w.cancelable&&w.preventDefault();return}if(!A){var E=(l.current.shards||[]).map(sL).filter(Boolean).filter(function(C){return C.contains(w.target)}),T=E.length>0?u(w,E[0]):!l.current.noIsolation;T&&w.cancelable&&w.preventDefault()}}},[]),f=y.useCallback(function(b,w,N,A){var E={name:b,delta:w,target:N,should:A,shadowParent:nxe(N)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),m=y.useCallback(function(b){n.current=Fp(b),r.current=void 0},[]),p=y.useCallback(function(b){f(b.type,oL(b),b.target,u(b,e.lockRef.current))},[]),g=y.useCallback(function(b){f(b.type,Fp(b),b.target,u(b,e.lockRef.current))},[]);y.useEffect(function(){return Oc.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Cc),document.addEventListener("touchmove",d,Cc),document.addEventListener("touchstart",m,Cc),function(){Oc=Oc.filter(function(b){return b!==o}),document.removeEventListener("wheel",d,Cc),document.removeEventListener("touchmove",d,Cc),document.removeEventListener("touchstart",m,Cc)}},[]);var x=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(o,{styles:Jye(a)}):null,x?y.createElement(Hye,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nxe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rxe=kye(wF,txe);var Uh=y.forwardRef(function(e,t){return y.createElement(Ry,ri({},e,{ref:t,sideCar:rxe}))});Uh.classNames=Ry.classNames;var axe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ec=new WeakMap,Up=new WeakMap,Hp={},QS=0,CF=function(e){return e&&(e.host||CF(e.parentNode))},ixe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=CF(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oxe=function(e,t,n,r){var a=ixe(t,Array.isArray(e)?e:[e]);Hp[n]||(Hp[n]=new WeakMap);var o=Hp[n],l=[],u=new Set,d=new Set(a),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};a.forEach(f);var m=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(u.has(g))m(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",b=(Ec.get(g)||0)+1,w=(o.get(g)||0)+1;Ec.set(g,b),o.set(g,w),l.push(g),b===1&&j&&Up.set(g,!0),w===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return m(t),u.clear(),QS++,function(){l.forEach(function(p){var g=Ec.get(p)-1,x=o.get(p)-1;Ec.set(p,g),o.set(p,x),g||(Up.has(p)||p.removeAttribute(r),Up.delete(p)),x||p.removeAttribute(n)}),QS--,QS||(Ec=new WeakMap,Ec=new WeakMap,Up=new WeakMap,Hp={})}},Dy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=axe(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),oxe(r,a,n,"aria-hidden")):function(){return null}};function sxe(e){const t=lxe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(uxe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function lxe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=fxe(a),u=dxe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cxe=Symbol("radix.slottable");function uxe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cxe}function dxe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function fxe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $y="Dialog",[OF,EF]=hr($y),[hxe,Ya]=OF($y),AF=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,u=y.useRef(null),d=y.useRef(null),[f,m]=Na({prop:r,defaultProp:a??!1,onChange:o,caller:$y});return i.jsx(hxe,{scope:t,triggerRef:u,contentRef:d,contentId:Fn(),titleId:Fn(),descriptionId:Fn(),open:f,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(p=>!p),[m]),modal:l,children:n})};AF.displayName=$y;var TF="DialogTrigger",kF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(TF,n),o=qe(t,a.triggerRef);return i.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":aE(a.open),...r,ref:o,onClick:Se(e.onClick,a.onOpenToggle)})});kF.displayName=TF;var nE="DialogPortal",[mxe,MF]=OF(nE,{forceMount:void 0}),PF=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=Ya(nE,t);return i.jsx(mxe,{scope:t,forceMount:n,children:y.Children.map(r,l=>i.jsx(Rn,{present:n||o.open,children:i.jsx(El,{asChild:!0,container:a,children:l})}))})};PF.displayName=nE;var Ng="DialogOverlay",RF=y.forwardRef((e,t)=>{const n=MF(Ng,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Ya(Ng,e.__scopeDialog);return o.modal?i.jsx(Rn,{present:r||o.open,children:i.jsx(vxe,{...a,ref:t})}):null});RF.displayName=Ng;var pxe=sxe("DialogOverlay.RemoveScroll"),vxe=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(Ng,n);return i.jsx(Uh,{as:pxe,allowPinchZoom:!0,shards:[a.contentRef],children:i.jsx(Pe.div,{"data-state":aE(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vl="DialogContent",DF=y.forwardRef((e,t)=>{const n=MF(vl,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Ya(vl,e.__scopeDialog);return i.jsx(Rn,{present:r||o.open,children:o.modal?i.jsx(gxe,{...a,ref:t}):i.jsx(yxe,{...a,ref:t})})});DF.displayName=vl;var gxe=y.forwardRef((e,t)=>{const n=Ya(vl,e.__scopeDialog),r=y.useRef(null),a=qe(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return Dy(o)},[]),i.jsx($F,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault())})}),yxe=y.forwardRef((e,t)=>{const n=Ya(vl,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return i.jsx($F,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),$F=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,u=Ya(vl,n),d=y.useRef(null),f=qe(t,d);return Py(),i.jsxs(i.Fragment,{children:[i.jsx(Fh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:i.jsx(Ol,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":aE(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(bxe,{titleId:u.titleId}),i.jsx(jxe,{contentRef:d,descriptionId:u.descriptionId})]})]})}),rE="DialogTitle",IF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(rE,n);return i.jsx(Pe.h2,{id:a.titleId,...r,ref:t})});IF.displayName=rE;var LF="DialogDescription",BF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(LF,n);return i.jsx(Pe.p,{id:a.descriptionId,...r,ref:t})});BF.displayName=LF;var zF="DialogClose",qF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(zF,n);return i.jsx(Pe.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});qF.displayName=zF;function aE(e){return e?"open":"closed"}var FF="DialogTitleWarning",[xxe,UF]=sZ(FF,{contentName:vl,titleName:rE,docsSlug:"dialog"}),bxe=({titleId:e})=>{const t=UF(FF),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wxe="DialogDescriptionWarning",jxe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${UF(wxe).contentName}}.`;return y.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},iE=AF,HF=kF,oE=PF,Iy=RF,Ly=DF,sE=IF,lE=BF,cE=qF;const nr=iE,WF=HF,Sxe=oE,VF=y.forwardRef(({className:e,...t},n)=>i.jsx(Iy,{ref:n,className:de("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));VF.displayName=Iy.displayName;const Hn=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(Sxe,{children:[i.jsx(VF,{}),i.jsxs(Ly,{ref:r,className:de("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,i.jsxs(cE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(Bh,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hn.displayName=Ly.displayName;const Wn=({className:e,...t})=>i.jsx("div",{className:de("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wn.displayName="DialogHeader";const $r=({className:e,...t})=>i.jsx("div",{className:de("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$r.displayName="DialogFooter";const Vn=y.forwardRef(({className:e,...t},n)=>i.jsx(sE,{ref:n,className:de("text-lg font-semibold leading-none tracking-tight",e),...t}));Vn.displayName=sE.displayName;const dr=y.forwardRef(({className:e,...t},n)=>i.jsx(lE,{ref:n,className:de("text-sm text-muted-foreground",e),...t}));dr.displayName=lE.displayName;var _xe=Symbol("radix.slottable");function Nxe(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=_xe,t}var GF="AlertDialog",[Cxe]=hr(GF,[EF]),ho=EF(),YF=e=>{const{__scopeAlertDialog:t,...n}=e,r=ho(t);return i.jsx(iE,{...r,...n,modal:!0})};YF.displayName=GF;var Oxe="AlertDialogTrigger",KF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(HF,{...a,...r,ref:t})});KF.displayName=Oxe;var Exe="AlertDialogPortal",XF=e=>{const{__scopeAlertDialog:t,...n}=e,r=ho(t);return i.jsx(oE,{...r,...n})};XF.displayName=Exe;var Axe="AlertDialogOverlay",ZF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(Iy,{...a,...r,ref:t})});ZF.displayName=Axe;var Kc="AlertDialogContent",[Txe,kxe]=Cxe(Kc),Mxe=Nxe("AlertDialogContent"),QF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=ho(n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return i.jsx(xxe,{contentName:Kc,titleName:JF,docsSlug:"alert-dialog",children:i.jsx(Txe,{scope:n,cancelRef:d,children:i.jsxs(Ly,{role:"alertdialog",...o,...a,ref:u,onOpenAutoFocus:Se(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[i.jsx(Mxe,{children:r}),i.jsx(Rxe,{contentRef:l})]})})})});QF.displayName=Kc;var JF="AlertDialogTitle",e8=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(sE,{...a,...r,ref:t})});e8.displayName=JF;var t8="AlertDialogDescription",n8=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(lE,{...a,...r,ref:t})});n8.displayName=t8;var Pxe="AlertDialogAction",r8=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(cE,{...a,...r,ref:t})});r8.displayName=Pxe;var a8="AlertDialogCancel",i8=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=kxe(a8,n),o=ho(n),l=qe(t,a);return i.jsx(cE,{...o,...r,ref:l})});i8.displayName=a8;var Rxe=({contentRef:e})=>{const t=`\`${Kc}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${Kc}\` by passing a \`${t8}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Kc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Dxe=YF,$xe=KF,Ixe=XF,o8=ZF,s8=QF,l8=r8,c8=i8,u8=e8,d8=n8;const Pn=Dxe,ra=$xe,Lxe=Ixe,f8=y.forwardRef(({className:e,...t},n)=>i.jsx(o8,{className:de("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));f8.displayName=o8.displayName;const yn=y.forwardRef(({className:e,...t},n)=>i.jsxs(Lxe,{children:[i.jsx(f8,{}),i.jsx(s8,{ref:n,className:de("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));yn.displayName=s8.displayName;const xn=({className:e,...t})=>i.jsx("div",{className:de("flex flex-col space-y-2 text-center sm:text-left",e),...t});xn.displayName="AlertDialogHeader";const bn=({className:e,...t})=>i.jsx("div",{className:de("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});bn.displayName="AlertDialogFooter";const wn=y.forwardRef(({className:e,...t},n)=>i.jsx(u8,{ref:n,className:de("text-lg font-semibold",e),...t}));wn.displayName=u8.displayName;const jn=y.forwardRef(({className:e,...t},n)=>i.jsx(d8,{ref:n,className:de("text-sm text-muted-foreground",e),...t}));jn.displayName=d8.displayName;const Sn=y.forwardRef(({className:e,...t},n)=>i.jsx(l8,{ref:n,className:de(fh(),e),...t}));Sn.displayName=l8.displayName;const _n=y.forwardRef(({className:e,...t},n)=>i.jsx(c8,{ref:n,className:de(fh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));_n.displayName=c8.displayName;function Bxe(){return i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),i.jsxs(ul,{defaultValue:"appearance",className:"w-full",children:[i.jsxs(Qo,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[i.jsxs(Ot,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(eF,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"外观"})]}),i.jsxs(Ot,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(uge,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"安全"})]}),i.jsxs(Ot,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(Vc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"其他"})]}),i.jsxs(Ot,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(YN,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"关于"})]})]}),i.jsxs(Vt,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[i.jsx(en,{value:"appearance",className:"mt-0",children:i.jsx(zxe,{})}),i.jsx(en,{value:"security",className:"mt-0",children:i.jsx(qxe,{})}),i.jsx(en,{value:"other",className:"mt-0",children:i.jsx(Fxe,{})}),i.jsx(en,{value:"about",className:"mt-0",children:i.jsx(Uxe,{})})]})]})]})}function lL(e){const t=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(r)t.style.setProperty("--primary",r.hsl),r.gradient?(t.style.setProperty("--primary-gradient",r.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const a=o=>{o=o.replace("#","");const l=parseInt(o.substring(0,2),16)/255,u=parseInt(o.substring(2,4),16)/255,d=parseInt(o.substring(4,6),16)/255,f=Math.max(l,u,d),m=Math.min(l,u,d);let p=0,g=0;const x=(f+m)/2;if(f!==m){const j=f-m;switch(g=x>.5?j/(2-f-m):j/(f+m),f){case l:p=((u-d)/j+(ulocalStorage.getItem("accent-color")||"blue");y.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";lL(f)},[]);const d=f=>{u(f),localStorage.setItem("accent-color",f),lL(f)};return i.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[i.jsx(JS,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),i.jsx(JS,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),i.jsx(JS,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),i.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),i.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[i.jsx(ba,{value:"blue",current:l,onChange:d,label:"蓝色",colorClass:"bg-blue-500"}),i.jsx(ba,{value:"purple",current:l,onChange:d,label:"紫色",colorClass:"bg-purple-500"}),i.jsx(ba,{value:"green",current:l,onChange:d,label:"绿色",colorClass:"bg-green-500"}),i.jsx(ba,{value:"orange",current:l,onChange:d,label:"橙色",colorClass:"bg-orange-500"}),i.jsx(ba,{value:"pink",current:l,onChange:d,label:"粉色",colorClass:"bg-pink-500"}),i.jsx(ba,{value:"red",current:l,onChange:d,label:"红色",colorClass:"bg-red-500"})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),i.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[i.jsx(ba,{value:"gradient-sunset",current:l,onChange:d,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),i.jsx(ba,{value:"gradient-ocean",current:l,onChange:d,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),i.jsx(ba,{value:"gradient-forest",current:l,onChange:d,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),i.jsx(ba,{value:"gradient-aurora",current:l,onChange:d,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),i.jsx(ba,{value:"gradient-fire",current:l,onChange:d,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),i.jsx(ba,{value:"gradient-twilight",current:l,onChange:d,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[i.jsx("div",{className:"flex-1",children:i.jsx("input",{type:"color",value:l.startsWith("#")?l:"#3b82f6",onChange:f=>d(f.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),i.jsx("div",{className:"flex-1",children:i.jsx(Ne,{type:"text",value:l,onChange:f=>d(f.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),i.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),i.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[i.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5 flex-1",children:[i.jsx(J,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),i.jsx(at,{id:"animations",checked:n,onCheckedChange:r})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5 flex-1",children:[i.jsx(J,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),i.jsx(at,{id:"waves-background",checked:a,onCheckedChange:o})]})})]})]})]})}function qxe(){const e=oa(),[t,n]=y.useState(""),[r,a]=y.useState(""),[o,l]=y.useState(!1),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[p,g]=y.useState(!1),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,A]=y.useState(""),[E,T]=y.useState(!1),{toast:C}=mr(),k=y.useMemo(()=>nye(r),[r]),O=()=>localStorage.getItem("access-token")||"",M=async F=>{try{await navigator.clipboard.writeText(F),j(!0),C({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>j(!1),2e3)}catch{C({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},I=async()=>{if(!r.trim()){C({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!k.isValid){const F=k.rules.filter(G=>!G.passed).map(G=>G.label).join(", ");C({title:"格式错误",description:`Token 不符合要求: ${F}`,variant:"destructive"});return}m(!0);try{const F=O(),G=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${F}`},body:JSON.stringify({new_token:r.trim()})}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",r.trim()),a(""),t&&n(r.trim()),C({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):C({title:"更新失败",description:L.message||"无法更新 Token",variant:"destructive"})}catch(F){console.error("更新 Token 错误:",F),C({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},z=async()=>{g(!0);try{const F=O(),G=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${F}`}}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",L.token),n(L.token),A(L.token),w(!0),T(!1),C({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):C({title:"生成失败",description:L.message||"无法生成新 Token",variant:"destructive"})}catch(F){console.error("生成 Token 错误:",F),C({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},D=async()=>{try{await navigator.clipboard.writeText(N),T(!0),C({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{C({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},H=()=>{w(!1),setTimeout(()=>{A(""),T(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},V=F=>{F||H()};return i.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[i.jsx(nr,{open:b,onOpenChange:V,children:i.jsxs(Hn,{className:"sm:max-w-md",children:[i.jsxs(Wn,{children:[i.jsxs(Vn,{className:"flex items-center gap-2",children:[i.jsx(Gc,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),i.jsx(dr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[i.jsx(J,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),i.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:N})]}),i.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Gc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[i.jsx("p",{className:"font-semibold",children:"重要提示"}),i.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[i.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),i.jsx("li",{children:"请立即复制并保存到安全的位置"}),i.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),i.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),i.jsxs($r,{className:"gap-2 sm:gap-0",children:[i.jsx(ue,{variant:"outline",onClick:D,className:"gap-2",children:E?i.jsxs(i.Fragment,{children:[i.jsx(il,{className:"h-4 w-4 text-green-500"}),"已复制"]}):i.jsxs(i.Fragment,{children:[i.jsx(HN,{className:"h-4 w-4"}),"复制 Token"]})}),i.jsx(ue,{onClick:H,children:"我已保存,关闭"})]})]})}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),i.jsx("div",{className:"space-y-3 sm:space-y-4",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Ne,{id:"current-token",type:o?"text":"password",value:t||O(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),i.jsx("button",{onClick:()=>{t||n(O()),l(!o)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:o?"隐藏":"显示",children:o?i.jsx(VN,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(Ua,{className:"h-4 w-4 text-muted-foreground"})})]}),i.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[i.jsx(ue,{variant:"outline",size:"icon",onClick:()=>M(O()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?i.jsx(il,{className:"h-4 w-4 text-green-500"}):i.jsx(HN,{className:"h-4 w-4"})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsxs(ue,{variant:"outline",disabled:p,className:"gap-2 flex-1 sm:flex-none",children:[i.jsx(sl,{className:de("h-4 w-4",p&&"animate-spin")}),i.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),i.jsx("span",{className:"sm:hidden",children:"生成"})]})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认重新生成 Token"}),i.jsx(jn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:z,children:"确认生成"})]})]})]})]})]}),i.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),i.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),i.jsxs("div",{className:"relative",children:[i.jsx(Ne,{id:"new-token",type:u?"text":"password",value:r,onChange:F=>a(F.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),i.jsx("button",{onClick:()=>d(!u),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:u?"隐藏":"显示",children:u?i.jsx(VN,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(Ua,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&i.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),i.jsx("div",{className:"space-y-1.5",children:k.rules.map(F=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[F.passed?i.jsx(Vo,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):i.jsx(UN,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),i.jsx("span",{className:de(F.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:F.label})]},F.id))}),k.isValid&&i.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:i.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[i.jsx(il,{className:"h-4 w-4"}),i.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),i.jsx(ue,{onClick:I,disabled:f||!k.isValid||!r,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),i.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[i.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),i.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),i.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),i.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),i.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),i.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),i.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function Fxe(){const e=oa(),{toast:t}=mr(),[n,r]=y.useState(!1),a=async()=>{r(!0);try{const o=localStorage.getItem("access-token"),l=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${o}`}}),u=await l.json();l.ok&&u.success?(t({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{e({to:"/setup"})},1e3)):t({title:"重置失败",description:u.message||"无法重置配置状态",variant:"destructive"})}catch(o){console.error("重置配置状态错误:",o),t({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return i.jsx("div",{className:"space-y-4 sm:space-y-6",children:i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),i.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[i.jsx("div",{className:"space-y-2",children:i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsxs(ue,{variant:"outline",disabled:n,className:"gap-2",children:[i.jsx(ege,{className:de("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认重新配置"}),i.jsx(jn,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:a,children:"确认重置"})]})]})]})]})]})})}function Uxe(){return i.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",tE]}),i.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[i.jsxs("p",{children:["版本: ",eE]}),i.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",i.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"React 19.2.0"}),i.jsx("li",{children:"TypeScript 5.7.2"}),i.jsx("li",{children:"Vite 6.0.7"}),i.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"shadcn/ui"}),i.jsx("li",{children:"Radix UI"}),i.jsx("li",{children:"Tailwind CSS 3.4.17"}),i.jsx("li",{children:"Lucide Icons"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"后端"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"Python 3.12+"}),i.jsx("li",{children:"FastAPI"}),i.jsx("li",{children:"Uvicorn"}),i.jsx("li",{children:"WebSocket"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"Bun / npm"}),i.jsx("li",{children:"ESLint 9.17.0"}),i.jsx("li",{children:"PostCSS"})]})]})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),i.jsx(Vt,{className:"h-[300px] sm:h-[400px]",children:i.jsxs("div",{className:"space-y-4 pr-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"React",description:"用户界面构建库",license:"MIT"}),i.jsx(Jt,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),i.jsx(Jt,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),i.jsx(Jt,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),i.jsx(Jt,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),i.jsx(Jt,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),i.jsx(Jt,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),i.jsx(Jt,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),i.jsx(Jt,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),i.jsx(Jt,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),i.jsx(Jt,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),i.jsx(Jt,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),i.jsx(Jt,{name:"Pydantic",description:"数据验证库",license:"MIT"}),i.jsx(Jt,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Jt,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),i.jsx(Jt,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),i.jsx(Jt,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),i.jsx(Jt,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:i.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[i.jsx("div",{className:"flex-shrink-0 mt-0.5",children:i.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:i.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Jt({name:e,description:t,license:n}){return i.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground truncate",children:e}),i.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:t})]}),i.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:n})]})}function JS({value:e,current:t,onChange:n,label:r,description:a}){const o=t===e;return i.jsxs("button",{onClick:()=>n(e),className:de("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&i.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),i.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:a})]}),i.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[e==="light"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ba({value:e,current:t,onChange:n,label:r,colorClass:a}){const o=t===e;return i.jsxs("button",{onClick:()=>n(e),className:de("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&i.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),i.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[i.jsx("div",{className:de("h-8 w-8 sm:h-10 sm:w-10 rounded-full",a)}),i.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class Hxe{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,r){return t[0]*n+t[1]*r}mix(t,n,r){return(1-r)*t+r*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const r=Math.floor(t)&255,a=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const o=this.fade(t),l=this.fade(n),u=this.perm[r]+a,d=this.perm[u],f=this.perm[u+1],m=this.perm[r+1]+a,p=this.perm[m],g=this.perm[m+1];return this.mix(this.mix(this.dot(this.grad3[d%12],t,n),this.dot(this.grad3[p%12],t-1,n),o),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[g%12],t-1,n-1),o),l)}}function Wxe(){const e=y.useRef(null),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new Hxe(Math.random()),bounding:null});return y.useEffect(()=>{const a=t.current,o=e.current;if(!a||!o)return;const l=r.current,u=()=>{const b=a.getBoundingClientRect();l.bounding=b,o.style.width=`${b.width}px`,o.style.height=`${b.height}px`},d=()=>{if(!l.bounding)return;const{width:b,height:w}=l.bounding;l.lines=[],l.paths.forEach(I=>I.remove()),l.paths=[];const N=10,A=32,E=b+200,T=w+30,C=Math.ceil(E/N),k=Math.ceil(T/A),O=(b-N*C)/2,M=(w-A*k)/2;for(let I=0;I<=C;I++){const z=[];for(let H=0;H<=k;H++){const V={x:O+N*I,y:M+A*H,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};z.push(V)}const D=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild(D),l.paths.push(D),l.lines.push(z)}},f=b=>{const{lines:w,mouse:N,noise:A}=l;w.forEach(E=>{E.forEach(T=>{const C=A.perlin2((T.x+b*.0125)*.002,(T.y+b*.005)*.0015)*12;T.wave.x=Math.cos(C)*32,T.wave.y=Math.sin(C)*16;const k=T.x-N.sx,O=T.y-N.sy,M=Math.hypot(k,O),I=Math.max(175,N.vs);if(M{const N={x:b.x+b.wave.x+(w?b.cursor.x:0),y:b.y+b.wave.y+(w?b.cursor.y:0)};return N.x=Math.round(N.x*10)/10,N.y=Math.round(N.y*10)/10,N},p=()=>{const{lines:b,paths:w}=l;b.forEach((N,A)=>{let E=m(N[0],!1),T=`M ${E.x} ${E.y}`;N.forEach((C,k)=>{const O=k===N.length-1;E=m(C,!O),T+=`L ${E.x} ${E.y}`}),w[A].setAttribute("d",T)})},g=b=>{const{mouse:w}=l;w.sx+=(w.x-w.sx)*.1,w.sy+=(w.y-w.sy)*.1;const N=w.x-w.lx,A=w.y-w.ly,E=Math.hypot(N,A);w.v=E,w.vs+=(E-w.vs)*.1,w.vs=Math.min(100,w.vs),w.lx=w.x,w.ly=w.y,w.a=Math.atan2(A,N),a&&(a.style.setProperty("--x",`${w.sx}px`),a.style.setProperty("--y",`${w.sy}px`)),f(b),p(),n.current=requestAnimationFrame(g)},x=b=>{if(!l.bounding)return;const{mouse:w}=l;w.x=b.pageX-l.bounding.left,w.y=b.pageY-l.bounding.top+window.scrollY,w.set||(w.sx=w.x,w.sy=w.y,w.lx=w.x,w.ly=w.y,w.set=!0)},j=()=>{u(),d()};return u(),d(),window.addEventListener("resize",j),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),i.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[i.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),i.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:i.jsx("style",{children:` - path { - fill: none; - stroke: hsl(var(--primary) / 0.20); - stroke-width: 1px; - } - `})})]})}function Vxe(){const e=oa();y.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function h8(){return!!localStorage.getItem("access-token")}function Gxe(){const[e,t]=y.useState(""),[n,r]=y.useState(!1),[a,o]=y.useState(""),l=oa(),{enableWavesBackground:u,setEnableWavesBackground:d}=oF(),{theme:f,setTheme:m}=JO();y.useEffect(()=>{h8()&&l({to:"/"})},[l]);const g=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,x=()=>{m(g==="dark"?"light":"dark")},j=async b=>{if(b.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}r(!0);try{const w=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),N=await w.json();if(w.ok&&N.valid){localStorage.setItem("access-token",e.trim());const A=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${e.trim()}`}}),E=await A.json();A.ok&&E.is_first_setup?l({to:"/setup"}):l({to:"/"})}else o(N.message||"Token 验证失败,请检查后重试")}catch(w){console.error("Token 验证错误:",w),o("连接服务器失败,请检查网络连接")}finally{r(!1)}};return i.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[u&&i.jsx(Wxe,{}),i.jsxs(st,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[i.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?i.jsx(ZN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):i.jsx(XN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),i.jsxs(qt,{className:"space-y-4 text-center",children:[i.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:i.jsx(HI,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ft,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),i.jsx(er,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),i.jsx(on,{children:i.jsxs("form",{onSubmit:j,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),i.jsxs("div",{className:"relative",children:[i.jsx($ve,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),i.jsx(Ne,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:b=>t(b.target.value),className:de("pl-10",a&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),a&&i.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[i.jsx(bg,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),i.jsx("span",{children:a})]}),i.jsx(ue,{type:"submit",className:"w-full",disabled:n,children:n?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),i.jsxs(nr,{children:[i.jsx(WF,{asChild:!0,children:i.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[i.jsx(mve,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),i.jsxs(Hn,{className:"sm:max-w-md",children:[i.jsxs(Wn,{children:[i.jsxs(Vn,{className:"flex items-center gap-2",children:[i.jsx(HI,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),i.jsx(dr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(bge,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),i.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[i.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),i.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),i.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(XO,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),i.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:i.jsx("code",{className:"text-primary",children:"data/webui.json"})}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",i.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),i.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx(bg,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),i.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[i.jsx("p",{className:"font-semibold",children:"安全提示"}),i.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[i.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),i.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[i.jsx(dh,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsxs(wn,{className:"flex items-center gap-2",children:[i.jsx(dh,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),i.jsx(jn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),i.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>d(!1),children:"关闭动画"})]})]})]})]})})]}),i.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:i.jsx("p",{children:rye})})]})}function Yxe(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l);u.displayName=o+"Context";const d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return i.jsx(b.Provider,{value:w,children:x})};f.displayName=o+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{const o=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,Kxe(a,...t)]}function Kxe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Xxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],m8=Xxe.reduce((e,t)=>{const n=zh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),uE="Progress",dE=100,[Zxe]=Yxe(uE),[Qxe,Jxe]=Zxe(uE),p8=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:o=ebe,...l}=e;(a||a===0)&&!cL(a)&&console.error(tbe(`${a}`,"Progress"));const u=cL(a)?a:dE;r!==null&&!uL(r,u)&&console.error(nbe(`${r}`,"Progress"));const d=uL(r,u)?r:null,f=Cg(d)?o(d,u):void 0;return i.jsx(Qxe,{scope:n,value:d,max:u,children:i.jsx(m8.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Cg(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":y8(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});p8.displayName=uE;var v8="ProgressIndicator",g8=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Jxe(v8,n);return i.jsx(m8.div,{"data-state":y8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});g8.displayName=v8;function ebe(e,t){return`${Math.round(e/t*100)}%`}function y8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Cg(e){return typeof e=="number"}function cL(e){return Cg(e)&&!isNaN(e)&&e>0}function uL(e,t){return Cg(e)&&!isNaN(e)&&e<=t&&e>=0}function tbe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${dE}\`.`}function nbe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${dE} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var x8=p8,rbe=g8;const fE=y.forwardRef(({className:e,value:t,...n},r)=>i.jsx(x8,{ref:r,className:de("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:i.jsx(rbe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));fE.displayName=x8.displayName;const Wt=y.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:de("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Wt.displayName="Textarea";var abe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ibe=abe.reduce((e,t)=>{const n=zh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),obe="Separator",dL="horizontal",sbe=["horizontal","vertical"],b8=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=dL,...a}=e,o=lbe(r)?r:dL,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(ibe.div,{"data-orientation":o,...u,...a,ref:t})});b8.displayName=obe;function lbe(e){return sbe.includes(e)}var w8=b8;const hh=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>i.jsx(w8,{ref:a,decorative:n,orientation:t,className:de("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));hh.displayName=w8.displayName;const cbe=qh("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Dt({className:e,variant:t,...n}){return i.jsx("div",{className:de(cbe({variant:t}),e),...n})}function ube({config:e,onChange:t}){const n=a=>{a.trim()&&!e.alias_names.includes(a.trim())&&t({...e,alias_names:[...e.alias_names,a.trim()]})},r=a=>{t({...e,alias_names:e.alias_names.filter((o,l)=>l!==a)})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"qq_account",children:"QQ账号 *"}),i.jsx(Ne,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:e.qq_account||"",onChange:a=>t({...e,qq_account:Number(a.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"nickname",children:"昵称 *"}),i.jsx(Ne,{id:"nickname",placeholder:"请输入机器人的昵称",value:e.nickname,onChange:a=>t({...e,nickname:a.target.value})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{children:"别名"}),i.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:e.alias_names.map((a,o)=>i.jsxs(Dt,{variant:"secondary",className:"gap-1",children:[a,i.jsx("button",{type:"button",onClick:()=>r(o),className:"ml-1 hover:text-destructive",children:i.jsx(Bh,{className:"h-3 w-3"})})]},o))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:a=>{a.key==="Enter"&&(n(a.target.value),a.target.value="")}}),i.jsx(ue,{type:"button",variant:"outline",onClick:()=>{const a=document.getElementById("alias_input");a&&(n(a.value),a.value="")},children:"添加"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function dbe({config:e,onChange:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"personality",children:"人格特征 *"}),i.jsx(Wt,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:e.personality,onChange:n=>t({...e,personality:n.target.value}),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"reply_style",children:"表达风格 *"}),i.jsx(Wt,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:e.reply_style,onChange:n=>t({...e,reply_style:n.target.value}),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"interest",children:"兴趣 *"}),i.jsx(Wt,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:e.interest,onChange:n=>t({...e,interest:n.target.value}),rows:2}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),i.jsx(hh,{}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"plan_style",children:"群聊说话规则 *"}),i.jsx(Wt,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:e.plan_style,onChange:n=>t({...e,plan_style:n.target.value}),rows:4}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),i.jsx(Wt,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:e.private_plan_style,onChange:n=>t({...e,private_plan_style:n.target.value}),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function fbe({config:e,onChange:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{htmlFor:"emoji_chance",children:"表情包激活概率"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[(e.emoji_chance*100).toFixed(0),"%"]})]}),i.jsx(Ne,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:e.emoji_chance,onChange:n=>t({...e,emoji_chance:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"max_reg_num",children:"最大表情包数量"}),i.jsx(Ne,{id:"max_reg_num",type:"number",min:"1",max:"200",value:e.max_reg_num,onChange:n=>t({...e,max_reg_num:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"do_replace",children:"达到最大数量时替换"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),i.jsx(at,{id:"do_replace",checked:e.do_replace,onCheckedChange:n=>t({...e,do_replace:n})})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),i.jsx(Ne,{id:"check_interval",type:"number",min:"1",max:"120",value:e.check_interval,onChange:n=>t({...e,check_interval:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),i.jsx(hh,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"steal_emoji",children:"偷取表情包"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),i.jsx(at,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:n=>t({...e,steal_emoji:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"content_filtration",children:"启用表情包过滤"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),i.jsx(at,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:n=>t({...e,content_filtration:n})})]}),e.content_filtration&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"filtration_prompt",children:"过滤要求"}),i.jsx(Ne,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:e.filtration_prompt,onChange:n=>t({...e,filtration_prompt:n.target.value})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function hbe({config:e,onChange:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"enable_tool",children:"启用工具系统"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),i.jsx(at,{id:"enable_tool",checked:e.enable_tool,onCheckedChange:n=>t({...e,enable_tool:n})})]}),i.jsx(hh,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"enable_mood",children:"启用情绪系统"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),i.jsx(at,{id:"enable_mood",checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})})]}),e.enable_mood&&i.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),i.jsx(Ne,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:e.mood_update_threshold||1,onChange:n=>t({...e,mood_update_threshold:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"emotion_style",children:"情感特征"}),i.jsx(Wt,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:e.emotion_style||"",onChange:n=>t({...e,emotion_style:n.target.value}),rows:2}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),i.jsx(hh,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"all_global",children:"启用全局黑话模式"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),i.jsx(at,{id:"all_global",checked:e.all_global,onCheckedChange:n=>t({...e,all_global:n})})]})]})}async function Qe(e,t){const n=await fetch(e,t);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function lt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function mbe(){const e=await Qe("/api/webui/config/bot",{method:"GET",headers:lt()});if(!e.ok)throw new Error("读取Bot配置失败");const n=(await e.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function pbe(){const e=await Qe("/api/webui/config/bot",{method:"GET",headers:lt()});if(!e.ok)throw new Error("读取人格配置失败");const n=(await e.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function vbe(){const e=await Qe("/api/webui/config/bot",{method:"GET",headers:lt()});if(!e.ok)throw new Error("读取表情包配置失败");const n=(await e.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function gbe(){const e=await Qe("/api/webui/config/bot",{method:"GET",headers:lt()});if(!e.ok)throw new Error("读取其他配置失败");const n=(await e.json()).config,r=n.tool||{},a=n.mood||{},o=n.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:a.enable_mood??!1,mood_update_threshold:a.mood_update_threshold,emotion_style:a.emotion_style,all_global:o.all_global??!0}}async function ybe(e){const t=await Qe("/api/webui/config/bot/section/bot",{method:"POST",headers:lt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await t.json()}async function xbe(e){const t=await Qe("/api/webui/config/bot/section/personality",{method:"POST",headers:lt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存人格配置失败")}return await t.json()}async function bbe(e){const t=await Qe("/api/webui/config/bot/section/emoji",{method:"POST",headers:lt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存表情包配置失败")}return await t.json()}async function wbe(e){const t=[];t.push(Qe("/api/webui/config/bot/section/tool",{method:"POST",headers:lt(),body:JSON.stringify({enable_tool:e.enable_tool})})),t.push(Qe("/api/webui/config/bot/section/jargon",{method:"POST",headers:lt(),body:JSON.stringify({all_global:e.all_global})}));const n={enable_mood:e.enable_mood};e.enable_mood&&(n.mood_update_threshold=e.mood_update_threshold||1,n.emotion_style=e.emotion_style||""),t.push(Qe("/api/webui/config/bot/section/mood",{method:"POST",headers:lt(),body:JSON.stringify(n)}));const r=await Promise.all(t);for(const a of r)if(!a.ok){const o=await a.json();throw new Error(o.detail||"保存其他配置失败")}return{success:!0}}async function fL(){const e=localStorage.getItem("access-token"),t=await Qe("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){const n=await t.json();throw new Error(n.message||"标记配置完成失败")}return await t.json()}function jbe(){const e=oa(),{toast:t}=mr(),[n,r]=y.useState(0),[a,o]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!0),[m,p]=y.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=y.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 -2.如果相同的内容已经被执行,请不要重复执行 -3.请控制你的发言频率,不要太过频繁的发言 -4.如果有人对你感到厌烦,请减少回复 -5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 -2.如果相同的内容已经被执行,请不要重复执行 -3.某句话如果已经被回复过,不要重复回复`}),[j,b]=y.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[w,N]=y.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),A=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:Jpe},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:nF},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:QO},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Vc},{id:"complete",title:"完成设置",description:"后续配置提示",icon:dh}],E=(n+1)/A.length*100;y.useEffect(()=>{(async()=>{try{f(!0);const[D,H,V,F]=await Promise.all([mbe(),pbe(),vbe(),gbe()]);p(D),x(H),b(V),N(F)}catch(D){t({title:"加载配置失败",description:D instanceof Error?D.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{f(!1)}})()},[t]);const T=async()=>{u(!0);try{switch(n){case 0:await ybe(m);break;case 1:await xbe(g);break;case 2:await bbe(j);break;case 3:await wbe(w);break}return t({title:"保存成功",description:`${A[n].title}配置已保存`}),!0}catch(z){return t({title:"保存失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"}),!1}finally{u(!1)}},C=async()=>{await T()&&n{n>0&&r(n-1)},O=async()=>{o(!0);try{if(!await T()){o(!1);return}await fL(),t({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{e({to:"/"})},500)}catch(z){t({title:"完成失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}finally{o(!1)}},M=async()=>{try{await fL(),e({to:"/"})}catch(z){t({title:"跳过失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},I=()=>{switch(n){case 0:return i.jsx(ube,{config:m,onChange:p});case 1:return i.jsx(dbe,{config:g,onChange:x});case 2:return i.jsx(fbe,{config:j,onChange:b});case 3:return i.jsx(hbe,{config:w,onChange:N});case 4:return i.jsxs("div",{className:"space-y-6 text-center py-8",children:[i.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:i.jsx(dh,{className:"h-8 w-8 text-primary",strokeWidth:2})}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),i.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-0.5",children:i.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-0.5",children:i.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"添加模型"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-0.5",children:i.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"配置模型任务"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return i.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[i.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[i.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),i.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),d?i.jsxs("div",{className:"relative z-10 text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:i.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),i.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),i.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[i.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:i.jsx(pge,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),i.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),i.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",tE," 的初始配置"]})]}),i.jsxs("div",{className:"mb-6 md:mb-8",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[i.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",A.length]}),i.jsxs("span",{className:"font-medium text-primary",children:[Math.round(E),"%"]})]}),i.jsx(fE,{value:E,className:"h-2"})]}),i.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:A.map((z,D)=>{const H=z.icon;return i.jsxs("div",{className:de("flex flex-1 flex-col items-center gap-1 md:gap-2",De({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[i.jsx(Sg,{className:"h-4 w-4"}),"返回首页"]}),i.jsxs(ue,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[i.jsx(Xq,{className:"h-4 w-4"}),"返回上一页"]})]}),i.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var S8=["PageUp","PageDown"],_8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Gu="Slider",[eC,Sbe,_be]=Ch(Gu),[C8]=hr(Gu,[_be]),[Nbe,By]=C8(Gu),O8=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:j,...b}=e,w=y.useRef(new Set),N=y.useRef(0),E=l==="horizontal"?Cbe:Obe,[T=[],C]=Na({prop:m,defaultProp:f,onChange:D=>{[...w.current][N.current]?.focus(),p(D)}}),k=y.useRef(T);function O(D){const H=Mbe(T,D);z(D,H)}function M(D){z(D,N.current)}function I(){const D=k.current[N.current];T[N.current]!==D&&g(T)}function z(D,H,{commit:V}={commit:!1}){const F=$be(o),G=Ibe(Math.round((D-r)/o)*o+r,F),L=Ef(G,[r,a]);C((R=[])=>{const U=Tbe(R,L,H);if(Dbe(U,d*o)){N.current=U.indexOf(L);const K=String(U)!==String(R);return K&&V&&g(U),K?U:R}else return R})}return i.jsx(Nbe,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:a,valueIndexToChangeRef:N,thumbs:w.current,values:T,orientation:l,form:j,children:i.jsx(eC.Provider,{scope:e.__scopeSlider,children:i.jsx(eC.Slot,{scope:e.__scopeSlider,children:i.jsx(E,{"aria-disabled":u,"data-disabled":u?"":void 0,...b,ref:t,onPointerDown:Se(b.onPointerDown,()=>{u||(k.current=T)}),min:r,max:a,inverted:x,onSlideStart:u?void 0:O,onSlideMove:u?void 0:M,onSlideEnd:u?void 0:I,onHomeKeyDown:()=>!u&&z(r,0,{commit:!0}),onEndKeyDown:()=>!u&&z(a,T.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:H})=>{if(!u){const G=S8.includes(D.key)||D.shiftKey&&_8.includes(D.key)?10:1,L=N.current,R=T[L],U=o*G*H;z(R+U,L,{commit:!0})}}})})})})});O8.displayName=Gu;var[E8,A8]=C8(Gu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Cbe=y.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...m}=e,[p,g]=y.useState(null),x=qe(t,E=>g(E)),j=y.useRef(void 0),b=Lu(a),w=b==="ltr",N=w&&!o||!w&&o;function A(E){const T=j.current||p.getBoundingClientRect(),C=[0,T.width],O=hE(C,N?[n,r]:[r,n]);return j.current=T,O(E-T.left)}return i.jsx(E8,{scope:e.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:i.jsx(T8,{dir:b,"data-orientation":"horizontal",...m,ref:x,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:E=>{const T=A(E.clientX);l?.(T)},onSlideMove:E=>{const T=A(E.clientX);u?.(T)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:E=>{const C=N8[N?"from-left":"from-right"].includes(E.key);f?.({event:E,direction:C?-1:1})}})})}),Obe=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,m=y.useRef(null),p=qe(t,m),g=y.useRef(void 0),x=!a;function j(b){const w=g.current||m.current.getBoundingClientRect(),N=[0,w.height],E=hE(N,x?[r,n]:[n,r]);return g.current=w,E(b-w.top)}return i.jsx(E8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:i.jsx(T8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const w=j(b.clientY);o?.(w)},onSlideMove:b=>{const w=j(b.clientY);l?.(w)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:b=>{const N=N8[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:N?-1:1})}})})}),T8=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,m=By(Gu,n);return i.jsx(Pe.span,{...f,ref:t,onKeyDown:Se(e.onKeyDown,p=>{p.key==="Home"?(l(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):S8.concat(_8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Se(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Se(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Se(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),o(p))})})}),k8="SliderTrack",M8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=By(k8,n);return i.jsx(Pe.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});M8.displayName=k8;var tC="SliderRange",P8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=By(tC,n),o=A8(tC,n),l=y.useRef(null),u=qe(t,l),d=a.values.length,f=a.values.map(g=>$8(g,a.min,a.max)),m=d>1?Math.min(...f):0,p=100-Math.max(...f);return i.jsx(Pe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:u,style:{...e.style,[o.startEdge]:m+"%",[o.endEdge]:p+"%"}})});P8.displayName=tC;var nC="SliderThumb",R8=y.forwardRef((e,t)=>{const n=Sbe(e.__scopeSlider),[r,a]=y.useState(null),o=qe(t,u=>a(u)),l=y.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return i.jsx(Ebe,{...e,ref:o,index:l})}),Ebe=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...o}=e,l=By(nC,n),u=A8(nC,n),[d,f]=y.useState(null),m=qe(t,A=>f(A)),p=d?l.form||!!d.closest("form"):!0,g=ky(d),x=l.values[r],j=x===void 0?0:$8(x,l.min,l.max),b=kbe(r,l.values.length),w=g?.[u.size],N=w?Pbe(w,j,u.direction):0;return y.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${j}% + ${N}px)`},children:[i.jsx(eC.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(Pe.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:m,style:x===void 0?{display:"none"}:e.style,onFocus:Se(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),p&&i.jsx(D8,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});R8.displayName=nC;var Abe="RadioBubbleInput",D8=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=y.useRef(null),o=qe(a,r),l=Ty(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("input",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),i.jsx(Pe.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});D8.displayName=Abe;function Tbe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,o)=>a-o)}function $8(e,t,n){const o=100/(n-t)*(e-t);return Ef(o,[0,100])}function kbe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Mbe(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function Pbe(e,t,n){const r=e/2,o=hE([0,50],[0,r]);return(r-o(t)*n)*n}function Rbe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Dbe(e,t){if(t>0){const n=Rbe(e);return Math.min(...n)>=t}return!0}function hE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function $be(e){return(String(e).split(".")[1]||"").length}function Ibe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var I8=O8,Lbe=M8,Bbe=P8,zbe=R8;const mE=y.forwardRef(({className:e,...t},n)=>i.jsxs(I8,{ref:n,className:de("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(Lbe,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:i.jsx(Bbe,{className:"absolute h-full bg-primary"})}),i.jsx(zbe,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));mE.displayName=I8.displayName;const qbe=["top","right","bottom","left"],Jo=Math.min,Jr=Math.max,Og=Math.round,Wp=Math.floor,mi=e=>({x:e,y:e}),Fbe={left:"right",right:"left",bottom:"top",top:"bottom"},Ube={start:"end",end:"start"};function rC(e,t,n){return Jr(e,Jo(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function oo(e){return e.split("-")[0]}function Yu(e){return e.split("-")[1]}function pE(e){return e==="x"?"y":"x"}function vE(e){return e==="y"?"height":"width"}const Hbe=new Set(["top","bottom"]);function ci(e){return Hbe.has(oo(e))?"y":"x"}function gE(e){return pE(ci(e))}function Wbe(e,t,n){n===void 0&&(n=!1);const r=Yu(e),a=gE(e),o=vE(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Eg(l)),[l,Eg(l)]}function Vbe(e){const t=Eg(e);return[aC(e),t,aC(t)]}function aC(e){return e.replace(/start|end/g,t=>Ube[t])}const hL=["left","right"],mL=["right","left"],Gbe=["top","bottom"],Ybe=["bottom","top"];function Kbe(e,t,n){switch(e){case"top":case"bottom":return n?t?mL:hL:t?hL:mL;case"left":case"right":return t?Gbe:Ybe;default:return[]}}function Xbe(e,t,n,r){const a=Yu(e);let o=Kbe(oo(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(aC)))),o}function Eg(e){return e.replace(/left|right|bottom|top/g,t=>Fbe[t])}function Zbe(e){return{top:0,right:0,bottom:0,left:0,...e}}function L8(e){return typeof e!="number"?Zbe(e):{top:e,right:e,bottom:e,left:e}}function Ag(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function pL(e,t,n){let{reference:r,floating:a}=e;const o=ci(t),l=gE(t),u=vE(l),d=oo(t),f=o==="y",m=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-a.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(Yu(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const Qbe=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:p}=pL(f,r,d),g=r,x={},j=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:m=0}=io(e,t)||{};if(f==null)return{};const p=L8(m),g={x:n,y:r},x=gE(a),j=vE(x),b=await l.getDimensions(f),w=x==="y",N=w?"top":"left",A=w?"bottom":"right",E=w?"clientHeight":"clientWidth",T=o.reference[j]+o.reference[x]-g[x]-o.floating[j],C=g[x]-o.reference[x],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=k?k[E]:0;(!O||!await(l.isElement==null?void 0:l.isElement(k)))&&(O=u.floating[E]||o.floating[j]);const M=T/2-C/2,I=O/2-b[j]/2-1,z=Jo(p[N],I),D=Jo(p[A],I),H=z,V=O-b[j]-D,F=O/2-b[j]/2+M,G=rC(H,F,V),L=!d.arrow&&Yu(a)!=null&&F!==G&&o.reference[j]/2-(FF<=0)){var D,H;const F=(((D=o.flip)==null?void 0:D.index)||0)+1,G=O[F];if(G&&(!(p==="alignment"?A!==ci(G):!1)||z.every(U=>ci(U.placement)===A?U.overflows[0]>0:!0)))return{data:{index:F,overflows:z},reset:{placement:G}};let L=(H=z.filter(R=>R.overflows[0]<=0).sort((R,U)=>R.overflows[1]-U.overflows[1])[0])==null?void 0:H.placement;if(!L)switch(x){case"bestFit":{var V;const R=(V=z.filter(U=>{if(k){const K=ci(U.placement);return K===A||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,te)=>K+te,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:V[0];R&&(L=R);break}case"initialPlacement":L=u;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function vL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gL(e){return qbe.some(t=>e[t]>=0)}const t0e=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=io(e,t);switch(r){case"referenceHidden":{const o=await mh(t,{...a,elementContext:"reference"}),l=vL(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:gL(l)}}}case"escaped":{const o=await mh(t,{...a,altBoundary:!0}),l=vL(o,n.floating);return{data:{escapedOffsets:l,escaped:gL(l)}}}default:return{}}}}},B8=new Set(["left","top"]);async function n0e(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=oo(n),u=Yu(n),d=ci(n)==="y",f=B8.has(l)?-1:1,m=o&&d?-1:1,p=io(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof j=="number"&&(x=u==="end"?j*-1:j),d?{x:x*m,y:g*f}:{x:g*f,y:x*m}}const r0e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:u}=t,d=await n0e(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:l}}}}},a0e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:N,y:A}=w;return{x:N,y:A}}},...d}=io(e,t),f={x:n,y:r},m=await mh(t,d),p=ci(oo(a)),g=pE(p);let x=f[g],j=f[p];if(o){const w=g==="y"?"top":"left",N=g==="y"?"bottom":"right",A=x+m[w],E=x-m[N];x=rC(A,x,E)}if(l){const w=p==="y"?"top":"left",N=p==="y"?"bottom":"right",A=j+m[w],E=j-m[N];j=rC(A,j,E)}const b=u.fn({...t,[g]:x,[p]:j});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:o,[p]:l}}}}}},i0e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=io(e,t),m={x:n,y:r},p=ci(a),g=pE(p);let x=m[g],j=m[p];const b=io(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const E=g==="y"?"height":"width",T=o.reference[g]-o.floating[E]+w.mainAxis,C=o.reference[g]+o.reference[E]-w.mainAxis;xC&&(x=C)}if(f){var N,A;const E=g==="y"?"width":"height",T=B8.has(oo(a)),C=o.reference[p]-o.floating[E]+(T&&((N=l.offset)==null?void 0:N[p])||0)+(T?0:w.crossAxis),k=o.reference[p]+o.reference[E]+(T?0:((A=l.offset)==null?void 0:A[p])||0)-(T?w.crossAxis:0);jk&&(j=k)}return{[g]:x,[p]:j}}}},o0e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...f}=io(e,t),m=await mh(t,f),p=oo(a),g=Yu(a),x=ci(a)==="y",{width:j,height:b}=o.floating;let w,N;p==="top"||p==="bottom"?(w=p,N=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(N=p,w=g==="end"?"top":"bottom");const A=b-m.top-m.bottom,E=j-m.left-m.right,T=Jo(b-m[w],A),C=Jo(j-m[N],E),k=!t.middlewareData.shift;let O=T,M=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=A),k&&!g){const z=Jr(m.left,0),D=Jr(m.right,0),H=Jr(m.top,0),V=Jr(m.bottom,0);x?M=j-2*(z!==0||D!==0?z+D:Jr(m.left,m.right)):O=b-2*(H!==0||V!==0?H+V:Jr(m.top,m.bottom))}await d({...t,availableWidth:M,availableHeight:O});const I=await l.getDimensions(u.floating);return j!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function zy(){return typeof window<"u"}function Ku(e){return z8(e)?(e.nodeName||"").toLowerCase():"#document"}function aa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ji(e){var t;return(t=(z8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function z8(e){return zy()?e instanceof Node||e instanceof aa(e).Node:!1}function Ha(e){return zy()?e instanceof Element||e instanceof aa(e).Element:!1}function yi(e){return zy()?e instanceof HTMLElement||e instanceof aa(e).HTMLElement:!1}function yL(e){return!zy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof aa(e).ShadowRoot}const s0e=new Set(["inline","contents"]);function Hh(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Wa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!s0e.has(a)}const l0e=new Set(["table","td","th"]);function c0e(e){return l0e.has(Ku(e))}const u0e=[":popover-open",":modal"];function qy(e){return u0e.some(t=>{try{return e.matches(t)}catch{return!1}})}const d0e=["transform","translate","scale","rotate","perspective"],f0e=["transform","translate","scale","rotate","perspective","filter"],h0e=["paint","layout","strict","content"];function yE(e){const t=xE(),n=Ha(e)?Wa(e):e;return d0e.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||f0e.some(r=>(n.willChange||"").includes(r))||h0e.some(r=>(n.contain||"").includes(r))}function m0e(e){let t=es(e);for(;yi(t)&&!ku(t);){if(yE(t))return t;if(qy(t))return null;t=es(t)}return null}function xE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const p0e=new Set(["html","body","#document"]);function ku(e){return p0e.has(Ku(e))}function Wa(e){return aa(e).getComputedStyle(e)}function Fy(e){return Ha(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function es(e){if(Ku(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yL(e)&&e.host||ji(e);return yL(t)?t.host:t}function q8(e){const t=es(e);return ku(t)?e.ownerDocument?e.ownerDocument.body:e.body:yi(t)&&Hh(t)?t:q8(t)}function ph(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=q8(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=aa(a);if(o){const u=iC(l);return t.concat(l,l.visualViewport||[],Hh(a)?a:[],u&&n?ph(u):[])}return t.concat(a,ph(a,[],n))}function iC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F8(e){const t=Wa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=yi(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Og(n)!==o||Og(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function bE(e){return Ha(e)?e:e.contextElement}function Xc(e){const t=bE(e);if(!yi(t))return mi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=F8(t);let l=(o?Og(n.width):n.width)/r,u=(o?Og(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const v0e=mi(0);function U8(e){const t=aa(e);return!xE()||!t.visualViewport?v0e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function g0e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==aa(e)?!1:t}function gl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=bE(e);let l=mi(1);t&&(r?Ha(r)&&(l=Xc(r)):l=Xc(e));const u=g0e(o,n,r)?U8(o):mi(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,m=a.width/l.x,p=a.height/l.y;if(o){const g=aa(o),x=r&&Ha(r)?aa(r):r;let j=g,b=iC(j);for(;b&&r&&x!==j;){const w=Xc(b),N=b.getBoundingClientRect(),A=Wa(b),E=N.left+(b.clientLeft+parseFloat(A.paddingLeft))*w.x,T=N.top+(b.clientTop+parseFloat(A.paddingTop))*w.y;d*=w.x,f*=w.y,m*=w.x,p*=w.y,d+=E,f+=T,j=aa(b),b=iC(j)}}return Ag({width:m,height:p,x:d,y:f})}function Uy(e,t){const n=Fy(e).scrollLeft;return t?t.left+n:gl(ji(e)).left+n}function H8(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Uy(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function y0e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=ji(r),u=t?qy(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},f=mi(1);const m=mi(0),p=yi(r);if((p||!p&&!o)&&((Ku(r)!=="body"||Hh(l))&&(d=Fy(r)),yi(r))){const x=gl(r);f=Xc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const g=l&&!p&&!o?H8(l,d):mi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-d.scrollTop*f.y+m.y+g.y}}function x0e(e){return Array.from(e.getClientRects())}function b0e(e){const t=ji(e),n=Fy(e),r=e.ownerDocument.body,a=Jr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Jr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Uy(e);const u=-n.scrollTop;return Wa(r).direction==="rtl"&&(l+=Jr(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:u}}const xL=25;function w0e(e,t){const n=aa(e),r=ji(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){o=a.width,l=a.height;const m=xE();(!m||m&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const f=Uy(r);if(f<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=xL&&(o-=j)}else f<=xL&&(o+=f);return{width:o,height:l,x:u,y:d}}const j0e=new Set(["absolute","fixed"]);function S0e(e,t){const n=gl(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=yi(e)?Xc(e):mi(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=a*o.x,f=r*o.y;return{width:l,height:u,x:d,y:f}}function bL(e,t,n){let r;if(t==="viewport")r=w0e(e,n);else if(t==="document")r=b0e(ji(e));else if(Ha(t))r=S0e(t,n);else{const a=U8(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ag(r)}function W8(e,t){const n=es(e);return n===t||!Ha(n)||ku(n)?!1:Wa(n).position==="fixed"||W8(n,t)}function _0e(e,t){const n=t.get(e);if(n)return n;let r=ph(e,[],!1).filter(u=>Ha(u)&&Ku(u)!=="body"),a=null;const o=Wa(e).position==="fixed";let l=o?es(e):e;for(;Ha(l)&&!ku(l);){const u=Wa(l),d=yE(l);!d&&u.position==="fixed"&&(a=null),(o?!d&&!a:!d&&u.position==="static"&&!!a&&j0e.has(a.position)||Hh(l)&&!d&&W8(e,l))?r=r.filter(m=>m!==l):a=u,l=es(l)}return t.set(e,r),r}function N0e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?qy(t)?[]:_0e(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,m)=>{const p=bL(t,m,a);return f.top=Jr(p.top,f.top),f.right=Jo(p.right,f.right),f.bottom=Jo(p.bottom,f.bottom),f.left=Jr(p.left,f.left),f},bL(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function C0e(e){const{width:t,height:n}=F8(e);return{width:t,height:n}}function O0e(e,t,n){const r=yi(t),a=ji(t),o=n==="fixed",l=gl(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=mi(0);function f(){d.x=Uy(a)}if(r||!r&&!o)if((Ku(t)!=="body"||Hh(a))&&(u=Fy(t)),r){const x=gl(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else a&&f();o&&!r&&a&&f();const m=a&&!r&&!o?H8(a,u):mi(0),p=l.left+u.scrollLeft-d.x-m.x,g=l.top+u.scrollTop-d.y-m.y;return{x:p,y:g,width:l.width,height:l.height}}function e_(e){return Wa(e).position==="static"}function wL(e,t){if(!yi(e)||Wa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ji(e)===n&&(n=n.ownerDocument.body),n}function V8(e,t){const n=aa(e);if(qy(e))return n;if(!yi(e)){let a=es(e);for(;a&&!ku(a);){if(Ha(a)&&!e_(a))return a;a=es(a)}return n}let r=wL(e,t);for(;r&&c0e(r)&&e_(r);)r=wL(r,t);return r&&ku(r)&&e_(r)&&!yE(r)?n:r||m0e(e)||n}const E0e=async function(e){const t=this.getOffsetParent||V8,n=this.getDimensions,r=await n(e.floating);return{reference:O0e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function A0e(e){return Wa(e).direction==="rtl"}const T0e={convertOffsetParentRelativeRectToViewportRelativeRect:y0e,getDocumentElement:ji,getClippingRect:N0e,getOffsetParent:V8,getElementRects:E0e,getClientRects:x0e,getDimensions:C0e,getScale:Xc,isElement:Ha,isRTL:A0e};function G8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k0e(e,t){let n=null,r;const a=ji(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:m,top:p,width:g,height:x}=f;if(u||t(),!g||!x)return;const j=Wp(p),b=Wp(a.clientWidth-(m+g)),w=Wp(a.clientHeight-(p+x)),N=Wp(m),E={rootMargin:-j+"px "+-b+"px "+-w+"px "+-N+"px",threshold:Jr(0,Jo(1,d))||1};let T=!0;function C(k){const O=k[0].intersectionRatio;if(O!==d){if(!T)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!G8(f,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(C,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(C,E)}n.observe(e)}return l(!0),o}function M0e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=bE(e),m=a||o?[...f?ph(f):[],...ph(t)]:[];m.forEach(N=>{a&&N.addEventListener("scroll",n,{passive:!0}),o&&N.addEventListener("resize",n)});const p=f&&u?k0e(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(N=>{let[A]=N;A&&A.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=x)==null||E.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?gl(e):null;d&&w();function w(){const N=gl(e);b&&!G8(b,N)&&n(),b=N,j=requestAnimationFrame(w)}return n(),()=>{var N;m.forEach(A=>{a&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),p?.(),(N=x)==null||N.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const P0e=r0e,R0e=a0e,D0e=e0e,$0e=o0e,I0e=t0e,jL=Jbe,L0e=i0e,B0e=(e,t,n)=>{const r=new Map,a={platform:T0e,...n},o={...a.platform,_c:r};return Qbe(e,t,{...a,platform:o})};var z0e=typeof document<"u",q0e=function(){},cv=z0e?y.useLayoutEffect:q0e;function Tg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Tg(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Tg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Y8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function SL(e,t){const n=Y8(e);return Math.round(t*n)/n}function t_(e){const t=y.useRef(e);return cv(()=>{t.current=e}),t}function F0e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=y.useState(r);Tg(g,r)||x(r);const[j,b]=y.useState(null),[w,N]=y.useState(null),A=y.useCallback(U=>{U!==k.current&&(k.current=U,b(U))},[]),E=y.useCallback(U=>{U!==O.current&&(O.current=U,N(U))},[]),T=o||j,C=l||w,k=y.useRef(null),O=y.useRef(null),M=y.useRef(m),I=d!=null,z=t_(d),D=t_(a),H=t_(f),V=y.useCallback(()=>{if(!k.current||!O.current)return;const U={placement:t,strategy:n,middleware:g};D.current&&(U.platform=D.current),B0e(k.current,O.current,U).then(K=>{const te={...K,isPositioned:H.current!==!1};F.current&&!Tg(M.current,te)&&(M.current=te,wl.flushSync(()=>{p(te)}))})},[g,t,n,D,H]);cv(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[f]);const F=y.useRef(!1);cv(()=>(F.current=!0,()=>{F.current=!1}),[]),cv(()=>{if(T&&(k.current=T),C&&(O.current=C),T&&C){if(z.current)return z.current(T,C,V);V()}},[T,C,V,z,I]);const G=y.useMemo(()=>({reference:k,floating:O,setReference:A,setFloating:E}),[A,E]),L=y.useMemo(()=>({reference:T,floating:C}),[T,C]),R=y.useMemo(()=>{const U={position:n,left:0,top:0};if(!L.floating)return U;const K=SL(L.floating,m.x),te=SL(L.floating,m.y);return u?{...U,transform:"translate("+K+"px, "+te+"px)",...Y8(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:te}},[n,u,L.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:V,refs:G,elements:L,floatingStyles:R}),[m,V,G,L,R])}const U0e=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jL({element:r.current,padding:a}).fn(n):{}:r?jL({element:r,padding:a}).fn(n):{}}}},H0e=(e,t)=>({...P0e(e),options:[e,t]}),W0e=(e,t)=>({...R0e(e),options:[e,t]}),V0e=(e,t)=>({...L0e(e),options:[e,t]}),G0e=(e,t)=>({...D0e(e),options:[e,t]}),Y0e=(e,t)=>({...$0e(e),options:[e,t]}),K0e=(e,t)=>({...I0e(e),options:[e,t]}),X0e=(e,t)=>({...U0e(e),options:[e,t]});var Z0e="Arrow",K8=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return i.jsx(Pe.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});K8.displayName=Z0e;var Q0e=K8,wE="Popper",[X8,us]=hr(wE),[J0e,Z8]=X8(wE),Q8=e=>{const{__scopePopper:t,children:n}=e,[r,a]=y.useState(null);return i.jsx(J0e,{scope:t,anchor:r,onAnchorChange:a,children:n})};Q8.displayName=wE;var J8="PopperAnchor",eU=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=Z8(J8,n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return y.useEffect(()=>{const f=d.current;d.current=r?.current||l.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:i.jsx(Pe.div,{...a,ref:u})});eU.displayName=J8;var jE="PopperContent",[ewe,twe]=X8(jE),tU=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,w=Z8(jE,n),[N,A]=y.useState(null),E=qe(t,ee=>A(ee)),[T,C]=y.useState(null),k=ky(T),O=k?.width??0,M=k?.height??0,I=r+(o!=="center"?"-"+o:""),z=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],H=D.length>0,V={padding:z,boundary:D.filter(rwe),altBoundary:H},{refs:F,floatingStyles:G,placement:L,isPositioned:R,middlewareData:U}=F0e({strategy:"fixed",placement:I,whileElementsMounted:(...ee)=>M0e(...ee,{animationFrame:x==="always"}),elements:{reference:w.anchor},middleware:[H0e({mainAxis:a+M,alignmentAxis:l}),d&&W0e({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?V0e():void 0,...V}),d&&G0e({...V}),Y0e({...V,apply:({elements:ee,rects:ae,availableWidth:Z,availableHeight:pe})=>{const{width:je,height:le}=ae.reference,Re=ee.floating.style;Re.setProperty("--radix-popper-available-width",`${Z}px`),Re.setProperty("--radix-popper-available-height",`${pe}px`),Re.setProperty("--radix-popper-anchor-width",`${je}px`),Re.setProperty("--radix-popper-anchor-height",`${le}px`)}}),T&&X0e({element:T,padding:u}),awe({arrowWidth:O,arrowHeight:M}),g&&K0e({strategy:"referenceHidden",...V})]}),[K,te]=aU(L),$=nn(j);Un(()=>{R&&$?.()},[R,$]);const B=U.arrow?.x,Y=U.arrow?.y,ne=U.arrow?.centerOffset!==0,[oe,xe]=y.useState();return Un(()=>{N&&xe(window.getComputedStyle(N).zIndex)},[N]),i.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:R?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(ewe,{scope:n,placedSide:K,onArrowChange:C,arrowX:B,arrowY:Y,shouldHideArrow:ne,children:i.jsx(Pe.div,{"data-side":K,"data-align":te,...b,ref:E,style:{...b.style,animation:R?void 0:"none"}})})})});tU.displayName=jE;var nU="PopperArrow",nwe={top:"bottom",right:"left",bottom:"top",left:"right"},rU=y.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=twe(nU,r),l=nwe[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(Q0e,{...a,ref:n,style:{...a.style,display:"block"}})})});rU.displayName=nU;function rwe(e){return e!==null}var awe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,m]=aU(n),p={start:"0%",center:"50%",end:"100%"}[m],g=(a.arrow?.x??0)+u/2,x=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=l?p:`${g}px`,b=`${-d}px`):f==="top"?(j=l?p:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=l?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=l?p:`${x}px`),{data:{x:j,y:b}}}});function aU(e){const[t,n="center"]=e.split("-");return[t,n]}var Wh=Q8,Vh=eU,Hy=tU,Wy=rU;function iwe(e){const t=owe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(lwe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function owe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=uwe(a),u=cwe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var swe=Symbol("radix.slottable");function lwe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===swe}function cwe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function uwe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var iU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dwe="VisuallyHidden",Vy=y.forwardRef((e,t)=>i.jsx(Pe.span,{...e,ref:t,style:{...iU,...e.style}}));Vy.displayName=dwe;var fwe=Vy,hwe=[" ","Enter","ArrowUp","ArrowDown"],mwe=[" ","Enter"],yl="Select",[Gy,Yy,pwe]=Ch(yl),[Xu]=hr(yl,[pwe,us]),Ky=us(),[vwe,ds]=Xu(yl),[gwe,ywe]=Xu(yl),oU=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:p,disabled:g,required:x,form:j}=e,b=Ky(t),[w,N]=y.useState(null),[A,E]=y.useState(null),[T,C]=y.useState(!1),k=Lu(f),[O,M]=Na({prop:r,defaultProp:a??!1,onChange:o,caller:yl}),[I,z]=Na({prop:l,defaultProp:u,onChange:d,caller:yl}),D=y.useRef(null),H=w?j||!!w.closest("form"):!0,[V,F]=y.useState(new Set),G=Array.from(V).map(L=>L.props.value).join(";");return i.jsx(Wh,{...b,children:i.jsxs(vwe,{required:x,scope:t,trigger:w,onTriggerChange:N,valueNode:A,onValueNodeChange:E,valueNodeHasChildren:T,onValueNodeHasChildrenChange:C,contentId:Fn(),value:I,onValueChange:z,open:O,onOpenChange:M,dir:k,triggerPointerDownPosRef:D,disabled:g,children:[i.jsx(Gy.Provider,{scope:t,children:i.jsx(gwe,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(L=>{F(R=>new Set(R).add(L))},[]),onNativeOptionRemove:y.useCallback(L=>{F(R=>{const U=new Set(R);return U.delete(L),U})},[]),children:n})}),H?i.jsxs(TU,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:p,value:I,onChange:L=>z(L.target.value),disabled:g,form:j,children:[I===void 0?i.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};oU.displayName=yl;var sU="SelectTrigger",lU=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=Ky(n),l=ds(sU,n),u=l.disabled||r,d=qe(t,l.onTriggerChange),f=Yy(n),m=y.useRef("touch"),[p,g,x]=MU(b=>{const w=f().filter(E=>!E.disabled),N=w.find(E=>E.value===l.value),A=PU(w,b,N);A!==void 0&&l.onValueChange(A.value)}),j=b=>{u||(l.onOpenChange(!0),x()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return i.jsx(Vh,{asChild:!0,...o,children:i.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":kU(l.value)?"":void 0,...a,ref:d,onClick:Se(a.onClick,b=>{b.currentTarget.focus(),m.current!=="mouse"&&j(b)}),onPointerDown:Se(a.onPointerDown,b=>{m.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Se(a.onKeyDown,b=>{const w=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&g(b.key),!(w&&b.key===" ")&&hwe.includes(b.key)&&(j(),b.preventDefault())})})})});lU.displayName=sU;var cU="SelectValue",uU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:l="",...u}=e,d=ds(cU,n),{onValueNodeHasChildrenChange:f}=d,m=o!==void 0,p=qe(t,d.onValueNodeChange);return Un(()=>{f(m)},[f,m]),i.jsx(Pe.span,{...u,ref:p,style:{pointerEvents:"none"},children:kU(d.value)?i.jsx(i.Fragment,{children:l}):o})});uU.displayName=cU;var xwe="SelectIcon",dU=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return i.jsx(Pe.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});dU.displayName=xwe;var bwe="SelectPortal",fU=e=>i.jsx(El,{asChild:!0,...e});fU.displayName=bwe;var xl="SelectContent",hU=y.forwardRef((e,t)=>{const n=ds(xl,e.__scopeSelect),[r,a]=y.useState();if(Un(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?wl.createPortal(i.jsx(mU,{scope:e.__scopeSelect,children:i.jsx(Gy.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(pU,{...e,ref:t})});hU.displayName=xl;var $a=10,[mU,fs]=Xu(xl),wwe="SelectContentImpl",jwe=iwe("SelectContent.RemoveScroll"),pU=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w,...N}=e,A=ds(xl,n),[E,T]=y.useState(null),[C,k]=y.useState(null),O=qe(t,ee=>T(ee)),[M,I]=y.useState(null),[z,D]=y.useState(null),H=Yy(n),[V,F]=y.useState(!1),G=y.useRef(!1);y.useEffect(()=>{if(E)return Dy(E)},[E]),Py();const L=y.useCallback(ee=>{const[ae,...Z]=H().map(le=>le.ref.current),[pe]=Z.slice(-1),je=document.activeElement;for(const le of ee)if(le===je||(le?.scrollIntoView({block:"nearest"}),le===ae&&C&&(C.scrollTop=0),le===pe&&C&&(C.scrollTop=C.scrollHeight),le?.focus(),document.activeElement!==je))return},[H,C]),R=y.useCallback(()=>L([M,E]),[L,M,E]);y.useEffect(()=>{V&&R()},[V,R]);const{onOpenChange:U,triggerPointerDownPosRef:K}=A;y.useEffect(()=>{if(E){let ee={x:0,y:0};const ae=pe=>{ee={x:Math.abs(Math.round(pe.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(K.current?.y??0))}},Z=pe=>{ee.x<=10&&ee.y<=10?pe.preventDefault():E.contains(pe.target)||U(!1),document.removeEventListener("pointermove",ae),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",Z,{capture:!0})}}},[E,U,K]),y.useEffect(()=>{const ee=()=>U(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[U]);const[te,$]=MU(ee=>{const ae=H().filter(je=>!je.disabled),Z=ae.find(je=>je.ref.current===document.activeElement),pe=PU(ae,ee,Z);pe&&setTimeout(()=>pe.ref.current.focus())}),B=y.useCallback((ee,ae,Z)=>{const pe=!G.current&&!Z;(A.value!==void 0&&A.value===ae||pe)&&(I(ee),pe&&(G.current=!0))},[A.value]),Y=y.useCallback(()=>E?.focus(),[E]),ne=y.useCallback((ee,ae,Z)=>{const pe=!G.current&&!Z;(A.value!==void 0&&A.value===ae||pe)&&D(ee)},[A.value]),oe=r==="popper"?oC:vU,xe=oe===oC?{side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w}:{};return i.jsx(mU,{scope:n,content:E,viewport:C,onViewportChange:k,itemRefCallback:B,selectedItem:M,onItemLeave:Y,itemTextRefCallback:ne,focusSelectedItem:R,selectedItemText:z,position:r,isPositioned:V,searchRef:te,children:i.jsx(Uh,{as:jwe,allowPinchZoom:!0,children:i.jsx(Fh,{asChild:!0,trapped:A.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Se(a,ee=>{A.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:i.jsx(Ol,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:i.jsx(oe,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ee=>ee.preventDefault(),...N,...xe,onPlaced:()=>F(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Se(N.onKeyDown,ee=>{const ae=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ae&&ee.key.length===1&&$(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let pe=H().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const je=ee.target,le=pe.indexOf(je);pe=pe.slice(le+1)}setTimeout(()=>L(pe)),ee.preventDefault()}})})})})})})});pU.displayName=wwe;var Swe="SelectItemAlignedPosition",vU=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=ds(xl,n),l=fs(xl,n),[u,d]=y.useState(null),[f,m]=y.useState(null),p=qe(t,O=>m(O)),g=Yy(n),x=y.useRef(!1),j=y.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:N,focusSelectedItem:A}=l,E=y.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&f&&b&&w&&N){const O=o.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),I=o.valueNode.getBoundingClientRect(),z=N.getBoundingClientRect();if(o.dir!=="rtl"){const je=z.left-M.left,le=I.left-je,Re=O.left-le,_e=O.width+Re,me=Math.max(_e,M.width),ve=window.innerWidth-$a,Le=Ef(le,[$a,Math.max($a,ve-me)]);u.style.minWidth=_e+"px",u.style.left=Le+"px"}else{const je=M.right-z.right,le=window.innerWidth-I.right-je,Re=window.innerWidth-O.right-le,_e=O.width+Re,me=Math.max(_e,M.width),ve=window.innerWidth-$a,Le=Ef(le,[$a,Math.max($a,ve-me)]);u.style.minWidth=_e+"px",u.style.right=Le+"px"}const D=g(),H=window.innerHeight-$a*2,V=b.scrollHeight,F=window.getComputedStyle(f),G=parseInt(F.borderTopWidth,10),L=parseInt(F.paddingTop,10),R=parseInt(F.borderBottomWidth,10),U=parseInt(F.paddingBottom,10),K=G+L+V+U+R,te=Math.min(w.offsetHeight*5,K),$=window.getComputedStyle(b),B=parseInt($.paddingTop,10),Y=parseInt($.paddingBottom,10),ne=O.top+O.height/2-$a,oe=H-ne,xe=w.offsetHeight/2,ee=w.offsetTop+xe,ae=G+L+ee,Z=K-ae;if(ae<=ne){const je=D.length>0&&w===D[D.length-1].ref.current;u.style.bottom="0px";const le=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(oe,xe+(je?Y:0)+le+R),_e=ae+Re;u.style.height=_e+"px"}else{const je=D.length>0&&w===D[0].ref.current;u.style.top="0px";const Re=Math.max(ne,G+b.offsetTop+(je?B:0)+xe)+Z;u.style.height=Re+"px",b.scrollTop=ae-ne+b.offsetTop}u.style.margin=`${$a}px 0`,u.style.minHeight=te+"px",u.style.maxHeight=H+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,u,f,b,w,N,o.dir,r]);Un(()=>E(),[E]);const[T,C]=y.useState();Un(()=>{f&&C(window.getComputedStyle(f).zIndex)},[f]);const k=y.useCallback(O=>{O&&j.current===!0&&(E(),A?.(),j.current=!1)},[E,A]);return i.jsx(Nwe,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:i.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:i.jsx(Pe.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});vU.displayName=Swe;var _we="SelectPopperPosition",oC=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=$a,...o}=e,l=Ky(n);return i.jsx(Hy,{...l,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});oC.displayName=_we;var[Nwe,SE]=Xu(xl,{}),sC="SelectViewport",gU=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=fs(sC,n),l=SE(sC,n),u=qe(t,o.onViewportChange),d=y.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(Gy.Slot,{scope:n,children:i.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Se(a.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=l;if(g?.current&&p){const x=Math.abs(d.current-m.scrollTop);if(x>0){const j=window.innerHeight-$a*2,b=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),N=Math.max(b,w);if(N0?T:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});gU.displayName=sC;var yU="SelectGroup",[Cwe,Owe]=Xu(yU),Ewe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Fn();return i.jsx(Cwe,{scope:n,id:a,children:i.jsx(Pe.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Ewe.displayName=yU;var xU="SelectLabel",bU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Owe(xU,n);return i.jsx(Pe.div,{id:a.id,...r,ref:t})});bU.displayName=xU;var kg="SelectItem",[Awe,wU]=Xu(kg),jU=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...l}=e,u=ds(kg,n),d=fs(kg,n),f=u.value===r,[m,p]=y.useState(o??""),[g,x]=y.useState(!1),j=qe(t,A=>d.itemRefCallback?.(A,r,a)),b=Fn(),w=y.useRef("touch"),N=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Awe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:y.useCallback(A=>{p(E=>E||(A?.textContent??"").trim())},[]),children:i.jsx(Gy.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:i.jsx(Pe.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:j,onFocus:Se(l.onFocus,()=>x(!0)),onBlur:Se(l.onBlur,()=>x(!1)),onClick:Se(l.onClick,()=>{w.current!=="mouse"&&N()}),onPointerUp:Se(l.onPointerUp,()=>{w.current==="mouse"&&N()}),onPointerDown:Se(l.onPointerDown,A=>{w.current=A.pointerType}),onPointerMove:Se(l.onPointerMove,A=>{w.current=A.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,A=>{A.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Se(l.onKeyDown,A=>{d.searchRef?.current!==""&&A.key===" "||(mwe.includes(A.key)&&N(),A.key===" "&&A.preventDefault())})})})})});jU.displayName=kg;var hf="SelectItemText",SU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,l=ds(hf,n),u=fs(hf,n),d=wU(hf,n),f=ywe(hf,n),[m,p]=y.useState(null),g=qe(t,N=>p(N),d.onItemTextChange,N=>u.itemTextRefCallback?.(N,d.value,d.disabled)),x=m?.textContent,j=y.useMemo(()=>i.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=f;return Un(()=>(b(j),()=>w(j)),[b,w,j]),i.jsxs(i.Fragment,{children:[i.jsx(Pe.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?wl.createPortal(o.children,l.valueNode):null]})});SU.displayName=hf;var _U="SelectItemIndicator",NU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return wU(_U,n).isSelected?i.jsx(Pe.span,{"aria-hidden":!0,...r,ref:t}):null});NU.displayName=_U;var lC="SelectScrollUpButton",CU=y.forwardRef((e,t)=>{const n=fs(lC,e.__scopeSelect),r=SE(lC,e.__scopeSelect),[a,o]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?i.jsx(EU,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});CU.displayName=lC;var cC="SelectScrollDownButton",OU=y.forwardRef((e,t)=>{const n=fs(cC,e.__scopeSelect),r=SE(cC,e.__scopeSelect),[a,o]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?i.jsx(EU,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});OU.displayName=cC;var EU=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=fs("SelectScrollButton",n),l=y.useRef(null),u=Yy(n),d=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),Un(()=>{u().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),i.jsx(Pe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Se(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Se(a.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Se(a.onPointerLeave,()=>{d()})})}),Twe="SelectSeparator",AU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(Pe.div,{"aria-hidden":!0,...r,ref:t})});AU.displayName=Twe;var uC="SelectArrow",kwe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ky(n),o=ds(uC,n),l=fs(uC,n);return o.open&&l.position==="popper"?i.jsx(Wy,{...a,...r,ref:t}):null});kwe.displayName=uC;var Mwe="SelectBubbleInput",TU=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=y.useRef(null),o=qe(r,a),l=Ty(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),i.jsx(Pe.select,{...n,style:{...iU,...n.style},ref:o,defaultValue:t})});TU.displayName=Mwe;function kU(e){return e===""||e===void 0}function MU(e){const t=nn(e),n=y.useRef(""),r=y.useRef(0),a=y.useCallback(l=>{const u=n.current+l;t(u),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function PU(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Pwe(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Pwe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Rwe=oU,RU=lU,Dwe=uU,$we=dU,Iwe=fU,DU=hU,Lwe=gU,$U=bU,IU=jU,Bwe=SU,zwe=NU,LU=CU,BU=OU,zU=AU;const Et=Rwe,At=Dwe,wt=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(RU,{ref:r,className:de("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx($we,{asChild:!0,children:i.jsx(uh,{className:"h-4 w-4 opacity-50"})})]}));wt.displayName=RU.displayName;const qU=y.forwardRef(({className:e,...t},n)=>i.jsx(LU,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(FN,{className:"h-4 w-4"})}));qU.displayName=LU.displayName;const FU=y.forwardRef(({className:e,...t},n)=>i.jsx(BU,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(uh,{className:"h-4 w-4"})}));FU.displayName=BU.displayName;const jt=y.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>i.jsx(Iwe,{children:i.jsxs(DU,{ref:a,className:de("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(qU,{}),i.jsx(Lwe,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(FU,{})]})}));jt.displayName=DU.displayName;const qwe=y.forwardRef(({className:e,...t},n)=>i.jsx($U,{ref:n,className:de("px-2 py-1.5 text-sm font-semibold",e),...t}));qwe.displayName=$U.displayName;const Me=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(IU,{ref:r,className:de("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(zwe,{children:i.jsx(il,{className:"h-4 w-4"})})}),i.jsx(Bwe,{children:t})]}));Me.displayName=IU.displayName;const Fwe=y.forwardRef(({className:e,...t},n)=>i.jsx(zU,{ref:n,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));Fwe.displayName=zU.displayName;function Uwe(e){const t=Hwe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(Vwe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Hwe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=Ywe(a),u=Gwe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wwe=Symbol("radix.slottable");function Vwe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wwe}function Gwe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Ywe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xy="Popover",[UU]=hr(Xy,[us]),Gh=us(),[Kwe,hs]=UU(Xy),HU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!1}=e,u=Gh(t),d=y.useRef(null),[f,m]=y.useState(!1),[p,g]=Na({prop:r,defaultProp:a??!1,onChange:o,caller:Xy});return i.jsx(Wh,{...u,children:i.jsx(Kwe,{scope:t,contentId:Fn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:y.useCallback(()=>m(!0),[]),onCustomAnchorRemove:y.useCallback(()=>m(!1),[]),modal:l,children:n})})};HU.displayName=Xy;var WU="PopoverAnchor",Xwe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=hs(WU,n),o=Gh(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return y.useEffect(()=>(l(),()=>u()),[l,u]),i.jsx(Vh,{...o,...r,ref:t})});Xwe.displayName=WU;var VU="PopoverTrigger",GU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=hs(VU,n),o=Gh(n),l=qe(t,a.triggerRef),u=i.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":QU(a.open),...r,ref:l,onClick:Se(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:i.jsx(Vh,{asChild:!0,...o,children:u})});GU.displayName=VU;var _E="PopoverPortal",[Zwe,Qwe]=UU(_E,{forceMount:void 0}),YU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=hs(_E,t);return i.jsx(Zwe,{scope:t,forceMount:n,children:i.jsx(Rn,{present:n||o.open,children:i.jsx(El,{asChild:!0,container:a,children:r})})})};YU.displayName=_E;var Mu="PopoverContent",KU=y.forwardRef((e,t)=>{const n=Qwe(Mu,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=hs(Mu,e.__scopePopover);return i.jsx(Rn,{present:r||o.open,children:o.modal?i.jsx(eje,{...a,ref:t}):i.jsx(tje,{...a,ref:t})})});KU.displayName=Mu;var Jwe=Uwe("PopoverContent.RemoveScroll"),eje=y.forwardRef((e,t)=>{const n=hs(Mu,e.__scopePopover),r=y.useRef(null),a=qe(t,r),o=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return Dy(l)},[]),i.jsx(Uh,{as:Jwe,allowPinchZoom:!0,children:i.jsx(XU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{l.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Se(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),tje=y.forwardRef((e,t)=>{const n=hs(Mu,e.__scopePopover),r=y.useRef(!1),a=y.useRef(!1);return i.jsx(XU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),XU=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,...p}=e,g=hs(Mu,n),x=Gh(n);return Py(),i.jsx(Fh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:i.jsx(Ol,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:i.jsx(Hy,{"data-state":QU(g.open),role:"dialog",id:g.contentId,...x,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ZU="PopoverClose",nje=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=hs(ZU,n);return i.jsx(Pe.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});nje.displayName=ZU;var rje="PopoverArrow",aje=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gh(n);return i.jsx(Wy,{...a,...r,ref:t})});aje.displayName=rje;function QU(e){return e?"open":"closed"}var ije=HU,oje=GU,sje=YU,JU=KU;const ts=ije,ns=oje,so=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>i.jsx(sje,{children:i.jsx(JU,{ref:a,align:t,sideOffset:n,className:de("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));so.displayName=JU.displayName;const Zu="/api/webui/config";async function lje(){const t=await(await Qe(`${Zu}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function Mg(){const t=await(await Qe(`${Zu}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function cje(e){const n=await(await Qe(`${Zu}/bot`,{method:"POST",headers:lt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function eH(e){const n=await(await Qe(`${Zu}/model`,{method:"POST",headers:lt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function uje(e,t){const r=await(await Qe(`${Zu}/bot/section/${e}`,{method:"POST",headers:lt(),body:JSON.stringify(t)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${e} 失败`)}async function dC(e,t){const r=await(await Qe(`${Zu}/model/section/${e}`,{method:"POST",headers:lt(),body:JSON.stringify(t)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${e} 失败`)}function dje(){const[e,t]=y.useState(!0),[n,r]=y.useState(!1),[a,o]=y.useState(!1),[l,u]=y.useState(!1),{toast:d}=mr(),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,A]=y.useState(null),[E,T]=y.useState(null),[C,k]=y.useState(null),[O,M]=y.useState(null),[I,z]=y.useState(null),[D,H]=y.useState(null),[V,F]=y.useState(null),[G,L]=y.useState(null),[R,U]=y.useState(null),[K,te]=y.useState(null),[$,B]=y.useState(null),[Y,ne]=y.useState(null),[oe,xe]=y.useState(null),[ee,ae]=y.useState(null),Z=y.useRef(null),pe=y.useRef(!0),je=y.useRef({}),le=y.useCallback(async()=>{try{t(!0);const ve=await lje();je.current=ve,m(ve.bot),g(ve.personality);const Le=ve.chat;Le.talk_value_rules||(Le.talk_value_rules=[]),j(Le),w(ve.expression),A(ve.emoji),T(ve.memory),k(ve.tool),M(ve.mood),z(ve.voice),H(ve.lpmm_knowledge),F(ve.keyword_reaction),L(ve.response_post_process),U(ve.chinese_typo),te(ve.response_splitter),B(ve.log),ne(ve.debug),xe(ve.maim_message),ae(ve.telemetry),u(!1),pe.current=!1}catch(ve){console.error("加载配置失败:",ve),d({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[d]);y.useEffect(()=>{le()},[le]);const Re=y.useCallback(async(ve,Le)=>{if(!pe.current)try{o(!0),await uje(ve,Le),u(!1)}catch(It){console.error(`自动保存 ${ve} 失败:`,It),u(!0)}finally{o(!1)}},[]),_e=y.useCallback((ve,Le)=>{pe.current||(u(!0),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{Re(ve,Le)},2e3))},[Re]);y.useEffect(()=>{f&&!pe.current&&_e("bot",f)},[f,_e]),y.useEffect(()=>{p&&!pe.current&&_e("personality",p)},[p,_e]),y.useEffect(()=>{x&&!pe.current&&_e("chat",x)},[x,_e]),y.useEffect(()=>{b&&!pe.current&&_e("expression",b)},[b,_e]),y.useEffect(()=>{N&&!pe.current&&_e("emoji",N)},[N,_e]),y.useEffect(()=>{E&&!pe.current&&_e("memory",E)},[E,_e]),y.useEffect(()=>{C&&!pe.current&&_e("tool",C)},[C,_e]),y.useEffect(()=>{O&&!pe.current&&_e("mood",O)},[O,_e]),y.useEffect(()=>{I&&!pe.current&&_e("voice",I)},[I,_e]),y.useEffect(()=>{D&&!pe.current&&_e("lpmm_knowledge",D)},[D,_e]),y.useEffect(()=>{V&&!pe.current&&_e("keyword_reaction",V)},[V,_e]),y.useEffect(()=>{G&&!pe.current&&_e("response_post_process",G)},[G,_e]),y.useEffect(()=>{R&&!pe.current&&_e("chinese_typo",R)},[R,_e]),y.useEffect(()=>{K&&!pe.current&&_e("response_splitter",K)},[K,_e]),y.useEffect(()=>{$&&!pe.current&&_e("log",$)},[$,_e]),y.useEffect(()=>{Y&&!pe.current&&_e("debug",Y)},[Y,_e]),y.useEffect(()=>{oe&&!pe.current&&_e("maim_message",oe)},[oe,_e]),y.useEffect(()=>{ee&&!pe.current&&_e("telemetry",ee)},[ee,_e]);const me=async()=>{try{r(!0),Z.current&&clearTimeout(Z.current);const ve={...je.current,bot:f,personality:p,chat:x,expression:b,emoji:N,memory:E,tool:C,mood:O,voice:I,lpmm_knowledge:D,keyword_reaction:V,response_post_process:G,chinese_typo:R,response_splitter:K,log:$,debug:Y,maim_message:oe,telemetry:ee};await cje(ve),u(!1),d({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(ve){console.error("保存配置失败:",ve),d({title:"保存失败",description:ve.message,variant:"destructive"})}finally{r(!1)}};return e?i.jsx(Vt,{className:"h-full",children:i.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):i.jsx(Vt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),i.jsxs(ue,{onClick:me,disabled:n||a||!l,size:"sm",className:"w-full sm:w-auto",children:[i.jsx(ZO,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":a?"自动保存中...":l?"保存配置":"已保存"]})]}),i.jsxs(ul,{defaultValue:"bot",className:"w-full",children:[i.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:i.jsxs(Qo,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[i.jsx(Ot,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),i.jsx(Ot,{value:"personality",className:"flex-shrink-0",children:"人格"}),i.jsx(Ot,{value:"chat",className:"flex-shrink-0",children:"聊天"}),i.jsx(Ot,{value:"expression",className:"flex-shrink-0",children:"表达"}),i.jsx(Ot,{value:"features",className:"flex-shrink-0",children:"功能"}),i.jsx(Ot,{value:"processing",className:"flex-shrink-0",children:"处理"}),i.jsx(Ot,{value:"mood",className:"flex-shrink-0",children:"情绪"}),i.jsx(Ot,{value:"voice",className:"flex-shrink-0",children:"语音"}),i.jsx(Ot,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),i.jsx(Ot,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),i.jsx(en,{value:"bot",className:"space-y-4",children:f&&i.jsx(fje,{config:f,onChange:m})}),i.jsx(en,{value:"personality",className:"space-y-4",children:p&&i.jsx(hje,{config:p,onChange:g})}),i.jsx(en,{value:"chat",className:"space-y-4",children:x&&i.jsx(mje,{config:x,onChange:j})}),i.jsx(en,{value:"expression",className:"space-y-4",children:b&&i.jsx(pje,{config:b,onChange:w})}),i.jsx(en,{value:"features",className:"space-y-4",children:N&&E&&C&&i.jsx(vje,{emojiConfig:N,memoryConfig:E,toolConfig:C,onEmojiChange:A,onMemoryChange:T,onToolChange:k})}),i.jsx(en,{value:"processing",className:"space-y-4",children:V&&G&&R&&K&&i.jsx(gje,{keywordReactionConfig:V,responsePostProcessConfig:G,chineseTypoConfig:R,responseSplitterConfig:K,onKeywordReactionChange:F,onResponsePostProcessChange:L,onChineseTypoChange:U,onResponseSplitterChange:te})}),i.jsx(en,{value:"mood",className:"space-y-4",children:O&&i.jsx(yje,{config:O,onChange:M})}),i.jsx(en,{value:"voice",className:"space-y-4",children:I&&i.jsx(xje,{config:I,onChange:z})}),i.jsx(en,{value:"lpmm",className:"space-y-4",children:D&&i.jsx(bje,{config:D,onChange:H})}),i.jsxs(en,{value:"other",className:"space-y-4",children:[$&&i.jsx(wje,{config:$,onChange:B}),Y&&i.jsx(jje,{config:Y,onChange:ne}),oe&&i.jsx(Sje,{config:oe,onChange:xe}),ee&&i.jsx(_je,{config:ee,onChange:ae})]})]})]})})}function fje({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},r=d=>{t({...e,platforms:e.platforms.filter((f,m)=>m!==d)})},a=(d,f)=>{const m=[...e.platforms];m[d]=f,t({...e,platforms:m})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},l=d=>{t({...e,alias_names:e.alias_names.filter((f,m)=>m!==d)})},u=(d,f)=>{const m=[...e.alias_names];m[d]=f,t({...e,alias_names:m})};return i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"platform",children:"平台"}),i.jsx(Ne,{id:"platform",value:e.platform,onChange:d=>t({...e,platform:d.target.value}),placeholder:"qq"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"qq_account",children:"QQ账号"}),i.jsx(Ne,{id:"qq_account",value:e.qq_account,onChange:d=>t({...e,qq_account:d.target.value}),placeholder:"123456789"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"nickname",children:"昵称"}),i.jsx(Ne,{id:"nickname",value:e.nickname,onChange:d=>t({...e,nickname:d.target.value}),placeholder:"麦麦"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{children:"其他平台账号"}),i.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),i.jsxs("div",{className:"space-y-2",children:[e.platforms.map((d,f)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{value:d,onChange:m=>a(f,m.target.value),placeholder:"wx:114514"}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"icon",variant:"outline",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除平台账号 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{children:"别名"}),i.jsxs(ue,{onClick:o,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),i.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((d,f)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{value:d,onChange:m=>u(f,m.target.value),placeholder:"小麦"}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"icon",variant:"outline",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除别名 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>l(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function hje({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},r=o=>{t({...e,states:e.states.filter((l,u)=>u!==o)})},a=(o,l)=>{const u=[...e.states];u[o]=l,t({...e,states:u})};return i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"personality",children:"人格特质"}),i.jsx(Wt,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"reply_style",children:"表达风格"}),i.jsx(Wt,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"interest",children:"兴趣"}),i.jsx(Wt,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"plan_style",children:"说话规则与行为风格"}),i.jsx(Wt,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"visual_style",children:"识图规则"}),i.jsx(Wt,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"private_plan_style",children:"私聊规则"}),i.jsx(Wt,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{children:"状态列表(人格多样性)"}),i.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),i.jsx("div",{className:"space-y-2",children:e.states.map((o,l)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Wt,{value:o,onChange:u=>a(l,u.target.value),placeholder:"描述一个人格状态",rows:2}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"icon",variant:"outline",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsx(jn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"state_probability",children:"状态替换概率"}),i.jsx(Ne,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:o=>t({...e,state_probability:parseFloat(o.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function mje({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=u=>{t({...e,talk_value_rules:e.talk_value_rules.filter((d,f)=>f!==u)})},a=(u,d,f)=>{const m=[...e.talk_value_rules];m[u]={...m[u],[d]:f},t({...e,talk_value_rules:m})},o=({value:u,onChange:d})=>{const[f,m]=y.useState("00"),[p,g]=y.useState("00"),[x,j]=y.useState("23"),[b,w]=y.useState("59");y.useEffect(()=>{const A=u.split("-");if(A.length===2){const[E,T]=A,[C,k]=E.split(":"),[O,M]=T.split(":");C&&m(C.padStart(2,"0")),k&&g(k.padStart(2,"0")),O&&j(O.padStart(2,"0")),M&&w(M.padStart(2,"0"))}},[u]);const N=(A,E,T,C)=>{const k=`${A}:${E}-${T}:${C}`;d(k)};return i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[i.jsx(ol,{className:"h-4 w-4 mr-2"}),u||"选择时间段"]})}),i.jsx(so,{className:"w-80",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"小时"}),i.jsxs(Et,{value:f,onValueChange:A=>{m(A),N(A,p,x,b)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:24},(A,E)=>E).map(A=>i.jsx(Me,{value:A.toString().padStart(2,"0"),children:A.toString().padStart(2,"0")},A))})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"分钟"}),i.jsxs(Et,{value:p,onValueChange:A=>{g(A),N(f,A,x,b)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:60},(A,E)=>E).map(A=>i.jsx(Me,{value:A.toString().padStart(2,"0"),children:A.toString().padStart(2,"0")},A))})]})]})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"小时"}),i.jsxs(Et,{value:x,onValueChange:A=>{j(A),N(f,p,A,b)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:24},(A,E)=>E).map(A=>i.jsx(Me,{value:A.toString().padStart(2,"0"),children:A.toString().padStart(2,"0")},A))})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"分钟"}),i.jsxs(Et,{value:b,onValueChange:A=>{w(A),N(f,p,x,A)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:60},(A,E)=>E).map(A=>i.jsx(Me,{value:A.toString().padStart(2,"0"),children:A.toString().padStart(2,"0")},A))})]})]})]})]})]})})]})},l=({rule:u})=>{const d=`{ target = "${u.target}", time = "${u.time}", value = ${u.value.toFixed(1)} }`;return i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",children:[i.jsx(Ua,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-96",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:d}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),i.jsx(Ne,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:u=>t({...e,talk_value:parseFloat(u.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),i.jsx(Ne,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:u=>t({...e,mentioned_bot_reply:parseFloat(u.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_context_size",children:"上下文长度"}),i.jsx(Ne,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:u=>t({...e,max_context_size:parseInt(u.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"planner_smooth",children:"规划器平滑"}),i.jsx(Ne,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:u=>t({...e,planner_smooth:parseFloat(u.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:u=>t({...e,enable_talk_value_rules:u})}),i.jsx(J,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:u=>t({...e,include_planner_reasoning:u})}),i.jsx(J,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&i.jsxs("div",{className:"border-t pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),i.jsxs(ue,{onClick:n,size:"sm",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?i.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((u,d)=>i.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",d+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(l,{rule:u}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"sm",children:i.jsx(Tt,{className:"h-4 w-4 text-destructive"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除规则 #",d+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(d),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"配置类型"}),i.jsxs(Et,{value:u.target===""?"global":"specific",onValueChange:f=>{f==="global"?a(d,"target",""):a(d,"target","qq::group")},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"global",children:"全局配置"}),i.jsx(Me,{value:"specific",children:"详细配置"})]})]})]}),u.target!==""&&(()=>{const f=u.target.split(":"),m=f[0]||"qq",p=f[1]||"",g=f[2]||"group";return i.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"平台"}),i.jsxs(Et,{value:m,onValueChange:x=>{a(d,"target",`${x}:${p}:${g}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"qq",children:"QQ"}),i.jsx(Me,{value:"wx",children:"微信"})]})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"群 ID"}),i.jsx(Ne,{value:p,onChange:x=>{a(d,"target",`${m}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"类型"}),i.jsxs(Et,{value:g,onValueChange:x=>{a(d,"target",`${m}:${p}:${x}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"group",children:"群组(group)"}),i.jsx(Me,{value:"private",children:"私聊(private)"})]})]})]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",u.target||"(未设置)"]})]})})(),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"时间段 (Time)"}),i.jsx(o,{value:u.time,onChange:f=>a(d,"time",f)}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{htmlFor:`rule-value-${d}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),i.jsx(Ne,{id:`rule-value-${d}`,type:"number",step:"0.01",min:"0",max:"1",value:u.value,onChange:f=>{const m=parseFloat(f.target.value);isNaN(m)||a(d,"value",Math.max(0,Math.min(1,m)))},className:"w-20 h-8 text-xs"})]}),i.jsx(mE,{value:[u.value],onValueChange:f=>a(d,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:"0 (完全沉默)"}),i.jsx("span",{children:"0.5"}),i.jsx("span",{children:"1.0 (正常)"})]})]})]})]},d))}):i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:i.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),i.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[i.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),i.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function pje({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},r=g=>{t({...e,learning_list:e.learning_list.filter((x,j)=>j!==g)})},a=(g,x,j)=>{const b=[...e.learning_list];b[g][x]=j,t({...e,learning_list:b})},o=({rule:g})=>{const x=`["${g[0]}", "${g[1]}", "${g[2]}", "${g[3]}"]`;return i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",children:[i.jsx(Ua,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-96",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:x}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=({member:g,groupIndex:x,memberIndex:j,availableChatIds:b})=>{const w=b.includes(g)||g==="*",[N,A]=y.useState(!w);return i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{className:"flex-1 flex gap-2",children:N?i.jsxs(i.Fragment,{children:[i.jsx(Ne,{value:g,onChange:E=>p(x,j,E.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),b.length>0&&i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>A(!1),title:"切换到下拉选择",children:"下拉"})]}):i.jsxs(i.Fragment,{children:[i.jsxs(Et,{value:g,onValueChange:E=>p(x,j,E),children:[i.jsx(wt,{className:"flex-1",children:i.jsx(At,{placeholder:"选择聊天流"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"*",children:"* (全局共享)"}),b.map((E,T)=>i.jsx(Me,{value:E,children:E},T))]})]}),i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>A(!0),title:"切换到手动输入",children:"输入"})]})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"icon",variant:"outline",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除组成员 "',g||"(空)",'" 吗?此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>m(x,j),children:"删除"})]})]})]})]})},u=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},d=g=>{t({...e,expression_groups:e.expression_groups.filter((x,j)=>j!==g)})},f=g=>{const x=[...e.expression_groups];x[g]=[...x[g],""],t({...e,expression_groups:x})},m=(g,x)=>{const j=[...e.expression_groups];j[g]=j[g].filter((b,w)=>w!==x),t({...e,expression_groups:j})},p=(g,x,j)=>{const b=[...e.expression_groups];b[g][x]=j,t({...e,expression_groups:b})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),i.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),i.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((g,x)=>{const j=e.learning_list.some((T,C)=>C!==x&&T[0]===""),b=g[0]==="",w=g[0].split(":"),N=w[0]||"qq",A=w[1]||"",E=w[2]||"group";return i.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["规则 ",x+1," ",b&&"(全局配置)"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(o,{rule:g}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"sm",variant:"ghost",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除学习规则 ",x+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(x),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"配置类型"}),i.jsxs(Et,{value:b?"global":"specific",onValueChange:T=>{T==="global"?a(x,0,""):a(x,0,"qq::group")},disabled:j&&!b,children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"global",children:"全局配置"}),i.jsx(Me,{value:"specific",disabled:j&&!b,children:"详细配置"})]})]}),j&&!b&&i.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!b&&i.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"平台"}),i.jsxs(Et,{value:N,onValueChange:T=>{a(x,0,`${T}:${A}:${E}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"qq",children:"QQ"}),i.jsx(Me,{value:"wx",children:"微信"})]})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"群 ID"}),i.jsx(Ne,{value:A,onChange:T=>{a(x,0,`${N}:${T.target.value}:${E}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"类型"}),i.jsxs(Et,{value:E,onValueChange:T=>{a(x,0,`${N}:${A}:${T}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"group",children:"群组(group)"}),i.jsx(Me,{value:"private",children:"私聊(private)"})]})]})]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",g[0]||"(未设置)"]})]}),i.jsx("div",{className:"grid gap-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs font-medium",children:"使用学到的表达"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),i.jsx(at,{checked:g[1]==="enable",onCheckedChange:T=>a(x,1,T?"enable":"disable")})]})}),i.jsx("div",{className:"grid gap-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs font-medium",children:"学习表达"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),i.jsx(at,{checked:g[2]==="enable",onCheckedChange:T=>a(x,2,T?"enable":"disable")})]})}),i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{className:"text-xs font-medium",children:"学习强度"}),i.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"5",value:g[3],onChange:T=>{const C=parseFloat(T.target.value);isNaN(C)||a(x,3,Math.max(0,Math.min(5,C)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),i.jsx(mE,{value:[parseFloat(g[3])||1],onValueChange:T=>a(x,3,T[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:"0 (不学习)"}),i.jsx("span",{children:"2.5"}),i.jsx("span",{children:"5.0 (快速学习)"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},x)}),e.learning_list.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),i.jsxs(ue,{onClick:u,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),i.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((g,x)=>{const j=e.learning_list.map(b=>b[0]).filter(b=>b!=="");return i.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",x+1,g.length===1&&g[0]==="*"&&"(全局共享)"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{onClick:()=>f(x),size:"sm",variant:"outline",children:i.jsx(tr,{className:"h-4 w-4"})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"sm",variant:"ghost",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除共享组 ",x+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>d(x),children:"删除"})]})]})]})]})]}),i.jsx("div",{className:"space-y-2",children:g.map((b,w)=>i.jsx(l,{member:b,groupIndex:x,memberIndex:w,availableChatIds:j},w))}),i.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},x)}),e.expression_groups.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function vje({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:r,onMemoryChange:a,onToolChange:o}){return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:l=>o({...n,enable_tool:l})}),i.jsx(J,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),i.jsx(Ne,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:l=>a({...t,max_agent_iterations:parseInt(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"emoji_chance",children:"表情包激活概率"}),i.jsx(Ne,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:l=>r({...e,emoji_chance:parseFloat(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_reg_num",children:"最大注册数量"}),i.jsx(Ne,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:l=>r({...e,max_reg_num:parseInt(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),i.jsx(Ne,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:l=>r({...e,check_interval:parseInt(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"do_replace",checked:e.do_replace,onCheckedChange:l=>r({...e,do_replace:l})}),i.jsx(J,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:l=>r({...e,steal_emoji:l})}),i.jsx(J,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),i.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:l=>r({...e,content_filtration:l})}),i.jsx(J,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&i.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[i.jsx(J,{htmlFor:"filtration_prompt",children:"过滤要求"}),i.jsx(Ne,{id:"filtration_prompt",value:e.filtration_prompt,onChange:l=>r({...e,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function gje({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:a,onResponsePostProcessChange:o,onChineseTypoChange:l,onResponseSplitterChange:u}){const d=()=>{a({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=T=>{a({...e,regex_rules:e.regex_rules.filter((C,k)=>k!==T)})},m=(T,C,k)=>{const O=[...e.regex_rules];C==="regex"&&typeof k=="string"?O[T]={...O[T],regex:[k]}:C==="reaction"&&typeof k=="string"&&(O[T]={...O[T],reaction:k}),a({...e,regex_rules:O})},p=({regex:T,reaction:C,onRegexChange:k,onReactionChange:O})=>{const[M,I]=y.useState(!1),[z,D]=y.useState(""),[H,V]=y.useState(null),[F,G]=y.useState(""),[L,R]=y.useState({}),[U,K]=y.useState(""),te=y.useRef(null),[$,B]=y.useState("build"),Y=ee=>ee.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),ne=(ee,ae=0)=>{const Z=te.current;if(!Z)return;const pe=Z.selectionStart||0,je=Z.selectionEnd||0,le=T.substring(0,pe)+ee+T.substring(je);k(le),setTimeout(()=>{const Re=pe+ee.length+ae;Z.setSelectionRange(Re,Re),Z.focus()},0)};y.useEffect(()=>{if(!T||!z){V(null),R({}),K(C),G("");return}try{const ee=Y(T),ae=new RegExp(ee,"g"),Z=z.match(ae);V(Z),G("");const je=new RegExp(ee).exec(z);if(je&&je.groups){R(je.groups);let le=C;Object.entries(je.groups).forEach(([Re,_e])=>{le=le.replace(new RegExp(`\\[${Re}\\]`,"g"),_e||"")}),K(le)}else R({}),K(C)}catch(ee){G(ee.message),V(null),R({}),K(C)}},[T,z,C]);const oe=()=>{if(!z||!H||H.length===0)return i.jsx("span",{className:"text-muted-foreground",children:z||"请输入测试文本"});try{const ee=Y(T),ae=new RegExp(ee,"g");let Z=0;const pe=[];let je;for(;(je=ae.exec(z))!==null;)je.index>Z&&pe.push(i.jsx("span",{children:z.substring(Z,je.index)},`text-${Z}`)),pe.push(i.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:je[0]},`match-${je.index}`)),Z=je.index+je[0].length;return Z)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return i.jsxs(nr,{open:M,onOpenChange:I,children:[i.jsx(WF,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",children:[i.jsx(wg,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),i.jsxs(Hn,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"正则表达式编辑器"}),i.jsx(dr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),i.jsx(Vt,{className:"max-h-[calc(90vh-120px)]",children:i.jsxs(ul,{value:$,onValueChange:ee=>B(ee),className:"w-full",children:[i.jsxs(Qo,{className:"grid w-full grid-cols-2",children:[i.jsx(Ot,{value:"build",children:"🔧 构建器"}),i.jsx(Ot,{value:"test",children:"🧪 测试器"})]}),i.jsxs(en,{value:"build",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"正则表达式"}),i.jsx(Ne,{ref:te,value:T,onChange:ee=>k(ee.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"Reaction 内容"}),i.jsx(Wt,{value:C,onChange:ee=>O(ee.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),i.jsxs("div",{className:"space-y-4 border-t pt-4",children:[xe.map(ee=>i.jsxs("div",{className:"space-y-2",children:[i.jsx("h5",{className:"text-xs font-semibold text-primary",children:ee.category}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ee.items.map(ae=>i.jsx(ue,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>ne(ae.pattern,ae.moveCursor||0),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsxs("div",{className:"flex items-center gap-2 w-full",children:[i.jsx("span",{className:"text-xs font-medium",children:ae.label}),i.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ae.pattern})]}),i.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ae.desc})]})},ae.label))})]},ee.category)),i.jsxs("div",{className:"space-y-2 border-t pt-4",children:[i.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("^(?P\\S{1,20})是这样的$"),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),i.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),i.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),i.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),i.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?P.+?)(?:是|为什么|怎么)"),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),i.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),i.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[i.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),i.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),i.jsxs("li",{children:["命名捕获组格式:",i.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),i.jsxs("li",{children:["在 reaction 中使用 ",i.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),i.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),i.jsxs(en,{value:"test",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"当前正则表达式"}),i.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),i.jsx(Wt,{id:"test-text",value:z,onChange:ee=>D(ee.target.value),placeholder:`在此输入要测试的文本... -例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),F&&i.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[i.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),i.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:F})]}),!F&&z&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"flex items-center gap-2",children:H&&H.length>0?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),i.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",H.length," 处)"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),i.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"匹配高亮"}),i.jsx(Vt,{className:"h-40 rounded-md bg-muted p-3",children:i.jsx("div",{className:"text-sm break-words",children:oe()})})]}),Object.keys(L).length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"命名捕获组"}),i.jsx(Vt,{className:"h-32 rounded-md border p-3",children:i.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([ee,ae])=>i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ee,"]"]}),i.jsx("span",{className:"text-muted-foreground",children:"="}),i.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ae})]},ee))})})]}),Object.keys(L).length>0&&C&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"Reaction 替换预览"}),i.jsx(Vt,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:i.jsx("div",{className:"text-sm break-words",children:U})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),i.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[i.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),i.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),i.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),i.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),i.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{a({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},x=T=>{a({...e,keyword_rules:e.keyword_rules.filter((C,k)=>k!==T)})},j=(T,C,k)=>{const O=[...e.keyword_rules];typeof k=="string"&&(O[T]={...O[T],reaction:k}),a({...e,keyword_rules:O})},b=T=>{const C=[...e.keyword_rules];C[T]={...C[T],keywords:[...C[T].keywords||[],""]},a({...e,keyword_rules:C})},w=(T,C)=>{const k=[...e.keyword_rules];k[T]={...k[T],keywords:(k[T].keywords||[]).filter((O,M)=>M!==C)},a({...e,keyword_rules:k})},N=(T,C,k)=>{const O=[...e.keyword_rules],M=[...O[T].keywords||[]];M[C]=k,O[T]={...O[T],keywords:M},a({...e,keyword_rules:O})},A=({rule:T})=>{const C=`{ regex = [${(T.regex||[]).map(k=>`"${k}"`).join(", ")}], reaction = "${T.reaction}" }`;return i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",children:[i.jsx(Ua,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-[95vw] sm:w-[500px]",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx(Vt,{className:"h-60 rounded-md bg-muted p-3",children:i.jsx("pre",{className:"font-mono text-xs break-all",children:C})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},E=({rule:T})=>{const C=`[[keyword_reaction.keyword_rules]] -keywords = [${(T.keywords||[]).map(k=>`"${k}"`).join(", ")}] -reaction = "${T.reaction}"`;return i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",children:[i.jsx(Ua,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-[95vw] sm:w-[500px]",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx(Vt,{className:"h-60 rounded-md bg-muted p-3",children:i.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:C})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),i.jsxs(ue,{onClick:d,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),i.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((T,C)=>i.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",C+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(p,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:k=>m(C,"regex",k),onReactionChange:k=>m(C,"reaction",k)}),i.jsx(A,{rule:T}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"sm",variant:"ghost",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除正则规则 ",C+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>f(C),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),i.jsx(Ne,{value:T.regex&&T.regex[0]||"",onChange:k=>m(C,"regex",k.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"反应内容"}),i.jsx(Wt,{value:T.reaction,onChange:k=>m(C,"reaction",k.target.value),placeholder:`触发后麦麦的反应... -可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},C)),e.regex_rules.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),i.jsxs("div",{className:"space-y-4 border-t pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),i.jsxs(ue,{onClick:g,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),i.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((T,C)=>i.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",C+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(E,{rule:T}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(ue,{size:"sm",variant:"ghost",children:i.jsx(Tt,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除关键词规则 ",C+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>x(C),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{className:"text-xs font-medium",children:"关键词列表"}),i.jsxs(ue,{onClick:()=>b(C),size:"sm",variant:"ghost",children:[i.jsx(tr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),i.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((k,O)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ne,{value:k,onChange:M=>N(C,O,M.target.value),placeholder:"关键词",className:"flex-1"}),i.jsx(ue,{onClick:()=>w(C,O),size:"sm",variant:"ghost",children:i.jsx(Tt,{className:"h-4 w-4"})})]},O)),(!T.keywords||T.keywords.length===0)&&i.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"反应内容"}),i.jsx(Wt,{value:T.reaction,onChange:k=>j(C,"reaction",k.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},C)),e.keyword_rules.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:T=>o({...t,enable_response_post_process:T})}),i.jsx(J,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"border-t pt-6 space-y-4",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[i.jsx(at,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>l({...n,enable:T})}),i.jsx(J,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&i.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),i.jsx(Ne,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:T=>l({...n,error_rate:parseFloat(T.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),i.jsx(Ne,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>l({...n,min_freq:parseInt(T.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),i.jsx(Ne,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:T=>l({...n,tone_error_rate:parseFloat(T.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),i.jsx(Ne,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:T=>l({...n,word_replace_rate:parseFloat(T.target.value)})})]})]})]})}),i.jsx("div",{className:"border-t pt-6 space-y-4",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[i.jsx(at,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>u({...r,enable:T})}),i.jsx(J,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&i.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),i.jsx(Ne,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>u({...r,max_length:parseInt(T.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),i.jsx(Ne,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>u({...r,max_sentence_num:parseInt(T.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>u({...r,enable_kaomoji_protection:T})}),i.jsx(J,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>u({...r,enable_overflow_return_all:T})}),i.jsx(J,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),i.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function yje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),i.jsx(J,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"情绪更新阈值"}),i.jsx(Ne,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"情感特征"}),i.jsx(Wt,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function xje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),i.jsx(J,{className:"cursor-pointer",children:"启用语音识别"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function bje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),i.jsx(J,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"LPMM 模式"}),i.jsxs(Et,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[i.jsx(wt,{children:i.jsx(At,{placeholder:"选择 LPMM 模式"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"classic",children:"经典模式"}),i.jsx(Me,{value:"agent",children:"Agent 模式"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"同义词搜索 TopK"}),i.jsx(Ne,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"同义词阈值"}),i.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"实体提取线程数"}),i.jsx(Ne,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"嵌入向量维度"}),i.jsx(Ne,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function wje({config:e,onChange:t}){const[n,r]=y.useState(""),[a,o]=y.useState("WARNING"),l=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),r(""))},u=x=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==x)})},d=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:a}}),r(""),o("WARNING"))},f=x=>{const j={...e.library_log_levels};delete j[x],t({...e,library_log_levels:j})},m=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],p=["FULL","compact","lite"],g=["none","title","full"];return i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"日期格式"}),i.jsx(Ne,{value:e.date_style,onChange:x=>t({...e,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"日志级别样式"}),i.jsxs(Et,{value:e.log_level_style,onValueChange:x=>t({...e,log_level_style:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:p.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"日志文本颜色"}),i.jsxs(Et,{value:e.color_text,onValueChange:x=>t({...e,color_text:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:g.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"全局日志级别"}),i.jsxs(Et,{value:e.log_level,onValueChange:x=>t({...e,log_level:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"控制台日志级别"}),i.jsxs(Et,{value:e.console_log_level,onValueChange:x=>t({...e,console_log_level:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"文件日志级别"}),i.jsxs(Et,{value:e.file_log_level,onValueChange:x=>t({...e,file_log_level:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"mb-2 block",children:"完全屏蔽的库"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(Ne,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),l())}}),i.jsx(ue,{onClick:l,size:"sm",className:"flex-shrink-0",children:i.jsx(tr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(x=>i.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[i.jsx("span",{className:"text-sm",children:x}),i.jsx(ue,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>u(x),children:i.jsx(Tt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),i.jsxs("div",{children:[i.jsx(J,{className:"mb-2 block",children:"特定库的日志级别"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(Ne,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),i.jsxs(Et,{value:a,onValueChange:o,children:[i.jsx(wt,{className:"w-32",children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]}),i.jsx(ue,{onClick:d,size:"sm",children:i.jsx(tr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),i.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([x,j])=>i.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[i.jsx("span",{className:"text-sm font-medium",children:x}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:j}),i.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(x),children:i.jsx(Tt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function jje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示 Prompt"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),i.jsx(at,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示回复器 Prompt"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),i.jsx(at,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示回复器推理"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),i.jsx(at,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示 Jargon Prompt"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),i.jsx(at,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function Sje({config:e,onChange:t}){const[n,r]=y.useState(""),a=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),r(""))},o=l=>{t({...e,auth_token:e.auth_token.filter((u,d)=>d!==l)})};return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"启用自定义服务器"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),i.jsx(at,{checked:e.use_custom,onCheckedChange:l=>t({...e,use_custom:l})})]}),e.use_custom&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"主机地址"}),i.jsx(Ne,{value:e.host,onChange:l=>t({...e,host:l.target.value}),placeholder:"127.0.0.1"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"端口号"}),i.jsx(Ne,{type:"number",value:e.port,onChange:l=>t({...e,port:parseInt(l.target.value)}),placeholder:"8090"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"连接模式"}),i.jsxs(Et,{value:e.mode,onValueChange:l=>t({...e,mode:l}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"ws",children:"WebSocket (ws)"}),i.jsx(Me,{value:"tcp",children:"TCP"})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.use_wss,onCheckedChange:l=>t({...e,use_wss:l}),disabled:e.mode!=="ws"}),i.jsx(J,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"SSL 证书文件路径"}),i.jsx(Ne,{value:e.cert_file,onChange:l=>t({...e,cert_file:l.target.value}),placeholder:"cert.pem"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"SSL 密钥文件路径"}),i.jsx(Ne,{value:e.key_file,onChange:l=>t({...e,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"mb-2 block",children:"认证令牌"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(Ne,{value:n,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())}}),i.jsx(ue,{onClick:a,size:"sm",children:i.jsx(tr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),i.jsx("div",{className:"space-y-2",children:e.auth_token.map((l,u)=>i.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[i.jsx("span",{className:"text-sm font-mono",children:l}),i.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(u),children:i.jsx(Tt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},u))})]})]})}function _je({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"启用统计信息发送"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),i.jsx(at,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const Al=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:n,className:de("w-full caption-bottom text-sm",e),...t})}));Al.displayName="Table";const Tl=y.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:de("[&_tr]:border-b",e),...t}));Tl.displayName="TableHeader";const kl=y.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:de("[&_tr:last-child]:border-0",e),...t}));kl.displayName="TableBody";const Nje=y.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:de("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Nje.displayName="TableFooter";const vn=y.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:de("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));vn.displayName="TableRow";const Ze=y.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:de("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ze.displayName="TableHead";const Ue=y.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:de("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ue.displayName="TableCell";const Cje=y.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:de("mt-4 text-sm text-muted-foreground",e),...t}));Cje.displayName="TableCaption";var Zy="Checkbox",[Oje]=hr(Zy),[Eje,NE]=Oje(Zy);function Aje(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:l,name:u,onCheckedChange:d,required:f,value:m="on",internal_do_not_use_render:p}=e,[g,x]=Na({prop:n,defaultProp:a??!1,onChange:d,caller:Zy}),[j,b]=y.useState(null),[w,N]=y.useState(null),A=y.useRef(!1),E=j?!!l||!!j.closest("form"):!0,T={checked:g,disabled:o,setChecked:x,control:j,setControl:b,name:u,form:l,value:m,hasConsumerStoppedPropagationRef:A,required:f,defaultChecked:Zo(a)?!1:a,isFormControl:E,bubbleInput:w,setBubbleInput:N};return i.jsx(Eje,{scope:t,...T,children:Tje(p)?p(T):r})}var tH="CheckboxTrigger",nH=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:l,disabled:u,checked:d,required:f,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:j}=NE(tH,e),b=qe(a,m),w=y.useRef(d);return y.useEffect(()=>{const N=o?.form;if(N){const A=()=>p(w.current);return N.addEventListener("reset",A),()=>N.removeEventListener("reset",A)}},[o,p]),i.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":Zo(d)?"mixed":d,"aria-required":f,"data-state":sH(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:b,onKeyDown:Se(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:Se(n,N=>{p(A=>Zo(A)?!0:!A),j&&x&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})})});nH.displayName=tH;var CE=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:f,form:m,...p}=e;return i.jsx(Aje,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:u,required:l,onCheckedChange:f,name:r,form:m,value:d,internal_do_not_use_render:({isFormControl:g})=>i.jsxs(i.Fragment,{children:[i.jsx(nH,{...p,ref:t,__scopeCheckbox:n}),g&&i.jsx(oH,{__scopeCheckbox:n})]})})});CE.displayName=Zy;var rH="CheckboxIndicator",aH=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=NE(rH,n);return i.jsx(Rn,{present:r||Zo(o.checked)||o.checked===!0,children:i.jsx(Pe.span,{"data-state":sH(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});aH.displayName=rH;var iH="CheckboxBubbleInput",oH=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:u,disabled:d,name:f,value:m,form:p,bubbleInput:g,setBubbleInput:x}=NE(iH,e),j=qe(n,x),b=Ty(o),w=ky(r);y.useEffect(()=>{const A=g;if(!A)return;const E=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(E,"checked").set,k=!a.current;if(b!==o&&C){const O=new Event("click",{bubbles:k});A.indeterminate=Zo(o),C.call(A,Zo(o)?!1:o),A.dispatchEvent(O)}},[g,b,o,a]);const N=y.useRef(Zo(o)?!1:o);return i.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??N.current,required:u,disabled:d,name:f,value:m,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});oH.displayName=iH;function Tje(e){return typeof e=="function"}function Zo(e){return e==="indeterminate"}function sH(e){return Zo(e)?"indeterminate":e?"checked":"unchecked"}const rs=y.forwardRef(({className:e,...t},n)=>i.jsx(CE,{ref:n,className:de("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(aH,{className:de("grid place-content-center text-current"),children:i.jsx(il,{className:"h-4 w-4"})})}));rs.displayName=CE.displayName;function kje(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,o]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(null),[j,b]=y.useState(null),[w,N]=y.useState(!1),[A,E]=y.useState(null),[T,C]=y.useState(!1),[k,O]=y.useState(""),[M,I]=y.useState(new Set),[z,D]=y.useState(!1),{toast:H}=mr(),V=y.useRef(null),F=y.useRef(!0);y.useEffect(()=>{G()},[]);const G=async()=>{try{r(!0);const ae=await Mg();t(ae.api_providers||[]),f(!1),F.current=!1}catch(ae){console.error("加载配置失败:",ae)}finally{r(!1)}},L=y.useCallback(async ae=>{if(!F.current)try{u(!0),await dC("api_providers",ae),f(!1)}catch(Z){console.error("自动保存失败:",Z),f(!0)}finally{u(!1)}},[]);y.useEffect(()=>{if(!F.current)return f(!0),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{L(e)},2e3),()=>{V.current&&clearTimeout(V.current)}},[e,L]);const R=async()=>{try{o(!0),V.current&&clearTimeout(V.current);const ae=await Mg();ae.api_providers=e,await eH(ae),f(!1),H({title:"保存成功",description:"模型提供商配置已保存"})}catch(ae){console.error("保存配置失败:",ae),H({title:"保存失败",description:ae.message,variant:"destructive"})}finally{o(!1)}},U=(ae,Z)=>{x(ae||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),b(Z),C(!1),p(!0)},K=async()=>{if(g?.api_key)try{await navigator.clipboard.writeText(g.api_key),H({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{H({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},te=()=>{if(g){if(j!==null){const ae=[...e];ae[j]=g,t(ae)}else t([...e,g]);p(!1),x(null),b(null)}},$=ae=>{E(ae),N(!0)},B=()=>{if(A!==null){const ae=e.filter((Z,pe)=>pe!==A);t(ae),H({title:"删除成功",description:"提供商已从列表中移除"})}N(!1),E(null)},Y=ae=>{const Z=new Set(M);Z.has(ae)?Z.delete(ae):Z.add(ae),I(Z)},ne=()=>{if(M.size===ee.length)I(new Set);else{const ae=ee.map((Z,pe)=>e.findIndex(je=>je===ee[pe]));I(new Set(ae))}},oe=()=>{if(M.size===0){H({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}D(!0)},xe=()=>{const ae=e.filter((Z,pe)=>!M.has(pe));t(ae),I(new Set),D(!1),H({title:"批量删除成功",description:`已删除 ${M.size} 个提供商`})},ee=e.filter(ae=>{if(!k)return!0;const Z=k.toLowerCase();return ae.name.toLowerCase().includes(Z)||ae.base_url.toLowerCase().includes(Z)||ae.client_type.toLowerCase().includes(Z)});return n?i.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[M.size>0&&i.jsxs(ue,{onClick:oe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[i.jsx(Tt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",M.size,")"]}),i.jsxs(ue,{onClick:()=>U(null,null),size:"sm",className:"w-full sm:w-auto",children:[i.jsx(tr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),i.jsxs(ue,{onClick:R,disabled:a||l||!d,size:"sm",variant:"default",className:"w-full sm:w-auto",children:[i.jsx(ZO,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),a?"保存中...":l?"自动保存中...":d?"保存配置":"已保存"]})]})]}),i.jsxs(Vt,{className:"h-[calc(100vh-260px)]",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[i.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索提供商名称、URL 或类型...",value:k,onChange:ae=>O(ae.target.value),className:"pl-9"})]}),k&&i.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",ee.length," 个结果"]})]}),i.jsx("div",{className:"md:hidden space-y-3",children:ee.length===0?i.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):ee.map((ae,Z)=>i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"font-semibold text-base truncate",children:ae.name}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ae.base_url})]}),i.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>U(ae,Z),children:i.jsx(Au,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>$(Z),children:i.jsx(Tt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),i.jsx("p",{className:"font-medium",children:ae.client_type})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),i.jsx("p",{className:"font-medium",children:ae.max_retry})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),i.jsx("p",{className:"font-medium",children:ae.timeout})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),i.jsx("p",{className:"font-medium",children:ae.retry_interval})]})]})]},Z))}),i.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:i.jsxs(Al,{children:[i.jsx(Tl,{children:i.jsxs(vn,{children:[i.jsx(Ze,{className:"w-12",children:i.jsx(rs,{checked:M.size===ee.length&&ee.length>0,onCheckedChange:ne})}),i.jsx(Ze,{children:"名称"}),i.jsx(Ze,{children:"基础URL"}),i.jsx(Ze,{children:"客户端类型"}),i.jsx(Ze,{className:"text-right",children:"最大重试"}),i.jsx(Ze,{className:"text-right",children:"超时(秒)"}),i.jsx(Ze,{className:"text-right",children:"重试间隔(秒)"}),i.jsx(Ze,{className:"text-right",children:"操作"})]})}),i.jsx(kl,{children:ee.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:8,className:"text-center text-muted-foreground py-8",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):ee.map((ae,Z)=>{const pe=e.findIndex(je=>je===ae);return i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx(rs,{checked:M.has(pe),onCheckedChange:()=>Y(pe)})}),i.jsx(Ue,{className:"font-medium",children:ae.name}),i.jsx(Ue,{className:"max-w-xs truncate",title:ae.base_url,children:ae.base_url}),i.jsx(Ue,{children:ae.client_type}),i.jsx(Ue,{className:"text-right",children:ae.max_retry}),i.jsx(Ue,{className:"text-right",children:ae.timeout}),i.jsx(Ue,{className:"text-right",children:ae.retry_interval}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>U(ae,pe),children:i.jsx(Au,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>$(pe),children:i.jsx(Tt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},Z)})})]})})]}),i.jsx(nr,{open:m,onOpenChange:p,children:i.jsxs(Hn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:j!==null?"编辑提供商":"添加提供商"}),i.jsx(dr,{children:"配置 API 提供商的连接信息和参数"})]}),i.jsxs("div",{className:"grid gap-4 py-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"name",children:"名称 *"}),i.jsx(Ne,{id:"name",value:g?.name||"",onChange:ae=>x(Z=>Z?{...Z,name:ae.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"base_url",children:"基础 URL *"}),i.jsx(Ne,{id:"base_url",value:g?.base_url||"",onChange:ae=>x(Z=>Z?{...Z,base_url:ae.target.value}:null),placeholder:"https://api.example.com/v1"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"api_key",children:"API Key *"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{id:"api_key",type:T?"text":"password",value:g?.api_key||"",onChange:ae=>x(Z=>Z?{...Z,api_key:ae.target.value}:null),placeholder:"sk-...",className:"flex-1"}),i.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:()=>C(!T),title:T?"隐藏密钥":"显示密钥",children:T?i.jsx(VN,{className:"h-4 w-4"}):i.jsx(Ua,{className:"h-4 w-4"})}),i.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:K,title:"复制密钥",children:i.jsx(HN,{className:"h-4 w-4"})})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"client_type",children:"客户端类型"}),i.jsxs(Et,{value:g?.client_type||"openai",onValueChange:ae=>x(Z=>Z?{...Z,client_type:ae}:null),children:[i.jsx(wt,{id:"client_type",children:i.jsx(At,{placeholder:"选择客户端类型"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"openai",children:"OpenAI"}),i.jsx(Me,{value:"gemini",children:"Gemini"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_retry",children:"最大重试"}),i.jsx(Ne,{id:"max_retry",type:"number",min:"0",value:g?.max_retry||2,onChange:ae=>x(Z=>Z?{...Z,max_retry:parseInt(ae.target.value)}:null)})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"timeout",children:"超时(秒)"}),i.jsx(Ne,{id:"timeout",type:"number",min:"1",value:g?.timeout||30,onChange:ae=>x(Z=>Z?{...Z,timeout:parseInt(ae.target.value)}:null)})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),i.jsx(Ne,{id:"retry_interval",type:"number",min:"1",value:g?.retry_interval||10,onChange:ae=>x(Z=>Z?{...Z,retry_interval:parseInt(ae.target.value)}:null)})]})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>p(!1),children:"取消"}),i.jsx(ue,{onClick:te,children:"保存"})]})]})}),i.jsx(Pn,{open:w,onOpenChange:N,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除提供商 "',A!==null?e[A]?.name:"",'" 吗? 此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:B,children:"删除"})]})]})}),i.jsx(Pn,{open:z,onOpenChange:D,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认批量删除"}),i.jsxs(jn,{children:["确定要删除选中的 ",M.size," 个提供商吗? 此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}var _L=1,Mje=.9,Pje=.8,Rje=.17,n_=.1,r_=.999,Dje=.9999,$je=.99,Ije=/[\\\/_+.#"@\[\(\{&]/,Lje=/[\\\/_+.#"@\[\(\{&]/g,Bje=/[\s-]/,lH=/[\s-]/g;function fC(e,t,n,r,a,o,l){if(o===t.length)return a===e.length?_L:$je;var u=`${a},${o}`;if(l[u]!==void 0)return l[u];for(var d=r.charAt(o),f=n.indexOf(d,a),m=0,p,g,x,j;f>=0;)p=fC(e,t,n,r,f+1,o+1,l),p>m&&(f===a?p*=_L:Ije.test(e.charAt(f-1))?(p*=Pje,x=e.slice(a,f-1).match(Lje),x&&a>0&&(p*=Math.pow(r_,x.length))):Bje.test(e.charAt(f-1))?(p*=Mje,j=e.slice(a,f-1).match(lH),j&&a>0&&(p*=Math.pow(r_,j.length))):(p*=Rje,a>0&&(p*=Math.pow(r_,f-a))),e.charAt(f)!==t.charAt(o)&&(p*=Dje)),(pp&&(p=g*n_)),p>m&&(m=p),f=n.indexOf(d,f+1);return l[u]=m,m}function NL(e){return e.toLowerCase().replace(lH," ")}function zje(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,fC(e,t,NL(e),NL(t),0,0,{})}var qje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ms=qje.reduce((e,t)=>{const n=zh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sf='[cmdk-group=""]',a_='[cmdk-group-items=""]',Fje='[cmdk-group-heading=""]',cH='[cmdk-item=""]',CL=`${cH}:not([aria-disabled="true"])`,hC="cmdk-item-select",Rc="data-value",Uje=(e,t,n)=>zje(e,t,n),uH=y.createContext(void 0),Yh=()=>y.useContext(uH),dH=y.createContext(void 0),OE=()=>y.useContext(dH),fH=y.createContext(void 0),hH=y.forwardRef((e,t)=>{let n=Dc(()=>{var B,Y;return{search:"",value:(Y=(B=e.value)!=null?B:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Dc(()=>new Set),a=Dc(()=>new Map),o=Dc(()=>new Map),l=Dc(()=>new Set),u=mH(e),{label:d,children:f,value:m,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:w=!0,...N}=e,A=Fn(),E=Fn(),T=Fn(),C=y.useRef(null),k=e1e();bl(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,O.emit()}},[m]),bl(()=>{k(6,V)},[]);let O=y.useMemo(()=>({subscribe:B=>(l.current.add(B),()=>l.current.delete(B)),snapshot:()=>n.current,setState:(B,Y,ne)=>{var oe,xe,ee,ae;if(!Object.is(n.current[B],Y)){if(n.current[B]=Y,B==="search")H(),z(),k(1,D);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(T);Z?Z.focus():(oe=document.getElementById(A))==null||oe.focus()}if(k(7,()=>{var Z;n.current.selectedItemId=(Z=F())==null?void 0:Z.id,O.emit()}),ne||k(5,V),((xe=u.current)==null?void 0:xe.value)!==void 0){let Z=Y??"";(ae=(ee=u.current).onValueChange)==null||ae.call(ee,Z);return}}O.emit()}},emit:()=>{l.current.forEach(B=>B())}}),[]),M=y.useMemo(()=>({value:(B,Y,ne)=>{var oe;Y!==((oe=o.current.get(B))==null?void 0:oe.value)&&(o.current.set(B,{value:Y,keywords:ne}),n.current.filtered.items.set(B,I(Y,ne)),k(2,()=>{z(),O.emit()}))},item:(B,Y)=>(r.current.add(B),Y&&(a.current.has(Y)?a.current.get(Y).add(B):a.current.set(Y,new Set([B]))),k(3,()=>{H(),z(),n.current.value||D(),O.emit()}),()=>{o.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let ne=F();k(4,()=>{H(),ne?.getAttribute("id")===B&&D(),O.emit()})}),group:B=>(a.current.has(B)||a.current.set(B,new Set),()=>{o.current.delete(B),a.current.delete(B)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:A,inputId:T,labelId:E,listInnerRef:C}),[]);function I(B,Y){var ne,oe;let xe=(oe=(ne=u.current)==null?void 0:ne.filter)!=null?oe:Uje;return B?xe(B,n.current.search,Y):0}function z(){if(!n.current.search||u.current.shouldFilter===!1)return;let B=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(oe=>{let xe=a.current.get(oe),ee=0;xe.forEach(ae=>{let Z=B.get(ae);ee=Math.max(Z,ee)}),Y.push([oe,ee])});let ne=C.current;G().sort((oe,xe)=>{var ee,ae;let Z=oe.getAttribute("id"),pe=xe.getAttribute("id");return((ee=B.get(pe))!=null?ee:0)-((ae=B.get(Z))!=null?ae:0)}).forEach(oe=>{let xe=oe.closest(a_);xe?xe.appendChild(oe.parentElement===xe?oe:oe.closest(`${a_} > *`)):ne.appendChild(oe.parentElement===ne?oe:oe.closest(`${a_} > *`))}),Y.sort((oe,xe)=>xe[1]-oe[1]).forEach(oe=>{var xe;let ee=(xe=C.current)==null?void 0:xe.querySelector(`${sf}[${Rc}="${encodeURIComponent(oe[0])}"]`);ee?.parentElement.appendChild(ee)})}function D(){let B=G().find(ne=>ne.getAttribute("aria-disabled")!=="true"),Y=B?.getAttribute(Rc);O.setState("value",Y||void 0)}function H(){var B,Y,ne,oe;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let ee of r.current){let ae=(Y=(B=o.current.get(ee))==null?void 0:B.value)!=null?Y:"",Z=(oe=(ne=o.current.get(ee))==null?void 0:ne.keywords)!=null?oe:[],pe=I(ae,Z);n.current.filtered.items.set(ee,pe),pe>0&&xe++}for(let[ee,ae]of a.current)for(let Z of ae)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=xe}function V(){var B,Y,ne;let oe=F();oe&&(((B=oe.parentElement)==null?void 0:B.firstChild)===oe&&((ne=(Y=oe.closest(sf))==null?void 0:Y.querySelector(Fje))==null||ne.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function F(){var B;return(B=C.current)==null?void 0:B.querySelector(`${cH}[aria-selected="true"]`)}function G(){var B;return Array.from(((B=C.current)==null?void 0:B.querySelectorAll(CL))||[])}function L(B){let Y=G()[B];Y&&O.setState("value",Y.getAttribute(Rc))}function R(B){var Y;let ne=F(),oe=G(),xe=oe.findIndex(ae=>ae===ne),ee=oe[xe+B];(Y=u.current)!=null&&Y.loop&&(ee=xe+B<0?oe[oe.length-1]:xe+B===oe.length?oe[0]:oe[xe+B]),ee&&O.setState("value",ee.getAttribute(Rc))}function U(B){let Y=F(),ne=Y?.closest(sf),oe;for(;ne&&!oe;)ne=B>0?Qje(ne,sf):Jje(ne,sf),oe=ne?.querySelector(CL);oe?O.setState("value",oe.getAttribute(Rc)):R(B)}let K=()=>L(G().length-1),te=B=>{B.preventDefault(),B.metaKey?K():B.altKey?U(1):R(1)},$=B=>{B.preventDefault(),B.metaKey?L(0):B.altKey?U(-1):R(-1)};return y.createElement(ms.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:B=>{var Y;(Y=N.onKeyDown)==null||Y.call(N,B);let ne=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||ne))switch(B.key){case"n":case"j":{w&&B.ctrlKey&&te(B);break}case"ArrowDown":{te(B);break}case"p":case"k":{w&&B.ctrlKey&&$(B);break}case"ArrowUp":{$(B);break}case"Home":{B.preventDefault(),L(0);break}case"End":{B.preventDefault(),K();break}case"Enter":{B.preventDefault();let oe=F();if(oe){let xe=new Event(hC);oe.dispatchEvent(xe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:n1e},d),Qy(e,B=>y.createElement(dH.Provider,{value:O},y.createElement(uH.Provider,{value:M},B))))}),Hje=y.forwardRef((e,t)=>{var n,r;let a=Fn(),o=y.useRef(null),l=y.useContext(fH),u=Yh(),d=mH(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:l?.forceMount;bl(()=>{if(!f)return u.item(a,l?.id)},[f]);let m=pH(a,o,[e.value,e.children,o],e.keywords),p=OE(),g=as(k=>k.value&&k.value===m.current),x=as(k=>f||u.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);y.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(hC,j),()=>k.removeEventListener(hC,j)},[x,e.onSelect,e.disabled]);function j(){var k,O;b(),(O=(k=d.current).onSelect)==null||O.call(k,m.current)}function b(){p.setState("value",m.current,!0)}if(!x)return null;let{disabled:w,value:N,onSelect:A,forceMount:E,keywords:T,...C}=e;return y.createElement(ms.div,{ref:Rr(o,t),...C,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!g,"data-disabled":!!w,"data-selected":!!g,onPointerMove:w||u.getDisablePointerSelection()?void 0:b,onClick:w?void 0:j},e.children)}),Wje=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,l=Fn(),u=y.useRef(null),d=y.useRef(null),f=Fn(),m=Yh(),p=as(x=>a||m.filter()===!1?!0:x.search?x.filtered.groups.has(l):!0);bl(()=>m.group(l),[]),pH(l,u,[e.value,e.heading,d]);let g=y.useMemo(()=>({id:l,forceMount:a}),[a]);return y.createElement(ms.div,{ref:Rr(u,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&y.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Qy(e,x=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},y.createElement(fH.Provider,{value:g},x))))}),Vje=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=y.useRef(null),o=as(l=>!l.search);return!n&&!o?null:y.createElement(ms.div,{ref:Rr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Gje=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=OE(),l=as(f=>f.search),u=as(f=>f.selectedItemId),d=Yh();return y.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),y.createElement(ms.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:l,onChange:f=>{a||o.setState("search",f.target.value),n?.(f.target.value)}})}),Yje=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=y.useRef(null),l=y.useRef(null),u=as(f=>f.selectedItemId),d=Yh();return y.useEffect(()=>{if(l.current&&o.current){let f=l.current,m=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;m.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),y.createElement(ms.div,{ref:Rr(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:d.listId},Qy(e,f=>y.createElement("div",{ref:Rr(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Kje=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:l,...u}=e;return y.createElement(iE,{open:n,onOpenChange:r},y.createElement(oE,{container:l},y.createElement(Iy,{"cmdk-overlay":"",className:a}),y.createElement(Ly,{"aria-label":e.label,"cmdk-dialog":"",className:o},y.createElement(hH,{ref:t,...u}))))}),Xje=y.forwardRef((e,t)=>as(n=>n.filtered.count===0)?y.createElement(ms.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Zje=y.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return y.createElement(ms.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Qy(e,l=>y.createElement("div",{"aria-hidden":!0},l)))}),Br=Object.assign(hH,{List:Yje,Item:Hje,Input:Gje,Group:Wje,Separator:Vje,Dialog:Kje,Empty:Xje,Loading:Zje});function Qje(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Jje(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function mH(e){let t=y.useRef(e);return bl(()=>{t.current=e}),t}var bl=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Dc(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function as(e){let t=OE(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function pH(e,t,n,r=[]){let a=y.useRef(),o=Yh();return bl(()=>{var l;let u=(()=>{var f;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(f=m.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());o.value(e,u,d),(l=t.current)==null||l.setAttribute(Rc,u),a.current=u}),a}var e1e=()=>{let[e,t]=y.useState(),n=Dc(()=>new Map);return bl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function t1e(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Qy({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(t1e(t),{ref:t.ref},n(t.props.children)):n(t)}var n1e={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br,{ref:n,className:de("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));vH.displayName=Br.displayName;const gH=y.forwardRef(({className:e,...t},n)=>i.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[i.jsx(Dr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),i.jsx(Br.Input,{ref:n,className:de("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));gH.displayName=Br.Input.displayName;const yH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.List,{ref:n,className:de("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));yH.displayName=Br.List.displayName;const xH=y.forwardRef((e,t)=>i.jsx(Br.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));xH.displayName=Br.Empty.displayName;const bH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.Group,{ref:n,className:de("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));bH.displayName=Br.Group.displayName;const r1e=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.Separator,{ref:n,className:de("-mx-1 h-px bg-border",e),...t}));r1e.displayName=Br.Separator.displayName;const wH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.Item,{ref:n,className:de("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));wH.displayName=Br.Item.displayName;function a1e({options:e,selected:t,onChange:n,placeholder:r="选择选项...",emptyText:a="未找到选项",className:o}){const[l,u]=y.useState(!1),d=m=>{t.includes(m)?n(t.filter(p=>p!==m)):n([...t,m])},f=m=>{n(t.filter(p=>p!==m))};return i.jsxs(ts,{open:l,onOpenChange:u,children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":l,className:de("w-full justify-between min-h-10 h-auto",o),children:[i.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?i.jsx("span",{className:"text-muted-foreground",children:r}):t.map(m=>{const p=e.find(g=>g.value===m);return i.jsxs(Dt,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:g=>{g.stopPropagation(),f(m)},children:[p?.label||m,i.jsx(Bh,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},m)})}),i.jsx(uve,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),i.jsx(so,{className:"w-full p-0",align:"start",children:i.jsxs(vH,{children:[i.jsx(gH,{placeholder:"搜索...",className:"h-9"}),i.jsxs(yH,{children:[i.jsx(xH,{children:a}),i.jsx(bH,{children:e.map(m=>{const p=t.includes(m.value);return i.jsxs(wH,{value:m.value,onSelect:()=>d(m.value),children:[i.jsx("div",{className:de("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",p?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:i.jsx(il,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),i.jsx("span",{children:m.label})]},m.value)})})]})]})})]})}function i1e(){const[e,t]=y.useState([]),[n,r]=y.useState([]),[a,o]=y.useState([]),[l,u]=y.useState(null),[d,f]=y.useState(!0),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState(!1),[w,N]=y.useState(!1),[A,E]=y.useState(null),[T,C]=y.useState(null),[k,O]=y.useState(!1),[M,I]=y.useState(null),[z,D]=y.useState(""),[H,V]=y.useState(new Set),[F,G]=y.useState(!1),{toast:L}=mr(),R=y.useRef(null),U=y.useRef(null),K=y.useRef(!0);y.useEffect(()=>{te()},[]);const te=async()=>{try{f(!0);const me=await Mg(),ve=me.models||[];t(ve),o(ve.map(It=>It.name));const Le=me.api_providers||[];r(Le.map(It=>It.name)),u(me.model_task_config||null),b(!1),K.current=!1}catch(me){console.error("加载配置失败:",me)}finally{f(!1)}},$=y.useCallback(async me=>{if(!K.current)try{x(!0),await dC("models",me),b(!1)}catch(ve){console.error("自动保存模型列表失败:",ve),b(!0)}finally{x(!1)}},[]),B=y.useCallback(async me=>{if(!K.current)try{x(!0),await dC("model_task_config",me),b(!1)}catch(ve){console.error("自动保存任务配置失败:",ve),b(!0)}finally{x(!1)}},[]);y.useEffect(()=>{if(!K.current)return b(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{$(e)},2e3),()=>{R.current&&clearTimeout(R.current)}},[e,$]),y.useEffect(()=>{if(!(K.current||!l))return b(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{B(l)},2e3),()=>{U.current&&clearTimeout(U.current)}},[l,B]);const Y=async()=>{try{p(!0),R.current&&clearTimeout(R.current),U.current&&clearTimeout(U.current);const me=await Mg();me.models=e,me.model_task_config=l,await eH(me),b(!1),L({title:"保存成功",description:"模型配置已保存"}),await te()}catch(me){console.error("保存配置失败:",me),L({title:"保存失败",description:me.message,variant:"destructive"})}finally{p(!1)}},ne=(me,ve)=>{E(me||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),C(ve),N(!0)},oe=()=>{if(A){if(T!==null){const me=[...e];me[T]=A,t(me)}else t([...e,A]);N(!1),E(null),C(null)}},xe=me=>{I(me),O(!0)},ee=()=>{if(M!==null){const me=e.filter((ve,Le)=>Le!==M);t(me),L({title:"删除成功",description:"模型已从列表中移除"})}O(!1),I(null)},ae=me=>{const ve=new Set(H);ve.has(me)?ve.delete(me):ve.add(me),V(ve)},Z=()=>{if(H.size===Re.length)V(new Set);else{const me=Re.map((ve,Le)=>e.findIndex(It=>It===Re[Le]));V(new Set(me))}},pe=()=>{if(H.size===0){L({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}G(!0)},je=()=>{const me=e.filter((ve,Le)=>!H.has(Le));t(me),V(new Set),G(!1),L({title:"批量删除成功",description:`已删除 ${H.size} 个模型`})},le=(me,ve,Le)=>{l&&u({...l,[me]:{...l[me],[ve]:Le}})},Re=e.filter(me=>{if(!z)return!0;const ve=z.toLowerCase();return me.name.toLowerCase().includes(ve)||me.model_identifier.toLowerCase().includes(ve)||me.api_provider.toLowerCase().includes(ve)}),_e=me=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some(Le=>Le.includes(me)):!1;return d?i.jsx(Vt,{className:"h-full",children:i.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):i.jsx(Vt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),i.jsxs(ue,{onClick:Y,disabled:m||g||!j,size:"sm",className:"w-full sm:w-auto",children:[i.jsx(ZO,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),m?"保存中...":g?"自动保存中...":j?"保存配置":"已保存"]})]}),i.jsxs(ul,{defaultValue:"models",className:"w-full",children:[i.jsxs(Qo,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[i.jsx(Ot,{value:"models",children:"模型配置"}),i.jsx(Ot,{value:"tasks",children:"模型任务配置"})]}),i.jsxs(en,{value:"models",className:"space-y-4 mt-0",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),i.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[H.size>0&&i.jsxs(ue,{onClick:pe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[i.jsx(Tt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",H.size,")"]}),i.jsxs(ue,{onClick:()=>ne(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[i.jsx(tr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[i.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索模型名称、标识符或提供商...",value:z,onChange:me=>D(me.target.value),className:"pl-9"})]}),z&&i.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Re.length," 个结果"]})]}),i.jsx("div",{className:"md:hidden space-y-3",children:Re.length===0?i.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的模型":"暂无模型配置"}):Re.map((me,ve)=>{const Le=_e(me.name);return i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("h3",{className:"font-semibold text-base",children:me.name}),i.jsx(Dt,{variant:Le?"default":"secondary",className:Le?"bg-green-600 hover:bg-green-700":"",children:Le?"已使用":"未使用"})]}),i.jsx("p",{className:"text-xs text-muted-foreground break-all",title:me.model_identifier,children:me.model_identifier})]}),i.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>ne(me,ve),children:i.jsx(Au,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>xe(ve),children:i.jsx(Tt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),i.jsx("p",{className:"font-medium",children:me.api_provider})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),i.jsx("p",{className:"font-medium",children:me.force_stream_mode?"是":"否"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),i.jsxs("p",{className:"font-medium",children:["¥",me.price_in,"/M"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),i.jsxs("p",{className:"font-medium",children:["¥",me.price_out,"/M"]})]})]})]},ve)})}),i.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:i.jsxs(Al,{children:[i.jsx(Tl,{children:i.jsxs(vn,{children:[i.jsx(Ze,{className:"w-12",children:i.jsx(rs,{checked:H.size===Re.length&&Re.length>0,onCheckedChange:Z})}),i.jsx(Ze,{className:"w-24",children:"使用状态"}),i.jsx(Ze,{children:"模型名称"}),i.jsx(Ze,{children:"模型标识符"}),i.jsx(Ze,{children:"提供商"}),i.jsx(Ze,{className:"text-right",children:"输入价格"}),i.jsx(Ze,{className:"text-right",children:"输出价格"}),i.jsx(Ze,{className:"text-center",children:"强制流式"}),i.jsx(Ze,{className:"text-right",children:"操作"})]})}),i.jsx(kl,{children:Re.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:9,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的模型":"暂无模型配置"})}):Re.map((me,ve)=>{const Le=e.findIndex(Cn=>Cn===me),It=_e(me.name);return i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx(rs,{checked:H.has(Le),onCheckedChange:()=>ae(Le)})}),i.jsx(Ue,{children:i.jsx(Dt,{variant:It?"default":"secondary",className:It?"bg-green-600 hover:bg-green-700":"",children:It?"已使用":"未使用"})}),i.jsx(Ue,{className:"font-medium",children:me.name}),i.jsx(Ue,{className:"max-w-xs truncate",title:me.model_identifier,children:me.model_identifier}),i.jsx(Ue,{children:me.api_provider}),i.jsxs(Ue,{className:"text-right",children:["¥",me.price_in,"/M"]}),i.jsxs(Ue,{className:"text-right",children:["¥",me.price_out,"/M"]}),i.jsx(Ue,{className:"text-center",children:me.force_stream_mode?"是":"否"}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>ne(me,Le),children:i.jsx(Au,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>xe(Le),children:i.jsx(Tt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},ve)})})]})})]}),i.jsxs(en,{value:"tasks",className:"space-y-6 mt-0",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&i.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[i.jsx(Ra,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:a,onChange:(me,ve)=>le("utils",me,ve)}),i.jsx(Ra,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:a,onChange:(me,ve)=>le("utils_small",me,ve)}),i.jsx(Ra,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:a,onChange:(me,ve)=>le("tool_use",me,ve)}),i.jsx(Ra,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:a,onChange:(me,ve)=>le("replyer",me,ve)}),i.jsx(Ra,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:a,onChange:(me,ve)=>le("planner",me,ve)}),i.jsx(Ra,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:a,onChange:(me,ve)=>le("vlm",me,ve),hideTemperature:!0}),i.jsx(Ra,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:a,onChange:(me,ve)=>le("voice",me,ve),hideTemperature:!0,hideMaxTokens:!0}),i.jsx(Ra,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:a,onChange:(me,ve)=>le("embedding",me,ve),hideTemperature:!0,hideMaxTokens:!0}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),i.jsx(Ra,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:a,onChange:(me,ve)=>le("lpmm_entity_extract",me,ve)}),i.jsx(Ra,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:a,onChange:(me,ve)=>le("lpmm_rdf_build",me,ve)}),i.jsx(Ra,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:a,onChange:(me,ve)=>le("lpmm_qa",me,ve)})]})]})]})]}),i.jsx(nr,{open:w,onOpenChange:N,children:i.jsxs(Hn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:T!==null?"编辑模型":"添加模型"}),i.jsx(dr,{children:"配置模型的基本信息和参数"})]}),i.jsxs("div",{className:"grid gap-4 py-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"model_name",children:"模型名称 *"}),i.jsx(Ne,{id:"model_name",value:A?.name||"",onChange:me=>E(ve=>ve?{...ve,name:me.target.value}:null),placeholder:"例如: qwen3-30b"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"model_identifier",children:"模型标识符 *"}),i.jsx(Ne,{id:"model_identifier",value:A?.model_identifier||"",onChange:me=>E(ve=>ve?{...ve,model_identifier:me.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"api_provider",children:"API 提供商 *"}),i.jsxs(Et,{value:A?.api_provider||"",onValueChange:me=>E(ve=>ve?{...ve,api_provider:me}:null),children:[i.jsx(wt,{id:"api_provider",children:i.jsx(At,{placeholder:"选择提供商"})}),i.jsx(jt,{children:n.map(me=>i.jsx(Me,{value:me,children:me},me))})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),i.jsx(Ne,{id:"price_in",type:"number",step:"0.1",min:"0",value:A?.price_in||0,onChange:me=>E(ve=>ve?{...ve,price_in:parseFloat(me.target.value)}:null)})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),i.jsx(Ne,{id:"price_out",type:"number",step:"0.1",min:"0",value:A?.price_out||0,onChange:me=>E(ve=>ve?{...ve,price_out:parseFloat(me.target.value)}:null)})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"force_stream_mode",checked:A?.force_stream_mode||!1,onCheckedChange:me=>E(ve=>ve?{...ve,force_stream_mode:me}:null)}),i.jsx(J,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>N(!1),children:"取消"}),i.jsx(ue,{onClick:oe,children:"保存"})]})]})}),i.jsx(Pn,{open:k,onOpenChange:O,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除模型 "',M!==null?e[M]?.name:"",'" 吗? 此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:ee,children:"删除"})]})]})}),i.jsx(Pn,{open:F,onOpenChange:G,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认批量删除"}),i.jsxs(jn,{children:["确定要删除选中的 ",H.size," 个模型吗? 此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})})}function Ra({title:e,description:t,taskConfig:n,modelNames:r,onChange:a,hideTemperature:o=!1,hideMaxTokens:l=!1}){const u=d=>{a("model_list",d)};return i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"模型列表"}),i.jsx(a1e,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:u,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"温度"}),i.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"2",value:n.temperature||.3,onChange:d=>a("temperature",parseFloat(d.target.value))})]}),!l&&i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"最大 Token"}),i.jsx(Ne,{type:"number",step:"1",min:"1",value:n.max_tokens||1024,onChange:d=>a("max_tokens",parseInt(d.target.value))})]})]})]})]})}const ps="/api/webui/emoji";async function o1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await Qe(`${ps}/list?${t}`,{headers:lt()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function s1e(e){const t=await Qe(`${ps}/${e}`,{headers:lt()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function l1e(e,t){const n=await Qe(`${ps}/${e}`,{method:"PATCH",headers:lt(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function c1e(e){const t=await Qe(`${ps}/${e}`,{method:"DELETE",headers:lt()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function u1e(){const e=await Qe(`${ps}/stats/summary`,{headers:lt()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function d1e(e){const t=await Qe(`${ps}/${e}/register`,{method:"POST",headers:lt()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function f1e(e){const t=await Qe(`${ps}/${e}/ban`,{method:"POST",headers:lt()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function mC(e){const t=localStorage.getItem("access-token");return`${ps}/${e}/thumbnail?token=${encodeURIComponent(t||"")}`}function h1e(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[a,o]=y.useState(!1),[l,u]=y.useState(1),[d,f]=y.useState(0),[m]=y.useState(20),[p,g]=y.useState(""),[x,j]=y.useState("all"),[b,w]=y.useState("all"),[N,A]=y.useState("all"),[E,T]=y.useState(null),[C,k]=y.useState(!1),[O,M]=y.useState(!1),[I,z]=y.useState(!1),{toast:D}=mr(),H=y.useCallback(async()=>{try{o(!0);const $=await o1e({page:l,page_size:m,search:p||void 0,is_registered:x==="all"?void 0:x==="registered",is_banned:b==="all"?void 0:b==="banned",format:N==="all"?void 0:N,sort_by:"usage_count",sort_order:"desc"});t($.data),f($.total)}catch($){const B=$ instanceof Error?$.message:"加载表情包列表失败";D({title:"错误",description:B,variant:"destructive"})}finally{o(!1)}},[l,m,p,x,b,N,D]),V=async()=>{try{const $=await u1e();r($.data)}catch($){console.error("加载统计数据失败:",$)}};y.useEffect(()=>{H()},[H]),y.useEffect(()=>{V()},[]);const F=async $=>{try{const B=await s1e($.id);T(B.data),k(!0)}catch(B){const Y=B instanceof Error?B.message:"加载详情失败";D({title:"错误",description:Y,variant:"destructive"})}},G=$=>{T($),M(!0)},L=$=>{T($),z(!0)},R=async()=>{if(E)try{await c1e(E.id),D({title:"成功",description:"表情包已删除"}),z(!1),T(null),H(),V()}catch($){const B=$ instanceof Error?$.message:"删除失败";D({title:"错误",description:B,variant:"destructive"})}},U=async $=>{try{await d1e($.id),D({title:"成功",description:"表情包已注册"}),H(),V()}catch(B){const Y=B instanceof Error?B.message:"注册失败";D({title:"错误",description:Y,variant:"destructive"})}},K=async $=>{try{await f1e($.id),D({title:"成功",description:"表情包已封禁"}),H(),V()}catch(B){const Y=B instanceof Error?B.message:"封禁失败";D({title:"错误",description:Y,variant:"destructive"})}},te=n?.formats?Object.keys(n.formats):[];return i.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[i.jsxs("div",{className:"mb-4 sm:mb-6",children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),i.jsx(Vt,{className:"flex-1",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&i.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[i.jsx(st,{children:i.jsxs(qt,{className:"pb-2",children:[i.jsx(er,{children:"总数"}),i.jsx(Ft,{className:"text-2xl",children:n.total})]})}),i.jsx(st,{children:i.jsxs(qt,{className:"pb-2",children:[i.jsx(er,{children:"已注册"}),i.jsx(Ft,{className:"text-2xl text-green-600",children:n.registered})]})}),i.jsx(st,{children:i.jsxs(qt,{className:"pb-2",children:[i.jsx(er,{children:"已封禁"}),i.jsx(Ft,{className:"text-2xl text-red-600",children:n.banned})]})}),i.jsx(st,{children:i.jsxs(qt,{className:"pb-2",children:[i.jsx(er,{children:"未注册"}),i.jsx(Ft,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),i.jsxs(st,{children:[i.jsx(qt,{children:i.jsxs(Ft,{className:"flex items-center gap-2",children:[i.jsx(GN,{className:"h-5 w-5"}),"搜索和筛选"]})}),i.jsxs(on,{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"搜索"}),i.jsxs("div",{className:"relative",children:[i.jsx(Dr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"描述或哈希值...",value:p,onChange:$=>{g($.target.value),u(1)},className:"pl-8"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"注册状态"}),i.jsxs(Et,{value:x,onValueChange:$=>{j($),u(1)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),i.jsx(Me,{value:"registered",children:"已注册"}),i.jsx(Me,{value:"unregistered",children:"未注册"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"封禁状态"}),i.jsxs(Et,{value:b,onValueChange:$=>{w($),u(1)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),i.jsx(Me,{value:"banned",children:"已封禁"}),i.jsx(Me,{value:"unbanned",children:"未封禁"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"格式"}),i.jsxs(Et,{value:N,onValueChange:$=>{A($),u(1)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),te.map($=>i.jsxs(Me,{value:$,children:[$.toUpperCase()," (",n?.formats[$],")"]},$))]})]})]})]}),i.jsx("div",{className:"flex justify-end",children:i.jsxs(ue,{variant:"outline",size:"sm",onClick:H,disabled:a,children:[i.jsx(sl,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"刷新"]})})]})]}),i.jsxs(st,{children:[i.jsxs(qt,{children:[i.jsx(Ft,{children:"表情包列表"}),i.jsxs(er,{children:["共 ",d," 个表情包,当前第 ",l," 页"]})]}),i.jsxs(on,{children:[i.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:i.jsxs(Al,{children:[i.jsx(Tl,{children:i.jsxs(vn,{children:[i.jsx(Ze,{className:"w-16",children:"预览"}),i.jsx(Ze,{children:"描述"}),i.jsx(Ze,{children:"格式"}),i.jsx(Ze,{children:"情绪标签"}),i.jsx(Ze,{className:"text-center",children:"状态"}),i.jsx(Ze,{className:"text-right",children:"使用次数"}),i.jsx(Ze,{className:"text-right",children:"操作"})]})}),i.jsx(kl,{children:e.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map($=>i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:mC($.id),alt:$.description||"表情包",className:"w-full h-full object-cover",onError:B=>{const Y=B.target;Y.style.display="none";const ne=Y.parentElement;ne&&(ne.innerHTML='')}})})}),i.jsx(Ue,{children:i.jsxs("div",{className:"space-y-1 max-w-xs",children:[i.jsx("div",{className:"font-medium truncate",title:$.description||"无描述",children:$.description||"无描述"}),i.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[$.emoji_hash.slice(0,16),"..."]})]})}),i.jsx(Ue,{children:i.jsx(Dt,{variant:"outline",children:$.format.toUpperCase()})}),i.jsx(Ue,{children:i.jsx(OL,{emotions:$.emotion})}),i.jsx(Ue,{className:"align-middle",children:i.jsxs("div",{className:"flex gap-2 justify-center",children:[$.is_registered&&i.jsxs(Dt,{variant:"default",className:"bg-green-600",children:[i.jsx(Vo,{className:"h-3 w-3 mr-1"}),"已注册"]}),$.is_banned&&i.jsxs(Dt,{variant:"destructive",children:[i.jsx(UN,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),i.jsx(Ue,{className:"text-right font-mono",children:$.usage_count}),i.jsx(Ue,{children:i.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>F($),children:[i.jsx(YN,{className:"h-4 w-4 mr-1"}),"详情"]}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>G($),children:[i.jsx(Tu,{className:"h-4 w-4 mr-1"}),"编辑"]}),!$.is_registered&&i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>U($),className:"text-green-600 hover:text-green-700",children:[i.jsx(Vo,{className:"h-4 w-4 mr-1"}),"注册"]}),!$.is_banned&&i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>K($),className:"text-orange-600 hover:text-orange-700",children:[i.jsx(FI,{className:"h-4 w-4 mr-1"}),"封禁"]}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>L($),className:"text-red-600 hover:text-red-700",children:[i.jsx(Tt,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},$.id))})]})}),i.jsx("div",{className:"md:hidden space-y-3",children:e.length===0?i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map($=>i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:mC($.id),alt:$.description||"表情包",className:"w-full h-full object-cover",onError:B=>{const Y=B.target;Y.style.display="none";const ne=Y.parentElement;ne&&(ne.innerHTML='')}})})}),i.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[i.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[i.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:$.description||"无描述",children:$.description||"无描述"}),i.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[$.emoji_hash.slice(0,16),"..."]})]}),i.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[i.jsx(Dt,{variant:"outline",className:"text-xs flex-shrink-0",children:$.format.toUpperCase()}),$.is_registered&&i.jsxs(Dt,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[i.jsx(Vo,{className:"h-3 w-3 mr-1"}),"已注册"]}),$.is_banned&&i.jsxs(Dt,{variant:"destructive",className:"text-xs flex-shrink-0",children:[i.jsx(UN,{className:"h-3 w-3 mr-1"}),"已封禁"]}),i.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",$.usage_count]})]}),$.emotion&&$.emotion.length>0&&i.jsx("div",{className:"min-w-0 overflow-hidden",children:i.jsx(OL,{emotions:$.emotion})})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>F($),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[i.jsx(YN,{className:"h-3 w-3 mr-1"}),"详情"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>G($),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[i.jsx(Tu,{className:"h-3 w-3 mr-1"}),"编辑"]}),!$.is_registered&&i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>U($),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-green-600 hover:text-green-700",children:[i.jsx(Vo,{className:"h-3 w-3 mr-1"}),"注册"]}),!$.is_banned&&i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>K($),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-orange-600 hover:text-orange-700",children:[i.jsx(FI,{className:"h-3 w-3 mr-1"}),"封禁"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>L($),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-red-600 hover:text-red-700",children:[i.jsx(Tt,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},$.id))}),d>m&&i.jsxs("div",{className:"flex items-center justify-between mt-4",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*m+1," 到"," ",Math.min(l*m,d)," 条,共 ",d," 条"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>u($=>Math.max(1,$-1)),disabled:l===1,children:[i.jsx(YO,{className:"h-4 w-4"}),"上一页"]}),i.jsxs("div",{className:"text-sm",children:["第 ",l," / ",Math.ceil(d/m)," 页"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>u($=>$+1),disabled:l>=Math.ceil(d/m),children:["下一页",i.jsx(KO,{className:"h-4 w-4"})]})]})]})]})]}),i.jsx(m1e,{emoji:E,open:C,onOpenChange:k}),i.jsx(p1e,{emoji:E,open:O,onOpenChange:M,onSuccess:()=>{H(),V()}})]})}),i.jsx(nr,{open:I,onOpenChange:z,children:i.jsxs(Hn,{children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"确认删除"}),i.jsx(dr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>z(!1),children:"取消"}),i.jsx(ue,{variant:"destructive",onClick:R,children:"删除"})]})]})})]})}function m1e({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl",children:[i.jsx(Wn,{children:i.jsx(Vn,{children:"表情包详情"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:mC(e.id),alt:e.description||"表情包",className:"w-full h-full object-cover",onError:a=>{const o=a.target;o.style.display="none";const l=o.parentElement;l&&(l.innerHTML='')}})})}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"ID"}),i.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"格式"}),i.jsx("div",{className:"mt-1",children:i.jsx(Dt,{variant:"outline",children:e.format.toUpperCase()})})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"文件路径"}),i.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"哈希值"}),i.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"描述"}),i.jsx("div",{className:"mt-1",children:e.description||"-"})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"情绪标签"}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.emotion&&e.emotion.length>0?e.emotion.map((a,o)=>i.jsx(Dt,{variant:"secondary",children:a},o)):i.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"状态"}),i.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&i.jsx(Dt,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&i.jsx(Dt,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&i.jsx(Dt,{variant:"outline",children:"未注册"})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"使用次数"}),i.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"记录时间"}),i.jsx("div",{className:"mt-1 text-sm",children:r(e.record_time)})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"注册时间"}),i.jsx("div",{className:"mt-1 text-sm",children:r(e.register_time)})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"最后使用"}),i.jsx("div",{className:"mt-1 text-sm",children:r(e.last_used_time)})]})]})]})})}function p1e({emoji:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=y.useState(""),[l,u]=y.useState(""),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(!1),{toast:j}=mr();y.useEffect(()=>{e&&(o(e.description||""),u(e.emotion?e.emotion.join(", "):""),f(e.is_registered),p(e.is_banned))},[e]);const b=async()=>{if(e)try{x(!0);const w=l.split(/[,,]/).map(N=>N.trim()).filter(Boolean);await l1e(e.id,{description:a||void 0,emotion:w.length>0?w:void 0,is_registered:d,is_banned:m}),j({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(w){const N=w instanceof Error?w.message:"保存失败";j({title:"错误",description:N,variant:"destructive"})}finally{x(!1)}};return e?i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑表情包"}),i.jsx(dr,{children:"修改表情包的描述和标签信息"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(J,{children:"描述"}),i.jsx(Wt,{value:a,onChange:w=>o(w.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx(J,{children:"情绪标签"}),i.jsx(Ne,{value:l,onChange:w=>u(w.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔(支持中英文逗号)"})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(rs,{id:"is_registered",checked:d,onCheckedChange:w=>f(w===!0)}),i.jsx(J,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(rs,{id:"is_banned",checked:m,onCheckedChange:w=>p(w===!0)}),i.jsx(J,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),i.jsx(ue,{onClick:b,disabled:g,children:g?"保存中...":"保存"})]})]})}):null}function OL({emotions:e}){if(!e||e.length===0)return i.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const t=(a,o=6)=>a.length<=o?a:a.slice(0,o)+"...",n=e.slice(0,3),r=e.length-3;return i.jsxs("div",{className:"flex flex-wrap gap-1 max-w-full overflow-hidden",children:[n.map((a,o)=>i.jsx(Dt,{variant:"secondary",className:"text-xs flex-shrink-0",title:a,children:t(a)},o)),r>0&&i.jsxs(Dt,{variant:"outline",className:"text-xs flex-shrink-0",title:`还有 ${r} 个标签: ${e.slice(3).join(", ")}`,children:["+",r]})]})}const Qu="/api/webui/expression";async function v1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await Qe(`${Qu}/list?${t}`,{headers:lt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function g1e(e){const t=await Qe(`${Qu}/${e}`,{headers:lt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function y1e(e){const t=await Qe(`${Qu}/`,{method:"POST",headers:lt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function x1e(e,t){const n=await Qe(`${Qu}/${e}`,{method:"PATCH",headers:lt(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function b1e(e){const t=await Qe(`${Qu}/${e}`,{method:"DELETE",headers:lt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function w1e(){const e=await Qe(`${Qu}/stats/summary`,{headers:lt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function j1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,o]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(null),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,A]=y.useState(!1),[E,T]=y.useState(null),[C,k]=y.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:O}=mr(),M=async()=>{try{r(!0);const F=await v1e({page:l,page_size:d,search:f||void 0});t(F.data),o(F.total)}catch(F){O({title:"加载失败",description:F instanceof Error?F.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},I=async()=>{try{const F=await w1e();k(F.data)}catch(F){console.error("加载统计数据失败:",F)}};y.useEffect(()=>{M(),I()},[l,d,f]);const z=async F=>{try{const G=await g1e(F.id);g(G.data),j(!0)}catch(G){O({title:"加载详情失败",description:G instanceof Error?G.message:"无法加载表达方式详情",variant:"destructive"})}},D=F=>{g(F),w(!0)},H=async F=>{try{await b1e(F.id),O({title:"删除成功",description:`已删除表达方式: ${F.situation}`}),T(null),M(),I()}catch(G){O({title:"删除失败",description:G instanceof Error?G.message:"无法删除表达方式",variant:"destructive"})}},V=F=>F?new Date(F*1e3).toLocaleString("zh-CN"):"-";return i.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[i.jsx("div",{className:"mb-4 sm:mb-6",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[i.jsx(Lh,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),i.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),i.jsxs(ue,{onClick:()=>A(!0),className:"gap-2",children:[i.jsx(tr,{className:"h-4 w-4"}),"新增表达方式"]})]})}),i.jsx(Vt,{className:"flex-1",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),i.jsx("div",{className:"text-2xl font-bold mt-1",children:C.total})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:C.recent_7days})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:C.chat_count})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx(J,{htmlFor:"search",children:"搜索"}),i.jsxs("div",{className:"relative mt-1.5",children:[i.jsx(Dr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{id:"search",placeholder:"搜索情境、风格或上下文...",value:f,onChange:F=>m(F.target.value),className:"pl-9"})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card",children:[i.jsx("div",{className:"hidden md:block",children:i.jsxs(Al,{children:[i.jsx(Tl,{children:i.jsxs(vn,{children:[i.jsx(Ze,{children:"情境"}),i.jsx(Ze,{children:"风格"}),i.jsx(Ze,{children:"聊天ID"}),i.jsx(Ze,{children:"最后活跃"}),i.jsx(Ze,{className:"text-right",children:"操作"})]})}),i.jsx(kl,{children:n?i.jsx(vn,{children:i.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(F=>i.jsxs(vn,{children:[i.jsx(Ue,{className:"font-medium max-w-xs truncate",children:F.situation}),i.jsx(Ue,{className:"max-w-xs truncate",children:F.style}),i.jsx(Ue,{className:"font-mono text-sm",children:F.chat_id}),i.jsx(Ue,{className:"text-sm text-muted-foreground",children:V(F.last_active_time)}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>z(F),children:i.jsx(Ua,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>D(F),children:i.jsx(Tu,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>T(F),children:i.jsx(Tt,{className:"h-4 w-4 text-destructive"})})]})})]},F.id))})]})}),i.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(F=>i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[i.jsxs("div",{className:"min-w-0 w-full overflow-hidden space-y-2",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),i.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:F.situation,children:F.situation})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),i.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:F.style,children:F.style})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),i.jsx("p",{className:"font-mono text-xs truncate",children:F.chat_id})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),i.jsx("p",{className:"text-xs",children:V(F.last_active_time)})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>z(F),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[i.jsx(Ua,{className:"h-3 w-3 mr-1"}),"查看"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>D(F),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[i.jsx(Tu,{className:"h-3 w-3 mr-1"}),"编辑"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>T(F),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[i.jsx(Tt,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},F.id))}),a>d&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]})]})}),i.jsx(S1e,{expression:p,open:x,onOpenChange:j}),i.jsx(_1e,{open:N,onOpenChange:A,onSuccess:()=>{M(),I(),A(!1)}}),i.jsx(N1e,{expression:p,open:b,onOpenChange:w,onSuccess:()=>{M(),I(),w(!1)}}),i.jsx(Pn,{open:!!E,onOpenChange:()=>T(null),children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除表达方式 "',E?.situation,'" 吗? 此操作不可撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>E&&H(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function S1e({expression:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"表达方式详情"}),i.jsx(dr,{children:"查看表达方式的完整信息"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Ac,{label:"情境",value:e.situation}),i.jsx(Ac,{label:"风格",value:e.style}),i.jsx(Ac,{icon:jg,label:"聊天ID",value:e.chat_id,mono:!0}),i.jsx(Ac,{icon:jg,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"上下文"}),i.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"上文内容"}),i.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Ac,{icon:ol,label:"最后活跃",value:r(e.last_active_time)}),i.jsx(Ac,{icon:ol,label:"创建时间",value:r(e.create_date)})]})]}),i.jsx($r,{children:i.jsx(ue,{onClick:()=>n(!1),children:"关闭"})})]})})}function Ac({icon:e,label:t,value:n,mono:r=!1}){return i.jsxs("div",{className:"space-y-1",children:[i.jsxs(J,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&i.jsx(e,{className:"h-3 w-3"}),t]}),i.jsx("div",{className:de("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function _1e({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=y.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[o,l]=y.useState(!1),{toast:u}=mr(),d=async()=>{if(!r.situation||!r.style||!r.chat_id){u({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await y1e(r),u({title:"创建成功",description:"表达方式已创建"}),a({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){u({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return i.jsx(nr,{open:e,onOpenChange:t,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"新增表达方式"}),i.jsx(dr,{children:"创建新的表达方式记录"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(J,{htmlFor:"situation",children:["情境 ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Ne,{id:"situation",value:r.situation,onChange:f=>a({...r,situation:f.target.value}),placeholder:"描述使用场景"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(J,{htmlFor:"style",children:["风格 ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Ne,{id:"style",value:r.style,onChange:f=>a({...r,style:f.target.value}),placeholder:"描述表达风格"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(J,{htmlFor:"chat_id",children:["聊天ID ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Ne,{id:"chat_id",value:r.chat_id,onChange:f=>a({...r,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"context",children:"上下文"}),i.jsx(Wt,{id:"context",value:r.context,onChange:f=>a({...r,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"up_content",children:"上文内容"}),i.jsx(Wt,{id:"up_content",value:r.up_content,onChange:f=>a({...r,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>t(!1),children:"取消"}),i.jsx(ue,{onClick:d,disabled:o,children:o?"创建中...":"创建"})]})]})})}function N1e({expression:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=mr();y.useEffect(()=>{e&&o({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{u(!0),await x1e(e.id,a),d({title:"保存成功",description:"表达方式已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{u(!1)}};return e?i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑表达方式"}),i.jsx(dr,{children:"修改表达方式的信息"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_situation",children:"情境"}),i.jsx(Ne,{id:"edit_situation",value:a.situation||"",onChange:m=>o({...a,situation:m.target.value}),placeholder:"描述使用场景"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_style",children:"风格"}),i.jsx(Ne,{id:"edit_style",value:a.style||"",onChange:m=>o({...a,style:m.target.value}),placeholder:"描述表达风格"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_chat_id",children:"聊天ID"}),i.jsx(Ne,{id:"edit_chat_id",value:a.chat_id||"",onChange:m=>o({...a,chat_id:m.target.value}),placeholder:"关联的聊天ID"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_context",children:"上下文"}),i.jsx(Wt,{id:"edit_context",value:a.context||"",onChange:m=>o({...a,context:m.target.value}),placeholder:"上下文信息",rows:3})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_up_content",children:"上文内容"}),i.jsx(Wt,{id:"edit_up_content",value:a.up_content||"",onChange:m=>o({...a,up_content:m.target.value}),placeholder:"上文内容",rows:3})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),i.jsx(ue,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}const Kh="/api/webui/person";async function C1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await Qe(`${Kh}/list?${t}`,{headers:lt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function O1e(e){const t=await Qe(`${Kh}/${e}`,{headers:lt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function E1e(e,t){const n=await Qe(`${Kh}/${e}`,{method:"PATCH",headers:lt(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function A1e(e){const t=await Qe(`${Kh}/${e}`,{method:"DELETE",headers:lt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function T1e(){const e=await Qe(`${Kh}/stats/summary`,{headers:lt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function k1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,o]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(void 0),[x,j]=y.useState(void 0),[b,w]=y.useState(null),[N,A]=y.useState(!1),[E,T]=y.useState(!1),[C,k]=y.useState(null),[O,M]=y.useState({total:0,known:0,unknown:0,platforms:{}}),{toast:I}=mr(),z=async()=>{try{r(!0);const R=await C1e({page:l,page_size:d,search:f||void 0,is_known:p,platform:x});t(R.data),o(R.total)}catch(R){I({title:"加载失败",description:R instanceof Error?R.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},D=async()=>{try{const R=await T1e();M(R.data)}catch(R){console.error("加载统计数据失败:",R)}};y.useEffect(()=>{z(),D()},[l,d,f,p,x]);const H=async R=>{try{const U=await O1e(R.person_id);w(U.data),A(!0)}catch(U){I({title:"加载详情失败",description:U instanceof Error?U.message:"无法加载人物详情",variant:"destructive"})}},V=R=>{w(R),T(!0)},F=async R=>{try{await A1e(R.person_id),I({title:"删除成功",description:`已删除人物信息: ${R.person_name||R.nickname||R.user_id}`}),k(null),z(),D()}catch(U){I({title:"删除失败",description:U instanceof Error?U.message:"无法删除人物信息",variant:"destructive"})}},G=y.useMemo(()=>Object.keys(O.platforms),[O.platforms]),L=R=>R?new Date(R*1e3).toLocaleString("zh-CN"):"-";return i.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[i.jsx("div",{className:"mb-4 sm:mb-6",children:i.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[i.jsx(Oge,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),i.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),i.jsx(Vt,{className:"flex-1",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),i.jsx("div",{className:"text-2xl font-bold mt-1",children:O.total})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:O.known})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:O.unknown})]})]}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx(J,{htmlFor:"search",children:"搜索"}),i.jsxs("div",{className:"relative mt-1.5",children:[i.jsx(Dr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:f,onChange:R=>m(R.target.value),className:"pl-9"})]})]}),i.jsxs("div",{children:[i.jsx(J,{htmlFor:"filter-known",children:"认识状态"}),i.jsxs(Et,{value:p===void 0?"all":p.toString(),onValueChange:R=>{g(R==="all"?void 0:R==="true"),u(1)},children:[i.jsx(wt,{id:"filter-known",className:"mt-1.5",children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),i.jsx(Me,{value:"true",children:"已认识"}),i.jsx(Me,{value:"false",children:"未认识"})]})]})]}),i.jsxs("div",{children:[i.jsx(J,{htmlFor:"filter-platform",children:"平台"}),i.jsxs(Et,{value:x||"all",onValueChange:R=>{j(R==="all"?void 0:R),u(1)},children:[i.jsx(wt,{id:"filter-platform",className:"mt-1.5",children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部平台"}),G.map(R=>i.jsxs(Me,{value:R,children:[R," (",O.platforms[R],")"]},R))]})]})]})]})}),i.jsxs("div",{className:"rounded-lg border bg-card",children:[i.jsx("div",{className:"hidden md:block",children:i.jsxs(Al,{children:[i.jsx(Tl,{children:i.jsxs(vn,{children:[i.jsx(Ze,{children:"状态"}),i.jsx(Ze,{children:"名称"}),i.jsx(Ze,{children:"昵称"}),i.jsx(Ze,{children:"平台"}),i.jsx(Ze,{children:"用户ID"}),i.jsx(Ze,{children:"最后更新"}),i.jsx(Ze,{className:"text-right",children:"操作"})]})}),i.jsx(kl,{children:n?i.jsx(vn,{children:i.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(R=>i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx("div",{className:de("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",R.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:R.is_known?"已认识":"未认识"})}),i.jsx(Ue,{className:"font-medium",children:R.person_name||i.jsx("span",{className:"text-muted-foreground",children:"-"})}),i.jsx(Ue,{children:R.nickname||"-"}),i.jsx(Ue,{children:R.platform}),i.jsx(Ue,{className:"font-mono text-sm",children:R.user_id}),i.jsx(Ue,{className:"text-sm text-muted-foreground",children:L(R.last_know)}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>H(R),children:i.jsx(Ua,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>V(R),children:i.jsx(Tu,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>k(R),children:i.jsx(Tt,{className:"h-4 w-4 text-destructive"})})]})})]},R.id))})]})}),i.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(R=>i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[i.jsx("div",{className:"flex items-start justify-between gap-2",children:i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:de("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",R.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:R.is_known?"已认识":"未认识"}),i.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:R.person_name||i.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),R.nickname&&i.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",R.nickname]})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),i.jsx("p",{className:"font-medium text-xs",children:R.platform})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),i.jsx("p",{className:"font-mono text-xs truncate",title:R.user_id,children:R.user_id})]}),i.jsxs("div",{className:"col-span-2",children:[i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),i.jsx("p",{className:"text-xs",children:L(R.last_know)})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>H(R),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[i.jsx(Ua,{className:"h-3 w-3 mr-1"}),"查看"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>V(R),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[i.jsx(Tu,{className:"h-3 w-3 mr-1"}),"编辑"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>k(R),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[i.jsx(Tt,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},R.id))}),a>d&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]})]})}),i.jsx(M1e,{person:b,open:N,onOpenChange:A}),i.jsx(P1e,{person:b,open:E,onOpenChange:T,onSuccess:()=>{z(),D(),T(!1)}}),i.jsx(Pn,{open:!!C,onOpenChange:()=>k(null),children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除人物信息 "',C?.person_name||C?.nickname||C?.user_id,'" 吗? 此操作不可撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>C&&F(C),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function M1e({person:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"人物详情"}),i.jsxs(dr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Hi,{icon:nF,label:"人物名称",value:e.person_name}),i.jsx(Hi,{icon:Lh,label:"昵称",value:e.nickname}),i.jsx(Hi,{icon:jg,label:"用户ID",value:e.user_id,mono:!0}),i.jsx(Hi,{icon:jg,label:"人物ID",value:e.person_id,mono:!0}),i.jsx(Hi,{label:"平台",value:e.platform}),i.jsx(Hi,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),i.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"个人印象"}),i.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"群昵称"}),i.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((a,o)=>i.jsxs("div",{className:"text-sm flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:a.group_id}),i.jsx("span",{children:"→"}),i.jsx("span",{children:a.group_nick_name})]},o))})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[i.jsx(Hi,{icon:ol,label:"认识时间",value:r(e.know_times)}),i.jsx(Hi,{icon:ol,label:"首次记录",value:r(e.know_since)}),i.jsx(Hi,{icon:ol,label:"最后更新",value:r(e.last_know)})]})]}),i.jsx($r,{children:i.jsx(ue,{onClick:()=>n(!1),children:"关闭"})})]})})}function Hi({icon:e,label:t,value:n,mono:r=!1}){return i.jsxs("div",{className:"space-y-1",children:[i.jsxs(J,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&i.jsx(e,{className:"h-3 w-3"}),t]}),i.jsx("div",{className:de("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function P1e({person:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=mr();y.useEffect(()=>{e&&o({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{u(!0),await E1e(e.person_id,a),d({title:"保存成功",description:"人物信息已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新人物信息",variant:"destructive"})}finally{u(!1)}};return e?i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑人物信息"}),i.jsxs(dr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"person_name",children:"人物名称"}),i.jsx(Ne,{id:"person_name",value:a.person_name||"",onChange:m=>o({...a,person_name:m.target.value}),placeholder:"为这个人设置一个名称"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"nickname",children:"昵称"}),i.jsx(Ne,{id:"nickname",value:a.nickname||"",onChange:m=>o({...a,nickname:m.target.value}),placeholder:"昵称"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"name_reason",children:"名称设定原因"}),i.jsx(Wt,{id:"name_reason",value:a.name_reason||"",onChange:m=>o({...a,name_reason:m.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"memory_points",children:"个人印象"}),i.jsx(Wt,{id:"memory_points",value:a.memory_points||"",onChange:m=>o({...a,memory_points:m.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),i.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[i.jsxs("div",{children:[i.jsx(J,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),i.jsx(at,{id:"is_known",checked:a.is_known,onCheckedChange:m=>o({...a,is_known:m})})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),i.jsx(ue,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function R1e(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const D1e={},mf={};function Zs(e,t){try{const r=(D1e[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in mf?mf[r]:EL(r,r.split(":"))}catch{if(e in mf)return mf[e];const n=e?.match($1e);return n?EL(e,n.slice(1)):NaN}}const $1e=/([+-]\d\d):?(\d\d)?/;function EL(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return mf[e]=n*60+r>0?n*60+r+a:n*60-r-a}class ui extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Zs(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),jH(this),pC(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new ui(...n,t):new ui(Date.now(),t)}withTimeZone(t){return new ui(+this,t)}getTimezoneOffset(){const t=-Zs(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),pC(this),+this}[Symbol.for("constructDateFrom")](t){return new ui(+new Date(t),this.timeZone)}}const AL=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!AL.test(e))return;const t=e.replace(AL,"$1UTC");ui.prototype[t]&&(e.startsWith("get")?ui.prototype[e]=function(){return this.internal[t]()}:(ui.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),I1e(this),+this},ui.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),pC(this),+this}))});function pC(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Zs(e.timeZone,e)*60))}function I1e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),jH(e)}function jH(e){const t=Zs(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),l=a-o,u=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&u&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const f=new Date(+e);f.setUTCSeconds(0);const m=a>0?f.getSeconds():(f.getSeconds()-60)%60,p=Math.round(-(Zs(e.timeZone,e)*60))%60;(p||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+m));const g=Zs(e.timeZone,e),x=g>0?Math.floor(g):Math.ceil(g),b=-new Date(+e).getTimezoneOffset()-x,w=x!==n,N=b-d;if(w&&N){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N);const A=Zs(e.timeZone,e),E=A>0?Math.floor(A):Math.ceil(A),T=x-E;T&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+T))}}class sr extends ui{static tz(t,...n){return n.length?new sr(...n,t):new sr(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${R1e(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new sr(+this,t)}[Symbol.for("constructDateFrom")](t){return new sr(+new Date(t),this.timeZone)}}const SH=6048e5,L1e=864e5,TL=Symbol.for("constructDateFrom");function Nn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&TL in e?e[TL](t):e instanceof Date?new e.constructor(t):new Date(t)}function $t(e,t){return Nn(t||e,e)}function _H(e,t,n){const r=$t(e,n?.in);return isNaN(t)?Nn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function NH(e,t,n){const r=$t(e,n?.in);if(isNaN(t))return Nn(e,NaN);if(!t)return r;const a=r.getDate(),o=Nn(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const l=o.getDate();return a>=l?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let B1e={};function Xh(){return B1e}function is(e,t){const n=Xh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=$t(e,t?.in),o=a.getDay(),l=(o=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function kL(e){const t=$t(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ml(e,...t){const n=Nn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function gh(e,t){const n=$t(e,t?.in);return n.setHours(0,0,0,0),n}function OH(e,t,n){const[r,a]=Ml(n?.in,e,t),o=gh(r),l=gh(a),u=+o-kL(o),d=+l-kL(l);return Math.round((u-d)/L1e)}function z1e(e,t){const n=CH(e,t),r=Nn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),vh(r)}function q1e(e,t,n){return _H(e,t*7,n)}function F1e(e,t,n){return NH(e,t*12,n)}function U1e(e,t){let n,r=t?.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=Nn.bind(null,a));const o=$t(a,r);(!n||n{!r&&typeof a=="object"&&(r=Nn.bind(null,a));const o=$t(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),Nn(r,n||NaN)}function W1e(e,t,n){const[r,a]=Ml(n?.in,e,t);return+gh(r)==+gh(a)}function EH(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function V1e(e){return!(!EH(e)&&typeof e!="number"||isNaN(+$t(e)))}function G1e(e,t,n){const[r,a]=Ml(n?.in,e,t),o=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return o*12+l}function Y1e(e,t){const n=$t(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function AH(e,t){const[n,r]=Ml(e,t.start,t.end);return{start:n,end:r}}function K1e(e,t){const{start:n,end:r}=AH(t?.in,e);let a=+n>+r;const o=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=o;)d.push(Nn(n,l)),l.setMonth(l.getMonth()+u);return a?d.reverse():d}function X1e(e,t){const n=$t(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Z1e(e,t){const n=$t(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function TH(e,t){const n=$t(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Q1e(e,t){const{start:n,end:r}=AH(t?.in,e);let a=+n>+r;const o=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=o;)d.push(Nn(n,l)),l.setFullYear(l.getFullYear()+u);return a?d.reverse():d}function kH(e,t){const n=Xh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=$t(e,t?.in),o=a.getDay(),l=(o{let r;const a=eSe[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Zc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const nSe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rSe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aSe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iSe={date:Zc({formats:nSe,defaultWidth:"full"}),time:Zc({formats:rSe,defaultWidth:"full"}),dateTime:Zc({formats:aSe,defaultWidth:"full"})},oSe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sSe=(e,t,n,r)=>oSe[e];function ai(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n?.width?String(n.width):l;a=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n?.width?String(n.width):e.defaultWidth;a=e.values[u]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const lSe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cSe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},uSe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dSe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},fSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},hSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mSe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},pSe={ordinalNumber:mSe,era:ai({values:lSe,defaultWidth:"wide"}),quarter:ai({values:cSe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ai({values:uSe,defaultWidth:"wide"}),day:ai({values:dSe,defaultWidth:"wide"}),dayPeriod:ai({values:fSe,defaultWidth:"wide",formattingValues:hSe,defaultFormattingWidth:"wide"})};function ii(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const l=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?gSe(u,p=>p.test(l)):vSe(u,p=>p.test(l));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const m=t.slice(l.length);return{value:f,rest:m}}}function vSe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function gSe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}const ySe=/^(\d+)(th|st|nd|rd)?/i,xSe=/\d+/i,bSe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},wSe={any:[/^b/i,/^(a|c)/i]},jSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},SSe={any:[/1/i,/2/i,/3/i,/4/i]},_Se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},NSe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},CSe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},OSe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ESe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ASe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},TSe={ordinalNumber:MH({matchPattern:ySe,parsePattern:xSe,valueCallback:e=>parseInt(e,10)}),era:ii({matchPatterns:bSe,defaultMatchWidth:"wide",parsePatterns:wSe,defaultParseWidth:"any"}),quarter:ii({matchPatterns:jSe,defaultMatchWidth:"wide",parsePatterns:SSe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ii({matchPatterns:_Se,defaultMatchWidth:"wide",parsePatterns:NSe,defaultParseWidth:"any"}),day:ii({matchPatterns:CSe,defaultMatchWidth:"wide",parsePatterns:OSe,defaultParseWidth:"any"}),dayPeriod:ii({matchPatterns:ESe,defaultMatchWidth:"any",parsePatterns:ASe,defaultParseWidth:"any"})},EE={code:"en-US",formatDistance:tSe,formatLong:iSe,formatRelative:sSe,localize:pSe,match:TSe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kSe(e,t){const n=$t(e,t?.in);return OH(n,TH(n))+1}function PH(e,t){const n=$t(e,t?.in),r=+vh(n)-+z1e(n);return Math.round(r/SH)+1}function RH(e,t){const n=$t(e,t?.in),r=n.getFullYear(),a=Xh(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=Nn(t?.in||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const u=is(l,t),d=Nn(t?.in||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const f=is(d,t);return+n>=+u?r+1:+n>=+f?r:r-1}function MSe(e,t){const n=Xh(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=RH(e,t),o=Nn(t?.in||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),is(o,t)}function DH(e,t){const n=$t(e,t?.in),r=+is(n,t)-+MSe(n,t);return Math.round(r/SH)+1}function Ct(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Bo={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ct(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Ct(a,t.length)}},Tc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ML={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Bo.y(e,t)},Y:function(e,t,n,r){const a=RH(e,r),o=a>0?a:1-a;if(t==="YY"){const l=o%100;return Ct(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Ct(o,t.length)},R:function(e,t){const n=CH(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ct(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ct(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Bo.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ct(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=DH(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Ct(a,t.length)},I:function(e,t,n){const r=PH(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Bo.d(e,t)},D:function(e,t,n){const r=kSe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ct(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ct(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ct(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Ct(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Tc.noon:r===0?a=Tc.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Tc.evening:r>=12?a=Tc.afternoon:r>=4?a=Tc.morning:a=Tc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Bo.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Bo.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Bo.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Bo.s(e,t)},S:function(e,t){return Bo.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return RL(r);case"XXXX":case"XX":return Hs(r);case"XXXXX":case"XXX":default:return Hs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return RL(r);case"xxxx":case"xx":return Hs(r);case"xxxxx":case"xxx":default:return Hs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+PL(r,":");case"OOOO":default:return"GMT"+Hs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+PL(r,":");case"zzzz":default:return"GMT"+Hs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ct(r,t.length)},T:function(e,t,n){return Ct(+e,t.length)}};function PL(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+t+Ct(o,2)}function RL(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):Hs(e,t)}function Hs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Ct(Math.trunc(r/60),2),o=Ct(r%60,2);return n+a+t+o}const DL=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$H=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},PSe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return DL(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",DL(r,t)).replace("{{time}}",$H(a,t))},RSe={p:$H,P:PSe},DSe=/^D+$/,$Se=/^Y+$/,ISe=["D","DD","YY","YYYY"];function LSe(e){return DSe.test(e)}function BSe(e){return $Se.test(e)}function zSe(e,t,n){const r=qSe(e,t,n);if(console.warn(r),ISe.includes(e))throw new RangeError(r)}function qSe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const FSe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,USe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HSe=/^'([^]*?)'?$/,WSe=/''/g,VSe=/[a-zA-Z]/;function uv(e,t,n){const r=Xh(),a=n?.locale??r.locale??EE,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=$t(e,n?.in);if(!V1e(u))throw new RangeError("Invalid time value");let d=t.match(USe).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=RSe[p];return g(m,a.formatLong)}return m}).join("").match(FSe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:GSe(m)};if(ML[p])return{isToken:!0,value:m};if(p.match(VSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const f={firstWeekContainsDate:o,weekStartsOn:l,locale:a};return d.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&BSe(p)||!n?.useAdditionalDayOfYearTokens&&LSe(p))&&zSe(p,t,String(e));const g=ML[p[0]];return g(u,p,a.localize,f)}).join("")}function GSe(e){const t=e.match(HSe);return t?t[1].replace(WSe,"'"):e}function YSe(e,t){const n=$t(e,t?.in),r=n.getFullYear(),a=n.getMonth(),o=Nn(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function KSe(e,t){return $t(e,t?.in).getMonth()}function XSe(e,t){return $t(e,t?.in).getFullYear()}function ZSe(e,t){return+$t(e)>+$t(t)}function QSe(e,t){return+$t(e)<+$t(t)}function JSe(e,t,n){const[r,a]=Ml(n?.in,e,t);return+is(r,n)==+is(a,n)}function e_e(e,t,n){const[r,a]=Ml(n?.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function t_e(e,t,n){const[r,a]=Ml(n?.in,e,t);return r.getFullYear()===a.getFullYear()}function n_e(e,t,n){const r=$t(e,n?.in),a=r.getFullYear(),o=r.getDate(),l=Nn(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const u=YSe(l);return r.setMonth(t,Math.min(o,u)),r}function r_e(e,t,n){const r=$t(e,n?.in);return isNaN(+r)?Nn(e,NaN):(r.setFullYear(t),r)}const $L=5,a_e=4;function i_e(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),o=t.addDays(a,$L*7-1);return t.getMonth(e)===t.getMonth(o)?$L:a_e}function IH(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function o_e(e,t){const n=IH(e,t),r=i_e(e,t);return t.addDays(n,r*7-1)}class ia{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?sr.tz(this.options.timeZone):new this.Date,this.newDate=(r,a,o)=>this.overrides?.newDate?this.overrides.newDate(r,a,o):this.options.timeZone?new sr(r,a,o,this.options.timeZone):new Date(r,a,o),this.addDays=(r,a)=>this.overrides?.addDays?this.overrides.addDays(r,a):_H(r,a),this.addMonths=(r,a)=>this.overrides?.addMonths?this.overrides.addMonths(r,a):NH(r,a),this.addWeeks=(r,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,a):q1e(r,a),this.addYears=(r,a)=>this.overrides?.addYears?this.overrides.addYears(r,a):F1e(r,a),this.differenceInCalendarDays=(r,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):OH(r,a),this.differenceInCalendarMonths=(r,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):G1e(r,a),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):K1e(r),this.eachYearOfInterval=r=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Q1e(r),o=new Set(a.map(u=>this.getYear(u)));if(o.size===a.length)return a;const l=[];return o.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):o_e(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):J1e(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):Y1e(r),this.endOfWeek=(r,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,a):kH(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):Z1e(r),this.format=(r,a,o)=>{const l=this.overrides?.format?this.overrides.format(r,a,this.options):uv(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):PH(r),this.getMonth=(r,a)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):KSe(r,this.options),this.getYear=(r,a)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):XSe(r,this.options),this.getWeek=(r,a)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):DH(r,this.options),this.isAfter=(r,a)=>this.overrides?.isAfter?this.overrides.isAfter(r,a):ZSe(r,a),this.isBefore=(r,a)=>this.overrides?.isBefore?this.overrides.isBefore(r,a):QSe(r,a),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):EH(r),this.isSameDay=(r,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,a):W1e(r,a),this.isSameMonth=(r,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,a):e_e(r,a),this.isSameYear=(r,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,a):t_e(r,a),this.max=r=>this.overrides?.max?this.overrides.max(r):U1e(r),this.min=r=>this.overrides?.min?this.overrides.min(r):H1e(r),this.setMonth=(r,a)=>this.overrides?.setMonth?this.overrides.setMonth(r,a):n_e(r,a),this.setYear=(r,a)=>this.overrides?.setYear?this.overrides.setYear(r,a):r_e(r,a),this.startOfBroadcastWeek=(r,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):IH(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):gh(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):vh(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):X1e(r),this.startOfWeek=(r,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):is(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):TH(r),this.options={locale:EE,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ia.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,o=n?.code;if(o&&ia.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}ia.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Si=new ia;class LH{constructor(t,n,r=Si){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class s_e{constructor(t,n){this.date=t,this.weeks=n}}class l_e{constructor(t,n){this.days=n,this.weekNumber=t}}function c_e(e){return W.createElement("button",{...e})}function u_e(e){return W.createElement("span",{...e})}function d_e(e){const{size:t=24,orientation:n="left",className:r}=e;return W.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&W.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&W.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&W.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&W.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function f_e(e){const{day:t,modifiers:n,...r}=e;return W.createElement("td",{...r})}function h_e(e){const{day:t,modifiers:n,...r}=e,a=W.useRef(null);return W.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),W.createElement("button",{ref:a,...r})}var $e;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})($e||($e={}));var tn;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(tn||(tn={}));var za;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(za||(za={}));var Xr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Xr||(Xr={}));function m_e(e){const{options:t,className:n,components:r,classNames:a,...o}=e,l=[a[$e.Dropdown],n].join(" "),u=t?.find(({value:d})=>d===o.value);return W.createElement("span",{"data-disabled":o.disabled,className:a[$e.DropdownRoot]},W.createElement(r.Select,{className:l,...o},t?.map(({value:d,label:f,disabled:m})=>W.createElement(r.Option,{key:d,value:d,disabled:m},f))),W.createElement("span",{className:a[$e.CaptionLabel],"aria-hidden":!0},u?.label,W.createElement(r.Chevron,{orientation:"down",size:18,className:a[$e.Chevron]})))}function p_e(e){return W.createElement("div",{...e})}function v_e(e){return W.createElement("div",{...e})}function g_e(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r},e.children)}function y_e(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r})}function x_e(e){return W.createElement("table",{...e})}function b_e(e){return W.createElement("div",{...e})}const BH=y.createContext(void 0);function Zh(){const e=y.useContext(BH);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function w_e(e){const{components:t}=Zh();return W.createElement(t.Dropdown,{...e})}function j_e(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=Zh(),m=y.useCallback(g=>{a&&n?.(g)},[a,n]),p=y.useCallback(g=>{r&&t?.(g)},[r,t]);return W.createElement("nav",{...o},W.createElement(l.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:p},W.createElement(l.Chevron,{disabled:r?void 0:!0,className:u[$e.Chevron],orientation:"left"})),W.createElement(l.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:m},W.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:u[$e.Chevron]})))}function S_e(e){const{components:t}=Zh();return W.createElement(t.Button,{...e})}function __e(e){return W.createElement("option",{...e})}function N_e(e){const{components:t}=Zh();return W.createElement(t.Button,{...e})}function C_e(e){const{rootRef:t,...n}=e;return W.createElement("div",{...n,ref:t})}function O_e(e){return W.createElement("select",{...e})}function E_e(e){const{week:t,...n}=e;return W.createElement("tr",{...n})}function A_e(e){return W.createElement("th",{...e})}function T_e(e){return W.createElement("thead",{"aria-hidden":!0},W.createElement("tr",{...e}))}function k_e(e){const{week:t,...n}=e;return W.createElement("th",{...n})}function M_e(e){return W.createElement("th",{...e})}function P_e(e){return W.createElement("tbody",{...e})}function R_e(e){const{components:t}=Zh();return W.createElement(t.Dropdown,{...e})}const D_e=Object.freeze(Object.defineProperty({__proto__:null,Button:c_e,CaptionLabel:u_e,Chevron:d_e,Day:f_e,DayButton:h_e,Dropdown:m_e,DropdownNav:p_e,Footer:v_e,Month:g_e,MonthCaption:y_e,MonthGrid:x_e,Months:b_e,MonthsDropdown:w_e,Nav:j_e,NextMonthButton:S_e,Option:__e,PreviousMonthButton:N_e,Root:C_e,Select:O_e,Week:E_e,WeekNumber:k_e,WeekNumberHeader:M_e,Weekday:A_e,Weekdays:T_e,Weeks:P_e,YearsDropdown:R_e},Symbol.toStringTag,{value:"Module"}));function Xi(e,t,n=!1,r=Si){let{from:a,to:o}=e;const{differenceInCalendarDays:l,isSameDay:u}=r;return a&&o?(l(o,a)<0&&([a,o]=[o,a]),l(t,a)>=(n?1:0)&&l(o,t)>=(n?1:0)):!n&&o?u(o,t):!n&&a?u(a,t):!1}function zH(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function AE(e){return!!(e&&typeof e=="object"&&"from"in e)}function qH(e){return!!(e&&typeof e=="object"&&"after"in e)}function FH(e){return!!(e&&typeof e=="object"&&"before"in e)}function UH(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function HH(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Zi(e,t,n=Si){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:o,isAfter:l}=n;return r.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return a(e,u);if(HH(u,n))return u.includes(e);if(AE(u))return Xi(u,e,!1,n);if(UH(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(e.getDay()):u.dayOfWeek===e.getDay();if(zH(u)){const d=o(u.before,e),f=o(u.after,e),m=d>0,p=f<0;return l(u.before,u.after)?p&&m:m||p}return qH(u)?o(e,u.after)>0:FH(u)?o(u.before,e)>0:typeof u=="function"?u(e):!1})}function $_e(e,t,n,r,a){const{disabled:o,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:m}=t,{isSameDay:p,isSameMonth:g,startOfMonth:x,isBefore:j,endOfMonth:b,isAfter:w}=a,N=n&&x(n),A=r&&b(r),E={[tn.focused]:[],[tn.outside]:[],[tn.disabled]:[],[tn.hidden]:[],[tn.today]:[]},T={};for(const C of e){const{date:k,displayMonth:O}=C,M=!!(O&&!g(k,O)),I=!!(N&&j(k,N)),z=!!(A&&w(k,A)),D=!!(o&&Zi(k,o,a)),H=!!(l&&Zi(k,l,a))||I||z||!f&&!d&&M||f&&d===!1&&M,V=p(k,m??a.today());M&&E.outside.push(C),D&&E.disabled.push(C),H&&E.hidden.push(C),V&&E.today.push(C),u&&Object.keys(u).forEach(F=>{const G=u?.[F];G&&Zi(k,G,a)&&(T[F]?T[F].push(C):T[F]=[C])})}return C=>{const k={[tn.focused]:!1,[tn.disabled]:!1,[tn.hidden]:!1,[tn.outside]:!1,[tn.today]:!1},O={};for(const M in E){const I=E[M];k[M]=I.some(z=>z===C)}for(const M in T)O[M]=T[M].some(I=>I===C);return{...k,...O}}}function I_e(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):t[tn[o]]?a.push(t[tn[o]]):t[za[o]]&&a.push(t[za[o]]),a),[t[$e.Day]])}function L_e(e){return{...D_e,...e}}function B_e(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function TE(){const e={};for(const t in $e)e[$e[t]]=`rdp-${$e[t]}`;for(const t in tn)e[tn[t]]=`rdp-${tn[t]}`;for(const t in za)e[za[t]]=`rdp-${za[t]}`;for(const t in Xr)e[Xr[t]]=`rdp-${Xr[t]}`;return e}function WH(e,t,n){return(n??new ia(t)).formatMonthYear(e)}const z_e=WH;function q_e(e,t,n){return(n??new ia(t)).format(e,"d")}function F_e(e,t=Si){return t.format(e,"LLLL")}function U_e(e,t,n){return(n??new ia(t)).format(e,"cccccc")}function H_e(e,t=Si){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function W_e(){return""}function VH(e,t=Si){return t.format(e,"yyyy")}const V_e=VH,G_e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:WH,formatDay:q_e,formatMonthCaption:z_e,formatMonthDropdown:F_e,formatWeekNumber:H_e,formatWeekNumberHeader:W_e,formatWeekdayName:U_e,formatYearCaption:V_e,formatYearDropdown:VH},Symbol.toStringTag,{value:"Module"}));function Y_e(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...G_e,...e}}function K_e(e,t,n,r,a){const{startOfMonth:o,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=a;return d({start:l(e),end:u(e)}).map(g=>{const x=r.formatMonthDropdown(g,a),j=f(g),b=t&&go(n)||!1;return{value:j,label:x,disabled:b}})}function X_e(e,t={},n={}){let r={...t?.[$e.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n?.[a]}}),r}function Z_e(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),o=[];for(let l=0;l<7;l++){const u=e.addDays(a,l);o.push(u)}return o}function Q_e(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:l,eachYearOfInterval:u,getYear:d}=r,f=o(e),m=l(t),p=u({start:f,end:m});return a&&p.reverse(),p.map(g=>{const x=n.formatYearDropdown(g,r);return{value:d(g),label:x,disabled:!1}})}function GH(e,t,n,r){let a=(r??new ia(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const J_e=GH;function YH(e,t,n){return(n??new ia(t)).formatMonthYear(e)}const eNe=YH;function tNe(e,t,n,r){let a=(r??new ia(n)).format(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a}function nNe(e){return"Choose the Month"}function rNe(){return""}function aNe(e){return"Go to the Next Month"}function iNe(e){return"Go to the Previous Month"}function oNe(e,t,n){return(n??new ia(t)).format(e,"cccc")}function sNe(e,t){return`Week ${e}`}function lNe(e){return"Week Number"}function cNe(e){return"Choose the Year"}const uNe=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:eNe,labelDay:J_e,labelDayButton:GH,labelGrid:YH,labelGridcell:tNe,labelMonthDropdown:nNe,labelNav:rNe,labelNext:aNe,labelPrevious:iNe,labelWeekNumber:sNe,labelWeekNumberHeader:lNe,labelWeekday:oNe,labelYearDropdown:cNe},Symbol.toStringTag,{value:"Module"})),Qh=e=>e instanceof HTMLElement?e:null,i_=e=>[...e.querySelectorAll("[data-animated-month]")??[]],dNe=e=>Qh(e.querySelector("[data-animated-month]")),o_=e=>Qh(e.querySelector("[data-animated-caption]")),s_=e=>Qh(e.querySelector("[data-animated-weeks]")),fNe=e=>Qh(e.querySelector("[data-animated-nav]")),hNe=e=>Qh(e.querySelector("[data-animated-weekdays]"));function mNe(e,t,{classNames:n,months:r,focused:a,dateLib:o}){const l=y.useRef(null),u=y.useRef(r),d=y.useRef(!1);y.useLayoutEffect(()=>{const f=u.current;if(u.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||f.length===0||r.length!==f.length)return;const m=o.isSameMonth(r[0].date,f[0].date),p=o.isAfter(r[0].date,f[0].date),g=p?n[Xr.caption_after_enter]:n[Xr.caption_before_enter],x=p?n[Xr.weeks_after_enter]:n[Xr.weeks_before_enter],j=l.current,b=e.current.cloneNode(!0);if(b instanceof HTMLElement?(i_(b).forEach(E=>{if(!(E instanceof HTMLElement))return;const T=dNe(E);T&&E.contains(T)&&E.removeChild(T);const C=o_(E);C&&C.classList.remove(g);const k=s_(E);k&&k.classList.remove(x)}),l.current=b):l.current=null,d.current||m||a)return;const w=j instanceof HTMLElement?i_(j):[],N=i_(e.current);if(N?.every(A=>A instanceof HTMLElement)&&w&&w.every(A=>A instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const A=fNe(e.current);A&&(A.style.zIndex="1"),N.forEach((E,T)=>{const C=w[T];if(!C)return;E.style.position="relative",E.style.overflow="hidden";const k=o_(E);k&&k.classList.add(g);const O=s_(E);O&&O.classList.add(x);const M=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),A&&(A.style.zIndex=""),k&&k.classList.remove(g),O&&O.classList.remove(x),E.style.position="",E.style.overflow="",E.contains(C)&&E.removeChild(C)};C.style.pointerEvents="none",C.style.position="absolute",C.style.overflow="hidden",C.setAttribute("aria-hidden","true");const I=hNe(C);I&&(I.style.opacity="0");const z=o_(C);z&&(z.classList.add(p?n[Xr.caption_before_exit]:n[Xr.caption_after_exit]),z.addEventListener("animationend",M));const D=s_(C);D&&D.classList.add(p?n[Xr.weeks_before_exit]:n[Xr.weeks_after_exit]),E.insertBefore(C,E.firstChild)})}})}function pNe(e,t,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:j,endOfWeek:b,isAfter:w,startOfBroadcastWeek:N,startOfISOWeek:A,startOfWeek:E}=r,T=d?N(a,r):l?A(a):E(a),C=d?g(o):l?x(j(o)):b(j(o)),k=m(C,T),O=p(o,a)+1,M=[];for(let D=0;D<=k;D++){const H=f(T,D);if(t&&w(H,t))break;M.push(H)}const z=(d?35:42)*O;if(u&&M.length{const a=r.weeks.reduce((o,l)=>o.concat(l.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function gNe(e,t,n,r){const{numberOfMonths:a=1}=n,o=[];for(let l=0;lt)break;o.push(u)}return o}function IL(e,t,n,r){const{month:a,defaultMonth:o,today:l=r.today(),numberOfMonths:u=1}=e;let d=a||o||l;const{differenceInCalendarMonths:f,addMonths:m,startOfMonth:p}=r;if(n&&f(n,d){const N=n.broadcastCalendar?p(w,r):n.ISOWeek?g(w):x(w),A=n.broadcastCalendar?o(w):n.ISOWeek?l(u(w)):d(u(w)),E=t.filter(O=>O>=N&&O<=A),T=n.broadcastCalendar?35:42;if(n.fixedWeeks&&E.length{const I=T-E.length;return M>A&&M<=a(A,I)});E.push(...O)}const C=E.reduce((O,M)=>{const I=n.ISOWeek?f(M):m(M),z=O.find(H=>H.weekNumber===I),D=new LH(M,w,r);return z?z.days.push(D):O.push(new l_e(I,[D])),O},[]),k=new s_e(w,C);return b.push(k),b},[]);return n.reverseMonths?j.reverse():j}function xNe(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:m,today:p}=t,{fromYear:g,toYear:x,fromMonth:j,toMonth:b}=e;!n&&j&&(n=j),!n&&g&&(n=t.newDate(g,0,1)),!r&&b&&(r=b),!r&&x&&(r=m(x,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):g?n=m(g,0,1):!n&&w&&(n=a(d(e.today??p(),-100))),r?r=u(r):x?r=m(x,11,31):!r&&w&&(r=f(e.today??p())),[n&&o(n),r&&o(r)]}function bNe(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=r,f=a?o:1,m=l(e);if(!t)return u(m,f);if(!(d(t,e)n.concat(r.weeks.slice()),t.slice())}function Jy(e,t){const[n,r]=y.useState(e);return[t===void 0?n:t,r]}function SNe(e,t){const[n,r]=xNe(e,t),{startOfMonth:a,endOfMonth:o}=t,l=IL(e,n,r,t),[u,d]=Jy(l,e.month?l:void 0);y.useEffect(()=>{const k=IL(e,n,r,t);d(k)},[e.timeZone]);const f=gNe(u,r,e,t),m=pNe(f,e.endMonth?o(e.endMonth):void 0,e,t),p=yNe(f,m,e,t),g=jNe(p),x=vNe(p),j=wNe(u,n,e,t),b=bNe(u,r,e,t),{disableNavigation:w,onMonthChange:N}=e,A=k=>g.some(O=>O.days.some(M=>M.isEqualTo(k))),E=k=>{if(w)return;let O=a(k);n&&Oa(r)&&(O=a(r)),d(O),N?.(O)};return{months:p,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:j,nextMonth:b,goToMonth:E,goToDay:k=>{A(k)||E(k.date)}}}var ti;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(ti||(ti={}));function LL(e){return!e[tn.disabled]&&!e[tn.hidden]&&!e[tn.outside]}function _Ne(e,t,n,r){let a,o=-1;for(const l of e){const u=t(l);LL(u)&&(u[tn.focused]&&oLL(t(l)))),a}function NNe(e,t,n,r,a,o,l){const{ISOWeek:u,broadcastCalendar:d}=o,{addDays:f,addMonths:m,addWeeks:p,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:j,endOfWeek:b,max:w,min:N,startOfBroadcastWeek:A,startOfISOWeek:E,startOfWeek:T}=l;let k={day:f,week:p,month:m,year:g,startOfWeek:O=>d?A(O,l):u?E(O):T(O),endOfWeek:O=>d?x(O):u?j(O):b(O)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=w([r,k]):t==="after"&&a&&(k=N([a,k])),k}function KH(e,t,n,r,a,o,l,u=0){if(u>365)return;const d=NNe(e,t,n.date,r,a,o,l),f=!!(o.disabled&&Zi(d,o.disabled,l)),m=!!(o.hidden&&Zi(d,o.hidden,l)),p=d,g=new LH(d,p,l);return!f&&!m?g:KH(e,t,g,r,a,o,l,u+1)}function CNe(e,t,n,r,a){const{autoFocus:o}=e,[l,u]=y.useState(),d=_Ne(t.days,n,r||(()=>!1),l),[f,m]=y.useState(o?d:void 0);return{isFocusTarget:b=>!!d?.isEqualTo(b),setFocused:m,focused:f,blur:()=>{u(f),m(void 0)},moveFocus:(b,w)=>{if(!f)return;const N=KH(b,w,f,t.navStart,t.navEnd,e,a);N&&(e.disableNavigation&&!t.days.some(E=>E.isEqualTo(N))||(t.goToDay(N),m(N)))}}}function ONe(e,t){const{selected:n,required:r,onSelect:a}=e,[o,l]=Jy(n,a?n:void 0),u=a?n:o,{isSameDay:d}=t,f=x=>u?.some(j=>d(j,x))??!1,{min:m,max:p}=e;return{selected:u,select:(x,j,b)=>{let w=[...u??[]];if(f(x)){if(u?.length===m||r&&u?.length===1)return;w=u?.filter(N=>!d(N,x))}else u?.length===p?w=[x]:w=[...w,x];return a||l(w),a?.(w,x,j,b),w},isSelected:f}}function ENe(e,t,n=0,r=0,a=!1,o=Si){const{from:l,to:u}=t||{},{isSameDay:d,isAfter:f,isBefore:m}=o;let p;if(!l&&!u)p={from:e,to:n>0?void 0:e};else if(l&&!u)d(l,e)?n===0?p={from:l,to:e}:a?p={from:l,to:void 0}:p=void 0:m(e,l)?p={from:e,to:l}:p={from:l,to:e};else if(l&&u)if(d(l,e)&&d(u,e))a?p={from:l,to:u}:p=void 0;else if(d(l,e))p={from:l,to:n>0?void 0:e};else if(d(u,e))p={from:e,to:n>0?void 0:e};else if(m(e,l))p={from:e,to:u};else if(f(e,l))p={from:l,to:e};else if(f(e,u))p={from:l,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const g=o.differenceInCalendarDays(p.to,p.from);r>0&&g>r?p={from:e,to:void 0}:n>1&&gtypeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?Xi(e,u,!1,n):HH(u,n)?u.some(d=>Xi(e,d,!1,n)):AE(u)?u.from&&u.to?BL(e,{from:u.from,to:u.to},n):!1:UH(u)?ANe(e,u.dayOfWeek,n):zH(u)?n.isAfter(u.before,u.after)?BL(e,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):Zi(e.from,u,n)||Zi(e.to,u,n):qH(u)||FH(u)?Zi(e.from,u,n)||Zi(e.to,u,n):!1))return!0;const l=r.filter(u=>typeof u=="function");if(l.length){let u=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=d;f++){if(l.some(m=>m(u)))return!0;u=n.addDays(u,1)}}return!1}function kNe(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:l}=e,[u,d]=Jy(a,l?a:void 0),f=l?a:u;return{selected:f,select:(g,x,j)=>{const{min:b,max:w}=e,N=g?ENe(g,f,b,w,o,t):void 0;return r&&n&&N?.from&&N.to&&TNe({from:N.from,to:N.to},n,t)&&(N.from=g,N.to=void 0),l||d(N),l?.(N,g,x,j),N},isSelected:g=>f&&Xi(f,g,!1,t)}}function MNe(e,t){const{selected:n,required:r,onSelect:a}=e,[o,l]=Jy(n,a?n:void 0),u=a?n:o,{isSameDay:d}=t;return{selected:u,select:(p,g,x)=>{let j=p;return!r&&u&&u&&d(p,u)&&(j=void 0),a||l(j),a?.(j,p,g,x),j},isSelected:p=>u?d(u,p):!1}}function PNe(e,t){const n=MNe(e,t),r=ONe(e,t),a=kNe(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function RNe(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new sr(t.today,t.timeZone)),t.month&&(t.month=new sr(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new sr(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new sr(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new sr(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new sr(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(et=>new sr(et,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new sr(t.selected.from,t.timeZone):void 0,to:t.selected.to?new sr(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:o,locale:l,classNames:u}=y.useMemo(()=>{const et={...EE,...t.locale};return{dateLib:new ia({locale:et,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:L_e(t.components),formatters:Y_e(t.formatters),labels:{...uNe,...t.labels},locale:et,classNames:{...TE(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:d,mode:f,navLayout:m,numberOfMonths:p=1,onDayBlur:g,onDayClick:x,onDayFocus:j,onDayKeyDown:b,onDayMouseEnter:w,onDayMouseLeave:N,onNextClick:A,onPrevClick:E,showWeekNumber:T,styles:C}=t,{formatCaption:k,formatDay:O,formatMonthDropdown:M,formatWeekNumber:I,formatWeekNumberHeader:z,formatWeekdayName:D,formatYearDropdown:H}=r,V=SNe(t,o),{days:F,months:G,navStart:L,navEnd:R,previousMonth:U,nextMonth:K,goToMonth:te}=V,$=$_e(F,t,L,R,o),{isSelected:B,select:Y,selected:ne}=PNe(t,o)??{},{blur:oe,focused:xe,isFocusTarget:ee,moveFocus:ae,setFocused:Z}=CNe(t,V,$,B??(()=>!1),o),{labelDayButton:pe,labelGridcell:je,labelGrid:le,labelMonthDropdown:Re,labelNav:_e,labelPrevious:me,labelNext:ve,labelWeekday:Le,labelWeekNumber:It,labelWeekNumberHeader:Cn,labelYearDropdown:vr}=a,rr=y.useMemo(()=>Z_e(o,t.ISOWeek),[o,t.ISOWeek]),gr=f!==void 0||x!==void 0,ct=y.useCallback(()=>{U&&(te(U),E?.(U))},[U,te,E]),rt=y.useCallback(()=>{K&&(te(K),A?.(K))},[te,K,A]),$n=y.useCallback((et,zt)=>He=>{He.preventDefault(),He.stopPropagation(),Z(et),Y?.(et.date,zt,He),x?.(et.date,zt,He)},[Y,x,Z]),gs=y.useCallback((et,zt)=>He=>{Z(et),j?.(et.date,zt,He)},[j,Z]),im=y.useCallback((et,zt)=>He=>{oe(),g?.(et.date,zt,He)},[oe,g]),Rl=y.useCallback((et,zt)=>He=>{const gt={ArrowLeft:[He.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[He.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[He.shiftKey?"year":"week","after"],ArrowUp:[He.shiftKey?"year":"week","before"],PageUp:[He.shiftKey?"year":"month","before"],PageDown:[He.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(gt[He.key]){He.preventDefault(),He.stopPropagation();const[In,tt]=gt[He.key];ae(In,tt)}b?.(et.date,zt,He)},[ae,b,t.dir]),ax=y.useCallback((et,zt)=>He=>{w?.(et.date,zt,He)},[w]),om=y.useCallback((et,zt)=>He=>{N?.(et.date,zt,He)},[N]),ix=y.useCallback(et=>zt=>{const He=Number(zt.target.value),gt=o.setMonth(o.startOfMonth(et),He);te(gt)},[o,te]),ox=y.useCallback(et=>zt=>{const He=Number(zt.target.value),gt=o.setYear(o.startOfMonth(et),He);te(gt)},[o,te]),{className:ys,style:yr}=y.useMemo(()=>({className:[u[$e.Root],t.className].filter(Boolean).join(" "),style:{...C?.[$e.Root],...t.style}}),[u,t.className,t.style,C]),Ka=B_e(t),ar=y.useRef(null);mNe(ar,!!t.animate,{classNames:u,months:G,focused:xe,dateLib:o});const sx={dayPickerProps:t,selected:ne,select:Y,isSelected:B,months:G,nextMonth:K,previousMonth:U,goToMonth:te,getModifiers:$,components:n,classNames:u,styles:C,labels:a,formatters:r};return W.createElement(BH.Provider,{value:sx},W.createElement(n.Root,{rootRef:t.animate?ar:void 0,className:ys,style:yr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Ka},W.createElement(n.Months,{className:u[$e.Months],style:C?.[$e.Months]},!t.hideNavigation&&!m&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:C?.[$e.Nav],"aria-label":_e(),onPreviousClick:ct,onNextClick:rt,previousMonth:U,nextMonth:K}),G.map((et,zt)=>W.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:u[$e.Month],style:C?.[$e.Month],key:zt,displayIndex:zt,calendarMonth:et},m==="around"&&!t.hideNavigation&&zt===0&&W.createElement(n.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:U?void 0:-1,"aria-disabled":U?void 0:!0,"aria-label":me(U),onClick:ct,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:U?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"right":"left"})),W.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[$e.MonthCaption],style:C?.[$e.MonthCaption],calendarMonth:et,displayIndex:zt},d?.startsWith("dropdown")?W.createElement(n.DropdownNav,{className:u[$e.Dropdowns],style:C?.[$e.Dropdowns]},(()=>{const He=d==="dropdown"||d==="dropdown-months"?W.createElement(n.MonthsDropdown,{key:"month",className:u[$e.MonthsDropdown],"aria-label":Re(),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:ix(et.date),options:K_e(et.date,L,R,r,o),style:C?.[$e.Dropdown],value:o.getMonth(et.date)}):W.createElement("span",{key:"month"},M(et.date,o)),gt=d==="dropdown"||d==="dropdown-years"?W.createElement(n.YearsDropdown,{key:"year",className:u[$e.YearsDropdown],"aria-label":vr(o.options),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:ox(et.date),options:Q_e(L,R,r,o,!!t.reverseYears),style:C?.[$e.Dropdown],value:o.getYear(et.date)}):W.createElement("span",{key:"year"},H(et.date,o));return o.getMonthYearOrder()==="year-first"?[gt,He]:[He,gt]})(),W.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(et.date,o.options,o))):W.createElement(n.CaptionLabel,{className:u[$e.CaptionLabel],role:"status","aria-live":"polite"},k(et.date,o.options,o))),m==="around"&&!t.hideNavigation&&zt===p-1&&W.createElement(n.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":ve(K),onClick:rt,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:K?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"left":"right"})),zt===p-1&&m==="after"&&!t.hideNavigation&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:C?.[$e.Nav],"aria-label":_e(),onPreviousClick:ct,onNextClick:rt,previousMonth:U,nextMonth:K}),W.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":le(et.date,o.options,o)||void 0,className:u[$e.MonthGrid],style:C?.[$e.MonthGrid]},!t.hideWeekdays&&W.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[$e.Weekdays],style:C?.[$e.Weekdays]},T&&W.createElement(n.WeekNumberHeader,{"aria-label":Cn(o.options),className:u[$e.WeekNumberHeader],style:C?.[$e.WeekNumberHeader],scope:"col"},z()),rr.map(He=>W.createElement(n.Weekday,{"aria-label":Le(He,o.options,o),className:u[$e.Weekday],key:String(He),style:C?.[$e.Weekday],scope:"col"},D(He,o.options,o)))),W.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[$e.Weeks],style:C?.[$e.Weeks]},et.weeks.map(He=>W.createElement(n.Week,{className:u[$e.Week],key:He.weekNumber,style:C?.[$e.Week],week:He},T&&W.createElement(n.WeekNumber,{week:He,style:C?.[$e.WeekNumber],"aria-label":It(He.weekNumber,{locale:l}),className:u[$e.WeekNumber],scope:"row",role:"rowheader"},I(He.weekNumber,o)),He.days.map(gt=>{const{date:In}=gt,tt=$(gt);if(tt[tn.focused]=!tt.hidden&&!!xe?.isEqualTo(gt),tt[za.selected]=B?.(In)||tt.selected,AE(ne)){const{from:$l,to:bs}=ne;tt[za.range_start]=!!($l&&bs&&o.isSameDay(In,$l)),tt[za.range_end]=!!($l&&bs&&o.isSameDay(In,bs)),tt[za.range_middle]=Xi(ne,In,!0,o)}const Dl=X_e(tt,C,t.modifiersStyles),xs=I_e(tt,u,t.modifiersClassNames),lx=!gr&&!tt.hidden?je(In,tt,o.options,o):void 0;return W.createElement(n.Day,{key:`${o.format(In,"yyyy-MM-dd")}_${o.format(gt.displayMonth,"yyyy-MM")}`,day:gt,modifiers:tt,className:xs.join(" "),style:Dl,role:"gridcell","aria-selected":tt.selected||void 0,"aria-label":lx,"data-day":o.format(In,"yyyy-MM-dd"),"data-month":gt.outside?o.format(In,"yyyy-MM"):void 0,"data-selected":tt.selected||void 0,"data-disabled":tt.disabled||void 0,"data-hidden":tt.hidden||void 0,"data-outside":gt.outside||void 0,"data-focused":tt.focused||void 0,"data-today":tt.today||void 0},!tt.hidden&&gr?W.createElement(n.DayButton,{className:u[$e.DayButton],style:C?.[$e.DayButton],type:"button",day:gt,modifiers:tt,disabled:tt.disabled||void 0,tabIndex:ee(gt)?0:-1,"aria-label":pe(In,tt,o.options,o),onClick:$n(gt,tt),onBlur:im(gt,tt),onFocus:gs(gt,tt),onKeyDown:Rl(gt,tt),onMouseEnter:ax(gt,tt),onMouseLeave:om(gt,tt)},O(In,o.options,o)):!tt.hidden&&O(gt.date,o.options,o))})))))))),t.footer&&W.createElement(n.Footer,{className:u[$e.Footer],style:C?.[$e.Footer],role:"status","aria-live":"polite"},t.footer)))}function zL({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:o,components:l,...u}){const d=TE();return i.jsx(RNe,{showOutsideDays:n,className:de("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...o},classNames:{root:de("w-fit",d.root),months:de("relative flex flex-col gap-4 md:flex-row",d.months),month:de("flex w-full flex-col gap-4",d.month),nav:de("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",d.nav),button_previous:de(fh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_previous),button_next:de(fh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_next),month_caption:de("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",d.month_caption),dropdowns:de("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",d.dropdowns),dropdown_root:de("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",d.dropdown_root),dropdown:de("bg-popover absolute inset-0 opacity-0",d.dropdown),caption_label:de("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:de("flex",d.weekdays),weekday:de("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",d.weekday),week:de("mt-2 flex w-full",d.week),week_number_header:de("w-[--cell-size] select-none",d.week_number_header),week_number:de("text-muted-foreground select-none text-[0.8rem]",d.week_number),day:de("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",d.day),range_start:de("bg-accent rounded-l-md",d.range_start),range_middle:de("rounded-none",d.range_middle),range_end:de("bg-accent rounded-r-md",d.range_end),today:de("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:de("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:de("text-muted-foreground opacity-50",d.disabled),hidden:de("invisible",d.hidden),...t},components:{Root:({className:f,rootRef:m,...p})=>i.jsx("div",{"data-slot":"calendar",ref:m,className:de(f),...p}),Chevron:({className:f,orientation:m,...p})=>m==="left"?i.jsx(YO,{className:de("size-4",f),...p}):m==="right"?i.jsx(KO,{className:de("size-4",f),...p}):i.jsx(uh,{className:de("size-4",f),...p}),DayButton:DNe,WeekNumber:({children:f,...m})=>i.jsx("td",{...m,children:i.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...l},...u})}function DNe({className:e,day:t,modifiers:n,...r}){const a=TE(),o=y.useRef(null);return y.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),i.jsx(ue,{ref:o,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:de("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",a.day,e),...r})}class $Ne{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(r=>r.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(t)}catch(a){console.error("日志回调执行失败:",a)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const $c=new $Ne;typeof window<"u"&&$c.connect();const INe={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},LNe=(e,t,n)=>{let r;const a=INe[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},BNe={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},zNe={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},qNe={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},FNe={date:Zc({formats:BNe,defaultWidth:"full"}),time:Zc({formats:zNe,defaultWidth:"full"}),dateTime:Zc({formats:qNe,defaultWidth:"full"})};function qL(e,t,n){const r="eeee p";return JSe(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const UNe={lastWeek:qL,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:qL,other:"PP p"},HNe=(e,t,n,r)=>{const a=UNe[e];return typeof a=="function"?a(t,n,r):a},WNe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},VNe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},GNe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},YNe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},KNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},XNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},ZNe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},QNe={ordinalNumber:ZNe,era:ai({values:WNe,defaultWidth:"wide"}),quarter:ai({values:VNe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ai({values:GNe,defaultWidth:"wide"}),day:ai({values:YNe,defaultWidth:"wide"}),dayPeriod:ai({values:KNe,defaultWidth:"wide",formattingValues:XNe,defaultFormattingWidth:"wide"})},JNe=/^(第\s*)?\d+(日|时|分|秒)?/i,eCe=/\d+/i,tCe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},nCe={any:[/^(前)/i,/^(公元)/i]},rCe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},aCe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},iCe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},oCe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},sCe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},lCe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},cCe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},uCe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},dCe={ordinalNumber:MH({matchPattern:JNe,parsePattern:eCe,valueCallback:e=>parseInt(e,10)}),era:ii({matchPatterns:tCe,defaultMatchWidth:"wide",parsePatterns:nCe,defaultParseWidth:"any"}),quarter:ii({matchPatterns:rCe,defaultMatchWidth:"wide",parsePatterns:aCe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ii({matchPatterns:iCe,defaultMatchWidth:"wide",parsePatterns:oCe,defaultParseWidth:"any"}),day:ii({matchPatterns:sCe,defaultMatchWidth:"wide",parsePatterns:lCe,defaultParseWidth:"any"}),dayPeriod:ii({matchPatterns:cCe,defaultMatchWidth:"any",parsePatterns:uCe,defaultParseWidth:"any"})},Vp={code:"zh-CN",formatDistance:LNe,formatLong:FNe,formatRelative:HNe,localize:QNe,match:dCe,options:{weekStartsOn:1,firstWeekContainsDate:4}};function fCe(){const[e,t]=y.useState([]),[n,r]=y.useState(""),[a,o]=y.useState("all"),[l,u]=y.useState("all"),[d,f]=y.useState(void 0),[m,p]=y.useState(void 0),[g,x]=y.useState(!0),[j,b]=y.useState(!1),w=y.useRef(null),N=y.useRef(null);y.useEffect(()=>{const D=$c.getAllLogs();t(D);const H=$c.onLog(()=>{t($c.getAllLogs())}),V=$c.onConnectionChange(F=>{b(F)});return()=>{H(),V()}},[]),y.useEffect(()=>{g&&N.current&&N.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,g]);const A=y.useMemo(()=>{const D=new Set(e.map(H=>H.module));return Array.from(D).sort()},[e]),E=D=>{switch(D){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},T=D=>{switch(D){case"DEBUG":return"bg-secondary/50";case"INFO":return"bg-blue-500/10 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-500/10 dark:bg-yellow-500/20";case"ERROR":return"bg-red-500/10 dark:bg-red-500/20";case"CRITICAL":return"bg-red-600/20 dark:bg-red-600/30";default:return"bg-muted/50"}},C=()=>{window.location.reload()},k=()=>{$c.clearLogs(),t([])},O=()=>{const D=z.map(G=>`${G.timestamp} [${G.level.padEnd(8)}] [${G.module}] ${G.message}`).join(` -`),H=new Blob([D],{type:"text/plain;charset=utf-8"}),V=URL.createObjectURL(H),F=document.createElement("a");F.href=V,F.download=`logs-${uv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,F.click(),URL.revokeObjectURL(V)},M=()=>{x(!g)},I=()=>{f(void 0),p(void 0)},z=y.useMemo(()=>e.filter(D=>{const H=n===""||D.message.toLowerCase().includes(n.toLowerCase())||D.module.toLowerCase().includes(n.toLowerCase()),V=a==="all"||D.level===a,F=l==="all"||D.module===l;let G=!0;if(d||m){const L=new Date(D.timestamp);if(d){const R=new Date(d);R.setHours(0,0,0,0),G=G&&L>=R}if(m){const R=new Date(m);R.setHours(23,59,59,999),G=G&&L<=R}}return H&&V&&F&&G}),[e,n,a,l,d,m]);return i.jsx(Vt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:de("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",j?"bg-green-500 animate-pulse":"bg-red-500")}),i.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:j?"已连接":"未连接"})]})]}),i.jsx(st,{className:"p-3 sm:p-4",children:i.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索日志...",value:n,onChange:D=>r(D.target.value),className:"pl-9 h-9 text-sm"})]}),i.jsxs(Et,{value:a,onValueChange:o,children:[i.jsxs(wt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[i.jsx(GN,{className:"h-4 w-4 mr-2"}),i.jsx(At,{placeholder:"级别"})]}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部级别"}),i.jsx(Me,{value:"DEBUG",children:"DEBUG"}),i.jsx(Me,{value:"INFO",children:"INFO"}),i.jsx(Me,{value:"WARNING",children:"WARNING"}),i.jsx(Me,{value:"ERROR",children:"ERROR"}),i.jsx(Me,{value:"CRITICAL",children:"CRITICAL"})]})]}),i.jsxs(Et,{value:l,onValueChange:u,children:[i.jsxs(wt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[i.jsx(GN,{className:"h-4 w-4 mr-2"}),i.jsx(At,{placeholder:"模块"})]}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部模块"}),A.map(D=>i.jsx(Me,{value:D,children:D},D))]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",className:de("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!d&&"text-muted-foreground"),children:[i.jsx(UI,{className:"mr-2 h-4 w-4"}),i.jsx("span",{className:"text-xs sm:text-sm",children:d?uv(d,"PPP",{locale:Vp}):"开始日期"})]})}),i.jsx(so,{className:"w-auto p-0",align:"start",children:i.jsx(zL,{mode:"single",selected:d,onSelect:f,initialFocus:!0,locale:Vp})})]}),i.jsxs(ts,{children:[i.jsx(ns,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",className:de("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[i.jsx(UI,{className:"mr-2 h-4 w-4"}),i.jsx("span",{className:"text-xs sm:text-sm",children:m?uv(m,"PPP",{locale:Vp}):"结束日期"})]})}),i.jsx(so,{className:"w-auto p-0",align:"start",children:i.jsx(zL,{mode:"single",selected:m,onSelect:p,initialFocus:!0,locale:Vp})})]}),(d||m)&&i.jsxs(ue,{variant:"outline",size:"sm",onClick:I,className:"w-full sm:w-auto h-9",children:[i.jsx(Bh,{className:"h-4 w-4 sm:mr-2"}),i.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),i.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[i.jsxs("div",{className:"flex gap-2 flex-wrap",children:[i.jsxs(ue,{variant:g?"default":"outline",size:"sm",onClick:M,className:"flex-1 sm:flex-none h-9",children:[g?i.jsx(Gve,{className:"h-4 w-4"}):i.jsx(Xve,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:C,className:"flex-1 sm:flex-none h-9",children:[i.jsx(sl,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:k,className:"flex-1 sm:flex-none h-9",children:[i.jsx(Tt,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:O,className:"flex-1 sm:flex-none h-9",children:[i.jsx(WN,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),i.jsx("div",{className:"flex-1 hidden sm:block"}),i.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[i.jsxs("span",{className:"font-mono",children:[z.length," / ",e.length]}),i.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),i.jsx(st,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:i.jsx(Vt,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:i.jsxs("div",{ref:w,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[z.length===0?i.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):z.map(D=>i.jsxs("div",{className:de("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",T(D.level)),children:[i.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:D.timestamp}),i.jsxs("span",{className:de("text-xs font-semibold",E(D.level)),children:["[",D.level,"]"]})]}),i.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:D.module}),i.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:D.message})]}),i.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[i.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:D.timestamp}),i.jsxs("span",{className:de("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",E(D.level)),children:["[",D.level,"]"]}),i.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:D.module}),i.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:D.message})]})]},D.id)),i.jsx("div",{ref:N,className:"h-4"})]})})})]})})}const hCe="Mai-with-u",mCe="plugin-repo",pCe="main",vCe="plugin_details.json";async function gCe(){try{const e=await Qe("/api/webui/plugins/fetch-raw",{method:"POST",headers:lt(),body:JSON.stringify({owner:hCe,repo:mCe,branch:pCe,file_path:vCe})});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success||!t.data)throw new Error(t.error||"获取插件列表失败");return JSON.parse(t.data).filter(a=>!a?.id||!a?.manifest?(console.warn("跳过无效插件数据:",a),!1):!a.manifest.name||!a.manifest.version?(console.warn("跳过缺少必需字段的插件:",a.id),!1):!0).map(a=>({id:a.id,manifest:{manifest_version:a.manifest.manifest_version||1,name:a.manifest.name,version:a.manifest.version,description:a.manifest.description||"",author:a.manifest.author||{name:"Unknown"},license:a.manifest.license||"Unknown",host_application:a.manifest.host_application||{min_version:"0.0.0"},homepage_url:a.manifest.homepage_url,repository_url:a.manifest.repository_url,keywords:a.manifest.keywords||[],categories:a.manifest.categories||[],default_locale:a.manifest.default_locale||"zh-CN",locales_path:a.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function yCe(){try{const e=await Qe("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function xCe(){try{const e=await Qe("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function bCe(e,t,n){const r=e.split(".").map(u=>parseInt(u)||0),a=r[0]||0,o=r[1]||0,l=r[2]||0;if(n.version_majorparseInt(p)||0),d=u[0]||0,f=u[1]||0,m=u[2]||0;if(n.version_major>d||n.version_major===d&&n.version_minor>f||n.version_major===d&&n.version_minor===f&&n.version_patch>m)return!1}return!0}function wCe(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,a=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return a.onopen=()=>{console.log("Plugin progress WebSocket connected");const o=setInterval(()=>{a.readyState===WebSocket.OPEN?a.send("ping"):clearInterval(o)},3e4)},a.onmessage=o=>{try{if(o.data==="pong")return;const l=JSON.parse(o.data);e(l)}catch(l){console.error("Failed to parse progress data:",l)}},a.onerror=o=>{console.error("Plugin progress WebSocket error:",o),t?.(o)},a.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},a}async function Gp(){try{const e=await Qe("/api/webui/plugins/installed",{headers:lt()});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success)throw new Error(t.message||"获取已安装插件列表失败");return t.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function Yp(e,t){return t.some(n=>n.id===e)}function Kp(e,t){const n=t.find(r=>r.id===e);if(n)return n.manifest?.version||n.version}async function jCe(e,t,n="main"){const r=await Qe("/api/webui/plugins/install",{method:"POST",headers:lt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!r.ok){const a=await r.json();throw new Error(a.detail||"安装失败")}return await r.json()}async function SCe(e){const t=await Qe("/api/webui/plugins/uninstall",{method:"POST",headers:lt(),body:JSON.stringify({plugin_id:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"卸载失败")}return await t.json()}async function _Ce(e,t,n="main"){const r=await Qe("/api/webui/plugins/update",{method:"POST",headers:lt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!r.ok){const a=await r.json();throw new Error(a.detail||"更新失败")}return await r.json()}function NCe(){const e=oa(),[t,n]=y.useState(null),[r,a]=y.useState(""),[o,l]=y.useState("all"),[u,d]=y.useState("all"),[f,m]=y.useState(!1),[p,g]=y.useState([]),[x,j]=y.useState(!0),[b,w]=y.useState(null),[N,A]=y.useState(null),[E,T]=y.useState(null),[C,k]=y.useState(null),[,O]=y.useState([]),{toast:M}=mr();y.useEffect(()=>{let R=null,U=!1;return(async()=>{if(R=wCe(te=>{U||(T(te),te.stage==="success"?setTimeout(()=>{U||T(null)},2e3):te.stage==="error"&&(j(!1),w(te.error||"加载失败")))},te=>{console.error("WebSocket error:",te),U||M({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(te=>{if(!R){te();return}const $=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),te()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),te()):setTimeout($,100)};$()}),!U){const te=await yCe();A(te),te.installed||M({title:"Git 未安装",description:te.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!U){const te=await xCe();k(te)}if(!U)try{j(!0),w(null);const te=await gCe();if(!U){const $=await Gp();O($);const B=te.map(Y=>{const ne=Yp(Y.id,$),oe=Kp(Y.id,$);return{...Y,installed:ne,installed_version:oe}});for(const Y of $)!B.some(oe=>oe.id===Y.id)&&Y.manifest&&B.push({id:Y.id,manifest:{manifest_version:Y.manifest.manifest_version||1,name:Y.manifest.name,version:Y.manifest.version,description:Y.manifest.description||"",author:Y.manifest.author,license:Y.manifest.license||"Unknown",host_application:Y.manifest.host_application,homepage_url:Y.manifest.homepage_url,repository_url:Y.manifest.repository_url,keywords:Y.manifest.keywords||[],categories:Y.manifest.categories||[],default_locale:Y.manifest.default_locale||"zh-CN",locales_path:Y.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:Y.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(B)}}catch(te){if(!U){const $=te instanceof Error?te.message:"加载插件列表失败";w($),M({title:"加载失败",description:$,variant:"destructive"})}}finally{U||j(!1)}})(),()=>{U=!0,R&&R.close()}},[M]);const I=R=>{if(!R.installed&&C&&!z(R))return i.jsxs(Dt,{variant:"destructive",className:"gap-1",children:[i.jsx(bg,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const U=R.installed_version?.trim(),K=R.manifest.version?.trim();if(U!==K){const te=U?.split(".").map(Number)||[0,0,0],$=K?.split(".").map(Number)||[0,0,0];for(let B=0;B<3;B++){if(($[B]||0)>(te[B]||0))return i.jsxs(Dt,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[i.jsx(bg,{className:"h-3 w-3"}),"可更新"]});if(($[B]||0)<(te[B]||0))break}}return i.jsxs(Dt,{variant:"default",className:"gap-1",children:[i.jsx(Vo,{className:"h-3 w-3"}),"已安装"]})}return null},z=R=>!C||!R.manifest?.host_application?!0:bCe(R.manifest.host_application.min_version,R.manifest.host_application.max_version,C),D=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const U=R.installed_version.trim(),K=R.manifest.version.trim();if(U===K)return!1;const te=U.split(".").map(Number),$=K.split(".").map(Number);for(let B=0;B<3;B++){if(($[B]||0)>(te[B]||0))return!0;if(($[B]||0)<(te[B]||0))return!1}return!1},H=p.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const U=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(B=>B.toLowerCase().includes(r.toLowerCase())),K=o==="all"||R.manifest.categories&&R.manifest.categories.includes(o);let te=!0;u==="installed"?te=R.installed===!0:u==="updates"&&(te=R.installed===!0&&D(R));const $=!f||!C||z(R);return U&&K&&te&&$}),V=()=>{n(null)},F=async R=>{if(!N?.installed){M({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(C&&!z(R)){M({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await jCe(R.id,R.manifest.repository_url||"","main"),M({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const U=await Gp();O(U),g(K=>K.map(te=>{if(te.id===R.id){const $=Yp(te.id,U),B=Kp(te.id,U);return{...te,installed:$,installed_version:B}}return te}))}catch(U){M({title:"安装失败",description:U instanceof Error?U.message:"未知错误",variant:"destructive"})}},G=async R=>{try{await SCe(R.id),M({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const U=await Gp();O(U),g(K=>K.map(te=>{if(te.id===R.id){const $=Yp(te.id,U),B=Kp(te.id,U);return{...te,installed:$,installed_version:B}}return te}))}catch(U){M({title:"卸载失败",description:U instanceof Error?U.message:"未知错误",variant:"destructive"})}},L=async R=>{if(!N?.installed){M({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const U=await _Ce(R.id,R.manifest.repository_url||"","main");M({title:"更新成功",description:`${R.manifest.name} 已从 ${U.old_version} 更新到 ${U.new_version}`});const K=await Gp();O(K),g(te=>te.map($=>{if($.id===R.id){const B=Yp($.id,K),Y=Kp($.id,K);return{...$,installed:B,installed_version:Y}}return $}))}catch(U){M({title:"更新失败",description:U instanceof Error?U.message:"未知错误",variant:"destructive"})}};return i.jsx(Vt,{className:"h-full",children:i.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),i.jsxs(ue,{onClick:()=>e({to:"/plugin-mirrors"}),children:[i.jsx(sge,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),N&&!N.installed&&i.jsxs(st,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[i.jsx(qt,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Gc,{className:"h-5 w-5 text-orange-600"}),i.jsxs("div",{children:[i.jsx(Ft,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),i.jsx(er,{className:"text-orange-800 dark:text-orange-200",children:N.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),i.jsx(on,{children:i.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",i.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),i.jsx(st,{className:"p-4",children:i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索插件...",value:r,onChange:R=>a(R.target.value),className:"pl-9"})]}),i.jsxs(Et,{value:o,onValueChange:l,children:[i.jsx(wt,{className:"w-full sm:w-[200px]",children:i.jsx(At,{placeholder:"选择分类"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部分类"}),i.jsx(Me,{value:"Developer Tools",children:"开发工具"}),i.jsx(Me,{value:"AI Enhancement",children:"AI 增强"}),i.jsx(Me,{value:"Utility",children:"工具类"}),i.jsx(Me,{value:"Entertainment",children:"娱乐"}),i.jsx(Me,{value:"Integration",children:"集成"}),i.jsx(Me,{value:"Data Analysis",children:"数据分析"}),i.jsx(Me,{value:"Automation",children:"自动化"}),i.jsx(Me,{value:"Other",children:"其他"})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(rs,{id:"compatible-only",checked:f,onCheckedChange:R=>m(R===!0)}),i.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),i.jsx(ul,{value:u,onValueChange:d,className:"w-full",children:i.jsxs(Qo,{className:"grid w-full grid-cols-3",children:[i.jsxs(Ot,{value:"all",children:["全部插件 (",p.length,")"]}),i.jsxs(Ot,{value:"installed",children:["已安装 (",p.filter(R=>R.installed).length,")"]}),i.jsxs(Ot,{value:"updates",children:["可更新 (",p.filter(R=>R.installed&&D(R)).length,")"]})]})}),E&&E.stage==="loading"&&i.jsx(st,{className:"p-4",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(KN,{className:"h-4 w-4 animate-spin"}),i.jsxs("span",{className:"text-sm font-medium",children:[E.operation==="fetch"&&"加载插件列表",E.operation==="install"&&`安装插件${E.plugin_id?`: ${E.plugin_id}`:""}`,E.operation==="uninstall"&&`卸载插件${E.plugin_id?`: ${E.plugin_id}`:""}`,E.operation==="update"&&`更新插件${E.plugin_id?`: ${E.plugin_id}`:""}`]})]}),i.jsxs("span",{className:"text-sm font-medium",children:[E.progress,"%"]})]}),i.jsx(fE,{value:E.progress,className:"h-2"}),i.jsx("div",{className:"text-xs text-muted-foreground",children:E.message}),E.operation==="fetch"&&E.total_plugins>0&&i.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",E.loaded_plugins," / ",E.total_plugins," 个插件"]})]})}),E&&E.stage==="error"&&E.error&&i.jsx(st,{className:"border-destructive bg-destructive/10",children:i.jsx(qt,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Gc,{className:"h-5 w-5 text-destructive"}),i.jsxs("div",{children:[i.jsx(Ft,{className:"text-lg text-destructive",children:"加载失败"}),i.jsx(er,{className:"text-destructive/80",children:E.error})]})]})})}),x?i.jsxs("div",{className:"flex items-center justify-center py-12",children:[i.jsx(KN,{className:"h-8 w-8 animate-spin text-muted-foreground"}),i.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):b?i.jsx(st,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[i.jsx(Gc,{className:"h-12 w-12 text-destructive mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:b}),i.jsx(ue,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):H.length===0?i.jsx(st,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[i.jsx(Dr,{className:"h-12 w-12 text-muted-foreground mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r||o!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:H.map(R=>i.jsxs(st,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[i.jsxs(qt,{children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsx(Ft,{className:"text-xl",children:R.manifest?.name||R.id}),i.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&i.jsx(Dt,{variant:"secondary",className:"text-xs whitespace-nowrap",children:R.manifest.categories[0]}),I(R)]})]}),i.jsx(er,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),i.jsx(on,{className:"flex-1",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(WN,{className:"h-4 w-4"}),i.jsx("span",{children:R.downloads.toLocaleString()})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(VI,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),i.jsx("span",{children:R.rating.toFixed(1)})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(U=>i.jsx(Dt,{variant:"outline",className:"text-xs",children:U},U)),R.manifest?.keywords&&R.manifest.keywords.length>3&&i.jsxs(Dt,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),i.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[i.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{children:"支持:"}),i.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),i.jsx(W5,{className:"pt-4",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?D(R)?i.jsxs(ue,{size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>L(R),children:[i.jsx(sl,{className:"h-4 w-4 mr-1"}),"更新"]}):i.jsxs(ue,{variant:"destructive",size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>G(R),children:[i.jsx(Tt,{className:"h-4 w-4 mr-1"}),"卸载"]}):i.jsxs(ue,{size:"sm",disabled:!N?.installed||E?.operation==="install"||C!==null&&!z(R),title:N?.installed?C!==null&&!z(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${C?.version})`:void 0:"Git 未安装",onClick:()=>F(R),children:[i.jsx(WN,{className:"h-4 w-4 mr-1"}),E?.operation==="install"&&E?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),i.jsx(nr,{open:t!==null,onOpenChange:V,children:t&&t.manifest&&i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsx(Wn,{children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"space-y-2 flex-1",children:[i.jsx(Vn,{className:"text-2xl",children:t.manifest.name}),i.jsxs(dr,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&i.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:i.jsx(av,{className:"h-3 w-3 inline"})})]})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&i.jsx(Dt,{variant:"secondary",children:t.manifest.categories[0]}),I(t)]})]})}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"版本"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"下载量"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.downloads.toLocaleString()})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"评分"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(VI,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.rating.toFixed(1)," (",t.review_count,")"]})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"许可证"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),i.jsxs("div",{className:"col-span-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(R=>i.jsx(Dt,{variant:"outline",children:R},R))})]}),t.detailed_description&&i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),i.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:"主页: "}),i.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:"仓库: "}),i.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),i.jsxs($r,{children:[t.manifest.homepage_url&&i.jsxs(ue,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[i.jsx(av,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&i.jsxs(ue,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[i.jsx(av,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function CCe(){const e=oa(),{toast:t}=mr(),[n,r]=y.useState([]),[a,o]=y.useState(!0),[l,u]=y.useState(null),[d,f]=y.useState(null),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w=y.useCallback(async()=>{try{o(!0),u(null);const O=localStorage.getItem("access-token"),M=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${O}`}});if(!M.ok)throw new Error("获取镜像源列表失败");const I=await M.json();r(I.mirrors||[])}catch(O){const M=O instanceof Error?O.message:"加载镜像源失败";u(M),t({title:"加载失败",description:M,variant:"destructive"})}finally{o(!1)}},[t]);y.useEffect(()=>{w()},[w]);const N=async()=>{try{const O=localStorage.getItem("access-token"),M=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${O}`,"Content-Type":"application/json"},body:JSON.stringify(j)});if(!M.ok){const I=await M.json();throw new Error(I.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),p(!1),b({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w()}catch(O){t({title:"添加失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},A=async()=>{if(d)try{const O=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${d.id}`,{method:"PUT",headers:{Authorization:`Bearer ${O}`,"Content-Type":"application/json"},body:JSON.stringify({name:j.name,raw_prefix:j.raw_prefix,clone_prefix:j.clone_prefix,enabled:j.enabled,priority:j.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),x(!1),f(null),w()}catch(O){t({title:"更新失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},E=async O=>{if(confirm("确定要删除这个镜像源吗?"))try{const M=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${O}`,{method:"DELETE",headers:{Authorization:`Bearer ${M}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),w()}catch(M){t({title:"删除失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},T=async O=>{try{const M=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${O.id}`,{method:"PUT",headers:{Authorization:`Bearer ${M}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!O.enabled})})).ok)throw new Error("更新状态失败");w()}catch(M){t({title:"更新失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},C=O=>{f(O),b({id:O.id,name:O.name,raw_prefix:O.raw_prefix,clone_prefix:O.clone_prefix,enabled:O.enabled,priority:O.priority}),x(!0)},k=async(O,M)=>{const I=M==="up"?O.priority-1:O.priority+1;if(!(I<1))try{const z=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${O.id}`,{method:"PUT",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify({priority:I})})).ok)throw new Error("更新优先级失败");w()}catch(z){t({title:"更新失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}};return i.jsx(Vt,{className:"h-full",children:i.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:i.jsx(Xq,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),i.jsxs(ue,{onClick:()=>p(!0),children:[i.jsx(tr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),a?i.jsx(st,{className:"p-6",children:i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(KN,{className:"h-8 w-8 animate-spin text-primary"})})}):l?i.jsx(st,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[i.jsx(Gc,{className:"h-12 w-12 text-destructive mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),i.jsx(ue,{onClick:w,children:"重新加载"})]})}):i.jsxs(st,{children:[i.jsx("div",{className:"hidden md:block",children:i.jsxs(Al,{children:[i.jsx(Tl,{children:i.jsxs(vn,{children:[i.jsx(Ze,{children:"状态"}),i.jsx(Ze,{children:"名称"}),i.jsx(Ze,{children:"ID"}),i.jsx(Ze,{children:"优先级"}),i.jsx(Ze,{className:"text-right",children:"操作"})]})}),i.jsx(kl,{children:n.map(O=>i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx(at,{checked:O.enabled,onCheckedChange:()=>T(O)})}),i.jsx(Ue,{children:i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:O.name}),i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",O.raw_prefix]})]})}),i.jsx(Ue,{children:i.jsx(Dt,{variant:"outline",children:O.id})}),i.jsx(Ue,{children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono",children:O.priority}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(O,"up"),disabled:O.priority===1,children:i.jsx(FN,{className:"h-3 w-3"})}),i.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(O,"down"),children:i.jsx(uh,{className:"h-3 w-3"})})]})]})}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>C(O),children:i.jsx(Au,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>E(O.id),children:i.jsx(Tt,{className:"h-4 w-4 text-destructive"})})]})})]},O.id))})]})}),i.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(O=>i.jsx(st,{className:"p-4",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"font-semibold",children:O.name}),O.enabled&&i.jsx(Dt,{variant:"default",className:"text-xs",children:"启用"})]}),i.jsx(Dt,{variant:"outline",className:"mt-1 text-xs",children:O.id})]}),i.jsx(at,{checked:O.enabled,onCheckedChange:()=>T(O)})]}),i.jsxs("div",{className:"text-sm space-y-1",children:[i.jsxs("div",{className:"text-muted-foreground",children:[i.jsx("span",{className:"font-medium",children:"Raw: "}),i.jsx("span",{className:"break-all",children:O.raw_prefix})]}),i.jsxs("div",{className:"text-muted-foreground",children:[i.jsx("span",{className:"font-medium",children:"优先级: "}),i.jsx("span",{className:"font-mono",children:O.priority})]})]}),i.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[i.jsxs(ue,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>C(O),children:[i.jsx(Au,{className:"h-4 w-4 mr-1"}),"编辑"]}),i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>k(O,"up"),disabled:O.priority===1,children:i.jsx(FN,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>k(O,"down"),children:i.jsx(uh,{className:"h-4 w-4"})}),i.jsx(ue,{variant:"destructive",size:"sm",onClick:()=>E(O.id),children:i.jsx(Tt,{className:"h-4 w-4"})})]})]})},O.id))})]}),i.jsx(nr,{open:m,onOpenChange:p,children:i.jsxs(Hn,{className:"max-w-lg",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"添加镜像源"}),i.jsx(dr,{children:"添加新的 Git 镜像源配置"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-id",children:"镜像源 ID *"}),i.jsx(Ne,{id:"add-id",placeholder:"例如: my-mirror",value:j.id,onChange:O=>b({...j,id:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-name",children:"名称 *"}),i.jsx(Ne,{id:"add-name",placeholder:"例如: 我的镜像源",value:j.name,onChange:O=>b({...j,name:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),i.jsx(Ne,{id:"add-raw",placeholder:"https://example.com/raw",value:j.raw_prefix,onChange:O=>b({...j,raw_prefix:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-clone",children:"克隆前缀 *"}),i.jsx(Ne,{id:"add-clone",placeholder:"https://example.com/clone",value:j.clone_prefix,onChange:O=>b({...j,clone_prefix:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-priority",children:"优先级"}),i.jsx(Ne,{id:"add-priority",type:"number",min:"1",value:j.priority,onChange:O=>b({...j,priority:parseInt(O.target.value)||1})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"add-enabled",checked:j.enabled,onCheckedChange:O=>b({...j,enabled:O})}),i.jsx(J,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>p(!1),children:"取消"}),i.jsx(ue,{onClick:N,children:"添加"})]})]})}),i.jsx(nr,{open:g,onOpenChange:x,children:i.jsxs(Hn,{className:"max-w-lg",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑镜像源"}),i.jsx(dr,{children:"修改镜像源配置"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"镜像源 ID"}),i.jsx(Ne,{value:j.id,disabled:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-name",children:"名称 *"}),i.jsx(Ne,{id:"edit-name",value:j.name,onChange:O=>b({...j,name:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),i.jsx(Ne,{id:"edit-raw",value:j.raw_prefix,onChange:O=>b({...j,raw_prefix:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-clone",children:"克隆前缀 *"}),i.jsx(Ne,{id:"edit-clone",value:j.clone_prefix,onChange:O=>b({...j,clone_prefix:O.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-priority",children:"优先级"}),i.jsx(Ne,{id:"edit-priority",type:"number",min:"1",value:j.priority,onChange:O=>b({...j,priority:parseInt(O.target.value)||1})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"edit-enabled",checked:j.enabled,onCheckedChange:O=>b({...j,enabled:O})}),i.jsx(J,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),i.jsxs($r,{children:[i.jsx(ue,{variant:"outline",onClick:()=>x(!1),children:"取消"}),i.jsx(ue,{onClick:A,children:"保存"})]})]})})]})})}const OCe=qh("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),XH=y.forwardRef(({className:e,size:t,abbrTitle:n,children:r,...a},o)=>i.jsx("kbd",{className:de(OCe({size:t,className:e})),ref:o,...a,children:n?i.jsx("abbr",{title:n,children:r}):r}));XH.displayName="Kbd";const ECe=[{icon:Sg,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:XO,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:tF,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:Zq,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:QO,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Lh,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:Qq,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:rve,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:Jq,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:wg,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Vc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function ACe({open:e,onOpenChange:t}){const[n,r]=y.useState(""),[a,o]=y.useState(0),l=oa(),u=ECe.filter(m=>m.title.toLowerCase().includes(n.toLowerCase())||m.description.toLowerCase().includes(n.toLowerCase())||m.category.toLowerCase().includes(n.toLowerCase()));y.useEffect(()=>{e&&(r(""),o(0))},[e]);const d=y.useCallback(m=>{l({to:m}),t(!1)},[l,t]),f=y.useCallback(m=>{m.key==="ArrowDown"?(m.preventDefault(),o(p=>(p+1)%u.length)):m.key==="ArrowUp"?(m.preventDefault(),o(p=>(p-1+u.length)%u.length)):m.key==="Enter"&&u[a]&&(m.preventDefault(),d(u[a].path))},[u,a,d]);return i.jsx(nr,{open:e,onOpenChange:t,children:i.jsxs(Hn,{className:"max-w-2xl p-0 gap-0",children:[i.jsxs(Wn,{className:"px-4 pt-4 pb-0",children:[i.jsx(Vn,{className:"sr-only",children:"搜索"}),i.jsxs("div",{className:"relative",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),i.jsx(Ne,{value:n,onChange:m=>{r(m.target.value),o(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),i.jsx("div",{className:"border-t",children:i.jsx(Vt,{className:"h-[400px]",children:u.length>0?i.jsx("div",{className:"p-2",children:u.map((m,p)=>{const g=m.icon;return i.jsxs("button",{onClick:()=>d(m.path),onMouseEnter:()=>o(p),className:de("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",p===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[i.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm",children:m.title}),i.jsx("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]}),i.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:m.category})]},m.path)})}):i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i.jsx(Dr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),i.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function TCe(e){const t=kCe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(PCe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function kCe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=DCe(a),u=RCe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MCe=Symbol("radix.slottable");function PCe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MCe}function RCe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function DCe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vC=["Enter"," "],$Ce=["ArrowDown","PageUp","Home"],ZH=["ArrowUp","PageDown","End"],ICe=[...$Ce,...ZH],LCe={ltr:[...vC,"ArrowRight"],rtl:[...vC,"ArrowLeft"]},BCe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jh="Menu",[yh,zCe,qCe]=Ch(Jh),[Pl,QH]=hr(Jh,[qCe,us,Ug]),em=us(),JH=Ug(),[e9,vs]=Pl(Jh),[FCe,tm]=Pl(Jh),t9=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:l=!0}=e,u=em(t),[d,f]=y.useState(null),m=y.useRef(!1),p=nn(o),g=Lu(a);return y.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>m.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),i.jsx(Wh,{...u,children:i.jsx(e9,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:i.jsx(FCe,{scope:t,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:l,children:r})})})};t9.displayName=Jh;var UCe="MenuAnchor",kE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=em(n);return i.jsx(Vh,{...a,...r,ref:t})});kE.displayName=UCe;var ME="MenuPortal",[HCe,n9]=Pl(ME,{forceMount:void 0}),r9=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,o=vs(ME,t);return i.jsx(HCe,{scope:t,forceMount:n,children:i.jsx(Rn,{present:n||o.open,children:i.jsx(El,{asChild:!0,container:a,children:r})})})};r9.displayName=ME;var _a="MenuContent",[WCe,PE]=Pl(_a),a9=y.forwardRef((e,t)=>{const n=n9(_a,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=vs(_a,e.__scopeMenu),l=tm(_a,e.__scopeMenu);return i.jsx(yh.Provider,{scope:e.__scopeMenu,children:i.jsx(Rn,{present:r||o.open,children:i.jsx(yh.Slot,{scope:e.__scopeMenu,children:l.modal?i.jsx(VCe,{...a,ref:t}):i.jsx(GCe,{...a,ref:t})})})})}),VCe=y.forwardRef((e,t)=>{const n=vs(_a,e.__scopeMenu),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const o=r.current;if(o)return Dy(o)},[]),i.jsx(RE,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),GCe=y.forwardRef((e,t)=>{const n=vs(_a,e.__scopeMenu);return i.jsx(RE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),YCe=TCe("MenuContent.ScrollLock"),RE=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:j,...b}=e,w=vs(_a,n),N=tm(_a,n),A=em(n),E=JH(n),T=zCe(n),[C,k]=y.useState(null),O=y.useRef(null),M=qe(t,O,w.onContentChange),I=y.useRef(0),z=y.useRef(""),D=y.useRef(0),H=y.useRef(null),V=y.useRef("right"),F=y.useRef(0),G=j?Uh:y.Fragment,L=j?{as:YCe,allowPinchZoom:!0}:void 0,R=K=>{const te=z.current+K,$=T().filter(ee=>!ee.disabled),B=document.activeElement,Y=$.find(ee=>ee.ref.current===B)?.textValue,ne=$.map(ee=>ee.textValue),oe=oOe(ne,te,Y),xe=$.find(ee=>ee.textValue===oe)?.ref.current;(function ee(ae){z.current=ae,window.clearTimeout(I.current),ae!==""&&(I.current=window.setTimeout(()=>ee(""),1e3))})(te),xe&&setTimeout(()=>xe.focus())};y.useEffect(()=>()=>window.clearTimeout(I.current),[]),Py();const U=y.useCallback(K=>V.current===H.current?.side&&lOe(K,H.current?.area),[]);return i.jsx(WCe,{scope:n,searchRef:z,onItemEnter:y.useCallback(K=>{U(K)&&K.preventDefault()},[U]),onItemLeave:y.useCallback(K=>{U(K)||(O.current?.focus(),k(null))},[U]),onTriggerLeave:y.useCallback(K=>{U(K)&&K.preventDefault()},[U]),pointerGraceTimerRef:D,onPointerGraceIntentChange:y.useCallback(K=>{H.current=K},[]),children:i.jsx(G,{...L,children:i.jsx(Fh,{asChild:!0,trapped:a,onMountAutoFocus:Se(o,K=>{K.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:i.jsx(Ol,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:i.jsx(Z5,{asChild:!0,...E,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Se(d,K=>{N.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Hy,{role:"menu","aria-orientation":"vertical","data-state":w9(w.open),"data-radix-menu-content":"",dir:N.dir,...A,...b,ref:M,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,K=>{const $=K.target.closest("[data-radix-menu-content]")===K.currentTarget,B=K.ctrlKey||K.altKey||K.metaKey,Y=K.key.length===1;$&&(K.key==="Tab"&&K.preventDefault(),!B&&Y&&R(K.key));const ne=O.current;if(K.target!==ne||!ICe.includes(K.key))return;K.preventDefault();const xe=T().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);ZH.includes(K.key)&&xe.reverse(),aOe(xe)}),onBlur:Se(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(I.current),z.current="")}),onPointerMove:Se(e.onPointerMove,xh(K=>{const te=K.target,$=F.current!==K.clientX;if(K.currentTarget.contains(te)&&$){const B=K.clientX>F.current?"right":"left";V.current=B,F.current=K.clientX}}))})})})})})})});a9.displayName=_a;var KCe="MenuGroup",DE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Pe.div,{role:"group",...r,ref:t})});DE.displayName=KCe;var XCe="MenuLabel",i9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Pe.div,{...r,ref:t})});i9.displayName=XCe;var Pg="MenuItem",FL="menu.itemSelect",ex=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,o=y.useRef(null),l=tm(Pg,e.__scopeMenu),u=PE(Pg,e.__scopeMenu),d=qe(t,o),f=y.useRef(!1),m=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(FL,{bubbles:!0,cancelable:!0});p.addEventListener(FL,x=>r?.(x),{once:!0}),LC(p,g),g.defaultPrevented?f.current=!1:l.onClose()}};return i.jsx(o9,{...a,ref:d,disabled:n,onClick:Se(e.onClick,m),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Se(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,p=>{const g=u.searchRef.current!=="";n||g&&p.key===" "||vC.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});ex.displayName=Pg;var o9=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,l=PE(Pg,n),u=JH(n),d=y.useRef(null),f=qe(t,d),[m,p]=y.useState(!1),[g,x]=y.useState("");return y.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[o.children]),i.jsx(yh.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:i.jsx(Q5,{asChild:!0,...u,focusable:!r,children:i.jsx(Pe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Se(e.onPointerMove,xh(j=>{r?l.onItemLeave(j):(l.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,xh(j=>l.onItemLeave(j))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),ZCe="MenuCheckboxItem",s9=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return i.jsx(f9,{scope:e.__scopeMenu,checked:n,children:i.jsx(ex,{role:"menuitemcheckbox","aria-checked":Rg(n)?"mixed":n,...a,ref:t,"data-state":LE(n),onSelect:Se(a.onSelect,()=>r?.(Rg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});s9.displayName=ZCe;var l9="MenuRadioGroup",[QCe,JCe]=Pl(l9,{value:void 0,onValueChange:()=>{}}),c9=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,o=nn(r);return i.jsx(QCe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:i.jsx(DE,{...a,ref:t})})});c9.displayName=l9;var u9="MenuRadioItem",d9=y.forwardRef((e,t)=>{const{value:n,...r}=e,a=JCe(u9,e.__scopeMenu),o=n===a.value;return i.jsx(f9,{scope:e.__scopeMenu,checked:o,children:i.jsx(ex,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":LE(o),onSelect:Se(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});d9.displayName=u9;var $E="MenuItemIndicator",[f9,eOe]=Pl($E,{checked:!1}),h9=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,o=eOe($E,n);return i.jsx(Rn,{present:r||Rg(o.checked)||o.checked===!0,children:i.jsx(Pe.span,{...a,ref:t,"data-state":LE(o.checked)})})});h9.displayName=$E;var tOe="MenuSeparator",m9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});m9.displayName=tOe;var nOe="MenuArrow",p9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=em(n);return i.jsx(Wy,{...a,...r,ref:t})});p9.displayName=nOe;var IE="MenuSub",[rOe,v9]=Pl(IE),g9=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,o=vs(IE,t),l=em(t),[u,d]=y.useState(null),[f,m]=y.useState(null),p=nn(a);return y.useEffect(()=>(o.open===!1&&p(!1),()=>p(!1)),[o.open,p]),i.jsx(Wh,{...l,children:i.jsx(e9,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:m,children:i.jsx(rOe,{scope:t,contentId:Fn(),triggerId:Fn(),trigger:u,onTriggerChange:d,children:n})})})};g9.displayName=IE;var pf="MenuSubTrigger",y9=y.forwardRef((e,t)=>{const n=vs(pf,e.__scopeMenu),r=tm(pf,e.__scopeMenu),a=v9(pf,e.__scopeMenu),o=PE(pf,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),d(null)}},[u,d]),i.jsx(kE,{asChild:!0,...f,children:i.jsx(o9,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":w9(n.open),...e,ref:Rr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,xh(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Se(e.onPointerLeave,xh(p=>{m();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,w=g[j?"left":"right"],N=g[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:w,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:w,y:g.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||LCe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});y9.displayName=pf;var x9="MenuSubContent",b9=y.forwardRef((e,t)=>{const n=n9(_a,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=vs(_a,e.__scopeMenu),l=tm(_a,e.__scopeMenu),u=v9(x9,e.__scopeMenu),d=y.useRef(null),f=qe(t,d);return i.jsx(yh.Provider,{scope:e.__scopeMenu,children:i.jsx(Rn,{present:r||o.open,children:i.jsx(yh.Slot,{scope:e.__scopeMenu,children:i.jsx(RE,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Se(e.onFocusOutside,m=>{m.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Se(e.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),g=BCe[l.dir].includes(m.key);p&&g&&(o.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});b9.displayName=x9;function w9(e){return e?"open":"closed"}function Rg(e){return e==="indeterminate"}function LE(e){return Rg(e)?"indeterminate":e?"checked":"unchecked"}function aOe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function iOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function oOe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=iOe(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function sOe(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function lOe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return sOe(n,t)}function xh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cOe=t9,uOe=kE,dOe=r9,fOe=a9,hOe=DE,mOe=i9,pOe=ex,vOe=s9,gOe=c9,yOe=d9,xOe=h9,bOe=m9,wOe=p9,jOe=g9,SOe=y9,_Oe=b9,BE="ContextMenu",[NOe]=hr(BE,[QH]),pr=QH(),[COe,j9]=NOe(BE),S9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:a,modal:o=!0}=e,[l,u]=y.useState(!1),d=pr(t),f=nn(r),m=y.useCallback(p=>{u(p),f(p)},[f]);return i.jsx(COe,{scope:t,open:l,onOpenChange:m,modal:o,children:i.jsx(cOe,{...d,dir:a,open:l,onOpenChange:m,modal:o,children:n})})};S9.displayName=BE;var _9="ContextMenuTrigger",N9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...a}=e,o=j9(_9,n),l=pr(n),u=y.useRef({x:0,y:0}),d=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),f=y.useRef(0),m=y.useCallback(()=>window.clearTimeout(f.current),[]),p=g=>{u.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return y.useEffect(()=>m,[m]),y.useEffect(()=>void(r&&m()),[r,m]),i.jsxs(i.Fragment,{children:[i.jsx(uOe,{...l,virtualRef:d}),i.jsx(Pe.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Se(e.onContextMenu,g=>{m(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Se(e.onPointerDown,Xp(g=>{m(),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Se(e.onPointerMove,Xp(m)),onPointerCancel:r?e.onPointerCancel:Se(e.onPointerCancel,Xp(m)),onPointerUp:r?e.onPointerUp:Se(e.onPointerUp,Xp(m))})]})});N9.displayName=_9;var OOe="ContextMenuPortal",C9=e=>{const{__scopeContextMenu:t,...n}=e,r=pr(t);return i.jsx(dOe,{...r,...n})};C9.displayName=OOe;var O9="ContextMenuContent",E9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=j9(O9,n),o=pr(n),l=y.useRef(!1);return i.jsx(fOe,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),!u.defaultPrevented&&!a.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E9.displayName=O9;var EOe="ContextMenuGroup",AOe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(hOe,{...a,...r,ref:t})});AOe.displayName=EOe;var TOe="ContextMenuLabel",A9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(mOe,{...a,...r,ref:t})});A9.displayName=TOe;var kOe="ContextMenuItem",T9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(pOe,{...a,...r,ref:t})});T9.displayName=kOe;var MOe="ContextMenuCheckboxItem",k9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(vOe,{...a,...r,ref:t})});k9.displayName=MOe;var POe="ContextMenuRadioGroup",ROe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(gOe,{...a,...r,ref:t})});ROe.displayName=POe;var DOe="ContextMenuRadioItem",M9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(yOe,{...a,...r,ref:t})});M9.displayName=DOe;var $Oe="ContextMenuItemIndicator",P9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(xOe,{...a,...r,ref:t})});P9.displayName=$Oe;var IOe="ContextMenuSeparator",R9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(bOe,{...a,...r,ref:t})});R9.displayName=IOe;var LOe="ContextMenuArrow",BOe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(wOe,{...a,...r,ref:t})});BOe.displayName=LOe;var D9="ContextMenuSub",$9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,defaultOpen:o}=e,l=pr(t),[u,d]=Na({prop:a,defaultProp:o??!1,onChange:r,caller:D9});return i.jsx(jOe,{...l,open:u,onOpenChange:d,children:n})};$9.displayName=D9;var zOe="ContextMenuSubTrigger",I9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(SOe,{...a,...r,ref:t})});I9.displayName=zOe;var qOe="ContextMenuSubContent",L9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(_Oe,{...a,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});L9.displayName=qOe;function Xp(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var FOe=S9,UOe=N9,HOe=C9,B9=E9,z9=A9,q9=T9,F9=k9,U9=M9,H9=P9,W9=R9,WOe=$9,V9=I9,G9=L9;const VOe=FOe,GOe=UOe,YOe=WOe,Y9=y.forwardRef(({className:e,inset:t,children:n,...r},a)=>i.jsxs(V9,{ref:a,className:de("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,i.jsx(KO,{className:"ml-auto h-4 w-4"})]}));Y9.displayName=V9.displayName;const K9=y.forwardRef(({className:e,...t},n)=>i.jsx(G9,{ref:n,className:de("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));K9.displayName=G9.displayName;const X9=y.forwardRef(({className:e,...t},n)=>i.jsx(HOe,{children:i.jsx(B9,{ref:n,className:de("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));X9.displayName=B9.displayName;const Da=y.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(q9,{ref:r,className:de("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Da.displayName=q9.displayName;const KOe=y.forwardRef(({className:e,children:t,checked:n,...r},a)=>i.jsxs(F9,{ref:a,className:de("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(H9,{children:i.jsx(il,{className:"h-4 w-4"})})}),t]}));KOe.displayName=F9.displayName;const XOe=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(U9,{ref:r,className:de("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(H9,{children:i.jsx(yve,{className:"h-2 w-2 fill-current"})})}),t]}));XOe.displayName=U9.displayName;const ZOe=y.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(z9,{ref:r,className:de("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));ZOe.displayName=z9.displayName;const vf=y.forwardRef(({className:e,...t},n)=>i.jsx(W9,{ref:n,className:de("-mx-1 my-1 h-px bg-border",e),...t}));vf.displayName=W9.displayName;const Ic=({className:e,...t})=>i.jsx("span",{className:de("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ic.displayName="ContextMenuShortcut";var QOe=Symbol("radix.slottable");function JOe(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=QOe,t}var[tx]=hr("Tooltip",[us]),nx=us(),Z9="TooltipProvider",eEe=700,gC="tooltip.open",[tEe,zE]=tx(Z9),Q9=e=>{const{__scopeTooltip:t,delayDuration:n=eEe,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,l=y.useRef(!0),u=y.useRef(!1),d=y.useRef(0);return y.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),i.jsx(tEe,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:o})};Q9.displayName=Z9;var bh="Tooltip",[nEe,nm]=tx(bh),J9=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,d=zE(bh,e.__scopeTooltip),f=nx(t),[m,p]=y.useState(null),g=Fn(),x=y.useRef(0),j=l??d.disableHoverableContent,b=u??d.delayDuration,w=y.useRef(!1),[N,A]=Na({prop:r,defaultProp:a??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(gC))):d.onClose(),o?.(O)},caller:bh}),E=y.useMemo(()=>N?w.current?"delayed-open":"instant-open":"closed",[N]),T=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,A(!0)},[A]),C=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,A(!1)},[A]),k=y.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,A(!0),x.current=0},b)},[b,A]);return y.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),i.jsx(Wh,{...f,children:i.jsx(nEe,{scope:t,contentId:g,open:N,stateAttribute:E,trigger:m,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{d.isOpenDelayedRef.current?k():T()},[d.isOpenDelayedRef,k,T]),onTriggerLeave:y.useCallback(()=>{j?C():(window.clearTimeout(x.current),x.current=0)},[C,j]),onOpen:T,onClose:C,disableHoverableContent:j,children:n})})};J9.displayName=bh;var yC="TooltipTrigger",eW=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=nm(yC,n),o=zE(yC,n),l=nx(n),u=y.useRef(null),d=qe(t,u,a.onTriggerChange),f=y.useRef(!1),m=y.useRef(!1),p=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),i.jsx(Vh,{asChild:!0,...l,children:i.jsx(Pe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Se(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Se(e.onBlur,a.onClose),onClick:Se(e.onClick,a.onClose)})})});eW.displayName=yC;var qE="TooltipPortal",[rEe,aEe]=tx(qE,{forceMount:void 0}),tW=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,o=nm(qE,t);return i.jsx(rEe,{scope:t,forceMount:n,children:i.jsx(Rn,{present:n||o.open,children:i.jsx(El,{asChild:!0,container:a,children:r})})})};tW.displayName=qE;var Pu="TooltipContent",nW=y.forwardRef((e,t)=>{const n=aEe(Pu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,l=nm(Pu,e.__scopeTooltip);return i.jsx(Rn,{present:r||l.open,children:l.disableHoverableContent?i.jsx(rW,{side:a,...o,ref:t}):i.jsx(iEe,{side:a,...o,ref:t})})}),iEe=y.forwardRef((e,t)=>{const n=nm(Pu,e.__scopeTooltip),r=zE(Pu,e.__scopeTooltip),a=y.useRef(null),o=qe(t,a),[l,u]=y.useState(null),{trigger:d,onClose:f}=n,m=a.current,{onPointerInTransitChange:p}=r,g=y.useCallback(()=>{u(null),p(!1)},[p]),x=y.useCallback((j,b)=>{const w=j.currentTarget,N={x:j.clientX,y:j.clientY},A=uEe(N,w.getBoundingClientRect()),E=dEe(N,A),T=fEe(b.getBoundingClientRect()),C=mEe([...E,...T]);u(C),p(!0)},[p]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(d&&m){const j=w=>x(w,m),b=w=>x(w,d);return d.addEventListener("pointerleave",j),m.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),m.removeEventListener("pointerleave",b)}}},[d,m,x,g]),y.useEffect(()=>{if(l){const j=b=>{const w=b.target,N={x:b.clientX,y:b.clientY},A=d?.contains(w)||m?.contains(w),E=!hEe(N,l);A?g():E&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,m,l,f,g]),i.jsx(rW,{...e,ref:o})}),[oEe,sEe]=tx(bh,{isInside:!1}),lEe=JOe("TooltipContent"),rW=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=nm(Pu,n),f=nx(n),{onClose:m}=d;return y.useEffect(()=>(document.addEventListener(gC,m),()=>document.removeEventListener(gC,m)),[m]),y.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,m]),i.jsx(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:i.jsxs(Hy,{"data-state":d.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(lEe,{children:r}),i.jsx(oEe,{scope:n,isInside:!0,children:i.jsx(fwe,{id:d.contentId,role:"tooltip",children:a||r})})]})})});nW.displayName=Pu;var aW="TooltipArrow",cEe=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=nx(n);return sEe(aW,n).isInside?null:i.jsx(Wy,{...a,...r,ref:t})});cEe.displayName=aW;function uEe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function dEe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function fEe(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function hEe(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function mEe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),pEe(t)}function pEe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(a.y-l.y)>=(o.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(a.y-l.y)>=(o.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vEe=Q9,gEe=J9,yEe=eW,xEe=tW,iW=nW;const bEe=vEe,wEe=gEe,jEe=yEe,oW=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(xEe,{children:i.jsx(iW,{ref:r,sideOffset:t,className:de("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));oW.displayName=iW.displayName;function SEe({children:e}){Vxe();const[t,n]=y.useState(!0),[r,a]=y.useState(!1),[o,l]=y.useState(!1),{theme:u,setTheme:d}=JO(),f=BY(),m=oa();y.useEffect(()=>{const b=w=>{(w.metaKey||w.ctrlKey)&&w.key==="k"&&(w.preventDefault(),l(!0))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const p=[{title:"概览",items:[{icon:Sg,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:XO,label:"麦麦主程序配置",path:"/config/bot"},{icon:tF,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:Zq,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:QO,label:"表情包管理",path:"/resource/emoji"},{icon:Lh,label:"表达方式管理",path:"/resource/expression"},{icon:Qq,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:Jq,label:"插件市场",path:"/plugins"},{icon:wg,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Vc,label:"系统设置",path:"/settings"}]}],x=u==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u,j=()=>{localStorage.removeItem("access-token"),m({to:"/auth"})};return i.jsx(bEe,{delayDuration:300,children:i.jsxs("div",{className:"flex h-screen overflow-hidden",children:[i.jsxs("aside",{className:de("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[i.jsx("div",{className:"flex h-16 items-center border-b px-4",children:i.jsxs("div",{className:de("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[i.jsxs("div",{className:de("flex items-baseline gap-2",!t&&"lg:hidden"),children:[i.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),i.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:aye()})]}),!t&&i.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),i.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:i.jsx("ul",{className:de("space-y-6",!t&&"lg:space-y-3"),children:p.map((b,w)=>i.jsxs("li",{children:[i.jsx("div",{className:de("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:i.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:b.title})}),!t&&w>0&&i.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),i.jsx("ul",{className:"space-y-1",children:b.items.map(N=>{const A=f({to:N.path}),E=N.icon,T=i.jsxs(i.Fragment,{children:[A&&i.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),i.jsxs("div",{className:de("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[i.jsx(E,{className:de("h-5 w-5 flex-shrink-0",A&&"text-primary"),strokeWidth:2,fill:"none"}),i.jsx("span",{className:de("text-sm font-medium whitespace-nowrap transition-all duration-300",A&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:N.label})]})]});return i.jsx("li",{className:"relative",children:i.jsxs(wEe,{children:[i.jsx(jEe,{asChild:!0,children:i.jsx(kC,{to:N.path,className:de("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",A?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>a(!1),children:T})}),!t&&i.jsx(oW,{side:"right",className:"hidden lg:block",children:i.jsx("p",{children:N.label})})]})},N.path)})})]},b.title))})})]}),r&&i.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>a(!1)}),i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("button",{onClick:()=>a(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:i.jsx(qve,{className:"h-5 w-5"})}),i.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:i.jsx(YO,{className:de("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>l(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),i.jsxs(XH,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[i.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),i.jsx(ACe,{open:o,onOpenChange:l}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[i.jsx(Zpe,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),i.jsx("button",{onClick:b=>{zge(x==="dark"?"light":"dark",d,b)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?i.jsx(ZN,{className:"h-5 w-5"}):i.jsx(XN,{className:"h-5 w-5"})}),i.jsx("div",{className:"h-6 w-px bg-border"}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:j,className:"gap-2",title:"登出系统",children:[i.jsx(WI,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),i.jsxs(VOe,{children:[i.jsx(GOe,{asChild:!0,children:i.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),i.jsxs(X9,{className:"w-64",children:[i.jsxs(Da,{onClick:()=>m({to:"/"}),children:[i.jsx(Sg,{className:"mr-2 h-4 w-4"}),"首页"]}),i.jsxs(Da,{onClick:()=>m({to:"/settings"}),children:[i.jsx(Vc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),i.jsxs(Da,{onClick:()=>m({to:"/logs"}),children:[i.jsx(wg,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),i.jsx(vf,{}),i.jsxs(YOe,{children:[i.jsxs(Y9,{children:[i.jsx(eF,{className:"mr-2 h-4 w-4"}),"切换主题"]}),i.jsxs(K9,{className:"w-48",children:[i.jsxs(Da,{onClick:()=>d("light"),disabled:u==="light",children:[i.jsx(ZN,{className:"mr-2 h-4 w-4"}),"浅色",u==="light"&&i.jsx(Ic,{children:"✓"})]}),i.jsxs(Da,{onClick:()=>d("dark"),disabled:u==="dark",children:[i.jsx(XN,{className:"mr-2 h-4 w-4"}),"深色",u==="dark"&&i.jsx(Ic,{children:"✓"})]}),i.jsxs(Da,{onClick:()=>d("system"),disabled:u==="system",children:[i.jsx(Vc,{className:"mr-2 h-4 w-4"}),"跟随系统",u==="system"&&i.jsx(Ic,{children:"✓"})]})]})]}),i.jsx(vf,{}),i.jsxs(Da,{onClick:()=>window.location.reload(),children:[i.jsx(nge,{className:"mr-2 h-4 w-4"}),"刷新页面",i.jsx(Ic,{children:"⌘R"})]}),i.jsxs(Da,{onClick:()=>l(!0),children:[i.jsx(Dr,{className:"mr-2 h-4 w-4"}),"搜索",i.jsx(Ic,{children:"⌘K"})]}),i.jsx(vf,{}),i.jsxs(Da,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[i.jsx(av,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),i.jsx(vf,{}),i.jsxs(Da,{onClick:j,className:"text-destructive focus:text-destructive",children:[i.jsx(WI,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const rm=TY({component:()=>i.jsxs(i.Fragment,{children:[i.jsx(MC,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!h8())throw YL({to:"/auth"})}}),_Ee=fr({getParentRoute:()=>rm,path:"/auth",component:Gxe}),NEe=fr({getParentRoute:()=>rm,path:"/setup",component:jbe}),Aa=fr({getParentRoute:()=>rm,id:"protected",component:()=>i.jsx(SEe,{children:i.jsx(MC,{})})}),CEe=fr({getParentRoute:()=>Aa,path:"/",component:Lge}),OEe=fr({getParentRoute:()=>Aa,path:"/config/bot",component:dje}),EEe=fr({getParentRoute:()=>Aa,path:"/config/modelProvider",component:kje}),AEe=fr({getParentRoute:()=>Aa,path:"/config/model",component:i1e}),TEe=fr({getParentRoute:()=>Aa,path:"/resource/emoji",component:h1e}),kEe=fr({getParentRoute:()=>Aa,path:"/resource/expression",component:j1e}),MEe=fr({getParentRoute:()=>Aa,path:"/resource/person",component:k1e}),PEe=fr({getParentRoute:()=>Aa,path:"/logs",component:fCe}),REe=fr({getParentRoute:()=>Aa,path:"/plugins",component:NCe}),DEe=fr({getParentRoute:()=>Aa,path:"/plugin-mirrors",component:CCe}),$Ee=fr({getParentRoute:()=>Aa,path:"/settings",component:Bxe}),IEe=fr({getParentRoute:()=>rm,path:"*",component:j8}),LEe=rm.addChildren([_Ee,NEe,Aa.addChildren([CEe,OEe,EEe,AEe,TEe,kEe,MEe,REe,DEe,PEe,$Ee]),IEe]),BEe=zY({routeTree:LEe,defaultNotFoundComponent:j8});function zEe({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...r}){const[a,o]=y.useState(()=>localStorage.getItem(n)||t);y.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]),y.useEffect(()=>{const u=localStorage.getItem("accent-color");if(u){const d=document.documentElement,m={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%"},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%"},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%"},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%"},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%"}}[u];m&&d.style.setProperty("--primary",m.hsl)}},[]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return i.jsx(aF.Provider,{...r,value:l,children:e})}function qEe({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:a="enable-waves-background"}){const[o,l]=y.useState(()=>{const m=localStorage.getItem(r);return m!==null?m==="true":t}),[u,d]=y.useState(()=>{const m=localStorage.getItem(a);return m!==null?m==="true":n});y.useEffect(()=>{const m=document.documentElement;o?m.classList.remove("no-animations"):m.classList.add("no-animations"),localStorage.setItem(r,String(o))},[o,r]),y.useEffect(()=>{localStorage.setItem(a,String(u))},[u,a]);const f={enableAnimations:o,setEnableAnimations:l,enableWavesBackground:u,setEnableWavesBackground:d};return i.jsx(iF.Provider,{value:f,children:e})}var FE="ToastProvider",[UE,FEe,UEe]=Ch("Toast"),[sW]=hr("Toast",[UEe]),[HEe,rx]=sW(FE),lW=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:l}=e,[u,d]=y.useState(null),[f,m]=y.useState(0),p=y.useRef(!1),g=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${FE}\`. Expected non-empty \`string\`.`),i.jsx(UE.Provider,{scope:t,children:i.jsx(HEe,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:o,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:y.useCallback(()=>m(x=>x+1),[]),onToastRemove:y.useCallback(()=>m(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:l})})};lW.displayName=FE;var cW="ToastViewport",WEe=["F8"],xC="toast.viewportPause",bC="toast.viewportResume",uW=y.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=WEe,label:a="Notifications ({hotkey})",...o}=e,l=rx(cW,n),u=FEe(n),d=y.useRef(null),f=y.useRef(null),m=y.useRef(null),p=y.useRef(null),g=qe(t,p,l.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=l.toastCount>0;y.useEffect(()=>{const w=N=>{r.length!==0&&r.every(E=>N[E]||N.code===E)&&p.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),y.useEffect(()=>{const w=d.current,N=p.current;if(j&&w&&N){const A=()=>{if(!l.isClosePausedRef.current){const k=new CustomEvent(xC);N.dispatchEvent(k),l.isClosePausedRef.current=!0}},E=()=>{if(l.isClosePausedRef.current){const k=new CustomEvent(bC);N.dispatchEvent(k),l.isClosePausedRef.current=!1}},T=k=>{!w.contains(k.relatedTarget)&&E()},C=()=>{w.contains(document.activeElement)||E()};return w.addEventListener("focusin",A),w.addEventListener("focusout",T),w.addEventListener("pointermove",A),w.addEventListener("pointerleave",C),window.addEventListener("blur",A),window.addEventListener("focus",E),()=>{w.removeEventListener("focusin",A),w.removeEventListener("focusout",T),w.removeEventListener("pointermove",A),w.removeEventListener("pointerleave",C),window.removeEventListener("blur",A),window.removeEventListener("focus",E)}}},[j,l.isClosePausedRef]);const b=y.useCallback(({tabbingDirection:w})=>{const A=u().map(E=>{const T=E.ref.current,C=[T,...aAe(T)];return w==="forwards"?C:C.reverse()});return(w==="forwards"?A.reverse():A).flat()},[u]);return y.useEffect(()=>{const w=p.current;if(w){const N=A=>{const E=A.altKey||A.ctrlKey||A.metaKey;if(A.key==="Tab"&&!E){const C=document.activeElement,k=A.shiftKey;if(A.target===w&&k){f.current?.focus();return}const I=b({tabbingDirection:k?"backwards":"forwards"}),z=I.findIndex(D=>D===C);l_(I.slice(z+1))?A.preventDefault():k?f.current?.focus():m.current?.focus()}};return w.addEventListener("keydown",N),()=>w.removeEventListener("keydown",N)}},[u,b]),i.jsxs(hye,{ref:d,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&i.jsx(wC,{ref:f,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"forwards"});l_(w)}}),i.jsx(UE.Slot,{scope:n,children:i.jsx(Pe.ol,{tabIndex:-1,...o,ref:g})}),j&&i.jsx(wC,{ref:m,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"backwards"});l_(w)}})]})});uW.displayName=cW;var dW="ToastFocusProxy",wC=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,o=rx(dW,n);return i.jsx(Vy,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!o.viewport?.contains(u)&&r()}})});wC.displayName=dW;var am="Toast",VEe="toast.swipeStart",GEe="toast.swipeMove",YEe="toast.swipeCancel",KEe="toast.swipeEnd",fW=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:o,...l}=e,[u,d]=Na({prop:r,defaultProp:a??!0,onChange:o,caller:am});return i.jsx(Rn,{present:n||u,children:i.jsx(QEe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:nn(e.onPause),onResume:nn(e.onResume),onSwipeStart:Se(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Se(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});fW.displayName=am;var[XEe,ZEe]=sW(am,{onClose(){}}),QEe=y.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:o,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:x,...j}=e,b=rx(am,n),[w,N]=y.useState(null),A=qe(t,F=>N(F)),E=y.useRef(null),T=y.useRef(null),C=a||b.duration,k=y.useRef(0),O=y.useRef(C),M=y.useRef(0),{onToastAdd:I,onToastRemove:z}=b,D=nn(()=>{w?.contains(document.activeElement)&&b.viewport?.focus(),l()}),H=y.useCallback(F=>{!F||F===1/0||(window.clearTimeout(M.current),k.current=new Date().getTime(),M.current=window.setTimeout(D,F))},[D]);y.useEffect(()=>{const F=b.viewport;if(F){const G=()=>{H(O.current),f?.()},L=()=>{const R=new Date().getTime()-k.current;O.current=O.current-R,window.clearTimeout(M.current),d?.()};return F.addEventListener(xC,L),F.addEventListener(bC,G),()=>{F.removeEventListener(xC,L),F.removeEventListener(bC,G)}}},[b.viewport,C,d,f,H]),y.useEffect(()=>{o&&!b.isClosePausedRef.current&&H(C)},[o,C,b.isClosePausedRef,H]),y.useEffect(()=>(I(),()=>z()),[I,z]);const V=y.useMemo(()=>w?xW(w):null,[w]);return b.viewport?i.jsxs(i.Fragment,{children:[V&&i.jsx(JEe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),i.jsx(XEe,{scope:n,onClose:D,children:wl.createPortal(i.jsx(UE.ItemSlot,{scope:n,children:i.jsx(fye,{asChild:!0,onEscapeKeyDown:Se(u,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(Pe.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:A,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,F=>{F.key==="Escape"&&(u?.(F.nativeEvent),F.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Se(e.onPointerDown,F=>{F.button===0&&(E.current={x:F.clientX,y:F.clientY})}),onPointerMove:Se(e.onPointerMove,F=>{if(!E.current)return;const G=F.clientX-E.current.x,L=F.clientY-E.current.y,R=!!T.current,U=["left","right"].includes(b.swipeDirection),K=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,te=U?K(0,G):0,$=U?0:K(0,L),B=F.pointerType==="touch"?10:2,Y={x:te,y:$},ne={originalEvent:F,delta:Y};R?(T.current=Y,Zp(GEe,p,ne,{discrete:!1})):UL(Y,b.swipeDirection,B)?(T.current=Y,Zp(VEe,m,ne,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(G)>B||Math.abs(L)>B)&&(E.current=null)}),onPointerUp:Se(e.onPointerUp,F=>{const G=T.current,L=F.target;if(L.hasPointerCapture(F.pointerId)&&L.releasePointerCapture(F.pointerId),T.current=null,E.current=null,G){const R=F.currentTarget,U={originalEvent:F,delta:G};UL(G,b.swipeDirection,b.swipeThreshold)?Zp(KEe,x,U,{discrete:!0}):Zp(YEe,g,U,{discrete:!0}),R.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),JEe=e=>{const{__scopeToast:t,children:n,...r}=e,a=rx(am,t),[o,l]=y.useState(!1),[u,d]=y.useState(!1);return nAe(()=>l(!0)),y.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:i.jsx(El,{asChild:!0,children:i.jsx(Vy,{...r,children:o&&i.jsxs(i.Fragment,{children:[a.label," ",n]})})})},eAe="ToastTitle",hW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(Pe.div,{...r,ref:t})});hW.displayName=eAe;var tAe="ToastDescription",mW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(Pe.div,{...r,ref:t})});mW.displayName=tAe;var pW="ToastAction",vW=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(yW,{altText:n,asChild:!0,children:i.jsx(HE,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${pW}\`. Expected non-empty \`string\`.`),null)});vW.displayName=pW;var gW="ToastClose",HE=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=ZEe(gW,n);return i.jsx(yW,{asChild:!0,children:i.jsx(Pe.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,a.onClose)})})});HE.displayName=gW;var yW=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return i.jsx(Pe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function xW(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),rAe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...xW(r))}}),t}function Zp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?LC(a,o):a.dispatchEvent(o)}var UL=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),o=r>a;return t==="left"||t==="right"?o&&r>n:!o&&a>n};function nAe(e=()=>{}){const t=nn(e);Un(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function rAe(e){return e.nodeType===e.ELEMENT_NODE}function aAe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function l_(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var iAe=lW,bW=uW,wW=fW,jW=hW,SW=mW,_W=vW,NW=HE;const oAe=iAe,CW=y.forwardRef(({className:e,...t},n)=>i.jsx(bW,{ref:n,className:de("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));CW.displayName=bW.displayName;const sAe=qh("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),OW=y.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(wW,{ref:r,className:de(sAe({variant:t}),e),...n}));OW.displayName=wW.displayName;const lAe=y.forwardRef(({className:e,...t},n)=>i.jsx(_W,{ref:n,className:de("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));lAe.displayName=_W.displayName;const EW=y.forwardRef(({className:e,...t},n)=>i.jsx(NW,{ref:n,className:de("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx(Bh,{className:"h-4 w-4"})}));EW.displayName=NW.displayName;const AW=y.forwardRef(({className:e,...t},n)=>i.jsx(jW,{ref:n,className:de("text-sm font-semibold [&+div]:text-xs",e),...t}));AW.displayName=jW.displayName;const TW=y.forwardRef(({className:e,...t},n)=>i.jsx(SW,{ref:n,className:de("text-sm opacity-90",e),...t}));TW.displayName=SW.displayName;function cAe(){const{toasts:e}=mr();return i.jsxs(oAe,{children:[e.map(function({id:t,title:n,description:r,action:a,...o}){return i.jsxs(OW,{...o,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(AW,{children:n}),r&&i.jsx(TW,{children:r})]}),a,i.jsx(EW,{})]},t)}),i.jsx(CW,{})]})}QV.createRoot(document.getElementById("root")).render(i.jsx(y.StrictMode,{children:i.jsx(zEe,{defaultTheme:"system",children:i.jsxs(qEe,{children:[i.jsx(UY,{router:BEe}),i.jsx(cAe,{})]})})})); diff --git a/webui/dist/assets/index-pMcRRAxj.js b/webui/dist/assets/index-pMcRRAxj.js new file mode 100644 index 00000000..7a2399d9 --- /dev/null +++ b/webui/dist/assets/index-pMcRRAxj.js @@ -0,0 +1,344 @@ +import{r as w,j as r,u as rs,R as Fe,d as _C,L as MC,e as EC,f as fr,g as AC,h as DC,O as _5,b as zC,k as OC}from"./router-BWgTyY51.js";import{a as RC,b as BC,g as M5}from"./react-vendor-Dtc2IqVY.js";import{c as E5,R as LC,T as PC,L as FC,a as IC,C as x0,X as g0,Y as Gc,b as qC,B as fp,d as v0,P as HC,e as UC,f as $C}from"./charts-DU5SeejN.js";import{c as Ha,a as vm,u as Ta,P as Ft,b as Pe,d as dn,e as Tu,f as Dl,g as gr,h as Wr,i as A5,j as o1,k as c1,S as VC,l as D5,m as z5,R as O5,O as ym,n as u1,C as bm,o as d1,T as m1,D as h1,p as f1,q as R5,r as B5,W as GC,s as L5,I as YC,t as P5,v as F5,w as WC,x as I5,V as XC,L as q5,y as H5,z as KC,A as QC,B as U5,E as ZC,F as JC,G as Nl,H as wm,J as Uo,K as $5,M as V5,N as G5,Q as Y5,U as p1,X as x1,Y as jm,Z as Nm,_ as g1,$ as W5,a0 as eT,a1 as X5,a2 as tT,a3 as nT,a4 as K5,a5 as rT}from"./ui-vendor-nTGLnMlb.js";import{R as Os,A as aT,D as sT,a as lT,Z as mu,C as ui,M as _u,T as iT,X as Mu,P as Q5,S as oT,b as Pa,I as hi,c as Mo,d as di,e as hx,E as fx,f as qa,g as Ur,h as px,i as cT,j as xx,k as gx,L as Py,K as uT,l as fi,m as dT,n as mT,F as jl,o as hT,B as fT,U as Z5,p as v1,q as pT,r as xT,s as Gr,H as K0,t as J5,u as hu,v as vx,w as fu,x as y1,y as b1,z as mr,G as Ot,J as Q0,N as Ro,O as Eu,Q as vi,V as yi,W as Au,Y as gT,_ as vT,$ as Z0,a0 as yx,a1 as Bo,a2 as Fy,a3 as J0,a4 as yT,a5 as Iy,a6 as bT,a7 as wT,a8 as jT,a9 as qy,aa as lu,ab as em,ac as e6,ad as t6,ae as n6,af as NT,ag as ST,ah as Hy,ai as kT,aj as CT,ak as Uy,al as TT}from"./icons-BdGv2zEo.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();var pp={exports:{}},Yc={},xp={exports:{}},gp={};var $y;function _T(){return $y||($y=1,(function(e){function t(U,q){var W=U.length;U.push(q);e:for(;0>>1,P=U[oe];if(0>>1;oel(O,W))Nel(se,O)?(U[oe]=se,U[Ne]=W,oe=Ne):(U[oe]=O,U[Z]=W,oe=Z);else if(Nel(se,W))U[oe]=se,U[Ne]=W,oe=Ne;else break e}}return q}function l(U,q){var W=U.sortIndex-q.sortIndex;return W!==0?W:U.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],f=[],p=1,x=null,y=3,b=!1,j=!1,k=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function z(U){for(var q=n(f);q!==null;){if(q.callback===null)a(f);else if(q.startTime<=U)a(f),q.sortIndex=q.expirationTime,t(m,q);else break;q=n(f)}}function L(U){if(k=!1,z(U),!j)if(n(m)!==null)j=!0,E||(E=!0,te());else{var q=n(f);q!==null&&ae(L,q.startTime-U)}}var E=!1,R=-1,H=5,$=-1;function I(){return S?!0:!(e.unstable_now()-$U&&I());){var oe=x.callback;if(typeof oe=="function"){x.callback=null,y=x.priorityLevel;var P=oe(x.expirationTime<=U);if(U=e.unstable_now(),typeof P=="function"){x.callback=P,z(U),q=!0;break t}x===n(m)&&a(m),z(U)}else a(m);x=n(m)}if(x!==null)q=!0;else{var je=n(f);je!==null&&ae(L,je.startTime-U),q=!1}}break e}finally{x=null,y=W,b=!1}q=void 0}}finally{q?te():E=!1}}}var te;if(typeof D=="function")te=function(){D(G)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,J=we.port2;we.port1.onmessage=G,te=function(){J.postMessage(null)}}else te=function(){_(G,0)};function ae(U,q){R=_(function(){U(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125oe?(U.sortIndex=W,t(f,U),n(m)===null&&U===n(f)&&(k?(M(R),R=-1):k=!0,ae(L,W-oe))):(U.sortIndex=P,t(m,U),j||b||(j=!0,E||(E=!0,te()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var q=y;return function(){var W=y;y=q;try{return U.apply(this,arguments)}finally{y=W}}}})(gp)),gp}var Vy;function MT(){return Vy||(Vy=1,xp.exports=_T()),xp.exports}var Gy;function ET(){if(Gy)return Yc;Gy=1;var e=MT(),t=RC(),n=BC();function a(s){var i="https://react.dev/errors/"+s;if(1P||(s.current=oe[P],oe[P]=null,P--)}function O(s,i){P++,oe[P]=s.current,s.current=i}var Ne=je(null),se=je(null),Ce=je(null),ye=je(null);function Be(s,i){switch(O(Ce,i),O(se,s),O(Ne,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?iy(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=iy(i),s=oy(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Z(Ne),O(Ne,s)}function ie(){Z(Ne),Z(se),Z(Ce)}function He(s){s.memoizedState!==null&&O(ye,s);var i=Ne.current,u=oy(i,s.type);i!==u&&(O(se,s),O(Ne,u))}function lt(s){se.current===s&&(Z(Ne),Z(se)),ye.current===s&&(Z(ye),Hc._currentValue=W)}var ve,Ze;function We(s){if(ve===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ve=i&&i[1]||"",Ze=-1)":-1g||X[h]!==de[g]){var be=` +`+X[h].replace(" at new "," at ");return s.displayName&&be.includes("")&&(be=be.replace("",s.displayName)),be}while(1<=h&&0<=g);break}}}finally{pn=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?We(u):""}function sr(s,i){switch(s.tag){case 26:case 27:case 5:return We(s.type);case 16:return We("Lazy");case 13:return s.child!==i&&i!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return Bn(s.type,!1);case 11:return Bn(s.type.render,!1);case 1:return Bn(s.type,!0);case 31:return We("Activity");default:return""}}function Qe(s){try{var i="",u=null;do i+=sr(s,u),u=s,s=s.return;while(s);return i}catch(h){return` +Error generating stack: `+h.message+` +`+h.stack}}var Gn=Object.prototype.hasOwnProperty,Sr=e.unstable_scheduleCallback,Er=e.unstable_cancelCallback,Sn=e.unstable_shouldYield,lr=e.unstable_requestPaint,Ue=e.unstable_now,Ln=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,nt=e.unstable_LowPriority,kt=e.unstable_IdlePriority,Qn=e.log,Ar=e.unstable_setDisableYieldValue,he=null,Me=null;function dt(s){if(typeof Qn=="function"&&Ar(s),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(he,s)}catch{}}var mt=Math.clz32?Math.clz32:xn,Dr=Math.log,at=Math.LN2;function xn(s){return s>>>=0,s===0?32:31-(Dr(s)/at|0)|0}var it=256,Ut=262144,Zn=4194304;function bt(s){var i=s&42;if(i!==0)return i;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Mi(s,i,u){var h=s.pendingLanes;if(h===0)return 0;var g=0,v=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var B=h&134217727;return B!==0?(h=B&~v,h!==0?g=bt(h):(T&=B,T!==0?g=bt(T):u||(u=B&~s,u!==0&&(g=bt(u))))):(B=h&~v,B!==0?g=bt(B):T!==0?g=bt(T):u||(u=h&~s,u!==0&&(g=bt(u)))),g===0?0:i!==0&&i!==g&&(i&v)===0&&(v=g&-g,u=i&-i,v>=u||v===32&&(u&4194048)!==0)?i:g}function Pl(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function th(s,i){switch(s){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ei(){var s=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),s}function Fl(s){for(var i=[],u=0;31>u;u++)i.push(s);return i}function nc(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function xS(s,i,u,h,g,v){var T=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var B=s.entanglements,X=s.expirationTimes,de=s.hiddenUpdates;for(u=T&~u;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var jS=/[\n"\\]/g;function pa(s){return s.replace(jS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ih(s,i,u,h,g,v,T,B){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),i!=null?T==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+fa(i)):s.value!==""+fa(i)&&(s.value=""+fa(i)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),i!=null?oh(s,T,fa(i)):u!=null?oh(s,T,fa(u)):h!=null&&s.removeAttribute("value"),g==null&&v!=null&&(s.defaultChecked=!!v),g!=null&&(s.checked=g&&typeof g!="function"&&typeof g!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?s.name=""+fa(B):s.removeAttribute("name")}function tv(s,i,u,h,g,v,T,B){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(s.type=v),i!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){lh(s);return}u=u!=null?""+fa(u):"",i=i!=null?""+fa(i):u,B||i===s.value||(s.value=i),s.defaultValue=i}h=h??g,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=B?s.checked:!!h,s.defaultChecked=!!h,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),lh(s)}function oh(s,i,u){i==="number"&&ld(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Bi(s,i,u,h){if(s=s.options,i){i={};for(var g=0;g"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hh=!1;if(ms)try{var lc={};Object.defineProperty(lc,"passive",{get:function(){hh=!0}}),window.addEventListener("test",lc,lc),window.removeEventListener("test",lc,lc)}catch{hh=!1}var Ys=null,fh=null,od=null;function ov(){if(od)return od;var s,i=fh,u=i.length,h,g="value"in Ys?Ys.value:Ys.textContent,v=g.length;for(s=0;s=cc),fv=" ",pv=!1;function xv(s,i){switch(s){case"keyup":return KS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ii=!1;function ZS(s,i){switch(s){case"compositionend":return gv(i);case"keypress":return i.which!==32?null:(pv=!0,fv);case"textInput":return s=i.data,s===fv&&pv?null:s;default:return null}}function JS(s,i){if(Ii)return s==="compositionend"||!yh&&xv(s,i)?(s=ov(),od=fh=Ys=null,Ii=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:u,offset:i-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=kv(u)}}function Tv(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?Tv(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function _v(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=ld(s.document);i instanceof s.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)s=i.contentWindow;else break;i=ld(s.document)}return i}function jh(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var ik=ms&&"documentMode"in document&&11>=document.documentMode,qi=null,Nh=null,hc=null,Sh=!1;function Mv(s,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Sh||qi==null||qi!==ld(h)||(h=qi,"selectionStart"in h&&jh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),hc&&mc(hc,h)||(hc=h,h=t0(Nh,"onSelect"),0>=T,g-=T,$a=1<<32-mt(i)+g|u<pt?(Dt=Ge,Ge=null):Dt=Ge.sibling;var qt=fe(le,Ge,ce[pt],Se);if(qt===null){Ge===null&&(Ge=Dt);break}s&&Ge&&qt.alternate===null&&i(le,Ge),ee=v(qt,ee,pt),It===null?Ke=qt:It.sibling=qt,It=qt,Ge=Dt}if(pt===ce.length)return u(le,Ge),zt&&fs(le,pt),Ke;if(Ge===null){for(;ptpt?(Dt=Ge,Ge=null):Dt=Ge.sibling;var pl=fe(le,Ge,qt.value,Se);if(pl===null){Ge===null&&(Ge=Dt);break}s&&Ge&&pl.alternate===null&&i(le,Ge),ee=v(pl,ee,pt),It===null?Ke=pl:It.sibling=pl,It=pl,Ge=Dt}if(qt.done)return u(le,Ge),zt&&fs(le,pt),Ke;if(Ge===null){for(;!qt.done;pt++,qt=ce.next())qt=ke(le,qt.value,Se),qt!==null&&(ee=v(qt,ee,pt),It===null?Ke=qt:It.sibling=qt,It=qt);return zt&&fs(le,pt),Ke}for(Ge=h(Ge);!qt.done;pt++,qt=ce.next())qt=xe(Ge,le,pt,qt.value,Se),qt!==null&&(s&&qt.alternate!==null&&Ge.delete(qt.key===null?pt:qt.key),ee=v(qt,ee,pt),It===null?Ke=qt:It.sibling=qt,It=qt);return s&&Ge.forEach(function(TC){return i(le,TC)}),zt&&fs(le,pt),Ke}function sn(le,ee,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===k&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:e:{for(var Ke=ce.key;ee!==null;){if(ee.key===Ke){if(Ke=ce.type,Ke===k){if(ee.tag===7){u(le,ee.sibling),Se=g(ee,ce.props.children),Se.return=le,le=Se;break e}}else if(ee.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===H&&Kl(Ke)===ee.type){u(le,ee.sibling),Se=g(ee,ce.props),yc(Se,ce),Se.return=le,le=Se;break e}u(le,ee);break}else i(le,ee);ee=ee.sibling}ce.type===k?(Se=Vl(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=vd(ce.type,ce.key,ce.props,null,le.mode,Se),yc(Se,ce),Se.return=le,le=Se)}return T(le);case j:e:{for(Ke=ce.key;ee!==null;){if(ee.key===Ke)if(ee.tag===4&&ee.stateNode.containerInfo===ce.containerInfo&&ee.stateNode.implementation===ce.implementation){u(le,ee.sibling),Se=g(ee,ce.children||[]),Se.return=le,le=Se;break e}else{u(le,ee);break}else i(le,ee);ee=ee.sibling}Se=Ah(ce,le.mode,Se),Se.return=le,le=Se}return T(le);case H:return ce=Kl(ce),sn(le,ee,ce,Se)}if(ae(ce))return qe(le,ee,ce,Se);if(te(ce)){if(Ke=te(ce),typeof Ke!="function")throw Error(a(150));return ce=Ke.call(ce),rt(le,ee,ce,Se)}if(typeof ce.then=="function")return sn(le,ee,kd(ce),Se);if(ce.$$typeof===D)return sn(le,ee,wd(le,ce),Se);Cd(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ee!==null&&ee.tag===6?(u(le,ee.sibling),Se=g(ee,ce),Se.return=le,le=Se):(u(le,ee),Se=Eh(ce,le.mode,Se),Se.return=le,le=Se),T(le)):u(le,ee)}return function(le,ee,ce,Se){try{vc=0;var Ke=sn(le,ee,ce,Se);return Zi=null,Ke}catch(Ge){if(Ge===Qi||Ge===Nd)throw Ge;var It=ea(29,Ge,null,le.mode);return It.lanes=Se,It.return=le,It}finally{}}}var Zl=Zv(!0),Jv=Zv(!1),Zs=!1;function Uh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $h(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function el(s,i,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,($t&2)!==0){var g=h.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),h.pending=i,i=gd(s),Bv(s,null,u),i}return xd(s,h,i,u),gd(s)}function bc(s,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var h=i.lanes;h&=s.pendingLanes,u|=h,i.lanes=u,$g(s,u)}}function Vh(s,i){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var T={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?g=v=T:v=v.next=T,u=u.next}while(u!==null);v===null?g=v=i:v=v.next=i}else g=v=i;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=i:s.next=i,u.lastBaseUpdate=i}var Gh=!1;function wc(){if(Gh){var s=Ki;if(s!==null)throw s}}function jc(s,i,u,h){Gh=!1;var g=s.updateQueue;Zs=!1;var v=g.firstBaseUpdate,T=g.lastBaseUpdate,B=g.shared.pending;if(B!==null){g.shared.pending=null;var X=B,de=X.next;X.next=null,T===null?v=de:T.next=de,T=X;var be=s.alternate;be!==null&&(be=be.updateQueue,B=be.lastBaseUpdate,B!==T&&(B===null?be.firstBaseUpdate=de:B.next=de,be.lastBaseUpdate=X))}if(v!==null){var ke=g.baseState;T=0,be=de=X=null,B=v;do{var fe=B.lane&-536870913,xe=fe!==B.lane;if(xe?(At&fe)===fe:(h&fe)===fe){fe!==0&&fe===Xi&&(Gh=!0),be!==null&&(be=be.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var qe=s,rt=B;fe=i;var sn=u;switch(rt.tag){case 1:if(qe=rt.payload,typeof qe=="function"){ke=qe.call(sn,ke,fe);break e}ke=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=rt.payload,fe=typeof qe=="function"?qe.call(sn,ke,fe):qe,fe==null)break e;ke=x({},ke,fe);break e;case 2:Zs=!0}}fe=B.callback,fe!==null&&(s.flags|=64,xe&&(s.flags|=8192),xe=g.callbacks,xe===null?g.callbacks=[fe]:xe.push(fe))}else xe={lane:fe,tag:B.tag,payload:B.payload,callback:B.callback,next:null},be===null?(de=be=xe,X=ke):be=be.next=xe,T|=fe;if(B=B.next,B===null){if(B=g.shared.pending,B===null)break;xe=B,B=xe.next,xe.next=null,g.lastBaseUpdate=xe,g.shared.pending=null}}while(!0);be===null&&(X=ke),g.baseState=X,g.firstBaseUpdate=de,g.lastBaseUpdate=be,v===null&&(g.shared.lanes=0),sl|=T,s.lanes=T,s.memoizedState=ke}}function e4(s,i){if(typeof s!="function")throw Error(a(191,s));s.call(i)}function t4(s,i){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;sv?v:8;var T=U.T,B={};U.T=B,mf(s,!1,i,u);try{var X=g(),de=U.S;if(de!==null&&de(B,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var be=xk(X,h);kc(s,i,be,sa(s))}else kc(s,i,h,sa(s))}catch(ke){kc(s,i,{then:function(){},status:"rejected",reason:ke},sa())}finally{q.p=v,T!==null&&B.types!==null&&(T.types=B.types),U.T=T}}function jk(){}function uf(s,i,u,h){if(s.tag!==5)throw Error(a(476));var g=z4(s).queue;D4(s,g,i,W,u===null?jk:function(){return O4(s),u(h)})}function z4(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:W},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:u},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function O4(s){var i=z4(s);i.next===null&&(i=s.alternate.memoizedState),kc(s,i.next.queue,{},sa())}function df(){return cr(Hc)}function R4(){return On().memoizedState}function B4(){return On().memoizedState}function Nk(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var u=sa();s=Js(u);var h=el(i,s,u);h!==null&&(Fr(h,i,u),bc(h,i,u)),i={cache:Fh()},s.payload=i;return}i=i.return}}function Sk(s,i,u){var h=sa();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bd(s)?P4(i,u):(u=_h(s,i,u,h),u!==null&&(Fr(u,s,h),F4(u,i,h)))}function L4(s,i,u){var h=sa();kc(s,i,u,h)}function kc(s,i,u,h){var g={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Bd(s))P4(i,g);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var T=i.lastRenderedState,B=v(T,u);if(g.hasEagerState=!0,g.eagerState=B,Jr(B,T))return xd(s,i,g,0),mn===null&&pd(),!1}catch{}finally{}if(u=_h(s,i,g,h),u!==null)return Fr(u,s,h),F4(u,i,h),!0}return!1}function mf(s,i,u,h){if(h={lane:2,revertLane:$f(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Bd(s)){if(i)throw Error(a(479))}else i=_h(s,u,h,2),i!==null&&Fr(i,s,2)}function Bd(s){var i=s.alternate;return s===ht||i!==null&&i===ht}function P4(s,i){eo=Md=!0;var u=s.pending;u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i}function F4(s,i,u){if((u&4194048)!==0){var h=i.lanes;h&=s.pendingLanes,u|=h,i.lanes=u,$g(s,u)}}var Cc={readContext:cr,use:Dd,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};Cc.useEffectEvent=En;var I4={readContext:cr,use:Dd,useCallback:function(s,i){return kr().memoizedState=[s,i===void 0?null:i],s},useContext:cr,useEffect:N4,useImperativeHandle:function(s,i,u){u=u!=null?u.concat([s]):null,Od(4194308,4,T4.bind(null,i,s),u)},useLayoutEffect:function(s,i){return Od(4194308,4,s,i)},useInsertionEffect:function(s,i){Od(4,2,s,i)},useMemo:function(s,i){var u=kr();i=i===void 0?null:i;var h=s();if(Jl){dt(!0);try{s()}finally{dt(!1)}}return u.memoizedState=[h,i],h},useReducer:function(s,i,u){var h=kr();if(u!==void 0){var g=u(i);if(Jl){dt(!0);try{u(i)}finally{dt(!1)}}}else g=i;return h.memoizedState=h.baseState=g,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:g},h.queue=s,s=s.dispatch=Sk.bind(null,ht,s),[h.memoizedState,s]},useRef:function(s){var i=kr();return s={current:s},i.memoizedState=s},useState:function(s){s=af(s);var i=s.queue,u=L4.bind(null,ht,i);return i.dispatch=u,[s.memoizedState,u]},useDebugValue:of,useDeferredValue:function(s,i){var u=kr();return cf(u,s,i)},useTransition:function(){var s=af(!1);return s=D4.bind(null,ht,s.queue,!0,!1),kr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,u){var h=ht,g=kr();if(zt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),mn===null)throw Error(a(349));(At&127)!==0||i4(h,i,u)}g.memoizedState=u;var v={value:u,getSnapshot:i};return g.queue=v,N4(c4.bind(null,h,v,s),[s]),h.flags|=2048,no(9,{destroy:void 0},o4.bind(null,h,v,u,i),null),u},useId:function(){var s=kr(),i=mn.identifierPrefix;if(zt){var u=Va,h=$a;u=(h&~(1<<32-mt(h)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Ed++,0<\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof h.is=="string"?T.createElement("select",{is:h.is}):T.createElement("select"),h.multiple?v.multiple=!0:h.size&&(v.size=h.size);break;default:v=typeof h.is=="string"?T.createElement(g,{is:h.is}):T.createElement(g)}}v[ir]=i,v[zr]=h;e:for(T=i.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===i)break e;for(;T.sibling===null;){if(T.return===null||T.return===i)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}i.stateNode=v;e:switch(dr(v,g,h),g){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&bs(i)}}return wn(i),Cf(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,u),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==h&&bs(i);else{if(typeof h!="string"&&i.stateNode===null)throw Error(a(166));if(s=Ce.current,Yi(i)){if(s=i.stateNode,u=i.memoizedProps,h=null,g=or,g!==null)switch(g.tag){case 27:case 5:h=g.memoizedProps}s[ir]=i,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||sy(s.nodeValue,u)),s||Ks(i,!0)}else s=n0(s).createTextNode(h),s[ir]=i,i.stateNode=s}return wn(i),null;case 31:if(u=i.memoizedState,s===null||s.memoizedState!==null){if(h=Yi(i),u!==null){if(s===null){if(!h)throw Error(a(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(557));s[ir]=i}else Gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;wn(i),s=!1}else u=Rh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return i.flags&256?(na(i),i):(na(i),null);if((i.flags&128)!==0)throw Error(a(558))}return wn(i),null;case 13:if(h=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(g=Yi(i),h!==null&&h.dehydrated!==null){if(s===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[ir]=i}else Gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;wn(i),g=!1}else g=Rh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(na(i),i):(na(i),null)}return na(i),(i.flags&128)!==0?(i.lanes=u,i):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=i.child,g=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(g=h.alternate.memoizedState.cachePool.pool),v=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==g&&(h.flags|=2048)),u!==s&&u&&(i.child.flags|=8192),qd(i,i.updateQueue),wn(i),null);case 4:return ie(),s===null&&Wf(i.stateNode.containerInfo),wn(i),null;case 10:return xs(i.type),wn(i),null;case 19:if(Z(zn),h=i.memoizedState,h===null)return wn(i),null;if(g=(i.flags&128)!==0,v=h.rendering,v===null)if(g)_c(h,!1);else{if(An!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(v=_d(s),v!==null){for(i.flags|=128,_c(h,!1),s=v.updateQueue,i.updateQueue=s,qd(i,s),i.subtreeFlags=0,s=u,u=i.child;u!==null;)Lv(u,s),u=u.sibling;return O(zn,zn.current&1|2),zt&&fs(i,h.treeForkCount),i.child}s=s.sibling}h.tail!==null&&Ue()>Gd&&(i.flags|=128,g=!0,_c(h,!1),i.lanes=4194304)}else{if(!g)if(s=_d(v),s!==null){if(i.flags|=128,g=!0,s=s.updateQueue,i.updateQueue=s,qd(i,s),_c(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!zt)return wn(i),null}else 2*Ue()-h.renderingStartTime>Gd&&u!==536870912&&(i.flags|=128,g=!0,_c(h,!1),i.lanes=4194304);h.isBackwards?(v.sibling=i.child,i.child=v):(s=h.last,s!==null?s.sibling=v:i.child=v,h.last=v)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Ue(),s.sibling=null,u=zn.current,O(zn,g?u&1|2:u&1),zt&&fs(i,h.treeForkCount),s):(wn(i),null);case 22:case 23:return na(i),Wh(),h=i.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(i.flags|=8192):h&&(i.flags|=8192),h?(u&536870912)!==0&&(i.flags&128)===0&&(wn(i),i.subtreeFlags&6&&(i.flags|=8192)):wn(i),u=i.updateQueue,u!==null&&qd(i,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==u&&(i.flags|=2048),s!==null&&Z(Xl),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),xs(Pn),wn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Mk(s,i){switch(zh(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return xs(Pn),ie(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return lt(i),null;case 31:if(i.memoizedState!==null){if(na(i),i.alternate===null)throw Error(a(340));Gl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(na(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Gl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return Z(zn),null;case 4:return ie(),null;case 10:return xs(i.type),null;case 22:case 23:return na(i),Wh(),s!==null&&Z(Xl),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return xs(Pn),null;case 25:return null;default:return null}}function u2(s,i){switch(zh(i),i.tag){case 3:xs(Pn),ie();break;case 26:case 27:case 5:lt(i);break;case 4:ie();break;case 31:i.memoizedState!==null&&na(i);break;case 13:na(i);break;case 19:Z(zn);break;case 10:xs(i.type);break;case 22:case 23:na(i),Wh(),s!==null&&Z(Xl);break;case 24:xs(Pn)}}function Mc(s,i){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&s)===s){h=void 0;var v=u.create,T=u.inst;h=v(),T.destroy=h}u=u.next}while(u!==g)}}catch(B){Yt(i,i.return,B)}}function rl(s,i,u){try{var h=i.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var v=g.next;h=v;do{if((h.tag&s)===s){var T=h.inst,B=T.destroy;if(B!==void 0){T.destroy=void 0,g=i;var X=u,de=B;try{de()}catch(be){Yt(g,X,be)}}}h=h.next}while(h!==v)}}catch(be){Yt(i,i.return,be)}}function d2(s){var i=s.updateQueue;if(i!==null){var u=s.stateNode;try{t4(i,u)}catch(h){Yt(s,s.return,h)}}}function m2(s,i,u){u.props=ei(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){Yt(s,i,h)}}function Ec(s,i){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(g){Yt(s,i,g)}}function Ga(s,i){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(g){Yt(s,i,g)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){Yt(s,i,g)}else u.current=null}function h2(s){var i=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(g){Yt(s,s.return,g)}}function Tf(s,i,u){try{var h=s.stateNode;Qk(h,s.type,u,i),h[zr]=i}catch(g){Yt(s,s.return,g)}}function f2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ul(s.type)||s.tag===4}function _f(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||f2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ul(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Mf(s,i,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(s),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=ds));else if(h!==4&&(h===27&&ul(s.type)&&(u=s.stateNode,i=null),s=s.child,s!==null))for(Mf(s,i,u),s=s.sibling;s!==null;)Mf(s,i,u),s=s.sibling}function Hd(s,i,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?u.insertBefore(s,i):u.appendChild(s);else if(h!==4&&(h===27&&ul(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Hd(s,i,u),s=s.sibling;s!==null;)Hd(s,i,u),s=s.sibling}function p2(s){var i=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);dr(i,h,u),i[ir]=s,i[zr]=u}catch(v){Yt(s,s.return,v)}}var ws=!1,qn=!1,Ef=!1,x2=typeof WeakSet=="function"?WeakSet:Set,er=null;function Ek(s,i){if(s=s.containerInfo,Qf=c0,s=_v(s),jh(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var T=0,B=-1,X=-1,de=0,be=0,ke=s,fe=null;t:for(;;){for(var xe;ke!==u||g!==0&&ke.nodeType!==3||(B=T+g),ke!==v||h!==0&&ke.nodeType!==3||(X=T+h),ke.nodeType===3&&(T+=ke.nodeValue.length),(xe=ke.firstChild)!==null;)fe=ke,ke=xe;for(;;){if(ke===s)break t;if(fe===u&&++de===g&&(B=T),fe===v&&++be===h&&(X=T),(xe=ke.nextSibling)!==null)break;ke=fe,fe=ke.parentNode}ke=xe}u=B===-1||X===-1?null:{start:B,end:X}}else u=null}u=u||{start:0,end:0}}else u=null;for(Zf={focusedElem:s,selectionRange:u},c0=!1,er=i;er!==null;)if(i=er,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,er=s;else for(;er!==null;){switch(i=er,v=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u title"))),dr(v,h,u),v[ir]=s,Jn(v),h=v;break e;case"link":var T=jy("link","href",g).get(h+(u.href||""));if(T){for(var B=0;Bsn&&(T=sn,sn=rt,rt=T);var le=Cv(B,rt),ee=Cv(B,sn);if(le&&ee&&(xe.rangeCount!==1||xe.anchorNode!==le.node||xe.anchorOffset!==le.offset||xe.focusNode!==ee.node||xe.focusOffset!==ee.offset)){var ce=ke.createRange();ce.setStart(le.node,le.offset),xe.removeAllRanges(),rt>sn?(xe.addRange(ce),xe.extend(ee.node,ee.offset)):(ce.setEnd(ee.node,ee.offset),xe.addRange(ce))}}}}for(ke=[],xe=B;xe=xe.parentNode;)xe.nodeType===1&&ke.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;Bu?32:u,U.T=null,u=Lf,Lf=null;var v=il,T=Cs;if(Yn=0,io=il=null,Cs=0,($t&6)!==0)throw Error(a(331));var B=$t;if($t|=4,T2(v.current),S2(v,v.current,T,u),$t=B,Bc(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(he,v)}catch{}return!0}finally{q.p=g,U.T=h,V2(s,i)}}function Y2(s,i,u){i=ga(u,i),i=xf(s.stateNode,i,2),s=el(s,i,2),s!==null&&(nc(s,2),Ya(s))}function Yt(s,i,u){if(s.tag===3)Y2(s,s,u);else for(;i!==null;){if(i.tag===3){Y2(i,s,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ll===null||!ll.has(h))){s=ga(u,s),u=W4(2),h=el(i,u,2),h!==null&&(X4(u,h,i,s),nc(h,2),Ya(h));break}}i=i.return}}function qf(s,i,u){var h=s.pingCache;if(h===null){h=s.pingCache=new zk;var g=new Set;h.set(i,g)}else g=h.get(i),g===void 0&&(g=new Set,h.set(i,g));g.has(u)||(zf=!0,g.add(u),s=Pk.bind(null,s,i,u),i.then(s,s))}function Pk(s,i,u){var h=s.pingCache;h!==null&&h.delete(i),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,mn===s&&(At&u)===u&&(An===4||An===3&&(At&62914560)===At&&300>Ue()-Vd?($t&2)===0&&oo(s,0):Of|=u,lo===At&&(lo=0)),Ya(s)}function W2(s,i){i===0&&(i=Ei()),s=$l(s,i),s!==null&&(nc(s,i),Ya(s))}function Fk(s){var i=s.memoizedState,u=0;i!==null&&(u=i.retryLane),W2(s,u)}function Ik(s,i){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,g=s.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(a(314))}h!==null&&h.delete(i),W2(s,u)}function qk(s,i){return Sr(s,i)}var Zd=null,uo=null,Hf=!1,Jd=!1,Uf=!1,cl=0;function Ya(s){s!==uo&&s.next===null&&(uo===null?Zd=uo=s:uo=uo.next=s),Jd=!0,Hf||(Hf=!0,Uk())}function Bc(s,i){if(!Uf&&Jd){Uf=!0;do for(var u=!1,h=Zd;h!==null;){if(s!==0){var g=h.pendingLanes;if(g===0)var v=0;else{var T=h.suspendedLanes,B=h.pingedLanes;v=(1<<31-mt(42|s)+1)-1,v&=g&~(T&~B),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Z2(h,v))}else v=At,v=Mi(h,h===mn?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Pl(h,v)||(u=!0,Z2(h,v));h=h.next}while(u);Uf=!1}}function Hk(){X2()}function X2(){Jd=Hf=!1;var s=0;cl!==0&&Jk()&&(s=cl);for(var i=Ue(),u=null,h=Zd;h!==null;){var g=h.next,v=K2(h,i);v===0?(h.next=null,u===null?Zd=g:u.next=g,g===null&&(uo=u)):(u=h,(s!==0||(v&3)!==0)&&(Jd=!0)),h=g}Yn!==0&&Yn!==5||Bc(s),cl!==0&&(cl=0)}function K2(s,i){for(var u=s.suspendedLanes,h=s.pingedLanes,g=s.expirationTimes,v=s.pendingLanes&-62914561;0B)break;var be=X.transferSize,ke=X.initiatorType;be&&ly(ke)&&(X=X.responseEnd,T+=be*(X"u"?null:document;function vy(s,i,u){var h=mo;if(h&&typeof i=="string"&&i){var g=pa(i);g='link[rel="'+s+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),gy.has(g)||(gy.add(g),s={rel:s,crossOrigin:u,href:i},h.querySelector(g)===null&&(i=h.createElement("link"),dr(i,"link",s),Jn(i),h.head.appendChild(i)))}}function oC(s){Ts.D(s),vy("dns-prefetch",s,null)}function cC(s,i){Ts.C(s,i),vy("preconnect",s,i)}function uC(s,i,u){Ts.L(s,i,u);var h=mo;if(h&&s&&i){var g='link[rel="preload"][as="'+pa(i)+'"]';i==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+pa(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+pa(u.imageSizes)+'"]')):g+='[href="'+pa(s)+'"]';var v=g;switch(i){case"style":v=ho(s);break;case"script":v=fo(s)}Na.has(v)||(s=x({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:s,as:i},u),Na.set(v,s),h.querySelector(g)!==null||i==="style"&&h.querySelector(Ic(v))||i==="script"&&h.querySelector(qc(v))||(i=h.createElement("link"),dr(i,"link",s),Jn(i),h.head.appendChild(i)))}}function dC(s,i){Ts.m(s,i);var u=mo;if(u&&s){var h=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+pa(h)+'"][href="'+pa(s)+'"]',v=g;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=fo(s)}if(!Na.has(v)&&(s=x({rel:"modulepreload",href:s},i),Na.set(v,s),u.querySelector(g)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(qc(v)))return}h=u.createElement("link"),dr(h,"link",s),Jn(h),u.head.appendChild(h)}}}function mC(s,i,u){Ts.S(s,i,u);var h=mo;if(h&&s){var g=Oi(h).hoistableStyles,v=ho(s);i=i||"default";var T=g.get(v);if(!T){var B={loading:0,preload:null};if(T=h.querySelector(Ic(v)))B.loading=5;else{s=x({rel:"stylesheet",href:s,"data-precedence":i},u),(u=Na.get(v))&&sp(s,u);var X=T=h.createElement("link");Jn(X),dr(X,"link",s),X._p=new Promise(function(de,be){X.onload=de,X.onerror=be}),X.addEventListener("load",function(){B.loading|=1}),X.addEventListener("error",function(){B.loading|=2}),B.loading|=4,a0(T,i,h)}T={type:"stylesheet",instance:T,count:1,state:B},g.set(v,T)}}}function hC(s,i){Ts.X(s,i);var u=mo;if(u&&s){var h=Oi(u).hoistableScripts,g=fo(s),v=h.get(g);v||(v=u.querySelector(qc(g)),v||(s=x({src:s,async:!0},i),(i=Na.get(g))&&lp(s,i),v=u.createElement("script"),Jn(v),dr(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(g,v))}}function fC(s,i){Ts.M(s,i);var u=mo;if(u&&s){var h=Oi(u).hoistableScripts,g=fo(s),v=h.get(g);v||(v=u.querySelector(qc(g)),v||(s=x({src:s,async:!0,type:"module"},i),(i=Na.get(g))&&lp(s,i),v=u.createElement("script"),Jn(v),dr(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(g,v))}}function yy(s,i,u,h){var g=(g=Ce.current)?r0(g):null;if(!g)throw Error(a(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=ho(u.href),u=Oi(g).hoistableStyles,h=u.get(i),h||(h={type:"style",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=ho(u.href);var v=Oi(g).hoistableStyles,T=v.get(s);if(T||(g=g.ownerDocument||g,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(s,T),(v=g.querySelector(Ic(s)))&&!v._p&&(T.instance=v,T.state.loading=5),Na.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Na.set(s,u),v||pC(g,s,u,T.state))),i&&h===null)throw Error(a(528,""));return T}if(i&&h!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fo(u),u=Oi(g).hoistableScripts,h=u.get(i),h||(h={type:"script",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,s))}}function ho(s){return'href="'+pa(s)+'"'}function Ic(s){return'link[rel="stylesheet"]['+s+"]"}function by(s){return x({},s,{"data-precedence":s.precedence,precedence:null})}function pC(s,i,u,h){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?h.loading=1:(i=s.createElement("link"),h.preload=i,i.addEventListener("load",function(){return h.loading|=1}),i.addEventListener("error",function(){return h.loading|=2}),dr(i,"link",u),Jn(i),s.head.appendChild(i))}function fo(s){return'[src="'+pa(s)+'"]'}function qc(s){return"script[async]"+s}function wy(s,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var h=s.querySelector('style[data-href~="'+pa(u.href)+'"]');if(h)return i.instance=h,Jn(h),h;var g=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Jn(h),dr(h,"style",g),a0(h,u.precedence,s),i.instance=h;case"stylesheet":g=ho(u.href);var v=s.querySelector(Ic(g));if(v)return i.state.loading|=4,i.instance=v,Jn(v),v;h=by(u),(g=Na.get(g))&&sp(h,g),v=(s.ownerDocument||s).createElement("link"),Jn(v);var T=v;return T._p=new Promise(function(B,X){T.onload=B,T.onerror=X}),dr(v,"link",h),i.state.loading|=4,a0(v,u.precedence,s),i.instance=v;case"script":return v=fo(u.src),(g=s.querySelector(qc(v)))?(i.instance=g,Jn(g),g):(h=u,(g=Na.get(v))&&(h=x({},u),lp(h,g)),s=s.ownerDocument||s,g=s.createElement("script"),Jn(g),dr(g,"link",h),s.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(h=i.instance,i.state.loading|=4,a0(h,u.precedence,s));return i.instance}function a0(s,i,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=h.length?h[h.length-1]:null,v=g,T=0;T title"):null)}function xC(s,i,u){if(u===1||i.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return s=i.disabled,typeof i.precedence=="string"&&s==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Sy(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function gC(s,i,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=ho(h.href),v=i.querySelector(Ic(g));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=l0.bind(s),i.then(s,s)),u.state.loading|=4,u.instance=v,Jn(v);return}v=i.ownerDocument||i,h=by(h),(g=Na.get(g))&&sp(h,g),v=v.createElement("link"),Jn(v);var T=v;T._p=new Promise(function(B,X){T.onload=B,T.onerror=X}),dr(v,"link",h),u.instance=v}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=l0.bind(s),i.addEventListener("load",u),i.addEventListener("error",u))}}var ip=0;function vC(s,i){return s.stylesheets&&s.count===0&&o0(s,s.stylesheets),0ip?50:800)+i);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(g)}}:null}function l0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)o0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var i0=null;function o0(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,i0=new Map,i.forEach(yC,s),i0=null,l0.call(s))}function yC(s,i){if(!(i.state.loading&4)){var u=i0.get(s);if(u)var h=u.get(null);else{u=new Map,i0.set(s,u);for(var g=s.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),pp.exports=ET(),pp.exports}var DT=AT();function r6(e,t){return function(){return e.apply(t,arguments)}}const{toString:zT}=Object.prototype,{getPrototypeOf:w1}=Object,{iterator:Sm,toStringTag:a6}=Symbol,km=(e=>t=>{const n=zT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ua=e=>(e=e.toLowerCase(),t=>km(t)===e),Cm=e=>t=>typeof t===e,{isArray:$o}=Array,Lo=Cm("undefined");function Du(e){return e!==null&&!Lo(e)&&e.constructor!==null&&!Lo(e.constructor)&&$r(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const s6=Ua("ArrayBuffer");function OT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&s6(e.buffer),t}const RT=Cm("string"),$r=Cm("function"),l6=Cm("number"),zu=e=>e!==null&&typeof e=="object",BT=e=>e===!0||e===!1,q0=e=>{if(km(e)!=="object")return!1;const t=w1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(a6 in e)&&!(Sm in e)},LT=e=>{if(!zu(e)||Du(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},PT=Ua("Date"),FT=Ua("File"),IT=Ua("Blob"),qT=Ua("FileList"),HT=e=>zu(e)&&$r(e.pipe),UT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||$r(e.append)&&((t=km(e))==="formdata"||t==="object"&&$r(e.toString)&&e.toString()==="[object FormData]"))},$T=Ua("URLSearchParams"),[VT,GT,YT,WT]=["ReadableStream","Request","Response","Headers"].map(Ua),XT=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ou(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,l;if(typeof e!="object"&&(e=[e]),$o(e))for(a=0,l=e.length;a0;)if(l=n[a],t===l.toLowerCase())return l;return null}const oi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,o6=e=>!Lo(e)&&e!==oi;function bx(){const{caseless:e,skipUndefined:t}=o6(this)&&this||{},n={},a=(l,o)=>{const c=e&&i6(n,o)||o;q0(n[c])&&q0(l)?n[c]=bx(n[c],l):q0(l)?n[c]=bx({},l):$o(l)?n[c]=l.slice():(!t||!Lo(l))&&(n[c]=l)};for(let l=0,o=arguments.length;l(Ou(t,(l,o)=>{n&&$r(l)?e[o]=r6(l,n):e[o]=l},{allOwnKeys:a}),e),QT=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZT=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},JT=(e,t,n,a)=>{let l,o,c;const d={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),o=l.length;o-- >0;)c=l[o],(!a||a(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&w1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},e_=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},t_=e=>{if(!e)return null;if($o(e))return e;let t=e.length;if(!l6(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},n_=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&w1(Uint8Array)),r_=(e,t)=>{const a=(e&&e[Sm]).call(e);let l;for(;(l=a.next())&&!l.done;){const o=l.value;t.call(e,o[0],o[1])}},a_=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},s_=Ua("HTMLFormElement"),l_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,l){return a.toUpperCase()+l}),Wy=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i_=Ua("RegExp"),c6=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};Ou(n,(l,o)=>{let c;(c=t(l,o,e))!==!1&&(a[o]=c||l)}),Object.defineProperties(e,a)},o_=e=>{c6(e,(t,n)=>{if($r(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if($r(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},c_=(e,t)=>{const n={},a=l=>{l.forEach(o=>{n[o]=!0})};return $o(e)?a(e):a(String(e).split(t)),n},u_=()=>{},d_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function m_(e){return!!(e&&$r(e.append)&&e[a6]==="FormData"&&e[Sm])}const h_=e=>{const t=new Array(10),n=(a,l)=>{if(zu(a)){if(t.indexOf(a)>=0)return;if(Du(a))return a;if(!("toJSON"in a)){t[l]=a;const o=$o(a)?[]:{};return Ou(a,(c,d)=>{const m=n(c,l+1);!Lo(m)&&(o[d]=m)}),t[l]=void 0,o}}return a};return n(e,0)},f_=Ua("AsyncFunction"),p_=e=>e&&(zu(e)||$r(e))&&$r(e.then)&&$r(e.catch),u6=((e,t)=>e?setImmediate:t?((n,a)=>(oi.addEventListener("message",({source:l,data:o})=>{l===oi&&o===n&&a.length&&a.shift()()},!1),l=>{a.push(l),oi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",$r(oi.postMessage)),x_=typeof queueMicrotask<"u"?queueMicrotask.bind(oi):typeof process<"u"&&process.nextTick||u6,g_=e=>e!=null&&$r(e[Sm]),pe={isArray:$o,isArrayBuffer:s6,isBuffer:Du,isFormData:UT,isArrayBufferView:OT,isString:RT,isNumber:l6,isBoolean:BT,isObject:zu,isPlainObject:q0,isEmptyObject:LT,isReadableStream:VT,isRequest:GT,isResponse:YT,isHeaders:WT,isUndefined:Lo,isDate:PT,isFile:FT,isBlob:IT,isRegExp:i_,isFunction:$r,isStream:HT,isURLSearchParams:$T,isTypedArray:n_,isFileList:qT,forEach:Ou,merge:bx,extend:KT,trim:XT,stripBOM:QT,inherits:ZT,toFlatObject:JT,kindOf:km,kindOfTest:Ua,endsWith:e_,toArray:t_,forEachEntry:r_,matchAll:a_,isHTMLForm:s_,hasOwnProperty:Wy,hasOwnProp:Wy,reduceDescriptors:c6,freezeMethods:o_,toObjectSet:c_,toCamelCase:l_,noop:u_,toFiniteNumber:d_,findKey:i6,global:oi,isContextDefined:o6,isSpecCompliantForm:m_,toJSONObject:h_,isAsyncFn:f_,isThenable:p_,setImmediate:u6,asap:x_,isIterable:g_};function ft(e,t,n,a,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),l&&(this.response=l,this.status=l.status?l.status:null)}pe.inherits(ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const d6=ft.prototype,m6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{m6[e]={value:e}});Object.defineProperties(ft,m6);Object.defineProperty(d6,"isAxiosError",{value:!0});ft.from=(e,t,n,a,l,o)=>{const c=Object.create(d6);pe.toFlatObject(e,c,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const d=e&&e.message?e.message:"Error",m=t==null&&e?e.code:t;return ft.call(c,d,m,n,a,l),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",o&&Object.assign(c,o),c};const v_=null;function wx(e){return pe.isPlainObject(e)||pe.isArray(e)}function h6(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function Xy(e,t,n){return e?e.concat(t).map(function(l,o){return l=h6(l),!n&&o?"["+l+"]":l}).join(n?".":""):t}function y_(e){return pe.isArray(e)&&!e.some(wx)}const b_=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function Tm(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,S){return!pe.isUndefined(S[k])});const a=n.metaTokens,l=n.visitor||p,o=n.dots,c=n.indexes,m=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(l))throw new TypeError("visitor must be a function");function f(j){if(j===null)return"";if(pe.isDate(j))return j.toISOString();if(pe.isBoolean(j))return j.toString();if(!m&&pe.isBlob(j))throw new ft("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(j)||pe.isTypedArray(j)?m&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function p(j,k,S){let _=j;if(j&&!S&&typeof j=="object"){if(pe.endsWith(k,"{}"))k=a?k:k.slice(0,-2),j=JSON.stringify(j);else if(pe.isArray(j)&&y_(j)||(pe.isFileList(j)||pe.endsWith(k,"[]"))&&(_=pe.toArray(j)))return k=h6(k),_.forEach(function(D,z){!(pe.isUndefined(D)||D===null)&&t.append(c===!0?Xy([k],z,o):c===null?k:k+"[]",f(D))}),!1}return wx(j)?!0:(t.append(Xy(S,k,o),f(j)),!1)}const x=[],y=Object.assign(b_,{defaultVisitor:p,convertValue:f,isVisitable:wx});function b(j,k){if(!pe.isUndefined(j)){if(x.indexOf(j)!==-1)throw Error("Circular reference detected in "+k.join("."));x.push(j),pe.forEach(j,function(_,M){(!(pe.isUndefined(_)||_===null)&&l.call(t,_,pe.isString(M)?M.trim():M,k,y))===!0&&b(_,k?k.concat(M):[M])}),x.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ky(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function j1(e,t){this._pairs=[],e&&Tm(e,this,t)}const f6=j1.prototype;f6.append=function(t,n){this._pairs.push([t,n])};f6.toString=function(t){const n=t?function(a){return t.call(this,a,Ky)}:Ky;return this._pairs.map(function(l){return n(l[0])+"="+n(l[1])},"").join("&")};function w_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function p6(e,t,n){if(!t)return e;const a=n&&n.encode||w_;pe.isFunction(n)&&(n={serialize:n});const l=n&&n.serialize;let o;if(l?o=l(t,n):o=pe.isURLSearchParams(t)?t.toString():new j1(t,n).toString(a),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Qy{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(a){a!==null&&t(a)})}}const x6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},j_=typeof URLSearchParams<"u"?URLSearchParams:j1,N_=typeof FormData<"u"?FormData:null,S_=typeof Blob<"u"?Blob:null,k_={isBrowser:!0,classes:{URLSearchParams:j_,FormData:N_,Blob:S_},protocols:["http","https","file","blob","url","data"]},N1=typeof window<"u"&&typeof document<"u",jx=typeof navigator=="object"&&navigator||void 0,C_=N1&&(!jx||["ReactNative","NativeScript","NS"].indexOf(jx.product)<0),T_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",__=N1&&window.location.href||"http://localhost",M_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:N1,hasStandardBrowserEnv:C_,hasStandardBrowserWebWorkerEnv:T_,navigator:jx,origin:__},Symbol.toStringTag,{value:"Module"})),vr={...M_,...k_};function E_(e,t){return Tm(e,new vr.classes.URLSearchParams,{visitor:function(n,a,l,o){return vr.isNode&&pe.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function A_(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function D_(e){const t={},n=Object.keys(e);let a;const l=n.length;let o;for(a=0;a=n.length;return c=!c&&pe.isArray(l)?l.length:c,m?(pe.hasOwnProp(l,c)?l[c]=[l[c],a]:l[c]=a,!d):((!l[c]||!pe.isObject(l[c]))&&(l[c]=[]),t(n,a,l[c],o)&&pe.isArray(l[c])&&(l[c]=D_(l[c])),!d)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(a,l)=>{t(A_(a),l,n,0)}),n}return null}function z_(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const Ru={transitional:x6,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",l=a.indexOf("application/json")>-1,o=pe.isObject(t);if(o&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return l?JSON.stringify(g6(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return E_(t,this.formSerializer).toString();if((d=pe.isFileList(t))||a.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return Tm(d?{"files[]":t}:t,m&&new m,this.formSerializer)}}return o||l?(n.setContentType("application/json",!1),z_(t)):t}],transformResponse:[function(t){const n=this.transitional||Ru.transitional,a=n&&n.forcedJSONParsing,l=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(a&&!this.responseType||l)){const c=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?ft.from(d,ft.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vr.classes.FormData,Blob:vr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{Ru.headers[e]={}});const O_=pe.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"]),R_=e=>{const t={};let n,a,l;return e&&e.split(` +`).forEach(function(c){l=c.indexOf(":"),n=c.substring(0,l).trim().toLowerCase(),a=c.substring(l+1).trim(),!(!n||t[n]&&O_[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},Zy=Symbol("internals");function Wc(e){return e&&String(e).trim().toLowerCase()}function H0(e){return e===!1||e==null?e:pe.isArray(e)?e.map(H0):String(e)}function B_(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const L_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vp(e,t,n,a,l){if(pe.isFunction(a))return a.call(this,t,n);if(l&&(t=n),!!pe.isString(t)){if(pe.isString(a))return t.indexOf(a)!==-1;if(pe.isRegExp(a))return a.test(t)}}function P_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function F_(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(l,o,c){return this[a].call(this,t,l,o,c)},configurable:!0})})}let Vr=class{constructor(t){t&&this.set(t)}set(t,n,a){const l=this;function o(d,m,f){const p=Wc(m);if(!p)throw new Error("header name must be a non-empty string");const x=pe.findKey(l,p);(!x||l[x]===void 0||f===!0||f===void 0&&l[x]!==!1)&&(l[x||m]=H0(d))}const c=(d,m)=>pe.forEach(d,(f,p)=>o(f,p,m));if(pe.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(pe.isString(t)&&(t=t.trim())&&!L_(t))c(R_(t),n);else if(pe.isObject(t)&&pe.isIterable(t)){let d={},m,f;for(const p of t){if(!pe.isArray(p))throw TypeError("Object iterator must return a key-value pair");d[f=p[0]]=(m=d[f])?pe.isArray(m)?[...m,p[1]]:[m,p[1]]:p[1]}c(d,n)}else t!=null&&o(n,t,a);return this}get(t,n){if(t=Wc(t),t){const a=pe.findKey(this,t);if(a){const l=this[a];if(!n)return l;if(n===!0)return B_(l);if(pe.isFunction(n))return n.call(this,l,a);if(pe.isRegExp(n))return n.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Wc(t),t){const a=pe.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||vp(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let l=!1;function o(c){if(c=Wc(c),c){const d=pe.findKey(a,c);d&&(!n||vp(a,a[d],d,n))&&(delete a[d],l=!0)}}return pe.isArray(t)?t.forEach(o):o(t),l}clear(t){const n=Object.keys(this);let a=n.length,l=!1;for(;a--;){const o=n[a];(!t||vp(this,this[o],o,t,!0))&&(delete this[o],l=!0)}return l}normalize(t){const n=this,a={};return pe.forEach(this,(l,o)=>{const c=pe.findKey(a,o);if(c){n[c]=H0(l),delete n[o];return}const d=t?P_(o):String(o).trim();d!==o&&delete n[o],n[d]=H0(l),a[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(a,l)=>{a!=null&&a!==!1&&(n[l]=t&&pe.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(l=>a.set(l)),a}static accessor(t){const a=(this[Zy]=this[Zy]={accessors:{}}).accessors,l=this.prototype;function o(c){const d=Wc(c);a[d]||(F_(l,c),a[d]=!0)}return pe.isArray(t)?t.forEach(o):o(t),this}};Vr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(Vr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});pe.freezeMethods(Vr);function yp(e,t){const n=this||Ru,a=t||n,l=Vr.from(a.headers);let o=a.data;return pe.forEach(e,function(d){o=d.call(n,o,l.normalize(),t?t.status:void 0)}),l.normalize(),o}function v6(e){return!!(e&&e.__CANCEL__)}function Vo(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Vo,ft,{__CANCEL__:!0});function y6(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function I_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function q_(e,t){e=e||10;const n=new Array(e),a=new Array(e);let l=0,o=0,c;return t=t!==void 0?t:1e3,function(m){const f=Date.now(),p=a[o];c||(c=f),n[l]=m,a[l]=f;let x=o,y=0;for(;x!==l;)y+=n[x++],x=x%e;if(l=(l+1)%e,l===o&&(o=(o+1)%e),f-c{n=p,l=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const p=Date.now(),x=p-n;x>=a?c(f,p):(l=f,o||(o=setTimeout(()=>{o=null,c(l)},a-x)))},()=>l&&c(l)]}const tm=(e,t,n=3)=>{let a=0;const l=q_(50,250);return H_(o=>{const c=o.loaded,d=o.lengthComputable?o.total:void 0,m=c-a,f=l(m),p=c<=d;a=c;const x={loaded:c,total:d,progress:d?c/d:void 0,bytes:m,rate:f||void 0,estimated:f&&d&&p?(d-c)/f:void 0,event:o,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(x)},n)},Jy=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},eb=e=>(...t)=>pe.asap(()=>e(...t)),U_=vr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,vr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(vr.origin),vr.navigator&&/(msie|trident)/i.test(vr.navigator.userAgent)):()=>!0,$_=vr.hasStandardBrowserEnv?{write(e,t,n,a,l,o,c){if(typeof document>"u")return;const d=[`${e}=${encodeURIComponent(t)}`];pe.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),pe.isString(a)&&d.push(`path=${a}`),pe.isString(l)&&d.push(`domain=${l}`),o===!0&&d.push("secure"),pe.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function V_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function G_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function b6(e,t,n){let a=!V_(t);return e&&(a||n==!1)?G_(e,t):t}const tb=e=>e instanceof Vr?{...e}:e;function pi(e,t){t=t||{};const n={};function a(f,p,x,y){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:y},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function l(f,p,x,y){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return a(void 0,f,x,y)}else return a(f,p,x,y)}function o(f,p){if(!pe.isUndefined(p))return a(void 0,p)}function c(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return a(void 0,f)}else return a(void 0,p)}function d(f,p,x){if(x in t)return a(f,p);if(x in e)return a(void 0,f)}const m={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(f,p,x)=>l(tb(f),tb(p),x,!0)};return pe.forEach(Object.keys({...e,...t}),function(p){const x=m[p]||l,y=x(e[p],t[p],p);pe.isUndefined(y)&&x!==d||(n[p]=y)}),n}const w6=e=>{const t=pi({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:l,xsrfCookieName:o,headers:c,auth:d}=t;if(t.headers=c=Vr.from(c),t.url=p6(b6(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),pe.isFormData(n)){if(vr.hasStandardBrowserEnv||vr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(pe.isFunction(n.getHeaders)){const m=n.getHeaders(),f=["content-type","content-length"];Object.entries(m).forEach(([p,x])=>{f.includes(p.toLowerCase())&&c.set(p,x)})}}if(vr.hasStandardBrowserEnv&&(a&&pe.isFunction(a)&&(a=a(t)),a||a!==!1&&U_(t.url))){const m=l&&o&&$_.read(o);m&&c.set(l,m)}return t},Y_=typeof XMLHttpRequest<"u",W_=Y_&&function(e){return new Promise(function(n,a){const l=w6(e);let o=l.data;const c=Vr.from(l.headers).normalize();let{responseType:d,onUploadProgress:m,onDownloadProgress:f}=l,p,x,y,b,j;function k(){b&&b(),j&&j(),l.cancelToken&&l.cancelToken.unsubscribe(p),l.signal&&l.signal.removeEventListener("abort",p)}let S=new XMLHttpRequest;S.open(l.method.toUpperCase(),l.url,!0),S.timeout=l.timeout;function _(){if(!S)return;const D=Vr.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),L={data:!d||d==="text"||d==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:D,config:e,request:S};y6(function(R){n(R),k()},function(R){a(R),k()},L),S=null}"onloadend"in S?S.onloadend=_:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(_)},S.onabort=function(){S&&(a(new ft("Request aborted",ft.ECONNABORTED,e,S)),S=null)},S.onerror=function(z){const L=z&&z.message?z.message:"Network Error",E=new ft(L,ft.ERR_NETWORK,e,S);E.event=z||null,a(E),S=null},S.ontimeout=function(){let z=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const L=l.transitional||x6;l.timeoutErrorMessage&&(z=l.timeoutErrorMessage),a(new ft(z,L.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,S)),S=null},o===void 0&&c.setContentType(null),"setRequestHeader"in S&&pe.forEach(c.toJSON(),function(z,L){S.setRequestHeader(L,z)}),pe.isUndefined(l.withCredentials)||(S.withCredentials=!!l.withCredentials),d&&d!=="json"&&(S.responseType=l.responseType),f&&([y,j]=tm(f,!0),S.addEventListener("progress",y)),m&&S.upload&&([x,b]=tm(m),S.upload.addEventListener("progress",x),S.upload.addEventListener("loadend",b)),(l.cancelToken||l.signal)&&(p=D=>{S&&(a(!D||D.type?new Vo(null,e,S):D),S.abort(),S=null)},l.cancelToken&&l.cancelToken.subscribe(p),l.signal&&(l.signal.aborted?p():l.signal.addEventListener("abort",p)));const M=I_(l.url);if(M&&vr.protocols.indexOf(M)===-1){a(new ft("Unsupported protocol "+M+":",ft.ERR_BAD_REQUEST,e));return}S.send(o||null)})},X_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,l;const o=function(f){if(!l){l=!0,d();const p=f instanceof Error?f:this.reason;a.abort(p instanceof ft?p:new Vo(p instanceof Error?p.message:p))}};let c=t&&setTimeout(()=>{c=null,o(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:m}=a;return m.unsubscribe=()=>pe.asap(d),m}},K_=function*(e,t){let n=e.byteLength;if(n{const l=Q_(e,t);let o=0,c,d=m=>{c||(c=!0,a&&a(m))};return new ReadableStream({async pull(m){try{const{done:f,value:p}=await l.next();if(f){d(),m.close();return}let x=p.byteLength;if(n){let y=o+=x;n(y)}m.enqueue(new Uint8Array(p))}catch(f){throw d(f),f}},cancel(m){return d(m),l.return()}},{highWaterMark:2})},rb=64*1024,{isFunction:y0}=pe,J_=(({Request:e,Response:t})=>({Request:e,Response:t}))(pe.global),{ReadableStream:ab,TextEncoder:sb}=pe.global,lb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},eM=e=>{e=pe.merge.call({skipUndefined:!0},J_,e);const{fetch:t,Request:n,Response:a}=e,l=t?y0(t):typeof fetch=="function",o=y0(n),c=y0(a);if(!l)return!1;const d=l&&y0(ab),m=l&&(typeof sb=="function"?(j=>k=>j.encode(k))(new sb):async j=>new Uint8Array(await new n(j).arrayBuffer())),f=o&&d&&lb(()=>{let j=!1;const k=new n(vr.origin,{body:new ab,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!k}),p=c&&d&&lb(()=>pe.isReadableStream(new a("").body)),x={stream:p&&(j=>j.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!x[j]&&(x[j]=(k,S)=>{let _=k&&k[j];if(_)return _.call(k);throw new ft(`Response type '${j}' is not supported`,ft.ERR_NOT_SUPPORT,S)})});const y=async j=>{if(j==null)return 0;if(pe.isBlob(j))return j.size;if(pe.isSpecCompliantForm(j))return(await new n(vr.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(j)||pe.isArrayBuffer(j))return j.byteLength;if(pe.isURLSearchParams(j)&&(j=j+""),pe.isString(j))return(await m(j)).byteLength},b=async(j,k)=>{const S=pe.toFiniteNumber(j.getContentLength());return S??y(k)};return async j=>{let{url:k,method:S,data:_,signal:M,cancelToken:D,timeout:z,onDownloadProgress:L,onUploadProgress:E,responseType:R,headers:H,withCredentials:$="same-origin",fetchOptions:I}=w6(j),G=t||fetch;R=R?(R+"").toLowerCase():"text";let te=X_([M,D&&D.toAbortSignal()],z),we=null;const J=te&&te.unsubscribe&&(()=>{te.unsubscribe()});let ae;try{if(E&&f&&S!=="get"&&S!=="head"&&(ae=await b(H,_))!==0){let je=new n(k,{method:"POST",body:_,duplex:"half"}),Z;if(pe.isFormData(_)&&(Z=je.headers.get("content-type"))&&H.setContentType(Z),je.body){const[O,Ne]=Jy(ae,tm(eb(E)));_=nb(je.body,rb,O,Ne)}}pe.isString($)||($=$?"include":"omit");const U=o&&"credentials"in n.prototype,q={...I,signal:te,method:S.toUpperCase(),headers:H.normalize().toJSON(),body:_,duplex:"half",credentials:U?$:void 0};we=o&&new n(k,q);let W=await(o?G(we,I):G(k,q));const oe=p&&(R==="stream"||R==="response");if(p&&(L||oe&&J)){const je={};["status","statusText","headers"].forEach(se=>{je[se]=W[se]});const Z=pe.toFiniteNumber(W.headers.get("content-length")),[O,Ne]=L&&Jy(Z,tm(eb(L),!0))||[];W=new a(nb(W.body,rb,O,()=>{Ne&&Ne(),J&&J()}),je)}R=R||"text";let P=await x[pe.findKey(x,R)||"text"](W,j);return!oe&&J&&J(),await new Promise((je,Z)=>{y6(je,Z,{data:P,headers:Vr.from(W.headers),status:W.status,statusText:W.statusText,config:j,request:we})})}catch(U){throw J&&J(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,j,we),{cause:U.cause||U}):ft.from(U,U&&U.code,j,we)}}},tM=new Map,j6=e=>{let t=e&&e.env||{};const{fetch:n,Request:a,Response:l}=t,o=[a,l,n];let c=o.length,d=c,m,f,p=tM;for(;d--;)m=o[d],f=p.get(m),f===void 0&&p.set(m,f=d?new Map:eM(t)),p=f;return f};j6();const S1={http:v_,xhr:W_,fetch:{get:j6}};pe.forEach(S1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ib=e=>`- ${e}`,nM=e=>pe.isFunction(e)||e===null||e===!1;function rM(e,t){e=pe.isArray(e)?e:[e];const{length:n}=e;let a,l;const o={};for(let c=0;c`adapter ${m} `+(f===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since : +`+c.map(ib).join(` +`):" "+ib(c[0]):"as no adapter specified";throw new ft("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return l}const N6={getAdapter:rM,adapters:S1};function bp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Vo(null,e)}function ob(e){return bp(e),e.headers=Vr.from(e.headers),e.data=yp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),N6.getAdapter(e.adapter||Ru.adapter,e)(e).then(function(a){return bp(e),a.data=yp.call(e,e.transformResponse,a),a.headers=Vr.from(a.headers),a},function(a){return v6(a)||(bp(e),a&&a.response&&(a.response.data=yp.call(e,e.transformResponse,a.response),a.response.headers=Vr.from(a.response.headers))),Promise.reject(a)})}const S6="1.13.2",_m={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_m[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const cb={};_m.transitional=function(t,n,a){function l(o,c){return"[Axios v"+S6+"] Transitional option '"+o+"'"+c+(a?". "+a:"")}return(o,c,d)=>{if(t===!1)throw new ft(l(c," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!cb[c]&&(cb[c]=!0,console.warn(l(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,c,d):!0}};_m.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function aM(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let l=a.length;for(;l-- >0;){const o=a[l],c=t[o];if(c){const d=e[o],m=d===void 0||c(d,o,e);if(m!==!0)throw new ft("option "+o+" must be "+m,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+o,ft.ERR_BAD_OPTION)}}const U0={assertOptions:aM,validators:_m},Wa=U0.validators;let mi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Qy,response:new Qy}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const o=l.stack?l.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=` +`+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=pi(this.defaults,n);const{transitional:a,paramsSerializer:l,headers:o}=n;a!==void 0&&U0.assertOptions(a,{silentJSONParsing:Wa.transitional(Wa.boolean),forcedJSONParsing:Wa.transitional(Wa.boolean),clarifyTimeoutError:Wa.transitional(Wa.boolean)},!1),l!=null&&(pe.isFunction(l)?n.paramsSerializer={serialize:l}:U0.assertOptions(l,{encode:Wa.function,serialize:Wa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),U0.assertOptions(n,{baseUrl:Wa.spelling("baseURL"),withXsrfToken:Wa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&pe.merge(o.common,o[n.method]);o&&pe.forEach(["delete","get","head","post","put","patch","common"],j=>{delete o[j]}),n.headers=Vr.concat(c,o);const d=[];let m=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(m=m&&k.synchronous,d.unshift(k.fulfilled,k.rejected))});const f=[];this.interceptors.response.forEach(function(k){f.push(k.fulfilled,k.rejected)});let p,x=0,y;if(!m){const j=[ob.bind(this),void 0];for(j.unshift(...d),j.push(...f),y=j.length,p=Promise.resolve(n);x{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](l);a._listeners=null}),this.promise.then=l=>{let o;const c=new Promise(d=>{a.subscribe(d),o=d}).then(l);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,d){a.reason||(a.reason=new Vo(o,c,d),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new k6(function(l){t=l}),cancel:t}}};function lM(e){return function(n){return e.apply(null,n)}}function iM(e){return pe.isObject(e)&&e.isAxiosError===!0}const Nx={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Nx).forEach(([e,t])=>{Nx[t]=e});function C6(e){const t=new mi(e),n=r6(mi.prototype.request,t);return pe.extend(n,mi.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(l){return C6(pi(e,l))},n}const Mn=C6(Ru);Mn.Axios=mi;Mn.CanceledError=Vo;Mn.CancelToken=sM;Mn.isCancel=v6;Mn.VERSION=S6;Mn.toFormData=Tm;Mn.AxiosError=ft;Mn.Cancel=Mn.CanceledError;Mn.all=function(t){return Promise.all(t)};Mn.spread=lM;Mn.isAxiosError=iM;Mn.mergeConfig=pi;Mn.AxiosHeaders=Vr;Mn.formToJSON=e=>g6(pe.isHTMLForm(e)?new FormData(e):e);Mn.getAdapter=N6.getAdapter;Mn.HttpStatusCode=Nx;Mn.default=Mn;const{Axios:aK,AxiosError:sK,CanceledError:lK,isCancel:iK,CancelToken:oK,VERSION:cK,all:uK,Cancel:dK,isAxiosError:mK,spread:hK,toFormData:fK,AxiosHeaders:pK,HttpStatusCode:xK,formToJSON:gK,getAdapter:vK,mergeConfig:yK}=Mn,oM=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a({classGroupId:e,validator:t}),T6=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),nm="-",ub=[],uM="arbitrary..",dM=e=>{const t=hM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return mM(c);const d=c.split(nm),m=d[0]===""&&d.length>1?1:0;return _6(d,m,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const m=a[c],f=n[c];return m?f?oM(f,m):m:f||ub}return n[c]||ub}}},_6=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const f=_6(e,t+1,o);if(f)return f}const c=n.validators;if(c===null)return;const d=t===0?e.join(nm):e.slice(t).join(nm),m=c.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?uM+a:void 0})(),hM=e=>{const{theme:t,classGroups:n}=e;return fM(n,t)},fM=(e,t)=>{const n=T6();for(const a in e){const l=e[a];k1(l,n,a,t)}return n},k1=(e,t,n,a)=>{const l=e.length;for(let o=0;o{if(typeof e=="string"){xM(e,t,n);return}if(typeof e=="function"){gM(e,t,n,a);return}vM(e,t,n,a)},xM=(e,t,n)=>{const a=e===""?t:M6(t,e);a.classGroupId=n},gM=(e,t,n,a)=>{if(yM(e)){k1(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(cM(n,e))},vM=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c{let n=e;const a=t.split(nm),l=a.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,bM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},Sx="!",db=":",wM=[],mb=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),jM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,d=0,m=0,f;const p=l.length;for(let k=0;km?f-m:void 0;return mb(o,b,y,j)};if(t){const l=t+db,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):mb(wM,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},NM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},SM=e=>({cache:bM(e.cacheSize),parseClassName:jM(e),sortModifiers:NM(e),...dM(e)}),kM=/\s+/,CM=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],d=e.trim().split(kM);let m="";for(let f=d.length-1;f>=0;f-=1){const p=d[f],{isExternal:x,modifiers:y,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:k}=n(p);if(x){m=p+(m.length>0?" "+m:m);continue}let S=!!k,_=a(S?j.substring(0,k):j);if(!_){if(!S){m=p+(m.length>0?" "+m:m);continue}if(_=a(j),!_){m=p+(m.length>0?" "+m:m);continue}S=!1}const M=y.length===0?"":y.length===1?y[0]:o(y).join(":"),D=b?M+Sx:M,z=D+_;if(c.indexOf(z)>-1)continue;c.push(z);const L=l(_,S);for(let E=0;E0?" "+m:m)}return m},TM=(...e)=>{let t=0,n,a,l="";for(;t{if(typeof e=="string")return e;let t,n="";for(let a=0;a{let n,a,l,o;const c=m=>{const f=t.reduce((p,x)=>x(p),e());return n=SM(f),a=n.cache.get,l=n.cache.set,o=d,d(m)},d=m=>{const f=a(m);if(f)return f;const p=CM(m,n);return l(m,p),p};return o=c,(...m)=>o(TM(...m))},MM=[],Wn=e=>{const t=n=>n[e]||MM;return t.isThemeGetter=!0,t},A6=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,D6=/^\((?:(\w[\w-]*):)?(.+)\)$/i,EM=/^\d+\/\d+$/,AM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,OM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xo=e=>EM.test(e),wt=e=>!!e&&!Number.isNaN(Number(e)),xl=e=>!!e&&Number.isInteger(Number(e)),wp=e=>e.endsWith("%")&&wt(e.slice(0,-1)),_s=e=>AM.test(e),BM=()=>!0,LM=e=>DM.test(e)&&!zM.test(e),z6=()=>!1,PM=e=>OM.test(e),FM=e=>RM.test(e),IM=e=>!$e(e)&&!Ve(e),qM=e=>Go(e,B6,z6),$e=e=>A6.test(e),ri=e=>Go(e,L6,LM),jp=e=>Go(e,GM,wt),hb=e=>Go(e,O6,z6),HM=e=>Go(e,R6,FM),b0=e=>Go(e,P6,PM),Ve=e=>D6.test(e),Xc=e=>Yo(e,L6),UM=e=>Yo(e,YM),fb=e=>Yo(e,O6),$M=e=>Yo(e,B6),VM=e=>Yo(e,R6),w0=e=>Yo(e,P6,!0),Go=(e,t,n)=>{const a=A6.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Yo=(e,t,n=!1)=>{const a=D6.exec(e);return a?a[1]?t(a[1]):n:!1},O6=e=>e==="position"||e==="percentage",R6=e=>e==="image"||e==="url",B6=e=>e==="length"||e==="size"||e==="bg-size",L6=e=>e==="length",GM=e=>e==="number",YM=e=>e==="family-name",P6=e=>e==="shadow",WM=()=>{const e=Wn("color"),t=Wn("font"),n=Wn("text"),a=Wn("font-weight"),l=Wn("tracking"),o=Wn("leading"),c=Wn("breakpoint"),d=Wn("container"),m=Wn("spacing"),f=Wn("radius"),p=Wn("shadow"),x=Wn("inset-shadow"),y=Wn("text-shadow"),b=Wn("drop-shadow"),j=Wn("blur"),k=Wn("perspective"),S=Wn("aspect"),_=Wn("ease"),M=Wn("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),Ve,$e],E=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],H=()=>[Ve,$e,m],$=()=>[xo,"full","auto",...H()],I=()=>[xl,"none","subgrid",Ve,$e],G=()=>["auto",{span:["full",xl,Ve,$e]},xl,Ve,$e],te=()=>[xl,"auto",Ve,$e],we=()=>["auto","min","max","fr",Ve,$e],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...H()],q=()=>[xo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],W=()=>[e,Ve,$e],oe=()=>[...z(),fb,hb,{position:[Ve,$e]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],je=()=>["auto","cover","contain",$M,qM,{size:[Ve,$e]}],Z=()=>[wp,Xc,ri],O=()=>["","none","full",f,Ve,$e],Ne=()=>["",wt,Xc,ri],se=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[wt,wp,fb,hb],Be=()=>["","none",j,Ve,$e],ie=()=>["none",wt,Ve,$e],He=()=>["none",wt,Ve,$e],lt=()=>[wt,Ve,$e],ve=()=>[xo,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_s],breakpoint:[_s],color:[BM],container:[_s],"drop-shadow":[_s],ease:["in","out","in-out"],font:[IM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_s],shadow:[_s],spacing:["px",wt],text:[_s],"text-shadow":[_s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xo,$e,Ve,S]}],container:["container"],columns:[{columns:[wt,$e,Ve,d]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[xl,"auto",Ve,$e]}],basis:[{basis:[xo,"full","auto",d,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[wt,xo,"auto","initial","none",$e]}],grow:[{grow:["",wt,Ve,$e]}],shrink:[{shrink:["",wt,Ve,$e]}],order:[{order:[xl,"first","last","none",Ve,$e]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[d,"screen",...q()]}],"min-w":[{"min-w":[d,"screen","none",...q()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Xc,ri]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ve,jp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wp,$e]}],"font-family":[{font:[UM,$e,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ve,$e]}],"line-clamp":[{"line-clamp":[wt,"none",Ve,jp]}],leading:[{leading:[o,...H()]}],"list-image":[{"list-image":["none",Ve,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[wt,"from-font","auto",Ve,ri]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[wt,"auto",Ve,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve,$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:je()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xl,Ve,$e],radial:["",Ve,$e],conic:[xl,Ve,$e]},VM,HM]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:Ne()}],"border-w-x":[{"border-x":Ne()}],"border-w-y":[{"border-y":Ne()}],"border-w-s":[{"border-s":Ne()}],"border-w-e":[{"border-e":Ne()}],"border-w-t":[{"border-t":Ne()}],"border-w-r":[{"border-r":Ne()}],"border-w-b":[{"border-b":Ne()}],"border-w-l":[{"border-l":Ne()}],"divide-x":[{"divide-x":Ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[wt,Ve,$e]}],"outline-w":[{outline:["",wt,Xc,ri]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",p,w0,b0]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",x,w0,b0]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[wt,ri]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":Ne()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",y,w0,b0]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[wt,Ve,$e]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[wt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ve,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":z()}],"mask-image-conic-pos":[{"mask-conic":[wt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:je()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,$e]}],filter:[{filter:["","none",Ve,$e]}],blur:[{blur:Be()}],brightness:[{brightness:[wt,Ve,$e]}],contrast:[{contrast:[wt,Ve,$e]}],"drop-shadow":[{"drop-shadow":["","none",b,w0,b0]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",wt,Ve,$e]}],"hue-rotate":[{"hue-rotate":[wt,Ve,$e]}],invert:[{invert:["",wt,Ve,$e]}],saturate:[{saturate:[wt,Ve,$e]}],sepia:[{sepia:["",wt,Ve,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,$e]}],"backdrop-blur":[{"backdrop-blur":Be()}],"backdrop-brightness":[{"backdrop-brightness":[wt,Ve,$e]}],"backdrop-contrast":[{"backdrop-contrast":[wt,Ve,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",wt,Ve,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[wt,Ve,$e]}],"backdrop-invert":[{"backdrop-invert":["",wt,Ve,$e]}],"backdrop-opacity":[{"backdrop-opacity":[wt,Ve,$e]}],"backdrop-saturate":[{"backdrop-saturate":[wt,Ve,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",wt,Ve,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ve,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[wt,"initial",Ve,$e]}],ease:[{ease:["linear","initial",_,Ve,$e]}],delay:[{delay:[wt,Ve,$e]}],animate:[{animate:["none",M,Ve,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ve,$e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[Ve,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve,$e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve,$e]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[wt,Xc,ri,jp]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},XM=_M(WM);function me(...e){return XM(E5(e))}const ot=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ot.displayName="Card";const Bt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));Bt.displayName="CardHeader";const Lt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("font-semibold leading-none tracking-tight",e),...t}));Lt.displayName="CardTitle";const tr=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));tr.displayName="CardDescription";const Vt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));Vt.displayName="CardContent";const F6=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));F6.displayName="CardFooter";var Np="rovingFocusGroup.onEntryFocus",KM={bubbles:!1,cancelable:!0},Bu="RovingFocusGroup",[kx,I6,QM]=vm(Bu),[ZM,Mm]=Ha(Bu,[QM]),[JM,eE]=ZM(Bu),q6=w.forwardRef((e,t)=>r.jsx(kx.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(kx.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(tE,{...e,ref:t})})}));q6.displayName=Bu;var tE=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:l=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...x}=e,y=w.useRef(null),b=dn(t,y),j=Tu(o),[k,S]=Dl({prop:c,defaultProp:d??null,onChange:m,caller:Bu}),[_,M]=w.useState(!1),D=gr(f),z=I6(n),L=w.useRef(!1),[E,R]=w.useState(0);return w.useEffect(()=>{const H=y.current;if(H)return H.addEventListener(Np,D),()=>H.removeEventListener(Np,D)},[D]),r.jsx(JM,{scope:n,orientation:a,dir:j,loop:l,currentTabStopId:k,onItemFocus:w.useCallback(H=>S(H),[S]),onItemShiftTab:w.useCallback(()=>M(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(H=>H+1),[]),onFocusableItemRemove:w.useCallback(()=>R(H=>H-1),[]),children:r.jsx(Ft.div,{tabIndex:_||E===0?-1:0,"data-orientation":a,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{L.current=!0}),onFocus:Pe(e.onFocus,H=>{const $=!L.current;if(H.target===H.currentTarget&&$&&!_){const I=new CustomEvent(Np,KM);if(H.currentTarget.dispatchEvent(I),!I.defaultPrevented){const G=z().filter(U=>U.focusable),te=G.find(U=>U.active),we=G.find(U=>U.id===k),ae=[te,we,...G].filter(Boolean).map(U=>U.ref.current);$6(ae,p)}}L.current=!1}),onBlur:Pe(e.onBlur,()=>M(!1))})})}),H6="RovingFocusGroupItem",U6=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:o,children:c,...d}=e,m=Ta(),f=o||m,p=eE(H6,n),x=p.currentTabStopId===f,y=I6(n),{onFocusableItemAdd:b,onFocusableItemRemove:j,currentTabStopId:k}=p;return w.useEffect(()=>{if(a)return b(),()=>j()},[a,b,j]),r.jsx(kx.ItemSlot,{scope:n,id:f,focusable:a,active:l,children:r.jsx(Ft.span,{tabIndex:x?0:-1,"data-orientation":p.orientation,...d,ref:t,onMouseDown:Pe(e.onMouseDown,S=>{a?p.onItemFocus(f):S.preventDefault()}),onFocus:Pe(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:Pe(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){p.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const _=aE(S,p.orientation,p.dir);if(_!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let D=y().filter(z=>z.focusable).map(z=>z.ref.current);if(_==="last")D.reverse();else if(_==="prev"||_==="next"){_==="prev"&&D.reverse();const z=D.indexOf(S.currentTarget);D=p.loop?sE(D,z+1):D.slice(z+1)}setTimeout(()=>$6(D))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});U6.displayName=H6;var nE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aE(e,t,n){const a=rE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return nE[a]}function $6(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function sE(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var V6=q6,G6=U6,Em="Tabs",[lE]=Ha(Em,[Mm]),Y6=Mm(),[iE,C1]=lE(Em),W6=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:l,defaultValue:o,orientation:c="horizontal",dir:d,activationMode:m="automatic",...f}=e,p=Tu(d),[x,y]=Dl({prop:a,onChange:l,defaultProp:o??"",caller:Em});return r.jsx(iE,{scope:n,baseId:Ta(),value:x,onValueChange:y,orientation:c,dir:p,activationMode:m,children:r.jsx(Ft.div,{dir:p,"data-orientation":c,...f,ref:t})})});W6.displayName=Em;var X6="TabsList",K6=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...l}=e,o=C1(X6,n),c=Y6(n);return r.jsx(V6,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:a,children:r.jsx(Ft.div,{role:"tablist","aria-orientation":o.orientation,...l,ref:t})})});K6.displayName=X6;var Q6="TabsTrigger",Z6=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:l=!1,...o}=e,c=C1(Q6,n),d=Y6(n),m=tw(c.baseId,a),f=nw(c.baseId,a),p=a===c.value;return r.jsx(G6,{asChild:!0,...d,focusable:!l,active:p,children:r.jsx(Ft.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:m,...o,ref:t,onMouseDown:Pe(e.onMouseDown,x=>{!l&&x.button===0&&x.ctrlKey===!1?c.onValueChange(a):x.preventDefault()}),onKeyDown:Pe(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(a)}),onFocus:Pe(e.onFocus,()=>{const x=c.activationMode!=="manual";!p&&!l&&x&&c.onValueChange(a)})})})});Z6.displayName=Q6;var J6="TabsContent",ew=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:l,children:o,...c}=e,d=C1(J6,n),m=tw(d.baseId,a),f=nw(d.baseId,a),p=a===d.value,x=w.useRef(p);return w.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Wr,{present:l||p,children:({present:y})=>r.jsx(Ft.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":m,hidden:!y,id:f,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&o})})});ew.displayName=J6;function tw(e,t){return`${e}-trigger-${t}`}function nw(e,t){return`${e}-content-${t}`}var oE=W6,rw=K6,aw=Z6,sw=ew;const Sl=oE,Ls=w.forwardRef(({className:e,...t},n)=>r.jsx(rw,{ref:n,className:me("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ls.displayName=rw.displayName;const Rt=w.forwardRef(({className:e,...t},n)=>r.jsx(aw,{ref:n,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Rt.displayName=aw.displayName;const ln=w.forwardRef(({className:e,...t},n)=>r.jsx(sw,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));ln.displayName=sw.displayName;function cE(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var T1="ScrollArea",[lw]=Ha(T1),[uE,Aa]=lw(T1),iw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:l,scrollHideDelay:o=600,...c}=e,[d,m]=w.useState(null),[f,p]=w.useState(null),[x,y]=w.useState(null),[b,j]=w.useState(null),[k,S]=w.useState(null),[_,M]=w.useState(0),[D,z]=w.useState(0),[L,E]=w.useState(!1),[R,H]=w.useState(!1),$=dn(t,G=>m(G)),I=Tu(l);return r.jsx(uE,{scope:n,type:a,dir:I,scrollHideDelay:o,scrollArea:d,viewport:f,onViewportChange:p,content:x,onContentChange:y,scrollbarX:b,onScrollbarXChange:j,scrollbarXEnabled:L,onScrollbarXEnabledChange:E,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:R,onScrollbarYEnabledChange:H,onCornerWidthChange:M,onCornerHeightChange:z,children:r.jsx(Ft.div,{dir:I,...c,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":D+"px",...e.style}})})});iw.displayName=T1;var ow="ScrollAreaViewport",cw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:l,...o}=e,c=Aa(ow,n),d=w.useRef(null),m=dn(t,d,c.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),r.jsx(Ft.div,{"data-radix-scroll-area-viewport":"",...o,ref:m,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:r.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});cw.displayName=ow;var as="ScrollAreaScrollbar",_1=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(as,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=l,d=e.orientation==="horizontal";return w.useEffect(()=>(d?o(!0):c(!0),()=>{d?o(!1):c(!1)}),[d,o,c]),l.type==="hover"?r.jsx(dE,{...a,ref:t,forceMount:n}):l.type==="scroll"?r.jsx(mE,{...a,ref:t,forceMount:n}):l.type==="auto"?r.jsx(uw,{...a,ref:t,forceMount:n}):l.type==="always"?r.jsx(M1,{...a,ref:t}):null});_1.displayName=as;var dE=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(as,e.__scopeScrollArea),[o,c]=w.useState(!1);return w.useEffect(()=>{const d=l.scrollArea;let m=0;if(d){const f=()=>{window.clearTimeout(m),c(!0)},p=()=>{m=window.setTimeout(()=>c(!1),l.scrollHideDelay)};return d.addEventListener("pointerenter",f),d.addEventListener("pointerleave",p),()=>{window.clearTimeout(m),d.removeEventListener("pointerenter",f),d.removeEventListener("pointerleave",p)}}},[l.scrollArea,l.scrollHideDelay]),r.jsx(Wr,{present:n||o,children:r.jsx(uw,{"data-state":o?"visible":"hidden",...a,ref:t})})}),mE=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(as,e.__scopeScrollArea),o=e.orientation==="horizontal",c=Dm(()=>m("SCROLL_END"),100),[d,m]=cE("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(d==="idle"){const f=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(f)}},[d,l.scrollHideDelay,m]),w.useEffect(()=>{const f=l.viewport,p=o?"scrollLeft":"scrollTop";if(f){let x=f[p];const y=()=>{const b=f[p];x!==b&&(m("SCROLL"),c()),x=b};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[l.viewport,o,m,c]),r.jsx(Wr,{present:n||d!=="hidden",children:r.jsx(M1,{"data-state":d==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),uw=w.forwardRef((e,t)=>{const n=Aa(as,e.__scopeScrollArea),{forceMount:a,...l}=e,[o,c]=w.useState(!1),d=e.orientation==="horizontal",m=Dm(()=>{if(n.viewport){const f=n.viewport.offsetWidth{const{orientation:n="vertical",...a}=e,l=Aa(as,e.__scopeScrollArea),o=w.useRef(null),c=w.useRef(0),[d,m]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=pw(d.viewport,d.content),p={...a,sizes:d,onSizesChange:m,hasThumb:f>0&&f<1,onThumbChange:y=>o.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function x(y,b){return vE(y,c.current,d,b)}return n==="horizontal"?r.jsx(hE,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&o.current){const y=l.viewport.scrollLeft,b=pb(y,d,l.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=x(y,l.dir))}}):n==="vertical"?r.jsx(fE,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&o.current){const y=l.viewport.scrollTop,b=pb(y,d);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=x(y))}}):null}),hE=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...l}=e,o=Aa(as,e.__scopeScrollArea),[c,d]=w.useState(),m=w.useRef(null),f=dn(t,m,o.onScrollbarXChange);return w.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),r.jsx(mw,{"data-orientation":"horizontal",...l,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Am(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,x)=>{if(o.viewport){const y=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(y),gw(y,x)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&c&&a({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:am(c.paddingLeft),paddingEnd:am(c.paddingRight)}})}})}),fE=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...l}=e,o=Aa(as,e.__scopeScrollArea),[c,d]=w.useState(),m=w.useRef(null),f=dn(t,m,o.onScrollbarYChange);return w.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),r.jsx(mw,{"data-orientation":"vertical",...l,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Am(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,x)=>{if(o.viewport){const y=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(y),gw(y,x)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&c&&a({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:am(c.paddingTop),paddingEnd:am(c.paddingBottom)}})}})}),[pE,dw]=lw(as),mw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:l,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:d,onThumbPositionChange:m,onDragScroll:f,onWheelScroll:p,onResize:x,...y}=e,b=Aa(as,n),[j,k]=w.useState(null),S=dn(t,$=>k($)),_=w.useRef(null),M=w.useRef(""),D=b.viewport,z=a.content-a.viewport,L=gr(p),E=gr(m),R=Dm(x,10);function H($){if(_.current){const I=$.clientX-_.current.left,G=$.clientY-_.current.top;f({x:I,y:G})}}return w.useEffect(()=>{const $=I=>{const G=I.target;j?.contains(G)&&L(I,z)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[D,j,z,L]),w.useEffect(E,[a,E]),Po(j,R),Po(b.content,R),r.jsx(pE,{scope:n,scrollbar:j,hasThumb:l,onThumbChange:gr(o),onThumbPointerUp:gr(c),onThumbPositionChange:E,onThumbPointerDown:gr(d),children:r.jsx(Ft.div,{...y,ref:S,style:{position:"absolute",...y.style},onPointerDown:Pe(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),_.current=j.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),H($))}),onPointerMove:Pe(e.onPointerMove,H),onPointerUp:Pe(e.onPointerUp,$=>{const I=$.target;I.hasPointerCapture($.pointerId)&&I.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=M.current,b.viewport&&(b.viewport.style.scrollBehavior=""),_.current=null})})})}),rm="ScrollAreaThumb",hw=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=dw(rm,e.__scopeScrollArea);return r.jsx(Wr,{present:n||l.hasThumb,children:r.jsx(xE,{ref:t,...a})})}),xE=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...l}=e,o=Aa(rm,n),c=dw(rm,n),{onThumbPositionChange:d}=c,m=dn(t,x=>c.onThumbChange(x)),f=w.useRef(void 0),p=Dm(()=>{f.current&&(f.current(),f.current=void 0)},100);return w.useEffect(()=>{const x=o.viewport;if(x){const y=()=>{if(p(),!f.current){const b=yE(x,d);f.current=b,d()}};return d(),x.addEventListener("scroll",y),()=>x.removeEventListener("scroll",y)}},[o.viewport,p,d]),r.jsx(Ft.div,{"data-state":c.hasThumb?"visible":"hidden",...l,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Pe(e.onPointerDownCapture,x=>{const b=x.target.getBoundingClientRect(),j=x.clientX-b.left,k=x.clientY-b.top;c.onThumbPointerDown({x:j,y:k})}),onPointerUp:Pe(e.onPointerUp,c.onThumbPointerUp)})});hw.displayName=rm;var E1="ScrollAreaCorner",fw=w.forwardRef((e,t)=>{const n=Aa(E1,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?r.jsx(gE,{...e,ref:t}):null});fw.displayName=E1;var gE=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,l=Aa(E1,n),[o,c]=w.useState(0),[d,m]=w.useState(0),f=!!(o&&d);return Po(l.scrollbarX,()=>{const p=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(p),m(p)}),Po(l.scrollbarY,()=>{const p=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(p),c(p)}),f?r.jsx(Ft.div,{...a,ref:t,style:{width:o,height:d,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function am(e){return e?parseInt(e,10):0}function pw(e,t){const n=e/t;return isNaN(n)?0:n}function Am(e){const t=pw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function vE(e,t,n,a="ltr"){const l=Am(n),o=l/2,c=t||o,d=l-c,m=n.scrollbar.paddingStart+c,f=n.scrollbar.size-n.scrollbar.paddingEnd-d,p=n.content-n.viewport,x=a==="ltr"?[0,p]:[p*-1,0];return xw([m,f],x)(e)}function pb(e,t,n="ltr"){const a=Am(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-l,c=t.content-t.viewport,d=o-a,m=n==="ltr"?[0,c]:[c*-1,0],f=o1(e,m);return xw([0,c],[0,d])(f)}function xw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function gw(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return(function l(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,d=n.top!==o.top;(c||d)&&t(),n=o,a=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(a)};function Dm(e,t){const n=gr(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Po(e,t){const n=gr(t);A5(()=>{let a=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return l.observe(e),()=>{window.cancelAnimationFrame(a),l.unobserve(e)}}},[e,n])}var vw=iw,bE=cw,wE=fw;const Xt=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(vw,{ref:a,className:me("relative overflow-hidden",e),...n,children:[r.jsx(bE,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsx(yw,{}),r.jsx(wE,{})]}));Xt.displayName=vw.displayName;const yw=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>r.jsx(_1,{ref:a,orientation:t,className:me("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:r.jsx(hw,{className:"relative flex-1 rounded-full bg-border"})}));yw.displayName=_1.displayName;function xb({className:e,...t}){return r.jsx("div",{className:me("animate-pulse rounded-md bg-primary/10",e),...t})}function jE(e,t=[]){let n=[];function a(o,c){const d=w.createContext(c);d.displayName=o+"Context";const m=n.length;n=[...n,c];const f=x=>{const{scope:y,children:b,...j}=x,k=y?.[e]?.[m]||d,S=w.useMemo(()=>j,Object.values(j));return r.jsx(k.Provider,{value:S,children:b})};f.displayName=o+"Provider";function p(x,y){const b=y?.[e]?.[m]||d,j=w.useContext(b);if(j)return j;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${o}\``)}return[f,p]}const l=()=>{const o=n.map(c=>w.createContext(c));return function(d){const m=d?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return l.scopeName=e,[a,NE(l,...t)]}function NE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((d,{useScope:m,scopeName:f})=>{const x=m(o)[`__scope${f}`];return{...d,...x}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var SE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bw=SE.reduce((e,t)=>{const n=c1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),A1="Progress",D1=100,[kE]=jE(A1),[CE,TE]=kE(A1),ww=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:l,getValueLabel:o=_E,...c}=e;(l||l===0)&&!gb(l)&&console.error(ME(`${l}`,"Progress"));const d=gb(l)?l:D1;a!==null&&!vb(a,d)&&console.error(EE(`${a}`,"Progress"));const m=vb(a,d)?a:null,f=sm(m)?o(m,d):void 0;return r.jsx(CE,{scope:n,value:m,max:d,children:r.jsx(bw.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":sm(m)?m:void 0,"aria-valuetext":f,role:"progressbar","data-state":Sw(m,d),"data-value":m??void 0,"data-max":d,...c,ref:t})})});ww.displayName=A1;var jw="ProgressIndicator",Nw=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,l=TE(jw,n);return r.jsx(bw.div,{"data-state":Sw(l.value,l.max),"data-value":l.value??void 0,"data-max":l.max,...a,ref:t})});Nw.displayName=jw;function _E(e,t){return`${Math.round(e/t*100)}%`}function Sw(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function sm(e){return typeof e=="number"}function gb(e){return sm(e)&&!isNaN(e)&&e>0}function vb(e,t){return sm(e)&&!isNaN(e)&&e<=t&&e>=0}function ME(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${D1}\`.`}function EE(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${D1} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var kw=ww,AE=Nw;const Lu=w.forwardRef(({className:e,value:t,...n},a)=>r.jsx(kw,{ref:a,className:me("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:r.jsx(AE,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Lu.displayName=kw.displayName;const DE={light:"",dark:".dark"},Cw=w.createContext(null);function Tw(){const e=w.useContext(Cw);if(!e)throw new Error("useChart must be used within a ");return e}const jo=w.forwardRef(({id:e,className:t,children:n,config:a,...l},o)=>{const c=w.useId(),d=`chart-${e||c.replace(/:/g,"")}`;return r.jsx(Cw.Provider,{value:{config:a},children:r.jsxs("div",{"data-chart":d,ref:o,className:me("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...l,children:[r.jsx(zE,{id:d,config:a}),r.jsx(LC,{children:n})]})})});jo.displayName="Chart";const zE=({id:e,config:t})=>{const n=Object.entries(t).filter(([,a])=>a.theme||a.color);return n.length?r.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(DE).map(([a,l])=>` +${l} [data-chart=${e}] { +${n.map(([o,c])=>{const d=c.theme?.[a]||c.color;return d?` --color-${o}: ${d};`:null}).join(` +`)} +} +`).join(` +`)}}):null},Kc=PC,No=w.forwardRef(({active:e,payload:t,className:n,indicator:a="dot",hideLabel:l=!1,hideIndicator:o=!1,label:c,labelFormatter:d,labelClassName:m,formatter:f,color:p,nameKey:x,labelKey:y},b)=>{const{config:j}=Tw(),k=w.useMemo(()=>{if(l||!t?.length)return null;const[_]=t,M=`${y||_?.dataKey||_?.name||"value"}`,D=Cx(j,_,M),z=!y&&typeof c=="string"?j[c]?.label||c:D?.label;return d?r.jsx("div",{className:me("font-medium",m),children:d(z,t)}):z?r.jsx("div",{className:me("font-medium",m),children:z}):null},[c,d,t,l,m,j,y]);if(!e||!t?.length)return null;const S=t.length===1&&a!=="dot";return r.jsxs("div",{ref:b,className:me("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[S?null:k,r.jsx("div",{className:"grid gap-1.5",children:t.filter(_=>_.type!=="none").map((_,M)=>{const D=`${x||_.name||_.dataKey||"value"}`,z=Cx(j,_,D),L=p||_.payload.fill||_.color;return r.jsx("div",{className:me("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",a==="dot"&&"items-center"),children:f&&_?.value!==void 0&&_.name?f(_.value,_.name,_,M,_.payload):r.jsxs(r.Fragment,{children:[z?.icon?r.jsx(z.icon,{}):!o&&r.jsx("div",{className:me("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":S&&a==="dashed"}),style:{"--color-bg":L,"--color-border":L}}),r.jsxs("div",{className:me("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[r.jsxs("div",{className:"grid gap-1.5",children:[S?k:null,r.jsx("span",{className:"text-muted-foreground",children:z?.label||_.name})]}),_.value&&r.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:_.value.toLocaleString()})]})]})},_.dataKey)})})]})});No.displayName="ChartTooltip";const OE=FC,_w=w.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:a="bottom",nameKey:l},o)=>{const{config:c}=Tw();return n?.length?r.jsx("div",{ref:o,className:me("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:n.filter(d=>d.type!=="none").map(d=>{const m=`${l||d.dataKey||"value"}`,f=Cx(c,d,m);return r.jsxs("div",{className:me("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?r.jsx(f.icon,{}):r.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:d.color}}),f?.label]},d.value)})}):null});_w.displayName="ChartLegend";function Cx(e,t,n){if(typeof t!="object"||t===null)return;const a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let l=n;return n in t&&typeof t[n]=="string"?l=t[n]:a&&n in a&&typeof a[n]=="string"&&(l=a[n]),l in e?e[l]:e[n]}const yb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bb=E5,Wo=(e,t)=>n=>{var a;if(t?.variants==null)return bb(e,n?.class,n?.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(f=>{const p=n?.[f],x=o?.[f];if(p===null)return null;const y=yb(p)||yb(x);return l[f][y]}),d=n&&Object.entries(n).reduce((f,p)=>{let[x,y]=p;return y===void 0||(f[x]=y),f},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,p)=>{let{class:x,className:y,...b}=p;return Object.entries(b).every(j=>{let[k,S]=j;return Array.isArray(S)?S.includes({...o,...d}[k]):{...o,...d}[k]===S})?[...f,x,y]:f},[]);return bb(e,c,m,n?.class,n?.className)},pu=Wo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),re=w.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?VC:"button";return r.jsx(c,{className:me(pu({variant:t,size:n,className:e})),ref:o,...l})});re.displayName="Button";function RE(){const[e,t]=w.useState(null),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(24),[m,f]=w.useState(!0),[p,x]=w.useState(null),[y,b]=w.useState(!0),j=w.useCallback(async()=>{try{b(!0);const $=await Mn.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");x({hitokoto:$.data.hitokoto,from:$.data.from||$.data.from_who||"未知"})}catch($){console.error("获取一言失败:",$),x({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{b(!1)}},[]),k=w.useCallback(async()=>{try{const $=localStorage.getItem("access-token"),I=await Mn.get(`/api/webui/statistics/dashboard?hours=${c}`,{headers:{Authorization:`Bearer ${$}`}});t(I.data),a(!1),o(100)}catch($){console.error("Failed to fetch dashboard data:",$),a(!1),o(100)}},[c]);if(w.useEffect(()=>{if(!n)return;o(0);const $=setTimeout(()=>o(15),200),I=setTimeout(()=>o(30),800),G=setTimeout(()=>o(45),2e3),te=setTimeout(()=>o(60),4e3),we=setTimeout(()=>o(75),6500),J=setTimeout(()=>o(85),9e3),ae=setTimeout(()=>o(92),11e3);return()=>{clearTimeout($),clearTimeout(I),clearTimeout(G),clearTimeout(te),clearTimeout(we),clearTimeout(J),clearTimeout(ae)}},[n]),w.useEffect(()=>{k(),j()},[k,j]),w.useEffect(()=>{if(!m)return;const $=setInterval(()=>{k()},3e4);return()=>clearInterval($)},[m,k]),n||!e)return r.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:r.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[r.jsx(Os,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Lu,{value:l,className:"h-2"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[l,"%"]})]})]})});const{summary:S,model_stats:_,hourly_data:M,daily_data:D,recent_activity:z}=e,L=$=>{const I=Math.floor($/3600),G=Math.floor($%3600/60);return`${I}小时${G}分钟`},E=$=>new Date($).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),R=_.slice(0,6).map($=>({name:$.model_name,value:$.request_count,fill:`hsl(var(--chart-${_.indexOf($)%5+1}))`})),H={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(Sl,{value:c.toString(),onValueChange:$=>d(Number($)),children:r.jsxs(Ls,{className:"grid grid-cols-3 w-full sm:w-auto",children:[r.jsx(Rt,{value:"24",children:"24小时"}),r.jsx(Rt,{value:"168",children:"7天"}),r.jsx(Rt,{value:"720",children:"30天"})]})}),r.jsxs(re,{variant:m?"default":"outline",size:"sm",onClick:()=>f(!m),className:"gap-2",children:[r.jsx(Os,{className:`h-4 w-4 ${m?"animate-spin":""}`}),r.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:k,children:r.jsx(Os,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"总请求数"}),r.jsx(aT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:S.total_requests.toLocaleString()}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",c<48?c+"小时":Math.floor(c/24)+"天"]})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"总花费"}),r.jsx(sT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:["¥",S.total_cost.toFixed(2)]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.cost_per_hour>0?`¥${S.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"Token消耗"}),r.jsx(lT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:[(S.total_tokens/1e3).toFixed(1),"K"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.tokens_per_hour>0?`${(S.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"平均响应"}),r.jsx(mu,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:[S.avg_response_time.toFixed(2),"s"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"在线时长"}),r.jsx(ui,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsx(Vt,{children:r.jsx("div",{className:"text-xl font-bold",children:L(S.online_time)})})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"消息处理"}),r.jsx(_u,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-xl font-bold",children:S.total_messages.toLocaleString()}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",S.total_replies.toLocaleString()," 条"]})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"成本效率"}),r.jsx(iT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-xl font-bold",children:S.total_messages>0?`¥${(S.total_cost/S.total_messages*100).toFixed(2)}`:"¥0.00"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),r.jsxs(Sl,{defaultValue:"trends",className:"space-y-4",children:[r.jsxs(Ls,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[r.jsx(Rt,{value:"trends",children:"趋势"}),r.jsx(Rt,{value:"models",children:"模型"}),r.jsx(Rt,{value:"activity",children:"活动"}),r.jsx(Rt,{value:"daily",children:"日统计"})]}),r.jsxs(ln,{value:"trends",className:"space-y-4",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"请求趋势"}),r.jsxs(tr,{children:["最近",c,"小时的请求量变化"]})]}),r.jsx(Vt,{children:r.jsx(jo,{config:H,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:r.jsxs(IC,{data:M,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>E($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>E($)})}),r.jsx(qC,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"花费趋势"}),r.jsx(tr,{children:"API调用成本变化"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:H,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:r.jsxs(fp,{data:M,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>E($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>E($)})}),r.jsx(v0,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"Token消耗"}),r.jsx(tr,{children:"Token使用量变化"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:H,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:r.jsxs(fp,{data:M,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>E($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>E($)})}),r.jsx(v0,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),r.jsx(ln,{value:"models",className:"space-y-4",children:r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"模型请求分布"}),r.jsx(tr,{children:"各模型使用占比"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:Object.fromEntries(_.slice(0,6).map(($,I)=>[$.model_name,{label:$.model_name,color:`hsl(var(--chart-${I%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:r.jsxs(HC,{children:[r.jsx(Kc,{content:r.jsx(No,{})}),r.jsx(UC,{data:R,cx:"50%",cy:"50%",labelLine:!1,label:({name:$,percent:I})=>`${$} ${I?(I*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:R.map(($,I)=>r.jsx($C,{fill:$.fill},`cell-${I}`))})]})})})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"模型详细统计"}),r.jsx(tr,{children:"请求数、花费和性能"})]}),r.jsx(Vt,{children:r.jsx(Xt,{className:"h-[300px] sm:h-[400px]",children:r.jsx("div",{className:"space-y-3",children:_.map(($,I)=>r.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:$.model_name}),r.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${I%5+1}))`}})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),r.jsx("span",{className:"ml-1 font-medium",children:$.request_count.toLocaleString()})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"花费:"}),r.jsxs("span",{className:"ml-1 font-medium",children:["¥",$.total_cost.toFixed(2)]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),r.jsxs("span",{className:"ml-1 font-medium",children:[($.total_tokens/1e3).toFixed(1),"K"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),r.jsxs("span",{className:"ml-1 font-medium",children:[$.avg_response_time.toFixed(2),"s"]})]})]})]},I))})})})]})]})}),r.jsx(ln,{value:"activity",children:r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"最近活动"}),r.jsx(tr,{children:"最新的API调用记录"})]}),r.jsx(Vt,{children:r.jsx(Xt,{className:"h-[400px] sm:h-[500px]",children:r.jsx("div",{className:"space-y-2",children:z.map(($,I)=>r.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-sm truncate",children:$.model}),r.jsx("div",{className:"text-xs text-muted-foreground",children:$.request_type})]}),r.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:E($.timestamp)})]}),r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),r.jsx("span",{className:"ml-1",children:$.tokens})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"花费:"}),r.jsxs("span",{className:"ml-1",children:["¥",$.cost.toFixed(4)]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),r.jsxs("span",{className:"ml-1",children:[$.time_cost.toFixed(2),"s"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"状态:"}),r.jsx("span",{className:`ml-1 ${$.status==="success"?"text-green-600":"text-red-600"}`,children:$.status})]})]})]},I))})})})]})}),r.jsx(ln,{value:"daily",children:r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"每日统计"}),r.jsx(tr,{children:"最近7天的数据汇总"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:r.jsxs(fp,{data:D,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>{const I=new Date($);return`${I.getMonth()+1}/${I.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>new Date($).toLocaleDateString("zh-CN")})}),r.jsx(OE,{content:r.jsx(_w,{})}),r.jsx(v0,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),r.jsx(v0,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),r.jsxs(ot,{className:"border-2 border-primary/20",children:[r.jsx(Bt,{className:"pb-3",children:r.jsx(Lt,{className:"text-lg",children:"每日一言"})}),r.jsx(Vt,{children:y?r.jsxs("div",{className:"space-y-2",children:[r.jsx(xb,{className:"h-6 w-3/4"}),r.jsx(xb,{className:"h-4 w-1/4"})]}):p?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',p.hitokoto,'"']}),r.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",p.from]})]}):null})]})]})})}const BE={theme:"system",setTheme:()=>null},Mw=w.createContext(BE),z1=()=>{const e=w.useContext(Mw);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},LE=(e,t,n)=>{const a=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||a){t(e);return}const l=n.clientX,o=n.clientY,c=Math.hypot(Math.max(l,innerWidth-l),Math.max(o,innerHeight-o));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${l}px ${o}px)`,`circle(${c}px at ${l}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},Ew=w.createContext(void 0),Aw=()=>{const e=w.useContext(Ew);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};var zm="Switch",[PE]=Ha(zm),[FE,IE]=PE(zm),Dw=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:l,defaultChecked:o,required:c,disabled:d,value:m="on",onCheckedChange:f,form:p,...x}=e,[y,b]=w.useState(null),j=dn(t,D=>b(D)),k=w.useRef(!1),S=y?p||!!y.closest("form"):!0,[_,M]=Dl({prop:l,defaultProp:o??!1,onChange:f,caller:zm});return r.jsxs(FE,{scope:n,checked:_,disabled:d,children:[r.jsx(Ft.button,{type:"button",role:"switch","aria-checked":_,"aria-required":c,"data-state":Bw(_),"data-disabled":d?"":void 0,disabled:d,value:m,...x,ref:j,onClick:Pe(e.onClick,D=>{M(z=>!z),S&&(k.current=D.isPropagationStopped(),k.current||D.stopPropagation())})}),S&&r.jsx(Rw,{control:y,bubbles:!k.current,name:a,value:m,checked:_,required:c,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});Dw.displayName=zm;var zw="SwitchThumb",Ow=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,l=IE(zw,n);return r.jsx(Ft.span,{"data-state":Bw(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t})});Ow.displayName=zw;var qE="SwitchBubbleInput",Rw=w.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...l},o)=>{const c=w.useRef(null),d=dn(c,o),m=D5(n),f=z5(t);return w.useEffect(()=>{const p=c.current;if(!p)return;const x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set;if(m!==n&&b){const j=new Event("click",{bubbles:a});b.call(p,n),p.dispatchEvent(j)}},[m,n,a]),r.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:d,style:{...l.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Rw.displayName=qE;function Bw(e){return e?"checked":"unchecked"}var Lw=Dw,HE=Ow;const gt=w.forwardRef(({className:e,...t},n)=>r.jsx(Lw,{className:me("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:r.jsx(HE,{className:me("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));gt.displayName=Lw.displayName;const UE=Wo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=w.forwardRef(({className:e,...t},n)=>r.jsx(O5,{ref:n,className:me(UE(),e),...t}));Q.displayName=O5.displayName;const Te=w.forwardRef(({className:e,type:t,...n},a)=>r.jsx("input",{type:t,className:me("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...n}));Te.displayName="Input";const $E=1,VE=1e6;let Sp=0;function GE(){return Sp=(Sp+1)%Number.MAX_SAFE_INTEGER,Sp.toString()}const kp=new Map,wb=e=>{if(kp.has(e))return;const t=setTimeout(()=>{kp.delete(e),iu({type:"REMOVE_TOAST",toastId:e})},VE);kp.set(e,t)},YE=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,$E)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?wb(n):e.toasts.forEach(a=>{wb(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===n||n===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},$0=[];let V0={toasts:[]};function iu(e){V0=YE(V0,e),$0.forEach(t=>{t(V0)})}function WE({...e}){const t=GE(),n=l=>iu({type:"UPDATE_TOAST",toast:{...l,id:t}}),a=()=>iu({type:"DISMISS_TOAST",toastId:t});return iu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:l=>{l||a()}}}),{id:t,dismiss:a,update:n}}function pr(){const[e,t]=w.useState(V0);return w.useEffect(()=>($0.push(t),()=>{const n=$0.indexOf(t);n>-1&&$0.splice(n,1)}),[e]),{...e,toast:WE,dismiss:n=>iu({type:"DISMISS_TOAST",toastId:n})}}const XE=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function KE(e){const t=XE.map(a=>({id:a.id,label:a.label,description:a.description,passed:a.validate(e)}));return{isValid:t.every(a=>a.passed),rules:t}}const O1="0.11.5 Beta",R1="MaiBot Dashboard",QE=`${R1} v${O1}`,ZE=(e="v")=>`${e}${O1}`,hr=f1,Pw=R5,JE=u1,Fw=w.forwardRef(({className:e,...t},n)=>r.jsx(ym,{ref:n,className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fw.displayName=ym.displayName;const nr=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(JE,{children:[r.jsx(Fw,{}),r.jsxs(bm,{ref:a,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,r.jsxs(d1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsx(Mu,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));nr.displayName=bm.displayName;const rr=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rr.displayName="DialogHeader";const Yr=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yr.displayName="DialogFooter";const ar=w.forwardRef(({className:e,...t},n)=>r.jsx(m1,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));ar.displayName=m1.displayName;const wr=w.forwardRef(({className:e,...t},n)=>r.jsx(h1,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));wr.displayName=h1.displayName;var eA=Symbol("radix.slottable");function tA(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eA,t}var Iw="AlertDialog",[nA]=Ha(Iw,[B5]),Hs=B5(),qw=e=>{const{__scopeAlertDialog:t,...n}=e,a=Hs(t);return r.jsx(f1,{...a,...n,modal:!0})};qw.displayName=Iw;var rA="AlertDialogTrigger",Hw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(R5,{...l,...a,ref:t})});Hw.displayName=rA;var aA="AlertDialogPortal",Uw=e=>{const{__scopeAlertDialog:t,...n}=e,a=Hs(t);return r.jsx(u1,{...a,...n})};Uw.displayName=aA;var sA="AlertDialogOverlay",$w=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(ym,{...l,...a,ref:t})});$w.displayName=sA;var Eo="AlertDialogContent",[lA,iA]=nA(Eo),oA=tA("AlertDialogContent"),Vw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...l}=e,o=Hs(n),c=w.useRef(null),d=dn(t,c),m=w.useRef(null);return r.jsx(GC,{contentName:Eo,titleName:Gw,docsSlug:"alert-dialog",children:r.jsx(lA,{scope:n,cancelRef:m,children:r.jsxs(bm,{role:"alertdialog",...o,...l,ref:d,onOpenAutoFocus:Pe(l.onOpenAutoFocus,f=>{f.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(oA,{children:a}),r.jsx(uA,{contentRef:c})]})})})});Vw.displayName=Eo;var Gw="AlertDialogTitle",Yw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(m1,{...l,...a,ref:t})});Yw.displayName=Gw;var Ww="AlertDialogDescription",Xw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(h1,{...l,...a,ref:t})});Xw.displayName=Ww;var cA="AlertDialogAction",Kw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(d1,{...l,...a,ref:t})});Kw.displayName=cA;var Qw="AlertDialogCancel",Zw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:l}=iA(Qw,n),o=Hs(n),c=dn(t,l);return r.jsx(d1,{...o,...a,ref:c})});Zw.displayName=Qw;var uA=({contentRef:e})=>{const t=`\`${Eo}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${Eo}\` by passing a \`${Ww}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Eo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},dA=qw,mA=Hw,hA=Uw,Jw=$w,e7=Vw,t7=Kw,n7=Zw,r7=Yw,a7=Xw;const cn=dA,Xn=mA,fA=hA,s7=w.forwardRef(({className:e,...t},n)=>r.jsx(Jw,{className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));s7.displayName=Jw.displayName;const Kt=w.forwardRef(({className:e,...t},n)=>r.jsxs(fA,{children:[r.jsx(s7,{}),r.jsx(e7,{ref:n,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Kt.displayName=e7.displayName;const Qt=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qt.displayName="AlertDialogHeader";const Zt=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="AlertDialogFooter";const Jt=w.forwardRef(({className:e,...t},n)=>r.jsx(r7,{ref:n,className:me("text-lg font-semibold",e),...t}));Jt.displayName=r7.displayName;const en=w.forwardRef(({className:e,...t},n)=>r.jsx(a7,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));en.displayName=a7.displayName;const tn=w.forwardRef(({className:e,...t},n)=>r.jsx(t7,{ref:n,className:me(pu(),e),...t}));tn.displayName=t7.displayName;const nn=w.forwardRef(({className:e,...t},n)=>r.jsx(n7,{ref:n,className:me(pu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));nn.displayName=n7.displayName;function pA(){return r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),r.jsxs(Sl,{defaultValue:"appearance",className:"w-full",children:[r.jsxs(Ls,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[r.jsxs(Rt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(Q5,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"外观"})]}),r.jsxs(Rt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(oT,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"安全"})]}),r.jsxs(Rt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(Pa,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"其他"})]}),r.jsxs(Rt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(hi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"关于"})]})]}),r.jsxs(Xt,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[r.jsx(ln,{value:"appearance",className:"mt-0",children:r.jsx(xA,{})}),r.jsx(ln,{value:"security",className:"mt-0",children:r.jsx(gA,{})}),r.jsx(ln,{value:"other",className:"mt-0",children:r.jsx(vA,{})}),r.jsx(ln,{value:"about",className:"mt-0",children:r.jsx(yA,{})})]})]})]})}function jb(e){const t=document.documentElement,a={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(a)t.style.setProperty("--primary",a.hsl),a.gradient?(t.style.setProperty("--primary-gradient",a.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const l=o=>{o=o.replace("#","");const c=parseInt(o.substring(0,2),16)/255,d=parseInt(o.substring(2,4),16)/255,m=parseInt(o.substring(4,6),16)/255,f=Math.max(c,d,m),p=Math.min(c,d,m);let x=0,y=0;const b=(f+p)/2;if(f!==p){const j=f-p;switch(y=b>.5?j/(2-f-p):j/(f+p),f){case c:x=((d-m)/j+(dlocalStorage.getItem("accent-color")||"blue");w.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";jb(f)},[]);const m=f=>{d(f),localStorage.setItem("accent-color",f),jb(f)};return r.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[r.jsx(Cp,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),r.jsx(Cp,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),r.jsx(Cp,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),r.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[r.jsx(Sa,{value:"blue",current:c,onChange:m,label:"蓝色",colorClass:"bg-blue-500"}),r.jsx(Sa,{value:"purple",current:c,onChange:m,label:"紫色",colorClass:"bg-purple-500"}),r.jsx(Sa,{value:"green",current:c,onChange:m,label:"绿色",colorClass:"bg-green-500"}),r.jsx(Sa,{value:"orange",current:c,onChange:m,label:"橙色",colorClass:"bg-orange-500"}),r.jsx(Sa,{value:"pink",current:c,onChange:m,label:"粉色",colorClass:"bg-pink-500"}),r.jsx(Sa,{value:"red",current:c,onChange:m,label:"红色",colorClass:"bg-red-500"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),r.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[r.jsx(Sa,{value:"gradient-sunset",current:c,onChange:m,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),r.jsx(Sa,{value:"gradient-ocean",current:c,onChange:m,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),r.jsx(Sa,{value:"gradient-forest",current:c,onChange:m,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),r.jsx(Sa,{value:"gradient-aurora",current:c,onChange:m,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),r.jsx(Sa,{value:"gradient-fire",current:c,onChange:m,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),r.jsx(Sa,{value:"gradient-twilight",current:c,onChange:m,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[r.jsx("div",{className:"flex-1",children:r.jsx("input",{type:"color",value:c.startsWith("#")?c:"#3b82f6",onChange:f=>m(f.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),r.jsx("div",{className:"flex-1",children:r.jsx(Te,{type:"text",value:c,onChange:f=>m(f.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),r.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[r.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5 flex-1",children:[r.jsx(Q,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),r.jsx(gt,{id:"animations",checked:n,onCheckedChange:a})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5 flex-1",children:[r.jsx(Q,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),r.jsx(gt,{id:"waves-background",checked:l,onCheckedChange:o})]})})]})]})]})}function gA(){const e=rs(),[t,n]=w.useState(""),[a,l]=w.useState(""),[o,c]=w.useState(!1),[d,m]=w.useState(!1),[f,p]=w.useState(!1),[x,y]=w.useState(!1),[b,j]=w.useState(!1),[k,S]=w.useState(!1),[_,M]=w.useState(""),[D,z]=w.useState(!1),{toast:L}=pr(),E=w.useMemo(()=>KE(a),[a]),R=()=>localStorage.getItem("access-token")||"",H=async J=>{try{await navigator.clipboard.writeText(J),j(!0),L({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>j(!1),2e3)}catch{L({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},$=async()=>{if(!a.trim()){L({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!E.isValid){const J=E.rules.filter(ae=>!ae.passed).map(ae=>ae.label).join(", ");L({title:"格式错误",description:`Token 不符合要求: ${J}`,variant:"destructive"});return}p(!0);try{const J=R(),ae=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`},body:JSON.stringify({new_token:a.trim()})}),U=await ae.json();ae.ok&&U.success?(localStorage.setItem("access-token",a.trim()),l(""),t&&n(a.trim()),L({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):L({title:"更新失败",description:U.message||"无法更新 Token",variant:"destructive"})}catch(J){console.error("更新 Token 错误:",J),L({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{p(!1)}},I=async()=>{y(!0);try{const J=R(),ae=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`}}),U=await ae.json();ae.ok&&U.success?(localStorage.setItem("access-token",U.token),n(U.token),M(U.token),S(!0),z(!1),L({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):L({title:"生成失败",description:U.message||"无法生成新 Token",variant:"destructive"})}catch(J){console.error("生成 Token 错误:",J),L({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{y(!1)}},G=async()=>{try{await navigator.clipboard.writeText(_),z(!0),L({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{L({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},te=()=>{S(!1),setTimeout(()=>{M(""),z(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},we=J=>{J||te()};return r.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[r.jsx(hr,{open:k,onOpenChange:we,children:r.jsxs(nr,{className:"sm:max-w-md",children:[r.jsxs(rr,{children:[r.jsxs(ar,{className:"flex items-center gap-2",children:[r.jsx(Mo,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),r.jsx(wr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[r.jsx(Q,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),r.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:_})]}),r.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Mo,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[r.jsx("p",{className:"font-semibold",children:"重要提示"}),r.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[r.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),r.jsx("li",{children:"请立即复制并保存到安全的位置"}),r.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),r.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),r.jsxs(Yr,{className:"gap-2 sm:gap-0",children:[r.jsx(re,{variant:"outline",onClick:G,className:"gap-2",children:D?r.jsxs(r.Fragment,{children:[r.jsx(di,{className:"h-4 w-4 text-green-500"}),"已复制"]}):r.jsxs(r.Fragment,{children:[r.jsx(hx,{className:"h-4 w-4"}),"复制 Token"]})}),r.jsx(re,{onClick:te,children:"我已保存,关闭"})]})]})}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),r.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Te,{id:"current-token",type:o?"text":"password",value:t||R(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),r.jsx("button",{onClick:()=>{t||n(R()),c(!o)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:o?"隐藏":"显示",children:o?r.jsx(fx,{className:"h-4 w-4 text-muted-foreground"}):r.jsx(qa,{className:"h-4 w-4 text-muted-foreground"})})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsx(re,{variant:"outline",size:"icon",onClick:()=>H(R()),title:"复制到剪贴板",className:"flex-shrink-0",children:b?r.jsx(di,{className:"h-4 w-4 text-green-500"}):r.jsx(hx,{className:"h-4 w-4"})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{variant:"outline",disabled:x,className:"gap-2 flex-1 sm:flex-none",children:[r.jsx(Os,{className:me("h-4 w-4",x&&"animate-spin")}),r.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),r.jsx("span",{className:"sm:hidden",children:"生成"})]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重新生成 Token"}),r.jsx(en,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:I,children:"确认生成"})]})]})]})]})]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{id:"new-token",type:d?"text":"password",value:a,onChange:J=>l(J.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),r.jsx("button",{onClick:()=>m(!d),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:d?"隐藏":"显示",children:d?r.jsx(fx,{className:"h-4 w-4 text-muted-foreground"}):r.jsx(qa,{className:"h-4 w-4 text-muted-foreground"})})]}),a&&r.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),r.jsx("div",{className:"space-y-1.5",children:E.rules.map(J=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[J.passed?r.jsx(Ur,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):r.jsx(px,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),r.jsx("span",{className:me(J.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:J.label})]},J.id))}),E.isValid&&r.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:r.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[r.jsx(di,{className:"h-4 w-4"}),r.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),r.jsx(re,{onClick:$,disabled:f||!E.isValid||!a,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),r.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[r.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),r.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),r.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),r.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),r.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),r.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),r.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function vA(){const e=rs(),{toast:t}=pr(),[n,a]=w.useState(!1),l=async()=>{a(!0);try{const o=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${o}`}}),d=await c.json();c.ok&&d.success?(t({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{e({to:"/setup"})},1e3)):t({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(o){console.error("重置配置状态错误:",o),t({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{a(!1)}};return r.jsx("div",{className:"space-y-4 sm:space-y-6",children:r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsx("div",{className:"space-y-2",children:r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{variant:"outline",disabled:n,className:"gap-2",children:[r.jsx(cT,{className:me("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重新配置"}),r.jsx(en,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:l,children:"确认重置"})]})]})]})]})]})})}function yA(){return r.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",R1]}),r.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("p",{children:["版本: ",O1]}),r.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),r.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",r.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"React 19.2.0"}),r.jsx("li",{children:"TypeScript 5.7.2"}),r.jsx("li",{children:"Vite 6.0.7"}),r.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"shadcn/ui"}),r.jsx("li",{children:"Radix UI"}),r.jsx("li",{children:"Tailwind CSS 3.4.17"}),r.jsx("li",{children:"Lucide Icons"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"后端"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"Python 3.12+"}),r.jsx("li",{children:"FastAPI"}),r.jsx("li",{children:"Uvicorn"}),r.jsx("li",{children:"WebSocket"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"Bun / npm"}),r.jsx("li",{children:"ESLint 9.17.0"}),r.jsx("li",{children:"PostCSS"})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),r.jsx(Xt,{className:"h-[300px] sm:h-[400px]",children:r.jsxs("div",{className:"space-y-4 pr-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"React",description:"用户界面构建库",license:"MIT"}),r.jsx(kn,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),r.jsx(kn,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),r.jsx(kn,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),r.jsx(kn,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),r.jsx(kn,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),r.jsx(kn,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),r.jsx(kn,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),r.jsx(kn,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),r.jsx(kn,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),r.jsx(kn,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),r.jsx(kn,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),r.jsx(kn,{name:"Pydantic",description:"数据验证库",license:"MIT"}),r.jsx(kn,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),r.jsx(kn,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),r.jsx(kn,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),r.jsx(kn,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[r.jsx("div",{className:"flex-shrink-0 mt-0.5",children:r.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:r.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function kn({name:e,description:t,license:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-medium text-foreground truncate",children:e}),r.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:t})]}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:n})]})}function Cp({value:e,current:t,onChange:n,label:a,description:l}){const o=t===e;return r.jsxs("button",{onClick:()=>n(e),className:me("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&r.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"text-sm sm:text-base font-medium",children:a}),r.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:l})]}),r.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[e==="light"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function Sa({value:e,current:t,onChange:n,label:a,colorClass:l}){const o=t===e;return r.jsxs("button",{onClick:()=>n(e),className:me("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&r.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),r.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[r.jsx("div",{className:me("h-8 w-8 sm:h-10 sm:w-10 rounded-full",l)}),r.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:a})]})]})}class bA{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,a){return t[0]*n+t[1]*a}mix(t,n,a){return(1-a)*t+a*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const a=Math.floor(t)&255,l=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const o=this.fade(t),c=this.fade(n),d=this.perm[a]+l,m=this.perm[d],f=this.perm[d+1],p=this.perm[a+1]+l,x=this.perm[p],y=this.perm[p+1];return this.mix(this.mix(this.dot(this.grad3[m%12],t,n),this.dot(this.grad3[x%12],t-1,n),o),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[y%12],t-1,n-1),o),c)}}function wA(){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(void 0),a=w.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new bA(Math.random()),bounding:null});return w.useEffect(()=>{const l=t.current,o=e.current;if(!l||!o)return;const c=a.current,d=()=>{const k=l.getBoundingClientRect();c.bounding=k,o.style.width=`${k.width}px`,o.style.height=`${k.height}px`},m=()=>{if(!c.bounding)return;const{width:k,height:S}=c.bounding;c.lines=[],c.paths.forEach($=>$.remove()),c.paths=[];const _=10,M=32,D=k+200,z=S+30,L=Math.ceil(D/_),E=Math.ceil(z/M),R=(k-_*L)/2,H=(S-M*E)/2;for(let $=0;$<=L;$++){const I=[];for(let te=0;te<=E;te++){const we={x:R+_*$,y:H+M*te,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};I.push(we)}const G=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild(G),c.paths.push(G),c.lines.push(I)}},f=k=>{const{lines:S,mouse:_,noise:M}=c;S.forEach(D=>{D.forEach(z=>{const L=M.perlin2((z.x+k*.0125)*.002,(z.y+k*.005)*.0015)*12;z.wave.x=Math.cos(L)*32,z.wave.y=Math.sin(L)*16;const E=z.x-_.sx,R=z.y-_.sy,H=Math.hypot(E,R),$=Math.max(175,_.vs);if(H<$){const I=1-H/$,G=Math.cos(H*.001)*I;z.cursor.vx+=Math.cos(_.a)*G*$*_.vs*65e-5,z.cursor.vy+=Math.sin(_.a)*G*$*_.vs*65e-5}z.cursor.vx+=(0-z.cursor.x)*.005,z.cursor.vy+=(0-z.cursor.y)*.005,z.cursor.vx*=.925,z.cursor.vy*=.925,z.cursor.x+=z.cursor.vx*2,z.cursor.y+=z.cursor.vy*2,z.cursor.x=Math.min(100,Math.max(-100,z.cursor.x)),z.cursor.y=Math.min(100,Math.max(-100,z.cursor.y))})})},p=(k,S=!0)=>{const _={x:k.x+k.wave.x+(S?k.cursor.x:0),y:k.y+k.wave.y+(S?k.cursor.y:0)};return _.x=Math.round(_.x*10)/10,_.y=Math.round(_.y*10)/10,_},x=()=>{const{lines:k,paths:S}=c;k.forEach((_,M)=>{let D=p(_[0],!1),z=`M ${D.x} ${D.y}`;_.forEach((L,E)=>{const R=E===_.length-1;D=p(L,!R),z+=`L ${D.x} ${D.y}`}),S[M].setAttribute("d",z)})},y=k=>{const{mouse:S}=c;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const _=S.x-S.lx,M=S.y-S.ly,D=Math.hypot(_,M);S.v=D,S.vs+=(D-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(M,_),l&&(l.style.setProperty("--x",`${S.sx}px`),l.style.setProperty("--y",`${S.sy}px`)),f(k),x(),n.current=requestAnimationFrame(y)},b=k=>{if(!c.bounding)return;const{mouse:S}=c;S.x=k.pageX-c.bounding.left,S.y=k.pageY-c.bounding.top+window.scrollY,S.set||(S.sx=S.x,S.sy=S.y,S.lx=S.x,S.ly=S.y,S.set=!0)},j=()=>{d(),m()};return d(),m(),window.addEventListener("resize",j),window.addEventListener("mousemove",b),n.current=requestAnimationFrame(y),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",b),n.current&&cancelAnimationFrame(n.current)}},[]),r.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[r.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),r.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:r.jsx("style",{children:` + path { + fill: none; + stroke: hsl(var(--primary) / 0.20); + stroke-width: 1px; + } + `})})]})}function jA(){const e=rs();w.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function l7(){return!!localStorage.getItem("access-token")}function NA(){const[e,t]=w.useState(""),[n,a]=w.useState(!1),[l,o]=w.useState(""),c=rs(),{enableWavesBackground:d,setEnableWavesBackground:m}=Aw(),{theme:f,setTheme:p}=z1();w.useEffect(()=>{l7()&&c({to:"/"})},[c]);const y=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,b=()=>{p(y==="dark"?"light":"dark")},j=async k=>{if(k.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}a(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),_=await S.json();if(S.ok&&_.valid){localStorage.setItem("access-token",e.trim());const M=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${e.trim()}`}}),D=await M.json();M.ok&&D.is_first_setup?c({to:"/setup"}):c({to:"/"})}else o(_.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),o("连接服务器失败,请检查网络连接")}finally{a(!1)}};return r.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[d&&r.jsx(wA,{}),r.jsxs(ot,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[r.jsx("button",{onClick:b,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:y==="dark"?"切换到浅色模式":"切换到深色模式",children:y==="dark"?r.jsx(xx,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):r.jsx(gx,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),r.jsxs(Bt,{className:"space-y-4 text-center",children:[r.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx(Py,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Lt,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),r.jsx(tr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),r.jsx(Vt,{children:r.jsxs("form",{onSubmit:j,className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),r.jsxs("div",{className:"relative",children:[r.jsx(uT,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),r.jsx(Te,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:k=>t(k.target.value),className:me("pl-10",l&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),l&&r.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[r.jsx(fi,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),r.jsx("span",{children:l})]}),r.jsx(re,{type:"submit",className:"w-full",disabled:n,children:n?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),r.jsxs(hr,{children:[r.jsx(Pw,{asChild:!0,children:r.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[r.jsx(dT,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),r.jsxs(nr,{className:"sm:max-w-md",children:[r.jsxs(rr,{children:[r.jsxs(ar,{className:"flex items-center gap-2",children:[r.jsx(Py,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),r.jsx(wr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(mT,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),r.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[r.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),r.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(jl,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),r.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:r.jsx("code",{className:"text-primary",children:"data/webui.json"})}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",r.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),r.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(fi,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[r.jsx("p",{className:"font-semibold",children:"安全提示"}),r.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[r.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),r.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[r.jsx(mu,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsxs(Jt,{className:"flex items-center gap-2",children:[r.jsx(mu,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),r.jsx(en,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>m(!1),children:"关闭动画"})]})]})]})]})})]}),r.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:r.jsx("p",{children:QE})})]})}const vn=w.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{className:me("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));vn.displayName="Textarea";var SA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kA=SA.reduce((e,t)=>{const n=c1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),CA="Separator",Nb="horizontal",TA=["horizontal","vertical"],i7=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=Nb,...l}=e,o=_A(a)?a:Nb,d=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return r.jsx(kA.div,{"data-orientation":o,...d,...l,ref:t})});i7.displayName=CA;function _A(e){return TA.includes(e)}var o7=i7;const xu=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},l)=>r.jsx(o7,{ref:l,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));xu.displayName=o7.displayName;const MA=Wo("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function on({className:e,variant:t,...n}){return r.jsx("div",{className:me(MA({variant:t}),e),...n})}function EA({config:e,onChange:t}){const n=l=>{l.trim()&&!e.alias_names.includes(l.trim())&&t({...e,alias_names:[...e.alias_names,l.trim()]})},a=l=>{t({...e,alias_names:e.alias_names.filter((o,c)=>c!==l)})};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"qq_account",children:"QQ账号 *"}),r.jsx(Te,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:e.qq_account||"",onChange:l=>t({...e,qq_account:Number(l.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称 *"}),r.jsx(Te,{id:"nickname",placeholder:"请输入机器人的昵称",value:e.nickname,onChange:l=>t({...e,nickname:l.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"别名"}),r.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:e.alias_names.map((l,o)=>r.jsxs(on,{variant:"secondary",className:"gap-1",children:[l,r.jsx("button",{type:"button",onClick:()=>a(o),className:"ml-1 hover:text-destructive",children:r.jsx(Mu,{className:"h-3 w-3"})})]},o))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:l=>{l.key==="Enter"&&(n(l.target.value),l.target.value="")}}),r.jsx(re,{type:"button",variant:"outline",onClick:()=>{const l=document.getElementById("alias_input");l&&(n(l.value),l.value="")},children:"添加"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function AA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"personality",children:"人格特征 *"}),r.jsx(vn,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:e.personality,onChange:n=>t({...e,personality:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"reply_style",children:"表达风格 *"}),r.jsx(vn,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:e.reply_style,onChange:n=>t({...e,reply_style:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"interest",children:"兴趣 *"}),r.jsx(vn,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:e.interest,onChange:n=>t({...e,interest:n.target.value}),rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),r.jsx(xu,{}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"plan_style",children:"群聊说话规则 *"}),r.jsx(vn,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:e.plan_style,onChange:n=>t({...e,plan_style:n.target.value}),rows:4}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),r.jsx(vn,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:e.private_plan_style,onChange:n=>t({...e,private_plan_style:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function DA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:"emoji_chance",children:"表情包激活概率"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[(e.emoji_chance*100).toFixed(0),"%"]})]}),r.jsx(Te,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:e.emoji_chance,onChange:n=>t({...e,emoji_chance:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"max_reg_num",children:"最大表情包数量"}),r.jsx(Te,{id:"max_reg_num",type:"number",min:"1",max:"200",value:e.max_reg_num,onChange:n=>t({...e,max_reg_num:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"do_replace",children:"达到最大数量时替换"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),r.jsx(gt,{id:"do_replace",checked:e.do_replace,onCheckedChange:n=>t({...e,do_replace:n})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),r.jsx(Te,{id:"check_interval",type:"number",min:"1",max:"120",value:e.check_interval,onChange:n=>t({...e,check_interval:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),r.jsx(xu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"steal_emoji",children:"偷取表情包"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),r.jsx(gt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:n=>t({...e,steal_emoji:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"content_filtration",children:"启用表情包过滤"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),r.jsx(gt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:n=>t({...e,content_filtration:n})})]}),e.content_filtration&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"filtration_prompt",children:"过滤要求"}),r.jsx(Te,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:e.filtration_prompt,onChange:n=>t({...e,filtration_prompt:n.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function zA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"enable_tool",children:"启用工具系统"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),r.jsx(gt,{id:"enable_tool",checked:e.enable_tool,onCheckedChange:n=>t({...e,enable_tool:n})})]}),r.jsx(xu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"enable_mood",children:"启用情绪系统"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),r.jsx(gt,{id:"enable_mood",checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})})]}),e.enable_mood&&r.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),r.jsx(Te,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:e.mood_update_threshold||1,onChange:n=>t({...e,mood_update_threshold:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"emotion_style",children:"情感特征"}),r.jsx(vn,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:e.emotion_style||"",onChange:n=>t({...e,emotion_style:n.target.value}),rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),r.jsx(xu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"all_global",children:"启用全局黑话模式"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),r.jsx(gt,{id:"all_global",checked:e.all_global,onCheckedChange:n=>t({...e,all_global:n})})]})]})}async function ut(e,t){const n=await fetch(e,t);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function yt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function OA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取Bot配置失败");const n=(await e.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function RA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取人格配置失败");const n=(await e.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function BA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取表情包配置失败");const n=(await e.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function LA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取其他配置失败");const n=(await e.json()).config,a=n.tool||{},l=n.mood||{},o=n.jargon||{};return{enable_tool:a.enable_tool??!0,enable_mood:l.enable_mood??!1,mood_update_threshold:l.mood_update_threshold,emotion_style:l.emotion_style,all_global:o.all_global??!0}}async function PA(e){const t=await ut("/api/webui/config/bot/section/bot",{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await t.json()}async function FA(e){const t=await ut("/api/webui/config/bot/section/personality",{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存人格配置失败")}return await t.json()}async function IA(e){const t=await ut("/api/webui/config/bot/section/emoji",{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存表情包配置失败")}return await t.json()}async function qA(e){const t=[];t.push(ut("/api/webui/config/bot/section/tool",{method:"POST",headers:yt(),body:JSON.stringify({enable_tool:e.enable_tool})})),t.push(ut("/api/webui/config/bot/section/jargon",{method:"POST",headers:yt(),body:JSON.stringify({all_global:e.all_global})}));const n={enable_mood:e.enable_mood};e.enable_mood&&(n.mood_update_threshold=e.mood_update_threshold||1,n.emotion_style=e.emotion_style||""),t.push(ut("/api/webui/config/bot/section/mood",{method:"POST",headers:yt(),body:JSON.stringify(n)}));const a=await Promise.all(t);for(const l of a)if(!l.ok){const o=await l.json();throw new Error(o.detail||"保存其他配置失败")}return{success:!0}}async function Sb(){const e=localStorage.getItem("access-token"),t=await ut("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){const n=await t.json();throw new Error(n.message||"标记配置完成失败")}return await t.json()}function HA(){const e=rs(),{toast:t}=pr(),[n,a]=w.useState(0),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!0),[p,x]=w.useState({qq_account:0,nickname:"",alias_names:[]}),[y,b]=w.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.请控制你的发言频率,不要太过频繁的发言 +4.如果有人对你感到厌烦,请减少回复 +5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.某句话如果已经被回复过,不要重复回复`}),[j,k]=w.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,_]=w.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),M=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:fT},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Z5},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:v1},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Pa},{id:"complete",title:"完成设置",description:"后续配置提示",icon:mu}],D=(n+1)/M.length*100;w.useEffect(()=>{(async()=>{try{f(!0);const[G,te,we,J]=await Promise.all([OA(),RA(),BA(),LA()]);x(G),b(te),k(we),_(J)}catch(G){t({title:"加载配置失败",description:G instanceof Error?G.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{f(!1)}})()},[t]);const z=async()=>{d(!0);try{switch(n){case 0:await PA(p);break;case 1:await FA(y);break;case 2:await IA(j);break;case 3:await qA(S);break}return t({title:"保存成功",description:`${M[n].title}配置已保存`}),!0}catch(I){return t({title:"保存失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"}),!1}finally{d(!1)}},L=async()=>{await z()&&n{n>0&&a(n-1)},R=async()=>{o(!0);try{if(!await z()){o(!1);return}await Sb(),t({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{e({to:"/"})},500)}catch(I){t({title:"完成失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}finally{o(!1)}},H=async()=>{try{await Sb(),e({to:"/"})}catch(I){t({title:"跳过失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}},$=()=>{switch(n){case 0:return r.jsx(EA,{config:p,onChange:x});case 1:return r.jsx(AA,{config:y,onChange:b});case 2:return r.jsx(DA,{config:j,onChange:k});case 3:return r.jsx(zA,{config:S,onChange:_});case 4:return r.jsxs("div",{className:"space-y-6 text-center py-8",children:[r.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(mu,{className:"h-8 w-8 text-primary",strokeWidth:2})}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),r.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"添加模型"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"配置模型任务"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return r.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[r.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[r.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),r.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),m?r.jsxs("div",{className:"relative z-10 text-center",children:[r.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:r.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),r.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[r.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[r.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx(hT,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),r.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),r.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",R1," 的初始配置"]})]}),r.jsxs("div",{className:"mb-6 md:mb-8",children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",M.length]}),r.jsxs("span",{className:"font-medium text-primary",children:[Math.round(D),"%"]})]}),r.jsx(Lu,{value:D,className:"h-2"})]}),r.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:M.map((I,G)=>{const te=I.icon;return r.jsxs("div",{className:me("flex flex-1 flex-col items-center gap-1 md:gap-2",Ge({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[r.jsx(K0,{className:"h-4 w-4"}),"返回首页"]}),r.jsxs(re,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[r.jsx(J5,{className:"h-4 w-4"}),"返回上一页"]})]}),r.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var u7=["PageUp","PageDown"],d7=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],m7={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xo="Slider",[Tx,UA,$A]=vm(Xo),[h7]=Ha(Xo,[$A]),[VA,Om]=h7(Xo),f7=w.forwardRef((e,t)=>{const{name:n,min:a=0,max:l=100,step:o=1,orientation:c="horizontal",disabled:d=!1,minStepsBetweenThumbs:m=0,defaultValue:f=[a],value:p,onValueChange:x=()=>{},onValueCommit:y=()=>{},inverted:b=!1,form:j,...k}=e,S=w.useRef(new Set),_=w.useRef(0),D=c==="horizontal"?GA:YA,[z=[],L]=Dl({prop:p,defaultProp:f,onChange:G=>{[...S.current][_.current]?.focus(),x(G)}}),E=w.useRef(z);function R(G){const te=ZA(z,G);I(G,te)}function H(G){I(G,_.current)}function $(){const G=E.current[_.current];z[_.current]!==G&&y(z)}function I(G,te,{commit:we}={commit:!1}){const J=nD(o),ae=rD(Math.round((G-a)/o)*o+a,J),U=o1(ae,[a,l]);L((q=[])=>{const W=KA(q,U,te);if(tD(W,m*o)){_.current=W.indexOf(U);const oe=String(W)!==String(q);return oe&&we&&y(W),oe?W:q}else return q})}return r.jsx(VA,{scope:e.__scopeSlider,name:n,disabled:d,min:a,max:l,valueIndexToChangeRef:_,thumbs:S.current,values:z,orientation:c,form:j,children:r.jsx(Tx.Provider,{scope:e.__scopeSlider,children:r.jsx(Tx.Slot,{scope:e.__scopeSlider,children:r.jsx(D,{"aria-disabled":d,"data-disabled":d?"":void 0,...k,ref:t,onPointerDown:Pe(k.onPointerDown,()=>{d||(E.current=z)}),min:a,max:l,inverted:b,onSlideStart:d?void 0:R,onSlideMove:d?void 0:H,onSlideEnd:d?void 0:$,onHomeKeyDown:()=>!d&&I(a,0,{commit:!0}),onEndKeyDown:()=>!d&&I(l,z.length-1,{commit:!0}),onStepKeyDown:({event:G,direction:te})=>{if(!d){const ae=u7.includes(G.key)||G.shiftKey&&d7.includes(G.key)?10:1,U=_.current,q=z[U],W=o*ae*te;I(q+W,U,{commit:!0})}}})})})})});f7.displayName=Xo;var[p7,x7]=h7(Xo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),GA=w.forwardRef((e,t)=>{const{min:n,max:a,dir:l,inverted:o,onSlideStart:c,onSlideMove:d,onSlideEnd:m,onStepKeyDown:f,...p}=e,[x,y]=w.useState(null),b=dn(t,D=>y(D)),j=w.useRef(void 0),k=Tu(l),S=k==="ltr",_=S&&!o||!S&&o;function M(D){const z=j.current||x.getBoundingClientRect(),L=[0,z.width],R=B1(L,_?[n,a]:[a,n]);return j.current=z,R(D-z.left)}return r.jsx(p7,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:r.jsx(g7,{dir:k,"data-orientation":"horizontal",...p,ref:b,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:D=>{const z=M(D.clientX);c?.(z)},onSlideMove:D=>{const z=M(D.clientX);d?.(z)},onSlideEnd:()=>{j.current=void 0,m?.()},onStepKeyDown:D=>{const L=m7[_?"from-left":"from-right"].includes(D.key);f?.({event:D,direction:L?-1:1})}})})}),YA=w.forwardRef((e,t)=>{const{min:n,max:a,inverted:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:m,...f}=e,p=w.useRef(null),x=dn(t,p),y=w.useRef(void 0),b=!l;function j(k){const S=y.current||p.current.getBoundingClientRect(),_=[0,S.height],D=B1(_,b?[a,n]:[n,a]);return y.current=S,D(k-S.top)}return r.jsx(p7,{scope:e.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:r.jsx(g7,{"data-orientation":"vertical",...f,ref:x,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:k=>{const S=j(k.clientY);o?.(S)},onSlideMove:k=>{const S=j(k.clientY);c?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:k=>{const _=m7[b?"from-bottom":"from-top"].includes(k.key);m?.({event:k,direction:_?-1:1})}})})}),g7=w.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:l,onSlideEnd:o,onHomeKeyDown:c,onEndKeyDown:d,onStepKeyDown:m,...f}=e,p=Om(Xo,n);return r.jsx(Ft.span,{...f,ref:t,onKeyDown:Pe(e.onKeyDown,x=>{x.key==="Home"?(c(x),x.preventDefault()):x.key==="End"?(d(x),x.preventDefault()):u7.concat(d7).includes(x.key)&&(m(x),x.preventDefault())}),onPointerDown:Pe(e.onPointerDown,x=>{const y=x.target;y.setPointerCapture(x.pointerId),x.preventDefault(),p.thumbs.has(y)?y.focus():a(x)}),onPointerMove:Pe(e.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&l(x)}),onPointerUp:Pe(e.onPointerUp,x=>{const y=x.target;y.hasPointerCapture(x.pointerId)&&(y.releasePointerCapture(x.pointerId),o(x))})})}),v7="SliderTrack",y7=w.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,l=Om(v7,n);return r.jsx(Ft.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...a,ref:t})});y7.displayName=v7;var _x="SliderRange",b7=w.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,l=Om(_x,n),o=x7(_x,n),c=w.useRef(null),d=dn(t,c),m=l.values.length,f=l.values.map(y=>N7(y,l.min,l.max)),p=m>1?Math.min(...f):0,x=100-Math.max(...f);return r.jsx(Ft.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...a,ref:d,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:x+"%"}})});b7.displayName=_x;var Mx="SliderThumb",w7=w.forwardRef((e,t)=>{const n=UA(e.__scopeSlider),[a,l]=w.useState(null),o=dn(t,d=>l(d)),c=w.useMemo(()=>a?n().findIndex(d=>d.ref.current===a):-1,[n,a]);return r.jsx(WA,{...e,ref:o,index:c})}),WA=w.forwardRef((e,t)=>{const{__scopeSlider:n,index:a,name:l,...o}=e,c=Om(Mx,n),d=x7(Mx,n),[m,f]=w.useState(null),p=dn(t,M=>f(M)),x=m?c.form||!!m.closest("form"):!0,y=z5(m),b=c.values[a],j=b===void 0?0:N7(b,c.min,c.max),k=QA(a,c.values.length),S=y?.[d.size],_=S?JA(S,j,d.direction):0;return w.useEffect(()=>{if(m)return c.thumbs.add(m),()=>{c.thumbs.delete(m)}},[m,c.thumbs]),r.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[d.startEdge]:`calc(${j}% + ${_}px)`},children:[r.jsx(Tx.ItemSlot,{scope:e.__scopeSlider,children:r.jsx(Ft.span,{role:"slider","aria-label":e["aria-label"]||k,"aria-valuemin":c.min,"aria-valuenow":b,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...o,ref:p,style:b===void 0?{display:"none"}:e.style,onFocus:Pe(e.onFocus,()=>{c.valueIndexToChangeRef.current=a})})}),x&&r.jsx(j7,{name:l??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:b},a)]})});w7.displayName=Mx;var XA="RadioBubbleInput",j7=w.forwardRef(({__scopeSlider:e,value:t,...n},a)=>{const l=w.useRef(null),o=dn(l,a),c=D5(t);return w.useEffect(()=>{const d=l.current;if(!d)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&p){const x=new Event("input",{bubbles:!0});p.call(d,t),d.dispatchEvent(x)}},[c,t]),r.jsx(Ft.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});j7.displayName=XA;function KA(e=[],t,n){const a=[...e];return a[n]=t,a.sort((l,o)=>l-o)}function N7(e,t,n){const o=100/(n-t)*(e-t);return o1(o,[0,100])}function QA(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ZA(e,t){if(e.length===1)return 0;const n=e.map(l=>Math.abs(l-t)),a=Math.min(...n);return n.indexOf(a)}function JA(e,t,n){const a=e/2,o=B1([0,50],[0,a]);return(a-o(t)*n)*n}function eD(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function tD(e,t){if(t>0){const n=eD(e);return Math.min(...n)>=t}return!0}function B1(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function nD(e){return(String(e).split(".")[1]||"").length}function rD(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var S7=f7,aD=y7,sD=b7,lD=w7;const Rm=w.forwardRef(({className:e,...t},n)=>r.jsxs(S7,{ref:n,className:me("relative flex w-full touch-none select-none items-center",e),...t,children:[r.jsx(aD,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:r.jsx(sD,{className:"absolute h-full bg-primary"})}),r.jsx(lD,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));Rm.displayName=S7.displayName;const _t=ZC,Mt=JC,jt=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(L5,{ref:a,className:me("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,r.jsx(YC,{asChild:!0,children:r.jsx(hu,{className:"h-4 w-4 opacity-50"})})]}));jt.displayName=L5.displayName;const k7=w.forwardRef(({className:e,...t},n)=>r.jsx(P5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(vx,{className:"h-4 w-4"})}));k7.displayName=P5.displayName;const C7=w.forwardRef(({className:e,...t},n)=>r.jsx(F5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(hu,{className:"h-4 w-4"})}));C7.displayName=F5.displayName;const Nt=w.forwardRef(({className:e,children:t,position:n="popper",...a},l)=>r.jsx(WC,{children:r.jsxs(I5,{ref:l,className:me("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[r.jsx(k7,{}),r.jsx(XC,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),r.jsx(C7,{})]})}));Nt.displayName=I5.displayName;const iD=w.forwardRef(({className:e,...t},n)=>r.jsx(q5,{ref:n,className:me("px-2 py-1.5 text-sm font-semibold",e),...t}));iD.displayName=q5.displayName;const ze=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(H5,{ref:a,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(KC,{children:r.jsx(di,{className:"h-4 w-4"})})}),r.jsx(QC,{children:t})]}));ze.displayName=H5.displayName;const oD=w.forwardRef(({className:e,...t},n)=>r.jsx(U5,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));oD.displayName=U5.displayName;function cD(e){const t=uD(e),n=w.forwardRef((a,l)=>{const{children:o,...c}=a,d=w.Children.toArray(o),m=d.find(mD);if(m){const f=m.props.children,p=d.map(x=>x===m?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return r.jsx(t,{...c,ref:l,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return r.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function uD(e){const t=w.forwardRef((n,a)=>{const{children:l,...o}=n;if(w.isValidElement(l)){const c=fD(l),d=hD(o,l.props);return l.type!==w.Fragment&&(d.ref=a?Nl(a,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dD=Symbol("radix.slottable");function mD(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dD}function hD(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...d)=>{const m=o(...d);return l(...d),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function fD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bm="Popover",[T7]=Ha(Bm,[Uo]),Pu=Uo(),[pD,zl]=T7(Bm),_7=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!1}=e,d=Pu(t),m=w.useRef(null),[f,p]=w.useState(!1),[x,y]=Dl({prop:a,defaultProp:l??!1,onChange:o,caller:Bm});return r.jsx(jm,{...d,children:r.jsx(pD,{scope:t,contentId:Ta(),triggerRef:m,open:x,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:f,onCustomAnchorAdd:w.useCallback(()=>p(!0),[]),onCustomAnchorRemove:w.useCallback(()=>p(!1),[]),modal:c,children:n})})};_7.displayName=Bm;var M7="PopoverAnchor",xD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=zl(M7,n),o=Pu(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=l;return w.useEffect(()=>(c(),()=>d()),[c,d]),r.jsx(Nm,{...o,...a,ref:t})});xD.displayName=M7;var E7="PopoverTrigger",A7=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=zl(E7,n),o=Pu(n),c=dn(t,l.triggerRef),d=r.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":B7(l.open),...a,ref:c,onClick:Pe(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?d:r.jsx(Nm,{asChild:!0,...o,children:d})});A7.displayName=E7;var L1="PopoverPortal",[gD,vD]=T7(L1,{forceMount:void 0}),D7=e=>{const{__scopePopover:t,forceMount:n,children:a,container:l}=e,o=zl(L1,t);return r.jsx(gD,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(wm,{asChild:!0,container:l,children:a})})})};D7.displayName=L1;var Fo="PopoverContent",z7=w.forwardRef((e,t)=>{const n=vD(Fo,e.__scopePopover),{forceMount:a=n.forceMount,...l}=e,o=zl(Fo,e.__scopePopover);return r.jsx(Wr,{present:a||o.open,children:o.modal?r.jsx(bD,{...l,ref:t}):r.jsx(wD,{...l,ref:t})})});z7.displayName=Fo;var yD=cD("PopoverContent.RemoveScroll"),bD=w.forwardRef((e,t)=>{const n=zl(Fo,e.__scopePopover),a=w.useRef(null),l=dn(t,a),o=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return $5(c)},[]),r.jsx(V5,{as:yD,allowPinchZoom:!0,children:r.jsx(O7,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,c=>{c.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0,f=d.button===2||m;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),wD=w.forwardRef((e,t)=>{const n=zl(Fo,e.__scopePopover),a=w.useRef(!1),l=w.useRef(!1);return r.jsx(O7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(a.current||n.triggerRef.current?.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;n.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),O7=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:p,...x}=e,y=zl(Fo,n),b=Pu(n);return G5(),r.jsx(Y5,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:r.jsx(p1,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:r.jsx(x1,{"data-state":B7(y.open),role:"dialog",id:y.contentId,...b,...x,ref:t,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),R7="PopoverClose",jD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=zl(R7,n);return r.jsx(Ft.button,{type:"button",...a,ref:t,onClick:Pe(e.onClick,()=>l.onOpenChange(!1))})});jD.displayName=R7;var ND="PopoverArrow",SD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=Pu(n);return r.jsx(g1,{...l,...a,ref:t})});SD.displayName=ND;function B7(e){return e?"open":"closed"}var kD=_7,CD=A7,TD=D7,L7=z7;const kl=kD,Cl=CD,Ps=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},l)=>r.jsx(TD,{children:r.jsx(L7,{ref:l,align:t,sideOffset:n,className:me("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...a})}));Ps.displayName=L7.displayName;const Ko="/api/webui/config";async function _D(){const t=await(await ut(`${Ko}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function Ao(){const t=await(await ut(`${Ko}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function kb(e){const n=await(await ut(`${Ko}/bot`,{method:"POST",headers:yt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function lm(e){const n=await(await ut(`${Ko}/model`,{method:"POST",headers:yt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function MD(e,t){const a=await(await ut(`${Ko}/bot/section/${e}`,{method:"POST",headers:yt(),body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}async function Ex(e,t){const a=await(await ut(`${Ko}/model/section/${e}`,{method:"POST",headers:yt(),body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}const ED=Mn.create({baseURL:"",timeout:1e4});async function P1(){try{return(await ED.post("/api/webui/system/restart")).data}catch(e){throw console.error("重启麦麦失败:",e),e}}const AD=Wo("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Fu=w.forwardRef(({className:e,variant:t,...n},a)=>r.jsx("div",{ref:a,role:"alert",className:me(AD({variant:t}),e),...n}));Fu.displayName="Alert";const DD=w.forwardRef(({className:e,...t},n)=>r.jsx("h5",{ref:n,className:me("mb-1 font-medium leading-none tracking-tight",e),...t}));DD.displayName="AlertTitle";const Iu=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("text-sm [&_p]:leading-relaxed",e),...t}));Iu.displayName="AlertDescription";function F1({onRestartComplete:e,onRestartFailed:t}){const[n,a]=w.useState(0),[l,o]=w.useState("restarting"),[c,d]=w.useState(0),[m,f]=w.useState(0);w.useEffect(()=>{const y=setInterval(()=>{a(k=>k>=90?k:k+1)},200),b=setInterval(()=>{d(k=>k+1)},1e3),j=setTimeout(()=>{o("checking"),p()},3e3);return()=>{clearInterval(y),clearInterval(b),clearTimeout(j)}},[]);const p=()=>{const b=async()=>{try{if(f(k=>k+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)a(100),o("success"),setTimeout(()=>{e?.()},1500);else throw new Error("Status check failed")}catch{m<60?setTimeout(b,2e3):(o("failed"),t?.())}};b()},x=y=>{const b=Math.floor(y/60),j=y%60;return`${b}:${j.toString().padStart(2,"0")}`};return r.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:r.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[r.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[l==="restarting"&&r.jsxs(r.Fragment,{children:[r.jsx(fu,{className:"h-16 w-16 text-primary animate-spin"}),r.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),l==="checking"&&r.jsxs(r.Fragment,{children:[r.jsx(fu,{className:"h-16 w-16 text-primary animate-spin"}),r.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),r.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",m,"/60)"]})]}),l==="success"&&r.jsxs(r.Fragment,{children:[r.jsx(Ur,{className:"h-16 w-16 text-green-500"}),r.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),l==="failed"&&r.jsxs(r.Fragment,{children:[r.jsx(fi,{className:"h-16 w-16 text-destructive"}),r.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),l!=="failed"&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Lu,{value:n,className:"h-2"}),r.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[r.jsxs("span",{children:[n,"%"]}),r.jsxs("span",{children:["已用时: ",x(c)]})]})]}),r.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:[l==="restarting"&&"🔄 配置已保存,正在重启主程序...",l==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",l==="success"&&"✅ 配置已生效,服务运行正常",l==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),l==="failed"&&r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),r.jsx("button",{onClick:()=>{o("checking"),f(0),p()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}function zD(){const[e,t]=w.useState(!0),[n,a]=w.useState(!1),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!1),[p,x]=w.useState(!1),{toast:y}=pr(),[b,j]=w.useState(null),[k,S]=w.useState(null),[_,M]=w.useState(null),[D,z]=w.useState(null),[L,E]=w.useState(null),[R,H]=w.useState(null),[$,I]=w.useState(null),[G,te]=w.useState(null),[we,J]=w.useState(null),[ae,U]=w.useState(null),[q,W]=w.useState(null),[oe,P]=w.useState(null),[je,Z]=w.useState(null),[O,Ne]=w.useState(null),[se,Ce]=w.useState(null),[ye,Be]=w.useState(null),[ie,He]=w.useState(null),[lt,ve]=w.useState(null),Ze=w.useRef(null),We=w.useRef(!0),pn=w.useRef({}),Bn=w.useCallback(async()=>{try{t(!0);const Ue=await _D();pn.current=Ue,j(Ue.bot),S(Ue.personality);const Ln=Ue.chat;Ln.talk_value_rules||(Ln.talk_value_rules=[]),M(Ln),z(Ue.expression),E(Ue.emoji),H(Ue.memory),I(Ue.tool),te(Ue.mood),J(Ue.voice),U(Ue.lpmm_knowledge),W(Ue.keyword_reaction),P(Ue.response_post_process),Z(Ue.chinese_typo),Ne(Ue.response_splitter),Ce(Ue.log),Be(Ue.debug),He(Ue.maim_message),ve(Ue.telemetry),d(!1),We.current=!1}catch(Ue){console.error("加载配置失败:",Ue),y({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[y]);w.useEffect(()=>{Bn()},[Bn]);const sr=w.useCallback(async(Ue,Ln)=>{if(!We.current)try{o(!0),await MD(Ue,Ln),d(!1)}catch(K){console.error(`自动保存 ${Ue} 失败:`,K),d(!0)}finally{o(!1)}},[]),Qe=w.useCallback((Ue,Ln)=>{We.current||(d(!0),Ze.current&&clearTimeout(Ze.current),Ze.current=setTimeout(()=>{sr(Ue,Ln)},2e3))},[sr]);w.useEffect(()=>{b&&!We.current&&Qe("bot",b)},[b,Qe]),w.useEffect(()=>{k&&!We.current&&Qe("personality",k)},[k,Qe]),w.useEffect(()=>{_&&!We.current&&Qe("chat",_)},[_,Qe]),w.useEffect(()=>{D&&!We.current&&Qe("expression",D)},[D,Qe]),w.useEffect(()=>{L&&!We.current&&Qe("emoji",L)},[L,Qe]),w.useEffect(()=>{R&&!We.current&&Qe("memory",R)},[R,Qe]),w.useEffect(()=>{$&&!We.current&&Qe("tool",$)},[$,Qe]),w.useEffect(()=>{G&&!We.current&&Qe("mood",G)},[G,Qe]),w.useEffect(()=>{we&&!We.current&&Qe("voice",we)},[we,Qe]),w.useEffect(()=>{ae&&!We.current&&Qe("lpmm_knowledge",ae)},[ae,Qe]),w.useEffect(()=>{q&&!We.current&&Qe("keyword_reaction",q)},[q,Qe]),w.useEffect(()=>{oe&&!We.current&&Qe("response_post_process",oe)},[oe,Qe]),w.useEffect(()=>{je&&!We.current&&Qe("chinese_typo",je)},[je,Qe]),w.useEffect(()=>{O&&!We.current&&Qe("response_splitter",O)},[O,Qe]),w.useEffect(()=>{se&&!We.current&&Qe("log",se)},[se,Qe]),w.useEffect(()=>{ye&&!We.current&&Qe("debug",ye)},[ye,Qe]),w.useEffect(()=>{ie&&!We.current&&Qe("maim_message",ie)},[ie,Qe]),w.useEffect(()=>{lt&&!We.current&&Qe("telemetry",lt)},[lt,Qe]);const Gn=async()=>{try{a(!0),Ze.current&&clearTimeout(Ze.current);const Ue={...pn.current,bot:b,personality:k,chat:_,expression:D,emoji:L,memory:R,tool:$,mood:G,voice:we,lpmm_knowledge:ae,keyword_reaction:q,response_post_process:oe,chinese_typo:je,response_splitter:O,log:se,debug:ye,maim_message:ie,telemetry:lt};await kb(Ue),d(!1),y({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Ue){console.error("保存配置失败:",Ue),y({title:"保存失败",description:Ue.message,variant:"destructive"})}finally{a(!1)}},Sr=async()=>{try{f(!0),P1().catch(()=>{}),x(!0)}catch(Ue){console.error("重启失败:",Ue),x(!1),y({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),f(!1)}},Er=async()=>{try{a(!0),Ze.current&&clearTimeout(Ze.current);const Ue={...pn.current,bot:b,personality:k,chat:_,expression:D,emoji:L,memory:R,tool:$,mood:G,voice:we,lpmm_knowledge:ae,keyword_reaction:q,response_post_process:oe,chinese_typo:je,response_splitter:O,log:se,debug:ye,maim_message:ie,telemetry:lt};await kb(Ue),d(!1),y({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Ln=>setTimeout(Ln,500)),await Sr()}catch(Ue){console.error("保存失败:",Ue),y({title:"保存失败",description:Ue.message,variant:"destructive"})}finally{a(!1)}},Sn=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},lr=()=>{x(!1),f(!1),y({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return e?r.jsx(Xt,{className:"h-full",children:r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsxs(re,{onClick:Gn,disabled:n||l||!c||m,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(y1,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":l?"自动保存中...":c?"保存配置":"已保存"]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{disabled:n||l||m,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(b1,{className:"mr-2 h-4 w-4"}),m?"重启中...":c?"保存并重启":"重启麦麦"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重启麦麦?"}),r.jsx(en,{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:c?Er:Sr,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(Sl,{defaultValue:"bot",className:"w-full",children:[r.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:r.jsxs(Ls,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[r.jsx(Rt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),r.jsx(Rt,{value:"personality",className:"flex-shrink-0",children:"人格"}),r.jsx(Rt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),r.jsx(Rt,{value:"expression",className:"flex-shrink-0",children:"表达"}),r.jsx(Rt,{value:"features",className:"flex-shrink-0",children:"功能"}),r.jsx(Rt,{value:"processing",className:"flex-shrink-0",children:"处理"}),r.jsx(Rt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),r.jsx(Rt,{value:"voice",className:"flex-shrink-0",children:"语音"}),r.jsx(Rt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),r.jsx(Rt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),r.jsx(ln,{value:"bot",className:"space-y-4",children:b&&r.jsx(OD,{config:b,onChange:j})}),r.jsx(ln,{value:"personality",className:"space-y-4",children:k&&r.jsx(RD,{config:k,onChange:S})}),r.jsx(ln,{value:"chat",className:"space-y-4",children:_&&r.jsx(BD,{config:_,onChange:M})}),r.jsx(ln,{value:"expression",className:"space-y-4",children:D&&r.jsx(LD,{config:D,onChange:z})}),r.jsx(ln,{value:"features",className:"space-y-4",children:L&&R&&$&&r.jsx(PD,{emojiConfig:L,memoryConfig:R,toolConfig:$,onEmojiChange:E,onMemoryChange:H,onToolChange:I})}),r.jsx(ln,{value:"processing",className:"space-y-4",children:q&&oe&&je&&O&&r.jsx(FD,{keywordReactionConfig:q,responsePostProcessConfig:oe,chineseTypoConfig:je,responseSplitterConfig:O,onKeywordReactionChange:W,onResponsePostProcessChange:P,onChineseTypoChange:Z,onResponseSplitterChange:Ne})}),r.jsx(ln,{value:"mood",className:"space-y-4",children:G&&r.jsx(ID,{config:G,onChange:te})}),r.jsx(ln,{value:"voice",className:"space-y-4",children:we&&r.jsx(qD,{config:we,onChange:J})}),r.jsx(ln,{value:"lpmm",className:"space-y-4",children:ae&&r.jsx(HD,{config:ae,onChange:U})}),r.jsxs(ln,{value:"other",className:"space-y-4",children:[se&&r.jsx(UD,{config:se,onChange:Ce}),ye&&r.jsx($D,{config:ye,onChange:Be}),ie&&r.jsx(VD,{config:ie,onChange:He}),lt&&r.jsx(GD,{config:lt,onChange:ve})]})]}),p&&r.jsx(F1,{onRestartComplete:Sn,onRestartFailed:lr})]})})}function OD({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},a=m=>{t({...e,platforms:e.platforms.filter((f,p)=>p!==m)})},l=(m,f)=>{const p=[...e.platforms];p[m]=f,t({...e,platforms:p})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},c=m=>{t({...e,alias_names:e.alias_names.filter((f,p)=>p!==m)})},d=(m,f)=>{const p=[...e.alias_names];p[m]=f,t({...e,alias_names:p})};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"platform",children:"平台"}),r.jsx(Te,{id:"platform",value:e.platform,onChange:m=>t({...e,platform:m.target.value}),placeholder:"qq"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"qq_account",children:"QQ账号"}),r.jsx(Te,{id:"qq_account",value:e.qq_account,onChange:m=>t({...e,qq_account:m.target.value}),placeholder:"123456789"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称"}),r.jsx(Te,{id:"nickname",value:e.nickname,onChange:m=>t({...e,nickname:m.target.value}),placeholder:"麦麦"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"其他平台账号"}),r.jsxs(re,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),r.jsxs("div",{className:"space-y-2",children:[e.platforms.map((m,f)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{value:m,onChange:p=>l(f,p.target.value),placeholder:"wx:114514"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除平台账号 "',m||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"别名"}),r.jsxs(re,{onClick:o,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),r.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((m,f)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{value:m,onChange:p=>d(f,p.target.value),placeholder:"小麦"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除别名 "',m||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>c(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function RD({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},a=o=>{t({...e,states:e.states.filter((c,d)=>d!==o)})},l=(o,c)=>{const d=[...e.states];d[o]=c,t({...e,states:d})};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"personality",children:"人格特质"}),r.jsx(vn,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"reply_style",children:"表达风格"}),r.jsx(vn,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"interest",children:"兴趣"}),r.jsx(vn,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"plan_style",children:"说话规则与行为风格"}),r.jsx(vn,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"visual_style",children:"识图规则"}),r.jsx(vn,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"private_plan_style",children:"私聊规则"}),r.jsx(vn,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"状态列表(人格多样性)"}),r.jsxs(re,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),r.jsx("div",{className:"space-y-2",children:e.states.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(vn,{value:o,onChange:d=>l(c,d.target.value),placeholder:"描述一个人格状态",rows:2}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsx(en,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(c),children:"删除"})]})]})]})]},c))})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"state_probability",children:"状态替换概率"}),r.jsx(Te,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:o=>t({...e,state_probability:parseFloat(o.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function BD({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},a=d=>{t({...e,talk_value_rules:e.talk_value_rules.filter((m,f)=>f!==d)})},l=(d,m,f)=>{const p=[...e.talk_value_rules];p[d]={...p[d],[m]:f},t({...e,talk_value_rules:p})},o=({value:d,onChange:m})=>{const[f,p]=w.useState("00"),[x,y]=w.useState("00"),[b,j]=w.useState("23"),[k,S]=w.useState("59");w.useEffect(()=>{const M=d.split("-");if(M.length===2){const[D,z]=M,[L,E]=D.split(":"),[R,H]=z.split(":");L&&p(L.padStart(2,"0")),E&&y(E.padStart(2,"0")),R&&j(R.padStart(2,"0")),H&&S(H.padStart(2,"0"))}},[d]);const _=(M,D,z,L)=>{const E=`${M}:${D}-${z}:${L}`;m(E)};return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[r.jsx(ui,{className:"h-4 w-4 mr-2"}),d||"选择时间段"]})}),r.jsx(Ps,{className:"w-80",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"小时"}),r.jsxs(_t,{value:f,onValueChange:M=>{p(M),_(M,x,b,k)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:24},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"分钟"}),r.jsxs(_t,{value:x,onValueChange:M=>{y(M),_(f,M,b,k)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:60},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"小时"}),r.jsxs(_t,{value:b,onValueChange:M=>{j(M),_(f,x,M,k)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:24},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"分钟"}),r.jsxs(_t,{value:k,onValueChange:M=>{S(M),_(f,x,b,M)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:60},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]})]})]})]})})]})},c=({rule:d})=>{const m=`{ target = "${d.target}", time = "${d.time}", value = ${d.value.toFixed(1)} }`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-96",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:m}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),r.jsx(Te,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:d=>t({...e,talk_value:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),r.jsx(Te,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:d=>t({...e,mentioned_bot_reply:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_context_size",children:"上下文长度"}),r.jsx(Te,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:d=>t({...e,max_context_size:parseInt(d.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"planner_smooth",children:"规划器平滑"}),r.jsx(Te,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:d=>t({...e,planner_smooth:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:d=>t({...e,enable_talk_value_rules:d})}),r.jsx(Q,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:d=>t({...e,include_planner_reasoning:d})}),r.jsx(Q,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&r.jsxs("div",{className:"border-t pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),r.jsxs(re,{onClick:n,size:"sm",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?r.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((d,m)=>r.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",m+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(c,{rule:d}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{variant:"ghost",size:"sm",children:r.jsx(Ot,{className:"h-4 w-4 text-destructive"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除规则 #",m+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(m),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"配置类型"}),r.jsxs(_t,{value:d.target===""?"global":"specific",onValueChange:f=>{f==="global"?l(m,"target",""):l(m,"target","qq::group")},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"global",children:"全局配置"}),r.jsx(ze,{value:"specific",children:"详细配置"})]})]})]}),d.target!==""&&(()=>{const f=d.target.split(":"),p=f[0]||"qq",x=f[1]||"",y=f[2]||"group";return r.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"平台"}),r.jsxs(_t,{value:p,onValueChange:b=>{l(m,"target",`${b}:${x}:${y}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"qq",children:"QQ"}),r.jsx(ze,{value:"wx",children:"微信"})]})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"群 ID"}),r.jsx(Te,{value:x,onChange:b=>{l(m,"target",`${p}:${b.target.value}:${y}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"类型"}),r.jsxs(_t,{value:y,onValueChange:b=>{l(m,"target",`${p}:${x}:${b}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"group",children:"群组(group)"}),r.jsx(ze,{value:"private",children:"私聊(private)"})]})]})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",d.target||"(未设置)"]})]})})(),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"时间段 (Time)"}),r.jsx(o,{value:d.time,onChange:f=>l(m,"time",f)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:`rule-value-${m}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),r.jsx(Te,{id:`rule-value-${m}`,type:"number",step:"0.01",min:"0",max:"1",value:d.value,onChange:f=>{const p=parseFloat(f.target.value);isNaN(p)||l(m,"value",Math.max(0,Math.min(1,p)))},className:"w-20 h-8 text-xs"})]}),r.jsx(Rm,{value:[d.value],onValueChange:f=>l(m,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0 (完全沉默)"}),r.jsx("span",{children:"0.5"}),r.jsx("span",{children:"1.0 (正常)"})]})]})]})]},m))}):r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:r.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),r.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[r.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),r.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[r.jsxs("li",{children:["• ",r.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function LD({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},a=y=>{t({...e,learning_list:e.learning_list.filter((b,j)=>j!==y)})},l=(y,b,j)=>{const k=[...e.learning_list];k[y][b]=j,t({...e,learning_list:k})},o=({rule:y})=>{const b=`["${y[0]}", "${y[1]}", "${y[2]}", "${y[3]}"]`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-96",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:b}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},c=({member:y,groupIndex:b,memberIndex:j,availableChatIds:k})=>{const S=k.includes(y)||y==="*",[_,M]=w.useState(!S);return r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"flex-1 flex gap-2",children:_?r.jsxs(r.Fragment,{children:[r.jsx(Te,{value:y,onChange:D=>x(b,j,D.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),k.length>0&&r.jsx(re,{size:"sm",variant:"outline",onClick:()=>M(!1),title:"切换到下拉选择",children:"下拉"})]}):r.jsxs(r.Fragment,{children:[r.jsxs(_t,{value:y,onValueChange:D=>x(b,j,D),children:[r.jsx(jt,{className:"flex-1",children:r.jsx(Mt,{placeholder:"选择聊天流"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"*",children:"* (全局共享)"}),k.map((D,z)=>r.jsx(ze,{value:D,children:D},z))]})]}),r.jsx(re,{size:"sm",variant:"outline",onClick:()=>M(!0),title:"切换到手动输入",children:"输入"})]})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除组成员 "',y||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>p(b,j),children:"删除"})]})]})]})]})},d=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},m=y=>{t({...e,expression_groups:e.expression_groups.filter((b,j)=>j!==y)})},f=y=>{const b=[...e.expression_groups];b[y]=[...b[y],""],t({...e,expression_groups:b})},p=(y,b)=>{const j=[...e.expression_groups];j[y]=j[y].filter((k,S)=>S!==b),t({...e,expression_groups:j})},x=(y,b,j)=>{const k=[...e.expression_groups];k[y][b]=j,t({...e,expression_groups:k})};return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),r.jsxs(re,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),r.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((y,b)=>{const j=e.learning_list.some((z,L)=>L!==b&&z[0]===""),k=y[0]==="",S=y[0].split(":"),_=S[0]||"qq",M=S[1]||"",D=S[2]||"group";return r.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["规则 ",b+1," ",k&&"(全局配置)"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(o,{rule:y}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除学习规则 ",b+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(b),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"配置类型"}),r.jsxs(_t,{value:k?"global":"specific",onValueChange:z=>{z==="global"?l(b,0,""):l(b,0,"qq::group")},disabled:j&&!k,children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"global",children:"全局配置"}),r.jsx(ze,{value:"specific",disabled:j&&!k,children:"详细配置"})]})]}),j&&!k&&r.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!k&&r.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"平台"}),r.jsxs(_t,{value:_,onValueChange:z=>{l(b,0,`${z}:${M}:${D}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"qq",children:"QQ"}),r.jsx(ze,{value:"wx",children:"微信"})]})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"群 ID"}),r.jsx(Te,{value:M,onChange:z=>{l(b,0,`${_}:${z.target.value}:${D}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"类型"}),r.jsxs(_t,{value:D,onValueChange:z=>{l(b,0,`${_}:${M}:${z}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"group",children:"群组(group)"}),r.jsx(ze,{value:"private",children:"私聊(private)"})]})]})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",y[0]||"(未设置)"]})]}),r.jsx("div",{className:"grid gap-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs font-medium",children:"使用学到的表达"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),r.jsx(gt,{checked:y[1]==="enable",onCheckedChange:z=>l(b,1,z?"enable":"disable")})]})}),r.jsx("div",{className:"grid gap-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs font-medium",children:"学习表达"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),r.jsx(gt,{checked:y[2]==="enable",onCheckedChange:z=>l(b,2,z?"enable":"disable")})]})}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{className:"text-xs font-medium",children:"学习强度"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"5",value:y[3],onChange:z=>{const L=parseFloat(z.target.value);isNaN(L)||l(b,3,Math.max(0,Math.min(5,L)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),r.jsx(Rm,{value:[parseFloat(y[3])||1],onValueChange:z=>l(b,3,z[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0 (不学习)"}),r.jsx("span",{children:"2.5"}),r.jsx("span",{children:"5.0 (快速学习)"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},b)}),e.learning_list.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),r.jsxs(re,{onClick:d,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),r.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((y,b)=>{const j=e.learning_list.map(k=>k[0]).filter(k=>k!=="");return r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",b+1,y.length===1&&y[0]==="*"&&"(全局共享)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(re,{onClick:()=>f(b),size:"sm",variant:"outline",children:r.jsx(mr,{className:"h-4 w-4"})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除共享组 ",b+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>m(b),children:"删除"})]})]})]})]})]}),r.jsx("div",{className:"space-y-2",children:y.map((k,S)=>r.jsx(c,{member:k,groupIndex:b,memberIndex:S,availableChatIds:j},S))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},b)}),e.expression_groups.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function PD({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:a,onMemoryChange:l,onToolChange:o}){return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:c=>o({...n,enable_tool:c})}),r.jsx(Q,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),r.jsx(Te,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:c=>l({...t,max_agent_iterations:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"emoji_chance",children:"表情包激活概率"}),r.jsx(Te,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:c=>a({...e,emoji_chance:parseFloat(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_reg_num",children:"最大注册数量"}),r.jsx(Te,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:c=>a({...e,max_reg_num:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),r.jsx(Te,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:c=>a({...e,check_interval:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"do_replace",checked:e.do_replace,onCheckedChange:c=>a({...e,do_replace:c})}),r.jsx(Q,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:c=>a({...e,steal_emoji:c})}),r.jsx(Q,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:c=>a({...e,content_filtration:c})}),r.jsx(Q,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&r.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[r.jsx(Q,{htmlFor:"filtration_prompt",children:"过滤要求"}),r.jsx(Te,{id:"filtration_prompt",value:e.filtration_prompt,onChange:c=>a({...e,filtration_prompt:c.target.value}),placeholder:"符合公序良俗"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function FD({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:a,onKeywordReactionChange:l,onResponsePostProcessChange:o,onChineseTypoChange:c,onResponseSplitterChange:d}){const m=()=>{l({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=z=>{l({...e,regex_rules:e.regex_rules.filter((L,E)=>E!==z)})},p=(z,L,E)=>{const R=[...e.regex_rules];L==="regex"&&typeof E=="string"?R[z]={...R[z],regex:[E]}:L==="reaction"&&typeof E=="string"&&(R[z]={...R[z],reaction:E}),l({...e,regex_rules:R})},x=({regex:z,reaction:L,onRegexChange:E,onReactionChange:R})=>{const[H,$]=w.useState(!1),[I,G]=w.useState(""),[te,we]=w.useState(null),[J,ae]=w.useState(""),[U,q]=w.useState({}),[W,oe]=w.useState(""),P=w.useRef(null),[je,Z]=w.useState("build"),O=ye=>ye.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),Ne=(ye,Be=0)=>{const ie=P.current;if(!ie)return;const He=ie.selectionStart||0,lt=ie.selectionEnd||0,ve=z.substring(0,He)+ye+z.substring(lt);E(ve),setTimeout(()=>{const Ze=He+ye.length+Be;ie.setSelectionRange(Ze,Ze),ie.focus()},0)};w.useEffect(()=>{if(!z||!I){we(null),q({}),oe(L),ae("");return}try{const ye=O(z),Be=new RegExp(ye,"g"),ie=I.match(Be);we(ie),ae("");const lt=new RegExp(ye).exec(I);if(lt&<.groups){q(lt.groups);let ve=L;Object.entries(lt.groups).forEach(([Ze,We])=>{ve=ve.replace(new RegExp(`\\[${Ze}\\]`,"g"),We||"")}),oe(ve)}else q({}),oe(L)}catch(ye){ae(ye.message),we(null),q({}),oe(L)}},[z,I,L]);const se=()=>{if(!I||!te||te.length===0)return r.jsx("span",{className:"text-muted-foreground",children:I||"请输入测试文本"});try{const ye=O(z),Be=new RegExp(ye,"g");let ie=0;const He=[];let lt;for(;(lt=Be.exec(I))!==null;)lt.index>ie&&He.push(r.jsx("span",{children:I.substring(ie,lt.index)},`text-${ie}`)),He.push(r.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:lt[0]},`match-${lt.index}`)),ie=lt.index+lt[0].length;return ie)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return r.jsxs(hr,{open:H,onOpenChange:$,children:[r.jsx(Pw,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(Q0,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),r.jsxs(nr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"正则表达式编辑器"}),r.jsx(wr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),r.jsx(Xt,{className:"max-h-[calc(90vh-120px)]",children:r.jsxs(Sl,{value:je,onValueChange:ye=>Z(ye),className:"w-full",children:[r.jsxs(Ls,{className:"grid w-full grid-cols-2",children:[r.jsx(Rt,{value:"build",children:"🔧 构建器"}),r.jsx(Rt,{value:"test",children:"🧪 测试器"})]}),r.jsxs(ln,{value:"build",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"正则表达式"}),r.jsx(Te,{ref:P,value:z,onChange:ye=>E(ye.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"Reaction 内容"}),r.jsx(vn,{value:L,onChange:ye=>R(ye.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),r.jsxs("div",{className:"space-y-4 border-t pt-4",children:[Ce.map(ye=>r.jsxs("div",{className:"space-y-2",children:[r.jsx("h5",{className:"text-xs font-semibold text-primary",children:ye.category}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ye.items.map(Be=>r.jsx(re,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>Ne(Be.pattern,Be.moveCursor||0),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r.jsx("span",{className:"text-xs font-medium",children:Be.label}),r.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:Be.pattern})]}),r.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:Be.desc})]})},Be.label))})]},ye.category)),r.jsxs("div",{className:"space-y-2 border-t pt-4",children:[r.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(re,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("^(?P\\S{1,20})是这样的$"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),r.jsx(re,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),r.jsx(re,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?P.+?)(?:是|为什么|怎么)"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),r.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[r.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),r.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),r.jsxs("li",{children:["命名捕获组格式:",r.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),r.jsxs("li",{children:["在 reaction 中使用 ",r.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),r.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),r.jsxs(ln,{value:"test",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"当前正则表达式"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:z||"(未设置)"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),r.jsx(vn,{id:"test-text",value:I,onChange:ye=>G(ye.target.value),placeholder:`在此输入要测试的文本... +例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),J&&r.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[r.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),r.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:J})]}),!J&&I&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center gap-2",children:te&&te.length>0?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),r.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",te.length," 处)"]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),r.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"匹配高亮"}),r.jsx(Xt,{className:"h-40 rounded-md bg-muted p-3",children:r.jsx("div",{className:"text-sm break-words",children:se()})})]}),Object.keys(U).length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"命名捕获组"}),r.jsx(Xt,{className:"h-32 rounded-md border p-3",children:r.jsx("div",{className:"space-y-2",children:Object.entries(U).map(([ye,Be])=>r.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[r.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ye,"]"]}),r.jsx("span",{className:"text-muted-foreground",children:"="}),r.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:Be})]},ye))})})]}),Object.keys(U).length>0&&L&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"Reaction 替换预览"}),r.jsx(Xt,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:r.jsx("div",{className:"text-sm break-words",children:W})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),r.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[r.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),r.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),r.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),r.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),r.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},y=()=>{l({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},b=z=>{l({...e,keyword_rules:e.keyword_rules.filter((L,E)=>E!==z)})},j=(z,L,E)=>{const R=[...e.keyword_rules];typeof E=="string"&&(R[z]={...R[z],reaction:E}),l({...e,keyword_rules:R})},k=z=>{const L=[...e.keyword_rules];L[z]={...L[z],keywords:[...L[z].keywords||[],""]},l({...e,keyword_rules:L})},S=(z,L)=>{const E=[...e.keyword_rules];E[z]={...E[z],keywords:(E[z].keywords||[]).filter((R,H)=>H!==L)},l({...e,keyword_rules:E})},_=(z,L,E)=>{const R=[...e.keyword_rules],H=[...R[z].keywords||[]];H[L]=E,R[z]={...R[z],keywords:H},l({...e,keyword_rules:R})},M=({rule:z})=>{const L=`{ regex = [${(z.regex||[]).map(E=>`"${E}"`).join(", ")}], reaction = "${z.reaction}" }`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-[95vw] sm:w-[500px]",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx(Xt,{className:"h-60 rounded-md bg-muted p-3",children:r.jsx("pre",{className:"font-mono text-xs break-all",children:L})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},D=({rule:z})=>{const L=`[[keyword_reaction.keyword_rules]] +keywords = [${(z.keywords||[]).map(E=>`"${E}"`).join(", ")}] +reaction = "${z.reaction}"`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-[95vw] sm:w-[500px]",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx(Xt,{className:"h-60 rounded-md bg-muted p-3",children:r.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:L})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),r.jsxs(re,{onClick:m,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),r.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((z,L)=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",L+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(x,{regex:z.regex&&z.regex[0]||"",reaction:z.reaction,onRegexChange:E=>p(L,"regex",E),onReactionChange:E=>p(L,"reaction",E)}),r.jsx(M,{rule:z}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除正则规则 ",L+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>f(L),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),r.jsx(Te,{value:z.regex&&z.regex[0]||"",onChange:E=>p(L,"regex",E.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"反应内容"}),r.jsx(vn,{value:z.reaction,onChange:E=>p(L,"reaction",E.target.value),placeholder:`触发后麦麦的反应... +可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},L)),e.regex_rules.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),r.jsxs("div",{className:"space-y-4 border-t pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),r.jsxs(re,{onClick:y,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),r.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((z,L)=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",L+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{rule:z}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除关键词规则 ",L+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>b(L),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{className:"text-xs font-medium",children:"关键词列表"}),r.jsxs(re,{onClick:()=>k(L),size:"sm",variant:"ghost",children:[r.jsx(mr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),r.jsxs("div",{className:"space-y-2",children:[(z.keywords||[]).map((E,R)=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{value:E,onChange:H=>_(L,R,H.target.value),placeholder:"关键词",className:"flex-1"}),r.jsx(re,{onClick:()=>S(L,R),size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})]},R)),(!z.keywords||z.keywords.length===0)&&r.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"反应内容"}),r.jsx(vn,{value:z.reaction,onChange:E=>j(L,"reaction",E.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},L)),e.keyword_rules.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:z=>o({...t,enable_response_post_process:z})}),r.jsx(Q,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"border-t pt-6 space-y-4",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[r.jsx(gt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:z=>c({...n,enable:z})}),r.jsx(Q,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&r.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),r.jsx(Te,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:z=>c({...n,error_rate:parseFloat(z.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),r.jsx(Te,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:z=>c({...n,min_freq:parseInt(z.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),r.jsx(Te,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:z=>c({...n,tone_error_rate:parseFloat(z.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),r.jsx(Te,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:z=>c({...n,word_replace_rate:parseFloat(z.target.value)})})]})]})]})}),r.jsx("div",{className:"border-t pt-6 space-y-4",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[r.jsx(gt,{id:"enable_response_splitter",checked:a.enable,onCheckedChange:z=>d({...a,enable:z})}),r.jsx(Q,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),a.enable&&r.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),r.jsx(Te,{id:"max_length",type:"number",min:"1",value:a.max_length,onChange:z=>d({...a,max_length:parseInt(z.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),r.jsx(Te,{id:"max_sentence_num",type:"number",min:"1",value:a.max_sentence_num,onChange:z=>d({...a,max_sentence_num:parseInt(z.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_kaomoji_protection",checked:a.enable_kaomoji_protection,onCheckedChange:z=>d({...a,enable_kaomoji_protection:z})}),r.jsx(Q,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_overflow_return_all",checked:a.enable_overflow_return_all,onCheckedChange:z=>d({...a,enable_overflow_return_all:z})}),r.jsx(Q,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function ID({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"情绪更新阈值"}),r.jsx(Te,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"情感特征"}),r.jsx(vn,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function qD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用语音识别"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function HD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"LPMM 模式"}),r.jsxs(_t,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[r.jsx(jt,{children:r.jsx(Mt,{placeholder:"选择 LPMM 模式"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"classic",children:"经典模式"}),r.jsx(ze,{value:"agent",children:"Agent 模式"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"同义词搜索 TopK"}),r.jsx(Te,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"同义词阈值"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"实体提取线程数"}),r.jsx(Te,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"嵌入向量维度"}),r.jsx(Te,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function UD({config:e,onChange:t}){const[n,a]=w.useState(""),[l,o]=w.useState("WARNING"),c=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),a(""))},d=b=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==b)})},m=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:l}}),a(""),o("WARNING"))},f=b=>{const j={...e.library_log_levels};delete j[b],t({...e,library_log_levels:j})},p=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],x=["FULL","compact","lite"],y=["none","title","full"];return r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日期格式"}),r.jsx(Te,{value:e.date_style,onChange:b=>t({...e,date_style:b.target.value}),placeholder:"例如: m-d H:i:s"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志级别样式"}),r.jsxs(_t,{value:e.log_level_style,onValueChange:b=>t({...e,log_level_style:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:x.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志文本颜色"}),r.jsxs(_t,{value:e.color_text,onValueChange:b=>t({...e,color_text:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:y.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"全局日志级别"}),r.jsxs(_t,{value:e.log_level,onValueChange:b=>t({...e,log_level:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"控制台日志级别"}),r.jsxs(_t,{value:e.console_log_level,onValueChange:b=>t({...e,console_log_level:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"文件日志级别"}),r.jsxs(_t,{value:e.file_log_level,onValueChange:b=>t({...e,file_log_level:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"完全屏蔽的库"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:b=>a(b.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),c())}}),r.jsx(re,{onClick:c,size:"sm",className:"flex-shrink-0",children:r.jsx(mr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(b=>r.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[r.jsx("span",{className:"text-sm",children:b}),r.jsx(re,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>d(b),children:r.jsx(Ot,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},b))})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"特定库的日志级别"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:b=>a(b.target.value),placeholder:"输入库名",className:"flex-1"}),r.jsxs(_t,{value:l,onValueChange:o,children:[r.jsx(jt,{className:"w-32",children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]}),r.jsx(re,{onClick:m,size:"sm",children:r.jsx(mr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([b,j])=>r.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[r.jsx("span",{className:"text-sm font-medium",children:b}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:j}),r.jsx(re,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(b),children:r.jsx(Ot,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},b))})]})]})}function $D({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示 Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),r.jsx(gt,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示回复器 Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),r.jsx(gt,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示回复器推理"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),r.jsx(gt,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示 Jargon Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),r.jsx(gt,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function VD({config:e,onChange:t}){const[n,a]=w.useState(""),l=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),a(""))},o=c=>{t({...e,auth_token:e.auth_token.filter((d,m)=>m!==c)})};return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"启用自定义服务器"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),r.jsx(gt,{checked:e.use_custom,onCheckedChange:c=>t({...e,use_custom:c})})]}),e.use_custom&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"主机地址"}),r.jsx(Te,{value:e.host,onChange:c=>t({...e,host:c.target.value}),placeholder:"127.0.0.1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"端口号"}),r.jsx(Te,{type:"number",value:e.port,onChange:c=>t({...e,port:parseInt(c.target.value)}),placeholder:"8090"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"连接模式"}),r.jsxs(_t,{value:e.mode,onValueChange:c=>t({...e,mode:c}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"ws",children:"WebSocket (ws)"}),r.jsx(ze,{value:"tcp",children:"TCP"})]})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.use_wss,onCheckedChange:c=>t({...e,use_wss:c}),disabled:e.mode!=="ws"}),r.jsx(Q,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"SSL 证书文件路径"}),r.jsx(Te,{value:e.cert_file,onChange:c=>t({...e,cert_file:c.target.value}),placeholder:"cert.pem"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"SSL 密钥文件路径"}),r.jsx(Te,{value:e.key_file,onChange:c=>t({...e,key_file:c.target.value}),placeholder:"key.pem"})]})]})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"认证令牌"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:c=>a(c.target.value),placeholder:"输入认证令牌",onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())}}),r.jsx(re,{onClick:l,size:"sm",children:r.jsx(mr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"space-y-2",children:e.auth_token.map((c,d)=>r.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[r.jsx("span",{className:"text-sm font-mono",children:c}),r.jsx(re,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(d),children:r.jsx(Ot,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},d))})]})]})}function GD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"启用统计信息发送"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),r.jsx(gt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const bi=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{className:"relative w-full overflow-auto",children:r.jsx("table",{ref:n,className:me("w-full caption-bottom text-sm",e),...t})}));bi.displayName="Table";const wi=w.forwardRef(({className:e,...t},n)=>r.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));wi.displayName="TableHeader";const ji=w.forwardRef(({className:e,...t},n)=>r.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));ji.displayName="TableBody";const YD=w.forwardRef(({className:e,...t},n)=>r.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));YD.displayName="TableFooter";const Un=w.forwardRef(({className:e,...t},n)=>r.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Un.displayName="TableRow";const ct=w.forwardRef(({className:e,...t},n)=>r.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ct.displayName="TableHead";const et=w.forwardRef(({className:e,...t},n)=>r.jsx("td",{ref:n,className:me("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));et.displayName="TableCell";const WD=w.forwardRef(({className:e,...t},n)=>r.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));WD.displayName="TableCaption";const br=w.forwardRef(({className:e,...t},n)=>r.jsx(W5,{ref:n,className:me("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:r.jsx(eT,{className:me("grid place-content-center text-current"),children:r.jsx(di,{className:"h-4 w-4"})})}));br.displayName=W5.displayName;function XD(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!1),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[j,k]=w.useState(!1),[S,_]=w.useState(null),[M,D]=w.useState(null),[z,L]=w.useState(!1),[E,R]=w.useState(null),[H,$]=w.useState(!1),[I,G]=w.useState(""),[te,we]=w.useState(new Set),[J,ae]=w.useState(!1),[U,q]=w.useState(1),[W,oe]=w.useState(20),[P,je]=w.useState(""),{toast:Z}=pr(),O=w.useRef(null),Ne=w.useRef(!0);w.useEffect(()=>{se()},[]);const se=async()=>{try{a(!0);const K=await Ao();t(K.api_providers||[]),f(!1),Ne.current=!1}catch(K){console.error("加载配置失败:",K)}finally{a(!1)}},Ce=async()=>{try{x(!0),P1().catch(()=>{}),b(!0)}catch(K){console.error("重启失败:",K),b(!1),Z({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),x(!1)}},ye=async()=>{try{o(!0),O.current&&clearTimeout(O.current);const K=await Ao();K.api_providers=e,await lm(K),f(!1),Z({title:"保存成功",description:"正在重启麦麦..."}),await Ce()}catch(K){console.error("保存配置失败:",K),Z({title:"保存失败",description:K.message,variant:"destructive"}),o(!1)}},Be=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ie=()=>{b(!1),x(!1),Z({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},He=w.useCallback(async K=>{if(!Ne.current)try{d(!0),await Ex("api_providers",K),f(!1)}catch(ge){console.error("自动保存失败:",ge),f(!0)}finally{d(!1)}},[]);w.useEffect(()=>{if(!Ne.current)return f(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{He(e)},2e3),()=>{O.current&&clearTimeout(O.current)}},[e,He]);const lt=async()=>{try{o(!0),O.current&&clearTimeout(O.current);const K=await Ao();K.api_providers=e,await lm(K),f(!1),Z({title:"保存成功",description:"模型提供商配置已保存"})}catch(K){console.error("保存配置失败:",K),Z({title:"保存失败",description:K.message,variant:"destructive"})}finally{o(!1)}},ve=(K,ge)=>{_(K||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),D(ge),$(!1),k(!0)},Ze=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),Z({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{Z({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},We=()=>{if(!S)return;const K={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(M!==null){const ge=[...e];ge[M]=K,t(ge)}else t([...e,K]);k(!1),_(null),D(null)},pn=K=>{if(!K&&S){const ge={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};_(ge)}k(K)},Bn=K=>{R(K),L(!0)},sr=()=>{if(E!==null){const K=e.filter((ge,Oe)=>Oe!==E);t(K),Z({title:"删除成功",description:"提供商已从列表中移除"})}L(!1),R(null)},Qe=K=>{const ge=new Set(te);ge.has(K)?ge.delete(K):ge.add(K),we(ge)},Gn=()=>{if(te.size===Sn.length)we(new Set);else{const K=Sn.map((ge,Oe)=>e.findIndex(nt=>nt===Sn[Oe]));we(new Set(K))}},Sr=()=>{if(te.size===0){Z({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}ae(!0)},Er=()=>{const K=e.filter((ge,Oe)=>!te.has(Oe));t(K),we(new Set),ae(!1),Z({title:"批量删除成功",description:`已删除 ${te.size} 个提供商`})},Sn=e.filter(K=>{if(!I)return!0;const ge=I.toLowerCase();return K.name.toLowerCase().includes(ge)||K.base_url.toLowerCase().includes(ge)||K.client_type.toLowerCase().includes(ge)}),lr=Math.ceil(Sn.length/W),Ue=Sn.slice((U-1)*W,U*W),Ln=()=>{const K=parseInt(P);K>=1&&K<=lr&&(q(K),je(""))};return n?r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[te.size>0&&r.jsxs(re,{onClick:Sr,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(Ot,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",te.size,")"]}),r.jsxs(re,{onClick:()=>ve(null,null),size:"sm",className:"w-full sm:w-auto",children:[r.jsx(mr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),r.jsxs(re,{onClick:lt,disabled:l||c||!m||p,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(y1,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),l?"保存中...":c?"自动保存中...":m?"保存配置":"已保存"]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{disabled:l||c||p,size:"sm",className:"w-full sm:w-auto",children:[r.jsx(b1,{className:"mr-2 h-4 w-4"}),p?"重启中...":m?"保存并重启":"重启麦麦"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重启麦麦?"}),r.jsx(en,{children:m?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:m?ye:Ce,children:m?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(Xt,{className:"h-[calc(100vh-260px)]",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[r.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索提供商名称、URL 或类型...",value:I,onChange:K=>G(K.target.value),className:"pl-9"})]}),I&&r.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Sn.length," 个结果"]})]}),r.jsx("div",{className:"md:hidden space-y-3",children:Sn.length===0?r.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):Ue.map((K,ge)=>{const Oe=e.findIndex(nt=>nt===K);return r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"font-semibold text-base truncate",children:K.name}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:K.base_url})]}),r.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>ve(K,Oe),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Bn(Oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),r.jsx("p",{className:"font-medium",children:K.client_type})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),r.jsx("p",{className:"font-medium",children:K.max_retry})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),r.jsx("p",{className:"font-medium",children:K.timeout})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),r.jsx("p",{className:"font-medium",children:K.retry_interval})]})]})]},ge)})}),r.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:te.size===Sn.length&&Sn.length>0,onCheckedChange:Gn})}),r.jsx(ct,{children:"名称"}),r.jsx(ct,{children:"基础URL"}),r.jsx(ct,{children:"客户端类型"}),r.jsx(ct,{className:"text-right",children:"最大重试"}),r.jsx(ct,{className:"text-right",children:"超时(秒)"}),r.jsx(ct,{className:"text-right",children:"重试间隔(秒)"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:Ue.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center text-muted-foreground py-8",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):Ue.map((K,ge)=>{const Oe=e.findIndex(nt=>nt===K);return r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:te.has(Oe),onCheckedChange:()=>Qe(Oe)})}),r.jsx(et,{className:"font-medium",children:K.name}),r.jsx(et,{className:"max-w-xs truncate",title:K.base_url,children:K.base_url}),r.jsx(et,{children:K.client_type}),r.jsx(et,{className:"text-right",children:K.max_retry}),r.jsx(et,{className:"text-right",children:K.timeout}),r.jsx(et,{className:"text-right",children:K.retry_interval}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>ve(K,Oe),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Bn(Oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},ge)})})]})}),Sn.length>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:W.toString(),onValueChange:K=>{oe(parseInt(K)),q(1),we(new Set)},children:[r.jsx(jt,{id:"page-size-provider",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(U-1)*W+1," 到"," ",Math.min(U*W,Sn.length)," 条,共 ",Sn.length," 条"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>q(1),disabled:U===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>q(K=>Math.max(1,K-1)),disabled:U===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:P,onChange:K=>je(K.target.value),onKeyDown:K=>K.key==="Enter"&&Ln(),placeholder:U.toString(),className:"w-16 h-8 text-center",min:1,max:lr}),r.jsx(re,{variant:"outline",size:"sm",onClick:Ln,disabled:!P,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>q(K=>K+1),disabled:U>=lr,children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>q(lr),disabled:U>=lr,className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]}),r.jsx(hr,{open:j,onOpenChange:pn,children:r.jsxs(nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:M!==null?"编辑提供商":"添加提供商"}),r.jsx(wr,{children:"配置 API 提供商的连接信息和参数"})]}),r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"name",children:"名称 *"}),r.jsx(Te,{id:"name",value:S?.name||"",onChange:K=>_(ge=>ge?{...ge,name:K.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"base_url",children:"基础 URL *"}),r.jsx(Te,{id:"base_url",value:S?.base_url||"",onChange:K=>_(ge=>ge?{...ge,base_url:K.target.value}:null),placeholder:"https://api.example.com/v1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"api_key",children:"API Key *"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{id:"api_key",type:H?"text":"password",value:S?.api_key||"",onChange:K=>_(ge=>ge?{...ge,api_key:K.target.value}:null),placeholder:"sk-...",className:"flex-1"}),r.jsx(re,{type:"button",variant:"outline",size:"icon",onClick:()=>$(!H),title:H?"隐藏密钥":"显示密钥",children:H?r.jsx(fx,{className:"h-4 w-4"}):r.jsx(qa,{className:"h-4 w-4"})}),r.jsx(re,{type:"button",variant:"outline",size:"icon",onClick:Ze,title:"复制密钥",children:r.jsx(hx,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"client_type",children:"客户端类型"}),r.jsxs(_t,{value:S?.client_type||"openai",onValueChange:K=>_(ge=>ge?{...ge,client_type:K}:null),children:[r.jsx(jt,{id:"client_type",children:r.jsx(Mt,{placeholder:"选择客户端类型"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"openai",children:"OpenAI"}),r.jsx(ze,{value:"gemini",children:"Gemini"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_retry",children:"最大重试"}),r.jsx(Te,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:K=>{const ge=K.target.value===""?null:parseInt(K.target.value);_(Oe=>Oe?{...Oe,max_retry:ge}:null)},placeholder:"默认: 2"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"timeout",children:"超时(秒)"}),r.jsx(Te,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:K=>{const ge=K.target.value===""?null:parseInt(K.target.value);_(Oe=>Oe?{...Oe,timeout:ge}:null)},placeholder:"默认: 30"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),r.jsx(Te,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:K=>{const ge=K.target.value===""?null:parseInt(K.target.value);_(Oe=>Oe?{...Oe,retry_interval:ge}:null)},placeholder:"默认: 10"})]})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>k(!1),children:"取消"}),r.jsx(re,{onClick:We,children:"保存"})]})]})}),r.jsx(cn,{open:z,onOpenChange:L,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除提供商 "',E!==null?e[E]?.name:"",'" 吗? 此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:sr,children:"删除"})]})]})}),r.jsx(cn,{open:J,onOpenChange:ae,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["确定要删除选中的 ",te.size," 个提供商吗? 此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:Er,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),y&&r.jsx(F1,{onRestartComplete:Be,onRestartFailed:ie})]})}var Cb=1,KD=.9,QD=.8,ZD=.17,Tp=.1,_p=.999,JD=.9999,ez=.99,tz=/[\\\/_+.#"@\[\(\{&]/,nz=/[\\\/_+.#"@\[\(\{&]/g,rz=/[\s-]/,P7=/[\s-]/g;function Ax(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?Cb:ez;var d=`${l},${o}`;if(c[d]!==void 0)return c[d];for(var m=a.charAt(o),f=n.indexOf(m,l),p=0,x,y,b,j;f>=0;)x=Ax(e,t,n,a,f+1,o+1,c),x>p&&(f===l?x*=Cb:tz.test(e.charAt(f-1))?(x*=QD,b=e.slice(l,f-1).match(nz),b&&l>0&&(x*=Math.pow(_p,b.length))):rz.test(e.charAt(f-1))?(x*=KD,j=e.slice(l,f-1).match(P7),j&&l>0&&(x*=Math.pow(_p,j.length))):(x*=ZD,l>0&&(x*=Math.pow(_p,f-l))),e.charAt(f)!==t.charAt(o)&&(x*=JD)),(xx&&(x=y*Tp)),x>p&&(p=x),f=n.indexOf(m,f+1);return c[d]=p,p}function Tb(e){return e.toLowerCase().replace(P7," ")}function az(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ax(e,t,Tb(e),Tb(t),0,0,{})}var sz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ol=sz.reduce((e,t)=>{const n=c1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Qc='[cmdk-group=""]',Mp='[cmdk-group-items=""]',lz='[cmdk-group-heading=""]',F7='[cmdk-item=""]',_b=`${F7}:not([aria-disabled="true"])`,Dx="cmdk-item-select",So="data-value",iz=(e,t,n)=>az(e,t,n),I7=w.createContext(void 0),qu=()=>w.useContext(I7),q7=w.createContext(void 0),I1=()=>w.useContext(q7),H7=w.createContext(void 0),U7=w.forwardRef((e,t)=>{let n=ko(()=>{var Z,O;return{search:"",value:(O=(Z=e.value)!=null?Z:e.defaultValue)!=null?O:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ko(()=>new Set),l=ko(()=>new Map),o=ko(()=>new Map),c=ko(()=>new Set),d=$7(e),{label:m,children:f,value:p,onValueChange:x,filter:y,shouldFilter:b,loop:j,disablePointerSelection:k=!1,vimBindings:S=!0,..._}=e,M=Ta(),D=Ta(),z=Ta(),L=w.useRef(null),E=vz();xi(()=>{if(p!==void 0){let Z=p.trim();n.current.value=Z,R.emit()}},[p]),xi(()=>{E(6,we)},[]);let R=w.useMemo(()=>({subscribe:Z=>(c.current.add(Z),()=>c.current.delete(Z)),snapshot:()=>n.current,setState:(Z,O,Ne)=>{var se,Ce,ye,Be;if(!Object.is(n.current[Z],O)){if(n.current[Z]=O,Z==="search")te(),I(),E(1,G);else if(Z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(z);ie?ie.focus():(se=document.getElementById(M))==null||se.focus()}if(E(7,()=>{var ie;n.current.selectedItemId=(ie=J())==null?void 0:ie.id,R.emit()}),Ne||E(5,we),((Ce=d.current)==null?void 0:Ce.value)!==void 0){let ie=O??"";(Be=(ye=d.current).onValueChange)==null||Be.call(ye,ie);return}}R.emit()}},emit:()=>{c.current.forEach(Z=>Z())}}),[]),H=w.useMemo(()=>({value:(Z,O,Ne)=>{var se;O!==((se=o.current.get(Z))==null?void 0:se.value)&&(o.current.set(Z,{value:O,keywords:Ne}),n.current.filtered.items.set(Z,$(O,Ne)),E(2,()=>{I(),R.emit()}))},item:(Z,O)=>(a.current.add(Z),O&&(l.current.has(O)?l.current.get(O).add(Z):l.current.set(O,new Set([Z]))),E(3,()=>{te(),I(),n.current.value||G(),R.emit()}),()=>{o.current.delete(Z),a.current.delete(Z),n.current.filtered.items.delete(Z);let Ne=J();E(4,()=>{te(),Ne?.getAttribute("id")===Z&&G(),R.emit()})}),group:Z=>(l.current.has(Z)||l.current.set(Z,new Set),()=>{o.current.delete(Z),l.current.delete(Z)}),filter:()=>d.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:M,inputId:z,labelId:D,listInnerRef:L}),[]);function $(Z,O){var Ne,se;let Ce=(se=(Ne=d.current)==null?void 0:Ne.filter)!=null?se:iz;return Z?Ce(Z,n.current.search,O):0}function I(){if(!n.current.search||d.current.shouldFilter===!1)return;let Z=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(se=>{let Ce=l.current.get(se),ye=0;Ce.forEach(Be=>{let ie=Z.get(Be);ye=Math.max(ie,ye)}),O.push([se,ye])});let Ne=L.current;ae().sort((se,Ce)=>{var ye,Be;let ie=se.getAttribute("id"),He=Ce.getAttribute("id");return((ye=Z.get(He))!=null?ye:0)-((Be=Z.get(ie))!=null?Be:0)}).forEach(se=>{let Ce=se.closest(Mp);Ce?Ce.appendChild(se.parentElement===Ce?se:se.closest(`${Mp} > *`)):Ne.appendChild(se.parentElement===Ne?se:se.closest(`${Mp} > *`))}),O.sort((se,Ce)=>Ce[1]-se[1]).forEach(se=>{var Ce;let ye=(Ce=L.current)==null?void 0:Ce.querySelector(`${Qc}[${So}="${encodeURIComponent(se[0])}"]`);ye?.parentElement.appendChild(ye)})}function G(){let Z=ae().find(Ne=>Ne.getAttribute("aria-disabled")!=="true"),O=Z?.getAttribute(So);R.setState("value",O||void 0)}function te(){var Z,O,Ne,se;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let Ce=0;for(let ye of a.current){let Be=(O=(Z=o.current.get(ye))==null?void 0:Z.value)!=null?O:"",ie=(se=(Ne=o.current.get(ye))==null?void 0:Ne.keywords)!=null?se:[],He=$(Be,ie);n.current.filtered.items.set(ye,He),He>0&&Ce++}for(let[ye,Be]of l.current)for(let ie of Be)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(ye);break}n.current.filtered.count=Ce}function we(){var Z,O,Ne;let se=J();se&&(((Z=se.parentElement)==null?void 0:Z.firstChild)===se&&((Ne=(O=se.closest(Qc))==null?void 0:O.querySelector(lz))==null||Ne.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function J(){var Z;return(Z=L.current)==null?void 0:Z.querySelector(`${F7}[aria-selected="true"]`)}function ae(){var Z;return Array.from(((Z=L.current)==null?void 0:Z.querySelectorAll(_b))||[])}function U(Z){let O=ae()[Z];O&&R.setState("value",O.getAttribute(So))}function q(Z){var O;let Ne=J(),se=ae(),Ce=se.findIndex(Be=>Be===Ne),ye=se[Ce+Z];(O=d.current)!=null&&O.loop&&(ye=Ce+Z<0?se[se.length-1]:Ce+Z===se.length?se[0]:se[Ce+Z]),ye&&R.setState("value",ye.getAttribute(So))}function W(Z){let O=J(),Ne=O?.closest(Qc),se;for(;Ne&&!se;)Ne=Z>0?xz(Ne,Qc):gz(Ne,Qc),se=Ne?.querySelector(_b);se?R.setState("value",se.getAttribute(So)):q(Z)}let oe=()=>U(ae().length-1),P=Z=>{Z.preventDefault(),Z.metaKey?oe():Z.altKey?W(1):q(1)},je=Z=>{Z.preventDefault(),Z.metaKey?U(0):Z.altKey?W(-1):q(-1)};return w.createElement(Ol.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:Z=>{var O;(O=_.onKeyDown)==null||O.call(_,Z);let Ne=Z.nativeEvent.isComposing||Z.keyCode===229;if(!(Z.defaultPrevented||Ne))switch(Z.key){case"n":case"j":{S&&Z.ctrlKey&&P(Z);break}case"ArrowDown":{P(Z);break}case"p":case"k":{S&&Z.ctrlKey&&je(Z);break}case"ArrowUp":{je(Z);break}case"Home":{Z.preventDefault(),U(0);break}case"End":{Z.preventDefault(),oe();break}case"Enter":{Z.preventDefault();let se=J();if(se){let Ce=new Event(Dx);se.dispatchEvent(Ce)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:bz},m),Lm(e,Z=>w.createElement(q7.Provider,{value:R},w.createElement(I7.Provider,{value:H},Z))))}),oz=w.forwardRef((e,t)=>{var n,a;let l=Ta(),o=w.useRef(null),c=w.useContext(H7),d=qu(),m=$7(e),f=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c?.forceMount;xi(()=>{if(!f)return d.item(l,c?.id)},[f]);let p=V7(l,o,[e.value,e.children,o],e.keywords),x=I1(),y=Tl(E=>E.value&&E.value===p.current),b=Tl(E=>f||d.filter()===!1?!0:E.search?E.filtered.items.get(l)>0:!0);w.useEffect(()=>{let E=o.current;if(!(!E||e.disabled))return E.addEventListener(Dx,j),()=>E.removeEventListener(Dx,j)},[b,e.onSelect,e.disabled]);function j(){var E,R;k(),(R=(E=m.current).onSelect)==null||R.call(E,p.current)}function k(){x.setState("value",p.current,!0)}if(!b)return null;let{disabled:S,value:_,onSelect:M,forceMount:D,keywords:z,...L}=e;return w.createElement(Ol.div,{ref:Nl(o,t),...L,id:l,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!y,"data-disabled":!!S,"data-selected":!!y,onPointerMove:S||d.getDisablePointerSelection()?void 0:k,onClick:S?void 0:j},e.children)}),cz=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Ta(),d=w.useRef(null),m=w.useRef(null),f=Ta(),p=qu(),x=Tl(b=>l||p.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);xi(()=>p.group(c),[]),V7(c,d,[e.value,e.heading,m]);let y=w.useMemo(()=>({id:c,forceMount:l}),[l]);return w.createElement(Ol.div,{ref:Nl(d,t),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},n&&w.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Lm(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},w.createElement(H7.Provider,{value:y},b))))}),uz=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=w.useRef(null),o=Tl(c=>!c.search);return!n&&!o?null:w.createElement(Ol.div,{ref:Nl(l,t),...a,"cmdk-separator":"",role:"separator"})}),dz=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=I1(),c=Tl(f=>f.search),d=Tl(f=>f.selectedItemId),m=qu();return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Ol.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:l?e.value:c,onChange:f=>{l||o.setState("search",f.target.value),n?.(f.target.value)}})}),mz=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=w.useRef(null),c=w.useRef(null),d=Tl(f=>f.selectedItemId),m=qu();return w.useEffect(()=>{if(c.current&&o.current){let f=c.current,p=o.current,x,y=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let b=f.offsetHeight;p.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(x),y.unobserve(f)}}},[]),w.createElement(Ol.div,{ref:Nl(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":a,id:m.listId},Lm(e,f=>w.createElement("div",{ref:Nl(c,m.listInnerRef),"cmdk-list-sizer":""},f)))}),hz=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...d}=e;return w.createElement(f1,{open:n,onOpenChange:a},w.createElement(u1,{container:c},w.createElement(ym,{"cmdk-overlay":"",className:l}),w.createElement(bm,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(U7,{ref:t,...d}))))}),fz=w.forwardRef((e,t)=>Tl(n=>n.filtered.count===0)?w.createElement(Ol.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),pz=w.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return w.createElement(Ol.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Lm(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),Xr=Object.assign(U7,{List:mz,Item:oz,Input:dz,Group:cz,Separator:uz,Dialog:hz,Empty:fz,Loading:pz});function xz(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function gz(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $7(e){let t=w.useRef(e);return xi(()=>{t.current=e}),t}var xi=typeof window>"u"?w.useEffect:w.useLayoutEffect;function ko(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Tl(e){let t=I1(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function V7(e,t,n,a=[]){let l=w.useRef(),o=qu();return xi(()=>{var c;let d=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():l.current}})(),m=a.map(f=>f.trim());o.value(e,d,m),(c=t.current)==null||c.setAttribute(So,d),l.current=d}),l}var vz=()=>{let[e,t]=w.useState(),n=ko(()=>new Map);return xi(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function yz(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Lm({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(yz(t),{ref:t.ref},n(t.props.children)):n(t)}var bz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const G7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr,{ref:n,className:me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));G7.displayName=Xr.displayName;const Y7=w.forwardRef(({className:e,...t},n)=>r.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[r.jsx(Gr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),r.jsx(Xr.Input,{ref:n,className:me("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Y7.displayName=Xr.Input.displayName;const W7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.List,{ref:n,className:me("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));W7.displayName=Xr.List.displayName;const X7=w.forwardRef((e,t)=>r.jsx(Xr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));X7.displayName=Xr.Empty.displayName;const K7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Group,{ref:n,className:me("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));K7.displayName=Xr.Group.displayName;const wz=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Separator,{ref:n,className:me("-mx-1 h-px bg-border",e),...t}));wz.displayName=Xr.Separator.displayName;const Q7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Item,{ref:n,className:me("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Q7.displayName=Xr.Item.displayName;function jz({options:e,selected:t,onChange:n,placeholder:a="选择选项...",emptyText:l="未找到选项",className:o}){const[c,d]=w.useState(!1),m=p=>{t.includes(p)?n(t.filter(x=>x!==p)):n([...t,p])},f=p=>{n(t.filter(x=>x!==p))};return r.jsxs(kl,{open:c,onOpenChange:d,children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",role:"combobox","aria-expanded":c,className:me("w-full justify-between min-h-10 h-auto",o),children:[r.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?r.jsx("span",{className:"text-muted-foreground",children:a}):t.map(p=>{const x=e.find(y=>y.value===p);return r.jsxs(on,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:y=>{y.stopPropagation(),f(p)},children:[x?.label||p,r.jsx(Mu,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},p)})}),r.jsx(gT,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),r.jsx(Ps,{className:"w-full p-0",align:"start",children:r.jsxs(G7,{children:[r.jsx(Y7,{placeholder:"搜索...",className:"h-9"}),r.jsxs(W7,{children:[r.jsx(X7,{children:l}),r.jsx(K7,{children:e.map(p=>{const x=t.includes(p.value);return r.jsxs(Q7,{value:p.value,onSelect:()=>m(p.value),children:[r.jsx("div",{className:me("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",x?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:r.jsx(di,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),r.jsx("span",{children:p.label})]},p.value)})})]})]})})]})}function Nz(){const[e,t]=w.useState([]),[n,a]=w.useState([]),[l,o]=w.useState([]),[c,d]=w.useState(null),[m,f]=w.useState(!0),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[j,k]=w.useState(!1),[S,_]=w.useState(!1),[M,D]=w.useState(!1),[z,L]=w.useState(!1),[E,R]=w.useState(null),[H,$]=w.useState(null),[I,G]=w.useState(!1),[te,we]=w.useState(null),[J,ae]=w.useState(""),[U,q]=w.useState(new Set),[W,oe]=w.useState(!1),[P,je]=w.useState(1),[Z,O]=w.useState(20),[Ne,se]=w.useState(""),{toast:Ce}=pr(),ye=w.useRef(null),Be=w.useRef(null),ie=w.useRef(!0);w.useEffect(()=>{He()},[]);const He=async()=>{try{f(!0);const he=await Ao(),Me=he.models||[];t(Me),o(Me.map(mt=>mt.name));const dt=he.api_providers||[];a(dt.map(mt=>mt.name)),d(he.model_task_config||null),k(!1),ie.current=!1}catch(he){console.error("加载配置失败:",he)}finally{f(!1)}},lt=async()=>{try{_(!0),P1().catch(()=>{}),D(!0)}catch(he){console.error("重启失败:",he),D(!1),Ce({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),_(!1)}},ve=async()=>{try{x(!0),ye.current&&clearTimeout(ye.current),Be.current&&clearTimeout(Be.current);const he=await Ao();he.models=e,he.model_task_config=c,await lm(he),k(!1),Ce({title:"保存成功",description:"正在重启麦麦..."}),await lt()}catch(he){console.error("保存配置失败:",he),Ce({title:"保存失败",description:he.message,variant:"destructive"}),x(!1)}},Ze=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},We=()=>{D(!1),_(!1),Ce({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},pn=w.useCallback(async he=>{if(!ie.current)try{b(!0),await Ex("models",he),k(!1)}catch(Me){console.error("自动保存模型列表失败:",Me),k(!0)}finally{b(!1)}},[]),Bn=w.useCallback(async he=>{if(!ie.current)try{b(!0),await Ex("model_task_config",he),k(!1)}catch(Me){console.error("自动保存任务配置失败:",Me),k(!0)}finally{b(!1)}},[]);w.useEffect(()=>{if(!ie.current)return k(!0),ye.current&&clearTimeout(ye.current),ye.current=setTimeout(()=>{pn(e)},2e3),()=>{ye.current&&clearTimeout(ye.current)}},[e,pn]),w.useEffect(()=>{if(!(ie.current||!c))return k(!0),Be.current&&clearTimeout(Be.current),Be.current=setTimeout(()=>{Bn(c)},2e3),()=>{Be.current&&clearTimeout(Be.current)}},[c,Bn]);const sr=async()=>{try{x(!0),ye.current&&clearTimeout(ye.current),Be.current&&clearTimeout(Be.current);const he=await Ao();he.models=e,he.model_task_config=c,await lm(he),k(!1),Ce({title:"保存成功",description:"模型配置已保存"}),await He()}catch(he){console.error("保存配置失败:",he),Ce({title:"保存失败",description:he.message,variant:"destructive"})}finally{x(!1)}},Qe=(he,Me)=>{R(he||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),$(Me),L(!0)},Gn=()=>{if(!E)return;const he={...E,price_in:E.price_in??0,price_out:E.price_out??0};let Me;H!==null?(Me=[...e],Me[H]=he):Me=[...e,he],t(Me),o(Me.map(dt=>dt.name)),L(!1),R(null),$(null)},Sr=he=>{if(!he&&E){const Me={...E,price_in:E.price_in??0,price_out:E.price_out??0};R(Me)}L(he)},Er=he=>{we(he),G(!0)},Sn=()=>{if(te!==null){const he=e.filter((Me,dt)=>dt!==te);t(he),o(he.map(Me=>Me.name)),Ce({title:"删除成功",description:"模型已从列表中移除"})}G(!1),we(null)},lr=he=>{const Me=new Set(U);Me.has(he)?Me.delete(he):Me.add(he),q(Me)},Ue=()=>{if(U.size===Oe.length)q(new Set);else{const he=Oe.map((Me,dt)=>e.findIndex(mt=>mt===Oe[dt]));q(new Set(he))}},Ln=()=>{if(U.size===0){Ce({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}oe(!0)},K=()=>{const he=e.filter((Me,dt)=>!U.has(dt));t(he),o(he.map(Me=>Me.name)),q(new Set),oe(!1),Ce({title:"批量删除成功",description:`已删除 ${U.size} 个模型`})},ge=(he,Me,dt)=>{c&&d({...c,[he]:{...c[he],[Me]:dt}})},Oe=e.filter(he=>{if(!J)return!0;const Me=J.toLowerCase();return he.name.toLowerCase().includes(Me)||he.model_identifier.toLowerCase().includes(Me)||he.api_provider.toLowerCase().includes(Me)}),nt=Math.ceil(Oe.length/Z),kt=Oe.slice((P-1)*Z,P*Z),Qn=()=>{const he=parseInt(Ne);he>=1&&he<=nt&&(je(he),se(""))},Ar=he=>c?[c.utils?.model_list||[],c.utils_small?.model_list||[],c.tool_use?.model_list||[],c.replyer?.model_list||[],c.planner?.model_list||[],c.vlm?.model_list||[],c.voice?.model_list||[],c.embedding?.model_list||[],c.lpmm_entity_extract?.model_list||[],c.lpmm_rdf_build?.model_list||[],c.lpmm_qa?.model_list||[]].some(dt=>dt.includes(he)):!1;return m?r.jsx(Xt,{className:"h-full",children:r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsxs(re,{onClick:sr,disabled:p||y||!j||S,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(y1,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),p?"保存中...":y?"自动保存中...":j?"保存配置":"已保存"]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{disabled:p||y||S,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(b1,{className:"mr-2 h-4 w-4"}),S?"重启中...":j?"保存并重启":"重启麦麦"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重启麦麦?"}),r.jsx(en,{children:j?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:j?ve:lt,children:j?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(Sl,{defaultValue:"models",className:"w-full",children:[r.jsxs(Ls,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[r.jsx(Rt,{value:"models",children:"模型配置"}),r.jsx(Rt,{value:"tasks",children:"模型任务配置"})]}),r.jsxs(ln,{value:"models",className:"space-y-4 mt-0",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[U.size>0&&r.jsxs(re,{onClick:Ln,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(Ot,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",U.size,")"]}),r.jsxs(re,{onClick:()=>Qe(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(mr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[r.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索模型名称、标识符或提供商...",value:J,onChange:he=>ae(he.target.value),className:"pl-9"})]}),J&&r.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Oe.length," 个结果"]})]}),r.jsx("div",{className:"md:hidden space-y-3",children:kt.length===0?r.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:J?"未找到匹配的模型":"暂无模型配置"}):kt.map((he,Me)=>{const dt=e.findIndex(Dr=>Dr===he),mt=Ar(he.name);return r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("h3",{className:"font-semibold text-base",children:he.name}),r.jsx(on,{variant:mt?"default":"secondary",className:mt?"bg-green-600 hover:bg-green-700":"",children:mt?"已使用":"未使用"})]}),r.jsx("p",{className:"text-xs text-muted-foreground break-all",title:he.model_identifier,children:he.model_identifier})]}),r.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Qe(he,dt),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Er(dt),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),r.jsx("p",{className:"font-medium",children:he.api_provider})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),r.jsx("p",{className:"font-medium",children:he.force_stream_mode?"是":"否"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),r.jsxs("p",{className:"font-medium",children:["¥",he.price_in,"/M"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),r.jsxs("p",{className:"font-medium",children:["¥",he.price_out,"/M"]})]})]})]},Me)})}),r.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:U.size===Oe.length&&Oe.length>0,onCheckedChange:Ue})}),r.jsx(ct,{className:"w-24",children:"使用状态"}),r.jsx(ct,{children:"模型名称"}),r.jsx(ct,{children:"模型标识符"}),r.jsx(ct,{children:"提供商"}),r.jsx(ct,{className:"text-right",children:"输入价格"}),r.jsx(ct,{className:"text-right",children:"输出价格"}),r.jsx(ct,{className:"text-center",children:"强制流式"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:kt.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:9,className:"text-center text-muted-foreground py-8",children:J?"未找到匹配的模型":"暂无模型配置"})}):kt.map((he,Me)=>{const dt=e.findIndex(Dr=>Dr===he),mt=Ar(he.name);return r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:U.has(dt),onCheckedChange:()=>lr(dt)})}),r.jsx(et,{children:r.jsx(on,{variant:mt?"default":"secondary",className:mt?"bg-green-600 hover:bg-green-700":"",children:mt?"已使用":"未使用"})}),r.jsx(et,{className:"font-medium",children:he.name}),r.jsx(et,{className:"max-w-xs truncate",title:he.model_identifier,children:he.model_identifier}),r.jsx(et,{children:he.api_provider}),r.jsxs(et,{className:"text-right",children:["¥",he.price_in,"/M"]}),r.jsxs(et,{className:"text-right",children:["¥",he.price_out,"/M"]}),r.jsx(et,{className:"text-center",children:he.force_stream_mode?"是":"否"}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Qe(he,dt),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Er(dt),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Me)})})]})}),Oe.length>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:Z.toString(),onValueChange:he=>{O(parseInt(he)),je(1),q(new Set)},children:[r.jsx(jt,{id:"page-size-model",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(P-1)*Z+1," 到"," ",Math.min(P*Z,Oe.length)," 条,共 ",Oe.length," 条"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>je(1),disabled:P===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>je(he=>Math.max(1,he-1)),disabled:P===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:Ne,onChange:he=>se(he.target.value),onKeyDown:he=>he.key==="Enter"&&Qn(),placeholder:P.toString(),className:"w-16 h-8 text-center",min:1,max:nt}),r.jsx(re,{variant:"outline",size:"sm",onClick:Qn,disabled:!Ne,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>je(he=>he+1),disabled:P>=nt,children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>je(nt),disabled:P>=nt,className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]}),r.jsxs(ln,{value:"tasks",className:"space-y-6 mt-0",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&r.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[r.jsx(Ra,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:l,onChange:(he,Me)=>ge("utils",he,Me)}),r.jsx(Ra,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:l,onChange:(he,Me)=>ge("utils_small",he,Me)}),r.jsx(Ra,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:l,onChange:(he,Me)=>ge("tool_use",he,Me)}),r.jsx(Ra,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:l,onChange:(he,Me)=>ge("replyer",he,Me)}),r.jsx(Ra,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:l,onChange:(he,Me)=>ge("planner",he,Me)}),r.jsx(Ra,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:l,onChange:(he,Me)=>ge("vlm",he,Me),hideTemperature:!0}),r.jsx(Ra,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:l,onChange:(he,Me)=>ge("voice",he,Me),hideTemperature:!0,hideMaxTokens:!0}),r.jsx(Ra,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:l,onChange:(he,Me)=>ge("embedding",he,Me),hideTemperature:!0,hideMaxTokens:!0}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),r.jsx(Ra,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:l,onChange:(he,Me)=>ge("lpmm_entity_extract",he,Me)}),r.jsx(Ra,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:l,onChange:(he,Me)=>ge("lpmm_rdf_build",he,Me)}),r.jsx(Ra,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:l,onChange:(he,Me)=>ge("lpmm_qa",he,Me)})]})]})]})]}),r.jsx(hr,{open:z,onOpenChange:Sr,children:r.jsxs(nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:H!==null?"编辑模型":"添加模型"}),r.jsx(wr,{children:"配置模型的基本信息和参数"})]}),r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"model_name",children:"模型名称 *"}),r.jsx(Te,{id:"model_name",value:E?.name||"",onChange:he=>R(Me=>Me?{...Me,name:he.target.value}:null),placeholder:"例如: qwen3-30b"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"model_identifier",children:"模型标识符 *"}),r.jsx(Te,{id:"model_identifier",value:E?.model_identifier||"",onChange:he=>R(Me=>Me?{...Me,model_identifier:he.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"api_provider",children:"API 提供商 *"}),r.jsxs(_t,{value:E?.api_provider||"",onValueChange:he=>R(Me=>Me?{...Me,api_provider:he}:null),children:[r.jsx(jt,{id:"api_provider",children:r.jsx(Mt,{placeholder:"选择提供商"})}),r.jsx(Nt,{children:n.map(he=>r.jsx(ze,{value:he,children:he},he))})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),r.jsx(Te,{id:"price_in",type:"number",step:"0.1",min:"0",value:E?.price_in??"",onChange:he=>{const Me=he.target.value===""?null:parseFloat(he.target.value);R(dt=>dt?{...dt,price_in:Me}:null)},placeholder:"默认: 0"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),r.jsx(Te,{id:"price_out",type:"number",step:"0.1",min:"0",value:E?.price_out??"",onChange:he=>{const Me=he.target.value===""?null:parseFloat(he.target.value);R(dt=>dt?{...dt,price_out:Me}:null)},placeholder:"默认: 0"})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"force_stream_mode",checked:E?.force_stream_mode||!1,onCheckedChange:he=>R(Me=>Me?{...Me,force_stream_mode:he}:null)}),r.jsx(Q,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>L(!1),children:"取消"}),r.jsx(re,{onClick:Gn,children:"保存"})]})]})}),r.jsx(cn,{open:I,onOpenChange:G,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除模型 "',te!==null?e[te]?.name:"",'" 吗? 此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:Sn,children:"删除"})]})]})}),r.jsx(cn,{open:W,onOpenChange:oe,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["确定要删除选中的 ",U.size," 个模型吗? 此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:K,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),M&&r.jsx(F1,{onRestartComplete:Ze,onRestartFailed:We})]})})}function Ra({title:e,description:t,taskConfig:n,modelNames:a,onChange:l,hideTemperature:o=!1,hideMaxTokens:c=!1}){const d=m=>{l("model_list",m)};return r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"模型列表"}),r.jsx(jz,{options:a.map(m=>({label:m,value:m})),selected:n.model_list||[],onChange:d,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"温度"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:m=>{const f=parseFloat(m.target.value);!isNaN(f)&&f>=0&&f<=1&&l("temperature",f)},className:"w-20 h-8 text-sm"})]}),r.jsx(Rm,{value:[n.temperature??.3],onValueChange:m=>l("temperature",m[0]),min:0,max:1,step:.1,className:"w-full"})]}),!c&&r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"最大 Token"}),r.jsx(Te,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:m=>l("max_tokens",parseInt(m.target.value))})]})]})]})]})}const la={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}};function Sz(){const[e,t]=w.useState(null),[n,a]=w.useState(""),l=w.useRef(null),{toast:o}=pr(),c=x=>{const y=JSON.parse(JSON.stringify(la)),b=x.split(` +`);let j="";for(const k of b){const S=k.trim();if(!S||S.startsWith("#"))continue;const _=S.match(/^\[(\w+)\]$/);if(_){j=_[1];continue}const M=S.match(/^(\w+)\s*=\s*(.+)$/);if(M&&j){const[,D,z]=M,L=z.trim();let E;if(L==="true")E=!0;else if(L==="false")E=!1;else if(L.startsWith("[")&&L.endsWith("]")){const R=L.slice(1,-1).trim();if(R){const H=R.split(",").map(I=>{const G=I.trim();return isNaN(Number(G))?G.replace(/"/g,""):Number(G)}),$=typeof H[0];E=H.every(I=>typeof I===$)?H:H.filter(I=>typeof I=="number")}else E=[]}else L.startsWith('"')&&L.endsWith('"')?E=L.slice(1,-1):isNaN(Number(L))?E=L.replace(/"/g,""):E=Number(L);if(j in y){const R=y[j];R[D]=E}}}return y},d=x=>{const y=[],b=(j,k)=>j===""||j===null||j===void 0?k:j;return y.push("[inner]"),y.push(`version = "${b(x.inner.version,la.inner.version)}" # 版本号`),y.push("# 请勿修改版本号,除非你知道自己在做什么"),y.push(""),y.push("[nickname] # 现在没用"),y.push(`nickname = "${b(x.nickname.nickname,la.nickname.nickname)}"`),y.push(""),y.push("[napcat_server] # Napcat连接的ws服务设置"),y.push(`host = "${b(x.napcat_server.host,la.napcat_server.host)}" # Napcat设定的主机地址`),y.push(`port = ${b(x.napcat_server.port||0,la.napcat_server.port)} # Napcat设定的端口`),y.push(`token = "${b(x.napcat_server.token,la.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),y.push(`heartbeat_interval = ${b(x.napcat_server.heartbeat_interval||0,la.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),y.push(""),y.push("[maibot_server] # 连接麦麦的ws服务设置"),y.push(`host = "${b(x.maibot_server.host,la.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),y.push(`port = ${b(x.maibot_server.port||0,la.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),y.push(""),y.push("[chat] # 黑白名单功能"),y.push(`group_list_type = "${b(x.chat.group_list_type,la.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),y.push(`group_list = [${x.chat.group_list.join(", ")}] # 群组名单`),y.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),y.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),y.push(`private_list_type = "${b(x.chat.private_list_type,la.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),y.push(`private_list = [${x.chat.private_list.join(", ")}] # 私聊名单`),y.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),y.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),y.push(`ban_user_id = [${x.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),y.push(`ban_qq_bot = ${x.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),y.push(`enable_poke = ${x.chat.enable_poke} # 是否启用戳一戳功能`),y.push(""),y.push("[voice] # 发送语音设置"),y.push(`use_tts = ${x.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),y.push(""),y.push("[debug]"),y.push(`level = "${b(x.debug.level,la.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),y.join(` +`)},m=x=>{const y=x.target.files?.[0];if(!y)return;const b=new FileReader;b.onload=j=>{try{const k=j.target?.result,S=c(k);t(S),a(y.name),o({title:"上传成功",description:`已加载配置文件:${y.name}`})}catch(k){console.error("解析配置文件失败:",k),o({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},b.readAsText(y)},f=()=>{if(!e)return;const x=d(e),y=new Blob([x],{type:"text/plain;charset=utf-8"}),b=URL.createObjectURL(y),j=document.createElement("a");j.href=b,j.download=n||"config.toml",document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(b),o({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},p=()=>{t(JSON.parse(JSON.stringify(la))),a("config.toml"),o({title:"已加载默认配置",description:"可以开始编辑配置"})};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[!e&&r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:l,type:"file",accept:".toml",className:"hidden",onChange:m}),r.jsxs(re,{onClick:()=>l.current?.click(),size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(vT,{className:"mr-2 h-4 w-4"}),"上传配置"]}),r.jsxs(re,{onClick:p,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(jl,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),e&&r.jsxs(re,{onClick:f,size:"sm",children:[r.jsx(Z0,{className:"mr-2 h-4 w-4"}),"下载配置"]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["适配器独立运行,需要"," ",r.jsx("strong",{children:"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"}),"。"]})]}),e?r.jsxs(Sl,{defaultValue:"napcat",className:"w-full",children:[r.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:r.jsxs(Ls,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[r.jsx(Rt,{value:"napcat",className:"flex-shrink-0",children:"Napcat 连接"}),r.jsx(Rt,{value:"maibot",className:"flex-shrink-0",children:"麦麦连接"}),r.jsx(Rt,{value:"chat",className:"flex-shrink-0",children:"聊天控制"}),r.jsx(Rt,{value:"voice",className:"flex-shrink-0",children:"语音设置"}),r.jsx(Rt,{value:"debug",className:"flex-shrink-0",children:"调试"})]})}),r.jsx(ln,{value:"napcat",className:"space-y-4",children:r.jsx(kz,{config:e,onChange:t})}),r.jsx(ln,{value:"maibot",className:"space-y-4",children:r.jsx(Cz,{config:e,onChange:t})}),r.jsx(ln,{value:"chat",className:"space-y-4",children:r.jsx(Tz,{config:e,onChange:t})}),r.jsx(ln,{value:"voice",className:"space-y-4",children:r.jsx(_z,{config:e,onChange:t})}),r.jsx(ln,{value:"debug",className:"space-y-4",children:r.jsx(Mz,{config:e,onChange:t})})]}):r.jsx("div",{className:"rounded-lg border bg-card p-12",children:r.jsxs("div",{className:"text-center space-y-4",children:[r.jsx(jl,{className:"h-16 w-16 mx-auto text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"尚未加载配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"请上传现有配置文件,或使用默认配置开始编辑"})]})]})})]})})}function kz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Napcat WebSocket 服务设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-host",children:"主机地址"}),r.jsx(Te,{id:"napcat-host",value:e.napcat_server.host,onChange:n=>t({...e,napcat_server:{...e.napcat_server,host:n.target.value}}),placeholder:"localhost"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-port",children:"端口"}),r.jsx(Te,{id:"napcat-port",type:"number",value:e.napcat_server.port||"",onChange:n=>t({...e,napcat_server:{...e.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-token",children:"访问令牌(Token)"}),r.jsx(Te,{id:"napcat-token",type:"password",value:e.napcat_server.token,onChange:n=>t({...e,napcat_server:{...e.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-heartbeat",children:"心跳间隔(秒)"}),r.jsx(Te,{id:"napcat-heartbeat",type:"number",value:e.napcat_server.heartbeat_interval||"",onChange:n=>t({...e,napcat_server:{...e.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Cz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"麦麦 WebSocket 服务设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"maibot-host",children:"主机地址"}),r.jsx(Te,{id:"maibot-host",value:e.maibot_server.host,onChange:n=>t({...e,maibot_server:{...e.maibot_server,host:n.target.value}}),placeholder:"localhost"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"maibot-port",children:"端口"}),r.jsx(Te,{id:"maibot-port",type:"number",value:e.maibot_server.port||"",onChange:n=>t({...e,maibot_server:{...e.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function Tz({config:e,onChange:t}){const n=o=>{const c={...e};o==="group"?c.chat.group_list=[...c.chat.group_list,0]:o==="private"?c.chat.private_list=[...c.chat.private_list,0]:c.chat.ban_user_id=[...c.chat.ban_user_id,0],t(c)},a=(o,c)=>{const d={...e};o==="group"?d.chat.group_list=d.chat.group_list.filter((m,f)=>f!==c):o==="private"?d.chat.private_list=d.chat.private_list.filter((m,f)=>f!==c):d.chat.ban_user_id=d.chat.ban_user_id.filter((m,f)=>f!==c),t(d)},l=(o,c,d)=>{const m={...e};o==="group"?m.chat.group_list[c]=d:o==="private"?m.chat.private_list[c]=d:m.chat.ban_user_id[c]=d,t(m)};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天黑白名单功能"}),r.jsxs("div",{className:"grid gap-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"群组名单类型"}),r.jsxs(_t,{value:e.chat.group_list_type,onValueChange:o=>t({...e,chat:{...e.chat,group_list_type:o}}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),r.jsx(ze,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"群组列表"}),r.jsxs(re,{onClick:()=>n("group"),size:"sm",variant:"outline",children:[r.jsx(jl,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),e.chat.group_list.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("group",c,parseInt(d.target.value)||0),placeholder:"输入群号"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除群号 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a("group",c),children:"删除"})]})]})]})]},c)),e.chat.group_list.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"私聊名单类型"}),r.jsxs(_t,{value:e.chat.private_list_type,onValueChange:o=>t({...e,chat:{...e.chat,private_list_type:o}}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),r.jsx(ze,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"私聊列表"}),r.jsxs(re,{onClick:()=>n("private"),size:"sm",variant:"outline",children:[r.jsx(jl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),e.chat.private_list.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("private",c,parseInt(d.target.value)||0),placeholder:"输入QQ号"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除用户 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a("private",c),children:"删除"})]})]})]})]},c)),e.chat.private_list.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"全局禁止名单"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),r.jsxs(re,{onClick:()=>n("ban"),size:"sm",variant:"outline",children:[r.jsx(jl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),e.chat.ban_user_id.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("ban",c,parseInt(d.target.value)||0),placeholder:"输入QQ号"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要从全局禁止名单中删除用户 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a("ban",c),children:"删除"})]})]})]})]},c)),e.chat.ban_user_id.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"屏蔽QQ官方机器人"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),r.jsx(gt,{checked:e.chat.ban_qq_bot,onCheckedChange:o=>t({...e,chat:{...e.chat,ban_qq_bot:o}})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"启用戳一戳功能"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),r.jsx(gt,{checked:e.chat.enable_poke,onCheckedChange:o=>t({...e,chat:{...e.chat,enable_poke:o}})})]})]})]})})}function _z({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"发送语音设置"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"使用 TTS 语音"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),r.jsx(gt,{checked:e.voice.use_tts,onCheckedChange:n=>t({...e,voice:{use_tts:n}})})]})]})})}function Mz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"调试设置"}),r.jsx("div",{className:"grid gap-4",children:r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志等级"}),r.jsxs(_t,{value:e.debug.level,onValueChange:n=>t({...e,debug:{level:n}}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"DEBUG",children:"DEBUG(调试)"}),r.jsx(ze,{value:"INFO",children:"INFO(信息)"}),r.jsx(ze,{value:"WARNING",children:"WARNING(警告)"}),r.jsx(ze,{value:"ERROR",children:"ERROR(错误)"}),r.jsx(ze,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function Mb(e){const t=[],n=String(e||"");let a=n.indexOf(","),l=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(l,a).trim();(c||!o)&&t.push(c),l=a+1,a=n.indexOf(",",l)}return t}function Ez(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Az=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zz={};function Eb(e,t){return(zz.jsx?Dz:Az).test(e)}const Oz=/[ \t\n\f\r]/g;function Rz(e){return typeof e=="object"?e.type==="text"?Ab(e.value):!1:Ab(e)}function Ab(e){return e.replace(Oz,"")===""}class Hu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Hu.prototype.normal={};Hu.prototype.property={};Hu.prototype.space=void 0;function Z7(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Hu(n,a,t)}function gu(e){return e.toLowerCase()}class Kr{constructor(t,n){this.attribute=n,this.property=t}}Kr.prototype.attribute="";Kr.prototype.booleanish=!1;Kr.prototype.boolean=!1;Kr.prototype.commaOrSpaceSeparated=!1;Kr.prototype.commaSeparated=!1;Kr.prototype.defined=!1;Kr.prototype.mustUseProperty=!1;Kr.prototype.number=!1;Kr.prototype.overloadedBoolean=!1;Kr.prototype.property="";Kr.prototype.spaceSeparated=!1;Kr.prototype.space=void 0;let Bz=0;const xt=Ni(),Hn=Ni(),zx=Ni(),De=Ni(),gn=Ni(),Do=Ni(),ia=Ni();function Ni(){return 2**++Bz}const Ox=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Hn,commaOrSpaceSeparated:ia,commaSeparated:Do,number:De,overloadedBoolean:zx,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),Ep=Object.keys(Ox);class q1 extends Kr{constructor(t,n,a,l){let o=-1;if(super(t,n),Db(this,"space",l),typeof a=="number")for(;++o4&&n.slice(0,4)==="data"&&qz.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(zb,Uz);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!zb.test(o)){let c=o.replace(Iz,Hz);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=q1}return new l(a,t)}function Hz(e){return"-"+e.toLowerCase()}function Uz(e){return e.charAt(1).toUpperCase()}const lj=Z7([J7,Lz,nj,rj,aj],"html"),Pm=Z7([J7,Pz,nj,rj,aj],"svg");function Ob(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $z(e){return e.join(" ").trim()}var go={},Ap,Rb;function Vz(){if(Rb)return Ap;Rb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=` +`,f="/",p="*",x="",y="comment",b="declaration";function j(S,_){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];_=_||{};var M=1,D=1;function z(J){var ae=J.match(t);ae&&(M+=ae.length);var U=J.lastIndexOf(m);D=~U?J.length-U:D+J.length}function L(){var J={line:M,column:D};return function(ae){return ae.position=new E(J),$(),ae}}function E(J){this.start=J,this.end={line:M,column:D},this.source=_.source}E.prototype.content=S;function R(J){var ae=new Error(_.source+":"+M+":"+D+": "+J);if(ae.reason=J,ae.filename=_.source,ae.line=M,ae.column=D,ae.source=S,!_.silent)throw ae}function H(J){var ae=J.exec(S);if(ae){var U=ae[0];return z(U),S=S.slice(U.length),ae}}function $(){H(n)}function I(J){var ae;for(J=J||[];ae=G();)ae!==!1&&J.push(ae);return J}function G(){var J=L();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var ae=2;x!=S.charAt(ae)&&(p!=S.charAt(ae)||f!=S.charAt(ae+1));)++ae;if(ae+=2,x===S.charAt(ae-1))return R("End of comment missing");var U=S.slice(2,ae-2);return D+=2,z(U),S=S.slice(ae),D+=2,J({type:y,comment:U})}}function te(){var J=L(),ae=H(a);if(ae){if(G(),!H(l))return R("property missing ':'");var U=H(o),q=J({type:b,property:k(ae[0].replace(e,x)),value:U?k(U[0].replace(e,x)):x});return H(c),q}}function we(){var J=[];I(J);for(var ae;ae=te();)ae!==!1&&(J.push(ae),I(J));return J}return $(),we()}function k(S){return S?S.replace(d,x):x}return Ap=j,Ap}var Bb;function Gz(){if(Bb)return go;Bb=1;var e=go&&go.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(go,"__esModule",{value:!0}),go.default=n;const t=e(Vz());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:f,value:p}=m;d?l(f,p,m):p&&(o=o||{},o[f]=p)}),o}return go}var Zc={},Lb;function Yz(){if(Lb)return Zc;Lb=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},c=function(f,p){return p.toUpperCase()},d=function(f,p){return"".concat(p,"-")},m=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(l,d):f=f.replace(a,d),f.replace(t,c))};return Zc.camelCase=m,Zc}var Jc,Pb;function Wz(){if(Pb)return Jc;Pb=1;var e=Jc&&Jc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(Gz()),n=Yz();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(d,m){d&&m&&(c[(0,n.camelCase)(d,o)]=m)}),c}return a.default=a,Jc=a,Jc}var Xz=Wz();const Kz=M5(Xz),ij=oj("end"),H1=oj("start");function oj(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Qz(e){const t=H1(e),n=ij(e);if(t&&n)return{start:t,end:n}}function ou(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fb(e.position):"start"in e||"end"in e?Fb(e):"line"in e||"column"in e?Rx(e):""}function Rx(e){return Ib(e&&e.line)+":"+Ib(e&&e.column)}function Fb(e){return Rx(e&&e.start)+"-"+Rx(e&&e.end)}function Ib(e){return e&&typeof e=="number"?e:1}class jr extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=d?d.line:void 0,this.name=ou(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jr.prototype.file="";jr.prototype.name="";jr.prototype.reason="";jr.prototype.message="";jr.prototype.stack="";jr.prototype.column=void 0;jr.prototype.line=void 0;jr.prototype.ancestors=void 0;jr.prototype.cause=void 0;jr.prototype.fatal=void 0;jr.prototype.place=void 0;jr.prototype.ruleId=void 0;jr.prototype.source=void 0;const U1={}.hasOwnProperty,Zz=new Map,Jz=/[A-Z]/g,eO=new Set(["table","tbody","thead","tfoot","tr"]),tO=new Set(["td","th"]),cj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=uO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=cO(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pm:lj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=uj(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function uj(e,t,n){if(t.type==="element")return rO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lO(e,t,n);if(t.type==="mdxjsEsm")return sO(e,t);if(t.type==="root")return iO(e,t,n);if(t.type==="text")return oO(e,t)}function rO(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Pm,e.schema=l),e.ancestors.push(t);const o=mj(e,t.tagName,!1),c=dO(e,t);let d=V1(e,t);return eO.has(t.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!Rz(m):!0})),dj(e,c,o,t),$1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function aO(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}vu(e,t.position)}function sO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vu(e,t.position)}function lO(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Pm,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:mj(e,t.name,!0),c=mO(e,t),d=V1(e,t);return dj(e,c,o,t),$1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function iO(e,t,n){const a={};return $1(a,V1(e,t)),e.create(t,e.Fragment,a,n)}function oO(e,t){return t.value}function dj(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function $1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function cO(e,t,n){return a;function a(l,o,c,d){const f=Array.isArray(c.children)?n:t;return d?f(o,c,d):f(o,c)}}function uO(e,t){return n;function n(a,l,o,c){const d=Array.isArray(o.children),m=H1(a);return t(l,o,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function dO(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&U1.call(t.properties,l)){const o=hO(e,l,t.properties[l]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&tO.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function mO(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else vu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else vu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function V1(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:Zz;for(;++al?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o0?(ua(e,e.length,0,t),e):t}const Ub={}.hasOwnProperty;function fj(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tr=Rl(/[A-Za-z]/),yr=Rl(/[\dA-Za-z]/),jO=Rl(/[#-'*+\--9=?A-Z^-~]/);function im(e){return e!==null&&(e<32||e===127)}const Bx=Rl(/\d/),NO=Rl(/[\dA-Fa-f]/),SO=Rl(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function hn(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const Fm=Rl(new RegExp("\\p{P}|\\p{S}","u")),gi=Rl(/\s/);function Rl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Zo(e){const t=[];let n=-1,a=0,l=0;for(;++n55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function St(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return Et(m)?(e.enter(n),d(m)):t(m)}function d(m){return Et(m)&&o++c))return;const R=t.events.length;let H=R,$,I;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if($){I=t.events[H][1].end;break}$=!0}for(_(a),E=R;ED;){const L=n[z];t.containerState=L[1],L[0].exit.call(t,e)}n.length=D}function M(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function MO(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Io(e){if(e===null||hn(e)||gi(e))return 1;if(Fm(e))return 2}function Im(e,t,n){const a=[];let l=-1;for(;++l1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[a][1].end},y={...e[n][1].start};Vb(x,-m),Vb(y,m),c={type:m>1?"strongSequence":"emphasisSequence",start:x,end:{...e[a][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},f=[],e[a][1].end.offset-e[a][1].start.offset&&(f=ka(f,[["enter",e[a][1],t],["exit",e[a][1],t]])),f=ka(f,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),f=ka(f,Im(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),f=ka(f,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=ka(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ua(e,a-1,n-a+3,f),n=a+f.length-p-2;break}}for(n=-1;++n0&&Et(E)?St(e,M,"linePrefix",o+1)(E):M(E)}function M(E){return E===null||Ye(E)?e.check(Gb,k,z)(E):(e.enter("codeFlowValue"),D(E))}function D(E){return E===null||Ye(E)?(e.exit("codeFlowValue"),M(E)):(e.consume(E),D)}function z(E){return e.exit("codeFenced"),t(E)}function L(E,R,H){let $=0;return I;function I(ae){return E.enter("lineEnding"),E.consume(ae),E.exit("lineEnding"),G}function G(ae){return E.enter("codeFencedFence"),Et(ae)?St(E,te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):te(ae)}function te(ae){return ae===d?(E.enter("codeFencedFenceSequence"),we(ae)):H(ae)}function we(ae){return ae===d?($++,E.consume(ae),we):$>=c?(E.exit("codeFencedFenceSequence"),Et(ae)?St(E,J,"whitespace")(ae):J(ae)):H(ae)}function J(ae){return ae===null||Ye(ae)?(E.exit("codeFencedFence"),R(ae)):H(ae)}}}function qO(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const zp={name:"codeIndented",tokenize:UO},HO={partial:!0,tokenize:$O};function UO(e,t,n){const a=this;return l;function l(f){return e.enter("codeIndented"),St(e,o,"linePrefix",5)(f)}function o(f){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(f):n(f)}function c(f){return f===null?m(f):Ye(f)?e.attempt(HO,c,m)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||Ye(f)?(e.exit("codeFlowValue"),c(f)):(e.consume(f),d)}function m(f){return e.exit("codeIndented"),t(f)}}function $O(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Ye(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):St(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Ye(c)?l(c):n(c)}}const VO={name:"codeText",previous:YO,resolve:GO,tokenize:WO};function GO(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&eu(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),eu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),eu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function bj(e,t,n,a,l,o,c,d,m){const f=m||Number.POSITIVE_INFINITY;let p=0;return x;function x(_){return _===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(_),e.exit(o),y):_===null||_===32||_===41||im(_)?n(_):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(_))}function y(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(d),y(_)):_===null||_===60||Ye(_)?n(_):(e.consume(_),_===92?j:b)}function j(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function k(_){return!p&&(_===null||_===41||hn(_))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(_)):p999||b===null||b===91||b===93&&!m||b===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):Ye(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||b===91||b===93||Ye(b)||d++>999?(e.exit("chunkString"),p(b)):(e.consume(b),m||(m=!Et(b)),b===92?y:x)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,x):x(b)}}function jj(e,t,n,a,l,o){let c;return d;function d(y){return y===34||y===39||y===40?(e.enter(a),e.enter(l),e.consume(y),e.exit(l),c=y===40?41:y,m):n(y)}function m(y){return y===c?(e.enter(l),e.consume(y),e.exit(l),e.exit(a),t):(e.enter(o),f(y))}function f(y){return y===c?(e.exit(o),m(c)):y===null?n(y):Ye(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),St(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===c||y===null||Ye(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?x:p)}function x(y){return y===c||y===92?(e.consume(y),p):p(y)}}function cu(e,t){let n;return a;function a(l){return Ye(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Et(l)?St(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const nR={name:"definition",tokenize:aR},rR={partial:!0,tokenize:sR};function aR(e,t,n){const a=this;let l;return o;function o(b){return e.enter("definition"),c(b)}function c(b){return wj.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return l=Ia(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),m):n(b)}function m(b){return hn(b)?cu(e,f)(b):f(b)}function f(b){return bj(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(rR,x,x)(b)}function x(b){return Et(b)?St(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Ye(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):n(b)}}function sR(e,t,n){return a;function a(d){return hn(d)?cu(e,l)(d):n(d)}function l(d){return jj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return Et(d)?St(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Ye(d)?t(d):n(d)}}const lR={name:"hardBreakEscape",tokenize:iR};function iR(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Ye(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const oR={name:"headingAtx",resolve:cR,tokenize:uR};function cR(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ua(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function uR(e,t,n){let a=0;return l;function l(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||hn(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||Ye(p)?(e.exit("atxHeading"),t(p)):Et(p)?St(e,d,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),d(p))}function f(p){return p===null||p===35||hn(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),f)}}const dR=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Wb=["pre","script","style","textarea"],mR={concrete:!0,name:"htmlFlow",resolveTo:pR,tokenize:xR},hR={partial:!0,tokenize:vR},fR={partial:!0,tokenize:gR};function pR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xR(e,t,n){const a=this;let l,o,c,d,m;return f;function f(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),x}function x(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),o=!0,k):O===63?(e.consume(O),l=3,a.interrupt?t:P):Tr(O)?(e.consume(O),c=String.fromCharCode(O),S):n(O)}function y(O){return O===45?(e.consume(O),l=2,b):O===91?(e.consume(O),l=5,d=0,j):Tr(O)?(e.consume(O),l=4,a.interrupt?t:P):n(O)}function b(O){return O===45?(e.consume(O),a.interrupt?t:P):n(O)}function j(O){const Ne="CDATA[";return O===Ne.charCodeAt(d++)?(e.consume(O),d===Ne.length?a.interrupt?t:te:j):n(O)}function k(O){return Tr(O)?(e.consume(O),c=String.fromCharCode(O),S):n(O)}function S(O){if(O===null||O===47||O===62||hn(O)){const Ne=O===47,se=c.toLowerCase();return!Ne&&!o&&Wb.includes(se)?(l=1,a.interrupt?t(O):te(O)):dR.includes(c.toLowerCase())?(l=6,Ne?(e.consume(O),_):a.interrupt?t(O):te(O)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(O):o?M(O):D(O))}return O===45||yr(O)?(e.consume(O),c+=String.fromCharCode(O),S):n(O)}function _(O){return O===62?(e.consume(O),a.interrupt?t:te):n(O)}function M(O){return Et(O)?(e.consume(O),M):I(O)}function D(O){return O===47?(e.consume(O),I):O===58||O===95||Tr(O)?(e.consume(O),z):Et(O)?(e.consume(O),D):I(O)}function z(O){return O===45||O===46||O===58||O===95||yr(O)?(e.consume(O),z):L(O)}function L(O){return O===61?(e.consume(O),E):Et(O)?(e.consume(O),L):D(O)}function E(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),m=O,R):Et(O)?(e.consume(O),E):H(O)}function R(O){return O===m?(e.consume(O),m=null,$):O===null||Ye(O)?n(O):(e.consume(O),R)}function H(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||hn(O)?L(O):(e.consume(O),H)}function $(O){return O===47||O===62||Et(O)?D(O):n(O)}function I(O){return O===62?(e.consume(O),G):n(O)}function G(O){return O===null||Ye(O)?te(O):Et(O)?(e.consume(O),G):n(O)}function te(O){return O===45&&l===2?(e.consume(O),U):O===60&&l===1?(e.consume(O),q):O===62&&l===4?(e.consume(O),je):O===63&&l===3?(e.consume(O),P):O===93&&l===5?(e.consume(O),oe):Ye(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(hR,Z,we)(O)):O===null||Ye(O)?(e.exit("htmlFlowData"),we(O)):(e.consume(O),te)}function we(O){return e.check(fR,J,Z)(O)}function J(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ae}function ae(O){return O===null||Ye(O)?we(O):(e.enter("htmlFlowData"),te(O))}function U(O){return O===45?(e.consume(O),P):te(O)}function q(O){return O===47?(e.consume(O),c="",W):te(O)}function W(O){if(O===62){const Ne=c.toLowerCase();return Wb.includes(Ne)?(e.consume(O),je):te(O)}return Tr(O)&&c.length<8?(e.consume(O),c+=String.fromCharCode(O),W):te(O)}function oe(O){return O===93?(e.consume(O),P):te(O)}function P(O){return O===62?(e.consume(O),je):O===45&&l===2?(e.consume(O),P):te(O)}function je(O){return O===null||Ye(O)?(e.exit("htmlFlowData"),Z(O)):(e.consume(O),je)}function Z(O){return e.exit("htmlFlow"),t(O)}}function gR(e,t,n){const a=this;return l;function l(c){return Ye(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function vR(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Uu,t,n)}}const yR={name:"htmlText",tokenize:bR};function bR(e,t,n){const a=this;let l,o,c;return d;function d(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),m}function m(P){return P===33?(e.consume(P),f):P===47?(e.consume(P),L):P===63?(e.consume(P),D):Tr(P)?(e.consume(P),H):n(P)}function f(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),o=0,j):Tr(P)?(e.consume(P),M):n(P)}function p(P){return P===45?(e.consume(P),b):n(P)}function x(P){return P===null?n(P):P===45?(e.consume(P),y):Ye(P)?(c=x,q(P)):(e.consume(P),x)}function y(P){return P===45?(e.consume(P),b):x(P)}function b(P){return P===62?U(P):P===45?y(P):x(P)}function j(P){const je="CDATA[";return P===je.charCodeAt(o++)?(e.consume(P),o===je.length?k:j):n(P)}function k(P){return P===null?n(P):P===93?(e.consume(P),S):Ye(P)?(c=k,q(P)):(e.consume(P),k)}function S(P){return P===93?(e.consume(P),_):k(P)}function _(P){return P===62?U(P):P===93?(e.consume(P),_):k(P)}function M(P){return P===null||P===62?U(P):Ye(P)?(c=M,q(P)):(e.consume(P),M)}function D(P){return P===null?n(P):P===63?(e.consume(P),z):Ye(P)?(c=D,q(P)):(e.consume(P),D)}function z(P){return P===62?U(P):D(P)}function L(P){return Tr(P)?(e.consume(P),E):n(P)}function E(P){return P===45||yr(P)?(e.consume(P),E):R(P)}function R(P){return Ye(P)?(c=R,q(P)):Et(P)?(e.consume(P),R):U(P)}function H(P){return P===45||yr(P)?(e.consume(P),H):P===47||P===62||hn(P)?$(P):n(P)}function $(P){return P===47?(e.consume(P),U):P===58||P===95||Tr(P)?(e.consume(P),I):Ye(P)?(c=$,q(P)):Et(P)?(e.consume(P),$):U(P)}function I(P){return P===45||P===46||P===58||P===95||yr(P)?(e.consume(P),I):G(P)}function G(P){return P===61?(e.consume(P),te):Ye(P)?(c=G,q(P)):Et(P)?(e.consume(P),G):$(P)}function te(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),l=P,we):Ye(P)?(c=te,q(P)):Et(P)?(e.consume(P),te):(e.consume(P),J)}function we(P){return P===l?(e.consume(P),l=void 0,ae):P===null?n(P):Ye(P)?(c=we,q(P)):(e.consume(P),we)}function J(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||hn(P)?$(P):(e.consume(P),J)}function ae(P){return P===47||P===62||hn(P)?$(P):n(P)}function U(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function q(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),W}function W(P){return Et(P)?St(e,oe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):oe(P)}function oe(P){return e.enter("htmlTextData"),c(P)}}const W1={name:"labelEnd",resolveAll:SR,resolveTo:kR,tokenize:CR},wR={tokenize:TR},jR={tokenize:_R},NR={tokenize:MR};function SR(e){let t=-1;const n=[];for(;++t=3&&(f===null||Ye(f))?(e.exit("thematicBreak"),t(f)):n(f)}function m(f){return f===l?(e.consume(f),a++,m):(e.exit("thematicBreakSequence"),Et(f)?St(e,d,"whitespace")(f):d(f))}}const Ir={continuation:{tokenize:FR},exit:qR,name:"list",tokenize:PR},BR={partial:!0,tokenize:HR},LR={partial:!0,tokenize:IR};function PR(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return d;function d(b){const j=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Bx(b)){if(a.containerState.type||(a.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(G0,n,f)(b):f(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(b)}return n(b)}function m(b){return Bx(b)&&++c<10?(e.consume(b),m):(!a.interrupt||c<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):n(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(Uu,a.interrupt?n:p,e.attempt(BR,y,x))}function p(b){return a.containerState.initialBlankLine=!0,o++,y(b)}function x(b){return Et(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function FR(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Uu,l,o);function l(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,St(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!Et(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(LR,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,St(e,e.attempt(Ir,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function IR(e,t,n){const a=this;return St(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function qR(e){e.exit(this.containerState.type)}function HR(e,t,n){const a=this;return St(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!Et(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xb={name:"setextUnderline",resolveTo:UR,tokenize:$R};function UR(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function $R(e,t,n){const a=this;let l;return o;function o(f){let p=a.events.length,x;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){x=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||x)?(e.enter("setextHeadingLine"),l=f,c(f)):n(f)}function c(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===l?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),Et(f)?St(e,m,"lineSuffix")(f):m(f))}function m(f){return f===null||Ye(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const VR={tokenize:GR};function GR(e){const t=this,n=e.attempt(Uu,a,e.attempt(this.parser.constructs.flowInitial,l,St(e,e.attempt(this.parser.constructs.flow,l,e.attempt(QO,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YR={resolveAll:Sj()},WR=Nj("string"),XR=Nj("text");function Nj(e){return{resolveAll:Sj(e==="text"?KR:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,d);return c;function c(p){return f(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),m}function m(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),m)}function f(p){if(p===null)return!0;const x=l[p];let y=-1;if(x)for(;++y-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function cB(e,t){let n=-1;const a=[];let l;for(;++n0){const Qn=Oe.tokenStack[Oe.tokenStack.length-1];(Qn[1]||Qb).call(Oe,void 0,Qn[0])}for(ge.position={start:gl(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:gl(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const f={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,f),e.applyData(t,f)}function CB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Tj(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function _B(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Tj(e,t);const l={src:Zo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function MB(e,t){const n={src:Zo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function EB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function AB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Tj(e,t);const l={href:Zo(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function DB(e,t){const n={href:Zo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function zB(e,t,n){const a=e.all(t),l=n?OB(n):_j(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let x;p&&p.type==="element"&&p.tagName==="p"?x=p:(x={type:"element",tagName:"p",properties:{},children:[]},a.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d1}function RB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=H1(t.children[1]),m=ij(t.children[t.children.length-1]);d&&m&&(c.position={start:d,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function IB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let m=-1;const f=[];for(;++m0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(e3(t.slice(l),l>0,!1)),o.join("")}function e3(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Zb||o===Jb;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Zb||o===Jb;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function UB(e,t){const n={type:"text",value:HB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $B(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const VB={blockquote:bB,break:wB,code:jB,delete:NB,emphasis:SB,footnoteReference:kB,heading:CB,html:TB,imageReference:_B,image:MB,inlineCode:EB,linkReference:AB,link:DB,listItem:zB,list:RB,paragraph:BB,root:LB,strong:PB,table:FB,tableCell:qB,tableRow:IB,text:UB,thematicBreak:$B,toml:j0,yaml:j0,definition:j0,footnoteDefinition:j0};function j0(){}const Mj=-1,qm=0,uu=1,om=2,X1=3,K1=4,Q1=5,Z1=6,Ej=7,Aj=8,t3=typeof self=="object"?self:globalThis,GB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case qm:case Mj:return n(c,l);case uu:{const d=n([],l);for(const m of c)d.push(a(m));return d}case om:{const d=n({},l);for(const[m,f]of c)d[a(m)]=a(f);return d}case X1:return n(new Date(c),l);case K1:{const{source:d,flags:m}=c;return n(new RegExp(d,m),l)}case Q1:{const d=n(new Map,l);for(const[m,f]of c)d.set(a(m),a(f));return d}case Z1:{const d=n(new Set,l);for(const m of c)d.add(a(m));return d}case Ej:{const{name:d,message:m}=c;return n(new t3[d](m),l)}case Aj:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new t3[o](c),l)};return a},n3=e=>GB(new Map,e)(0),vo="",{toString:YB}={},{keys:WB}=Object,tu=e=>{const t=typeof e;if(t!=="object"||!e)return[qm,t];const n=YB.call(e).slice(8,-1);switch(n){case"Array":return[uu,vo];case"Object":return[om,vo];case"Date":return[X1,vo];case"RegExp":return[K1,vo];case"Map":return[Q1,vo];case"Set":return[Z1,vo];case"DataView":return[uu,n]}return n.includes("Array")?[uu,n]:n.includes("Error")?[Ej,n]:[om,n]},N0=([e,t])=>e===qm&&(t==="function"||t==="symbol"),XB=(e,t,n,a)=>{const l=(c,d)=>{const m=a.push(c)-1;return n.set(d,m),m},o=c=>{if(n.has(c))return n.get(c);let[d,m]=tu(c);switch(d){case qm:{let p=c;switch(m){case"bigint":d=Aj,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return l([Mj],c)}return l([d,p],c)}case uu:{if(m){let y=c;return m==="DataView"?y=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(c)),l([m,[...y]],c)}const p=[],x=l([d,p],c);for(const y of c)p.push(o(y));return x}case om:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],x=l([d,p],c);for(const y of WB(c))(e||!N0(tu(c[y])))&&p.push([o(y),o(c[y])]);return x}case X1:return l([d,c.toISOString()],c);case K1:{const{source:p,flags:x}=c;return l([d,{source:p,flags:x}],c)}case Q1:{const p=[],x=l([d,p],c);for(const[y,b]of c)(e||!(N0(tu(y))||N0(tu(b))))&&p.push([o(y),o(b)]);return x}case Z1:{const p=[],x=l([d,p],c);for(const y of c)(e||!N0(tu(y)))&&p.push(o(y));return x}}const{message:f}=c;return l([d,{name:m,message:f}],c)};return o},r3=(e,{json:t,lossy:n}={})=>{const a=[];return XB(!(t||n),!!t,new Map,a)(e),a},cm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?n3(r3(e,t)):structuredClone(e):(e,t)=>n3(r3(e,t));function KB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function QB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ZB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KB,a=e.options.footnoteBackLabel||QB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m0&&j.push({type:"text",value:" "});let M=typeof n=="string"?n:n(m,b);typeof M=="string"&&(M={type:"text",value:M}),j.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,b),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const M=S.children[S.children.length-1];M&&M.type==="text"?M.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...j)}else p.push(...j);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,_),d.push(_)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cm(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:` +`}]}}const $u=(function(e){if(e==null)return nL;if(typeof e=="function")return Hm(e);if(typeof e=="object")return Array.isArray(e)?JB(e):eL(e);if(typeof e=="string")return tL(e);throw new Error("Expected function, string, or object as test")});function JB(e){const t=[];let n=-1;for(;++n":""))+")"})}return y;function y(){let b=Dj,j,k,S;if((!t||o(m,f,p[p.length-1]||void 0))&&(b=sL(n(m,p)),b[0]===Px))return b;if("children"in m&&m.children){const _=m;if(_.children&&b[0]!==zj)for(k=(a?_.children.length:-1)+c,S=p.concat(_);k>-1&&k<_.children.length;){const M=_.children[k];if(j=d(M,k,S)(),j[0]===Px)return j;k=typeof j[1]=="number"?j[1]:k+c}}return b}}}function sL(e){return Array.isArray(e)?e:typeof e=="number"?[aL,e]:e==null?Dj:[e]}function eg(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),J1(e,o,d,l);function d(m,f){const p=f[f.length-1],x=p?p.children.indexOf(m):void 0;return c(m,x,p)}}const Fx={}.hasOwnProperty,lL={};function iL(e,t){const n=t||lL,a=new Map,l=new Map,o=new Map,c={...VB,...n.handlers},d={all:f,applyData:cL,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:oL,wrap:dL};return eg(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const x=p.type==="definition"?a:l,y=String(p.identifier).toUpperCase();x.has(y)||x.set(y,p)}}),d;function m(p,x){const y=p.type,b=d.handlers[y];if(Fx.call(d.handlers,y)&&b)return b(d,p,x);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in p){const{children:k,...S}=p,_=cm(S);return _.children=d.all(p),_}return cm(p)}return(d.options.unknownHandler||uL)(d,p,x)}function f(p){const x=[];if("children"in p){const y=p.children;let b=-1;for(;++b0&&n.push({type:"text",value:` +`}),n}function a3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function s3(e,t){const n=iL(e,t),a=n.one(e,void 0),l=ZB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:` +`},l),o}function mL(e,t){return e&&"run"in e?async function(n,a){const l=s3(n,{file:a,...t});await e.run(l,a)}:function(n,a){return s3(n,{file:a,...e||t})}}function l3(e){if(e)throw e}var Rp,i3;function hL(){if(i3)return Rp;i3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),x=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!x)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},c=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},d=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(a)return a(f,p).value}else return;return f[p]};return Rp=function m(){var f,p,x,y,b,j,k=arguments[0],S=1,_=arguments.length,M=!1;for(typeof k=="boolean"&&(M=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<_;++S)if(f=arguments[S],f!=null)for(p in f)x=d(k,p),y=d(f,p),k!==y&&(M&&y&&(o(y)||(b=l(y)))?(b?(b=!1,j=x&&l(x)?x:[]):j=x&&o(x)?x:{},c(k,{name:p,newValue:m(M,j,y)})):typeof y<"u"&&c(k,{name:p,newValue:y}));return k},Rp}var fL=hL();const Bp=M5(fL);function Ix(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pL(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...l);function d(m,...f){const p=e[++o];let x=-1;if(m){c(m);return}for(;++xc.length;let m;d&&c.push(l);try{m=e.apply(this,c)}catch(f){const p=f;if(d&&n)throw p;return l(p)}d||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...d){n||(n=!0,t(c,...d))}function o(c){l(null,c)}}const Xa={basename:gL,dirname:vL,extname:yL,join:bL,sep:"/"};function gL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),d>-1&&(e.codePointAt(l)===t.codePointAt(d--)?d<0&&(a=l):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function vL(e){if(Vu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yL(e){Vu(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function bL(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function jL(e,t){let n="",a=0,l=-1,o=0,c=-1,d,m;for(;++c<=e.length;){if(c2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function Vu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const NL={cwd:SL};function SL(){return"/"}function qx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function kL(e){if(typeof e=="string")e=new URL(e);else if(!qx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return CL(e)}function CL(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n0){let[b,...j]=p;const k=a[y][1];Ix(k)&&Ix(b)&&(b=Bp(!0,k,b)),a[y]=[f,b,...j]}}}}const EL=new tg().freeze();function Ip(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function c3(e){if(!Ix(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function u3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function S0(e){return AL(e)?e:new Oj(e)}function AL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function DL(e){return typeof e=="string"||zL(e)}function zL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",d3=[],m3={allowDangerousHtml:!0},RL=/^(https?|ircs?|mailto|xmpp)$/i,BL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function LL(e){const t=PL(e),n=FL(e);return IL(t.runSync(t.parse(n),n),e)}function PL(e){const t=e.rehypePlugins||d3,n=e.remarkPlugins||d3,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...m3}:m3;return EL().use(yB).use(n).use(mL,a).use(t)}function FL(e){const t=e.children||"",n=new Oj;return typeof t=="string"&&(n.value=t),n}function IL(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,m=t.urlTransform||qL;for(const p of BL)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+OL+p.id,void 0);return eg(e,f),nO(e,{Fragment:r.Fragment,components:l,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function f(p,x,y){if(p.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let b;for(b in Dp)if(Object.hasOwn(Dp,b)&&Object.hasOwn(p.properties,b)){const j=p.properties[b],k=Dp[b];(k===null||k.includes(p.tagName))&&(p.properties[b]=m(String(j||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!b&&a&&typeof x=="number"&&(b=!a(p,x,y)),b&&y&&typeof x=="number")return d&&p.children?y.children.splice(x,1,...p.children):y.children.splice(x,1),x}}}function qL(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||RL.test(e.slice(0,t))?e:""}function h3(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}function HL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function UL(e,t,n){const l=$u((n||{}).ignore||[]),o=$L(t);let c=-1;for(;++c0?{type:"text",value:E}:void 0),E===!1?y.lastIndex=z+1:(j!==z&&M.push({type:"text",value:f.value.slice(j,z)}),Array.isArray(E)?M.push(...E):E&&M.push(E),j=z+D[0].length,_=!0),!y.global)break;D=y.exec(f.value)}return _?(j?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=h3(e,"(");let o=h3(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function Rj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gi(n)||Fm(n))&&(!t||n!==47)}Bj.peek=hP;function sP(){this.buffer()}function lP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function iP(){this.buffer()}function oP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uP(e){this.exit(e)}function dP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mP(e){this.exit(e)}function hP(){return"["}function Bj(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=l.move("]"),o}function fP(){return{enter:{gfmFootnoteCallString:sP,gfmFootnoteCall:lP,gfmFootnoteDefinitionLabelString:iP,gfmFootnoteDefinition:oP},exit:{gfmFootnoteCallString:cP,gfmFootnoteCall:uP,gfmFootnoteDefinitionLabelString:dP,gfmFootnoteDefinition:mP}}}function pP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Bj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const d=o.createTracker(c);let m=d.move("[^");const f=o.enter("footnoteDefinition"),p=o.enter("label");return m+=d.move(o.safe(o.associationId(a),{before:m,after:"]"})),p(),m+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),m+=d.move((t?` +`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?Lj:xP))),f(),m}}function xP(e,t,n){return t===0?e:Lj(e,t,n)}function Lj(e,t,n){return(n?"":" ")+e}const gP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Pj.peek=jP;function vP(){return{canContainEols:["delete"],enter:{strikethrough:bP},exit:{strikethrough:wP}}}function yP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gP}],handlers:{delete:Pj}}}function bP(e){this.enter({type:"delete",children:[]},e)}function wP(e){this.exit(e)}function Pj(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function jP(){return"~"}function NP(e){return e.length}function SP(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||NP,o=[],c=[],d=[],m=[];let f=0,p=-1;for(;++pf&&(f=e[p].length);++_m[_])&&(m[_]=D)}k.push(M)}c[p]=k,d[p]=S}let x=-1;if(typeof a=="object"&&"length"in a)for(;++xm[x]&&(m[x]=M),b[x]=M),y[x]=D}c.splice(1,0,y),d.splice(1,0,b),p=-1;const j=[];for(;++p "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),TP);return l(),c}function TP(e,t,n){return">"+(n?"":" ")+e}function _P(e,t){return p3(e,t.inConstruct,!0)&&!p3(e,t.notInConstruct,!1)}function p3(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++ac&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function MP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function AP(e,t,n,a){const l=EP(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(MP(e,n)){const x=n.enter("codeIndented"),y=n.indentLines(o,DP);return x(),y}const d=n.createTracker(a),m=l.repeat(Math.max(Fj(o,l)+1,3)),f=n.enter("codeFenced");let p=d.move(m);if(e.lang){const x=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),x()}if(e.lang&&e.meta){const x=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:` +`,encode:["`"],...d.current()})),x()}return p+=d.move(` +`),o&&(p+=d.move(o+` +`)),p+=d.move(m),f(),p}function DP(e,t,n){return(n?"":" ")+e}function ng(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zP(e,t,n,a){const l=ng(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const m=n.createTracker(a);let f=m.move("[");return f+=m.move(n.safe(n.associationId(e),{before:f,after:"]",...m.current()})),f+=m.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=m.move("<"),f+=m.move(n.safe(e.url,{before:f,after:">",...m.current()})),f+=m.move(">")):(d=n.enter("destinationRaw"),f+=m.move(n.safe(e.url,{before:f,after:e.title?" ":` +`,...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=m.move(" "+l),f+=m.move(n.safe(e.title,{before:f,after:l,...m.current()})),f+=m.move(l),d()),c(),f}function OP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function um(e,t,n){const a=Io(e),l=Io(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ij.peek=RP;function Ij(e,t,n,a){const l=OP(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:d,...c.current()}));const f=m.charCodeAt(0),p=um(a.before.charCodeAt(a.before.length-1),f,l);p.inside&&(m=yu(f)+m.slice(1));const x=m.charCodeAt(m.length-1),y=um(a.after.charCodeAt(0),x,l);y.inside&&(m=m.slice(0,-1)+yu(x));const b=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+b}function RP(e,t,n){return n.options.emphasis||"*"}function BP(e,t){let n=!1;return eg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Px}),!!((!e.depth||e.depth<3)&&G1(e)&&(t.options.setext||n))}function LP(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(BP(e,n)){const p=n.enter("headingSetext"),x=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:` +`,after:` +`});return x(),p(),y+` +`+(l===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(` +`))+1))}const c="#".repeat(l),d=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let f=n.containerPhrasing(e,{before:"# ",after:` +`,...o.current()});return/^[\t ]/.test(f)&&(f=yu(f.charCodeAt(0))+f.slice(1)),f=f?c+" "+f:c,n.options.closeAtx&&(f+=" "+c),m(),d(),f}qj.peek=PP;function qj(e){return e.value||""}function PP(){return"<"}Hj.peek=FP;function Hj(e,t,n,a){const l=ng(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const m=n.createTracker(a);let f=m.move("![");return f+=m.move(n.safe(e.alt,{before:f,after:"]",...m.current()})),f+=m.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=m.move("<"),f+=m.move(n.safe(e.url,{before:f,after:">",...m.current()})),f+=m.move(">")):(d=n.enter("destinationRaw"),f+=m.move(n.safe(e.url,{before:f,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=m.move(" "+l),f+=m.move(n.safe(e.title,{before:f,after:l,...m.current()})),f+=m.move(l),d()),f+=m.move(")"),c(),f}function FP(){return"!"}Uj.peek=IP;function Uj(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("![");const f=n.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const x=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),l==="full"||!f||f!==x?m+=d.move(x+"]"):l==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function IP(){return"!"}$j.peek=qP;function $j(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o\u007F]/.test(e.url))}Gj.peek=HP;function Gj(e,t,n,a){const l=ng(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,m;if(Vj(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let x=c.move("<");return x+=c.move(n.containerPhrasing(e,{before:x,after:">",...c.current()})),x+=c.move(">"),d(),n.stack=p,x}d=n.enter("link"),m=n.enter("label");let f=c.move("[");return f+=c.move(n.containerPhrasing(e,{before:f,after:"](",...c.current()})),f+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(m=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),f+=c.move(" "+l),f+=c.move(n.safe(e.title,{before:f,after:l,...c.current()})),f+=c.move(l),m()),f+=c.move(")"),d(),f}function HP(e,t,n){return Vj(e,n)?"<":"["}Yj.peek=UP;function Yj(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("[");const f=n.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const x=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),l==="full"||!f||f!==x?m+=d.move(x+"]"):l==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function UP(){return"["}function rg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $P(e){const t=rg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VP(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Wj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function GP(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?VP(n):rg(n);const d=e.ordered?c==="."?")":".":$P(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),Wj(n)===c&&p){let x=-1;for(;++x-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const m=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,d.current()),p);return m(),f;function p(x,y,b){return y?(b?"":" ".repeat(c))+x:(b?o:o+" ".repeat(c-o.length))+x}}function XP(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const KP=$u(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function QP(e,t,n,a){return(e.children.some(function(c){return KP(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function ZP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xj.peek=JP;function Xj(e,t,n,a){const l=ZP(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:d,...c.current()}));const f=m.charCodeAt(0),p=um(a.before.charCodeAt(a.before.length-1),f,l);p.inside&&(m=yu(f)+m.slice(1));const x=m.charCodeAt(m.length-1),y=um(a.after.charCodeAt(0),x,l);y.inside&&(m=m.slice(0,-1)+yu(x));const b=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+b}function JP(e,t,n){return n.options.strong||"*"}function eF(e,t,n,a){return n.safe(e.value,a)}function tF(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nF(e,t,n){const a=(Wj(n)+(n.options.ruleSpaces?" ":"")).repeat(tF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const Kj={blockquote:CP,break:x3,code:AP,definition:zP,emphasis:Ij,hardBreak:x3,heading:LP,html:qj,image:Hj,imageReference:Uj,inlineCode:$j,link:Gj,linkReference:Yj,list:GP,listItem:WP,paragraph:XP,root:QP,strong:Xj,text:eF,thematicBreak:nF};function rF(){return{enter:{table:aF,tableData:g3,tableHeader:g3,tableRow:lF},exit:{codeText:iF,table:sF,tableData:Gp,tableHeader:Gp,tableRow:Gp}}}function aF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function sF(e){this.exit(e),this.data.inTable=void 0}function lF(e){this.enter({type:"tableRow",children:[]},e)}function Gp(e){this.exit(e)}function g3(e){this.enter({type:"tableCell",children:[]},e)}function iF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oF(e,t){return t==="|"?t:e}function cF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:m,tableRow:d}};function c(b,j,k,S){return f(p(b,k,S),b.align)}function d(b,j,k,S){const _=x(b,k,S),M=f([_]);return M.slice(0,M.indexOf(` +`))}function m(b,j,k,S){const _=k.enter("tableCell"),M=k.enter("phrasing"),D=k.containerPhrasing(b,{...S,before:o,after:o});return M(),_(),D}function f(b,j){return SP(b,{align:j,alignDelimiters:a,padding:n,stringLength:l})}function p(b,j,k){const S=b.children;let _=-1;const M=[],D=j.enter("table");for(;++_0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const TF={tokenize:RF,partial:!0};function _F(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DF,continuation:{tokenize:zF},exit:OF}},text:{91:{name:"gfmFootnoteCall",tokenize:AF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MF,resolveTo:EF}}}}function MF(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return d;function d(m){if(!c||!c._balanced)return n(m);const f=Ia(a.sliceSerialize({start:c.end,end:a.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function EF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function AF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),m}function m(x){return x!==94?n(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(x){if(o>999||x===93&&!c||x===null||x===91||hn(x))return n(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(Ia(a.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(x)}return hn(x)||(c=!0),o++,e.consume(x),x===92?p:f}function p(x){return x===91||x===92||x===93?(e.consume(x),o++,f):f(x)}}function DF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return m;function m(j){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(j){return j===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(j)}function p(j){if(c>999||j===93&&!d||j===null||j===91||hn(j))return n(j);if(j===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=Ia(a.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return hn(j)||(d=!0),c++,e.consume(j),j===92?x:p}function x(j){return j===91||j===92||j===93?(e.consume(j),c++,p):p(j)}function y(j){return j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),l.includes(o)||l.push(o),St(e,b,"gfmFootnoteDefinitionWhitespace")):n(j)}function b(j){return t(j)}}function zF(e,t,n){return e.check(Uu,t,e.attempt(TF,t,n))}function OF(e){e.exit("gfmFootnoteDefinition")}function RF(e,t,n){const a=this;return St(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function BF(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,d){let m=-1;for(;++m1?m(j):(c.consume(j),x++,b);if(x<2&&!n)return m(j);const S=c.exit("strikethroughSequenceTemporary"),_=Io(j);return S._open=!_||_===2&&!!k,S._close=!k||k===2&&!!_,d(j)}}}class LF{constructor(){this.map=[]}add(t,n,a){PF(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function PF(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l-1;){const J=a.events[G][1].type;if(J==="lineEnding"||J==="linePrefix")G--;else break}const te=G>-1?a.events[G][1].type:null,we=te==="tableHead"||te==="tableRow"?E:m;return we===E&&a.parser.lazy[a.now().line]?n(I):we(I)}function m(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(c=!0,o+=1),p(I)}function p(I){return I===null?n(I):Ye(I)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b):n(I):Et(I)?St(e,p,"whitespace")(I):(o+=1,c&&(c=!1,l+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),x(I)))}function x(I){return I===null||I===124||hn(I)?(e.exit("data"),p(I)):(e.consume(I),I===92?y:x)}function y(I){return I===92||I===124?(e.consume(I),x):x(I)}function b(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),c=!1,Et(I)?St(e,j,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):j(I))}function j(I){return I===45||I===58?S(I):I===124?(c=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):L(I)}function k(I){return Et(I)?St(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):I===45?(o+=1,_(I)):I===null||Ye(I)?z(I):L(I)}function _(I){return I===45?(e.enter("tableDelimiterFiller"),M(I)):L(I)}function M(I){return I===45?(e.consume(I),M):I===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),D):(e.exit("tableDelimiterFiller"),D(I))}function D(I){return Et(I)?St(e,z,"whitespace")(I):z(I)}function z(I){return I===124?j(I):I===null||Ye(I)?!c||l!==o?L(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):L(I)}function L(I){return n(I)}function E(I){return e.enter("tableRow"),R(I)}function R(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):I===null||Ye(I)?(e.exit("tableRow"),t(I)):Et(I)?St(e,R,"whitespace")(I):(e.enter("data"),H(I))}function H(I){return I===null||I===124||hn(I)?(e.exit("data"),R(I)):(e.consume(I),I===92?$:H)}function $(I){return I===92||I===124?(e.consume(I),H):H(I)}}function HF(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,f,p,x;const y=new LF;for(;++nn[2]+1){const j=n[2]+1,k=n[3]-n[2]-1;e.add(j,k,[])}}e.add(n[3]+1,0,[["exit",x,t]])}return l!==void 0&&(o.end=Object.assign({},Co(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function y3(e,t,n,a,l){const o=[],c=Co(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function Co(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const UF={name:"tasklistCheck",tokenize:VF};function $F(){return{text:{91:UF}}}function VF(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return hn(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(m)}function d(m){return Ye(m)?t(m):Et(m)?e.check({tokenize:GF},t,n)(m):n(m)}}function GF(e,t,n){return St(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function YF(e){return fj([vF(),_F(),BF(e),IF(),$F()])}const WF={};function XF(e){const t=this,n=e||WF,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(YF(n)),o.push(fF()),c.push(pF(n))}function KF(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:l,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(m){const f={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[f]}},m)}function t(){this.buffer()}function n(){const m=this.resume(),f=this.stack[this.stack.length-1];f.type,f.meta=m}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function l(m){const f=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=f;const x=p.data.hChildren[0];x.type,x.tagName,x.children.push({type:"text",value:f}),this.data.mathFlowInside=void 0}function o(m){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},m),this.buffer()}function c(m){const f=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=f,p.data.hChildren.push({type:"text",value:f})}function d(m){this.config.enter.data.call(this,m),this.config.exit.data.call(this,m)}}function QF(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=l,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,c,d,m){const f=o.value||"",p=d.createTracker(m),x="$".repeat(Math.max(Fj(f,"$")+1,2)),y=d.enter("mathFlow");let b=p.move(x);if(o.meta){const j=d.enter("mathFlowMeta");b+=p.move(d.safe(o.meta,{after:` +`,before:b,encode:["$"],...p.current()})),j()}return b+=p.move(` +`),f&&(b+=p.move(f+` +`)),b+=p.move(x),y(),b}function a(o,c,d){let m=o.value||"",f=1;for(t||f++;new RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(m);)f++;const p="$".repeat(f);/[^ \r\n]/.test(m)&&(/^[ \r\n]/.test(m)&&/[ \r\n]$/.test(m)||/^\$|\$$/.test(m))&&(m=" "+m+" ");let x=-1;for(;++x15?f="…"+d.slice(l-15,l):f=d.slice(0,l);var p;o+15":">","<":"<",'"':""","'":"'"},cI=/[&><"']/g;function uI(e){return String(e).replace(cI,t=>oI[t])}var s8=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},dI=function(t){var n=s8(t);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},mI=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},hI=function(t){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Ht={deflt:sI,escape:uI,hyphenate:iI,getBaseElem:s8,isCharacterBox:dI,protocolFromUrl:hI},Y0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function fI(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class sg{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n in Y0)if(Y0.hasOwnProperty(n)){var a=Y0[n];this[n]=t[n]!==void 0?a.processor?a.processor(t[n]):t[n]:fI(a)}}reportNonstrict(t,n,a){var l=this.strict;if(typeof l=="function"&&(l=l(t,n,a)),!(!l||l==="ignore")){if(l===!0||l==="error")throw new Ae("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);l==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var l=this.strict;if(typeof l=="function")try{l=l(t,n,a)}catch{l="error"}return!l||l==="ignore"?!1:l===!0||l==="error"?!0:l==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if(t.url&&!t.protocol){var n=Ht.protocolFromUrl(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class vl{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Qa[pI[this.id]]}sub(){return Qa[xI[this.id]]}fracNum(){return Qa[gI[this.id]]}fracDen(){return Qa[vI[this.id]]}cramp(){return Qa[yI[this.id]]}text(){return Qa[bI[this.id]]}isTight(){return this.size>=2}}var lg=0,dm=1,zo=2,Rs=3,bu=4,Ca=5,qo=6,_r=7,Qa=[new vl(lg,0,!1),new vl(dm,0,!0),new vl(zo,1,!1),new vl(Rs,1,!0),new vl(bu,2,!1),new vl(Ca,2,!0),new vl(qo,3,!1),new vl(_r,3,!0)],pI=[bu,Ca,bu,Ca,qo,_r,qo,_r],xI=[Ca,Ca,Ca,Ca,_r,_r,_r,_r],gI=[zo,Rs,bu,Ca,qo,_r,qo,_r],vI=[Rs,Rs,Ca,Ca,_r,_r,_r,_r],yI=[dm,dm,Rs,Rs,Ca,Ca,_r,_r],bI=[lg,dm,zo,Rs,zo,Rs,zo,Rs],tt={DISPLAY:Qa[lg],TEXT:Qa[zo],SCRIPT:Qa[bu],SCRIPTSCRIPT:Qa[qo]},Ux=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function wI(e){for(var t=0;t=l[0]&&e<=l[1])return n.name}return null}var W0=[];Ux.forEach(e=>e.blocks.forEach(t=>W0.push(...t)));function l8(e){for(var t=0;t=W0[t]&&e<=W0[t+1])return!0;return!1}var yo=80,jI=function(t,n){return"M95,"+(622+t+n)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+t/2.075+" -"+t+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+t)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},NI=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+t/2.084+" -"+t+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+t)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},SI=function(t,n){return"M983 "+(10+t+n)+` +l`+t/3.13+" -"+t+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},kI=function(t,n){return"M424,"+(2398+t+n)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+t)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+` +h400000v`+(40+t)+"h-400000z"},CI=function(t,n){return"M473,"+(2713+t+n)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},TI=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},_I=function(t,n,a){var l=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+` +H742v`+l+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},MI=function(t,n,a){n=1e3*n;var l="";switch(t){case"sqrtMain":l=jI(n,yo);break;case"sqrtSize1":l=NI(n,yo);break;case"sqrtSize2":l=SI(n,yo);break;case"sqrtSize3":l=kI(n,yo);break;case"sqrtSize4":l=CI(n,yo);break;case"sqrtTall":l=_I(n,yo,a)}return l},EI=function(t,n){switch(t){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},w3={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},AI=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z +M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z +M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z +M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Gu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;nn.toText();return this.children.map(t).join("")}}var es={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},C0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},j3={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function DI(e,t){es[e]=t}function ig(e,t,n){if(!es[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),l=es[t][a];if(!l&&e[0]in j3&&(a=j3[e[0]].charCodeAt(0),l=es[t][a]),!l&&n==="text"&&l8(a)&&(l=es[t][77]),l)return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}var Yp={};function zI(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Yp[t]){var n=Yp[t]={cssEmPerMu:C0.quad[t]/18};for(var a in C0)C0.hasOwnProperty(a)&&(n[a]=C0[a][t])}return Yp[t]}var OI=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],N3=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],S3=function(t,n){return n.size<2?t:OI[t-1][n.size-1]};class As{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||As.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=N3[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a]);return new As(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:S3(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:N3[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=S3(As.BASESIZE,t);return this.size===n&&this.textSize===As.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==As.BASESIZE?["sizing","reset-size"+this.size,"size"+As.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=zI(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}As.BASESIZE=6;var $x={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},RI={ex:!0,em:!0,mu:!0},i8=function(t){return typeof t!="string"&&(t=t.unit),t in $x||t in RI||t==="ex"},_n=function(t,n){var a;if(t.unit in $x)a=$x[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var l;if(n.style.isTight()?l=n.havingStyle(n.style.text()):l=n,t.unit==="ex")a=l.fontMetrics().xHeight;else if(t.unit==="em")a=l.fontMetrics().quad;else throw new Ae("Invalid unit: '"+t.unit+"'");l!==n&&(a*=l.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Re=function(t){return+t.toFixed(4)+"em"},_l=function(t){return t.filter(n=>n).join(" ")},o8=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var l=n.getColor();l&&(this.style.color=l)}},c8=function(t){var n=document.createElement(t);n.className=_l(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(n.style[a]=this.style[a]);for(var l in this.attributes)this.attributes.hasOwnProperty(l)&&n.setAttribute(l,this.attributes[l]);for(var o=0;o/=\x00-\x1f]/,u8=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Ht.escape(_l(this.classes))+'"');var a="";for(var l in this.style)this.style.hasOwnProperty(l)&&(a+=Ht.hyphenate(l)+":"+this.style[l]+";");a&&(n+=' style="'+Ht.escape(a)+'"');for(var o in this.attributes)if(this.attributes.hasOwnProperty(o)){if(BI.test(o))throw new Ae("Invalid attribute name '"+o+"'");n+=" "+o+'="'+Ht.escape(this.attributes[o])+'"'}n+=">";for(var c=0;c",n};class Yu{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,o8.call(this,t,a,l),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return c8.call(this,"span")}toMarkup(){return u8.call(this,"span")}}class og{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,o8.call(this,n,l),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return c8.call(this,"a")}toMarkup(){return u8.call(this,"a")}}class LI{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t=''+Ht.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Re(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=_l(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(n=n||document.createElement("span"),n.style[a]=this.style[a]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="0&&(a+="margin-right:"+this.italic+"em;");for(var l in this.style)this.style.hasOwnProperty(l)&&(a+=Ht.hyphenate(l)+":"+this.style[l]+";");a&&(t=!0,n+=' style="'+Ht.escape(a)+'"');var o=Ht.escape(this.text);return t?(n+=">",n+=o,n+="",n):o}}class Fs{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);for(var l=0;l':''}}class Vx{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t=" but got "+String(e)+".")}var II={bin:1,close:1,inner:1,open:1,punct:1,rel:1},qI={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},yn={math:{},text:{}};function N(e,t,n,a,l,o){yn[e][l]={font:t,group:n,replace:a},o&&a&&(yn[e][a]=yn[e][l])}var C="math",_e="text",A="main",V="ams",Nn="accent-token",Ie="bin",Mr="close",Jo="inner",Je="mathord",Vn="op-token",ha="open",Um="punct",Y="rel",$s="spacing",ne="textord";N(C,A,Y,"≡","\\equiv",!0);N(C,A,Y,"≺","\\prec",!0);N(C,A,Y,"≻","\\succ",!0);N(C,A,Y,"∼","\\sim",!0);N(C,A,Y,"⊥","\\perp");N(C,A,Y,"⪯","\\preceq",!0);N(C,A,Y,"⪰","\\succeq",!0);N(C,A,Y,"≃","\\simeq",!0);N(C,A,Y,"∣","\\mid",!0);N(C,A,Y,"≪","\\ll",!0);N(C,A,Y,"≫","\\gg",!0);N(C,A,Y,"≍","\\asymp",!0);N(C,A,Y,"∥","\\parallel");N(C,A,Y,"⋈","\\bowtie",!0);N(C,A,Y,"⌣","\\smile",!0);N(C,A,Y,"⊑","\\sqsubseteq",!0);N(C,A,Y,"⊒","\\sqsupseteq",!0);N(C,A,Y,"≐","\\doteq",!0);N(C,A,Y,"⌢","\\frown",!0);N(C,A,Y,"∋","\\ni",!0);N(C,A,Y,"∝","\\propto",!0);N(C,A,Y,"⊢","\\vdash",!0);N(C,A,Y,"⊣","\\dashv",!0);N(C,A,Y,"∋","\\owns");N(C,A,Um,".","\\ldotp");N(C,A,Um,"⋅","\\cdotp");N(C,A,ne,"#","\\#");N(_e,A,ne,"#","\\#");N(C,A,ne,"&","\\&");N(_e,A,ne,"&","\\&");N(C,A,ne,"ℵ","\\aleph",!0);N(C,A,ne,"∀","\\forall",!0);N(C,A,ne,"ℏ","\\hbar",!0);N(C,A,ne,"∃","\\exists",!0);N(C,A,ne,"∇","\\nabla",!0);N(C,A,ne,"♭","\\flat",!0);N(C,A,ne,"ℓ","\\ell",!0);N(C,A,ne,"♮","\\natural",!0);N(C,A,ne,"♣","\\clubsuit",!0);N(C,A,ne,"℘","\\wp",!0);N(C,A,ne,"♯","\\sharp",!0);N(C,A,ne,"♢","\\diamondsuit",!0);N(C,A,ne,"ℜ","\\Re",!0);N(C,A,ne,"♡","\\heartsuit",!0);N(C,A,ne,"ℑ","\\Im",!0);N(C,A,ne,"♠","\\spadesuit",!0);N(C,A,ne,"§","\\S",!0);N(_e,A,ne,"§","\\S");N(C,A,ne,"¶","\\P",!0);N(_e,A,ne,"¶","\\P");N(C,A,ne,"†","\\dag");N(_e,A,ne,"†","\\dag");N(_e,A,ne,"†","\\textdagger");N(C,A,ne,"‡","\\ddag");N(_e,A,ne,"‡","\\ddag");N(_e,A,ne,"‡","\\textdaggerdbl");N(C,A,Mr,"⎱","\\rmoustache",!0);N(C,A,ha,"⎰","\\lmoustache",!0);N(C,A,Mr,"⟯","\\rgroup",!0);N(C,A,ha,"⟮","\\lgroup",!0);N(C,A,Ie,"∓","\\mp",!0);N(C,A,Ie,"⊖","\\ominus",!0);N(C,A,Ie,"⊎","\\uplus",!0);N(C,A,Ie,"⊓","\\sqcap",!0);N(C,A,Ie,"∗","\\ast");N(C,A,Ie,"⊔","\\sqcup",!0);N(C,A,Ie,"◯","\\bigcirc",!0);N(C,A,Ie,"∙","\\bullet",!0);N(C,A,Ie,"‡","\\ddagger");N(C,A,Ie,"≀","\\wr",!0);N(C,A,Ie,"⨿","\\amalg");N(C,A,Ie,"&","\\And");N(C,A,Y,"⟵","\\longleftarrow",!0);N(C,A,Y,"⇐","\\Leftarrow",!0);N(C,A,Y,"⟸","\\Longleftarrow",!0);N(C,A,Y,"⟶","\\longrightarrow",!0);N(C,A,Y,"⇒","\\Rightarrow",!0);N(C,A,Y,"⟹","\\Longrightarrow",!0);N(C,A,Y,"↔","\\leftrightarrow",!0);N(C,A,Y,"⟷","\\longleftrightarrow",!0);N(C,A,Y,"⇔","\\Leftrightarrow",!0);N(C,A,Y,"⟺","\\Longleftrightarrow",!0);N(C,A,Y,"↦","\\mapsto",!0);N(C,A,Y,"⟼","\\longmapsto",!0);N(C,A,Y,"↗","\\nearrow",!0);N(C,A,Y,"↩","\\hookleftarrow",!0);N(C,A,Y,"↪","\\hookrightarrow",!0);N(C,A,Y,"↘","\\searrow",!0);N(C,A,Y,"↼","\\leftharpoonup",!0);N(C,A,Y,"⇀","\\rightharpoonup",!0);N(C,A,Y,"↙","\\swarrow",!0);N(C,A,Y,"↽","\\leftharpoondown",!0);N(C,A,Y,"⇁","\\rightharpoondown",!0);N(C,A,Y,"↖","\\nwarrow",!0);N(C,A,Y,"⇌","\\rightleftharpoons",!0);N(C,V,Y,"≮","\\nless",!0);N(C,V,Y,"","\\@nleqslant");N(C,V,Y,"","\\@nleqq");N(C,V,Y,"⪇","\\lneq",!0);N(C,V,Y,"≨","\\lneqq",!0);N(C,V,Y,"","\\@lvertneqq");N(C,V,Y,"⋦","\\lnsim",!0);N(C,V,Y,"⪉","\\lnapprox",!0);N(C,V,Y,"⊀","\\nprec",!0);N(C,V,Y,"⋠","\\npreceq",!0);N(C,V,Y,"⋨","\\precnsim",!0);N(C,V,Y,"⪹","\\precnapprox",!0);N(C,V,Y,"≁","\\nsim",!0);N(C,V,Y,"","\\@nshortmid");N(C,V,Y,"∤","\\nmid",!0);N(C,V,Y,"⊬","\\nvdash",!0);N(C,V,Y,"⊭","\\nvDash",!0);N(C,V,Y,"⋪","\\ntriangleleft");N(C,V,Y,"⋬","\\ntrianglelefteq",!0);N(C,V,Y,"⊊","\\subsetneq",!0);N(C,V,Y,"","\\@varsubsetneq");N(C,V,Y,"⫋","\\subsetneqq",!0);N(C,V,Y,"","\\@varsubsetneqq");N(C,V,Y,"≯","\\ngtr",!0);N(C,V,Y,"","\\@ngeqslant");N(C,V,Y,"","\\@ngeqq");N(C,V,Y,"⪈","\\gneq",!0);N(C,V,Y,"≩","\\gneqq",!0);N(C,V,Y,"","\\@gvertneqq");N(C,V,Y,"⋧","\\gnsim",!0);N(C,V,Y,"⪊","\\gnapprox",!0);N(C,V,Y,"⊁","\\nsucc",!0);N(C,V,Y,"⋡","\\nsucceq",!0);N(C,V,Y,"⋩","\\succnsim",!0);N(C,V,Y,"⪺","\\succnapprox",!0);N(C,V,Y,"≆","\\ncong",!0);N(C,V,Y,"","\\@nshortparallel");N(C,V,Y,"∦","\\nparallel",!0);N(C,V,Y,"⊯","\\nVDash",!0);N(C,V,Y,"⋫","\\ntriangleright");N(C,V,Y,"⋭","\\ntrianglerighteq",!0);N(C,V,Y,"","\\@nsupseteqq");N(C,V,Y,"⊋","\\supsetneq",!0);N(C,V,Y,"","\\@varsupsetneq");N(C,V,Y,"⫌","\\supsetneqq",!0);N(C,V,Y,"","\\@varsupsetneqq");N(C,V,Y,"⊮","\\nVdash",!0);N(C,V,Y,"⪵","\\precneqq",!0);N(C,V,Y,"⪶","\\succneqq",!0);N(C,V,Y,"","\\@nsubseteqq");N(C,V,Ie,"⊴","\\unlhd");N(C,V,Ie,"⊵","\\unrhd");N(C,V,Y,"↚","\\nleftarrow",!0);N(C,V,Y,"↛","\\nrightarrow",!0);N(C,V,Y,"⇍","\\nLeftarrow",!0);N(C,V,Y,"⇏","\\nRightarrow",!0);N(C,V,Y,"↮","\\nleftrightarrow",!0);N(C,V,Y,"⇎","\\nLeftrightarrow",!0);N(C,V,Y,"△","\\vartriangle");N(C,V,ne,"ℏ","\\hslash");N(C,V,ne,"▽","\\triangledown");N(C,V,ne,"◊","\\lozenge");N(C,V,ne,"Ⓢ","\\circledS");N(C,V,ne,"®","\\circledR");N(_e,V,ne,"®","\\circledR");N(C,V,ne,"∡","\\measuredangle",!0);N(C,V,ne,"∄","\\nexists");N(C,V,ne,"℧","\\mho");N(C,V,ne,"Ⅎ","\\Finv",!0);N(C,V,ne,"⅁","\\Game",!0);N(C,V,ne,"‵","\\backprime");N(C,V,ne,"▲","\\blacktriangle");N(C,V,ne,"▼","\\blacktriangledown");N(C,V,ne,"■","\\blacksquare");N(C,V,ne,"⧫","\\blacklozenge");N(C,V,ne,"★","\\bigstar");N(C,V,ne,"∢","\\sphericalangle",!0);N(C,V,ne,"∁","\\complement",!0);N(C,V,ne,"ð","\\eth",!0);N(_e,A,ne,"ð","ð");N(C,V,ne,"╱","\\diagup");N(C,V,ne,"╲","\\diagdown");N(C,V,ne,"□","\\square");N(C,V,ne,"□","\\Box");N(C,V,ne,"◊","\\Diamond");N(C,V,ne,"¥","\\yen",!0);N(_e,V,ne,"¥","\\yen",!0);N(C,V,ne,"✓","\\checkmark",!0);N(_e,V,ne,"✓","\\checkmark");N(C,V,ne,"ℶ","\\beth",!0);N(C,V,ne,"ℸ","\\daleth",!0);N(C,V,ne,"ℷ","\\gimel",!0);N(C,V,ne,"ϝ","\\digamma",!0);N(C,V,ne,"ϰ","\\varkappa");N(C,V,ha,"┌","\\@ulcorner",!0);N(C,V,Mr,"┐","\\@urcorner",!0);N(C,V,ha,"└","\\@llcorner",!0);N(C,V,Mr,"┘","\\@lrcorner",!0);N(C,V,Y,"≦","\\leqq",!0);N(C,V,Y,"⩽","\\leqslant",!0);N(C,V,Y,"⪕","\\eqslantless",!0);N(C,V,Y,"≲","\\lesssim",!0);N(C,V,Y,"⪅","\\lessapprox",!0);N(C,V,Y,"≊","\\approxeq",!0);N(C,V,Ie,"⋖","\\lessdot");N(C,V,Y,"⋘","\\lll",!0);N(C,V,Y,"≶","\\lessgtr",!0);N(C,V,Y,"⋚","\\lesseqgtr",!0);N(C,V,Y,"⪋","\\lesseqqgtr",!0);N(C,V,Y,"≑","\\doteqdot");N(C,V,Y,"≓","\\risingdotseq",!0);N(C,V,Y,"≒","\\fallingdotseq",!0);N(C,V,Y,"∽","\\backsim",!0);N(C,V,Y,"⋍","\\backsimeq",!0);N(C,V,Y,"⫅","\\subseteqq",!0);N(C,V,Y,"⋐","\\Subset",!0);N(C,V,Y,"⊏","\\sqsubset",!0);N(C,V,Y,"≼","\\preccurlyeq",!0);N(C,V,Y,"⋞","\\curlyeqprec",!0);N(C,V,Y,"≾","\\precsim",!0);N(C,V,Y,"⪷","\\precapprox",!0);N(C,V,Y,"⊲","\\vartriangleleft");N(C,V,Y,"⊴","\\trianglelefteq");N(C,V,Y,"⊨","\\vDash",!0);N(C,V,Y,"⊪","\\Vvdash",!0);N(C,V,Y,"⌣","\\smallsmile");N(C,V,Y,"⌢","\\smallfrown");N(C,V,Y,"≏","\\bumpeq",!0);N(C,V,Y,"≎","\\Bumpeq",!0);N(C,V,Y,"≧","\\geqq",!0);N(C,V,Y,"⩾","\\geqslant",!0);N(C,V,Y,"⪖","\\eqslantgtr",!0);N(C,V,Y,"≳","\\gtrsim",!0);N(C,V,Y,"⪆","\\gtrapprox",!0);N(C,V,Ie,"⋗","\\gtrdot");N(C,V,Y,"⋙","\\ggg",!0);N(C,V,Y,"≷","\\gtrless",!0);N(C,V,Y,"⋛","\\gtreqless",!0);N(C,V,Y,"⪌","\\gtreqqless",!0);N(C,V,Y,"≖","\\eqcirc",!0);N(C,V,Y,"≗","\\circeq",!0);N(C,V,Y,"≜","\\triangleq",!0);N(C,V,Y,"∼","\\thicksim");N(C,V,Y,"≈","\\thickapprox");N(C,V,Y,"⫆","\\supseteqq",!0);N(C,V,Y,"⋑","\\Supset",!0);N(C,V,Y,"⊐","\\sqsupset",!0);N(C,V,Y,"≽","\\succcurlyeq",!0);N(C,V,Y,"⋟","\\curlyeqsucc",!0);N(C,V,Y,"≿","\\succsim",!0);N(C,V,Y,"⪸","\\succapprox",!0);N(C,V,Y,"⊳","\\vartriangleright");N(C,V,Y,"⊵","\\trianglerighteq");N(C,V,Y,"⊩","\\Vdash",!0);N(C,V,Y,"∣","\\shortmid");N(C,V,Y,"∥","\\shortparallel");N(C,V,Y,"≬","\\between",!0);N(C,V,Y,"⋔","\\pitchfork",!0);N(C,V,Y,"∝","\\varpropto");N(C,V,Y,"◀","\\blacktriangleleft");N(C,V,Y,"∴","\\therefore",!0);N(C,V,Y,"∍","\\backepsilon");N(C,V,Y,"▶","\\blacktriangleright");N(C,V,Y,"∵","\\because",!0);N(C,V,Y,"⋘","\\llless");N(C,V,Y,"⋙","\\gggtr");N(C,V,Ie,"⊲","\\lhd");N(C,V,Ie,"⊳","\\rhd");N(C,V,Y,"≂","\\eqsim",!0);N(C,A,Y,"⋈","\\Join");N(C,V,Y,"≑","\\Doteq",!0);N(C,V,Ie,"∔","\\dotplus",!0);N(C,V,Ie,"∖","\\smallsetminus");N(C,V,Ie,"⋒","\\Cap",!0);N(C,V,Ie,"⋓","\\Cup",!0);N(C,V,Ie,"⩞","\\doublebarwedge",!0);N(C,V,Ie,"⊟","\\boxminus",!0);N(C,V,Ie,"⊞","\\boxplus",!0);N(C,V,Ie,"⋇","\\divideontimes",!0);N(C,V,Ie,"⋉","\\ltimes",!0);N(C,V,Ie,"⋊","\\rtimes",!0);N(C,V,Ie,"⋋","\\leftthreetimes",!0);N(C,V,Ie,"⋌","\\rightthreetimes",!0);N(C,V,Ie,"⋏","\\curlywedge",!0);N(C,V,Ie,"⋎","\\curlyvee",!0);N(C,V,Ie,"⊝","\\circleddash",!0);N(C,V,Ie,"⊛","\\circledast",!0);N(C,V,Ie,"⋅","\\centerdot");N(C,V,Ie,"⊺","\\intercal",!0);N(C,V,Ie,"⋒","\\doublecap");N(C,V,Ie,"⋓","\\doublecup");N(C,V,Ie,"⊠","\\boxtimes",!0);N(C,V,Y,"⇢","\\dashrightarrow",!0);N(C,V,Y,"⇠","\\dashleftarrow",!0);N(C,V,Y,"⇇","\\leftleftarrows",!0);N(C,V,Y,"⇆","\\leftrightarrows",!0);N(C,V,Y,"⇚","\\Lleftarrow",!0);N(C,V,Y,"↞","\\twoheadleftarrow",!0);N(C,V,Y,"↢","\\leftarrowtail",!0);N(C,V,Y,"↫","\\looparrowleft",!0);N(C,V,Y,"⇋","\\leftrightharpoons",!0);N(C,V,Y,"↶","\\curvearrowleft",!0);N(C,V,Y,"↺","\\circlearrowleft",!0);N(C,V,Y,"↰","\\Lsh",!0);N(C,V,Y,"⇈","\\upuparrows",!0);N(C,V,Y,"↿","\\upharpoonleft",!0);N(C,V,Y,"⇃","\\downharpoonleft",!0);N(C,A,Y,"⊶","\\origof",!0);N(C,A,Y,"⊷","\\imageof",!0);N(C,V,Y,"⊸","\\multimap",!0);N(C,V,Y,"↭","\\leftrightsquigarrow",!0);N(C,V,Y,"⇉","\\rightrightarrows",!0);N(C,V,Y,"⇄","\\rightleftarrows",!0);N(C,V,Y,"↠","\\twoheadrightarrow",!0);N(C,V,Y,"↣","\\rightarrowtail",!0);N(C,V,Y,"↬","\\looparrowright",!0);N(C,V,Y,"↷","\\curvearrowright",!0);N(C,V,Y,"↻","\\circlearrowright",!0);N(C,V,Y,"↱","\\Rsh",!0);N(C,V,Y,"⇊","\\downdownarrows",!0);N(C,V,Y,"↾","\\upharpoonright",!0);N(C,V,Y,"⇂","\\downharpoonright",!0);N(C,V,Y,"⇝","\\rightsquigarrow",!0);N(C,V,Y,"⇝","\\leadsto");N(C,V,Y,"⇛","\\Rrightarrow",!0);N(C,V,Y,"↾","\\restriction");N(C,A,ne,"‘","`");N(C,A,ne,"$","\\$");N(_e,A,ne,"$","\\$");N(_e,A,ne,"$","\\textdollar");N(C,A,ne,"%","\\%");N(_e,A,ne,"%","\\%");N(C,A,ne,"_","\\_");N(_e,A,ne,"_","\\_");N(_e,A,ne,"_","\\textunderscore");N(C,A,ne,"∠","\\angle",!0);N(C,A,ne,"∞","\\infty",!0);N(C,A,ne,"′","\\prime");N(C,A,ne,"△","\\triangle");N(C,A,ne,"Γ","\\Gamma",!0);N(C,A,ne,"Δ","\\Delta",!0);N(C,A,ne,"Θ","\\Theta",!0);N(C,A,ne,"Λ","\\Lambda",!0);N(C,A,ne,"Ξ","\\Xi",!0);N(C,A,ne,"Π","\\Pi",!0);N(C,A,ne,"Σ","\\Sigma",!0);N(C,A,ne,"Υ","\\Upsilon",!0);N(C,A,ne,"Φ","\\Phi",!0);N(C,A,ne,"Ψ","\\Psi",!0);N(C,A,ne,"Ω","\\Omega",!0);N(C,A,ne,"A","Α");N(C,A,ne,"B","Β");N(C,A,ne,"E","Ε");N(C,A,ne,"Z","Ζ");N(C,A,ne,"H","Η");N(C,A,ne,"I","Ι");N(C,A,ne,"K","Κ");N(C,A,ne,"M","Μ");N(C,A,ne,"N","Ν");N(C,A,ne,"O","Ο");N(C,A,ne,"P","Ρ");N(C,A,ne,"T","Τ");N(C,A,ne,"X","Χ");N(C,A,ne,"¬","\\neg",!0);N(C,A,ne,"¬","\\lnot");N(C,A,ne,"⊤","\\top");N(C,A,ne,"⊥","\\bot");N(C,A,ne,"∅","\\emptyset");N(C,V,ne,"∅","\\varnothing");N(C,A,Je,"α","\\alpha",!0);N(C,A,Je,"β","\\beta",!0);N(C,A,Je,"γ","\\gamma",!0);N(C,A,Je,"δ","\\delta",!0);N(C,A,Je,"ϵ","\\epsilon",!0);N(C,A,Je,"ζ","\\zeta",!0);N(C,A,Je,"η","\\eta",!0);N(C,A,Je,"θ","\\theta",!0);N(C,A,Je,"ι","\\iota",!0);N(C,A,Je,"κ","\\kappa",!0);N(C,A,Je,"λ","\\lambda",!0);N(C,A,Je,"μ","\\mu",!0);N(C,A,Je,"ν","\\nu",!0);N(C,A,Je,"ξ","\\xi",!0);N(C,A,Je,"ο","\\omicron",!0);N(C,A,Je,"π","\\pi",!0);N(C,A,Je,"ρ","\\rho",!0);N(C,A,Je,"σ","\\sigma",!0);N(C,A,Je,"τ","\\tau",!0);N(C,A,Je,"υ","\\upsilon",!0);N(C,A,Je,"ϕ","\\phi",!0);N(C,A,Je,"χ","\\chi",!0);N(C,A,Je,"ψ","\\psi",!0);N(C,A,Je,"ω","\\omega",!0);N(C,A,Je,"ε","\\varepsilon",!0);N(C,A,Je,"ϑ","\\vartheta",!0);N(C,A,Je,"ϖ","\\varpi",!0);N(C,A,Je,"ϱ","\\varrho",!0);N(C,A,Je,"ς","\\varsigma",!0);N(C,A,Je,"φ","\\varphi",!0);N(C,A,Ie,"∗","*",!0);N(C,A,Ie,"+","+");N(C,A,Ie,"−","-",!0);N(C,A,Ie,"⋅","\\cdot",!0);N(C,A,Ie,"∘","\\circ",!0);N(C,A,Ie,"÷","\\div",!0);N(C,A,Ie,"±","\\pm",!0);N(C,A,Ie,"×","\\times",!0);N(C,A,Ie,"∩","\\cap",!0);N(C,A,Ie,"∪","\\cup",!0);N(C,A,Ie,"∖","\\setminus",!0);N(C,A,Ie,"∧","\\land");N(C,A,Ie,"∨","\\lor");N(C,A,Ie,"∧","\\wedge",!0);N(C,A,Ie,"∨","\\vee",!0);N(C,A,ne,"√","\\surd");N(C,A,ha,"⟨","\\langle",!0);N(C,A,ha,"∣","\\lvert");N(C,A,ha,"∥","\\lVert");N(C,A,Mr,"?","?");N(C,A,Mr,"!","!");N(C,A,Mr,"⟩","\\rangle",!0);N(C,A,Mr,"∣","\\rvert");N(C,A,Mr,"∥","\\rVert");N(C,A,Y,"=","=");N(C,A,Y,":",":");N(C,A,Y,"≈","\\approx",!0);N(C,A,Y,"≅","\\cong",!0);N(C,A,Y,"≥","\\ge");N(C,A,Y,"≥","\\geq",!0);N(C,A,Y,"←","\\gets");N(C,A,Y,">","\\gt",!0);N(C,A,Y,"∈","\\in",!0);N(C,A,Y,"","\\@not");N(C,A,Y,"⊂","\\subset",!0);N(C,A,Y,"⊃","\\supset",!0);N(C,A,Y,"⊆","\\subseteq",!0);N(C,A,Y,"⊇","\\supseteq",!0);N(C,V,Y,"⊈","\\nsubseteq",!0);N(C,V,Y,"⊉","\\nsupseteq",!0);N(C,A,Y,"⊨","\\models");N(C,A,Y,"←","\\leftarrow",!0);N(C,A,Y,"≤","\\le");N(C,A,Y,"≤","\\leq",!0);N(C,A,Y,"<","\\lt",!0);N(C,A,Y,"→","\\rightarrow",!0);N(C,A,Y,"→","\\to");N(C,V,Y,"≱","\\ngeq",!0);N(C,V,Y,"≰","\\nleq",!0);N(C,A,$s," ","\\ ");N(C,A,$s," ","\\space");N(C,A,$s," ","\\nobreakspace");N(_e,A,$s," ","\\ ");N(_e,A,$s," "," ");N(_e,A,$s," ","\\space");N(_e,A,$s," ","\\nobreakspace");N(C,A,$s,null,"\\nobreak");N(C,A,$s,null,"\\allowbreak");N(C,A,Um,",",",");N(C,A,Um,";",";");N(C,V,Ie,"⊼","\\barwedge",!0);N(C,V,Ie,"⊻","\\veebar",!0);N(C,A,Ie,"⊙","\\odot",!0);N(C,A,Ie,"⊕","\\oplus",!0);N(C,A,Ie,"⊗","\\otimes",!0);N(C,A,ne,"∂","\\partial",!0);N(C,A,Ie,"⊘","\\oslash",!0);N(C,V,Ie,"⊚","\\circledcirc",!0);N(C,V,Ie,"⊡","\\boxdot",!0);N(C,A,Ie,"△","\\bigtriangleup");N(C,A,Ie,"▽","\\bigtriangledown");N(C,A,Ie,"†","\\dagger");N(C,A,Ie,"⋄","\\diamond");N(C,A,Ie,"⋆","\\star");N(C,A,Ie,"◃","\\triangleleft");N(C,A,Ie,"▹","\\triangleright");N(C,A,ha,"{","\\{");N(_e,A,ne,"{","\\{");N(_e,A,ne,"{","\\textbraceleft");N(C,A,Mr,"}","\\}");N(_e,A,ne,"}","\\}");N(_e,A,ne,"}","\\textbraceright");N(C,A,ha,"{","\\lbrace");N(C,A,Mr,"}","\\rbrace");N(C,A,ha,"[","\\lbrack",!0);N(_e,A,ne,"[","\\lbrack",!0);N(C,A,Mr,"]","\\rbrack",!0);N(_e,A,ne,"]","\\rbrack",!0);N(C,A,ha,"(","\\lparen",!0);N(C,A,Mr,")","\\rparen",!0);N(_e,A,ne,"<","\\textless",!0);N(_e,A,ne,">","\\textgreater",!0);N(C,A,ha,"⌊","\\lfloor",!0);N(C,A,Mr,"⌋","\\rfloor",!0);N(C,A,ha,"⌈","\\lceil",!0);N(C,A,Mr,"⌉","\\rceil",!0);N(C,A,ne,"\\","\\backslash");N(C,A,ne,"∣","|");N(C,A,ne,"∣","\\vert");N(_e,A,ne,"|","\\textbar",!0);N(C,A,ne,"∥","\\|");N(C,A,ne,"∥","\\Vert");N(_e,A,ne,"∥","\\textbardbl");N(_e,A,ne,"~","\\textasciitilde");N(_e,A,ne,"\\","\\textbackslash");N(_e,A,ne,"^","\\textasciicircum");N(C,A,Y,"↑","\\uparrow",!0);N(C,A,Y,"⇑","\\Uparrow",!0);N(C,A,Y,"↓","\\downarrow",!0);N(C,A,Y,"⇓","\\Downarrow",!0);N(C,A,Y,"↕","\\updownarrow",!0);N(C,A,Y,"⇕","\\Updownarrow",!0);N(C,A,Vn,"∐","\\coprod");N(C,A,Vn,"⋁","\\bigvee");N(C,A,Vn,"⋀","\\bigwedge");N(C,A,Vn,"⨄","\\biguplus");N(C,A,Vn,"⋂","\\bigcap");N(C,A,Vn,"⋃","\\bigcup");N(C,A,Vn,"∫","\\int");N(C,A,Vn,"∫","\\intop");N(C,A,Vn,"∬","\\iint");N(C,A,Vn,"∭","\\iiint");N(C,A,Vn,"∏","\\prod");N(C,A,Vn,"∑","\\sum");N(C,A,Vn,"⨂","\\bigotimes");N(C,A,Vn,"⨁","\\bigoplus");N(C,A,Vn,"⨀","\\bigodot");N(C,A,Vn,"∮","\\oint");N(C,A,Vn,"∯","\\oiint");N(C,A,Vn,"∰","\\oiiint");N(C,A,Vn,"⨆","\\bigsqcup");N(C,A,Vn,"∫","\\smallint");N(_e,A,Jo,"…","\\textellipsis");N(C,A,Jo,"…","\\mathellipsis");N(_e,A,Jo,"…","\\ldots",!0);N(C,A,Jo,"…","\\ldots",!0);N(C,A,Jo,"⋯","\\@cdots",!0);N(C,A,Jo,"⋱","\\ddots",!0);N(C,A,ne,"⋮","\\varvdots");N(_e,A,ne,"⋮","\\varvdots");N(C,A,Nn,"ˊ","\\acute");N(C,A,Nn,"ˋ","\\grave");N(C,A,Nn,"¨","\\ddot");N(C,A,Nn,"~","\\tilde");N(C,A,Nn,"ˉ","\\bar");N(C,A,Nn,"˘","\\breve");N(C,A,Nn,"ˇ","\\check");N(C,A,Nn,"^","\\hat");N(C,A,Nn,"⃗","\\vec");N(C,A,Nn,"˙","\\dot");N(C,A,Nn,"˚","\\mathring");N(C,A,Je,"","\\@imath");N(C,A,Je,"","\\@jmath");N(C,A,ne,"ı","ı");N(C,A,ne,"ȷ","ȷ");N(_e,A,ne,"ı","\\i",!0);N(_e,A,ne,"ȷ","\\j",!0);N(_e,A,ne,"ß","\\ss",!0);N(_e,A,ne,"æ","\\ae",!0);N(_e,A,ne,"œ","\\oe",!0);N(_e,A,ne,"ø","\\o",!0);N(_e,A,ne,"Æ","\\AE",!0);N(_e,A,ne,"Œ","\\OE",!0);N(_e,A,ne,"Ø","\\O",!0);N(_e,A,Nn,"ˊ","\\'");N(_e,A,Nn,"ˋ","\\`");N(_e,A,Nn,"ˆ","\\^");N(_e,A,Nn,"˜","\\~");N(_e,A,Nn,"ˉ","\\=");N(_e,A,Nn,"˘","\\u");N(_e,A,Nn,"˙","\\.");N(_e,A,Nn,"¸","\\c");N(_e,A,Nn,"˚","\\r");N(_e,A,Nn,"ˇ","\\v");N(_e,A,Nn,"¨",'\\"');N(_e,A,Nn,"˝","\\H");N(_e,A,Nn,"◯","\\textcircled");var d8={"--":!0,"---":!0,"``":!0,"''":!0};N(_e,A,ne,"–","--",!0);N(_e,A,ne,"–","\\textendash");N(_e,A,ne,"—","---",!0);N(_e,A,ne,"—","\\textemdash");N(_e,A,ne,"‘","`",!0);N(_e,A,ne,"‘","\\textquoteleft");N(_e,A,ne,"’","'",!0);N(_e,A,ne,"’","\\textquoteright");N(_e,A,ne,"“","``",!0);N(_e,A,ne,"“","\\textquotedblleft");N(_e,A,ne,"”","''",!0);N(_e,A,ne,"”","\\textquotedblright");N(C,A,ne,"°","\\degree",!0);N(_e,A,ne,"°","\\degree");N(_e,A,ne,"°","\\textdegree",!0);N(C,A,ne,"£","\\pounds");N(C,A,ne,"£","\\mathsterling",!0);N(_e,A,ne,"£","\\pounds");N(_e,A,ne,"£","\\textsterling",!0);N(C,V,ne,"✠","\\maltese");N(_e,V,ne,"✠","\\maltese");var C3='0123456789/@."';for(var Wp=0;Wp0)return La(o,f,l,n,c.concat(p));if(m){var x,y;if(m==="boldsymbol"){var b=$I(o,l,n,c,a);x=b.fontName,y=[b.fontClass]}else d?(x=f8[m].fontName,y=[m]):(x=E0(m,n.fontWeight,n.fontShape),y=[m,n.fontWeight,n.fontShape]);if($m(o,x,l).metrics)return La(o,x,l,n,c.concat(y));if(d8.hasOwnProperty(o)&&x.slice(0,10)==="Typewriter"){for(var j=[],k=0;k{if(_l(e.classes)!==_l(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a in e.style)if(e.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;for(var l in t.style)if(t.style.hasOwnProperty(l)&&e.style[l]!==t.style[l])return!1;return!0},YI=e=>{for(var t=0;tn&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>l&&(l=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=l},qr=function(t,n,a,l){var o=new Yu(t,n,a,l);return cg(o),o},m8=(e,t,n,a)=>new Yu(e,t,n,a),WI=function(t,n,a){var l=qr([t],[],n);return l.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),l.style.borderBottomWidth=Re(l.height),l.maxFontSize=1,l},XI=function(t,n,a,l){var o=new og(t,n,a,l);return cg(o),o},h8=function(t){var n=new Gu(t);return cg(n),n},KI=function(t,n){return t instanceof Gu?qr([],[t],n):t},QI=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],l=-n[0].shift-n[0].elem.depth,o=l,c=1;c{var n=qr(["mspace"],[],t),a=_n(e,t);return n.style.marginRight=Re(a),n},E0=function(t,n,a){var l="";switch(t){case"amsrm":l="AMS";break;case"textrm":l="Main";break;case"textsf":l="SansSerif";break;case"texttt":l="Typewriter";break;default:l=t}var o;return n==="textbf"&&a==="textit"?o="BoldItalic":n==="textbf"?o="Bold":n==="textit"?o="Italic":o="Regular",l+"-"+o},f8={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},p8={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},eq=function(t,n){var[a,l,o]=p8[t],c=new Ml(a),d=new Fs([c],{width:Re(l),height:Re(o),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),m=m8(["overlay"],[d],n);return m.height=o,m.style.height=Re(o),m.style.width=Re(l),m},ue={fontMap:f8,makeSymbol:La,mathsym:UI,makeSpan:qr,makeSvgSpan:m8,makeLineSpan:WI,makeAnchor:XI,makeFragment:h8,wrapFragment:KI,makeVList:ZI,makeOrd:VI,makeGlue:JI,staticSvg:eq,svgData:p8,tryCombineChars:YI},Cn={number:3,unit:"mu"},li={number:4,unit:"mu"},Ms={number:5,unit:"mu"},tq={mord:{mop:Cn,mbin:li,mrel:Ms,minner:Cn},mop:{mord:Cn,mop:Cn,mrel:Ms,minner:Cn},mbin:{mord:li,mop:li,mopen:li,minner:li},mrel:{mord:Ms,mop:Ms,mopen:Ms,minner:Ms},mopen:{},mclose:{mop:Cn,mbin:li,mrel:Ms,minner:Cn},mpunct:{mord:Cn,mop:Cn,mrel:Ms,mopen:Cn,mclose:Cn,mpunct:Cn,minner:Cn},minner:{mord:Cn,mop:Cn,mbin:li,mrel:Ms,mopen:Cn,mpunct:Cn,minner:Cn}},nq={mord:{mop:Cn},mop:{mord:Cn,mop:Cn},mbin:{},mrel:{},mopen:{},mclose:{mop:Cn},mpunct:{},minner:{mop:Cn}},x8={},hm={},fm={};function Le(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:l},m=0;m{var S=k.classes[0],_=j.classes[0];S==="mbin"&&aq.includes(_)?k.classes[0]="mord":_==="mbin"&&rq.includes(S)&&(j.classes[0]="mord")},{node:x},y,b),A3(o,(j,k)=>{var S=Yx(k),_=Yx(j),M=S&&_?j.hasClass("mtight")?nq[S][_]:tq[S][_]:null;if(M)return ue.makeGlue(M,f)},{node:x},y,b),o},A3=function e(t,n,a,l,o){l&&t.push(l);for(var c=0;cy=>{t.splice(x+1,0,y),c++})(c)}l&&t.pop()},g8=function(t){return t instanceof Gu||t instanceof og||t instanceof Yu&&t.hasClass("enclosing")?t:null},iq=function e(t,n){var a=g8(t);if(a){var l=a.children;if(l.length){if(n==="right")return e(l[l.length-1],"right");if(n==="left")return e(l[0],"left")}}return t},Yx=function(t,n){return t?(n&&(t=iq(t,n)),lq[t.classes[0]]||null):null},wu=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Is(n.concat(a))},Pt=function(t,n,a){if(!t)return Is();if(hm[t.type]){var l=hm[t.type](t,n);if(a&&n.size!==a.size){l=Is(n.sizingClasses(a),[l],n);var o=n.sizeMultiplier/a.sizeMultiplier;l.height*=o,l.depth*=o}return l}else throw new Ae("Got group of unknown type: '"+t.type+"'")};function A0(e,t){var n=Is(["base"],e,t),a=Is(["strut"]);return a.style.height=Re(n.height+n.depth),n.depth&&(a.style.verticalAlign=Re(-n.depth)),n.children.unshift(a),n}function Wx(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Kn(e,t,"root"),l;a.length===2&&a[1].hasClass("tag")&&(l=a.pop());for(var o=[],c=[],d=0;d0&&(o.push(A0(c,t)),c=[]),o.push(a[d]));c.length>0&&o.push(A0(c,t));var f;n?(f=A0(Kn(n,t,!0)),f.classes=["tag"],o.push(f)):l&&o.push(l);var p=Is(["katex-html"],o);if(p.setAttribute("aria-hidden","true"),f){var x=f.children[0];x.style.height=Re(p.height+p.depth),p.depth&&(x.style.verticalAlign=Re(-p.depth))}return p}function v8(e){return new Gu(e)}class ca{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=_l(this.classes));for(var a=0;a0&&(t+=' class ="'+Ht.escape(_l(this.classes))+'"'),t+=">";for(var a=0;a",t}toText(){return this.children.map(t=>t.toText()).join("")}}class ts{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ht.escape(this.toText())}toText(){return this.text}}class oq{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Re(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Ee={MathNode:ca,TextNode:ts,SpaceNode:oq,newDocumentFragment:v8},Ea=function(t,n,a){return yn[n][t]&&yn[n][t].replace&&t.charCodeAt(0)!==55349&&!(d8.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=yn[n][t].replace),new Ee.TextNode(t)},ug=function(t){return t.length===1?t[0]:new Ee.MathNode("mrow",t)},dg=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var a=n.font;if(!a||a==="mathnormal")return null;var l=t.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathsfit")return"sans-serif-italic";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var o=t.text;if(["\\imath","\\jmath"].includes(o))return null;yn[l][o]&&yn[l][o].replace&&(o=yn[l][o].replace);var c=ue.fontMap[a].fontName;return ig(o,c,l)?ue.fontMap[a].variant:null};function Zp(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof ts&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof ts&&n.text===","}else return!1}var Qr=function(t,n,a){if(t.length===1){var l=fn(t[0],n);return a&&l instanceof ca&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}for(var o=[],c,d=0;d=1&&(c.type==="mn"||Zp(c))){var f=m.children[0];f instanceof ca&&f.type==="mn"&&(f.children=[...c.children,...f.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof ts&&p.text==="̸"&&(m.type==="mo"||m.type==="mi"||m.type==="mn")){var x=m.children[0];x instanceof ts&&x.text.length>0&&(x.text=x.text.slice(0,1)+"̸"+x.text.slice(1),o.pop())}}}o.push(m),c=m}return o},El=function(t,n,a){return ug(Qr(t,n,a))},fn=function(t,n){if(!t)return new Ee.MathNode("mrow");if(fm[t.type]){var a=fm[t.type](t,n);return a}else throw new Ae("Got group of unknown type: '"+t.type+"'")};function D3(e,t,n,a,l){var o=Qr(e,n),c;o.length===1&&o[0]instanceof ca&&["mrow","mtable"].includes(o[0].type)?c=o[0]:c=new Ee.MathNode("mrow",o);var d=new Ee.MathNode("annotation",[new Ee.TextNode(t)]);d.setAttribute("encoding","application/x-tex");var m=new Ee.MathNode("semantics",[c,d]),f=new Ee.MathNode("math",[m]);f.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&f.setAttribute("display","block");var p=l?"katex":"katex-mathml";return ue.makeSpan([p],[f])}var y8=function(t){return new As({style:t.displayMode?tt.DISPLAY:tt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},b8=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=ue.makeSpan(a,[t])}return t},cq=function(t,n,a){var l=y8(a),o;if(a.output==="mathml")return D3(t,n,l,a.displayMode,!0);if(a.output==="html"){var c=Wx(t,l);o=ue.makeSpan(["katex"],[c])}else{var d=D3(t,n,l,a.displayMode,!1),m=Wx(t,l);o=ue.makeSpan(["katex"],[d,m])}return b8(o,a)},uq=function(t,n,a){var l=y8(a),o=Wx(t,l),c=ue.makeSpan(["katex"],[o]);return b8(c,a)},dq={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},mq=function(t){var n=new Ee.MathNode("mo",[new Ee.TextNode(dq[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},hq={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},fq=function(t){return t.type==="ordgroup"?t.body.length:1},pq=function(t,n){function a(){var d=4e5,m=t.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(m)){var f=t,p=fq(f.base),x,y,b;if(p>5)m==="widehat"||m==="widecheck"?(x=420,d=2364,b=.42,y=m+"4"):(x=312,d=2340,b=.34,y="tilde4");else{var j=[1,1,2,2,3,3][p];m==="widehat"||m==="widecheck"?(d=[0,1062,2364,2364,2364][j],x=[0,239,300,360,420][j],b=[0,.24,.3,.3,.36,.42][j],y=m+j):(d=[0,600,1033,2339,2340][j],x=[0,260,286,306,312][j],b=[0,.26,.286,.3,.306,.34][j],y="tilde"+j)}var k=new Ml(y),S=new Fs([k],{width:"100%",height:Re(b),viewBox:"0 0 "+d+" "+x,preserveAspectRatio:"none"});return{span:ue.makeSvgSpan([],[S],n),minWidth:0,height:b}}else{var _=[],M=hq[m],[D,z,L]=M,E=L/1e3,R=D.length,H,$;if(R===1){var I=M[3];H=["hide-tail"],$=[I]}else if(R===2)H=["halfarrow-left","halfarrow-right"],$=["xMinYMin","xMaxYMin"];else if(R===3)H=["brace-left","brace-center","brace-right"],$=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+R+" children.");for(var G=0;G0&&(l.style.minWidth=Re(o)),l},xq=function(t,n,a,l,o){var c,d=t.height+t.depth+a+l;if(/fbox|color|angl/.test(n)){if(c=ue.makeSpan(["stretchy",n],[],o),n==="fbox"){var m=o.color&&o.getColor();m&&(c.style.borderColor=m)}}else{var f=[];/^[bx]cancel$/.test(n)&&f.push(new Vx({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&f.push(new Vx({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new Fs(f,{width:"100%",height:Re(d)});c=ue.makeSvgSpan([],[p],o)}return c.height=d,c.style.height=Re(d),c},qs={encloseSpan:xq,mathMLnode:mq,svgSpan:pq};function vt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function mg(e){var t=Vm(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Vm(e){return e&&(e.type==="atom"||qI.hasOwnProperty(e.type))?e:null}var hg=(e,t)=>{var n,a,l;e&&e.type==="supsub"?(a=vt(e.base,"accent"),n=a.base,e.base=n,l=FI(Pt(e,t)),e.base=a):(a=vt(e,"accent"),n=a.base);var o=Pt(n,t.havingCrampedStyle()),c=a.isShifty&&Ht.isCharacterBox(n),d=0;if(c){var m=Ht.getBaseElem(n),f=Pt(m,t.havingCrampedStyle());d=k3(f).skew}var p=a.label==="\\c",x=p?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),y;if(a.isStretchy)y=qs.svgSpan(a,t),y=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:y,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+Re(2*d)+")",marginLeft:Re(2*d)}:void 0}]},t);else{var b,j;a.label==="\\vec"?(b=ue.staticSvg("vec",t),j=ue.svgData.vec[1]):(b=ue.makeOrd({mode:a.mode,text:a.label},t,"textord"),b=k3(b),b.italic=0,j=b.width,p&&(x+=b.depth)),y=ue.makeSpan(["accent-body"],[b]);var k=a.label==="\\textcircled";k&&(y.classes.push("accent-full"),x=o.height);var S=d;k||(S-=j/2),y.style.left=Re(S),a.label==="\\textcircled"&&(y.style.top=".2em"),y=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-x},{type:"elem",elem:y}]},t)}var _=ue.makeSpan(["mord","accent"],[y],t);return l?(l.children[0]=_,l.height=Math.max(_.height,l.height),l.classes[0]="mord",l):_},w8=(e,t)=>{var n=e.isStretchy?qs.mathMLnode(e.label):new Ee.MathNode("mo",[Ea(e.label,e.mode)]),a=new Ee.MathNode("mover",[fn(e.base,t),n]);return a.setAttribute("accent","true"),a},gq=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Le({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=pm(t[0]),a=!gq.test(e.funcName),l=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:l,base:n}},htmlBuilder:hg,mathmlBuilder:w8});Le({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:hg,mathmlBuilder:w8});Le({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:l}},htmlBuilder:(e,t)=>{var n=Pt(e.base,t),a=qs.svgSpan(e,t),l=e.label==="\\utilde"?.12:0,o=ue.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:n}]},t);return ue.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=qs.mathMLnode(e.label),a=new Ee.MathNode("munder",[fn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var D0=e=>{var t=new Ee.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Le({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:l}=e;return{type:"xArrow",mode:a.mode,label:l,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),l=ue.wrapFragment(Pt(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=ue.wrapFragment(Pt(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var d=qs.svgSpan(e,t),m=-t.fontMetrics().axisHeight+.5*d.height,f=-t.fontMetrics().axisHeight-.5*d.height-.111;(l.depth>.25||e.label==="\\xleftequilibrium")&&(f-=l.depth);var p;if(c){var x=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:f},{type:"elem",elem:d,shift:m},{type:"elem",elem:c,shift:x}]},t)}else p=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:f},{type:"elem",elem:d,shift:m}]},t);return p.children[0].children[0].children[1].classes.push("svg-align"),ue.makeSpan(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=qs.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var l=D0(fn(e.body,t));if(e.below){var o=D0(fn(e.below,t));a=new Ee.MathNode("munderover",[n,o,l])}else a=new Ee.MathNode("mover",[n,l])}else if(e.below){var c=D0(fn(e.below,t));a=new Ee.MathNode("munder",[n,c])}else a=D0(),a=new Ee.MathNode("mover",[n,a]);return a}});var vq=ue.makeSpan;function j8(e,t){var n=Kn(e.body,t,!0);return vq([e.mclass],n,t)}function N8(e,t){var n,a=Qr(e.body,t);return e.mclass==="minner"?n=new Ee.MathNode("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Ee.MathNode("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Ee.MathNode("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Le({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Rn(l),isCharacterBox:Ht.isCharacterBox(l)}},htmlBuilder:j8,mathmlBuilder:N8});var Gm=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Le({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Gm(t[0]),body:Rn(t[1]),isCharacterBox:Ht.isCharacterBox(t[1])}}});Le({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,l=t[1],o=t[0],c;a!=="\\stackrel"?c=Gm(l):c="mrel";var d={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Rn(l)},m={type:"supsub",mode:o.mode,base:d,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[m],isCharacterBox:Ht.isCharacterBox(m)}},htmlBuilder:j8,mathmlBuilder:N8});Le({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Gm(t[0]),body:Rn(t[0])}},htmlBuilder(e,t){var n=Kn(e.body,t,!0),a=ue.makeSpan([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Qr(e.body,t),a=new Ee.MathNode("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var yq={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},z3=()=>({type:"styling",body:[],mode:"math",style:"display"}),O3=e=>e.type==="textord"&&e.text==="@",bq=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function wq(e,t,n){var a=yq[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var l=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),m={type:"ordgroup",mode:"math",body:[l,c,d]};return n.callFunction("\\\\cdparent",[m],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var f={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[f],[])}default:return{type:"textord",text:" ",mode:"math"}}}function jq(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Ae("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],l=[a],o=0;o-1))if("<>AV".indexOf(f)>-1)for(var x=0;x<2;x++){for(var y=!0,b=m+1;bAV=|." after @',c[m]);var j=wq(f,p,e),k={type:"styling",body:[j],mode:"math",style:"display"};a.push(k),d=z3()}o%2===0?a.push(d):a.shift(),a=[],l.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var S=new Array(l[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:l,arraystretch:1,addJot:!0,rowGaps:[null],cols:S,colSeparationType:"CD",hLinesBeforeRow:new Array(l.length+1).fill([])}}Le({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=ue.wrapFragment(Pt(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Re(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Ee.MathNode("mrow",[fn(e.label,t)]);return n=new Ee.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Ee.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Le({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=ue.wrapFragment(Pt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Ee.MathNode("mrow",[fn(e.fragment,t)])}});Le({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=vt(t[0],"ordgroup"),l=a.body,o="",c=0;c=1114111)throw new Ae("\\@char with invalid code point "+o);return m<=65535?f=String.fromCharCode(m):(m-=65536,f=String.fromCharCode((m>>10)+55296,(m&1023)+56320)),{type:"textord",mode:n.mode,text:f}}});var S8=(e,t)=>{var n=Kn(e.body,t.withColor(e.color),!1);return ue.makeFragment(n)},k8=(e,t)=>{var n=Qr(e.body,t.withColor(e.color)),a=new Ee.MathNode("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Le({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=vt(t[0],"color-token").color,l=t[1];return{type:"color",mode:n.mode,color:a,body:Rn(l)}},htmlBuilder:S8,mathmlBuilder:k8});Le({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,l=vt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",l);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:l,body:o}},htmlBuilder:S8,mathmlBuilder:k8});Le({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,l=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:l&&vt(l,"size").value}},htmlBuilder(e,t){var n=ue.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Re(_n(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ee.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Re(_n(e.size,t)))),n}});var Xx={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},C8=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ae("Expected a control sequence",e);return t},Nq=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},T8=(e,t,n,a)=>{var l=e.gullet.macros.get(n.text);l==null&&(n.noexpand=!0,l={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,l,a)};Le({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(Xx[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Xx[a.text]),vt(t.parseFunction(),"internal");throw new Ae("Invalid token after macro prefix",a)}});Le({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),l=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(l))throw new Ae("Expected a control sequence",a);for(var o=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Ae('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Ae('Argument number "'+a.text+'" out of order');o++,d.push([])}else{if(a.text==="EOF")throw new Ae("Expected a macro definition");d[o].push(a.text)}var{tokens:m}=t.gullet.consumeArg();return c&&m.unshift(c),(n==="\\edef"||n==="\\xdef")&&(m=t.gullet.expandTokens(m),m.reverse()),t.gullet.macros.set(l,{tokens:m,numArgs:o,delimiters:d},n===Xx[n]),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=C8(t.gullet.popToken());t.gullet.consumeSpaces();var l=Nq(t);return T8(t,a,l,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=C8(t.gullet.popToken()),l=t.gullet.popToken(),o=t.gullet.popToken();return T8(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(l),{type:"internal",mode:t.mode}}});var nu=function(t,n,a){var l=yn.math[t]&&yn.math[t].replace,o=ig(l||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},fg=function(t,n,a,l){var o=a.havingBaseStyle(n),c=ue.makeSpan(l.concat(o.sizingClasses(a)),[t],a),d=o.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=o.sizeMultiplier,c},_8=function(t,n,a){var l=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/l.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Re(o),t.height-=o,t.depth+=o},Sq=function(t,n,a,l,o,c){var d=ue.makeSymbol(t,"Main-Regular",o,l),m=fg(d,n,l,c);return a&&_8(m,l,n),m},kq=function(t,n,a,l){return ue.makeSymbol(t,"Size"+n+"-Regular",a,l)},M8=function(t,n,a,l,o,c){var d=kq(t,n,o,l),m=fg(ue.makeSpan(["delimsizing","size"+n],[d],l),tt.TEXT,l,c);return a&&_8(m,l,tt.TEXT),m},Jp=function(t,n,a){var l;n==="Size1-Regular"?l="delim-size1":l="delim-size4";var o=ue.makeSpan(["delimsizinginner",l],[ue.makeSpan([],[ue.makeSymbol(t,n,a)])]);return{type:"elem",elem:o}},ex=function(t,n,a){var l=es["Size4-Regular"][t.charCodeAt(0)]?es["Size4-Regular"][t.charCodeAt(0)][4]:es["Size1-Regular"][t.charCodeAt(0)][4],o=new Ml("inner",EI(t,Math.round(1e3*n))),c=new Fs([o],{width:Re(l),height:Re(n),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=ue.makeSvgSpan([],[c],a);return d.height=n,d.style.height=Re(n),d.style.width=Re(l),{type:"elem",elem:d}},Kx=.008,z0={type:"kern",size:-1*Kx},Cq=["|","\\lvert","\\rvert","\\vert"],Tq=["\\|","\\lVert","\\rVert","\\Vert"],E8=function(t,n,a,l,o,c){var d,m,f,p,x="",y=0;d=f=p=t,m=null;var b="Size1-Regular";t==="\\uparrow"?f=p="⏐":t==="\\Uparrow"?f=p="‖":t==="\\downarrow"?d=f="⏐":t==="\\Downarrow"?d=f="‖":t==="\\updownarrow"?(d="\\uparrow",f="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",f="‖",p="\\Downarrow"):Cq.includes(t)?(f="∣",x="vert",y=333):Tq.includes(t)?(f="∥",x="doublevert",y=556):t==="["||t==="\\lbrack"?(d="⎡",f="⎢",p="⎣",b="Size4-Regular",x="lbrack",y=667):t==="]"||t==="\\rbrack"?(d="⎤",f="⎥",p="⎦",b="Size4-Regular",x="rbrack",y=667):t==="\\lfloor"||t==="⌊"?(f=d="⎢",p="⎣",b="Size4-Regular",x="lfloor",y=667):t==="\\lceil"||t==="⌈"?(d="⎡",f=p="⎢",b="Size4-Regular",x="lceil",y=667):t==="\\rfloor"||t==="⌋"?(f=d="⎥",p="⎦",b="Size4-Regular",x="rfloor",y=667):t==="\\rceil"||t==="⌉"?(d="⎤",f=p="⎥",b="Size4-Regular",x="rceil",y=667):t==="("||t==="\\lparen"?(d="⎛",f="⎜",p="⎝",b="Size4-Regular",x="lparen",y=875):t===")"||t==="\\rparen"?(d="⎞",f="⎟",p="⎠",b="Size4-Regular",x="rparen",y=875):t==="\\{"||t==="\\lbrace"?(d="⎧",m="⎨",p="⎩",f="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",m="⎬",p="⎭",f="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",f="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",f="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",f="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",f="⎪",b="Size4-Regular");var j=nu(d,b,o),k=j.height+j.depth,S=nu(f,b,o),_=S.height+S.depth,M=nu(p,b,o),D=M.height+M.depth,z=0,L=1;if(m!==null){var E=nu(m,b,o);z=E.height+E.depth,L=2}var R=k+D+z,H=Math.max(0,Math.ceil((n-R)/(L*_))),$=R+H*L*_,I=l.fontMetrics().axisHeight;a&&(I*=l.sizeMultiplier);var G=$/2-I,te=[];if(x.length>0){var we=$-k-D,J=Math.round($*1e3),ae=AI(x,Math.round(we*1e3)),U=new Ml(x,ae),q=(y/1e3).toFixed(3)+"em",W=(J/1e3).toFixed(3)+"em",oe=new Fs([U],{width:q,height:W,viewBox:"0 0 "+y+" "+J}),P=ue.makeSvgSpan([],[oe],l);P.height=J/1e3,P.style.width=q,P.style.height=W,te.push({type:"elem",elem:P})}else{if(te.push(Jp(p,b,o)),te.push(z0),m===null){var je=$-k-D+2*Kx;te.push(ex(f,je,l))}else{var Z=($-k-D-z)/2+2*Kx;te.push(ex(f,Z,l)),te.push(z0),te.push(Jp(m,b,o)),te.push(z0),te.push(ex(f,Z,l))}te.push(z0),te.push(Jp(d,b,o))}var O=l.havingBaseStyle(tt.TEXT),Ne=ue.makeVList({positionType:"bottom",positionData:G,children:te},O);return fg(ue.makeSpan(["delimsizing","mult"],[Ne],O),tt.TEXT,l,c)},tx=80,nx=.08,rx=function(t,n,a,l,o){var c=MI(t,l,a),d=new Ml(t,c),m=new Fs([d],{width:"400em",height:Re(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return ue.makeSvgSpan(["hide-tail"],[m],o)},_q=function(t,n){var a=n.havingBaseSizing(),l=O8("\\surd",t*a.sizeMultiplier,z8,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,m=0,f=0,p=0,x;return l.type==="small"?(p=1e3+1e3*c+tx,t<1?o=1:t<1.4&&(o=.7),m=(1+c+nx)/o,f=(1+c)/o,d=rx("sqrtMain",m,p,c,n),d.style.minWidth="0.853em",x=.833/o):l.type==="large"?(p=(1e3+tx)*du[l.size],f=(du[l.size]+c)/o,m=(du[l.size]+c+nx)/o,d=rx("sqrtSize"+l.size,m,p,c,n),d.style.minWidth="1.02em",x=1/o):(m=t+c+nx,f=t+c,p=Math.floor(1e3*t+c)+tx,d=rx("sqrtTall",m,p,c,n),d.style.minWidth="0.742em",x=1.056),d.height=f,d.style.height=Re(m),{span:d,advanceWidth:x,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},A8=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Mq=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],D8=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],du=[0,1.2,1.8,2.4,3],Eq=function(t,n,a,l,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),A8.includes(t)||D8.includes(t))return M8(t,n,!1,a,l,o);if(Mq.includes(t))return E8(t,du[n],!1,a,l,o);throw new Ae("Illegal delimiter: '"+t+"'")},Aq=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Dq=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"stack"}],z8=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],zq=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},O8=function(t,n,a,l){for(var o=Math.min(2,3-l.style.size),c=o;cn)return a[c]}return a[a.length-1]},R8=function(t,n,a,l,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;D8.includes(t)?d=Aq:A8.includes(t)?d=z8:d=Dq;var m=O8(t,n,d,l);return m.type==="small"?Sq(t,m.style,a,l,o,c):m.type==="large"?M8(t,m.size,a,l,o,c):E8(t,n,a,l,o,c)},Oq=function(t,n,a,l,o,c){var d=l.fontMetrics().axisHeight*l.sizeMultiplier,m=901,f=5/l.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),x=Math.max(p/500*m,2*p-f);return R8(t,x,!0,l,o,c)},Bs={sqrtImage:_q,sizedDelim:Eq,sizeToMaxHeight:du,customSizedDelim:R8,leftRightDelim:Oq},R3={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Rq=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ym(e,t){var n=Vm(e);if(n&&Rq.includes(n.text))return n;throw n?new Ae("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ae("Invalid delimiter type '"+e.type+"'",e)}Le({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Ym(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:R3[e.funcName].size,mclass:R3[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?ue.makeSpan([e.mclass]):Bs.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Ea(e.delim,e.mode));var n=new Ee.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Re(Bs.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function B3(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Le({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Ae("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ym(t[0],e).text,color:n}}});Le({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ym(t[0],e),a=e.parser;++a.leftrightDepth;var l=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=vt(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:l,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{B3(e);for(var n=Kn(e.body,t,!0,["mopen","mclose"]),a=0,l=0,o=!1,c=0;c{B3(e);var n=Qr(e.body,t);if(e.left!=="."){var a=new Ee.MathNode("mo",[Ea(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var l=new Ee.MathNode("mo",[Ea(e.right,e.mode)]);l.setAttribute("fence","true"),e.rightColor&&l.setAttribute("mathcolor",e.rightColor),n.push(l)}return ug(n)}});Le({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ym(t[0],e);if(!e.parser.leftrightDepth)throw new Ae("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=wu(t,[]);else{n=Bs.sizedDelim(e.delim,1,t,e.mode,[]);var a={delim:e.delim,options:t};n.isMiddle=a}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Ea("|","text"):Ea(e.delim,e.mode),a=new Ee.MathNode("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var pg=(e,t)=>{var n=ue.wrapFragment(Pt(e.body,t),t),a=e.label.slice(1),l=t.sizeMultiplier,o,c=0,d=Ht.isCharacterBox(e.body);if(a==="sout")o=ue.makeSpan(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/l,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var m=_n({number:.6,unit:"pt"},t),f=_n({number:.35,unit:"ex"},t),p=t.havingBaseSizing();l=l/p.sizeMultiplier;var x=n.height+n.depth+m+f;n.style.paddingLeft=Re(x/2+m);var y=Math.floor(1e3*x*l),b=TI(y),j=new Fs([new Ml("phase",b)],{width:"400em",height:Re(y/1e3),viewBox:"0 0 400000 "+y,preserveAspectRatio:"xMinYMin slice"});o=ue.makeSvgSpan(["hide-tail"],[j],t),o.style.height=Re(x),c=n.depth+m+f}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var k=0,S=0,_=0;/box/.test(a)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),k=t.fontMetrics().fboxsep+(a==="colorbox"?0:_),S=k):a==="angl"?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),k=4*_,S=Math.max(0,.25-n.depth)):(k=d?.2:0,S=k),o=qs.encloseSpan(n,a,k,S,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Re(_)):a==="angl"&&_!==.049&&(o.style.borderTopWidth=Re(_),o.style.borderRightWidth=Re(_)),c=n.depth+S,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]},t);else{var D=/cancel|phase/.test(a)?["svg-align"]:[];M=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:D}]},t)}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!d?ue.makeSpan(["mord","cancel-lap"],[M],t):ue.makeSpan(["mord"],[M],t)},xg=(e,t)=>{var n=0,a=new Ee.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[fn(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var l=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+l+"em solid "+String(e.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Le({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=vt(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:l,backgroundColor:o,body:c}},htmlBuilder:pg,mathmlBuilder:xg});Le({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=vt(t[0],"color-token").color,c=vt(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:l,backgroundColor:c,borderColor:o,body:d}},htmlBuilder:pg,mathmlBuilder:xg});Le({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Le({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:pg,mathmlBuilder:xg});Le({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var B8={};function ls(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:l},m=0;m{var t=e.parser.settings;if(!t.displayMode)throw new Ae("{"+e.envName+"} can be used only in display mode.")};function gg(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function Bl(e,t,n){var{hskipBeforeAndAfter:a,addJot:l,cols:o,arraystretch:c,colSeparationType:d,autoTag:m,singleRow:f,emptySingleRow:p,maxNumCols:x,leqno:y}=t;if(e.gullet.beginGroup(),f||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)c=1;else if(c=parseFloat(b),!c||c<0)throw new Ae("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var j=[],k=[j],S=[],_=[],M=m!=null?[]:void 0;function D(){m&&e.gullet.macros.set("\\@eqnsw","1",!0)}function z(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new da("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!m&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(D(),_.push(L3(e));;){var L=e.parseExpression(!1,f?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),L={type:"ordgroup",mode:e.mode,body:L},n&&(L={type:"styling",mode:e.mode,style:n,body:[L]}),j.push(L);var E=e.fetch().text;if(E==="&"){if(x&&j.length===x){if(f||d)throw new Ae("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(E==="\\end"){z(),j.length===1&&L.type==="styling"&&L.body[0].body.length===0&&(k.length>1||!p)&&k.pop(),_.length0&&(D+=.25),f.push({pos:D,isDashed:Qe[Gn]})}for(z(c[0]),a=0;a0&&(G+=M,RQe))for(a=0;a=d)){var ye=void 0;(l>0||t.hskipBeforeAndAfter)&&(ye=Ht.deflt(Z.pregap,y),ye!==0&&(ae=ue.makeSpan(["arraycolsep"],[]),ae.style.width=Re(ye),J.push(ae)));var Be=[];for(a=0;a0){for(var ve=ue.makeLineSpan("hline",n,p),Ze=ue.makeLineSpan("hdashline",n,p),We=[{type:"elem",elem:m,shift:0}];f.length>0;){var pn=f.pop(),Bn=pn.pos-te;pn.isDashed?We.push({type:"elem",elem:Ze,shift:Bn}):We.push({type:"elem",elem:ve,shift:Bn})}m=ue.makeVList({positionType:"individualShift",children:We},n)}if(q.length===0)return ue.makeSpan(["mord"],[m],n);var sr=ue.makeVList({positionType:"individualShift",children:q},n);return sr=ue.makeSpan(["tag"],[sr],n),ue.makeFragment([m,sr])},Bq={c:"center ",l:"left ",r:"right "},os=function(t,n){for(var a=[],l=new Ee.MathNode("mtd",[],["mtr-glue"]),o=new Ee.MathNode("mtd",[],["mml-eqn-num"]),c=0;c0){var j=t.cols,k="",S=!1,_=0,M=j.length;j[0].type==="separator"&&(y+="top ",_=1),j[j.length-1].type==="separator"&&(y+="bottom ",M-=1);for(var D=_;D0?"left ":"",y+=H[H.length-1].length>0?"right ":"";for(var $=1;$-1?"alignat":"align",o=t.envName==="split",c=Bl(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:gg(t.envName),emptySingleRow:!0,colSeparationType:l,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),d,m=0,f={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",x=0;x0&&b&&(S=1),a[j]={type:"align",align:k,pregap:S,postgap:0}}return c.colSeparationType=b?"align":"alignat",c};ls({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Vm(t[0]),a=n?[t[0]]:vt(t[0],"ordgroup").body,l=a.map(function(c){var d=mg(c),m=d.text;if("lcr".indexOf(m)!==-1)return{type:"align",align:m};if(m==="|")return{type:"separator",separator:"|"};if(m===":")return{type:"separator",separator:":"};throw new Ae("Unknown column alignment: "+m,c)}),o={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return Bl(e.parser,o,vg(e.envName))},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var l=e.parser;if(l.consumeSpaces(),l.fetch().text==="["){if(l.consume(),l.consumeSpaces(),n=l.fetch().text,"lcr".indexOf(n)===-1)throw new Ae("Expected l or c or r",l.nextToken);l.consume(),l.consumeSpaces(),l.expect("]"),l.consume(),a.cols=[{type:"align",align:n}]}}var o=Bl(e.parser,a,vg(e.envName)),c=Math.max(0,...o.body.map(d=>d.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Bl(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Vm(t[0]),a=n?[t[0]]:vt(t[0],"ordgroup").body,l=a.map(function(c){var d=mg(c),m=d.text;if("lc".indexOf(m)!==-1)return{type:"align",align:m};throw new Ae("Unknown column alignment: "+m,c)});if(l.length>1)throw new Ae("{subarray} can contain only one column");var o={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5};if(o=Bl(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new Ae("{subarray} can contain only one column");return o},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Bl(e.parser,t,vg(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:P8,htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&Wm(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:gg(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Bl(e.parser,t,"display")},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:P8,htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Wm(e);var t={autoTag:gg(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Bl(e.parser,t,"display")},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Wm(e),jq(e.parser)},htmlBuilder:is,mathmlBuilder:os});F("\\nonumber","\\gdef\\@eqnsw{0}");F("\\notag","\\nonumber");Le({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ae(e.funcName+" valid only within array environment")}});var P3=B8;Le({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];if(l.type!=="ordgroup")throw new Ae("Invalid environment name",l);for(var o="",c=0;c{var n=e.font,a=t.withFont(n);return Pt(e.body,a)},I8=(e,t)=>{var n=e.font,a=t.withFont(n);return fn(e.body,a)},F3={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Le({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=pm(t[0]),o=a;return o in F3&&(o=F3[o]),{type:"font",mode:n.mode,font:o.slice(1),body:l}},htmlBuilder:F8,mathmlBuilder:I8});Le({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0],l=Ht.isCharacterBox(a);return{type:"mclass",mode:n.mode,mclass:Gm(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:l}}});Le({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:l}=e,{mode:o}=n,c=n.parseExpression(!0,l),d="math"+a.slice(1);return{type:"font",mode:o,font:d,body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:F8,mathmlBuilder:I8});var q8=(e,t)=>{var n=t;return e==="display"?n=n.id>=tt.SCRIPT.id?n.text():tt.DISPLAY:e==="text"&&n.size===tt.DISPLAY.size?n=tt.TEXT:e==="script"?n=tt.SCRIPT:e==="scriptscript"&&(n=tt.SCRIPTSCRIPT),n},yg=(e,t)=>{var n=q8(e.size,t.style),a=n.fracNum(),l=n.fracDen(),o;o=t.havingStyle(a);var c=Pt(e.numer,o,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,m=3.5/t.fontMetrics().ptPerEm;c.height=c.height0?j=3*y:j=7*y,k=t.fontMetrics().denom1):(x>0?(b=t.fontMetrics().num2,j=y):(b=t.fontMetrics().num3,j=3*y),k=t.fontMetrics().denom2);var S;if(p){var M=t.fontMetrics().axisHeight;b-c.depth-(M+.5*x){var n=new Ee.MathNode("mfrac",[fn(e.numer,t),fn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=_n(e.barSize,t);n.setAttribute("linethickness",Re(a))}var l=q8(e.size,t.style);if(l.size!==t.style.size){n=new Ee.MathNode("mstyle",[n]);var o=l.size===tt.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var c=[];if(e.leftDelim!=null){var d=new Ee.MathNode("mo",[new Ee.TextNode(e.leftDelim.replace("\\",""))]);d.setAttribute("fence","true"),c.push(d)}if(c.push(n),e.rightDelim!=null){var m=new Ee.MathNode("mo",[new Ee.TextNode(e.rightDelim.replace("\\",""))]);m.setAttribute("fence","true"),c.push(m)}return ug(c)}return n};Le({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=t[1],c,d=null,m=null,f="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,d="(",m=")";break;case"\\\\bracefrac":c=!1,d="\\{",m="\\}";break;case"\\\\brackfrac":c=!1,d="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":f="display";break;case"\\tfrac":case"\\tbinom":f="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:l,denom:o,hasBarLine:c,leftDelim:d,rightDelim:m,size:f,barSize:null}},htmlBuilder:yg,mathmlBuilder:bg});Le({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:l,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Le({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,l;switch(n){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:a}}});var I3=["display","text","script","scriptscript"],q3=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Le({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],l=t[5],o=pm(t[0]),c=o.type==="atom"&&o.family==="open"?q3(o.text):null,d=pm(t[1]),m=d.type==="atom"&&d.family==="close"?q3(d.text):null,f=vt(t[2],"size"),p,x=null;f.isBlank?p=!0:(x=f.value,p=x.number>0);var y="auto",b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var j=vt(b.body[0],"textord");y=I3[Number(j.text)]}}else b=vt(b,"textord"),y=I3[Number(b.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:l,continued:!1,hasBarLine:p,barSize:x,leftDelim:c,rightDelim:m,size:y}},htmlBuilder:yg,mathmlBuilder:bg});Le({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:l}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:vt(t[0],"size").value,token:l}}});Le({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=mI(vt(t[1],"infix").size),c=t[2],d=o.number>0;return{type:"genfrac",mode:n.mode,numer:l,denom:c,continued:!1,hasBarLine:d,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:yg,mathmlBuilder:bg});var H8=(e,t)=>{var n=t.style,a,l;e.type==="supsub"?(a=e.sup?Pt(e.sup,t.havingStyle(n.sup()),t):Pt(e.sub,t.havingStyle(n.sub()),t),l=vt(e.base,"horizBrace")):l=vt(e,"horizBrace");var o=Pt(l.base,t.havingBaseStyle(tt.DISPLAY)),c=qs.svgSpan(l,t),d;if(l.isOver?(d=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c}]},t),d.children[0].children[0].children[1].classes.push("svg-align")):(d=ue.makeVList({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c},{type:"kern",size:.1},{type:"elem",elem:o}]},t),d.children[0].children[0].children[0].classes.push("svg-align")),a){var m=ue.makeSpan(["mord",l.isOver?"mover":"munder"],[d],t);l.isOver?d=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:a}]},t):d=ue.makeVList({positionType:"bottom",positionData:m.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:m}]},t)}return ue.makeSpan(["mord",l.isOver?"mover":"munder"],[d],t)},Lq=(e,t)=>{var n=qs.mathMLnode(e.label);return new Ee.MathNode(e.isOver?"mover":"munder",[fn(e.base,t),n])};Le({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:/^\\over/.test(a),base:t[0]}},htmlBuilder:H8,mathmlBuilder:Lq});Le({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],l=vt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:n.mode,href:l,body:Rn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Kn(e.body,t,!1);return ue.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=El(e.body,t);return n instanceof ca||(n=new ca("mrow",[n])),n.setAttribute("href",e.href),n}});Le({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=vt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var l=[],o=0;o{var{parser:n,funcName:a,token:l}=e,o=vt(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,m={};switch(a){case"\\htmlClass":m.class=o,d={command:"\\htmlClass",class:o};break;case"\\htmlId":m.id=o,d={command:"\\htmlId",id:o};break;case"\\htmlStyle":m.style=o,d={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var f=o.split(","),p=0;p{var n=Kn(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var l=ue.makeSpan(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&l.setAttribute(o,e.attributes[o]);return l},mathmlBuilder:(e,t)=>El(e.body,t)});Le({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Rn(t[0]),mathml:Rn(t[1])}},htmlBuilder:(e,t)=>{var n=Kn(e.html,t,!1);return ue.makeFragment(n)},mathmlBuilder:(e,t)=>El(e.mathml,t)});var ax=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ae("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!i8(a))throw new Ae("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Le({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,l={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var m=vt(n[0],"raw").string,f=m.split(","),p=0;p{var n=_n(e.height,t),a=0;e.totalheight.number>0&&(a=_n(e.totalheight,t)-n);var l=0;e.width.number>0&&(l=_n(e.width,t));var o={height:Re(n+a)};l>0&&(o.width=Re(l)),a>0&&(o.verticalAlign=Re(-a));var c=new LI(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Ee.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var a=_n(e.height,t),l=0;if(e.totalheight.number>0&&(l=_n(e.totalheight,t)-a,n.setAttribute("valign",Re(-l))),n.setAttribute("height",Re(a+l)),e.width.number>0){var o=_n(e.width,t);n.setAttribute("width",Re(o))}return n.setAttribute("src",e.src),n}});Le({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=vt(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=l.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+l.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:l.value}},htmlBuilder(e,t){return ue.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=_n(e.dimension,t);return new Ee.SpaceNode(n)}});Le({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:l}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=ue.makeSpan([],[Pt(e.body,t)]),n=ue.makeSpan(["inner"],[n],t)):n=ue.makeSpan(["inner"],[Pt(e.body,t)]);var a=ue.makeSpan(["fix"],[]),l=ue.makeSpan([e.alignment],[n,a],t),o=ue.makeSpan(["strut"]);return o.style.height=Re(l.height+l.depth),l.depth&&(o.style.verticalAlign=Re(-l.depth)),l.children.unshift(o),l=ue.makeSpan(["thinbox"],[l],t),ue.makeSpan(["mord","vbox"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Ee.MathNode("mpadded",[fn(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Le({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,l=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(l),{type:"styling",mode:a.mode,style:"text",body:c}}});Le({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ae("Mismatched "+e.funcName)}});var H3=(e,t)=>{switch(t.style.size){case tt.DISPLAY.size:return e.display;case tt.TEXT.size:return e.text;case tt.SCRIPT.size:return e.script;case tt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Le({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Rn(t[0]),text:Rn(t[1]),script:Rn(t[2]),scriptscript:Rn(t[3])}},htmlBuilder:(e,t)=>{var n=H3(e,t),a=Kn(n,t,!1);return ue.makeFragment(a)},mathmlBuilder:(e,t)=>{var n=H3(e,t);return El(n,t)}});var U8=(e,t,n,a,l,o,c)=>{e=ue.makeSpan([],[e]);var d=n&&Ht.isCharacterBox(n),m,f;if(t){var p=Pt(t,a.havingStyle(l.sup()),a);f={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var x=Pt(n,a.havingStyle(l.sub()),a);m={elem:x,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-x.height)}}var y;if(f&&m){var b=a.fontMetrics().bigOpSpacing5+m.elem.height+m.elem.depth+m.kern+e.depth+c;y=ue.makeVList({positionType:"bottom",positionData:b,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Re(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(m){var j=e.height-c;y=ue.makeVList({positionType:"top",positionData:j,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Re(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e}]},a)}else if(f){var k=e.depth+c;y=ue.makeVList({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return e;var S=[y];if(m&&o!==0&&!d){var _=ue.makeSpan(["mspace"],[],a);_.style.marginRight=Re(o),S.unshift(_)}return ue.makeSpan(["mop","op-limits"],S,a)},$8=["\\smallint"],ec=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=vt(e.base,"op"),l=!0):o=vt(e,"op");var c=t.style,d=!1;c.size===tt.DISPLAY.size&&o.symbol&&!$8.includes(o.name)&&(d=!0);var m;if(o.symbol){var f=d?"Size2-Regular":"Size1-Regular",p="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(p=o.name.slice(1),o.name=p==="oiint"?"\\iint":"\\iiint"),m=ue.makeSymbol(o.name,f,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),p.length>0){var x=m.italic,y=ue.staticSvg(p+"Size"+(d?"2":"1"),t);m=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:m,shift:0},{type:"elem",elem:y,shift:d?.08:0}]},t),o.name="\\"+p,m.classes.unshift("mop"),m.italic=x}}else if(o.body){var b=Kn(o.body,t,!0);b.length===1&&b[0]instanceof Ma?(m=b[0],m.classes[0]="mop"):m=ue.makeSpan(["mop"],b,t)}else{for(var j=[],k=1;k{var n;if(e.symbol)n=new ca("mo",[Ea(e.name,e.mode)]),$8.includes(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ca("mo",Qr(e.body,t));else{n=new ca("mi",[new ts(e.name.slice(1))]);var a=new ca("mo",[Ea("⁡","text")]);e.parentIsSupSub?n=new ca("mrow",[n,a]):n=v8([n,a])}return n},Pq={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Le({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=a;return l.length===1&&(l=Pq[l]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:l}},htmlBuilder:ec,mathmlBuilder:Wu});Le({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Rn(a)}},htmlBuilder:ec,mathmlBuilder:Wu});var Fq={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Le({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ec,mathmlBuilder:Wu});Le({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ec,mathmlBuilder:Wu});Le({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=Fq[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:ec,mathmlBuilder:Wu});var V8=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=vt(e.base,"operatorname"),l=!0):o=vt(e,"operatorname");var c;if(o.body.length>0){for(var d=o.body.map(x=>{var y=x.text;return typeof y=="string"?{type:"textord",mode:x.mode,text:y}:x}),m=Kn(d,t.withFont("mathrm"),!0),f=0;f{for(var n=Qr(e.body,t.withFont("mathrm")),a=!0,l=0;lp.toText()).join("");n=[new Ee.TextNode(d)]}var m=new Ee.MathNode("mi",n);m.setAttribute("mathvariant","normal");var f=new Ee.MathNode("mo",[Ea("⁡","text")]);return e.parentIsSupSub?new Ee.MathNode("mrow",[m,f]):Ee.newDocumentFragment([m,f])};Le({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"operatorname",mode:n.mode,body:Rn(l),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:V8,mathmlBuilder:Iq});F("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Si({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ue.makeFragment(Kn(e.body,t,!1)):ue.makeSpan(["mord"],Kn(e.body,t,!0),t)},mathmlBuilder(e,t){return El(e.body,t,!0)}});Le({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=Pt(e.body,t.havingCrampedStyle()),a=ue.makeLineSpan("overline-line",t),l=t.fontMetrics().defaultRuleThickness,o=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*l},{type:"elem",elem:a},{type:"kern",size:l}]},t);return ue.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Ee.MathNode("mo",[new Ee.TextNode("‾")]);n.setAttribute("stretchy","true");var a=new Ee.MathNode("mover",[fn(e.body,t),n]);return a.setAttribute("accent","true"),a}});Le({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:Rn(a)}},htmlBuilder:(e,t)=>{var n=Kn(e.body,t.withPhantom(),!1);return ue.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Qr(e.body,t);return new Ee.MathNode("mphantom",n)}});Le({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"hphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=ue.makeSpan([],[Pt(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var a=0;a{var n=Qr(Rn(e.body),t),a=new Ee.MathNode("mphantom",n),l=new Ee.MathNode("mpadded",[a]);return l.setAttribute("height","0px"),l.setAttribute("depth","0px"),l}});Le({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=ue.makeSpan(["inner"],[Pt(e.body,t.withPhantom())]),a=ue.makeSpan(["fix"],[]);return ue.makeSpan(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Qr(Rn(e.body),t),a=new Ee.MathNode("mphantom",n),l=new Ee.MathNode("mpadded",[a]);return l.setAttribute("width","0px"),l}});Le({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=vt(t[0],"size").value,l=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:l}},htmlBuilder(e,t){var n=Pt(e.body,t),a=_n(e.dy,t);return ue.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Ee.MathNode("mpadded",[fn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Le({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Le({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,l=n[0],o=vt(t[0],"size"),c=vt(t[1],"size");return{type:"rule",mode:a.mode,shift:l&&vt(l,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=ue.makeSpan(["mord","rule"],[],t),a=_n(e.width,t),l=_n(e.height,t),o=e.shift?_n(e.shift,t):0;return n.style.borderRightWidth=Re(a),n.style.borderTopWidth=Re(l),n.style.bottom=Re(o),n.width=a,n.height=l+o,n.depth=-o,n.maxFontSize=l*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=_n(e.width,t),a=_n(e.height,t),l=e.shift?_n(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Ee.MathNode("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Re(n)),c.setAttribute("height",Re(a));var d=new Ee.MathNode("mpadded",[c]);return l>=0?d.setAttribute("height",Re(l)):(d.setAttribute("height",Re(l)),d.setAttribute("depth",Re(-l))),d.setAttribute("voffset",Re(l)),d}});function G8(e,t,n){for(var a=Kn(e,t,!1),l=t.sizeMultiplier/n.sizeMultiplier,o=0;o{var n=t.havingSize(e.size);return G8(e.body,n,t)};Le({type:"sizing",names:U3,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!1,n);return{type:"sizing",mode:l.mode,size:U3.indexOf(a)+1,body:o}},htmlBuilder:qq,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Qr(e.body,n),l=new Ee.MathNode("mstyle",a);return l.setAttribute("mathsize",Re(n.sizeMultiplier)),l}});Le({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,l=!1,o=!1,c=n[0]&&vt(n[0],"ordgroup");if(c)for(var d="",m=0;m{var n=ue.makeSpan([],[Pt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var a=0;a{var n=new Ee.MathNode("mpadded",[fn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Le({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,l=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:l}},htmlBuilder(e,t){var n=Pt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=ue.wrapFragment(n,t);var a=t.fontMetrics(),l=a.defaultRuleThickness,o=l;t.style.idn.height+n.depth+c&&(c=(c+x-n.height-n.depth)/2);var y=m.height-n.height-c-f;n.style.paddingLeft=Re(p);var b=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+y)},{type:"elem",elem:m},{type:"kern",size:f}]},t);if(e.index){var j=t.havingStyle(tt.SCRIPTSCRIPT),k=Pt(e.index,j,t),S=.6*(b.height-b.depth),_=ue.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:k}]},t),M=ue.makeSpan(["root"],[_]);return ue.makeSpan(["mord","sqrt"],[M,b],t)}else return ue.makeSpan(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Ee.MathNode("mroot",[fn(n,t),fn(a,t)]):new Ee.MathNode("msqrt",[fn(n,t)])}});var $3={display:tt.DISPLAY,text:tt.TEXT,script:tt.SCRIPT,scriptscript:tt.SCRIPTSCRIPT};Le({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!0,n),c=a.slice(1,a.length-5);return{type:"styling",mode:l.mode,style:c,body:o}},htmlBuilder(e,t){var n=$3[e.style],a=t.havingStyle(n).withFont("");return G8(e.body,a,t)},mathmlBuilder(e,t){var n=$3[e.style],a=t.havingStyle(n),l=Qr(e.body,a),o=new Ee.MathNode("mstyle",l),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return o.setAttribute("scriptlevel",d[0]),o.setAttribute("displaystyle",d[1]),o}});var Hq=function(t,n){var a=t.base;if(a)if(a.type==="op"){var l=a.limits&&(n.style.size===tt.DISPLAY.size||a.alwaysHandleSupSub);return l?ec:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===tt.DISPLAY.size||a.limits);return o?V8:null}else{if(a.type==="accent")return Ht.isCharacterBox(a.base)?hg:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?H8:null}else return null}else return null};Si({type:"supsub",htmlBuilder(e,t){var n=Hq(e,t);if(n)return n(e,t);var{base:a,sup:l,sub:o}=e,c=Pt(a,t),d,m,f=t.fontMetrics(),p=0,x=0,y=a&&Ht.isCharacterBox(a);if(l){var b=t.havingStyle(t.style.sup());d=Pt(l,b,t),y||(p=c.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(o){var j=t.havingStyle(t.style.sub());m=Pt(o,j,t),y||(x=c.depth+j.fontMetrics().subDrop*j.sizeMultiplier/t.sizeMultiplier)}var k;t.style===tt.DISPLAY?k=f.sup1:t.style.cramped?k=f.sup3:k=f.sup2;var S=t.sizeMultiplier,_=Re(.5/f.ptPerEm/S),M=null;if(m){var D=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(c instanceof Ma||D)&&(M=Re(-c.italic))}var z;if(d&&m){p=Math.max(p,k,d.depth+.25*f.xHeight),x=Math.max(x,f.sub2);var L=f.defaultRuleThickness,E=4*L;if(p-d.depth-(m.height-x)0&&(p+=R,x-=R)}var H=[{type:"elem",elem:m,shift:x,marginRight:_,marginLeft:M},{type:"elem",elem:d,shift:-p,marginRight:_}];z=ue.makeVList({positionType:"individualShift",children:H},t)}else if(m){x=Math.max(x,f.sub1,m.height-.8*f.xHeight);var $=[{type:"elem",elem:m,marginLeft:M,marginRight:_}];z=ue.makeVList({positionType:"shift",positionData:x,children:$},t)}else if(d)p=Math.max(p,k,d.depth+.25*f.xHeight),z=ue.makeVList({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:_}]},t);else throw new Error("supsub must have either sup or sub.");var I=Yx(c,"right")||"mord";return ue.makeSpan([I],[c,ue.makeSpan(["msupsub"],[z])],t)},mathmlBuilder(e,t){var n=!1,a,l;e.base&&e.base.type==="horizBrace"&&(l=!!e.sup,l===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[fn(e.base,t)];e.sub&&o.push(fn(e.sub,t)),e.sup&&o.push(fn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var f=e.base;f&&f.type==="op"&&f.limits&&t.style===tt.DISPLAY||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(t.style===tt.DISPLAY||f.limits)?c="munderover":c="msubsup"}else{var m=e.base;m&&m.type==="op"&&m.limits&&(t.style===tt.DISPLAY||m.alwaysHandleSupSub)||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(m.limits||t.style===tt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===tt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===tt.DISPLAY)?c="mover":c="msup"}return new Ee.MathNode(c,o)}});Si({type:"atom",htmlBuilder(e,t){return ue.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Ee.MathNode("mo",[Ea(e.text,e.mode)]);if(e.family==="bin"){var a=dg(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var Y8={mi:"italic",mn:"normal",mtext:"normal"};Si({type:"mathord",htmlBuilder(e,t){return ue.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Ee.MathNode("mi",[Ea(e.text,e.mode,t)]),a=dg(e,t)||"italic";return a!==Y8[n.type]&&n.setAttribute("mathvariant",a),n}});Si({type:"textord",htmlBuilder(e,t){return ue.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=Ea(e.text,e.mode,t),a=dg(e,t)||"normal",l;return e.mode==="text"?l=new Ee.MathNode("mtext",[n]):/[0-9]/.test(e.text)?l=new Ee.MathNode("mn",[n]):e.text==="\\prime"?l=new Ee.MathNode("mo",[n]):l=new Ee.MathNode("mi",[n]),a!==Y8[l.type]&&l.setAttribute("mathvariant",a),l}});var sx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},lx={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Si({type:"spacing",htmlBuilder(e,t){if(lx.hasOwnProperty(e.text)){var n=lx[e.text].className||"";if(e.mode==="text"){var a=ue.makeOrd(e,t,"textord");return a.classes.push(n),a}else return ue.makeSpan(["mspace",n],[ue.mathsym(e.text,e.mode,t)],t)}else{if(sx.hasOwnProperty(e.text))return ue.makeSpan(["mspace",sx[e.text]],[],t);throw new Ae('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(lx.hasOwnProperty(e.text))n=new Ee.MathNode("mtext",[new Ee.TextNode(" ")]);else{if(sx.hasOwnProperty(e.text))return new Ee.MathNode("mspace");throw new Ae('Unknown type of space "'+e.text+'"')}return n}});var V3=()=>{var e=new Ee.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Si({type:"tag",mathmlBuilder(e,t){var n=new Ee.MathNode("mtable",[new Ee.MathNode("mtr",[V3(),new Ee.MathNode("mtd",[El(e.body,t)]),V3(),new Ee.MathNode("mtd",[El(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var G3={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Y3={"\\textbf":"textbf","\\textmd":"textmd"},Uq={"\\textit":"textit","\\textup":"textup"},W3=(e,t)=>{var n=e.font;if(n){if(G3[n])return t.withTextFontFamily(G3[n]);if(Y3[n])return t.withTextFontWeight(Y3[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(Uq[n])};Le({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"text",mode:n.mode,body:Rn(l),font:a}},htmlBuilder(e,t){var n=W3(e,t),a=Kn(e.body,n,!0);return ue.makeSpan(["mord","text"],a,n)},mathmlBuilder(e,t){var n=W3(e,t);return El(e.body,n)}});Le({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Pt(e.body,t),a=ue.makeLineSpan("underline-line",t),l=t.fontMetrics().defaultRuleThickness,o=ue.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:l},{type:"elem",elem:a},{type:"kern",size:3*l},{type:"elem",elem:n}]},t);return ue.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Ee.MathNode("mo",[new Ee.TextNode("‾")]);n.setAttribute("stretchy","true");var a=new Ee.MathNode("munder",[fn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Le({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Pt(e.body,t),a=t.fontMetrics().axisHeight,l=.5*(n.height-a-(n.depth+a));return ue.makeVList({positionType:"shift",positionData:l,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new Ee.MathNode("mpadded",[fn(e.body,t)],["vcenter"])}});Le({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ae("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=X3(e),a=[],l=t.havingStyle(t.style.text()),o=0;oe.body.replace(/ /g,e.star?"␣":" "),wl=x8,W8=`[ \r + ]`,$q="\\\\[a-zA-Z@]+",Vq="\\\\[^\uD800-\uDFFF]",Gq="("+$q+")"+W8+"*",Yq=`\\\\( +|[ \r ]+ +?)[ \r ]*`,Qx="[̀-ͯ]",Wq=new RegExp(Qx+"+$"),Xq="("+W8+"+)|"+(Yq+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Qx+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Qx+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Gq)+("|"+Vq+")");class K3{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(Xq,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new da("EOF",new Hr(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Ae("Unexpected character: '"+t[n]+"'",new da(t[n],new Hr(this,n,n+1)));var l=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[l]===14){var o=t.indexOf(` +`,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new da(l,new Hr(this,n,this.tokenRegex.lastIndex))}}class Kq{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ae("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var l=0;l0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var Qq=L8;F("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});F("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});F("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});F("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});F("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});F("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");F("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Q3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};F("\\char",function(e){var t=e.popToken(),n,a="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ae("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=Q3[t.text],a==null||a>=n)throw new Ae("Invalid base-"+n+" digit "+t.text);for(var l;(l=Q3[e.future().text])!=null&&l{var l=e.consumeArg().tokens;if(l.length!==1)throw new Ae("\\newcommand's first argument must be a macro name");var o=l[0].text,c=e.isDefined(o);if(c&&!t)throw new Ae("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!c&&!n)throw new Ae("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var d=0;if(l=e.consumeArg().tokens,l.length===1&&l[0].text==="["){for(var m="",f=e.expandNextToken();f.text!=="]"&&f.text!=="EOF";)m+=f.text,f=e.expandNextToken();if(!m.match(/^\s*[0-9]+\s*$/))throw new Ae("Invalid number of arguments: "+m);d=parseInt(m),l=e.consumeArg().tokens}return c&&a||e.macros.set(o,{tokens:l,numArgs:d}),""};F("\\newcommand",e=>wg(e,!1,!0,!1));F("\\renewcommand",e=>wg(e,!0,!1,!1));F("\\providecommand",e=>wg(e,!0,!0,!0));F("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});F("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});F("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),wl[n],yn.math[n],yn.text[n]),""});F("\\bgroup","{");F("\\egroup","}");F("~","\\nobreakspace");F("\\lq","`");F("\\rq","'");F("\\aa","\\r a");F("\\AA","\\r A");F("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");F("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");F("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");F("ℬ","\\mathscr{B}");F("ℰ","\\mathscr{E}");F("ℱ","\\mathscr{F}");F("ℋ","\\mathscr{H}");F("ℐ","\\mathscr{I}");F("ℒ","\\mathscr{L}");F("ℳ","\\mathscr{M}");F("ℛ","\\mathscr{R}");F("ℭ","\\mathfrak{C}");F("ℌ","\\mathfrak{H}");F("ℨ","\\mathfrak{Z}");F("\\Bbbk","\\Bbb{k}");F("·","\\cdotp");F("\\llap","\\mathllap{\\textrm{#1}}");F("\\rlap","\\mathrlap{\\textrm{#1}}");F("\\clap","\\mathclap{\\textrm{#1}}");F("\\mathstrut","\\vphantom{(}");F("\\underbar","\\underline{\\text{#1}}");F("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');F("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");F("\\ne","\\neq");F("≠","\\neq");F("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");F("∉","\\notin");F("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");F("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");F("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");F("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");F("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");F("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");F("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");F("⟂","\\perp");F("‼","\\mathclose{!\\mkern-0.8mu!}");F("∌","\\notni");F("⌜","\\ulcorner");F("⌝","\\urcorner");F("⌞","\\llcorner");F("⌟","\\lrcorner");F("©","\\copyright");F("®","\\textregistered");F("️","\\textregistered");F("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');F("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');F("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');F("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');F("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");F("⋮","\\vdots");F("\\varGamma","\\mathit{\\Gamma}");F("\\varDelta","\\mathit{\\Delta}");F("\\varTheta","\\mathit{\\Theta}");F("\\varLambda","\\mathit{\\Lambda}");F("\\varXi","\\mathit{\\Xi}");F("\\varPi","\\mathit{\\Pi}");F("\\varSigma","\\mathit{\\Sigma}");F("\\varUpsilon","\\mathit{\\Upsilon}");F("\\varPhi","\\mathit{\\Phi}");F("\\varPsi","\\mathit{\\Psi}");F("\\varOmega","\\mathit{\\Omega}");F("\\substack","\\begin{subarray}{c}#1\\end{subarray}");F("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");F("\\boxed","\\fbox{$\\displaystyle{#1}$}");F("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");F("\\implies","\\DOTSB\\;\\Longrightarrow\\;");F("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");F("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");F("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Z3={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};F("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Z3?t=Z3[n]:(n.slice(0,4)==="\\not"||n in yn.math&&["bin","rel"].includes(yn.math[n].group))&&(t="\\dotsb"),t});var jg={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};F("\\dotso",function(e){var t=e.future().text;return t in jg?"\\ldots\\,":"\\ldots"});F("\\dotsc",function(e){var t=e.future().text;return t in jg&&t!==","?"\\ldots\\,":"\\ldots"});F("\\cdots",function(e){var t=e.future().text;return t in jg?"\\@cdots\\,":"\\@cdots"});F("\\dotsb","\\cdots");F("\\dotsm","\\cdots");F("\\dotsi","\\!\\cdots");F("\\dotsx","\\ldots\\,");F("\\DOTSI","\\relax");F("\\DOTSB","\\relax");F("\\DOTSX","\\relax");F("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");F("\\,","\\tmspace+{3mu}{.1667em}");F("\\thinspace","\\,");F("\\>","\\mskip{4mu}");F("\\:","\\tmspace+{4mu}{.2222em}");F("\\medspace","\\:");F("\\;","\\tmspace+{5mu}{.2777em}");F("\\thickspace","\\;");F("\\!","\\tmspace-{3mu}{.1667em}");F("\\negthinspace","\\!");F("\\negmedspace","\\tmspace-{4mu}{.2222em}");F("\\negthickspace","\\tmspace-{5mu}{.277em}");F("\\enspace","\\kern.5em ");F("\\enskip","\\hskip.5em\\relax");F("\\quad","\\hskip1em\\relax");F("\\qquad","\\hskip2em\\relax");F("\\tag","\\@ifstar\\tag@literal\\tag@paren");F("\\tag@paren","\\tag@literal{({#1})}");F("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ae("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});F("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");F("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");F("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");F("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");F("\\newline","\\\\\\relax");F("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var X8=Re(es["Main-Regular"][84][1]-.7*es["Main-Regular"][65][1]);F("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+X8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");F("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+X8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");F("\\hspace","\\@ifstar\\@hspacer\\@hspace");F("\\@hspace","\\hskip #1\\relax");F("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");F("\\ordinarycolon",":");F("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");F("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');F("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');F("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');F("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');F("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');F("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');F("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');F("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');F("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');F("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');F("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');F("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');F("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');F("∷","\\dblcolon");F("∹","\\eqcolon");F("≔","\\coloneqq");F("≕","\\eqqcolon");F("⩴","\\Coloneqq");F("\\ratio","\\vcentcolon");F("\\coloncolon","\\dblcolon");F("\\colonequals","\\coloneqq");F("\\coloncolonequals","\\Coloneqq");F("\\equalscolon","\\eqqcolon");F("\\equalscoloncolon","\\Eqqcolon");F("\\colonminus","\\coloneq");F("\\coloncolonminus","\\Coloneq");F("\\minuscolon","\\eqcolon");F("\\minuscoloncolon","\\Eqcolon");F("\\coloncolonapprox","\\Colonapprox");F("\\coloncolonsim","\\Colonsim");F("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");F("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");F("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");F("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");F("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");F("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");F("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");F("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");F("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");F("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");F("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");F("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");F("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");F("\\nleqq","\\html@mathml{\\@nleqq}{≰}");F("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");F("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");F("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");F("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");F("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");F("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");F("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");F("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");F("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");F("\\imath","\\html@mathml{\\@imath}{ı}");F("\\jmath","\\html@mathml{\\@jmath}{ȷ}");F("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");F("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");F("⟦","\\llbracket");F("⟧","\\rrbracket");F("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");F("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");F("⦃","\\lBrace");F("⦄","\\rBrace");F("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");F("⦵","\\minuso");F("\\darr","\\downarrow");F("\\dArr","\\Downarrow");F("\\Darr","\\Downarrow");F("\\lang","\\langle");F("\\rang","\\rangle");F("\\uarr","\\uparrow");F("\\uArr","\\Uparrow");F("\\Uarr","\\Uparrow");F("\\N","\\mathbb{N}");F("\\R","\\mathbb{R}");F("\\Z","\\mathbb{Z}");F("\\alef","\\aleph");F("\\alefsym","\\aleph");F("\\Alpha","\\mathrm{A}");F("\\Beta","\\mathrm{B}");F("\\bull","\\bullet");F("\\Chi","\\mathrm{X}");F("\\clubs","\\clubsuit");F("\\cnums","\\mathbb{C}");F("\\Complex","\\mathbb{C}");F("\\Dagger","\\ddagger");F("\\diamonds","\\diamondsuit");F("\\empty","\\emptyset");F("\\Epsilon","\\mathrm{E}");F("\\Eta","\\mathrm{H}");F("\\exist","\\exists");F("\\harr","\\leftrightarrow");F("\\hArr","\\Leftrightarrow");F("\\Harr","\\Leftrightarrow");F("\\hearts","\\heartsuit");F("\\image","\\Im");F("\\infin","\\infty");F("\\Iota","\\mathrm{I}");F("\\isin","\\in");F("\\Kappa","\\mathrm{K}");F("\\larr","\\leftarrow");F("\\lArr","\\Leftarrow");F("\\Larr","\\Leftarrow");F("\\lrarr","\\leftrightarrow");F("\\lrArr","\\Leftrightarrow");F("\\Lrarr","\\Leftrightarrow");F("\\Mu","\\mathrm{M}");F("\\natnums","\\mathbb{N}");F("\\Nu","\\mathrm{N}");F("\\Omicron","\\mathrm{O}");F("\\plusmn","\\pm");F("\\rarr","\\rightarrow");F("\\rArr","\\Rightarrow");F("\\Rarr","\\Rightarrow");F("\\real","\\Re");F("\\reals","\\mathbb{R}");F("\\Reals","\\mathbb{R}");F("\\Rho","\\mathrm{P}");F("\\sdot","\\cdot");F("\\sect","\\S");F("\\spades","\\spadesuit");F("\\sub","\\subset");F("\\sube","\\subseteq");F("\\supe","\\supseteq");F("\\Tau","\\mathrm{T}");F("\\thetasym","\\vartheta");F("\\weierp","\\wp");F("\\Zeta","\\mathrm{Z}");F("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");F("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");F("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");F("\\bra","\\mathinner{\\langle{#1}|}");F("\\ket","\\mathinner{|{#1}\\rangle}");F("\\braket","\\mathinner{\\langle{#1}\\rangle}");F("\\Bra","\\left\\langle#1\\right|");F("\\Ket","\\left|#1\\right\\rangle");var K8=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,l=t.consumeArg().tokens,o=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var m=x=>y=>{e&&(y.macros.set("|",c),l.length&&y.macros.set("\\|",d));var b=x;if(!x&&l.length){var j=y.future();j.text==="|"&&(y.popToken(),b=!0)}return{tokens:b?l:a,numArgs:0}};t.macros.set("|",m(!1)),l.length&&t.macros.set("\\|",m(!0));var f=t.consumeArg().tokens,p=t.expandTokens([...o,...f,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};F("\\bra@ket",K8(!1));F("\\bra@set",K8(!0));F("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");F("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");F("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");F("\\angln","{\\angl n}");F("\\blue","\\textcolor{##6495ed}{#1}");F("\\orange","\\textcolor{##ffa500}{#1}");F("\\pink","\\textcolor{##ff00af}{#1}");F("\\red","\\textcolor{##df0030}{#1}");F("\\green","\\textcolor{##28ae7b}{#1}");F("\\gray","\\textcolor{gray}{#1}");F("\\purple","\\textcolor{##9d38bd}{#1}");F("\\blueA","\\textcolor{##ccfaff}{#1}");F("\\blueB","\\textcolor{##80f6ff}{#1}");F("\\blueC","\\textcolor{##63d9ea}{#1}");F("\\blueD","\\textcolor{##11accd}{#1}");F("\\blueE","\\textcolor{##0c7f99}{#1}");F("\\tealA","\\textcolor{##94fff5}{#1}");F("\\tealB","\\textcolor{##26edd5}{#1}");F("\\tealC","\\textcolor{##01d1c1}{#1}");F("\\tealD","\\textcolor{##01a995}{#1}");F("\\tealE","\\textcolor{##208170}{#1}");F("\\greenA","\\textcolor{##b6ffb0}{#1}");F("\\greenB","\\textcolor{##8af281}{#1}");F("\\greenC","\\textcolor{##74cf70}{#1}");F("\\greenD","\\textcolor{##1fab54}{#1}");F("\\greenE","\\textcolor{##0d923f}{#1}");F("\\goldA","\\textcolor{##ffd0a9}{#1}");F("\\goldB","\\textcolor{##ffbb71}{#1}");F("\\goldC","\\textcolor{##ff9c39}{#1}");F("\\goldD","\\textcolor{##e07d10}{#1}");F("\\goldE","\\textcolor{##a75a05}{#1}");F("\\redA","\\textcolor{##fca9a9}{#1}");F("\\redB","\\textcolor{##ff8482}{#1}");F("\\redC","\\textcolor{##f9685d}{#1}");F("\\redD","\\textcolor{##e84d39}{#1}");F("\\redE","\\textcolor{##bc2612}{#1}");F("\\maroonA","\\textcolor{##ffbde0}{#1}");F("\\maroonB","\\textcolor{##ff92c6}{#1}");F("\\maroonC","\\textcolor{##ed5fa6}{#1}");F("\\maroonD","\\textcolor{##ca337c}{#1}");F("\\maroonE","\\textcolor{##9e034e}{#1}");F("\\purpleA","\\textcolor{##ddd7ff}{#1}");F("\\purpleB","\\textcolor{##c6b9fc}{#1}");F("\\purpleC","\\textcolor{##aa87ff}{#1}");F("\\purpleD","\\textcolor{##7854ab}{#1}");F("\\purpleE","\\textcolor{##543b78}{#1}");F("\\mintA","\\textcolor{##f5f9e8}{#1}");F("\\mintB","\\textcolor{##edf2df}{#1}");F("\\mintC","\\textcolor{##e0e5cc}{#1}");F("\\grayA","\\textcolor{##f6f7f7}{#1}");F("\\grayB","\\textcolor{##f0f1f2}{#1}");F("\\grayC","\\textcolor{##e3e5e6}{#1}");F("\\grayD","\\textcolor{##d6d8da}{#1}");F("\\grayE","\\textcolor{##babec2}{#1}");F("\\grayF","\\textcolor{##888d93}{#1}");F("\\grayG","\\textcolor{##626569}{#1}");F("\\grayH","\\textcolor{##3b3e40}{#1}");F("\\grayI","\\textcolor{##21242c}{#1}");F("\\kaBlue","\\textcolor{##314453}{#1}");F("\\kaGreen","\\textcolor{##71B307}{#1}");var Q8={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Zq{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new Kq(Qq,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new K3(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,l;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:l,end:a}=this.consumeArg(["]"])}else({tokens:l,start:n,end:a}=this.consumeArg());return this.pushToken(new da("EOF",a.loc)),this.pushTokens(l),new da("",Hr.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var l=this.future(),o,c=0,d=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++c;else if(o.text==="}"){if(--c,c===-1)throw new Ae("Extra }",o)}else if(o.text==="EOF")throw new Ae("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",o);if(t&&a)if((c===0||c===1&&t[d]==="{")&&o.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return l.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:l,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Ae("The length of delimiters doesn't match the number of args!");for(var a=n[0],l=0;lthis.settings.maxExpand)throw new Ae("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,l=n.noexpand?null:this._getExpansion(a);if(l==null||t&&l.unexpandable){if(t&&l==null&&a[0]==="\\"&&!this.isDefined(a))throw new Ae("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var o=l.tokens,c=this.consumeArgs(l.numArgs,l.delimiters);if(l.numArgs){o=o.slice();for(var d=o.length-1;d>=0;--d){var m=o[d];if(m.text==="#"){if(d===0)throw new Ae("Incomplete placeholder at end of macro body",m);if(m=o[--d],m.text==="#")o.splice(d+1,1);else if(/^[1-9]$/.test(m.text))o.splice(d,2,...c[+m.text-1]);else throw new Ae("Not a valid argument number",m)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new da(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var l=this.stack.pop();l.treatAsRelax&&(l.noexpand=!1,l.treatAsRelax=!1),n.push(l)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var l=typeof n=="function"?n(this):n;if(typeof l=="string"){var o=0;if(l.indexOf("#")!==-1)for(var c=l.replace(/##/g,"");c.indexOf("#"+(o+1))!==-1;)++o;for(var d=new K3(l,this.settings),m=[],f=d.lex();f.text!=="EOF";)m.push(f),f=d.lex();m.reverse();var p={tokens:m,numArgs:o};return p}return l}isDefined(t){return this.macros.has(t)||wl.hasOwnProperty(t)||yn.math.hasOwnProperty(t)||yn.text.hasOwnProperty(t)||Q8.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:wl.hasOwnProperty(t)&&!wl[t].primitive}}var J3=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,O0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ix={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},e5={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Xm{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Zq(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Ae("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new da("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var l=this.fetch();if(Xm.endOfExpression.indexOf(l.text)!==-1||n&&l.text===n||t&&wl[l.text]&&wl[l.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;a.push(o)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,l=0;l=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=yn[this.mode][n].group,m=Hr.range(t),f;if(II.hasOwnProperty(d)){var p=d;f={type:"atom",mode:this.mode,family:p,loc:m,text:n}}else f={type:d,mode:this.mode,loc:m,text:n};c=f}else if(n.charCodeAt(0)>=128)this.settings.strict&&(l8(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Hr.range(t),text:n};else return null;if(this.consume(),o)for(var x=0;xf&&(f=p):p&&(f!==void 0&&f>-1&&m.push(` +`.repeat(f)||" "),f=-1,m.push(p))}return m.join("")}function a9(e,t,n){return e.type==="element"?MH(e,t,n):e.type==="text"?n.whitespace==="normal"?s9(e,n):EH(e):[]}function MH(e,t,n){const a=l9(e,n),l=e.children||[];let o=-1,c=[];if(TH(e))return c;let d,m;for(Jx(e)||c5(e)&&s5(t,e,c5)?m=` +`:CH(e)?(d=2,m=2):r9(e)&&(d=1,m=1);++o{try{o(!0);const ve=await IH({page:c,page_size:p,search:y||void 0,is_registered:j==="all"?void 0:j==="registered",is_banned:S==="all"?void 0:S==="banned",format:M==="all"?void 0:M,sort_by:"usage_count",sort_order:"desc"});t(ve.data),f(ve.total)}catch(ve){const Ze=ve instanceof Error?ve.message:"加载表情包列表失败";W({title:"错误",description:Ze,variant:"destructive"})}finally{o(!1)}},[c,p,y,j,S,M,W]),P=async()=>{try{const ve=await $H();a(ve.data)}catch(ve){console.error("加载统计数据失败:",ve)}};w.useEffect(()=>{oe()},[oe]),w.useEffect(()=>{P()},[]);const je=async ve=>{try{const Ze=await qH(ve.id);L(Ze.data),R(!0)}catch(Ze){const We=Ze instanceof Error?Ze.message:"加载详情失败";W({title:"错误",description:We,variant:"destructive"})}},Z=ve=>{L(ve),$(!0)},O=ve=>{L(ve),G(!0)},Ne=async()=>{if(z)try{await UH(z.id),W({title:"成功",description:"表情包已删除"}),G(!1),L(null),oe(),P()}catch(ve){const Ze=ve instanceof Error?ve.message:"删除失败";W({title:"错误",description:Ze,variant:"destructive"})}},se=async ve=>{try{await VH(ve.id),W({title:"成功",description:"表情包已注册"}),oe(),P()}catch(Ze){const We=Ze instanceof Error?Ze.message:"注册失败";W({title:"错误",description:We,variant:"destructive"})}},Ce=async ve=>{try{await GH(ve.id),W({title:"成功",description:"表情包已封禁"}),oe(),P()}catch(Ze){const We=Ze instanceof Error?Ze.message:"封禁失败";W({title:"错误",description:We,variant:"destructive"})}},ye=ve=>{const Ze=new Set(te);Ze.has(ve)?Ze.delete(ve):Ze.add(ve),we(Ze)},Be=()=>{te.size===e.length&&e.length>0?we(new Set):we(new Set(e.map(ve=>ve.id)))},ie=async()=>{try{const ve=await YH(Array.from(te));W({title:"批量删除完成",description:ve.message}),we(new Set),ae(!1),oe(),P()}catch(ve){W({title:"批量删除失败",description:ve instanceof Error?ve.message:"批量删除失败",variant:"destructive"})}},He=()=>{const ve=parseInt(U),Ze=Math.ceil(m/p);ve>=1&&ve<=Ze?(d(ve),q("")):W({title:"无效的页码",description:`请输入1-${Ze}之间的页码`,variant:"destructive"})},lt=n?.formats?Object.keys(n.formats):[];return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsxs("div",{className:"mb-4 sm:mb-6",children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),r.jsx(Xt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&r.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"总数"}),r.jsx(Lt,{className:"text-2xl",children:n.total})]})}),r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"已注册"}),r.jsx(Lt,{className:"text-2xl text-green-600",children:n.registered})]})}),r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"已封禁"}),r.jsx(Lt,{className:"text-2xl text-red-600",children:n.banned})]})}),r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"未注册"}),r.jsx(Lt,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),r.jsxs(ot,{children:[r.jsx(Bt,{children:r.jsxs(Lt,{className:"flex items-center gap-2",children:[r.jsx(yx,{className:"h-5 w-5"}),"搜索和筛选"]})}),r.jsxs(Vt,{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"搜索"}),r.jsxs("div",{className:"relative",children:[r.jsx(Gr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"描述或哈希值...",value:y,onChange:ve=>{b(ve.target.value),d(1)},className:"pl-8"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"注册状态"}),r.jsxs(_t,{value:j,onValueChange:ve=>{k(ve),d(1)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),r.jsx(ze,{value:"registered",children:"已注册"}),r.jsx(ze,{value:"unregistered",children:"未注册"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"封禁状态"}),r.jsxs(_t,{value:S,onValueChange:ve=>{_(ve),d(1)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),r.jsx(ze,{value:"banned",children:"已封禁"}),r.jsx(ze,{value:"unbanned",children:"未封禁"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"格式"}),r.jsxs(_t,{value:M,onValueChange:ve=>{D(ve),d(1)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),lt.map(ve=>r.jsxs(ze,{value:ve,children:[ve.toUpperCase()," (",n?.formats[ve],")"]},ve))]})]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:te.size>0&&r.jsxs("span",{children:["已选择 ",te.size," 个表情包"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:p.toString(),onValueChange:ve=>{x(parseInt(ve)),d(1),we(new Set)},children:[r.jsx(jt,{id:"emoji-page-size",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),te.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>we(new Set),children:"取消选择"}),r.jsxs(re,{variant:"destructive",size:"sm",onClick:()=>ae(!0),children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),r.jsx("div",{className:"flex justify-end pt-4 border-t",children:r.jsxs(re,{variant:"outline",size:"sm",onClick:oe,disabled:l,children:[r.jsx(Os,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"表情包列表"}),r.jsxs(tr,{children:["共 ",m," 个表情包,当前第 ",c," 页"]})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:e.length>0&&te.size===e.length,onCheckedChange:Be,"aria-label":"全选"})}),r.jsx(ct,{className:"w-16",children:"预览"}),r.jsx(ct,{children:"描述"}),r.jsx(ct,{children:"格式"}),r.jsx(ct,{children:"情绪标签"}),r.jsx(ct,{className:"text-center",children:"状态"}),r.jsx(ct,{className:"text-right",children:"使用次数"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:e.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(ve=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:te.has(ve.id),onCheckedChange:()=>ye(ve.id),"aria-label":`选择 ${ve.description}`})}),r.jsx(et,{children:r.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:e1(ve.id),alt:ve.description||"表情包",className:"w-full h-full object-cover",onError:Ze=>{const We=Ze.target;We.style.display="none";const pn=We.parentElement;pn&&(pn.innerHTML='')}})})}),r.jsx(et,{children:r.jsxs("div",{className:"space-y-1 max-w-xs",children:[r.jsx("div",{className:"font-medium truncate",title:ve.description||"无描述",children:ve.description||"无描述"}),r.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[ve.emoji_hash.slice(0,16),"..."]})]})}),r.jsx(et,{children:r.jsx(on,{variant:"outline",children:ve.format.toUpperCase()})}),r.jsx(et,{children:r.jsx(u5,{emotions:ve.emotion})}),r.jsx(et,{className:"align-middle",children:r.jsxs("div",{className:"flex gap-2 justify-center",children:[ve.is_registered&&r.jsxs(on,{variant:"default",className:"bg-green-600",children:[r.jsx(Ur,{className:"h-3 w-3 mr-1"}),"已注册"]}),ve.is_banned&&r.jsxs(on,{variant:"destructive",children:[r.jsx(px,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),r.jsx(et,{className:"text-right font-mono",children:ve.usage_count}),r.jsx(et,{children:r.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>je(ve),children:[r.jsx(hi,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Z(ve),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),!ve.is_registered&&r.jsxs(re,{size:"sm",onClick:()=>se(ve),className:"bg-green-600 hover:bg-green-700 text-white",children:[r.jsx(Ur,{className:"h-4 w-4 mr-1"}),"注册"]}),!ve.is_banned&&r.jsxs(re,{size:"sm",onClick:()=>Ce(ve),className:"bg-orange-600 hover:bg-orange-700 text-white",children:[r.jsx(Fy,{className:"h-4 w-4 mr-1"}),"封禁"]}),r.jsxs(re,{size:"sm",onClick:()=>O(ve),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ve.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3",children:e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(ve=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex gap-3",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:e1(ve.id),alt:ve.description||"表情包",className:"w-full h-full object-cover",onError:Ze=>{const We=Ze.target;We.style.display="none";const pn=We.parentElement;pn&&(pn.innerHTML='')}})})}),r.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[r.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[r.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:ve.description||"无描述",children:ve.description||"无描述"}),r.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[ve.emoji_hash.slice(0,16),"..."]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[r.jsx(on,{variant:"outline",className:"text-xs flex-shrink-0",children:ve.format.toUpperCase()}),ve.is_registered&&r.jsxs(on,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[r.jsx(Ur,{className:"h-3 w-3 mr-1"}),"已注册"]}),ve.is_banned&&r.jsxs(on,{variant:"destructive",className:"text-xs flex-shrink-0",children:[r.jsx(px,{className:"h-3 w-3 mr-1"}),"已封禁"]}),r.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",ve.usage_count]})]}),ve.emotion&&ve.emotion.length>0&&r.jsx("div",{className:"min-w-0 overflow-hidden",children:r.jsx(u5,{emotions:ve.emotion})})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>je(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(hi,{className:"h-3 w-3 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Z(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Bo,{className:"h-3 w-3 mr-1"}),"编辑"]}),!ve.is_registered&&r.jsxs(re,{size:"sm",onClick:()=>se(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-green-600 hover:bg-green-700 text-white",children:[r.jsx(Ur,{className:"h-3 w-3 mr-1"}),"注册"]}),!ve.is_banned&&r.jsxs(re,{size:"sm",onClick:()=>Ce(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-orange-600 hover:bg-orange-700 text-white",children:[r.jsx(Fy,{className:"h-3 w-3 mr-1"}),"封禁"]}),r.jsxs(re,{size:"sm",onClick:()=>O(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ve.id))}),m>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(c-1)*p+1," 到"," ",Math.min(c*p,m)," 条,共 ",m," 条"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(ve=>Math.max(1,ve-1)),disabled:c===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:U,onChange:ve=>q(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&He(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(m/p)}),r.jsx(re,{variant:"outline",size:"sm",onClick:He,disabled:!U,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(ve=>ve+1),disabled:c>=Math.ceil(m/p),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(m/p)),disabled:c>=Math.ceil(m/p),className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]})]}),r.jsx(XH,{emoji:z,open:E,onOpenChange:R}),r.jsx(KH,{emoji:z,open:H,onOpenChange:$,onSuccess:()=>{oe(),P()}})]})}),r.jsx(cn,{open:J,onOpenChange:ae,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["你确定要删除选中的 ",te.size," 个表情包吗?此操作不可撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:ie,children:"确认删除"})]})]})}),r.jsx(hr,{open:I,onOpenChange:G,children:r.jsxs(nr,{children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"确认删除"}),r.jsx(wr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>G(!1),children:"取消"}),r.jsx(re,{variant:"destructive",onClick:Ne,children:"删除"})]})]})})]})}function XH({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[90vh]",children:[r.jsx(rr,{children:r.jsx(ar,{children:"表情包详情"})}),r.jsx(Xt,{className:"max-h-[calc(90vh-8rem)] pr-4",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex justify-center",children:r.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:e1(e.id),alt:e.description||"表情包",className:"w-full h-full object-cover",onError:l=>{const o=l.target;o.style.display="none";const c=o.parentElement;c&&(c.innerHTML='')}})})}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"ID"}),r.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"格式"}),r.jsx("div",{className:"mt-1",children:r.jsx(on,{variant:"outline",children:e.format.toUpperCase()})})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"文件路径"}),r.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"哈希值"}),r.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"描述"}),e.description?r.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:r.jsx(FH,{className:"prose-sm",children:e.description})}):r.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"情绪标签"}),r.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(()=>{const l=e.emotion?e.emotion.split(/[,,]/).map(o=>o.trim()).filter(Boolean):[];return l.length>0?l.map((o,c)=>r.jsx(on,{variant:"secondary",children:o},c)):r.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})()})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"状态"}),r.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&r.jsx(on,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&r.jsx(on,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&r.jsx(on,{variant:"outline",children:"未注册"})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"使用次数"}),r.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"记录时间"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.record_time)})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"注册时间"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.register_time)})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"最后使用"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.last_used_time)})]})]})})]})})}function KH({emoji:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState(""),[c,d]=w.useState(""),[m,f]=w.useState(!1),[p,x]=w.useState(!1),[y,b]=w.useState(!1),{toast:j}=pr();w.useEffect(()=>{e&&(o(e.description||""),d(e.emotion||""),f(e.is_registered),x(e.is_banned))},[e]);const k=async()=>{if(e)try{b(!0);const S=c.split(/[,,]/).map(_=>_.trim()).filter(Boolean).join(",");await HH(e.id,{description:l||void 0,emotion:S||void 0,is_registered:m,is_banned:p}),j({title:"成功",description:"表情包信息已更新"}),n(!1),a()}catch(S){const _=S instanceof Error?S.message:"保存失败";j({title:"错误",description:_,variant:"destructive"})}finally{b(!1)}};return e?r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑表情包"}),r.jsx(wr,{children:"修改表情包的描述和标签信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"描述"}),r.jsx(vn,{value:l,onChange:S=>o(S.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"情绪标签"}),r.jsx(Te,{value:c,onChange:S=>d(S.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔(支持中英文逗号)"})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(br,{id:"is_registered",checked:m,onCheckedChange:S=>f(S===!0)}),r.jsx(Q,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(br,{id:"is_banned",checked:p,onCheckedChange:S=>x(S===!0)}),r.jsx(Q,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(re,{onClick:k,disabled:y,children:y?"保存中...":"保存"})]})]})}):null}function u5({emotions:e}){const t=e?e.split(/[,,]/).map(o=>o.trim()).filter(Boolean):[];if(t.length===0)return r.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const n=(o,c=6)=>o.length<=c?o:o.slice(0,c)+"...",a=t.slice(0,3),l=t.length-3;return r.jsxs("div",{className:"flex flex-wrap gap-1 max-w-full overflow-hidden",children:[a.map((o,c)=>r.jsx(on,{variant:"secondary",className:"text-xs flex-shrink-0",title:o,children:n(o)},c)),l>0&&r.jsxs(on,{variant:"outline",className:"text-xs flex-shrink-0",title:`还有 ${l} 个标签: ${t.slice(3).join(", ")}`,children:["+",l]})]})}const Ci="/api/webui/expression";async function QH(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await ut(`${Ci}/list?${t}`,{headers:yt()});if(!n.ok){const a=await n.json();throw new Error(a.detail||"获取表达方式列表失败")}return n.json()}async function ZH(e){const t=await ut(`${Ci}/${e}`,{headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function JH(e){const t=await ut(`${Ci}/`,{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function eU(e,t){const n=await ut(`${Ci}/${e}`,{method:"PATCH",headers:yt(),body:JSON.stringify(t)});if(!n.ok){const a=await n.json();throw new Error(a.detail||"更新表达方式失败")}return n.json()}async function tU(e){const t=await ut(`${Ci}/${e}`,{method:"DELETE",headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function nU(e){const t=await ut(`${Ci}/batch/delete`,{method:"POST",headers:yt(),body:JSON.stringify({ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除表达方式失败")}return t.json()}async function rU(){const e=await ut(`${Ci}/stats/summary`,{headers:yt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function aU(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(1),[m,f]=w.useState(20),[p,x]=w.useState(""),[y,b]=w.useState(null),[j,k]=w.useState(!1),[S,_]=w.useState(!1),[M,D]=w.useState(!1),[z,L]=w.useState(null),[E,R]=w.useState(new Set),[H,$]=w.useState(!1),[I,G]=w.useState(""),[te,we]=w.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:J}=pr(),ae=async()=>{try{a(!0);const se=await QH({page:c,page_size:m,search:p||void 0});t(se.data),o(se.total)}catch(se){J({title:"加载失败",description:se instanceof Error?se.message:"无法加载表达方式",variant:"destructive"})}finally{a(!1)}},U=async()=>{try{const se=await rU();we(se.data)}catch(se){console.error("加载统计数据失败:",se)}};w.useEffect(()=>{ae(),U()},[c,m,p]);const q=async se=>{try{const Ce=await ZH(se.id);b(Ce.data),k(!0)}catch(Ce){J({title:"加载详情失败",description:Ce instanceof Error?Ce.message:"无法加载表达方式详情",variant:"destructive"})}},W=se=>{b(se),_(!0)},oe=async se=>{try{await tU(se.id),J({title:"删除成功",description:`已删除表达方式: ${se.situation}`}),L(null),ae(),U()}catch(Ce){J({title:"删除失败",description:Ce instanceof Error?Ce.message:"无法删除表达方式",variant:"destructive"})}},P=se=>{const Ce=new Set(E);Ce.has(se)?Ce.delete(se):Ce.add(se),R(Ce)},je=()=>{E.size===e.length&&e.length>0?R(new Set):R(new Set(e.map(se=>se.id)))},Z=async()=>{try{await nU(Array.from(E)),J({title:"批量删除成功",description:`已删除 ${E.size} 个表达方式`}),R(new Set),$(!1),ae(),U()}catch(se){J({title:"批量删除失败",description:se instanceof Error?se.message:"无法批量删除表达方式",variant:"destructive"})}},O=()=>{const se=parseInt(I),Ce=Math.ceil(l/m);se>=1&&se<=Ce?(d(se),G("")):J({title:"无效的页码",description:`请输入1-${Ce}之间的页码`,variant:"destructive"})},Ne=se=>se?new Date(se*1e3).toLocaleString("zh-CN"):"-";return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsx("div",{className:"mb-4 sm:mb-6",children:r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[r.jsx(_u,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),r.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),r.jsxs(re,{onClick:()=>D(!0),className:"gap-2",children:[r.jsx(mr,{className:"h-4 w-4"}),"新增表达方式"]})]})}),r.jsx(Xt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),r.jsx("div",{className:"text-2xl font-bold mt-1",children:te.total})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:te.recent_7days})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:te.chat_count})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx(Q,{htmlFor:"search",children:"搜索"}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Gr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{id:"search",placeholder:"搜索情境、风格或上下文...",value:p,onChange:se=>x(se.target.value),className:"pl-9"})]})}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:E.size>0&&r.jsxs("span",{children:["已选择 ",E.size," 个表达方式"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:m.toString(),onValueChange:se=>{f(parseInt(se)),d(1),R(new Set)},children:[r.jsx(jt,{id:"page-size",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),E.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>R(new Set),children:"取消选择"}),r.jsxs(re,{variant:"destructive",size:"sm",onClick:()=>$(!0),children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card",children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:E.size===e.length&&e.length>0,onCheckedChange:je})}),r.jsx(ct,{children:"情境"}),r.jsx(ct,{children:"风格"}),r.jsx(ct,{children:"聊天ID"}),r.jsx(ct,{children:"最后活跃"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:n?r.jsx(Un,{children:r.jsx(et,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(se=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:E.has(se.id),onCheckedChange:()=>P(se.id)})}),r.jsx(et,{className:"font-medium max-w-xs truncate",children:se.situation}),r.jsx(et,{className:"max-w-xs truncate",children:se.style}),r.jsx(et,{className:"font-mono text-sm",children:se.chat_id}),r.jsx(et,{className:"text-sm text-muted-foreground",children:Ne(se.last_active_time)}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>q(se),children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>W(se),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>L(se),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},se.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(se=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(br,{checked:E.has(se.id),onCheckedChange:()=>P(se.id),className:"mt-1"}),r.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),r.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:se.situation,children:se.situation})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),r.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:se.style,children:se.style})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),r.jsx("p",{className:"font-mono text-xs truncate",children:se.chat_id})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),r.jsx("p",{className:"text-xs",children:Ne(se.last_active_time)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>q(se),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(qa,{className:"h-3 w-3 mr-1"}),"查看"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>W(se),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Bo,{className:"h-3 w-3 mr-1"}),"编辑"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>L(se),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[r.jsx(Ot,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},se.id))}),l>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",l," 条记录,第 ",c," / ",Math.ceil(l/m)," 页"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c-1),disabled:c===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:I,onChange:se=>G(se.target.value),onKeyDown:se=>se.key==="Enter"&&O(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(l/m)}),r.jsx(re,{variant:"outline",size:"sm",onClick:O,disabled:!I,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c+1),disabled:c>=Math.ceil(l/m),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(l/m)),disabled:c>=Math.ceil(l/m),className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]})]})}),r.jsx(sU,{expression:y,open:j,onOpenChange:k}),r.jsx(lU,{open:M,onOpenChange:D,onSuccess:()=>{ae(),U(),D(!1)}}),r.jsx(iU,{expression:y,open:S,onOpenChange:_,onSuccess:()=>{ae(),U(),_(!1)}}),r.jsx(cn,{open:!!z,onOpenChange:()=>L(null),children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除表达方式 "',z?.situation,'" 吗? 此操作不可撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>z&&oe(z),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),r.jsx(oU,{open:H,onOpenChange:$,onConfirm:Z,count:E.size})]})}function sU({expression:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"表达方式详情"}),r.jsx(wr,{children:"查看表达方式的完整信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(bo,{label:"情境",value:e.situation}),r.jsx(bo,{label:"风格",value:e.style}),r.jsx(bo,{icon:J0,label:"聊天ID",value:e.chat_id,mono:!0}),r.jsx(bo,{icon:J0,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"上下文"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"上文内容"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(bo,{icon:ui,label:"最后活跃",value:a(e.last_active_time)}),r.jsx(bo,{icon:ui,label:"创建时间",value:a(e.create_date)})]})]}),r.jsx(Yr,{children:r.jsx(re,{onClick:()=>n(!1),children:"关闭"})})]})})}function bo({icon:e,label:t,value:n,mono:a=!1}){return r.jsxs("div",{className:"space-y-1",children:[r.jsxs(Q,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&r.jsx(e,{className:"h-3 w-3"}),t]}),r.jsx("div",{className:me("text-sm",a&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function lU({open:e,onOpenChange:t,onSuccess:n}){const[a,l]=w.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[o,c]=w.useState(!1),{toast:d}=pr(),m=async()=>{if(!a.situation||!a.style||!a.chat_id){d({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{c(!0),await JH(a),d({title:"创建成功",description:"表达方式已创建"}),l({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){d({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{c(!1)}};return r.jsx(hr,{open:e,onOpenChange:t,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"新增表达方式"}),r.jsx(wr,{children:"创建新的表达方式记录"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"situation",children:["情境 ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"situation",value:a.situation,onChange:f=>l({...a,situation:f.target.value}),placeholder:"描述使用场景"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"style",children:["风格 ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"style",value:a.style,onChange:f=>l({...a,style:f.target.value}),placeholder:"描述表达风格"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"chat_id",children:["聊天ID ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"chat_id",value:a.chat_id,onChange:f=>l({...a,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"context",children:"上下文"}),r.jsx(vn,{id:"context",value:a.context,onChange:f=>l({...a,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"up_content",children:"上文内容"}),r.jsx(vn,{id:"up_content",value:a.up_content,onChange:f=>l({...a,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>t(!1),children:"取消"}),r.jsx(re,{onClick:m,disabled:o,children:o?"创建中...":"创建"})]})]})})}function iU({expression:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState({}),[c,d]=w.useState(!1),{toast:m}=pr();w.useEffect(()=>{e&&o({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{d(!0),await eU(e.id,l),m({title:"保存成功",description:"表达方式已更新"}),a()}catch(p){m({title:"保存失败",description:p instanceof Error?p.message:"无法更新表达方式",variant:"destructive"})}finally{d(!1)}};return e?r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑表达方式"}),r.jsx(wr,{children:"修改表达方式的信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_situation",children:"情境"}),r.jsx(Te,{id:"edit_situation",value:l.situation||"",onChange:p=>o({...l,situation:p.target.value}),placeholder:"描述使用场景"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_style",children:"风格"}),r.jsx(Te,{id:"edit_style",value:l.style||"",onChange:p=>o({...l,style:p.target.value}),placeholder:"描述表达风格"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_chat_id",children:"聊天ID"}),r.jsx(Te,{id:"edit_chat_id",value:l.chat_id||"",onChange:p=>o({...l,chat_id:p.target.value}),placeholder:"关联的聊天ID"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_context",children:"上下文"}),r.jsx(vn,{id:"edit_context",value:l.context||"",onChange:p=>o({...l,context:p.target.value}),placeholder:"上下文信息",rows:3})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_up_content",children:"上文内容"}),r.jsx(vn,{id:"edit_up_content",value:l.up_content||"",onChange:p=>o({...l,up_content:p.target.value}),placeholder:"上文内容",rows:3})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(re,{onClick:f,disabled:c,children:c?"保存中...":"保存"})]})]})}):null}function oU({open:e,onOpenChange:t,onConfirm:n,count:a}){return r.jsx(cn,{open:e,onOpenChange:t,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["您即将删除 ",a," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const tc="/api/webui/person";async function cU(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await ut(`${tc}/list?${t}`,{headers:yt()});if(!n.ok){const a=await n.json();throw new Error(a.detail||"获取人物列表失败")}return n.json()}async function uU(e){const t=await ut(`${tc}/${e}`,{headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function dU(e,t){const n=await ut(`${tc}/${e}`,{method:"PATCH",headers:yt(),body:JSON.stringify(t)});if(!n.ok){const a=await n.json();throw new Error(a.detail||"更新人物信息失败")}return n.json()}async function mU(e){const t=await ut(`${tc}/${e}`,{method:"DELETE",headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function hU(){const e=await ut(`${tc}/stats/summary`,{headers:yt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}async function fU(e){const t=await ut(`${tc}/batch/delete`,{method:"POST",headers:yt(),body:JSON.stringify({person_ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除失败")}return t.json()}function pU(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(1),[m,f]=w.useState(20),[p,x]=w.useState(""),[y,b]=w.useState(void 0),[j,k]=w.useState(void 0),[S,_]=w.useState(null),[M,D]=w.useState(!1),[z,L]=w.useState(!1),[E,R]=w.useState(null),[H,$]=w.useState({total:0,known:0,unknown:0,platforms:{}}),[I,G]=w.useState(new Set),[te,we]=w.useState(!1),[J,ae]=w.useState(""),{toast:U}=pr(),q=async()=>{try{a(!0);const ie=await cU({page:c,page_size:m,search:p||void 0,is_known:y,platform:j});t(ie.data),o(ie.total)}catch(ie){U({title:"加载失败",description:ie instanceof Error?ie.message:"无法加载人物信息",variant:"destructive"})}finally{a(!1)}},W=async()=>{try{const ie=await hU();$(ie.data)}catch(ie){console.error("加载统计数据失败:",ie)}};w.useEffect(()=>{q(),W()},[c,m,p,y,j]);const oe=async ie=>{try{const He=await uU(ie.person_id);_(He.data),D(!0)}catch(He){U({title:"加载详情失败",description:He instanceof Error?He.message:"无法加载人物详情",variant:"destructive"})}},P=ie=>{_(ie),L(!0)},je=async ie=>{try{await mU(ie.person_id),U({title:"删除成功",description:`已删除人物信息: ${ie.person_name||ie.nickname||ie.user_id}`}),R(null),q(),W()}catch(He){U({title:"删除失败",description:He instanceof Error?He.message:"无法删除人物信息",variant:"destructive"})}},Z=w.useMemo(()=>Object.keys(H.platforms),[H.platforms]),O=ie=>{const He=new Set(I);He.has(ie)?He.delete(ie):He.add(ie),G(He)},Ne=()=>{I.size===e.length&&e.length>0?G(new Set):G(new Set(e.map(ie=>ie.person_id)))},se=()=>{if(I.size===0){U({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}we(!0)},Ce=async()=>{try{const ie=await fU(Array.from(I));U({title:"批量删除完成",description:ie.message}),G(new Set),we(!1),q(),W()}catch(ie){U({title:"批量删除失败",description:ie instanceof Error?ie.message:"批量删除失败",variant:"destructive"})}},ye=()=>{const ie=parseInt(J),He=Math.ceil(l/m);ie>=1&&ie<=He?(d(ie),ae("")):U({title:"无效的页码",description:`请输入1-${He}之间的页码`,variant:"destructive"})},Be=ie=>ie?new Date(ie*1e3).toLocaleString("zh-CN"):"-";return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsx("div",{className:"mb-4 sm:mb-6",children:r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[r.jsx(yT,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),r.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),r.jsx(Xt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),r.jsx("div",{className:"text-2xl font-bold mt-1",children:H.total})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:H.known})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:H.unknown})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx(Q,{htmlFor:"search",children:"搜索"}),r.jsxs("div",{className:"relative mt-1.5",children:[r.jsx(Gr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:p,onChange:ie=>x(ie.target.value),className:"pl-9"})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"filter-known",children:"认识状态"}),r.jsxs(_t,{value:y===void 0?"all":y.toString(),onValueChange:ie=>{b(ie==="all"?void 0:ie==="true"),d(1)},children:[r.jsx(jt,{id:"filter-known",className:"mt-1.5",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),r.jsx(ze,{value:"true",children:"已认识"}),r.jsx(ze,{value:"false",children:"未认识"})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"filter-platform",children:"平台"}),r.jsxs(_t,{value:j||"all",onValueChange:ie=>{k(ie==="all"?void 0:ie),d(1)},children:[r.jsx(jt,{id:"filter-platform",className:"mt-1.5",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部平台"}),Z.map(ie=>r.jsxs(ze,{value:ie,children:[ie," (",H.platforms[ie],")"]},ie))]})]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:I.size>0&&r.jsxs("span",{children:["已选择 ",I.size," 个人物"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:m.toString(),onValueChange:ie=>{f(parseInt(ie)),d(1),G(new Set)},children:[r.jsx(jt,{id:"page-size",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),I.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>G(new Set),children:"取消选择"}),r.jsxs(re,{variant:"destructive",size:"sm",onClick:se,children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card",children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:e.length>0&&I.size===e.length,onCheckedChange:Ne,"aria-label":"全选"})}),r.jsx(ct,{children:"状态"}),r.jsx(ct,{children:"名称"}),r.jsx(ct,{children:"昵称"}),r.jsx(ct,{children:"平台"}),r.jsx(ct,{children:"用户ID"}),r.jsx(ct,{children:"最后更新"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:n?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(ie=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:I.has(ie.person_id),onCheckedChange:()=>O(ie.person_id),"aria-label":`选择 ${ie.person_name||ie.nickname||ie.user_id}`})}),r.jsx(et,{children:r.jsx("div",{className:me("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",ie.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:ie.is_known?"已认识":"未认识"})}),r.jsx(et,{className:"font-medium",children:ie.person_name||r.jsx("span",{className:"text-muted-foreground",children:"-"})}),r.jsx(et,{children:ie.nickname||"-"}),r.jsx(et,{children:ie.platform}),r.jsx(et,{className:"font-mono text-sm",children:ie.user_id}),r.jsx(et,{className:"text-sm text-muted-foreground",children:Be(ie.last_know)}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>oe(ie),children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>P(ie),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>R(ie),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ie.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(ie=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(br,{checked:I.has(ie.person_id),onCheckedChange:()=>O(ie.person_id),className:"mt-1"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:me("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",ie.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:ie.is_known?"已认识":"未认识"}),r.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:ie.person_name||r.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),ie.nickname&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",ie.nickname]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),r.jsx("p",{className:"font-medium text-xs",children:ie.platform})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),r.jsx("p",{className:"font-mono text-xs truncate",title:ie.user_id,children:ie.user_id})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),r.jsx("p",{className:"text-xs",children:Be(ie.last_know)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>oe(ie),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(qa,{className:"h-3 w-3 mr-1"}),"查看"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>P(ie),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Bo,{className:"h-3 w-3 mr-1"}),"编辑"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>R(ie),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[r.jsx(Ot,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ie.id))}),l>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",l," 条记录,第 ",c," / ",Math.ceil(l/m)," 页"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c-1),disabled:c===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:J,onChange:ie=>ae(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&ye(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(l/m)}),r.jsx(re,{variant:"outline",size:"sm",onClick:ye,disabled:!J,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c+1),disabled:c>=Math.ceil(l/m),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(l/m)),disabled:c>=Math.ceil(l/m),className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]})]})}),r.jsx(xU,{person:S,open:M,onOpenChange:D}),r.jsx(gU,{person:S,open:z,onOpenChange:L,onSuccess:()=>{q(),W(),L(!1)}}),r.jsx(cn,{open:!!E,onOpenChange:()=>R(null),children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>E&&je(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),r.jsx(cn,{open:te,onOpenChange:we,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["确定要删除选中的 ",I.size," 个人物信息吗? 此操作不可撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:Ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function xU({person:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"人物详情"}),r.jsxs(wr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(Es,{icon:Z5,label:"人物名称",value:e.person_name}),r.jsx(Es,{icon:_u,label:"昵称",value:e.nickname}),r.jsx(Es,{icon:J0,label:"用户ID",value:e.user_id,mono:!0}),r.jsx(Es,{icon:J0,label:"人物ID",value:e.person_id,mono:!0}),r.jsx(Es,{label:"平台",value:e.platform}),r.jsx(Es,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),r.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"个人印象"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"群昵称"}),r.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((l,o)=>r.jsxs("div",{className:"text-sm flex items-center gap-2",children:[r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:l.group_id}),r.jsx("span",{children:"→"}),r.jsx("span",{children:l.group_nick_name})]},o))})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsx(Es,{icon:ui,label:"认识时间",value:a(e.know_times)}),r.jsx(Es,{icon:ui,label:"首次记录",value:a(e.know_since)}),r.jsx(Es,{icon:ui,label:"最后更新",value:a(e.last_know)})]})]}),r.jsx(Yr,{children:r.jsx(re,{onClick:()=>n(!1),children:"关闭"})})]})})}function Es({icon:e,label:t,value:n,mono:a=!1}){return r.jsxs("div",{className:"space-y-1",children:[r.jsxs(Q,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&r.jsx(e,{className:"h-3 w-3"}),t]}),r.jsx("div",{className:me("text-sm",a&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function gU({person:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState({}),[c,d]=w.useState(!1),{toast:m}=pr();w.useEffect(()=>{e&&o({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{d(!0),await dU(e.person_id,l),m({title:"保存成功",description:"人物信息已更新"}),a()}catch(p){m({title:"保存失败",description:p instanceof Error?p.message:"无法更新人物信息",variant:"destructive"})}finally{d(!1)}};return e?r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑人物信息"}),r.jsxs(wr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"person_name",children:"人物名称"}),r.jsx(Te,{id:"person_name",value:l.person_name||"",onChange:p=>o({...l,person_name:p.target.value}),placeholder:"为这个人设置一个名称"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称"}),r.jsx(Te,{id:"nickname",value:l.nickname||"",onChange:p=>o({...l,nickname:p.target.value}),placeholder:"昵称"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"name_reason",children:"名称设定原因"}),r.jsx(vn,{id:"name_reason",value:l.name_reason||"",onChange:p=>o({...l,name_reason:p.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"memory_points",children:"个人印象"}),r.jsx(vn,{id:"memory_points",value:l.memory_points||"",onChange:p=>o({...l,memory_points:p.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),r.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),r.jsx(gt,{id:"is_known",checked:l.is_known,onCheckedChange:p=>o({...l,is_known:p})})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(re,{onClick:f,disabled:c,children:c?"保存中...":"保存"})]})]})}):null}function vU(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const yU={},ru={};function ci(e,t){try{const a=(yU[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return a in ru?ru[a]:d5(a,a.split(":"))}catch{if(e in ru)return ru[e];const n=e?.match(bU);return n?d5(e,n.slice(1)):NaN}}const bU=/([+-]\d\d):?(\d\d)?/;function d5(e,t){const n=+(t[0]||0),a=+(t[1]||0),l=+(t[2]||0)/60;return ru[e]=n*60+a>0?n*60+a+l:n*60-a-l}class ns extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ci(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),i9(this),t1(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new ns(...n,t):new ns(Date.now(),t)}withTimeZone(t){return new ns(+this,t)}getTimezoneOffset(){const t=-ci(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),t1(this),+this}[Symbol.for("constructDateFrom")](t){return new ns(+new Date(t),this.timeZone)}}const m5=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!m5.test(e))return;const t=e.replace(m5,"$1UTC");ns.prototype[t]&&(e.startsWith("get")?ns.prototype[e]=function(){return this.internal[t]()}:(ns.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),wU(this),+this},ns.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),t1(this),+this}))});function t1(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ci(e.timeZone,e)*60))}function wU(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),i9(e)}function i9(e){const t=ci(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);const l=-new Date(+e).getTimezoneOffset(),o=-new Date(+a).getTimezoneOffset(),c=l-o,d=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();c&&d&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+c);const m=l-n;m&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);const f=new Date(+e);f.setUTCSeconds(0);const p=l>0?f.getSeconds():(f.getSeconds()-60)%60,x=Math.round(-(ci(e.timeZone,e)*60))%60;(x||p)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+x+p));const y=ci(e.timeZone,e),b=y>0?Math.floor(y):Math.ceil(y),k=-new Date(+e).getTimezoneOffset()-b,S=b!==n,_=k-m;if(S&&_){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+_);const M=ci(e.timeZone,e),D=M>0?Math.floor(M):Math.ceil(M),z=b-D;z&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+z),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+z))}}class xr extends ns{static tz(t,...n){return n.length?new xr(...n,t):new xr(Date.now(),t)}toISOString(){const[t,n,a]=this.tzComponents(),l=`${t}${n}:${a}`;return this.internal.toISOString().slice(0,-1)+l}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,a,l]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${a} ${n} ${l}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,a,l]=this.tzComponents();return`${t} GMT${n}${a}${l} (${vU(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",a=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),l=String(Math.abs(t)%60).padStart(2,"0");return[n,a,l]}withTimeZone(t){return new xr(+this,t)}[Symbol.for("constructDateFrom")](t){return new xr(+new Date(t),this.timeZone)}}const o9=6048e5,jU=864e5,h5=Symbol.for("constructDateFrom");function $n(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&h5 in e?e[h5](t):e instanceof Date?new e.constructor(t):new Date(t)}function un(e,t){return $n(t||e,e)}function c9(e,t,n){const a=un(e,n?.in);return isNaN(t)?$n(e,NaN):(t&&a.setDate(a.getDate()+t),a)}function u9(e,t,n){const a=un(e,n?.in);if(isNaN(t))return $n(e,NaN);if(!t)return a;const l=a.getDate(),o=$n(e,a.getTime());o.setMonth(a.getMonth()+t+1,0);const c=o.getDate();return l>=c?o:(a.setFullYear(o.getFullYear(),o.getMonth(),l),a)}let NU={};function Xu(){return NU}function Al(e,t){const n=Xu(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=un(e,t?.in),o=l.getDay(),c=(o=o.getTime()?a+1:n.getTime()>=d.getTime()?a:a-1}function f5(e){const t=un(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ti(e,...t){const n=$n.bind(null,e||t.find(a=>typeof a=="object"));return t.map(n)}function Nu(e,t){const n=un(e,t?.in);return n.setHours(0,0,0,0),n}function m9(e,t,n){const[a,l]=Ti(n?.in,e,t),o=Nu(a),c=Nu(l),d=+o-f5(o),m=+c-f5(c);return Math.round((d-m)/jU)}function SU(e,t){const n=d9(e,t),a=$n(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),ju(a)}function kU(e,t,n){return c9(e,t*7,n)}function CU(e,t,n){return u9(e,t*12,n)}function TU(e,t){let n,a=t?.in;return e.forEach(l=>{!a&&typeof l=="object"&&(a=$n.bind(null,l));const o=un(l,a);(!n||n{!a&&typeof l=="object"&&(a=$n.bind(null,l));const o=un(l,a);(!n||n>o||isNaN(+o))&&(n=o)}),$n(a,n||NaN)}function MU(e,t,n){const[a,l]=Ti(n?.in,e,t);return+Nu(a)==+Nu(l)}function h9(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function EU(e){return!(!h9(e)&&typeof e!="number"||isNaN(+un(e)))}function AU(e,t,n){const[a,l]=Ti(n?.in,e,t),o=a.getFullYear()-l.getFullYear(),c=a.getMonth()-l.getMonth();return o*12+c}function DU(e,t){const n=un(e,t?.in),a=n.getMonth();return n.setFullYear(n.getFullYear(),a+1,0),n.setHours(23,59,59,999),n}function f9(e,t){const[n,a]=Ti(e,t.start,t.end);return{start:n,end:a}}function zU(e,t){const{start:n,end:a}=f9(t?.in,e);let l=+n>+a;const o=l?+n:+a,c=l?a:n;c.setHours(0,0,0,0),c.setDate(1);let d=1;const m=[];for(;+c<=o;)m.push($n(n,c)),c.setMonth(c.getMonth()+d);return l?m.reverse():m}function OU(e,t){const n=un(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function RU(e,t){const n=un(e,t?.in),a=n.getFullYear();return n.setFullYear(a+1,0,0),n.setHours(23,59,59,999),n}function p9(e,t){const n=un(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function BU(e,t){const{start:n,end:a}=f9(t?.in,e);let l=+n>+a;const o=l?+n:+a,c=l?a:n;c.setHours(0,0,0,0),c.setMonth(0,1);let d=1;const m=[];for(;+c<=o;)m.push($n(n,c)),c.setFullYear(c.getFullYear()+d);return l?m.reverse():m}function x9(e,t){const n=Xu(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=un(e,t?.in),o=l.getDay(),c=(o{let a;const l=PU[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Oo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const IU={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qU={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},HU={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},UU={date:Oo({formats:IU,defaultWidth:"full"}),time:Oo({formats:qU,defaultWidth:"full"}),dateTime:Oo({formats:HU,defaultWidth:"full"})},$U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},VU=(e,t,n,a)=>$U[e];function Za(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let l;if(a==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=n?.width?String(n.width):c;l=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n?.width?String(n.width):e.defaultWidth;l=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return l[o]}}const GU={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YU={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},WU={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XU={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},KU={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},QU={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZU=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},JU={ordinalNumber:ZU,era:Za({values:GU,defaultWidth:"wide"}),quarter:Za({values:YU,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Za({values:WU,defaultWidth:"wide"}),day:Za({values:XU,defaultWidth:"wide"}),dayPeriod:Za({values:KU,defaultWidth:"wide",formattingValues:QU,defaultFormattingWidth:"wide"})};function Ja(e){return(t,n={})=>{const a=n.width,l=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(l);if(!o)return null;const c=o[0],d=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?t$(d,x=>x.test(c)):e$(d,x=>x.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=n.valueCallback?n.valueCallback(f):f;const p=t.slice(c.length);return{value:f,rest:p}}}function e$(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function t$(e,t){for(let n=0;n{const a=t.match(e.matchPattern);if(!a)return null;const l=a[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(l.length);return{value:c,rest:d}}}const n$=/^(\d+)(th|st|nd|rd)?/i,r$=/\d+/i,a$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},s$={any:[/^b/i,/^(a|c)/i]},l$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},i$={any:[/1/i,/2/i,/3/i,/4/i]},o$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},c$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},u$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},m$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},h$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},f$={ordinalNumber:g9({matchPattern:n$,parsePattern:r$,valueCallback:e=>parseInt(e,10)}),era:Ja({matchPatterns:a$,defaultMatchWidth:"wide",parsePatterns:s$,defaultParseWidth:"any"}),quarter:Ja({matchPatterns:l$,defaultMatchWidth:"wide",parsePatterns:i$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ja({matchPatterns:o$,defaultMatchWidth:"wide",parsePatterns:c$,defaultParseWidth:"any"}),day:Ja({matchPatterns:u$,defaultMatchWidth:"wide",parsePatterns:d$,defaultParseWidth:"any"}),dayPeriod:Ja({matchPatterns:m$,defaultMatchWidth:"any",parsePatterns:h$,defaultParseWidth:"any"})},Cg={code:"en-US",formatDistance:FU,formatLong:UU,formatRelative:VU,localize:JU,match:f$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function p$(e,t){const n=un(e,t?.in);return m9(n,p9(n))+1}function v9(e,t){const n=un(e,t?.in),a=+ju(n)-+SU(n);return Math.round(a/o9)+1}function y9(e,t){const n=un(e,t?.in),a=n.getFullYear(),l=Xu(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,c=$n(t?.in||e,0);c.setFullYear(a+1,0,o),c.setHours(0,0,0,0);const d=Al(c,t),m=$n(t?.in||e,0);m.setFullYear(a,0,o),m.setHours(0,0,0,0);const f=Al(m,t);return+n>=+d?a+1:+n>=+f?a:a-1}function x$(e,t){const n=Xu(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,l=y9(e,t),o=$n(t?.in||e,0);return o.setFullYear(l,0,a),o.setHours(0,0,0,0),Al(o,t)}function b9(e,t){const n=un(e,t?.in),a=+Al(n,t)-+x$(n,t);return Math.round(a/o9)+1}function Wt(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const bl={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return Wt(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Wt(n+1,2)},d(e,t){return Wt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Wt(e.getHours()%12||12,t.length)},H(e,t){return Wt(e.getHours(),t.length)},m(e,t){return Wt(e.getMinutes(),t.length)},s(e,t){return Wt(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),l=Math.trunc(a*Math.pow(10,n-3));return Wt(l,t.length)}},wo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},p5={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),l=a>0?a:1-a;return n.ordinalNumber(l,{unit:"year"})}return bl.y(e,t)},Y:function(e,t,n,a){const l=y9(e,a),o=l>0?l:1-l;if(t==="YY"){const c=o%100;return Wt(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Wt(o,t.length)},R:function(e,t){const n=d9(e);return Wt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Wt(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Wt(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Wt(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return bl.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Wt(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const l=b9(e,a);return t==="wo"?n.ordinalNumber(l,{unit:"week"}):Wt(l,t.length)},I:function(e,t,n){const a=v9(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):Wt(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):bl.d(e,t)},D:function(e,t,n){const a=p$(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):Wt(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const l=e.getDay(),o=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Wt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const l=e.getDay(),o=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Wt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return Wt(l,t.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const l=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let l;switch(a===12?l=wo.noon:a===0?l=wo.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let l;switch(a>=17?l=wo.evening:a>=12?l=wo.afternoon:a>=4?l=wo.morning:l=wo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return bl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):bl.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):Wt(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):Wt(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):bl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):bl.s(e,t)},S:function(e,t){return bl.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return g5(a);case"XXXX":case"XX":return ii(a);case"XXXXX":case"XXX":default:return ii(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return g5(a);case"xxxx":case"xx":return ii(a);case"xxxxx":case"xxx":default:return ii(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x5(a,":");case"OOOO":default:return"GMT"+ii(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x5(a,":");case"zzzz":default:return"GMT"+ii(a,":")}},t:function(e,t,n){const a=Math.trunc(+e/1e3);return Wt(a,t.length)},T:function(e,t,n){return Wt(+e,t.length)}};function x5(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),l=Math.trunc(a/60),o=a%60;return o===0?n+String(l):n+String(l)+t+Wt(o,2)}function g5(e,t){return e%60===0?(e>0?"-":"+")+Wt(Math.abs(e)/60,2):ii(e,t)}function ii(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),l=Wt(Math.trunc(a/60),2),o=Wt(a%60,2);return n+l+t+o}const v5=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},w9=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},g$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],l=n[2];if(!l)return v5(e,t);let o;switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",v5(a,t)).replace("{{time}}",w9(l,t))},v$={p:w9,P:g$},y$=/^D+$/,b$=/^Y+$/,w$=["D","DD","YY","YYYY"];function j$(e){return y$.test(e)}function N$(e){return b$.test(e)}function S$(e,t,n){const a=k$(e,t,n);if(console.warn(a),w$.includes(e))throw new RangeError(a)}function k$(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const C$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,T$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_$=/^'([^]*?)'?$/,M$=/''/g,E$=/[a-zA-Z]/;function X0(e,t,n){const a=Xu(),l=n?.locale??a.locale??Cg,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,d=un(e,n?.in);if(!EU(d))throw new RangeError("Invalid time value");let m=t.match(T$).map(p=>{const x=p[0];if(x==="p"||x==="P"){const y=v$[x];return y(p,l.formatLong)}return p}).join("").match(C$).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const x=p[0];if(x==="'")return{isToken:!1,value:A$(p)};if(p5[x])return{isToken:!0,value:p};if(x.match(E$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:p}});l.localize.preprocessor&&(m=l.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:l};return m.map(p=>{if(!p.isToken)return p.value;const x=p.value;(!n?.useAdditionalWeekYearTokens&&N$(x)||!n?.useAdditionalDayOfYearTokens&&j$(x))&&S$(x,t,String(e));const y=p5[x[0]];return y(d,x,l.localize,f)}).join("")}function A$(e){const t=e.match(_$);return t?t[1].replace(M$,"'"):e}function D$(e,t){const n=un(e,t?.in),a=n.getFullYear(),l=n.getMonth(),o=$n(n,0);return o.setFullYear(a,l+1,0),o.setHours(0,0,0,0),o.getDate()}function z$(e,t){return un(e,t?.in).getMonth()}function O$(e,t){return un(e,t?.in).getFullYear()}function R$(e,t){return+un(e)>+un(t)}function B$(e,t){return+un(e)<+un(t)}function L$(e,t,n){const[a,l]=Ti(n?.in,e,t);return+Al(a,n)==+Al(l,n)}function P$(e,t,n){const[a,l]=Ti(n?.in,e,t);return a.getFullYear()===l.getFullYear()&&a.getMonth()===l.getMonth()}function F$(e,t,n){const[a,l]=Ti(n?.in,e,t);return a.getFullYear()===l.getFullYear()}function I$(e,t,n){const a=un(e,n?.in),l=a.getFullYear(),o=a.getDate(),c=$n(e,0);c.setFullYear(l,t,15),c.setHours(0,0,0,0);const d=D$(c);return a.setMonth(t,Math.min(o,d)),a}function q$(e,t,n){const a=un(e,n?.in);return isNaN(+a)?$n(e,NaN):(a.setFullYear(t),a)}const y5=5,H$=4;function U$(e,t){const n=t.startOfMonth(e),a=n.getDay()>0?n.getDay():7,l=t.addDays(e,-a+1),o=t.addDays(l,y5*7-1);return t.getMonth(e)===t.getMonth(o)?y5:H$}function j9(e,t){const n=t.startOfMonth(e),a=n.getDay();return a===1?n:a===0?t.addDays(n,-6):t.addDays(n,-1*(a-1))}function $$(e,t){const n=j9(e,t),a=U$(e,t);return t.addDays(n,a*7-1)}class ma{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?xr.tz(this.options.timeZone):new this.Date,this.newDate=(a,l,o)=>this.overrides?.newDate?this.overrides.newDate(a,l,o):this.options.timeZone?new xr(a,l,o,this.options.timeZone):new Date(a,l,o),this.addDays=(a,l)=>this.overrides?.addDays?this.overrides.addDays(a,l):c9(a,l),this.addMonths=(a,l)=>this.overrides?.addMonths?this.overrides.addMonths(a,l):u9(a,l),this.addWeeks=(a,l)=>this.overrides?.addWeeks?this.overrides.addWeeks(a,l):kU(a,l),this.addYears=(a,l)=>this.overrides?.addYears?this.overrides.addYears(a,l):CU(a,l),this.differenceInCalendarDays=(a,l)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(a,l):m9(a,l),this.differenceInCalendarMonths=(a,l)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(a,l):AU(a,l),this.eachMonthOfInterval=a=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(a):zU(a),this.eachYearOfInterval=a=>{const l=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(a):BU(a),o=new Set(l.map(d=>this.getYear(d)));if(o.size===l.length)return l;const c=[];return o.forEach(d=>{c.push(new Date(d,0,1))}),c},this.endOfBroadcastWeek=a=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(a):$$(a,this),this.endOfISOWeek=a=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(a):LU(a),this.endOfMonth=a=>this.overrides?.endOfMonth?this.overrides.endOfMonth(a):DU(a),this.endOfWeek=(a,l)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(a,l):x9(a,this.options),this.endOfYear=a=>this.overrides?.endOfYear?this.overrides.endOfYear(a):RU(a),this.format=(a,l,o)=>{const c=this.overrides?.format?this.overrides.format(a,l,this.options):X0(a,l,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(c):c},this.getISOWeek=a=>this.overrides?.getISOWeek?this.overrides.getISOWeek(a):v9(a),this.getMonth=(a,l)=>this.overrides?.getMonth?this.overrides.getMonth(a,this.options):z$(a,this.options),this.getYear=(a,l)=>this.overrides?.getYear?this.overrides.getYear(a,this.options):O$(a,this.options),this.getWeek=(a,l)=>this.overrides?.getWeek?this.overrides.getWeek(a,this.options):b9(a,this.options),this.isAfter=(a,l)=>this.overrides?.isAfter?this.overrides.isAfter(a,l):R$(a,l),this.isBefore=(a,l)=>this.overrides?.isBefore?this.overrides.isBefore(a,l):B$(a,l),this.isDate=a=>this.overrides?.isDate?this.overrides.isDate(a):h9(a),this.isSameDay=(a,l)=>this.overrides?.isSameDay?this.overrides.isSameDay(a,l):MU(a,l),this.isSameMonth=(a,l)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(a,l):P$(a,l),this.isSameYear=(a,l)=>this.overrides?.isSameYear?this.overrides.isSameYear(a,l):F$(a,l),this.max=a=>this.overrides?.max?this.overrides.max(a):TU(a),this.min=a=>this.overrides?.min?this.overrides.min(a):_U(a),this.setMonth=(a,l)=>this.overrides?.setMonth?this.overrides.setMonth(a,l):I$(a,l),this.setYear=(a,l)=>this.overrides?.setYear?this.overrides.setYear(a,l):q$(a,l),this.startOfBroadcastWeek=(a,l)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(a,this):j9(a,this),this.startOfDay=a=>this.overrides?.startOfDay?this.overrides.startOfDay(a):Nu(a),this.startOfISOWeek=a=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(a):ju(a),this.startOfMonth=a=>this.overrides?.startOfMonth?this.overrides.startOfMonth(a):OU(a),this.startOfWeek=(a,l)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(a,this.options):Al(a,this.options),this.startOfYear=a=>this.overrides?.startOfYear?this.overrides.startOfYear(a):p9(a),this.options={locale:Cg,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),a={};for(let l=0;l<10;l++)a[l.toString()]=n.format(l);return a}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,a=>n[a]||a)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ma.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:a,numerals:l}=this.options,o=n?.code;if(o&&ma.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:a,numberingSystem:l}).format(t)}catch{}const c=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,c)}}ma.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const cs=new ma;class N9{constructor(t,n,a=cs){this.date=t,this.displayMonth=n,this.outside=!!(n&&!a.isSameMonth(t,n)),this.dateLib=a}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class V${constructor(t,n){this.date=t,this.weeks=n}}class G${constructor(t,n){this.days=n,this.weekNumber=t}}function Y$(e){return Fe.createElement("button",{...e})}function W$(e){return Fe.createElement("span",{...e})}function X$(e){const{size:t=24,orientation:n="left",className:a}=e;return Fe.createElement("svg",{className:a,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Fe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Fe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Fe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Fe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function K$(e){const{day:t,modifiers:n,...a}=e;return Fe.createElement("td",{...a})}function Q$(e){const{day:t,modifiers:n,...a}=e,l=Fe.useRef(null);return Fe.useEffect(()=>{n.focused&&l.current?.focus()},[n.focused]),Fe.createElement("button",{ref:l,...a})}var Xe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Xe||(Xe={}));var Tn;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Tn||(Tn={}));var Fa;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Fa||(Fa={}));var oa;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(oa||(oa={}));function Z$(e){const{options:t,className:n,components:a,classNames:l,...o}=e,c=[l[Xe.Dropdown],n].join(" "),d=t?.find(({value:m})=>m===o.value);return Fe.createElement("span",{"data-disabled":o.disabled,className:l[Xe.DropdownRoot]},Fe.createElement(a.Select,{className:c,...o},t?.map(({value:m,label:f,disabled:p})=>Fe.createElement(a.Option,{key:m,value:m,disabled:p},f))),Fe.createElement("span",{className:l[Xe.CaptionLabel],"aria-hidden":!0},d?.label,Fe.createElement(a.Chevron,{orientation:"down",size:18,className:l[Xe.Chevron]})))}function J$(e){return Fe.createElement("div",{...e})}function eV(e){return Fe.createElement("div",{...e})}function tV(e){const{calendarMonth:t,displayIndex:n,...a}=e;return Fe.createElement("div",{...a},e.children)}function nV(e){const{calendarMonth:t,displayIndex:n,...a}=e;return Fe.createElement("div",{...a})}function rV(e){return Fe.createElement("table",{...e})}function aV(e){return Fe.createElement("div",{...e})}const S9=w.createContext(void 0);function Ku(){const e=w.useContext(S9);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function sV(e){const{components:t}=Ku();return Fe.createElement(t.Dropdown,{...e})}function lV(e){const{onPreviousClick:t,onNextClick:n,previousMonth:a,nextMonth:l,...o}=e,{components:c,classNames:d,labels:{labelPrevious:m,labelNext:f}}=Ku(),p=w.useCallback(y=>{l&&n?.(y)},[l,n]),x=w.useCallback(y=>{a&&t?.(y)},[a,t]);return Fe.createElement("nav",{...o},Fe.createElement(c.PreviousMonthButton,{type:"button",className:d[Xe.PreviousMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":m(a),onClick:x},Fe.createElement(c.Chevron,{disabled:a?void 0:!0,className:d[Xe.Chevron],orientation:"left"})),Fe.createElement(c.NextMonthButton,{type:"button",className:d[Xe.NextMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":f(l),onClick:p},Fe.createElement(c.Chevron,{disabled:l?void 0:!0,orientation:"right",className:d[Xe.Chevron]})))}function iV(e){const{components:t}=Ku();return Fe.createElement(t.Button,{...e})}function oV(e){return Fe.createElement("option",{...e})}function cV(e){const{components:t}=Ku();return Fe.createElement(t.Button,{...e})}function uV(e){const{rootRef:t,...n}=e;return Fe.createElement("div",{...n,ref:t})}function dV(e){return Fe.createElement("select",{...e})}function mV(e){const{week:t,...n}=e;return Fe.createElement("tr",{...n})}function hV(e){return Fe.createElement("th",{...e})}function fV(e){return Fe.createElement("thead",{"aria-hidden":!0},Fe.createElement("tr",{...e}))}function pV(e){const{week:t,...n}=e;return Fe.createElement("th",{...n})}function xV(e){return Fe.createElement("th",{...e})}function gV(e){return Fe.createElement("tbody",{...e})}function vV(e){const{components:t}=Ku();return Fe.createElement(t.Dropdown,{...e})}const yV=Object.freeze(Object.defineProperty({__proto__:null,Button:Y$,CaptionLabel:W$,Chevron:X$,Day:K$,DayButton:Q$,Dropdown:Z$,DropdownNav:J$,Footer:eV,Month:tV,MonthCaption:nV,MonthGrid:rV,Months:aV,MonthsDropdown:sV,Nav:lV,NextMonthButton:iV,Option:oV,PreviousMonthButton:cV,Root:uV,Select:dV,Week:mV,WeekNumber:pV,WeekNumberHeader:xV,Weekday:hV,Weekdays:fV,Weeks:gV,YearsDropdown:vV},Symbol.toStringTag,{value:"Module"}));function Ds(e,t,n=!1,a=cs){let{from:l,to:o}=e;const{differenceInCalendarDays:c,isSameDay:d}=a;return l&&o?(c(o,l)<0&&([l,o]=[o,l]),c(t,l)>=(n?1:0)&&c(o,t)>=(n?1:0)):!n&&o?d(o,t):!n&&l?d(l,t):!1}function k9(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Tg(e){return!!(e&&typeof e=="object"&&"from"in e)}function C9(e){return!!(e&&typeof e=="object"&&"after"in e)}function T9(e){return!!(e&&typeof e=="object"&&"before"in e)}function _9(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function M9(e,t){return Array.isArray(e)&&e.every(t.isDate)}function zs(e,t,n=cs){const a=Array.isArray(t)?t:[t],{isSameDay:l,differenceInCalendarDays:o,isAfter:c}=n;return a.some(d=>{if(typeof d=="boolean")return d;if(n.isDate(d))return l(e,d);if(M9(d,n))return d.includes(e);if(Tg(d))return Ds(d,e,!1,n);if(_9(d))return Array.isArray(d.dayOfWeek)?d.dayOfWeek.includes(e.getDay()):d.dayOfWeek===e.getDay();if(k9(d)){const m=o(d.before,e),f=o(d.after,e),p=m>0,x=f<0;return c(d.before,d.after)?x&&p:p||x}return C9(d)?o(e,d.after)>0:T9(d)?o(d.before,e)>0:typeof d=="function"?d(e):!1})}function bV(e,t,n,a,l){const{disabled:o,hidden:c,modifiers:d,showOutsideDays:m,broadcastCalendar:f,today:p}=t,{isSameDay:x,isSameMonth:y,startOfMonth:b,isBefore:j,endOfMonth:k,isAfter:S}=l,_=n&&b(n),M=a&&k(a),D={[Tn.focused]:[],[Tn.outside]:[],[Tn.disabled]:[],[Tn.hidden]:[],[Tn.today]:[]},z={};for(const L of e){const{date:E,displayMonth:R}=L,H=!!(R&&!y(E,R)),$=!!(_&&j(E,_)),I=!!(M&&S(E,M)),G=!!(o&&zs(E,o,l)),te=!!(c&&zs(E,c,l))||$||I||!f&&!m&&H||f&&m===!1&&H,we=x(E,p??l.today());H&&D.outside.push(L),G&&D.disabled.push(L),te&&D.hidden.push(L),we&&D.today.push(L),d&&Object.keys(d).forEach(J=>{const ae=d?.[J];ae&&zs(E,ae,l)&&(z[J]?z[J].push(L):z[J]=[L])})}return L=>{const E={[Tn.focused]:!1,[Tn.disabled]:!1,[Tn.hidden]:!1,[Tn.outside]:!1,[Tn.today]:!1},R={};for(const H in D){const $=D[H];E[H]=$.some(I=>I===L)}for(const H in z)R[H]=z[H].some($=>$===L);return{...E,...R}}}function wV(e,t,n={}){return Object.entries(e).filter(([,l])=>l===!0).reduce((l,[o])=>(n[o]?l.push(n[o]):t[Tn[o]]?l.push(t[Tn[o]]):t[Fa[o]]&&l.push(t[Fa[o]]),l),[t[Xe.Day]])}function jV(e){return{...yV,...e}}function NV(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,a])=>{n.startsWith("data-")&&(t[n]=a)}),t}function _g(){const e={};for(const t in Xe)e[Xe[t]]=`rdp-${Xe[t]}`;for(const t in Tn)e[Tn[t]]=`rdp-${Tn[t]}`;for(const t in Fa)e[Fa[t]]=`rdp-${Fa[t]}`;for(const t in oa)e[oa[t]]=`rdp-${oa[t]}`;return e}function E9(e,t,n){return(n??new ma(t)).formatMonthYear(e)}const SV=E9;function kV(e,t,n){return(n??new ma(t)).format(e,"d")}function CV(e,t=cs){return t.format(e,"LLLL")}function TV(e,t,n){return(n??new ma(t)).format(e,"cccccc")}function _V(e,t=cs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function MV(){return""}function A9(e,t=cs){return t.format(e,"yyyy")}const EV=A9,AV=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:E9,formatDay:kV,formatMonthCaption:SV,formatMonthDropdown:CV,formatWeekNumber:_V,formatWeekNumberHeader:MV,formatWeekdayName:TV,formatYearCaption:EV,formatYearDropdown:A9},Symbol.toStringTag,{value:"Module"}));function DV(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...AV,...e}}function zV(e,t,n,a,l){const{startOfMonth:o,startOfYear:c,endOfYear:d,eachMonthOfInterval:m,getMonth:f}=l;return m({start:c(e),end:d(e)}).map(y=>{const b=a.formatMonthDropdown(y,l),j=f(y),k=t&&yo(n)||!1;return{value:j,label:b,disabled:k}})}function OV(e,t={},n={}){let a={...t?.[Xe.Day]};return Object.entries(e).filter(([,l])=>l===!0).forEach(([l])=>{a={...a,...n?.[l]}}),a}function RV(e,t,n){const a=e.today(),l=t?e.startOfISOWeek(a):e.startOfWeek(a),o=[];for(let c=0;c<7;c++){const d=e.addDays(l,c);o.push(d)}return o}function BV(e,t,n,a,l=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:c,eachYearOfInterval:d,getYear:m}=a,f=o(e),p=c(t),x=d({start:f,end:p});return l&&x.reverse(),x.map(y=>{const b=n.formatYearDropdown(y,a);return{value:m(y),label:b,disabled:!1}})}function D9(e,t,n,a){let l=(a??new ma(n)).format(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l}const LV=D9;function z9(e,t,n){return(n??new ma(t)).formatMonthYear(e)}const PV=z9;function FV(e,t,n,a){let l=(a??new ma(n)).format(e,"PPPP");return t?.today&&(l=`Today, ${l}`),l}function IV(e){return"Choose the Month"}function qV(){return""}function HV(e){return"Go to the Next Month"}function UV(e){return"Go to the Previous Month"}function $V(e,t,n){return(n??new ma(t)).format(e,"cccc")}function VV(e,t){return`Week ${e}`}function GV(e){return"Week Number"}function YV(e){return"Choose the Year"}const WV=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:PV,labelDay:LV,labelDayButton:D9,labelGrid:z9,labelGridcell:FV,labelMonthDropdown:IV,labelNav:qV,labelNext:HV,labelPrevious:UV,labelWeekNumber:VV,labelWeekNumberHeader:GV,labelWeekday:$V,labelYearDropdown:YV},Symbol.toStringTag,{value:"Module"})),Qu=e=>e instanceof HTMLElement?e:null,cx=e=>[...e.querySelectorAll("[data-animated-month]")??[]],XV=e=>Qu(e.querySelector("[data-animated-month]")),ux=e=>Qu(e.querySelector("[data-animated-caption]")),dx=e=>Qu(e.querySelector("[data-animated-weeks]")),KV=e=>Qu(e.querySelector("[data-animated-nav]")),QV=e=>Qu(e.querySelector("[data-animated-weekdays]"));function ZV(e,t,{classNames:n,months:a,focused:l,dateLib:o}){const c=w.useRef(null),d=w.useRef(a),m=w.useRef(!1);w.useLayoutEffect(()=>{const f=d.current;if(d.current=a,!t||!e.current||!(e.current instanceof HTMLElement)||a.length===0||f.length===0||a.length!==f.length)return;const p=o.isSameMonth(a[0].date,f[0].date),x=o.isAfter(a[0].date,f[0].date),y=x?n[oa.caption_after_enter]:n[oa.caption_before_enter],b=x?n[oa.weeks_after_enter]:n[oa.weeks_before_enter],j=c.current,k=e.current.cloneNode(!0);if(k instanceof HTMLElement?(cx(k).forEach(D=>{if(!(D instanceof HTMLElement))return;const z=XV(D);z&&D.contains(z)&&D.removeChild(z);const L=ux(D);L&&L.classList.remove(y);const E=dx(D);E&&E.classList.remove(b)}),c.current=k):c.current=null,m.current||p||l)return;const S=j instanceof HTMLElement?cx(j):[],_=cx(e.current);if(_?.every(M=>M instanceof HTMLElement)&&S&&S.every(M=>M instanceof HTMLElement)){m.current=!0,e.current.style.isolation="isolate";const M=KV(e.current);M&&(M.style.zIndex="1"),_.forEach((D,z)=>{const L=S[z];if(!L)return;D.style.position="relative",D.style.overflow="hidden";const E=ux(D);E&&E.classList.add(y);const R=dx(D);R&&R.classList.add(b);const H=()=>{m.current=!1,e.current&&(e.current.style.isolation=""),M&&(M.style.zIndex=""),E&&E.classList.remove(y),R&&R.classList.remove(b),D.style.position="",D.style.overflow="",D.contains(L)&&D.removeChild(L)};L.style.pointerEvents="none",L.style.position="absolute",L.style.overflow="hidden",L.setAttribute("aria-hidden","true");const $=QV(L);$&&($.style.opacity="0");const I=ux(L);I&&(I.classList.add(x?n[oa.caption_before_exit]:n[oa.caption_after_exit]),I.addEventListener("animationend",H));const G=dx(L);G&&G.classList.add(x?n[oa.weeks_before_exit]:n[oa.weeks_after_exit]),D.insertBefore(L,D.firstChild)})}})}function JV(e,t,n,a){const l=e[0],o=e[e.length-1],{ISOWeek:c,fixedWeeks:d,broadcastCalendar:m}=n??{},{addDays:f,differenceInCalendarDays:p,differenceInCalendarMonths:x,endOfBroadcastWeek:y,endOfISOWeek:b,endOfMonth:j,endOfWeek:k,isAfter:S,startOfBroadcastWeek:_,startOfISOWeek:M,startOfWeek:D}=a,z=m?_(l,a):c?M(l):D(l),L=m?y(o):c?b(j(o)):k(j(o)),E=p(L,z),R=x(o,l)+1,H=[];for(let G=0;G<=E;G++){const te=f(z,G);if(t&&S(te,t))break;H.push(te)}const I=(m?35:42)*R;if(d&&H.length{const l=a.weeks.reduce((o,c)=>o.concat(c.days.slice()),t.slice());return n.concat(l.slice())},t.slice())}function tG(e,t,n,a){const{numberOfMonths:l=1}=n,o=[];for(let c=0;ct)break;o.push(d)}return o}function b5(e,t,n,a){const{month:l,defaultMonth:o,today:c=a.today(),numberOfMonths:d=1}=e;let m=l||o||c;const{differenceInCalendarMonths:f,addMonths:p,startOfMonth:x}=a;if(n&&f(n,m){const _=n.broadcastCalendar?x(S,a):n.ISOWeek?y(S):b(S),M=n.broadcastCalendar?o(S):n.ISOWeek?c(d(S)):m(d(S)),D=t.filter(R=>R>=_&&R<=M),z=n.broadcastCalendar?35:42;if(n.fixedWeeks&&D.length{const $=z-D.length;return H>M&&H<=l(M,$)});D.push(...R)}const L=D.reduce((R,H)=>{const $=n.ISOWeek?f(H):p(H),I=R.find(te=>te.weekNumber===$),G=new N9(H,S,a);return I?I.days.push(G):R.push(new G$($,[G])),R},[]),E=new V$(S,L);return k.push(E),k},[]);return n.reverseMonths?j.reverse():j}function rG(e,t){let{startMonth:n,endMonth:a}=e;const{startOfYear:l,startOfDay:o,startOfMonth:c,endOfMonth:d,addYears:m,endOfYear:f,newDate:p,today:x}=t,{fromYear:y,toYear:b,fromMonth:j,toMonth:k}=e;!n&&j&&(n=j),!n&&y&&(n=t.newDate(y,0,1)),!a&&k&&(a=k),!a&&b&&(a=p(b,11,31));const S=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=c(n):y?n=p(y,0,1):!n&&S&&(n=l(m(e.today??x(),-100))),a?a=d(a):b?a=p(b,11,31):!a&&S&&(a=f(e.today??x())),[n&&o(n),a&&o(a)]}function aG(e,t,n,a){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:o=1}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:m}=a,f=l?o:1,p=c(e);if(!t)return d(p,f);if(!(m(t,e)n.concat(a.weeks.slice()),t.slice())}function Km(e,t){const[n,a]=w.useState(e);return[t===void 0?n:t,a]}function iG(e,t){const[n,a]=rG(e,t),{startOfMonth:l,endOfMonth:o}=t,c=b5(e,n,a,t),[d,m]=Km(c,e.month?c:void 0);w.useEffect(()=>{const E=b5(e,n,a,t);m(E)},[e.timeZone]);const f=tG(d,a,e,t),p=JV(f,e.endMonth?o(e.endMonth):void 0,e,t),x=nG(f,p,e,t),y=lG(x),b=eG(x),j=sG(d,n,e,t),k=aG(d,a,e,t),{disableNavigation:S,onMonthChange:_}=e,M=E=>y.some(R=>R.days.some(H=>H.isEqualTo(E))),D=E=>{if(S)return;let R=l(E);n&&Rl(a)&&(R=l(a)),m(R),_?.(R)};return{months:x,weeks:y,days:b,navStart:n,navEnd:a,previousMonth:j,nextMonth:k,goToMonth:D,goToDay:E=>{M(E)||D(E.date)}}}var Ka;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ka||(Ka={}));function w5(e){return!e[Tn.disabled]&&!e[Tn.hidden]&&!e[Tn.outside]}function oG(e,t,n,a){let l,o=-1;for(const c of e){const d=t(c);w5(d)&&(d[Tn.focused]&&ow5(t(c)))),l}function cG(e,t,n,a,l,o,c){const{ISOWeek:d,broadcastCalendar:m}=o,{addDays:f,addMonths:p,addWeeks:x,addYears:y,endOfBroadcastWeek:b,endOfISOWeek:j,endOfWeek:k,max:S,min:_,startOfBroadcastWeek:M,startOfISOWeek:D,startOfWeek:z}=c;let E={day:f,week:x,month:p,year:y,startOfWeek:R=>m?M(R,c):d?D(R):z(R),endOfWeek:R=>m?b(R):d?j(R):k(R)}[e](n,t==="after"?1:-1);return t==="before"&&a?E=S([a,E]):t==="after"&&l&&(E=_([l,E])),E}function O9(e,t,n,a,l,o,c,d=0){if(d>365)return;const m=cG(e,t,n.date,a,l,o,c),f=!!(o.disabled&&zs(m,o.disabled,c)),p=!!(o.hidden&&zs(m,o.hidden,c)),x=m,y=new N9(m,x,c);return!f&&!p?y:O9(e,t,y,a,l,o,c,d+1)}function uG(e,t,n,a,l){const{autoFocus:o}=e,[c,d]=w.useState(),m=oG(t.days,n,a||(()=>!1),c),[f,p]=w.useState(o?m:void 0);return{isFocusTarget:k=>!!m?.isEqualTo(k),setFocused:p,focused:f,blur:()=>{d(f),p(void 0)},moveFocus:(k,S)=>{if(!f)return;const _=O9(k,S,f,t.navStart,t.navEnd,e,l);_&&(e.disableNavigation&&!t.days.some(D=>D.isEqualTo(_))||(t.goToDay(_),p(_)))}}}function dG(e,t){const{selected:n,required:a,onSelect:l}=e,[o,c]=Km(n,l?n:void 0),d=l?n:o,{isSameDay:m}=t,f=b=>d?.some(j=>m(j,b))??!1,{min:p,max:x}=e;return{selected:d,select:(b,j,k)=>{let S=[...d??[]];if(f(b)){if(d?.length===p||a&&d?.length===1)return;S=d?.filter(_=>!m(_,b))}else d?.length===x?S=[b]:S=[...S,b];return l||c(S),l?.(S,b,j,k),S},isSelected:f}}function mG(e,t,n=0,a=0,l=!1,o=cs){const{from:c,to:d}=t||{},{isSameDay:m,isAfter:f,isBefore:p}=o;let x;if(!c&&!d)x={from:e,to:n>0?void 0:e};else if(c&&!d)m(c,e)?n===0?x={from:c,to:e}:l?x={from:c,to:void 0}:x=void 0:p(e,c)?x={from:e,to:c}:x={from:c,to:e};else if(c&&d)if(m(c,e)&&m(d,e))l?x={from:c,to:d}:x=void 0;else if(m(c,e))x={from:c,to:n>0?void 0:e};else if(m(d,e))x={from:e,to:n>0?void 0:e};else if(p(e,c))x={from:e,to:d};else if(f(e,c))x={from:c,to:e};else if(f(e,d))x={from:c,to:e};else throw new Error("Invalid range");if(x?.from&&x?.to){const y=o.differenceInCalendarDays(x.to,x.from);a>0&&y>a?x={from:e,to:void 0}:n>1&&ytypeof d!="function").some(d=>typeof d=="boolean"?d:n.isDate(d)?Ds(e,d,!1,n):M9(d,n)?d.some(m=>Ds(e,m,!1,n)):Tg(d)?d.from&&d.to?j5(e,{from:d.from,to:d.to},n):!1:_9(d)?hG(e,d.dayOfWeek,n):k9(d)?n.isAfter(d.before,d.after)?j5(e,{from:n.addDays(d.after,1),to:n.addDays(d.before,-1)},n):zs(e.from,d,n)||zs(e.to,d,n):C9(d)||T9(d)?zs(e.from,d,n)||zs(e.to,d,n):!1))return!0;const c=a.filter(d=>typeof d=="function");if(c.length){let d=e.from;const m=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=m;f++){if(c.some(p=>p(d)))return!0;d=n.addDays(d,1)}}return!1}function pG(e,t){const{disabled:n,excludeDisabled:a,selected:l,required:o,onSelect:c}=e,[d,m]=Km(l,c?l:void 0),f=c?l:d;return{selected:f,select:(y,b,j)=>{const{min:k,max:S}=e,_=y?mG(y,f,k,S,o,t):void 0;return a&&n&&_?.from&&_.to&&fG({from:_.from,to:_.to},n,t)&&(_.from=y,_.to=void 0),c||m(_),c?.(_,y,b,j),_},isSelected:y=>f&&Ds(f,y,!1,t)}}function xG(e,t){const{selected:n,required:a,onSelect:l}=e,[o,c]=Km(n,l?n:void 0),d=l?n:o,{isSameDay:m}=t;return{selected:d,select:(x,y,b)=>{let j=x;return!a&&d&&d&&m(x,d)&&(j=void 0),l||c(j),l?.(j,x,y,b),j},isSelected:x=>d?m(d,x):!1}}function gG(e,t){const n=xG(e,t),a=dG(e,t),l=pG(e,t);switch(e.mode){case"single":return n;case"multiple":return a;case"range":return l;default:return}}function vG(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new xr(t.today,t.timeZone)),t.month&&(t.month=new xr(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new xr(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new xr(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new xr(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new xr(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(at=>new xr(at,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new xr(t.selected.from,t.timeZone):void 0,to:t.selected.to?new xr(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:a,labels:l,dateLib:o,locale:c,classNames:d}=w.useMemo(()=>{const at={...Cg,...t.locale};return{dateLib:new ma({locale:at,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:jV(t.components),formatters:DV(t.formatters),labels:{...WV,...t.labels},locale:at,classNames:{..._g(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:m,mode:f,navLayout:p,numberOfMonths:x=1,onDayBlur:y,onDayClick:b,onDayFocus:j,onDayKeyDown:k,onDayMouseEnter:S,onDayMouseLeave:_,onNextClick:M,onPrevClick:D,showWeekNumber:z,styles:L}=t,{formatCaption:E,formatDay:R,formatMonthDropdown:H,formatWeekNumber:$,formatWeekNumberHeader:I,formatWeekdayName:G,formatYearDropdown:te}=a,we=iG(t,o),{days:J,months:ae,navStart:U,navEnd:q,previousMonth:W,nextMonth:oe,goToMonth:P}=we,je=bV(J,t,U,q,o),{isSelected:Z,select:O,selected:Ne}=gG(t,o)??{},{blur:se,focused:Ce,isFocusTarget:ye,moveFocus:Be,setFocused:ie}=uG(t,we,je,Z??(()=>!1),o),{labelDayButton:He,labelGridcell:lt,labelGrid:ve,labelMonthDropdown:Ze,labelNav:We,labelPrevious:pn,labelNext:Bn,labelWeekday:sr,labelWeekNumber:Qe,labelWeekNumberHeader:Gn,labelYearDropdown:Sr}=l,Er=w.useMemo(()=>RV(o,t.ISOWeek),[o,t.ISOWeek]),Sn=f!==void 0||b!==void 0,lr=w.useCallback(()=>{W&&(P(W),D?.(W))},[W,P,D]),Ue=w.useCallback(()=>{oe&&(P(oe),M?.(oe))},[P,oe,M]),Ln=w.useCallback((at,xn)=>it=>{it.preventDefault(),it.stopPropagation(),ie(at),O?.(at.date,xn,it),b?.(at.date,xn,it)},[O,b,ie]),K=w.useCallback((at,xn)=>it=>{ie(at),j?.(at.date,xn,it)},[j,ie]),ge=w.useCallback((at,xn)=>it=>{se(),y?.(at.date,xn,it)},[se,y]),Oe=w.useCallback((at,xn)=>it=>{const Ut={ArrowLeft:[it.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[it.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[it.shiftKey?"year":"week","after"],ArrowUp:[it.shiftKey?"year":"week","before"],PageUp:[it.shiftKey?"year":"month","before"],PageDown:[it.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Ut[it.key]){it.preventDefault(),it.stopPropagation();const[Zn,bt]=Ut[it.key];Be(Zn,bt)}k?.(at.date,xn,it)},[Be,k,t.dir]),nt=w.useCallback((at,xn)=>it=>{S?.(at.date,xn,it)},[S]),kt=w.useCallback((at,xn)=>it=>{_?.(at.date,xn,it)},[_]),Qn=w.useCallback(at=>xn=>{const it=Number(xn.target.value),Ut=o.setMonth(o.startOfMonth(at),it);P(Ut)},[o,P]),Ar=w.useCallback(at=>xn=>{const it=Number(xn.target.value),Ut=o.setYear(o.startOfMonth(at),it);P(Ut)},[o,P]),{className:he,style:Me}=w.useMemo(()=>({className:[d[Xe.Root],t.className].filter(Boolean).join(" "),style:{...L?.[Xe.Root],...t.style}}),[d,t.className,t.style,L]),dt=NV(t),mt=w.useRef(null);ZV(mt,!!t.animate,{classNames:d,months:ae,focused:Ce,dateLib:o});const Dr={dayPickerProps:t,selected:Ne,select:O,isSelected:Z,months:ae,nextMonth:oe,previousMonth:W,goToMonth:P,getModifiers:je,components:n,classNames:d,styles:L,labels:l,formatters:a};return Fe.createElement(S9.Provider,{value:Dr},Fe.createElement(n.Root,{rootRef:t.animate?mt:void 0,className:he,style:Me,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...dt},Fe.createElement(n.Months,{className:d[Xe.Months],style:L?.[Xe.Months]},!t.hideNavigation&&!p&&Fe.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Xe.Nav],style:L?.[Xe.Nav],"aria-label":We(),onPreviousClick:lr,onNextClick:Ue,previousMonth:W,nextMonth:oe}),ae.map((at,xn)=>Fe.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Xe.Month],style:L?.[Xe.Month],key:xn,displayIndex:xn,calendarMonth:at},p==="around"&&!t.hideNavigation&&xn===0&&Fe.createElement(n.PreviousMonthButton,{type:"button",className:d[Xe.PreviousMonthButton],tabIndex:W?void 0:-1,"aria-disabled":W?void 0:!0,"aria-label":pn(W),onClick:lr,"data-animated-button":t.animate?"true":void 0},Fe.createElement(n.Chevron,{disabled:W?void 0:!0,className:d[Xe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Fe.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Xe.MonthCaption],style:L?.[Xe.MonthCaption],calendarMonth:at,displayIndex:xn},m?.startsWith("dropdown")?Fe.createElement(n.DropdownNav,{className:d[Xe.Dropdowns],style:L?.[Xe.Dropdowns]},(()=>{const it=m==="dropdown"||m==="dropdown-months"?Fe.createElement(n.MonthsDropdown,{key:"month",className:d[Xe.MonthsDropdown],"aria-label":Ze(),classNames:d,components:n,disabled:!!t.disableNavigation,onChange:Qn(at.date),options:zV(at.date,U,q,a,o),style:L?.[Xe.Dropdown],value:o.getMonth(at.date)}):Fe.createElement("span",{key:"month"},H(at.date,o)),Ut=m==="dropdown"||m==="dropdown-years"?Fe.createElement(n.YearsDropdown,{key:"year",className:d[Xe.YearsDropdown],"aria-label":Sr(o.options),classNames:d,components:n,disabled:!!t.disableNavigation,onChange:Ar(at.date),options:BV(U,q,a,o,!!t.reverseYears),style:L?.[Xe.Dropdown],value:o.getYear(at.date)}):Fe.createElement("span",{key:"year"},te(at.date,o));return o.getMonthYearOrder()==="year-first"?[Ut,it]:[it,Ut]})(),Fe.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},E(at.date,o.options,o))):Fe.createElement(n.CaptionLabel,{className:d[Xe.CaptionLabel],role:"status","aria-live":"polite"},E(at.date,o.options,o))),p==="around"&&!t.hideNavigation&&xn===x-1&&Fe.createElement(n.NextMonthButton,{type:"button",className:d[Xe.NextMonthButton],tabIndex:oe?void 0:-1,"aria-disabled":oe?void 0:!0,"aria-label":Bn(oe),onClick:Ue,"data-animated-button":t.animate?"true":void 0},Fe.createElement(n.Chevron,{disabled:oe?void 0:!0,className:d[Xe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),xn===x-1&&p==="after"&&!t.hideNavigation&&Fe.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Xe.Nav],style:L?.[Xe.Nav],"aria-label":We(),onPreviousClick:lr,onNextClick:Ue,previousMonth:W,nextMonth:oe}),Fe.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":ve(at.date,o.options,o)||void 0,className:d[Xe.MonthGrid],style:L?.[Xe.MonthGrid]},!t.hideWeekdays&&Fe.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Xe.Weekdays],style:L?.[Xe.Weekdays]},z&&Fe.createElement(n.WeekNumberHeader,{"aria-label":Gn(o.options),className:d[Xe.WeekNumberHeader],style:L?.[Xe.WeekNumberHeader],scope:"col"},I()),Er.map(it=>Fe.createElement(n.Weekday,{"aria-label":sr(it,o.options,o),className:d[Xe.Weekday],key:String(it),style:L?.[Xe.Weekday],scope:"col"},G(it,o.options,o)))),Fe.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Xe.Weeks],style:L?.[Xe.Weeks]},at.weeks.map(it=>Fe.createElement(n.Week,{className:d[Xe.Week],key:it.weekNumber,style:L?.[Xe.Week],week:it},z&&Fe.createElement(n.WeekNumber,{week:it,style:L?.[Xe.WeekNumber],"aria-label":Qe(it.weekNumber,{locale:c}),className:d[Xe.WeekNumber],scope:"row",role:"rowheader"},$(it.weekNumber,o)),it.days.map(Ut=>{const{date:Zn}=Ut,bt=je(Ut);if(bt[Tn.focused]=!bt.hidden&&!!Ce?.isEqualTo(Ut),bt[Fa.selected]=Z?.(Zn)||bt.selected,Tg(Ne)){const{from:Ei,to:Fl}=Ne;bt[Fa.range_start]=!!(Ei&&Fl&&o.isSameDay(Zn,Ei)),bt[Fa.range_end]=!!(Ei&&Fl&&o.isSameDay(Zn,Fl)),bt[Fa.range_middle]=Ds(Ne,Zn,!0,o)}const Mi=OV(bt,L,t.modifiersStyles),Pl=wV(bt,d,t.modifiersClassNames),th=!Sn&&!bt.hidden?lt(Zn,bt,o.options,o):void 0;return Fe.createElement(n.Day,{key:`${o.format(Zn,"yyyy-MM-dd")}_${o.format(Ut.displayMonth,"yyyy-MM")}`,day:Ut,modifiers:bt,className:Pl.join(" "),style:Mi,role:"gridcell","aria-selected":bt.selected||void 0,"aria-label":th,"data-day":o.format(Zn,"yyyy-MM-dd"),"data-month":Ut.outside?o.format(Zn,"yyyy-MM"):void 0,"data-selected":bt.selected||void 0,"data-disabled":bt.disabled||void 0,"data-hidden":bt.hidden||void 0,"data-outside":Ut.outside||void 0,"data-focused":bt.focused||void 0,"data-today":bt.today||void 0},!bt.hidden&&Sn?Fe.createElement(n.DayButton,{className:d[Xe.DayButton],style:L?.[Xe.DayButton],type:"button",day:Ut,modifiers:bt,disabled:bt.disabled||void 0,tabIndex:ye(Ut)?0:-1,"aria-label":He(Zn,bt,o.options,o),onClick:Ln(Ut,bt),onBlur:ge(Ut,bt),onFocus:K(Ut,bt),onKeyDown:Oe(Ut,bt),onMouseEnter:nt(Ut,bt),onMouseLeave:kt(Ut,bt)},R(Zn,o.options,o)):!bt.hidden&&R(Ut.date,o.options,o))})))))))),t.footer&&Fe.createElement(n.Footer,{className:d[Xe.Footer],style:L?.[Xe.Footer],role:"status","aria-live":"polite"},t.footer)))}function N5({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:a="label",buttonVariant:l="ghost",formatters:o,components:c,...d}){const m=_g();return r.jsx(vG,{showOutsideDays:n,className:me("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:a,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...o},classNames:{root:me("w-fit",m.root),months:me("relative flex flex-col gap-4 md:flex-row",m.months),month:me("flex w-full flex-col gap-4",m.month),nav:me("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",m.nav),button_previous:me(pu({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",m.button_previous),button_next:me(pu({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",m.button_next),month_caption:me("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",m.month_caption),dropdowns:me("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",m.dropdowns),dropdown_root:me("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",m.dropdown_root),dropdown:me("bg-popover absolute inset-0 opacity-0",m.dropdown),caption_label:me("select-none font-medium",a==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",m.caption_label),table:"w-full border-collapse",weekdays:me("flex",m.weekdays),weekday:me("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",m.weekday),week:me("mt-2 flex w-full",m.week),week_number_header:me("w-[--cell-size] select-none",m.week_number_header),week_number:me("text-muted-foreground select-none text-[0.8rem]",m.week_number),day:me("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",m.day),range_start:me("bg-accent rounded-l-md",m.range_start),range_middle:me("rounded-none",m.range_middle),range_end:me("bg-accent rounded-r-md",m.range_end),today:me("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",m.today),outside:me("text-muted-foreground aria-selected:text-muted-foreground",m.outside),disabled:me("text-muted-foreground opacity-50",m.disabled),hidden:me("invisible",m.hidden),...t},components:{Root:({className:f,rootRef:p,...x})=>r.jsx("div",{"data-slot":"calendar",ref:p,className:me(f),...x}),Chevron:({className:f,orientation:p,...x})=>p==="left"?r.jsx(vi,{className:me("size-4",f),...x}):p==="right"?r.jsx(yi,{className:me("size-4",f),...x}):r.jsx(hu,{className:me("size-4",f),...x}),DayButton:yG,WeekNumber:({children:f,...p})=>r.jsx("td",{...p,children:r.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...c},...d})}function yG({className:e,day:t,modifiers:n,...a}){const l=_g(),o=w.useRef(null);return w.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),r.jsx(re,{ref:o,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:me("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",l.day,e),...a})}class bG{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const a=JSON.parse(n.data);this.notifyLog(a)}catch(a){console.error("解析日志消息失败:",a)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(a=>a.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(a=>{try{a(t)}catch(l){console.error("日志回调执行失败:",l)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(a){console.error("连接状态回调执行失败:",a)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const To=new bG;typeof window<"u"&&To.connect();const wG={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},jG=(e,t,n)=>{let a;const l=wG[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?a+"内":a+"前":a},NG={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},SG={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},kG={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},CG={date:Oo({formats:NG,defaultWidth:"full"}),time:Oo({formats:SG,defaultWidth:"full"}),dateTime:Oo({formats:kG,defaultWidth:"full"})};function S5(e,t,n){const a="eeee p";return L$(e,t,n)?a:e.getTime()>t.getTime()?"'下个'"+a:"'上个'"+a}const TG={lastWeek:S5,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:S5,other:"PP p"},_G=(e,t,n,a)=>{const l=TG[e];return typeof l=="function"?l(t,n,a):l},MG={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},EG={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},AG={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},DG={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zG={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},OG={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},RG=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},BG={ordinalNumber:RG,era:Za({values:MG,defaultWidth:"wide"}),quarter:Za({values:EG,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Za({values:AG,defaultWidth:"wide"}),day:Za({values:DG,defaultWidth:"wide"}),dayPeriod:Za({values:zG,defaultWidth:"wide",formattingValues:OG,defaultFormattingWidth:"wide"})},LG=/^(第\s*)?\d+(日|时|分|秒)?/i,PG=/\d+/i,FG={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},IG={any:[/^(前)/i,/^(公元)/i]},qG={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},HG={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},UG={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},$G={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},VG={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},GG={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},YG={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},WG={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},XG={ordinalNumber:g9({matchPattern:LG,parsePattern:PG,valueCallback:e=>parseInt(e,10)}),era:Ja({matchPatterns:FG,defaultMatchWidth:"wide",parsePatterns:IG,defaultParseWidth:"any"}),quarter:Ja({matchPatterns:qG,defaultMatchWidth:"wide",parsePatterns:HG,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ja({matchPatterns:UG,defaultMatchWidth:"wide",parsePatterns:$G,defaultParseWidth:"any"}),day:Ja({matchPatterns:VG,defaultMatchWidth:"wide",parsePatterns:GG,defaultParseWidth:"any"}),dayPeriod:Ja({matchPatterns:YG,defaultMatchWidth:"any",parsePatterns:WG,defaultParseWidth:"any"})},R0={code:"zh-CN",formatDistance:jG,formatLong:CG,formatRelative:_G,localize:BG,match:XG,options:{weekStartsOn:1,firstWeekContainsDate:4}};function KG(){const[e,t]=w.useState([]),[n,a]=w.useState(""),[l,o]=w.useState("all"),[c,d]=w.useState("all"),[m,f]=w.useState(void 0),[p,x]=w.useState(void 0),[y,b]=w.useState(!0),[j,k]=w.useState(!1),S=w.useRef(null),_=w.useRef(null);w.useEffect(()=>{const G=To.getAllLogs();t(G);const te=To.onLog(()=>{t(To.getAllLogs())}),we=To.onConnectionChange(J=>{k(J)});return()=>{te(),we()}},[]),w.useEffect(()=>{y&&_.current&&_.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,y]);const M=w.useMemo(()=>{const G=new Set(e.map(te=>te.module));return Array.from(G).sort()},[e]),D=G=>{switch(G){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},z=G=>{switch(G){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},L=()=>{window.location.reload()},E=()=>{To.clearLogs(),t([])},R=()=>{const G=I.map(ae=>`${ae.timestamp} [${ae.level.padEnd(8)}] [${ae.module}] ${ae.message}`).join(` +`),te=new Blob([G],{type:"text/plain;charset=utf-8"}),we=URL.createObjectURL(te),J=document.createElement("a");J.href=we,J.download=`logs-${X0(new Date,"yyyy-MM-dd-HHmmss")}.txt`,J.click(),URL.revokeObjectURL(we)},H=()=>{b(!y)},$=()=>{f(void 0),x(void 0)},I=w.useMemo(()=>e.filter(G=>{const te=n===""||G.message.toLowerCase().includes(n.toLowerCase())||G.module.toLowerCase().includes(n.toLowerCase()),we=l==="all"||G.level===l,J=c==="all"||G.module===c;let ae=!0;if(m||p){const U=new Date(G.timestamp);if(m){const q=new Date(m);q.setHours(0,0,0,0),ae=ae&&U>=q}if(p){const q=new Date(p);q.setHours(23,59,59,999),ae=ae&&U<=q}}return te&&we&&J&&ae}),[e,n,l,c,m,p]);return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:me("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",j?"bg-green-500 animate-pulse":"bg-red-500")}),r.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:j?"已连接":"未连接"})]})]}),r.jsx(ot,{className:"p-3 sm:p-4",children:r.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[r.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索日志...",value:n,onChange:G=>a(G.target.value),className:"pl-9 h-9 text-sm"})]}),r.jsxs(_t,{value:l,onValueChange:o,children:[r.jsxs(jt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[r.jsx(yx,{className:"h-4 w-4 mr-2"}),r.jsx(Mt,{placeholder:"级别"})]}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部级别"}),r.jsx(ze,{value:"DEBUG",children:"DEBUG"}),r.jsx(ze,{value:"INFO",children:"INFO"}),r.jsx(ze,{value:"WARNING",children:"WARNING"}),r.jsx(ze,{value:"ERROR",children:"ERROR"}),r.jsx(ze,{value:"CRITICAL",children:"CRITICAL"})]})]}),r.jsxs(_t,{value:c,onValueChange:d,children:[r.jsxs(jt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[r.jsx(yx,{className:"h-4 w-4 mr-2"}),r.jsx(Mt,{placeholder:"模块"})]}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部模块"}),M.map(G=>r.jsx(ze,{value:G,children:G},G))]})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",className:me("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[r.jsx(Iy,{className:"mr-2 h-4 w-4"}),r.jsx("span",{className:"text-xs sm:text-sm",children:m?X0(m,"PPP",{locale:R0}):"开始日期"})]})}),r.jsx(Ps,{className:"w-auto p-0",align:"start",children:r.jsx(N5,{mode:"single",selected:m,onSelect:f,initialFocus:!0,locale:R0})})]}),r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",className:me("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!p&&"text-muted-foreground"),children:[r.jsx(Iy,{className:"mr-2 h-4 w-4"}),r.jsx("span",{className:"text-xs sm:text-sm",children:p?X0(p,"PPP",{locale:R0}):"结束日期"})]})}),r.jsx(Ps,{className:"w-auto p-0",align:"start",children:r.jsx(N5,{mode:"single",selected:p,onSelect:x,initialFocus:!0,locale:R0})})]}),(m||p)&&r.jsxs(re,{variant:"outline",size:"sm",onClick:$,className:"w-full sm:w-auto h-9",children:[r.jsx(Mu,{className:"h-4 w-4 sm:mr-2"}),r.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),r.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[r.jsxs("div",{className:"flex gap-2 flex-wrap",children:[r.jsxs(re,{variant:y?"default":"outline",size:"sm",onClick:H,className:"flex-1 sm:flex-none h-9",children:[y?r.jsx(bT,{className:"h-4 w-4"}):r.jsx(wT,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:y?"自动滚动":"已暂停"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:L,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Os,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Ot,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:R,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Z0,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),r.jsx("div",{className:"flex-1 hidden sm:block"}),r.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[r.jsxs("span",{className:"font-mono",children:[I.length," / ",e.length]}),r.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),r.jsx(ot,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:r.jsx(Xt,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:r.jsxs("div",{ref:S,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[I.length===0?r.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):I.map(G=>r.jsxs("div",{className:me("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",z(G.level)),children:[r.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:G.timestamp}),r.jsxs("span",{className:me("text-xs font-semibold",D(G.level)),children:["[",G.level,"]"]})]}),r.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:G.module}),r.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:G.message})]}),r.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[r.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:G.timestamp}),r.jsxs("span",{className:me("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",D(G.level)),children:["[",G.level,"]"]}),r.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:G.module}),r.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:G.message})]})]},G.id)),r.jsx("div",{ref:_,className:"h-4"})]})})})]})})}const QG="Mai-with-u",ZG="plugin-repo",JG="main",eY="plugin_details.json";async function tY(){try{const e=await ut("/api/webui/plugins/fetch-raw",{method:"POST",headers:yt(),body:JSON.stringify({owner:QG,repo:ZG,branch:JG,file_path:eY})});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success||!t.data)throw new Error(t.error||"获取插件列表失败");return JSON.parse(t.data).filter(l=>!l?.id||!l?.manifest?(console.warn("跳过无效插件数据:",l),!1):!l.manifest.name||!l.manifest.version?(console.warn("跳过缺少必需字段的插件:",l.id),!1):!0).map(l=>({id:l.id,manifest:{manifest_version:l.manifest.manifest_version||1,name:l.manifest.name,version:l.manifest.version,description:l.manifest.description||"",author:l.manifest.author||{name:"Unknown"},license:l.manifest.license||"Unknown",host_application:l.manifest.host_application||{min_version:"0.0.0"},homepage_url:l.manifest.homepage_url,repository_url:l.manifest.repository_url,keywords:l.manifest.keywords||[],categories:l.manifest.categories||[],default_locale:l.manifest.default_locale||"zh-CN",locales_path:l.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function nY(){try{const e=await ut("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function rY(){try{const e=await ut("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function aY(e,t,n){const a=e.split(".").map(d=>parseInt(d)||0),l=a[0]||0,o=a[1]||0,c=a[2]||0;if(n.version_majorparseInt(x)||0),m=d[0]||0,f=d[1]||0,p=d[2]||0;if(n.version_major>m||n.version_major===m&&n.version_minor>f||n.version_major===m&&n.version_minor===f&&n.version_patch>p)return!1}return!0}function sY(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",a=window.location.host,l=new WebSocket(`${n}//${a}/api/webui/ws/plugin-progress`);return l.onopen=()=>{console.log("Plugin progress WebSocket connected");const o=setInterval(()=>{l.readyState===WebSocket.OPEN?l.send("ping"):clearInterval(o)},3e4)},l.onmessage=o=>{try{if(o.data==="pong")return;const c=JSON.parse(o.data);e(c)}catch(c){console.error("Failed to parse progress data:",c)}},l.onerror=o=>{console.error("Plugin progress WebSocket error:",o),t?.(o)},l.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},l}async function B0(){try{const e=await ut("/api/webui/plugins/installed",{headers:yt()});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success)throw new Error(t.message||"获取已安装插件列表失败");return t.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function L0(e,t){return t.some(n=>n.id===e)}function P0(e,t){const n=t.find(a=>a.id===e);if(n)return n.manifest?.version||n.version}async function lY(e,t,n="main"){const a=await ut("/api/webui/plugins/install",{method:"POST",headers:yt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"安装失败")}return await a.json()}async function iY(e){const t=await ut("/api/webui/plugins/uninstall",{method:"POST",headers:yt(),body:JSON.stringify({plugin_id:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"卸载失败")}return await t.json()}async function oY(e,t,n="main"){const a=await ut("/api/webui/plugins/update",{method:"POST",headers:yt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"更新失败")}return await a.json()}const k5={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function cY(){const e=rs(),[t,n]=w.useState(null),[a,l]=w.useState(""),[o,c]=w.useState("all"),[d,m]=w.useState("all"),[f,p]=w.useState(!1),[x,y]=w.useState([]),[b,j]=w.useState(!0),[k,S]=w.useState(null),[_,M]=w.useState(null),[D,z]=w.useState(null),[L,E]=w.useState(null),[,R]=w.useState([]),{toast:H}=pr();w.useEffect(()=>{let q=null,W=!1;return(async()=>{if(q=sY(P=>{W||(z(P),P.stage==="success"?setTimeout(()=>{W||z(null)},2e3):P.stage==="error"&&(j(!1),S(P.error||"加载失败")))},P=>{console.error("WebSocket error:",P),W||H({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(P=>{if(!q){P();return}const je=()=>{q&&q.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),P()):q&&q.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),P()):setTimeout(je,100)};je()}),!W){const P=await nY();M(P),P.installed||H({title:"Git 未安装",description:P.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!W){const P=await rY();E(P)}if(!W)try{j(!0),S(null);const P=await tY();if(!W){const je=await B0();R(je);const Z=P.map(O=>{const Ne=L0(O.id,je),se=P0(O.id,je);return{...O,installed:Ne,installed_version:se}});for(const O of je)!Z.some(se=>se.id===O.id)&&O.manifest&&Z.push({id:O.id,manifest:{manifest_version:O.manifest.manifest_version||1,name:O.manifest.name,version:O.manifest.version,description:O.manifest.description||"",author:O.manifest.author,license:O.manifest.license||"Unknown",host_application:O.manifest.host_application,homepage_url:O.manifest.homepage_url,repository_url:O.manifest.repository_url,keywords:O.manifest.keywords||[],categories:O.manifest.categories||[],default_locale:O.manifest.default_locale||"zh-CN",locales_path:O.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:O.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});y(Z)}}catch(P){if(!W){const je=P instanceof Error?P.message:"加载插件列表失败";S(je),H({title:"加载失败",description:je,variant:"destructive"})}}finally{W||j(!1)}})(),()=>{W=!0,q&&q.close()}},[H]);const $=q=>{if(!q.installed&&L&&!I(q))return r.jsxs(on,{variant:"destructive",className:"gap-1",children:[r.jsx(fi,{className:"h-3 w-3"}),"不兼容"]});if(q.installed){const W=q.installed_version?.trim(),oe=q.manifest.version?.trim();if(W!==oe){const P=W?.split(".").map(Number)||[0,0,0],je=oe?.split(".").map(Number)||[0,0,0];for(let Z=0;Z<3;Z++){if((je[Z]||0)>(P[Z]||0))return r.jsxs(on,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[r.jsx(fi,{className:"h-3 w-3"}),"可更新"]});if((je[Z]||0)<(P[Z]||0))break}}return r.jsxs(on,{variant:"default",className:"gap-1",children:[r.jsx(Ur,{className:"h-3 w-3"}),"已安装"]})}return null},I=q=>!L||!q.manifest?.host_application?!0:aY(q.manifest.host_application.min_version,q.manifest.host_application.max_version,L),G=q=>{if(!q.installed||!q.installed_version||!q.manifest?.version)return!1;const W=q.installed_version.trim(),oe=q.manifest.version.trim();if(W===oe)return!1;const P=W.split(".").map(Number),je=oe.split(".").map(Number);for(let Z=0;Z<3;Z++){if((je[Z]||0)>(P[Z]||0))return!0;if((je[Z]||0)<(P[Z]||0))return!1}return!1},te=x.filter(q=>{if(!q.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",q.id),!1;const W=a===""||q.manifest.name?.toLowerCase().includes(a.toLowerCase())||q.manifest.description?.toLowerCase().includes(a.toLowerCase())||q.manifest.keywords&&q.manifest.keywords.some(Z=>Z.toLowerCase().includes(a.toLowerCase())),oe=o==="all"||q.manifest.categories&&q.manifest.categories.includes(o);let P=!0;d==="installed"?P=q.installed===!0:d==="updates"&&(P=q.installed===!0&&G(q));const je=!f||!L||I(q);return W&&oe&&P&&je}),we=()=>{n(null)},J=async q=>{if(!_?.installed){H({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(L&&!I(q)){H({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await lY(q.id,q.manifest.repository_url||"","main"),H({title:"安装成功",description:`${q.manifest.name} 已成功安装`});const W=await B0();R(W),y(oe=>oe.map(P=>{if(P.id===q.id){const je=L0(P.id,W),Z=P0(P.id,W);return{...P,installed:je,installed_version:Z}}return P}))}catch(W){H({title:"安装失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}},ae=async q=>{try{await iY(q.id),H({title:"卸载成功",description:`${q.manifest.name} 已成功卸载`});const W=await B0();R(W),y(oe=>oe.map(P=>{if(P.id===q.id){const je=L0(P.id,W),Z=P0(P.id,W);return{...P,installed:je,installed_version:Z}}return P}))}catch(W){H({title:"卸载失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}},U=async q=>{if(!_?.installed){H({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const W=await oY(q.id,q.manifest.repository_url||"","main");H({title:"更新成功",description:`${q.manifest.name} 已从 ${W.old_version} 更新到 ${W.new_version}`});const oe=await B0();R(oe),y(P=>P.map(je=>{if(je.id===q.id){const Z=L0(je.id,oe),O=P0(je.id,oe);return{...je,installed:Z,installed_version:O}}return je}))}catch(W){H({title:"更新失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),r.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),r.jsxs(re,{onClick:()=>e({to:"/plugin-mirrors"}),children:[r.jsx(jT,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),_&&!_.installed&&r.jsxs(ot,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[r.jsx(Bt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Mo,{className:"h-5 w-5 text-orange-600"}),r.jsxs("div",{children:[r.jsx(Lt,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),r.jsx(tr,{className:"text-orange-800 dark:text-orange-200",children:_.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),r.jsx(Vt,{children:r.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",r.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),r.jsx(ot,{className:"p-4",children:r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索插件...",value:a,onChange:q=>l(q.target.value),className:"pl-9"})]}),r.jsxs(_t,{value:o,onValueChange:c,children:[r.jsx(jt,{className:"w-full sm:w-[200px]",children:r.jsx(Mt,{placeholder:"选择分类"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部分类"}),r.jsx(ze,{value:"Group Management",children:"群组管理"}),r.jsx(ze,{value:"Entertainment & Interaction",children:"娱乐互动"}),r.jsx(ze,{value:"Utility Tools",children:"实用工具"}),r.jsx(ze,{value:"Content Generation",children:"内容生成"}),r.jsx(ze,{value:"Multimedia",children:"多媒体"}),r.jsx(ze,{value:"External Integration",children:"外部集成"}),r.jsx(ze,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),r.jsx(ze,{value:"Other",children:"其他"})]})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(br,{id:"compatible-only",checked:f,onCheckedChange:q=>p(q===!0)}),r.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),r.jsx(Sl,{value:d,onValueChange:m,className:"w-full",children:r.jsxs(Ls,{className:"grid w-full grid-cols-3",children:[r.jsxs(Rt,{value:"all",children:["全部插件 (",x.length,")"]}),r.jsxs(Rt,{value:"installed",children:["已安装 (",x.filter(q=>q.installed).length,")"]}),r.jsxs(Rt,{value:"updates",children:["可更新 (",x.filter(q=>q.installed&&G(q)).length,")"]})]})}),D&&D.stage==="loading"&&r.jsx(ot,{className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fu,{className:"h-4 w-4 animate-spin"}),r.jsxs("span",{className:"text-sm font-medium",children:[D.operation==="fetch"&&"加载插件列表",D.operation==="install"&&`安装插件${D.plugin_id?`: ${D.plugin_id}`:""}`,D.operation==="uninstall"&&`卸载插件${D.plugin_id?`: ${D.plugin_id}`:""}`,D.operation==="update"&&`更新插件${D.plugin_id?`: ${D.plugin_id}`:""}`]})]}),r.jsxs("span",{className:"text-sm font-medium",children:[D.progress,"%"]})]}),r.jsx(Lu,{value:D.progress,className:"h-2"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:D.message}),D.operation==="fetch"&&D.total_plugins>0&&r.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",D.loaded_plugins," / ",D.total_plugins," 个插件"]})]})}),D&&D.stage==="error"&&D.error&&r.jsx(ot,{className:"border-destructive bg-destructive/10",children:r.jsx(Bt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Mo,{className:"h-5 w-5 text-destructive"}),r.jsxs("div",{children:[r.jsx(Lt,{className:"text-lg text-destructive",children:"加载失败"}),r.jsx(tr,{className:"text-destructive/80",children:D.error})]})]})})}),b?r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(fu,{className:"h-8 w-8 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):k?r.jsx(ot,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Mo,{className:"h-12 w-12 text-destructive mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:k}),r.jsx(re,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):te.length===0?r.jsx(ot,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Gr,{className:"h-12 w-12 text-muted-foreground mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a||o!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:te.map(q=>r.jsxs(ot,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[r.jsxs(Bt,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsx(Lt,{className:"text-xl",children:q.manifest?.name||q.id}),r.jsxs("div",{className:"flex flex-col gap-1",children:[q.manifest?.categories&&q.manifest.categories[0]&&r.jsx(on,{variant:"secondary",className:"text-xs whitespace-nowrap",children:k5[q.manifest.categories[0]]||q.manifest.categories[0]}),$(q)]})]}),r.jsx(tr,{className:"line-clamp-2",children:q.manifest?.description||"无描述"})]}),r.jsx(Vt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Z0,{className:"h-4 w-4"}),r.jsx("span",{children:q.downloads.toLocaleString()})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(qy,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsx("span",{children:q.rating.toFixed(1)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[q.manifest?.keywords&&q.manifest.keywords.slice(0,3).map(W=>r.jsx(on,{variant:"outline",className:"text-xs",children:W},W)),q.manifest?.keywords&&q.manifest.keywords.length>3&&r.jsxs(on,{variant:"outline",className:"text-xs",children:["+",q.manifest.keywords.length-3]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[r.jsxs("div",{children:["v",q.manifest?.version||"unknown"," · ",q.manifest?.author?.name||"Unknown"]}),q.manifest?.host_application&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{children:"支持:"}),r.jsxs("span",{className:"font-medium",children:[q.manifest.host_application.min_version,q.manifest.host_application.max_version?` - ${q.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),r.jsx(F6,{className:"pt-4",children:r.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>n(q),children:"查看详情"}),q.installed?G(q)?r.jsxs(re,{size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git 未安装",onClick:()=>U(q),children:[r.jsx(Os,{className:"h-4 w-4 mr-1"}),"更新"]}):r.jsxs(re,{variant:"destructive",size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git 未安装",onClick:()=>ae(q),children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"卸载"]}):r.jsxs(re,{size:"sm",disabled:!_?.installed||D?.operation==="install"||L!==null&&!I(q),title:_?.installed?L!==null&&!I(q)?`不兼容当前版本 (需要 ${q.manifest?.host_application?.min_version||"未知"}${q.manifest?.host_application?.max_version?` - ${q.manifest.host_application.max_version}`:"+"},当前 ${L?.version})`:void 0:"Git 未安装",onClick:()=>J(q),children:[r.jsx(Z0,{className:"h-4 w-4 mr-1"}),D?.operation==="install"&&D?.plugin_id===q.id?"安装中...":"安装"]})]})})]},q.id))}),r.jsx(hr,{open:t!==null,onOpenChange:we,children:t&&t.manifest&&r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsx(rr,{children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-2 flex-1",children:[r.jsx(ar,{className:"text-2xl",children:t.manifest.name}),r.jsxs(wr,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&r.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:r.jsx(lu,{className:"h-3 w-3 inline"})})]})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&r.jsx(on,{variant:"secondary",children:k5[t.manifest.categories[0]]||t.manifest.categories[0]}),$(t)]})]})}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"版本"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"下载量"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.downloads.toLocaleString()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"评分"}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(qy,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.rating.toFixed(1)," (",t.review_count,")"]})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"许可证"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(q=>r.jsx(on,{variant:"outline",children:q},q))})]}),t.detailed_description&&r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),r.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),r.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"font-medium",children:"主页: "}),r.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"font-medium",children:"仓库: "}),r.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),r.jsxs(Yr,{children:[t.manifest.homepage_url&&r.jsxs(re,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[r.jsx(lu,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&r.jsxs(re,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[r.jsx(lu,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function uY(){return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(Os,{className:"h-4 w-4 mr-2"}),"刷新"]}),r.jsxs(re,{size:"sm",children:[r.jsx(Pa,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"已安装插件"}),r.jsx(em,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"已启用"}),r.jsx(Ur,{className:"h-4 w-4 text-green-600"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"已禁用"}),r.jsx(fi,{className:"h-4 w-4 text-orange-600"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"可更新"}),r.jsx(Os,{className:"h-4 w-4 text-blue-600"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"已安装的插件"}),r.jsx(tr,{children:"查看和管理已安装插件的配置"})]}),r.jsx(Vt,{children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[r.jsx(em,{className:"h-16 w-16 text-muted-foreground/50"}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),r.jsx("div",{className:"flex gap-2",children:r.jsx(re,{variant:"outline",asChild:!0,children:r.jsxs("a",{href:"/plugins",children:[r.jsx(lu,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ot,{children:[r.jsx(Bt,{children:r.jsx(Lt,{className:"text-base",children:"即将推出的功能"})}),r.jsx(Vt,{children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"插件启用/禁用"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"快速切换插件运行状态"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"配置参数编辑"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"可视化编辑插件配置文件"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"依赖管理"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"查看和安装插件依赖包"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"插件日志"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"查看插件运行日志和错误信息"})]})]})]})})]}),r.jsxs(ot,{children:[r.jsx(Bt,{children:r.jsx(Lt,{className:"text-base",children:"开发者工具"})}),r.jsx(Vt,{children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"热重载"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"无需重启即可重新加载插件"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"配置验证"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查配置文件格式和完整性"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"性能监控"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"监控插件的资源占用情况"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"调试模式"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"详细的调试信息和错误追踪"})]})]})]})})]})]}),r.jsx(ot,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:r.jsx(Vt,{className:"pt-6",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(fi,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),r.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",r.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function dY(){const e=rs(),{toast:t}=pr(),[n,a]=w.useState([]),[l,o]=w.useState(!0),[c,d]=w.useState(null),[m,f]=w.useState(null),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[j,k]=w.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=w.useCallback(async()=>{try{o(!0),d(null);const R=localStorage.getItem("access-token"),H=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${R}`}});if(!H.ok)throw new Error("获取镜像源列表失败");const $=await H.json();a($.mirrors||[])}catch(R){const H=R instanceof Error?R.message:"加载镜像源失败";d(H),t({title:"加载失败",description:H,variant:"destructive"})}finally{o(!1)}},[t]);w.useEffect(()=>{S()},[S]);const _=async()=>{try{const R=localStorage.getItem("access-token"),H=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${R}`,"Content-Type":"application/json"},body:JSON.stringify(j)});if(!H.ok){const $=await H.json();throw new Error($.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),x(!1),k({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(R){t({title:"添加失败",description:R instanceof Error?R.message:"未知错误",variant:"destructive"})}},M=async()=>{if(m)try{const R=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${m.id}`,{method:"PUT",headers:{Authorization:`Bearer ${R}`,"Content-Type":"application/json"},body:JSON.stringify({name:j.name,raw_prefix:j.raw_prefix,clone_prefix:j.clone_prefix,enabled:j.enabled,priority:j.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),b(!1),f(null),S()}catch(R){t({title:"更新失败",description:R instanceof Error?R.message:"未知错误",variant:"destructive"})}},D=async R=>{if(confirm("确定要删除这个镜像源吗?"))try{const H=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${R}`,{method:"DELETE",headers:{Authorization:`Bearer ${H}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),S()}catch(H){t({title:"删除失败",description:H instanceof Error?H.message:"未知错误",variant:"destructive"})}},z=async R=>{try{const H=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${R.id}`,{method:"PUT",headers:{Authorization:`Bearer ${H}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!R.enabled})})).ok)throw new Error("更新状态失败");S()}catch(H){t({title:"更新失败",description:H instanceof Error?H.message:"未知错误",variant:"destructive"})}},L=R=>{f(R),k({id:R.id,name:R.name,raw_prefix:R.raw_prefix,clone_prefix:R.clone_prefix,enabled:R.enabled,priority:R.priority}),b(!0)},E=async(R,H)=>{const $=H==="up"?R.priority-1:R.priority+1;if(!($<1))try{const I=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${R.id}`,{method:"PUT",headers:{Authorization:`Bearer ${I}`,"Content-Type":"application/json"},body:JSON.stringify({priority:$})})).ok)throw new Error("更新优先级失败");S()}catch(I){t({title:"更新失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(re,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:r.jsx(J5,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),r.jsxs(re,{onClick:()=>x(!0),children:[r.jsx(mr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),l?r.jsx(ot,{className:"p-6",children:r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(fu,{className:"h-8 w-8 animate-spin text-primary"})})}):c?r.jsx(ot,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Mo,{className:"h-12 w-12 text-destructive mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:c}),r.jsx(re,{onClick:S,children:"重新加载"})]})}):r.jsxs(ot,{children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{children:"状态"}),r.jsx(ct,{children:"名称"}),r.jsx(ct,{children:"ID"}),r.jsx(ct,{children:"优先级"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:n.map(R=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(gt,{checked:R.enabled,onCheckedChange:()=>z(R)})}),r.jsx(et,{children:r.jsxs("div",{children:[r.jsx("div",{className:"font-medium",children:R.name}),r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",R.raw_prefix]})]})}),r.jsx(et,{children:r.jsx(on,{variant:"outline",children:R.id})}),r.jsx(et,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-mono",children:R.priority}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(re,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(R,"up"),disabled:R.priority===1,children:r.jsx(vx,{className:"h-3 w-3"})}),r.jsx(re,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(R,"down"),children:r.jsx(hu,{className:"h-3 w-3"})})]})]})}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(re,{variant:"ghost",size:"icon",onClick:()=>L(R),children:r.jsx(Ro,{className:"h-4 w-4"})}),r.jsx(re,{variant:"ghost",size:"icon",onClick:()=>D(R.id),children:r.jsx(Ot,{className:"h-4 w-4 text-destructive"})})]})})]},R.id))})]})}),r.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(R=>r.jsx(ot,{className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold",children:R.name}),R.enabled&&r.jsx(on,{variant:"default",className:"text-xs",children:"启用"})]}),r.jsx(on,{variant:"outline",className:"mt-1 text-xs",children:R.id})]}),r.jsx(gt,{checked:R.enabled,onCheckedChange:()=>z(R)})]}),r.jsxs("div",{className:"text-sm space-y-1",children:[r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"Raw: "}),r.jsx("span",{className:"break-all",children:R.raw_prefix})]}),r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"优先级: "}),r.jsx("span",{className:"font-mono",children:R.priority})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[r.jsxs(re,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>L(R),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>E(R,"up"),disabled:R.priority===1,children:r.jsx(vx,{className:"h-4 w-4"})}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>E(R,"down"),children:r.jsx(hu,{className:"h-4 w-4"})}),r.jsx(re,{variant:"destructive",size:"sm",onClick:()=>D(R.id),children:r.jsx(Ot,{className:"h-4 w-4"})})]})]})},R.id))})]}),r.jsx(hr,{open:p,onOpenChange:x,children:r.jsxs(nr,{className:"max-w-lg",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"添加镜像源"}),r.jsx(wr,{children:"添加新的 Git 镜像源配置"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-id",children:"镜像源 ID *"}),r.jsx(Te,{id:"add-id",placeholder:"例如: my-mirror",value:j.id,onChange:R=>k({...j,id:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-name",children:"名称 *"}),r.jsx(Te,{id:"add-name",placeholder:"例如: 我的镜像源",value:j.name,onChange:R=>k({...j,name:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),r.jsx(Te,{id:"add-raw",placeholder:"https://example.com/raw",value:j.raw_prefix,onChange:R=>k({...j,raw_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-clone",children:"克隆前缀 *"}),r.jsx(Te,{id:"add-clone",placeholder:"https://example.com/clone",value:j.clone_prefix,onChange:R=>k({...j,clone_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-priority",children:"优先级"}),r.jsx(Te,{id:"add-priority",type:"number",min:"1",value:j.priority,onChange:R=>k({...j,priority:parseInt(R.target.value)||1})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"add-enabled",checked:j.enabled,onCheckedChange:R=>k({...j,enabled:R})}),r.jsx(Q,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>x(!1),children:"取消"}),r.jsx(re,{onClick:_,children:"添加"})]})]})}),r.jsx(hr,{open:y,onOpenChange:b,children:r.jsxs(nr,{className:"max-w-lg",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑镜像源"}),r.jsx(wr,{children:"修改镜像源配置"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"镜像源 ID"}),r.jsx(Te,{value:j.id,disabled:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-name",children:"名称 *"}),r.jsx(Te,{id:"edit-name",value:j.name,onChange:R=>k({...j,name:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),r.jsx(Te,{id:"edit-raw",value:j.raw_prefix,onChange:R=>k({...j,raw_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-clone",children:"克隆前缀 *"}),r.jsx(Te,{id:"edit-clone",value:j.clone_prefix,onChange:R=>k({...j,clone_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-priority",children:"优先级"}),r.jsx(Te,{id:"edit-priority",type:"number",min:"1",value:j.priority,onChange:R=>k({...j,priority:parseInt(R.target.value)||1})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"edit-enabled",checked:j.enabled,onCheckedChange:R=>k({...j,enabled:R})}),r.jsx(Q,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>b(!1),children:"取消"}),r.jsx(re,{onClick:M,children:"保存"})]})]})})]})})}const mY=Wo("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),R9=w.forwardRef(({className:e,size:t,abbrTitle:n,children:a,...l},o)=>r.jsx("kbd",{className:me(mY({size:t,className:e})),ref:o,...l,children:n?r.jsx("abbr",{title:n,children:a}):a}));R9.displayName="Kbd";const hY=[{icon:K0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:jl,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:e6,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:t6,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:v1,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:_u,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:n6,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:NT,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:em,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:Q0,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Pa,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function fY({open:e,onOpenChange:t}){const[n,a]=w.useState(""),[l,o]=w.useState(0),c=rs(),d=hY.filter(p=>p.title.toLowerCase().includes(n.toLowerCase())||p.description.toLowerCase().includes(n.toLowerCase())||p.category.toLowerCase().includes(n.toLowerCase()));w.useEffect(()=>{e&&(a(""),o(0))},[e]);const m=w.useCallback(p=>{c({to:p}),t(!1)},[c,t]),f=w.useCallback(p=>{p.key==="ArrowDown"?(p.preventDefault(),o(x=>(x+1)%d.length)):p.key==="ArrowUp"?(p.preventDefault(),o(x=>(x-1+d.length)%d.length)):p.key==="Enter"&&d[l]&&(p.preventDefault(),m(d[l].path))},[d,l,m]);return r.jsx(hr,{open:e,onOpenChange:t,children:r.jsxs(nr,{className:"max-w-2xl p-0 gap-0",children:[r.jsxs(rr,{className:"px-4 pt-4 pb-0",children:[r.jsx(ar,{className:"sr-only",children:"搜索"}),r.jsxs("div",{className:"relative",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),r.jsx(Te,{value:n,onChange:p=>{a(p.target.value),o(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),r.jsx("div",{className:"border-t",children:r.jsx(Xt,{className:"h-[400px]",children:d.length>0?r.jsx("div",{className:"p-2",children:d.map((p,x)=>{const y=p.icon;return r.jsxs("button",{onClick:()=>m(p.path),onMouseEnter:()=>o(x),className:me("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",x===l?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[r.jsx(y,{className:"h-5 w-5 flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-sm",children:p.title}),r.jsx("div",{className:"text-xs text-muted-foreground truncate",children:p.description})]}),r.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:p.category})]},p.path)})}):r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(Gr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),r.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function pY(e){const t=xY(e),n=w.forwardRef((a,l)=>{const{children:o,...c}=a,d=w.Children.toArray(o),m=d.find(vY);if(m){const f=m.props.children,p=d.map(x=>x===m?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return r.jsx(t,{...c,ref:l,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return r.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function xY(e){const t=w.forwardRef((n,a)=>{const{children:l,...o}=n;if(w.isValidElement(l)){const c=bY(l),d=yY(o,l.props);return l.type!==w.Fragment&&(d.ref=a?Nl(a,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gY=Symbol("radix.slottable");function vY(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gY}function yY(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...d)=>{const m=o(...d);return l(...d),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function bY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var n1=["Enter"," "],wY=["ArrowDown","PageUp","Home"],B9=["ArrowUp","PageDown","End"],jY=[...wY,...B9],NY={ltr:[...n1,"ArrowRight"],rtl:[...n1,"ArrowLeft"]},SY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zu="Menu",[Su,kY,CY]=vm(Zu),[_i,L9]=Ha(Zu,[CY,Uo,Mm]),Ju=Uo(),P9=Mm(),[F9,Ll]=_i(Zu),[TY,ed]=_i(Zu),I9=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:l,onOpenChange:o,modal:c=!0}=e,d=Ju(t),[m,f]=w.useState(null),p=w.useRef(!1),x=gr(o),y=Tu(l);return w.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),r.jsx(jm,{...d,children:r.jsx(F9,{scope:t,open:n,onOpenChange:x,content:m,onContentChange:f,children:r.jsx(TY,{scope:t,onClose:w.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:p,dir:y,modal:c,children:a})})})};I9.displayName=Zu;var _Y="MenuAnchor",Mg=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=Ju(n);return r.jsx(Nm,{...l,...a,ref:t})});Mg.displayName=_Y;var Eg="MenuPortal",[MY,q9]=_i(Eg,{forceMount:void 0}),H9=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:l}=e,o=Ll(Eg,t);return r.jsx(MY,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(wm,{asChild:!0,container:l,children:a})})})};H9.displayName=Eg;var _a="MenuContent",[EY,Ag]=_i(_a),U9=w.forwardRef((e,t)=>{const n=q9(_a,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,o=Ll(_a,e.__scopeMenu),c=ed(_a,e.__scopeMenu);return r.jsx(Su.Provider,{scope:e.__scopeMenu,children:r.jsx(Wr,{present:a||o.open,children:r.jsx(Su.Slot,{scope:e.__scopeMenu,children:c.modal?r.jsx(AY,{...l,ref:t}):r.jsx(DY,{...l,ref:t})})})})}),AY=w.forwardRef((e,t)=>{const n=Ll(_a,e.__scopeMenu),a=w.useRef(null),l=dn(t,a);return w.useEffect(()=>{const o=a.current;if(o)return $5(o)},[]),r.jsx(Dg,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DY=w.forwardRef((e,t)=>{const n=Ll(_a,e.__scopeMenu);return r.jsx(Dg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zY=pY("MenuContent.ScrollLock"),Dg=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:l,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:x,onInteractOutside:y,onDismiss:b,disableOutsideScroll:j,...k}=e,S=Ll(_a,n),_=ed(_a,n),M=Ju(n),D=P9(n),z=kY(n),[L,E]=w.useState(null),R=w.useRef(null),H=dn(t,R,S.onContentChange),$=w.useRef(0),I=w.useRef(""),G=w.useRef(0),te=w.useRef(null),we=w.useRef("right"),J=w.useRef(0),ae=j?V5:w.Fragment,U=j?{as:zY,allowPinchZoom:!0}:void 0,q=oe=>{const P=I.current+oe,je=z().filter(ye=>!ye.disabled),Z=document.activeElement,O=je.find(ye=>ye.ref.current===Z)?.textValue,Ne=je.map(ye=>ye.textValue),se=VY(Ne,P,O),Ce=je.find(ye=>ye.textValue===se)?.ref.current;(function ye(Be){I.current=Be,window.clearTimeout($.current),Be!==""&&($.current=window.setTimeout(()=>ye(""),1e3))})(P),Ce&&setTimeout(()=>Ce.focus())};w.useEffect(()=>()=>window.clearTimeout($.current),[]),G5();const W=w.useCallback(oe=>we.current===te.current?.side&&YY(oe,te.current?.area),[]);return r.jsx(EY,{scope:n,searchRef:I,onItemEnter:w.useCallback(oe=>{W(oe)&&oe.preventDefault()},[W]),onItemLeave:w.useCallback(oe=>{W(oe)||(R.current?.focus(),E(null))},[W]),onTriggerLeave:w.useCallback(oe=>{W(oe)&&oe.preventDefault()},[W]),pointerGraceTimerRef:G,onPointerGraceIntentChange:w.useCallback(oe=>{te.current=oe},[]),children:r.jsx(ae,{...U,children:r.jsx(Y5,{asChild:!0,trapped:l,onMountAutoFocus:Pe(o,oe=>{oe.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:r.jsx(p1,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:x,onInteractOutside:y,onDismiss:b,children:r.jsx(V6,{asChild:!0,...D,dir:_.dir,orientation:"vertical",loop:a,currentTabStopId:L,onCurrentTabStopIdChange:E,onEntryFocus:Pe(m,oe=>{_.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(x1,{role:"menu","aria-orientation":"vertical","data-state":lN(S.open),"data-radix-menu-content":"",dir:_.dir,...M,...k,ref:H,style:{outline:"none",...k.style},onKeyDown:Pe(k.onKeyDown,oe=>{const je=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,Z=oe.ctrlKey||oe.altKey||oe.metaKey,O=oe.key.length===1;je&&(oe.key==="Tab"&&oe.preventDefault(),!Z&&O&&q(oe.key));const Ne=R.current;if(oe.target!==Ne||!jY.includes(oe.key))return;oe.preventDefault();const Ce=z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);B9.includes(oe.key)&&Ce.reverse(),UY(Ce)}),onBlur:Pe(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout($.current),I.current="")}),onPointerMove:Pe(e.onPointerMove,ku(oe=>{const P=oe.target,je=J.current!==oe.clientX;if(oe.currentTarget.contains(P)&&je){const Z=oe.clientX>J.current?"right":"left";we.current=Z,J.current=oe.clientX}}))})})})})})})});U9.displayName=_a;var OY="MenuGroup",zg=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(Ft.div,{role:"group",...a,ref:t})});zg.displayName=OY;var RY="MenuLabel",$9=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(Ft.div,{...a,ref:t})});$9.displayName=RY;var xm="MenuItem",C5="menu.itemSelect",Qm=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...l}=e,o=w.useRef(null),c=ed(xm,e.__scopeMenu),d=Ag(xm,e.__scopeMenu),m=dn(t,o),f=w.useRef(!1),p=()=>{const x=o.current;if(!n&&x){const y=new CustomEvent(C5,{bubbles:!0,cancelable:!0});x.addEventListener(C5,b=>a?.(b),{once:!0}),X5(x,y),y.defaultPrevented?f.current=!1:c.onClose()}};return r.jsx(V9,{...l,ref:m,disabled:n,onClick:Pe(e.onClick,p),onPointerDown:x=>{e.onPointerDown?.(x),f.current=!0},onPointerUp:Pe(e.onPointerUp,x=>{f.current||x.currentTarget?.click()}),onKeyDown:Pe(e.onKeyDown,x=>{const y=d.searchRef.current!=="";n||y&&x.key===" "||n1.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})});Qm.displayName=xm;var V9=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:l,...o}=e,c=Ag(xm,n),d=P9(n),m=w.useRef(null),f=dn(t,m),[p,x]=w.useState(!1),[y,b]=w.useState("");return w.useEffect(()=>{const j=m.current;j&&b((j.textContent??"").trim())},[o.children]),r.jsx(Su.ItemSlot,{scope:n,disabled:a,textValue:l??y,children:r.jsx(G6,{asChild:!0,...d,focusable:!a,children:r.jsx(Ft.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:f,onPointerMove:Pe(e.onPointerMove,ku(j=>{a?c.onItemLeave(j):(c.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,ku(j=>c.onItemLeave(j))),onFocus:Pe(e.onFocus,()=>x(!0)),onBlur:Pe(e.onBlur,()=>x(!1))})})})}),BY="MenuCheckboxItem",G9=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...l}=e;return r.jsx(Q9,{scope:e.__scopeMenu,checked:n,children:r.jsx(Qm,{role:"menuitemcheckbox","aria-checked":gm(n)?"mixed":n,...l,ref:t,"data-state":Bg(n),onSelect:Pe(l.onSelect,()=>a?.(gm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});G9.displayName=BY;var Y9="MenuRadioGroup",[LY,PY]=_i(Y9,{value:void 0,onValueChange:()=>{}}),W9=w.forwardRef((e,t)=>{const{value:n,onValueChange:a,...l}=e,o=gr(a);return r.jsx(LY,{scope:e.__scopeMenu,value:n,onValueChange:o,children:r.jsx(zg,{...l,ref:t})})});W9.displayName=Y9;var X9="MenuRadioItem",K9=w.forwardRef((e,t)=>{const{value:n,...a}=e,l=PY(X9,e.__scopeMenu),o=n===l.value;return r.jsx(Q9,{scope:e.__scopeMenu,checked:o,children:r.jsx(Qm,{role:"menuitemradio","aria-checked":o,...a,ref:t,"data-state":Bg(o),onSelect:Pe(a.onSelect,()=>l.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});K9.displayName=X9;var Og="MenuItemIndicator",[Q9,FY]=_i(Og,{checked:!1}),Z9=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...l}=e,o=FY(Og,n);return r.jsx(Wr,{present:a||gm(o.checked)||o.checked===!0,children:r.jsx(Ft.span,{...l,ref:t,"data-state":Bg(o.checked)})})});Z9.displayName=Og;var IY="MenuSeparator",J9=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(Ft.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});J9.displayName=IY;var qY="MenuArrow",eN=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=Ju(n);return r.jsx(g1,{...l,...a,ref:t})});eN.displayName=qY;var Rg="MenuSub",[HY,tN]=_i(Rg),nN=e=>{const{__scopeMenu:t,children:n,open:a=!1,onOpenChange:l}=e,o=Ll(Rg,t),c=Ju(t),[d,m]=w.useState(null),[f,p]=w.useState(null),x=gr(l);return w.useEffect(()=>(o.open===!1&&x(!1),()=>x(!1)),[o.open,x]),r.jsx(jm,{...c,children:r.jsx(F9,{scope:t,open:a,onOpenChange:x,content:f,onContentChange:p,children:r.jsx(HY,{scope:t,contentId:Ta(),triggerId:Ta(),trigger:d,onTriggerChange:m,children:n})})})};nN.displayName=Rg;var au="MenuSubTrigger",rN=w.forwardRef((e,t)=>{const n=Ll(au,e.__scopeMenu),a=ed(au,e.__scopeMenu),l=tN(au,e.__scopeMenu),o=Ag(au,e.__scopeMenu),c=w.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=o,f={__scopeMenu:e.__scopeMenu},p=w.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return w.useEffect(()=>p,[p]),w.useEffect(()=>{const x=d.current;return()=>{window.clearTimeout(x),m(null)}},[d,m]),r.jsx(Mg,{asChild:!0,...f,children:r.jsx(V9,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":lN(n.open),...e,ref:Nl(t,l.onTriggerChange),onClick:x=>{e.onClick?.(x),!(e.disabled||x.defaultPrevented)&&(x.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,ku(x=>{o.onItemEnter(x),!x.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Pe(e.onPointerLeave,ku(x=>{p();const y=n.content?.getBoundingClientRect();if(y){const b=n.content?.dataset.side,j=b==="right",k=j?-5:5,S=y[j?"left":"right"],_=y[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:x.clientX+k,y:x.clientY},{x:S,y:y.top},{x:_,y:y.top},{x:_,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(x),x.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,x=>{const y=o.searchRef.current!=="";e.disabled||y&&x.key===" "||NY[a.dir].includes(x.key)&&(n.onOpenChange(!0),n.content?.focus(),x.preventDefault())})})})});rN.displayName=au;var aN="MenuSubContent",sN=w.forwardRef((e,t)=>{const n=q9(_a,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,o=Ll(_a,e.__scopeMenu),c=ed(_a,e.__scopeMenu),d=tN(aN,e.__scopeMenu),m=w.useRef(null),f=dn(t,m);return r.jsx(Su.Provider,{scope:e.__scopeMenu,children:r.jsx(Wr,{present:a||o.open,children:r.jsx(Su.Slot,{scope:e.__scopeMenu,children:r.jsx(Dg,{id:d.contentId,"aria-labelledby":d.triggerId,...l,ref:f,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{c.isUsingKeyboardRef.current&&m.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,p=>{p.target!==d.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:Pe(e.onKeyDown,p=>{const x=p.currentTarget.contains(p.target),y=SY[c.dir].includes(p.key);x&&y&&(o.onOpenChange(!1),d.trigger?.focus(),p.preventDefault())})})})})})});sN.displayName=aN;function lN(e){return e?"open":"closed"}function gm(e){return e==="indeterminate"}function Bg(e){return gm(e)?"indeterminate":e?"checked":"unchecked"}function UY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $Y(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function VY(e,t,n){const l=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let c=$Y(e,Math.max(o,0));l.length===1&&(c=c.filter(f=>f!==n));const m=c.find(f=>f.toLowerCase().startsWith(l.toLowerCase()));return m!==n?m:void 0}function GY(e,t){const{x:n,y:a}=e;let l=!1;for(let o=0,c=t.length-1;oa!=y>a&&n<(x-f)*(a-p)/(y-p)+f&&(l=!l)}return l}function YY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return GY(n,t)}function ku(e){return t=>t.pointerType==="mouse"?e(t):void 0}var WY=I9,XY=Mg,KY=H9,QY=U9,ZY=zg,JY=$9,eW=Qm,tW=G9,nW=W9,rW=K9,aW=Z9,sW=J9,lW=eN,iW=nN,oW=rN,cW=sN,Lg="ContextMenu",[uW]=Ha(Lg,[L9]),Nr=L9(),[dW,iN]=uW(Lg),oN=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:a,dir:l,modal:o=!0}=e,[c,d]=w.useState(!1),m=Nr(t),f=gr(a),p=w.useCallback(x=>{d(x),f(x)},[f]);return r.jsx(dW,{scope:t,open:c,onOpenChange:p,modal:o,children:r.jsx(WY,{...m,dir:l,open:c,onOpenChange:p,modal:o,children:n})})};oN.displayName=Lg;var cN="ContextMenuTrigger",uN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:a=!1,...l}=e,o=iN(cN,n),c=Nr(n),d=w.useRef({x:0,y:0}),m=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...d.current})}),f=w.useRef(0),p=w.useCallback(()=>window.clearTimeout(f.current),[]),x=y=>{d.current={x:y.clientX,y:y.clientY},o.onOpenChange(!0)};return w.useEffect(()=>p,[p]),w.useEffect(()=>void(a&&p()),[a,p]),r.jsxs(r.Fragment,{children:[r.jsx(XY,{...c,virtualRef:m}),r.jsx(Ft.span,{"data-state":o.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:a?e.onContextMenu:Pe(e.onContextMenu,y=>{p(),x(y),y.preventDefault()}),onPointerDown:a?e.onPointerDown:Pe(e.onPointerDown,F0(y=>{p(),f.current=window.setTimeout(()=>x(y),700)})),onPointerMove:a?e.onPointerMove:Pe(e.onPointerMove,F0(p)),onPointerCancel:a?e.onPointerCancel:Pe(e.onPointerCancel,F0(p)),onPointerUp:a?e.onPointerUp:Pe(e.onPointerUp,F0(p))})]})});uN.displayName=cN;var mW="ContextMenuPortal",dN=e=>{const{__scopeContextMenu:t,...n}=e,a=Nr(t);return r.jsx(KY,{...a,...n})};dN.displayName=mW;var mN="ContextMenuContent",hN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=iN(mN,n),o=Nr(n),c=w.useRef(!1);return r.jsx(QY,{...o,...a,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:d=>{e.onCloseAutoFocus?.(d),!d.defaultPrevented&&c.current&&d.preventDefault(),c.current=!1},onInteractOutside:d=>{e.onInteractOutside?.(d),!d.defaultPrevented&&!l.modal&&(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hN.displayName=mN;var hW="ContextMenuGroup",fW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(ZY,{...l,...a,ref:t})});fW.displayName=hW;var pW="ContextMenuLabel",fN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(JY,{...l,...a,ref:t})});fN.displayName=pW;var xW="ContextMenuItem",pN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(eW,{...l,...a,ref:t})});pN.displayName=xW;var gW="ContextMenuCheckboxItem",xN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(tW,{...l,...a,ref:t})});xN.displayName=gW;var vW="ContextMenuRadioGroup",yW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(nW,{...l,...a,ref:t})});yW.displayName=vW;var bW="ContextMenuRadioItem",gN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(rW,{...l,...a,ref:t})});gN.displayName=bW;var wW="ContextMenuItemIndicator",vN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(aW,{...l,...a,ref:t})});vN.displayName=wW;var jW="ContextMenuSeparator",yN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(sW,{...l,...a,ref:t})});yN.displayName=jW;var NW="ContextMenuArrow",SW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(lW,{...l,...a,ref:t})});SW.displayName=NW;var bN="ContextMenuSub",wN=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:a,open:l,defaultOpen:o}=e,c=Nr(t),[d,m]=Dl({prop:l,defaultProp:o??!1,onChange:a,caller:bN});return r.jsx(iW,{...c,open:d,onOpenChange:m,children:n})};wN.displayName=bN;var kW="ContextMenuSubTrigger",jN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(oW,{...l,...a,ref:t})});jN.displayName=kW;var CW="ContextMenuSubContent",NN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(cW,{...l,...a,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});NN.displayName=CW;function F0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var TW=oN,_W=uN,MW=dN,SN=hN,kN=fN,CN=pN,TN=xN,_N=gN,MN=vN,EN=yN,EW=wN,AN=jN,DN=NN;const AW=TW,DW=_W,zW=EW,zN=w.forwardRef(({className:e,inset:t,children:n,...a},l)=>r.jsxs(AN,{ref:l,className:me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...a,children:[n,r.jsx(yi,{className:"ml-auto h-4 w-4"})]}));zN.displayName=AN.displayName;const ON=w.forwardRef(({className:e,...t},n)=>r.jsx(DN,{ref:n,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));ON.displayName=DN.displayName;const RN=w.forwardRef(({className:e,...t},n)=>r.jsx(MW,{children:r.jsx(SN,{ref:n,className:me("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));RN.displayName=SN.displayName;const Ba=w.forwardRef(({className:e,inset:t,...n},a)=>r.jsx(CN,{ref:a,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ba.displayName=CN.displayName;const OW=w.forwardRef(({className:e,children:t,checked:n,...a},l)=>r.jsxs(TN,{ref:l,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...a,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(MN,{children:r.jsx(di,{className:"h-4 w-4"})})}),t]}));OW.displayName=TN.displayName;const RW=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(_N,{ref:a,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(MN,{children:r.jsx(ST,{className:"h-2 w-2 fill-current"})})}),t]}));RW.displayName=_N.displayName;const BW=w.forwardRef(({className:e,inset:t,...n},a)=>r.jsx(kN,{ref:a,className:me("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));BW.displayName=kN.displayName;const su=w.forwardRef(({className:e,...t},n)=>r.jsx(EN,{ref:n,className:me("-mx-1 my-1 h-px bg-border",e),...t}));su.displayName=EN.displayName;const _o=({className:e,...t})=>r.jsx("span",{className:me("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});_o.displayName="ContextMenuShortcut";var LW=Symbol("radix.slottable");function PW(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LW,t}var[Zm]=Ha("Tooltip",[Uo]),Jm=Uo(),BN="TooltipProvider",FW=700,r1="tooltip.open",[IW,Pg]=Zm(BN),LN=e=>{const{__scopeTooltip:t,delayDuration:n=FW,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:o}=e,c=w.useRef(!0),d=w.useRef(!1),m=w.useRef(0);return w.useEffect(()=>{const f=m.current;return()=>window.clearTimeout(f)},[]),r.jsx(IW,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(m.current),c.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.current=!0,a)},[a]),isPointerInTransitRef:d,onPointerInTransitChange:w.useCallback(f=>{d.current=f},[]),disableHoverableContent:l,children:o})};LN.displayName=BN;var Cu="Tooltip",[qW,td]=Zm(Cu),PN=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:l,onOpenChange:o,disableHoverableContent:c,delayDuration:d}=e,m=Pg(Cu,e.__scopeTooltip),f=Jm(t),[p,x]=w.useState(null),y=Ta(),b=w.useRef(0),j=c??m.disableHoverableContent,k=d??m.delayDuration,S=w.useRef(!1),[_,M]=Dl({prop:a,defaultProp:l??!1,onChange:R=>{R?(m.onOpen(),document.dispatchEvent(new CustomEvent(r1))):m.onClose(),o?.(R)},caller:Cu}),D=w.useMemo(()=>_?S.current?"delayed-open":"instant-open":"closed",[_]),z=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,S.current=!1,M(!0)},[M]),L=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,M(!1)},[M]),E=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{S.current=!0,M(!0),b.current=0},k)},[k,M]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),r.jsx(jm,{...f,children:r.jsx(qW,{scope:t,contentId:y,open:_,stateAttribute:D,trigger:p,onTriggerChange:x,onTriggerEnter:w.useCallback(()=>{m.isOpenDelayedRef.current?E():z()},[m.isOpenDelayedRef,E,z]),onTriggerLeave:w.useCallback(()=>{j?L():(window.clearTimeout(b.current),b.current=0)},[L,j]),onOpen:z,onClose:L,disableHoverableContent:j,children:n})})};PN.displayName=Cu;var a1="TooltipTrigger",FN=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=td(a1,n),o=Pg(a1,n),c=Jm(n),d=w.useRef(null),m=dn(t,d,l.onTriggerChange),f=w.useRef(!1),p=w.useRef(!1),x=w.useCallback(()=>f.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(Nm,{asChild:!0,...c,children:r.jsx(Ft.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:m,onPointerMove:Pe(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(l.onTriggerEnter(),p.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{l.onTriggerLeave(),p.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{l.open&&l.onClose(),f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Pe(e.onFocus,()=>{f.current||l.onOpen()}),onBlur:Pe(e.onBlur,l.onClose),onClick:Pe(e.onClick,l.onClose)})})});FN.displayName=a1;var Fg="TooltipPortal",[HW,UW]=Zm(Fg,{forceMount:void 0}),IN=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:l}=e,o=td(Fg,t);return r.jsx(HW,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(wm,{asChild:!0,container:l,children:a})})})};IN.displayName=Fg;var Ho="TooltipContent",qN=w.forwardRef((e,t)=>{const n=UW(Ho,e.__scopeTooltip),{forceMount:a=n.forceMount,side:l="top",...o}=e,c=td(Ho,e.__scopeTooltip);return r.jsx(Wr,{present:a||c.open,children:c.disableHoverableContent?r.jsx(HN,{side:l,...o,ref:t}):r.jsx($W,{side:l,...o,ref:t})})}),$W=w.forwardRef((e,t)=>{const n=td(Ho,e.__scopeTooltip),a=Pg(Ho,e.__scopeTooltip),l=w.useRef(null),o=dn(t,l),[c,d]=w.useState(null),{trigger:m,onClose:f}=n,p=l.current,{onPointerInTransitChange:x}=a,y=w.useCallback(()=>{d(null),x(!1)},[x]),b=w.useCallback((j,k)=>{const S=j.currentTarget,_={x:j.clientX,y:j.clientY},M=XW(_,S.getBoundingClientRect()),D=KW(_,M),z=QW(k.getBoundingClientRect()),L=JW([...D,...z]);d(L),x(!0)},[x]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(m&&p){const j=S=>b(S,p),k=S=>b(S,m);return m.addEventListener("pointerleave",j),p.addEventListener("pointerleave",k),()=>{m.removeEventListener("pointerleave",j),p.removeEventListener("pointerleave",k)}}},[m,p,b,y]),w.useEffect(()=>{if(c){const j=k=>{const S=k.target,_={x:k.clientX,y:k.clientY},M=m?.contains(S)||p?.contains(S),D=!ZW(_,c);M?y():D&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[m,p,c,f,y]),r.jsx(HN,{...e,ref:o})}),[VW,GW]=Zm(Cu,{isInside:!1}),YW=PW("TooltipContent"),HN=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":l,onEscapeKeyDown:o,onPointerDownOutside:c,...d}=e,m=td(Ho,n),f=Jm(n),{onClose:p}=m;return w.useEffect(()=>(document.addEventListener(r1,p),()=>document.removeEventListener(r1,p)),[p]),w.useEffect(()=>{if(m.trigger){const x=y=>{y.target?.contains(m.trigger)&&p()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[m.trigger,p]),r.jsx(p1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:p,children:r.jsxs(x1,{"data-state":m.stateAttribute,...f,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(YW,{children:a}),r.jsx(VW,{scope:n,isInside:!0,children:r.jsx(tT,{id:m.contentId,role:"tooltip",children:l||a})})]})})});qN.displayName=Ho;var UN="TooltipArrow",WW=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=Jm(n);return GW(UN,n).isInside?null:r.jsx(g1,{...l,...a,ref:t})});WW.displayName=UN;function XW(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,a,l,o)){case o:return"left";case l:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function KW(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function QW(e){const{top:t,right:n,bottom:a,left:l}=e;return[{x:l,y:t},{x:n,y:t},{x:n,y:a},{x:l,y:a}]}function ZW(e,t){const{x:n,y:a}=e;let l=!1;for(let o=0,c=t.length-1;oa!=y>a&&n<(x-f)*(a-p)/(y-p)+f&&(l=!l)}return l}function JW(e){const t=e.slice();return t.sort((n,a)=>n.xa.x?1:n.ya.y?1:0),eX(t)}function eX(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(l.y-c.y)>=(o.y-c.y)*(l.x-c.x))t.pop();else break}t.push(l)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const l=e[a];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(l.y-c.y)>=(o.y-c.y)*(l.x-c.x))n.pop();else break}n.push(l)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tX=LN,nX=PN,rX=FN,aX=IN,$N=qN;const sX=tX,lX=nX,iX=rX,VN=w.forwardRef(({className:e,sideOffset:t=4,...n},a)=>r.jsx(aX,{children:r.jsx($N,{ref:a,sideOffset:t,className:me("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));VN.displayName=$N.displayName;function oX({children:e}){jA();const[t,n]=w.useState(!0),[a,l]=w.useState(!1),[o,c]=w.useState(!1),{theme:d,setTheme:m}=z1(),f=_C(),p=rs();w.useEffect(()=>{const k=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),c(!0))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[]);const x=[{title:"概览",items:[{icon:K0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:jl,label:"麦麦主程序配置",path:"/config/bot"},{icon:e6,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:t6,label:"麦麦模型配置",path:"/config/model"},{icon:Hy,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:v1,label:"表情包管理",path:"/resource/emoji"},{icon:_u,label:"表达方式管理",path:"/resource/expression"},{icon:n6,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:em,label:"插件市场",path:"/plugins"},{icon:Hy,label:"插件配置",path:"/plugin-config"},{icon:Q0,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Pa,label:"系统设置",path:"/settings"}]}],b=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,j=()=>{localStorage.removeItem("access-token"),p({to:"/auth"})};return r.jsx(sX,{delayDuration:300,children:r.jsxs("div",{className:"flex h-screen overflow-hidden",children:[r.jsxs("aside",{className:me("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",a?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[r.jsx("div",{className:"flex h-16 items-center border-b px-4",children:r.jsxs("div",{className:me("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[r.jsxs("div",{className:me("flex items-baseline gap-2",!t&&"lg:hidden"),children:[r.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),r.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:ZE()})]}),!t&&r.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),r.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:r.jsx("ul",{className:me("space-y-6",!t&&"lg:space-y-3"),children:x.map((k,S)=>r.jsxs("li",{children:[r.jsx("div",{className:me("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:k.title})}),!t&&S>0&&r.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),r.jsx("ul",{className:"space-y-1",children:k.items.map(_=>{const M=f({to:_.path}),D=_.icon,z=r.jsxs(r.Fragment,{children:[M&&r.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),r.jsxs("div",{className:me("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[r.jsx(D,{className:me("h-5 w-5 flex-shrink-0",M&&"text-primary"),strokeWidth:2,fill:"none"}),r.jsx("span",{className:me("text-sm font-medium whitespace-nowrap transition-all duration-300",M&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:_.label})]})]});return r.jsx("li",{className:"relative",children:r.jsxs(lX,{children:[r.jsx(iX,{asChild:!0,children:r.jsx(MC,{to:_.path,className:me("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",M?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>l(!1),children:z})}),!t&&r.jsx(VN,{side:"right",className:"hidden lg:block",children:r.jsx("p",{children:_.label})})]})},_.path)})})]},k.title))})})]}),a&&r.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>l(!1)}),r.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[r.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("button",{onClick:()=>l(!a),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:r.jsx(kT,{className:"h-5 w-5"})}),r.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:r.jsx(vi,{className:me("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>c(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),r.jsxs(R9,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[r.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),r.jsx(fY,{open:o,onOpenChange:c}),r.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[r.jsx(CT,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),r.jsx("button",{onClick:k=>{LE(b==="dark"?"light":"dark",m,k)},className:"rounded-lg p-2 hover:bg-accent",title:b==="dark"?"切换到浅色模式":"切换到深色模式",children:b==="dark"?r.jsx(xx,{className:"h-5 w-5"}):r.jsx(gx,{className:"h-5 w-5"})}),r.jsx("div",{className:"h-6 w-px bg-border"}),r.jsxs(re,{variant:"ghost",size:"sm",onClick:j,className:"gap-2",title:"登出系统",children:[r.jsx(Uy,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),r.jsxs(AW,{children:[r.jsx(DW,{asChild:!0,children:r.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),r.jsxs(RN,{className:"w-64",children:[r.jsxs(Ba,{onClick:()=>p({to:"/"}),children:[r.jsx(K0,{className:"mr-2 h-4 w-4"}),"首页"]}),r.jsxs(Ba,{onClick:()=>p({to:"/settings"}),children:[r.jsx(Pa,{className:"mr-2 h-4 w-4"}),"系统设置"]}),r.jsxs(Ba,{onClick:()=>p({to:"/logs"}),children:[r.jsx(Q0,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),r.jsx(su,{}),r.jsxs(zW,{children:[r.jsxs(zN,{children:[r.jsx(Q5,{className:"mr-2 h-4 w-4"}),"切换主题"]}),r.jsxs(ON,{className:"w-48",children:[r.jsxs(Ba,{onClick:()=>m("light"),disabled:d==="light",children:[r.jsx(xx,{className:"mr-2 h-4 w-4"}),"浅色",d==="light"&&r.jsx(_o,{children:"✓"})]}),r.jsxs(Ba,{onClick:()=>m("dark"),disabled:d==="dark",children:[r.jsx(gx,{className:"mr-2 h-4 w-4"}),"深色",d==="dark"&&r.jsx(_o,{children:"✓"})]}),r.jsxs(Ba,{onClick:()=>m("system"),disabled:d==="system",children:[r.jsx(Pa,{className:"mr-2 h-4 w-4"}),"跟随系统",d==="system"&&r.jsx(_o,{children:"✓"})]})]})]}),r.jsx(su,{}),r.jsxs(Ba,{onClick:()=>window.location.reload(),children:[r.jsx(TT,{className:"mr-2 h-4 w-4"}),"刷新页面",r.jsx(_o,{children:"⌘R"})]}),r.jsxs(Ba,{onClick:()=>c(!0),children:[r.jsx(Gr,{className:"mr-2 h-4 w-4"}),"搜索",r.jsx(_o,{children:"⌘K"})]}),r.jsx(su,{}),r.jsxs(Ba,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[r.jsx(lu,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),r.jsx(su,{}),r.jsxs(Ba,{onClick:j,className:"text-destructive focus:text-destructive",children:[r.jsx(Uy,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const nd=EC({component:()=>r.jsxs(r.Fragment,{children:[r.jsx(_5,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!l7())throw DC({to:"/auth"})}}),cX=fr({getParentRoute:()=>nd,path:"/auth",component:NA}),uX=fr({getParentRoute:()=>nd,path:"/setup",component:HA}),Zr=fr({getParentRoute:()=>nd,id:"protected",component:()=>r.jsx(oX,{children:r.jsx(_5,{})})}),dX=fr({getParentRoute:()=>Zr,path:"/",component:RE}),mX=fr({getParentRoute:()=>Zr,path:"/config/bot",component:zD}),hX=fr({getParentRoute:()=>Zr,path:"/config/modelProvider",component:XD}),fX=fr({getParentRoute:()=>Zr,path:"/config/model",component:Nz}),pX=fr({getParentRoute:()=>Zr,path:"/config/adapter",component:Sz}),xX=fr({getParentRoute:()=>Zr,path:"/resource/emoji",component:WH}),gX=fr({getParentRoute:()=>Zr,path:"/resource/expression",component:aU}),vX=fr({getParentRoute:()=>Zr,path:"/resource/person",component:pU}),yX=fr({getParentRoute:()=>Zr,path:"/logs",component:KG}),bX=fr({getParentRoute:()=>Zr,path:"/plugins",component:cY}),wX=fr({getParentRoute:()=>Zr,path:"/plugin-config",component:uY}),jX=fr({getParentRoute:()=>Zr,path:"/plugin-mirrors",component:dY}),NX=fr({getParentRoute:()=>Zr,path:"/settings",component:pA}),SX=fr({getParentRoute:()=>nd,path:"*",component:c7}),kX=nd.addChildren([cX,uX,Zr.addChildren([dX,mX,hX,fX,pX,xX,gX,vX,bX,wX,jX,yX,NX]),SX]),CX=AC({routeTree:kX,defaultNotFoundComponent:c7});function TX({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...a}){const[l,o]=w.useState(()=>localStorage.getItem(n)||t);w.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),l==="system"){const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(m);return}d.classList.add(l)},[l]),w.useEffect(()=>{const d=localStorage.getItem("accent-color");if(d){const m=document.documentElement,p={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[d];p&&(m.style.setProperty("--primary",p.hsl),p.gradient?(m.style.setProperty("--primary-gradient",p.gradient),m.classList.add("has-gradient")):(m.style.removeProperty("--primary-gradient"),m.classList.remove("has-gradient")))}},[]);const c={theme:l,setTheme:d=>{localStorage.setItem(n,d),o(d)}};return r.jsx(Mw.Provider,{...a,value:c,children:e})}function _X({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:a="enable-animations",wavesStorageKey:l="enable-waves-background"}){const[o,c]=w.useState(()=>{const p=localStorage.getItem(a);return p!==null?p==="true":t}),[d,m]=w.useState(()=>{const p=localStorage.getItem(l);return p!==null?p==="true":n});w.useEffect(()=>{const p=document.documentElement;o?p.classList.remove("no-animations"):p.classList.add("no-animations"),localStorage.setItem(a,String(o))},[o,a]),w.useEffect(()=>{localStorage.setItem(l,String(d))},[d,l]);const f={enableAnimations:o,setEnableAnimations:c,enableWavesBackground:d,setEnableWavesBackground:m};return r.jsx(Ew.Provider,{value:f,children:e})}var Ig="ToastProvider",[qg,MX,EX]=vm("Toast"),[GN]=Ha("Toast",[EX]),[AX,eh]=GN(Ig),YN=e=>{const{__scopeToast:t,label:n="Notification",duration:a=5e3,swipeDirection:l="right",swipeThreshold:o=50,children:c}=e,[d,m]=w.useState(null),[f,p]=w.useState(0),x=w.useRef(!1),y=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ig}\`. Expected non-empty \`string\`.`),r.jsx(qg.Provider,{scope:t,children:r.jsx(AX,{scope:t,label:n,duration:a,swipeDirection:l,swipeThreshold:o,toastCount:f,viewport:d,onViewportChange:m,onToastAdd:w.useCallback(()=>p(b=>b+1),[]),onToastRemove:w.useCallback(()=>p(b=>b-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:y,children:c})})};YN.displayName=Ig;var WN="ToastViewport",DX=["F8"],s1="toast.viewportPause",l1="toast.viewportResume",XN=w.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:a=DX,label:l="Notifications ({hotkey})",...o}=e,c=eh(WN,n),d=MX(n),m=w.useRef(null),f=w.useRef(null),p=w.useRef(null),x=w.useRef(null),y=dn(t,x,c.onViewportChange),b=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=c.toastCount>0;w.useEffect(()=>{const S=_=>{a.length!==0&&a.every(D=>_[D]||_.code===D)&&x.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[a]),w.useEffect(()=>{const S=m.current,_=x.current;if(j&&S&&_){const M=()=>{if(!c.isClosePausedRef.current){const E=new CustomEvent(s1);_.dispatchEvent(E),c.isClosePausedRef.current=!0}},D=()=>{if(c.isClosePausedRef.current){const E=new CustomEvent(l1);_.dispatchEvent(E),c.isClosePausedRef.current=!1}},z=E=>{!S.contains(E.relatedTarget)&&D()},L=()=>{S.contains(document.activeElement)||D()};return S.addEventListener("focusin",M),S.addEventListener("focusout",z),S.addEventListener("pointermove",M),S.addEventListener("pointerleave",L),window.addEventListener("blur",M),window.addEventListener("focus",D),()=>{S.removeEventListener("focusin",M),S.removeEventListener("focusout",z),S.removeEventListener("pointermove",M),S.removeEventListener("pointerleave",L),window.removeEventListener("blur",M),window.removeEventListener("focus",D)}}},[j,c.isClosePausedRef]);const k=w.useCallback(({tabbingDirection:S})=>{const M=d().map(D=>{const z=D.ref.current,L=[z,...VX(z)];return S==="forwards"?L:L.reverse()});return(S==="forwards"?M.reverse():M).flat()},[d]);return w.useEffect(()=>{const S=x.current;if(S){const _=M=>{const D=M.altKey||M.ctrlKey||M.metaKey;if(M.key==="Tab"&&!D){const L=document.activeElement,E=M.shiftKey;if(M.target===S&&E){f.current?.focus();return}const $=k({tabbingDirection:E?"backwards":"forwards"}),I=$.findIndex(G=>G===L);mx($.slice(I+1))?M.preventDefault():E?f.current?.focus():p.current?.focus()}};return S.addEventListener("keydown",_),()=>S.removeEventListener("keydown",_)}},[d,k]),r.jsxs(nT,{ref:m,role:"region","aria-label":l.replace("{hotkey}",b),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&r.jsx(i1,{ref:f,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"forwards"});mx(S)}}),r.jsx(qg.Slot,{scope:n,children:r.jsx(Ft.ol,{tabIndex:-1,...o,ref:y})}),j&&r.jsx(i1,{ref:p,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"backwards"});mx(S)}})]})});XN.displayName=WN;var KN="ToastFocusProxy",i1=w.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:a,...l}=e,o=eh(KN,n);return r.jsx(K5,{tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:c=>{const d=c.relatedTarget;!o.viewport?.contains(d)&&a()}})});i1.displayName=KN;var rd="Toast",zX="toast.swipeStart",OX="toast.swipeMove",RX="toast.swipeCancel",BX="toast.swipeEnd",QN=w.forwardRef((e,t)=>{const{forceMount:n,open:a,defaultOpen:l,onOpenChange:o,...c}=e,[d,m]=Dl({prop:a,defaultProp:l??!0,onChange:o,caller:rd});return r.jsx(Wr,{present:n||d,children:r.jsx(FX,{open:d,...c,ref:t,onClose:()=>m(!1),onPause:gr(e.onPause),onResume:gr(e.onResume),onSwipeStart:Pe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,f=>{const{x:p,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,f=>{const{x:p,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),m(!1)})})})});QN.displayName=rd;var[LX,PX]=GN(rd,{onClose(){}}),FX=w.forwardRef((e,t)=>{const{__scopeToast:n,type:a="foreground",duration:l,open:o,onClose:c,onEscapeKeyDown:d,onPause:m,onResume:f,onSwipeStart:p,onSwipeMove:x,onSwipeCancel:y,onSwipeEnd:b,...j}=e,k=eh(rd,n),[S,_]=w.useState(null),M=dn(t,J=>_(J)),D=w.useRef(null),z=w.useRef(null),L=l||k.duration,E=w.useRef(0),R=w.useRef(L),H=w.useRef(0),{onToastAdd:$,onToastRemove:I}=k,G=gr(()=>{S?.contains(document.activeElement)&&k.viewport?.focus(),c()}),te=w.useCallback(J=>{!J||J===1/0||(window.clearTimeout(H.current),E.current=new Date().getTime(),H.current=window.setTimeout(G,J))},[G]);w.useEffect(()=>{const J=k.viewport;if(J){const ae=()=>{te(R.current),f?.()},U=()=>{const q=new Date().getTime()-E.current;R.current=R.current-q,window.clearTimeout(H.current),m?.()};return J.addEventListener(s1,U),J.addEventListener(l1,ae),()=>{J.removeEventListener(s1,U),J.removeEventListener(l1,ae)}}},[k.viewport,L,m,f,te]),w.useEffect(()=>{o&&!k.isClosePausedRef.current&&te(L)},[o,L,k.isClosePausedRef,te]),w.useEffect(()=>($(),()=>I()),[$,I]);const we=w.useMemo(()=>S?aS(S):null,[S]);return k.viewport?r.jsxs(r.Fragment,{children:[we&&r.jsx(IX,{__scopeToast:n,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:we}),r.jsx(LX,{scope:n,onClose:G,children:zC.createPortal(r.jsx(qg.ItemSlot,{scope:n,children:r.jsx(rT,{asChild:!0,onEscapeKeyDown:Pe(d,()=>{k.isFocusedToastEscapeKeyDownRef.current||G(),k.isFocusedToastEscapeKeyDownRef.current=!1}),children:r.jsx(Ft.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":k.swipeDirection,...j,ref:M,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,J=>{J.key==="Escape"&&(d?.(J.nativeEvent),J.nativeEvent.defaultPrevented||(k.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Pe(e.onPointerDown,J=>{J.button===0&&(D.current={x:J.clientX,y:J.clientY})}),onPointerMove:Pe(e.onPointerMove,J=>{if(!D.current)return;const ae=J.clientX-D.current.x,U=J.clientY-D.current.y,q=!!z.current,W=["left","right"].includes(k.swipeDirection),oe=["left","up"].includes(k.swipeDirection)?Math.min:Math.max,P=W?oe(0,ae):0,je=W?0:oe(0,U),Z=J.pointerType==="touch"?10:2,O={x:P,y:je},Ne={originalEvent:J,delta:O};q?(z.current=O,I0(OX,x,Ne,{discrete:!1})):T5(O,k.swipeDirection,Z)?(z.current=O,I0(zX,p,Ne,{discrete:!1}),J.target.setPointerCapture(J.pointerId)):(Math.abs(ae)>Z||Math.abs(U)>Z)&&(D.current=null)}),onPointerUp:Pe(e.onPointerUp,J=>{const ae=z.current,U=J.target;if(U.hasPointerCapture(J.pointerId)&&U.releasePointerCapture(J.pointerId),z.current=null,D.current=null,ae){const q=J.currentTarget,W={originalEvent:J,delta:ae};T5(ae,k.swipeDirection,k.swipeThreshold)?I0(BX,b,W,{discrete:!0}):I0(RX,y,W,{discrete:!0}),q.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})})}),k.viewport)})]}):null}),IX=e=>{const{__scopeToast:t,children:n,...a}=e,l=eh(rd,t),[o,c]=w.useState(!1),[d,m]=w.useState(!1);return UX(()=>c(!0)),w.useEffect(()=>{const f=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(f)},[]),d?null:r.jsx(wm,{asChild:!0,children:r.jsx(K5,{...a,children:o&&r.jsxs(r.Fragment,{children:[l.label," ",n]})})})},qX="ToastTitle",ZN=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return r.jsx(Ft.div,{...a,ref:t})});ZN.displayName=qX;var HX="ToastDescription",JN=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return r.jsx(Ft.div,{...a,ref:t})});JN.displayName=HX;var eS="ToastAction",tS=w.forwardRef((e,t)=>{const{altText:n,...a}=e;return n.trim()?r.jsx(rS,{altText:n,asChild:!0,children:r.jsx(Hg,{...a,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${eS}\`. Expected non-empty \`string\`.`),null)});tS.displayName=eS;var nS="ToastClose",Hg=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e,l=PX(nS,n);return r.jsx(rS,{asChild:!0,children:r.jsx(Ft.button,{type:"button",...a,ref:t,onClick:Pe(e.onClick,l.onClose)})})});Hg.displayName=nS;var rS=w.forwardRef((e,t)=>{const{__scopeToast:n,altText:a,...l}=e;return r.jsx(Ft.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...l,ref:t})});function aS(e){const t=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),$X(a)){const l=a.ariaHidden||a.hidden||a.style.display==="none",o=a.dataset.radixToastAnnounceExclude==="";if(!l)if(o){const c=a.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...aS(a))}}),t}function I0(e,t,n,{discrete:a}){const l=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?X5(l,o):l.dispatchEvent(o)}var T5=(e,t,n=0)=>{const a=Math.abs(e.x),l=Math.abs(e.y),o=a>l;return t==="left"||t==="right"?o&&a>n:!o&&l>n};function UX(e=()=>{}){const t=gr(e);A5(()=>{let n=0,a=0;return n=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(a)}},[t])}function $X(e){return e.nodeType===e.ELEMENT_NODE}function VX(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mx(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var GX=YN,sS=XN,lS=QN,iS=ZN,oS=JN,cS=tS,uS=Hg;const YX=GX,dS=w.forwardRef(({className:e,...t},n)=>r.jsx(sS,{ref:n,className:me("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));dS.displayName=sS.displayName;const WX=Wo("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),mS=w.forwardRef(({className:e,variant:t,...n},a)=>r.jsx(lS,{ref:a,className:me(WX({variant:t}),e),...n}));mS.displayName=lS.displayName;const XX=w.forwardRef(({className:e,...t},n)=>r.jsx(cS,{ref:n,className:me("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));XX.displayName=cS.displayName;const hS=w.forwardRef(({className:e,...t},n)=>r.jsx(uS,{ref:n,className:me("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsx(Mu,{className:"h-4 w-4"})}));hS.displayName=uS.displayName;const fS=w.forwardRef(({className:e,...t},n)=>r.jsx(iS,{ref:n,className:me("text-sm font-semibold [&+div]:text-xs",e),...t}));fS.displayName=iS.displayName;const pS=w.forwardRef(({className:e,...t},n)=>r.jsx(oS,{ref:n,className:me("text-sm opacity-90",e),...t}));pS.displayName=oS.displayName;function KX(){const{toasts:e}=pr();return r.jsxs(YX,{children:[e.map(function({id:t,title:n,description:a,action:l,...o}){return r.jsxs(mS,{...o,children:[r.jsxs("div",{className:"grid gap-1",children:[n&&r.jsx(fS,{children:n}),a&&r.jsx(pS,{children:a})]}),l,r.jsx(hS,{})]},t)}),r.jsx(dS,{})]})}DT.createRoot(document.getElementById("root")).render(r.jsx(w.StrictMode,{children:r.jsx(TX,{defaultTheme:"system",children:r.jsxs(_X,{children:[r.jsx(OC,{router:CX}),r.jsx(KX,{})]})})})); diff --git a/webui/dist/assets/react-vendor-Dtc2IqVY.js b/webui/dist/assets/react-vendor-Dtc2IqVY.js new file mode 100644 index 00000000..087b3f14 --- /dev/null +++ b/webui/dist/assets/react-vendor-Dtc2IqVY.js @@ -0,0 +1 @@ +var ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ae(_){return _&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_}var $={exports:{}},P={};var W;function oe(){if(W)return P;W=1;var _=Symbol.for("react.transitional.element"),O=Symbol.for("react.fragment");function v(y,E,g){var R=null;if(g!==void 0&&(R=""+g),E.key!==void 0&&(R=""+E.key),"key"in E){g={};for(var m in E)m!=="key"&&(g[m]=E[m])}else g=E;return E=g.ref,{$$typeof:_,type:y,key:R,ref:E!==void 0?E:null,props:g}}return P.Fragment=O,P.jsx=v,P.jsxs=v,P}var X;function le(){return X||(X=1,$.exports=oe()),$.exports}var k={exports:{}},n={};var F;function ie(){if(F)return n;F=1;var _=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),R=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),t=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),h=Symbol.iterator;function w(e){return e===null||typeof e!="object"?null:(e=h&&e[h]||e["@@iterator"],typeof e=="function"?e:null)}var Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,q={};function C(e,r,o){this.props=e,this.context=r,this.refs=q,this.updater=o||Y}C.prototype.isReactComponent={},C.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function b(){}b.prototype=C.prototype;function N(e,r,o){this.props=e,this.context=r,this.refs=q,this.updater=o||Y}var j=N.prototype=new b;j.constructor=N,U(j,C.prototype),j.isPureReactComponent=!0;var G=Array.isArray;function D(){}var a={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function L(e,r,o){var u=o.ref;return{$$typeof:_,type:e,key:r,ref:u!==void 0?u:null,props:o}}function V(e,r){return L(e.type,r,e.props)}function x(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}function ee(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return r[o]})}var B=/\/+/g;function M(e,r){return typeof e=="object"&&e!==null&&e.key!=null?ee(""+e.key):r.toString(36)}function te(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(D,D):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function A(e,r,o,u,s){var f=typeof e;(f==="undefined"||f==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(f){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case _:case O:l=!0;break;case c:return l=e._init,A(l(e._payload),r,o,u,s)}}if(l)return s=s(e),l=u===""?"."+M(e,0):u,G(s)?(o="",l!=null&&(o=l.replace(B,"$&/")+"/"),A(s,r,o,"",function(ue){return ue})):s!=null&&(x(s)&&(s=V(s,o+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(B,"$&/")+"/")+l)),r.push(s)),1;l=0;var T=u===""?".":u+":";if(G(e))for(var d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(O){console.error(O)}}return _(),I.exports=fe(),I.exports}export{se as a,ye as b,ce as c,ae as g,le as r}; diff --git a/webui/dist/assets/router-BWgTyY51.js b/webui/dist/assets/router-BWgTyY51.js new file mode 100644 index 00000000..78a82272 --- /dev/null +++ b/webui/dist/assets/router-BWgTyY51.js @@ -0,0 +1,2 @@ +import{r as fo,a as ee,g as Ne,b as po}from"./react-vendor-Dtc2IqVY.js";function mo(t,o){for(var e=0;es[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=fo(),R=ee();const rt=Ne(R),hn=mo({__proto__:null,default:rt},[R]),Yt=new WeakMap,go=new WeakMap,bt={current:[]};let Nt=!1,mt=0;const pt=new Set,Pt=new Map;function Ue(t){for(const o of t){if(bt.current.includes(o))continue;bt.current.push(o),o.recompute();const e=go.get(o);if(e)for(const s of e){const n=Yt.get(s);n?.length&&Ue(n)}}}function yo(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function vo(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function Ve(t){if(mt>0&&!Pt.has(t)&&Pt.set(t,t.prevState),pt.add(t),!(mt>0)&&!Nt)try{for(Nt=!0;pt.size>0;){const o=Array.from(pt);pt.clear();for(const e of o){const s=Pt.get(e)??e.prevState;e.prevState=s,yo(e)}for(const e of o){const s=Yt.get(e);s&&(bt.current.push(e),Ue(s))}for(const e of o){const s=Yt.get(e);if(s)for(const n of s)vo(n)}}}finally{Nt=!1,bt.current=[],Pt.clear()}}function gt(t){mt++;try{t()}finally{if(mt--,mt===0){const o=pt.values().next().value;o&&Ve(o)}}}function So(t){return typeof t=="function"}class _o{constructor(o,e){this.listeners=new Set,this.subscribe=s=>{var n,r;this.listeners.add(s);const i=(r=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:r.call(n,s,this);return()=>{this.listeners.delete(s),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,s,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):So(o)?this.state=o(this.prevState):this.state=o,(n=(s=this.options)==null?void 0:s.onUpdate)==null||n.call(s),Ve(this)}}const G="__TSR_index",ve="popstate",Se="beforeunload";function Ro(t){let o=t.getLocation();const e=new Set,s=i=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?s(i):o=t.getLocation()},r=async({task:i,navigateOpts:c,...a})=>{if(c?.ignoreBlocker??!1){i();return}const u=t.getBlockers?.()??[],h=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const d=Et(a.path,a.state);if(await f.blockerFn({currentLocation:o,nextLocation:d,action:a.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{const l=o.state[G];c=_e(l+1,c),r({task:()=>{t.pushState(i,c),s({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{const l=o.state[G];c=_e(l,c),r({task:()=>{t.replaceState(i,c),s({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{r({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>o.state[G]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{const a=t.getBlockers?.()??[];t.setBlockers?.(a.filter(l=>l!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:s}}function _e(t,o){o||(o={});const e=oe();return{...o,key:e,__TSR_key:e,[G]:t}}function Po(t){const o=typeof document<"u"?window:void 0,e=o.history.pushState,s=o.history.replaceState;let n=[];const r=()=>n,i=v=>n=v,c=(v=>v),a=(()=>Et(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){const v=oe();o.history.replaceState({[G]:0,key:v,__TSR_key:v},"")}let l=a(),u,h=!1,f=!1,d=!1,p=!1;const m=()=>l;let y,_;const x=()=>{y&&(S._ignoreSubscribers=!0,(y.isPush?o.history.pushState:o.history.replaceState)(y.state,"",y.href),S._ignoreSubscribers=!1,y=void 0,_=void 0,u=void 0)},P=(v,C,M)=>{const T=c(C);_||(u=l),l=Et(C,M),y={href:T,state:M,isPush:y?.isPush||v==="push"},_||(_=Promise.resolve().then(()=>x()))},L=v=>{l=a(),S.notify({type:v})},E=async()=>{if(f){f=!1;return}const v=a(),C=v.state[G]-l.state[G],M=C===1,T=C===-1,I=!M&&!T||h;h=!1;const Y=I?"GO":T?"BACK":"FORWARD",D=I?{type:"GO",index:C}:{type:T?"BACK":"FORWARD"};if(d)d=!1;else{const X=r();if(typeof document<"u"&&X.length){for(const he of X)if(await he.blockerFn({currentLocation:l,nextLocation:v,action:Y})){f=!0,o.history.go(1),S.notify(D);return}}}l=a(),S.notify(D)},w=v=>{if(p){p=!1;return}let C=!1;const M=r();if(typeof document<"u"&&M.length)for(const T of M){const I=T.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return v.preventDefault(),v.returnValue=""},S=Ro({getLocation:m,getLength:()=>o.history.length,pushState:(v,C)=>P("push",v,C),replaceState:(v,C)=>P("replace",v,C),back:v=>(v&&(d=!0),p=!0,o.history.back()),forward:v=>{v&&(d=!0),p=!0,o.history.forward()},go:v=>{h=!0,o.history.go(v)},createHref:v=>c(v),flush:x,destroy:()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(Se,w,{capture:!0}),o.removeEventListener(ve,E)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return o.addEventListener(Se,w,{capture:!0}),o.addEventListener(ve,E),o.history.pushState=function(...v){const C=e.apply(o.history,v);return S._ignoreSubscribers||L("PUSH"),C},o.history.replaceState=function(...v){const C=s.apply(o.history,v);return S._ignoreSubscribers||L("REPLACE"),C},S}function Et(t,o){const e=t.indexOf("#"),s=t.indexOf("?"),n=oe();return{href:t,pathname:t.substring(0,e>0?s>0?Math.min(e,s):e:s>0?s:t.length),hash:e>-1?t.substring(e):"",search:s>-1?t.slice(s,e===-1?void 0:e):"",state:o||{[G]:0,key:n,__TSR_key:n}}}function oe(){return(Math.random()+1).toString(36).substring(7)}function Xt(t){return t[t.length-1]}function wo(t){return typeof t=="function"}function Q(t,o){return wo(t)?t(o):t}const xo=Object.prototype.hasOwnProperty;function B(t,o){if(t===o)return t;const e=o,s=we(t)&&we(e);if(!s&&!(Tt(t)&&Tt(e)))return e;const n=s?t:Re(t);if(!n)return e;const r=s?e:Re(e);if(!r)return e;const i=n.length,c=r.length,a=s?new Array(c):{};let l=0;for(let u=0;u"u")return!0;const e=o.prototype;return!(!Pe(e)||!e.hasOwnProperty("isPrototypeOf"))}function Pe(t){return Object.prototype.toString.call(t)==="[object Object]"}function we(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function tt(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,n=t.length;sn||!tt(t[i],o[i],e)))return!1;return n===r}return!1}function it(t){let o,e;const s=new Promise((n,r)=>{o=n,e=r});return s.status="pending",s.resolve=n=>{s.status="resolved",s.value=n,o(n),t?.(n)},s.reject=n=>{s.status="rejected",e(n)},s}function q(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Lo=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function xe(t,o=Lo){function e(n,r,i=0){for(let c=i;c{try{return decodeURI(c)}catch{return c}})}}if(t===""||!/%[0-9A-Fa-f]{2}/g.test(t))return t;const s=t.replaceAll(/%[0-9a-f]{2}/g,n=>n.toUpperCase());return e(s,o)}var Co="Invariant failed";function K(t,o){if(!t)throw new Error(Co)}const U=0,ot=1,at=2,ct=3;function z(t){return se(t.filter(o=>o!==void 0).join("/"))}function se(t){return t.replace(/\/{2,}/g,"/")}function ne(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function J(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Ct(t){return J(ne(t))}function It(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}function Mo(t,o,e){return It(t,e)===It(o,e)}function bo(t){const{type:o,value:e}=t;if(o===U)return e;const{prefixSegment:s,suffixSegment:n}=t;if(o===ot){const r=e.substring(1);if(s&&n)return`${s}{$${r}}${n}`;if(s)return`${s}{$${r}}`;if(n)return`{$${r}}${n}`}if(o===ct){const r=e.substring(1);return s&&n?`${s}{-$${r}}${n}`:s?`${s}{-$${r}}`:n?`{-$${r}}${n}`:`{-$${r}}`}if(o===at){if(s&&n)return`${s}{$}${n}`;if(s)return`${s}{$}`;if(n)return`{$}${n}`}return e}function Eo({base:t,to:o,trailingSlash:e="never",parseCache:s}){let n=ut(t,s).slice();const r=ut(o,s);n.length>1&&Xt(n)?.value==="/"&&n.pop();for(let a=0,l=r.length;a1&&(Xt(n).value==="/"?e==="never"&&n.pop():e==="always"&&n.push({type:U,value:"/"}));const i=n.map(bo);return z(i)}const ut=(t,o)=>{if(!t)return[];const e=o?.get(t);if(e)return e;const s=Ao(t);return o?.set(t,s),s},To=/^\$.{1,}$/,Io=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,ko=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Oo=/^\$$/,Fo=/^(.*?)\{\$\}(.*)$/;function Ao(t){t=se(t);const o=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),!t)return o;const e=t.split("/").filter(Boolean);return o.push(...e.map(s=>{const n=s.match(Fo);if(n){const c=n[1],a=n[2];return{type:at,value:"$",prefixSegment:c||void 0,suffixSegment:a||void 0}}const r=s.match(ko);if(r){const c=r[1],a=r[2],l=r[3];return{type:ct,value:a,prefixSegment:c||void 0,suffixSegment:l||void 0}}const i=s.match(Io);if(i){const c=i[1],a=i[2],l=i[3];return{type:ot,value:""+a,prefixSegment:c||void 0,suffixSegment:l||void 0}}if(To.test(s)){const c=s.substring(1);return{type:ot,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return Oo.test(s)?{type:at,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:U,value:s}})),t.slice(-1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),o}function Ut({path:t,params:o,decodeCharMap:e,parseCache:s}){const n=ut(t,s);function r(l){const u=o[l],h=typeof u=="string";return l==="*"||l==="_splat"?h?encodeURI(u):u:h?Bo(u,e):u}let i=!1;const c={},a=z(n.map(l=>{if(l.type===U)return l.value;if(l.type===at){c._splat=o._splat,c["*"]=o._splat;const u=l.prefixSegment||"",h=l.suffixSegment||"";if(!o._splat)return i=!0,u||h?`${u}${h}`:void 0;const f=r("_splat");return`${u}${f}${h}`}if(l.type===ot){const u=l.value.substring(1);!i&&!(u in o)&&(i=!0),c[u]=o[u];const h=l.prefixSegment||"",f=l.suffixSegment||"";return`${h}${r(u)??"undefined"}${f}`}if(l.type===ct){const u=l.value.substring(1),h=l.prefixSegment||"",f=l.suffixSegment||"";return!(u in o)||o[u]==null?h||f?`${h}${f}`:void 0:(c[u]=o[u],`${h}${r(u)??""}${f}`)}return l.value}));return{usedParams:c,interpolatedPath:a,isMissingParams:i}}function Bo(t,o){let e=encodeURIComponent(t);if(o)for(const[s,n]of o)e=e.replaceAll(s,n);return e}function Zt(t,o,e){const s=Do(t,o,e);if(!(o.to&&!s))return s??{}}function Do(t,{to:o,fuzzy:e,caseSensitive:s},n){const r=o,i=ut(t.startsWith("/")?t:`/${t}`,n),c=ut(r.startsWith("/")?r:`/${r}`,n),a={};return $o(i,c,a,e,s)?a:void 0}function $o(t,o,e,s,n){let r=0,i=0;for(;rm.value)));h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),u=p}else u=decodeURI(z(l.map(h=>h.value)));return e["*"]=u,e._splat=u,!0}if(a.type===U){if(a.value==="/"&&!c?.value){i++;continue}if(c){if(n){if(a.value!==c.value)return!1}else if(a.value.toLowerCase()!==c.value.toLowerCase())return!1;r++,i++;continue}else return!1}if(a.type===ot){if(!c||c.value==="/")return!1;let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if(h&&!d.startsWith(h)||f&&!d.endsWith(f))return!1;let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}else l=decodeURIComponent(c.value),u=!0;u&&(e[a.value.substring(1)]=l,r++),i++;continue}if(a.type===ct){if(!c){i++;continue}if(c.value==="/"){i++;continue}let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if((!h||d.startsWith(h))&&(!f||d.endsWith(f))){let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}}else{let h=!0;for(let f=i+1;f=o.length)return e["**"]=z(t.slice(r).map(l=>l.value)),!!s&&o[o.length-1]?.value!=="/";if(i=t.length){for(let l=i;l{if(s.isRoot||!s.path)return;const r=ne(s.fullPath);let i=ut(r),c=0;for(;i.length>c+1&&i[c]?.value==="/";)c++;c>0&&(i=i.slice(c));let a=0,l=!1;const u=i.map((h,f)=>{if(h.value==="/")return jo;if(h.type===U)return No;let d;h.type===ot?d=Uo:h.type===ct?(d=Vo,a++):d=Wo;for(let p=f+1;p{const r=Math.min(s.scores.length,n.scores.length);for(let i=0;in.parsed[i].value?1:-1;return s.index-n.index}).map((s,n)=>(s.child.rank=n,s.child))}function Jo({routeTree:t,initRoute:o}){const e={},s={},n=i=>{i.forEach((c,a)=>{o?.(c,a);const l=e[c.id];if(K(!l,`Duplicate routes found with id: ${String(c.id)}`),e[c.id]=c,!c.isRoot&&c.path){const h=J(c.fullPath);(!s[h]||c.fullPath.endsWith("/"))&&(s[h]=c)}const u=c.children;u?.length&&n(u)})};n([t]);const r=qo(Object.values(e));return{routesById:e,routesByPath:s,flatRoutes:r}}function j(t){return!!t?.isNotFound}function Yo(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const kt="tsr-scroll-restoration-v1_3",Xo=(t,o)=>{let e;return(...s)=>{e||(e=setTimeout(()=>{t(...s),e=null},o))}};function Zo(){const t=Yo();if(!t)return null;const o=t.getItem(kt);let e=o?JSON.parse(o):{};return{state:e,set:s=>(e=Q(s,e)||e,t.setItem(kt,JSON.stringify(e)))}}const wt=Zo(),Qt=t=>t.state.__TSR_key||t.href;function Qo(t){const o=[];let e;for(;e=t.parentNode;)o.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${o.reverse().join(" > ")}`.toLowerCase()}let Ot=!1;function We({storageKey:t,key:o,behavior:e,shouldScrollRestoration:s,scrollToTopSelectors:n,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(l){console.error(l);return}const c=o||window.history.state?.__TSR_key,a=i[c];Ot=!0;t:{if(s&&a&&Object.keys(a).length>0){for(const h in a){const f=a[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:e});else if(h){const d=document.querySelector(h);d&&(d.scrollLeft=f.scrollX,d.scrollTop=f.scrollY)}}break t}const l=(r??window.location).hash.split("#",2)[1];if(l){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(l);f&&f.scrollIntoView(h)}break t}const u={top:0,left:0,behavior:e};if(window.scrollTo(u),n)for(const h of n){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Ot=!1}function ts(t,o){if(!wt&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!wt))return;t.isScrollRestorationSetup=!0,Ot=!1;const s=t.options.getScrollRestorationKey||Qt;window.history.scrollRestoration="manual";const n=r=>{if(Ot||!t.isScrollRestoring)return;let i="";if(r.target===document||r.target===window)i="window";else{const a=r.target.getAttribute("data-scroll-restoration-id");a?i=`[data-scroll-restoration-id="${a}"]`:i=Qo(r.target)}const c=s(t.state.location);wt.set(a=>{const l=a[c]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const h=document.querySelector(i);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",Xo(n,100),!0),t.subscribe("onRendered",r=>{const i=s(r.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(We({storageKey:kt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&wt.set(c=>(c[i]||={},c)))})}function es(t){if(typeof document<"u"&&document.querySelector){const o=t.state.location.state.__hashScrollIntoViewOptions??!0;if(o&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(o)}}}function os(t,o=String){const e=new URLSearchParams;for(const s in t){const n=t[s];n!==void 0&&e.set(s,o(n))}return e.toString()}function Vt(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function ss(t){const o=new URLSearchParams(t),e={};for(const[s,n]of o.entries()){const r=e[s];r==null?e[s]=Vt(n):Array.isArray(r)?r.push(Vt(n)):e[s]=[r,Vt(n)]}return e}const ns=is(JSON.parse),rs=as(JSON.stringify,JSON.parse);function is(t){return o=>{o[0]==="?"&&(o=o.substring(1));const e=ss(o);for(const s in e){const n=e[s];if(typeof n=="string")try{e[s]=t(n)}catch{}}return e}}function as(t,o){const e=typeof o=="function";function s(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return o(n),t(n)}catch{}return n}return n=>{const r=os(n,s);return r?`?${r}`:""}}const A="__root__";function cs(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}function N(t){return t instanceof Response&&!!t.options}function us(t){const o=new Map;let e,s;const n=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,s&&(s.next=r,r.prev=s)):(r.next.prev=void 0,e=r.next,r.next=void 0,s&&(r.prev=s,s.next=r)),s=r)};return{get(r){const i=o.get(r);if(i)return n(i),i.value},set(r,i){if(o.size>=t&&e){const a=e;o.delete(a.key),a.next&&(e=a.next,a.next.prev=void 0),a===s&&(s=void 0)}const c=o.get(r);if(c)c.value=i,n(c);else{const a={key:r,value:i,prev:s};s&&(s.next=a),s=a,e||(e=a),o.set(r,a)}}}}const Mt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},At=(t,o)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===o)),ze=(t,o)=>{const e=t.router.routesById[o.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),K(e.options.notFoundComponent);const s=t.matches.find(n=>n.routeId===e.id);K(s,"Could not find match for route: "+e.id),t.updateMatch(s.id,n=>({...n,status:"notFound",error:o,isFetching:!1})),o.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(o.routeId=e.parentRoute.id,ze(t,o))},H=(t,o,e)=>{if(!(!N(e)&&!j(e))){if(N(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(o){o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0;const s=N(e)?"redirected":"notFound";o._nonReactive.error=e,t.updateMatch(o.id,n=>({...n,status:s,isFetching:!1,error:e})),j(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()}throw N(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(ze(t,e),e)}},Ke=(t,o)=>{const e=t.router.getMatch(o);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},ht=(t,o,e,s)=>{const{id:n,routeId:r}=t.matches[o],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=s,t.firstBadMatchIndex??=o,H(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(c){e=c,H(t,t.router.getMatch(n),e)}t.updateMatch(n,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},ls=(t,o,e,s)=>{const n=t.router.getMatch(o),r=t.matches[e-1]?.id,i=r?t.router.getMatch(r):void 0;if(t.router.isShell()){n.ssr=s.id===A;return}if(i?.ssr===!1){n.ssr=!1;return}const c=d=>d===!0&&i?.ssr==="data-only"?"data-only":d,a=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){n.ssr=c(a);return}if(typeof s.options.ssr!="function"){n.ssr=c(s.options.ssr);return}const{search:l,params:u}=n,h={search:xt(l,n.searchError),params:xt(u,n.paramsError),location:t.location,matches:t.matches.map(d=>({index:d.index,pathname:d.pathname,fullPath:d.fullPath,staticData:d.staticData,id:d.id,routeId:d.routeId,search:xt(d.search,d.searchError),params:xt(d.params,d.paramsError),ssr:d.ssr}))},f=s.options.ssr(h);if(q(f))return f.then(d=>{n.ssr=c(d??a)});n.ssr=c(f??a)},He=(t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const n=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!At(t,o)&&(e.options.loader||e.options.beforeLoad||Je(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{Mt(t)},n);s._nonReactive.pendingTimeout=i}},hs=(t,o,e)=>{const s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;He(t,o,e,s);const n=()=>{const r=t.router.getMatch(o);r.preload&&(r.status==="redirected"||r.status==="notFound")&&H(t,r,r.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(n):n()},fs=(t,o,e,s)=>{const n=t.router.getMatch(o),r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=it(()=>{r?.resolve()});const{paramsError:i,searchError:c}=n;i&&ht(t,e,i,"PARSE_PARAMS"),c&&ht(t,e,c,"VALIDATE_SEARCH"),He(t,o,s,n);const a=new AbortController,l=t.matches[e-1]?.id,f={...(l?t.router.getMatch(l):void 0)?.context??t.router.options.context??void 0,...n.__routeContext};let d=!1;const p=()=>{d||(d=!0,t.updateMatch(o,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:a,context:f})))},m=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,S=>({...S,isFetching:!1}))};if(!s.options.beforeLoad){gt(()=>{p(),m()});return}n._nonReactive.beforeLoadPromise=it();const{search:y,params:_,cause:x}=n,P=At(t,o),L={search:y,abortController:a,params:_,preload:P,context:f,location:t.location,navigate:S=>t.router.navigate({...S,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:P?"preload":x,matches:t.matches,...t.router.options.additionalContext},E=S=>{if(S===void 0){gt(()=>{p(),m()});return}(N(S)||j(S))&&(p(),ht(t,e,S,"BEFORE_LOAD")),gt(()=>{p(),t.updateMatch(o,v=>({...v,__beforeLoadContext:S,context:{...v.context,...S}})),m()})};let w;try{if(w=s.options.beforeLoad(L),q(w))return p(),w.catch(S=>{ht(t,e,S,"BEFORE_LOAD")}).then(E)}catch(S){p(),ht(t,e,S,"BEFORE_LOAD")}E(w)},ds=(t,o)=>{const{id:e,routeId:s}=t.matches[o],n=t.router.looseRoutesById[s],r=()=>{if(t.router.isServer){const a=ls(t,e,o,n);if(q(a))return a.then(c)}return c()},i=()=>fs(t,e,o,n),c=()=>{if(Ke(t,e))return;const a=hs(t,e,n);return q(a)?a.then(i):i()};return r()},yt=(t,o,e)=>{const s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const n={matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([r,i,c])=>{const a=r?.meta,l=r?.links,u=r?.scripts,h=r?.styles;return{meta:a,links:l,headScripts:u,headers:c,scripts:i,styles:h}})},Ge=(t,o,e,s)=>{const n=t.matchPromises[e-1],{params:r,loaderDeps:i,abortController:c,cause:a}=t.router.getMatch(o);let l=t.router.options.context??{};for(let h=0;h<=e;h++){const f=t.matches[h];if(!f)continue;const d=t.router.getMatch(f.id);d&&(l={...l,...d.__routeContext??{},...d.__beforeLoadContext??{}})}const u=At(t,o);return{params:r,deps:i,preload:!!u,parentMatchPromise:n,abortController:c,context:l,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:u?"preload":a,route:s,...t.router.options.additionalContext}},be=async(t,o,e,s)=>{try{const n=t.router.getMatch(o);try{(!t.router.isServer||n.ssr===!0)&&qe(s);const r=s.options.loader?.(Ge(t,o,e,s)),i=s.options.loader&&q(r);if(!!(i||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(o,h=>({...h,isFetching:"loader"})),s.options.loader){const h=i?await r:r;H(t,t.router.getMatch(o),h),h!==void 0&&t.updateMatch(o,f=>({...f,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const a=yt(t,o,s),l=a?await a:void 0,u=n._nonReactive.minPendingPromise;u&&await u,s._componentsPromise&&await s._componentsPromise,t.updateMatch(o,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...l}))}catch(r){let i=r;const c=n._nonReactive.minPendingPromise;c&&await c,j(r)&&await s.options.notFoundComponent?.preload?.(),H(t,t.router.getMatch(o),r);try{s.options.onError?.(r)}catch(u){i=u,H(t,t.router.getMatch(o),u)}const a=yt(t,o,s),l=a?await a:void 0;t.updateMatch(o,u=>({...u,error:i,status:"error",isFetching:!1,...l}))}}catch(n){const r=t.router.getMatch(o);if(r){const i=yt(t,o,s);if(i){const c=await i;t.updateMatch(o,a=>({...a,...c}))}r._nonReactive.loaderPromise=void 0}H(t,r,n)}},ps=async(t,o)=>{const{id:e,routeId:s}=t.matches[o];let n=!1,r=!1;const i=t.router.looseRoutesById[s];if(Ke(t,e)){if(t.router.isServer){const l=yt(t,e,i);if(l){const u=await l;t.updateMatch(e,h=>({...h,...u}))}return t.router.getMatch(e)}}else{const l=t.router.getMatch(e);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!t.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const u=t.router.getMatch(e),h=u._nonReactive.error||u.error;h&&H(t,u,h)}else{const u=Date.now()-l.updatedAt,h=At(t,e),f=h?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,d=i.options.shouldReload,p=typeof d=="function"?d(Ge(t,e,o,i)):d,m=!!h&&!t.router.state.matches.some(P=>P.id===e),y=t.router.getMatch(e);y._nonReactive.loaderPromise=it(),m!==y.preload&&t.updateMatch(e,P=>({...P,preload:m}));const{status:_,invalid:x}=y;if(n=_==="success"&&(x||(p??u>f)),!(h&&i.options.preload===!1))if(n&&!t.sync)r=!0,(async()=>{try{await be(t,e,o,i);const P=t.router.getMatch(e);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){N(P)&&await t.router.navigate(P.options)}})();else if(_!=="success"||n&&t.sync)await be(t,e,o,i);else{const P=yt(t,e,i);if(P){const L=await P;t.updateMatch(e,E=>({...E,...L}))}}}}const c=t.router.getMatch(e);r||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,r||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const a=r?c.isFetching:!1;return a!==c.isFetching||c.invalid!==!1?(t.updateMatch(e,l=>({...l,isFetching:a,invalid:!1})),t.router.getMatch(e)):c};async function Ee(t){const o=Object.assign(t,{matchPromises:[]});!o.router.isServer&&o.router.state.matches.some(e=>e._forcePending)&&Mt(o);try{for(let n=0;n{const{id:e,...s}=o.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const o=()=>{const e=[];for(const s of Ye){const n=t.options[s]?.preload;n&&e.push(n())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(o):o()}return t._componentsPromise}function xt(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}function Je(t){for(const o of Ye)if(t.options[o]?.preload)return!0;return!1}const Ye=["component","errorComponent","pendingComponent","notFoundComponent"];function ms(t){return{input:({url:o})=>{for(const e of t)o=Xe(e,o);return o},output:({url:o})=>{for(let e=t.length-1;e>=0;e--)o=Ze(t[e],o);return o}}}function gs(t){const o=Ct(t.basepath),e=`/${o}`,s=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?s:s.toLowerCase();return{input:({url:i})=>{const c=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return c===n?i.pathname="/":c.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=z(["/",o,i.pathname]),i)}}function Xe(t,o){const e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function Ze(t,o){const e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function et(t){const o=t.resolvedLocation,e=t.location,s=o?.pathname!==e.pathname,n=o?.href!==e.href,r=o?.hash!==e.hash;return{fromLocation:o,toLocation:e,pathChanged:s,hrefChanged:n,hashChanged:r}}class ys{constructor(o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,n=this.basepath??s?.basepath??"/",r=this.basepath===void 0,i=s?.rewrite;this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(f=>[encodeURIComponent(f),f])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Po())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new _o(Ss(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),ts(this));let c=!1;const a=this.options.basepath??"/",l=this.options.rewrite;if(r||n!==a||i!==l){this.basepath=a;const f=[];Ct(a)!==""&&f.push(gs({basepath:a})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:ms(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:e,routesByPath:s,flatRoutes:n}=Jo({routeTree:this.routeTree,initRoute:(i,c)=>{i.init({originalIndex:c})}});this.routesById=e,this.routesByPath=s,this.flatRoutes=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,s)=>{const n={eventType:e,fn:s};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{const n=({href:a,state:l})=>{const u=new URL(a,this.origin),h=Xe(this.rewrite,u),f=this.options.parseSearch(h.search),d=this.options.stringifySearch(f);h.search=d;const p=h.href.replace(h.origin,""),{pathname:m,hash:y}=h;return{href:p,publicHref:a,url:h.href,pathname:xe(m),searchStr:d,search:B(s?.search,f),hash:y.split("#").reverse()[0]??"",state:B(s?.state,l)}},r=n(e),{__tempLocation:i,__tempKey:c}=r.state;if(i&&(!c||c===this.tempLocationKey)){const a=n(i);return a.state.key=r.state.key,a.state.__TSR_key=r.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:r}}return r},this.resolvePathWithBase=(e,s)=>Eo({base:e,to:se(s),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,s,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},n):this.matchRoutesInternal(e,s),this.parsePathnameCache=us(1e3),this.getMatchedRoutes=(e,s)=>_s({pathname:e,routePathname:s,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{const s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),s=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...s]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const s=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutes(i,{_buildLocation:!0}),a=Xt(c);r.from;const l=r.unsafeRelative==="path"?i.pathname:r.from??a.fullPath,u=this.resolvePathWithBase(l,"."),h=a.search,f={...a.params},d=r.to?this.resolvePathWithBase(u,`${r.to}`):this.resolvePathWithBase(u,"."),p=r.params===!1||r.params===null?{}:(r.params??!0)===!0?f:Object.assign(f,Q(r.params,f)),m=Ut({path:d,params:p,parseCache:this.parsePathnameCache}).interpolatedPath,y=this.matchRoutes(m,void 0,{_buildLocation:!0}).map(M=>this.looseRoutesById[M.routeId]);if(Object.keys(p).length>0)for(const M of y){const T=M.options.params?.stringify??M.options.stringifyParams;T&&Object.assign(p,T(p))}const _=e.leaveParams?d:xe(Ut({path:d,params:p,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let x=h;if(e._includeValidateSearch&&this.options.search?.strict){const M={};y.forEach(T=>{if(T.options.validateSearch)try{Object.assign(M,te(T.options.validateSearch,{...M,...x}))}catch{}}),x=M}x=Rs({search:x,dest:r,destRoutes:y,_includeValidateSearch:e._includeValidateSearch}),x=B(h,x);const P=this.options.stringifySearch(x),L=r.hash===!0?i.hash:r.hash?Q(r.hash,i.hash):void 0,E=L?`#${L}`:"";let w=r.state===!0?i.state:r.state?Q(r.state,i.state):{};w=B(i.state,w);const S=`${_}${P}${E}`,v=new URL(S,this.origin),C=Ze(this.rewrite,v);return{publicHref:C.pathname+C.search+C.hash,href:S,url:C.href,pathname:_,search:x,searchStr:P,state:w,hash:L??"",unmaskOnReload:r.unmaskOnReload}},n=(r={},i)=>{const c=s(r);let a=i?s(i):void 0;if(!a){let l={};const u=this.options.routeMasks?.find(h=>{const f=Zt(c.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return f?(l=f,!0):!1});if(u){const{from:h,...f}=u;i={from:e.from,...f,params:l},a=s(i)}}return a&&(c.maskedLocation=a),c};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:s,...n})=>{const r=()=>{const a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(u=>{n.state[u]=this.latestLocation.state[u]});const l=tt(n.state,this.latestLocation.state);return a.forEach(u=>{delete n.state[u]}),l},i=J(this.latestLocation.href)===J(n.href),c=this.commitLocationPromise;if(this.commitLocationPromise=it(()=>{c?.resolve()}),i&&r())this.load();else{let{maskedLocation:a,hashScrollIntoView:l,...u}=n;a&&(u={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:s})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:c,...a}={})=>{if(c){const h=this.history.location.state.__TSR_index,f=Et(c,{__TSR_index:e?h:h+1});a.to=f.pathname,a.search=this.options.parseSearch(f.search),a.hash=f.hash.slice(1)}const l=this.buildLocation({...a,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:r,replace:e,resetScroll:s,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=({to:e,reloadDocument:s,href:n,...r})=>{if(!s&&n)try{new URL(`${n}`),s=!0}catch{}return s?(n||(n=this.buildLocation({to:e,...r}).url),r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()):this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),n=r=>{try{return encodeURI(decodeURI(r))}catch{return r}};if(Ct(n(this.latestLocation.href))!==Ct(n(s.href))){let r=s.url;throw this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),cs({href:r})}}const e=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:s.cachedMatches.filter(n=>!e.some(r=>r.id===n.id))}))},this.load=async e=>{let s,n,r;for(r=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const a=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...et({resolvedLocation:l,location:a})}),this.emit({type:"onBeforeLoad",...et({resolvedLocation:l,location:a})}),await Ee({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:a,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[];gt(()=>{this.__store.setState(d=>{const p=d.matches,m=d.pendingMatches||d.matches;return u=p.filter(y=>!m.some(_=>_.id===y.id)),h=m.filter(y=>!p.some(_=>_.id===y.id)),f=m.filter(y=>p.some(_=>_.id===y.id)),{...d,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...d.cachedMatches,...u.filter(y=>y.status!=="error")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[h,"onEnter"],[f,"onStay"]].forEach(([d,p])=>{d.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(a){N(a)?(s=a,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):j(a)&&(n=a),this.__store.setState(l=>({...l,statusCode:s?s.status:n?404:l.matches.some(u=>u.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(c=>c.status==="error")&&(i=500),i!==void 0&&this.__store.setState(c=>({...c,statusCode:i}))},this.startViewTransition=e=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.state.resolvedLocation,c=typeof s.types=="function"?s.types(et({resolvedLocation:i,location:r})):s.types;if(c===!1){e();return}n={update:e,types:c}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{const n=this.state.pendingMatches?.some(r=>r.id===e)?"pendingMatches":this.state.matches.some(r=>r.id===e)?"matches":this.state.cachedMatches.some(r=>r.id===e)?"cachedMatches":"";n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(i=>i.id===e?s(i):i)}))})},this.getMatch=e=>{const s=n=>n.id===e;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=e=>{const s=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"?{status:"pending",error:void 0}:void 0}:n;return this.__store.setState(n=>({...n,matches:n.matches.map(s),cachedMatches:n.cachedMatches.map(s),pendingMatches:n.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){const s=this.buildLocation(e.options);let n=s.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,"")||"/"),e.options.href=s.href,e.headers.set("Location",n)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const s=e?.filter;s!==void 0?this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>!s(r))})):this.__store.setState(n=>({...n,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=s=>{const n=this.looseRoutesById[s.routeId];if(!n.options.loader)return!0;const r=(s.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:e})},this.loadRouteChunk=qe,this.preloadRoute=async e=>{const s=this.buildLocation(e);let n=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),i=new Set([...r,...this.state.cachedMatches.map(c=>c.id)]);gt(()=>{n.forEach(c=>{i.has(c.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,c]}))})});try{return n=await Ee({router:this,matches:n,location:s,preload:!0,updateMatch:(c,a)=>{r.has(c)?n=n.map(l=>l.id===c?a(l):l):this.updateMatch(c,a)}}),n}catch(c){if(N(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:s});j(c)||console.error(c);return}},this.matchRoute=(e,s)=>{const n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Zt(c.pathname,{...s,to:r.pathname},this.parsePathnameCache);return!a||e.params&&!tt(a,e.params,{partial:!0})?!1:a&&(s?.includeSearch??!0)?tt(c.search,r.search,{partial:!0})?a:!1:a},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...o,caseSensitive:o.caseSensitive??!1,notFoundMode:o.notFoundMode??"fuzzy",stringifySearch:o.stringifySearch??rs,parseSearch:o.parseSearch??ns}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(o,e){const{foundRoute:s,matchedRoutes:n,routeParams:r}=this.getMatchedRoutes(o.pathname,e?.dest?.to);let i=!1;(s?s.path!=="/"&&r["**"]:J(o.pathname))&&(this.options.notFoundRoute?n.push(this.options.notFoundRoute):i=!0);const c=(()=>{if(i){if(this.options.notFoundMode!=="root")for(let u=n.length-1;u>=0;u--){const h=n[u];if(h.children)return h.id}return A}})(),a=[],l=u=>u?.id?u.context??this.options.context??void 0:this.options.context??void 0;return n.forEach((u,h)=>{const f=a[h-1],[d,p,m]=(()=>{const I=f?.search??o.search,Y=f?._strictSearch??void 0;try{const D=te(u.options.validateSearch,{...I})??void 0;return[{...I,...D},{...Y,...D},void 0]}catch(D){let X=D;if(D instanceof Ft||(X=new Ft(D.message,{cause:D})),e?.throwOnError)throw X;return[I,{},X]}})(),y=u.options.loaderDeps?.({search:d})??"",_=y?JSON.stringify(y):"",{interpolatedPath:x,usedParams:P}=Ut({path:u.fullPath,params:r,decodeCharMap:this.pathParamsDecodeCharMap}),L=u.id+x+_,E=this.getMatch(L),w=this.state.matches.find(I=>I.routeId===u.id),S=E?._strictParams??P;let v;if(!E){const I=u.options.params?.parse??u.options.parseParams;if(I)try{Object.assign(S,I(S))}catch(Y){if(v=new vs(Y.message,{cause:Y}),e?.throwOnError)throw v}}Object.assign(r,S);const C=w?"stay":"enter";let M;if(E)M={...E,cause:C,params:w?B(w.params,r):r,_strictParams:S,search:B(w?w.search:E.search,d),_strictSearch:p};else{const I=u.options.loader||u.options.beforeLoad||u.lazyFn||Je(u)?"pending":"success";M={id:L,index:h,routeId:u.id,params:w?B(w.params,r):r,_strictParams:S,pathname:x,updatedAt:Date.now(),search:w?B(w.search,d):d,_strictSearch:p,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:v,__routeContext:void 0,_nonReactive:{loadPromise:it()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:w?B(w.loaderDeps,y):y,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}e?.preload||(M.globalNotFound=c===u.id),M.searchError=m;const T=l(f);M.context={...T,...M.__routeContext,...M.__beforeLoadContext},a.push(M)}),a.forEach((u,h)=>{const f=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)&&e?._buildLocation!==!0){const p=a[h-1],m=l(p);if(f.options.context){const y={deps:u.loaderDeps,params:u.params,context:m??{},location:o,navigate:_=>this.navigate({..._,_fromLocation:o}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:a};u.__routeContext=f.options.context(y)??void 0}u.context={...m,...u.__routeContext,...u.__beforeLoadContext}}}),a}}class Ft extends Error{}class vs extends Error{}function Ss(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function te(t,o){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(o);if(e instanceof Promise)throw new Ft("Async validation not supported");if(e.issues)throw new Ft(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}function _s({pathname:t,routePathname:o,caseSensitive:e,routesByPath:s,routesById:n,flatRoutes:r,parseCache:i}){let c={};const a=J(t),l=d=>Zt(a,{to:d.fullPath,caseSensitive:d.options?.caseSensitive??e,fuzzy:!0},i);let u=o!==void 0?s[o]:void 0;if(u)c=l(u);else{let d;for(const p of r){const m=l(p);if(m)if(p.path!=="/"&&m["**"])d||(d={foundRoute:p,routeParams:m});else{u=p,c=m;break}}!u&&d&&(u=d.foundRoute,c=d.routeParams)}let h=u||n[A];const f=[h];for(;h.parentRoute;)h=h.parentRoute,f.push(h);return f.reverse(),{matchedRoutes:f,routeParams:c,foundRoute:u}}function Rs({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){const n=e.reduce((c,a)=>{const l=[];if("search"in a.options)a.options.search?.middlewares&&l.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){const u=({search:h,next:f})=>{let d=h;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(d=a.options.preSearchFilters.reduce((m,y)=>y(m),h));const p=f(d);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((m,y)=>y(m),p):p};l.push(u)}if(s&&a.options.validateSearch){const u=({search:h,next:f})=>{const d=f(h);try{return{...d,...te(a.options.validateSearch,d)??void 0}}catch{return d}};l.push(u)}return c.concat(l)},[])??[],r=({search:c})=>o.search?o.search===!0?c:Q(o.search,c):{};n.push(r);const i=(c,a)=>{if(c>=n.length)return a;const l=n[c];return l({search:a,next:h=>i(c+1,h)})};return i(0,t)}const Ps="Error preloading route! ☝️";class Qe{constructor(o){if(this.init=e=>{this.originalIndex=e.originalIndex;const s=this.options,n=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=A:this.parentRoute||K(!1);let r=n?A:s?.path;r&&r!=="/"&&(r=ne(r));const i=s?.id||r;let c=n?A:z([this.parentRoute.id===A?"":this.parentRoute.id,i]);r===A&&(r="/"),c!==A&&(c=z(["/",c]));const a=c===A?"/":z([this.parentRoute.fullPath,r]);this._path=r,this._id=c,this._fullPath=a,this._to=a},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=o||{},this.isRoot=!o?.getParentRoute,o?.id&&o?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class ws extends Qe{constructor(o){super(o)}}function re(t){const o=t.errorComponent??Bt;return g.jsx(xs,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:s})=>e?R.createElement(o,{error:e,reset:s}):t.children})}class xs extends R.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(o){return{resetKey:o.getResetKey()}}static getDerivedStateFromError(o){return{error:o}}reset(){this.setState({error:null})}componentDidUpdate(o,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(o,e){this.props.onCatch&&this.props.onCatch(o,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Bt({error:t}){const[o,e]=R.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(s=>!s),children:o?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),o?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?g.jsx("code",{children:t.message}):null})}):null]})}function Ls({children:t,fallback:o=null}){return Cs()?g.jsx(rt.Fragment,{children:t}):g.jsx(rt.Fragment,{children:o})}function Cs(){return rt.useSyncExternalStore(Ms,()=>!0,()=>!1)}function Ms(){return()=>{}}var Wt={exports:{}},zt={},Kt={exports:{}},Ht={};var Te;function bs(){if(Te)return Ht;Te=1;var t=ee();function o(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var e=typeof Object.is=="function"?Object.is:o,s=t.useState,n=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function c(h,f){var d=f(),p=s({inst:{value:d,getSnapshot:f}}),m=p[0].inst,y=p[1];return r(function(){m.value=d,m.getSnapshot=f,a(m)&&y({inst:m})},[h,d,f]),n(function(){return a(m)&&y({inst:m}),h(function(){a(m)&&y({inst:m})})},[h]),i(d),d}function a(h){var f=h.getSnapshot;h=h.value;try{var d=f();return!e(h,d)}catch{return!0}}function l(h,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Ht.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Ht}var Ie;function Es(){return Ie||(Ie=1,Kt.exports=bs()),Kt.exports}var ke;function Ts(){if(ke)return zt;ke=1;var t=ee(),o=Es();function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var s=typeof Object.is=="function"?Object.is:e,n=o.useSyncExternalStore,r=t.useRef,i=t.useEffect,c=t.useMemo,a=t.useDebugValue;return zt.useSyncExternalStoreWithSelector=function(l,u,h,f,d){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=c(function(){function _(w){if(!x){if(x=!0,P=w,w=f(w),d!==void 0&&m.hasValue){var S=m.value;if(d(S,w))return L=S}return L=w}if(S=L,s(P,w))return S;var v=f(w);return d!==void 0&&d(S,v)?(P=w,S):(P=w,L=v)}var x=!1,P,L,E=h===void 0?null:h;return[function(){return _(u())},E===null?void 0:function(){return _(E())}]},[u,h,f,d]);var y=n(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},zt}var Oe;function Is(){return Oe||(Oe=1,Wt.exports=Ts()),Wt.exports}var ks=Is();function Os(t,o=s=>s,e={}){const s=e.equal??Fs;return ks.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,o,s)}function Fs(t,o){if(Object.is(t,o))return!0;if(typeof t!="object"||t===null||typeof o!="object"||o===null)return!1;if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(const[s,n]of t)if(!o.has(s)||!Object.is(n,o.get(s)))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(const s of t)if(!o.has(s))return!1;return!0}if(t instanceof Date&&o instanceof Date)return t.getTime()===o.getTime();const e=Fe(t);if(e.length!==Fe(o).length)return!1;for(let s=0;s"u"?Gt:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Gt,Gt)}function F(t){const o=R.useContext(to());return t?.warn,o}function O(t){const o=F({warn:t?.router===void 0}),e=t?.router||o,s=R.useRef(void 0);return Os(e.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const r=B(s.current,t.select(n));return s.current=r,r}return t.select(n)}return n})}const Dt=R.createContext(void 0),As=R.createContext(void 0);function V(t){const o=R.useContext(t.from?As:Dt);return O({select:s=>{const n=s.matches.find(r=>t.from?t.from===r.routeId:r.id===o);if(K(!((t.shouldThrow??!0)&&!n),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),n!==void 0)return t.select?t.select(n):n},structuralSharing:t.structuralSharing})}function ie(t){return V({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.loaderData):o.loaderData})}function ae(t){const{select:o,...e}=t;return V({...e,select:s=>o?o(s.loaderDeps):s.loaderDeps})}function ce(t){return V({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:o=>{const e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e}})}function ue(t){return V({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.search):o.search})}function le(t){const o=F();return R.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}var eo=po();const fn=Ne(eo),Lt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function qt(t){const o=R.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}function Bs(t,o,e={},s={}){R.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([r])=>{o(r)},e);return n.observe(t.current),()=>{n.disconnect()}},[o,e,s.disabled,t])}function Ds(t){const o=R.useRef(null);return R.useImperativeHandle(t,()=>o.current,[]),o}function $s(t,o){const e=F(),[s,n]=R.useState(!1),r=R.useRef(!1),i=Ds(o),{activeProps:c,inactiveProps:a,activeOptions:l,to:u,preload:h,preloadDelay:f,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:y,viewTransition:_,children:x,target:P,disabled:L,style:E,className:w,onClick:S,onFocus:v,onMouseEnter:C,onMouseLeave:M,onTouchStart:T,ignoreBlocker:I,params:Y,search:D,hash:X,state:he,mask:ro,reloadDocument:rn,unsafeRelative:an,from:cn,_fromLocation:un,...fe}=t,io=O({select:b=>b.location.search,structuralSharing:!0}),de=t.from,lt=R.useMemo(()=>({...t,from:de}),[e,io,de,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),W=R.useMemo(()=>e.buildLocation({...lt}),[e,lt]),vt=R.useMemo(()=>{if(L)return;let b=W.maskedLocation?W.maskedLocation.url:W.url,k=!1;return e.origin&&(b.startsWith(e.origin)?b=e.history.createHref(b.replace(e.origin,""))||"/":k=!0),{href:b,external:k}},[L,W.maskedLocation,W.url,e.origin,e.history]),St=R.useMemo(()=>{if(vt?.external)return vt.href;try{return new URL(u),u}catch{}},[u,vt]),st=t.reloadDocument||St?!1:h??e.options.defaultPreload,$t=f??e.options.defaultPreloadDelay??0,jt=O({select:b=>{if(St)return!1;if(l?.exact){if(!Mo(b.location.pathname,W.pathname,e.basepath))return!1}else{const k=It(b.location.pathname,e.basepath),$=It(W.pathname,e.basepath);if(!(k.startsWith($)&&(k.length===$.length||k[$.length]==="/")))return!1}return(l?.includeSearch??!0)&&!tt(b.location.search,W.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?b.location.hash===W.hash:!0}}),Z=R.useCallback(()=>{e.preloadRoute({...lt}).catch(b=>{console.warn(b),console.warn(Ps)})},[e,lt]),ao=R.useCallback(b=>{b?.isIntersecting&&Z()},[Z]);Bs(i,ao,Ws,{disabled:!!L||st!=="viewport"}),R.useEffect(()=>{r.current||!L&&st==="render"&&(Z(),r.current=!0)},[L,Z,st]);const co=b=>{const k=b.currentTarget.getAttribute("target"),$=P!==void 0?P:k;if(!L&&!zs(b)&&!b.defaultPrevented&&(!$||$==="_self")&&b.button===0){b.preventDefault(),eo.flushSync(()=>{n(!0)});const ye=e.subscribe("onResolved",()=>{ye(),n(!1)});e.navigate({...lt,replace:p,resetScroll:y,hashScrollIntoView:d,startTransition:m,viewTransition:_,ignoreBlocker:I})}};if(St)return{...fe,ref:i,href:St,...x&&{children:x},...P&&{target:P},...L&&{disabled:L},...E&&{style:E},...w&&{className:w},...S&&{onClick:S},...v&&{onFocus:v},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...T&&{onTouchStart:T}};const pe=b=>{L||st&&Z()},uo=pe,lo=b=>{if(!(L||!st))if(!$t)Z();else{const k=b.target;if(ft.has(k))return;const $=setTimeout(()=>{ft.delete(k),Z()},$t);ft.set(k,$)}},ho=b=>{if(L||!st||!$t)return;const k=b.target,$=ft.get(k);$&&(clearTimeout($),ft.delete(k))},_t=jt?Q(c,{})??js:Jt,Rt=jt?Jt:Q(a,{})??Jt,me=[w,_t.className,Rt.className].filter(Boolean).join(" "),ge=(E||_t.style||Rt.style)&&{...E,..._t.style,...Rt.style};return{...fe,..._t,...Rt,href:vt?.href,ref:i,onClick:dt([S,co]),onFocus:dt([v,pe]),onMouseEnter:dt([C,lo]),onMouseLeave:dt([M,ho]),onTouchStart:dt([T,uo]),disabled:!!L,target:P,...ge&&{style:ge},...me&&{className:me},...L&&Ns,...jt&&Us,...s&&Vs}}const Jt={},js={className:"active"},Ns={role:"link","aria-disabled":!0},Us={"data-status":"active","aria-current":"page"},Vs={"data-transitioning":"transitioning"},ft=new WeakMap,Ws={rootMargin:"100px"},dt=t=>o=>{for(const e of t)if(e){if(o.defaultPrevented)return;e(o)}},oo=R.forwardRef((t,o)=>{const{_asChild:e,...s}=t,{type:n,ref:r,...i}=$s(s,o),c=typeof s.children=="function"?s.children({isActive:i["data-status"]==="active"}):s.children;return e===void 0&&delete i.disabled,R.createElement(e||"a",{...i,ref:r},c)});function zs(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class Ks extends Qe{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ae({...e,from:this.id}),this.useLoaderData=e=>ie({...e,from:this.id}),this.useNavigate=()=>le({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(oo,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Hs(t){return new Ks(t)}class Gs extends ws{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ae({...e,from:this.id}),this.useLoaderData=e=>ie({...e,from:this.id}),this.useNavigate=()=>le({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(oo,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function dn(t){return new Gs(t)}function Ae(t){return typeof t=="object"?new Be(t,{silent:!0}).createRoute(t):new Be(t,{silent:!0}).createRoute}class Be{constructor(o,e){this.path=o,this.createRoute=s=>{this.silent;const n=Hs(s);return n.isRoot=!1,n},this.silent=e?.silent}}class De{constructor(o){this.useMatch=e=>V({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({from:this.options.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ae({...e,from:this.options.id}),this.useLoaderData=e=>ie({...e,from:this.options.id}),this.useNavigate=()=>{const e=F();return le({from:e.routesById[this.options.id].fullPath})},this.options=o,this.$$typeof=Symbol.for("react.memo")}}function $e(t){return typeof t=="object"?new De(t):o=>new De({id:t,...o})}function qs(){const t=F(),o=R.useRef({router:t,mounted:!1}),[e,s]=R.useState(!1),{hasPendingMatches:n,isLoading:r}=O({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=qt(r),c=r||e||n,a=qt(c),l=r||n,u=qt(l);return t.startTransition=h=>{s(!0),R.startTransition(()=>{h(),s(!1)})},R.useEffect(()=>{const h=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return J(t.latestLocation.href)!==J(f.href)&&t.commitLocation({...f,replace:!0}),()=>{h()}},[t,t.history]),Lt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(f){console.error(f)}})()},[t]),Lt(()=>{i&&!r&&t.emit({type:"onLoad",...et(t.state)})},[i,t,r]),Lt(()=>{u&&!l&&t.emit({type:"onBeforeRouteMount",...et(t.state)})},[l,u,t]),Lt(()=>{a&&!c&&(t.emit({type:"onResolved",...et(t.state)}),t.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),es(t))},[c,a,t]),null}function Js(t){const o=O({select:e=>`not-found-${e.location.pathname}-${e.status}`});return g.jsx(re,{getResetKey:()=>o,onCatch:(e,s)=>{if(j(e))t.onCatch?.(e,s);else throw e},errorComponent:({error:e})=>{if(j(e))return t.fallback?.(e);throw e},children:t.children})}function Ys(){return g.jsx("p",{children:"Not Found"})}function nt(t){return g.jsx(g.Fragment,{children:t.children})}function so(t,o,e){return o.options.notFoundComponent?g.jsx(o.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?g.jsx(t.options.defaultNotFoundComponent,{data:e}):g.jsx(Ys,{})}function Xs({children:t}){const o=F();return o.isServer?g.jsx("script",{nonce:o.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(` +`)+";$_TSR.c()"}}):null}function Zs(){const t=F();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const e=(t.options.getScrollRestorationKey||Qt)(t.latestLocation),s=e!==Qt(t.latestLocation)?e:void 0,n={storageKey:kt,shouldScrollRestoration:!0};return s&&(n.key=s),g.jsx(Xs,{children:`(${We.toString()})(${JSON.stringify(n)})`})}const no=R.memo(function({matchId:o}){const e=F(),s=O({select:_=>{const x=_.matches.find(P=>P.id===o);return K(x),{routeId:x.routeId,ssr:x.ssr,_displayPending:x._displayPending}},structuralSharing:!0}),n=e.routesById[s.routeId],r=n.options.pendingComponent??e.options.defaultPendingComponent,i=r?g.jsx(r,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=s.ssr===!1||s.ssr==="data-only",h=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||u))?R.Suspense:nt,f=c?re:nt,d=l?Js:nt,p=O({select:_=>_.loadedAt}),m=O({select:_=>{const x=_.matches.findIndex(P=>P.id===o);return _.matches[x-1]?.routeId}}),y=n.isRoot?n.options.shellComponent??nt:nt;return g.jsxs(y,{children:[g.jsx(Dt.Provider,{value:o,children:g.jsx(h,{fallback:i,children:g.jsx(f,{getResetKey:()=>p,errorComponent:c||Bt,onCatch:(_,x)=>{if(j(_))throw _;a?.(_,x)},children:g.jsx(d,{fallback:_=>{if(!l||_.routeId&&_.routeId!==s.routeId||!_.routeId&&!n.isRoot)throw _;return R.createElement(l,_)},children:u||s._displayPending?g.jsx(Ls,{fallback:i,children:g.jsx(je,{matchId:o})}):g.jsx(je,{matchId:o})})})})}),m===A&&e.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Qs,{}),g.jsx(Zs,{})]}):null]})});function Qs(){const t=F(),o=R.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...et(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const je=R.memo(function({matchId:o}){const e=F(),{match:s,key:n,routeId:r}=O({select:a=>{const l=a.matches.find(p=>p.id===o),u=l.routeId,f=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=e.routesById[r],c=R.useMemo(()=>{const a=i.options.component??e.options.defaultComponent;return a?g.jsx(a,{},n):g.jsx(tn,{})},[n,i.options.component,e.options.defaultComponent]);if(s._displayPending)throw e.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw e.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){const l=e.getMatch(s.id);if(l&&!l._nonReactive.minPendingPromise&&!e.isServer){const u=it();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return K(j(s.error)),so(e,i,s.error);if(s.status==="redirected")throw K(N(s.error)),e.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(e.isServer){const a=(i.options.errorComponent??e.options.defaultErrorComponent)||Bt;return g.jsx(a,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return c}),tn=R.memo(function(){const o=F(),e=R.useContext(Dt),s=O({select:l=>l.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[s],r=O({select:l=>{const h=l.matches.find(f=>f.id===e);return K(h),h.globalNotFound}}),i=O({select:l=>{const u=l.matches,h=u.findIndex(f=>f.id===e);return u[h+1]?.id}}),c=o.options.defaultPendingComponent?g.jsx(o.options.defaultPendingComponent,{}):null;if(r)return so(o,n,void 0);if(!i)return null;const a=g.jsx(no,{matchId:i});return s===A?g.jsx(R.Suspense,{fallback:c,children:a}):a});function en(){const t=F(),e=t.routesById[A].options.pendingComponent??t.options.defaultPendingComponent,s=e?g.jsx(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?nt:R.Suspense,r=g.jsxs(n,{fallback:s,children:[!t.isServer&&g.jsx(qs,{}),g.jsx(on,{})]});return t.options.InnerWrap?g.jsx(t.options.InnerWrap,{children:r}):r}function on(){const t=F(),o=O({select:n=>n.matches[0]?.id}),e=O({select:n=>n.loadedAt}),s=o?g.jsx(no,{matchId:o}):null;return g.jsx(Dt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:g.jsx(re,{getResetKey:()=>e,errorComponent:Bt,onCatch:n=>{n.message||n.toString()},children:s})})}function pn(){const t=F();return O({select:o=>[o.location.href,o.resolvedLocation?.href,o.status],structuralSharing:!0}),R.useCallback(o=>{const{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r,...i}=o;return t.matchRoute(i,{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r})},[t])}const mn=t=>new sn(t);class sn extends ys{constructor(o){super(o)}}typeof globalThis<"u"?(globalThis.createFileRoute=Ae,globalThis.createLazyFileRoute=$e):typeof window<"u"&&(window.createFileRoute=Ae,window.createLazyFileRoute=$e);function nn({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const s=to(),n=g.jsx(s.Provider,{value:t,children:o});return t.options.Wrap?g.jsx(t.options.Wrap,{children:n}):n}function gn({router:t,...o}){return g.jsx(nn,{router:t,...o,children:g.jsx(en,{})})}export{oo as L,tn as O,rt as R,hn as a,eo as b,fn as c,pn as d,dn as e,Hs as f,mn as g,cs as h,K as i,g as j,gn as k,R as r,le as u}; diff --git a/webui/dist/assets/ui-vendor-nTGLnMlb.js b/webui/dist/assets/ui-vendor-nTGLnMlb.js new file mode 100644 index 00000000..0fcce437 --- /dev/null +++ b/webui/dist/assets/ui-vendor-nTGLnMlb.js @@ -0,0 +1,45 @@ +import{r as a,j as x,R as we,a as Vt,b as at,c as yr}from"./router-BWgTyY51.js";function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function wr(e,t){const n=a.createContext(t),o=i=>{const{children:c,...s}=i,l=a.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:l,children:c})};o.displayName=e+"Provider";function r(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Ve(e,t=[]){let n=[];function o(i,c){const s=a.createContext(c),l=n.length;n=[...n,c];const u=p=>{const{scope:h,children:m,...w}=p,f=h?.[e]?.[l]||s,g=a.useMemo(()=>w,Object.values(w));return x.jsx(f.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(p,h){const m=h?.[e]?.[l]||s,w=a.useContext(m);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const r=()=>{const i=n.map(c=>a.createContext(c));return function(s){const l=s?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,xr(r,...t)]}function xr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const c=o.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _e(...e){return t=>{let n=!1;const o=e.map(r=>{const i=sn(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Cr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Sr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Rr(r),s=Er(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var br=Symbol("radix.slottable");function Cr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===br}function Er(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Rr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pr(e){const t=e+"CollectionProvider",[n,o]=Ve(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=f=>{const{scope:g,children:y}=f,v=we.useRef(null),S=we.useRef(new Map).current;return x.jsx(r,{scope:g,itemMap:S,collectionRef:v,children:y})};c.displayName=t;const s=e+"CollectionSlot",l=cn(s),u=we.forwardRef((f,g)=>{const{scope:y,children:v}=f,S=i(s,y),b=H(g,S.collectionRef);return x.jsx(l,{ref:b,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",p="data-radix-collection-item",h=cn(d),m=we.forwardRef((f,g)=>{const{scope:y,children:v,...S}=f,b=we.useRef(null),C=H(g,b),R=i(d,y);return we.useEffect(()=>(R.itemMap.set(b,{ref:b,...S}),()=>void R.itemMap.delete(b))),x.jsx(h,{[p]:"",ref:C,children:v})});m.displayName=d;function w(f){const g=i(e+"CollectionConsumer",f);return we.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const S=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((R,E)=>S.indexOf(R.ref.current)-S.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:c,Slot:u,ItemSlot:m},w,o]}var K=globalThis?.document?a.useLayoutEffect:()=>{},Ar=Vt[" useId ".trim().toString()]||(()=>{}),Or=0;function Te(e){const[t,n]=a.useState(Ar());return K(()=>{n(o=>o??String(Or++))},[e]),t?`radix-${t}`:""}function Tr(e){const t=Nr(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Dr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Nr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Mr(r),s=_r(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ir=Symbol("radix.slottable");function Dr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ir}function _r(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Mr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=Lr.reduce((e,t)=>{const n=Tr(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function kr(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var jr=Vt[" useInsertionEffect ".trim().toString()]||K;function et({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,c]=Fr({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:r;{const d=a.useRef(e!==void 0);a.useEffect(()=>{const p=d.current;p!==s&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,o])}const u=a.useCallback(d=>{if(s){const p=Wr(d)?d(e):d;p!==e&&c.current?.(p)}else i(d)},[s,e,i,c]);return[l,u]}function Fr({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),i=a.useRef(t);return jr(()=>{i.current=t},[t]),a.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function Wr(e){return typeof e=="function"}var $r=a.createContext(void 0);function Br(e){const t=a.useContext($r);return e||t||"ltr"}function Vr(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var He=e=>{const{present:t,children:n}=e,o=Hr(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),i=H(o.ref,Ur(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:i}):null};He.displayName="Presence";function Hr(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,l]=Vr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=ze(o.current);i.current=s==="mounted"?u:"none"},[s]),K(()=>{const u=o.current,d=r.current;if(d!==e){const h=i.current,m=ze(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),K(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const f=ze(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&f&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(i.current=ze(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function ze(e){return e?.animationName||"none"}function Ur(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function an(e,[t,n]){return Math.min(n,Math.max(t,e))}var zr=Symbol.for("react.lazy"),tt=Vt[" use ".trim().toString()];function Kr(e){return typeof e=="object"&&e!==null&&"then"in e}function Dn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zr&&"_payload"in e&&Kr(e._payload)}function _n(e){const t=Yr(e),n=a.forwardRef((o,r)=>{let{children:i,...c}=o;Dn(i)&&typeof tt=="function"&&(i=tt(i._payload));const s=a.Children.toArray(i),l=s.find(Gr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var wa=_n("Slot");function Yr(e){const t=a.forwardRef((n,o)=>{let{children:r,...i}=n;if(Dn(r)&&typeof tt=="function"&&(r=tt(r._payload)),a.isValidElement(r)){const c=Zr(r),s=qr(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xr=Symbol("radix.slottable");function Gr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xr}function qr(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Zr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mn(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ln(e){const[t,n]=a.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let c,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;c=u.inlineSize,s=u.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=Qr.reduce((e,t)=>{const n=_n(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ei="Label",kn=a.forwardRef((e,t)=>x.jsx(Jr.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kn.displayName=ei;var xa=kn;function ti(e,t=globalThis?.document){const n=xe(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ni="DismissableLayer",Dt="dismissableLayer.update",oi="dismissableLayer.pointerDownOutside",ri="dismissableLayer.focusOutside",ln,jn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...l}=e,u=a.useContext(jn),[d,p]=a.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=a.useState({}),w=H(t,E=>p(E)),f=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(g),v=d?f.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=y,C=si(E=>{const O=E.target,_=[...u.branches].some(I=>I.contains(O));!b||_||(r?.(E),c?.(E),E.defaultPrevented||s?.())},h),R=ci(E=>{const O=E.target;[...u.branches].some(I=>I.contains(O))||(i?.(E),c?.(E),E.defaultPrevented||s?.())},h);return ti(E=>{v===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},h),a.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ln=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),un(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ln)}},[d,h,n,u]),a.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),un())},[d,u]),a.useEffect(()=>{const E=()=>m({});return document.addEventListener(Dt,E),()=>document.removeEventListener(Dt,E)},[]),x.jsx(M.div,{...l,ref:w,style:{pointerEvents:S?b?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,R.onFocusCapture),onBlurCapture:k(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,C.onPointerDownCapture)})});lt.displayName=ni;var ii="DismissableLayerBranch",Fn=a.forwardRef((e,t)=>{const n=a.useContext(jn),o=a.useRef(null),r=H(t,o);return a.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(M.div,{...e,ref:r})});Fn.displayName=ii;function si(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let l=function(){Wn(oi,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function ci(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1);return a.useEffect(()=>{const r=i=>{i.target&&!o.current&&Wn(ri,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function un(){const e=new CustomEvent(Dt);document.dispatchEvent(e)}function Wn(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?kr(r,i):r.dispatchEvent(i)}var Sa=lt,ba=Fn,Ct="focusScope.autoFocusOnMount",Et="focusScope.autoFocusOnUnmount",fn={bubbles:!1,cancelable:!0},ai="FocusScope",Ht=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...c}=e,[s,l]=a.useState(null),u=xe(r),d=xe(i),p=a.useRef(null),h=H(t,f=>l(f)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let f=function(S){if(m.paused||!s)return;const b=S.target;s.contains(b)?p.current=b:ue(p.current,{select:!0})},g=function(S){if(m.paused||!s)return;const b=S.relatedTarget;b!==null&&(s.contains(b)||ue(p.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&ue(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",g),v.disconnect()}}},[o,s,m.paused]),a.useEffect(()=>{if(s){pn.add(m);const f=document.activeElement;if(!s.contains(f)){const y=new CustomEvent(Ct,fn);s.addEventListener(Ct,u),s.dispatchEvent(y),y.defaultPrevented||(li(mi($n(s)),{select:!0}),document.activeElement===f&&ue(s))}return()=>{s.removeEventListener(Ct,u),setTimeout(()=>{const y=new CustomEvent(Et,fn);s.addEventListener(Et,d),s.dispatchEvent(y),y.defaultPrevented||ue(f??document.body,{select:!0}),s.removeEventListener(Et,d),pn.remove(m)},0)}}},[s,u,d,m]);const w=a.useCallback(f=>{if(!n&&!o||m.paused)return;const g=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(g&&y){const v=f.currentTarget,[S,b]=ui(v);S&&b?!f.shiftKey&&y===b?(f.preventDefault(),n&&ue(S,{select:!0})):f.shiftKey&&y===S&&(f.preventDefault(),n&&ue(b,{select:!0})):y===v&&f.preventDefault()}},[n,o,m.paused]);return x.jsx(M.div,{tabIndex:-1,...c,ref:h,onKeyDown:w})});Ht.displayName=ai;function li(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ue(o,{select:t}),document.activeElement!==n)return}function ui(e){const t=$n(e),n=dn(t,e),o=dn(t.reverse(),e);return[n,o]}function $n(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dn(e,t){for(const n of e)if(!fi(n,{upTo:t}))return n}function fi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function di(e){return e instanceof HTMLInputElement&&"select"in e}function ue(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&di(e)&&t&&e.select()}}var pn=pi();function pi(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=mn(e,t),e.unshift(t)},remove(t){e=mn(e,t),e[0]?.resume()}}}function mn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function mi(e){return e.filter(t=>t.tagName!=="A")}var hi="Portal",Ut=a.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=a.useState(!1);K(()=>i(!0),[]);const c=n||r&&globalThis?.document?.body;return c?yr.createPortal(x.jsx(M.div,{...o,ref:t}),c):null});Ut.displayName=hi;var Rt=0;function Bn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),Rt++,()=>{Rt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rt--}},[])}function hn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ne=function(){return ne=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Di;var t=_i(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Li=zn(),Ne="data-scroll-locked",ki=function(e,t,n,o){var r=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(vi,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(s,"px ").concat(o,`; + } + body[`).concat(Ne,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` + padding-left: `.concat(r,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(c,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(o,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(Ze,` { + right: `).concat(s,"px ").concat(o,`; + } + + .`).concat(Qe,` { + margin-right: `).concat(s,"px ").concat(o,`; + } + + .`).concat(Ze," .").concat(Ze,` { + right: 0 `).concat(o,`; + } + + .`).concat(Qe," .").concat(Qe,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Ne,`] { + `).concat(yi,": ").concat(s,`px; + } +`)},vn=function(){var e=parseInt(document.body.getAttribute(Ne)||"0",10);return isFinite(e)?e:0},ji=function(){a.useEffect(function(){return document.body.setAttribute(Ne,(vn()+1).toString()),function(){var e=vn()-1;e<=0?document.body.removeAttribute(Ne):document.body.setAttribute(Ne,e.toString())}},[])},Fi=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;ji();var i=a.useMemo(function(){return Mi(r)},[r]);return a.createElement(Li,{styles:ki(i,!t,r,n?"":"!important")})},_t=!1;if(typeof window<"u")try{var Ke=Object.defineProperty({},"passive",{get:function(){return _t=!0,!0}});window.addEventListener("test",Ke,Ke),window.removeEventListener("test",Ke,Ke)}catch{_t=!1}var Pe=_t?{passive:!1}:!1,Wi=function(e){return e.tagName==="TEXTAREA"},Kn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wi(e)&&n[t]==="visible")},$i=function(e){return Kn(e,"overflowY")},Bi=function(e){return Kn(e,"overflowX")},yn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Yn(e,o);if(r){var i=Xn(e,o),c=i[1],s=i[2];if(c>s)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Vi=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Hi=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Yn=function(e,t){return e==="v"?$i(t):Bi(t)},Xn=function(e,t){return e==="v"?Vi(t):Hi(t)},Ui=function(e,t){return e==="h"&&t==="rtl"?-1:1},zi=function(e,t,n,o,r){var i=Ui(e,window.getComputedStyle(t).direction),c=i*o,s=n.target,l=t.contains(s),u=!1,d=c>0,p=0,h=0;do{if(!s)break;var m=Xn(e,s),w=m[0],f=m[1],g=m[2],y=f-g-i*w;(w||y)&&Yn(e,s)&&(p+=y,h+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&Math.abs(p)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Ye=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wn=function(e){return[e.deltaX,e.deltaY]},xn=function(e){return e&&"current"in e?e.current:e},Ki=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yi=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Xi=0,Ae=[];function Gi(e){var t=a.useRef([]),n=a.useRef([0,0]),o=a.useRef(),r=a.useState(Xi++)[0],i=a.useState(zn)[0],c=a.useRef(e);a.useEffect(function(){c.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var f=gi([e.lockRef.current],(e.shards||[]).map(xn),!0).filter(Boolean);return f.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),f.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=a.useCallback(function(f,g){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!c.current.allowPinchZoom;var y=Ye(f),v=n.current,S="deltaX"in f?f.deltaX:v[0]-y[0],b="deltaY"in f?f.deltaY:v[1]-y[1],C,R=f.target,E=Math.abs(S)>Math.abs(b)?"h":"v";if("touches"in f&&E==="h"&&R.type==="range")return!1;var O=yn(E,R);if(!O)return!0;if(O?C=E:(C=E==="v"?"h":"v",O=yn(E,R)),!O)return!1;if(!o.current&&"changedTouches"in f&&(S||b)&&(o.current=C),!C)return!0;var _=o.current||C;return zi(_,g,f,_==="h"?S:b)},[]),l=a.useCallback(function(f){var g=f;if(!(!Ae.length||Ae[Ae.length-1]!==i)){var y="deltaY"in g?wn(g):Ye(g),v=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&Ki(C.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var S=(c.current.shards||[]).map(xn).filter(Boolean).filter(function(C){return C.contains(g.target)}),b=S.length>0?s(g,S[0]):!c.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),u=a.useCallback(function(f,g,y,v){var S={name:f,delta:g,target:y,should:v,shadowParent:qi(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(b){return b!==S})},1)},[]),d=a.useCallback(function(f){n.current=Ye(f),o.current=void 0},[]),p=a.useCallback(function(f){u(f.type,wn(f),f.target,s(f,e.lockRef.current))},[]),h=a.useCallback(function(f){u(f.type,Ye(f),f.target,s(f,e.lockRef.current))},[]);a.useEffect(function(){return Ae.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Pe),document.addEventListener("touchmove",l,Pe),document.addEventListener("touchstart",d,Pe),function(){Ae=Ae.filter(function(f){return f!==i}),document.removeEventListener("wheel",l,Pe),document.removeEventListener("touchmove",l,Pe),document.removeEventListener("touchstart",d,Pe)}},[]);var m=e.removeScrollBar,w=e.inert;return a.createElement(a.Fragment,null,w?a.createElement(i,{styles:Yi(r)}):null,m?a.createElement(Fi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zi=Ri(Un,Gi);var zt=a.forwardRef(function(e,t){return a.createElement(ut,ne({},e,{ref:t,sideCar:Zi}))});zt.classNames=ut.classNames;var Qi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Xe=new WeakMap,Ge={},Tt=0,Gn=function(e){return e&&(e.host||Gn(e.parentNode))},Ji=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Gn(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},es=function(e,t,n,o){var r=Ji(t,Array.isArray(e)?e:[e]);Ge[n]||(Ge[n]=new WeakMap);var i=Ge[n],c=[],s=new Set,l=new Set(r),u=function(p){!p||s.has(p)||(s.add(p),u(p.parentNode))};r.forEach(u);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(h){if(s.has(h))d(h);else try{var m=h.getAttribute(o),w=m!==null&&m!=="false",f=(Oe.get(h)||0)+1,g=(i.get(h)||0)+1;Oe.set(h,f),i.set(h,g),c.push(h),f===1&&w&&Xe.set(h,!0),g===1&&h.setAttribute(n,"true"),w||h.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),s.clear(),Tt++,function(){c.forEach(function(p){var h=Oe.get(p)-1,m=i.get(p)-1;Oe.set(p,h),i.set(p,m),h||(Xe.has(p)||p.removeAttribute(o),Xe.delete(p)),m||p.removeAttribute(n)}),Tt--,Tt||(Oe=new WeakMap,Oe=new WeakMap,Xe=new WeakMap,Ge={})}},qn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Qi(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),es(o,r,n,"aria-hidden")):function(){return null}};function ts(e){const t=ns(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(rs);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function ns(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=ss(r),s=is(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var os=Symbol("radix.slottable");function rs(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===os}function is(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function ss(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ft="Dialog",[Zn,Ca]=Ve(ft),[cs,te]=Zn(ft),Qn=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:c=!0}=e,s=a.useRef(null),l=a.useRef(null),[u,d]=et({prop:o,defaultProp:r??!1,onChange:i,caller:ft});return x.jsx(cs,{scope:t,triggerRef:s,contentRef:l,contentId:Te(),titleId:Te(),descriptionId:Te(),open:u,onOpenChange:d,onOpenToggle:a.useCallback(()=>d(p=>!p),[d]),modal:c,children:n})};Qn.displayName=ft;var Jn="DialogTrigger",eo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(Jn,n),i=H(t,r.triggerRef);return x.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Xt(r.open),...o,ref:i,onClick:k(e.onClick,r.onOpenToggle)})});eo.displayName=Jn;var Kt="DialogPortal",[as,to]=Zn(Kt,{forceMount:void 0}),no=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=te(Kt,t);return x.jsx(as,{scope:t,forceMount:n,children:a.Children.map(o,c=>x.jsx(He,{present:n||i.open,children:x.jsx(Ut,{asChild:!0,container:r,children:c})}))})};no.displayName=Kt;var nt="DialogOverlay",oo=a.forwardRef((e,t)=>{const n=to(nt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(nt,e.__scopeDialog);return i.modal?x.jsx(He,{present:o||i.open,children:x.jsx(us,{...r,ref:t})}):null});oo.displayName=nt;var ls=ts("DialogOverlay.RemoveScroll"),us=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(nt,n);return x.jsx(zt,{as:ls,allowPinchZoom:!0,shards:[r.contentRef],children:x.jsx(M.div,{"data-state":Xt(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Se="DialogContent",ro=a.forwardRef((e,t)=>{const n=to(Se,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(Se,e.__scopeDialog);return x.jsx(He,{present:o||i.open,children:i.modal?x.jsx(fs,{...r,ref:t}):x.jsx(ds,{...r,ref:t})})});ro.displayName=Se;var fs=a.forwardRef((e,t)=>{const n=te(Se,e.__scopeDialog),o=a.useRef(null),r=H(t,n.contentRef,o);return a.useEffect(()=>{const i=o.current;if(i)return qn(i)},[]),x.jsx(io,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,s=c.button===0&&c.ctrlKey===!0;(c.button===2||s)&&i.preventDefault()}),onFocusOutside:k(e.onFocusOutside,i=>i.preventDefault())})}),ds=a.forwardRef((e,t)=>{const n=te(Se,e.__scopeDialog),o=a.useRef(!1),r=a.useRef(!1);return x.jsx(io,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=i.target;n.triggerRef.current?.contains(c)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),io=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...c}=e,s=te(Se,n),l=a.useRef(null),u=H(t,l);return Bn(),x.jsxs(x.Fragment,{children:[x.jsx(Ht,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i,children:x.jsx(lt,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Xt(s.open),...c,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(ps,{titleId:s.titleId}),x.jsx(hs,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Yt="DialogTitle",so=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(Yt,n);return x.jsx(M.h2,{id:r.titleId,...o,ref:t})});so.displayName=Yt;var co="DialogDescription",ao=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(co,n);return x.jsx(M.p,{id:r.descriptionId,...o,ref:t})});ao.displayName=co;var lo="DialogClose",uo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(lo,n);return x.jsx(M.button,{type:"button",...o,ref:t,onClick:k(e.onClick,()=>r.onOpenChange(!1))})});uo.displayName=lo;function Xt(e){return e?"open":"closed"}var fo="DialogTitleWarning",[Ea,po]=wr(fo,{contentName:Se,titleName:Yt,docsSlug:"dialog"}),ps=({titleId:e})=>{const t=po(fo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ms="DialogDescriptionWarning",hs=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${po(ms).contentName}}.`;return a.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Ra=Qn,Pa=eo,Aa=no,Oa=oo,Ta=ro,Na=so,Ia=ao,Da=uo;const gs=["top","right","bottom","left"],de=Math.min,G=Math.max,ot=Math.round,qe=Math.floor,re=e=>({x:e,y:e}),vs={left:"right",right:"left",bottom:"top",top:"bottom"},ys={start:"end",end:"start"};function Mt(e,t,n){return G(e,de(t,n))}function ce(e,t){return typeof e=="function"?e(t):e}function ae(e){return e.split("-")[0]}function Me(e){return e.split("-")[1]}function Gt(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}const ws=new Set(["top","bottom"]);function oe(e){return ws.has(ae(e))?"y":"x"}function Zt(e){return Gt(oe(e))}function xs(e,t,n){n===void 0&&(n=!1);const o=Me(e),r=Zt(e),i=qt(r);let c=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=rt(c)),[c,rt(c)]}function Ss(e){const t=rt(e);return[Lt(e),t,Lt(t)]}function Lt(e){return e.replace(/start|end/g,t=>ys[t])}const Sn=["left","right"],bn=["right","left"],bs=["top","bottom"],Cs=["bottom","top"];function Es(e,t,n){switch(e){case"top":case"bottom":return n?t?bn:Sn:t?Sn:bn;case"left":case"right":return t?bs:Cs;default:return[]}}function Rs(e,t,n,o){const r=Me(e);let i=Es(ae(e),n==="start",o);return r&&(i=i.map(c=>c+"-"+r),t&&(i=i.concat(i.map(Lt)))),i}function rt(e){return e.replace(/left|right|bottom|top/g,t=>vs[t])}function Ps(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e!="number"?Ps(e):{top:e,right:e,bottom:e,left:e}}function it(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Cn(e,t,n){let{reference:o,floating:r}=e;const i=oe(t),c=Zt(t),s=qt(c),l=ae(t),u=i==="y",d=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2;let m;switch(l){case"top":m={x:d,y:o.y-r.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:p};break;case"left":m={x:o.x-r.width,y:p};break;default:m={x:o.x,y:o.y}}switch(Me(t)){case"start":m[c]-=h*(n&&u?-1:1);break;case"end":m[c]+=h*(n&&u?-1:1);break}return m}const As=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:c}=n,s=i.filter(Boolean),l=await(c.isRTL==null?void 0:c.isRTL(t));let u=await c.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=Cn(u,o,l),h=o,m={},w=0;for(let f=0;f({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:c,elements:s,middlewareData:l}=t,{element:u,padding:d=0}=ce(e,t)||{};if(u==null)return{};const p=mo(d),h={x:n,y:o},m=Zt(r),w=qt(m),f=await c.getDimensions(u),g=m==="y",y=g?"top":"left",v=g?"bottom":"right",S=g?"clientHeight":"clientWidth",b=i.reference[w]+i.reference[m]-h[m]-i.floating[w],C=h[m]-i.reference[m],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(u));let E=R?R[S]:0;(!E||!await(c.isElement==null?void 0:c.isElement(R)))&&(E=s.floating[S]||i.floating[w]);const O=b/2-C/2,_=E/2-f[w]/2-1,I=de(p[y],_),j=de(p[v],_),F=I,L=E-f[w]-j,N=E/2-f[w]/2+O,V=Mt(F,N,L),T=!l.arrow&&Me(r)!=null&&N!==V&&i.reference[w]/2-(NN<=0)){var j,F;const N=(((j=i.flip)==null?void 0:j.index)||0)+1,V=E[N];if(V&&(!(p==="alignment"?v!==oe(V):!1)||I.every(A=>oe(A.placement)===v?A.overflows[0]>0:!0)))return{data:{index:N,overflows:I},reset:{placement:V}};let T=(F=I.filter(D=>D.overflows[0]<=0).sort((D,A)=>D.overflows[1]-A.overflows[1])[0])==null?void 0:F.placement;if(!T)switch(m){case"bestFit":{var L;const D=(L=I.filter(A=>{if(R){const W=oe(A.placement);return W===v||W==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(W=>W>0).reduce((W,X)=>W+X,0)]).sort((A,W)=>A[1]-W[1])[0])==null?void 0:L[0];D&&(T=D);break}case"initialPlacement":T=s;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function En(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rn(e){return gs.some(t=>e[t]>=0)}const Ns=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=ce(e,t);switch(o){case"referenceHidden":{const i=await $e(t,{...r,elementContext:"reference"}),c=En(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Rn(c)}}}case"escaped":{const i=await $e(t,{...r,altBoundary:!0}),c=En(i,n.floating);return{data:{escapedOffsets:c,escaped:Rn(c)}}}default:return{}}}}},ho=new Set(["left","top"]);async function Is(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),c=ae(n),s=Me(n),l=oe(n)==="y",u=ho.has(c)?-1:1,d=i&&l?-1:1,p=ce(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof w=="number"&&(m=s==="end"?w*-1:w),l?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Ds=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:c,middlewareData:s}=t,l=await Is(t,e);return c===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:c}}}}},_s=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:s={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=ce(e,t),u={x:n,y:o},d=await $e(t,l),p=oe(ae(r)),h=Gt(p);let m=u[h],w=u[p];if(i){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=m+d[g],S=m-d[y];m=Mt(v,m,S)}if(c){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=w+d[g],S=w-d[y];w=Mt(v,w,S)}const f=s.fn({...t,[h]:m,[p]:w});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[h]:i,[p]:c}}}}}},Ms=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:c}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=ce(e,t),d={x:n,y:o},p=oe(r),h=Gt(p);let m=d[h],w=d[p];const f=ce(s,t),g=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const S=h==="y"?"height":"width",b=i.reference[h]-i.floating[S]+g.mainAxis,C=i.reference[h]+i.reference[S]-g.mainAxis;mC&&(m=C)}if(u){var y,v;const S=h==="y"?"width":"height",b=ho.has(ae(r)),C=i.reference[p]-i.floating[S]+(b&&((y=c.offset)==null?void 0:y[p])||0)+(b?0:g.crossAxis),R=i.reference[p]+i.reference[S]+(b?0:((v=c.offset)==null?void 0:v[p])||0)-(b?g.crossAxis:0);wR&&(w=R)}return{[h]:m,[p]:w}}}},Ls=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:c,elements:s}=t,{apply:l=()=>{},...u}=ce(e,t),d=await $e(t,u),p=ae(r),h=Me(r),m=oe(r)==="y",{width:w,height:f}=i.floating;let g,y;p==="top"||p==="bottom"?(g=p,y=h===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(y=p,g=h==="end"?"top":"bottom");const v=f-d.top-d.bottom,S=w-d.left-d.right,b=de(f-d[g],v),C=de(w-d[y],S),R=!t.middlewareData.shift;let E=b,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=v),R&&!h){const I=G(d.left,0),j=G(d.right,0),F=G(d.top,0),L=G(d.bottom,0);m?O=w-2*(I!==0||j!==0?I+j:G(d.left,d.right)):E=f-2*(F!==0||L!==0?F+L:G(d.top,d.bottom))}await l({...t,availableWidth:O,availableHeight:E});const _=await c.getDimensions(s.floating);return w!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}};function dt(){return typeof window<"u"}function Le(e){return go(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function se(e){var t;return(t=(go(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function go(e){return dt()?e instanceof Node||e instanceof q(e).Node:!1}function J(e){return dt()?e instanceof Element||e instanceof q(e).Element:!1}function ie(e){return dt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Pn(e){return!dt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const ks=new Set(["inline","contents"]);function Ue(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ks.has(r)}const js=new Set(["table","td","th"]);function Fs(e){return js.has(Le(e))}const Ws=[":popover-open",":modal"];function pt(e){return Ws.some(t=>{try{return e.matches(t)}catch{return!1}})}const $s=["transform","translate","scale","rotate","perspective"],Bs=["transform","translate","scale","rotate","perspective","filter"],Vs=["paint","layout","strict","content"];function Qt(e){const t=Jt(),n=J(e)?ee(e):e;return $s.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Bs.some(o=>(n.willChange||"").includes(o))||Vs.some(o=>(n.contain||"").includes(o))}function Hs(e){let t=pe(e);for(;ie(t)&&!De(t);){if(Qt(t))return t;if(pt(t))return null;t=pe(t)}return null}function Jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Us=new Set(["html","body","#document"]);function De(e){return Us.has(Le(e))}function ee(e){return q(e).getComputedStyle(e)}function mt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pe(e){if(Le(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pn(e)&&e.host||se(e);return Pn(t)?t.host:t}function vo(e){const t=pe(e);return De(t)?e.ownerDocument?e.ownerDocument.body:e.body:ie(t)&&Ue(t)?t:vo(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=vo(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),c=q(r);if(i){const s=kt(c);return t.concat(c,c.visualViewport||[],Ue(r)?r:[],s&&n?Be(s):[])}return t.concat(r,Be(r,[],n))}function kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yo(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ie(e),i=r?e.offsetWidth:n,c=r?e.offsetHeight:o,s=ot(n)!==i||ot(o)!==c;return s&&(n=i,o=c),{width:n,height:o,$:s}}function en(e){return J(e)?e:e.contextElement}function Ie(e){const t=en(e);if(!ie(t))return re(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=yo(t);let c=(i?ot(n.width):n.width)/o,s=(i?ot(n.height):n.height)/r;return(!c||!Number.isFinite(c))&&(c=1),(!s||!Number.isFinite(s))&&(s=1),{x:c,y:s}}const zs=re(0);function wo(e){const t=q(e);return!Jt()||!t.visualViewport?zs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ks(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function be(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=en(e);let c=re(1);t&&(o?J(o)&&(c=Ie(o)):c=Ie(e));const s=Ks(i,n,o)?wo(i):re(0);let l=(r.left+s.x)/c.x,u=(r.top+s.y)/c.y,d=r.width/c.x,p=r.height/c.y;if(i){const h=q(i),m=o&&J(o)?q(o):o;let w=h,f=kt(w);for(;f&&o&&m!==w;){const g=Ie(f),y=f.getBoundingClientRect(),v=ee(f),S=y.left+(f.clientLeft+parseFloat(v.paddingLeft))*g.x,b=y.top+(f.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,p*=g.y,l+=S,u+=b,w=q(f),f=kt(w)}}return it({width:d,height:p,x:l,y:u})}function ht(e,t){const n=mt(e).scrollLeft;return t?t.left+n:be(se(e)).left+n}function xo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ht(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ys(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",c=se(o),s=t?pt(t.floating):!1;if(o===c||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=re(1);const d=re(0),p=ie(o);if((p||!p&&!i)&&((Le(o)!=="body"||Ue(c))&&(l=mt(o)),ie(o))){const m=be(o);u=Ie(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const h=c&&!p&&!i?xo(c,l):re(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function Xs(e){return Array.from(e.getClientRects())}function Gs(e){const t=se(e),n=mt(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+ht(e);const s=-n.scrollTop;return ee(o).direction==="rtl"&&(c+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:c,y:s}}const An=25;function qs(e,t){const n=q(e),o=se(e),r=n.visualViewport;let i=o.clientWidth,c=o.clientHeight,s=0,l=0;if(r){i=r.width,c=r.height;const d=Jt();(!d||d&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}const u=ht(o);if(u<=0){const d=o.ownerDocument,p=d.body,h=getComputedStyle(p),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(o.clientWidth-p.clientWidth-m);w<=An&&(i-=w)}else u<=An&&(i+=u);return{width:i,height:c,x:s,y:l}}const Zs=new Set(["absolute","fixed"]);function Qs(e,t){const n=be(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ie(e)?Ie(e):re(1),c=e.clientWidth*i.x,s=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:c,height:s,x:l,y:u}}function On(e,t,n){let o;if(t==="viewport")o=qs(e,n);else if(t==="document")o=Gs(se(e));else if(J(t))o=Qs(t,n);else{const r=wo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return it(o)}function So(e,t){const n=pe(e);return n===t||!J(n)||De(n)?!1:ee(n).position==="fixed"||So(n,t)}function Js(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>J(s)&&Le(s)!=="body"),r=null;const i=ee(e).position==="fixed";let c=i?pe(e):e;for(;J(c)&&!De(c);){const s=ee(c),l=Qt(c);!l&&s.position==="fixed"&&(r=null),(i?!l&&!r:!l&&s.position==="static"&&!!r&&Zs.has(r.position)||Ue(c)&&!l&&So(e,c))?o=o.filter(d=>d!==c):r=s,c=pe(c)}return t.set(e,o),o}function ec(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const c=[...n==="clippingAncestors"?pt(t)?[]:Js(t,this._c):[].concat(n),o],s=c[0],l=c.reduce((u,d)=>{const p=On(t,d,r);return u.top=G(p.top,u.top),u.right=de(p.right,u.right),u.bottom=de(p.bottom,u.bottom),u.left=G(p.left,u.left),u},On(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tc(e){const{width:t,height:n}=yo(e);return{width:t,height:n}}function nc(e,t,n){const o=ie(t),r=se(t),i=n==="fixed",c=be(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=re(0);function u(){l.x=ht(r)}if(o||!o&&!i)if((Le(t)!=="body"||Ue(r))&&(s=mt(t)),o){const m=be(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&u();i&&!o&&r&&u();const d=r&&!o&&!i?xo(r,s):re(0),p=c.left+s.scrollLeft-l.x-d.x,h=c.top+s.scrollTop-l.y-d.y;return{x:p,y:h,width:c.width,height:c.height}}function Nt(e){return ee(e).position==="static"}function Tn(e,t){if(!ie(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return se(e)===n&&(n=n.ownerDocument.body),n}function bo(e,t){const n=q(e);if(pt(e))return n;if(!ie(e)){let r=pe(e);for(;r&&!De(r);){if(J(r)&&!Nt(r))return r;r=pe(r)}return n}let o=Tn(e,t);for(;o&&Fs(o)&&Nt(o);)o=Tn(o,t);return o&&De(o)&&Nt(o)&&!Qt(o)?n:o||Hs(e)||n}const oc=async function(e){const t=this.getOffsetParent||bo,n=this.getDimensions,o=await n(e.floating);return{reference:nc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rc(e){return ee(e).direction==="rtl"}const ic={convertOffsetParentRelativeRectToViewportRelativeRect:Ys,getDocumentElement:se,getClippingRect:ec,getOffsetParent:bo,getElementRects:oc,getClientRects:Xs,getDimensions:tc,getScale:Ie,isElement:J,isRTL:rc};function Co(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sc(e,t){let n=null,o;const r=se(e);function i(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function c(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:p,width:h,height:m}=u;if(s||t(),!h||!m)return;const w=qe(p),f=qe(r.clientWidth-(d+h)),g=qe(r.clientHeight-(p+m)),y=qe(d),S={rootMargin:-w+"px "+-f+"px "+-g+"px "+-y+"px",threshold:G(0,de(1,l))||1};let b=!0;function C(R){const E=R[0].intersectionRatio;if(E!==l){if(!b)return c();E?c(!1,E):o=setTimeout(()=>{c(!1,1e-7)},1e3)}E===1&&!Co(u,e.getBoundingClientRect())&&c(),b=!1}try{n=new IntersectionObserver(C,{...S,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return c(!0),i}function cc(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=en(e),d=r||i?[...u?Be(u):[],...Be(t)]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const p=u&&s?sc(u,n):null;let h=-1,m=null;c&&(m=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let w,f=l?be(e):null;l&&g();function g(){const y=be(e);f&&!Co(f,y)&&n(),f=y,w=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),p?.(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(w)}}const ac=Ds,lc=_s,uc=Ts,fc=Ls,dc=Ns,Nn=Os,pc=Ms,mc=(e,t,n)=>{const o=new Map,r={platform:ic,...n},i={...r.platform,_c:o};return As(e,t,{...r,platform:i})};var hc=typeof document<"u",gc=function(){},Je=hc?a.useLayoutEffect:gc;function st(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!st(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!st(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Eo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function In(e,t){const n=Eo(e);return Math.round(t*n)/n}function It(e){const t=a.useRef(e);return Je(()=>{t.current=e}),t}function vc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:c}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=a.useState(o);st(h,o)||m(o);const[w,f]=a.useState(null),[g,y]=a.useState(null),v=a.useCallback(A=>{A!==R.current&&(R.current=A,f(A))},[]),S=a.useCallback(A=>{A!==E.current&&(E.current=A,y(A))},[]),b=i||w,C=c||g,R=a.useRef(null),E=a.useRef(null),O=a.useRef(d),_=l!=null,I=It(l),j=It(r),F=It(u),L=a.useCallback(()=>{if(!R.current||!E.current)return;const A={placement:t,strategy:n,middleware:h};j.current&&(A.platform=j.current),mc(R.current,E.current,A).then(W=>{const X={...W,isPositioned:F.current!==!1};N.current&&!st(O.current,X)&&(O.current=X,at.flushSync(()=>{p(X)}))})},[h,t,n,j,F]);Je(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(A=>({...A,isPositioned:!1})))},[u]);const N=a.useRef(!1);Je(()=>(N.current=!0,()=>{N.current=!1}),[]),Je(()=>{if(b&&(R.current=b),C&&(E.current=C),b&&C){if(I.current)return I.current(b,C,L);L()}},[b,C,L,I,_]);const V=a.useMemo(()=>({reference:R,floating:E,setReference:v,setFloating:S}),[v,S]),T=a.useMemo(()=>({reference:b,floating:C}),[b,C]),D=a.useMemo(()=>{const A={position:n,left:0,top:0};if(!T.floating)return A;const W=In(T.floating,d.x),X=In(T.floating,d.y);return s?{...A,transform:"translate("+W+"px, "+X+"px)",...Eo(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:X}},[n,s,T.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:L,refs:V,elements:T,floatingStyles:D}),[d,L,V,T,D])}const yc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Nn({element:o.current,padding:r}).fn(n):{}:o?Nn({element:o,padding:r}).fn(n):{}}}},wc=(e,t)=>({...ac(e),options:[e,t]}),xc=(e,t)=>({...lc(e),options:[e,t]}),Sc=(e,t)=>({...pc(e),options:[e,t]}),bc=(e,t)=>({...uc(e),options:[e,t]}),Cc=(e,t)=>({...fc(e),options:[e,t]}),Ec=(e,t)=>({...dc(e),options:[e,t]}),Rc=(e,t)=>({...yc(e),options:[e,t]});var Pc="Arrow",Ro=a.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return x.jsx(M.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ro.displayName=Pc;var Ac=Ro,tn="Popper",[Po,Ao]=Ve(tn),[Oc,Oo]=Po(tn),To=e=>{const{__scopePopper:t,children:n}=e,[o,r]=a.useState(null);return x.jsx(Oc,{scope:t,anchor:o,onAnchorChange:r,children:n})};To.displayName=tn;var No="PopperAnchor",Io=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Oo(No,n),c=a.useRef(null),s=H(t,c),l=a.useRef(null);return a.useEffect(()=>{const u=l.current;l.current=o?.current||c.current,u!==l.current&&i.onAnchorChange(l.current)}),o?null:x.jsx(M.div,{...r,ref:s})});Io.displayName=No;var nn="PopperContent",[Tc,Nc]=Po(nn),Do=a.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:c=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:w,...f}=e,g=Oo(nn,n),[y,v]=a.useState(null),S=H(t,P=>v(P)),[b,C]=a.useState(null),R=Ln(b),E=R?.width??0,O=R?.height??0,_=o+(i!=="center"?"-"+i:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],F=j.length>0,L={padding:I,boundary:j.filter(Dc),altBoundary:F},{refs:N,floatingStyles:V,placement:T,isPositioned:D,middlewareData:A}=vc({strategy:"fixed",placement:_,whileElementsMounted:(...P)=>cc(...P,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[wc({mainAxis:r+O,alignmentAxis:c}),l&&xc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sc():void 0,...L}),l&&bc({...L}),Cc({...L,apply:({elements:P,rects:U,availableWidth:Y,availableHeight:$})=>{const{width:B,height:z}=U.reference,Z=P.floating.style;Z.setProperty("--radix-popper-available-width",`${Y}px`),Z.setProperty("--radix-popper-available-height",`${$}px`),Z.setProperty("--radix-popper-anchor-width",`${B}px`),Z.setProperty("--radix-popper-anchor-height",`${z}px`)}}),b&&Rc({element:b,padding:s}),_c({arrowWidth:E,arrowHeight:O}),h&&Ec({strategy:"referenceHidden",...L})]}),[W,X]=Lo(T),ge=xe(w);K(()=>{D&&ge?.()},[D,ge]);const je=A.arrow?.x,Fe=A.arrow?.y,le=A.arrow?.centerOffset!==0,[Re,ve]=a.useState();return K(()=>{y&&ve(window.getComputedStyle(y).zIndex)},[y]),x.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:D?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(Tc,{scope:n,placedSide:W,onArrowChange:C,arrowX:je,arrowY:Fe,shouldHideArrow:le,children:x.jsx(M.div,{"data-side":W,"data-align":X,...f,ref:S,style:{...f.style,animation:D?void 0:"none"}})})})});Do.displayName=nn;var _o="PopperArrow",Ic={top:"bottom",right:"left",bottom:"top",left:"right"},Mo=a.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Nc(_o,o),c=Ic[i.placedSide];return x.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:x.jsx(Ac,{...r,ref:n,style:{...r.style,display:"block"}})})});Mo.displayName=_o;function Dc(e){return e!==null}var _c=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,c=r.arrow?.centerOffset!==0,s=c?0:e.arrowWidth,l=c?0:e.arrowHeight,[u,d]=Lo(n),p={start:"0%",center:"50%",end:"100%"}[d],h=(r.arrow?.x??0)+s/2,m=(r.arrow?.y??0)+l/2;let w="",f="";return u==="bottom"?(w=c?p:`${h}px`,f=`${-l}px`):u==="top"?(w=c?p:`${h}px`,f=`${o.floating.height+l}px`):u==="right"?(w=`${-l}px`,f=c?p:`${m}px`):u==="left"&&(w=`${o.floating.width+l}px`,f=c?p:`${m}px`),{data:{x:w,y:f}}}});function Lo(e){const[t,n="center"]=e.split("-");return[t,n]}var Mc=To,Lc=Io,kc=Do,jc=Mo;function Fc(e){const t=Wc(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Bc);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Wc(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Hc(r),s=Vc(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $c=Symbol("radix.slottable");function Bc(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$c}function Vc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Hc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ko=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Uc="VisuallyHidden",jo=a.forwardRef((e,t)=>x.jsx(M.span,{...e,ref:t,style:{...ko,...e.style}}));jo.displayName=Uc;var _a=jo,zc=[" ","Enter","ArrowUp","ArrowDown"],Kc=[" ","Enter"],Ce="Select",[gt,vt,Yc]=Pr(Ce),[ke]=Ve(Ce,[Yc,Ao]),yt=Ao(),[Xc,me]=ke(Ce),[Gc,qc]=ke(Ce),Fo=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:c,defaultValue:s,onValueChange:l,dir:u,name:d,autoComplete:p,disabled:h,required:m,form:w}=e,f=yt(t),[g,y]=a.useState(null),[v,S]=a.useState(null),[b,C]=a.useState(!1),R=Br(u),[E,O]=et({prop:o,defaultProp:r??!1,onChange:i,caller:Ce}),[_,I]=et({prop:c,defaultProp:s,onChange:l,caller:Ce}),j=a.useRef(null),F=g?w||!!g.closest("form"):!0,[L,N]=a.useState(new Set),V=Array.from(L).map(T=>T.props.value).join(";");return x.jsx(Mc,{...f,children:x.jsxs(Xc,{required:m,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:S,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:Te(),value:_,onValueChange:I,open:E,onOpenChange:O,dir:R,triggerPointerDownPosRef:j,disabled:h,children:[x.jsx(gt.Provider,{scope:t,children:x.jsx(Gc,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(T=>{N(D=>new Set(D).add(T))},[]),onNativeOptionRemove:a.useCallback(T=>{N(D=>{const A=new Set(D);return A.delete(T),A})},[]),children:n})}),F?x.jsxs(ar,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:p,value:_,onChange:T=>I(T.target.value),disabled:h,form:w,children:[_===void 0?x.jsx("option",{value:""}):null,Array.from(L)]},V):null]})})};Fo.displayName=Ce;var Wo="SelectTrigger",$o=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=yt(n),c=me(Wo,n),s=c.disabled||o,l=H(t,c.onTriggerChange),u=vt(n),d=a.useRef("touch"),[p,h,m]=ur(f=>{const g=u().filter(S=>!S.disabled),y=g.find(S=>S.value===c.value),v=fr(g,f,y);v!==void 0&&c.onValueChange(v.value)}),w=f=>{s||(c.onOpenChange(!0),m()),f&&(c.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return x.jsx(Lc,{asChild:!0,...i,children:x.jsx(M.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":lr(c.value)?"":void 0,...r,ref:l,onClick:k(r.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&w(f)}),onPointerDown:k(r.onPointerDown,f=>{d.current=f.pointerType;const g=f.target;g.hasPointerCapture(f.pointerId)&&g.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(w(f),f.preventDefault())}),onKeyDown:k(r.onKeyDown,f=>{const g=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&h(f.key),!(g&&f.key===" ")&&zc.includes(f.key)&&(w(),f.preventDefault())})})})});$o.displayName=Wo;var Bo="SelectValue",Vo=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:c="",...s}=e,l=me(Bo,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,p=H(t,l.onValueNodeChange);return K(()=>{u(d)},[u,d]),x.jsx(M.span,{...s,ref:p,style:{pointerEvents:"none"},children:lr(l.value)?x.jsx(x.Fragment,{children:c}):i})});Vo.displayName=Bo;var Zc="SelectIcon",Ho=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return x.jsx(M.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Ho.displayName=Zc;var Qc="SelectPortal",Uo=e=>x.jsx(Ut,{asChild:!0,...e});Uo.displayName=Qc;var Ee="SelectContent",zo=a.forwardRef((e,t)=>{const n=me(Ee,e.__scopeSelect),[o,r]=a.useState();if(K(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?at.createPortal(x.jsx(Ko,{scope:e.__scopeSelect,children:x.jsx(gt.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),i):null}return x.jsx(Yo,{...e,ref:t})});zo.displayName=Ee;var Q=10,[Ko,he]=ke(Ee),Jc="SelectContentImpl",ea=Fc("SelectContent.RemoveScroll"),Yo=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:c,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:w,hideWhenDetached:f,avoidCollisions:g,...y}=e,v=me(Ee,n),[S,b]=a.useState(null),[C,R]=a.useState(null),E=H(t,P=>b(P)),[O,_]=a.useState(null),[I,j]=a.useState(null),F=vt(n),[L,N]=a.useState(!1),V=a.useRef(!1);a.useEffect(()=>{if(S)return qn(S)},[S]),Bn();const T=a.useCallback(P=>{const[U,...Y]=F().map(z=>z.ref.current),[$]=Y.slice(-1),B=document.activeElement;for(const z of P)if(z===B||(z?.scrollIntoView({block:"nearest"}),z===U&&C&&(C.scrollTop=0),z===$&&C&&(C.scrollTop=C.scrollHeight),z?.focus(),document.activeElement!==B))return},[F,C]),D=a.useCallback(()=>T([O,S]),[T,O,S]);a.useEffect(()=>{L&&D()},[L,D]);const{onOpenChange:A,triggerPointerDownPosRef:W}=v;a.useEffect(()=>{if(S){let P={x:0,y:0};const U=$=>{P={x:Math.abs(Math.round($.pageX)-(W.current?.x??0)),y:Math.abs(Math.round($.pageY)-(W.current?.y??0))}},Y=$=>{P.x<=10&&P.y<=10?$.preventDefault():S.contains($.target)||A(!1),document.removeEventListener("pointermove",U),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",Y,{capture:!0})}}},[S,A,W]),a.useEffect(()=>{const P=()=>A(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[A]);const[X,ge]=ur(P=>{const U=F().filter(B=>!B.disabled),Y=U.find(B=>B.ref.current===document.activeElement),$=fr(U,P,Y);$&&setTimeout(()=>$.ref.current.focus())}),je=a.useCallback((P,U,Y)=>{const $=!V.current&&!Y;(v.value!==void 0&&v.value===U||$)&&(_(P),$&&(V.current=!0))},[v.value]),Fe=a.useCallback(()=>S?.focus(),[S]),le=a.useCallback((P,U,Y)=>{const $=!V.current&&!Y;(v.value!==void 0&&v.value===U||$)&&j(P)},[v.value]),Re=o==="popper"?jt:Xo,ve=Re===jt?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:w,hideWhenDetached:f,avoidCollisions:g}:{};return x.jsx(Ko,{scope:n,content:S,viewport:C,onViewportChange:R,itemRefCallback:je,selectedItem:O,onItemLeave:Fe,itemTextRefCallback:le,focusSelectedItem:D,selectedItemText:I,position:o,isPositioned:L,searchRef:X,children:x.jsx(zt,{as:ea,allowPinchZoom:!0,children:x.jsx(Ht,{asChild:!0,trapped:v.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:k(r,P=>{v.trigger?.focus({preventScroll:!0}),P.preventDefault()}),children:x.jsx(lt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:x.jsx(Re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:P=>P.preventDefault(),...y,...ve,onPlaced:()=>N(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:k(y.onKeyDown,P=>{const U=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!U&&P.key.length===1&&ge(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let $=F().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(P.key)&&($=$.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const B=P.target,z=$.indexOf(B);$=$.slice(z+1)}setTimeout(()=>T($)),P.preventDefault()}})})})})})})});Yo.displayName=Jc;var ta="SelectItemAlignedPosition",Xo=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=me(Ee,n),c=he(Ee,n),[s,l]=a.useState(null),[u,d]=a.useState(null),p=H(t,E=>d(E)),h=vt(n),m=a.useRef(!1),w=a.useRef(!0),{viewport:f,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=c,S=a.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&f&&g&&y){const E=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),_=i.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(i.dir!=="rtl"){const B=I.left-O.left,z=_.left-B,Z=E.left-z,ye=E.width+Z,xt=Math.max(ye,O.width),St=window.innerWidth-Q,bt=an(z,[Q,Math.max(Q,St-xt)]);s.style.minWidth=ye+"px",s.style.left=bt+"px"}else{const B=O.right-I.right,z=window.innerWidth-_.right-B,Z=window.innerWidth-E.right-z,ye=E.width+Z,xt=Math.max(ye,O.width),St=window.innerWidth-Q,bt=an(z,[Q,Math.max(Q,St-xt)]);s.style.minWidth=ye+"px",s.style.right=bt+"px"}const j=h(),F=window.innerHeight-Q*2,L=f.scrollHeight,N=window.getComputedStyle(u),V=parseInt(N.borderTopWidth,10),T=parseInt(N.paddingTop,10),D=parseInt(N.borderBottomWidth,10),A=parseInt(N.paddingBottom,10),W=V+T+L+A+D,X=Math.min(g.offsetHeight*5,W),ge=window.getComputedStyle(f),je=parseInt(ge.paddingTop,10),Fe=parseInt(ge.paddingBottom,10),le=E.top+E.height/2-Q,Re=F-le,ve=g.offsetHeight/2,P=g.offsetTop+ve,U=V+T+P,Y=W-U;if(U<=le){const B=j.length>0&&g===j[j.length-1].ref.current;s.style.bottom="0px";const z=u.clientHeight-f.offsetTop-f.offsetHeight,Z=Math.max(Re,ve+(B?Fe:0)+z+D),ye=U+Z;s.style.height=ye+"px"}else{const B=j.length>0&&g===j[0].ref.current;s.style.top="0px";const Z=Math.max(le,V+f.offsetTop+(B?je:0)+ve)+Y;s.style.height=Z+"px",f.scrollTop=U-le+f.offsetTop}s.style.margin=`${Q}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=F+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,s,u,f,g,y,i.dir,o]);K(()=>S(),[S]);const[b,C]=a.useState();K(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const R=a.useCallback(E=>{E&&w.current===!0&&(S(),v?.(),w.current=!1)},[S,v]);return x.jsx(oa,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:x.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:x.jsx(M.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Xo.displayName=ta;var na="SelectPopperPosition",jt=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Q,...i}=e,c=yt(n);return x.jsx(kc,{...c,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});jt.displayName=na;var[oa,on]=ke(Ee,{}),Ft="SelectViewport",Go=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=he(Ft,n),c=on(Ft,n),s=H(t,i.onViewportChange),l=a.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),x.jsx(gt.Slot,{scope:n,children:x.jsx(M.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:k(r.onScroll,u=>{const d=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=c;if(h?.current&&p){const m=Math.abs(l.current-d.scrollTop);if(m>0){const w=window.innerHeight-Q*2,f=parseFloat(p.style.minHeight),g=parseFloat(p.style.height),y=Math.max(f,g);if(y0?b:0,p.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Go.displayName=Ft;var qo="SelectGroup",[ra,ia]=ke(qo),sa=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Te();return x.jsx(ra,{scope:n,id:r,children:x.jsx(M.div,{role:"group","aria-labelledby":r,...o,ref:t})})});sa.displayName=qo;var Zo="SelectLabel",Qo=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ia(Zo,n);return x.jsx(M.div,{id:r.id,...o,ref:t})});Qo.displayName=Zo;var ct="SelectItem",[ca,Jo]=ke(ct),er=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...c}=e,s=me(ct,n),l=he(ct,n),u=s.value===o,[d,p]=a.useState(i??""),[h,m]=a.useState(!1),w=H(t,v=>l.itemRefCallback?.(v,o,r)),f=Te(),g=a.useRef("touch"),y=()=>{r||(s.onValueChange(o),s.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(ca,{scope:n,value:o,disabled:r,textId:f,isSelected:u,onItemTextChange:a.useCallback(v=>{p(S=>S||(v?.textContent??"").trim())},[]),children:x.jsx(gt.ItemSlot,{scope:n,value:o,disabled:r,textValue:d,children:x.jsx(M.div,{role:"option","aria-labelledby":f,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...c,ref:w,onFocus:k(c.onFocus,()=>m(!0)),onBlur:k(c.onBlur,()=>m(!1)),onClick:k(c.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:k(c.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:k(c.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:k(c.onPointerMove,v=>{g.current=v.pointerType,r?l.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:k(c.onPointerLeave,v=>{v.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:k(c.onKeyDown,v=>{l.searchRef?.current!==""&&v.key===" "||(Kc.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});er.displayName=ct;var We="SelectItemText",tr=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,c=me(We,n),s=he(We,n),l=Jo(We,n),u=qc(We,n),[d,p]=a.useState(null),h=H(t,y=>p(y),l.onItemTextChange,y=>s.itemTextRefCallback?.(y,l.value,l.disabled)),m=d?.textContent,w=a.useMemo(()=>x.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:f,onNativeOptionRemove:g}=u;return K(()=>(f(w),()=>g(w)),[f,g,w]),x.jsxs(x.Fragment,{children:[x.jsx(M.span,{id:l.textId,...i,ref:h}),l.isSelected&&c.valueNode&&!c.valueNodeHasChildren?at.createPortal(i.children,c.valueNode):null]})});tr.displayName=We;var nr="SelectItemIndicator",or=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Jo(nr,n).isSelected?x.jsx(M.span,{"aria-hidden":!0,...o,ref:t}):null});or.displayName=nr;var Wt="SelectScrollUpButton",rr=a.forwardRef((e,t)=>{const n=he(Wt,e.__scopeSelect),o=on(Wt,e.__scopeSelect),[r,i]=a.useState(!1),c=H(t,o.onScrollButtonChange);return K(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?x.jsx(sr,{...e,ref:c,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});rr.displayName=Wt;var $t="SelectScrollDownButton",ir=a.forwardRef((e,t)=>{const n=he($t,e.__scopeSelect),o=on($t,e.__scopeSelect),[r,i]=a.useState(!1),c=H(t,o.onScrollButtonChange);return K(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?x.jsx(sr,{...e,ref:c,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});ir.displayName=$t;var sr=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=he("SelectScrollButton",n),c=a.useRef(null),s=vt(n),l=a.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>l(),[l]),K(()=>{s().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),x.jsx(M.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:k(r.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(o,50))}),onPointerMove:k(r.onPointerMove,()=>{i.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(o,50))}),onPointerLeave:k(r.onPointerLeave,()=>{l()})})}),aa="SelectSeparator",cr=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return x.jsx(M.div,{"aria-hidden":!0,...o,ref:t})});cr.displayName=aa;var Bt="SelectArrow",la=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=yt(n),i=me(Bt,n),c=he(Bt,n);return i.open&&c.position==="popper"?x.jsx(jc,{...r,...o,ref:t}):null});la.displayName=Bt;var ua="SelectBubbleInput",ar=a.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=a.useRef(null),i=H(o,r),c=Mn(t);return a.useEffect(()=>{const s=r.current;if(!s)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(c!==t&&d){const p=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(p)}},[c,t]),x.jsx(M.select,{...n,style:{...ko,...n.style},ref:i,defaultValue:t})});ar.displayName=ua;function lr(e){return e===""||e===void 0}function ur(e){const t=xe(e),n=a.useRef(""),o=a.useRef(0),r=a.useCallback(c=>{const s=n.current+c;t(s),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),i=a.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function fr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=fa(e,Math.max(i,0));r.length===1&&(c=c.filter(u=>u!==n));const l=c.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function fa(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ma=Fo,La=$o,ka=Vo,ja=Ho,Fa=Uo,Wa=zo,$a=Go,Ba=Qo,Va=er,Ha=tr,Ua=or,za=rr,Ka=ir,Ya=cr,wt="Checkbox",[da]=Ve(wt),[pa,rn]=da(wt);function ma(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:i,form:c,name:s,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:p}=e,[h,m]=et({prop:n,defaultProp:r??!1,onChange:l,caller:wt}),[w,f]=a.useState(null),[g,y]=a.useState(null),v=a.useRef(!1),S=w?!!c||!!w.closest("form"):!0,b={checked:h,disabled:i,setChecked:m,control:w,setControl:f,name:s,form:c,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:fe(r)?!1:r,isFormControl:S,bubbleInput:g,setBubbleInput:y};return x.jsx(pa,{scope:t,...b,children:va(p)?p(b):o})}var dr="CheckboxTrigger",pr=a.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:i,value:c,disabled:s,checked:l,required:u,setControl:d,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:w}=rn(dr,e),f=H(r,d),g=a.useRef(l);return a.useEffect(()=>{const y=i?.form;if(y){const v=()=>p(g.current);return y.addEventListener("reset",v),()=>y.removeEventListener("reset",v)}},[i,p]),x.jsx(M.button,{type:"button",role:"checkbox","aria-checked":fe(l)?"mixed":l,"aria-required":u,"data-state":vr(l),"data-disabled":s?"":void 0,disabled:s,value:c,...o,ref:f,onKeyDown:k(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:k(n,y=>{p(v=>fe(v)?!0:!v),w&&m&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})})});pr.displayName=dr;var ha=a.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:i,required:c,disabled:s,value:l,onCheckedChange:u,form:d,...p}=e;return x.jsx(ma,{__scopeCheckbox:n,checked:r,defaultChecked:i,disabled:s,required:c,onCheckedChange:u,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:h})=>x.jsxs(x.Fragment,{children:[x.jsx(pr,{...p,ref:t,__scopeCheckbox:n}),h&&x.jsx(gr,{__scopeCheckbox:n})]})})});ha.displayName=wt;var mr="CheckboxIndicator",ga=a.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,i=rn(mr,n);return x.jsx(He,{present:o||fe(i.checked)||i.checked===!0,children:x.jsx(M.span,{"data-state":vr(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});ga.displayName=mr;var hr="CheckboxBubbleInput",gr=a.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:i,defaultChecked:c,required:s,disabled:l,name:u,value:d,form:p,bubbleInput:h,setBubbleInput:m}=rn(hr,e),w=H(n,m),f=Mn(i),g=Ln(o);a.useEffect(()=>{const v=h;if(!v)return;const S=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(S,"checked").set,R=!r.current;if(f!==i&&C){const E=new Event("click",{bubbles:R});v.indeterminate=fe(i),C.call(v,fe(i)?!1:i),v.dispatchEvent(E)}},[h,f,i,r]);const y=a.useRef(fe(i)?!1:i);return x.jsx(M.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??y.current,required:s,disabled:l,name:u,value:d,form:p,...t,tabIndex:-1,ref:w,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});gr.displayName=hr;function va(e){return typeof e=="function"}function fe(e){return e==="indeterminate"}function vr(e){return fe(e)?"indeterminate":e?"checked":"unchecked"}export{ha as $,Ha as A,Ya as B,Ta as C,Ia as D,Ma as E,ka as F,_e as G,Ut as H,ja as I,Ao as J,qn as K,Ba as L,zt as M,Bn as N,Oa as O,M as P,Ht as Q,xa as R,wa as S,Na as T,lt as U,$a as V,Ea as W,kc as X,Mc as Y,Lc as Z,jc as _,Pr as a,ga as a0,kr as a1,_a as a2,ba as a3,jo as a4,Sa as a5,k as b,Ve as c,H as d,Br as e,et as f,xe as g,He as h,K as i,an as j,_n as k,Mn as l,Ln as m,Aa as n,Da as o,Ra as p,Pa as q,Ca as r,La as s,za as t,Te as u,Ka as v,Fa as w,Wa as x,Va as y,Ua as z}; diff --git a/webui/dist/index.html b/webui/dist/index.html index cbf4716b..379c953d 100644 --- a/webui/dist/index.html +++ b/webui/dist/index.html @@ -5,8 +5,13 @@ MaiBot Dashboard - - + + + + + + +