================================================================================ FILE: AUDIT_FILE_TREE.txt ================================================================================ ================================================================================ ClassNotify Audit Source Tree Manifest Generated: 2026-09-20 21:50:33 +08:00 ================================================================================ build_installer.ps1 4.17 KB ClassNotify.sln 2.5 KB Publish-AuditSnapshot.ps1 13.43 KB README.md 5.62 KB src/Android/ClassNotify.Android/app/build.gradle.kts 2.61 KB src/Android/ClassNotify.Android/app/src/main/AndroidManifest.xml 1.27 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ClassNotifyApp.kt 2.15 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/api/AuthInterceptor.kt 0.53 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/api/ClassNotifyApi.kt 1.1 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/api/SignalRManager.kt 2.82 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/model/AuthModels.kt 0.75 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/model/ClassroomModels.kt 0.84 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/model/NotificationModels.kt 1.83 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/repository/AuthRepository.kt 2.35 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/repository/NotificationRepository.kt 2.06 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/MainActivity.kt 2.28 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/login/LoginScreen.kt 7.23 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/login/LoginViewModel.kt 1.67 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/teacher/TeacherMainScreen.kt 19.84 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/teacher/TeacherViewModel.kt 6.45 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/theme/Color.kt 0.57 KB src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/theme/Theme.kt 1.26 KB src/Android/ClassNotify.Android/app/src/main/res/drawable/ic_launcher_foreground.xml 0.38 KB src/Android/ClassNotify.Android/app/src/main/res/mipmap/ic_launcher.xml 0.46 KB src/Android/ClassNotify.Android/app/src/main/res/mipmap/ic_launcher_round.xml 0.49 KB src/Android/ClassNotify.Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 0.26 KB src/Android/ClassNotify.Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml 0.26 KB src/Android/ClassNotify.Android/app/src/main/res/values/colors.xml 0.12 KB src/Android/ClassNotify.Android/app/src/main/res/values/strings.xml 0.07 KB src/Android/ClassNotify.Android/app/src/main/res/values/themes.xml 0.28 KB src/Android/ClassNotify.Android/app/src/main/res/xml/backup_rules.xml 0.08 KB src/Android/ClassNotify.Android/app/src/main/res/xml/data_extraction_rules.xml 0.25 KB src/Android/ClassNotify.Android/build.gradle.kts 0.24 KB src/Android/ClassNotify.Android/gradle.properties 0.13 KB src/Android/ClassNotify.Android/gradle/wrapper/gradle-wrapper.jar 62.23 KB src/Android/ClassNotify.Android/gradle/wrapper/gradle-wrapper.properties 0.24 KB src/Android/ClassNotify.Android/gradlew 8.51 KB src/Android/ClassNotify.Android/gradlew.bat 2.73 KB src/Android/ClassNotify.Android/README.md 1.93 KB src/Android/ClassNotify.Android/settings.gradle.kts 0.52 KB src/Scripts/Install-ClassNotify.ps1 3.86 KB src/Scripts/Repair-ClassNotify.ps1 3.65 KB src/Scripts/SelfCheck.ps1 1.46 KB src/Scripts/Uninstall-ClassNotify.ps1 1.08 KB src/Server/Caddyfile 0.28 KB src/Server/ClassNotify.Server/ClassNotify.Server.csproj 0.83 KB src/Server/ClassNotify.Server/Controllers/AdminController.cs 4.18 KB src/Server/ClassNotify.Server/Controllers/AuthController.cs 1.39 KB src/Server/ClassNotify.Server/Controllers/DeviceController.cs 2.33 KB src/Server/ClassNotify.Server/Controllers/NotificationController.cs 4.91 KB src/Server/ClassNotify.Server/Controllers/SchoolAdminController.cs 6.88 KB src/Server/ClassNotify.Server/Dockerfile 0.63 KB src/Server/ClassNotify.Server/Domain/Entities/Entities.cs 2.18 KB src/Server/ClassNotify.Server/Hubs/DeviceHub.cs 7.11 KB src/Server/ClassNotify.Server/Hubs/TeacherHub.cs 1.34 KB src/Server/ClassNotify.Server/Program.cs 4.27 KB src/Server/ClassNotify.Server/Services/ISecurityService.cs 1.92 KB src/Server/ClassNotify.Server/Services/SecurityService.cs 32.86 KB src/Server/ClassNotify.Server/wwwroot/assets/index-CkDikWR1.css 27.95 KB src/Server/ClassNotify.Server/wwwroot/assets/index-tQkPyOQJ.js 239.12 KB src/Server/ClassNotify.Server/wwwroot/index.html 0.96 KB src/Server/classnotify.service 0.46 KB src/Server/docker-compose.yml 0.54 KB src/Shared/ClassNotify.Shared/ClassNotify.Shared.csproj 0.24 KB src/Shared/ClassNotify.Shared/Contracts/IDeviceHubClient.cs 0.65 KB src/Shared/ClassNotify.Shared/Contracts/ITeacherHubClient.cs 0.83 KB src/Shared/ClassNotify.Shared/Enums/AckStatus.cs 0.61 KB src/Shared/ClassNotify.Shared/Enums/DeviceOnlineState.cs 0.42 KB src/Shared/ClassNotify.Shared/Enums/NotificationType.cs 0.41 KB src/Shared/ClassNotify.Shared/Ipc/IpcMessage.cs 0.54 KB src/Shared/ClassNotify.Shared/Models/AckReceiptDto.cs 0.83 KB src/Shared/ClassNotify.Shared/Models/AdminDtos.cs 3.66 KB src/Shared/ClassNotify.Shared/Models/DeviceActivationRequestDto.cs 0.55 KB src/Shared/ClassNotify.Shared/Models/DeviceActivationResultDto.cs 0.44 KB src/Shared/ClassNotify.Shared/Models/DeviceCredentials.cs 0.57 KB src/Shared/ClassNotify.Shared/Models/DeviceHealthReportDto.cs 0.94 KB src/Shared/ClassNotify.Shared/Models/DeviceStatusDto.cs 0.53 KB src/Shared/ClassNotify.Shared/Models/NotificationDto.cs 1.63 KB src/Shared/ClassNotify.Shared/Models/TeacherLoginDto.cs 0.64 KB src/Web/ClassNotify.Web/index.html 0.86 KB src/Web/ClassNotify.Web/package.json 0.68 KB src/Web/ClassNotify.Web/package-lock.json 101.03 KB src/Web/ClassNotify.Web/postcss.config.js 0.08 KB src/Web/ClassNotify.Web/src/api/client.ts 4.65 KB src/Web/ClassNotify.Web/src/App.tsx 3.44 KB src/Web/ClassNotify.Web/src/components/Navbar.tsx 8.06 KB src/Web/ClassNotify.Web/src/context/AuthContext.tsx 2.04 KB src/Web/ClassNotify.Web/src/index.css 0.49 KB src/Web/ClassNotify.Web/src/main.tsx 0.23 KB src/Web/ClassNotify.Web/src/pages/admin/ActivationCodes.tsx 9.14 KB src/Web/ClassNotify.Web/src/pages/admin/AdminDashboard.tsx 10.19 KB src/Web/ClassNotify.Web/src/pages/admin/DeviceManagement.tsx 10.95 KB src/Web/ClassNotify.Web/src/pages/admin/HistoryAudit.tsx 6.68 KB src/Web/ClassNotify.Web/src/pages/Login.tsx 6.9 KB src/Web/ClassNotify.Web/src/pages/school/ClassManagement.tsx 8.99 KB src/Web/ClassNotify.Web/src/pages/school/SchoolDashboard.tsx 7.19 KB src/Web/ClassNotify.Web/src/pages/school/TeacherManagement.tsx 7.94 KB src/Web/ClassNotify.Web/src/pages/teacher/TeacherConsole.tsx 13.81 KB src/Web/ClassNotify.Web/src/types/index.ts 2 KB src/Web/ClassNotify.Web/tailwind.config.js 0.49 KB src/Web/ClassNotify.Web/tsconfig.json 0.61 KB src/Web/ClassNotify.Web/vite.config.ts 0.68 KB src/Windows/ClassNotify.Client/app.manifest 0.75 KB src/Windows/ClassNotify.Client/App.xaml 0.26 KB src/Windows/ClassNotify.Client/App.xaml.cs 0.76 KB src/Windows/ClassNotify.Client/ClassNotify.Client.csproj 0.5 KB src/Windows/ClassNotify.Client/MainWindow.xaml 4.88 KB src/Windows/ClassNotify.Client/MainWindow.xaml.cs 4.03 KB src/Windows/ClassNotify.Client/Services/IpcClient.cs 4.36 KB src/Windows/ClassNotify.Service/appsettings.json 0.39 KB src/Windows/ClassNotify.Service/ClassNotify.Service.csproj 0.84 KB src/Windows/ClassNotify.Service/Ipc/NamedPipeServer.cs 5.43 KB src/Windows/ClassNotify.Service/Program.cs 1.32 KB src/Windows/ClassNotify.Service/Services/DeviceCredentialsManager.cs 3.5 KB src/Windows/ClassNotify.Service/Services/SessionLauncher.cs 6.73 KB src/Windows/ClassNotify.Service/Workers/SignalRWorker.cs 12.38 KB src/Windows/ClassNotify.Setup/app.manifest 0.69 KB src/Windows/ClassNotify.Setup/App.xaml 3.92 KB src/Windows/ClassNotify.Setup/App.xaml.cs 7.8 KB src/Windows/ClassNotify.Setup/ClassNotify.Setup.csproj 0.76 KB src/Windows/ClassNotify.Setup/MainWindow.xaml 10.6 KB src/Windows/ClassNotify.Setup/MainWindow.xaml.cs 8.87 KB src/Windows/ClassNotify.Setup/Services/ActivationService.cs 3.67 KB src/Windows/ClassNotify.Setup/Services/DeploymentService.cs 5.41 KB src/Windows/ClassNotify.Setup/Services/RegistryUninstallManager.cs 1.21 KB src/Windows/ClassNotify.Setup/Services/SelfCheckService.cs 1.34 KB src/Windows/ClassNotify.Setup/Services/StartupManager.cs 3.49 KB src/Windows/ClassNotify.Setup/Services/UninstallManager.cs 1.82 KB src/Windows/ClassNotify.Setup/Services/WindowsServiceManager.cs 4.5 KB src/Windows/ClassNotify.Setup/UninstallWindow.xaml 4.16 KB src/Windows/ClassNotify.Setup/UninstallWindow.xaml.cs 1.35 KB test_p0_fixes.ps1 4.35 KB test_vps_security.ps1 2.48 KB update_vps.ps1 1.18 KB -------------------------------------------------------------------------------- Total Files: 134 | Total Uncompressed Size: 0.83 MB -------------------------------------------------------------------------------- ================================================================================ FILE: AUDIT_README.md ================================================================================ # ClassNotify 全量代码审计缺陷修复报告 (P0 级别全面清零) > 报告生成时间:2026-09-20 > 审计基准:针对外部独立全量代码审计报告(P0 致命级 12 项缺陷)的闭环修复与验证 --- ## 修复概述 ClassNotify 团队已对独立审计报告指出的 **全部 12 项 P0 阻塞级缺陷** 进行了系统性的代码级修复、单元编译验证与线上生产环境(东京 VPS)实测验证。项目现已进入严格的“稳定冻结期”,未引入任何新功能,专注于安全边界、数据一致性与运行可靠性。 --- ## P0 缺陷修复清单与技术实现细节 ### 第一梯队:权限与安全边界 (P0-02, P0-11, P0-12) #### 1. [P0-02] 修复 SchoolAdmin 越权创建 SuperAdmin - **问题**:`SchoolAdminController.CreateTeacher()` 直接传入前端提交的 `Role`,可提权为全平台超级管理员。 - **修复**: - 在 `SecurityService.CreateUserAsync()` 增加防御性角色白名单校验(非 `SchoolAdmin` 强制归为 `Teacher`,绝对禁止创建 `SuperAdmin`)。 - 在 `SchoolAdminController.CreateTeacher()` 增加鉴权守卫:非 `SuperAdmin` 统一强制将角色覆盖为 `Teacher`,彻底封死提权通道。 #### 2. [P0-12] 修复 DeviceController.GenerateCode 任意租户/班级越权生成激活码 - **问题**:接口仅标注 `[Authorize]`,任何普通教师 Token 均可调用生成虚构班级硬件激活码。 - **修复**: - 角色限制升级为 `[Authorize(Roles = "SuperAdmin,SchoolAdmin")]`。 - 强制从 JWT 中提取 `tenant_id`,并增加 `GetClassroomAsync(tenantId, classId)` 校验,确保班级真实存在且属于当前学校,否则返回 404/403。 #### 3. [P0-11] 修复 DeviceHub.SendAckReceipt 设备回执伪造 - **问题**:服务端完全信任客户端上报的 `ack.ClassId`,未校验设备身份与消息真实派发目标。 - **修复**: - 在 `DeviceHub.SendAckReceipt` 中,强制将 `ack.ClassId` 覆盖为该 SignalR 连接认证绑定的 `ClassroomId`。 - 新增 `ISecurityService.ValidateNotificationTarget(messageId, tenantId, classroomId)`,严格校验该 `messageId` 是否曾下发至该租户与班级,伪造/不匹配的回执直接拒绝记录与转发。 --- ### 第二梯队:数据一致性与并发安全 (P0-01, P0-03, P0-04) #### 4. [P0-01] 消除 SecurityService 中的死锁风险 (AB-BA 锁排序混乱) - **问题**:`GetTenantsOverviewAsync`、`GetAllDevicesAsync`、`UpdateDeviceHeartbeatAsync` 存在嵌套锁相互等待(如先锁 `_devices` 再锁 `_tenants` vs 先锁 `_tenants` 再锁 `_devices`)。 - **修复**: - 彻底推行“快照模式 (Snapshot Pattern)”,**消除全服务内所有嵌套锁**。 - 各集合(`_tenants`, `_classrooms`, `_devices`, `_liveConnections`, `_activationCodes`)仅在克隆快照时独立、短暂加锁并立即释放,业务投影与计数在无锁状态下进行。 #### 5. [P0-03] 修复激活码重启后“复活”问题 - **问题**:`InitializeSeedData` 每次重启向内存注入写死激活码,`codes.json` 反序列化合并逻辑缺失,导致已被使用的激活码在重启后重新生效。 - **修复**: - 重写静态构造加载逻辑:磁盘 `activation_codes.json` 作为唯一真实持久化状态,加载时覆盖内存 Seed 的状态(`IsUsed`, `UsedAt`, `UsedByDeviceId`)。 #### 6. [P0-04] 修复学校、班级、用户、通知历史重启全部丢失问题 - **问题**:Tenants, Classrooms, Users, Notifications 纯在内存中维护,崩溃或重启即丢失。 - **修复**: - 新增 `tenants.json`, `classrooms.json`, `users.json`, `notifications.json` 本地持久化支持。 - 在 `CreateClassroomAsync`, `CreateUserAsync`, `RecordNotification`, `RecordAck` 时实时触发增量写入与持久化落盘。 --- ### 第三梯队:Windows 教室端生命周期与状态机 (P0-05, P0-06, P0-07, P0-08, P0-09) #### 7. [P0-05] 消除虚假 Delivered 回执 - **问题**:`SignalRWorker` 在收到通知后立即向云端上报 `Delivered`,而此时 WPF Client 界面可能尚未启动或未渲染。 - **修复**: - `SignalRWorker` 移除收到通知即上报 `Delivered` 的逻辑。 - 若 WPF Client 未连接本地命名管道,`SignalRWorker` 立即上报 `AckStatus.Failed` 并附带明确诊断信息(“教室端 UI 界面未运行”)。 - `AckStatus.Delivered` 回执改为由 `ClassNotify.Client` 在 `MainWindow.Show()` 成功执行并激活窗口后,通过命名管道主动上报。 #### 8. [P0-06] 修复 SignalR 30 秒超时后永久死亡 - **问题**:`WithAutomaticReconnect` 仅配置了 5 次重试(最长 30 秒),网络断开时间稍长即触发永久断开。 - **修复**: - 引入实现 `IRetryPolicy` 的 `InfiniteRetryPolicy`:前 4 次快速重试(0s, 2s, 5s, 10s),之后每 30 秒持续重试,永不放弃。 - 监听 `_hubConnection.Closed` 事件,在非取消状态下进入常驻自愈重连循环。 #### 9. [P0-07 & P0-08] 修复 Session 0 无法拉起交互式 WPF 界面与崩溃自愈 - **问题**:`ClassNotify.Service` 运行在 Session 0,通过 `Process.Start` 启动 WPF 客户端将被隔离在 Session 0,无法在真实屏幕显示 UI。 - **修复**: - 实现 `SessionLauncher.cs`,使用 Win32 API(`WTSGetActiveConsoleSessionId`, `WTSQueryUserToken`, `DuplicateTokenEx`, `CreateEnvironmentBlock`, `CreateProcessAsUser`)将 WPF 客户端精确注入到当前活跃的用户交互式桌面会话(Session 1+)。 - 安装向导同时注册 `schtasks` 定时任务 `ClassNotifyClient` 作为可靠 fallback,双重保障拉起。 #### 10. [P0-09] 修复安装失败/重试导致一次性激活码永久报废 - **问题**:安装向导 Step 1 成功激活后若后续步骤(解压、写凭据、装服务)因杀软或权限异常退出,激活码已在云端核销,重试时报“已被使用”。 - **修复**: - 安装向导在 Step 1 激活成功后立即将安全凭据写入磁盘 `device_credentials.json`,并在内存缓存 `_pendingActivationResult`。 - 点击“重试”时优先复用已激活凭据,无需重复请求云端激活接口;重新打开安装器时自动识别已有凭据,直接进入升级/修复通道。 --- ### 第四梯队:Android 构建闭环 (P0-10) #### 11. [P0-10] 补齐 Android Gradle Wrapper 与 Launcher 图标资源 - **问题**:缺失 `gradle-wrapper.jar` 与 `gradlew` 脚本;缺少 `mipmap-*` 图标导致 aapt2 编译报错。 - **修复**: - 引入官方标准的 Gradle 8.4 `gradle-wrapper.jar`(63,721 字节)、`gradlew.bat` 与 `gradlew`。 - 补齐 `mipmap-anydpi-v26/ic_launcher.xml`、`ic_launcher_round.xml` 自适应图标,以及 `colors.xml`、`ic_launcher_foreground.xml` 与默认 mipmap 资源。 --- ## 线上实测验证结果 (东京 VPS: 158.179.179.29) 通过自动化测试脚本 `test_p0_fixes.ps1` 与 `test_vps_security.ps1` 在公网生产环境执行实测,结果如下: ``` ========================================== ClassNotify P0 Security Verification ========================================== [Test 1] Health Check Probe... Status: Healthy, Version: 2.1.0 [Test 2] Login as SchoolAdmin (admin_bj4)... Logged in as: 北京四中管理员, Role: SchoolAdmin [Test 3] P0-02: SchoolAdmin attempts to create SuperAdmin account... Created user response: {"success":true,"message":"教师账号创建成功"} PASS: Privilege escalation blocked! Role was forced to: Teacher [Test 4] P0-12: Teacher attempts to generate device activation code... PASS: Teacher denied from generating code (403 Forbidden) [Test 5] P0-12: SchoolAdmin attempts to generate code for nonexistent class... PASS: Code generation for invalid class rejected (404 Not Found) [Test 6] Valid code generation by SchoolAdmin for cls_801... PASS: Successfully generated valid activation code: 90C5-8AF3 === ALL PRODUCTION SECURITY CHECKS PASSED === ``` ================================================================================ FILE: build_installer.ps1 ================================================================================ # ============================================================================== # ClassNotifySetup.exe Build Script (Self-Contained Single-File) # ============================================================================== $ErrorActionPreference = "Stop" $dotnet = "C:\Program Files\dotnet\dotnet.exe" $root = $PSScriptRoot Write-Host "==========================================================" -ForegroundColor Cyan Write-Host " ClassNotify Installer Build Starting (Milestone 3)" -ForegroundColor Cyan Write-Host "==========================================================" -ForegroundColor Cyan # 1. Directories $stagingDir = Join-Path $root "staging" $serviceStaging = Join-Path $stagingDir "service" $clientStaging = Join-Path $stagingDir "client" $payloadStaging = Join-Path $stagingDir "payload" $distDir = Join-Path $root "dist" $resourcesDir = Join-Path $root "src\Windows\ClassNotify.Setup\Resources" $payloadZip = Join-Path $resourcesDir "payload.zip" if (Test-Path $stagingDir) { Remove-Item $stagingDir -Recurse -Force } if (Test-Path $distDir) { Remove-Item $distDir -Recurse -Force } New-Item -ItemType Directory -Path $serviceStaging -Force | Out-Null New-Item -ItemType Directory -Path $clientStaging -Force | Out-Null New-Item -ItemType Directory -Path $payloadStaging -Force | Out-Null New-Item -ItemType Directory -Path $resourcesDir -Force | Out-Null New-Item -ItemType Directory -Path $distDir -Force | Out-Null # 2. Publish Windows Service (win-x64, self-contained) Write-Host "`n[1/4] Publishing ClassNotify.Service (win-x64, self-contained)..." -ForegroundColor Yellow $serviceProj = Join-Path $root "src\Windows\ClassNotify.Service\ClassNotify.Service.csproj" & $dotnet publish $serviceProj -c Release -r win-x64 --self-contained true -o $serviceStaging if ($LASTEXITCODE -ne 0) { throw "ClassNotify.Service publish failed" } # 3. Publish WPF Client (win-x64, self-contained) Write-Host "`n[2/4] Publishing ClassNotify.Client (win-x64, self-contained)..." -ForegroundColor Yellow $clientProj = Join-Path $root "src\Windows\ClassNotify.Client\ClassNotify.Client.csproj" & $dotnet publish $clientProj -c Release -r win-x64 --self-contained true -o $clientStaging if ($LASTEXITCODE -ne 0) { throw "ClassNotify.Client publish failed" } # 4. Assemble payload and compress to payload.zip Write-Host "`n[3/4] Assembling and compressing payload.zip..." -ForegroundColor Yellow Copy-Item -Path $serviceStaging -Destination (Join-Path $payloadStaging "Service") -Recurse -Force Copy-Item -Path $clientStaging -Destination (Join-Path $payloadStaging "Client") -Recurse -Force if (Test-Path $payloadZip) { Remove-Item $payloadZip -Force } Compress-Archive -Path "$payloadStaging\*" -DestinationPath $payloadZip -CompressionLevel Optimal $zipSize = (Get-Item $payloadZip).Length / 1MB Write-Host " payload.zip generated: $([math]::Round($zipSize, 2)) MB" -ForegroundColor Green # 5. Publish ClassNotify.Setup (Single-File, win-x64, self-contained) Write-Host "`n[4/4] Packaging ClassNotifySetup.exe (Single-File Self-Contained)..." -ForegroundColor Yellow $setupProj = Join-Path $root "src\Windows\ClassNotify.Setup\ClassNotify.Setup.csproj" & $dotnet publish $setupProj -c Release -r win-x64 --self-contained true ` -p:PublishSingleFile=true ` -p:IncludeNativeLibrariesForSelfExtract=true ` -p:EnableCompressionInSingleFile=true ` -o $distDir if ($LASTEXITCODE -ne 0) { throw "ClassNotify.Setup packaging failed" } # 6. Rename to delivery name $builtExe = Join-Path $distDir "ClassNotify.Setup.exe" $finalExe = Join-Path $distDir "ClassNotifySetup.exe" if (Test-Path $builtExe) { Move-Item -Path $builtExe -Destination $finalExe -Force } $fileInfo = Get-Item $finalExe $finalSize = [math]::Round($fileInfo.Length / 1MB, 2) Write-Host "`n==========================================================" -ForegroundColor Green Write-Host " ClassNotifySetup.exe Built Successfully!" -ForegroundColor Green Write-Host " Path: $($fileInfo.FullName)" -ForegroundColor Green Write-Host " Size: $finalSize MB" -ForegroundColor Green Write-Host " Delivery Ready: Fully Self-Contained (No .NET SDK/Runtime Needed)" -ForegroundColor Green Write-Host "==========================================================" -ForegroundColor Green ================================================================================ FILE: ClassNotify.sln ================================================================================ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34330.188 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassNotify.Shared", "src\Shared\ClassNotify.Shared\ClassNotify.Shared.csproj", "{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassNotify.Server", "src\Server\ClassNotify.Server\ClassNotify.Server.csproj", "{B2C3D4E5-F6A7-4B8C-9D0E-1F2A3B4C5D6E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassNotify.Service", "src\Windows\ClassNotify.Service\ClassNotify.Service.csproj", "{C3D4E5F6-A7B8-4C9D-0E1F-2A3B4C5D6E7F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassNotify.Client", "src\Windows\ClassNotify.Client\ClassNotify.Client.csproj", "{D4E5F6A7-B8C9-4D0E-1F2A-3B4C5D6E7F80}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Release|Any CPU.Build.0 = Release|Any CPU {B2C3D4E5-F6A7-4B8C-9D0E-1F2A3B4C5D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B2C3D4E5-F6A7-4B8C-9D0E-1F2A3B4C5D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU {B2C3D4E5-F6A7-4B8C-9D0E-1F2A3B4C5D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU {B2C3D4E5-F6A7-4B8C-9D0E-1F2A3B4C5D6E}.Release|Any CPU.Build.0 = Release|Any CPU {C3D4E5F6-A7B8-4C9D-0E1F-2A3B4C5D6E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3D4E5F6-A7B8-4C9D-0E1F-2A3B4C5D6E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3D4E5F6-A7B8-4C9D-0E1F-2A3B4C5D6E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3D4E5F6-A7B8-4C9D-0E1F-2A3B4C5D6E7F}.Release|Any CPU.Build.0 = Release|Any CPU {D4E5F6A7-B8C9-4D0E-1F2A-3B4C5D6E7F80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D4E5F6A7-B8C9-4D0E-1F2A-3B4C5D6E7F80}.Debug|Any CPU.Build.0 = Debug|Any CPU {D4E5F6A7-B8C9-4D0E-1F2A-3B4C5D6E7F80}.Release|Any CPU.ActiveCfg = Release|Any CPU {D4E5F6A7-B8C9-4D0E-1F2A-3B4C5D6E7F80}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ================================================================================ FILE: Publish-AuditSnapshot.ps1 ================================================================================ # ============================================================================== # ClassNotify Automated Audit Snapshot Publisher # Target: Oracle VPS (/srv/classnotify-audit/) # Primary Domain: https://audit.paradise.eu.org # Fallback Domain: https://classnotify.paradise.eu.org/audit-sec-9a7f8b2c4e # ============================================================================== param ( [string]$VpsHost = "158.179.179.29", [string]$SshKey = "C:\Users\Administrator\.ssh\", [string]$RemoteDir = "/srv/classnotify-audit", [string]$AuditBaseUrl = "https://audit.paradise.eu.org", [string]$FallbackBaseUrl = "https://classnotify.paradise.eu.org/audit-sec-9a7f8b2c4e" ) $ErrorActionPreference = "Stop" $root = $PSScriptRoot if (-not $root) { $root = Get-Location } Write-Host "==========================================================" -ForegroundColor Cyan Write-Host " ClassNotify Audit Snapshot Publishing Starting " -ForegroundColor Cyan Write-Host "==========================================================" -ForegroundColor Cyan # 1. Prepare Staging Directory $timestamp = Get-Date -Format "yyyyMMdd-HHmmss" $staging = Join-Path $root ".audit_staging" if (Test-Path $staging) { Remove-Item $staging -Recurse -Force } New-Item -ItemType Directory -Path $staging -Force | Out-Null Write-Host "`n[1/7] Copying source files to staging..." -ForegroundColor Yellow # Exclusion patterns for files/directories $excludeDirs = @( "bin", "obj", "node_modules", ".gradle", "build", "dist", "publish_linux", "publish_linux_v2", "staging", ".audit_staging", ".git", ".idea", ".vs", ".vscode" ) $excludeExts = @( ".exe", ".dll", ".pdb", ".apk", ".aab", ".node", ".log", ".tmp", ".user", ".suo", ".tar.gz", ".zip" ) # Helper function to recursively copy matching source files function Copy-SourceTree([string]$sourceDir, [string]$targetDir) { if (-not (Test-Path $sourceDir)) { return } New-Item -ItemType Directory -Path $targetDir -Force | Out-Null $items = Get-ChildItem -Path $sourceDir -Force foreach ($item in $items) { if ($item.PSIsContainer) { if ($excludeDirs -contains $item.Name) { continue } Copy-SourceTree $item.FullName (Join-Path $targetDir $item.Name) } else { if ($excludeExts -contains $item.Extension.ToLower()) { # Preserve gradle-wrapper.jar as required for Android build if ($item.Name -ne "gradle-wrapper.jar") { continue } } Copy-Item -Path $item.FullName -Destination $targetDir -Force } } } # Copy src/ Copy-SourceTree (Join-Path $root "src") (Join-Path $staging "src") # Copy root build & deploy scripts, solutions, documentation $rootFiles = @( "ClassNotify.sln", "build_installer.ps1", "update_vps.ps1", "test_p0_fixes.ps1", "test_vps_security.ps1", "Publish-AuditSnapshot.ps1", "README.md", "walkthrough.md", "implementation_plan.md" ) foreach ($rf in $rootFiles) { $srcFile = Join-Path $root $rf if (Test-Path $srcFile) { Copy-Item -Path $srcFile -Destination $staging -Force } } # 2. Redact Sensitive Secrets in Staging Write-Host "`n[2/7] Redacting sensitive credentials in staging..." -ForegroundColor Yellow $filesToScan = Get-ChildItem -Path $staging -Recurse -File | Where-Object { $_.Extension -match "\.(cs|json|ts|tsx|kt|gradle|kts|xml|ps1|sh|env)$" } foreach ($file in $filesToScan) { $content = [System.IO.File]::ReadAllText($file.FullName, [System.Text.Encoding]::UTF8) $modified = $false # Redact private keys if ($content -match "-----BEGIN[ A-Z0-9_-]*PRIVATE KEY-----") { $content = [System.Text.RegularExpressions.Regex]::Replace($content, "-----BEGIN[ A-Z0-9_-]*PRIVATE KEY-----[\s\S]*?-----END[ A-Z0-9_-]*PRIVATE KEY-----", "") $modified = $true } # Redact production SSH keys or sensitive paths if ($content -match "") { $content = $content.Replace("", "") $modified = $true } if ($modified) { [System.IO.File]::WriteAllText($file.FullName, $content, [System.Text.Encoding]::UTF8) } } # 3. Generate AUDIT_FILE_TREE.txt Write-Host "`n[3/7] Generating AUDIT_FILE_TREE.txt..." -ForegroundColor Yellow $treeLines = [System.Collections.Generic.List[string]]::new() $treeLines.Add("================================================================================") $treeLines.Add("ClassNotify Audit Source Tree Manifest") $treeLines.Add("Generated: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss zzz')") $treeLines.Add("================================================================================") $treeLines.Add("") $allStagedFiles = Get-ChildItem -Path $staging -Recurse -File | Sort-Object FullName $totalFiles = $allStagedFiles.Count $totalBytes = 0 foreach ($f in $allStagedFiles) { $relPath = $f.FullName.Substring($staging.Length + 1).Replace("\", "/") $sizeKb = [math]::Round($f.Length / 1KB, 2) $totalBytes += $f.Length $treeLines.Add(("{0,-65} {1,10} KB" -f $relPath, $sizeKb)) } $treeLines.Add("") $treeLines.Add("--------------------------------------------------------------------------------") $treeLines.Add("Total Files: $totalFiles | Total Uncompressed Size: $([math]::Round($totalBytes / 1MB, 2)) MB") $treeLines.Add("--------------------------------------------------------------------------------") $treeFile = Join-Path $staging "AUDIT_FILE_TREE.txt" [System.IO.File]::WriteAllLines($treeFile, $treeLines, [System.Text.Encoding]::UTF8) # 4. Generate AUDIT_README.md $auditReadme = Join-Path $staging "AUDIT_README.md" $existingReadme = Join-Path $root "audit_staging\AUDIT_FIXES_REPORT.md" if (Test-Path $existingReadme) { Copy-Item -Path $existingReadme -Destination $auditReadme -Force } else { Set-Content -Path $auditReadme -Value "# ClassNotify Codebase Snapshot`nVersion: 2.1.0`nAll 12 P0 defects resolved." -Encoding utf8 } # 5. Generate latest-source.txt (Unified plain-text source snapshot for AI consumption) Write-Host "`n[4/7] Generating latest-source.txt..." -ForegroundColor Yellow $sourceTxtPath = Join-Path $staging "latest-source.txt" $sb = [System.Text.StringBuilder]::new() $textFiles = Get-ChildItem -Path $staging -Recurse -File | Where-Object { $_.Name -ne "latest.zip" -and $_.Name -ne "latest-source.txt" -and $_.Name -ne "manifest.json" -and $_.Extension -ne ".jar" -and $_.Extension -ne ".zip" } | Sort-Object FullName foreach ($tf in $textFiles) { $rel = $tf.FullName.Substring($staging.Length + 1).Replace("\", "/") $sb.AppendLine("================================================================================") | Out-Null $sb.AppendLine("FILE: $rel") | Out-Null $sb.AppendLine("================================================================================") | Out-Null try { $content = [System.IO.File]::ReadAllText($tf.FullName, [System.Text.Encoding]::UTF8) $sb.AppendLine($content) | Out-Null } catch { $sb.AppendLine("[Binary or Unreadable Content]") | Out-Null } $sb.AppendLine("") | Out-Null } [System.IO.File]::WriteAllText($sourceTxtPath, $sb.ToString(), (New-Object System.Text.UTF8Encoding($false))) $sourceTxtInfo = Get-Item $sourceTxtPath $sourceTxtSizeMb = [math]::Round($sourceTxtInfo.Length / 1MB, 2) $sourceTxtSha256 = (Get-FileHash -Path $sourceTxtPath -Algorithm SHA256).Hash Write-Host " latest-source.txt created: $sourceTxtSizeMb MB (SHA256: $sourceTxtSha256)" -ForegroundColor Green # 6. Compress to latest.zip & Compute SHA256 Write-Host "`n[5/7] Compressing latest.zip..." -ForegroundColor Yellow $zipOutput = Join-Path $root "latest.zip" if (Test-Path $zipOutput) { Remove-Item $zipOutput -Force } Compress-Archive -Path "$staging\*" -DestinationPath $zipOutput -CompressionLevel Optimal $zipFileInfo = Get-Item $zipOutput $zipSizeMb = [math]::Round($zipFileInfo.Length / 1MB, 2) $zipSha256 = (Get-FileHash -Path $zipOutput -Algorithm SHA256).Hash Write-Host " latest.zip created: $zipSizeMb MB (SHA256: $zipSha256)" -ForegroundColor Green # 7. Generate manifest.json (UTF-8 without BOM) Write-Host "`n[6/7] Generating manifest.json..." -ForegroundColor Yellow $gitCommit = "" try { $gitCommit = & git rev-parse --short HEAD 2>$null } catch { } $manifestObj = [ordered]@{ project = "ClassNotify" generatedAt = (Get-Date).ToString("o") version = "2.1.0" gitCommit = if ($gitCommit) { $gitCommit.Trim() } else { "" } fileCount = $totalFiles + 4 # including manifest, tree, readme, latest-source.txt archive = "latest.zip" archiveSha256 = $zipSha256 sourceText = "latest-source.txt" sourceTextSha256 = $sourceTxtSha256 } $manifestFile = Join-Path $staging "manifest.json" $jsonContent = $manifestObj | ConvertTo-Json -Depth 5 [System.IO.File]::WriteAllText($manifestFile, $jsonContent, (New-Object System.Text.UTF8Encoding($false))) # 8. Upload to Oracle VPS via SCP & Maintain History Write-Host "`n[7/7] Uploading to Oracle VPS ($RemoteDir)..." -ForegroundColor Yellow $historyZip = "ClassNotify-Audit-$timestamp.zip" $historySource = "ClassNotify-Audit-$timestamp-source.txt" # Copy all audit artifacts scp -i $SshKey -o StrictHostKeyChecking=no ` $zipOutput ` $sourceTxtPath ` $manifestFile ` $treeFile ` $auditReadme ` "root@${VpsHost}:${RemoteDir}/" if ($LASTEXITCODE -ne 0) { throw "SCP upload failed" } # On remote server: archive to history and retain last 10 versions $remoteCmd = "cp ${RemoteDir}/latest.zip ${RemoteDir}/history/${historyZip} && cp ${RemoteDir}/latest-source.txt ${RemoteDir}/history/${historySource} && cd ${RemoteDir}/history && ls -t ClassNotify-Audit-*.zip 2>/dev/null | tail -n +11 | xargs -r rm -f && ls -t ClassNotify-Audit-*-source.txt 2>/dev/null | tail -n +11 | xargs -r rm -f && chmod -R 755 ${RemoteDir}" ssh -i $SshKey -o StrictHostKeyChecking=no "root@${VpsHost}" $remoteCmd if ($LASTEXITCODE -ne 0) { throw "Remote history maintenance failed" } # 9. Self-Verification via HTTPS Write-Host "`n[Self-Verification] Testing HTTPS endpoints..." -ForegroundColor Cyan # Check DNS resolution of audit.paradise.eu.org $dnsIp = "" try { $dns = Resolve-DnsName "audit.paradise.eu.org" -ErrorAction SilentlyContinue $dnsIp = ($dns | Where-Object { $_.IPAddress } | Select-Object -First 1).IPAddress } catch { } $primaryActive = $false if ($dnsIp -eq $VpsHost) { try { $manifestResp = Invoke-RestMethod -Uri "$AuditBaseUrl/manifest.json" -Method Get -UseBasicParsing $zipHead = Invoke-WebRequest -Uri "$AuditBaseUrl/latest.zip" -Method Head -UseBasicParsing $srcHead = Invoke-WebRequest -Uri "$AuditBaseUrl/latest-source.txt" -Method Head -UseBasicParsing $primaryActive = $true Write-Host " [audit.paradise.eu.org] Check: HTTP 200 OK across all endpoints!" -ForegroundColor Green } catch { Write-Host " [audit.paradise.eu.org] Warning: $($_.Exception.Message)" -ForegroundColor Yellow } } else { Write-Host " [Notice] audit.paradise.eu.org currently resolves to '$dnsIp' (expected: '$VpsHost')." -ForegroundColor Yellow Write-Host " Please update the A record in Cloudflare DNS to point to $VpsHost." -ForegroundColor Yellow } # Verify via fallback path on classnotify.paradise.eu.org try { $fbManifest = Invoke-RestMethod -Uri "$FallbackBaseUrl/manifest.json" -Method Get -UseBasicParsing $fbZip = Invoke-WebRequest -Uri "$FallbackBaseUrl/latest.zip" -Method Head -UseBasicParsing $fbSrc = Invoke-WebRequest -Uri "$FallbackBaseUrl/latest-source.txt" -Method Head -UseBasicParsing Write-Host " [Fallback Path] Check: HTTP 200 OK (Content-Length: $($fbZip.Headers['Content-Length']) bytes, Source: $($fbSrc.Headers['Content-Length']) bytes)" -ForegroundColor Green } catch { Write-Host " [Fallback Path] Error: $($_.Exception.Message)" -ForegroundColor Red } # Clean up local staging directory if (Test-Path $staging) { Remove-Item $staging -Recurse -Force } Write-Host "`n==========================================================" -ForegroundColor Green Write-Host " Audit Snapshot Published Successfully! " -ForegroundColor Green Write-Host "==========================================================" -ForegroundColor Green Write-Host "Primary URLs (Active once DNS points to $VpsHost):" -ForegroundColor Cyan Write-Host " ZIP: $AuditBaseUrl/latest.zip" -ForegroundColor White Write-Host " Source Text: $AuditBaseUrl/latest-source.txt" -ForegroundColor White Write-Host " Manifest: $AuditBaseUrl/manifest.json" -ForegroundColor White Write-Host " File Tree: $AuditBaseUrl/AUDIT_FILE_TREE.txt" -ForegroundColor White Write-Host " Readme: $AuditBaseUrl/AUDIT_README.md" -ForegroundColor White Write-Host "`nFallback URLs (Active now on production domain):" -ForegroundColor Cyan Write-Host " ZIP: $FallbackBaseUrl/latest.zip" -ForegroundColor White Write-Host " Source Text: $FallbackBaseUrl/latest-source.txt" -ForegroundColor White Write-Host " Manifest: $FallbackBaseUrl/manifest.json" -ForegroundColor White Write-Host "`nMetadata:" -ForegroundColor Cyan Write-Host " Files: $($manifestObj.fileCount)" -ForegroundColor White Write-Host " ZIP Size: $zipSizeMb MB (SHA256: $zipSha256)" -ForegroundColor White Write-Host " Source Text Size: $sourceTxtSizeMb MB (SHA256: $sourceTxtSha256)" -ForegroundColor White Write-Host " Generated At: $($manifestObj.generatedAt)" -ForegroundColor White Write-Host "==========================================================" -ForegroundColor Green ================================================================================ FILE: README.md ================================================================================ # ClassNotify 班级实时通知系统 (V1.0) > 老师在办公室通过 **Android 手机 / Web 网页** 向指定教室多媒体大屏发送通知(例如:“张三,请到办公室”、“英语课代表来一下”)。教室电脑立即**置顶弹窗、剧烈抖动、播放提示音、Windows 原生中文语音播报**,并支持“已收到”回执反馈。 --- ## 🌟 核心特性与设计哲学 - **稳定无感、学生不可见**: - 教室端无黑框、无控制台窗口、无明显任务栏托盘。 - 仅在有通知到来时弹窗,倒计时或点击【我知道了】后自动消失。 - **三层容灾看门狗(无人值守自我恢复)**: - **第一层**:`ClassNotify.exe` 负责界面展示与语音,进程异常退出由 Agent 重新调度。 - **第二层**:`ClassNotifyAgent.ps1` 隐藏在后台维持长连接心跳,掉线自动重连。 - **第三层**:Windows 计划任务 `Watchdog.ps1` 定期检查 Agent,确保电脑重启或被误杀后 100% 自动救活。 - **零额外运行时依赖**: - 教室端使用 Windows 原生 .NET 4.8 编译的 C# EXE(体积仅 9KB),**无需安装 Python、Node.js、Docker 或任何 AI 运行库**。 - 使用 Windows 自带的 SAPI 中文语音库,离线免费播报。 --- ## 📁 目录结构 ``` ClassNotify/ │ ├── Server/ # 云端中继服务器 │ ├── server.js # REST API + WebSocket 核心网关 │ ├── package.json │ └── data/ # 班级、设备与历史通知数据 (SQLite/JSON) │ ├── Web/ # 教师控制端 (响应式 Web / PWA) │ ├── index.html # 教师发信界面、班级大屏在线状态、快捷呼叫 │ └── manifest.json # 支持在 Android 手机上“安装为独立 App” │ ├── WindowsClient/ # 教室多媒体电脑端 │ ├── ClassNotify.cs # 窗体与语音源码 (置顶、抖动、TTS、确认回执) │ ├── ClassNotify.exe # 编译后的轻量可执行文件 (9KB) │ ├── compile.bat # 调用 Windows 原生 csc.exe 编译脚本 │ ├── ClassNotifyAgent.ps1 # 后台守护 Agent (WSS 长连接、心跳、自检) │ ├── Watchdog.ps1 # 看门狗脚本 (计划任务自动拉起) │ ├── Install-ClassNotify.ps1 # 一键自动化安装脚本 (部署至 ProgramData) │ ├── Uninstall-ClassNotify.ps1 │ ├── config.json # 客户端配置文件 │ └── logs/ # 本地运行日志 │ └── README.md ``` --- ## 🚀 部署指南 ### 一、 云服务器部署 (Server) 1. **环境准备**:任何带有 Node.js (>= 18) 的 Linux 或 Windows 服务器。 2. **安装并启动**: ```bash cd Server npm install node server.js # 或使用 pm2 守护进程: # npm install -g pm2 # pm2 start server.js --name "classnotify" ``` 3. **Nginx 反向代理配置 (配置域名与 SSL 证书)**: ```nginx server { listen 80; server_name notice.yourdomain.com; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name notice.yourdomain.com; ssl_certificate /path/to/fullchain.pem; ssl_certificate_key /path/to/privkey.pem; # 静态网页与 REST 接口 location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } # WebSocket 双向长连接支持 (教室端 & 教师端) location /ws/ { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_read_timeout 300s; } } ``` --- ### 二、 教室多媒体电脑部署 (WindowsClient) 1. 将 `WindowsClient` 文件夹拷贝到教室电脑或 U 盘中。 2. 右键以管理员身份运行 PowerShell,执行安装脚本: ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force .\Install-ClassNotify.ps1 -ClassId "801" -ClassName "八年级(1)班" -ServerUrl "wss://notice.yourdomain.com/ws/device" ``` 3. **脚本会自动完成**: - 将程序安装至隐藏目录 `C:\ProgramData\ClassNotify\`。 - 注册开机自启任务(开机自动在后台隐藏启动 Agent)。 - 注册每 5 分钟定时看门狗(Agent 异常退出自动拉起)。 - 启动 Agent 建立与云服务器的 WSS 长连接。 --- ### 三、 教师端使用 (Web / Android) 1. **浏览器打开**:访问 `https://notice.yourdomain.com`。 2. **登录**:输入教师管理口令(默认:`teacher123`,可在 `server.js` 或环境变量 `ADMIN_PASSWORD` 中修改)。 3. **Android 手机添加到主屏幕 (PWA)**: - 用手机 Chrome / 系统浏览器打开控制台。 - 点击浏览器右上角菜单 `⋮` ➔ 选择 **“添加到主屏幕”** 或 **“安装应用”**。 - 手机桌面上将生成一个独立的 **ClassNotify** App 图标,打开后全屏无浏览器地址栏,操作体验与原生 App 完全一致。 4. **发送通知**: - 选择目标班级(卡片实时显示 🟢在线 / 🔴离线 状态)。 - 点击常用学生名字(如“张三”)直接填充:“*张三,请到办公室一趟。*”。 - 勾选【🔊 语音朗读】与【📳 窗口抖动】。 - 点击【呼叫学生到办公室】。 - 下方实时时间线将展示:**已发送 ➔ 教室已收到 ➔ 🟢 学生已确认**。 ================================================================================ FILE: src/Android/ClassNotify.Android/app/build.gradle.kts ================================================================================ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") } android { namespace = "com.classnotify.app" compileSdk = 34 defaultConfig { applicationId = "com.classnotify.app" minSdk = 26 targetSdk = 34 versionCode = 1 versionName = "2.1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary = true } } buildTypes { release { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = "17" } buildFeatures { compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.11" } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } } dependencies { // AndroidX Core & Lifecycle implementation("androidx.core:core-ktx:1.12.0") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0") implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0") implementation("androidx.activity:activity-compose:1.8.2") // Jetpack Compose & Material 3 val composeBom = platform("androidx.compose:compose-bom:2024.04.00") implementation(composeBom) implementation("androidx.compose.ui:ui") implementation("androidx.compose.ui:ui-graphics") implementation("androidx.compose.ui:ui-tooling-preview") implementation("androidx.compose.material3:material3") implementation("androidx.compose.material:material-icons-extended") implementation("androidx.navigation:navigation-compose:2.7.7") // Retrofit & OkHttp implementation("com.squareup.retrofit2:retrofit:2.9.0") implementation("com.squareup.retrofit2:converter-gson:2.9.0") implementation("com.squareup.okhttp3:okhttp:4.12.0") implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") // Microsoft SignalR Client implementation("com.microsoft.signalr:signalr:8.0.0") // Coroutines implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0") // Security Crypto / Encrypted SharedPreferences implementation("androidx.security:security-crypto:1.1.0-alpha06") // Debugging debugImplementation("androidx.compose.ui:ui-tooling") debugImplementation("androidx.compose.ui:ui-test-manifest") } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/AndroidManifest.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ClassNotifyApp.kt ================================================================================ package com.classnotify.app import android.app.Application import com.classnotify.app.data.api.AuthInterceptor import com.classnotify.app.data.api.ClassNotifyApi import com.classnotify.app.data.api.SignalRManager import com.classnotify.app.data.repository.AuthRepository import com.classnotify.app.data.repository.NotificationRepository import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory import java.util.concurrent.TimeUnit class ClassNotifyApp : Application() { companion object { const val BASE_SERVER_URL = "https://classnotify.paradise.eu.org" const val BASE_API_URL = "$BASE_SERVER_URL/api/" lateinit var instance: ClassNotifyApp private set } lateinit var authRepository: AuthRepository private set lateinit var notificationRepository: NotificationRepository private set lateinit var signalRManager: SignalRManager private set override fun onCreate() { super.onCreate() instance = this val logging = HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY } // Shared SignalR manager signalRManager = SignalRManager() // Auth repository instantiated first to provide token for AuthInterceptor var tokenProvider: () -> String? = { null } val authInterceptor = AuthInterceptor { tokenProvider() } val okHttpClient = OkHttpClient.Builder() .addInterceptor(authInterceptor) .addInterceptor(logging) .connectTimeout(15, TimeUnit.SECONDS) .readTimeout(15, TimeUnit.SECONDS) .build() val retrofit = Retrofit.Builder() .baseUrl(BASE_API_URL) .client(okHttpClient) .addConverterFactory(GsonConverterFactory.create()) .build() val api = retrofit.create(ClassNotifyApi::class.java) authRepository = AuthRepository(this, api) tokenProvider = { authRepository.getToken() } notificationRepository = NotificationRepository(api, signalRManager) } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/api/AuthInterceptor.kt ================================================================================ package com.classnotify.app.data.api import okhttp3.Interceptor import okhttp3.Response class AuthInterceptor(private val tokenProvider: () -> String?) : Interceptor { override fun intercept(chain: Interceptor.Chain): Response { val original = chain.request() val token = tokenProvider() val requestBuilder = original.newBuilder() if (!token.isNullOrBlank()) { requestBuilder.header("Authorization", "Bearer $token") } return chain.proceed(requestBuilder.build()) } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/api/ClassNotifyApi.kt ================================================================================ package com.classnotify.app.data.api import com.classnotify.app.data.model.ClassroomDto import com.classnotify.app.data.model.LoginRequest import com.classnotify.app.data.model.LoginResponse import com.classnotify.app.data.model.NotificationRecordDto import com.classnotify.app.data.model.SendNotificationRequest import com.classnotify.app.data.model.SendNotificationResponse import com.classnotify.app.data.model.UserProfile import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST import retrofit2.http.Query interface ClassNotifyApi { @POST("auth/login") suspend fun login(@Body request: LoginRequest): LoginResponse @GET("auth/me") suspend fun getMe(): UserProfile @GET("notification/classes") suspend fun getTeacherClasses(): List @POST("notification/send") suspend fun sendNotification(@Body request: SendNotificationRequest): SendNotificationResponse @GET("notification/history") suspend fun getTeacherHistory( @Query("classId") classId: String? = null, @Query("limit") limit: Int = 20 ): List } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/api/SignalRManager.kt ================================================================================ package com.classnotify.app.data.api import android.util.Log import com.classnotify.app.data.model.AckReceiptDto import com.classnotify.app.data.model.DeviceStatusDto import com.microsoft.signalr.HubConnection import com.microsoft.signalr.HubConnectionBuilder import com.microsoft.signalr.HubConnectionState import io.reactivex.rxjava3.core.Single import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.launch class SignalRManager { private val TAG = "SignalRManager" private var hubConnection: HubConnection? = null private val scope = CoroutineScope(Dispatchers.IO) private val _ackEvents = MutableSharedFlow(extraBufferCapacity = 64) val ackEvents: SharedFlow = _ackEvents.asSharedFlow() private val _deviceStatusEvents = MutableSharedFlow(extraBufferCapacity = 64) val deviceStatusEvents: SharedFlow = _deviceStatusEvents.asSharedFlow() fun connect(serverBaseUrl: String, token: String) { if (hubConnection?.connectionState == HubConnectionState.CONNECTED) { Log.d(TAG, "SignalR already connected.") return } val hubUrl = "$serverBaseUrl/hubs/teacher" Log.d(TAG, "Connecting to SignalR: $hubUrl") try { hubConnection = HubConnectionBuilder.create(hubUrl) .withAccessTokenProvider(Single.just(token)) .build() // 1. Listen for ACK receipt updates hubConnection?.on("OnAckReceiptReceived", { ack: AckReceiptDto -> Log.d(TAG, "Received ACK via SignalR: ${ack.messageId} -> ${ack.status}") scope.launch { _ackEvents.emit(ack) } }, AckReceiptDto::class.java) // 2. Listen for device online/offline status changes hubConnection?.on("OnDeviceStatusChanged", { status: DeviceStatusDto -> Log.d(TAG, "Device status changed: Class=${status.classId}, State=${status.state}") scope.launch { _deviceStatusEvents.emit(status) } }, DeviceStatusDto::class.java) // 3. Connect asynchronously hubConnection?.start()?.blockingAwait() Log.i(TAG, "SignalR connected successfully!") } catch (e: Exception) { Log.e(TAG, "SignalR connection failed", e) } } fun disconnect() { try { hubConnection?.stop()?.blockingAwait() hubConnection = null Log.d(TAG, "SignalR disconnected.") } catch (e: Exception) { Log.e(TAG, "SignalR disconnect error", e) } } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/model/AuthModels.kt ================================================================================ package com.classnotify.app.data.model import com.google.gson.annotations.SerializedName data class LoginRequest( @SerializedName("username") val username: String, @SerializedName("password") val password: String ) data class LoginResponse( @SerializedName("success") val success: Boolean, @SerializedName("token") val token: String?, @SerializedName("tenantId") val tenantId: String?, @SerializedName("userId") val userId: String?, @SerializedName("fullName") val fullName: String?, @SerializedName("role") val role: String?, @SerializedName("errorMessage") val errorMessage: String? ) data class UserProfile( val userId: String, val fullName: String, val role: String, val tenantId: String, val token: String ) ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/model/ClassroomModels.kt ================================================================================ package com.classnotify.app.data.model import com.google.gson.annotations.SerializedName data class ClassroomDto( @SerializedName("id") val id: String, @SerializedName("tenantId") val tenantId: String, @SerializedName("displayName") val displayName: String, @SerializedName("grade") val grade: String?, @SerializedName("roomNumber") val roomNumber: String?, var isDeviceOnline: Boolean = false ) data class DeviceStatusDto( @SerializedName("classId") val classId: String, @SerializedName("className") val className: String?, @SerializedName("hostname") val hostname: String?, @SerializedName("state") val state: Int, // 0 = Offline, 1 = Online @SerializedName("lastHeartbeat") val lastHeartbeat: String?, @SerializedName("agentVersion") val agentVersion: String? ) { val isOnline: Boolean get() = state == 1 } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/model/NotificationModels.kt ================================================================================ package com.classnotify.app.data.model import com.google.gson.annotations.SerializedName data class SendNotificationRequest( @SerializedName("classId") val classId: String, @SerializedName("studentName") val studentName: String?, @SerializedName("title") val title: String, @SerializedName("message") val message: String, @SerializedName("type") val type: Int = 0, // 0=Call, 1=Broadcast, 2=Urgent @SerializedName("voice") val voice: Boolean = true, @SerializedName("shake") val shake: Boolean = true, @SerializedName("durationSeconds") val durationSeconds: Int = 15 ) data class SendNotificationResponse( @SerializedName("success") val success: Boolean, @SerializedName("messageId") val messageId: String?, @SerializedName("tenantId") val tenantId: String?, @SerializedName("classId") val classId: String?, @SerializedName("className") val className: String?, @SerializedName("message") val message: String? ) data class NotificationRecordDto( @SerializedName("id") val id: String, @SerializedName("tenantId") val tenantId: String, @SerializedName("classId") val classId: String, @SerializedName("className") val className: String, @SerializedName("senderName") val senderName: String, @SerializedName("message") val message: String, @SerializedName("priority") val priority: String, @SerializedName("createdAt") val createdAt: String, @SerializedName("status") var status: String, // Sent, Delivered, Acknowledged, Timeout @SerializedName("confirmedAt") var confirmedAt: String? = null ) data class AckReceiptDto( @SerializedName("messageId") val messageId: String, @SerializedName("classId") val classId: String, @SerializedName("status") val status: Int, // 0=Sent, 1=Delivered, 2=Acknowledged, 3=Timeout @SerializedName("timestamp") val timestamp: String ) ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/repository/AuthRepository.kt ================================================================================ package com.classnotify.app.data.repository import android.content.Context import android.content.SharedPreferences import com.classnotify.app.data.api.ClassNotifyApi import com.classnotify.app.data.model.LoginRequest import com.classnotify.app.data.model.UserProfile import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext class AuthRepository( private val context: Context, private val api: ClassNotifyApi ) { private val prefs: SharedPreferences = context.getSharedPreferences("classnotify_auth_prefs", Context.MODE_PRIVATE) fun getToken(): String? = prefs.getString("jwt_token", null) fun getUserProfile(): UserProfile? { val token = getToken() ?: return null val userId = prefs.getString("user_id", "") ?: "" val fullName = prefs.getString("full_name", "") ?: "" val role = prefs.getString("user_role", "") ?: "" val tenantId = prefs.getString("tenant_id", "") ?: "" return UserProfile(userId, fullName, role, tenantId, token) } fun isLoggedIn(): Boolean = !getToken().isNullOrBlank() suspend fun login(username: String, pass: String): Result = withContext(Dispatchers.IO) { try { val response = api.login(LoginRequest(username, pass)) if (response.success && !response.token.isNullOrBlank()) { val profile = UserProfile( userId = response.userId ?: "", fullName = response.fullName ?: username, role = response.role ?: "Teacher", tenantId = response.tenantId ?: "", token = response.token ) saveSession(profile) Result.success(profile) } else { Result.failure(Exception(response.errorMessage ?: "登录失败,请检查账号密码")) } } catch (e: Exception) { Result.failure(e) } } private fun saveSession(profile: UserProfile) { prefs.edit() .putString("jwt_token", profile.token) .putString("user_id", profile.userId) .putString("full_name", profile.fullName) .putString("user_role", profile.role) .putString("tenant_id", profile.tenantId) .apply() } fun logout() { prefs.edit().clear().apply() } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/data/repository/NotificationRepository.kt ================================================================================ package com.classnotify.app.data.repository import com.classnotify.app.data.api.ClassNotifyApi import com.classnotify.app.data.api.SignalRManager import com.classnotify.app.data.model.AckReceiptDto import com.classnotify.app.data.model.ClassroomDto import com.classnotify.app.data.model.DeviceStatusDto import com.classnotify.app.data.model.NotificationRecordDto import com.classnotify.app.data.model.SendNotificationRequest import com.classnotify.app.data.model.SendNotificationResponse import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.withContext class NotificationRepository( private val api: ClassNotifyApi, private val signalRManager: SignalRManager ) { val ackEvents: SharedFlow = signalRManager.ackEvents val deviceStatusEvents: SharedFlow = signalRManager.deviceStatusEvents fun startSignalR(serverUrl: String, token: String) { signalRManager.connect(serverUrl, token) } fun stopSignalR() { signalRManager.disconnect() } suspend fun getTeacherClasses(): Result> = withContext(Dispatchers.IO) { try { val classes = api.getTeacherClasses() Result.success(classes) } catch (e: Exception) { Result.failure(e) } } suspend fun sendNotification(request: SendNotificationRequest): Result = withContext(Dispatchers.IO) { try { val res = api.sendNotification(request) if (res.success) { Result.success(res) } else { Result.failure(Exception(res.message ?: "发送失败")) } } catch (e: Exception) { Result.failure(e) } } suspend fun getHistory(classId: String? = null): Result> = withContext(Dispatchers.IO) { try { val history = api.getTeacherHistory(classId) Result.success(history) } catch (e: Exception) { Result.failure(e) } } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/MainActivity.kt ================================================================================ package com.classnotify.app import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import com.classnotify.app.ui.login.LoginScreen import com.classnotify.app.ui.login.LoginViewModel import com.classnotify.app.ui.teacher.TeacherMainScreen import com.classnotify.app.ui.teacher.TeacherViewModel import com.classnotify.app.ui.theme.ClassNotifyTheme import com.classnotify.app.ui.theme.Slate950 class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { ClassNotifyTheme { Surface( modifier = Modifier.fillMaxSize(), color = Slate950 ) { ClassNotifyNavigation() } } } } } @Composable fun ClassNotifyNavigation() { val navController = rememberNavController() val app = ClassNotifyApp.instance val isLoggedIn = app.authRepository.isLoggedIn() NavHost( navController = navController, startDestination = if (isLoggedIn) "teacher_main" else "login" ) { composable("login") { val loginViewModel = LoginViewModel(app.authRepository) LoginScreen( viewModel = loginViewModel, onLoginSuccess = { navController.navigate("teacher_main") { popUpTo("login") { inclusive = true } } } ) } composable("teacher_main") { val teacherViewModel = TeacherViewModel(app.authRepository, app.notificationRepository) TeacherMainScreen( viewModel = teacherViewModel, onLogout = { navController.navigate("login") { popUpTo("teacher_main") { inclusive = true } } } ) } } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/login/LoginScreen.kt ================================================================================ package com.classnotify.app.ui.login import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Lock import androidx.compose.material.icons.filled.Person import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.classnotify.app.data.model.UserProfile import com.classnotify.app.ui.theme.* @OptIn(ExperimentalMaterial3Api::class) @Composable fun LoginScreen( viewModel: LoginViewModel, onLoginSuccess: (UserProfile) -> Unit ) { val uiState by viewModel.uiState.collectAsState() var username by remember { mutableStateOf("") } var password by remember { mutableStateOf("") } LaunchedEffect(uiState) { if (uiState is LoginUiState.Success) { onLoginSuccess((uiState as LoginUiState.Success).profile) } } Box( modifier = Modifier .fillMaxSize() .background(Slate950) .padding(24.dp), contentAlignment = Alignment.Center ) { Card( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(24.dp), colors = CardDefaults.cardColors(containerColor = Slate900) ) { Column( modifier = Modifier .fillMaxWidth() .padding(28.dp), horizontalAlignment = Alignment.CenterHorizontally ) { // Header Logo Surface( modifier = Modifier.size(60.dp), shape = RoundedCornerShape(18.dp), color = Indigo600 ) { Box(contentAlignment = Alignment.Center) { Text(text = "🔔", fontSize = 28.sp) } } Spacer(modifier = Modifier.height(16.dp)) Text( text = "ClassNotify 教师端", color = Slate100, fontSize = 22.sp, fontWeight = FontWeight.Bold ) Text( text = "智慧教室即时点呼与通知", color = Slate400, fontSize = 13.sp, modifier = Modifier.padding(top = 4.dp) ) Spacer(modifier = Modifier.height(28.dp)) // Error Message if (uiState is LoginUiState.Error) { Surface( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(12.dp), color = Rose400.copy(alpha = 0.15f) ) { Text( text = (uiState as LoginUiState.Error).message, color = Rose400, fontSize = 12.sp, modifier = Modifier.padding(12.dp) ) } Spacer(modifier = Modifier.height(16.dp)) } // Username field OutlinedTextField( value = username, onValueChange = { username = it }, label = { Text("教师账号") }, leadingIcon = { Icon(Icons.Default.Person, contentDescription = null, tint = Slate400) }, modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(14.dp), colors = OutlinedTextFieldDefaults.colors( focusedTextColor = Slate100, unfocusedTextColor = Slate300, focusedBorderColor = Indigo500, unfocusedBorderColor = Slate700, focusedLabelColor = Indigo500, unfocusedLabelColor = Slate400 ), singleLine = true ) Spacer(modifier = Modifier.height(14.dp)) // Password field OutlinedTextField( value = password, onValueChange = { password = it }, label = { Text("登录密码") }, leadingIcon = { Icon(Icons.Default.Lock, contentDescription = null, tint = Slate400) }, visualTransformation = PasswordVisualTransformation(), modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(14.dp), colors = OutlinedTextFieldDefaults.colors( focusedTextColor = Slate100, unfocusedTextColor = Slate300, focusedBorderColor = Indigo500, unfocusedBorderColor = Slate700, focusedLabelColor = Indigo500, unfocusedLabelColor = Slate400 ), singleLine = true ) Spacer(modifier = Modifier.height(24.dp)) // Submit Button Button( onClick = { viewModel.login(username, password) }, modifier = Modifier .fillMaxWidth() .height(50.dp), shape = RoundedCornerShape(14.dp), colors = ButtonDefaults.buttonColors(containerColor = Indigo600), enabled = uiState !is LoginUiState.Loading ) { if (uiState is LoginUiState.Loading) { CircularProgressIndicator( modifier = Modifier.size(20.dp), color = Color.White, strokeWidth = 2.dp ) } else { Text(text = "登 录", fontWeight = FontWeight.SemiBold, fontSize = 15.sp) } } Spacer(modifier = Modifier.height(24.dp)) HorizontalDivider(color = Slate800) Spacer(modifier = Modifier.height(16.dp)) // Quick Login Button for testing OutlinedButton( onClick = { username = "teacher_zhang" password = "teacher123" viewModel.login("teacher_zhang", "teacher123") }, modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(12.dp), colors = ButtonDefaults.outlinedButtonColors(contentColor = Emerald400) ) { Text(text = "⚡ 快捷体验:张老师 (teacher_zhang)", fontSize = 12.sp) } } } } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/login/LoginViewModel.kt ================================================================================ package com.classnotify.app.ui.login import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.classnotify.app.data.model.UserProfile import com.classnotify.app.data.repository.AuthRepository import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch sealed class LoginUiState { object Idle : LoginUiState() object Loading : LoginUiState() data class Success(val profile: UserProfile) : LoginUiState() data class Error(val message: String) : LoginUiState() } class LoginViewModel(private val authRepository: AuthRepository) : ViewModel() { private val _uiState = MutableStateFlow(LoginUiState.Idle) val uiState: StateFlow = _uiState.asStateFlow() init { // Auto-login if session exists val current = authRepository.getUserProfile() if (current != null) { _uiState.value = LoginUiState.Success(current) } } fun login(username: String, pass: String) { if (username.isBlank() || pass.isBlank()) { _uiState.value = LoginUiState.Error("用户名与密码不可为空") return } viewModelScope.launch { _uiState.value = LoginUiState.Loading val result = authRepository.login(username.trim(), pass.trim()) result.onSuccess { profile -> _uiState.value = LoginUiState.Success(profile) }.onFailure { error -> _uiState.value = LoginUiState.Error(error.message ?: "登录失败,请检查网络或密码") } } } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/teacher/TeacherMainScreen.kt ================================================================================ package com.classnotify.app.ui.teacher import android.widget.Toast import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.* import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.classnotify.app.data.model.NotificationRecordDto import com.classnotify.app.ui.theme.* @OptIn(ExperimentalMaterial3Api::class) @Composable fun TeacherMainScreen( viewModel: TeacherViewModel, onLogout: () -> Unit ) { val context = LocalContext.current val userProfile by viewModel.userProfile.collectAsState() val classes by viewModel.classes.collectAsState() val selectedClassId by viewModel.selectedClassId.collectAsState() val history by viewModel.history.collectAsState() val isSending by viewModel.isSending.collectAsState() var studentName by remember { mutableStateOf("") } var message by remember { mutableStateOf("") } var voice by remember { mutableStateOf(true) } var shake by remember { mutableStateOf(true) } var isUrgent by remember { mutableStateOf(false) } var durationSeconds by remember { mutableStateOf(15) } val presets = listOf( "请带各科作业本到办公室", "马上到操场集合整队", "课代表请到教研室领试卷", "午休时间请教室内保持安静", "请班长负责维护自习纪律", "放学后值日生留下来打扫卫生" ) Scaffold( topBar = { TopAppBar( title = { Column { Text( text = "ClassNotify 教师端", fontSize = 17.sp, fontWeight = FontWeight.Bold, color = Slate100 ) Text( text = "${userProfile?.fullName ?: "老师"} · ${userProfile?.tenantId ?: "学校"}", fontSize = 11.sp, color = Slate400 ) } }, actions = { IconButton(onClick = { viewModel.logout() onLogout() }) { Icon(Icons.Default.ExitToApp, contentDescription = "退出", tint = Slate400) } }, colors = TopAppBarDefaults.topAppBarColors(containerColor = Slate950) ) }, containerColor = Slate950 ) { padding -> LazyColumn( modifier = Modifier .fillMaxSize() .padding(padding) .padding(horizontal = 16.dp), verticalArrangement = Arrangement.spacedBy(16.dp) ) { // Section 1: Class Selector item { Text( text = "1. 选择教学班级", color = Slate300, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, modifier = Modifier.padding(top = 8.dp, bottom = 4.dp) ) LazyRow( horizontalArrangement = Arrangement.spacedBy(10.dp) ) { items(classes) { c -> val isSelected = c.id == selectedClassId Card( modifier = Modifier .width(140.dp) .clickable { viewModel.selectClass(c.id) }, shape = RoundedCornerShape(14.dp), colors = CardDefaults.cardColors( containerColor = if (isSelected) Emerald500.copy(alpha = 0.15f) else Slate900 ), border = if (isSelected) androidx.compose.foundation.BorderStroke(1.5.dp, Emerald500) else androidx.compose.foundation.BorderStroke(1.dp, Slate800) ) { Column(modifier = Modifier.padding(12.dp)) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth() ) { Text( text = c.displayName, fontWeight = FontWeight.Bold, fontSize = 14.sp, color = if (isSelected) Slate100 else Slate300 ) // Live Online Status Dot Box( modifier = Modifier .size(8.dp) .background( color = if (c.isDeviceOnline) Emerald400 else Slate700, shape = CircleShape ) ) } Text( text = c.id, fontSize = 11.sp, color = Slate500, modifier = Modifier.padding(top = 2.dp) ) } } } } } // Section 2: Form (Student & Message) item { Card( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(20.dp), colors = CardDefaults.cardColors(containerColor = Slate900) ) { Column(modifier = Modifier.padding(16.dp)) { Text( text = "2. 呼叫内容", color = Slate300, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, modifier = Modifier.padding(bottom = 8.dp) ) // Student Name (Optional) OutlinedTextField( value = studentName, onValueChange = { studentName = it }, placeholder = { Text("呼叫指定学生姓名 (选填,留空则全班广播)", fontSize = 13.sp) }, leadingIcon = { Icon(Icons.Default.Person, contentDescription = null, tint = Slate400, modifier = Modifier.size(18.dp)) }, modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(12.dp), colors = OutlinedTextFieldDefaults.colors( focusedTextColor = Slate100, unfocusedTextColor = Slate300, focusedBorderColor = Indigo500, unfocusedBorderColor = Slate800, focusedContainerColor = Slate950, unfocusedContainerColor = Slate950 ), singleLine = true ) Spacer(modifier = Modifier.height(12.dp)) // Quick Presets Text( text = "快捷常用语:", color = Slate400, fontSize = 11.sp, modifier = Modifier.padding(bottom = 6.dp) ) LazyRow( horizontalArrangement = Arrangement.spacedBy(6.dp) ) { items(presets) { p -> Surface( modifier = Modifier.clickable { message = p }, shape = RoundedCornerShape(8.dp), color = Slate800 ) { Text( text = p, color = Slate300, fontSize = 11.sp, modifier = Modifier.padding(horizontal = 8.dp, vertical = 5.dp) ) } } } Spacer(modifier = Modifier.height(12.dp)) // Message Text OutlinedTextField( value = message, onValueChange = { message = it }, placeholder = { Text("输入要下发到大屏的通知内容...", fontSize = 13.sp) }, modifier = Modifier .fillMaxWidth() .height(90.dp), shape = RoundedCornerShape(12.dp), colors = OutlinedTextFieldDefaults.colors( focusedTextColor = Slate100, unfocusedTextColor = Slate300, focusedBorderColor = Indigo500, unfocusedBorderColor = Slate800, focusedContainerColor = Slate950, unfocusedContainerColor = Slate950 ) ) Spacer(modifier = Modifier.height(14.dp)) // Control Switches Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { // TTS Switch Row(verticalAlignment = Alignment.CenterVertically) { Switch( checked = voice, onCheckedChange = { voice = it }, colors = SwitchDefaults.colors(checkedThumbColor = Emerald400, checkedTrackColor = Emerald500.copy(alpha = 0.3f)) ) Spacer(modifier = Modifier.width(4.dp)) Text("语音朗读", color = Slate300, fontSize = 12.sp) } // Shake Switch Row(verticalAlignment = Alignment.CenterVertically) { Switch( checked = shake, onCheckedChange = { shake = it }, colors = SwitchDefaults.colors(checkedThumbColor = Indigo500, checkedTrackColor = Indigo600.copy(alpha = 0.3f)) ) Spacer(modifier = Modifier.width(4.dp)) Text("窗口震颤", color = Slate300, fontSize = 12.sp) } // Urgent Switch Row(verticalAlignment = Alignment.CenterVertically) { Switch( checked = isUrgent, onCheckedChange = { isUrgent = it }, colors = SwitchDefaults.colors(checkedThumbColor = Rose400, checkedTrackColor = Rose400.copy(alpha = 0.3f)) ) Spacer(modifier = Modifier.width(4.dp)) Text("置顶紧急", color = Slate300, fontSize = 12.sp) } } Spacer(modifier = Modifier.height(16.dp)) // Submit Button Button( onClick = { viewModel.sendNotification( studentName = studentName, message = message, voice = voice, shake = shake, isUrgent = isUrgent, durationSeconds = durationSeconds, onSuccess = { message = "" studentName = "" Toast.makeText(context, "已成功下发至教室大屏!", Toast.LENGTH_SHORT).show() }, onError = { err -> Toast.makeText(context, err, Toast.LENGTH_LONG).show() } ) }, modifier = Modifier .fillMaxWidth() .height(48.dp), shape = RoundedCornerShape(12.dp), colors = ButtonDefaults.buttonColors(containerColor = Emerald500), enabled = !isSending && selectedClassId.isNotEmpty() && message.isNotBlank() ) { if (isSending) { CircularProgressIndicator( modifier = Modifier.size(18.dp), color = Color.White, strokeWidth = 2.dp ) } else { Icon(Icons.Default.Send, contentDescription = null, modifier = Modifier.size(16.dp)) Spacer(modifier = Modifier.width(6.dp)) Text("下发到教室大屏", fontWeight = FontWeight.SemiBold, fontSize = 14.sp) } } } } } // Section 3: Live ACK Timeline item { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth().padding(top = 4.dp) ) { Text( text = "3. 实时回执动态 (ACK)", color = Slate300, fontSize = 13.sp, fontWeight = FontWeight.SemiBold ) Text( text = "SignalR 毫秒级同步", color = Slate500, fontSize = 10.sp ) } } if (history.isEmpty()) { item { Box( modifier = Modifier .fillMaxWidth() .padding(vertical = 32.dp), contentAlignment = Alignment.Center ) { Text("暂无呼叫记录", color = Slate500, fontSize = 12.sp) } } } else { items(history) { item -> NotificationAckCard(item) } } } } } @Composable fun NotificationAckCard(item: NotificationRecordDto) { Card( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(16.dp), colors = CardDefaults.cardColors(containerColor = Slate900), border = androidx.compose.foundation.BorderStroke(1.dp, Slate800) ) { Column(modifier = Modifier.padding(14.dp)) { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Text( text = item.className, fontWeight = FontWeight.Bold, fontSize = 14.sp, color = Slate100 ) Text( text = item.createdAt.takeLast(8), fontSize = 11.sp, color = Slate500 ) } Text( text = item.message, fontSize = 12.sp, color = Slate300, modifier = Modifier.padding(vertical = 6.dp) ) HorizontalDivider(color = Slate800.copy(alpha = 0.6f), modifier = Modifier.padding(vertical = 4.dp)) Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Text( text = "回执状态:", fontSize = 11.sp, color = Slate400 ) when (item.status) { "Acknowledged" -> { Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Default.CheckCircle, contentDescription = null, tint = Emerald400, modifier = Modifier.size(14.dp)) Spacer(modifier = Modifier.width(4.dp)) Text("学生已点击确认", color = Emerald400, fontSize = 11.sp, fontWeight = FontWeight.SemiBold) } } "Delivered" -> { Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Default.Send, contentDescription = null, tint = Sky400, modifier = Modifier.size(14.dp)) Spacer(modifier = Modifier.width(4.dp)) Text("教室大屏已接收", color = Sky400, fontSize = 11.sp, fontWeight = FontWeight.Medium) } } "Timeout" -> { Text("超时自动关闭", color = Slate500, fontSize = 11.sp) } else -> { Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Default.Refresh, contentDescription = null, tint = Amber400, modifier = Modifier.size(14.dp)) Spacer(modifier = Modifier.width(4.dp)) Text("云端下发中...", color = Amber400, fontSize = 11.sp) } } } } } } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/teacher/TeacherViewModel.kt ================================================================================ package com.classnotify.app.ui.teacher import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.classnotify.app.ClassNotifyApp import com.classnotify.app.data.model.ClassroomDto import com.classnotify.app.data.model.NotificationRecordDto import com.classnotify.app.data.model.SendNotificationRequest import com.classnotify.app.data.model.UserProfile import com.classnotify.app.data.repository.AuthRepository import com.classnotify.app.data.repository.NotificationRepository import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch class TeacherViewModel( private val authRepository: AuthRepository, private val notificationRepository: NotificationRepository ) : ViewModel() { private val _classes = MutableStateFlow>(emptyList()) val classes: StateFlow> = _classes.asStateFlow() private val _selectedClassId = MutableStateFlow("") val selectedClassId: StateFlow = _selectedClassId.asStateFlow() private val _history = MutableStateFlow>(emptyList()) val history: StateFlow> = _history.asStateFlow() private val _isSending = MutableStateFlow(false) val isSending: StateFlow = _isSending.asStateFlow() private val _userProfile = MutableStateFlow(authRepository.getUserProfile()) val userProfile: StateFlow = _userProfile.asStateFlow() init { loadData() startSignalR() listenSignalREvents() } private fun loadData() { viewModelScope.launch { // Load classes val classResult = notificationRepository.getTeacherClasses() classResult.onSuccess { list -> _classes.value = list if (list.isNotEmpty() && _selectedClassId.value.isEmpty()) { _selectedClassId.value = list.first().id } } // Load history val histResult = notificationRepository.getHistory() histResult.onSuccess { _history.value = it } } } private fun startSignalR() { val token = authRepository.getToken() ?: return notificationRepository.startSignalR(ClassNotifyApp.BASE_SERVER_URL, token) } private fun listenSignalREvents() { // 1. Listen for real-time ACK updates viewModelScope.launch { notificationRepository.ackEvents.collect { ack -> val currentList = _history.value.toMutableList() val idx = currentList.indexOfFirst { it.id == ack.messageId } if (idx != -1) { val statusText = when (ack.status) { 1 -> "Delivered" 2 -> "Acknowledged" 3 -> "Timeout" else -> "Sent" } val updated = currentList[idx].copy( status = statusText, confirmedAt = if (ack.status == 2) ack.timestamp else currentList[idx].confirmedAt ) currentList[idx] = updated _history.value = currentList } } } // 2. Listen for device online/offline status updates viewModelScope.launch { notificationRepository.deviceStatusEvents.collect { status -> val currentClasses = _classes.value.toMutableList() val idx = currentClasses.indexOfFirst { it.id == status.classId } if (idx != -1) { val updated = currentClasses[idx].copy(isDeviceOnline = status.isOnline) currentClasses[idx] = updated _classes.value = currentClasses } } } } fun selectClass(classId: String) { _selectedClassId.value = classId } fun sendNotification( studentName: String?, message: String, voice: Boolean, shake: Boolean, isUrgent: Boolean, durationSeconds: Int, onSuccess: () -> Unit, onError: (String) -> Unit ) { val classId = _selectedClassId.value if (classId.isEmpty() || message.isBlank()) { onError("请选择班级并输入通知内容") return } val targetClass = _classes.value.find { it.id == classId } val title = if (!studentName.isNullOrBlank()) { "🔔 老师呼叫: ${studentName.trim()}" } else { "📢 ${targetClass?.displayName ?: "班级"}通知" } viewModelScope.launch { _isSending.value = true val request = SendNotificationRequest( classId = classId, studentName = studentName?.takeIf { it.isNotBlank() }, title = title, message = message.trim(), type = if (isUrgent) 2 else 0, voice = voice, shake = shake, durationSeconds = durationSeconds ) val result = notificationRepository.sendNotification(request) _isSending.value = false result.onSuccess { res -> // Prepend to local history val newRecord = NotificationRecordDto( id = res.messageId ?: "msg_${System.currentTimeMillis()}", tenantId = res.tenantId ?: "", classId = classId, className = targetClass?.displayName ?: classId, senderName = _userProfile.value?.fullName ?: "我", message = message.trim(), priority = if (isUrgent) "Urgent" else "Normal", createdAt = java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", java.util.Locale.getDefault()).format(java.util.Date()), status = "Sent" ) _history.value = listOf(newRecord) + _history.value onSuccess() }.onFailure { err -> onError(err.message ?: "下发失败,请重试") } } } fun logout() { notificationRepository.stopSignalR() authRepository.logout() } override fun onCleared() { super.onCleared() notificationRepository.stopSignalR() } } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/theme/Color.kt ================================================================================ package com.classnotify.app.ui.theme import androidx.compose.ui.graphics.Color val Slate950 = Color(0xFF020617) val Slate900 = Color(0xFF0F172A) val Slate800 = Color(0xFF1E293B) val Slate700 = Color(0xFF334155) val Slate400 = Color(0xFF94A3B8) val Slate300 = Color(0xFFCBD5E1) val Slate100 = Color(0xFFF1F5F9) val Indigo500 = Color(0xFF6366F1) val Indigo600 = Color(0xFF4F46E5) val Violet500 = Color(0xFF8B5CF6) val Emerald400 = Color(0xFF34D399) val Emerald500 = Color(0xFF10B981) val Sky400 = Color(0xFF38BDF8) val Amber400 = Color(0xFFFBBF24) val Rose400 = Color(0xFFFB7185) ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/java/com/classnotify/app/ui/theme/Theme.kt ================================================================================ package com.classnotify.app.ui.theme import android.app.Activity import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.MaterialTheme import androidx.compose.material3.darkColorScheme import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalView import androidx.core.view.WindowCompat private val DarkColorScheme = darkColorScheme( primary = Indigo500, secondary = Violet500, background = Slate950, surface = Slate900, onPrimary = Slate100, onSecondary = Slate100, onBackground = Slate100, onSurface = Slate100, ) @Composable fun ClassNotifyTheme( darkTheme: Boolean = true, // Default to dark theme for professional console look content: @Composable () -> Unit ) { val colorScheme = DarkColorScheme val view = LocalView.current if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window window.statusBarColor = Slate950.toArgb() WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = false } } MaterialTheme( colorScheme = colorScheme, content = content ) } ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/drawable/ic_launcher_foreground.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/mipmap/ic_launcher.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/mipmap/ic_launcher_round.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/values/colors.xml ================================================================================ #2563EB ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/values/strings.xml ================================================================================ ClassNotify ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/values/themes.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/xml/backup_rules.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/app/src/main/res/xml/data_extraction_rules.xml ================================================================================ ================================================================================ FILE: src/Android/ClassNotify.Android/build.gradle.kts ================================================================================ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id("com.android.application") version "8.3.2" apply false id("org.jetbrains.kotlin.android") version "1.9.23" apply false } ================================================================================ FILE: src/Android/ClassNotify.Android/gradle.properties ================================================================================ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 android.useAndroidX=true android.nonTransitiveRClass=true kotlin.code.style=official ================================================================================ FILE: src/Android/ClassNotify.Android/gradle/wrapper/gradle-wrapper.properties ================================================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================================================ FILE: src/Android/ClassNotify.Android/gradlew ================================================================================ #!/bin/sh # # Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################################## # # Gradle start up script for POSIX generated by Gradle. # # Important for running: # # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is # noncompliant, but you have some other compliant shell such as ksh or # bash, then to run this script, type that shell name before the whole # command line, like: # # ksh Gradle # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # «${var#prefix}», «${var%suffix}», and «$( cmd )»; # * compound commands having a testable exit status, especially «case»; # * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # # (2) This script targets any POSIX shell, so it avoids extensions provided # by Bash, Ksh, etc; in particular arrays are avoided. # # The "traditional" practice of packing multiple parameters into a # space-separated string is a well documented source of bugs and security # problems, so this is (mostly) avoided, by progressively accumulating # options in "$@", and eventually passing that to Java. # # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; # see the in-line comments for details. # # There are tweaks for specific operating systems such as AIX, CygWin, # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. # ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link app_path=$0 # Need this for daisy-chained symlinks. while APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path [ -h "$app_path" ] do ls=$( ls -ld "$app_path" ) link=${ls#*' -> '} case $link in #( /*) app_path=$link ;; #( *) app_path=$APP_HOME$link ;; esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { echo "$*" } >&2 die () { echo echo "$*" echo exit 1 } >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "$( uname )" in #( CYGWIN* ) cygwin=true ;; #( Darwin* ) darwin=true ;; #( MSYS* | MINGW* ) msys=true ;; #( NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD=$JAVA_HOME/jre/sh/java else JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD=java if ! command -v java >/dev/null 2>&1 then die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi # Collect all arguments for the java command, stacking in reverse order: # * args from the command line # * the main class name # * -classpath # * -D...appname settings # * --module-path (only if needed) # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) # Now convert the arguments - kludge to limit ourselves to /bin/sh for arg do if case $arg in #( -*) false ;; # don't mess with options #( /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath [ -e "$t" ] ;; #( *) false ;; esac then arg=$( cygpath --path --ignore --mixed "$arg" ) fi # Roll the args list around exactly as many times as the number of # args, so each arg winds up back in the position where it started, but # possibly modified. # # NB: a `for` loop captures its iteration list before it begins, so # changing the positional parameters here affects neither the number of # iterations, nor the values presented in `arg`. shift # remove old arg set -- "$@" "$arg" # push replacement arg done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ org.gradle.wrapper.GradleWrapperMain \ "$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then die "xargs is not available" fi # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. # # In Bash we could simply go: # # readarray ARGS < <( xargs -n1 <<<"$var" ) && # set -- "${ARGS[@]}" "$@" # # but POSIX shell has neither arrays nor command substitution, so instead we # post-process each arg (as a line of input to sed) to backslash-escape any # character that might be a shell metacharacter, then use eval to reverse # that process (while maintaining the separation between arguments), and wrap # the whole thing up as a single "set" statement. # # This will of course break if any of these variables contains a newline or # an unmatched quote. # eval "set -- $( printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | xargs -n1 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | tr '\n' ' ' )" '"$@"' exec "$JAVACMD" "$@" ================================================================================ FILE: src/Android/ClassNotify.Android/gradlew.bat ================================================================================ @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Resolve any "." and ".." in APP_HOME to make it shorter. for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! set EXIT_CODE=%ERRORLEVEL% if %EXIT_CODE% equ 0 set EXIT_CODE=1 if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================================================ FILE: src/Android/ClassNotify.Android/README.md ================================================================================ # ClassNotify Android 教师端应用 采用 **Kotlin + Jetpack Compose + Material 3** 原生开发,直连东京云端服务器(`https://classnotify.paradise.eu.org`)。 --- ## 🌟 核心功能特性 1. **登录与会话保持**: - 教师工号 + 密码鉴权,JWT 自动持久化存储,下次启动免登录。 - 内置 **“⚡ 快捷体验:张老师”** 一键填充与登录。 2. **班级看板与实时硬件状态**: - 横向滑动查看所带班级(八年级(1)班、八年级(2)班等)。 - **教室大屏硬件实时状态指示灯**(🟢 在线 / 🔴 离线),由 SignalR WebSocket 毫秒级动态推送。 3. **呼叫表单与高频短语**: - 支持呼叫指定学生姓名(选填),留空则全班广播。 - 常用快捷短语标签一键填入(“请带作业本到办公室”、“马上到操场集合”等)。 - 控制开关:TTS 语音朗读、窗口震颤、置顶紧急广播、倒计时时长。 4. **实时回执时间线 (ACK)**: - 直连云端 `SignalR`(`com.microsoft.signalr:signalr:8.0.0`),长连接监听回执事件。 - 毫秒级动态展示: - `云端下发中...`(Sent) - `教室大屏已接收`(Delivered) - `学生已点击确认`(Acknowledged,附精确确认时间) --- ## 🛠️ 构建与运行 ### 方式 1:Android Studio(推荐) 1. 使用 **Android Studio Hedgehog (2023.1.1)** 或更高版本打开目录: `src/Android/ClassNotify.Android` 2. 等待 Gradle Sync 完成。 3. 连接 Android 真机(开启 USB 调试)或启动 Android 模拟器。 4. 点击 **Run 'app'** 即可直接在手机上运行调试。 5. 生成发布版 APK:点击菜单 **Build > Build Bundle(s) / APK(s) > Build APK(s)**。 ### 方式 2:命令行构建(需 JDK 17+ 和 Android SDK) ```bash cd src/Android/ClassNotify.Android ./gradlew assembleDebug ``` 产物路径:`app/build/outputs/apk/debug/app-debug.apk`。 ================================================================================ FILE: src/Android/ClassNotify.Android/settings.gradle.kts ================================================================================ pluginManagement { repositories { google { content { includeGroupByRegex("com\\.android.*") includeGroupByRegex("com\\.google.*") includeGroupByRegex("androidx.*") } } mavenCentral() gradlePluginPortal() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() } } rootProject.name = "ClassNotify" include(":app") ================================================================================ FILE: src/Scripts/Install-ClassNotify.ps1 ================================================================================ # Install-ClassNotify.ps1 - Enterprise Windows Service Installer # Installs ClassNotify.Service as a Windows Service with automatic failure recovery. param( [string]$ClassId = "801", [string]$ClassName = "八年级(1)班", [string]$ServerUrl = "https://notice.yourdomain.com/hubs/device", [string]$DeviceToken = "device_secret_token_801" ) # Ensure running as Administrator if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Error "请以管理员身份运行此脚本!(Run as Administrator)" exit 1 } Write-Host "=========================================" -ForegroundColor Cyan Write-Host " ClassNotify V2.0 商业级客户端部署程序 " -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan $InstallDir = "C:\ProgramData\ClassNotify" $SourceDir = Split-Path -Parent $MyInvocation.MyCommand.Path # 1. Prepare Directory Write-Host "[1/5] 创建企业级安装目录: $InstallDir ..." -ForegroundColor Yellow if (-not (Test-Path $InstallDir)) { New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null } $logDir = Join-Path $InstallDir "logs" if (-not (Test-Path $logDir)) { New-Item -ItemType Directory -Force -Path $logDir | Out-Null } # 2. Copy Binaries Write-Host "[2/5] 部署服务与客户端二进制文件..." -ForegroundColor Yellow $binaries = @("ClassNotify.Service.exe", "ClassNotify.Client.exe", "ClassNotify.Shared.dll") foreach ($bin in $binaries) { $src = Join-Path $SourceDir $bin if (Test-Path $src) { Copy-Item -Path $src -Destination $InstallDir -Force } } # 3. Generate AppSettings Write-Host "[3/5] 写入服务配置 appsettings.json..." -ForegroundColor Yellow $configObj = @{ Logging = @{ LogLevel = @{ Default = "Information" "Microsoft.Hosting.Lifetime" = "Information" } } ClassNotify = @{ ServerUrl = $ServerUrl ClassId = $ClassId ClassName = $ClassName DeviceToken = $DeviceToken HeartbeatIntervalSeconds = 15 PipeName = "ClassNotify_Ipc_Pipe" } } $configPath = Join-Path $InstallDir "appsettings.json" $configObj | ConvertTo-Json -Depth 5 | Set-Content -Path $configPath -Encoding UTF8 # 4. Register Windows Service & Failure Recovery Write-Host "[4/5] 注册 Windows Service (ClassNotifyService)..." -ForegroundColor Yellow $serviceExe = Join-Path $InstallDir "ClassNotify.Service.exe" $existingService = Get-Service -Name "ClassNotifyService" -ErrorAction SilentlyContinue if ($existingService) { Stop-Service -Name "ClassNotifyService" -Force -ErrorAction SilentlyContinue sc.exe delete ClassNotifyService | Out-Null Start-Sleep -Seconds 1 } sc.exe create ClassNotifyService binPath= "`"$serviceExe`"" start= auto DisplayName= "ClassNotify 班级实时通信服务" | Out-Null # Set 3-tier failure recovery policy: restart service after 60s sc.exe failure ClassNotifyService reset= 86400 actions= restart/60000/restart/60000/restart/60000 | Out-Null # 5. Register User Interactive UI Task $uiExe = Join-Path $InstallDir "ClassNotify.Client.exe" $taskName = "ClassNotify_Client_UI" cmd /c "schtasks /create /tn `"$taskName`" /tr `"$uiExe`" /sc onlogon /f" 2>$null # Start Service Write-Host "[5/5] 启动 ClassNotify 核心守护服务..." -ForegroundColor Yellow Start-Service -Name "ClassNotifyService" -ErrorAction SilentlyContinue Write-Host "`n=========================================" -ForegroundColor Green Write-Host " [成功] ClassNotify V2.0 商业级部署完成!" -ForegroundColor Green Write-Host " 服务名称: ClassNotifyService (自动重启看门狗已启用)" -ForegroundColor Green Write-Host " 教室编号: $ClassName ($ClassId)" -ForegroundColor Green Write-Host "=========================================" -ForegroundColor Green ================================================================================ FILE: src/Scripts/Repair-ClassNotify.ps1 ================================================================================ # Repair-ClassNotify.ps1 - One-click enterprise diagnosis & self-healing script if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Error "请以管理员身份运行此脚本!(Run as Administrator)" exit 1 } Write-Host "=========================================" -ForegroundColor Cyan Write-Host " ClassNotify 一键自动化诊断与修复工具 " -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan $InstallDir = "C:\ProgramData\ClassNotify" $configPath = Join-Path $InstallDir "appsettings.json" # 1. Check Service Write-Host "[1/4] 检查 Windows 服务状态..." -ForegroundColor Yellow $svc = Get-Service -Name "ClassNotifyService" -ErrorAction SilentlyContinue if (-not $svc) { Write-Host " [警告] ClassNotifyService 未安装,正在尝试重新注册..." -ForegroundColor Red $serviceExe = Join-Path $InstallDir "ClassNotify.Service.exe" if (Test-Path $serviceExe) { sc.exe create ClassNotifyService binPath= "`"$serviceExe`"" start= auto DisplayName= "ClassNotify 班级实时通信服务" | Out-Null sc.exe failure ClassNotifyService reset= 86400 actions= restart/60000/restart/60000/restart/60000 | Out-Null Start-Service -Name "ClassNotifyService" Write-Host " [恢复] 服务已重新注册并启动!" -ForegroundColor Green } } elseif ($svc.Status -ne "Running") { Write-Host " [警告] 服务当前处于停止状态 ($($svc.Status)),正在强制重启..." -ForegroundColor Yellow Restart-Service -Name "ClassNotifyService" -Force Write-Host " [恢复] 服务已重新启动!" -ForegroundColor Green } else { Write-Host " [正常] ClassNotifyService 运行正常。" -ForegroundColor Green } # 2. Check UI Process Write-Host "[2/4] 检查前台 UI 进程..." -ForegroundColor Yellow $uiProc = Get-Process -Name "ClassNotify.Client" -ErrorAction SilentlyContinue if (-not $uiProc) { Write-Host " [提示] 前台 UI 进程未运行,正在唤醒..." -ForegroundColor Yellow $uiExe = Join-Path $InstallDir "ClassNotify.Client.exe" if (Test-Path $uiExe) { Start-Process -FilePath $uiExe Write-Host " [恢复] 前台 UI 进程已启动!" -ForegroundColor Green } } else { Write-Host " [正常] 前台 UI 进程运行正常。" -ForegroundColor Green } # 3. Check Network & SignalR Write-Host "[3/4] 检查云端连通性..." -ForegroundColor Yellow if (Test-Path $configPath) { try { $cfg = Get-Content -Path $configPath -Raw | ConvertFrom-Json $serverUrl = $cfg.ClassNotify.ServerUrl $uri = [System.Uri]$serverUrl $ip = [System.Net.Dns]::GetHostAddresses($uri.DnsSafeHost) if ($ip.Length -gt 0) { Write-Host " [正常] 云端域名解析成功 ($($uri.DnsSafeHost) -> $($ip[0]))" -ForegroundColor Green } } catch { Write-Host " [警告] 云端解析异常: $_" -ForegroundColor Red } } # 4. Check TTS Sound Engine Write-Host "[4/4] 测试本地 TTS 中文语音引擎..." -ForegroundColor Yellow try { Add-Type -AssemblyName System.Speech -ErrorAction Stop $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer $voices = $synth.GetInstalledVoices() if ($voices.Count -gt 0) { Write-Host " [正常] 发现 $($voices.Count) 个系统语音包,TTS 引擎就绪。" -ForegroundColor Green } $synth.Dispose() } catch { Write-Host " [警告] TTS 引擎初始化失败: $_" -ForegroundColor Red } Write-Host "`n[诊断完成] 核心组件与自愈排错流程已执行完毕。" -ForegroundColor Cyan ================================================================================ FILE: src/Scripts/SelfCheck.ps1 ================================================================================ # SelfCheck.ps1 - Detailed environment diagnostic tool $InstallDir = "C:\ProgramData\ClassNotify" $configPath = Join-Path $InstallDir "appsettings.json" Write-Host "=========================================" -ForegroundColor Cyan Write-Host " ClassNotify 运行环境与组件健康自检 " -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan $report = [PSCustomObject]@{ WindowsService = "Missing" UiProcess = "Stopped" ConfigValid = (Test-Path $configPath) TtsAvailable = $false DnsResolution = $false } # 1. Service $svc = Get-Service -Name "ClassNotifyService" -ErrorAction SilentlyContinue if ($svc) { $report.WindowsService = $svc.Status.ToString() } # 2. UI Process $proc = Get-Process -Name "ClassNotify.Client" -ErrorAction SilentlyContinue if ($proc) { $report.UiProcess = "Running" } # 3. TTS try { Add-Type -AssemblyName System.Speech -ErrorAction Stop $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer if ($synth.GetInstalledVoices().Count -gt 0) { $report.TtsAvailable = $true } $synth.Dispose() } catch {} # 4. Network DNS if (Test-Path $configPath) { try { $cfg = Get-Content -Path $configPath -Raw | ConvertFrom-Json $uri = [System.Uri]$cfg.ClassNotify.ServerUrl if ([System.Net.Dns]::GetHostAddresses($uri.DnsSafeHost).Length -gt 0) { $report.DnsResolution = $true } } catch {} } $report | Format-List ================================================================================ FILE: src/Scripts/Uninstall-ClassNotify.ps1 ================================================================================ # Uninstall-ClassNotify.ps1 - Clean enterprise uninstaller if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Error "请以管理员身份运行此脚本!(Run as Administrator)" exit 1 } Write-Host "正在停止并清理 ClassNotifyService..." -ForegroundColor Yellow Stop-Service -Name "ClassNotifyService" -Force -ErrorAction SilentlyContinue sc.exe delete ClassNotifyService | Out-Null Write-Host "正在停止前台 UI 进程..." -ForegroundColor Yellow Stop-Process -Name "ClassNotify.Client" -Force -ErrorAction SilentlyContinue Write-Host "清理计划任务..." -ForegroundColor Yellow cmd /c "schtasks /delete /tn `"ClassNotify_Client_UI`" /f" 2>$null Write-Host "清理安装文件目录..." -ForegroundColor Yellow $InstallDir = "C:\ProgramData\ClassNotify" if (Test-Path $InstallDir) { Remove-Item -Path $InstallDir -Recurse -Force -ErrorAction SilentlyContinue } Write-Host "ClassNotify 商业级组件已彻底卸载干净。" -ForegroundColor Green ================================================================================ FILE: src/Server/Caddyfile ================================================================================ # Caddyfile - Production reverse proxy for ClassNotify on Linux # Caddy automatically handles HTTPS provisioning, renewal, and WebSocket tunneling. notify.yourdomain.com { reverse_proxy 127.0.0.1:5000 { header_up Host {host} header_up X-Real-IP {remote_host} } } ================================================================================ FILE: src/Server/ClassNotify.Server/ClassNotify.Server.csproj ================================================================================ net8.0 enable enable ================================================================================ FILE: src/Server/ClassNotify.Server/Controllers/AdminController.cs ================================================================================ using ClassNotify.Server.Hubs; using ClassNotify.Server.Services; using ClassNotify.Shared.Contracts; using ClassNotify.Shared.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; namespace ClassNotify.Server.Controllers; [ApiController] [Route("api/[controller]")] [Authorize(Roles = "SuperAdmin")] public class AdminController : ControllerBase { private readonly ISecurityService _securityService; private readonly IHubContext _deviceHub; private readonly ILogger _logger; public AdminController( ISecurityService securityService, IHubContext deviceHub, ILogger logger) { _securityService = securityService; _deviceHub = deviceHub; _logger = logger; } /// /// 获取平台总体运行指标 /// [HttpGet("metrics")] public async Task GetMetrics() { var metrics = await _securityService.GetAdminMetricsAsync(); return Ok(metrics); } /// /// 获取所有学校/租户概览 /// [HttpGet("tenants")] public async Task GetTenants() { var tenants = await _securityService.GetTenantsOverviewAsync(); return Ok(tenants); } /// /// 获取全网所有设备及其在线状态、心跳、版本 /// [HttpGet("devices")] public async Task GetDevices() { var devices = await _securityService.GetAllDevicesAsync(); return Ok(devices); } /// /// 向指定设备下发远程维护指令 (ping, restart_client, refresh_config) /// [HttpPost("devices/{deviceId}/command")] public async Task SendDeviceCommand(string deviceId, [FromBody] RemoteCommandRequestDto req) { if (string.IsNullOrWhiteSpace(deviceId) || string.IsNullOrWhiteSpace(req.Command)) { return BadRequest(new { success = false, message = "设备编号与指令内容不可为空" }); } var connId = _securityService.GetDeviceConnectionId(deviceId); if (string.IsNullOrEmpty(connId)) { return BadRequest(new { success = false, message = "该设备当前未在线,无法执行远程指令" }); } _logger.LogInformation("Admin dispatched remote command '{Command}' to device {DeviceId} ({ConnId})", req.Command, deviceId, connId); await _deviceHub.Clients.Client(connId).ReceiveRemoteCommand(req.Command, req.Parameters); return Ok(new { success = true, deviceId, command = req.Command, message = $"远程指令 [{req.Command}] 已通过 SignalR 毫秒级下发至设备" }); } /// /// 获取全网激活码列表 /// [HttpGet("activation-codes")] public async Task GetActivationCodes() { var codes = await _securityService.GetActivationCodesAsync(null); return Ok(codes); } /// /// 超级管理员直接生成指定学校指定班级的激活码 /// [HttpPost("activation-codes")] public async Task GenerateActivationCode([FromQuery] string tenantId, [FromQuery] string classId) { if (string.IsNullOrWhiteSpace(tenantId) || string.IsNullOrWhiteSpace(classId)) { return BadRequest(new { success = false, message = "租户与班级不可为空" }); } var code = await _securityService.GenerateActivationCodeAsync(tenantId, classId); return Ok(new { success = true, code, tenantId, classId, message = "激活码生成成功" }); } /// /// 获取全平台最新通知历史记录与 ACK /// [HttpGet("notifications")] public IActionResult GetNotifications([FromQuery] int limit = 50) { var list = _securityService.GetNotifications(null, null, limit); return Ok(list); } } ================================================================================ FILE: src/Server/ClassNotify.Server/Controllers/AuthController.cs ================================================================================ using System.Security.Claims; using ClassNotify.Server.Services; using ClassNotify.Shared.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; namespace ClassNotify.Server.Controllers; [ApiController] [Route("api/[controller]")] [EnableRateLimiting("AuthLimiter")] public class AuthController : ControllerBase { private readonly ISecurityService _securityService; public AuthController(ISecurityService securityService) { _securityService = securityService; } /// /// 统一登录接口 (返回包含 Role / TenantId 的 JWT Token) /// [HttpPost("login")] public async Task Login([FromBody] TeacherLoginDto dto) { var result = await _securityService.LoginTeacherAsync(dto); if (!result.Success) { return Unauthorized(result); } return Ok(result); } /// /// 获取当前登录用户画像与角色 /// [HttpGet("me")] [Authorize] public IActionResult GetMe() { return Ok(new { userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value, name = User.FindFirst(ClaimTypes.Name)?.Value, role = User.FindFirst(ClaimTypes.Role)?.Value, tenantId = User.FindFirst("tenant_id")?.Value }); } } ================================================================================ FILE: src/Server/ClassNotify.Server/Controllers/DeviceController.cs ================================================================================ using ClassNotify.Server.Services; using ClassNotify.Shared.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; namespace ClassNotify.Server.Controllers; [ApiController] [Route("api/[controller]")] [EnableRateLimiting("ActivationLimiter")] public class DeviceController : ControllerBase { private readonly ISecurityService _securityService; public DeviceController(ISecurityService securityService) { _securityService = securityService; } /// /// 教室端初次安装激活接口 (通过一次性激活码换取永久硬件凭据) /// [HttpPost("activate")] public async Task Activate([FromBody] DeviceActivationRequestDto dto) { var result = await _securityService.ActivateDeviceAsync(dto); if (!result.Success) { return BadRequest(result); } return Ok(result); } /// /// 学校教师/管理员在线生成班级一次性设备激活码 /// [HttpPost("generate-code")] [Microsoft.AspNetCore.Authorization.Authorize(Roles = "SuperAdmin,SchoolAdmin")] public async Task GenerateCode([FromQuery] string classId) { var tenantId = User.FindFirst("tenant_id")?.Value; if (string.IsNullOrEmpty(tenantId)) { return Unauthorized(new { success = false, message = "未发现合法的租户信息" }); } if (string.IsNullOrWhiteSpace(classId)) { return BadRequest(new { success = false, message = "班级编号不可为空" }); } var classroom = await _securityService.GetClassroomAsync(tenantId, classId); if (classroom == null) { return NotFound(new { success = false, message = $"班级 {classId} 不存在或不属于当前学校" }); } try { var code = await _securityService.GenerateActivationCodeAsync(tenantId, classId); return Ok(new { success = true, code, tenantId, classId, message = "激活码已生成,有效期 7 天" }); } catch (Exception ex) { return BadRequest(new { success = false, message = ex.Message }); } } } ================================================================================ FILE: src/Server/ClassNotify.Server/Controllers/NotificationController.cs ================================================================================ using System.Security.Claims; using ClassNotify.Server.Hubs; using ClassNotify.Server.Services; using ClassNotify.Shared.Contracts; using ClassNotify.Shared.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; using Microsoft.AspNetCore.SignalR; namespace ClassNotify.Server.Controllers; [ApiController] [Route("api/[controller]")] [Authorize] [EnableRateLimiting("SendLimiter")] public class NotificationController : ControllerBase { private readonly IHubContext _deviceHubContext; private readonly IHubContext _teacherHubContext; private readonly ISecurityService _securityService; private readonly ILogger _logger; public NotificationController( IHubContext deviceHubContext, IHubContext teacherHubContext, ISecurityService securityService, ILogger logger) { _deviceHubContext = deviceHubContext; _teacherHubContext = teacherHubContext; _securityService = securityService; _logger = logger; } /// /// 教师向指定班级下发呼叫通知 (严格校验租户与班级权限) /// [HttpPost("send")] public async Task SendNotification([FromBody] NotificationDto notification) { // 1. Extract and validate tenant from authenticated teacher claims var teacherTenantId = User.FindFirst("tenant_id")?.Value; var teacherName = User.FindFirst(ClaimTypes.Name)?.Value ?? "未知老师"; var teacherId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; if (string.IsNullOrEmpty(teacherTenantId)) { return Unauthorized(new { success = false, message = "未发现合法的租户信息" }); } if (string.IsNullOrWhiteSpace(notification.ClassId) || string.IsNullOrWhiteSpace(notification.Message)) { return BadRequest(new { success = false, message = "班级编号与通知内容不可为空" }); } // 2. Multi-tenant Scope Validation: Ensure target classroom exists in teacher's tenant! var classroom = await _securityService.GetClassroomAsync(teacherTenantId, notification.ClassId); if (classroom == null) { _logger.LogWarning("Cross-tenant attempt or invalid class: Teacher {TeacherId} (Tenant: {TenantId}) tried to notify Class {ClassId}", teacherId, teacherTenantId, notification.ClassId); return StatusCode(403, new { success = false, message = "无权访问该班级,或班级不属于当前学校" }); } // 3. Stamp metadata notification.Id = $"msg_{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}_{Guid.NewGuid().ToString("N")[..4]}"; notification.TenantId = teacherTenantId; notification.CreatedAt = DateTimeOffset.UtcNow; _securityService.RecordNotification(notification, teacherName); _logger.LogInformation("Teacher {TeacherName} ({TenantId}) sending notification to {ClassName} ({ClassId}): {Message}", teacherName, teacherTenantId, classroom.DisplayName, classroom.Id, notification.Message); // 4. Send to tenant-isolated SignalR classroom group var tenantClassGroup = $"t:{teacherTenantId}:c:{notification.ClassId}"; await _deviceHubContext.Clients.Group(tenantClassGroup).ReceiveNotification(notification); // 5. Broadcast only to teachers of THIS tenant var tenantTeacherGroup = $"t:{teacherTenantId}:teachers"; await _teacherHubContext.Clients.Group(tenantTeacherGroup).OnNewNotificationBroadcast(notification); return Ok(new { success = true, messageId = notification.Id, tenantId = teacherTenantId, classId = notification.ClassId, className = classroom.DisplayName, message = "通知已成功下发至教室大屏" }); } /// /// 获取当前教师所在学校的班级列表 /// [HttpGet("classes")] public async Task GetTeacherClasses() { var tenantId = User.FindFirst("tenant_id")?.Value; if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var classes = await _securityService.GetClassroomsAsync(tenantId); return Ok(classes); } /// /// 获取当前教师所在学校的历史通知记录与回执 /// [HttpGet("history")] public IActionResult GetNotificationHistory([FromQuery] string? classId, [FromQuery] int limit = 50) { var tenantId = User.FindFirst("tenant_id")?.Value; if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var list = _securityService.GetNotifications(tenantId, classId, limit); return Ok(list); } } ================================================================================ FILE: src/Server/ClassNotify.Server/Controllers/SchoolAdminController.cs ================================================================================ using ClassNotify.Server.Services; using ClassNotify.Shared.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace ClassNotify.Server.Controllers; [ApiController] [Route("api/[controller]")] [Authorize(Roles = "SchoolAdmin,SuperAdmin")] public class SchoolAdminController : ControllerBase { private readonly ISecurityService _securityService; private readonly ILogger _logger; public SchoolAdminController(ISecurityService securityService, ILogger logger) { _securityService = securityService; _logger = logger; } private string? GetTenantId() { // If SuperAdmin, can specify tenant_id via query or header, otherwise use claim var claimTenant = User.FindFirst("tenant_id")?.Value; if (claimTenant == "global" && Request.Query.ContainsKey("tenant_id")) { return Request.Query["tenant_id"].ToString(); } return claimTenant; } /// /// 获取本校基础统计 /// [HttpGet("overview")] public async Task GetOverview() { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var tenant = await _securityService.GetTenantAsync(tenantId); var classes = await _securityService.GetClassroomsAsync(tenantId); var devices = await _securityService.GetTenantDevicesAsync(tenantId); var teachers = await _securityService.GetUsersAsync(tenantId); return Ok(new { tenantId, tenantName = tenant?.Name ?? tenantId, classCount = classes.Count, deviceCount = devices.Count, onlineCount = devices.Count(d => d.IsOnline), teacherCount = teachers.Count }); } /// /// 获取本校所有班级 /// [HttpGet("classes")] public async Task GetClasses() { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var classes = await _securityService.GetClassroomsAsync(tenantId); return Ok(classes); } /// /// 为本校新增班级 /// [HttpPost("classes")] public async Task CreateClass([FromBody] CreateClassroomDto dto) { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); if (string.IsNullOrWhiteSpace(dto.Id) || string.IsNullOrWhiteSpace(dto.DisplayName)) { return BadRequest(new { success = false, message = "班级编号与班级名称不可为空" }); } var ok = await _securityService.CreateClassroomAsync(tenantId, dto); if (!ok) { return BadRequest(new { success = false, message = $"班级编号 {dto.Id} 已存在" }); } return Ok(new { success = true, message = "班级创建成功" }); } /// /// 获取本校所有教师与管理员账号 /// [HttpGet("teachers")] public async Task GetTeachers() { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var users = await _securityService.GetUsersAsync(tenantId); var result = users.Select(u => new { u.Id, u.Username, u.FullName, u.Role }); return Ok(result); } /// /// 为本校创建教师账号 /// [HttpPost("teachers")] public async Task CreateTeacher([FromBody] CreateTeacherDto dto) { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); if (string.IsNullOrWhiteSpace(dto.Username) || string.IsNullOrWhiteSpace(dto.Password) || string.IsNullOrWhiteSpace(dto.FullName)) { return BadRequest(new { success = false, message = "账号、密码和姓名不可为空" }); } // P0-02: Prevent privilege escalation. // SchoolAdmin can only create Teacher accounts. // SuperAdmin can create SchoolAdmin or Teacher, but never SuperAdmin here. if (!User.IsInRole("SuperAdmin")) { dto.Role = "Teacher"; } else { if (dto.Role == "SuperAdmin") { return BadRequest(new { success = false, message = "禁止通过此接口创建平台超级管理员账号" }); } if (string.IsNullOrWhiteSpace(dto.Role)) { dto.Role = "Teacher"; } } var ok = await _securityService.CreateUserAsync(tenantId, dto); if (!ok) { return BadRequest(new { success = false, message = $"用户名 {dto.Username} 已存在" }); } return Ok(new { success = true, message = "教师账号创建成功" }); } /// /// 获取本校所有设备 /// [HttpGet("devices")] public async Task GetDevices() { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var devices = await _securityService.GetTenantDevicesAsync(tenantId); return Ok(devices); } /// /// 获取本校激活码 /// [HttpGet("activation-codes")] public async Task GetActivationCodes() { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); var codes = await _securityService.GetActivationCodesAsync(tenantId); return Ok(codes); } /// /// 本校管理员生成班级激活码 /// [HttpPost("activation-codes")] public async Task GenerateActivationCode([FromQuery] string classId) { var tenantId = GetTenantId(); if (string.IsNullOrEmpty(tenantId)) return Unauthorized(); if (string.IsNullOrWhiteSpace(classId)) { return BadRequest(new { success = false, message = "班级编号不可为空" }); } var classroom = await _securityService.GetClassroomAsync(tenantId, classId); if (classroom == null) { return NotFound(new { success = false, message = $"班级 {classId} 不存在或不属于该学校" }); } try { var code = await _securityService.GenerateActivationCodeAsync(tenantId, classId); return Ok(new { success = true, code, tenantId, classId, message = "激活码生成成功" }); } catch (Exception ex) { return BadRequest(new { success = false, message = ex.Message }); } } } ================================================================================ FILE: src/Server/ClassNotify.Server/Dockerfile ================================================================================ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /app # Copy solution and projects COPY ClassNotify.sln . COPY src/Shared/ClassNotify.Shared/ src/Shared/ClassNotify.Shared/ COPY src/Server/ClassNotify.Server/ src/Server/ClassNotify.Server/ # Restore and build Server RUN dotnet restore src/Server/ClassNotify.Server/ClassNotify.Server.csproj RUN dotnet publish src/Server/ClassNotify.Server/ClassNotify.Server.csproj -c Release -o /app/publish FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime WORKDIR /app COPY --from=build /app/publish . ENV ASPNETCORE_URLS=http://+:5000 EXPOSE 5000 ENTRYPOINT ["dotnet", "ClassNotify.Server.dll"] ================================================================================ FILE: src/Server/ClassNotify.Server/Domain/Entities/Entities.cs ================================================================================ namespace ClassNotify.Server.Domain.Entities; /// /// 学校/机构租户实体 /// public class Tenant { public string Id { get; set; } = string.Empty; // e.g. "t_beijing_no4" public string Name { get; set; } = string.Empty; // e.g. "北京四中" public bool IsActive { get; set; } = true; public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow; } /// /// 教师/管理员用户实体 /// public class User { public string Id { get; set; } = string.Empty; // e.g. "usr_1001" public string TenantId { get; set; } = string.Empty; public string Username { get; set; } = string.Empty; public string PasswordHash { get; set; } = string.Empty; public string FullName { get; set; } = string.Empty; public string Role { get; set; } = "Teacher"; // Teacher, SchoolAdmin } /// /// 班级实体 /// public class Classroom { public string Id { get; set; } = string.Empty; // e.g. "cls_801" public string TenantId { get; set; } = string.Empty; public string DisplayName { get; set; } = string.Empty; // e.g. "八年级(1)班" public string? Grade { get; set; } public string? RoomNumber { get; set; } } /// /// 教室硬件多媒体设备实体 /// public class Device { public string Id { get; set; } = string.Empty; // e.g. "dev_52f0" public string TenantId { get; set; } = string.Empty; public string ClassroomId { get; set; } = string.Empty; public string DeviceTokenHash { get; set; } = string.Empty; public string? Hostname { get; set; } public DateTimeOffset? LastHeartbeatAt { get; set; } public bool IsActive { get; set; } = true; } /// /// 一次性设备激活码实体 /// public class ActivationCode { public string Code { get; set; } = string.Empty; // e.g. "H8K4-29DP" public string TenantId { get; set; } = string.Empty; public string ClassroomId { get; set; } = string.Empty; public DateTimeOffset ExpiresAt { get; set; } = DateTimeOffset.UtcNow.AddDays(7); public bool IsUsed { get; set; } public DateTimeOffset? UsedAt { get; set; } public string? UsedByDeviceId { get; set; } } ================================================================================ FILE: src/Server/ClassNotify.Server/Hubs/DeviceHub.cs ================================================================================ using ClassNotify.Server.Services; using ClassNotify.Shared.Contracts; using ClassNotify.Shared.Enums; using ClassNotify.Shared.Models; using Microsoft.AspNetCore.SignalR; namespace ClassNotify.Server.Hubs; public class DeviceHub : Hub { private readonly ILogger _logger; private readonly IHubContext _teacherHub; private readonly ISecurityService _securityService; // Track active connection -> { TenantId, ClassroomId, DeviceId } private static readonly Dictionary _connectionTenantMap = new(); public DeviceHub( ILogger logger, IHubContext teacherHub, ISecurityService securityService) { _logger = logger; _teacherHub = teacherHub; _securityService = securityService; } public override async Task OnConnectedAsync() { var httpContext = Context.GetHttpContext(); var deviceId = httpContext?.Request.Headers["X-Device-Id"].FirstOrDefault() ?? httpContext?.Request.Query["device_id"].FirstOrDefault(); var deviceToken = httpContext?.Request.Headers["X-Device-Token"].FirstOrDefault() ?? httpContext?.Request.Query["device_token"].FirstOrDefault(); var clientVersion = httpContext?.Request.Headers["X-Client-Version"].FirstOrDefault() ?? "2.1.0"; var remoteIp = httpContext?.Connection.RemoteIpAddress?.ToString() ?? "127.0.0.1"; if (string.IsNullOrEmpty(deviceId) || string.IsNullOrEmpty(deviceToken)) { _logger.LogWarning("Rejecting unauthorized device connection {ConnId}: Missing device credentials.", Context.ConnectionId); Context.Abort(); return; } var device = await _securityService.ValidateDeviceAsync(deviceId, deviceToken); if (device == null) { _logger.LogWarning("Rejecting unauthorized device connection {ConnId}: Invalid device ID or token ({DeviceId}).", Context.ConnectionId, deviceId); Context.Abort(); return; } // Add to Tenant-Isolated Group var tenantClassGroup = $"t:{device.TenantId}:c:{device.ClassroomId}"; await Groups.AddToGroupAsync(Context.ConnectionId, tenantClassGroup); lock (_connectionTenantMap) { _connectionTenantMap[Context.ConnectionId] = (device.TenantId, device.ClassroomId, device.Id); } // Register in SecurityService Live Registry await _securityService.RegisterDeviceConnectionAsync( Context.ConnectionId, device.Id, device.TenantId, device.ClassroomId, device.Hostname, remoteIp, clientVersion); _logger.LogInformation("Device {DeviceId} authenticated successfully. Joined group {Group} at {ConnId}", device.Id, tenantClassGroup, Context.ConnectionId); // Notify teachers of THIS tenant var classroom = await _securityService.GetClassroomAsync(device.TenantId, device.ClassroomId); var status = new DeviceStatusDto { ClassId = device.ClassroomId, ClassName = classroom?.DisplayName ?? device.ClassroomId, Hostname = device.Hostname ?? "Classroom-PC", State = DeviceOnlineState.Online, LastHeartbeat = DateTimeOffset.UtcNow, AgentVersion = clientVersion }; await _teacherHub.Clients.Group($"t:{device.TenantId}:teachers").OnDeviceStatusChanged(status); await base.OnConnectedAsync(); } public async Task SendAckReceipt(AckReceiptDto ack) { string? tenantId = null; string? classroomId = null; string? deviceId = null; lock (_connectionTenantMap) { if (_connectionTenantMap.TryGetValue(Context.ConnectionId, out var info)) { tenantId = info.TenantId; classroomId = info.ClassroomId; deviceId = info.DeviceId; } } if (tenantId == null || classroomId == null) { _logger.LogWarning("Rejecting ACK from unauthenticated connection {ConnId}", Context.ConnectionId); return; } // P0-11: Enforce device ACK attribution validation. // Force ClassId to match the connection's authenticated classroom (never trust client-supplied ClassId). ack.ClassId = classroomId; // Verify that this notification was actually sent to this tenant and classroom if (!_securityService.ValidateNotificationTarget(ack.MessageId, tenantId, classroomId)) { _logger.LogWarning("Spoofed or unknown ACK rejected: Message {MsgId} does not match Tenant {TenantId}, Class {ClassId} (Device {DeviceId})", ack.MessageId, tenantId, classroomId, deviceId); return; } _logger.LogInformation("ACK validated from Tenant {TenantId}, Class {ClassId} (Device {DeviceId}): Message {MsgId} -> {Status}", tenantId, classroomId, deviceId, ack.MessageId, ack.Status); // Record ACK in history _securityService.RecordAck(ack); // Relay ONLY to teachers belonging to THIS tenant! await _teacherHub.Clients.Group($"t:{tenantId}:teachers").OnAckReceiptReceived(ack); } public async Task SendHealthReport(DeviceHealthReportDto report) { string? tenantId = null; lock (_connectionTenantMap) { if (_connectionTenantMap.TryGetValue(Context.ConnectionId, out var info)) { tenantId = info.TenantId; } } if (tenantId == null) return; await _teacherHub.Clients.Group($"t:{tenantId}:teachers").OnHealthReportReceived(report); } public async Task SendHeartbeat(string classId) { await _securityService.UpdateDeviceHeartbeatAsync(Context.ConnectionId); _logger.LogDebug("Received heartbeat from Class {ClassId} ({ConnId})", classId, Context.ConnectionId); } public override async Task OnDisconnectedAsync(Exception? exception) { string? tenantId = null; string? classId = null; lock (_connectionTenantMap) { if (_connectionTenantMap.TryGetValue(Context.ConnectionId, out var info)) { tenantId = info.TenantId; classId = info.ClassroomId; _connectionTenantMap.Remove(Context.ConnectionId); } } await _securityService.UnregisterDeviceConnectionAsync(Context.ConnectionId); if (tenantId != null && classId != null) { _logger.LogInformation("Device disconnected for Tenant {TenantId}, Class {ClassId}", tenantId, classId); var status = new DeviceStatusDto { ClassId = classId, State = DeviceOnlineState.Offline, LastHeartbeat = DateTimeOffset.UtcNow }; await _teacherHub.Clients.Group($"t:{tenantId}:teachers").OnDeviceStatusChanged(status); } await base.OnDisconnectedAsync(exception); } } ================================================================================ FILE: src/Server/ClassNotify.Server/Hubs/TeacherHub.cs ================================================================================ using System.Security.Claims; using ClassNotify.Shared.Contracts; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; namespace ClassNotify.Server.Hubs; /// /// 教师端 SignalR Hub (强制 JWT 认证,基于 TenantId 强隔离事件流) /// [Authorize] public class TeacherHub : Hub { private readonly ILogger _logger; public TeacherHub(ILogger logger) { _logger = logger; } public override async Task OnConnectedAsync() { var tenantId = Context.User?.FindFirst("tenant_id")?.Value; var teacherName = Context.User?.FindFirst(ClaimTypes.Name)?.Value ?? "教师"; if (string.IsNullOrEmpty(tenantId)) { _logger.LogWarning("Rejecting teacher connection {ConnId}: Missing tenant_id claim.", Context.ConnectionId); Context.Abort(); return; } // Join tenant-specific teacher event channel var tenantTeacherGroup = $"t:{tenantId}:teachers"; await Groups.AddToGroupAsync(Context.ConnectionId, tenantTeacherGroup); _logger.LogInformation("Teacher {TeacherName} connected to SignalR Hub. Joined group {Group} at {ConnId}", teacherName, tenantTeacherGroup, Context.ConnectionId); await base.OnConnectedAsync(); } } ================================================================================ FILE: src/Server/ClassNotify.Server/Program.cs ================================================================================ using System.Text; using System.Threading.RateLimiting; using ClassNotify.Server.Hubs; using ClassNotify.Server.Services; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.RateLimiting; using Microsoft.IdentityModel.Tokens; using Serilog; Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() .WriteTo.Console() .CreateLogger(); try { var builder = WebApplication.CreateBuilder(args); builder.Host.UseSerilog(); builder.Services.AddControllers(); builder.Services.AddSignalR(); builder.Services.AddSingleton(); // 1. JWT Authentication builder.Services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(options => { options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = false, ValidateAudience = false, ValidateLifetime = true, ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(SecurityService.JwtSecret)) }; // Support SignalR query string token for WebSocket connections options.Events = new JwtBearerEvents { OnMessageReceived = context => { var accessToken = context.Request.Query["access_token"]; var path = context.HttpContext.Request.Path; if (!string.IsNullOrEmpty(accessToken) && (path.StartsWithSegments("/hubs/teacher") || path.StartsWithSegments("/hubs/device"))) { context.Token = accessToken; } return Task.CompletedTask; } }; }); builder.Services.AddAuthorization(); // 2. Native Rate Limiting (防刷防爆破) builder.Services.AddRateLimiter(options => { options.RejectionStatusCode = StatusCodes.Status429TooManyRequests; options.AddFixedWindowLimiter("AuthLimiter", opt => { opt.Window = TimeSpan.FromMinutes(1); opt.PermitLimit = 30; opt.QueueLimit = 0; }); options.AddFixedWindowLimiter("ActivationLimiter", opt => { opt.Window = TimeSpan.FromMinutes(1); opt.PermitLimit = 15; opt.QueueLimit = 0; }); options.AddFixedWindowLimiter("SendLimiter", opt => { opt.Window = TimeSpan.FromMinutes(1); opt.PermitLimit = 60; opt.QueueLimit = 0; }); }); // 3. CORS builder.Services.AddCors(options => { options.AddPolicy("CorsPolicy", policy => { policy.AllowAnyHeader() .AllowAnyMethod() .SetIsOriginAllowed(_ => true) .AllowCredentials(); }); }); // 4. Forwarded Headers for Linux reverse proxy (Caddy / Nginx) builder.Services.Configure(options => { options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; options.KnownNetworks.Clear(); options.KnownProxies.Clear(); }); var app = builder.Build(); app.UseForwardedHeaders(); app.UseCors("CorsPolicy"); app.UseRateLimiter(); // Serve React SPA static files from wwwroot app.UseDefaultFiles(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.MapControllers(); app.MapHub("/hubs/device"); app.MapHub("/hubs/teacher"); // Dedicated Health Check Endpoint app.MapGet("/api/health", () => Results.Json(new { service = "ClassNotify Commercial Server (ASP.NET Core on Linux)", version = "2.1.0", status = "Healthy", hubs = new[] { "/hubs/device", "/hubs/teacher" } })); // Fallback to index.html for React SPA client-side routing app.MapFallbackToFile("index.html"); app.Run(); } catch (Exception ex) { Log.Fatal(ex, "ClassNotify Server terminated unexpectedly."); } finally { Log.CloseAndFlush(); } ================================================================================ FILE: src/Server/ClassNotify.Server/Services/ISecurityService.cs ================================================================================ using ClassNotify.Server.Domain.Entities; using ClassNotify.Shared.Models; namespace ClassNotify.Server.Services; public interface ISecurityService { // Auth & Identity Task LoginTeacherAsync(TeacherLoginDto dto); Task ActivateDeviceAsync(DeviceActivationRequestDto dto); Task ValidateDeviceAsync(string deviceId, string deviceToken); // Tenant & Classrooms Task GetClassroomAsync(string tenantId, string classId); Task> GetClassroomsAsync(string tenantId); Task CreateClassroomAsync(string tenantId, CreateClassroomDto dto); Task GetTenantAsync(string tenantId); Task> GetTenantsOverviewAsync(); // Users Task> GetUsersAsync(string tenantId); Task CreateUserAsync(string tenantId, CreateTeacherDto dto); // Devices & Metrics Task GetAdminMetricsAsync(); Task> GetAllDevicesAsync(); Task> GetTenantDevicesAsync(string tenantId); Task RegisterDeviceConnectionAsync(string connectionId, string deviceId, string tenantId, string classroomId, string? hostname, string? remoteIp, string? clientVersion); Task UnregisterDeviceConnectionAsync(string connectionId); Task UpdateDeviceHeartbeatAsync(string connectionId); string? GetDeviceConnectionId(string deviceId); // Activation Codes Task GenerateActivationCodeAsync(string tenantId, string classId); Task> GetActivationCodesAsync(string? tenantId); // Notifications & ACKs void RecordNotification(NotificationDto notification, string senderName); void RecordAck(AckReceiptDto ack); bool ValidateNotificationTarget(string messageId, string tenantId, string classroomId); List GetNotifications(string? tenantId, string? classId, int limit = 50); } ================================================================================ FILE: src/Server/ClassNotify.Server/Services/SecurityService.cs ================================================================================ using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Security.Cryptography; using System.Text; using ClassNotify.Server.Domain.Entities; using ClassNotify.Shared.Models; using Microsoft.IdentityModel.Tokens; namespace ClassNotify.Server.Services; public class SecurityService : ISecurityService { private readonly IConfiguration _config; private readonly ILogger _logger; // Seed Tenants private static readonly List _tenants = new() { new Tenant { Id = "t_beijing_no4", Name = "北京四中", IsActive = true }, new Tenant { Id = "t_shanghai_high", Name = "上海实验学校", IsActive = true } }; // Seed Users (SuperAdmin, SchoolAdmin, Teacher) private static readonly List _users = new() { new User { Id = "usr_super", TenantId = "global", Username = "admin", FullName = "超级管理员", Role = "SuperAdmin", PasswordHash = HashPassword("admin888") }, new User { Id = "usr_admin_bj", TenantId = "t_beijing_no4", Username = "admin_bj4", FullName = "北京四中管理员", Role = "SchoolAdmin", PasswordHash = HashPassword("admin123") }, new User { Id = "usr_admin_sh", TenantId = "t_shanghai_high", Username = "admin_sh", FullName = "上海实验管理员", Role = "SchoolAdmin", PasswordHash = HashPassword("admin123") }, new User { Id = "usr_101", TenantId = "t_beijing_no4", Username = "teacher_zhang", FullName = "张老师", Role = "Teacher", PasswordHash = HashPassword("teacher123") }, new User { Id = "usr_201", TenantId = "t_shanghai_high", Username = "teacher_li", FullName = "李老师", Role = "Teacher", PasswordHash = HashPassword("teacher123") } }; // Seed Classrooms private static readonly List _classrooms = new() { new Classroom { Id = "cls_801", TenantId = "t_beijing_no4", DisplayName = "八年级(1)班", Grade = "初二", RoomNumber = "综合楼301" }, new Classroom { Id = "cls_802", TenantId = "t_beijing_no4", DisplayName = "八年级(2)班", Grade = "初二", RoomNumber = "综合楼302" }, new Classroom { Id = "cls_801", TenantId = "t_shanghai_high", DisplayName = "高一(1)班", Grade = "高一", RoomNumber = "实验楼101" } }; // Seed Activation Codes private static readonly List _activationCodes = new() { new ActivationCode { Code = "TEST-2026", TenantId = "t_beijing_no4", ClassroomId = "cls_801", ExpiresAt = DateTimeOffset.UtcNow.AddDays(30), IsUsed = false }, new ActivationCode { Code = "BJ81-2026", TenantId = "t_beijing_no4", ClassroomId = "cls_801", ExpiresAt = DateTimeOffset.UtcNow.AddDays(30), IsUsed = false }, new ActivationCode { Code = "BJ82-2026", TenantId = "t_beijing_no4", ClassroomId = "cls_802", ExpiresAt = DateTimeOffset.UtcNow.AddDays(30), IsUsed = false }, new ActivationCode { Code = "BJ81-DEMO", TenantId = "t_beijing_no4", ClassroomId = "cls_801", ExpiresAt = DateTimeOffset.UtcNow.AddDays(30), IsUsed = false }, new ActivationCode { Code = "SH01-2026", TenantId = "t_shanghai_high", ClassroomId = "cls_801", ExpiresAt = DateTimeOffset.UtcNow.AddDays(30), IsUsed = false } }; private static readonly List _devices = new(); private static readonly string DataDir = Path.Combine(AppContext.BaseDirectory, "data"); private static readonly string DevicesFilePath = Path.Combine(DataDir, "devices.json"); private static readonly string CodesFilePath = Path.Combine(DataDir, "activation_codes.json"); private static readonly string TenantsFilePath = Path.Combine(DataDir, "tenants.json"); private static readonly string ClassroomsFilePath = Path.Combine(DataDir, "classrooms.json"); private static readonly string UsersFilePath = Path.Combine(DataDir, "users.json"); private static readonly string NotificationsFilePath = Path.Combine(DataDir, "notifications.json"); static SecurityService() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); // 1. Tenants Persistence & Seed Merging if (File.Exists(TenantsFilePath)) { var json = File.ReadAllText(TenantsFilePath); var list = System.Text.Json.JsonSerializer.Deserialize>(json); if (list != null && list.Count > 0) { lock (_tenants) { foreach (var item in list) { if (!_tenants.Any(t => t.Id == item.Id)) _tenants.Add(item); } } } } SaveTenants(); // 2. Classrooms Persistence & Seed Merging if (File.Exists(ClassroomsFilePath)) { var json = File.ReadAllText(ClassroomsFilePath); var list = System.Text.Json.JsonSerializer.Deserialize>(json); if (list != null && list.Count > 0) { lock (_classrooms) { foreach (var item in list) { if (!_classrooms.Any(c => c.TenantId == item.TenantId && c.Id == item.Id)) _classrooms.Add(item); } } } } SaveClassrooms(); // 3. Users Persistence & Seed Merging if (File.Exists(UsersFilePath)) { var json = File.ReadAllText(UsersFilePath); var list = System.Text.Json.JsonSerializer.Deserialize>(json); if (list != null && list.Count > 0) { lock (_users) { foreach (var item in list) { if (!_users.Any(u => u.Username.Equals(item.Username, StringComparison.OrdinalIgnoreCase))) _users.Add(item); } } } } SaveUsers(); // 4. Devices Persistence if (File.Exists(DevicesFilePath)) { var json = File.ReadAllText(DevicesFilePath); var list = System.Text.Json.JsonSerializer.Deserialize>(json); if (list != null) { lock (_devices) _devices.AddRange(list); } } // Ensure test device is recognized var testDevId = "dev_b510ddb1"; var testRawToken = "dtoken_aee34c46e4474694bb3bdfa022be0910"; lock (_devices) { if (!_devices.Any(d => d.Id == testDevId)) { _devices.Add(new Device { Id = testDevId, TenantId = "t_beijing_no4", ClassroomId = "cls_802", DeviceTokenHash = HashToken(testRawToken), Hostname = "DESKTOP-LOCAL", IsActive = true }); } } SaveDevices(); // 5. Activation Codes Persistence (P0-03: Disk state overrides seed state) if (File.Exists(CodesFilePath)) { var json = File.ReadAllText(CodesFilePath); var list = System.Text.Json.JsonSerializer.Deserialize>(json); if (list != null) { lock (_activationCodes) { foreach (var c in list) { var existing = _activationCodes.FirstOrDefault(x => x.Code == c.Code); if (existing != null) { // Overwrite seed state with disk state (crucial for IsUsed, UsedAt, etc.) existing.IsUsed = c.IsUsed; existing.UsedAt = c.UsedAt; existing.UsedByDeviceId = c.UsedByDeviceId; existing.ExpiresAt = c.ExpiresAt; } else { _activationCodes.Add(c); } } } } } SaveCodes(); // 6. Notifications Persistence if (File.Exists(NotificationsFilePath)) { var json = File.ReadAllText(NotificationsFilePath); var list = System.Text.Json.JsonSerializer.Deserialize>(json); if (list != null) { lock (_notifications) { _notifications.AddRange(list); } } } } catch { } } private static void SaveTenants() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); lock (_tenants) { var json = System.Text.Json.JsonSerializer.Serialize(_tenants, new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(TenantsFilePath, json); } } catch { } } private static void SaveClassrooms() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); lock (_classrooms) { var json = System.Text.Json.JsonSerializer.Serialize(_classrooms, new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(ClassroomsFilePath, json); } } catch { } } private static void SaveUsers() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); lock (_users) { var json = System.Text.Json.JsonSerializer.Serialize(_users, new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(UsersFilePath, json); } } catch { } } private static void SaveDevices() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); lock (_devices) { var json = System.Text.Json.JsonSerializer.Serialize(_devices, new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(DevicesFilePath, json); } } catch { } } private static void SaveCodes() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); lock (_activationCodes) { var json = System.Text.Json.JsonSerializer.Serialize(_activationCodes, new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(CodesFilePath, json); } } catch { } } private static void SaveNotifications() { try { if (!Directory.Exists(DataDir)) Directory.CreateDirectory(DataDir); lock (_notifications) { var json = System.Text.Json.JsonSerializer.Serialize(_notifications, new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(NotificationsFilePath, json); } } catch { } } // Live SignalR connections tracking private class LiveConnectionInfo { public string ConnectionId { get; set; } = string.Empty; public string DeviceId { get; set; } = string.Empty; public string TenantId { get; set; } = string.Empty; public string ClassroomId { get; set; } = string.Empty; public string? Hostname { get; set; } public string? RemoteIp { get; set; } public string? ClientVersion { get; set; } public DateTimeOffset ConnectedAt { get; set; } = DateTimeOffset.UtcNow; public DateTimeOffset LastHeartbeatAt { get; set; } = DateTimeOffset.UtcNow; } private static readonly Dictionary _liveConnections = new(); private static readonly Dictionary _deviceToConnection = new(); // In-memory Notification History with ACKs private static readonly List _notifications = new(); public const string JwtSecret = "ClassNotify_Enterprise_Super_Secret_Key_2026_For_Jwt_Signing!"; public SecurityService(IConfiguration config, ILogger logger) { _config = config; _logger = logger; } public Task GetTenantAsync(string tenantId) { lock (_tenants) { return Task.FromResult(_tenants.FirstOrDefault(t => t.Id == tenantId && t.IsActive)); } } public Task> GetTenantsOverviewAsync() { List tenantsSnapshot; lock (_tenants) tenantsSnapshot = _tenants.ToList(); List classroomsSnapshot; lock (_classrooms) classroomsSnapshot = _classrooms.ToList(); List devicesSnapshot; lock (_devices) devicesSnapshot = _devices.ToList(); List liveSnapshot; lock (_liveConnections) liveSnapshot = _liveConnections.Values.ToList(); var result = tenantsSnapshot.Select(t => { var classCount = classroomsSnapshot.Count(c => c.TenantId == t.Id); var deviceCount = devicesSnapshot.Count(d => d.TenantId == t.Id); var onlineCount = liveSnapshot.Count(c => c.TenantId == t.Id); return new TenantAdminDto { Id = t.Id, Name = t.Name, ClassroomCount = classCount, DeviceCount = deviceCount, OnlineCount = onlineCount, IsActive = t.IsActive, CreatedAt = t.CreatedAt }; }).ToList(); return Task.FromResult(result); } public Task GetClassroomAsync(string tenantId, string classId) { lock (_classrooms) { return Task.FromResult(_classrooms.FirstOrDefault(c => c.TenantId == tenantId && c.Id == classId)); } } public Task> GetClassroomsAsync(string tenantId) { lock (_classrooms) { return Task.FromResult(_classrooms.Where(c => c.TenantId == tenantId).ToList()); } } public Task CreateClassroomAsync(string tenantId, CreateClassroomDto dto) { lock (_classrooms) { if (_classrooms.Any(c => c.TenantId == tenantId && c.Id == dto.Id)) { return Task.FromResult(false); } _classrooms.Add(new Classroom { Id = dto.Id, TenantId = tenantId, DisplayName = dto.DisplayName, Grade = dto.Grade, RoomNumber = dto.RoomNumber }); SaveClassrooms(); return Task.FromResult(true); } } public Task> GetUsersAsync(string tenantId) { lock (_users) { return Task.FromResult(_users.Where(u => u.TenantId == tenantId).ToList()); } } public Task CreateUserAsync(string tenantId, CreateTeacherDto dto) { lock (_users) { if (_users.Any(u => u.Username.Equals(dto.Username, StringComparison.OrdinalIgnoreCase))) { return Task.FromResult(false); } // P0-02 DEFENSE: Role Whitelist - Only "Teacher" or "SchoolAdmin" can be created under a tenant, NEVER "SuperAdmin"! var safeRole = "Teacher"; if (dto.Role.Equals("SchoolAdmin", StringComparison.OrdinalIgnoreCase)) { safeRole = "SchoolAdmin"; } _users.Add(new User { Id = $"usr_{Guid.NewGuid().ToString("N")[..8]}", TenantId = tenantId, Username = dto.Username, FullName = dto.FullName, Role = safeRole, PasswordHash = HashPassword(dto.Password) }); SaveUsers(); return Task.FromResult(true); } } public Task LoginTeacherAsync(TeacherLoginDto dto) { if (string.IsNullOrWhiteSpace(dto.Username) || string.IsNullOrWhiteSpace(dto.Password)) { return Task.FromResult(new TeacherLoginResultDto { Success = false, ErrorMessage = "用户名与密码不可为空" }); } User? user; lock (_users) { user = _users.FirstOrDefault(u => u.Username.Equals(dto.Username, StringComparison.OrdinalIgnoreCase)); } if (user == null || user.PasswordHash != HashPassword(dto.Password)) { _logger.LogWarning("Failed login attempt for username: {Username}", dto.Username); return Task.FromResult(new TeacherLoginResultDto { Success = false, ErrorMessage = "用户名或密码错误" }); } var token = GenerateJwtToken(user); _logger.LogInformation("User {FullName} ({Username}, Role: {Role}) logged in successfully.", user.FullName, user.Username, user.Role); return Task.FromResult(new TeacherLoginResultDto { Success = true, Token = token, TenantId = user.TenantId, UserId = user.Id, FullName = user.FullName, Role = user.Role }); } public Task ActivateDeviceAsync(DeviceActivationRequestDto dto) { if (string.IsNullOrWhiteSpace(dto.ActivationCode)) { return Task.FromResult(new DeviceActivationResultDto { Success = false, ErrorMessage = "激活码不可为空" }); } var normalizedCode = dto.ActivationCode.Trim().ToUpperInvariant(); lock (_activationCodes) { var code = _activationCodes.FirstOrDefault(c => c.Code == normalizedCode); if (code == null) { return Task.FromResult(new DeviceActivationResultDto { Success = false, ErrorMessage = "激活码无效" }); } if (code.IsUsed) { return Task.FromResult(new DeviceActivationResultDto { Success = false, ErrorMessage = "该激活码已被使用" }); } if (code.ExpiresAt < DateTimeOffset.UtcNow) { return Task.FromResult(new DeviceActivationResultDto { Success = false, ErrorMessage = "激活码已过期" }); } Classroom? cls; lock (_classrooms) { cls = _classrooms.FirstOrDefault(c => c.TenantId == code.TenantId && c.Id == code.ClassroomId); } if (cls == null) { return Task.FromResult(new DeviceActivationResultDto { Success = false, ErrorMessage = "绑定的班级不存在" }); } var deviceId = $"dev_{Guid.NewGuid().ToString("N")[..8]}"; var rawToken = $"dtoken_{Guid.NewGuid().ToString("N")}"; var device = new Device { Id = deviceId, TenantId = code.TenantId, ClassroomId = code.ClassroomId, DeviceTokenHash = HashToken(rawToken), Hostname = dto.Hostname, IsActive = true }; lock (_devices) { _devices.Add(device); } code.IsUsed = true; code.UsedAt = DateTimeOffset.UtcNow; code.UsedByDeviceId = deviceId; _logger.LogInformation("Device {DeviceId} activated successfully for {TenantId} / {ClassId} ({DisplayName})", deviceId, cls.TenantId, cls.Id, cls.DisplayName); SaveDevices(); SaveCodes(); return Task.FromResult(new DeviceActivationResultDto { Success = true, DeviceId = deviceId, DeviceToken = rawToken, TenantId = cls.TenantId, ClassId = cls.Id, ClassDisplayName = cls.DisplayName }); } } public Task ValidateDeviceAsync(string deviceId, string deviceToken) { if (string.IsNullOrEmpty(deviceId) || string.IsNullOrEmpty(deviceToken)) { return Task.FromResult(null); } var tokenHash = HashToken(deviceToken); lock (_devices) { var dev = _devices.FirstOrDefault(d => d.Id == deviceId && d.DeviceTokenHash == tokenHash && d.IsActive); return Task.FromResult(dev); } } public Task RegisterDeviceConnectionAsync(string connectionId, string deviceId, string tenantId, string classroomId, string? hostname, string? remoteIp, string? clientVersion) { lock (_liveConnections) { var info = new LiveConnectionInfo { ConnectionId = connectionId, DeviceId = deviceId, TenantId = tenantId, ClassroomId = classroomId, Hostname = hostname, RemoteIp = remoteIp, ClientVersion = clientVersion ?? "2.1.0", ConnectedAt = DateTimeOffset.UtcNow, LastHeartbeatAt = DateTimeOffset.UtcNow }; _liveConnections[connectionId] = info; _deviceToConnection[deviceId] = connectionId; } lock (_devices) { var dev = _devices.FirstOrDefault(d => d.Id == deviceId); if (dev != null) { dev.LastHeartbeatAt = DateTimeOffset.UtcNow; if (!string.IsNullOrEmpty(hostname)) dev.Hostname = hostname; } } return Task.CompletedTask; } public Task UnregisterDeviceConnectionAsync(string connectionId) { lock (_liveConnections) { if (_liveConnections.TryGetValue(connectionId, out var info)) { _deviceToConnection.Remove(info.DeviceId); _liveConnections.Remove(connectionId); } } return Task.CompletedTask; } public Task UpdateDeviceHeartbeatAsync(string connectionId) { string? deviceId = null; lock (_liveConnections) { if (_liveConnections.TryGetValue(connectionId, out var info)) { info.LastHeartbeatAt = DateTimeOffset.UtcNow; deviceId = info.DeviceId; } } if (deviceId != null) { lock (_devices) { var dev = _devices.FirstOrDefault(d => d.Id == deviceId); if (dev != null) { dev.LastHeartbeatAt = DateTimeOffset.UtcNow; } } } return Task.CompletedTask; } public string? GetDeviceConnectionId(string deviceId) { lock (_liveConnections) { return _deviceToConnection.TryGetValue(deviceId, out var connId) ? connId : null; } } public Task GetAdminMetricsAsync() { int totalTenants; lock (_tenants) totalTenants = _tenants.Count; int totalClasses; lock (_classrooms) totalClasses = _classrooms.Count; int totalDevices; lock (_devices) totalDevices = _devices.Count; int onlineDevices; lock (_liveConnections) onlineDevices = _liveConnections.Values.Select(c => c.DeviceId).Distinct().Count(); int todayNotifications; lock (_notifications) { var today = DateTimeOffset.UtcNow.Date; todayNotifications = _notifications.Count(n => n.CreatedAt.Date == today); } return Task.FromResult(new AdminMetricsDto { TotalTenants = totalTenants, TotalClassrooms = totalClasses, TotalDevices = totalDevices, OnlineDevices = onlineDevices, TodayNotifications = todayNotifications, AbnormalDevices = 0 }); } public Task> GetAllDevicesAsync() { List devicesSnapshot; lock (_devices) devicesSnapshot = _devices.ToList(); List tenantsSnapshot; lock (_tenants) tenantsSnapshot = _tenants.ToList(); List classroomsSnapshot; lock (_classrooms) classroomsSnapshot = _classrooms.ToList(); Dictionary liveMap; Dictionary devToConn; lock (_liveConnections) { liveMap = new Dictionary(_liveConnections); devToConn = new Dictionary(_deviceToConnection); } var list = new List(); foreach (var dev in devicesSnapshot) { var tenantName = tenantsSnapshot.FirstOrDefault(t => t.Id == dev.TenantId)?.Name ?? dev.TenantId; var className = classroomsSnapshot.FirstOrDefault(c => c.TenantId == dev.TenantId && c.Id == dev.ClassroomId)?.DisplayName ?? dev.ClassroomId; LiveConnectionInfo? live = null; if (devToConn.TryGetValue(dev.Id, out var connId)) { liveMap.TryGetValue(connId, out live); } list.Add(new DeviceAdminDto { DeviceId = dev.Id, TenantId = dev.TenantId, TenantName = tenantName, ClassroomId = dev.ClassroomId, ClassroomName = className, Hostname = live?.Hostname ?? dev.Hostname ?? "Classroom-PC", IsOnline = live != null, LastHeartbeat = live?.LastHeartbeatAt ?? dev.LastHeartbeatAt, ClientVersion = live?.ClientVersion ?? "2.1.0", RemoteIp = live?.RemoteIp ?? "127.0.0.1", ServiceRunning = true, ClientRunning = live != null }); } return Task.FromResult(list); } public Task> GetTenantDevicesAsync(string tenantId) { return GetAllDevicesAsync().ContinueWith(t => t.Result.Where(d => d.TenantId == tenantId).ToList()); } public Task GenerateActivationCodeAsync(string tenantId, string classId) { lock (_classrooms) { if (!_classrooms.Any(c => c.TenantId == tenantId && c.Id == classId)) { throw new InvalidOperationException($"目标班级 {classId} 不存在或不属于租户 {tenantId}"); } } var raw = Guid.NewGuid().ToString("N")[..8].ToUpperInvariant(); var formatted = $"{raw[..4]}-{raw[4..]}"; var code = new ActivationCode { Code = formatted, TenantId = tenantId, ClassroomId = classId, ExpiresAt = DateTimeOffset.UtcNow.AddDays(7), IsUsed = false }; lock (_activationCodes) { _activationCodes.Add(code); SaveCodes(); } _logger.LogInformation("Generated activation code {Code} for tenant {TenantId}, classroom {ClassId}", formatted, tenantId, classId); return Task.FromResult(formatted); } public Task> GetActivationCodesAsync(string? tenantId) { List codesSnapshot; lock (_activationCodes) codesSnapshot = _activationCodes.ToList(); List tenantsSnapshot; lock (_tenants) tenantsSnapshot = _tenants.ToList(); List classroomsSnapshot; lock (_classrooms) classroomsSnapshot = _classrooms.ToList(); var query = codesSnapshot.AsEnumerable(); if (!string.IsNullOrEmpty(tenantId) && tenantId != "global") { query = query.Where(c => c.TenantId == tenantId); } var list = query.Select(c => { var tName = tenantsSnapshot.FirstOrDefault(t => t.Id == c.TenantId)?.Name ?? c.TenantId; var cName = classroomsSnapshot.FirstOrDefault(cls => cls.TenantId == c.TenantId && cls.Id == c.ClassroomId)?.DisplayName ?? c.ClassroomId; return new ActivationCodeDto { Code = c.Code, TenantId = c.TenantId, TenantName = tName, ClassroomId = c.ClassroomId, ClassroomName = cName, ExpiresAt = c.ExpiresAt, IsUsed = c.IsUsed, UsedAt = c.UsedAt, UsedByDeviceId = c.UsedByDeviceId }; }).OrderByDescending(c => c.ExpiresAt).ToList(); return Task.FromResult(list); } public void RecordNotification(NotificationDto notification, string senderName) { string cName = notification.ClassId; lock (_classrooms) { cName = _classrooms.FirstOrDefault(c => c.TenantId == notification.TenantId && c.Id == notification.ClassId)?.DisplayName ?? notification.ClassId; } lock (_notifications) { _notifications.Insert(0, new NotificationRecordDto { Id = notification.Id, TenantId = notification.TenantId, ClassId = notification.ClassId, ClassName = cName, SenderName = senderName, Message = notification.Message, Priority = notification.Type.ToString(), CreatedAt = notification.CreatedAt, Status = "Sent" }); // Keep last 500 notifications if (_notifications.Count > 500) { _notifications.RemoveAt(_notifications.Count - 1); } SaveNotifications(); } } public void RecordAck(AckReceiptDto ack) { lock (_notifications) { var record = _notifications.FirstOrDefault(n => n.Id == ack.MessageId); if (record != null) { record.Status = ack.Status.ToString(); if (ack.Status == Shared.Enums.AckStatus.Acknowledged) { record.ConfirmedAt = ack.Timestamp; } SaveNotifications(); } } } public bool ValidateNotificationTarget(string messageId, string tenantId, string classroomId) { lock (_notifications) { var record = _notifications.FirstOrDefault(n => n.Id == messageId); if (record == null) { // If notification not found in history buffer, reject spoofed ACK return false; } return record.TenantId == tenantId && record.ClassId == classroomId; } } public List GetNotifications(string? tenantId, string? classId, int limit = 50) { lock (_notifications) { var query = _notifications.AsEnumerable(); if (!string.IsNullOrEmpty(tenantId) && tenantId != "global") { query = query.Where(n => n.TenantId == tenantId); } if (!string.IsNullOrEmpty(classId)) { query = query.Where(n => n.ClassId == classId); } return query.Take(limit).ToList(); } } private string GenerateJwtToken(User user) { var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.UTF8.GetBytes(JwtSecret); var tokenDescriptor = new SecurityTokenDescriptor { Subject = new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, user.Id), new Claim(ClaimTypes.Name, user.FullName), new Claim(ClaimTypes.Role, user.Role), new Claim("tenant_id", user.TenantId) }), Expires = DateTime.UtcNow.AddDays(14), SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) }; var token = tokenHandler.CreateToken(tokenDescriptor); return tokenHandler.WriteToken(token); } private static string HashPassword(string password) { using var sha = SHA256.Create(); var bytes = sha.ComputeHash(Encoding.UTF8.GetBytes(password + "_classnotify_salt")); return Convert.ToBase64String(bytes); } private static string HashToken(string token) { using var sha = SHA256.Create(); var bytes = sha.ComputeHash(Encoding.UTF8.GetBytes(token)); return Convert.ToBase64String(bytes); } } ================================================================================ FILE: src/Server/ClassNotify.Server/wwwroot/assets/index-CkDikWR1.css ================================================================================ *,: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}body{min-height:100vh;--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}body *::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}body *::selection{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}body::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}body::selection{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-20{bottom:-5rem}.-left-20{left:-5rem}.-right-20{right:-5rem}.-top-20{top:-5rem}.left-3\.5{left:.875rem}.top-0{top:0}.top-3{top:.75rem}.top-3\.5{top:.875rem}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-8{margin-top:2rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.max-h-\[580px\]{max-height:580px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-full{width:100%}.max-w-7xl{max-width:80rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@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-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.625rem * var(--tw-space-x-reverse));margin-left:calc(.625rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-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\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-slate-800\/50>:not([hidden])~:not([hidden]){border-color:#1e293b80}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-amber-500\/30{border-color:#f59e0b4d}.border-emerald-500{--tw-border-opacity: 1;border-color:rgb(16 185 129 / var(--tw-border-opacity, 1))}.border-emerald-500\/30{border-color:#10b9814d}.border-indigo-500\/30{border-color:#6366f14d}.border-rose-500\/30{border-color:#f43f5e4d}.border-sky-500\/30{border-color:#0ea5e94d}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-700\/60{border-color:#33415599}.border-slate-700\/80{border-color:#334155cc}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.border-slate-800\/60{border-color:#1e293b99}.border-slate-800\/80{border-color:#1e293bcc}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-black\/70{background-color:#000000b3}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/15{background-color:#10b98126}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-emerald-600\/20{background-color:#05966933}.bg-indigo-500\/10{background-color:#6366f11a}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-indigo-600\/10{background-color:#4f46e51a}.bg-indigo-600\/20{background-color:#4f46e533}.bg-rose-400{--tw-bg-opacity: 1;background-color:rgb(251 113 133 / var(--tw-bg-opacity, 1))}.bg-rose-500\/10{background-color:#f43f5e1a}.bg-sky-500\/10{background-color:#0ea5e91a}.bg-sky-600{--tw-bg-opacity: 1;background-color:rgb(2 132 199 / var(--tw-bg-opacity, 1))}.bg-sky-600\/10{background-color:#0284c71a}.bg-sky-600\/20{background-color:#0284c733}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / 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-800\/40{background-color:#1e293b66}.bg-slate-800\/80{background-color:#1e293bcc}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/60{background-color:#0f172a99}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/50{background-color:#02061780}.bg-slate-950\/60{background-color:#02061799}.bg-slate-950\/70{background-color:#020617b3}.bg-slate-950\/80{background-color:#020617cc}.bg-transparent{background-color:transparent}.bg-violet-500\/10{background-color:#8b5cf61a}.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))}.bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--tw-gradient-stops))}.from-emerald-600{--tw-gradient-from: #059669 var(--tw-gradient-from-position);--tw-gradient-to: rgb(5 150 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-950{--tw-gradient-from: #020617 var(--tw-gradient-from-position);--tw-gradient-to: rgb(2 6 23 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-slate-200{--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #e2e8f0 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-slate-900{--tw-gradient-to: rgb(15 23 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #0f172a var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-indigo-950\/40{--tw-gradient-to: rgb(30 27 75 / .4) var(--tw-gradient-to-position)}.to-slate-400{--tw-gradient-to: #94a3b8 var(--tw-gradient-to-position)}.to-teal-600{--tw-gradient-to: #0d9488 var(--tw-gradient-to-position)}.to-violet-500{--tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.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-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-16{padding-top:4rem;padding-bottom:4rem}.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-3\.5{padding-top:.875rem;padding-bottom:.875rem}.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-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pr-1{padding-right:.25rem}.pr-4{padding-right:1rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-\[\'Inter\'\,system-ui\,-apple-system\,sans-serif\]{font-family:Inter,system-ui,-apple-system,sans-serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.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-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-tight{letter-spacing:-.025em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-400\/80{color:#34d399cc}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-rose-300{--tw-text-opacity: 1;color:rgb(253 164 175 / var(--tw-text-opacity, 1))}.text-rose-400{--tw-text-opacity: 1;color:rgb(251 113 133 / var(--tw-text-opacity, 1))}.text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity, 1))}.text-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.opacity-70{opacity:.7}.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-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)}.shadow-emerald-500\/10{--tw-shadow-color: rgb(16 185 129 / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-emerald-600\/30{--tw-shadow-color: rgb(5 150 105 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-indigo-500\/20{--tw-shadow-color: rgb(99 102 241 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-indigo-500\/25{--tw-shadow-color: rgb(99 102 241 / .25);--tw-shadow: var(--tw-shadow-colored)}.shadow-indigo-600\/25{--tw-shadow-color: rgb(79 70 229 / .25);--tw-shadow: var(--tw-shadow-colored)}.shadow-indigo-600\/30{--tw-shadow-color: rgb(79 70 229 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-sky-600\/25{--tw-shadow-color: rgb(2 132 199 / .25);--tw-shadow: var(--tw-shadow-colored)}.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-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-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-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.glass-panel{border-radius:1rem;border-width:1px;border-color:#1e293bcc;background-color:#0f172ab3;--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);--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)}.glass-card{border-radius:.75rem;border-width:1px;border-color:#33415580;background-color:#1e293b66;--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);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.glass-card:hover{border-color:#475569b3;background-color:#1e293b99}.hover\:border-slate-700:hover{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.hover\:bg-amber-500\/20:hover{background-color:#f59e0b33}.hover\:bg-emerald-500:hover{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-500:hover{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-600\/20:hover{background-color:#4f46e533}.hover\:bg-rose-500\/10:hover{background-color:#f43f5e1a}.hover\:bg-sky-500:hover{--tw-bg-opacity: 1;background-color:rgb(14 165 233 / var(--tw-bg-opacity, 1))}.hover\:bg-sky-600\/20:hover{background-color:#0284c733}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800\/25:hover{background-color:#1e293b40}.hover\:bg-slate-800\/30:hover{background-color:#1e293b4d}.hover\:bg-slate-800\/80:hover{background-color:#1e293bcc}.hover\:bg-slate-900:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:from-emerald-500:hover{--tw-gradient-from: #10b981 var(--tw-gradient-from-position);--tw-gradient-to: rgb(16 185 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-teal-500:hover{--tw-gradient-to: #14b8a6 var(--tw-gradient-to-position)}.hover\:text-rose-400:hover{--tw-text-opacity: 1;color:rgb(251 113 133 / var(--tw-text-opacity, 1))}.hover\:text-sky-300:hover{--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:opacity-100:hover{opacity:1}.focus\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0: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(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\: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-emerald-500\/50:focus{--tw-ring-color: rgb(16 185 129 / .5)}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-indigo-500\/50:focus{--tw-ring-color: rgb(99 102 241 / .5)}.focus\:ring-sky-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(14 165 233 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}@media(min-width:640px){.sm\:flex{display:flex}.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\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:self-auto{align-self:auto}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media(min-width:768px){.md\:flex{display:flex}}@media(min-width:1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:col-span-5{grid-column:span 5 / span 5}.lg\:col-span-7{grid-column:span 7 / span 7}.lg\:grid-cols-12{grid-template-columns:repeat(12,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\:px-8{padding-left:2rem;padding-right:2rem}} ================================================================================ FILE: src/Server/ClassNotify.Server/wwwroot/assets/index-tQkPyOQJ.js ================================================================================ function Xf(a,c){for(var u=0;uf[m]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))f(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const N of v.addedNodes)N.tagName==="LINK"&&N.rel==="modulepreload"&&f(N)}).observe(document,{childList:!0,subtree:!0});function u(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function f(m){if(m.ep)return;m.ep=!0;const v=u(m);fetch(m.href,v)}})();function zc(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Gi={exports:{}},zr={},Xi={exports:{}},te={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var pc;function qf(){if(pc)return te;pc=1;var a=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),N=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),E=Symbol.iterator;function O(x){return x===null||typeof x!="object"?null:(x=E&&x[E]||x["@@iterator"],typeof x=="function"?x:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,F={};function I(x,L,ee){this.props=x,this.context=L,this.refs=F,this.updater=ee||G}I.prototype.isReactComponent={},I.prototype.setState=function(x,L){if(typeof x!="object"&&typeof x!="function"&&x!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,x,L,"setState")},I.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function Z(){}Z.prototype=I.prototype;function W(x,L,ee){this.props=x,this.context=L,this.refs=F,this.updater=ee||G}var U=W.prototype=new Z;U.constructor=W,z(U,I.prototype),U.isPureReactComponent=!0;var re=Array.isArray,J=Object.prototype.hasOwnProperty,ge={current:null},De={key:!0,ref:!0,__self:!0,__source:!0};function He(x,L,ee){var ne,se={},ie=null,de=null;if(L!=null)for(ne in L.ref!==void 0&&(de=L.ref),L.key!==void 0&&(ie=""+L.key),L)J.call(L,ne)&&!De.hasOwnProperty(ne)&&(se[ne]=L[ne]);var ue=arguments.length-2;if(ue===1)se.children=ee;else if(1>>1,L=D[x];if(0>>1;xm(se,b))iem(de,se)?(D[x]=de,D[ie]=b,x=ie):(D[x]=se,D[ne]=b,x=ne);else if(iem(de,b))D[x]=de,D[ie]=b,x=ie;else break e}}return X}function m(D,X){var b=D.sortIndex-X.sortIndex;return b!==0?b:D.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var v=performance;a.unstable_now=function(){return v.now()}}else{var N=Date,C=N.now();a.unstable_now=function(){return N.now()-C}}var w=[],S=[],P=1,E=null,O=3,G=!1,z=!1,F=!1,I=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(D){for(var X=u(S);X!==null;){if(X.callback===null)f(S);else if(X.startTime<=D)f(S),X.sortIndex=X.expirationTime,c(w,X);else break;X=u(S)}}function re(D){if(F=!1,U(D),!z)if(u(w)!==null)z=!0,We(J);else{var X=u(S);X!==null&&Ne(re,X.startTime-D)}}function J(D,X){z=!1,F&&(F=!1,Z(He),He=-1),G=!0;var b=O;try{for(U(X),E=u(w);E!==null&&(!(E.expirationTime>X)||D&&!Et());){var x=E.callback;if(typeof x=="function"){E.callback=null,O=E.priorityLevel;var L=x(E.expirationTime<=X);X=a.unstable_now(),typeof L=="function"?E.callback=L:E===u(w)&&f(w),U(X)}else f(w);E=u(w)}if(E!==null)var ee=!0;else{var ne=u(S);ne!==null&&Ne(re,ne.startTime-X),ee=!1}return ee}finally{E=null,O=b,G=!1}}var ge=!1,De=null,He=-1,Y=5,Pe=-1;function Et(){return!(a.unstable_now()-PeD||125x?(D.sortIndex=b,c(S,D),u(w)===null&&D===u(S)&&(F?(Z(He),He=-1):F=!0,Ne(re,b-x))):(D.sortIndex=L,c(w,D),z||G||(z=!0,We(J))),D},a.unstable_shouldYield=Et,a.unstable_wrapCallback=function(D){var X=O;return function(){var b=O;O=X;try{return D.apply(this,arguments)}finally{O=b}}}})(Zi)),Zi}var vc;function np(){return vc||(vc=1,Ji.exports=tp()),Ji.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yc;function rp(){if(yc)return qe;yc=1;var a=oa(),c=np();function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),w=Object.prototype.hasOwnProperty,S=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,P={},E={};function O(e){return w.call(E,e)?!0:w.call(P,e)?!1:S.test(e)?E[e]=!0:(P[e]=!0,!1)}function G(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z(e,t,n,r){if(t===null||typeof t>"u"||G(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function F(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){I[e]=new F(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];I[t]=new F(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){I[e]=new F(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){I[e]=new F(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){I[e]=new F(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){I[e]=new F(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){I[e]=new F(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){I[e]=new F(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){I[e]=new F(e,5,!1,e.toLowerCase(),null,!1,!1)});var Z=/[\-:]([a-z])/g;function W(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Z,W);I[t]=new F(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Z,W);I[t]=new F(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Z,W);I[t]=new F(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){I[e]=new F(e,1,!1,e.toLowerCase(),null,!1,!1)}),I.xlinkHref=new F("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){I[e]=new F(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,n,r){var l=I.hasOwnProperty(t)?I[t]:null;(l!==null?l.type!==0:r||!(2d||l[o]!==i[d]){var p=` `+l[o].replace(" at new "," at ");return e.displayName&&p.includes("")&&(p=p.replace("",e.displayName)),p}while(1<=o&&0<=d);break}}}finally{ee=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function se(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return""}}function ie(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case De:return"Fragment";case ge:return"Portal";case Y:return"Profiler";case He:return"StrictMode";case be:return"Suspense";case dt:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Et:return(e.displayName||"Context")+".Consumer";case Pe:return(e._context.displayName||"Context")+".Provider";case lt:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wt:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case We:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ie(t);case 8:return t===He?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ue(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ze(e){var t=he(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dr(e){e._valueTracker||(e._valueTracker=Ze(e))}function va(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=he(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ns(e,t){var n=t.checked;return b({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ya(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ue(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wa(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function rs(e,t){wa(e,t);var n=ue(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ls(e,t.type,n):t.hasOwnProperty("defaultValue")&&ls(e,t.type,ue(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Na(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ls(e,t,n){(t!=="number"||Fr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Kn=Array.isArray;function yn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zc=["Webkit","ms","Moz","O"];Object.keys(Gn).forEach(function(e){Zc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gn[t]=Gn[e]})});function _a(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gn.hasOwnProperty(e)&&Gn[e]?(""+t).trim():t+"px"}function Pa(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=_a(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var ed=b({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function as(e,t){if(t){if(ed[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function os(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var us=null;function cs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ds=null,wn=null,Nn=null;function La(e){if(e=gr(e)){if(typeof ds!="function")throw Error(u(280));var t=e.stateNode;t&&(t=al(t),ds(e.stateNode,e.type,t))}}function Ta(e){wn?Nn?Nn.push(e):Nn=[e]:wn=e}function Ra(){if(wn){var e=wn,t=Nn;if(Nn=wn=null,La(e),t)for(e=0;e>>=0,e===0?32:31-(dd(e)/fd|0)|0}var Vr=64,Hr=4194304;function Zn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var d=o&~l;d!==0?r=Zn(d):(i&=o,i!==0&&(r=Zn(i)))}else o=n&~l,o!==0?r=Zn(o):i!==0&&(r=Zn(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ft(t),e[t]=n}function xd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=or),so=" ",io=!1;function ao(e,t){switch(e){case"keyup":return Hd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sn=!1;function Qd(e,t){switch(e){case"compositionend":return oo(t);case"keypress":return t.which!==32?null:(io=!0,so);case"textInput":return e=t.data,e===so&&io?null:e;default:return null}}function Kd(e,t){if(Sn)return e==="compositionend"||!Ls&&ao(e,t)?(e=Za(),Xr=ks=$t=null,Sn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xo(n)}}function vo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yo(){for(var e=window,t=Fr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fr(e.document)}return t}function zs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nf(e){var t=yo(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vo(n.ownerDocument.documentElement,n)){if(r!==null&&zs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=go(n,i);var o=go(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Cn=null,Ms=null,fr=null,Is=!1;function wo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Is||Cn==null||Cn!==Fr(r)||(r=Cn,"selectionStart"in r&&zs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),fr&&dr(fr,r)||(fr=r,r=ll(Ms,"onSelect"),0Tn||(e.current=Qs[Tn],Qs[Tn]=null,Tn--)}function fe(e,t){Tn++,Qs[Tn]=e.current,e.current=t}var Ht={},Fe=Vt(Ht),Qe=Vt(!1),on=Ht;function Rn(e,t){var n=e.type.contextTypes;if(!n)return Ht;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ke(e){return e=e.childContextTypes,e!=null}function ol(){me(Qe),me(Fe)}function Oo(e,t,n){if(Fe.current!==Ht)throw Error(u(168));fe(Fe,t),fe(Qe,n)}function Do(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(u(108,de(e)||"Unknown",l));return b({},n,r)}function ul(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,on=Fe.current,fe(Fe,e),fe(Qe,Qe.current),!0}function Fo(e,t,n){var r=e.stateNode;if(!r)throw Error(u(169));n?(e=Do(e,t,on),r.__reactInternalMemoizedMergedChildContext=e,me(Qe),me(Fe),fe(Fe,e)):me(Qe),fe(Qe,n)}var Pt=null,cl=!1,Ks=!1;function Ao(e){Pt===null?Pt=[e]:Pt.push(e)}function hf(e){cl=!0,Ao(e)}function Wt(){if(!Ks&&Pt!==null){Ks=!0;var e=0,t=ce;try{var n=Pt;for(ce=1;e>=o,l-=o,Lt=1<<32-ft(t)+l|n<q?(Me=K,K=null):Me=K.sibling;var ae=_(g,K,y[q],M);if(ae===null){K===null&&(K=Me);break}e&&K&&ae.alternate===null&&t(g,K),h=i(ae,h,q),Q===null?H=ae:Q.sibling=ae,Q=ae,K=Me}if(q===y.length)return n(g,K),xe&&cn(g,q),H;if(K===null){for(;qq?(Me=K,K=null):Me=K.sibling;var en=_(g,K,ae.value,M);if(en===null){K===null&&(K=Me);break}e&&K&&en.alternate===null&&t(g,K),h=i(en,h,q),Q===null?H=en:Q.sibling=en,Q=en,K=Me}if(ae.done)return n(g,K),xe&&cn(g,q),H;if(K===null){for(;!ae.done;q++,ae=y.next())ae=R(g,ae.value,M),ae!==null&&(h=i(ae,h,q),Q===null?H=ae:Q.sibling=ae,Q=ae);return xe&&cn(g,q),H}for(K=r(g,K);!ae.done;q++,ae=y.next())ae=A(K,g,q,ae.value,M),ae!==null&&(e&&ae.alternate!==null&&K.delete(ae.key===null?q:ae.key),h=i(ae,h,q),Q===null?H=ae:Q.sibling=ae,Q=ae);return e&&K.forEach(function(Gf){return t(g,Gf)}),xe&&cn(g,q),H}function Se(g,h,y,M){if(typeof y=="object"&&y!==null&&y.type===De&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case J:e:{for(var H=y.key,Q=h;Q!==null;){if(Q.key===H){if(H=y.type,H===De){if(Q.tag===7){n(g,Q.sibling),h=l(Q,y.props.children),h.return=g,g=h;break e}}else if(Q.elementType===H||typeof H=="object"&&H!==null&&H.$$typeof===We&&Ho(H)===Q.type){n(g,Q.sibling),h=l(Q,y.props),h.ref=vr(g,Q,y),h.return=g,g=h;break e}n(g,Q);break}else t(g,Q);Q=Q.sibling}y.type===De?(h=vn(y.props.children,g.mode,M,y.key),h.return=g,g=h):(M=Al(y.type,y.key,y.props,null,g.mode,M),M.ref=vr(g,h,y),M.return=g,g=M)}return o(g);case ge:e:{for(Q=y.key;h!==null;){if(h.key===Q)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){n(g,h.sibling),h=l(h,y.children||[]),h.return=g,g=h;break e}else{n(g,h);break}else t(g,h);h=h.sibling}h=Hi(y,g.mode,M),h.return=g,g=h}return o(g);case We:return Q=y._init,Se(g,h,Q(y._payload),M)}if(Kn(y))return B(g,h,y,M);if(X(y))return V(g,h,y,M);ml(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,h!==null&&h.tag===6?(n(g,h.sibling),h=l(h,y),h.return=g,g=h):(n(g,h),h=Vi(y,g.mode,M),h.return=g,g=h),o(g)):n(g,h)}return Se}var On=Wo(!0),Qo=Wo(!1),hl=Vt(null),xl=null,Dn=null,Zs=null;function ei(){Zs=Dn=xl=null}function ti(e){var t=hl.current;me(hl),e._currentValue=t}function ni(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fn(e,t){xl=e,Zs=Dn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ye=!0),e.firstContext=null)}function at(e){var t=e._currentValue;if(Zs!==e)if(e={context:e,memoizedValue:t,next:null},Dn===null){if(xl===null)throw Error(u(308));Dn=e,xl.dependencies={lanes:0,firstContext:e}}else Dn=Dn.next=e;return t}var dn=null;function ri(e){dn===null?dn=[e]:dn.push(e)}function Ko(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ri(t)):(n.next=l.next,l.next=n),t.interleaved=n,Rt(e,r)}function Rt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Qt=!1;function li(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function zt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Kt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(le&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Rt(e,n)}return l=r.interleaved,l===null?(t.next=t,ri(r)):(t.next=l.next,l.next=t),r.interleaved=t,Rt(e,n)}function gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vs(e,n)}}function Go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vl(e,t,n,r){var l=e.updateQueue;Qt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,d=l.shared.pending;if(d!==null){l.shared.pending=null;var p=d,j=p.next;p.next=null,o===null?i=j:o.next=j,o=p;var T=e.alternate;T!==null&&(T=T.updateQueue,d=T.lastBaseUpdate,d!==o&&(d===null?T.firstBaseUpdate=j:d.next=j,T.lastBaseUpdate=p))}if(i!==null){var R=l.baseState;o=0,T=j=p=null,d=i;do{var _=d.lane,A=d.eventTime;if((r&_)===_){T!==null&&(T=T.next={eventTime:A,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var B=e,V=d;switch(_=t,A=n,V.tag){case 1:if(B=V.payload,typeof B=="function"){R=B.call(A,R,_);break e}R=B;break e;case 3:B.flags=B.flags&-65537|128;case 0:if(B=V.payload,_=typeof B=="function"?B.call(A,R,_):B,_==null)break e;R=b({},R,_);break e;case 2:Qt=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,_=l.effects,_===null?l.effects=[d]:_.push(d))}else A={eventTime:A,lane:_,tag:d.tag,payload:d.payload,callback:d.callback,next:null},T===null?(j=T=A,p=R):T=T.next=A,o|=_;if(d=d.next,d===null){if(d=l.shared.pending,d===null)break;_=d,d=_.next,_.next=null,l.lastBaseUpdate=_,l.shared.pending=null}}while(!0);if(T===null&&(p=R),l.baseState=p,l.firstBaseUpdate=j,l.lastBaseUpdate=T,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);mn|=o,e.lanes=o,e.memoizedState=R}}function Xo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ui.transition;ui.transition={};try{e(!1),t()}finally{ce=n,ui.transition=r}}function hu(){return ot().memoizedState}function yf(e,t,n){var r=qt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xu(e))gu(t,n);else if(n=Ko(e,t,n,r),n!==null){var l=Ve();vt(n,e,r,l),vu(n,t,r)}}function wf(e,t,n){var r=qt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xu(e))gu(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,d=i(o,n);if(l.hasEagerState=!0,l.eagerState=d,pt(d,o)){var p=t.interleaved;p===null?(l.next=l,ri(t)):(l.next=p.next,p.next=l),t.interleaved=l;return}}catch{}finally{}n=Ko(e,t,l,r),n!==null&&(l=Ve(),vt(n,e,r,l),vu(n,t,r))}}function xu(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function gu(e,t){jr=Nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vs(e,n)}}var Sl={readContext:at,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useInsertionEffect:Ae,useLayoutEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useMutableSource:Ae,useSyncExternalStore:Ae,useId:Ae,unstable_isNewReconciler:!1},Nf={readContext:at,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:au,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,jl(4194308,4,cu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return jl(4194308,4,e,t)},useInsertionEffect:function(e,t){return jl(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yf.bind(null,ye,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:su,useDebugValue:xi,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=su(!1),t=e[0];return e=vf.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ye,l=St();if(xe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),ze===null)throw Error(u(349));(pn&30)!==0||eu(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,au(nu.bind(null,r,i,e),[e]),r.flags|=2048,Cr(9,tu.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=St(),t=ze.identifierPrefix;if(xe){var n=Tt,r=Lt;n=(r&~(1<<32-ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=kr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[jt]=t,e[xr]=r,Au(e,t,!1,!1),t.stateNode=e;e:{switch(o=os(n,r),n){case"dialog":pe("cancel",e),pe("close",e),l=r;break;case"iframe":case"object":case"embed":pe("load",e),l=r;break;case"video":case"audio":for(l=0;lBn&&(t.flags|=128,r=!0,Er(i,!1),t.lanes=4194304)}else{if(!r)if(e=yl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Er(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!xe)return Ue(t),null}else 2*ke()-i.renderingStartTime>Bn&&n!==1073741824&&(t.flags|=128,r=!0,Er(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ke(),t.sibling=null,n=ve.current,fe(ve,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return $i(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(rt&1073741824)!==0&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function Lf(e,t){switch(Gs(t),t.tag){case 1:return Ke(t.type)&&ol(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return An(),me(Qe),me(Fe),oi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ii(t),null;case 13:if(me(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));In()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(ve),null;case 4:return An(),null;case 10:return ti(t.type._context),null;case 22:case 23:return $i(),null;case 24:return null;default:return null}}var Pl=!1,$e=!1,Tf=typeof WeakSet=="function"?WeakSet:Set,$=null;function $n(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function Pi(e,t,n){try{n()}catch(r){je(e,t,r)}}var bu=!1;function Rf(e,t){if($s=Yr,e=yo(),zs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,d=-1,p=-1,j=0,T=0,R=e,_=null;t:for(;;){for(var A;R!==n||l!==0&&R.nodeType!==3||(d=o+l),R!==i||r!==0&&R.nodeType!==3||(p=o+r),R.nodeType===3&&(o+=R.nodeValue.length),(A=R.firstChild)!==null;)_=R,R=A;for(;;){if(R===e)break t;if(_===n&&++j===l&&(d=o),_===i&&++T===r&&(p=o),(A=R.nextSibling)!==null)break;R=_,_=R.parentNode}R=A}n=d===-1||p===-1?null:{start:d,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for(bs={focusedElem:e,selectionRange:n},Yr=!1,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var B=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(B!==null){var V=B.memoizedProps,Se=B.memoizedState,g=t.stateNode,h=g.getSnapshotBeforeUpdate(t.elementType===t.type?V:ht(t.type,V),Se);g.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(M){je(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return B=bu,bu=!1,B}function _r(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Pi(t,n,i)}l=l.next}while(l!==r)}}function Ll(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Li(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bu(e){var t=e.alternate;t!==null&&(e.alternate=null,Bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jt],delete t[xr],delete t[Ws],delete t[pf],delete t[mf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vu(e){return e.tag===5||e.tag===3||e.tag===4}function Hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ti(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=il));else if(r!==4&&(e=e.child,e!==null))for(Ti(e,t,n),e=e.sibling;e!==null;)Ti(e,t,n),e=e.sibling}function Ri(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ri(e,t,n),e=e.sibling;e!==null;)Ri(e,t,n),e=e.sibling}var Ie=null,xt=!1;function Yt(e,t,n){for(n=n.child;n!==null;)Wu(e,t,n),n=n.sibling}function Wu(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Br,n)}catch{}switch(n.tag){case 5:$e||$n(n,t);case 6:var r=Ie,l=xt;Ie=null,Yt(e,t,n),Ie=r,xt=l,Ie!==null&&(xt?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&(xt?(e=Ie,n=n.stateNode,e.nodeType===8?Hs(e.parentNode,n):e.nodeType===1&&Hs(e,n),sr(e)):Hs(Ie,n.stateNode));break;case 4:r=Ie,l=xt,Ie=n.stateNode.containerInfo,xt=!0,Yt(e,t,n),Ie=r,xt=l;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&((i&2)!==0||(i&4)!==0)&&Pi(n,t,o),l=l.next}while(l!==r)}Yt(e,t,n);break;case 1:if(!$e&&($n(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){je(n,t,d)}Yt(e,t,n);break;case 21:Yt(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,Yt(e,t,n),$e=r):Yt(e,t,n);break;default:Yt(e,t,n)}}function Qu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Tf),t.forEach(function(r){var l=$f.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function gt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Mf(r/1960))-r,10e?16:e,Xt===null)var r=!1;else{if(e=Xt,Xt=null,Il=0,(le&6)!==0)throw Error(u(331));var l=le;for(le|=4,$=e.current;$!==null;){var i=$,o=i.child;if(($.flags&16)!==0){var d=i.deletions;if(d!==null){for(var p=0;pke()-Ii?xn(e,0):Mi|=n),Xe(e,t)}function sc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Hr,Hr<<=1,(Hr&130023424)===0&&(Hr=4194304)));var n=Ve();e=Rt(e,t),e!==null&&(er(e,t,n),Xe(e,n))}function Uf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sc(e,n)}function $f(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(u(314))}r!==null&&r.delete(t),sc(e,n)}var ic;ic=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)Ye=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Ye=!1,_f(e,t,n);Ye=(e.flags&131072)!==0}else Ye=!1,xe&&(t.flags&1048576)!==0&&Uo(t,fl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_l(e,t),e=t.pendingProps;var l=Rn(t,Fe.current);Fn(t,n),l=di(null,t,r,e,l,n);var i=fi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(i=!0,ul(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,li(t),l.updater=Cl,t.stateNode=l,l._reactInternals=t,vi(t,r,e,n),t=ji(null,t,r,!0,i,n)):(t.tag=0,xe&&i&&Ys(t),Be(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_l(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Bf(r),e=ht(r,e),l){case 0:t=Ni(null,t,r,e,n);break e;case 1:t=zu(null,t,r,e,n);break e;case 11:t=_u(null,t,r,e,n);break e;case 14:t=Pu(null,t,r,ht(r.type,e),n);break e}throw Error(u(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),Ni(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),zu(e,t,r,l,n);case 3:e:{if(Mu(t),e===null)throw Error(u(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Yo(e,t),vl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Un(Error(u(423)),t),t=Iu(e,t,r,n,l);break e}else if(r!==l){l=Un(Error(u(424)),t),t=Iu(e,t,r,n,l);break e}else for(nt=Bt(t.stateNode.containerInfo.firstChild),tt=t,xe=!0,mt=null,n=Qo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(In(),r===l){t=Mt(e,t,n);break e}Be(e,t,r,n)}t=t.child}return t;case 5:return qo(t),e===null&&qs(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Bs(r,l)?o=null:i!==null&&Bs(r,i)&&(t.flags|=32),Ru(e,t),Be(e,t,o,n),t.child;case 6:return e===null&&qs(t),null;case 13:return Ou(e,t,n);case 4:return si(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=On(t,null,r,n):Be(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),_u(e,t,r,l,n);case 7:return Be(e,t,t.pendingProps,n),t.child;case 8:return Be(e,t,t.pendingProps.children,n),t.child;case 12:return Be(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,fe(hl,r._currentValue),r._currentValue=o,i!==null)if(pt(i.value,o)){if(i.children===l.children&&!Qe.current){t=Mt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var d=i.dependencies;if(d!==null){o=i.child;for(var p=d.firstContext;p!==null;){if(p.context===r){if(i.tag===1){p=zt(-1,n&-n),p.tag=2;var j=i.updateQueue;if(j!==null){j=j.shared;var T=j.pending;T===null?p.next=p:(p.next=T.next,T.next=p),j.pending=p}}i.lanes|=n,p=i.alternate,p!==null&&(p.lanes|=n),ni(i.return,n,t),d.lanes|=n;break}p=p.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(u(341));o.lanes|=n,d=o.alternate,d!==null&&(d.lanes|=n),ni(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Be(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Fn(t,n),l=at(l),r=r(l),t.flags|=1,Be(e,t,r,n),t.child;case 14:return r=t.type,l=ht(r,t.pendingProps),l=ht(r.type,l),Pu(e,t,r,l,n);case 15:return Lu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),_l(e,t),t.tag=1,Ke(r)?(e=!0,ul(t)):e=!1,Fn(t,n),wu(t,r,l),vi(t,r,l,n),ji(null,t,r,!0,e,n);case 19:return Fu(e,t,n);case 22:return Tu(e,t,n)}throw Error(u(156,t.tag))};function ac(e,t){return Ua(e,t)}function bf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ct(e,t,n,r){return new bf(e,t,n,r)}function Bi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bf(e){if(typeof e=="function")return Bi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lt)return 11;if(e===wt)return 14}return 2}function Zt(e,t){var n=e.alternate;return n===null?(n=ct(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Al(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Bi(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case De:return vn(n.children,l,i,t);case He:o=8,l|=8;break;case Y:return e=ct(12,n,t,l|2),e.elementType=Y,e.lanes=i,e;case be:return e=ct(13,n,t,l),e.elementType=be,e.lanes=i,e;case dt:return e=ct(19,n,t,l),e.elementType=dt,e.lanes=i,e;case Ne:return Ul(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pe:o=10;break e;case Et:o=9;break e;case lt:o=11;break e;case wt:o=14;break e;case We:o=16,r=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=ct(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function vn(e,t,n,r){return e=ct(7,e,r,t),e.lanes=n,e}function Ul(e,t,n,r){return e=ct(22,e,r,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function Vi(e,t,n){return e=ct(6,e,null,t),e.lanes=n,e}function Hi(e,t,n){return t=ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gs(0),this.expirationTimes=gs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gs(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Wi(e,t,n,r,l,i,o,d,p){return e=new Vf(e,t,n,d,p),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ct(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},li(i),e}function Hf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(c){console.error(c)}}return a(),qi.exports=rp(),qi.exports}var Nc;function lp(){if(Nc)return Ql;Nc=1;var a=Ic();return Ql.createRoot=a.createRoot,Ql.hydrateRoot=a.hydrateRoot,Ql}var sp=lp();const ip=zc(sp);Ic();/** * @remix-run/router v1.23.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Mr(){return Mr=Object.assign?Object.assign.bind():function(a){for(var c=1;c"u")throw new Error(c)}function Oc(a,c){if(!a){typeof console<"u"&&console.warn(c);try{throw new Error(c)}catch{}}}function op(){return Math.random().toString(36).substr(2,8)}function kc(a,c){return{usr:a.state,key:a.key,idx:c}}function ta(a,c,u,f){return u===void 0&&(u=null),Mr({pathname:typeof a=="string"?a:a.pathname,search:"",hash:""},typeof c=="string"?Hn(c):c,{state:u,key:c&&c.key||f||op()})}function Kl(a){let{pathname:c="/",search:u="",hash:f=""}=a;return u&&u!=="?"&&(c+=u.charAt(0)==="?"?u:"?"+u),f&&f!=="#"&&(c+=f.charAt(0)==="#"?f:"#"+f),c}function Hn(a){let c={};if(a){let u=a.indexOf("#");u>=0&&(c.hash=a.substr(u),a=a.substr(0,u));let f=a.indexOf("?");f>=0&&(c.search=a.substr(f),a=a.substr(0,f)),a&&(c.pathname=a)}return c}function up(a,c,u,f){f===void 0&&(f={});let{window:m=document.defaultView,v5Compat:v=!1}=f,N=m.history,C=tn.Pop,w=null,S=P();S==null&&(S=0,N.replaceState(Mr({},N.state,{idx:S}),""));function P(){return(N.state||{idx:null}).idx}function E(){C=tn.Pop;let I=P(),Z=I==null?null:I-S;S=I,w&&w({action:C,location:F.location,delta:Z})}function O(I,Z){C=tn.Push;let W=ta(F.location,I,Z);S=P()+1;let U=kc(W,S),re=F.createHref(W);try{N.pushState(U,"",re)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;m.location.assign(re)}v&&w&&w({action:C,location:F.location,delta:1})}function G(I,Z){C=tn.Replace;let W=ta(F.location,I,Z);S=P();let U=kc(W,S),re=F.createHref(W);N.replaceState(U,"",re),v&&w&&w({action:C,location:F.location,delta:0})}function z(I){let Z=m.location.origin!=="null"?m.location.origin:m.location.href,W=typeof I=="string"?I:Kl(I);return W=W.replace(/ $/,"%20"),Ce(Z,"No window.location.(origin|href) available to create URL for href: "+W),new URL(W,Z)}let F={get action(){return C},get location(){return a(m,N)},listen(I){if(w)throw new Error("A history only accepts one active listener");return m.addEventListener(jc,E),w=I,()=>{m.removeEventListener(jc,E),w=null}},createHref(I){return c(m,I)},createURL:z,encodeLocation(I){let Z=z(I);return{pathname:Z.pathname,search:Z.search,hash:Z.hash}},push:O,replace:G,go(I){return N.go(I)}};return F}var Sc;(function(a){a.data="data",a.deferred="deferred",a.redirect="redirect",a.error="error"})(Sc||(Sc={}));function cp(a,c,u){return u===void 0&&(u="/"),dp(a,c,u)}function dp(a,c,u,f){let m=typeof c=="string"?Hn(c):c,v=ua(m.pathname||"/",u);if(v==null)return null;let N=Dc(a);fp(N);let C=null,w=Sp(v);for(let S=0;C==null&&S{let w={relativePath:C===void 0?v.path||"":C,caseSensitive:v.caseSensitive===!0,childrenIndex:N,route:v};w.relativePath.startsWith("/")&&(Ce(w.relativePath.startsWith(f),'Absolute route path "'+w.relativePath+'" nested under path '+('"'+f+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),w.relativePath=w.relativePath.slice(f.length));let S=nn([f,w.relativePath]),P=u.concat(w);v.children&&v.children.length>0&&(Ce(v.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+S+'".')),Dc(v.children,c,P,S)),!(v.path==null&&!v.index)&&c.push({path:S,score:yp(S,v.index),routesMeta:P})};return a.forEach((v,N)=>{var C;if(v.path===""||!((C=v.path)!=null&&C.includes("?")))m(v,N);else for(let w of Fc(v.path))m(v,N,w)}),c}function Fc(a){let c=a.split("/");if(c.length===0)return[];let[u,...f]=c,m=u.endsWith("?"),v=u.replace(/\?$/,"");if(f.length===0)return m?[v,""]:[v];let N=Fc(f.join("/")),C=[];return C.push(...N.map(w=>w===""?v:[v,w].join("/"))),m&&C.push(...N),C.map(w=>a.startsWith("/")&&w===""?"/":w)}function fp(a){a.sort((c,u)=>c.score!==u.score?u.score-c.score:wp(c.routesMeta.map(f=>f.childrenIndex),u.routesMeta.map(f=>f.childrenIndex)))}const pp=/^:[\w-]+$/,mp=3,hp=2,xp=1,gp=10,vp=-2,Cc=a=>a==="*";function yp(a,c){let u=a.split("/"),f=u.length;return u.some(Cc)&&(f+=vp),c&&(f+=hp),u.filter(m=>!Cc(m)).reduce((m,v)=>m+(pp.test(v)?mp:v===""?xp:gp),f)}function wp(a,c){return a.length===c.length&&a.slice(0,-1).every((f,m)=>f===c[m])?a[a.length-1]-c[c.length-1]:0}function Np(a,c,u){let{routesMeta:f}=a,m={},v="/",N=[];for(let C=0;C{let{paramName:O,isOptional:G}=P;if(O==="*"){let F=C[E]||"";N=v.slice(0,v.length-F.length).replace(/(.)\/+$/,"$1")}const z=C[E];return G&&!z?S[O]=void 0:S[O]=(z||"").replace(/%2F/g,"/"),S},{}),pathname:v,pathnameBase:N,pattern:a}}function kp(a,c,u){c===void 0&&(c=!1),u===void 0&&(u=!0),Oc(a==="*"||!a.endsWith("*")||a.endsWith("/*"),'Route path "'+a+'" will be treated as if it were '+('"'+a.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+a.replace(/\*$/,"/*")+'".'));let f=[],m="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(N,C,w)=>(f.push({paramName:C,isOptional:w!=null}),w?"/?([^\\/]+)?":"/([^\\/]+)"));return a.endsWith("*")?(f.push({paramName:"*"}),m+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?m+="\\/*$":a!==""&&a!=="/"&&(m+="(?:(?=\\/|$))"),[new RegExp(m,c?void 0:"i"),f]}function Sp(a){try{return a.split("/").map(c=>decodeURIComponent(c).replace(/\//g,"%2F")).join("/")}catch(c){return Oc(!1,'The URL path "'+a+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+c+").")),a}}function ua(a,c){if(c==="/")return a;if(!a.toLowerCase().startsWith(c.toLowerCase()))return null;let u=c.endsWith("/")?c.length-1:c.length,f=a.charAt(u);return f&&f!=="/"?null:a.slice(u)||"/"}function Cp(a,c){c===void 0&&(c="/");let{pathname:u,search:f="",hash:m=""}=typeof a=="string"?Hn(a):a,v;return u?(u=Ac(u),u.startsWith("/")?v=Ec(u.substring(1),"/"):v=Ec(u,c)):v=c,{pathname:v,search:Pp(f),hash:Lp(m)}}function Ec(a,c){let u=c.replace(/\/+$/,"").split("/");return a.split("/").forEach(m=>{m===".."?u.length>1&&u.pop():m!=="."&&u.push(m)}),u.length>1?u.join("/"):"/"}function ea(a,c,u,f){return"Cannot include a '"+a+"' character in a manually specified "+("`to."+c+"` field ["+JSON.stringify(f)+"]. Please separate it out to the ")+("`to."+u+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ep(a){return a.filter((c,u)=>u===0||c.route.path&&c.route.path.length>0)}function ca(a,c){let u=Ep(a);return c?u.map((f,m)=>m===u.length-1?f.pathname:f.pathnameBase):u.map(f=>f.pathnameBase)}function da(a,c,u,f){f===void 0&&(f=!1);let m;typeof a=="string"?m=Hn(a):(m=Mr({},a),Ce(!m.pathname||!m.pathname.includes("?"),ea("?","pathname","search",m)),Ce(!m.pathname||!m.pathname.includes("#"),ea("#","pathname","hash",m)),Ce(!m.search||!m.search.includes("#"),ea("#","search","hash",m)));let v=a===""||m.pathname==="",N=v?"/":m.pathname,C;if(N==null)C=u;else{let E=c.length-1;if(!f&&N.startsWith("..")){let O=N.split("/");for(;O[0]==="..";)O.shift(),E-=1;m.pathname=O.join("/")}C=E>=0?c[E]:"/"}let w=Cp(m,C),S=N&&N!=="/"&&N.endsWith("/"),P=(v||N===".")&&u.endsWith("/");return!w.pathname.endsWith("/")&&(S||P)&&(w.pathname+="/"),w}const Ac=a=>a.replace(/\/\/+/g,"/"),nn=a=>Ac(a.join("/")),_p=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),Pp=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Lp=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function Tp(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}const Uc=["post","put","patch","delete"];new Set(Uc);const Rp=["get",...Uc];new Set(Rp);/** * React Router v6.30.6 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ir(){return Ir=Object.assign?Object.assign.bind():function(a){for(var c=1;c{C.current=!0}),k.useCallback(function(S,P){if(P===void 0&&(P={}),!C.current)return;if(typeof S=="number"){f.go(S);return}let E=da(S,JSON.parse(N),v,P.relative==="path");a==null&&c!=="/"&&(E.pathname=E.pathname==="/"?c:nn([c,E.pathname])),(P.replace?f.replace:f.push)(E,P.state,P)},[c,f,N,v,a])}function Bc(a,c){let{relative:u}=c===void 0?{}:c,{future:f}=k.useContext(rn),{matches:m}=k.useContext(ln),{pathname:v}=Qn(),N=JSON.stringify(ca(m,f.v7_relativeSplatPath));return k.useMemo(()=>da(a,JSON.parse(N),v,u==="path"),[a,N,v,u])}function Op(a,c){return Dp(a,c)}function Dp(a,c,u,f){Wn()||Ce(!1);let{navigator:m}=k.useContext(rn),{matches:v}=k.useContext(ln),N=v[v.length-1],C=N?N.params:{};N&&N.pathname;let w=N?N.pathnameBase:"/";N&&N.route;let S=Qn(),P;if(c){var E;let I=typeof c=="string"?Hn(c):c;w==="/"||(E=I.pathname)!=null&&E.startsWith(w)||Ce(!1),P=I}else P=S;let O=P.pathname||"/",G=O;if(w!=="/"){let I=w.replace(/^\//,"").split("/");G="/"+O.replace(/^\//,"").split("/").slice(I.length).join("/")}let z=cp(a,{pathname:G}),F=bp(z&&z.map(I=>Object.assign({},I,{params:Object.assign({},C,I.params),pathname:nn([w,m.encodeLocation?m.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?w:nn([w,m.encodeLocation?m.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),v,u,f);return c&&F?k.createElement(Jl.Provider,{value:{location:Ir({pathname:"/",search:"",hash:"",state:null,key:"default"},P),navigationType:tn.Pop}},F):F}function Fp(){let a=Wp(),c=Tp(a)?a.status+" "+a.statusText:a instanceof Error?a.message:JSON.stringify(a),u=a instanceof Error?a.stack:null,m={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},c),u?k.createElement("pre",{style:m},u):null,null)}const Ap=k.createElement(Fp,null);class Up extends k.Component{constructor(c){super(c),this.state={location:c.location,revalidation:c.revalidation,error:c.error}}static getDerivedStateFromError(c){return{error:c}}static getDerivedStateFromProps(c,u){return u.location!==c.location||u.revalidation!=="idle"&&c.revalidation==="idle"?{error:c.error,location:c.location,revalidation:c.revalidation}:{error:c.error!==void 0?c.error:u.error,location:u.location,revalidation:c.revalidation||u.revalidation}}componentDidCatch(c,u){console.error("React Router caught the following error during render",c,u)}render(){return this.state.error!==void 0?k.createElement(ln.Provider,{value:this.props.routeContext},k.createElement($c.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $p(a){let{routeContext:c,match:u,children:f}=a,m=k.useContext(fa);return m&&m.static&&m.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(m.staticContext._deepestRenderedBoundaryId=u.route.id),k.createElement(ln.Provider,{value:c},f)}function bp(a,c,u,f){var m;if(c===void 0&&(c=[]),u===void 0&&(u=null),f===void 0&&(f=null),a==null){var v;if(!u)return null;if(u.errors)a=u.matches;else if((v=f)!=null&&v.v7_partialHydration&&c.length===0&&!u.initialized&&u.matches.length>0)a=u.matches;else return null}let N=a,C=(m=u)==null?void 0:m.errors;if(C!=null){let P=N.findIndex(E=>E.route.id&&(C==null?void 0:C[E.route.id])!==void 0);P>=0||Ce(!1),N=N.slice(0,Math.min(N.length,P+1))}let w=!1,S=-1;if(u&&f&&f.v7_partialHydration)for(let P=0;P=0?N=N.slice(0,S+1):N=[N[0]];break}}}return N.reduceRight((P,E,O)=>{let G,z=!1,F=null,I=null;u&&(G=C&&E.route.id?C[E.route.id]:void 0,F=E.route.errorElement||Ap,w&&(S<0&&O===0?(Kp("route-fallback"),z=!0,I=null):S===O&&(z=!0,I=E.route.hydrateFallbackElement||null)));let Z=c.concat(N.slice(0,O+1)),W=()=>{let U;return G?U=F:z?U=I:E.route.Component?U=k.createElement(E.route.Component,null):E.route.element?U=E.route.element:U=P,k.createElement($p,{match:E,routeContext:{outlet:P,matches:Z,isDataRoute:u!=null},children:U})};return u&&(E.route.ErrorBoundary||E.route.errorElement||O===0)?k.createElement(Up,{location:u.location,revalidation:u.revalidation,component:F,error:G,children:W(),routeContext:{outlet:null,matches:Z,isDataRoute:!0}}):W()},null)}var Vc=(function(a){return a.UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a})(Vc||{}),Hc=(function(a){return a.UseBlocker="useBlocker",a.UseLoaderData="useLoaderData",a.UseActionData="useActionData",a.UseRouteError="useRouteError",a.UseNavigation="useNavigation",a.UseRouteLoaderData="useRouteLoaderData",a.UseMatches="useMatches",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a.UseRouteId="useRouteId",a})(Hc||{});function Bp(a){let c=k.useContext(fa);return c||Ce(!1),c}function Vp(a){let c=k.useContext(zp);return c||Ce(!1),c}function Hp(a){let c=k.useContext(ln);return c||Ce(!1),c}function Wc(a){let c=Hp(),u=c.matches[c.matches.length-1];return u.route.id||Ce(!1),u.route.id}function Wp(){var a;let c=k.useContext($c),u=Vp(),f=Wc();return c!==void 0?c:(a=u.errors)==null?void 0:a[f]}function Qp(){let{router:a}=Bp(Vc.UseNavigateStable),c=Wc(Hc.UseNavigateStable),u=k.useRef(!1);return bc(()=>{u.current=!0}),k.useCallback(function(m,v){v===void 0&&(v={}),u.current&&(typeof m=="number"?a.navigate(m):a.navigate(m,Ir({fromRouteId:c},v)))},[a,c])}const _c={};function Kp(a,c,u){_c[a]||(_c[a]=!0)}function Yp(a,c){a==null||a.v7_startTransition,a==null||a.v7_relativeSplatPath}function Ot(a){let{to:c,replace:u,state:f,relative:m}=a;Wn()||Ce(!1);let{future:v,static:N}=k.useContext(rn),{matches:C}=k.useContext(ln),{pathname:w}=Qn(),S=pa(),P=da(c,ca(C,v.v7_relativeSplatPath),w,m==="path"),E=JSON.stringify(P);return k.useEffect(()=>S(JSON.parse(E),{replace:u,state:f,relative:m}),[S,E,m,u,f]),null}function Je(a){Ce(!1)}function Gp(a){let{basename:c="/",children:u=null,location:f,navigationType:m=tn.Pop,navigator:v,static:N=!1,future:C}=a;Wn()&&Ce(!1);let w=c.replace(/^\/*/,"/"),S=k.useMemo(()=>({basename:w,navigator:v,static:N,future:Ir({v7_relativeSplatPath:!1},C)}),[w,C,v,N]);typeof f=="string"&&(f=Hn(f));let{pathname:P="/",search:E="",hash:O="",state:G=null,key:z="default"}=f,F=k.useMemo(()=>{let I=ua(P,w);return I==null?null:{location:{pathname:I,search:E,hash:O,state:G,key:z},navigationType:m}},[w,P,E,O,G,z,m]);return F==null?null:k.createElement(rn.Provider,{value:S},k.createElement(Jl.Provider,{children:u,value:F}))}function Qc(a){let{children:c,location:u}=a;return Op(na(c),u)}new Promise(()=>{});function na(a,c){c===void 0&&(c=[]);let u=[];return k.Children.forEach(a,(f,m)=>{if(!k.isValidElement(f))return;let v=[...c,m];if(f.type===k.Fragment){u.push.apply(u,na(f.props.children,v));return}f.type!==Je&&Ce(!1),!f.props.index||!f.props.children||Ce(!1);let N={id:f.props.id||v.join("-"),caseSensitive:f.props.caseSensitive,element:f.props.element,Component:f.props.Component,index:f.props.index,path:f.props.path,loader:f.props.loader,action:f.props.action,errorElement:f.props.errorElement,ErrorBoundary:f.props.ErrorBoundary,hasErrorBoundary:f.props.ErrorBoundary!=null||f.props.errorElement!=null,shouldRevalidate:f.props.shouldRevalidate,handle:f.props.handle,lazy:f.props.lazy};f.props.children&&(N.children=na(f.props.children,v)),u.push(N)}),u}/** * React Router DOM v6.30.6 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ra(){return ra=Object.assign?Object.assign.bind():function(a){for(var c=1;c{S&&Pc?Pc(()=>w(E)):w(E)},[w,S]);return k.useLayoutEffect(()=>N.listen(P),[N,P]),k.useEffect(()=>Yp(f),[f]),k.createElement(Gp,{basename:c,children:u,location:C.location,navigationType:C.action,navigator:N,future:f})}const rm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yt=k.forwardRef(function(c,u){let{onClick:f,relative:m,reloadDocument:v,replace:N,state:C,target:w,to:S,preventScrollReset:P,viewTransition:E}=c,O=Xp(c,Zp),{basename:G}=k.useContext(rn),z,F=!1;if(typeof S=="string"&&lm.test(S)&&(z=S,rm))try{let U=new URL(window.location.href),re=S.startsWith("//")?new URL(U.protocol+S):new URL(S),J=ua(re.pathname,G);re.origin===U.origin&&J!=null?S=J+re.search+re.hash:F=!0}catch{}let I=Mp(S,{relative:m}),Z=sm(S,{replace:N,state:C,target:w,preventScrollReset:P,relative:m,viewTransition:E});function W(U){f&&f(U),U.defaultPrevented||Z(U)}return k.createElement("a",ra({},O,{href:z||I,onClick:F||v?f:W,ref:u,target:w}))});var Lc;(function(a){a.UseScrollRestoration="useScrollRestoration",a.UseSubmit="useSubmit",a.UseSubmitFetcher="useSubmitFetcher",a.UseFetcher="useFetcher",a.useViewTransitionState="useViewTransitionState"})(Lc||(Lc={}));var Tc;(function(a){a.UseFetcher="useFetcher",a.UseFetchers="useFetchers",a.UseScrollRestoration="useScrollRestoration"})(Tc||(Tc={}));function sm(a,c){let{target:u,replace:f,state:m,preventScrollReset:v,relative:N,viewTransition:C}=c===void 0?{}:c,w=pa(),S=Qn(),P=Bc(a,{relative:N});return k.useCallback(E=>{if(Jp(E,u)){E.preventDefault();let O=f!==void 0?f:Kl(S)===Kl(P);w(a,{replace:O,state:m,preventScrollReset:v,relative:N,viewTransition:C})}},[S,w,P,f,m,u,a,v,N,C])}const im="/api";function la(){return localStorage.getItem("classnotify_token")}function am(a){localStorage.setItem("classnotify_token",a)}function sa(){localStorage.removeItem("classnotify_token"),localStorage.removeItem("classnotify_user")}async function _e(a,c={}){const u=la(),f={"Content-Type":"application/json",...c.headers};u&&(f.Authorization=`Bearer ${u}`);const m=await fetch(`${im}${a}`,{...c,headers:f});if(m.status===401)throw sa(),window.location.href="/login",new Error("未授权或登录已过期,请重新登录");if(!m.ok){let v=`请求失败 (${m.status})`;try{const N=await m.json();v=N.message||N.errorMessage||v}catch{}throw new Error(v)}return m.json()}const we={login:(a,c)=>_e("/auth/login",{method:"POST",body:JSON.stringify({username:a,password:c})}),getMe:()=>_e("/auth/me"),getAdminMetrics:()=>_e("/admin/metrics"),getTenants:()=>_e("/admin/tenants"),getAllDevices:()=>_e("/admin/devices"),sendDeviceCommand:(a,c,u)=>_e(`/admin/devices/${a}/command`,{method:"POST",body:JSON.stringify({command:c,parameters:u})}),getAdminActivationCodes:()=>_e("/admin/activation-codes"),generateAdminCode:(a,c)=>_e(`/admin/activation-codes?tenantId=${encodeURIComponent(a)}&classId=${encodeURIComponent(c)}`,{method:"POST"}),getAdminNotifications:(a=50)=>_e(`/admin/notifications?limit=${a}`),getSchoolOverview:()=>_e("/school-admin/overview"),getSchoolClasses:()=>_e("/school-admin/classes"),createSchoolClass:a=>_e("/school-admin/classes",{method:"POST",body:JSON.stringify(a)}),getSchoolTeachers:()=>_e("/school-admin/teachers"),createSchoolTeacher:a=>_e("/school-admin/teachers",{method:"POST",body:JSON.stringify(a)}),getSchoolDevices:()=>_e("/school-admin/devices"),getSchoolCodes:()=>_e("/school-admin/activation-codes"),generateSchoolCode:a=>_e(`/school-admin/activation-codes?classId=${encodeURIComponent(a)}`,{method:"POST"}),getTeacherClasses:()=>_e("/notification/classes"),sendNotification:a=>_e("/notification/send",{method:"POST",body:JSON.stringify(a)}),getTeacherHistory:(a,c=50)=>_e(`/notification/history?${a?`classId=${encodeURIComponent(a)}&`:""}limit=${c}`)},Kc=k.createContext(void 0),om=({children:a})=>{const[c,u]=k.useState(null),[f,m]=k.useState(la()),[v,N]=k.useState(!0);k.useEffect(()=>{(async()=>{if(la())try{const E=await we.getMe();u(E)}catch{sa(),m(null),u(null)}N(!1)})()},[]);const C=async(S,P)=>{const E=await we.login(S,P);if(!E.success||!E.token||!E.role)throw new Error(E.errorMessage||"登录失败");am(E.token),m(E.token);const O={userId:E.userId||"",name:E.fullName||S,role:E.role,tenantId:E.tenantId||""};return u(O),E.role},w=()=>{sa(),m(null),u(null),window.location.href="/login"};return s.jsx(Kc.Provider,{value:{user:c,token:f,login:C,logout:w,isLoading:v},children:a})},Zl=()=>{const a=k.useContext(Kc);if(!a)throw new Error("useAuth must be used within an AuthProvider");return a};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const um=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yc=(...a)=>a.filter((c,u,f)=>!!c&&c.trim()!==""&&f.indexOf(c)===u).join(" ").trim();/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var cm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dm=k.forwardRef(({color:a="currentColor",size:c=24,strokeWidth:u=2,absoluteStrokeWidth:f,className:m="",children:v,iconNode:N,...C},w)=>k.createElement("svg",{ref:w,...cm,width:c,height:c,stroke:a,strokeWidth:f?Number(u)*24/Number(c):u,className:Yc("lucide",m),...C},[...N.map(([S,P])=>k.createElement(S,P)),...Array.isArray(v)?v:[v]]));/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oe=(a,c)=>{const u=k.forwardRef(({className:f,...m},v)=>k.createElement(dm,{ref:v,iconNode:c,className:Yc(`lucide-${um(a)}`,f),...m}));return u.displayName=`${a}`,u};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fm=[["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"}]],ma=oe("Activity",fm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pm=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],mm=oe("ArrowRight",pm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hm=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Yl=oe("Bell",hm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xm=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],gm=oe("Check",xm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vm=[["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"}]],ym=oe("CircleAlert",vm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],es=oe("CircleCheck",wm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],ts=oe("Clock",Nm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jm=[["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"}]],km=oe("Copy",jm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sm=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],ha=oe("GraduationCap",Sm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cm=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Em=oe("History",Cm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _m=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Gl=oe("KeyRound",_m);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pm=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Xl=oe("Layers",Pm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lm=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Gc=oe("LoaderCircle",Lm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tm=[["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"}]],Rm=oe("Lock",Tm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zm=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Mm=oe("LogOut",zm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Im=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],ql=oe("Monitor",Im);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Om=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xa=oe("Plus",Om);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dm=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],Fm=oe("Radio",Dm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Am=[["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"}]],ia=oe("RefreshCw",Am);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Um=[["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"}]],$m=oe("RotateCcw",Um);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bm=[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7.382a1 1 0 0 1 .553-.894L6 10",key:"1xqip1"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 7.106-3.553a2 2 0 0 1 1.788 0L20 6",key:"9d2mlk"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]],Or=oe("School",bm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bm=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Xc=oe("Search",Bm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vm=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],aa=oe("Send",Vm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hm=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wm=oe("ShieldCheck",Hm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qm=[["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"}]],qc=oe("Shield",Qm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Km=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Ym=oe("Sparkles",Km);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gm=[["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"}]],Xm=oe("TriangleAlert",Gm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qm=[["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"}]],Jc=oe("User",qm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jm=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],ga=oe("Users",Jm);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zm=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],eh=oe("Volume2",Zm),th=()=>{const{user:a,logout:c}=Zl(),u=Qn();if(!a)return null;const f=m=>u.pathname===m;return s.jsx("header",{className:"sticky top-0 z-50 border-b border-slate-800/80 bg-slate-950/80 backdrop-blur-xl",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex items-center justify-between h-16",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs(yt,{to:"/",className:"flex items-center space-x-2.5",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-tr from-indigo-600 to-violet-500 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:s.jsx(Yl,{className:"w-5 h-5 text-white"})}),s.jsx("span",{className:"font-bold text-lg tracking-tight bg-gradient-to-r from-white via-slate-200 to-slate-400 bg-clip-text text-transparent",children:"ClassNotify"})]}),s.jsxs("span",{className:"text-xs px-2.5 py-1 rounded-full font-medium flex items-center gap-1.5 border bg-slate-900 border-slate-800 text-slate-300",children:[a.role==="SuperAdmin"&&s.jsxs(s.Fragment,{children:[s.jsx(Wm,{className:"w-3.5 h-3.5 text-amber-400"}),s.jsx("span",{className:"text-amber-400 font-semibold",children:"超级运维后台"})]}),a.role==="SchoolAdmin"&&s.jsxs(s.Fragment,{children:[s.jsx(Or,{className:"w-3.5 h-3.5 text-sky-400"}),s.jsx("span",{className:"text-sky-400 font-semibold",children:"学校管理后台"})]}),a.role==="Teacher"&&s.jsxs(s.Fragment,{children:[s.jsx(ha,{className:"w-3.5 h-3.5 text-emerald-400"}),s.jsx("span",{className:"text-emerald-400 font-semibold",children:"教师工作台"})]})]})]}),s.jsxs("nav",{className:"hidden md:flex items-center space-x-1",children:[a.role==="SuperAdmin"&&s.jsxs(s.Fragment,{children:[s.jsxs(yt,{to:"/admin",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/admin")?"bg-indigo-600/20 text-indigo-400 border border-indigo-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Xl,{className:"w-4 h-4"}),"全局大盘"]}),s.jsxs(yt,{to:"/admin/devices",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/admin/devices")?"bg-indigo-600/20 text-indigo-400 border border-indigo-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(ql,{className:"w-4 h-4"}),"设备集控"]}),s.jsxs(yt,{to:"/admin/codes",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/admin/codes")?"bg-indigo-600/20 text-indigo-400 border border-indigo-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Gl,{className:"w-4 h-4"}),"全网激活码"]}),s.jsxs(yt,{to:"/admin/history",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/admin/history")?"bg-indigo-600/20 text-indigo-400 border border-indigo-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Em,{className:"w-4 h-4"}),"历史审计"]})]}),a.role==="SchoolAdmin"&&s.jsxs(s.Fragment,{children:[s.jsxs(yt,{to:"/school-admin",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/school-admin")?"bg-sky-600/20 text-sky-400 border border-sky-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Or,{className:"w-4 h-4"}),"学校概览"]}),s.jsxs(yt,{to:"/school-admin/classes",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/school-admin/classes")?"bg-sky-600/20 text-sky-400 border border-sky-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Xl,{className:"w-4 h-4"}),"班级管理"]}),s.jsxs(yt,{to:"/school-admin/teachers",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/school-admin/teachers")?"bg-sky-600/20 text-sky-400 border border-sky-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(ga,{className:"w-4 h-4"}),"教师账号"]}),s.jsxs(yt,{to:"/school-admin/codes",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/school-admin/codes")?"bg-sky-600/20 text-sky-400 border border-sky-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Gl,{className:"w-4 h-4"}),"本校激活码"]})]}),a.role==="Teacher"&&s.jsxs(yt,{to:"/teacher",className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-1.5 ${f("/teacher")?"bg-emerald-600/20 text-emerald-400 border border-emerald-500/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-900"}`,children:[s.jsx(Yl,{className:"w-4 h-4"}),"呼叫与回执"]})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"hidden sm:flex flex-col text-right",children:[s.jsx("span",{className:"text-sm font-medium text-slate-200",children:a.name}),s.jsx("span",{className:"text-xs text-slate-500",children:a.tenantId==="global"?"全平台":a.tenantId})]}),s.jsx("button",{onClick:c,className:"p-2 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-rose-500/10 transition-colors",title:"退出登录",children:s.jsx(Mm,{className:"w-4 h-4"})})]})]})})})},nh=()=>{const[a,c]=k.useState(""),[u,f]=k.useState(""),[m,v]=k.useState(null),[N,C]=k.useState(!1),{login:w}=Zl(),S=pa(),P=async(O=a,G=u)=>{v(null),C(!0);try{const z=await w(O,G);S(z==="SuperAdmin"?"/admin":z==="SchoolAdmin"?"/school-admin":"/teacher")}catch(z){v(z.message||"登录失败,请检查账号密码")}finally{C(!1)}},E=(O,G)=>{c(O),f(G),P(O,G)};return s.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-br from-slate-950 via-slate-900 to-indigo-950/40 relative overflow-hidden",children:[s.jsx("div",{className:"absolute w-96 h-96 bg-indigo-500/10 rounded-full blur-3xl -top-20 -left-20 pointer-events-none"}),s.jsx("div",{className:"absolute w-96 h-96 bg-violet-500/10 rounded-full blur-3xl -bottom-20 -right-20 pointer-events-none"}),s.jsx("div",{className:"w-full max-w-md relative z-10",children:s.jsxs("div",{className:"glass-panel p-8 border-slate-800",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-tr from-indigo-600 to-violet-500 flex items-center justify-center mx-auto mb-4 shadow-xl shadow-indigo-500/25",children:s.jsx(Yl,{className:"w-8 h-8 text-white"})}),s.jsx("h1",{className:"text-2xl font-bold tracking-tight text-white",children:"ClassNotify 控制台"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1.5",children:"智慧教室通知与设备集控一体化系统"})]}),m&&s.jsxs("div",{className:"mb-6 p-3.5 rounded-xl bg-rose-500/10 border border-rose-500/30 text-rose-300 text-sm flex items-center gap-2",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-rose-400"}),m]}),s.jsxs("form",{onSubmit:O=>{O.preventDefault(),P()},className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"登录账号"}),s.jsxs("div",{className:"relative",children:[s.jsx(Jc,{className:"w-4 h-4 text-slate-400 absolute left-3.5 top-3.5"}),s.jsx("input",{type:"text",value:a,onChange:O=>c(O.target.value),placeholder:"admin / admin_bj4 / teacher_zhang",className:"w-full pl-10 pr-4 py-2.5 rounded-xl bg-slate-950/60 border border-slate-700/80 text-white placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500",required:!0})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"登录密码"}),s.jsxs("div",{className:"relative",children:[s.jsx(Rm,{className:"w-4 h-4 text-slate-400 absolute left-3.5 top-3.5"}),s.jsx("input",{type:"password",value:u,onChange:O=>f(O.target.value),placeholder:"••••••••",className:"w-full pl-10 pr-4 py-2.5 rounded-xl bg-slate-950/60 border border-slate-700/80 text-white placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500",required:!0})]})]}),s.jsx("button",{type:"submit",disabled:N,className:"w-full py-2.5 px-4 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white font-medium text-sm transition-all duration-200 flex items-center justify-center gap-2 shadow-lg shadow-indigo-600/30 disabled:opacity-50 disabled:cursor-not-allowed mt-2",children:N?s.jsxs(s.Fragment,{children:[s.jsx(Gc,{className:"w-4 h-4 animate-spin"}),s.jsx("span",{children:"正在验证身份..."})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"登 录"}),s.jsx(mm,{className:"w-4 h-4"})]})})]}),s.jsxs("div",{className:"mt-8 pt-6 border-t border-slate-800/80",children:[s.jsx("div",{className:"text-xs font-medium text-slate-400 mb-3 text-center",children:"⚡ 快速体验预设身份"}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>E("admin","admin888"),className:"p-2.5 rounded-xl bg-slate-800/40 hover:bg-slate-800/80 border border-slate-700/60 text-xs text-slate-300 flex flex-col items-center gap-1.5 transition-colors group",children:[s.jsx(qc,{className:"w-4 h-4 text-amber-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"font-medium text-[11px]",children:"超级运维"})]}),s.jsxs("button",{type:"button",onClick:()=>E("admin_bj4","admin123"),className:"p-2.5 rounded-xl bg-slate-800/40 hover:bg-slate-800/80 border border-slate-700/60 text-xs text-slate-300 flex flex-col items-center gap-1.5 transition-colors group",children:[s.jsx(Or,{className:"w-4 h-4 text-sky-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"font-medium text-[11px]",children:"学校管理"})]}),s.jsxs("button",{type:"button",onClick:()=>E("teacher_zhang","teacher123"),className:"p-2.5 rounded-xl bg-slate-800/40 hover:bg-slate-800/80 border border-slate-700/60 text-xs text-slate-300 flex flex-col items-center gap-1.5 transition-colors group",children:[s.jsx(ha,{className:"w-4 h-4 text-emerald-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"font-medium text-[11px]",children:"教师端"})]})]})]})]})})]})},rh=()=>{const[a,c]=k.useState(null),[u,f]=k.useState([]),[m,v]=k.useState([]),[N,C]=k.useState(!0),w=async()=>{try{const[S,P,E]=await Promise.all([we.getAdminMetrics(),we.getTenants(),we.getAdminNotifications(6)]);c(S),f(P),v(E)}catch(S){console.error("Failed to load admin dashboard data",S)}finally{C(!1)}};return k.useEffect(()=>{w();const S=setInterval(w,1e4);return()=>clearInterval(S)},[]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"全网运行大盘"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"实时监控多租户集群、边缘教室硬件及云端连接状态"})]}),s.jsxs("div",{className:"flex items-center gap-2 self-start sm:self-auto px-3 py-1.5 rounded-xl bg-emerald-500/10 border border-emerald-500/30 text-emerald-400 text-xs font-medium",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),s.jsx("span",{children:"东京主节点 (Caddy + ASP.NET Core 8) 正常运行"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"入驻学校 / 租户"}),s.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/10 text-indigo-400 flex items-center justify-center",children:s.jsx(Or,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:N?"-":(a==null?void 0:a.totalTenants)??0}),s.jsx("span",{className:"text-xs text-slate-400",children:"所学校"})]})]}),s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"总设备数量"}),s.jsx("div",{className:"w-8 h-8 rounded-lg bg-sky-500/10 text-sky-400 flex items-center justify-center",children:s.jsx(ql,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:N?"-":(a==null?void 0:a.totalDevices)??0}),s.jsx("span",{className:"text-xs text-slate-400",children:"台教室终端"})]})]}),s.jsxs("div",{className:"glass-panel p-5 border-slate-800 relative overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"在线设备"}),s.jsx("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/10 text-emerald-400 flex items-center justify-center",children:s.jsx(ma,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-3xl font-bold text-emerald-400 tracking-tight flex items-center gap-2",children:[s.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400 animate-ping inline-block"}),N?"-":(a==null?void 0:a.onlineDevices)??0]}),s.jsxs("span",{className:"text-xs text-slate-400",children:["/ 离线 ",N?"-":(a==null?void 0:a.offlineDevices)??0]})]})]}),s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"今日呼叫通知"}),s.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 text-amber-400 flex items-center justify-center",children:s.jsx(Yl,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:N?"-":(a==null?void 0:a.todayNotifications)??0}),s.jsx("span",{className:"text-xs text-slate-400",children:"次下发"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 glass-panel p-6 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[s.jsx(Or,{className:"w-4 h-4 text-indigo-400"}),"学校 / 租户在线统计"]}),s.jsx("span",{className:"text-xs text-slate-500",children:"每 10 秒实时刷新"})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"pb-3 font-medium",children:"学校名称"}),s.jsx("th",{className:"pb-3 font-medium",children:"班级数"}),s.jsx("th",{className:"pb-3 font-medium",children:"设备数"}),s.jsx("th",{className:"pb-3 font-medium",children:"在线状态"}),s.jsx("th",{className:"pb-3 font-medium text-right",children:"在线率"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:u.map(S=>{const P=S.deviceCount>0?Math.round(S.onlineCount/S.deviceCount*100):0;return s.jsxs("tr",{className:"hover:bg-slate-800/30 transition-colors",children:[s.jsxs("td",{className:"py-3 font-medium text-white flex items-center gap-2",children:[s.jsx("span",{children:S.name}),s.jsxs("span",{className:"text-[11px] text-slate-500",children:["(",S.id,")"]})]}),s.jsx("td",{className:"py-3 text-slate-300",children:S.classroomCount}),s.jsx("td",{className:"py-3 text-slate-300",children:S.deviceCount}),s.jsx("td",{className:"py-3",children:s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("span",{className:"text-xs text-slate-300",children:[S.onlineCount," / ",S.deviceCount," 在线"]})})}),s.jsx("td",{className:"py-3 text-right",children:s.jsxs("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${P>=80?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/30":P>0?"bg-amber-500/10 text-amber-400 border border-amber-500/30":"bg-slate-800 text-slate-400"}`,children:[P,"%"]})})]},S.id)})})]})})]}),s.jsxs("div",{className:"glass-panel p-6 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[s.jsx(ts,{className:"w-4 h-4 text-amber-400"}),"全网最新呼叫"]}),s.jsx("span",{className:"text-xs text-slate-500",children:"实时审计"})]}),s.jsx("div",{className:"space-y-3",children:m.length===0?s.jsx("div",{className:"text-center py-8 text-xs text-slate-500",children:"暂无呼叫记录"}):m.map(S=>s.jsxs("div",{className:"glass-card p-3 text-xs space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-semibold text-slate-200",children:S.className}),s.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${S.status==="Acknowledged"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/30":S.status==="Delivered"?"bg-sky-500/10 text-sky-400 border border-sky-500/30":"bg-slate-800 text-slate-400"}`,children:S.status==="Acknowledged"?"已确认":S.status==="Delivered"?"已送达":"下发中"})]}),s.jsx("div",{className:"text-slate-300 line-clamp-1",children:S.message}),s.jsxs("div",{className:"flex items-center justify-between text-slate-500 text-[10px]",children:[s.jsxs("span",{children:["发起: ",S.senderName]}),s.jsx("span",{children:new Date(S.createdAt).toLocaleTimeString()})]})]},S.id))})]})]})]})},lh=()=>{const[a,c]=k.useState([]),[u,f]=k.useState(!0),[m,v]=k.useState(""),[N,C]=k.useState(null),[w,S]=k.useState(null),P=async()=>{try{const z=await we.getAllDevices();c(z)}catch(z){console.error("Failed to load devices",z)}finally{f(!1)}};k.useEffect(()=>{P();const z=setInterval(P,5e3);return()=>clearInterval(z)},[]);const E=async(z,F,I)=>{S(`${z}_${F}`),C(null);try{const Z=await we.sendDeviceCommand(z,F,I);C({deviceId:z,message:Z.message,success:!0}),P()}catch(Z){C({deviceId:z,message:Z.message||"远程指令执行失败",success:!1})}finally{S(null)}},O=z=>{if(!z)return"从无心跳";const F=Math.floor((Date.now()-new Date(z).getTime())/1e3);return F<10?"刚刚 (几秒前)":F<60?`${F} 秒前`:F<3600?`${Math.floor(F/60)} 分钟前`:`${Math.floor(F/3600)} 小时前`},G=a.filter(z=>z.tenantName.toLowerCase().includes(m.toLowerCase())||z.classroomName.toLowerCase().includes(m.toLowerCase())||z.deviceId.toLowerCase().includes(m.toLowerCase())||z.hostname&&z.hostname.toLowerCase().includes(m.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"全网设备集控中心"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"实时查看教室边缘设备健康状态,直接下发远程自检、重启与配置刷新指令"})]}),s.jsxs("button",{onClick:()=>{f(!0),P()},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-medium transition-colors self-start sm:self-auto border border-slate-700/60",children:[s.jsx(ia,{className:`w-3.5 h-3.5 ${u?"animate-spin":""}`}),"刷新状态"]})]}),N&&s.jsxs("div",{className:`p-4 rounded-xl border flex items-center justify-between transition-all ${N.success?"bg-emerald-500/10 border-emerald-500/30 text-emerald-300":"bg-rose-500/10 border-rose-500/30 text-rose-300"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[N.success?s.jsx(es,{className:"w-5 h-5 text-emerald-400 shrink-0"}):s.jsx(ym,{className:"w-5 h-5 text-rose-400 shrink-0"}),s.jsxs("span",{children:["[设备 ",N.deviceId,"] ",N.message]})]}),s.jsx("button",{onClick:()=>C(null),className:"text-xs opacity-70 hover:opacity-100",children:"关闭"})]}),s.jsxs("div",{className:"glass-panel p-4 border-slate-800 flex items-center gap-3",children:[s.jsx(Xc,{className:"w-4 h-4 text-slate-400"}),s.jsx("input",{type:"text",value:m,onChange:z=>v(z.target.value),placeholder:"按学校、班级、设备编号或计算机名过滤...",className:"bg-transparent border-none text-sm text-white placeholder-slate-500 focus:outline-none w-full"}),m&&s.jsx("button",{onClick:()=>v(""),className:"text-xs text-slate-400 hover:text-white",children:"清空"})]}),s.jsx("div",{className:"glass-panel border-slate-800 overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 bg-slate-900/60 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"学校 / 班级"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"设备编号"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"运行状态"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"最后心跳"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"客户端版本"}),s.jsx("th",{className:"py-3.5 px-4 font-medium text-right",children:"远程运维操作"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:G.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-10 text-xs text-slate-500",children:u?"正在同步设备状态...":"暂无匹配的设备"})}):G.map(z=>s.jsxs("tr",{className:"hover:bg-slate-800/25 transition-colors",children:[s.jsxs("td",{className:"py-4 px-4",children:[s.jsx("div",{className:"font-semibold text-white",children:z.classroomName}),s.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:z.tenantName})]}),s.jsxs("td",{className:"py-4 px-4 font-mono text-xs text-slate-300",children:[s.jsx("div",{children:z.deviceId}),s.jsx("div",{className:"text-[11px] text-slate-500 font-sans mt-0.5",children:z.hostname||"Classroom-PC"})]}),s.jsx("td",{className:"py-4 px-4",children:z.isOnline?s.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-emerald-500/10 border border-emerald-500/30 text-emerald-400",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),s.jsx("span",{children:"在线 (Session 0)"})]}):s.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-slate-800 border border-slate-700 text-slate-400",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-500"}),s.jsx("span",{children:"离线"})]})}),s.jsxs("td",{className:"py-4 px-4 text-xs text-slate-300",children:[s.jsx("div",{children:O(z.lastHeartbeat)}),s.jsx("div",{className:"text-[11px] text-slate-500 mt-0.5 font-mono",children:z.remoteIp||"127.0.0.1"})]}),s.jsx("td",{className:"py-4 px-4 text-xs",children:s.jsxs("span",{className:"px-2 py-0.5 rounded bg-slate-800 text-slate-300 font-mono",children:["v",z.clientVersion||"2.1.0"]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsxs("button",{onClick:()=>E(z.deviceId,"self_check"),disabled:!z.isOnline||w===`${z.deviceId}_self_check`,className:"px-2.5 py-1.5 rounded-lg bg-indigo-600/10 hover:bg-indigo-600/20 border border-indigo-500/30 text-indigo-400 text-xs font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-1",title:"下发远程自检指令",children:[s.jsx(ma,{className:"w-3 h-3"}),"自检"]}),s.jsxs("button",{onClick:()=>E(z.deviceId,"restart_client"),disabled:!z.isOnline||w===`${z.deviceId}_restart_client`,className:"px-2.5 py-1.5 rounded-lg bg-amber-500/10 hover:bg-amber-500/20 border border-amber-500/30 text-amber-400 text-xs font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-1",title:"远程重启前台 WPF Client 弹窗进程",children:[s.jsx($m,{className:"w-3 h-3"}),"重启 Client"]}),s.jsxs("button",{onClick:()=>E(z.deviceId,"refresh_config"),disabled:!z.isOnline||w===`${z.deviceId}_refresh_config`,className:"px-2.5 py-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-300 text-xs font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-1",title:"下发配置刷新",children:[s.jsx(ia,{className:"w-3 h-3"}),"刷新"]})]})})]},z.deviceId))})]})})})]})},Rc=()=>{const[a,c]=k.useState([]),[u,f]=k.useState([]),[m,v]=k.useState(!0),[N,C]=k.useState(null),[w,S]=k.useState(!1),[P,E]=k.useState(""),[O,G]=k.useState(""),[z,F]=k.useState(!1),I=async()=>{try{const[U,re]=await Promise.all([we.getAdminActivationCodes(),we.getTenants()]);c(U),f(re),re.length>0&&!P&&E(re[0].id)}catch(U){console.error("Failed to load activation codes",U)}finally{v(!1)}};k.useEffect(()=>{I()},[]);const Z=U=>{navigator.clipboard.writeText(U),C(U),setTimeout(()=>C(null),2e3)},W=async U=>{if(U.preventDefault(),!(!P||!O)){F(!0);try{await we.generateAdminCode(P,O),S(!1),G(""),I()}catch(re){alert(re.message||"生成失败")}finally{F(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"全网设备激活码大盘"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"生成与管理各学校教室电脑安装所需的 8 位一次性硬件绑定激活码"})]}),s.jsxs("button",{onClick:()=>S(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium transition-colors shadow-lg shadow-indigo-600/25 self-start sm:self-auto",children:[s.jsx(xa,{className:"w-4 h-4"}),"生成新激活码"]})]}),s.jsx("div",{className:"glass-panel border-slate-800 overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 bg-slate-900/60 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"激活码"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"绑定学校 / 班级"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"使用状态"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"激活设备"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"有效期限"}),s.jsx("th",{className:"py-3.5 px-4 font-medium text-right",children:"操作"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:a.map(U=>s.jsxs("tr",{className:"hover:bg-slate-800/25 transition-colors",children:[s.jsxs("td",{className:"py-4 px-4 font-mono font-bold text-indigo-400 text-base flex items-center gap-2",children:[s.jsx("span",{children:U.code}),s.jsx("button",{onClick:()=>Z(U.code),className:"p-1 rounded text-slate-500 hover:text-white transition-colors",title:"复制激活码",children:N===U.code?s.jsx(gm,{className:"w-3.5 h-3.5 text-emerald-400"}):s.jsx(km,{className:"w-3.5 h-3.5"})})]}),s.jsxs("td",{className:"py-4 px-4",children:[s.jsx("div",{className:"font-medium text-white",children:U.classroomName}),s.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:U.tenantName})]}),s.jsx("td",{className:"py-4 px-4",children:U.isUsed?s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-slate-800 text-slate-400 border border-slate-700",children:[s.jsx(es,{className:"w-3.5 h-3.5 text-slate-500"}),"已激活使用"]}):s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/30",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400"}),"待激活 (可用)"]})}),s.jsx("td",{className:"py-4 px-4 font-mono text-xs text-slate-400",children:U.usedByDeviceId?s.jsx("span",{className:"text-slate-200",children:U.usedByDeviceId}):s.jsx("span",{className:"text-slate-600",children:"-"})}),s.jsx("td",{className:"py-4 px-4 text-xs text-slate-400",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(ts,{className:"w-3.5 h-3.5 text-slate-500"}),s.jsxs("span",{children:[new Date(U.expiresAt).toLocaleDateString()," 到期"]})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsx("button",{onClick:()=>Z(U.code),className:"text-xs text-slate-400 hover:text-white underline underline-offset-4",children:N===U.code?"已复制":"复制用于安装"})})]},U.code))})]})})}),w&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",children:s.jsxs("div",{className:"glass-panel max-w-md w-full p-6 border-slate-800",children:[s.jsxs("h2",{className:"text-lg font-bold text-white mb-4 flex items-center gap-2",children:[s.jsx(Gl,{className:"w-5 h-5 text-indigo-400"}),"生成班级设备激活码"]}),s.jsxs("form",{onSubmit:W,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"所属学校 / 租户"}),s.jsx("select",{value:P,onChange:U=>E(U.target.value),className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-indigo-500",required:!0,children:u.map(U=>s.jsxs("option",{value:U.id,children:[U.name," (",U.id,")"]},U.id))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"目标班级编号"}),s.jsx("input",{type:"text",value:O,onChange:U=>G(U.target.value),placeholder:"如 cls_801 或 cls_802",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-indigo-500",required:!0})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-slate-800",children:[s.jsx("button",{type:"button",onClick:()=>S(!1),className:"px-4 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 text-xs font-medium",children:"取消"}),s.jsx("button",{type:"submit",disabled:z,className:"px-4 py-2 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium disabled:opacity-50",children:z?"生成中...":"立即生成"})]})]})]})})]})},sh=()=>{const[a,c]=k.useState([]),[u,f]=k.useState(!0),[m,v]=k.useState(""),N=async()=>{try{const w=await we.getAdminNotifications(100);c(w)}catch(w){console.error("Failed to load notifications",w)}finally{f(!1)}};k.useEffect(()=>{N();const w=setInterval(N,8e3);return()=>clearInterval(w)},[]);const C=a.filter(w=>w.className.toLowerCase().includes(m.toLowerCase())||w.senderName.toLowerCase().includes(m.toLowerCase())||w.message.toLowerCase().includes(m.toLowerCase())||w.id.toLowerCase().includes(m.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"全网呼叫历史与回执审计"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"追踪全网每条通知从下发、教室大屏接收、到学生点击确认的全流程时间戳与 ACK 回执"})]}),s.jsxs("button",{onClick:()=>{f(!0),N()},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-medium transition-colors border border-slate-700 self-start sm:self-auto",children:[s.jsx(ia,{className:`w-3.5 h-3.5 ${u?"animate-spin":""}`}),"刷新审计"]})]}),s.jsxs("div",{className:"glass-panel p-4 border-slate-800 flex items-center gap-3",children:[s.jsx(Xc,{className:"w-4 h-4 text-slate-400"}),s.jsx("input",{type:"text",value:m,onChange:w=>v(w.target.value),placeholder:"搜索消息内容、班级或教师姓名...",className:"bg-transparent border-none text-sm text-white placeholder-slate-500 focus:outline-none w-full"})]}),s.jsx("div",{className:"glass-panel border-slate-800 overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 bg-slate-900/60 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"目标班级"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"通知正文"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"发起老师"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"下发时间"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"回执状态 (ACK)"}),s.jsx("th",{className:"py-3.5 px-4 font-medium text-right",children:"确认时间"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:C.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-10 text-xs text-slate-500",children:u?"正在加载审计数据...":"暂无呼叫历史记录"})}):C.map(w=>s.jsxs("tr",{className:"hover:bg-slate-800/25 transition-colors",children:[s.jsxs("td",{className:"py-4 px-4",children:[s.jsx("div",{className:"font-semibold text-white",children:w.className}),s.jsx("div",{className:"text-[11px] font-mono text-slate-500",children:w.classId})]}),s.jsxs("td",{className:"py-4 px-4 text-slate-200 max-w-md",children:[s.jsx("div",{className:"font-medium text-sm",children:w.message}),s.jsx("div",{className:"text-[11px] font-mono text-slate-500 mt-0.5",children:w.id})]}),s.jsx("td",{className:"py-4 px-4 text-slate-300 text-xs",children:w.senderName}),s.jsx("td",{className:"py-4 px-4 text-xs text-slate-400",children:new Date(w.createdAt).toLocaleTimeString()}),s.jsxs("td",{className:"py-4 px-4",children:[w.status==="Acknowledged"&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/30",children:[s.jsx(es,{className:"w-3.5 h-3.5"}),"学生已点击确认"]}),w.status==="Delivered"&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-sky-500/10 text-sky-400 border border-sky-500/30",children:[s.jsx(aa,{className:"w-3.5 h-3.5"}),"已送达教室大屏"]}),w.status==="Sent"&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-amber-500/10 text-amber-400 border border-amber-500/30",children:[s.jsx(ts,{className:"w-3.5 h-3.5"}),"云端下发中"]}),w.status==="Timeout"&&s.jsx("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-slate-800 text-slate-400 border border-slate-700",children:"超时自动关闭"})]}),s.jsx("td",{className:"py-4 px-4 text-right text-xs text-slate-400",children:w.confirmedAt?s.jsx("span",{className:"text-emerald-400 font-mono",children:new Date(w.confirmedAt).toLocaleTimeString()}):s.jsx("span",{className:"text-slate-600",children:"-"})})]},w.id))})]})})})]})},ih=()=>{const[a,c]=k.useState(null),[u,f]=k.useState([]),[m,v]=k.useState(!0),N=async()=>{try{const[C,w]=await Promise.all([we.getSchoolOverview(),we.getSchoolDevices()]);c(C),f(w)}catch(C){console.error("Failed to load school overview",C)}finally{v(!1)}};return k.useEffect(()=>{N();const C=setInterval(N,6e3);return()=>clearInterval(C)},[]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:(a==null?void 0:a.tenantName)||"本校管理后台"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"管理本校班级配置、多媒体教室设备绑定与科任教师账号"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"已建班级"}),s.jsx(Xl,{className:"w-4 h-4 text-sky-400"})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:m?"-":(a==null?void 0:a.classCount)??0}),s.jsx("span",{className:"text-xs text-slate-400",children:"个教学班"})]})]}),s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"教室终端"}),s.jsx(ql,{className:"w-4 h-4 text-indigo-400"})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:m?"-":(a==null?void 0:a.deviceCount)??0}),s.jsx("span",{className:"text-xs text-slate-400",children:"台已安装"})]})]}),s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"实时在线"}),s.jsx(ma,{className:"w-4 h-4 text-emerald-400"})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-3xl font-bold text-emerald-400 tracking-tight flex items-center gap-2",children:[s.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400 animate-ping inline-block"}),m?"-":(a==null?void 0:a.onlineCount)??0]}),s.jsxs("span",{className:"text-xs text-slate-400",children:["/ 总 ",m?"-":(a==null?void 0:a.deviceCount)??0]})]})]}),s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-slate-400",children:"教师账号"}),s.jsx(ga,{className:"w-4 h-4 text-amber-400"})]}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[s.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:m?"-":(a==null?void 0:a.teacherCount)??0}),s.jsx("span",{className:"text-xs text-slate-400",children:"位老师"})]})]})]}),s.jsxs("div",{className:"glass-panel p-6 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[s.jsx(ql,{className:"w-4 h-4 text-sky-400"}),"本校各教室设备状态"]}),s.jsx(yt,{to:"/school-admin/classes",className:"text-xs text-sky-400 hover:text-sky-300 font-medium flex items-center gap-1",children:"班级管理"})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 bg-slate-900/60 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"py-3 px-4 font-medium",children:"班级名称"}),s.jsx("th",{className:"py-3 px-4 font-medium",children:"设备编号"}),s.jsx("th",{className:"py-3 px-4 font-medium",children:"设备状态"}),s.jsx("th",{className:"py-3 px-4 font-medium",children:"最后心跳"}),s.jsx("th",{className:"py-3 px-4 font-medium",children:"版本"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:u.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"text-center py-8 text-xs text-slate-500",children:"暂无已绑定的教室设备,请前往【本校激活码】生成激活码并在教室电脑安装"})}):u.map(C=>s.jsxs("tr",{className:"hover:bg-slate-800/25 transition-colors",children:[s.jsx("td",{className:"py-3.5 px-4 font-medium text-white",children:C.classroomName}),s.jsx("td",{className:"py-3.5 px-4 font-mono text-xs text-slate-300",children:C.deviceId}),s.jsx("td",{className:"py-3.5 px-4",children:C.isOnline?s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/30",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"在线"]}):s.jsx("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium bg-slate-800 text-slate-400 border border-slate-700",children:"离线"})}),s.jsx("td",{className:"py-3.5 px-4 text-xs text-slate-400",children:C.lastHeartbeat?new Date(C.lastHeartbeat).toLocaleTimeString():"无"}),s.jsxs("td",{className:"py-3.5 px-4 text-xs font-mono text-slate-400",children:["v",C.clientVersion||"2.1.0"]})]},C.deviceId))})]})})]})]})},ah=()=>{const[a,c]=k.useState([]),[u,f]=k.useState(!0),[m,v]=k.useState(!1),[N,C]=k.useState(""),[w,S]=k.useState(""),[P,E]=k.useState(""),[O,G]=k.useState(""),[z,F]=k.useState(!1),[I,Z]=k.useState(null),W=async()=>{try{const J=await we.getSchoolClasses();c(J)}catch(J){console.error("Failed to load classes",J)}finally{f(!1)}};k.useEffect(()=>{W()},[]);const U=async J=>{if(J.preventDefault(),!(!N||!w)){F(!0);try{await we.createSchoolClass({id:N,displayName:w,grade:P,roomNumber:O}),v(!1),C(""),S(""),E(""),G(""),W()}catch(ge){alert(ge.message||"创建班级失败")}finally{F(!1)}}},re=async J=>{try{const ge=await we.generateSchoolCode(J);Z({classId:J,code:ge.code})}catch(ge){alert(ge.message||"生成激活码失败")}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"本校班级管理"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"维护学校全部教学班级,并为各班级生成设备激活码"})]}),s.jsxs("button",{onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-sky-600 hover:bg-sky-500 text-white text-xs font-medium transition-colors shadow-lg shadow-sky-600/25 self-start sm:self-auto",children:[s.jsx(xa,{className:"w-4 h-4"}),"新建教学班"]})]}),I&&s.jsxs("div",{className:"p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/30 text-emerald-300 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("span",{className:"font-semibold",children:["【",I.classId,"】激活码已生成:"]}),s.jsx("span",{className:"font-mono text-base font-bold text-white ml-2 bg-slate-900 px-2 py-1 rounded",children:I.code}),s.jsx("span",{className:"text-xs text-emerald-400/80 ml-3",children:"(请在教室电脑运行 ClassNotifySetup.exe 输入该激活码完成绑定)"})]}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(I.code),alert("激活码已复制!")},className:"px-3 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-xs font-medium",children:"复制激活码"})]}),s.jsx("div",{className:"glass-panel border-slate-800 overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 bg-slate-900/60 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"班级名称"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"班级编号 (ClassId)"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"年级"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"教室位置"}),s.jsx("th",{className:"py-3.5 px-4 font-medium text-right",children:"操作"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:a.map(J=>s.jsxs("tr",{className:"hover:bg-slate-800/25 transition-colors",children:[s.jsx("td",{className:"py-4 px-4 font-semibold text-white",children:J.displayName}),s.jsx("td",{className:"py-4 px-4 font-mono text-xs text-slate-400",children:J.id}),s.jsx("td",{className:"py-4 px-4 text-xs text-slate-300",children:J.grade||"-"}),s.jsx("td",{className:"py-4 px-4 text-xs text-slate-300",children:J.roomNumber||"-"}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("button",{onClick:()=>re(J.id),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-sky-600/10 hover:bg-sky-600/20 border border-sky-500/30 text-sky-400 text-xs font-medium transition-colors",children:[s.jsx(Gl,{className:"w-3.5 h-3.5"}),"生成安装激活码"]})})]},J.id))})]})})}),m&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",children:s.jsxs("div",{className:"glass-panel max-w-md w-full p-6 border-slate-800",children:[s.jsxs("h2",{className:"text-lg font-bold text-white mb-4 flex items-center gap-2",children:[s.jsx(Xl,{className:"w-5 h-5 text-sky-400"}),"新建教学班级"]}),s.jsxs("form",{onSubmit:U,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"班级编号 (唯一识别码)"}),s.jsx("input",{type:"text",value:N,onChange:J=>C(J.target.value),placeholder:"如 cls_803 或 cls_grade7_1",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"班级显示名称"}),s.jsx("input",{type:"text",value:w,onChange:J=>S(J.target.value),placeholder:"如 八年级(3)班",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"年级 (可选)"}),s.jsx("input",{type:"text",value:P,onChange:J=>E(J.target.value),placeholder:"如 初二 / 高一",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"教室位置 (可选)"}),s.jsx("input",{type:"text",value:O,onChange:J=>G(J.target.value),placeholder:"如 教学楼 303",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500"})]})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-slate-800",children:[s.jsx("button",{type:"button",onClick:()=>v(!1),className:"px-4 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 text-xs font-medium",children:"取消"}),s.jsx("button",{type:"submit",disabled:z,className:"px-4 py-2 rounded-xl bg-sky-600 hover:bg-sky-500 text-white text-xs font-medium disabled:opacity-50",children:z?"创建中...":"确认创建"})]})]})]})})]})},oh=()=>{const[a,c]=k.useState([]),[u,f]=k.useState(!0),[m,v]=k.useState(!1),[N,C]=k.useState(""),[w,S]=k.useState(""),[P,E]=k.useState(""),[O,G]=k.useState("Teacher"),[z,F]=k.useState(!1),I=async()=>{try{const W=await we.getSchoolTeachers();c(W)}catch(W){console.error("Failed to load teachers",W)}finally{f(!1)}};k.useEffect(()=>{I()},[]);const Z=async W=>{if(W.preventDefault(),!(!N||!w||!P)){F(!0);try{await we.createSchoolTeacher({username:N,password:w,fullName:P,role:O}),v(!1),C(""),S(""),E(""),I()}catch(U){alert(U.message||"创建教师账号失败")}finally{F(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"本校教师账号管理"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"为科任教师开设 ClassNotify 网页控制台与后续 Android 移动端登录权限"})]}),s.jsxs("button",{onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-sky-600 hover:bg-sky-500 text-white text-xs font-medium transition-colors shadow-lg shadow-sky-600/25 self-start sm:self-auto",children:[s.jsx(xa,{className:"w-4 h-4"}),"开设教师账号"]})]}),s.jsx("div",{className:"glass-panel border-slate-800 overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-xs uppercase text-slate-400 bg-slate-900/60 border-b border-slate-800/80",children:s.jsxs("tr",{children:[s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"教师姓名"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"登录账号 (Username)"}),s.jsx("th",{className:"py-3.5 px-4 font-medium",children:"账号权限角色"}),s.jsx("th",{className:"py-3.5 px-4 font-medium text-right",children:"状态"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:a.map(W=>s.jsxs("tr",{className:"hover:bg-slate-800/25 transition-colors",children:[s.jsxs("td",{className:"py-4 px-4 font-semibold text-white flex items-center gap-2",children:[W.role==="SchoolAdmin"?s.jsx(qc,{className:"w-4 h-4 text-sky-400"}):s.jsx(ha,{className:"w-4 h-4 text-emerald-400"}),s.jsx("span",{children:W.fullName})]}),s.jsx("td",{className:"py-4 px-4 font-mono text-xs text-slate-300",children:W.username}),s.jsx("td",{className:"py-4 px-4 text-xs",children:W.role==="SchoolAdmin"?s.jsx("span",{className:"px-2 py-0.5 rounded bg-sky-500/10 text-sky-400 border border-sky-500/30",children:"学校管理员"}):s.jsx("span",{className:"px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/30",children:"任课教师"})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsx("span",{className:"text-xs text-emerald-400 font-medium",children:"正常可用"})})]},W.id))})]})})}),m&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",children:s.jsxs("div",{className:"glass-panel max-w-md w-full p-6 border-slate-800",children:[s.jsxs("h2",{className:"text-lg font-bold text-white mb-4 flex items-center gap-2",children:[s.jsx(ga,{className:"w-5 h-5 text-sky-400"}),"开设新账号"]}),s.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"教师真实姓名"}),s.jsx("input",{type:"text",value:P,onChange:W=>E(W.target.value),placeholder:"如 王老师 / 李明",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"登录账号"}),s.jsx("input",{type:"text",value:N,onChange:W=>C(W.target.value),placeholder:"如 teacher_wang",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"登录初始密码"}),s.jsx("input",{type:"password",value:w,onChange:W=>S(W.target.value),placeholder:"••••••••",className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"角色权限"}),s.jsxs("select",{value:O,onChange:W=>G(W.target.value),className:"w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500",children:[s.jsx("option",{value:"Teacher",children:"普通科任教师 (仅呼叫与回执)"}),s.jsx("option",{value:"SchoolAdmin",children:"学校管理员 (可管理班级与账号)"})]})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-slate-800",children:[s.jsx("button",{type:"button",onClick:()=>v(!1),className:"px-4 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 text-xs font-medium",children:"取消"}),s.jsx("button",{type:"submit",disabled:z,className:"px-4 py-2 rounded-xl bg-sky-600 hover:bg-sky-500 text-white text-xs font-medium disabled:opacity-50",children:z?"开设计算中...":"确认开通"})]})]})]})})]})},uh=()=>{const[a,c]=k.useState([]),[u,f]=k.useState(""),[m,v]=k.useState(""),[N,C]=k.useState(""),[w,S]=k.useState(!0),[P,E]=k.useState(!0),[O,G]=k.useState(!1),[z,F]=k.useState(15),[I,Z]=k.useState(!1),[W,U]=k.useState([]),[re,J]=k.useState(!0),ge=["请带各科作业本到办公室","马上到操场集合整队","课代表请到教研室领试卷","午休时间请教室内保持安静","请班长负责维护自习纪律","放学后值日生留下来打扫卫生"],De=async()=>{try{const Y=await we.getTeacherClasses();c(Y),Y.length>0&&!u&&f(Y[0].id);const Pe=await we.getTeacherHistory(void 0,20);U(Pe)}catch(Y){console.error("Failed to load teacher console data",Y)}finally{J(!1)}};k.useEffect(()=>{De();const Y=setInterval(async()=>{try{const Pe=await we.getTeacherHistory(void 0,20);U(Pe)}catch{}},4e3);return()=>clearInterval(Y)},[]);const He=async Y=>{if(Y.preventDefault(),!(!u||!N.trim())){Z(!0);try{const Pe=a.find(be=>be.id===u),Et=m.trim()?`🔔 老师呼叫: ${m.trim()}`:`📢 ${(Pe==null?void 0:Pe.displayName)||"班级"}通知`;await we.sendNotification({classId:u,studentName:m.trim()||void 0,title:Et,message:N.trim(),type:O?2:0,voice:w,shake:P,durationSeconds:z}),C(""),v("");const lt=await we.getTeacherHistory(void 0,20);U(lt)}catch(Pe){alert(Pe.message||"呼叫发送失败")}finally{Z(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"教师呼叫工作台"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"向指定教室大屏下发即时点呼与通知,支持语音朗读(TTS)与学生回执确认"})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6",children:[s.jsx("div",{className:"lg:col-span-7 space-y-5",children:s.jsx("div",{className:"glass-panel p-6 border-slate-800",children:s.jsxs("form",{onSubmit:He,className:"space-y-5",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-2",children:"1. 选择目标教室 / 班级"}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2.5",children:a.map(Y=>s.jsxs("button",{type:"button",onClick:()=>f(Y.id),className:`p-3 rounded-xl border text-left transition-all ${u===Y.id?"bg-emerald-500/15 border-emerald-500 text-white shadow-lg shadow-emerald-500/10":"bg-slate-900/60 border-slate-800 text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[s.jsx("div",{className:"font-semibold text-sm",children:Y.displayName}),s.jsx("div",{className:"text-[11px] font-mono text-slate-500 mt-0.5",children:Y.id})]},Y.id))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"2. 呼叫指定学生 (留空则全班广播)"}),s.jsxs("div",{className:"relative",children:[s.jsx(Jc,{className:"w-4 h-4 text-slate-500 absolute left-3.5 top-3"}),s.jsx("input",{type:"text",value:m,onChange:Y=>v(Y.target.value),placeholder:"如 李晓明 / 张伟 (可选)",className:"w-full pl-10 pr-4 py-2 rounded-xl bg-slate-950/70 border border-slate-700 text-white placeholder-slate-500 text-sm focus:ring-2 focus:ring-emerald-500/50"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-slate-300",children:"3. 通知内容"}),s.jsx("span",{className:"text-[11px] text-slate-500",children:"点击下方快捷标签快速填入"})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2.5",children:ge.map(Y=>s.jsx("button",{type:"button",onClick:()=>C(Y),className:"px-2.5 py-1 rounded-lg bg-slate-800/80 hover:bg-slate-700 border border-slate-700/60 text-slate-300 text-xs transition-colors",children:Y},Y))}),s.jsx("textarea",{value:N,onChange:Y=>C(Y.target.value),rows:3,placeholder:"输入通知内容,教室大屏将弹窗展示并语音朗读...",className:"w-full px-3.5 py-2.5 rounded-xl bg-slate-950/70 border border-slate-700 text-white placeholder-slate-500 text-sm focus:ring-2 focus:ring-emerald-500/50",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 pt-2",children:[s.jsxs("label",{className:"glass-card p-3 flex items-center justify-between cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(eh,{className:`w-4 h-4 ${w?"text-emerald-400":"text-slate-500"}`}),s.jsx("span",{className:"text-xs text-slate-200",children:"TTS 朗读"})]}),s.jsx("input",{type:"checkbox",checked:w,onChange:Y=>S(Y.target.checked),className:"rounded bg-slate-900 border-slate-700 text-emerald-500 focus:ring-0"})]}),s.jsxs("label",{className:"glass-card p-3 flex items-center justify-between cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ym,{className:`w-4 h-4 ${P?"text-indigo-400":"text-slate-500"}`}),s.jsx("span",{className:"text-xs text-slate-200",children:"窗口震颤"})]}),s.jsx("input",{type:"checkbox",checked:P,onChange:Y=>E(Y.target.checked),className:"rounded bg-slate-900 border-slate-700 text-indigo-500 focus:ring-0"})]}),s.jsxs("label",{className:"glass-card p-3 flex items-center justify-between cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xm,{className:`w-4 h-4 ${O?"text-rose-400":"text-slate-500"}`}),s.jsx("span",{className:"text-xs text-slate-200",children:"置顶紧急"})]}),s.jsx("input",{type:"checkbox",checked:O,onChange:Y=>G(Y.target.checked),className:"rounded bg-slate-900 border-slate-700 text-rose-500 focus:ring-0"})]}),s.jsxs("div",{className:"glass-card p-2.5 flex flex-col justify-center",children:[s.jsx("span",{className:"text-[10px] text-slate-400 mb-1",children:"展示时长"}),s.jsxs("select",{value:z,onChange:Y=>F(Number(Y.target.value)),className:"bg-transparent text-xs text-white border-none p-0 focus:ring-0",children:[s.jsx("option",{value:15,className:"bg-slate-900",children:"15 秒"}),s.jsx("option",{value:30,className:"bg-slate-900",children:"30 秒"}),s.jsx("option",{value:60,className:"bg-slate-900",children:"60 秒"})]})]})]}),s.jsx("button",{type:"submit",disabled:I||!u||!N.trim(),className:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-semibold text-sm transition-all duration-200 flex items-center justify-center gap-2 shadow-lg shadow-emerald-600/30 disabled:opacity-40 disabled:cursor-not-allowed",children:I?s.jsxs(s.Fragment,{children:[s.jsx(Gc,{className:"w-4 h-4 animate-spin"}),s.jsx("span",{children:"正在秒级投递至教室大屏..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(aa,{className:"w-4 h-4"}),s.jsx("span",{children:"立即下发到教室大屏"})]})})]})})}),s.jsx("div",{className:"lg:col-span-5 space-y-4",children:s.jsxs("div",{className:"glass-panel p-5 border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[s.jsx(Fm,{className:"w-4 h-4 text-emerald-400"}),"实时回执动态 (ACK)"]}),s.jsx("span",{className:"text-xs text-slate-500",children:"毫秒级同步"})]}),s.jsx("div",{className:"space-y-3 max-h-[580px] overflow-y-auto pr-1",children:W.length===0?s.jsx("div",{className:"text-center py-16 text-xs text-slate-500",children:"暂无发送记录,在左侧选择班级即可下发第一条呼叫"}):W.map(Y=>s.jsxs("div",{className:"glass-card p-4 space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-semibold text-sm text-white",children:Y.className}),s.jsx("span",{className:"text-[11px] font-mono text-slate-500",children:new Date(Y.createdAt).toLocaleTimeString()})]}),s.jsx("div",{className:"text-xs text-slate-300 bg-slate-950/50 p-2.5 rounded-lg border border-slate-800/80",children:Y.message}),s.jsxs("div",{className:"pt-1.5 border-t border-slate-800/60 flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-slate-400 text-[11px]",children:"回执阶段:"}),Y.status==="Acknowledged"&&s.jsxs("div",{className:"inline-flex items-center gap-1.5 text-emerald-400 font-medium",children:[s.jsx(es,{className:"w-4 h-4 text-emerald-400"}),s.jsxs("span",{children:["学生已确认 (",Y.confirmedAt?new Date(Y.confirmedAt).toLocaleTimeString():"刚刚",")"]})]}),Y.status==="Delivered"&&s.jsxs("div",{className:"inline-flex items-center gap-1.5 text-sky-400 font-medium",children:[s.jsx(aa,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:"教室大屏已接收"})]}),Y.status==="Sent"&&s.jsxs("div",{className:"inline-flex items-center gap-1.5 text-amber-400",children:[s.jsx(ts,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:"云端投递中..."})]}),Y.status==="Timeout"&&s.jsx("div",{className:"text-slate-400 text-xs",children:s.jsx("span",{children:"超时已自动关闭"})})]})]},Y.id))})]})})]})]})},ch=({allowedRoles:a})=>{const{user:c,isLoading:u}=Zl();return u?s.jsx("div",{className:"min-h-screen bg-slate-950 flex items-center justify-center text-slate-400 text-sm",children:"正在验证用户身份..."}):c?a&&!a.includes(c.role)?c.role==="SuperAdmin"?s.jsx(Ot,{to:"/admin",replace:!0}):c.role==="SchoolAdmin"?s.jsx(Ot,{to:"/school-admin",replace:!0}):s.jsx(Ot,{to:"/teacher",replace:!0}):s.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100 flex flex-col",children:[s.jsx(th,{}),s.jsx("main",{className:"flex-1 max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-6",children:s.jsxs(Qc,{children:[s.jsx(Je,{path:"/admin",element:s.jsx(rh,{})}),s.jsx(Je,{path:"/admin/devices",element:s.jsx(lh,{})}),s.jsx(Je,{path:"/admin/codes",element:s.jsx(Rc,{})}),s.jsx(Je,{path:"/admin/history",element:s.jsx(sh,{})}),s.jsx(Je,{path:"/school-admin",element:s.jsx(ih,{})}),s.jsx(Je,{path:"/school-admin/classes",element:s.jsx(ah,{})}),s.jsx(Je,{path:"/school-admin/teachers",element:s.jsx(oh,{})}),s.jsx(Je,{path:"/school-admin/codes",element:s.jsx(Rc,{})}),s.jsx(Je,{path:"/teacher",element:s.jsx(uh,{})}),s.jsx(Je,{path:"*",element:s.jsx(Ot,{to:"/",replace:!0})})]})})]}):s.jsx(Ot,{to:"/login",replace:!0})},dh=()=>{const{user:a,isLoading:c}=Zl();return c?s.jsx("div",{className:"min-h-screen bg-slate-950 flex items-center justify-center text-slate-400 text-sm",children:"正在初始化..."}):a?a.role==="SuperAdmin"?s.jsx(Ot,{to:"/admin",replace:!0}):a.role==="SchoolAdmin"?s.jsx(Ot,{to:"/school-admin",replace:!0}):s.jsx(Ot,{to:"/teacher",replace:!0}):s.jsx(Ot,{to:"/login",replace:!0})},fh=()=>s.jsx(om,{children:s.jsx(nm,{children:s.jsxs(Qc,{children:[s.jsx(Je,{path:"/login",element:s.jsx(nh,{})}),s.jsx(Je,{path:"/",element:s.jsx(dh,{})}),s.jsx(Je,{path:"/*",element:s.jsx(ch,{})})]})})});ip.createRoot(document.getElementById("root")).render(s.jsx(Mc.StrictMode,{children:s.jsx(fh,{})})); ================================================================================ FILE: src/Server/ClassNotify.Server/wwwroot/index.html ================================================================================ ClassNotify 智慧教室通知与集控平台
================================================================================ FILE: src/Server/classnotify.service ================================================================================ [Unit] Description=ClassNotify Cloud SignalR Server (.NET 8) After=network.target [Service] WorkingDirectory=/var/www/classnotify ExecStart=/usr/bin/dotnet /var/www/classnotify/ClassNotify.Server.dll Restart=always RestartSec=10 KillSignal=SIGINT SyslogIdentifier=classnotify User=www-data Environment=ASPNETCORE_ENVIRONMENT=Production Environment=ASPNETCORE_URLS=http://127.0.0.1:5000 Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false [Install] WantedBy=multi-user.target ================================================================================ FILE: src/Server/docker-compose.yml ================================================================================ version: '3.8' services: server: build: context: ../../ dockerfile: src/Server/ClassNotify.Server/Dockerfile restart: always environment: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://+:5000 ports: - "5000:5000" caddy: image: caddy:alpine restart: always ports: - "80:80" - "443:443" volumes: - ./Caddyfile:/etc/caddy/Caddyfile - caddy_data:/data - caddy_config:/config depends_on: - server volumes: caddy_data: caddy_config: ================================================================================ FILE: src/Shared/ClassNotify.Shared/ClassNotify.Shared.csproj ================================================================================ net8.0 enable enable latest ================================================================================ FILE: src/Shared/ClassNotify.Shared/Contracts/IDeviceHubClient.cs ================================================================================ using ClassNotify.Shared.Models; namespace ClassNotify.Shared.Contracts; /// /// 教室端 (Windows Service) 接收来自服务端的强类型 SignalR 契约 /// public interface IDeviceHubClient { /// /// 接收呼叫/通知指令 /// Task ReceiveNotification(NotificationDto notification); /// /// 接收服务端下发的远程维护指令 (如 self_check, restart_ui, reload_config) /// Task ReceiveRemoteCommand(string command, string? parameters); /// /// 接收配置更新 /// Task ReceiveConfigUpdate(string configJson); } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Contracts/ITeacherHubClient.cs ================================================================================ using ClassNotify.Shared.Models; namespace ClassNotify.Shared.Contracts; /// /// 教师控制端 (Web / Android) 接收来自服务端的强类型 SignalR 契约 /// public interface ITeacherHubClient { /// /// 设备在线状态变更通知 (上线/离线/心跳刷新) /// Task OnDeviceStatusChanged(DeviceStatusDto status); /// /// 消息回执更新 (已送达、学生已点击【我知道了】、超时关闭) /// Task OnAckReceiptReceived(AckReceiptDto receipt); /// /// 收到教室端健康自检体检报告 /// Task OnHealthReportReceived(DeviceHealthReportDto report); /// /// 新消息广播 /// Task OnNewNotificationBroadcast(NotificationDto notification); } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Enums/AckStatus.cs ================================================================================ namespace ClassNotify.Shared.Enums; /// /// 消息状态与回执阶段 /// public enum AckStatus { /// /// 已提交至云端服务器 /// Sent = 0, /// /// 教室端大屏/后台已成功接收 /// Delivered = 1, /// /// 学生或值日生点击了【我知道了】 /// Acknowledged = 2, /// /// 倒计时结束,窗口自动淡出关闭 /// Timeout = 3, /// /// 设备离线或投递失败 /// Failed = 4 } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Enums/DeviceOnlineState.cs ================================================================================ namespace ClassNotify.Shared.Enums; /// /// 设备在线与健康状态 /// public enum DeviceOnlineState { /// /// 离线(无心跳连接) /// Offline = 0, /// /// 正常在线 /// Online = 1, /// /// 降级运行(如后台在线但 UI 进程异常或 TTS 不可用) /// Degraded = 2 } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Enums/NotificationType.cs ================================================================================ namespace ClassNotify.Shared.Enums; /// /// 通知类别 /// public enum NotificationType { /// /// 老师呼叫(默认蓝色,高优先级) /// Call = 0, /// /// 班级常规通知(绿色) /// Notice = 1, /// /// 紧急/重要提醒(红色,全屏强调) /// Urgent = 2 } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Ipc/IpcMessage.cs ================================================================================ namespace ClassNotify.Shared.Ipc; /// /// Windows Service 与 WinUI 3 前台进程之间的命名管道 IPC 消息类型 /// public enum IpcCommandType { Ping = 0, Pong = 1, ShowNotification = 2, CloseNotification = 3, ReportAck = 4, HealthCheck = 5 } /// /// 命名管道传输帧 /// public class IpcMessage { public IpcCommandType Type { get; set; } public string? CorrelationId { get; set; } = Guid.NewGuid().ToString("N"); public string? PayloadJson { get; set; } } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/AckReceiptDto.cs ================================================================================ using ClassNotify.Shared.Enums; namespace ClassNotify.Shared.Models; /// /// 教室端确认与回执数据对象 /// public class AckReceiptDto { /// /// 对应的消息 ID /// public string MessageId { get; set; } = string.Empty; /// /// 班级编号 /// public string ClassId { get; set; } = string.Empty; /// /// 当前回执状态(Delivered / Acknowledged / Timeout) /// public AckStatus Status { get; set; } = AckStatus.Delivered; /// /// 触发时间戳 /// public DateTimeOffset Timestamp { get; set; } = DateTimeOffset.UtcNow; /// /// 备注信息(如“值日生张三确认”) /// public string? Remark { get; set; } } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/AdminDtos.cs ================================================================================ namespace ClassNotify.Shared.Models; /// /// 全局平台统计指标 (超级管理员大盘) /// public class AdminMetricsDto { public int TotalTenants { get; set; } public int TotalClassrooms { get; set; } public int TotalDevices { get; set; } public int OnlineDevices { get; set; } public int OfflineDevices => Math.Max(0, TotalDevices - OnlineDevices); public int TodayNotifications { get; set; } public int AbnormalDevices { get; set; } } /// /// 设备明细与实时状态 DTO /// public class DeviceAdminDto { public string DeviceId { get; set; } = string.Empty; public string TenantId { get; set; } = string.Empty; public string TenantName { get; set; } = string.Empty; public string ClassroomId { get; set; } = string.Empty; public string ClassroomName { get; set; } = string.Empty; public string? Hostname { get; set; } public bool IsOnline { get; set; } public DateTimeOffset? LastHeartbeat { get; set; } public string? ClientVersion { get; set; } public string? RemoteIp { get; set; } public bool ServiceRunning { get; set; } = true; public bool ClientRunning { get; set; } = true; } /// /// 学校/租户大盘 DTO /// public class TenantAdminDto { public string Id { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public int ClassroomCount { get; set; } public int DeviceCount { get; set; } public int OnlineCount { get; set; } public bool IsActive { get; set; } = true; public DateTimeOffset CreatedAt { get; set; } } /// /// 激活码详情 DTO /// public class ActivationCodeDto { public string Code { get; set; } = string.Empty; public string TenantId { get; set; } = string.Empty; public string TenantName { get; set; } = string.Empty; public string ClassroomId { get; set; } = string.Empty; public string ClassroomName { get; set; } = string.Empty; public DateTimeOffset ExpiresAt { get; set; } public bool IsUsed { get; set; } public DateTimeOffset? UsedAt { get; set; } public string? UsedByDeviceId { get; set; } } /// /// 远程指令下发请求 /// public class RemoteCommandRequestDto { public string Command { get; set; } = string.Empty; // "ping", "restart_client", "refresh_config" public string? Parameters { get; set; } } /// /// 创建班级请求 /// public class CreateClassroomDto { public string Id { get; set; } = string.Empty; public string DisplayName { get; set; } = string.Empty; public string? Grade { get; set; } public string? RoomNumber { get; set; } } /// /// 创建教师账号请求 /// public class CreateTeacherDto { public string Username { get; set; } = string.Empty; public string Password { get; set; } = string.Empty; public string FullName { get; set; } = string.Empty; public string Role { get; set; } = "Teacher"; // Teacher, SchoolAdmin } /// /// 消息历史记录与回执 /// public class NotificationRecordDto { public string Id { get; set; } = string.Empty; public string TenantId { get; set; } = string.Empty; public string ClassId { get; set; } = string.Empty; public string ClassName { get; set; } = string.Empty; public string SenderName { get; set; } = string.Empty; public string Message { get; set; } = string.Empty; public string Priority { get; set; } = "Normal"; public DateTimeOffset CreatedAt { get; set; } public string Status { get; set; } = "Sent"; // Sent, Delivered, Confirmed, Timeout public DateTimeOffset? ConfirmedAt { get; set; } } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/DeviceActivationRequestDto.cs ================================================================================ namespace ClassNotify.Shared.Models; /// /// 教室设备首次激活请求 DTO /// public class DeviceActivationRequestDto { /// /// 一次性设备激活码 (例如: H8K4-29DP) /// public string ActivationCode { get; set; } = string.Empty; /// /// 教室电脑主机名 /// public string Hostname { get; set; } = Environment.MachineName; /// /// 客户端版本号 /// public string ClientVersion { get; set; } = "2.1.0"; } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/DeviceActivationResultDto.cs ================================================================================ namespace ClassNotify.Shared.Models; /// /// 教室设备激活响应 DTO /// public class DeviceActivationResultDto { public bool Success { get; set; } public string? DeviceId { get; set; } public string? DeviceToken { get; set; } public string? TenantId { get; set; } public string? ClassId { get; set; } public string? ClassDisplayName { get; set; } public string? ErrorMessage { get; set; } } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/DeviceCredentials.cs ================================================================================ namespace ClassNotify.Shared.Models; /// /// 教室本地保存的永久设备凭证 (存储于 C:\ProgramData\ClassNotify\device_credentials.json) /// public class DeviceCredentials { public string DeviceId { get; set; } = string.Empty; public string DeviceToken { get; set; } = string.Empty; public string TenantId { get; set; } = string.Empty; public string ClassId { get; set; } = string.Empty; public string ClassDisplayName { get; set; } = string.Empty; public DateTimeOffset ActivatedAt { get; set; } = DateTimeOffset.UtcNow; } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/DeviceHealthReportDto.cs ================================================================================ namespace ClassNotify.Shared.Models; /// /// 教室设备详细健康自检报告 /// public class DeviceHealthReportDto { public string ClassId { get; set; } = string.Empty; public DateTimeOffset Timestamp { get; set; } = DateTimeOffset.UtcNow; /// /// Windows SAPI / WinRT TTS 语音引擎是否可用 /// public bool IsTtsAvailable { get; set; } /// /// WinUI 3 前台 UI 进程是否处于就绪/健康状态 /// public bool IsUiProcessRunning { get; set; } /// /// 互联网与云端连接是否正常 /// public bool IsNetworkReachable { get; set; } /// /// 域名 DNS 解析是否正常 /// public bool IsDnsResolved { get; set; } /// /// 诊断详情信息 /// public string DiagnosticMessage { get; set; } = "All checks passed."; } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/DeviceStatusDto.cs ================================================================================ using ClassNotify.Shared.Enums; namespace ClassNotify.Shared.Models; /// /// 教室设备简要在线状态模型 /// public class DeviceStatusDto { public string ClassId { get; set; } = string.Empty; public string ClassName { get; set; } = string.Empty; public string? Hostname { get; set; } public DeviceOnlineState State { get; set; } = DeviceOnlineState.Offline; public DateTimeOffset LastHeartbeat { get; set; } = DateTimeOffset.UtcNow; public string AgentVersion { get; set; } = "2.0.0"; } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/NotificationDto.cs ================================================================================ using ClassNotify.Shared.Enums; namespace ClassNotify.Shared.Models; /// /// 通知消息传输对象 (DTO) /// public class NotificationDto { /// /// 唯一消息 ID (如 msg_20260920_xxxx) /// public string Id { get; set; } = Guid.NewGuid().ToString("N"); /// /// 所属学校/租户 ID (如 "t_beijing_no4") /// public string TenantId { get; set; } = string.Empty; /// /// 目标班级编号 (如 "cls_801") /// public string ClassId { get; set; } = string.Empty; /// /// 呼叫的目标学生姓名(可选,如 "张三") /// public string? StudentName { get; set; } /// /// 弹窗标题 /// public string Title { get; set; } = "🔔 老师呼叫"; /// /// 通知正文内容 /// public string Message { get; set; } = string.Empty; /// /// 通知类型 /// public NotificationType Type { get; set; } = NotificationType.Call; /// /// 是否开启 Windows TTS 中文语音朗读 /// public bool Voice { get; set; } = true; /// /// 是否开启窗口抖动震颤 /// public bool Shake { get; set; } = true; /// /// 展示持续时长(秒),超时后自动关闭 /// public int DurationSeconds { get; set; } = 15; /// /// 教师端发送时间戳 /// public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow; } ================================================================================ FILE: src/Shared/ClassNotify.Shared/Models/TeacherLoginDto.cs ================================================================================ namespace ClassNotify.Shared.Models; /// /// 教师登录请求 DTO /// public class TeacherLoginDto { public string Username { get; set; } = string.Empty; public string Password { get; set; } = string.Empty; } /// /// 教师登录成功返回包含 Tenant Claims 的 JWT 凭证 /// public class TeacherLoginResultDto { public bool Success { get; set; } public string? Token { get; set; } public string? TenantId { get; set; } public string? UserId { get; set; } public string? FullName { get; set; } public string? Role { get; set; } public string? ErrorMessage { get; set; } } ================================================================================ FILE: src/Web/ClassNotify.Web/index.html ================================================================================ ClassNotify 智慧教室通知与集控平台
================================================================================ FILE: src/Web/ClassNotify.Web/package.json ================================================================================ { "name": "classnotify-web", "private": true, "version": "2.1.0", "type": "module", "scripts": { "dev": "vite", "build": "tsc && vite build", "preview": "vite preview" }, "dependencies": { "@microsoft/signalr": "^8.0.7", "clsx": "^2.1.1", "lucide-react": "^0.475.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.28.0", "tailwind-merge": "^2.6.0" }, "devDependencies": { "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", "autoprefixer": "^10.4.20", "postcss": "^8.4.49", "tailwindcss": "^3.4.17", "typescript": "~5.6.2", "vite": "^6.0.1" } } ================================================================================ FILE: src/Web/ClassNotify.Web/package-lock.json ================================================================================ { "name": "classnotify-web", "version": "2.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "classnotify-web", "version": "2.1.0", "dependencies": { "@microsoft/signalr": "^8.0.7", "clsx": "^2.1.1", "lucide-react": "^0.475.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.28.0", "tailwind-merge": "^2.6.0" }, "devDependencies": { "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", "autoprefixer": "^10.4.20", "postcss": "^8.4.49", "tailwindcss": "^3.4.17", "typescript": "~5.6.2", "vite": "^6.0.1" } }, "node_modules/@alloc/quick-lru": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.3.0.tgz", "integrity": "sha512-U4+70Pc5ZS9osnCBCE5Jha/ciHM+Yp+CNMNC/7HvYbNRk1Ldd+f7qO65W5qfhu/TCv+/ozljlXXe9Nj8419DMA==", "dev": true, "license": "MIT", "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@babel/code-frame": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/babel" } }, "node_modules/@babel/generator": { "version": "7.29.8", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-globals": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-plugin-utils": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { "version": "7.29.9", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.29.8" }, "bin": { "parser": "bin/babel-parser.js" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/plugin-transform-react-jsx-self": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-react-jsx-source": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/template": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { "version": "7.29.8", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.8.tgz", "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { "version": "7.29.8", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", "cpu": [ "ppc64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "aix" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/android-arm": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", "cpu": [ "arm" ], "dev": true, "license": "MIT", "optional": true, "os": [ "android" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "android" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/android-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "android" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", "cpu": [ "arm" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", "cpu": [ "ia32" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", "cpu": [ "loong64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", "cpu": [ "mips64el" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", "cpu": [ "ppc64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", "cpu": [ "riscv64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", "cpu": [ "s390x" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/netbsd-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "netbsd" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "netbsd" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/openbsd-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "openbsd" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "openbsd" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/openharmony-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "openharmony" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "sunos" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", "cpu": [ "ia32" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { "node": ">=18" } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "node_modules/@jridgewell/remapping": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.31", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@microsoft/signalr": { "version": "8.0.29", "resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-8.0.29.tgz", "integrity": "sha512-yzszFiTAuRxHm3qxNaSan3YzN8dffLqQcc3ZNJD2tn9eInCBBi7u2xCJ6AVNXjw19RDoBc+NPWfYN43K1HcjdA==", "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "eventsource": "^2.0.2", "fetch-cookie": "^2.0.3", "node-fetch": "^2.6.7", "ws": "^7.5.10" } }, "node_modules/@napi-rs/lzma-linux-x64-gnu": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", "cpu": [ "x64" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { "node": "^22.20 || ^24.12 || >=25" } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { "node": ">= 8" } }, "node_modules/@remix-run/router": { "version": "1.23.4", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.4.tgz", "integrity": "sha512-q7j5geK7xs3UJSdm9/iytUNclBnLmYx1EnSeCFXHPeutdqgIMeFeHtUZgS3EhlKxdBEAu8OwtJCwmLrEzpSs7Q==", "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-beta.27", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", "dev": true, "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.4.tgz", "integrity": "sha512-I+BSHzTAhKN2n7ZwGZsegGcZjDpLqFOMAtJz/u6uFGe0pUFbq56dEHjqJV/ZUdRJtNXNxA+hREUatZBvMR3Oiw==", "cpu": [ "arm" ], "dev": true, "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.4.tgz", "integrity": "sha512-pu3BdjS2LtEzRu2elmGzS3fIeWSZy4BMDIaLNwjorO76+k2d0LMluijhsDx3KQyQBQ/lLUZCQA9/s6csvUfuhw==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.4.tgz", "integrity": "sha512-xfSrj9MHnWK9GaSqT9U0ImHtH/N8WZlHLx4cZHiuLcqs640hvZ3hLPd5UR2AZS57FaE8HrRUSpltbZdWRxHiDA==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.4.tgz", "integrity": "sha512-bqU99PLJb/dqb3S0GIMdeuyAEETSUgZBoqXYd3Sd+WCsV+MmPhnN6JrotWyir31+QgH7EvvE5/mwGJlEoci8Fw==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-freebsd-arm64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.4.tgz", "integrity": "sha512-JinsFZ5G40oXQb+sUuiA5x689vhr6dDYK0H0NL+rwKdL6CqnmYN8PE4ZwfRSoIjrCxqTQG/SLfTtSvHeGxoVlw==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-freebsd-x64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.4.tgz", "integrity": "sha512-GAdA4UxpiNm27cLHr2GqXBpAD0x9FqwYBY7/YSP0Ss0/PNi4k8gbviqpIpYbVSRBaS2ZcegXEzgTQMbRNCwxCw==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.4.tgz", "integrity": "sha512-qDd6NoA1znaLjp4jR5U/KWCdLAKDJNB8W9ChbbDaKbo0xA+Atln5HK6LFCZ4oJQpemtRZA288DCirFRjrspptw==", "cpu": [ "arm" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.4.tgz", "integrity": "sha512-WtB5Tz5KTNINb8ZA+8sQ7bmjuS1JrRT7YverYIhUGdWWDlpzVWmIwuZE+jidkEXUn1l0zrEkaIMa8dHF3NGcsA==", "cpu": [ "arm" ], "dev": true, "libc": [ "musl" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.4.tgz", "integrity": "sha512-VcQ3L1tjnkKzWjryAVaFhHEWcqOfICX9uxVVoDzm2t0DpgKRHd2zOpVrJc0xsWeBZcBFyYROCIBdyR/fS174pg==", "cpu": [ "arm64" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.4.tgz", "integrity": "sha512-6+ZQX6P5s0cMDN2Ypb8Lbm2+/sZYmZjdaYny992ujUU9UKi/4CWoJWsl1pNvjWJHNHGK51m+jKGLlh1ylb2ifQ==", "cpu": [ "arm64" ], "dev": true, "libc": [ "musl" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.4.tgz", "integrity": "sha512-D72ZnvkFkBXOfzMMQLcwfPLyGkKb7HZ9/mf97B7v6/P5Lbv4oFOtSY/uHbS8lH6uKUOxoKiuokdb50XZSzzbJw==", "cpu": [ "loong64" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.4.tgz", "integrity": "sha512-piU6BxeqA3O9KSu3kRCIQQtNqFFaTu21SEV4FwaRZowpnj3bLaWPZHw+xFqCs0XlJ+aOH3PTRWGoglH+mKA/OA==", "cpu": [ "loong64" ], "dev": true, "libc": [ "musl" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.4.tgz", "integrity": "sha512-/5PGpHwqt2EEEOUs1XwzubE/ucr0dWDQ+to3zqi4Ds7EWpwtQ79wXc4JBoxqj/OwpawTsKWzJxHfSuBOq3DrWA==", "cpu": [ "ppc64" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.4.tgz", "integrity": "sha512-cX3beZDLWt7G2oJF+nhChiT+qtaihs+S2xi7ziGmVB+2pwPng6D0Ed0HmElQOgv2UsUmSJJLGwpBao/3TDx3VA==", "cpu": [ "ppc64" ], "dev": true, "libc": [ "musl" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.4.tgz", "integrity": "sha512-1uz2mGWHyptR7DgHHrlbdRAjXK7v7elGZ9lMja910/RP+ZYbX6xAmCiU9UZSX4hqmgtHMv6lr5l3kq1HIOpcag==", "cpu": [ "riscv64" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.4.tgz", "integrity": "sha512-nLS8topojxyz7SRpKR2IODRpQ0XPZ+xaOXvT3+hqK/Uy8Lo5HFgkkIBiIrCu5tL5YqzTvgovGw55PwpahTAGig==", "cpu": [ "riscv64" ], "dev": true, "libc": [ "musl" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.4.tgz", "integrity": "sha512-gs7DRKotr3l3q+jGPQBjH0ng1FjlEDm5ueQrkw5JtQvtLyEIcLASqAEaor56BhkKRzk+IcQzrcanBdb/bBQn8g==", "cpu": [ "s390x" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.4.tgz", "integrity": "sha512-791ET7W17NnScOZM7h4dX5hYspxE28htPFsb1awY/NRR8+PRNkS53e475rDdxXXDrP+kwnCcNWg9CX5ztn/Aqw==", "cpu": [ "x64" ], "dev": true, "libc": [ "glibc" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.4.tgz", "integrity": "sha512-iwZQRcmj7g88g3tzefIrQY7qvmuA/cfYwhrDtTBhsmukO4U2huVO5W+86XacUMRvdSFVAc6kZUZy21JaRwiB9w==", "cpu": [ "x64" ], "dev": true, "libc": [ "musl" ], "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-openbsd-x64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.4.tgz", "integrity": "sha512-dVHFp9gRWrdTpnqQuGfCwd7hOQDatK1VCP2iWhLY/cGrOQs/ucFzJ6A5SRqbXX12ZDI8EUuejSM5kwg+ja7Png==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "openbsd" ] }, "node_modules/@rollup/rollup-openharmony-arm64": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.4.tgz", "integrity": "sha512-t3NlauOW6gxZVVFcBEnO62Cb4wbyDFL416gTg1uFI/2tgqYQlf69FbSE115Ajre9I+c26Lk4mcmdFUsS/DGifQ==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "openharmony" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.4.tgz", "integrity": "sha512-xWuIaSye5FWZF8+UYtVEcHtRJDN5kN9Kfgxx3Kq8XIov9KSKbc1fiqQCm90SKrgQbUXZelbnUhnlUJmfSE7P9A==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.4.tgz", "integrity": "sha512-9ALJJUOg/ZflMJepVo2PlgsGxSaxN7SQ4Z8GoZfVlarWr6r3rkHUNsd/zAio7p4YMtChSMXPionxej4Hkf6CXQ==", "cpu": [ "ia32" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.4.tgz", "integrity": "sha512-blj9z5qx/Pv4WU0W1NMFDB97e0JH5ed+aZGywW8WCvp/NhWX/4PFAq5uu6Q0AebNn+Vo6KzUYDT++JzTT5ojlQ==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.4.tgz", "integrity": "sha512-Erx822VRBwLa124shbj+wNXe//BOgMEctDV0m1aqTQdNO1S69DgNUCFKC1RCeZfixs1J31l6igk1ziyXErbigQ==", "cpu": [ "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "node_modules/@types/babel__generator": { "version": "7.27.0", "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__traverse": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.28.2" } }, "node_modules/@types/estree": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, "node_modules/@types/prop-types": { "version": "15.7.15", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", "dev": true, "license": "MIT" }, "node_modules/@types/react": { "version": "18.3.31", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", "dev": true, "license": "MIT", "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" } }, "node_modules/@types/react-dom": { "version": "18.3.7", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", "dev": true, "license": "MIT", "peerDependencies": { "@types/react": "^18.0.0" } }, "node_modules/@vitejs/plugin-react": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.28.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, "engines": { "node": ">=6.5" } }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true, "license": "MIT" }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" }, "engines": { "node": ">= 8" } }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", "dev": true, "license": "MIT" }, "node_modules/autoprefixer": { "version": "10.6.1", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.1.tgz", "integrity": "sha512-cL1Qz6ADZhcEbny/8HPfe99J6HhNoYtpX2LFLIbhgGE7Q1hlQVkYFdetDN7Id3KiQxhDrHwzlHr/YQCnZ8+xSA==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/autoprefixer" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "browserslist": "^4.28.9", "caniuse-lite": "^1.0.30001810", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "bin": { "autoprefixer": "bin/autoprefixer" }, "engines": { "node": "^10 || ^12 || >=14" }, "peerDependencies": { "postcss": "^8.1.0" } }, "node_modules/baseline-browser-mapping": { "version": "2.11.25", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.25.tgz", "integrity": "sha512-gMmEShwwq7FJqMwvfRwvCl00v4kN+KOfJqXn+f4nrufak5gNHJOksd/60Dvjuz7sI8Y5WiSFBa8FEYr+zoyqCw==", "dev": true, "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" }, "engines": { "node": ">=6.0.0" } }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, "license": "MIT", "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { "version": "4.29.0", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.0.tgz", "integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "baseline-browser-mapping": "^2.11.23", "caniuse-lite": "^1.0.30001810", "electron-to-chromium": "^1.5.427", "node-releases": "^2.0.55", "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, "node_modules/camelcase-css": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", "dev": true, "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/caniuse-lite": { "version": "1.0.30001810", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz", "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "CC-BY-4.0" }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "funding": { "url": "https://paulmillr.com/funding/" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/chokidar/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", "dev": true, "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, "license": "MIT" }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true, "license": "MIT", "bin": { "cssesc": "bin/cssesc" }, "engines": { "node": ">=4" } }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", "dev": true, "license": "MIT" }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "dev": true, "license": "Apache-2.0" }, "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", "dev": true, "license": "MIT" }, "node_modules/electron-to-chromium": { "version": "1.5.433", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.433.tgz", "integrity": "sha512-5lCAbyZBjtmUt/RAGHRqrL2q0oEFRThDAsZHHDn9XHa89Qw7gMYOeSicBTy+AHfvo0r6vwsZvqNJTQIQy1BLzA==", "dev": true, "license": "ISC" }, "node_modules/es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", "dev": true, "hasInstallScript": true, "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, "engines": { "node": ">=18" }, "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" } }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/eventsource": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz", "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==", "license": "MIT", "engines": { "node": ">=12.0.0" } }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" } }, "node_modules/fast-glob/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/fastq": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz", "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fetch-cookie": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-2.2.0.tgz", "integrity": "sha512-h9AgfjURuCgA2+2ISl8GbavpUdR+WGAM2McW/ovn4tVccegp8ZqCKWSBR8uRdM8dDNlx5WdKRWxBYUwteLDCNQ==", "license": "Unlicense", "dependencies": { "set-cookie-parser": "^2.4.8", "tough-cookie": "^4.0.0" } }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/fraction.js": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", "dev": true, "license": "MIT", "engines": { "node": "*" }, "funding": { "type": "github", "url": "https://github.com/sponsors/rawify" } }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, "engines": { "node": ">=10.13.0" } }, "node_modules/hasown": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/is-core-module": { "version": "2.17.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.4" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, "engines": { "node": ">=0.10.0" } }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/jiti": { "version": "1.21.7", "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", "dev": true, "license": "MIT", "bin": { "jiti": "bin/jiti.js" } }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { "node": ">=6" } }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", "bin": { "json5": "lib/cli.js" }, "engines": { "node": ">=6" } }, "node_modules/lilconfig": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "dev": true, "license": "MIT", "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true, "license": "MIT" }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/lucide-react": { "version": "0.475.0", "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.475.0.tgz", "integrity": "sha512-NJzvVu1HwFVeZ+Gwq2q00KygM1aBhy/ZrhY9FsAgJtpB+E4R7uxRk9M2iKvHa6/vNxZydIB59htha4c2vvwvVg==", "license": "ISC", "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, "license": "MIT", "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", "thenify-all": "^1.0.0" } }, "node_modules/nanoid": { "version": "3.3.19", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz", "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, "engines": { "node": "4.x || >=6.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "peerDependenciesMeta": { "encoding": { "optional": true } } }, "node_modules/node-releases": { "version": "2.0.56", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.56.tgz", "integrity": "sha512-x0InOIyzgdk+eyaWaRJFH5snEtiImgBgblZ2CyPrLmqqcuMQkEvcDPHbzqbD8eDsSeJbVOjn+crzyzHaM4D+/A==", "dev": true, "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", "dev": true, "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true, "license": "MIT" }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pirates": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/postcss": { "version": "8.5.28", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/postcss-import": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", "dev": true, "license": "MIT", "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "postcss": "^8.0.0" } }, "node_modules/postcss-js": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "camelcase-css": "^2.0.1" }, "engines": { "node": "^12 || ^14 || >= 16" }, "peerDependencies": { "postcss": "^8.4.21" } }, "node_modules/postcss-load-config": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "lilconfig": "^3.1.1" }, "engines": { "node": ">= 18" }, "peerDependencies": { "jiti": ">=1.21.0", "postcss": ">=8.0.9", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "peerDependenciesMeta": { "jiti": { "optional": true }, "postcss": { "optional": true }, "tsx": { "optional": true }, "yaml": { "optional": true } } }, "node_modules/postcss-nested": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.1.1" }, "engines": { "node": ">=12.0" }, "peerDependencies": { "postcss": "^8.2.14" } }, "node_modules/postcss-selector-parser": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.4.tgz", "integrity": "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==", "dev": true, "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" }, "engines": { "node": ">=4" } }, "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true, "license": "MIT" }, "node_modules/psl": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", "license": "MIT", "dependencies": { "punycode": "^2.3.1" }, "funding": { "url": "https://github.com/sponsors/lupomontero" } }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "license": "MIT" }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ], "license": "MIT" }, "node_modules/react": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" }, "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "node_modules/react-refresh": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-router": { "version": "6.30.6", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.6.tgz", "integrity": "sha512-5HfK7k5im7LTOB0EqCQmfvy4C13G92Ssj1VTmouTK3AJvyjKTnFuCV0vcMAD/JS+JC4DvDIBRrlAeJIFjh5VWg==", "license": "MIT", "dependencies": { "@remix-run/router": "1.23.4" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "react": ">=16.8" } }, "node_modules/react-router-dom": { "version": "6.30.6", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.6.tgz", "integrity": "sha512-0RHKZz7wwffvkU+2MFVT2NnjK44ssLEV+m0CAJaS2Ksmorrwj7WxH00jO0SOCW26/tINUnJHToXblDs33I38YQ==", "license": "MIT", "dependencies": { "@remix-run/router": "1.23.4", "react-router": "6.30.6" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "react": ">=16.8", "react-dom": ">=16.8" } }, "node_modules/read-cache": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.2.tgz", "integrity": "sha512-/peqiBB/n07gQGLsWaHho3WfvUyRscw0gYTsEFMhrIe/nWLkYaf5SbKYjGYqtRV3aPwykJgF2VEMo1ac4bnsGA==", "dev": true, "license": "MIT" }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, "engines": { "node": ">=8.10.0" } }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "license": "MIT" }, "node_modules/resolve": { "version": "1.22.12", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rollup": { "version": "4.63.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.4.tgz", "integrity": "sha512-4U0liVayNIoLp3GFl1FcI8561WepLnZ1rqfraGh7S9B3Ur5F9S283y8Futii7RUU2C/97tOBmBy7nYvhoiOpbQ==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.9" }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { "@napi-rs/lzma-linux-x64-gnu": "1.5.1", "@rollup/rollup-android-arm-eabi": "4.63.4", "@rollup/rollup-android-arm64": "4.63.4", "@rollup/rollup-darwin-arm64": "4.63.4", "@rollup/rollup-darwin-x64": "4.63.4", "@rollup/rollup-freebsd-arm64": "4.63.4", "@rollup/rollup-freebsd-x64": "4.63.4", "@rollup/rollup-linux-arm-gnueabihf": "4.63.4", "@rollup/rollup-linux-arm-musleabihf": "4.63.4", "@rollup/rollup-linux-arm64-gnu": "4.63.4", "@rollup/rollup-linux-arm64-musl": "4.63.4", "@rollup/rollup-linux-loong64-gnu": "4.63.4", "@rollup/rollup-linux-loong64-musl": "4.63.4", "@rollup/rollup-linux-ppc64-gnu": "4.63.4", "@rollup/rollup-linux-ppc64-musl": "4.63.4", "@rollup/rollup-linux-riscv64-gnu": "4.63.4", "@rollup/rollup-linux-riscv64-musl": "4.63.4", "@rollup/rollup-linux-s390x-gnu": "4.63.4", "@rollup/rollup-linux-x64-gnu": "4.63.4", "@rollup/rollup-linux-x64-musl": "4.63.4", "@rollup/rollup-openbsd-x64": "4.63.4", "@rollup/rollup-openharmony-arm64": "4.63.4", "@rollup/rollup-win32-arm64-msvc": "4.63.4", "@rollup/rollup-win32-ia32-msvc": "4.63.4", "@rollup/rollup-win32-x64-gnu": "4.63.4", "@rollup/rollup-win32-x64-msvc": "4.63.4", "fsevents": "~2.3.2" } }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ], "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" } }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/set-cookie-parser": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", "license": "MIT" }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/sucrase": { "version": "3.35.1", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "tinyglobby": "^0.2.11", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" }, "engines": { "node": ">=16 || 14 >=14.17" } }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/tailwind-merge": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.1.tgz", "integrity": "sha512-Oo6tHdpZsGpkKG88HJ8RR1rg/RdnEkQEfMoEk2x1XRI3F1AxeU+ijRXpiVUF4UbLfcxxRGw6TbUINKYdWVsQTQ==", "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/dcastil" } }, "node_modules/tailwindcss": { "version": "3.4.19", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", "dev": true, "license": "MIT", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.21.7", "lilconfig": "^3.1.3", "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.1.1", "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", "postcss-nested": "^6.2.0", "postcss-selector-parser": "^6.1.2", "resolve": "^1.22.8", "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" }, "engines": { "node": ">=14.0.0" } }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "license": "MIT", "dependencies": { "any-promise": "^1.0.0" } }, "node_modules/thenify-all": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "dev": true, "license": "MIT", "dependencies": { "thenify": ">= 3.1.0 < 4" }, "engines": { "node": ">=0.8" } }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" }, "funding": { "url": "https://github.com/sponsors/SuperchupuDev" } }, "node_modules/tinyglobby/node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", "engines": { "node": ">=12.0.0" }, "peerDependencies": { "picomatch": "^3 || ^4" }, "peerDependenciesMeta": { "picomatch": { "optional": true } } }, "node_modules/tinyglobby/node_modules/picomatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, "engines": { "node": ">=8.0" } }, "node_modules/tough-cookie": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", "universalify": "^0.2.0", "url-parse": "^1.5.3" }, "engines": { "node": ">=6" } }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true, "license": "Apache-2.0" }, "node_modules/typescript": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=14.17" } }, "node_modules/universalify": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "license": "MIT", "engines": { "node": ">= 4.0.0" } }, "node_modules/update-browserslist-db": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" } }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "license": "MIT", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true, "license": "MIT" }, "node_modules/vite": { "version": "6.4.3", "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" }, "engines": { "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, "jiti": { "optional": true }, "less": { "optional": true }, "lightningcss": { "optional": true }, "sass": { "optional": true }, "sass-embedded": { "optional": true }, "stylus": { "optional": true }, "sugarss": { "optional": true }, "terser": { "optional": true }, "tsx": { "optional": true }, "yaml": { "optional": true } } }, "node_modules/vite/node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", "engines": { "node": ">=12.0.0" }, "peerDependencies": { "picomatch": "^3 || ^4" }, "peerDependenciesMeta": { "picomatch": { "optional": true } } }, "node_modules/vite/node_modules/picomatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "node_modules/ws": { "version": "7.5.13", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", "integrity": "sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==", "license": "MIT", "engines": { "node": ">=8.3.0" }, "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "peerDependenciesMeta": { "bufferutil": { "optional": true }, "utf-8-validate": { "optional": true } } }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "license": "ISC" } } } ================================================================================ FILE: src/Web/ClassNotify.Web/postcss.config.js ================================================================================ export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, } ================================================================================ FILE: src/Web/ClassNotify.Web/src/api/client.ts ================================================================================ import { AdminMetrics, TenantAdmin, DeviceAdmin, ActivationCode, Classroom, TeacherUser, NotificationRecord, SendNotificationPayload, LoginResult, CurrentUser } from '../types'; const API_BASE = '/api'; export function getToken(): string | null { return localStorage.getItem('classnotify_token'); } export function setToken(token: string) { localStorage.setItem('classnotify_token', token); } export function clearToken() { localStorage.removeItem('classnotify_token'); localStorage.removeItem('classnotify_user'); } async function request(endpoint: string, options: RequestInit = {}): Promise { const token = getToken(); const headers: Record = { 'Content-Type': 'application/json', ...(options.headers as Record), }; if (token) { headers['Authorization'] = `Bearer ${token}`; } const res = await fetch(`${API_BASE}${endpoint}`, { ...options, headers, }); if (res.status === 401) { clearToken(); window.location.href = '/login'; throw new Error('未授权或登录已过期,请重新登录'); } if (!res.ok) { let errorMsg = `请求失败 (${res.status})`; try { const err = await res.json(); errorMsg = err.message || err.errorMessage || errorMsg; } catch { // ignore json parse error } throw new Error(errorMsg); } return res.json() as Promise; } export const api = { // Auth login: (username: string, password: string): Promise => request('/auth/login', { method: 'POST', body: JSON.stringify({ username, password }), }), getMe: (): Promise => request('/auth/me'), // SuperAdmin getAdminMetrics: (): Promise => request('/admin/metrics'), getTenants: (): Promise => request('/admin/tenants'), getAllDevices: (): Promise => request('/admin/devices'), sendDeviceCommand: (deviceId: string, command: string, parameters?: string) => request<{ success: boolean; message: string }>(`/admin/devices/${deviceId}/command`, { method: 'POST', body: JSON.stringify({ command, parameters }), }), getAdminActivationCodes: (): Promise => request('/admin/activation-codes'), generateAdminCode: (tenantId: string, classId: string) => request<{ success: boolean; code: string; message: string }>( `/admin/activation-codes?tenantId=${encodeURIComponent(tenantId)}&classId=${encodeURIComponent(classId)}`, { method: 'POST' } ), getAdminNotifications: (limit = 50): Promise => request(`/admin/notifications?limit=${limit}`), // School Admin getSchoolOverview: (): Promise<{ tenantId: string; tenantName: string; classCount: number; deviceCount: number; onlineCount: number; teacherCount: number; }> => request('/school-admin/overview'), getSchoolClasses: (): Promise => request('/school-admin/classes'), createSchoolClass: (dto: { id: string; displayName: string; grade?: string; roomNumber?: string }) => request<{ success: boolean; message: string }>('/school-admin/classes', { method: 'POST', body: JSON.stringify(dto), }), getSchoolTeachers: (): Promise => request('/school-admin/teachers'), createSchoolTeacher: (dto: { username: string; password: string; fullName: string; role: string }) => request<{ success: boolean; message: string }>('/school-admin/teachers', { method: 'POST', body: JSON.stringify(dto), }), getSchoolDevices: (): Promise => request('/school-admin/devices'), getSchoolCodes: (): Promise => request('/school-admin/activation-codes'), generateSchoolCode: (classId: string) => request<{ success: boolean; code: string; message: string }>( `/school-admin/activation-codes?classId=${encodeURIComponent(classId)}`, { method: 'POST' } ), // Teacher getTeacherClasses: (): Promise => request('/notification/classes'), sendNotification: (payload: SendNotificationPayload) => request<{ success: boolean; messageId: string; className: string; message: string }>( '/notification/send', { method: 'POST', body: JSON.stringify(payload), } ), getTeacherHistory: (classId?: string, limit = 50): Promise => request( `/notification/history?${classId ? `classId=${encodeURIComponent(classId)}&` : ''}limit=${limit}` ), }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/App.tsx ================================================================================ import React from 'react'; import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; import { AuthProvider, useAuth } from './context/AuthContext'; import { Navbar } from './components/Navbar'; import { Login } from './pages/Login'; // SuperAdmin import { AdminDashboard } from './pages/admin/AdminDashboard'; import { DeviceManagement } from './pages/admin/DeviceManagement'; import { ActivationCodes } from './pages/admin/ActivationCodes'; import { HistoryAudit } from './pages/admin/HistoryAudit'; // SchoolAdmin import { SchoolDashboard } from './pages/school/SchoolDashboard'; import { ClassManagement } from './pages/school/ClassManagement'; import { TeacherManagement } from './pages/school/TeacherManagement'; // Teacher import { TeacherConsole } from './pages/teacher/TeacherConsole'; // Role Guard Component const ProtectedLayout: React.FC<{ allowedRoles?: string[] }> = ({ allowedRoles }) => { const { user, isLoading } = useAuth(); if (isLoading) { return (
正在验证用户身份...
); } if (!user) { return ; } if (allowedRoles && !allowedRoles.includes(user.role)) { // Redirect to user's home role if (user.role === 'SuperAdmin') return ; if (user.role === 'SchoolAdmin') return ; return ; } return (
{/* SuperAdmin Routes */} } /> } /> } /> } /> {/* SchoolAdmin Routes */} } /> } /> } /> } /> {/* Teacher Routes */} } /> {/* Fallback */} } />
); }; const RootRedirect: React.FC = () => { const { user, isLoading } = useAuth(); if (isLoading) { return (
正在初始化...
); } if (!user) return ; if (user.role === 'SuperAdmin') return ; if (user.role === 'SchoolAdmin') return ; return ; }; export const App: React.FC = () => { return ( } /> } /> } /> ); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/components/Navbar.tsx ================================================================================ import React from 'react'; import { Link, useLocation } from 'react-router-dom'; import { useAuth } from '../context/AuthContext'; import { Bell, Monitor, KeyRound, History, School, Users, Layers, LogOut, ShieldCheck, GraduationCap } from 'lucide-react'; export const Navbar: React.FC = () => { const { user, logout } = useAuth(); const location = useLocation(); if (!user) return null; const isActive = (path: string) => location.pathname === path; return (
{/* Brand & Role */}
ClassNotify {user.role === 'SuperAdmin' && ( <> 超级运维后台 )} {user.role === 'SchoolAdmin' && ( <> 学校管理后台 )} {user.role === 'Teacher' && ( <> 教师工作台 )}
{/* Navigation Links */} {/* User profile & Logout */}
{user.name} {user.tenantId === 'global' ? '全平台' : user.tenantId}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/context/AuthContext.tsx ================================================================================ import React, { createContext, useContext, useState, useEffect } from 'react'; import { CurrentUser, UserRole } from '../types'; import { api, setToken, clearToken, getToken } from '../api/client'; interface AuthContextType { user: CurrentUser | null; token: string | null; login: (username: string, password: string) => Promise; logout: () => void; isLoading: boolean; } const AuthContext = createContext(undefined); export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => { const [user, setUser] = useState(null); const [token, setTokenState] = useState(getToken()); const [isLoading, setIsLoading] = useState(true); useEffect(() => { const initAuth = async () => { const savedToken = getToken(); if (savedToken) { try { const me = await api.getMe(); setUser(me); } catch { clearToken(); setTokenState(null); setUser(null); } } setIsLoading(false); }; initAuth(); }, []); const login = async (username: string, password: string): Promise => { const res = await api.login(username, password); if (!res.success || !res.token || !res.role) { throw new Error(res.errorMessage || '登录失败'); } setToken(res.token); setTokenState(res.token); const currentUser: CurrentUser = { userId: res.userId || '', name: res.fullName || username, role: res.role, tenantId: res.tenantId || '', }; setUser(currentUser); return res.role; }; const logout = () => { clearToken(); setTokenState(null); setUser(null); window.location.href = '/login'; }; return ( {children} ); }; export const useAuth = () => { const ctx = useContext(AuthContext); if (!ctx) throw new Error('useAuth must be used within an AuthProvider'); return ctx; }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/index.css ================================================================================ @tailwind base; @tailwind components; @tailwind utilities; @layer base { body { @apply bg-slate-950 text-slate-100 min-h-screen selection:bg-indigo-500 selection:text-white; } } /* Glassmorphic card styling */ .glass-panel { @apply bg-slate-900/70 backdrop-blur-xl border border-slate-800/80 rounded-2xl shadow-xl; } .glass-card { @apply bg-slate-800/40 backdrop-blur-md border border-slate-700/50 rounded-xl transition-all duration-200 hover:border-slate-600/70 hover:bg-slate-800/60; } ================================================================================ FILE: src/Web/ClassNotify.Web/src/main.tsx ================================================================================ import React from 'react'; import ReactDOM from 'react-dom/client'; import { App } from './App'; import './index.css'; ReactDOM.createRoot(document.getElementById('root')!).render( ); ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/admin/ActivationCodes.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { ActivationCode, TenantAdmin } from '../../types'; import { KeyRound, Plus, Copy, Check, Clock, CheckCircle2, School } from 'lucide-react'; export const ActivationCodes: React.FC = () => { const [codes, setCodes] = useState([]); const [tenants, setTenants] = useState([]); const [loading, setLoading] = useState(true); const [copiedCode, setCopiedCode] = useState(null); // Modal state const [showModal, setShowModal] = useState(false); const [selectedTenant, setSelectedTenant] = useState(''); const [classId, setClassId] = useState(''); const [generating, setGenerating] = useState(false); const loadData = async () => { try { const [c, t] = await Promise.all([api.getAdminActivationCodes(), api.getTenants()]); setCodes(c); setTenants(t); if (t.length > 0 && !selectedTenant) { setSelectedTenant(t[0].id); } } catch (err) { console.error('Failed to load activation codes', err); } finally { setLoading(false); } }; useEffect(() => { loadData(); }, []); const copyToClipboard = (code: string) => { navigator.clipboard.writeText(code); setCopiedCode(code); setTimeout(() => setCopiedCode(null), 2000); }; const handleGenerate = async (e: React.FormEvent) => { e.preventDefault(); if (!selectedTenant || !classId) return; setGenerating(true); try { await api.generateAdminCode(selectedTenant, classId); setShowModal(false); setClassId(''); loadData(); } catch (err: any) { alert(err.message || '生成失败'); } finally { setGenerating(false); } }; return (

全网设备激活码大盘

生成与管理各学校教室电脑安装所需的 8 位一次性硬件绑定激活码

{/* Codes Table */}
{codes.map((c) => ( {/* Code */} {/* School / Class */} {/* Status */} {/* Used Device */} {/* Expires At */} {/* Actions */} ))}
激活码 绑定学校 / 班级 使用状态 激活设备 有效期限 操作
{c.code}
{c.classroomName}
{c.tenantName}
{c.isUsed ? ( 已激活使用 ) : ( 待激活 (可用) )} {c.usedByDeviceId ? ( {c.usedByDeviceId} ) : ( - )}
{new Date(c.expiresAt).toLocaleDateString()} 到期
{/* Generate Code Modal */} {showModal && (

生成班级设备激活码

setClassId(e.target.value)} placeholder="如 cls_801 或 cls_802" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-indigo-500" required />
)}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/admin/AdminDashboard.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { AdminMetrics, TenantAdmin, NotificationRecord } from '../../types'; import { School, Monitor, Bell, Activity, ArrowUpRight, CheckCircle2, Clock } from 'lucide-react'; export const AdminDashboard: React.FC = () => { const [metrics, setMetrics] = useState(null); const [tenants, setTenants] = useState([]); const [recentNotifs, setRecentNotifs] = useState([]); const [loading, setLoading] = useState(true); const loadData = async () => { try { const [m, t, n] = await Promise.all([ api.getAdminMetrics(), api.getTenants(), api.getAdminNotifications(6), ]); setMetrics(m); setTenants(t); setRecentNotifs(n); } catch (err) { console.error('Failed to load admin dashboard data', err); } finally { setLoading(false); } }; useEffect(() => { loadData(); const timer = setInterval(loadData, 10000); // 10s auto-refresh return () => clearInterval(timer); }, []); return (
{/* Top Welcome & System Status */}

全网运行大盘

实时监控多租户集群、边缘教室硬件及云端连接状态

东京主节点 (Caddy + ASP.NET Core 8) 正常运行
{/* Metric Cards */}
{/* Total Tenants */}
入驻学校 / 租户
{loading ? '-' : metrics?.totalTenants ?? 0} 所学校
{/* Total Devices */}
总设备数量
{loading ? '-' : metrics?.totalDevices ?? 0} 台教室终端
{/* Online Devices */}
在线设备
{loading ? '-' : metrics?.onlineDevices ?? 0} / 离线 {loading ? '-' : metrics?.offlineDevices ?? 0}
{/* Today Notifications */}
今日呼叫通知
{loading ? '-' : metrics?.todayNotifications ?? 0} 次下发
{/* Grid: Tenants Summary & Recent Notifications */}
{/* Tenants List */}

学校 / 租户在线统计

每 10 秒实时刷新
{tenants.map((t) => { const rate = t.deviceCount > 0 ? Math.round((t.onlineCount / t.deviceCount) * 100) : 0; return ( ); })}
学校名称 班级数 设备数 在线状态 在线率
{t.name} ({t.id}) {t.classroomCount} {t.deviceCount}
{t.onlineCount} / {t.deviceCount} 在线
= 80 ? 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/30' : rate > 0 ? 'bg-amber-500/10 text-amber-400 border border-amber-500/30' : 'bg-slate-800 text-slate-400' }`} > {rate}%
{/* Recent Notifications Feed */}

全网最新呼叫

实时审计
{recentNotifs.length === 0 ? (
暂无呼叫记录
) : ( recentNotifs.map((n) => (
{n.className} {n.status === 'Acknowledged' ? '已确认' : n.status === 'Delivered' ? '已送达' : '下发中'}
{n.message}
发起: {n.senderName} {new Date(n.createdAt).toLocaleTimeString()}
)) )}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/admin/DeviceManagement.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { DeviceAdmin } from '../../types'; import { Monitor, RefreshCw, RotateCcw, Activity, Terminal, CheckCircle2, AlertCircle, Search, Bell } from 'lucide-react'; export const DeviceManagement: React.FC = () => { const [devices, setDevices] = useState([]); const [loading, setLoading] = useState(true); const [search, setSearch] = useState(''); const [commandResult, setCommandResult] = useState<{ deviceId: string; message: string; success: boolean; } | null>(null); const [actionLoading, setActionLoading] = useState(null); const loadDevices = async () => { try { const data = await api.getAllDevices(); setDevices(data); } catch (err) { console.error('Failed to load devices', err); } finally { setLoading(false); } }; useEffect(() => { loadDevices(); const interval = setInterval(loadDevices, 5000); // Poll every 5s for live heartbeats return () => clearInterval(interval); }, []); const handleCommand = async (deviceId: string, cmd: string, params?: string) => { setActionLoading(`${deviceId}_${cmd}`); setCommandResult(null); try { const res = await api.sendDeviceCommand(deviceId, cmd, params); setCommandResult({ deviceId, message: res.message, success: true, }); // Refresh list loadDevices(); } catch (err: any) { setCommandResult({ deviceId, message: err.message || '远程指令执行失败', success: false, }); } finally { setActionLoading(null); } }; const formatHeartbeat = (timeStr?: string) => { if (!timeStr) return '从无心跳'; const diff = Math.floor((Date.now() - new Date(timeStr).getTime()) / 1000); if (diff < 10) return '刚刚 (几秒前)'; if (diff < 60) return `${diff} 秒前`; if (diff < 3600) return `${Math.floor(diff / 60)} 分钟前`; return `${Math.floor(diff / 3600)} 小时前`; }; const filteredDevices = devices.filter( (d) => d.tenantName.toLowerCase().includes(search.toLowerCase()) || d.classroomName.toLowerCase().includes(search.toLowerCase()) || d.deviceId.toLowerCase().includes(search.toLowerCase()) || (d.hostname && d.hostname.toLowerCase().includes(search.toLowerCase())) ); return (
{/* Header */}

全网设备集控中心

实时查看教室边缘设备健康状态,直接下发远程自检、重启与配置刷新指令

{/* Command Result Banner */} {commandResult && (
{commandResult.success ? ( ) : ( )} [设备 {commandResult.deviceId}] {commandResult.message}
)} {/* Search Filter */}
setSearch(e.target.value)} placeholder="按学校、班级、设备编号或计算机名过滤..." className="bg-transparent border-none text-sm text-white placeholder-slate-500 focus:outline-none w-full" /> {search && ( )}
{/* Devices Table */}
{filteredDevices.length === 0 ? ( ) : ( filteredDevices.map((d) => ( {/* School / Class */} {/* Device ID / Hostname */} {/* Status */} {/* Last Heartbeat */} {/* Version */} {/* Remote Operations */} )) )}
学校 / 班级 设备编号 运行状态 最后心跳 客户端版本 远程运维操作
{loading ? '正在同步设备状态...' : '暂无匹配的设备'}
{d.classroomName}
{d.tenantName}
{d.deviceId}
{d.hostname || 'Classroom-PC'}
{d.isOnline ? (
在线 (Session 0)
) : (
离线
)}
{formatHeartbeat(d.lastHeartbeat)}
{d.remoteIp || '127.0.0.1'}
v{d.clientVersion || '2.1.0'}
{/* Ping / SelfCheck */} {/* Restart Client */} {/* Refresh Config */}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/admin/HistoryAudit.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { NotificationRecord } from '../../types'; import { History, Search, RefreshCw, CheckCircle2, Clock, Send, AlertTriangle } from 'lucide-react'; export const HistoryAudit: React.FC = () => { const [notifications, setNotifications] = useState([]); const [loading, setLoading] = useState(true); const [search, setSearch] = useState(''); const loadData = async () => { try { const data = await api.getAdminNotifications(100); setNotifications(data); } catch (err) { console.error('Failed to load notifications', err); } finally { setLoading(false); } }; useEffect(() => { loadData(); const timer = setInterval(loadData, 8000); return () => clearInterval(timer); }, []); const filtered = notifications.filter( (n) => n.className.toLowerCase().includes(search.toLowerCase()) || n.senderName.toLowerCase().includes(search.toLowerCase()) || n.message.toLowerCase().includes(search.toLowerCase()) || n.id.toLowerCase().includes(search.toLowerCase()) ); return (

全网呼叫历史与回执审计

追踪全网每条通知从下发、教室大屏接收、到学生点击确认的全流程时间戳与 ACK 回执

{/* Filter */}
setSearch(e.target.value)} placeholder="搜索消息内容、班级或教师姓名..." className="bg-transparent border-none text-sm text-white placeholder-slate-500 focus:outline-none w-full" />
{/* Audit Table */}
{filtered.length === 0 ? ( ) : ( filtered.map((n) => ( )) )}
目标班级 通知正文 发起老师 下发时间 回执状态 (ACK) 确认时间
{loading ? '正在加载审计数据...' : '暂无呼叫历史记录'}
{n.className}
{n.classId}
{n.message}
{n.id}
{n.senderName} {new Date(n.createdAt).toLocaleTimeString()} {n.status === 'Acknowledged' && ( 学生已点击确认 )} {n.status === 'Delivered' && ( 已送达教室大屏 )} {n.status === 'Sent' && ( 云端下发中 )} {n.status === 'Timeout' && ( 超时自动关闭 )} {n.confirmedAt ? ( {new Date(n.confirmedAt).toLocaleTimeString()} ) : ( - )}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/Login.tsx ================================================================================ import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../context/AuthContext'; import { Bell, Lock, User, Shield, School, GraduationCap, ArrowRight, Loader2 } from 'lucide-react'; export const Login: React.FC = () => { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(null); const [loading, setLoading] = useState(false); const { login } = useAuth(); const navigate = useNavigate(); const handleLogin = async (u = username, p = password) => { setError(null); setLoading(true); try { const role = await login(u, p); if (role === 'SuperAdmin') navigate('/admin'); else if (role === 'SchoolAdmin') navigate('/school-admin'); else navigate('/teacher'); } catch (err: any) { setError(err.message || '登录失败,请检查账号密码'); } finally { setLoading(false); } }; const quickLogin = (u: string, p: string) => { setUsername(u); setPassword(p); handleLogin(u, p); }; return (
{/* Subtle background glow */}
{/* Header */}

ClassNotify 控制台

智慧教室通知与设备集控一体化系统

{/* Error Message */} {error && (
{error}
)} {/* Form */}
{ e.preventDefault(); handleLogin(); }} className="space-y-4" >
setUsername(e.target.value)} placeholder="admin / admin_bj4 / teacher_zhang" className="w-full pl-10 pr-4 py-2.5 rounded-xl bg-slate-950/60 border border-slate-700/80 text-white placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500" required />
setPassword(e.target.value)} placeholder="••••••••" className="w-full pl-10 pr-4 py-2.5 rounded-xl bg-slate-950/60 border border-slate-700/80 text-white placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500" required />
{/* Quick Demo Switcher */}
⚡ 快速体验预设身份
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/school/ClassManagement.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { Classroom } from '../../types'; import { Layers, Plus, KeyRound, Check, Copy } from 'lucide-react'; export const ClassManagement: React.FC = () => { const [classes, setClasses] = useState([]); const [loading, setLoading] = useState(true); // New Class Modal const [showAddModal, setShowAddModal] = useState(false); const [classId, setClassId] = useState(''); const [displayName, setDisplayName] = useState(''); const [grade, setGrade] = useState(''); const [roomNumber, setRoomNumber] = useState(''); const [submitting, setSubmitting] = useState(false); // Generated Code Toast const [newCodeInfo, setNewCodeInfo] = useState<{ classId: string; code: string } | null>(null); const loadClasses = async () => { try { const data = await api.getSchoolClasses(); setClasses(data); } catch (err) { console.error('Failed to load classes', err); } finally { setLoading(false); } }; useEffect(() => { loadClasses(); }, []); const handleCreateClass = async (e: React.FormEvent) => { e.preventDefault(); if (!classId || !displayName) return; setSubmitting(true); try { await api.createSchoolClass({ id: classId, displayName, grade, roomNumber }); setShowAddModal(false); setClassId(''); setDisplayName(''); setGrade(''); setRoomNumber(''); loadClasses(); } catch (err: any) { alert(err.message || '创建班级失败'); } finally { setSubmitting(false); } }; const handleGenerateCode = async (cId: string) => { try { const res = await api.generateSchoolCode(cId); setNewCodeInfo({ classId: cId, code: res.code }); } catch (err: any) { alert(err.message || '生成激活码失败'); } }; return (

本校班级管理

维护学校全部教学班级,并为各班级生成设备激活码

{/* Generated Code Alert */} {newCodeInfo && (
【{newCodeInfo.classId}】激活码已生成: {newCodeInfo.code} (请在教室电脑运行 ClassNotifySetup.exe 输入该激活码完成绑定)
)} {/* Class List Table */}
{classes.map((c) => ( ))}
班级名称 班级编号 (ClassId) 年级 教室位置 操作
{c.displayName} {c.id} {c.grade || '-'} {c.roomNumber || '-'}
{/* Modal */} {showAddModal && (

新建教学班级

setClassId(e.target.value)} placeholder="如 cls_803 或 cls_grade7_1" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" required />
setDisplayName(e.target.value)} placeholder="如 八年级(3)班" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" required />
setGrade(e.target.value)} placeholder="如 初二 / 高一" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" />
setRoomNumber(e.target.value)} placeholder="如 教学楼 303" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" />
)}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/school/SchoolDashboard.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { DeviceAdmin } from '../../types'; import { School, Layers, Users, Monitor, Activity, Plus } from 'lucide-react'; import { Link } from 'react-router-dom'; export const SchoolDashboard: React.FC = () => { const [overview, setOverview] = useState<{ tenantId: string; tenantName: string; classCount: number; deviceCount: number; onlineCount: number; teacherCount: number; } | null>(null); const [devices, setDevices] = useState([]); const [loading, setLoading] = useState(true); const loadData = async () => { try { const [ov, devs] = await Promise.all([api.getSchoolOverview(), api.getSchoolDevices()]); setOverview(ov); setDevices(devs); } catch (err) { console.error('Failed to load school overview', err); } finally { setLoading(false); } }; useEffect(() => { loadData(); const timer = setInterval(loadData, 6000); return () => clearInterval(timer); }, []); return (
{/* Header */}

{overview?.tenantName || '本校管理后台'}

管理本校班级配置、多媒体教室设备绑定与科任教师账号

{/* Metrics */}
已建班级
{loading ? '-' : overview?.classCount ?? 0} 个教学班
教室终端
{loading ? '-' : overview?.deviceCount ?? 0} 台已安装
实时在线
{loading ? '-' : overview?.onlineCount ?? 0} / 总 {loading ? '-' : overview?.deviceCount ?? 0}
教师账号
{loading ? '-' : overview?.teacherCount ?? 0} 位老师
{/* Classroom Devices Section */}

本校各教室设备状态

班级管理
{devices.length === 0 ? ( ) : ( devices.map((d) => ( )) )}
班级名称 设备编号 设备状态 最后心跳 版本
暂无已绑定的教室设备,请前往【本校激活码】生成激活码并在教室电脑安装
{d.classroomName} {d.deviceId} {d.isOnline ? ( 在线 ) : ( 离线 )} {d.lastHeartbeat ? new Date(d.lastHeartbeat).toLocaleTimeString() : '无'} v{d.clientVersion || '2.1.0'}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/school/TeacherManagement.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { TeacherUser } from '../../types'; import { Users, Plus, Shield, GraduationCap } from 'lucide-react'; export const TeacherManagement: React.FC = () => { const [teachers, setTeachers] = useState([]); const [loading, setLoading] = useState(true); // Modal state const [showAddModal, setShowAddModal] = useState(false); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [fullName, setFullName] = useState(''); const [role, setRole] = useState<'Teacher' | 'SchoolAdmin'>('Teacher'); const [submitting, setSubmitting] = useState(false); const loadTeachers = async () => { try { const data = await api.getSchoolTeachers(); setTeachers(data); } catch (err) { console.error('Failed to load teachers', err); } finally { setLoading(false); } }; useEffect(() => { loadTeachers(); }, []); const handleCreate = async (e: React.FormEvent) => { e.preventDefault(); if (!username || !password || !fullName) return; setSubmitting(true); try { await api.createSchoolTeacher({ username, password, fullName, role }); setShowAddModal(false); setUsername(''); setPassword(''); setFullName(''); loadTeachers(); } catch (err: any) { alert(err.message || '创建教师账号失败'); } finally { setSubmitting(false); } }; return (

本校教师账号管理

为科任教师开设 ClassNotify 网页控制台与后续 Android 移动端登录权限

{/* Teachers Table */}
{teachers.map((t) => ( ))}
教师姓名 登录账号 (Username) 账号权限角色 状态
{t.role === 'SchoolAdmin' ? ( ) : ( )} {t.fullName} {t.username} {t.role === 'SchoolAdmin' ? ( 学校管理员 ) : ( 任课教师 )} 正常可用
{/* Modal */} {showAddModal && (

开设新账号

setFullName(e.target.value)} placeholder="如 王老师 / 李明" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" required />
setUsername(e.target.value)} placeholder="如 teacher_wang" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" required />
setPassword(e.target.value)} placeholder="••••••••" className="w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-700 text-white text-sm focus:ring-2 focus:ring-sky-500" required />
)}
); }; ================================================================================ FILE: src/Web/ClassNotify.Web/src/pages/teacher/TeacherConsole.tsx ================================================================================ import React, { useEffect, useState } from 'react'; import { api } from '../../api/client'; import { Classroom, NotificationRecord } from '../../types'; import { Bell, Send, Volume2, Sparkles, CheckCircle2, Clock, AlertTriangle, User, Radio, Check, Loader2 } from 'lucide-react'; export const TeacherConsole: React.FC = () => { const [classes, setClasses] = useState([]); const [selectedClassId, setSelectedClassId] = useState(''); const [studentName, setStudentName] = useState(''); const [message, setMessage] = useState(''); const [voice, setVoice] = useState(true); const [shake, setShake] = useState(true); const [isUrgent, setIsUrgent] = useState(false); const [duration, setDuration] = useState(15); const [sending, setSending] = useState(false); const [history, setHistory] = useState([]); const [loading, setLoading] = useState(true); // Presets const presets = [ '请带各科作业本到办公室', '马上到操场集合整队', '课代表请到教研室领试卷', '午休时间请教室内保持安静', '请班长负责维护自习纪律', '放学后值日生留下来打扫卫生', ]; const loadClassesAndHistory = async () => { try { const cls = await api.getTeacherClasses(); setClasses(cls); if (cls.length > 0 && !selectedClassId) { setSelectedClassId(cls[0].id); } const hist = await api.getTeacherHistory(undefined, 20); setHistory(hist); } catch (err) { console.error('Failed to load teacher console data', err); } finally { setLoading(false); } }; useEffect(() => { loadClassesAndHistory(); const timer = setInterval(async () => { try { const hist = await api.getTeacherHistory(undefined, 20); setHistory(hist); } catch {} }, 4000); // 4s refresh for live ACK updates return () => clearInterval(timer); }, []); const handleSend = async (e: React.FormEvent) => { e.preventDefault(); if (!selectedClassId || !message.trim()) return; setSending(true); try { const targetClass = classes.find((c) => c.id === selectedClassId); const title = studentName.trim() ? `🔔 老师呼叫: ${studentName.trim()}` : `📢 ${targetClass?.displayName || '班级'}通知`; await api.sendNotification({ classId: selectedClassId, studentName: studentName.trim() || undefined, title, message: message.trim(), type: isUrgent ? 2 : 0, // 2=Urgent, 0=Call voice, shake, durationSeconds: duration, }); setMessage(''); setStudentName(''); // Refresh history immediately const hist = await api.getTeacherHistory(undefined, 20); setHistory(hist); } catch (err: any) { alert(err.message || '呼叫发送失败'); } finally { setSending(false); } }; return (

教师呼叫工作台

向指定教室大屏下发即时点呼与通知,支持语音朗读(TTS)与学生回执确认

{/* Left Form: 7 cols */}
{/* Target Class Selector */}
{classes.map((c) => ( ))}
{/* Target Student (Optional) */}
setStudentName(e.target.value)} placeholder="如 李晓明 / 张伟 (可选)" className="w-full pl-10 pr-4 py-2 rounded-xl bg-slate-950/70 border border-slate-700 text-white placeholder-slate-500 text-sm focus:ring-2 focus:ring-emerald-500/50" />
{/* Message Content & Presets */}
点击下方快捷标签快速填入
{presets.map((p) => ( ))}