diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de5060f6..53b07392 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,8 @@ jobs: cache: npm - name: Install dependencies run: npm ci - - name: Typecheck - run: npm run typecheck + - name: Check + run: npm run check - name: Test run: npm test - name: Build diff --git a/.gitignore b/.gitignore index 08a891f8..b2436ac7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ resources/bin csdn-blog.md updater-server/.vercel .env +.vitest/ diff --git a/AGENTS.md b/AGENTS.md index 3af34a14..db61d99f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,8 +22,8 @@ map data providers, an AI globe assistant ("EOQ agent"), and teaching/drawing to **Pinned versions — do not bump casually:** -- `vite@^7` — electron-vite@5 peer range tops out at vite 7. -- `typescript@5.9.x` — pinned TypeScript version (`tsconfig.node.json` + `tsconfig.web.json`). +- `vite-plus` — Vite+ provides Vite 8 through the npm alias for `vite` (`@voidzero-dev/vite-plus-core`). Keep the `devDependencies` alias and the `overrides` entry aligned when upgrading Vite+. +- `typescript@^7` — the native TypeScript compiler (`tsconfig.node.json` + `tsconfig.web.json`). TypeScript 7 has no stable JS API yet, so tests that compile or parse source import TypeScript 6 from `@typescript/typescript6`. Type checking runs in `npm run check` through Vite+, so don't call `tsc` from scripts: `@typescript/typescript6` also links a TypeScript 6 `tsc` into `node_modules/.bin`. - `@base-ui/react@^1.9` + `tailwindcss@^4.3` + `lucide-react` — headless Base UI primitives wrapped in `src/renderer/src/components/ui/` following [DESIGN.md](./DESIGN.md) monochrome Light/Dark tokens. Do not reintroduce `antd` or `@ant-design/*`. - Electron binaries must be installed manually with the npmmirror mirror: `ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" node node_modules/electron/install.js` @@ -95,10 +95,14 @@ npm run dev # electron-vite dev server + app npm run build # production build npm run fetch:ffmpeg # pinned LGPL FFmpeg for Windows or Linux into resources/bin npm run build:linux # AppImage + deb for Linux x64 and arm64 -npm run typecheck # tsc (node) + tsc (web) -npm test # node:test unit tests (tests/*.test.mjs), run by CI +npm run check # vp check: lint and type checks (format is off for now), run by CI +npm test # Vitest unit tests through Vite+ (tests/*.test.mjs), run by CI ``` +Vite+ config lives in `vite.config.mts`, on top of the `@liangmi/vp-config` preset. Rules that don't fit GuEarth are turned off there with a reason. Disable a rule inline only with `// oxlint-disable-next-line -- `. Import test APIs from `vite-plus/test`, not `vitest`. + +Vitest uses native Node.js imports (`experimental.viteModuleRunner: false` in `vite.config.mts`), so the `module.registerHooks` fixtures in the tests can load React components and simulate filesystem failures. + ## Docs - https://ant.design/llms.txt diff --git a/electron.vite.config.ts b/electron.vite.config.ts index c07ca5b0..439a3eb9 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,5 +1,5 @@ -import { cpSync, createReadStream, existsSync, statSync } from 'fs' -import { extname, join, resolve, sep } from 'path' +import { cpSync, createReadStream, existsSync, statSync } from 'node:fs' +import { extname, join, resolve, sep } from 'node:path' import { defineConfig } from 'electron-vite' import type { Connect, Plugin } from 'vite' import react from '@vitejs/plugin-react' @@ -22,8 +22,8 @@ const cesiumMimeTypes: Record = { const serveCesiumAsset: Connect.NextHandleFunction = (req, res, next) => { const assetPath = resolve(cesiumBuild, `.${(req.url ?? '/').split('?')[0]}`) - if (!assetPath.startsWith(cesiumBuild + sep)) return next() - if (!existsSync(assetPath) || !statSync(assetPath).isFile()) return next() + if (!assetPath.startsWith(cesiumBuild + sep)) { next(); return;} + if (!existsSync(assetPath) || !statSync(assetPath).isFile()) { next(); return;} res.setHeader('Content-Type', cesiumMimeTypes[extname(assetPath).toLowerCase()] ?? 'application/octet-stream') res.setHeader('Cache-Control', 'no-cache') createReadStream(assetPath).pipe(res) @@ -37,7 +37,7 @@ function cesiumStaticPlugin(): Plugin { }, writeBundle(options) { const outDir = options.dir - if (!outDir) return + if (!outDir) {return} for (const dir of cesiumDirs) { cpSync(join(cesiumBuild, dir), join(outDir, 'cesium', dir), { recursive: true }) } @@ -49,7 +49,7 @@ export default defineConfig({ main: { build: { externalizeDeps: false, - rollupOptions: { + rolldownOptions: { external: ['koffi'], input: { index: resolve('src/main/index.ts'), @@ -72,16 +72,14 @@ export default defineConfig({ }, plugins: [react(), tailwindcss(), cesiumStaticPlugin()], build: { - rollupOptions: { + rolldownOptions: { input: { index: resolve('src/renderer/index.html'), offscreen: resolve('src/renderer/offscreen.html') }, output: { - manualChunks(id) { - const normalizedId = id.replaceAll('\\', '/') - if (normalizedId.includes('/node_modules/cesium/') || normalizedId.includes('/node_modules/@cesium/')) return 'cesium' - return undefined + codeSplitting: { + groups: [{ name: 'cesium', test: /[\\/]node_modules[\\/]@?cesium[\\/]/ }] } } } diff --git a/package-lock.json b/package-lock.json index 58504103..4c9b127b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,11 +22,13 @@ "@assistant-ui/react": "^0.15.37", "@assistant-ui/react-markdown": "^0.14.26", "@base-ui/react": "^1.9.0", + "@liangmi/vp-config": "^1.0.2", "@sentry/electron": "^8.0.0", "@tailwindcss/vite": "^4.3.5", "@types/node": "^26.6.3", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", + "@typescript/typescript6": "^6.0.2", "@vitejs/plugin-react": "^5.2.0", "cesium": "^1.145.0", "class-variance-authority": "^0.7.1", @@ -35,7 +37,7 @@ "echarts": "^6.1.0", "electron": "^44.9.1", "electron-builder": "^26.15.3", - "electron-vite": "^5.0.0", + "electron-vite": "^6.0.0", "jsdom": "^31.0.1", "lucide-react": "^1.77.0", "markdown-it": "^15.0.3", @@ -46,8 +48,9 @@ "tailwind-merge": "^3.7.1", "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", - "typescript": "^5.9.3", - "vite": "^7.3.7", + "typescript": "^7.0.2", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000", + "vite-plus": "1.7.0", "zustand": "^5.1.0" } }, @@ -551,6 +554,13 @@ } } }, + "node_modules/@blazediff/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@blazediff/core/-/core-1.10.0.tgz", + "integrity": "sha512-AOQff0zgR7cGsZL+4E7hVkmujoPUpm0J9xzWGWZj5wCjd3gmxESXAPfKyuzs93VdpQNFhHlBhfOjrcZ+XTERtQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@cesium/engine": { "version": "26.3.0", "resolved": "https://registry.npmmirror.com/@cesium/engine/-/engine-26.3.0.tgz", @@ -837,1092 +847,1054 @@ "node": ">=14.14" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", - "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", - "cpu": [ - "ppc64" - ], + "node_modules/@emnapi/core": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", + "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==", "dev": true, + "license": "MIT", "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@emnapi/wasi-threads": "2.2.0", + "tslib": "^2.4.0" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.28.2.tgz", - "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", - "cpu": [ - "arm" - ], + "node_modules/@emnapi/runtime": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz", + "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==", "dev": true, + "license": "MIT", "optional": true, - "os": [ - "android" - ], + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz", + "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@exodus/bytes": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.16.0.tgz", + "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "dev": true, "engines": { - "node": ">=18" + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@noble/hashes": "^1.8.0 || ^2.0.0" + }, + "peerDependenciesMeta": { + "@noble/hashes": { + "optional": true + } + } + }, + "node_modules/@floating-ui/core": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.8.0.tgz", + "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", + "dev": true, + "dependencies": { + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.8.0.tgz", + "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", + "dev": true, + "dependencies": { + "@floating-ui/core": "^1.8.0", + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@floating-ui/react-dom/-/react-dom-2.1.9.tgz", + "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==", + "dev": true, + "dependencies": { + "@floating-ui/dom": "^1.8.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.12", + "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.12.tgz", + "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", + "dev": true + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz", + "integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "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.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@esbuild/android-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", - "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "node_modules/@koromix/koffi-android-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-arm64/-/koffi-android-arm64-3.3.8.tgz", + "integrity": "sha512-Y0lt2JexRGXlg1PxFuegfi5p6bIcLMj7Mig0WapZRKEM3Yv2L9J3Ej4XHPYMsB0TRNttBRHiliaJOH6EedEIXg==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/android-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.28.2.tgz", - "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "node_modules/@koromix/koffi-android-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-x64/-/koffi-android-x64-3.3.8.tgz", + "integrity": "sha512-ZOwUZJoQ7Xd0rRF85Qc5XyIBjZPKGNLNgoTFakWdxn55AoZ6zdGEYvOXQMIN8JLjQ6qYUiQMtlFlusddZr+pjA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", - "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "node_modules/@koromix/koffi-darwin-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-arm64/-/koffi-darwin-arm64-3.3.8.tgz", + "integrity": "sha512-7tzlnYSePCQW66iEIi+wgN9HgTiF431KL9wIDhH9b+32KOYZXBdA+JyDgRVi2E5AIyJ1hdkQFNg7YCAOft2mKw==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", - "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "node_modules/@koromix/koffi-darwin-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-x64/-/koffi-darwin-x64-3.3.8.tgz", + "integrity": "sha512-Pw1EsCT9Yov4Szo4joLhABbQfqNgYhwfkhWZiIbEZ2b3sGyv9Yj2N0p00jOpdTfQ+u9QFFi8XhNivJbBTqMTPA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", - "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "node_modules/@koromix/koffi-freebsd-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-arm64/-/koffi-freebsd-arm64-3.3.8.tgz", + "integrity": "sha512-bpkvHfxUn5EqaHQO9k42lqO8+5t9aF8McgJyOsXx+vd/xicA0Zc0vP2kz0MjQu760ZdsR3WI4VFiNh2xHRP6Lw==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" + } + }, + "node_modules/@koromix/koffi-freebsd-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-ia32/-/koffi-freebsd-ia32-3.3.8.tgz", + "integrity": "sha512-h2WI3Ofb+TioTqWDTMXPgtZ2LAghY2CPwZwMM3mZeGAzKygo9RxZ4PRGq8bvrdvinR4VN9ZK+H48m9GV3/u3mQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "freebsd" + ], + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", - "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "node_modules/@koromix/koffi-freebsd-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-x64/-/koffi-freebsd-x64-3.3.8.tgz", + "integrity": "sha512-Z1VAr2CfWaHYfqJ1UlbZBH2IcPqZHilBSCgSqDmVhmyN/tSz5kSjaRfxcBGloJted3CCvsNFg8lOJiKkPiAUNQ==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", - "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "node_modules/@koromix/koffi-linux-arm": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm/-/koffi-linux-arm-3.3.8.tgz", + "integrity": "sha512-9c9IfIz5sFpzbuwV2HomSBWOakpbd9tJ3FChmE556KdPzw9iXrJoMT5JyzPnUe10Soag2NK6SMKrDafOsR6J2A==", "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", - "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "node_modules/@koromix/koffi-linux-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm64/-/koffi-linux-arm64-3.3.8.tgz", + "integrity": "sha512-7yknlwsy7X76+Qy7leuI+RTQfYHX1W8Uv+CFpyiMsdLnpaSCpNJDIpCr6/qnQzpLx93mRncB+VBBD2PB/IMX8g==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", - "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "node_modules/@koromix/koffi-linux-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ia32/-/koffi-linux-ia32-3.3.8.tgz", + "integrity": "sha512-/AqDOcvQzeSDnwDsdqfJP2LjBgCX6CJZwSuYJc+YZCFFtUvsIDq9sRfSvyDy6xTC3HTkJKaT1SrrlE6Ji1aZCA==", "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", - "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "node_modules/@koromix/koffi-linux-loong64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-loong64/-/koffi-linux-loong64-3.3.8.tgz", + "integrity": "sha512-XgqxynMlKdcPZ5Hu0EyhFqfvEMcqm1RzLj8vbhRTtwV/GhrAMoToExzcF5uHXqiVL/EsWE1V/BmdrCfjlUsqtA==", "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", - "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", - "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "node_modules/@koromix/koffi-linux-ppc64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ppc64/-/koffi-linux-ppc64-3.3.8.tgz", + "integrity": "sha512-nzoG1pIu00cdwbMmQ+U4Tr1Xaej1L/XP39wG0nQMviDf/7tlZeM8i/yD1ggNHeSYao/CHcaJr0eW5IjmkfO10Q==", "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", - "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "node_modules/@koromix/koffi-linux-riscv64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-riscv64/-/koffi-linux-riscv64-3.3.8.tgz", + "integrity": "sha512-i6CtjaydMXmhvUPz5gCCodgCBCQOA27Cs0mCTcodHzaJCmICqlmGr0y7ManHIeqTxzrDNIJERa0BFNBpoPpe4A==", "cpu": [ "riscv64" ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", - "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", - "cpu": [ - "s390x" - ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", - "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "node_modules/@koromix/koffi-linux-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-x64/-/koffi-linux-x64-3.3.8.tgz", + "integrity": "sha512-0KyTCxjxzjdwCxTA8HdEFCLeJLZPQdOqpJQVvf2KJA8izmnDlM/g2NZd6jNJ4lwvuU8+R6fN7zW0OrwSM6pHzA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", - "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", - "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", - "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "node_modules/@koromix/koffi-openbsd-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-arm64/-/koffi-openbsd-arm64-3.3.8.tgz", + "integrity": "sha512-HY1pfpsHrHL248y3TRg0FAa8MlSLuVMABkkieiKINqNvIWWvuMekZO/zQM+BtmgFQHXO+t/Hd0W55fzH/U2EYA==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "openbsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", - "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "node_modules/@koromix/koffi-openbsd-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-ia32/-/koffi-openbsd-ia32-3.3.8.tgz", + "integrity": "sha512-745gBEJnFhO9N7mnRVRkd2NQnQGbBUKkEUsJcm2Di5KBkkTyfjf2BQSvzegJE+ab6gLnQ57ZEA0UwBBdS0MlrA==", "cpu": [ - "x64" + "ia32" ], - "dev": true, "optional": true, "os": [ "openbsd" ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", - "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", - "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "node_modules/@koromix/koffi-openbsd-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-x64/-/koffi-openbsd-x64-3.3.8.tgz", + "integrity": "sha512-bwcuk5PquAQGgR1DYAVrZwInSEeKuq0RXFylejAs5kQCJCBoyUOipkAJj4q4HYdOtCCxwqdrMm/+XwXrwtf3ZQ==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ - "sunos" + "openbsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", - "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "node_modules/@koromix/koffi-win32-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-arm64/-/koffi-win32-arm64-3.3.8.tgz", + "integrity": "sha512-f43sCr9lxFIvkOEE0Br+Qr5+KH2XqRm/EAQgAflYprIsjCz4eBTPVwEjbuymyN/6iDEKyO7EDz/7xQgNiyvIyA==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", - "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "node_modules/@koromix/koffi-win32-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-ia32/-/koffi-win32-ia32-3.3.8.tgz", + "integrity": "sha512-aBozU1HP1mWzanVAoo2fkJBLJsEVVs2b3/FbtqbotrgDFsBt8r71LNX+mKX7d4YASXMIAsUPG3iXBpNtk7+Y8Q==", "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", - "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "node_modules/@koromix/koffi-win32-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-x64/-/koffi-win32-x64-3.3.8.tgz", + "integrity": "sha512-Ef9XpIn/AfnZWMI1lvA6IOjCsTVRlako+BXosp4cRaLZZXkgjwiBVqYXXhqZix1G8e+27UAv97XBTmDEyfS7jA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@exodus/bytes": { - "version": "1.16.0", - "resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.16.0.tgz", - "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "node_modules/@liangmi/vp-config": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@liangmi/vp-config/-/vp-config-1.0.2.tgz", + "integrity": "sha512-WbirZirK+TCupY9ilWLEEnMMmABA5zhcuY3AY4cx9x9KNBtYrEOg0zN4rEn9rjzssxk9m0ewoQHfiH3EH3fyHA==", "dev": true, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + "license": "MIT", + "dependencies": { + "@oxlint-flat-config/composer": "^0.3.1", + "oxlint-flat-config": "^0.4.0" }, "peerDependencies": { - "@noble/hashes": "^1.8.0 || ^2.0.0" - }, - "peerDependenciesMeta": { - "@noble/hashes": { - "optional": true - } + "vite-plus": ">=1.0.0" } }, - "node_modules/@floating-ui/core": { - "version": "1.8.0", - "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.8.0.tgz", - "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", + "node_modules/@malept/cross-spawn-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", + "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/malept" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" + } + ], "dependencies": { - "@floating-ui/utils": "^0.2.12" + "cross-spawn": "^7.0.1" + }, + "engines": { + "node": ">= 12.13.0" } }, - "node_modules/@floating-ui/dom": { - "version": "1.8.0", - "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.8.0.tgz", - "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", + "node_modules/@malept/flatpak-bundler": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", + "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", "dev": true, "dependencies": { - "@floating-ui/core": "^1.8.0", - "@floating-ui/utils": "^0.2.12" + "debug": "^4.1.1", + "fs-extra": "^9.0.0", + "lodash": "^4.17.15", + "tmp-promise": "^3.0.2" + }, + "engines": { + "node": ">= 10.0.0" } }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.9", - "resolved": "https://registry.npmmirror.com/@floating-ui/react-dom/-/react-dom-2.1.9.tgz", - "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==", + "node_modules/@malept/flatpak-bundler/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "dependencies": { - "@floating-ui/dom": "^1.8.0" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" + "engines": { + "node": ">=10" } }, - "node_modules/@floating-ui/utils": { - "version": "0.2.12", - "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.12.tgz", - "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", - "dev": true - }, - "node_modules/@isaacs/fs-minipass": { - "version": "4.0.1", - "resolved": "https://registry.npmmirror.com/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", - "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", + "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "minipass": "^7.0.4" + "@tybys/wasm-util": "^0.10.3" }, "engines": { - "node": ">=18.0.0" + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", + "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" } }, - "node_modules/@isaacs/nonrecursive-glob-match": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz", - "integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==", + "node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", "dev": true, - "license": "BlueOak-1.0.0" + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, + "node_modules/@opentelemetry/api": { + "version": "1.10.0", + "resolved": "https://registry.npmmirror.com/@opentelemetry/api/-/api-1.10.0.tgz", + "integrity": "sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.223.0", + "resolved": "https://registry.npmmirror.com/@opentelemetry/api-logs/-/api-logs-0.223.0.tgz", + "integrity": "sha512-Oepm6etVPFCn0VWB1t833iOTgz1eYBDUPxcrOR/XvwzD1+Ag9VzSPSrrKAFNJ/haatj+8CXbG47pZXvdNQKDJw==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" } }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, + "node_modules/@opentelemetry/core": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/core/-/core-3.1.1.tgz", + "integrity": "sha512-6wc9r0zrTsAVOd/5UrZBsrHhXWNfwisolgWxd8o3Eu1HKIz8cAxQjOdGrrJB406ceFiGV+ckTcLdXzB+y/QVTA==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, + "node_modules/@opentelemetry/exporter-logs-otlp-http": { + "version": "0.301.2", + "resolved": "https://registry.npmmirror.com/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.301.2.tgz", + "integrity": "sha512-l3K1Fp2qaxAS8wKPyjVm7/QfnvJXZZfPuGXa+AYzNeoOk6qxcZwWZhLe9SYemWxDrtPTl3Mj82diLgVzbz54Hw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/otlp-exporter-base": "0.301.2", + "@opentelemetry/otlp-transformer": "0.301.2", + "@opentelemetry/sdk-logs": "3.1.1" + }, "engines": { - "node": ">=6.0.0" + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.10.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.6.0", - "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", - "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", - "dev": true + "node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.301.2", + "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.301.2.tgz", + "integrity": "sha512-XlC8Mqeqk5vY9/jXU2No4tAPDO4g7d3QqgxznctJrM1wzF/xKUiBvQwlQguGL98nEBweq2NCkXMGj4QIGSpplg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/otlp-transformer": "0.301.2" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.10.0" + } }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, + "node_modules/@opentelemetry/otlp-transformer": { + "version": "0.301.2", + "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.301.2.tgz", + "integrity": "sha512-Ap4MhVvrta1YAXoLKLdX9KuEy8zfupMRaDmbOFm0afxPqe56dAo2cCe52TDN6t175E6i4hnrBMzDXpnDR843eg==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1", + "@opentelemetry/sdk-logs": "3.1.1", + "@opentelemetry/sdk-metrics": "3.1.1", + "@opentelemetry/sdk-trace": "3.1.1" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@koromix/koffi-android-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-arm64/-/koffi-android-arm64-3.3.8.tgz", - "integrity": "sha512-Y0lt2JexRGXlg1PxFuegfi5p6bIcLMj7Mig0WapZRKEM3Yv2L9J3Ej4XHPYMsB0TRNttBRHiliaJOH6EedEIXg==", + "node_modules/@opentelemetry/resources": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/resources/-/resources-3.1.1.tgz", + "integrity": "sha512-dSd0FI1rfl+WHeaZxCTCEvwv6vcmUqkOHHTGWMkmyHg+PyL/wLbCqgsGKgI0wOwT0KGy9IMPAvY85hT8IPwApA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" + } + }, + "node_modules/@opentelemetry/sdk-logs": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-logs/-/sdk-logs-3.1.1.tgz", + "integrity": "sha512-Z2V826tjNXRaCP7EtaJGzNuk16o8rq8OWnYBS60tfCkGyUv3Eugrz3GIj7AiXb5MAyeeOR2PJ9EC8WjeGeAgbg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-metrics/-/sdk-metrics-3.1.1.tgz", + "integrity": "sha512-QBDkERTMERMxwtH7hHbE6esoo+5Tdb79MtF9lMh1EIFlij39prkSEWlfSD2flUGGv15b0GQ1X2jj/JqG9gQBTw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" + } + }, + "node_modules/@opentelemetry/sdk-trace": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-trace/-/sdk-trace-3.1.1.tgz", + "integrity": "sha512-DJZXZJu1H3kek9Kh9SqJ46yN3faiNiabnqkEtl9eVnBvs4KuK+ynmk9jOyB0NfWAXWGZlTivCf46uwiXyr2PGA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.45.0", + "resolved": "https://registry.npmmirror.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.45.0.tgz", + "integrity": "sha512-aOP45mbcOKbQVvFWfQmgoOPT8R2iwbbbgl83k4CujGV9BrJhFr3qG55MFpwFs4YLabpuW3HhzUY9eQxPlDqaZw==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/@oxc-parser/binding-android-arm-eabi": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.143.0.tgz", + "integrity": "sha512-n9uozULWflPqBtdmI8lAabLqGKNgLVNN0ZH8HfgCwpKGNtzRzauB76jTiW/3YLkcA7N1zskpi9GdVnZuu1SAvg==", "cpu": [ - "arm64" + "arm" ], + "dev": true, "optional": true, "os": [ "android" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-android-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-x64/-/koffi-android-x64-3.3.8.tgz", - "integrity": "sha512-ZOwUZJoQ7Xd0rRF85Qc5XyIBjZPKGNLNgoTFakWdxn55AoZ6zdGEYvOXQMIN8JLjQ6qYUiQMtlFlusddZr+pjA==", + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.143.0.tgz", + "integrity": "sha512-9BbdjHETk6O3zH/DDid9IgBtF0GlpLabNKN231uraXpRDSfY+iiZxTP5bk1Z63GBownVdhdINFIeddmMz4MzpQ==", "cpu": [ - "x64" + "arm64" ], + "dev": true, "optional": true, "os": [ "android" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-darwin-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-arm64/-/koffi-darwin-arm64-3.3.8.tgz", - "integrity": "sha512-7tzlnYSePCQW66iEIi+wgN9HgTiF431KL9wIDhH9b+32KOYZXBdA+JyDgRVi2E5AIyJ1hdkQFNg7YCAOft2mKw==", + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.143.0.tgz", + "integrity": "sha512-gh+6ecoHUy4/sUcolBl/1qPXKBbYNxFY0Pk0ujgQvINTMSftJY7o4yb8gOkDJPeZeB8+a+u7xTe6umoP8N5HFA==", "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "darwin" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-darwin-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-x64/-/koffi-darwin-x64-3.3.8.tgz", - "integrity": "sha512-Pw1EsCT9Yov4Szo4joLhABbQfqNgYhwfkhWZiIbEZ2b3sGyv9Yj2N0p00jOpdTfQ+u9QFFi8XhNivJbBTqMTPA==", + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.143.0.tgz", + "integrity": "sha512-qd1hl2d+lXgHv/VQ/M9qm8TrMC5T4RqDBwtOnl+1D0QMjwcz+8AaB4JSg8STgeag0GP6a6L74XEGAsrTSJWNzQ==", "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "darwin" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-freebsd-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-arm64/-/koffi-freebsd-arm64-3.3.8.tgz", - "integrity": "sha512-bpkvHfxUn5EqaHQO9k42lqO8+5t9aF8McgJyOsXx+vd/xicA0Zc0vP2kz0MjQu760ZdsR3WI4VFiNh2xHRP6Lw==", + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.143.0.tgz", + "integrity": "sha512-M5XXcNa7aOqLPKTR41msfghKu2yQ4xWvCm11/gwU0JzOzHNk5sgW//rVEjJ+LO48+VDAMzXTSzurUVxIDKwozw==", "cpu": [ - "arm64" + "x64" ], + "dev": true, "optional": true, "os": [ "freebsd" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-freebsd-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-ia32/-/koffi-freebsd-ia32-3.3.8.tgz", - "integrity": "sha512-h2WI3Ofb+TioTqWDTMXPgtZ2LAghY2CPwZwMM3mZeGAzKygo9RxZ4PRGq8bvrdvinR4VN9ZK+H48m9GV3/u3mQ==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "freebsd" - ], - "funding": { - "url": "https://liberapay.com/Koromix" - } - }, - "node_modules/@koromix/koffi-freebsd-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-x64/-/koffi-freebsd-x64-3.3.8.tgz", - "integrity": "sha512-Z1VAr2CfWaHYfqJ1UlbZBH2IcPqZHilBSCgSqDmVhmyN/tSz5kSjaRfxcBGloJted3CCvsNFg8lOJiKkPiAUNQ==", + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.143.0.tgz", + "integrity": "sha512-T/GXusuOkPNQhCQCSBbcU/N8j0rAypuDBl1IyFK+lyYT594XsVz80clPC/OtbSSpBGyJxj8uYEfctxVuxVYoww==", "cpu": [ - "x64" + "arm" ], + "dev": true, "optional": true, "os": [ - "freebsd" + "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-arm": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm/-/koffi-linux-arm-3.3.8.tgz", - "integrity": "sha512-9c9IfIz5sFpzbuwV2HomSBWOakpbd9tJ3FChmE556KdPzw9iXrJoMT5JyzPnUe10Soag2NK6SMKrDafOsR6J2A==", + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.143.0.tgz", + "integrity": "sha512-oKu4RcBlXSqo3OC62dp6YTnQaZIurNDpCX3BnAM3+bJxt7s8J2TJKMnC0UYer1qhlRaDCg6wkTaTw+2IlsZ12w==", "cpu": [ "arm" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm64/-/koffi-linux-arm64-3.3.8.tgz", - "integrity": "sha512-7yknlwsy7X76+Qy7leuI+RTQfYHX1W8Uv+CFpyiMsdLnpaSCpNJDIpCr6/qnQzpLx93mRncB+VBBD2PB/IMX8g==", + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.143.0.tgz", + "integrity": "sha512-WJBbD186AZmMGaSIhlktC+rPl8L3peCTXAh88Ih9uEvK0en2mPojGyCGYiL6mHtV1RPV3JyfJW5t6n5hh0lXhA==", "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ia32/-/koffi-linux-ia32-3.3.8.tgz", - "integrity": "sha512-/AqDOcvQzeSDnwDsdqfJP2LjBgCX6CJZwSuYJc+YZCFFtUvsIDq9sRfSvyDy6xTC3HTkJKaT1SrrlE6Ji1aZCA==", + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.143.0.tgz", + "integrity": "sha512-t1AcYOwEzgceadT4v5e+vaCCb0AncCA3v5AyzfBAz/tMq11qzVccXKzNHtkWdjBsgvTKwRkaUF3QvT4kot8vcQ==", "cpu": [ - "ia32" + "arm64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-loong64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-loong64/-/koffi-linux-loong64-3.3.8.tgz", - "integrity": "sha512-XgqxynMlKdcPZ5Hu0EyhFqfvEMcqm1RzLj8vbhRTtwV/GhrAMoToExzcF5uHXqiVL/EsWE1V/BmdrCfjlUsqtA==", + "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.143.0.tgz", + "integrity": "sha512-RsnO/NoD8376LMJq8JS8TwI0ieNaFRTuNe2GVJntQg6gwZNMENZsEbknHdVwjpOmxdGLGodcwaGSbAeRr5Bgjw==", "cpu": [ - "loong64" + "ppc64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-ppc64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ppc64/-/koffi-linux-ppc64-3.3.8.tgz", - "integrity": "sha512-nzoG1pIu00cdwbMmQ+U4Tr1Xaej1L/XP39wG0nQMviDf/7tlZeM8i/yD1ggNHeSYao/CHcaJr0eW5IjmkfO10Q==", + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.143.0.tgz", + "integrity": "sha512-48fSVfR9TZi5CASZFyv0VC6z6BCoeihFsX031mAD/oSH7d9PYsPgIqza7d9mjP7Z2KTEpTFyH6SIu0Ui6R1vdg==", "cpu": [ - "ppc64" + "riscv64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-riscv64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-riscv64/-/koffi-linux-riscv64-3.3.8.tgz", - "integrity": "sha512-i6CtjaydMXmhvUPz5gCCodgCBCQOA27Cs0mCTcodHzaJCmICqlmGr0y7ManHIeqTxzrDNIJERa0BFNBpoPpe4A==", + "node_modules/@oxc-parser/binding-linux-riscv64-musl": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.143.0.tgz", + "integrity": "sha512-T8CpdD+SfE01DnIOD4HpVxu0ZJOfMJ/VhCvikKfaXAxkZ+9veyLM/D2hpi7Y2hFUyPmVQO3FNZHmYzV/WlVR4g==", "cpu": [ "riscv64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-x64/-/koffi-linux-x64-3.3.8.tgz", - "integrity": "sha512-0KyTCxjxzjdwCxTA8HdEFCLeJLZPQdOqpJQVvf2KJA8izmnDlM/g2NZd6jNJ4lwvuU8+R6fN7zW0OrwSM6pHzA==", + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.143.0.tgz", + "integrity": "sha512-QLdeMsCcacenPEFsfxnBUDF1y6opyz5+fmOz9bfD5Y7fiGCMupUCuB3KTPQhNwshIG1P9fPqar9MHxuBDd4bwQ==", "cpu": [ - "x64" + "s390x" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-openbsd-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-arm64/-/koffi-openbsd-arm64-3.3.8.tgz", - "integrity": "sha512-HY1pfpsHrHL248y3TRg0FAa8MlSLuVMABkkieiKINqNvIWWvuMekZO/zQM+BtmgFQHXO+t/Hd0W55fzH/U2EYA==", + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.143.0.tgz", + "integrity": "sha512-659ujfqLy6k7cuH3sbzhd8b+ztSq+i6E2E9pG78Q0BmHjAExfGIdgc8cGgMdwAozDXeZFHkJ+LXYJdWsaGdgyw==", "cpu": [ - "arm64" + "x64" ], + "dev": true, "optional": true, "os": [ - "openbsd" + "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-openbsd-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-ia32/-/koffi-openbsd-ia32-3.3.8.tgz", - "integrity": "sha512-745gBEJnFhO9N7mnRVRkd2NQnQGbBUKkEUsJcm2Di5KBkkTyfjf2BQSvzegJE+ab6gLnQ57ZEA0UwBBdS0MlrA==", + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.143.0.tgz", + "integrity": "sha512-/Mw/9j4TfZcnKphPrzOE6t4MMknXadcAAuVUlDRTF/ETWB5xOgQvOJV2Mh9We/bWxZdoxaGAdc+hy4GuYwQ2yQ==", "cpu": [ - "ia32" + "x64" ], + "dev": true, "optional": true, "os": [ - "openbsd" + "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-openbsd-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-x64/-/koffi-openbsd-x64-3.3.8.tgz", - "integrity": "sha512-bwcuk5PquAQGgR1DYAVrZwInSEeKuq0RXFylejAs5kQCJCBoyUOipkAJj4q4HYdOtCCxwqdrMm/+XwXrwtf3ZQ==", + "node_modules/@oxc-parser/binding-openharmony-arm64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.143.0.tgz", + "integrity": "sha512-8rIKWR2BFuifbIK/1XB9wTaSdtuJ25dlE7ZQYDnEwj/2xH2vHsxnvIjHT3ZjSVuLLwGGlSslIG/fbOJ8TV8rTw==", "cpu": [ - "x64" + "arm64" ], + "dev": true, "optional": true, "os": [ - "openbsd" + "openharmony" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-win32-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-arm64/-/koffi-win32-arm64-3.3.8.tgz", - "integrity": "sha512-f43sCr9lxFIvkOEE0Br+Qr5+KH2XqRm/EAQgAflYprIsjCz4eBTPVwEjbuymyN/6iDEKyO7EDz/7xQgNiyvIyA==", + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.143.0.tgz", + "integrity": "sha512-5U9kQYMfRRI6Zq7KDxgbIP0RMnKrfn3gLepRMgJuRkPSUALTiRCk9d/uyhb4lGDjUdzwK7mBkKqhLgzBPCmLpQ==", "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "win32" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-win32-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-ia32/-/koffi-win32-ia32-3.3.8.tgz", - "integrity": "sha512-aBozU1HP1mWzanVAoo2fkJBLJsEVVs2b3/FbtqbotrgDFsBt8r71LNX+mKX7d4YASXMIAsUPG3iXBpNtk7+Y8Q==", + "node_modules/@oxc-parser/binding-win32-ia32-msvc": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.143.0.tgz", + "integrity": "sha512-25P7AaHk4R88Yv2XH4gToDVmh0cOu+bEURQU10CRrmvgabfRArSGAP5osmwUKeSUHj0VS50upbpbRWWW/m7mHA==", "cpu": [ "ia32" ], + "dev": true, "optional": true, "os": [ "win32" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-win32-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-x64/-/koffi-win32-x64-3.3.8.tgz", - "integrity": "sha512-Ef9XpIn/AfnZWMI1lvA6IOjCsTVRlako+BXosp4cRaLZZXkgjwiBVqYXXhqZix1G8e+27UAv97XBTmDEyfS7jA==", + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.143.0.tgz", + "integrity": "sha512-ORMh3JE1s6V7ySicdRK7vgaDQnn5o+UHg9ct989PlWHbel8O9ARrmWXM6kZjrBMtNucxNayQ8g69G0VfWzhANw==", "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "win32" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@malept/cross-spawn-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", - "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", + "node_modules/@oxc-project/runtime": { + "version": "0.159.0", + "resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.159.0.tgz", + "integrity": "sha512-z+wJlHpqB2rsnQ5PbQlWKC7lYISlHrniQ3N5JF4LGaa+kOopx5u5DMT2P7pN12fsXFg1gVcoLdRXPRyIS61OKQ==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/malept" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" - } - ], - "dependencies": { - "cross-spawn": "^7.0.1" - }, + "license": "MIT", "engines": { - "node": ">= 12.13.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@malept/flatpak-bundler": { - "version": "0.4.0", - "resolved": "https://registry.npmmirror.com/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", - "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", + "node_modules/@oxc-project/types": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.143.0.tgz", + "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==", "dev": true, - "dependencies": { - "debug": "^4.1.1", - "fs-extra": "^9.0.0", - "lodash": "^4.17.15", - "tmp-promise": "^3.0.2" - }, - "engines": { - "node": ">= 10.0.0" + "funding": { + "url": "https://github.com/sponsors/Boshen" } }, - "node_modules/@malept/flatpak-bundler/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@napi-rs/lzma-linux-x64-gnu": { - "version": "1.5.1", - "resolved": "https://registry.npmmirror.com/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", - "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^22.20 || ^24.12 || >=25" - } - }, - "node_modules/@noble/hashes": { - "version": "2.4.0", - "resolved": "https://registry.npmmirror.com/@noble/hashes/-/hashes-2.4.0.tgz", - "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", - "dev": true, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@opentelemetry/api": { - "version": "1.10.0", - "resolved": "https://registry.npmmirror.com/@opentelemetry/api/-/api-1.10.0.tgz", - "integrity": "sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@opentelemetry/api-logs": { - "version": "0.223.0", - "resolved": "https://registry.npmmirror.com/@opentelemetry/api-logs/-/api-logs-0.223.0.tgz", - "integrity": "sha512-Oepm6etVPFCn0VWB1t833iOTgz1eYBDUPxcrOR/XvwzD1+Ag9VzSPSrrKAFNJ/haatj+8CXbG47pZXvdNQKDJw==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@opentelemetry/core": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/core/-/core-3.1.1.tgz", - "integrity": "sha512-6wc9r0zrTsAVOd/5UrZBsrHhXWNfwisolgWxd8o3Eu1HKIz8cAxQjOdGrrJB406ceFiGV+ckTcLdXzB+y/QVTA==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/exporter-logs-otlp-http": { - "version": "0.301.2", - "resolved": "https://registry.npmmirror.com/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.301.2.tgz", - "integrity": "sha512-l3K1Fp2qaxAS8wKPyjVm7/QfnvJXZZfPuGXa+AYzNeoOk6qxcZwWZhLe9SYemWxDrtPTl3Mj82diLgVzbz54Hw==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/otlp-exporter-base": "0.301.2", - "@opentelemetry/otlp-transformer": "0.301.2", - "@opentelemetry/sdk-logs": "3.1.1" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.10.0" - } - }, - "node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.301.2", - "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.301.2.tgz", - "integrity": "sha512-XlC8Mqeqk5vY9/jXU2No4tAPDO4g7d3QqgxznctJrM1wzF/xKUiBvQwlQguGL98nEBweq2NCkXMGj4QIGSpplg==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/otlp-transformer": "0.301.2" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.10.0" - } - }, - "node_modules/@opentelemetry/otlp-transformer": { - "version": "0.301.2", - "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.301.2.tgz", - "integrity": "sha512-Ap4MhVvrta1YAXoLKLdX9KuEy8zfupMRaDmbOFm0afxPqe56dAo2cCe52TDN6t175E6i4hnrBMzDXpnDR843eg==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1", - "@opentelemetry/sdk-logs": "3.1.1", - "@opentelemetry/sdk-metrics": "3.1.1", - "@opentelemetry/sdk-trace": "3.1.1" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/resources": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/resources/-/resources-3.1.1.tgz", - "integrity": "sha512-dSd0FI1rfl+WHeaZxCTCEvwv6vcmUqkOHHTGWMkmyHg+PyL/wLbCqgsGKgI0wOwT0KGy9IMPAvY85hT8IPwApA==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/sdk-logs": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-logs/-/sdk-logs-3.1.1.tgz", - "integrity": "sha512-Z2V826tjNXRaCP7EtaJGzNuk16o8rq8OWnYBS60tfCkGyUv3Eugrz3GIj7AiXb5MAyeeOR2PJ9EC8WjeGeAgbg==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/sdk-metrics": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-metrics/-/sdk-metrics-3.1.1.tgz", - "integrity": "sha512-QBDkERTMERMxwtH7hHbE6esoo+5Tdb79MtF9lMh1EIFlij39prkSEWlfSD2flUGGv15b0GQ1X2jj/JqG9gQBTw==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/sdk-trace": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-trace/-/sdk-trace-3.1.1.tgz", - "integrity": "sha512-DJZXZJu1H3kek9Kh9SqJ46yN3faiNiabnqkEtl9eVnBvs4KuK+ynmk9jOyB0NfWAXWGZlTivCf46uwiXyr2PGA==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.45.0", - "resolved": "https://registry.npmmirror.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.45.0.tgz", - "integrity": "sha512-aOP45mbcOKbQVvFWfQmgoOPT8R2iwbbbgl83k4CujGV9BrJhFr3qG55MFpwFs4YLabpuW3HhzUY9eQxPlDqaZw==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@oxc-parser/binding-android-arm-eabi": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.143.0.tgz", - "integrity": "sha512-n9uozULWflPqBtdmI8lAabLqGKNgLVNN0ZH8HfgCwpKGNtzRzauB76jTiW/3YLkcA7N1zskpi9GdVnZuu1SAvg==", + "node_modules/@oxfmt/binding-android-arm-eabi": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.79.0.tgz", + "integrity": "sha512-xOCQ/rvokUXs8SxOQY5Wy2ukPaZJZ0PmdJovN0ryB1c8DVEtbcvliLdYtINUYh8QOTpmBOctIisSJk9tvh+J6w==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1931,14 +1903,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-android-arm64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.143.0.tgz", - "integrity": "sha512-9BbdjHETk6O3zH/DDid9IgBtF0GlpLabNKN231uraXpRDSfY+iiZxTP5bk1Z63GBownVdhdINFIeddmMz4MzpQ==", + "node_modules/@oxfmt/binding-android-arm64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.79.0.tgz", + "integrity": "sha512-WMLDvCjjchUYtI6zXKOdzTDGm72BaYZiz1/VhB1rrxdakUZRlJh1aMr3CT6ui51uHcWVBycULIXSZHpw6u2pTQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1947,14 +1920,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-darwin-arm64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.143.0.tgz", - "integrity": "sha512-gh+6ecoHUy4/sUcolBl/1qPXKBbYNxFY0Pk0ujgQvINTMSftJY7o4yb8gOkDJPeZeB8+a+u7xTe6umoP8N5HFA==", + "node_modules/@oxfmt/binding-darwin-arm64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.79.0.tgz", + "integrity": "sha512-+LzSN7w7tULz96ntS1Uqe5oI00XZ0o/m/t3+eSfiQp3aTPnj2eGUafqEWryMLk84j7x9NiF+GEP2YT4/BfClgA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1963,14 +1937,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-darwin-x64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.143.0.tgz", - "integrity": "sha512-qd1hl2d+lXgHv/VQ/M9qm8TrMC5T4RqDBwtOnl+1D0QMjwcz+8AaB4JSg8STgeag0GP6a6L74XEGAsrTSJWNzQ==", + "node_modules/@oxfmt/binding-darwin-x64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.79.0.tgz", + "integrity": "sha512-KFiMRhKeiiooaS1dKc4r8AZgOrfOhwVe1yf/aRef+8BajJwtVjMtlsQl/BNRxtkFbq13GjEo/4Q+9YhFGU4o6g==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1979,14 +1954,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-freebsd-x64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.143.0.tgz", - "integrity": "sha512-M5XXcNa7aOqLPKTR41msfghKu2yQ4xWvCm11/gwU0JzOzHNk5sgW//rVEjJ+LO48+VDAMzXTSzurUVxIDKwozw==", + "node_modules/@oxfmt/binding-freebsd-x64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.79.0.tgz", + "integrity": "sha512-lHVIp0g8ZOFKiqVscvttp+3HJkkRH6XkGgfAA0lVexIlE1mMFVp4V7RBdxz/P9p7T8pSNsYdapFWvdT21Mib9w==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1995,14 +1971,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.143.0.tgz", - "integrity": "sha512-T/GXusuOkPNQhCQCSBbcU/N8j0rAypuDBl1IyFK+lyYT594XsVz80clPC/OtbSSpBGyJxj8uYEfctxVuxVYoww==", + "node_modules/@oxfmt/binding-linux-arm-gnueabihf": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.79.0.tgz", + "integrity": "sha512-Pt35GoxiMUfnr+23cuzk07XQVvISDFxxPcp/aFVB87+RQvJoQaBo/XN7Re9XxgElvbELdyxTLnV9XM2aTfJeUA==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -2011,14 +1988,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.143.0.tgz", - "integrity": "sha512-oKu4RcBlXSqo3OC62dp6YTnQaZIurNDpCX3BnAM3+bJxt7s8J2TJKMnC0UYer1qhlRaDCg6wkTaTw+2IlsZ12w==", + "node_modules/@oxfmt/binding-linux-arm-musleabihf": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.79.0.tgz", + "integrity": "sha512-zPi9Dni58VKp3r1QUcFvnbJNfBr49qyecq0vlM4SaX/MSjmguq77VngirghDua5tyhIDfqdUMTCK2KRlnZFp/g==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -2027,14 +2005,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-arm64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.143.0.tgz", - "integrity": "sha512-WJBbD186AZmMGaSIhlktC+rPl8L3peCTXAh88Ih9uEvK0en2mPojGyCGYiL6mHtV1RPV3JyfJW5t6n5hh0lXhA==", + "node_modules/@oxfmt/binding-linux-arm64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.79.0.tgz", + "integrity": "sha512-XhRehATEWjwX7VVEgDUD+7pfHYncQIJaEU0qsHvEKtu9XX0QYzcKvXhU9+URfiGX9WRh3wy2Ow+YCc3EeHtImg==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2043,14 +2025,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-arm64-musl": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.143.0.tgz", - "integrity": "sha512-t1AcYOwEzgceadT4v5e+vaCCb0AncCA3v5AyzfBAz/tMq11qzVccXKzNHtkWdjBsgvTKwRkaUF3QvT4kot8vcQ==", + "node_modules/@oxfmt/binding-linux-arm64-musl": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.79.0.tgz", + "integrity": "sha512-gbVjFZYug0MEyqvuTAzXGNxFJmBqBO32o1Fud1lG8bGs6oVz48ZtNQyEcAzqrOwaaG+Sxtv4gVzcsfht9aqmkg==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2059,14 +2045,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.143.0.tgz", - "integrity": "sha512-RsnO/NoD8376LMJq8JS8TwI0ieNaFRTuNe2GVJntQg6gwZNMENZsEbknHdVwjpOmxdGLGodcwaGSbAeRr5Bgjw==", + "node_modules/@oxfmt/binding-linux-ppc64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.79.0.tgz", + "integrity": "sha512-0N0sD3vnllyuiNh1r6zKvNXWE/CakcPKJAespg7XE2+sfvxpz5Q1iFah8sF5aedsOmVvbZaOPZcSHVmMosT1fA==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2075,14 +2065,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.143.0.tgz", - "integrity": "sha512-48fSVfR9TZi5CASZFyv0VC6z6BCoeihFsX031mAD/oSH7d9PYsPgIqza7d9mjP7Z2KTEpTFyH6SIu0Ui6R1vdg==", + "node_modules/@oxfmt/binding-linux-riscv64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.79.0.tgz", + "integrity": "sha512-YtjqUHolcX6cv0ZMZuKQCM4H0ae/okcowy0wGcPHJk4O+8zjy3TvNhzDQ1/KGCkMJO8Fwulm1JcPJsraVJ3p+w==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2091,14 +2085,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-riscv64-musl": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.143.0.tgz", - "integrity": "sha512-T8CpdD+SfE01DnIOD4HpVxu0ZJOfMJ/VhCvikKfaXAxkZ+9veyLM/D2hpi7Y2hFUyPmVQO3FNZHmYzV/WlVR4g==", + "node_modules/@oxfmt/binding-linux-riscv64-musl": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.79.0.tgz", + "integrity": "sha512-H2gb9bEBr5tcdP5FU8JYTfgOavXDorWcAAlwci/zEKF2jzgh/oEr/SAw6aHB9n3FLEvnKvOh0A1fjku+vgYoUA==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2107,14 +2105,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-s390x-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.143.0.tgz", - "integrity": "sha512-QLdeMsCcacenPEFsfxnBUDF1y6opyz5+fmOz9bfD5Y7fiGCMupUCuB3KTPQhNwshIG1P9fPqar9MHxuBDd4bwQ==", + "node_modules/@oxfmt/binding-linux-s390x-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.79.0.tgz", + "integrity": "sha512-aZUbyWW5dSOxT/u6suWc4S9GVDt7YPPNMKQon+z79M8dpXmosadcFHAb7jBhpU7Hdsd2GN6/y3nd0JFTsGddZw==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2123,14 +2125,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-x64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.143.0.tgz", - "integrity": "sha512-659ujfqLy6k7cuH3sbzhd8b+ztSq+i6E2E9pG78Q0BmHjAExfGIdgc8cGgMdwAozDXeZFHkJ+LXYJdWsaGdgyw==", + "node_modules/@oxfmt/binding-linux-x64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.79.0.tgz", + "integrity": "sha512-5pW/ZHYfjjQ71gQR+EKzDz8ZzWIDHlTUtWtxVFNgZbKxVZnRxiSXVrllbjpJtx1q8VtSPZ+Lyg9BLny3yw+PTA==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2139,14 +2145,18 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-linux-x64-musl": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.143.0.tgz", - "integrity": "sha512-/Mw/9j4TfZcnKphPrzOE6t4MMknXadcAAuVUlDRTF/ETWB5xOgQvOJV2Mh9We/bWxZdoxaGAdc+hy4GuYwQ2yQ==", + "node_modules/@oxfmt/binding-linux-x64-musl": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.79.0.tgz", + "integrity": "sha512-3IVUerTDB7Dvd90c1EurAzlVnlE9Azl7Wn8e33qX3wL/IqnslF+P7HvwkD+VeMbHxRtuw0EEBGSArZFXpUAZrQ==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -2155,14 +2165,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-openharmony-arm64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.143.0.tgz", - "integrity": "sha512-8rIKWR2BFuifbIK/1XB9wTaSdtuJ25dlE7ZQYDnEwj/2xH2vHsxnvIjHT3ZjSVuLLwGGlSslIG/fbOJ8TV8rTw==", + "node_modules/@oxfmt/binding-openharmony-arm64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.79.0.tgz", + "integrity": "sha512-C5QDgJBtu9+/2BQScoP7ynv54PLOqfoSqhRWwI0D0RPOwYD4tYj0TUdJbXMO1fNegL/5zJiSOxkq6II2xvttWg==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openharmony" @@ -2171,14 +2182,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-win32-arm64-msvc": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.143.0.tgz", - "integrity": "sha512-5U9kQYMfRRI6Zq7KDxgbIP0RMnKrfn3gLepRMgJuRkPSUALTiRCk9d/uyhb4lGDjUdzwK7mBkKqhLgzBPCmLpQ==", + "node_modules/@oxfmt/binding-win32-arm64-msvc": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.79.0.tgz", + "integrity": "sha512-zlW1m8M49vNGgqQF/ze80KW8pZMicnW2XDZGBHuYtXTRYn4ewvgpqN9wwoqb6uLZZfb1R1zaQWKEB8cs7KYjwA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2187,14 +2199,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-win32-ia32-msvc": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.143.0.tgz", - "integrity": "sha512-25P7AaHk4R88Yv2XH4gToDVmh0cOu+bEURQU10CRrmvgabfRArSGAP5osmwUKeSUHj0VS50upbpbRWWW/m7mHA==", + "node_modules/@oxfmt/binding-win32-ia32-msvc": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.79.0.tgz", + "integrity": "sha512-wbb7hFv2wK3SCTfu8dl1ydNsXM5dmH+PJMU3sojCkfKcG29VDpITL5/AtouCzXjkOc90QRkcAZcg36gP0KqoHA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2203,14 +2216,15 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-parser/binding-win32-x64-msvc": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.143.0.tgz", - "integrity": "sha512-ORMh3JE1s6V7ySicdRK7vgaDQnn5o+UHg9ct989PlWHbel8O9ARrmWXM6kZjrBMtNucxNayQ8g69G0VfWzhANw==", + "node_modules/@oxfmt/binding-win32-x64-msvc": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.79.0.tgz", + "integrity": "sha512-JLaeaQ+4LkQiVXY06JIV1dBFEDJzssvDieK/3Poi6CsY+c4UxghZVrrsfcKGJ5R/0F2Sw3C5Lf5Hu0sM5qJfPw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2219,141 +2233,871 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@oxc-project/types": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.143.0.tgz", - "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==", + "node_modules/@oxlint-flat-config/composer": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@oxlint-flat-config/composer/-/composer-0.3.1.tgz", + "integrity": "sha512-LGAbkgDZrwgiGc8/R4gyQCMT9aT3XugX1w5Uy86vbnmi4xGSrztPpVmie7ZqJFtlX/2BgOGW9MLi3TtFzu1LIQ==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/Boshen" + "license": "MIT", + "peerDependencies": { + "oxlint": ">=1.85.0", + "oxlint-flat-config": "^0.4.0", + "vite-plus": ">=1.0.0" + }, + "peerDependenciesMeta": { + "oxlint": { + "optional": true + }, + "vite-plus": { + "optional": true + } } }, - "node_modules/@peculiar/asn1-schema": { - "version": "2.10.0", - "resolved": "https://registry.npmmirror.com/@peculiar/asn1-schema/-/asn1-schema-2.10.0.tgz", - "integrity": "sha512-GhokD41lV4gQrrLYm3wCkHfBOnJrnhDMgt4XeMW8gzfE1UdJqIuSwsE+ggf82XBjUXRJylcm+KIGQFa4utIVLw==", + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.94.0.tgz", + "integrity": "sha512-730FKSBsKg/NawYnpI3gXRroXptOVqY32iYBPLUZaSx0vgYzOeiNtwojZL4gJdzo9wDvHUlstShmGRHrWcbRYg==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@peculiar/utils": "^2.0.2", - "asn1js": "^3.0.10", - "tslib": "^2.8.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=14" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@peculiar/json-schema": { - "version": "1.1.12", - "resolved": "https://registry.npmmirror.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz", - "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.94.0.tgz", + "integrity": "sha512-8v8TICIiZpXLot1HSq5+vsG9NEKQ5czQBYlUqJR75OVfFDr3cGOmRU/CtHDWnS4tm8nW+Z4Y357qGToSfYqFvA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "tslib": "^2.0.0" - }, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@peculiar/utils": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/@peculiar/utils/-/utils-2.0.3.tgz", - "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.94.0.tgz", + "integrity": "sha512-NePcRMO/ltt1Pnytohl6pl0bd/QyRX8HbpptuDz9LK7FTsFD4lKxDMBt7di9k6IFLO0J05jO2nm7wGqIh6dRHA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "tslib": "^2.8.1" + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@peculiar/webcrypto": { - "version": "1.7.1", - "resolved": "https://registry.npmmirror.com/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", - "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.94.0.tgz", + "integrity": "sha512-QV+m+OaEgLmYyillvP1wKXhMm6tDZEWx3vG7Wjmx9ybg15+6YMfqzvp6e+uPukC6zNywuule0vMn0fZgihZzZA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@peculiar/asn1-schema": "^2.7.0", - "@peculiar/json-schema": "^1.1.12", - "@peculiar/utils": "^2.0.2", - "tslib": "^2.8.1", - "webcrypto-core": "^1.9.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.18.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@posthog/browser-common": { - "version": "0.12.0", - "resolved": "https://registry.npmmirror.com/@posthog/browser-common/-/browser-common-0.12.0.tgz", - "integrity": "sha512-P1CubrDp1xwYi2DQxjzJITEeMJpZ7qYcbHuhtXLHgkG8bE6gLy0JwkykjRtEFbElvJNbHQO1jQi7Cbb3JyazNw==", + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.94.0.tgz", + "integrity": "sha512-KVZjca581nrV6P71kZ9M1otBib9LH0IMn9rr4mrnbRp18V0HiZhBHbU26gji/Ieq2G34qMacnMc3zrmKmvWqWA==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@posthog/core": "^1.68.0", - "@posthog/types": "^1.425.1", - "dompurify": "^3.4.13", - "preact": "^10.29.3" + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@posthog/core": { - "version": "1.69.1", - "resolved": "https://registry.npmmirror.com/@posthog/core/-/core-1.69.1.tgz", - "integrity": "sha512-36hlJRZlVh5d+yBOmqObT162SrqNes9yY4x4wLDXVSu5Dzdt19KNxQ136cd37+U0yABZVx7ehjtWslyn1iG+0Q==", + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.94.0.tgz", + "integrity": "sha512-AMQtgQJk8DgdIV+qaQ5sFoHAko4iKa8zo+gYqELy2grtU8hXWB08DAGB3u90aQL1YSxbd3zqHjgcODBHDFyzBQ==", + "cpu": [ + "arm" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@posthog/types": "^1.425.1" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@posthog/types": { - "version": "1.425.1", - "resolved": "https://registry.npmmirror.com/@posthog/types/-/types-1.425.1.tgz", - "integrity": "sha512-mh7jyQ5lN+XCeOnMdYkBEFtO/G0TxeLOKTWNH6E6OZjxS4nVM0Tb2xQt+FG5DCFM9qzL2HmuX6A793TwlJVDvw==", - "license": "MIT" - }, - "node_modules/@radix-ui/number": { - "version": "1.1.3", - "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz", - "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==", - "dev": true + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.94.0.tgz", + "integrity": "sha512-ZLzoGVGAmQkp9leeB5rNxAXLcvlmkmd/GY71LKd5uikk+28NEApY3S2FB3pq6MkfOCFFnFg6QgD9lJIjd07D0Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@radix-ui/primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.2.0.tgz", - "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", - "dev": true + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.94.0.tgz", + "integrity": "sha512-N1dW6o7cY90hLVkDsvz8nWIFOwbO+n272pvW7uLYB7u47HagJVnLChfK6QA9dWFdiPudud9zfksVUOciHc5PNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@radix-ui/react-accessible-icon": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", - "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.94.0.tgz", + "integrity": "sha512-7tCF4OV/bGDQ2xxgb+sDI97SpmmDrUII4JxTG553voJVA9cnkbXSGSXzo78Ax73BuhEOPoQc2Qi6VrfT0cDG2A==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@radix-ui/react-visually-hidden": "1.2.13" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-accordion": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", - "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.94.0.tgz", + "integrity": "sha512-B5vUHE4wNisVEuaYxwFUn6tY+vw7A+9APxxqGKI+UmP3yKLpkhnt0qsaCrzjpX55F8rCRHBaTvIDdYo32NE36g==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collapsible": "1.2.1", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.94.0.tgz", + "integrity": "sha512-/U0b15+c4hTodo8YhEqDlQ6OjnGKvc8igjM/mh23ukqqCUBKiBCaxqUV8bcaofK9uZ+f8wCygkyXLS6LN25YSA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.94.0.tgz", + "integrity": "sha512-ba94Vwl0qOnwXIXNDR33AEbLXuX++ckM74t+9Te7CiPSPAHivhOYyeEkUAicrvOEei1pxXkWggLbFeBFFBTuHA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.94.0.tgz", + "integrity": "sha512-GVwwwms3O8pdgbCiPavwq2vltyB4661GkDz6kJduZ0E5nsSJUDJ0svaP+ePYpuDVYi4+K1qhCKnWa/Ec8I4LUA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.94.0.tgz", + "integrity": "sha512-iUfCFJN8ZIresSnpTfiIkhF3s8X+XA4I9KJ249QwR2QYTMwh0+pla1pj1xaFi+HtR9McjM4Jaemf70HzX7ilOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.94.0.tgz", + "integrity": "sha512-RqWVeWpDACS4Oh0m21OBmy+CQ50CbbhuHFmNNPVS2P/4R3d188MjEuEuV7So82/tAM8UAT+UuMDtRDESd9NJ7g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.94.0.tgz", + "integrity": "sha512-K/2DHOUoypwYVqzxJMRPdMuBKjAetZEAsGPP7rHimd+2+5J1TxM+17pG8kw+ayH4+rqBXiPd+H9wgPcU+fF77A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.94.0.tgz", + "integrity": "sha512-hYOCaOJiB4ZCGswBWKl3JQrhqu6mnC5DCUw/1UMNzRXgsHIJ0V226J43LAVICVIDGlhFUZTYShFW+wHWpt6qCQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.94.0.tgz", + "integrity": "sha512-1l1FDlzbPmAeDoZ8UGspOE2dOmz1ZL6SlDsvOmRCmWSQjCdTy5LzUepS8mO/SGpAoz4D6WAt/yNZAUyHqbkmkQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.94.0.tgz", + "integrity": "sha512-I3eZdd4bemIJQDNv9XDV/FEofDxIoN32tzCv98wIgLdW05EqxZb5hF4AwPrRzHD/dQhl0n7KgPy5AQPfM0HWrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/plugins": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/plugins/-/plugins-1.94.0.tgz", + "integrity": "sha512-YT6htikBOBQ00XDxZpRZLZ0anEDo7h9s4+YvjRU0/Ng/cLd0D6SZQ3tsms4g/GDer/z8UKlegC5iptEfyRXJcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@peculiar/asn1-schema": { + "version": "2.10.0", + "resolved": "https://registry.npmmirror.com/@peculiar/asn1-schema/-/asn1-schema-2.10.0.tgz", + "integrity": "sha512-GhokD41lV4gQrrLYm3wCkHfBOnJrnhDMgt4XeMW8gzfE1UdJqIuSwsE+ggf82XBjUXRJylcm+KIGQFa4utIVLw==", + "dev": true, + "dependencies": { + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmmirror.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@peculiar/utils": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/@peculiar/utils/-/utils-2.0.3.tgz", + "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", + "dev": true, + "dependencies": { + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/webcrypto": { + "version": "1.7.1", + "resolved": "https://registry.npmmirror.com/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", + "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.7.0", + "@peculiar/json-schema": "^1.1.12", + "@peculiar/utils": "^2.0.2", + "tslib": "^2.8.1", + "webcrypto-core": "^1.9.2" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@posthog/browser-common": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/@posthog/browser-common/-/browser-common-0.12.0.tgz", + "integrity": "sha512-P1CubrDp1xwYi2DQxjzJITEeMJpZ7qYcbHuhtXLHgkG8bE6gLy0JwkykjRtEFbElvJNbHQO1jQi7Cbb3JyazNw==", + "license": "MIT", + "dependencies": { + "@posthog/core": "^1.68.0", + "@posthog/types": "^1.425.1", + "dompurify": "^3.4.13", + "preact": "^10.29.3" + } + }, + "node_modules/@posthog/core": { + "version": "1.69.1", + "resolved": "https://registry.npmmirror.com/@posthog/core/-/core-1.69.1.tgz", + "integrity": "sha512-36hlJRZlVh5d+yBOmqObT162SrqNes9yY4x4wLDXVSu5Dzdt19KNxQ136cd37+U0yABZVx7ehjtWslyn1iG+0Q==", + "license": "MIT", + "dependencies": { + "@posthog/types": "^1.425.1" + } + }, + "node_modules/@posthog/types": { + "version": "1.425.1", + "resolved": "https://registry.npmmirror.com/@posthog/types/-/types-1.425.1.tgz", + "integrity": "sha512-mh7jyQ5lN+XCeOnMdYkBEFtO/G0TxeLOKTWNH6E6OZjxS4nVM0Tb2xQt+FG5DCFM9qzL2HmuX6A793TwlJVDvw==", + "license": "MIT" + }, + "node_modules/@radix-ui/number": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz", + "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==", + "dev": true + }, + "node_modules/@radix-ui/primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.2.0.tgz", + "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", + "dev": true + }, + "node_modules/@radix-ui/react-accessible-icon": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", + "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", + "dev": true, + "dependencies": { + "@radix-ui/react-visually-hidden": "1.2.13" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-accordion": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", + "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collapsible": "1.2.1", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-alert-dialog": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", + "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dialog": "1.3.1", + "@radix-ui/react-primitive": "2.2.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-arrow": { + "version": "1.1.17", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", + "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", + "dev": true, + "dependencies": { + "@radix-ui/react-primitive": "2.2.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-aspect-ratio": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.2.0.tgz", + "integrity": "sha512-gHEU+Lx8DlT/FYIjZQvvBJrFSwUngXTjh7FeL9QvJaNALDLez6pgDj2axCUihBjtPBy82LN0gNb25+sTcSXNmA==", + "dev": true, + "dependencies": { + "@radix-ui/react-primitive": "2.2.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-avatar": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-avatar/-/react-avatar-1.3.1.tgz", + "integrity": "sha512-ssZOkfQNkFpYVmCPQlr978xSaU7moSrGXdwg4j2Xs2WlGl/1KsSZtfpK+WnLnx0Rwll1BAh6oUrAy/uR31SBvQ==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-is-hydrated": "0.1.3", + "@radix-ui/react-use-layout-effect": "1.1.4" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-checkbox": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-checkbox/-/react-checkbox-1.4.1.tgz", + "integrity": "sha512-KWtwhh+98ML3seZ9vO9yRY2OwaQG90dCiDAxjpSNY2AaZ3Hik3B0dsk6m0ILywo/no3A9/SozadyPMNweVT8yw==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-size": "1.1.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collapsible": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-collapsible/-/react-collapsible-1.2.1.tgz", + "integrity": "sha512-fSzLb/qy1wuZSxQBcxpW0hNXYHDMWiIXDGyJGdA4+FSLknOWZsNRrTCUavxb4PI8b8lvHo/CysO6NVi5zLpo5g==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-collection/-/react-collection-1.2.0.tgz", + "integrity": "sha512-+yiQzqcc7Sy7/5s0jrMCjpPRFB3538VNrXPWdTLZhE/SCfgEws4aI6lHWN/vvcnyhHndROWBzqmqB4QBrITZ9Q==", + "dev": true, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-layout-effect": "1.1.4" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz", + "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==", + "dev": true, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-context/-/react-context-1.3.0.tgz", + "integrity": "sha512-v5AYEocMISkbJ+1fTXzZpiFv7NRr3D2WiYbLIKf+FkmJ8VkP6d503eV2n34MFussHXY1pcoq3yfJiQH77dc4Mg==", + "dev": true, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-context-menu": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-context-menu/-/react-context-menu-2.4.1.tgz", + "integrity": "sha512-Pddn3Z8lio3/ChxyXaEP3jHTTo1LTHCWwF8+mG1chQlWijP+ttVHBKwezrQTiV6Mj670ojvumqvuGh+mdv33iQ==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-dialog/-/react-dialog-1.3.1.tgz", + "integrity": "sha512-+0E4qvVTwjAWra9sEhJ+9BTsvHE00zkUuNw1VGh7S+Gc13dfYk+S1PVQdchWDj+XYHhAai7Z7IpzXVDCGsDplg==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-direction": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-direction/-/react-direction-1.2.0.tgz", + "integrity": "sha512-FtRA52a/r+LKStFT+neLUm+8vSe7wbzkbQGGeU8ixFiwC8NU14Evoq9ATECqL3eGbcUzJR4fyfA4KkK/q6dfqg==", + "dev": true, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.2.1.tgz", + "integrity": "sha512-KIfDcAsx+oVylFZ4xryVKusJUrLLhTQmfnJW4kwk4Km5myvhHCrj04hnWWUC166+xD4DHdH8tQGylwYX1h6+Pg==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-effect-event": "0.0.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dropdown-menu": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.2.1.tgz", + "integrity": "sha512-XsHcmYG2AcqnvTqrOXXWcMrhquEIlqucizuDH1MV/qMRW+DndpBCMvNeTRXOxqmG1H5j89M/+I0/34Zdd+zDcQ==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-menu": "2.2.1", "@radix-ui/react-primitive": "2.2.0", "@radix-ui/react-use-controllable-state": "1.3.0" }, @@ -2372,16 +3116,57 @@ } } }, - "node_modules/@radix-ui/react-alert-dialog": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", - "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", + "node_modules/@radix-ui/react-focus-guards": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.2.0.tgz", + "integrity": "sha512-MPm5R0iRGUDrDnPNxmLBkv+X7pN4XKzt+MbWJEuJQsH3NFH4omrbpXpucyYCCKTSt+na/ZxGhEWQrWTZ0285cA==", + "dev": true, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.3.1.tgz", + "integrity": "sha512-ugeMhbXt4y5S2T1GnIqbWDKEN962PDwnX1fN0eKOOgf5f63Dh2mn8F1FUySlgW0iF6GiVsRF32DzuDIWTUyQJg==", + "dev": true, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-form": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-form/-/react-form-0.3.0.tgz", + "integrity": "sha512-KnmrCM27m7Jo1R8S6cFDPrEeq20Jfn5dqde0SZrJr2lVXlj6/QZSUCyFoYh1d8ti0uUrMNK5Lx6dUDuINT+f4Q==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dialog": "1.3.1", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-label": "2.1.17", "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { @@ -2399,10 +3184,60 @@ } } }, - "node_modules/@radix-ui/react-arrow": { - "version": "1.1.17", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", - "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", + "node_modules/@radix-ui/react-hover-card": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-hover-card/-/react-hover-card-1.2.1.tgz", + "integrity": "sha512-4QooHxgmpCKRjj1Pft+hETKidYcrbPKcVwMGtk2Oa5DcWY2IH1fHuQt9LG6q5hUQBBV2MhQxSvtx6B/C1xfiTw==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-id": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-id/-/react-id-1.1.4.tgz", + "integrity": "sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA==", + "dev": true, + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.4" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-label": { + "version": "2.1.17", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-label/-/react-label-2.1.17.tgz", + "integrity": "sha512-xmj7MN/drx1oUAXkfiFIvyDmGNUIN/omGobvA5oAoNqu9zO2MkISYGZOkBcqSzs/UZXXwV+/3ACRE7q7mGcmkA==", "dev": true, "dependencies": { "@radix-ui/react-primitive": "2.2.0" @@ -2422,13 +3257,163 @@ } } }, - "node_modules/@radix-ui/react-aspect-ratio": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.2.0.tgz", - "integrity": "sha512-gHEU+Lx8DlT/FYIjZQvvBJrFSwUngXTjh7FeL9QvJaNALDLez6pgDj2axCUihBjtPBy82LN0gNb25+sTcSXNmA==", + "node_modules/@radix-ui/react-menu": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-menu/-/react-menu-2.2.1.tgz", + "integrity": "sha512-G34BsU90SBj5foYpz8pQqq/Q0Dlfyyl6KitWEfRwXC0QvfwhWNAwS49DWP2+rRJ0iwv20Z2Qx7Sk+T03bGo5JA==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-menubar": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-menubar/-/react-menubar-1.2.1.tgz", + "integrity": "sha512-bRTYtS9JITV2dUYqYZb7+N5SooQBkZrNRejfmyrSKe3Y57aXhKgx//kBUP0kY7pEpsWR/U1AHsAJRzjwCrK3PA==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-navigation-menu": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.4.1.tgz", + "integrity": "sha512-XPPZjkeyCSMNNvt0FyDv/PUauG7Ow4GwHQ/XZSwW36F/TS7rR4HFTsXH8ewLnXTOLn3x96/pmTPNQIVoTX/86g==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", + "@radix-ui/react-use-previous": "1.1.4", + "@radix-ui/react-visually-hidden": "1.2.13" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-one-time-password-field": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.2.1.tgz", + "integrity": "sha512-KtHdcgnaAK6rohQ/MMJoGYcbgSRJsIuGBdHrFeTB1/9SaKlDs14oSOniW6BL6M43HqvgCO3u4WuVdFLkuc6sqw==", + "dev": true, + "dependencies": { + "@radix-ui/number": "1.1.3", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-effect-event": "0.0.5", + "@radix-ui/react-use-is-hydrated": "0.1.3", + "@radix-ui/react-use-layout-effect": "1.1.4" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-password-toggle-field": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.2.1.tgz", + "integrity": "sha512-vu4+ZoJAaFjdI7l1lDSZRs+4dEv83Jmu7lyzajPrAeQzX74y84n0rUNWbWSgN9XB5NE8IY86Z02kGH6oRrzR+w==", "dev": true, "dependencies": { - "@radix-ui/react-primitive": "2.2.0" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-effect-event": "0.0.5", + "@radix-ui/react-use-is-hydrated": "0.1.3" }, "peerDependencies": { "@types/react": "*", @@ -2445,18 +3430,28 @@ } } }, - "node_modules/@radix-ui/react-avatar": { + "node_modules/@radix-ui/react-popover": { "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-avatar/-/react-avatar-1.3.1.tgz", - "integrity": "sha512-ssZOkfQNkFpYVmCPQlr978xSaU7moSrGXdwg4j2Xs2WlGl/1KsSZtfpK+WnLnx0Rwll1BAh6oUrAy/uR31SBvQ==", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-popover/-/react-popover-1.3.1.tgz", + "integrity": "sha512-ZNxvXRx5W2Wos4fXCXb5lpdqN0Z5chf+mStOUOTr4ik7d+62MRvoe9rzCA/eGNg36lxXqSrKEKmwuZEcUrIstw==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-is-hydrated": "0.1.3", - "@radix-ui/react-use-layout-effect": "1.1.4" + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", @@ -2473,19 +3468,22 @@ } } }, - "node_modules/@radix-ui/react-checkbox": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-checkbox/-/react-checkbox-1.4.1.tgz", - "integrity": "sha512-KWtwhh+98ML3seZ9vO9yRY2OwaQG90dCiDAxjpSNY2AaZ3Hik3B0dsk6m0ILywo/no3A9/SozadyPMNweVT8yw==", + "node_modules/@radix-ui/react-popper": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-popper/-/react-popper-1.4.0.tgz", + "integrity": "sha512-yCWRvLeGv9Pz3+efwHqGPp70mZ56r3kfIgQVF56Oj2aAa4uP/Tb+IE59wNcc+758rctqbCKx4LbK8II/r7Bn0Q==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", + "@floating-ui/react-dom": "^2.0.0", + "@radix-ui/react-arrow": "1.1.17", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-size": "1.1.5" + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-layout-effect": "1.1.4", + "@radix-ui/react-use-rect": "1.1.4", + "@radix-ui/react-use-size": "1.1.5", + "@radix-ui/rect": "1.1.3" }, "peerDependencies": { "@types/react": "*", @@ -2502,19 +3500,13 @@ } } }, - "node_modules/@radix-ui/react-collapsible": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-collapsible/-/react-collapsible-1.2.1.tgz", - "integrity": "sha512-fSzLb/qy1wuZSxQBcxpW0hNXYHDMWiIXDGyJGdA4+FSLknOWZsNRrTCUavxb4PI8b8lvHo/CysO6NVi5zLpo5g==", + "node_modules/@radix-ui/react-portal": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-portal/-/react-portal-1.2.0.tgz", + "integrity": "sha512-StX7xXnaRU41VvFtMm9zlhVGz8XF6GmWWTXftkQaY+tqVkbs/R9UmAp5mLzHHapk5hM9RMZQvO/3usyIP/g42g==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { @@ -2532,16 +3524,12 @@ } } }, - "node_modules/@radix-ui/react-collection": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-collection/-/react-collection-1.2.0.tgz", - "integrity": "sha512-+yiQzqcc7Sy7/5s0jrMCjpPRFB3538VNrXPWdTLZhE/SCfgEws4aI6lHWN/vvcnyhHndROWBzqmqB4QBrITZ9Q==", + "node_modules/@radix-ui/react-presence": { + "version": "1.1.11", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-presence/-/react-presence-1.1.11.tgz", + "integrity": "sha512-Z7/atlkab36Z8hm+V8zYc79r0W+tiOB1o0tun1By94JyadkekLQmtEAnBSP9XKXBNQsStoStS4+gX10JpS5akA==", "dev": true, "dependencies": { - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-slot": "1.5.0", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { @@ -2559,47 +3547,37 @@ } } }, - "node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.5", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz", - "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==", + "node_modules/@radix-ui/react-primitive": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-primitive/-/react-primitive-2.2.0.tgz", + "integrity": "sha512-HCTSPMNqv55Qk0IX4geJbpyXazmqulcimwuyjxTkKi29v+QZbG2Zho9BnbBq4YS2PF+KlNb2CXoLz66uUmblkg==", "dev": true, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "dependencies": { + "@radix-ui/react-slot": "1.5.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-context": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-context/-/react-context-1.3.0.tgz", - "integrity": "sha512-v5AYEocMISkbJ+1fTXzZpiFv7NRr3D2WiYbLIKf+FkmJ8VkP6d503eV2n34MFussHXY1pcoq3yfJiQH77dc4Mg==", - "dev": true, "peerDependencies": { "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, - "node_modules/@radix-ui/react-context-menu": { - "version": "2.4.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-context-menu/-/react-context-menu-2.4.1.tgz", - "integrity": "sha512-Pddn3Z8lio3/ChxyXaEP3jHTTo1LTHCWwF8+mG1chQlWijP+ttVHBKwezrQTiV6Mj670ojvumqvuGh+mdv33iQ==", + "node_modules/@radix-ui/react-progress": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-progress/-/react-progress-1.2.1.tgz", + "integrity": "sha512-yQBiM6J3YM8Ums1orkEFpbznK47geKxa0igikzcaS1xHgdba3DdAQBsGbCTt5BVfR8zhEvgxQ0poGcINaD3lvw==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-menu": "2.2.1", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -2616,27 +3594,21 @@ } } }, - "node_modules/@radix-ui/react-dialog": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-dialog/-/react-dialog-1.3.1.tgz", - "integrity": "sha512-+0E4qvVTwjAWra9sEhJ+9BTsvHE00zkUuNw1VGh7S+Gc13dfYk+S1PVQdchWDj+XYHhAai7Z7IpzXVDCGsDplg==", + "node_modules/@radix-ui/react-radio-group": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-radio-group/-/react-radio-group-1.5.1.tgz", + "integrity": "sha512-QbyVT1ddnjqB9H+CUYKkNWdU9fIK3QHCYtjf7mS6ekSqiuXkWtWn5UZW9mhA8qtl3vrVyIsmR9gePstAtKrqkw==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-focus-guards": "1.2.0", - "@radix-ui/react-focus-scope": "1.3.1", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-roving-focus": "1.2.1", "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-layout-effect": "1.1.4", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -2653,32 +3625,23 @@ } } }, - "node_modules/@radix-ui/react-direction": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-direction/-/react-direction-1.2.0.tgz", - "integrity": "sha512-FtRA52a/r+LKStFT+neLUm+8vSe7wbzkbQGGeU8ixFiwC8NU14Evoq9ATECqL3eGbcUzJR4fyfA4KkK/q6dfqg==", - "dev": true, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dismissable-layer": { + "node_modules/@radix-ui/react-roving-focus": { "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.2.1.tgz", - "integrity": "sha512-KIfDcAsx+oVylFZ4xryVKusJUrLLhTQmfnJW4kwk4Km5myvhHCrj04hnWWUC166+xD4DHdH8tQGylwYX1h6+Pg==", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.2.1.tgz", + "integrity": "sha512-UwraORzVUeEPMclhO1p0vz0qI+TbdDLO9i+FiOqhJyHKwdpCRCck9yVEscUnAMIzCiuNoQa8D4A9bIpOPXGt6Q==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-id": "1.1.4", "@radix-ui/react-primitive": "2.2.0", "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-effect-event": "0.0.5" + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-is-hydrated": "0.1.3", + "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", @@ -2695,19 +3658,22 @@ } } }, - "node_modules/@radix-ui/react-dropdown-menu": { - "version": "2.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.2.1.tgz", - "integrity": "sha512-XsHcmYG2AcqnvTqrOXXWcMrhquEIlqucizuDH1MV/qMRW+DndpBCMvNeTRXOxqmG1H5j89M/+I0/34Zdd+zDcQ==", + "node_modules/@radix-ui/react-scroll-area": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-scroll-area/-/react-scroll-area-1.4.0.tgz", + "integrity": "sha512-CFrLqHNejWq5FhKAcj9V/WPGRsol76HBQto81NdOBVFEOqIEkJkKIJt0Z824A/9hHLCtoiR/Kw3euRgzXP2pxg==", "dev": true, "dependencies": { + "@radix-ui/number": "1.1.3", "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0" + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", @@ -2724,30 +3690,33 @@ } } }, - "node_modules/@radix-ui/react-focus-guards": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.2.0.tgz", - "integrity": "sha512-MPm5R0iRGUDrDnPNxmLBkv+X7pN4XKzt+MbWJEuJQsH3NFH4omrbpXpucyYCCKTSt+na/ZxGhEWQrWTZ0285cA==", - "dev": true, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.3.1.tgz", - "integrity": "sha512-ugeMhbXt4y5S2T1GnIqbWDKEN962PDwnX1fN0eKOOgf5f63Dh2mn8F1FUySlgW0iF6GiVsRF32DzuDIWTUyQJg==", + "node_modules/@radix-ui/react-select": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-select/-/react-select-2.4.1.tgz", + "integrity": "sha512-888ZwW0Md6GyptuqYABRX9nLKgoYfcooCyBBvVaX5Jp3e+8Jp2i4Zo/Uy50Hm+Ysn2JfloQXstW4U36w8teVtg==", "dev": true, "dependencies": { + "@radix-ui/number": "1.1.3", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-callback-ref": "1.1.5" + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", + "@radix-ui/react-visually-hidden": "1.2.13", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", @@ -2764,17 +3733,12 @@ } } }, - "node_modules/@radix-ui/react-form": { - "version": "0.3.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-form/-/react-form-0.3.0.tgz", - "integrity": "sha512-KnmrCM27m7Jo1R8S6cFDPrEeq20Jfn5dqde0SZrJr2lVXlj6/QZSUCyFoYh1d8ti0uUrMNK5Lx6dUDuINT+f4Q==", + "node_modules/@radix-ui/react-separator": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-separator/-/react-separator-1.2.0.tgz", + "integrity": "sha512-1jUAap0wZEqVP05Ou7kJgRxe/W+Qftng+rUNWGa0qkKbv9r5pWTG3E7a3ELKo2eJoHKMECnzuYrZpSyO1YgcYQ==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-label": "2.1.17", "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { @@ -2790,24 +3754,24 @@ "@types/react-dom": { "optional": true } - } - }, - "node_modules/@radix-ui/react-hover-card": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-hover-card/-/react-hover-card-1.2.1.tgz", - "integrity": "sha512-4QooHxgmpCKRjj1Pft+hETKidYcrbPKcVwMGtk2Oa5DcWY2IH1fHuQt9LG6q5hUQBBV2MhQxSvtx6B/C1xfiTw==", + } + }, + "node_modules/@radix-ui/react-slider": { + "version": "1.6.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-slider/-/react-slider-1.6.1.tgz", + "integrity": "sha512-IRNRR90moPqxfwCJ0XbMJIxo70W0/1ZExT/sNCxEHMaPx0SF9HoQrcPEC75+H28cFKa0b+KH63anfLYJmwKacw==", "dev": true, "dependencies": { + "@radix-ui/number": "1.1.3", "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-focus-scope": "1.3.1", - "@radix-ui/react-popper": "1.4.0", - "@radix-ui/react-portal": "1.2.0", - "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0" + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -2824,13 +3788,13 @@ } } }, - "node_modules/@radix-ui/react-id": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-id/-/react-id-1.1.4.tgz", - "integrity": "sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA==", + "node_modules/@radix-ui/react-slot": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-slot/-/react-slot-1.5.0.tgz", + "integrity": "sha512-tyYd9ddPXAysAbdbD9eYxgwpCSv6f3PncqVSNKQFSR5lcJVLz3cb/pANDoYrLiHBpXv7skortyUgGUWsYuPPFQ==", "dev": true, "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.4" + "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -2842,13 +3806,18 @@ } } }, - "node_modules/@radix-ui/react-label": { - "version": "2.1.17", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-label/-/react-label-2.1.17.tgz", - "integrity": "sha512-xmj7MN/drx1oUAXkfiFIvyDmGNUIN/omGobvA5oAoNqu9zO2MkISYGZOkBcqSzs/UZXXwV+/3ACRE7q7mGcmkA==", + "node_modules/@radix-ui/react-switch": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-switch/-/react-switch-1.4.1.tgz", + "integrity": "sha512-NpBGwc40rY02ZmSvuyeKk0Bvc8ZsNeTMi4qHvJ+ZH4EiYCv0zIXEgdCW4bVdzgIUeP9xxbLJSxKOUfqITYNmkA==", "dev": true, "dependencies": { - "@radix-ui/react-primitive": "2.2.0" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -2865,30 +3834,20 @@ } } }, - "node_modules/@radix-ui/react-menu": { - "version": "2.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-menu/-/react-menu-2.2.1.tgz", - "integrity": "sha512-G34BsU90SBj5foYpz8pQqq/Q0Dlfyyl6KitWEfRwXC0QvfwhWNAwS49DWP2+rRJ0iwv20Z2Qx7Sk+T03bGo5JA==", + "node_modules/@radix-ui/react-tabs": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-tabs/-/react-tabs-1.2.1.tgz", + "integrity": "sha512-hRoJlode+hg5ZNlR+3tkfkUliIybdTpD5lkAvHQ9yaXseGf7XVO9Ib2GPEIOuaJJbo7YWYbNpDDRfo8Dhf6/xA==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-focus-guards": "1.2.0", - "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.4.0", - "@radix-ui/react-portal": "1.2.0", "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-slot": "1.5.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -2905,22 +3864,24 @@ } } }, - "node_modules/@radix-ui/react-menubar": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-menubar/-/react-menubar-1.2.1.tgz", - "integrity": "sha512-bRTYtS9JITV2dUYqYZb7+N5SooQBkZrNRejfmyrSKe3Y57aXhKgx//kBUP0kY7pEpsWR/U1AHsAJRzjwCrK3PA==", + "node_modules/@radix-ui/react-toast": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-toast/-/react-toast-1.3.1.tgz", + "integrity": "sha512-iQvL0J7XK4HtJNGkkWMyYrboNseI7vtotFeUkIno8YNxVA9oM7B6//fh0Mc6TSKI96+zioLWi98lQLso88yJmQ==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-use-controllable-state": "1.3.0" + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -2937,27 +3898,15 @@ } } }, - "node_modules/@radix-ui/react-navigation-menu": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.4.1.tgz", - "integrity": "sha512-XPPZjkeyCSMNNvt0FyDv/PUauG7Ow4GwHQ/XZSwW36F/TS7rR4HFTsXH8ewLnXTOLn3x96/pmTPNQIVoTX/86g==", + "node_modules/@radix-ui/react-toggle": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-toggle/-/react-toggle-1.2.1.tgz", + "integrity": "sha512-+3MUq+WyiBplXYqQ0EIYlq8R4sLQ0T5NbOK7DMdDLCKO93pe2uE0DUJTWWfTBprpJJXxfoF3eMW0xpakVZrYsg==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-presence": "1.1.11", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-slot": "1.5.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-use-previous": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.13" + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -2974,24 +3923,19 @@ } } }, - "node_modules/@radix-ui/react-one-time-password-field": { - "version": "0.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.2.1.tgz", - "integrity": "sha512-KtHdcgnaAK6rohQ/MMJoGYcbgSRJsIuGBdHrFeTB1/9SaKlDs14oSOniW6BL6M43HqvgCO3u4WuVdFLkuc6sqw==", + "node_modules/@radix-ui/react-toggle-group": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-toggle-group/-/react-toggle-group-1.2.1.tgz", + "integrity": "sha512-O8Ldx5ao4p4KoW+DO8/PmkOe5mdKNi3F2SseqjVj88wvDGDHe60cUmO0Zm/uHsKrvNgQGV8Efpuh95Tht/h4vw==", "dev": true, "dependencies": { - "@radix-ui/number": "1.1.3", "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-primitive": "2.2.0", "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-effect-event": "0.0.5", - "@radix-ui/react-use-is-hydrated": "0.1.3", - "@radix-ui/react-use-layout-effect": "1.1.4" + "@radix-ui/react-toggle": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -3008,20 +3952,19 @@ } } }, - "node_modules/@radix-ui/react-password-toggle-field": { - "version": "0.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.2.1.tgz", - "integrity": "sha512-vu4+ZoJAaFjdI7l1lDSZRs+4dEv83Jmu7lyzajPrAeQzX74y84n0rUNWbWSgN9XB5NE8IY86Z02kGH6oRrzR+w==", + "node_modules/@radix-ui/react-toolbar": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-toolbar/-/react-toolbar-1.2.1.tgz", + "integrity": "sha512-Cm8m7JTEeUdbfA6T9xgyu8HfOpyvSx8pB/wj0DlEuWaJe9FilIs4Az9wci/lU9RbthV/UkltszMw5WnnD+m/Ug==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-effect-event": "0.0.5", - "@radix-ui/react-use-is-hydrated": "0.1.3" + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-separator": "1.2.0", + "@radix-ui/react-toggle-group": "1.2.1" }, "peerDependencies": { "@types/react": "*", @@ -3038,17 +3981,16 @@ } } }, - "node_modules/@radix-ui/react-popover": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-popover/-/react-popover-1.3.1.tgz", - "integrity": "sha512-ZNxvXRx5W2Wos4fXCXb5lpdqN0Z5chf+mStOUOTr4ik7d+62MRvoe9rzCA/eGNg36lxXqSrKEKmwuZEcUrIstw==", + "node_modules/@radix-ui/react-tooltip": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-tooltip/-/react-tooltip-1.4.1.tgz", + "integrity": "sha512-NxLFGSFtZ78zVfcoOhTwR1xwqo5qx1Jh8Pw6FMZ9McCaqfRzz7/gIRahs2Oy5XlPgQ+8QkUcKbN5B0U44J/kCg==", "dev": true, "dependencies": { "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.3.0", "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-focus-guards": "1.2.0", "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", "@radix-ui/react-popper": "1.4.0", @@ -3058,8 +4000,7 @@ "@radix-ui/react-slot": "1.5.0", "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -3076,255 +4017,168 @@ } } }, - "node_modules/@radix-ui/react-popper": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-popper/-/react-popper-1.4.0.tgz", - "integrity": "sha512-yCWRvLeGv9Pz3+efwHqGPp70mZ56r3kfIgQVF56Oj2aAa4uP/Tb+IE59wNcc+758rctqbCKx4LbK8II/r7Bn0Q==", + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.5.tgz", + "integrity": "sha512-Y5GBf4NKeADoXI1geiMlMuMoURT3k9MizzzKhGb/m55H94aGigZ01PIpkvsO6lML13BA6XYAXSJ6gza7vTn5nw==", "dev": true, "dependencies": { - "@floating-ui/react-dom": "^2.0.0", - "@radix-ui/react-arrow": "1.1.17", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-use-rect": "1.1.4", - "@radix-ui/react-use-size": "1.1.5", - "@radix-ui/rect": "1.1.3" + "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-portal": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-portal/-/react-portal-1.2.0.tgz", - "integrity": "sha512-StX7xXnaRU41VvFtMm9zlhVGz8XF6GmWWTXftkQaY+tqVkbs/R9UmAp5mLzHHapk5hM9RMZQvO/3usyIP/g42g==", + "node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.3.0.tgz", + "integrity": "sha512-TAcBI7bw2ljYCbv4+zuTSd6zICu8pRt6SDN2vJ/Z06K2MXh6I9WYFe/A9ovlFDtR5HVHGm5iDxDoABm/++dbKg==", "dev": true, "dependencies": { - "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-use-effect-event": "0.0.5", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-presence": { - "version": "1.1.11", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-presence/-/react-presence-1.1.11.tgz", - "integrity": "sha512-Z7/atlkab36Z8hm+V8zYc79r0W+tiOB1o0tun1By94JyadkekLQmtEAnBSP9XKXBNQsStoStS4+gX10JpS5akA==", + "node_modules/@radix-ui/react-use-effect-event": { + "version": "0.0.5", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz", + "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==", "dev": true, "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-primitive": { - "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-primitive/-/react-primitive-2.2.0.tgz", - "integrity": "sha512-HCTSPMNqv55Qk0IX4geJbpyXazmqulcimwuyjxTkKi29v+QZbG2Zho9BnbBq4YS2PF+KlNb2CXoLz66uUmblkg==", + "node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.6.tgz", + "integrity": "sha512-9cRullnQRv+kqnRmFlmh0WC3kAPuGmHiQ9VwsXdrYk//sBhgCKEttcpPEPgIQbyx6TGUmooVEHYTyohwz/lSJg==", "dev": true, "dependencies": { - "@radix-ui/react-slot": "1.5.0" + "@radix-ui/react-use-callback-ref": "1.1.5" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-progress": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-progress/-/react-progress-1.2.1.tgz", - "integrity": "sha512-yQBiM6J3YM8Ums1orkEFpbznK47geKxa0igikzcaS1xHgdba3DdAQBsGbCTt5BVfR8zhEvgxQ0poGcINaD3lvw==", + "node_modules/@radix-ui/react-use-is-hydrated": { + "version": "0.1.3", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.3.tgz", + "integrity": "sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw==", "dev": true, - "dependencies": { - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-primitive": "2.2.0" - }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz", + "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==", + "dev": true, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-radio-group": { - "version": "1.5.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-radio-group/-/react-radio-group-1.5.1.tgz", - "integrity": "sha512-QbyVT1ddnjqB9H+CUYKkNWdU9fIK3QHCYtjf7mS6ekSqiuXkWtWn5UZW9mhA8qtl3vrVyIsmR9gePstAtKrqkw==", + "node_modules/@radix-ui/react-use-previous": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-previous/-/react-use-previous-1.1.4.tgz", + "integrity": "sha512-XoSLhbRbqxFtgJoi2fNHA3C6pDlY34x508vUpUGoFZfvePfHXHbE1lC4FYFMnJWgiCRroSTw6fOsXQoVS9RwZg==", "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-presence": "1.1.11", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-size": "1.1.5" - }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-roving-focus": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.2.1.tgz", - "integrity": "sha512-UwraORzVUeEPMclhO1p0vz0qI+TbdDLO9i+FiOqhJyHKwdpCRCck9yVEscUnAMIzCiuNoQa8D4A9bIpOPXGt6Q==", + "node_modules/@radix-ui/react-use-rect": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-rect/-/react-use-rect-1.1.4.tgz", + "integrity": "sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-is-hydrated": "0.1.3", - "@radix-ui/react-use-layout-effect": "1.1.4" + "@radix-ui/rect": "1.1.3" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-scroll-area": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-scroll-area/-/react-scroll-area-1.4.0.tgz", - "integrity": "sha512-CFrLqHNejWq5FhKAcj9V/WPGRsol76HBQto81NdOBVFEOqIEkJkKIJt0Z824A/9hHLCtoiR/Kw3euRgzXP2pxg==", + "node_modules/@radix-ui/react-use-size": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-size/-/react-use-size-1.1.5.tgz", + "integrity": "sha512-V1McDQkMGzgivwqdu7u96APs7oi0Jvj9LTzgq3WWrDZqxWdAqU9yZnZQqk5OizGFR8badUQwZsrlao7MOlWYOA==", "dev": true, "dependencies": { - "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-presence": "1.1.11", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-slot": "1.5.0", - "@radix-ui/react-use-callback-ref": "1.1.5", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-select": { - "version": "2.4.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-select/-/react-select-2.4.1.tgz", - "integrity": "sha512-888ZwW0Md6GyptuqYABRX9nLKgoYfcooCyBBvVaX5Jp3e+8Jp2i4Zo/Uy50Hm+Ysn2JfloQXstW4U36w8teVtg==", + "node_modules/@radix-ui/react-visually-hidden": { + "version": "1.2.13", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.13.tgz", + "integrity": "sha512-feijiN1oPk4rck4u9Dm9tsU4mT6Wp9oeEEhaz1WUEs1VuqLf8xzsFG+Qk+uWq6TnMH9O+WRECRg0NftyP9E4Fw==", "dev": true, "dependencies": { - "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-focus-guards": "1.2.0", - "@radix-ui/react-focus-scope": "1.3.1", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.4.0", - "@radix-ui/react-portal": "1.2.0", - "@radix-ui/react-presence": "1.1.11", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-slot": "1.5.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.13", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -3341,699 +4195,810 @@ } } }, - "node_modules/@radix-ui/react-separator": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-separator/-/react-separator-1.2.0.tgz", - "integrity": "sha512-1jUAap0wZEqVP05Ou7kJgRxe/W+Qftng+rUNWGa0qkKbv9r5pWTG3E7a3ELKo2eJoHKMECnzuYrZpSyO1YgcYQ==", + "node_modules/@radix-ui/rect": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@radix-ui/rect/-/rect-1.1.3.tgz", + "integrity": "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==", + "dev": true + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", + "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz", + "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz", + "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz", + "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz", + "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz", + "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz", + "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz", + "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz", + "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz", + "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz", + "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz", + "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@radix-ui/react-primitive": "2.2.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-slider": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-slider/-/react-slider-1.6.1.tgz", - "integrity": "sha512-IRNRR90moPqxfwCJ0XbMJIxo70W0/1ZExT/sNCxEHMaPx0SF9HoQrcPEC75+H28cFKa0b+KH63anfLYJmwKacw==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz", + "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-use-size": "1.1.5" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-slot": { - "version": "1.5.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-slot/-/react-slot-1.5.0.tgz", - "integrity": "sha512-tyYd9ddPXAysAbdbD9eYxgwpCSv6f3PncqVSNKQFSR5lcJVLz3cb/pANDoYrLiHBpXv7skortyUgGUWsYuPPFQ==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz", + "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==", + "cpu": [ + "wasm32" + ], "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "@radix-ui/react-compose-refs": "1.1.5" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@emnapi/core": "2.0.0-beta.2", + "@emnapi/runtime": "2.0.0-beta.2", + "@napi-rs/wasm-runtime": "1.2.6" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" } }, - "node_modules/@radix-ui/react-switch": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-switch/-/react-switch-1.4.1.tgz", - "integrity": "sha512-NpBGwc40rY02ZmSvuyeKk0Bvc8ZsNeTMi4qHvJ+ZH4EiYCv0zIXEgdCW4bVdzgIUeP9xxbLJSxKOUfqITYNmkA==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz", + "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-size": "1.1.5" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-tabs": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-tabs/-/react-tabs-1.2.1.tgz", - "integrity": "sha512-hRoJlode+hg5ZNlR+3tkfkUliIybdTpD5lkAvHQ9yaXseGf7XVO9Ib2GPEIOuaJJbo7YWYbNpDDRfo8Dhf6/xA==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz", + "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-presence": "1.1.11", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-use-controllable-state": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-toast": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-toast/-/react-toast-1.3.1.tgz", - "integrity": "sha512-iQvL0J7XK4HtJNGkkWMyYrboNseI7vtotFeUkIno8YNxVA9oM7B6//fh0Mc6TSKI96+zioLWi98lQLso88yJmQ==", + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sentry/browser": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/browser/-/browser-11.1.0.tgz", + "integrity": "sha512-9uXvMg5U8q6hcyzRUYywDJKdaQu1PqjVoqKJ7owwlLFSXjzYihYnfAUmUUalJUQ7Hibe8PydyOV/8r9aL6m72A==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-portal": "1.2.0", - "@radix-ui/react-presence": "1.1.11", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-callback-ref": "1.1.5", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.13" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@sentry/browser-utils": "11.1.0", + "@sentry/conventions": "^0.24.0", + "@sentry/core": "11.1.0", + "@sentry/feedback": "11.1.0", + "@sentry/replay": "11.1.0", + "@sentry/replay-canvas": "11.1.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" } }, - "node_modules/@radix-ui/react-toggle": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-toggle/-/react-toggle-1.2.1.tgz", - "integrity": "sha512-+3MUq+WyiBplXYqQ0EIYlq8R4sLQ0T5NbOK7DMdDLCKO93pe2uE0DUJTWWfTBprpJJXxfoF3eMW0xpakVZrYsg==", + "node_modules/@sentry/browser-utils": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/browser-utils/-/browser-utils-11.1.0.tgz", + "integrity": "sha512-1Bcv2FOKQUXKCSfGmCUMTthQZbmyxoWkiePFQzF7hrchdLlwsgYKJic1t1QwxBMZCBCA+352C4/5tZ9/DWgOVw==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@sentry/conventions": "^0.24.0", + "@sentry/core": "11.1.0", + "web-vitals": "^6.1.1" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + } + }, + "node_modules/@sentry/browser-utils/node_modules/@sentry/conventions": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", + "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sentry/browser/node_modules/@sentry/conventions": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", + "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "dev": true, + "engines": { + "node": ">=14" } }, - "node_modules/@radix-ui/react-toggle-group": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-toggle-group/-/react-toggle-group-1.2.1.tgz", - "integrity": "sha512-O8Ldx5ao4p4KoW+DO8/PmkOe5mdKNi3F2SseqjVj88wvDGDHe60cUmO0Zm/uHsKrvNgQGV8Efpuh95Tht/h4vw==", + "node_modules/@sentry/bundler-plugins": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/bundler-plugins/-/bundler-plugins-11.1.0.tgz", + "integrity": "sha512-0p22SeSdyCnr7PaFkSHZnOzc8lpPlkiA+rsjye9JACR9Hd/n7e9Ssvanw19R7LdqS05foYQSViJIsrVbk45Y3w==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-toggle": "1.2.1", - "@radix-ui/react-use-controllable-state": "1.3.0" + "@sentry/core": "11.1.0", + "dotenv": "^17.4.2", + "glob": "^13.0.6", + "magic-string": "~0.30.8", + "oxc-parser": "^0.143.0", + "sentry": "^0.44.0", + "supports-color": "^8.1.1" + }, + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" }, "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@babel/core": "^7.18.5", + "rollup": ">=3.2.0", + "webpack": ">=5.1.0" }, "peerDependenciesMeta": { - "@types/react": { + "@babel/core": { "optional": true }, - "@types/react-dom": { + "rollup": { + "optional": true + }, + "webpack": { "optional": true } } }, - "node_modules/@radix-ui/react-toolbar": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-toolbar/-/react-toolbar-1.2.1.tgz", - "integrity": "sha512-Cm8m7JTEeUdbfA6T9xgyu8HfOpyvSx8pB/wj0DlEuWaJe9FilIs4Az9wci/lU9RbthV/UkltszMw5WnnD+m/Ug==", + "node_modules/@sentry/bundler-plugins/node_modules/dotenv": { + "version": "17.4.2", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-17.4.2.tgz", + "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-roving-focus": "1.2.1", - "@radix-ui/react-separator": "1.2.0", - "@radix-ui/react-toggle-group": "1.2.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "engines": { + "node": ">=12" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/@radix-ui/react-tooltip": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-tooltip/-/react-tooltip-1.4.1.tgz", - "integrity": "sha512-NxLFGSFtZ78zVfcoOhTwR1xwqo5qx1Jh8Pw6FMZ9McCaqfRzz7/gIRahs2Oy5XlPgQ+8QkUcKbN5B0U44J/kCg==", + "node_modules/@sentry/bundler-plugins/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmmirror.com/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dev": true, "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dismissable-layer": "1.2.1", - "@radix-ui/react-focus-scope": "1.3.1", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.4.0", - "@radix-ui/react-portal": "1.2.0", - "@radix-ui/react-presence": "1.1.11", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-slot": "1.5.0", - "@radix-ui/react-use-controllable-state": "1.3.0", - "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.13" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "engines": { + "node": "18 || 20 || >=22" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@radix-ui/react-use-callback-ref": { - "version": "1.1.5", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.5.tgz", - "integrity": "sha512-Y5GBf4NKeADoXI1geiMlMuMoURT3k9MizzzKhGb/m55H94aGigZ01PIpkvsO6lML13BA6XYAXSJ6gza7vTn5nw==", + "node_modules/@sentry/bundler-plugins/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.4" + "has-flag": "^4.0.0" }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "engines": { + "node": ">=10" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/@radix-ui/react-use-controllable-state": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.3.0.tgz", - "integrity": "sha512-TAcBI7bw2ljYCbv4+zuTSd6zICu8pRt6SDN2vJ/Z06K2MXh6I9WYFe/A9ovlFDtR5HVHGm5iDxDoABm/++dbKg==", + "node_modules/@sentry/conventions": { + "version": "0.23.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.23.0.tgz", + "integrity": "sha512-+Euyo7CNVecoOusgUnq27oV97oshifgceKfnGnuKfXrPUVWA/cisvii3E1rlvy2yBrKvl9K1gCEo1Jqog5zjEQ==", "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-use-effect-event": "0.0.5", - "@radix-ui/react-use-layout-effect": "1.1.4" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": ">=14" } }, - "node_modules/@radix-ui/react-use-effect-event": { - "version": "0.0.5", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz", - "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==", + "node_modules/@sentry/core": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/core/-/core-11.1.0.tgz", + "integrity": "sha512-ObM47oMWxRQiVxUdkV6bs2BeHxPVWim571hw1iT3suyAc8iRfJ27f+QdIdmDKZtvHFGJ0Vh/LpeTZP5Z8FXyEA==", "dev": true, "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.4" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@sentry/conventions": "^0.24.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" } }, - "node_modules/@radix-ui/react-use-escape-keydown": { - "version": "1.1.6", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.6.tgz", - "integrity": "sha512-9cRullnQRv+kqnRmFlmh0WC3kAPuGmHiQ9VwsXdrYk//sBhgCKEttcpPEPgIQbyx6TGUmooVEHYTyohwz/lSJg==", + "node_modules/@sentry/core/node_modules/@sentry/conventions": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", + "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sentry/electron": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/@sentry/electron/-/electron-8.0.0.tgz", + "integrity": "sha512-eoxA5nAQwicqfRaZRK2ERx8oMHDf6nI55Dm9yfDFQKICYmFLfq6sDLDUfXmvIaoWg5eM7nSavgDYjG6NQo59fA==", "dev": true, "dependencies": { - "@radix-ui/react-use-callback-ref": "1.1.5" + "@sentry/browser": "11.1.0", + "@sentry/conventions": "^0.23.0", + "@sentry/core": "11.1.0", + "@sentry/node": "11.1.0", + "@sentry/server-utils": "11.1.0" }, "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@sentry/node-native": "11.1.0" }, "peerDependenciesMeta": { - "@types/react": { + "@sentry/node-native": { "optional": true } } }, - "node_modules/@radix-ui/react-use-is-hydrated": { - "version": "0.1.3", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.3.tgz", - "integrity": "sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw==", + "node_modules/@sentry/feedback": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/feedback/-/feedback-11.1.0.tgz", + "integrity": "sha512-ZHZwmJEWcvxJP/rvaJlrO6NFpGHkewsxVmvHLJHkbd1XSChtwgdUI8W/+Gu4jcGXRz0JJPFrpRFNuVTp1QWCjg==", "dev": true, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "dependencies": { + "@sentry/core": "11.1.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" } }, - "node_modules/@radix-ui/react-use-layout-effect": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz", - "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==", + "node_modules/@sentry/node": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/node/-/node-11.1.0.tgz", + "integrity": "sha512-8QPZILpVGkggpCe1Qt9VaPQ8UWy6EAVY/94HB2EWqSn6Xx9J7f3pMlncxOQfwv09S7iZDs1Lmfj/Zf7iftinZw==", "dev": true, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "dependencies": { + "@opentelemetry/api": "^1.9.1", + "@sentry/bundler-plugins": "11.1.0", + "@sentry/conventions": "^0.24.0", + "@sentry/core": "11.1.0", + "@sentry/opentelemetry": "11.1.0", + "@sentry/server-runtime-injection": "11.1.0", + "@sentry/server-utils": "11.1.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" } }, - "node_modules/@radix-ui/react-use-previous": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-previous/-/react-use-previous-1.1.4.tgz", - "integrity": "sha512-XoSLhbRbqxFtgJoi2fNHA3C6pDlY34x508vUpUGoFZfvePfHXHbE1lC4FYFMnJWgiCRroSTw6fOsXQoVS9RwZg==", + "node_modules/@sentry/node/node_modules/@sentry/conventions": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", + "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", "dev": true, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": ">=14" } }, - "node_modules/@radix-ui/react-use-rect": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-rect/-/react-use-rect-1.1.4.tgz", - "integrity": "sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ==", + "node_modules/@sentry/opentelemetry": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/opentelemetry/-/opentelemetry-11.1.0.tgz", + "integrity": "sha512-ZFRwYDSuTIzpS1yOFTMn6p568tQW8k7KIjwzlI8VMOYYAEDkXQK+D/ZUGedSA/iu9fbiZXX+/wFfKqk7AYIiGg==", "dev": true, "dependencies": { - "@radix-ui/rect": "1.1.3" + "@sentry/conventions": "^0.24.0", + "@sentry/core": "11.1.0" }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "peerDependencies": { + "@opentelemetry/api": "^1.9.0" } }, - "node_modules/@radix-ui/react-use-size": { - "version": "1.1.5", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-size/-/react-use-size-1.1.5.tgz", - "integrity": "sha512-V1McDQkMGzgivwqdu7u96APs7oi0Jvj9LTzgq3WWrDZqxWdAqU9yZnZQqk5OizGFR8badUQwZsrlao7MOlWYOA==", + "node_modules/@sentry/opentelemetry/node_modules/@sentry/conventions": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", + "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", "dev": true, - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.4" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": ">=14" } }, - "node_modules/@radix-ui/react-visually-hidden": { - "version": "1.2.13", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.13.tgz", - "integrity": "sha512-feijiN1oPk4rck4u9Dm9tsU4mT6Wp9oeEEhaz1WUEs1VuqLf8xzsFG+Qk+uWq6TnMH9O+WRECRg0NftyP9E4Fw==", + "node_modules/@sentry/replay": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/replay/-/replay-11.1.0.tgz", + "integrity": "sha512-11J/iTBOHqYXQxu9b/KRPxUeHakFdLPnHmDz4hrJ198R4QQQeY245tnYxL8o/1yaQdSo0AMEWJ38lo9GtIWfhg==", "dev": true, "dependencies": { - "@radix-ui/react-primitive": "2.2.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@sentry/browser-utils": "11.1.0", + "@sentry/core": "11.1.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" } }, - "node_modules/@radix-ui/rect": { - "version": "1.1.3", - "resolved": "https://registry.npmmirror.com/@radix-ui/rect/-/rect-1.1.3.tgz", - "integrity": "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==", - "dev": true - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.6.tgz", - "integrity": "sha512-G6xF9OVRWsbHadMfoPNUDwW/Jt70QYG+ZDUvtYCFxjf3SPhqVAO0u9ShXZ7Cf5silVoRWyN4bDjCEKnJkXkw0w==", - "cpu": [ - "arm" - ], + "node_modules/@sentry/replay-canvas": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/replay-canvas/-/replay-canvas-11.1.0.tgz", + "integrity": "sha512-nHWrcN5B6tkxSNvFkI1xT9llNi3NJfUV5JUGhUTtt9urcL55dIMtT7GSflub2fBtrsE//FzeoL1T3Wt4r8+CMQ==", "dev": true, - "optional": true, - "os": [ - "android" - ] + "dependencies": { + "@sentry/core": "11.1.0", + "@sentry/replay": "11.1.0" + }, + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.6.tgz", - "integrity": "sha512-Us/kTH5e2anr1CQvO8MEq4eeCVcIXI3Ag7OFxDI30n2OW7Q7xWuxo8ItbYq28PG2Sm1NWmZzG9+SqVEaj25SFA==", - "cpu": [ - "arm64" - ], + "node_modules/@sentry/server-runtime-injection": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/server-runtime-injection/-/server-runtime-injection-11.1.0.tgz", + "integrity": "sha512-tp5ihEibsCQG/qTqL7yqU3PXQLsXM9Nm+ELPMy6hptkyuiOCuDOXpAzthWcSDHVIdBYIC7iUPmpcZihfTXx6Mw==", "dev": true, - "optional": true, - "os": [ - "android" - ] + "dependencies": { + "@sentry/core": "11.1.0", + "@sentry/server-utils": "11.1.0" + }, + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.6.tgz", - "integrity": "sha512-fwaSNrSHp9PJuEh4bKtd0mYC+G3FeVDjSTmsSiSlIYu7TFCpxrfB6lk7Ao8cIbswFyklPB1ZDUV8LkLBM15VWw==", - "cpu": [ - "arm64" - ], + "node_modules/@sentry/server-utils": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/@sentry/server-utils/-/server-utils-11.1.0.tgz", + "integrity": "sha512-5IQtU8SommZyTZgJxZFunQQHay8Vq78D8P0qP9ggQ1hTa6GU6kQKBDDN8eNayUA/Hl2qPei/LAmvmyiZNDIJ0Q==", "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "dependencies": { + "@opentelemetry/api": "^1.9.1", + "@sentry/conventions": "^0.24.0", + "@sentry/core": "11.1.0" + }, + "engines": { + "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.6.tgz", - "integrity": "sha512-QR2tx26gCeGh4eAGnUasfnJuRc+d7Vc0Jo1/fYtKGuiKqCuhbVpbNEvqgYGBwGDZGyS04jj+zdHi9W8uvb1Sdw==", - "cpu": [ - "x64" - ], + "node_modules/@sentry/server-utils/node_modules/@sentry/conventions": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", + "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "engines": { + "node": ">=14" + } }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.6.tgz", - "integrity": "sha512-7E1wRJEW8r7WlqmCy58ugndWHrzoEV/pRt2x0D9el7Inra62+Cw00lYW9XhW6iUCtFjhNw49McsSCIzJ/nG8uw==", - "cpu": [ - "arm64" - ], + "node_modules/@spz-loader/core": { + "version": "0.3.1", + "resolved": "https://registry.npmmirror.com/@spz-loader/core/-/core-0.3.1.tgz", + "integrity": "sha512-8qJ1WIBXaJu8HjnJAjYniE0kYcr0kCe5Hp7kDzYiGVvvd7zyrOBwbF5imoW5mvwx1Qba0hxGEK5R9jEoaHKJFA==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ] + "engines": { + "node": ">=16", + "pnpm": ">=8" + } }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.6.tgz", - "integrity": "sha512-13KJeF+vDswMzEHmMIouCVcEQdov3CzAA3ZhM8QFmBJV/FZ/VMZI49UHDvPXTK+wokk86kYPmQ9Qb3xGGJbZoQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.6.tgz", - "integrity": "sha512-hV+W1r8HM84PER4If94QuzrrD0DNk4CxobNhVUiz9ZiiWHDzJss4Jra2AYGH1a7GOTzjS1sIyZ35yYEhw/aq+g==", - "cpu": [ - "arm" - ], + "node_modules/@tailwindcss/node": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/node/-/node-4.3.5.tgz", + "integrity": "sha512-yT53FzV4ke0cr/BguDxhWMpm5MJu1O2muzk+tKw6lKHjODAsYArBbWwFbJiaksfzFv1tpkO9QHGzmfs1hJT66g==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.24.5", + "jiti": "^2.7.0", + "lightningcss": "1.33.0", + "magic-string": "^1.1.0", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.5" + } }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.6.tgz", - "integrity": "sha512-5dWs/GENZufRph8PEfl0TrNH/R3DHJA+VxF/dqlfV2oUZfxRtN3qmFXg2DZj8DYM8d+Vd3dgZtuVmoBE/nb2YQ==", - "cpu": [ - "arm" - ], + "node_modules/@tailwindcss/node/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.6.tgz", - "integrity": "sha512-inQYLPVIUvYk+s7zpxQldqwrajUNs+t4TJjPGzsdPTvsT8gsQXVcW/sQFolHZ3YSWVk0nMMwU7TtRi0Ow+QMuw==", - "cpu": [ - "arm64" - ], + "node_modules/@tailwindcss/oxide": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide/-/oxide-4.3.5.tgz", + "integrity": "sha512-PynqGLZsZvwM9tqD/CUxkOIfyd6K5elZ2MooauzJryP/UqXYgi3yYbtt3N0Xe+MHV/eFKPFQCEfIKAqlAS1CBg==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.5", + "@tailwindcss/oxide-darwin-arm64": "4.3.5", + "@tailwindcss/oxide-darwin-x64": "4.3.5", + "@tailwindcss/oxide-freebsd-x64": "4.3.5", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.5", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.5", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.5", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.5", + "@tailwindcss/oxide-linux-x64-musl": "4.3.5", + "@tailwindcss/oxide-wasm32-wasi": "4.3.5", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.5", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.5" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.6.tgz", - "integrity": "sha512-sH+0MV1HmDC1q7+bQnlN9ywKBmHqkA2EdD/hHYrrz654ybc+vNC1FRNyzuYKicMQVtZZ4X2jz0osJYmsOtnj4g==", + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.5.tgz", + "integrity": "sha512-Se0z5xMqcSQanJD1IYmO0cGpK3iv0fp3ZsIT7xRJZ1Da5PghvNoc46zz4jIQn+aan3dV9T8AermFNN9QPmsh0Q==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ - "linux" - ] + "android" + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.6.tgz", - "integrity": "sha512-mCECvRr6HGekdBc6dvHzUWubqEti4JyOqlNePrOzl4Wimk26iW5Zy9rld2mQbC9id1NYjfF8nHLFq5fr3CuOKQ==", + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.5.tgz", + "integrity": "sha512-UPrgTDuUbvmqGMZuCnmI3FKee/tYKzKdp00/kuB4oSGB213VYg8QTdF7lVhnPoBXq/mIfJ+ILoBFqNOboWcMwQ==", "cpu": [ - "loong64" + "arm64" ], "dev": true, "optional": true, "os": [ - "linux" - ] + "darwin" + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.6.tgz", - "integrity": "sha512-bb9rdoCPwM4DEsbOP3CJgFnvhSJ3XKCUYyUhxnlSs/XGT0DknpOYgLCPbK8VUzwl+cZGzFQm0KbBYRaSGZC2YQ==", + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.5.tgz", + "integrity": "sha512-E+p7HEtjI0b8D7kbbWxH067cGui6d4c79COGko9fAPVE3rwc1E7ld2HFCbaG86AOGWS5VKQYqZOaf38ya4uxTQ==", "cpu": [ - "loong64" + "x64" ], "dev": true, "optional": true, "os": [ - "linux" - ] + "darwin" + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.6.tgz", - "integrity": "sha512-aIJRoGCHev45JSu7JMzVrMzu1NX3nQrXx1Vb/6y4AblxW7JpCMpk4e8C6lHzvSElxi3UEcMdFJldsuWQjV1ddA==", + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.5.tgz", + "integrity": "sha512-yWEWcWyAG7rWOcTpJTjdhQ3pcaFY2h+0bqTRfgU3G2fz87ZU3AKdvdZKhslD+kyHnjBUWKvNdRYwIYC5dI1tIg==", "cpu": [ - "ppc64" + "x64" ], "dev": true, "optional": true, "os": [ - "linux" - ] + "freebsd" + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.6.tgz", - "integrity": "sha512-LvjnulezHjiaM5Ga9MPCDLTVddjvcrJhZc6vEz9fxeFRGPJsPAX9HuTuPTUQ3l8d+nYpZB/xWzUpuKJlLQm3VQ==", + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.5.tgz", + "integrity": "sha512-WmeVjtJhZlr+smpqcdR2kQkkn6arHIJnUIBxTO2EJcTLGY1ecVXNo2hbSn8xc0IH2aEtys936iMWKGyj0GaKnA==", "cpu": [ - "ppc64" + "arm" ], "dev": true, "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.6.tgz", - "integrity": "sha512-YmhSBeYZwJ937s8tKpYAhms48N+tj7e+oFkbkVVxfMRdAiynK2AxqRapJXB4utyXxc/iYTkMfPRQ+7ZP0IO78w==", + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.5.tgz", + "integrity": "sha512-DTCSyucc6ShMp1QMqV5R94Z7xlgNgUzkGmFF1rL5HH2Qjy4eSmEqy+YLGkqqYvWa4sILtgrBt1JjRKbneQtiFQ==", "cpu": [ - "riscv64" + "arm64" ], "dev": true, "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.6.tgz", - "integrity": "sha512-9+YukhzqTvJvzfDXJJzkURK9TDY01nofNH3pyHGuucGC4xPvBVtIfCAqJjkjnmBEGJYNXB8sBc2EDt7xDgGenw==", + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.5.tgz", + "integrity": "sha512-H9lsvO4x9E4nE4Hi8h7NHHw0O/kcVSu+iOyFHNGdYzazGgDjFHZbE6S3hQ8kMcbNXSBlMdNi67LV5EVqtpaJtw==", "cpu": [ - "riscv64" + "arm64" ], "dev": true, "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.6.tgz", - "integrity": "sha512-9G5AtEkpN/A89BILHHEL9aYRYTuFjwa8PUQqoEg8SDrwOZBKpwYqNlQCBNI5QPwGrf7qFlb6LNFilo8FCSA3Wg==", + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.5.tgz", + "integrity": "sha512-4uxQvtBvPuIdl13WfUBj9xMZHH14PtHZ8OZdtLmdyDtG66sCa1t599NZT+jagkUzRtWhuul1qRZQ1nAJscXN5g==", "cpu": [ - "s390x" + "x64" ], "dev": true, "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.6.tgz", - "integrity": "sha512-Ezx2E5D6Siz805j41x91JiGbzuCm8i2U98U37SQ7ytY737+wsJq+P9nPL6UmqDww491zO7MTivYOTrtmTTeCSw==", + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.5.tgz", + "integrity": "sha512-0JQAzs7jwbA7O6+z/adU+Jk3AXwsu3npAhtr5escXS7TqEqWcaDV7qHuI+0Vy/KQRuVGnLQREcSJWYauyV3oqg==", "cpu": [ "x64" ], @@ -4041,90 +5006,126 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.6.tgz", - "integrity": "sha512-8EZ1Q3PB7yUjvR4MbFAnCBF1wF0XRe5QQqbtlJXP7ZX5C8iYlSQJugUhj9oS0gbUP4jp9qGhaIgFnV9Nvod86Q==", - "cpu": [ - "x64" + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.5.tgz", + "integrity": "sha512-OJhFmlEfdzMr+avACdi40RPtnkW0B6hXyxL/8r+tnEHBWZji36CYRjEXrrvgBmaYsD3oEOBqwYFRKsYvzFe7Bw==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" ], "dev": true, "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@emnapi/core": "^1.11.3", + "@emnapi/runtime": "^1.11.3", + "@emnapi/wasi-threads": "^1.2.3", + "@napi-rs/wasm-runtime": "^1.2.2", + "@tybys/wasm-util": "^0.10.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.6.tgz", - "integrity": "sha512-3JI27TALItfZ/qaxXKdbRXfV6WepUoUa3IN07FE+1xxoRdl3JIyrp5PiDF0vOHsPgEiOFkF8s3B3BRymQkdwGA==", - "cpu": [ - "x64" - ], + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.3", "dev": true, + "inBundle": true, + "license": "MIT", "optional": true, - "os": [ - "openbsd" - ] + "dependencies": { + "@emnapi/wasi-threads": "1.2.3", + "tslib": "^2.4.0" + } }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.6.tgz", - "integrity": "sha512-BNOGeNFNRZDT7Hfc7b9JbTZFXkpAXeXl/CZWtxdd5CNfBaor/0RkJjg+q+E2gwVIvGqqp/NclThKFGrhuScVhw==", - "cpu": [ - "arm64" - ], + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.3", "dev": true, + "inBundle": true, + "license": "MIT", "optional": true, - "os": [ - "openharmony" - ] + "dependencies": { + "tslib": "^2.4.0" + } }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.6.tgz", - "integrity": "sha512-D3eEyLSIim5WF5fHbwnx+ryk0delN7fJyBrDTO3wVCCNBZ/cA8aCGwLS3SiuK+vRI4E7dqikAlStGuR20dBMuw==", - "cpu": [ - "arm64" - ], + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { + "version": "1.2.3", "dev": true, + "inBundle": true, + "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "tslib": "^2.4.0" + } }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.6.tgz", - "integrity": "sha512-xwbs9g8zLbHzj1poG1uh27xtubsu27Gk2nuN6kvvGDybjiTfwMksQAnF+phlvI5oeXkJWWDc6kg1t3XpgUYvrg==", - "cpu": [ - "ia32" - ], + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.2", "dev": true, + "inBundle": true, + "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.6.tgz", - "integrity": "sha512-Tr6rhRNnFthvXr45zWVZQ5P8jZ5UwZnXNc7Qnu80cP/VVYtSioOPmvv7wP6UMgRfkBCJr2Pm60ua0YBDSJjgnw==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": { + "version": "2.8.1", + "dev": true, + "inBundle": true, + "license": "0BSD", + "optional": true + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", + "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", "cpu": [ - "x64" + "arm64" ], "dev": true, "optional": true, "os": [ "win32" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.6.tgz", - "integrity": "sha512-0RAxO1pS/6lY1mSoD2Apm+6aPyfUlm+OWKgncIdj/eVN9I+pDY3lKgD7xsUNFei1u7MZQETGOo6m8POXMDp53A==", + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", + "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", "cpu": [ "x64" ], @@ -4132,822 +5133,773 @@ "optional": true, "os": [ "win32" - ] + ], + "engines": { + "node": ">= 20" + } }, - "node_modules/@sentry/browser": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/browser/-/browser-11.1.0.tgz", - "integrity": "sha512-9uXvMg5U8q6hcyzRUYywDJKdaQu1PqjVoqKJ7owwlLFSXjzYihYnfAUmUUalJUQ7Hibe8PydyOV/8r9aL6m72A==", + "node_modules/@tailwindcss/vite": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.5.tgz", + "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", "dev": true, "dependencies": { - "@sentry/browser-utils": "11.1.0", - "@sentry/conventions": "^0.24.0", - "@sentry/core": "11.1.0", - "@sentry/feedback": "11.1.0", - "@sentry/replay": "11.1.0", - "@sentry/replay-canvas": "11.1.0" + "@tailwindcss/node": "4.3.5", + "@tailwindcss/oxide": "4.3.5", + "tailwindcss": "4.3.5" }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, - "node_modules/@sentry/browser-utils": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/browser-utils/-/browser-utils-11.1.0.tgz", - "integrity": "sha512-1Bcv2FOKQUXKCSfGmCUMTthQZbmyxoWkiePFQzF7hrchdLlwsgYKJic1t1QwxBMZCBCA+352C4/5tZ9/DWgOVw==", + "node_modules/@testing-library/dom": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.2.tgz", + "integrity": "sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==", "dev": true, - "dependencies": { - "@sentry/conventions": "^0.24.0", - "@sentry/core": "11.1.0", - "web-vitals": "^6.1.1" + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "picocolors": "1.1.1", + "pretty-format": "^27.0.2" }, "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "node": ">=18" } }, - "node_modules/@sentry/browser-utils/node_modules/@sentry/conventions": { - "version": "0.24.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", - "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "node_modules/@testing-library/user-event": { + "version": "14.6.13", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.13.tgz", + "integrity": "sha512-2LVZGptuB5un1Cu/u31o9adkCwbsUTMp4B4p04xupI7uobvTIpgKidSdShqZiReo/mQmvR9xjgdgTgge4oAbYA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=14" + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" } }, - "node_modules/@sentry/browser/node_modules/@sentry/conventions": { - "version": "0.24.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", - "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "node_modules/@tsrs/darwin-arm64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/darwin-arm64/-/darwin-arm64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-VMsXBPFD0SO5p7XrXhLutPmnpHc4kMIt7uztBJoHr/5Jd6qC8eH/TomobdPGugw27U3uiW2wJDqYjqYq5fxoCA==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14" + "node": ">=16.20.0" } }, - "node_modules/@sentry/bundler-plugins": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/bundler-plugins/-/bundler-plugins-11.1.0.tgz", - "integrity": "sha512-0p22SeSdyCnr7PaFkSHZnOzc8lpPlkiA+rsjye9JACR9Hd/n7e9Ssvanw19R7LdqS05foYQSViJIsrVbk45Y3w==", + "node_modules/@tsrs/darwin-x64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/darwin-x64/-/darwin-x64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-cNVbvIaKasKYjAI4aBfCE+gpa188JMb3GORyK9SDMZOEib9toEAAO7XCImOkazkLPq45UZxmxfCgBKMpMNWfug==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@sentry/core": "11.1.0", - "dotenv": "^17.4.2", - "glob": "^13.0.6", - "magic-string": "~0.30.8", - "oxc-parser": "^0.143.0", - "sentry": "^0.44.0", - "supports-color": "^8.1.1" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" - }, - "peerDependencies": { - "@babel/core": "^7.18.5", - "rollup": ">=3.2.0", - "webpack": ">=5.1.0" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "rollup": { - "optional": true - }, - "webpack": { - "optional": true - } + "node": ">=16.20.0" } }, - "node_modules/@sentry/bundler-plugins/node_modules/dotenv": { - "version": "17.4.2", - "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-17.4.2.tgz", - "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", + "node_modules/@tsrs/linux-arm64-gnu": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-arm64-gnu/-/linux-arm64-gnu-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-g1wZyn53DDQsIeu19i0YTYZCwY8eEZetR2MjgZK8XIznA6GSir67pEBaAsxpLZzOD7Z6UPjnoSP6w6ft08JnWQ==", + "cpu": [ + "arm64" + ], "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" + "node": ">=16.20.0" } }, - "node_modules/@sentry/bundler-plugins/node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmmirror.com/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "node_modules/@tsrs/linux-arm64-musl": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-arm64-musl/-/linux-arm64-musl-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-vt23JfDe8ECKOC9G7dpYY3dzC8EFKBKuNCLaYbTJgemKN0GbxvWN3chm5LotjNYuROv2cED1AUTJEE1+k5oDGw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "minimatch": "^10.2.2", - "minipass": "^7.1.3", - "path-scurry": "^2.0.2" - }, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=16.20.0" } }, - "node_modules/@sentry/bundler-plugins/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/@tsrs/linux-x64-gnu": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-x64-gnu/-/linux-x64-gnu-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-4QlsTwQSAnx5KrNeWDg/+HKSjBhsFPU2JsMZzK2vn+8hxNXDD3gbiP6dP7dD7ohdJdSAy+jm6uY2F4XyLpIyRQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "node": ">=16.20.0" } }, - "node_modules/@sentry/conventions": { - "version": "0.23.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.23.0.tgz", - "integrity": "sha512-+Euyo7CNVecoOusgUnq27oV97oshifgceKfnGnuKfXrPUVWA/cisvii3E1rlvy2yBrKvl9K1gCEo1Jqog5zjEQ==", + "node_modules/@tsrs/linux-x64-musl": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-x64-musl/-/linux-x64-musl-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-ZGwwZiaA8hUh5kKIktDifI5b9pfprjU0so4Pkkx9NLvgdIhJVjYt0sGOVdNPDdpk6NG+96ld8sH70hRUav7w/g==", + "cpu": [ + "x64" + ], "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" + "node": ">=16.20.0" } }, - "node_modules/@sentry/core": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/core/-/core-11.1.0.tgz", - "integrity": "sha512-ObM47oMWxRQiVxUdkV6bs2BeHxPVWim571hw1iT3suyAc8iRfJ27f+QdIdmDKZtvHFGJ0Vh/LpeTZP5Z8FXyEA==", + "node_modules/@tsrs/win32-arm64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/win32-arm64/-/win32-arm64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-P6WGeHGKNz3+BLrC0aBDiEHTvqTl95T15sBv20om3y7RwFpTNCWUYuxkDXUWciltxyGgjRh1enUJ4dTUZ7SQbQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@sentry/conventions": "^0.24.0" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "node": ">=16.20.0" } }, - "node_modules/@sentry/core/node_modules/@sentry/conventions": { - "version": "0.24.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", - "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "node_modules/@tsrs/win32-x64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/win32-x64/-/win32-x64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-ICto2KzEv99ScmQInd/ItESq0V8MBA7MYakNEQX45cgqGLeFIrv64X9X/avNcRJVqOE1SvAGXk68uysAPOqjWA==", + "cpu": [ + "x64" + ], "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=14" + "node": ">=16.20.0" } }, - "node_modules/@sentry/electron": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/@sentry/electron/-/electron-8.0.0.tgz", - "integrity": "sha512-eoxA5nAQwicqfRaZRK2ERx8oMHDf6nI55Dm9yfDFQKICYmFLfq6sDLDUfXmvIaoWg5eM7nSavgDYjG6NQo59fA==", + "node_modules/@tweenjs/tween.js": { + "version": "25.0.0", + "resolved": "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-25.0.0.tgz", + "integrity": "sha512-XKLA6syeBUaPzx4j3qwMqzzq+V4uo72BnlbOjmuljLrRqdsd3qnzvZZoxvMHZ23ndsRS4aufU6JOZYpCbU6T1A==", + "dev": true + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz", + "integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "@sentry/browser": "11.1.0", - "@sentry/conventions": "^0.23.0", - "@sentry/core": "11.1.0", - "@sentry/node": "11.1.0", - "@sentry/server-utils": "11.1.0" - }, - "peerDependencies": { - "@sentry/node-native": "11.1.0" - }, - "peerDependenciesMeta": { - "@sentry/node-native": { - "optional": true - } + "tslib": "^2.4.0" } }, - "node_modules/@sentry/feedback": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/feedback/-/feedback-11.1.0.tgz", - "integrity": "sha512-ZHZwmJEWcvxJP/rvaJlrO6NFpGHkewsxVmvHLJHkbd1XSChtwgdUI8W/+Gu4jcGXRz0JJPFrpRFNuVTp1QWCjg==", + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", "dev": true, - "dependencies": { - "@sentry/core": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" - } + "license": "MIT" }, - "node_modules/@sentry/node": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/node/-/node-11.1.0.tgz", - "integrity": "sha512-8QPZILpVGkggpCe1Qt9VaPQ8UWy6EAVY/94HB2EWqSn6Xx9J7f3pMlncxOQfwv09S7iZDs1Lmfj/Zf7iftinZw==", + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { - "@opentelemetry/api": "^1.9.1", - "@sentry/bundler-plugins": "11.1.0", - "@sentry/conventions": "^0.24.0", - "@sentry/core": "11.1.0", - "@sentry/opentelemetry": "11.1.0", - "@sentry/server-runtime-injection": "11.1.0", - "@sentry/server-utils": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" } }, - "node_modules/@sentry/node/node_modules/@sentry/conventions": { - "version": "0.24.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", - "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", "dev": true, - "engines": { - "node": ">=14" + "dependencies": { + "@babel/types": "^7.0.0" } }, - "node_modules/@sentry/opentelemetry": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/opentelemetry/-/opentelemetry-11.1.0.tgz", - "integrity": "sha512-ZFRwYDSuTIzpS1yOFTMn6p568tQW8k7KIjwzlI8VMOYYAEDkXQK+D/ZUGedSA/iu9fbiZXX+/wFfKqk7AYIiGg==", + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { - "@sentry/conventions": "^0.24.0", - "@sentry/core": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } }, - "node_modules/@sentry/opentelemetry/node_modules/@sentry/conventions": { - "version": "0.24.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", - "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dev": true, - "engines": { - "node": ">=14" + "dependencies": { + "@babel/types": "^7.28.2" } }, - "node_modules/@sentry/replay": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/replay/-/replay-11.1.0.tgz", - "integrity": "sha512-11J/iTBOHqYXQxu9b/KRPxUeHakFdLPnHmDz4hrJ198R4QQQeY245tnYxL8o/1yaQdSo0AMEWJ38lo9GtIWfhg==", + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", "dev": true, + "license": "MIT", "dependencies": { - "@sentry/browser-utils": "11.1.0", - "@sentry/core": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" } }, - "node_modules/@sentry/replay-canvas": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/replay-canvas/-/replay-canvas-11.1.0.tgz", - "integrity": "sha512-nHWrcN5B6tkxSNvFkI1xT9llNi3NJfUV5JUGhUTtt9urcL55dIMtT7GSflub2fBtrsE//FzeoL1T3Wt4r8+CMQ==", + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmmirror.com/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", "dev": true, "dependencies": { - "@sentry/core": "11.1.0", - "@sentry/replay": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "@types/ms": "*" } }, - "node_modules/@sentry/server-runtime-injection": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/server-runtime-injection/-/server-runtime-injection-11.1.0.tgz", - "integrity": "sha512-tp5ihEibsCQG/qTqL7yqU3PXQLsXM9Nm+ELPMy6hptkyuiOCuDOXpAzthWcSDHVIdBYIC7iUPmpcZihfTXx6Mw==", + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/dom-webcodecs": { + "version": "0.1.19", + "resolved": "https://registry.npmmirror.com/@types/dom-webcodecs/-/dom-webcodecs-0.1.19.tgz", + "integrity": "sha512-+yFUIDUaASFz0vQpWBErPxun/Lb+F0TdrlTsj50gm7K797YzEx2TmV6fEiwciHyFNghlZYPgQXH5qRcwMHcJFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", "dev": true, "dependencies": { - "@sentry/core": "11.1.0", - "@sentry/server-utils": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "@types/estree": "*" } }, - "node_modules/@sentry/server-utils": { - "version": "11.1.0", - "resolved": "https://registry.npmmirror.com/@sentry/server-utils/-/server-utils-11.1.0.tgz", - "integrity": "sha512-5IQtU8SommZyTZgJxZFunQQHay8Vq78D8P0qP9ggQ1hTa6GU6kQKBDDN8eNayUA/Hl2qPei/LAmvmyiZNDIJ0Q==", + "node_modules/@types/fs-extra": { + "version": "9.0.13", + "resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz", + "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "dev": true, "dependencies": { - "@opentelemetry/api": "^1.9.1", - "@sentry/conventions": "^0.24.0", - "@sentry/core": "11.1.0" - }, - "engines": { - "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0" + "@types/node": "*" } }, - "node_modules/@sentry/server-utils/node_modules/@sentry/conventions": { - "version": "0.24.0", - "resolved": "https://registry.npmmirror.com/@sentry/conventions/-/conventions-0.24.0.tgz", - "integrity": "sha512-pmmF2mLy7A23z8gnLRG87lYu4SSPIBColtfqu9cfkh1omn/0CI3w0/AqZ/uf/VGAtM/wJMN61J58Ks/IWBCHpQ==", + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmmirror.com/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", "dev": true, - "engines": { - "node": ">=14" + "dependencies": { + "@types/unist": "*" } }, - "node_modules/@spz-loader/core": { - "version": "0.3.1", - "resolved": "https://registry.npmmirror.com/@spz-loader/core/-/core-0.3.1.tgz", - "integrity": "sha512-8qJ1WIBXaJu8HjnJAjYniE0kYcr0kCe5Hp7kDzYiGVvvd7zyrOBwbF5imoW5mvwx1Qba0hxGEK5R9jEoaHKJFA==", + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dev": true, - "engines": { - "node": ">=16", - "pnpm": ">=8" + "dependencies": { + "@types/unist": "*" } }, - "node_modules/@standard-schema/spec": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true }, - "node_modules/@tailwindcss/node": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/node/-/node-4.3.5.tgz", - "integrity": "sha512-yT53FzV4ke0cr/BguDxhWMpm5MJu1O2muzk+tKw6lKHjODAsYArBbWwFbJiaksfzFv1tpkO9QHGzmfs1hJT66g==", + "node_modules/@types/node": { + "version": "26.6.3", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-26.6.3.tgz", + "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", "dev": true, "dependencies": { - "@jridgewell/remapping": "^2.3.5", - "enhanced-resolve": "^5.24.5", - "jiti": "^2.7.0", - "lightningcss": "1.33.0", - "magic-string": "^1.1.0", - "source-map-js": "^1.2.1", - "tailwindcss": "4.3.5" + "undici-types": "~8.9.0" } }, - "node_modules/@tailwindcss/node/node_modules/magic-string": { - "version": "1.4.5", - "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.4.5.tgz", - "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", - "dev": true, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmmirror.com/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "devOptional": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.6.0" + "csstype": "^3.2.2" } }, - "node_modules/@tailwindcss/oxide": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide/-/oxide-4.3.5.tgz", - "integrity": "sha512-PynqGLZsZvwM9tqD/CUxkOIfyd6K5elZ2MooauzJryP/UqXYgi3yYbtt3N0Xe+MHV/eFKPFQCEfIKAqlAS1CBg==", + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmmirror.com/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", "dev": true, - "engines": { - "node": ">= 20" + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmmirror.com/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "optional": true + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "node_modules/@types/wicg-file-system-access": { + "version": "2020.9.8", + "resolved": "https://registry.npmmirror.com/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.8.tgz", + "integrity": "sha512-ggMz8nOygG7d/stpH40WVaNvBwuyYLnrg5Mbyf6bmsj/8+gb6Ei4ZZ9/4PNpcPNTT8th9Q8sM8wYmWGjMWLX/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript/old": { + "name": "typescript", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, - "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.3.5", - "@tailwindcss/oxide-darwin-arm64": "4.3.5", - "@tailwindcss/oxide-darwin-x64": "4.3.5", - "@tailwindcss/oxide-freebsd-x64": "4.3.5", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.5", - "@tailwindcss/oxide-linux-arm64-gnu": "4.3.5", - "@tailwindcss/oxide-linux-arm64-musl": "4.3.5", - "@tailwindcss/oxide-linux-x64-gnu": "4.3.5", - "@tailwindcss/oxide-linux-x64-musl": "4.3.5", - "@tailwindcss/oxide-wasm32-wasi": "4.3.5", - "@tailwindcss/oxide-win32-arm64-msvc": "4.3.5", - "@tailwindcss/oxide-win32-x64-msvc": "4.3.5" + "engines": { + "node": ">=14.17" } }, - "node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.5.tgz", - "integrity": "sha512-Se0z5xMqcSQanJD1IYmO0cGpK3iv0fp3ZsIT7xRJZ1Da5PghvNoc46zz4jIQn+aan3dV9T8AermFNN9QPmsh0Q==", + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", "cpu": [ - "arm64" + "ppc64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ - "android" + "aix" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.5.tgz", - "integrity": "sha512-UPrgTDuUbvmqGMZuCnmI3FKee/tYKzKdp00/kuB4oSGB213VYg8QTdF7lVhnPoBXq/mIfJ+ILoBFqNOboWcMwQ==", + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", "cpu": [ "arm64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.5.tgz", - "integrity": "sha512-E+p7HEtjI0b8D7kbbWxH067cGui6d4c79COGko9fAPVE3rwc1E7ld2HFCbaG86AOGWS5VKQYqZOaf38ya4uxTQ==", + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", "cpu": [ "x64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.5.tgz", - "integrity": "sha512-yWEWcWyAG7rWOcTpJTjdhQ3pcaFY2h+0bqTRfgU3G2fz87ZU3AKdvdZKhslD+kyHnjBUWKvNdRYwIYC5dI1tIg==", + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.5.tgz", - "integrity": "sha512-WmeVjtJhZlr+smpqcdR2kQkkn6arHIJnUIBxTO2EJcTLGY1ecVXNo2hbSn8xc0IH2aEtys936iMWKGyj0GaKnA==", + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", "cpu": [ - "arm" + "x64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "freebsd" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.5.tgz", - "integrity": "sha512-DTCSyucc6ShMp1QMqV5R94Z7xlgNgUzkGmFF1rL5HH2Qjy4eSmEqy+YLGkqqYvWa4sILtgrBt1JjRKbneQtiFQ==", + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", "cpu": [ - "arm64" + "arm" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.5.tgz", - "integrity": "sha512-H9lsvO4x9E4nE4Hi8h7NHHw0O/kcVSu+iOyFHNGdYzazGgDjFHZbE6S3hQ8kMcbNXSBlMdNi67LV5EVqtpaJtw==", + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", "cpu": [ "arm64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.5.tgz", - "integrity": "sha512-4uxQvtBvPuIdl13WfUBj9xMZHH14PtHZ8OZdtLmdyDtG66sCa1t599NZT+jagkUzRtWhuul1qRZQ1nAJscXN5g==", + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", "cpu": [ - "x64" + "loong64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.5.tgz", - "integrity": "sha512-0JQAzs7jwbA7O6+z/adU+Jk3AXwsu3npAhtr5escXS7TqEqWcaDV7qHuI+0Vy/KQRuVGnLQREcSJWYauyV3oqg==", + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", "cpu": [ - "x64" + "mips64el" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-wasm32-wasi": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.5.tgz", - "integrity": "sha512-OJhFmlEfdzMr+avACdi40RPtnkW0B6hXyxL/8r+tnEHBWZji36CYRjEXrrvgBmaYsD3oEOBqwYFRKsYvzFe7Bw==", - "bundleDependencies": [ - "@napi-rs/wasm-runtime", - "@emnapi/core", - "@emnapi/runtime", - "@tybys/wasm-util", - "@emnapi/wasi-threads", - "tslib" + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" ], "dev": true, + "license": "Apache-2.0", "optional": true, - "dependencies": { - "@emnapi/core": "^1.11.3", - "@emnapi/runtime": "^1.11.3", - "@emnapi/wasi-threads": "^1.2.3", - "@napi-rs/wasm-runtime": "^1.2.2", - "@tybys/wasm-util": "^0.10.3", - "tslib": "^2.8.1" - }, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=23.5.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { - "version": "1.11.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.3", - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { - "version": "1.11.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { - "version": "1.2.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { - "version": "1.2.2", + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "inBundle": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.3" - }, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=23.5.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", - "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": { - "version": "2.8.1", - "dev": true, - "inBundle": true, - "license": "0BSD", - "optional": true - }, - "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", - "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", "cpu": [ - "arm64" + "s390x" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ - "win32" + "linux" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", - "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", "cpu": [ "x64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ - "win32" + "linux" ], "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/vite": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.5.tgz", - "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", - "dev": true, - "dependencies": { - "@tailwindcss/node": "4.3.5", - "@tailwindcss/oxide": "4.3.5", - "tailwindcss": "4.3.5" - }, - "peerDependencies": { - "vite": "^5.2.0 || ^6 || ^7 || ^8" - } - }, - "node_modules/@tweenjs/tween.js": { - "version": "25.0.0", - "resolved": "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-25.0.0.tgz", - "integrity": "sha512-XKLA6syeBUaPzx4j3qwMqzzq+V4uo72BnlbOjmuljLrRqdsd3qnzvZZoxvMHZ23ndsRS4aufU6JOZYpCbU6T1A==", - "dev": true - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "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.npmmirror.com/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", - "dev": true, - "dependencies": { - "@babel/types": "^7.28.2" - } - }, - "node_modules/@types/debug": { - "version": "4.1.13", - "resolved": "https://registry.npmmirror.com/@types/debug/-/debug-4.1.13.tgz", - "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", - "dev": true, - "dependencies": { - "@types/ms": "*" + "node": ">=16.20.0" } }, - "node_modules/@types/dom-webcodecs": { - "version": "0.1.19", - "resolved": "https://registry.npmmirror.com/@types/dom-webcodecs/-/dom-webcodecs-0.1.19.tgz", - "integrity": "sha512-+yFUIDUaASFz0vQpWBErPxun/Lb+F0TdrlTsj50gm7K797YzEx2TmV6fEiwciHyFNghlZYPgQXH5qRcwMHcJFQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true - }, - "node_modules/@types/estree-jsx": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", - "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@types/estree": "*" + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@types/node": "*" + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/hast": { - "version": "3.0.5", - "resolved": "https://registry.npmmirror.com/@types/hast/-/hast-3.0.5.tgz", - "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@types/unist": "*" + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmmirror.com/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@types/unist": "*" + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "26.6.3", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-26.6.3.tgz", - "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "undici-types": "~8.9.0" + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/react": { - "version": "19.3.0", - "resolved": "https://registry.npmmirror.com/@types/react/-/react-19.3.0.tgz", - "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", - "devOptional": true, - "dependencies": { - "csstype": "^3.2.2" + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/react-dom": { - "version": "19.3.0", - "resolved": "https://registry.npmmirror.com/@types/react-dom/-/react-dom-19.3.0.tgz", - "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], "dev": true, - "peerDependencies": { - "@types/react": "^19.3.0" + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmmirror.com/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "optional": true - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true - }, - "node_modules/@types/wicg-file-system-access": { - "version": "2020.9.8", - "resolved": "https://registry.npmmirror.com/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.8.tgz", - "integrity": "sha512-ggMz8nOygG7d/stpH40WVaNvBwuyYLnrg5Mbyf6bmsj/8+gb6Ei4ZZ9/4PNpcPNTT8th9Q8sM8wYmWGjMWLX/A==", + "node_modules/@typescript/typescript6": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript6/-/typescript6-6.0.2.tgz", + "integrity": "sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==", "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "dependencies": { + "@typescript/old": "npm:typescript@^6" + }, + "bin": { + "tsc6": "bin/tsc6" + } }, "node_modules/@ungap/structured-clone": { "version": "1.4.0", @@ -4981,1634 +5933,1756 @@ "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", "dev": true }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.15", - "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", - "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", + "node_modules/@vitest/browser": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-5.1.0.tgz", + "integrity": "sha512-2sjGVAC/Rs8Jwv+xxBgklNG2g1LGyNgcFMBw71AcfBstLz25UGv1+fVvvZ+z8IfSuNg3nipERijnFtoEIdRDEA==", "dev": true, - "engines": { - "node": ">=10.0.0" + "license": "MIT", + "dependencies": { + "@blazediff/core": "1.10.0", + "@vitest/mocker": "5.1.0", + "@vitest/ui": "5.1.0", + "@vitest/utils": "5.1.0", + "magic-string": "^1.4.3", + "pngjs": "^7.0.0", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0", + "ws": "^8.22.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" } }, - "node_modules/@zip.js/zip.js": { - "version": "2.22.0", - "resolved": "https://registry.npmmirror.com/@zip.js/zip.js/-/zip.js-2.22.0.tgz", - "integrity": "sha512-QgkA+BSEPNR0C2l6xbSu5HDXieUxiuDK+Jx4ZeZlp22QO/qRUIF6JRXdxh4WlLiQUmnE/9aaGerlni+OY81wqg==", + "node_modules/@vitest/browser-preview": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/browser-preview/-/browser-preview-5.1.0.tgz", + "integrity": "sha512-z9SbodBSMoJtYy5VTCaSP5SSZfNYRlfIlR0P/uH1PAuhUJbstSyOYvxXCYmqG+EemIiZzd3uGUtREX5zbXLR8A==", "dev": true, - "engines": { - "bun": ">=0.7.0", - "deno": ">=1.0.0", - "node": ">=18.0.0" + "license": "MIT", + "dependencies": { + "@testing-library/dom": "^10.4.2", + "@testing-library/user-event": "^14.6.8", + "@vitest/browser": "5.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" } }, - "node_modules/abbrev": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-4.0.0.tgz", - "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", + "node_modules/@vitest/browser/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", "dev": true, - "engines": { - "node": "^20.17.0 || >=22.9.0" + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" } }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "node_modules/@vitest/mocker": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz", + "integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==", "dev": true, - "engines": { - "node": ">= 14" + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.0", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } } }, - "node_modules/ajv": { - "version": "8.20.0", - "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.20.0.tgz", - "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", "dev": true, + "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-5.1.0.tgz", + "integrity": "sha512-IRx5mc30CrFzyMNni6SZKQ1r53kv049Mcvvk0WbWcD6PUz/bFjG4zYv0KosQAeonPpGp5WxqYBMqdSOfJfvVWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.2.0" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://opencollective.com/vitest" } }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@vitest/snapshot": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-5.1.0.tgz", + "integrity": "sha512-6tLM70+37LVXz+A6QmOlMQUuj+taODAyXZhz58lNNNNKHH0D81yzPBEezKQQGPlABc8OpAQBOBVvssVLLQqixw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "5.1.0", + "@vitest/utils": "5.1.0", + "magic-string": "^1.4.3", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/spy": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz", + "integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-5.1.0.tgz", + "integrity": "sha512-00S3x4NRmqIBUiTVWF9/xLaA9EP9KeKv0+1sBO7e2Y4luBISlW+2ttnhlk/zjbTqEvVhJWCCo7MXzu6zNbefqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "5.1.0", + "fflate": "^0.8.3", + "flatted": "^3.4.4", + "pathe": "^2.0.3", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/ui/node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-5.1.0.tgz", + "integrity": "sha512-V+qgCwkvVw+s1t1S5TaoBHsLi5Sz/YmohCMoOu0mZ8ZQst2bKhRYARAQucWpVg8D0mv0x5MHcWXY5QdOsoiGBQ==", "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "5.1.0", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@voidzero-dev/vite-plus-darwin-arm64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-darwin-arm64/-/vite-plus-darwin-arm64-1.7.0.tgz", + "integrity": "sha512-ozIv7lPzEEfGmNOvHiHublwsLHMUkZBTuSq05FuOvS9yw/4TZYiItESFC0Y2NchaotcSn4MeatxegatjgeRevA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=8" + "node": ">=20.0.0" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@voidzero-dev/vite-plus-darwin-x64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-darwin-x64/-/vite-plus-darwin-x64-1.7.0.tgz", + "integrity": "sha512-SYEAvMJN0L4VO3brYqCU7aXExVwfIFnMjDLe9BauHedYwoG83BrezBN1wRviZt+SvZs1rpW9ttAwOHoQm7BoHw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=20.0.0" } }, - "node_modules/app-builder-lib": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/app-builder-lib/-/app-builder-lib-26.15.3.tgz", - "integrity": "sha512-2VnyWkqsP5v5XbBhL3tD5Syx8iNPBYsoU7kY4S2fz7wg8Rj/nztWKCUzGKaFRTv0Xwf3/H058CR1Kvtd/3lRow==", + "node_modules/@voidzero-dev/vite-plus-linux-arm64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-arm64-gnu/-/vite-plus-linux-arm64-gnu-1.7.0.tgz", + "integrity": "sha512-127UdNRXMZ/tQiNVYX+Hsy/RsodAwIJRdSG2reDdraAbxMWBCcdTJ5fyRTHCqjUl1aEuI/TUyuK35D1+0x7mGQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@electron/asar": "3.4.1", - "@electron/fuses": "^1.8.0", - "@electron/get": "^3.0.0", - "@electron/notarize": "2.5.0", - "@electron/osx-sign": "1.3.3", - "@electron/rebuild": "^4.0.4", - "@electron/universal": "2.0.3", - "@malept/flatpak-bundler": "^0.4.0", - "@noble/hashes": "^2.2.0", - "@peculiar/webcrypto": "^1.7.1", - "@types/fs-extra": "9.0.13", - "ajv": "^8.18.0", - "asn1js": "^3.0.10", - "async-exit-hook": "^2.0.1", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chromium-pickle-js": "^0.2.0", - "ci-info": "4.3.1", - "debug": "^4.3.4", - "dotenv": "^16.4.5", - "dotenv-expand": "^11.0.6", - "ejs": "^3.1.8", - "electron-publish": "26.15.3", - "fs-extra": "^10.1.0", - "hosted-git-info": "^4.1.0", - "isbinaryfile": "^5.0.0", - "jiti": "^2.4.2", - "js-yaml": "^4.1.0", - "json5": "^2.2.3", - "lazy-val": "^1.0.5", - "minimatch": "^10.2.5", - "pkijs": "^3.4.0", - "plist": "3.1.0", - "proper-lockfile": "^4.1.2", - "resedit": "^1.7.0", - "semver": "~7.7.3", - "tar": "^7.5.7", - "temp-file": "^3.4.0", - "tiny-async-pool": "1.3.0", - "unzipper": "^0.12.3", - "which": "^5.0.0" - }, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "dmg-builder": "26.15.3", - "electron-builder-squirrel-windows": "26.15.3" + "node": ">=20.0.0" } }, - "node_modules/app-builder-lib/node_modules/ci-info": { - "version": "4.3.1", - "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.3.1.tgz", - "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "node_modules/@voidzero-dev/vite-plus-linux-arm64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-arm64-musl/-/vite-plus-linux-arm64-musl-1.7.0.tgz", + "integrity": "sha512-H1qQM2D49bByh5CNDTo1sJz99sinEGdbqj/7/G/prVhVeCnMQ3xDa7mj8Jr9ObMF1UiARhGznXuWdBd8TBBkwg==", + "cpu": [ + "arm64" + ], "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" ], "engines": { - "node": ">=8" + "node": ">=20.0.0" } }, - "node_modules/app-builder-lib/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "node_modules/@voidzero-dev/vite-plus-linux-x64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-x64-gnu/-/vite-plus-linux-x64-gnu-1.7.0.tgz", + "integrity": "sha512-OWee6VlSZbc0SemrqXzs5b2ukGTFNHg29tEAirqqmEYIBf/yOVSamXUL2L4I3fOMTJuT2dsXGc/Q30Z0xdsNjg==", + "cpu": [ + "x64" + ], "dev": true, - "bin": { - "semver": "bin/semver.js" - }, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" + "node": ">=20.0.0" } }, - "node_modules/argparse": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.3.tgz", - "integrity": "sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==", + "node_modules/@voidzero-dev/vite-plus-linux-x64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-x64-musl/-/vite-plus-linux-x64-musl-1.7.0.tgz", + "integrity": "sha512-htq0rkjaXr755gnq0NKh8JSJuE+sjImzRUZGcMsX35x2X31xrlHurb51du+/VM8YtluvXqatGDHwnQCbcTG16Q==", + "cpu": [ + "x64" + ], "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nodeca" - } + "libc": [ + "musl" ], - "license": "PSF-2.0" + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } }, - "node_modules/aria-hidden": { - "version": "1.2.6", - "resolved": "https://registry.npmmirror.com/aria-hidden/-/aria-hidden-1.2.6.tgz", - "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", + "node_modules/@voidzero-dev/vite-plus-win32-arm64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-win32-arm64-msvc/-/vite-plus-win32-arm64-msvc-1.7.0.tgz", + "integrity": "sha512-CO3txOUEnzlncFFRUIKxqBxoEH1F34sOuGhpfBhZLpwLe/Bvuypcrcky2mlpT5g98H+hw/hQHMZukyIArYm7Cg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "tslib": "^2.0.0" - }, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=10" + "node": ">=20.0.0" } }, - "node_modules/asn1js": { - "version": "3.0.10", - "resolved": "https://registry.npmmirror.com/asn1js/-/asn1js-3.0.10.tgz", - "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==", + "node_modules/@voidzero-dev/vite-plus-win32-x64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-win32-x64-msvc/-/vite-plus-win32-x64-msvc-1.7.0.tgz", + "integrity": "sha512-eA/Lg7eQTLwTiNhGBav9Lik6qiTSv8IPAETIziGgjNjEiTviCcFHNFlUyDOIFTY7uIWraGgMl8THY3zPnikoRg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "pvtsutils": "^1.3.6", - "pvutils": "^1.1.5", - "tslib": "^2.8.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=12.0.0" + "node": ">=20.0.0" } }, - "node_modules/assistant-cloud": { - "version": "0.2.13", - "resolved": "https://registry.npmmirror.com/assistant-cloud/-/assistant-cloud-0.2.13.tgz", - "integrity": "sha512-ptR42dXgQ8lx+9mR21/UDRWoaEZr4RjwBoxlDTQUTX+Jvsz/DOOrSDRHZIyOCgns9WTicMXvNWnGYvFyRQd7Uw==", + "node_modules/@xmldom/xmldom": { + "version": "0.8.15", + "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", + "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", "dev": true, - "dependencies": { - "assistant-stream": "^0.3.58" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/exporter-trace-otlp-http": ">=0.200.0", - "@opentelemetry/sdk-trace-base": "^2.1.0", - "ai": "^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "@opentelemetry/exporter-trace-otlp-http": { - "optional": true - }, - "@opentelemetry/sdk-trace-base": { - "optional": true - }, - "ai": { - "optional": true - } + "engines": { + "node": ">=10.0.0" } }, - "node_modules/assistant-stream": { - "version": "0.3.58", - "resolved": "https://registry.npmmirror.com/assistant-stream/-/assistant-stream-0.3.58.tgz", - "integrity": "sha512-i3g2FPxq2bC45Ac1J4bDuAJOHga1f7LdkJjw0nl0tEAIjENhZSVI/FjdLI0qxL1XPkMeWDT7IIBtJfnIXw8jZA==", + "node_modules/@yuku-core/binding-android-arm64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-android-arm64/-/binding-android-arm64-0.19.0.tgz", + "integrity": "sha512-wdL2XmTiZixAOaHk9Z0JJZ8u9Qm8d333Zjpc6gaxXFX+UR5BlsfxZ7a2+2Rm71pamppsPYGUGFq2oVLbh6DISw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@yuku-core/binding-darwin-arm64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-darwin-arm64/-/binding-darwin-arm64-0.19.0.tgz", + "integrity": "sha512-7sNJa6XJhyetnTy64jw3NEi4YgUcezHk1G5GH9FSvXAuC8wIlbaOwT9lgq5qo5sspjrZJQlBR1TWflP49uRpMw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@yuku-core/binding-darwin-x64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-darwin-x64/-/binding-darwin-x64-0.19.0.tgz", + "integrity": "sha512-pTC7dYEc59isdyizc3nsuyFNBu2LU5wMYZ1be6UMr59PY/AJNtO1aBLWV0MgL/z7C1nv/2sX4TNjGgKLoeevJw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@yuku-core/binding-freebsd-x64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-freebsd-x64/-/binding-freebsd-x64-0.19.0.tgz", + "integrity": "sha512-xrZjF6XOEwyLOiDIfrwDdRCS6ghxcJeirNC1KivQhVcUwlRonaU79S3/Uiyx3lBylPnT8qKJ3/aMT+H52nGTJQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@yuku-core/binding-linux-arm-gnu": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm-gnu/-/binding-linux-arm-gnu-0.19.0.tgz", + "integrity": "sha512-0OyIH53C0I1CbADHn9FSdCfX5qbpeLwJhmOVhonFJNYheybOnkSJ50qGMfTJIb8y5zrwqvLs7FVBvz6Fk8maZg==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@standard-schema/spec": "^1.1.0", - "@types/json-schema": "^7.0.15", - "nanoid": "^6.0.2", - "secure-json-parse": "^4.1.1" - }, - "peerDependencies": { - "ai": "^6.0.0 || ^7.0.0", - "ioredis": "^5.10.1 || ^6.0.0", - "redis": "^5.12.1" - }, - "peerDependenciesMeta": { - "ai": { - "optional": true - }, - "ioredis": { - "optional": true - }, - "redis": { - "optional": true - } - } + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/assistant-stream/node_modules/nanoid": { - "version": "6.0.2", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-6.0.2.tgz", - "integrity": "sha512-hIvVOb9Qr1p/9CNNLOe0OlWvgx/ziTsVwKN/GDSsuArN2K0wDiafP3s0SWmsm7o2BdnyS8Z9Z64NFBUbn6ziBg==", + "node_modules/@yuku-core/binding-linux-arm-musl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm-musl/-/binding-linux-arm-musl-0.19.0.tgz", + "integrity": "sha512-z/iPfkCOCSXE34VXNt0uP1ORSW+4mEa9b5CiJcWZeqZH08g49bFU/jRM2T04f+Wpw5mJ6HIzNBiojxeAbrHjeg==", + "cpu": [ + "arm" + ], "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } + "libc": [ + "musl" ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^22 || ^24 || >=26" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmmirror.com/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true + "node_modules/@yuku-core/binding-linux-arm64-gnu": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.19.0.tgz", + "integrity": "sha512-jLNTi+gzaRwBJ+gwhCJ+rDb5dmx/8hEBx93UWd7hjMSqPTL1D1wvVSvXVAldV5kALvju7b0/m51EHEhs4+I1fA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/async-exit-hook": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/async-exit-hook/-/async-exit-hook-2.0.1.tgz", - "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", + "node_modules/@yuku-core/binding-linux-arm64-musl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.19.0.tgz", + "integrity": "sha512-YwyPIdW/rN2Fmv0MTFWi47FaB3F9g+2b+sJISyAw83Yd60RWH4T3Nx6XkAHHVN+uKJNBAd6So7/BVihSiFYvuQ==", + "cpu": [ + "arm64" + ], "dev": true, - "engines": { - "node": ">=0.12.0" - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "node_modules/@yuku-core/binding-linux-x64-gnu": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.19.0.tgz", + "integrity": "sha512-/vskaAXVX3ESR43FiTdfiYS7z1b9uoQJwVQ/0RgUHgN2sWoAyCZs+aX4CgU7eKGIHTVfp9VFwv+c+2XchYiEtQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "node_modules/@yuku-core/binding-linux-x64-musl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-x64-musl/-/binding-linux-x64-musl-0.19.0.tgz", + "integrity": "sha512-FuXL5igeSKib9Rye02TdH+D6SQezTyGxIATMu1Qsn/QywrzwpGl35OLpS2C1x5vpGLeVE2XgiLd5mVPFHmIglQ==", + "cpu": [ + "x64" + ], "dev": true, - "engines": { - "node": ">= 4.0.0" - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/autolinker": { - "version": "4.1.5", - "resolved": "https://registry.npmmirror.com/autolinker/-/autolinker-4.1.5.tgz", - "integrity": "sha512-vEfYZPmvVOIuE567XBVCsx8SBgOYtjB2+S1iAaJ+HgH+DNjAcrHem2hmAeC9yaNGWayicv4yR+9UaJlkF3pvtw==", + "node_modules/@yuku-core/binding-win32-arm64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-win32-arm64/-/binding-win32-arm64-0.19.0.tgz", + "integrity": "sha512-YuJAe7zEKT1Xa7LuHlhGJpPnYQeVtvo0rZvNjJRqkH0hQGOw4C8QeP30Tg5VKGzZfo2x8CjhjEhKt4TmLwfmdg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "tslib": "^2.8.1" - }, - "engines": { - "pnpm": ">=10.10.0" - } + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmmirror.com/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "dev": true + "node_modules/@yuku-core/binding-win32-x64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-win32-x64/-/binding-win32-x64-0.19.0.tgz", + "integrity": "sha512-o8iY/mXwlRkedp0LNTr4+TEfXTPQwoNZmv6k+1WIAd1ZXEn8xJJTBCtB0osaVvdZo/x/cNmV16UrWrrGpM5Mvw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/bail": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "node_modules/@yuku-toolchain/types": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-toolchain/types/-/types-0.19.0.tgz", + "integrity": "sha512-tFkNbsP4WXX9UMUC5syJGdK9dPMLK0PPaIuXCcCYH75sZ8MrebfBZ2XvCILRTw8AgLivSSCfDa4R67iYBDa4Kg==", "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + "license": "MIT" }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "node_modules/@zip.js/zip.js": { + "version": "2.22.0", + "resolved": "https://registry.npmmirror.com/@zip.js/zip.js/-/zip.js-2.22.0.tgz", + "integrity": "sha512-QgkA+BSEPNR0C2l6xbSu5HDXieUxiuDK+Jx4ZeZlp22QO/qRUIF6JRXdxh4WlLiQUmnE/9aaGerlni+OY81wqg==", "dev": true, "engines": { - "node": "18 || 20 || >=22" + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=18.0.0" } }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "node_modules/abbrev": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-4.0.0.tgz", + "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", "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" - } - ] + "engines": { + "node": "^20.17.0 || >=22.9.0" + } }, - "node_modules/baseline-browser-mapping": { - "version": "2.11.26", - "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.26.tgz", - "integrity": "sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==", + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "dev": true, - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, "engines": { - "node": ">=6.0.0" + "node": ">= 14" } }, - "node_modules/bcp-47": { - "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/bcp-47/-/bcp-47-2.1.2.tgz", - "integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==", + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "dependencies": { - "is-alphabetical": "^2.0.0", - "is-alphanumerical": "^2.0.0", - "is-decimal": "^2.0.0" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/bcp-47-match": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/bcp-47-match/-/bcp-47-match-2.0.3.tgz", - "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/bitmap-sdf": { - "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", - "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", - "dev": true - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "balanced-match": "^4.0.2" - }, "engines": { - "node": "20 || >=22" + "node": ">=8" } }, - "node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "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" - } - ], "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" + "color-convert": "^2.0.1" }, "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/builder-util": { + "node_modules/app-builder-lib": { "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/builder-util/-/builder-util-26.15.3.tgz", - "integrity": "sha512-q2hn7Mbo2nFNkVekPiHFx6Nfo3hURmES3tfBn+k5Pqxl2RkmP3QGqZUhH/q9Pch/4G05NRhPjDlVj1O8q4Txvw==", + "resolved": "https://registry.npmmirror.com/app-builder-lib/-/app-builder-lib-26.15.3.tgz", + "integrity": "sha512-2VnyWkqsP5v5XbBhL3tD5Syx8iNPBYsoU7kY4S2fz7wg8Rj/nztWKCUzGKaFRTv0Xwf3/H058CR1Kvtd/3lRow==", "dev": true, "dependencies": { - "@types/debug": "^4.1.6", + "@electron/asar": "3.4.1", + "@electron/fuses": "^1.8.0", + "@electron/get": "^3.0.0", + "@electron/notarize": "2.5.0", + "@electron/osx-sign": "1.3.3", + "@electron/rebuild": "^4.0.4", + "@electron/universal": "2.0.3", + "@malept/flatpak-bundler": "^0.4.0", + "@noble/hashes": "^2.2.0", + "@peculiar/webcrypto": "^1.7.1", + "@types/fs-extra": "9.0.13", + "ajv": "^8.18.0", + "asn1js": "^3.0.10", + "async-exit-hook": "^2.0.1", + "builder-util": "26.15.3", "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "cross-spawn": "^7.0.6", + "chromium-pickle-js": "^0.2.0", + "ci-info": "4.3.1", "debug": "^4.3.4", + "dotenv": "^16.4.5", + "dotenv-expand": "^11.0.6", + "ejs": "^3.1.8", + "electron-publish": "26.15.3", "fs-extra": "^10.1.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", + "hosted-git-info": "^4.1.0", + "isbinaryfile": "^5.0.0", + "jiti": "^2.4.2", "js-yaml": "^4.1.0", - "sanitize-filename": "^1.6.3", - "source-map-support": "^0.5.19", - "stat-mode": "^1.0.0", + "json5": "^2.2.3", + "lazy-val": "^1.0.5", + "minimatch": "^10.2.5", + "pkijs": "^3.4.0", + "plist": "3.1.0", + "proper-lockfile": "^4.1.2", + "resedit": "^1.7.0", + "semver": "~7.7.3", + "tar": "^7.5.7", "temp-file": "^3.4.0", - "tiny-async-pool": "1.3.0" + "tiny-async-pool": "1.3.0", + "unzipper": "^0.12.3", + "which": "^5.0.0" }, "engines": { "node": ">=14.0.0" - } - }, - "node_modules/builder-util-runtime": { - "version": "9.7.0", - "resolved": "https://registry.npmmirror.com/builder-util-runtime/-/builder-util-runtime-9.7.0.tgz", - "integrity": "sha512-g/kR520giAFYkSXTzcmF3kqQq7wi8F6N6SzeDgZrqTBN+VHdmgWOyTdD1yD7AATDId/yXLvuP34CxW46/BwCdw==", - "dev": true, - "dependencies": { - "debug": "^4.3.4", - "sax": "^1.2.4" }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/bytestreamjs": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/bytestreamjs/-/bytestreamjs-2.0.1.tgz", - "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", - "dev": true, - "engines": { - "node": ">=6.0.0" + "peerDependencies": { + "dmg-builder": "26.15.3", + "electron-builder-squirrel-windows": "26.15.3" } }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmmirror.com/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "node_modules/app-builder-lib/node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], "engines": { "node": ">=8" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "node_modules/app-builder-lib/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">= 0.4" + "node": ">=10" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001814", - "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001814.tgz", - "integrity": "sha512-/Uaf1lAzr59XcMpW0o96WoEfr+VXK2OX4U9AgFoiSHsVJ4HppnIFUjtYzsyDH2+tgANaQb2/oxYGwCPapN1FpA==", + "node_modules/argparse": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.3.tgz", + "integrity": "sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==", "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/puzrin" }, { "type": "github", - "url": "https://github.com/sponsors/ai" + "url": "https://github.com/sponsors/nodeca" } - ] - }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/cesium": { - "version": "1.145.0", - "resolved": "https://registry.npmmirror.com/cesium/-/cesium-1.145.0.tgz", - "integrity": "sha512-6Azix8b5LPpoVSx8XQ6zPztpluJVmq+CEO3W2rOWxtc6bri6Nc9MvCYhKmTW1LAEwfisV7yzNgfulCXw9842+g==", - "dev": true, - "workspaces": [ - "packages/engine", - "packages/widgets", - "packages/sandcastle" ], - "dependencies": { - "@cesium/engine": "^26.3.0", - "@cesium/widgets": "^16.2.0", - "protobufjs": "^8.8.0" - }, - "engines": { - "node": ">=22.0.0" - } + "license": "PSF-2.0" }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/aria-hidden": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/aria-hidden/-/aria-hidden-1.2.6.tgz", + "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "tslib": "^2.0.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/character-entities": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-html4": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz", - "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", - "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/character-reference-invalid": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", - "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" } }, - "node_modules/chownr": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/chownr/-/chownr-3.0.0.tgz", - "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "node_modules/asn1js": { + "version": "3.0.10", + "resolved": "https://registry.npmmirror.com/asn1js/-/asn1js-3.0.10.tgz", + "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==", "dev": true, + "dependencies": { + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.5", + "tslib": "^2.8.1" + }, "engines": { - "node": ">=18" + "node": ">=12.0.0" } }, - "node_modules/chromium-pickle-js": { - "version": "0.2.0", - "resolved": "https://registry.npmmirror.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", - "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", - "dev": true - }, - "node_modules/ci-info": { - "version": "4.4.0", - "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.4.0.tgz", - "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/class-variance-authority": { - "version": "0.7.1", - "resolved": "https://registry.npmmirror.com/class-variance-authority/-/class-variance-authority-0.7.1.tgz", - "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", + "node_modules/assistant-cloud": { + "version": "0.2.13", + "resolved": "https://registry.npmmirror.com/assistant-cloud/-/assistant-cloud-0.2.13.tgz", + "integrity": "sha512-ptR42dXgQ8lx+9mR21/UDRWoaEZr4RjwBoxlDTQUTX+Jvsz/DOOrSDRHZIyOCgns9WTicMXvNWnGYvFyRQd7Uw==", "dev": true, "dependencies": { - "clsx": "^2.1.1" + "assistant-stream": "^0.3.58" }, - "funding": { - "url": "https://polar.sh/cva" + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/exporter-trace-otlp-http": ">=0.200.0", + "@opentelemetry/sdk-trace-base": "^2.1.0", + "ai": "^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@opentelemetry/exporter-trace-otlp-http": { + "optional": true + }, + "@opentelemetry/sdk-trace-base": { + "optional": true + }, + "ai": { + "optional": true + } } }, - "node_modules/classnames": { - "version": "2.5.1", - "resolved": "https://registry.npmmirror.com/classnames/-/classnames-2.5.1.tgz", - "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", - "dev": true - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/assistant-stream": { + "version": "0.3.58", + "resolved": "https://registry.npmmirror.com/assistant-stream/-/assistant-stream-0.3.58.tgz", + "integrity": "sha512-i3g2FPxq2bC45Ac1J4bDuAJOHga1f7LdkJjw0nl0tEAIjENhZSVI/FjdLI0qxL1XPkMeWDT7IIBtJfnIXw8jZA==", "dev": true, "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "@standard-schema/spec": "^1.1.0", + "@types/json-schema": "^7.0.15", + "nanoid": "^6.0.2", + "secure-json-parse": "^4.1.1" }, - "engines": { - "node": ">=12" + "peerDependencies": { + "ai": "^6.0.0 || ^7.0.0", + "ioredis": "^5.10.1 || ^6.0.0", + "redis": "^5.12.1" + }, + "peerDependenciesMeta": { + "ai": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "redis": { + "optional": true + } } }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "node_modules/assistant-stream/node_modules/nanoid": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-6.0.2.tgz", + "integrity": "sha512-hIvVOb9Qr1p/9CNNLOe0OlWvgx/ziTsVwKN/GDSsuArN2K0wDiafP3s0SWmsm7o2BdnyS8Z9Z64NFBUbn6ziBg==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.js" + }, "engines": { - "node": ">=6" + "node": "^22 || ^24 || >=26" } }, - "node_modules/color-convert": { + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmmirror.com/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, + "node_modules/async-exit-hook": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "resolved": "https://registry.npmmirror.com/async-exit-hook/-/async-exit-hook-2.0.1.tgz", + "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=0.12.0" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/autolinker": { + "version": "4.1.5", + "resolved": "https://registry.npmmirror.com/autolinker/-/autolinker-4.1.5.tgz", + "integrity": "sha512-vEfYZPmvVOIuE567XBVCsx8SBgOYtjB2+S1iAaJ+HgH+DNjAcrHem2hmAeC9yaNGWayicv4yR+9UaJlkF3pvtw==", "dev": true, "dependencies": { - "delayed-stream": "~1.0.0" + "tslib": "^2.8.1" }, "engines": { - "node": ">= 0.8" + "pnpm": ">=10.10.0" } }, - "node_modules/comma-separated-tokens": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", - "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmmirror.com/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", "dev": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/compare-version": { - "version": "0.1.2", - "resolved": "https://registry.npmmirror.com/compare-version/-/compare-version-0.1.2.tgz", - "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": "18 || 20 || >=22" } }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "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" + } + ] }, - "node_modules/core-js": { - "version": "3.50.0", - "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.50.0.tgz", - "integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==", - "hasInstallScript": true, - "engines": { - "node": "*" + "node_modules/baseline-browser-mapping": { + "version": "2.11.26", + "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.26.tgz", + "integrity": "sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==", + "dev": true, + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/cross-dirname": { - "version": "0.1.0", - "resolved": "https://registry.npmmirror.com/cross-dirname/-/cross-dirname-0.1.0.tgz", - "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "node_modules/bcp-47": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/bcp-47/-/bcp-47-2.1.2.tgz", + "integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/cross-spawn/node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bitmap-sdf": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", + "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", "dev": true }, - "node_modules/cross-spawn/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "balanced-match": "^4.0.2" }, "engines": { - "node": ">= 8" + "node": "20 || >=22" } }, - "node_modules/csstype": { - "version": "3.2.3", - "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "devOptional": true - }, - "node_modules/data-urls": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-8.0.0.tgz", - "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", + "node_modules/browserslist": { + "version": "4.29.3", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "whatwg-mimetype": "^5.0.0", - "whatwg-url": "^17.1.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" }, "engines": { - "node": "^22.14.0 || >=24.0.0" + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/dayjs": { - "version": "1.11.23", - "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.23.tgz", - "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==", + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/builder-util": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/builder-util/-/builder-util-26.15.3.tgz", + "integrity": "sha512-q2hn7Mbo2nFNkVekPiHFx6Nfo3hURmES3tfBn+k5Pqxl2RkmP3QGqZUhH/q9Pch/4G05NRhPjDlVj1O8q4Txvw==", "dev": true, "dependencies": { - "ms": "^2.1.3" + "@types/debug": "^4.1.6", + "builder-util-runtime": "9.7.0", + "chalk": "^4.1.2", + "cross-spawn": "^7.0.6", + "debug": "^4.3.4", + "fs-extra": "^10.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "js-yaml": "^4.1.0", + "sanitize-filename": "^1.6.3", + "source-map-support": "^0.5.19", + "stat-mode": "^1.0.0", + "temp-file": "^3.4.0", + "tiny-async-pool": "1.3.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=14.0.0" } }, - "node_modules/decimal.js": { - "version": "10.6.0", - "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz", - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "dev": true - }, - "node_modules/decode-named-character-reference": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", - "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "node_modules/builder-util-runtime": { + "version": "9.7.0", + "resolved": "https://registry.npmmirror.com/builder-util-runtime/-/builder-util-runtime-9.7.0.tgz", + "integrity": "sha512-g/kR520giAFYkSXTzcmF3kqQq7wi8F6N6SzeDgZrqTBN+VHdmgWOyTdD1yD7AATDId/yXLvuP34CxW46/BwCdw==", "dev": true, "dependencies": { - "character-entities": "^2.0.0" + "debug": "^4.3.4", + "sax": "^1.2.4" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "engines": { + "node": ">=12.0.0" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "node_modules/bytestreamjs": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/bytestreamjs/-/bytestreamjs-2.0.1.tgz", + "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", "dev": true, "engines": { - "node": ">=0.4.0" + "node": ">=6.0.0" } }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "node_modules/cac": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/cac/-/cac-7.1.1.tgz", + "integrity": "sha512-8zc+h51HxpodKsA7L4PpBNd+9qlrfuUcyUDE5a793BJfN4NZgwk7v9NmrY3ptZ+Sk0+ToigxSzkb47AsEgyizw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=20.19.0" } }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/detect-node-es": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", - "dev": true + "node_modules/caniuse-lite": { + "version": "1.0.30001814", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001814.tgz", + "integrity": "sha512-/Uaf1lAzr59XcMpW0o96WoEfr+VXK2OX4U9AgFoiSHsVJ4HppnIFUjtYzsyDH2+tgANaQb2/oxYGwCPapN1FpA==", + "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" + } + ] }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "dev": true, - "dependencies": { - "dequal": "^2.0.0" - }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/dir-compare": { - "version": "4.2.0", - "resolved": "https://registry.npmmirror.com/dir-compare/-/dir-compare-4.2.0.tgz", - "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", - "dev": true, - "dependencies": { - "minimatch": "^3.0.5", - "p-limit": "^3.1.0 " - } - }, - "node_modules/dmg-builder": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/dmg-builder/-/dmg-builder-26.15.3.tgz", - "integrity": "sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==", + "node_modules/cesium": { + "version": "1.145.0", + "resolved": "https://registry.npmmirror.com/cesium/-/cesium-1.145.0.tgz", + "integrity": "sha512-6Azix8b5LPpoVSx8XQ6zPztpluJVmq+CEO3W2rOWxtc6bri6Nc9MvCYhKmTW1LAEwfisV7yzNgfulCXw9842+g==", "dev": true, - "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "fs-extra": "^10.1.0", - "js-yaml": "^4.1.0" - } - }, - "node_modules/dompurify": { - "version": "3.4.17", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", - "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", - "license": "(MPL-2.0 OR Apache-2.0)", - "optionalDependencies": { - "@types/trusted-types": "^2.0.7" + "workspaces": [ + "packages/engine", + "packages/widgets", + "packages/sandcastle" + ], + "dependencies": { + "@cesium/engine": "^26.3.0", + "@cesium/widgets": "^16.2.0", + "protobufjs": "^8.8.0" + }, + "engines": { + "node": ">=22.0.0" } }, - "node_modules/dotenv": { - "version": "16.6.1", - "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.6.1.tgz", - "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" + "node": ">=18" } }, - "node_modules/dotenv-expand": { - "version": "11.0.7", - "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-11.0.7.tgz", - "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "dotenv": "^16.4.5" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "url": "https://dotenvx.com" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/draco3d": { - "version": "1.5.7", - "resolved": "https://registry.npmmirror.com/draco3d/-/draco3d-1.5.7.tgz", - "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==", - "dev": true + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", "dev": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmmirror.com/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/earcut": { - "version": "3.0.2", - "resolved": "https://registry.npmmirror.com/earcut/-/earcut-3.0.2.tgz", - "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", - "dev": true + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, - "node_modules/echarts": { - "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/echarts/-/echarts-6.1.0.tgz", - "integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==", + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", "dev": true, - "dependencies": { - "tslib": "2.3.0", - "zrender": "6.1.0" + "engines": { + "node": ">=18" } }, - "node_modules/echarts/node_modules/tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "node_modules/chromium-pickle-js": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", + "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", "dev": true }, - "node_modules/ejs": { - "version": "3.1.10", - "resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz", - "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "node_modules/ci-info": { + "version": "4.4.0", + "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/electron": { - "version": "44.9.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-44.9.1.tgz", - "integrity": "sha512-x/tECFFDa2OFNjMObFH0EGKWrCnFZPOR1wP2iMIVt0STecGl8FmDXdaiaryY0kf8mtw9kSLP2yK8dfdaWkfDmw==", + "node_modules/class-variance-authority": { + "version": "0.7.1", + "resolved": "https://registry.npmmirror.com/class-variance-authority/-/class-variance-authority-0.7.1.tgz", + "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", "dev": true, - "license": "MIT", "dependencies": { - "@electron-internal/extract-zip": "^1.0.1", - "@electron/get": "^5.0.0", - "@types/node": "^24.9.0" - }, - "bin": { - "electron": "cli.js", - "install-electron": "install.js" + "clsx": "^2.1.1" }, - "engines": { - "node": ">= 22.12.0" + "funding": { + "url": "https://polar.sh/cva" } }, - "node_modules/electron-builder": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/electron-builder/-/electron-builder-26.15.3.tgz", - "integrity": "sha512-a1KM5heqS3gQCZzizXEI8RjJy3QVogULPdeSknt76uLDpBIW/HDGsMg/XgP0riP6PI9COsRvFITKKGDqA8fJxA==", + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmmirror.com/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "ci-info": "^4.2.0", - "dmg-builder": "26.15.3", - "fs-extra": "^10.1.0", - "lazy-val": "^1.0.5", - "simple-update-notifier": "2.0.0", - "yargs": "^17.6.2" - }, - "bin": { - "electron-builder": "cli.js", - "install-app-deps": "install-app-deps.js" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/electron-builder-squirrel-windows": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.15.3.tgz", - "integrity": "sha512-Jc19XPV9y9+2bAdZPkXuVNGNIEFBq9poHC61l8Kv6FdK7DRG3+Ic0rerC0DXOaeHNz8yW0fg/JnF8GQROOF5MA==", - "dev": true, - "peer": true, - "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "electron-winstaller": "5.4.0" + "node": ">=12" } }, - "node_modules/electron-publish": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/electron-publish/-/electron-publish-26.15.3.tgz", - "integrity": "sha512-g/2bn8YTavY4cuS5F+jOS7zmZbXXBV8KZ8yHKfJjFPoKtzBqrpCdNPxBd3tqdBwP7BVd0lGzf7Bk2s0KesWZ4Q==", + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "dev": true, - "dependencies": { - "@types/fs-extra": "^9.0.11", - "aws4": "^1.13.2", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "form-data": "^4.0.5", - "fs-extra": "^10.1.0", - "lazy-val": "^1.0.5", - "mime": "^2.5.2" + "engines": { + "node": ">=6" } }, - "node_modules/electron-to-chromium": { - "version": "1.5.443", - "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.443.tgz", - "integrity": "sha512-TDJG36L9A3CWWwZ97HKaE+Iz1sW80pNp6sAU0owzCIV3Zc9eVyRqZK8Vz6NKuMIU8WjP0pIkoqCa0VRf/yFD0Q==", - "dev": true - }, - "node_modules/electron-vite": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/electron-vite/-/electron-vite-5.0.0.tgz", - "integrity": "sha512-OHp/vjdlubNlhNkPkL/+3JD34ii5ov7M0GpuXEVdQeqdQ3ulvVR7Dg/rNBLfS5XPIFwgoBLDf9sjjrL+CuDyRQ==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@babel/core": "^7.28.4", - "@babel/plugin-transform-arrow-functions": "^7.27.1", - "cac": "^6.7.14", - "esbuild": "^0.25.11", - "magic-string": "^0.30.19", - "picocolors": "^1.1.1" - }, - "bin": { - "electron-vite": "bin/electron-vite.js" + "color-name": "~1.1.4" }, "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "peerDependencies": { - "@swc/core": "^1.0.0", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - } + "node": ">=7.0.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "optional": true, - "os": [ - "aix" - ], + "dependencies": { + "delayed-stream": "~1.0.0" + }, "engines": { - "node": ">=18" + "node": ">= 0.8" } }, - "node_modules/electron-vite/node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-vite/node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true, + "license": "ISC" + }, + "node_modules/compare-version": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/compare-version/-/compare-version-0.1.2.tgz", + "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", "dev": true, - "optional": true, - "os": [ - "android" - ], "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/core-js": { + "version": "3.50.0", + "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.50.0.tgz", + "integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==", + "hasInstallScript": true, "engines": { - "node": ">=18" + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" } }, - "node_modules/electron-vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cross-dirname": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/cross-dirname/-/cross-dirname-0.1.0.tgz", + "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==", "dev": true, "optional": true, - "os": [ - "darwin" - ], + "peer": true + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, "engines": { - "node": ">=18" + "node": ">= 8" } }, - "node_modules/electron-vite/node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, "engines": { - "node": ">=18" + "node": ">= 8" } }, - "node_modules/electron-vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "devOptional": true + }, + "node_modules/data-urls": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-8.0.0.tgz", + "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^17.1.2" + }, "engines": { - "node": ">=18" + "node": "^22.14.0 || >=24.0.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], + "node_modules/dayjs": { + "version": "1.11.23", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.23.tgz", + "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==", + "dev": true + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "ms": "^2.1.3" + }, "engines": { - "node": ">=18" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true + }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=0.4.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=6" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=8" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "dev": true + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], + "node_modules/dir-compare": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/dir-compare/-/dir-compare-4.2.0.tgz", + "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "minimatch": "^3.0.5", + "p-limit": "^3.1.0 " } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], + "node_modules/dmg-builder": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/dmg-builder/-/dmg-builder-26.15.3.tgz", + "integrity": "sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "fs-extra": "^10.1.0", + "js-yaml": "^4.1.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "license": "MIT" + }, + "node_modules/dompurify": { + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", + "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/electron-vite/node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], + "node_modules/dotenv-expand": { + "version": "11.0.7", + "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-11.0.7.tgz", + "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "dotenv": "^16.4.5" + }, "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/electron-vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], + "node_modules/draco3d": { + "version": "1.5.7", + "resolved": "https://registry.npmmirror.com/draco3d/-/draco3d-1.5.7.tgz", + "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==", + "dev": true + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, "engines": { - "node": ">=18" + "node": ">= 0.4" } }, - "node_modules/electron-vite/node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "readable-stream": "^2.0.2" } }, - "node_modules/electron-vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], + "node_modules/earcut": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", + "dev": true + }, + "node_modules/echarts": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-6.1.0.tgz", + "integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "tslib": "2.3.0", + "zrender": "6.1.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], + "node_modules/echarts/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "dev": true + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, - "optional": true, - "os": [ - "openharmony" - ], + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], + "node_modules/electron": { + "version": "44.9.1", + "resolved": "https://registry.npmjs.org/electron/-/electron-44.9.1.tgz", + "integrity": "sha512-x/tECFFDa2OFNjMObFH0EGKWrCnFZPOR1wP2iMIVt0STecGl8FmDXdaiaryY0kf8mtw9kSLP2yK8dfdaWkfDmw==", "dev": true, - "optional": true, - "os": [ - "sunos" - ], + "license": "MIT", + "dependencies": { + "@electron-internal/extract-zip": "^1.0.1", + "@electron/get": "^5.0.0", + "@types/node": "^24.9.0" + }, + "bin": { + "electron": "cli.js", + "install-electron": "install.js" + }, "engines": { - "node": ">=18" + "node": ">= 22.12.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], + "node_modules/electron-builder": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/electron-builder/-/electron-builder-26.15.3.tgz", + "integrity": "sha512-a1KM5heqS3gQCZzizXEI8RjJy3QVogULPdeSknt76uLDpBIW/HDGsMg/XgP0riP6PI9COsRvFITKKGDqA8fJxA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "dmg-builder": "26.15.3", + "fs-extra": "^10.1.0", + "lazy-val": "^1.0.5", + "simple-update-notifier": "2.0.0", + "yargs": "^17.6.2" + }, + "bin": { + "electron-builder": "cli.js", + "install-app-deps": "install-app-deps.js" + }, "engines": { - "node": ">=18" + "node": ">=14.0.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], + "node_modules/electron-builder-squirrel-windows": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.15.3.tgz", + "integrity": "sha512-Jc19XPV9y9+2bAdZPkXuVNGNIEFBq9poHC61l8Kv6FdK7DRG3+Ic0rerC0DXOaeHNz8yW0fg/JnF8GQROOF5MA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "peer": true, + "dependencies": { + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "electron-winstaller": "5.4.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", - "cpu": [ - "x64" - ], + "node_modules/electron-publish": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/electron-publish/-/electron-publish-26.15.3.tgz", + "integrity": "sha512-g/2bn8YTavY4cuS5F+jOS7zmZbXXBV8KZ8yHKfJjFPoKtzBqrpCdNPxBd3tqdBwP7BVd0lGzf7Bk2s0KesWZ4Q==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@types/fs-extra": "^9.0.11", + "aws4": "^1.13.2", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", + "chalk": "^4.1.2", + "form-data": "^4.0.5", + "fs-extra": "^10.1.0", + "lazy-val": "^1.0.5", + "mime": "^2.5.2" } }, - "node_modules/electron-vite/node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "node_modules/electron-to-chromium": { + "version": "1.5.443", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.443.tgz", + "integrity": "sha512-TDJG36L9A3CWWwZ97HKaE+Iz1sW80pNp6sAU0owzCIV3Zc9eVyRqZK8Vz6NKuMIU8WjP0pIkoqCa0VRf/yFD0Q==", + "dev": true + }, + "node_modules/electron-vite": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/electron-vite/-/electron-vite-6.0.0.tgz", + "integrity": "sha512-zafg2uizgll7jdx0BNDkkzO/SowsUBsiHqYN3v9Ieq7XPDHreRGZ4G9IRY/+RslgBktpLOjLM4jlP+IVpV0BGw==", "dev": true, - "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.29.7", + "@babel/plugin-transform-arrow-functions": "^7.29.7", + "cac": "^7.0.0", + "magic-string": "^1.4.2", + "picocolors": "^1.1.1", + "rolldown": "~1.2.10" + }, "bin": { - "esbuild": "bin/esbuild" + "electron-vite": "bin/electron-vite.js" }, "engines": { - "node": ">=18" + "node": "^20.19.0 || >=22.12.0" }, - "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" + "peerDependencies": { + "@swc/core": "^1.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + } + } + }, + "node_modules/electron-vite/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" } }, "node_modules/electron-winstaller": { @@ -6737,6 +7811,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -6764,47 +7845,6 @@ "node": ">= 0.4" } }, - "node_modules/esbuild": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.28.2.tgz", - "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.2", - "@esbuild/android-arm": "0.28.2", - "@esbuild/android-arm64": "0.28.2", - "@esbuild/android-x64": "0.28.2", - "@esbuild/darwin-arm64": "0.28.2", - "@esbuild/darwin-x64": "0.28.2", - "@esbuild/freebsd-arm64": "0.28.2", - "@esbuild/freebsd-x64": "0.28.2", - "@esbuild/linux-arm": "0.28.2", - "@esbuild/linux-arm64": "0.28.2", - "@esbuild/linux-ia32": "0.28.2", - "@esbuild/linux-loong64": "0.28.2", - "@esbuild/linux-mips64el": "0.28.2", - "@esbuild/linux-ppc64": "0.28.2", - "@esbuild/linux-riscv64": "0.28.2", - "@esbuild/linux-s390x": "0.28.2", - "@esbuild/linux-x64": "0.28.2", - "@esbuild/netbsd-arm64": "0.28.2", - "@esbuild/netbsd-x64": "0.28.2", - "@esbuild/openbsd-arm64": "0.28.2", - "@esbuild/openbsd-x64": "0.28.2", - "@esbuild/openharmony-arm64": "0.28.2", - "@esbuild/sunos-x64": "0.28.2", - "@esbuild/win32-arm64": "0.28.2", - "@esbuild/win32-ia32": "0.28.2", - "@esbuild/win32-x64": "0.28.2" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz", @@ -6836,6 +7876,26 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/exponential-backoff": { "version": "3.1.3", "resolved": "https://registry.npmmirror.com/exponential-backoff/-/exponential-backoff-3.1.3.tgz", @@ -6903,6 +7963,48 @@ "minimatch": "^5.0.1" } }, + "node_modules/find-cache-dir": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-6.0.0.tgz", + "integrity": "sha512-nZMBQ0IuwcMgW8jsiShHtj2WQS6ReVTOMGiSnriCdWBUN/eVsolBlE0EPXe2R5MfIWtqkpM4grjGuqimbWhUFA==", + "deprecated": "Renamed to `find-cache-directory`.", + "dev": true, + "license": "MIT", + "dependencies": { + "common-path-prefix": "^3.0.0", + "pkg-dir": "^7.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, "node_modules/form-data": { "version": "4.0.6", "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.6.tgz", @@ -7019,6 +8121,27 @@ "node": ">=6" } }, + "node_modules/get-oxlint-rules": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/get-oxlint-rules/-/get-oxlint-rules-0.3.1.tgz", + "integrity": "sha512-dASXJ9xgkjEs0O/U7fmNcfJd6BUHD1rNJomFARTc/lhkqO0QnQRNuJWU5kNh2CEq9Nw8NPJnRy2yqaParVXLew==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-cache-dir": "6.0.0", + "tinyexec": "1.3.1" + } + }, + "node_modules/get-oxlint-rules/node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz", @@ -7053,6 +8176,13 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-distribute": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/glob-distribute/-/glob-distribute-0.1.0.tgz", + "integrity": "sha512-Z+EYFkNVV8e7BeciaFg5j6PyzyOsTQscXOH1SKmtGavMaRWjmW4U9n6+cN08VlRgyolYM1SD0gUsWL/pkQgJ+Q==", + "dev": true, + "license": "MIT" + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", @@ -7853,6 +8983,22 @@ "uc.micro": "^3.0.0" } }, + "node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash": { "version": "4.18.1", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.18.1.tgz", @@ -7899,6 +9045,16 @@ } } }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", @@ -8948,6 +10104,16 @@ "@types/wicg-file-system-access": "^2020.9.5" } }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", @@ -8955,9 +10121,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.19", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.19.tgz", - "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -8965,6 +10131,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -9096,6 +10263,20 @@ "integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==", "dev": true }, + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", @@ -9141,6 +10322,134 @@ "@oxc-parser/binding-win32-x64-msvc": "0.143.0" } }, + "node_modules/oxfmt": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.79.0.tgz", + "integrity": "sha512-92iLHGxAgtYk6jLp/1ZBnEeABveNduHZgMDQj7tyqO9iafuJG3q+YHJq0R5Aa4YT+E6xswMQXdmPZYMwynS8ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinypool": "2.2.0" + }, + "bin": { + "oxfmt": "bin/oxfmt" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxfmt/binding-android-arm-eabi": "0.79.0", + "@oxfmt/binding-android-arm64": "0.79.0", + "@oxfmt/binding-darwin-arm64": "0.79.0", + "@oxfmt/binding-darwin-x64": "0.79.0", + "@oxfmt/binding-freebsd-x64": "0.79.0", + "@oxfmt/binding-linux-arm-gnueabihf": "0.79.0", + "@oxfmt/binding-linux-arm-musleabihf": "0.79.0", + "@oxfmt/binding-linux-arm64-gnu": "0.79.0", + "@oxfmt/binding-linux-arm64-musl": "0.79.0", + "@oxfmt/binding-linux-ppc64-gnu": "0.79.0", + "@oxfmt/binding-linux-riscv64-gnu": "0.79.0", + "@oxfmt/binding-linux-riscv64-musl": "0.79.0", + "@oxfmt/binding-linux-s390x-gnu": "0.79.0", + "@oxfmt/binding-linux-x64-gnu": "0.79.0", + "@oxfmt/binding-linux-x64-musl": "0.79.0", + "@oxfmt/binding-openharmony-arm64": "0.79.0", + "@oxfmt/binding-win32-arm64-msvc": "0.79.0", + "@oxfmt/binding-win32-ia32-msvc": "0.79.0", + "@oxfmt/binding-win32-x64-msvc": "0.79.0" + }, + "peerDependencies": { + "@astrojs/compiler-rs": "^0.5.0", + "svelte": "^5.0.0", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "@astrojs/compiler-rs": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxlint": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.94.0.tgz", + "integrity": "sha512-Fnt+3wSKRhtLmvgRfxgRX0excSPCoyiXRol4eWKZLtXxWMQtwQ3KjKQUYXOw5loyinfnZfGzh4RCYf7opfL0vw==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.94.0", + "@oxlint/binding-android-arm64": "1.94.0", + "@oxlint/binding-darwin-arm64": "1.94.0", + "@oxlint/binding-darwin-x64": "1.94.0", + "@oxlint/binding-freebsd-x64": "1.94.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.94.0", + "@oxlint/binding-linux-arm-musleabihf": "1.94.0", + "@oxlint/binding-linux-arm64-gnu": "1.94.0", + "@oxlint/binding-linux-arm64-musl": "1.94.0", + "@oxlint/binding-linux-ppc64-gnu": "1.94.0", + "@oxlint/binding-linux-riscv64-gnu": "1.94.0", + "@oxlint/binding-linux-riscv64-musl": "1.94.0", + "@oxlint/binding-linux-s390x-gnu": "1.94.0", + "@oxlint/binding-linux-x64-gnu": "1.94.0", + "@oxlint/binding-linux-x64-musl": "1.94.0", + "@oxlint/binding-openharmony-arm64": "1.94.0", + "@oxlint/binding-win32-arm64-msvc": "1.94.0", + "@oxlint/binding-win32-ia32-msvc": "1.94.0", + "@oxlint/binding-win32-x64-msvc": "1.94.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=7.0.2007", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxlint-flat-config": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/oxlint-flat-config/-/oxlint-flat-config-0.4.0.tgz", + "integrity": "sha512-Ts6BG501Nx5VpjKOHhRYRpRMlBMaZwD462cY7ha3gP2ri4BRmTAO/0epDeQ8CYwQADAQXp4nyqj/1rZerpCNKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-oxlint-rules": "^0.3.1", + "glob-distribute": "^0.1.0" + }, + "peerDependencies": { + "oxlint": ">=1.85.0", + "vite-plus": ">=1.0.0" + }, + "peerDependenciesMeta": { + "oxlint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-3.1.0.tgz", @@ -9156,6 +10465,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/yocto-queue": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pako": { "version": "3.0.2", "resolved": "https://registry.npmmirror.com/pako/-/pako-3.0.2.tgz", @@ -9233,6 +10587,16 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -9276,6 +10640,13 @@ "node": "20 || >=22" } }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/pe-library": { "version": "0.4.1", "resolved": "https://registry.npmmirror.com/pe-library/-/pe-library-0.4.1.tgz", @@ -9308,6 +10679,22 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^6.3.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pkijs": { "version": "3.4.1", "resolved": "https://registry.npmmirror.com/pkijs/-/pkijs-3.4.1.tgz", @@ -9354,10 +10741,20 @@ "node": ">=10.4.0" } }, + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.19.0" + } + }, "node_modules/postcss": { - "version": "8.5.28", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.28.tgz", - "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", "dev": true, "funding": [ { @@ -9373,10 +10770,11 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "nanoid": "^3.3.18", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -9486,6 +10884,34 @@ } } }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/proc-log": { "version": "6.1.0", "resolved": "https://registry.npmmirror.com/proc-log/-/proc-log-6.1.0.tgz", @@ -9711,6 +11137,13 @@ "react": "^19.3.1" } }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT" + }, "node_modules/react-markdown": { "version": "10.1.0", "resolved": "https://registry.npmmirror.com/react-markdown/-/react-markdown-10.1.0.tgz", @@ -9990,49 +11423,49 @@ "rimraf": "bin.js" } }, - "node_modules/rollup": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.63.6.tgz", - "integrity": "sha512-w4+GKyTBqshj84F1GF3s2zxAPFZPEmNkCbQtqilsYS7GsksmX6VoV7UggfZg8sUHCCOkBe7UtQp6fZwbH311FQ==", + "node_modules/rolldown": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz", + "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.9" + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { - "rollup": "dist/bin/rollup" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.63.6", - "@rollup/rollup-android-arm64": "4.63.6", - "@rollup/rollup-darwin-arm64": "4.63.6", - "@rollup/rollup-darwin-x64": "4.63.6", - "@rollup/rollup-freebsd-arm64": "4.63.6", - "@rollup/rollup-freebsd-x64": "4.63.6", - "@rollup/rollup-linux-arm-gnueabihf": "4.63.6", - "@rollup/rollup-linux-arm-musleabihf": "4.63.6", - "@rollup/rollup-linux-arm64-gnu": "4.63.6", - "@rollup/rollup-linux-arm64-musl": "4.63.6", - "@rollup/rollup-linux-loong64-gnu": "4.63.6", - "@rollup/rollup-linux-loong64-musl": "4.63.6", - "@rollup/rollup-linux-ppc64-gnu": "4.63.6", - "@rollup/rollup-linux-ppc64-musl": "4.63.6", - "@rollup/rollup-linux-riscv64-gnu": "4.63.6", - "@rollup/rollup-linux-riscv64-musl": "4.63.6", - "@rollup/rollup-linux-s390x-gnu": "4.63.6", - "@rollup/rollup-linux-x64-gnu": "4.63.6", - "@rollup/rollup-linux-x64-musl": "4.63.6", - "@rollup/rollup-openbsd-x64": "4.63.6", - "@rollup/rollup-openharmony-arm64": "4.63.6", - "@rollup/rollup-win32-arm64-msvc": "4.63.6", - "@rollup/rollup-win32-ia32-msvc": "4.63.6", - "@rollup/rollup-win32-x64-gnu": "4.63.6", - "@rollup/rollup-win32-x64-msvc": "4.63.6", - "fsevents": "~2.3.2" + "@rolldown/binding-android-arm-eabi": "1.2.19", + "@rolldown/binding-android-arm64": "1.2.19", + "@rolldown/binding-darwin-arm64": "1.2.19", + "@rolldown/binding-darwin-x64": "1.2.19", + "@rolldown/binding-freebsd-x64": "1.2.19", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.19", + "@rolldown/binding-linux-arm64-gnu": "1.2.19", + "@rolldown/binding-linux-arm64-musl": "1.2.19", + "@rolldown/binding-linux-ppc64-gnu": "1.2.19", + "@rolldown/binding-linux-s390x-gnu": "1.2.19", + "@rolldown/binding-linux-x64-gnu": "1.2.19", + "@rolldown/binding-linux-x64-musl": "1.2.19", + "@rolldown/binding-openharmony-arm64": "1.2.19", + "@rolldown/binding-wasm32-wasi": "1.2.19", + "@rolldown/binding-win32-arm64-msvc": "1.2.19", + "@rolldown/binding-win32-x64-msvc": "1.2.19" + } + }, + "node_modules/rolldown/node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" } }, "node_modules/safe-buffer": { @@ -10162,6 +11595,21 @@ "node": ">=10" } }, + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", @@ -10209,6 +11657,13 @@ "node": ">= 6" } }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", @@ -10387,6 +11842,26 @@ "semver": "bin/semver" } }, + "node_modules/tinybench": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.5.tgz", + "integrity": "sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.4.0.tgz", + "integrity": "sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -10403,6 +11878,26 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinypool": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.2.0.tgz", + "integrity": "sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.0.0 || >=22.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/tldts": { "version": "7.5.5", "resolved": "https://registry.npmmirror.com/tldts/-/tldts-7.5.5.tgz", @@ -10453,6 +11948,16 @@ "topoquantize": "bin/topoquantize" } }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/tough-cookie": { "version": "6.1.0", "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-6.1.0.tgz", @@ -10512,6 +12017,30 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, + "node_modules/tsrs": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/tsrs/-/tsrs-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-T6O1mYbPe7B5ZSudwqJcn7hfn66w3wXsCd+GpXyDPsRmei71W6WAidlj+QWaYgmfpbmMqzcryKcg5aVg8DOSXw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsrs": "bin/tsrs", + "tsrs-lint": "bin/tsrs-lint" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@tsrs/darwin-arm64": "7.1.0-beta.tsrs2", + "@tsrs/darwin-x64": "7.1.0-beta.tsrs2", + "@tsrs/linux-arm64-gnu": "7.1.0-beta.tsrs2", + "@tsrs/linux-arm64-musl": "7.1.0-beta.tsrs2", + "@tsrs/linux-x64-gnu": "7.1.0-beta.tsrs2", + "@tsrs/linux-x64-musl": "7.1.0-beta.tsrs2", + "@tsrs/win32-arm64": "7.1.0-beta.tsrs2", + "@tsrs/win32-x64": "7.1.0-beta.tsrs2" + } + }, "node_modules/tw-shimmer": { "version": "0.4.14", "resolved": "https://registry.npmmirror.com/tw-shimmer/-/tw-shimmer-0.4.14.tgz", @@ -10522,16 +12051,38 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dev": true, + "license": "Apache-2.0", "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "tsc": "bin/tsc" }, "engines": { - "node": ">=14.17" + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" } }, "node_modules/uc.micro": { @@ -10854,55 +12405,85 @@ } }, "node_modules/vite": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.7.tgz", - "integrity": "sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA==", + "name": "@voidzero-dev/vite-plus-core", + "version": "8.3.8000", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-core/-/vite-plus-core-8.3.8000.tgz", + "integrity": "sha512-kWOoI7ut3UE83p87jJxcxxg92pbipmC/aakCm6mfm1nkPyPnEZngNaRjiVRPrvxk3vSgy54A4fdlTeb++dSKfg==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.27.0 || ^0.28.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" - }, - "bin": { - "vite": "bin/vite.js" + "@oxc-project/runtime": "=0.159.0", + "@oxc-project/types": "=0.159.0", + "lightningcss": "^1.33.0", + "postcss": "^8.5.32", + "yuku-parser": "0.19.0" }, "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" + "node": "^20.19.0 || ^22.18.0 || >=24.11.0" }, "optionalDependencies": { + "@voidzero-dev/vite-plus-darwin-arm64": "1.7.0", + "@voidzero-dev/vite-plus-darwin-x64": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-musl": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-musl": "1.7.0", + "@voidzero-dev/vite-plus-win32-arm64-msvc": "1.7.0", + "@voidzero-dev/vite-plus-win32-x64-msvc": "1.7.0", "fsevents": "~2.3.3" }, "peerDependencies": { + "@arethetypeswrong/core": "^0.18.1", "@types/node": "^20.19.0 || >=22.12.0", + "@typescript/native-preview": "*", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "@volar/typescript": "~2.4.0", + "@vue/language-core": "~3.2.0 || ~3.3.0", + "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", - "lightningcss": "^1.21.0", + "publint": "^0.3.8", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", + "typescript": "^5.0.0 || ^6.0.0 || ^7.0.0", + "unplugin-unused": ">=0.5.0", + "unrun": "*", + "vue-tsc": "~3.2.0 || ~3.3.0", "yaml": "^2.4.2" }, "peerDependenciesMeta": { + "@arethetypeswrong/core": { + "optional": true + }, "@types/node": { "optional": true }, + "@typescript/native-preview": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "@volar/typescript": { + "optional": true + }, + "@vue/language-core": { + "optional": true + }, + "esbuild": { + "optional": true + }, "jiti": { "optional": true }, "less": { "optional": true }, - "lightningcss": { + "publint": { "optional": true }, "sass": { @@ -10923,11 +12504,194 @@ "tsx": { "optional": true }, + "typescript": { + "optional": true + }, + "unplugin-unused": { + "optional": true + }, + "unrun": { + "optional": true + }, + "vue-tsc": { + "optional": true + }, "yaml": { "optional": true } } }, + "node_modules/vite-plus": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vite-plus/-/vite-plus-1.7.0.tgz", + "integrity": "sha512-dWeTqWhRXZSIr9i45IjPXjiAuLtHOdiRrZNBCusyhb/06MxFHOSbVKqG5bq9svxsE494AMHmVocBvzem+a6qHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/runtime": "=0.159.0", + "@oxc-project/types": "=0.159.0", + "@oxlint/plugins": "=1.94.0", + "@vitest/browser": "5.1.0", + "@vitest/browser-preview": "5.1.0", + "@vitest/mocker": "5.1.0", + "@vitest/pretty-format": "5.1.0", + "@vitest/snapshot": "5.1.0", + "@vitest/spy": "5.1.0", + "@vitest/utils": "5.1.0", + "oxfmt": "=0.79.0", + "oxlint": "=1.94.0", + "tsrs": "=7.1.0-beta.tsrs2", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000", + "vitest": "5.1.0" + }, + "bin": { + "vp": "bin/vp", + "vpr": "bin/vpr", + "vpx": "bin/vpx" + }, + "engines": { + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" + }, + "optionalDependencies": { + "@voidzero-dev/vite-plus-darwin-arm64": "1.7.0", + "@voidzero-dev/vite-plus-darwin-x64": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-musl": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-musl": "1.7.0", + "@voidzero-dev/vite-plus-win32-arm64-msvc": "1.7.0", + "@voidzero-dev/vite-plus-win32-x64-msvc": "1.7.0" + }, + "peerDependencies": { + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "playwright": "*" + }, + "peerDependenciesMeta": { + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "playwright": { + "optional": true + } + } + }, + "node_modules/vite-plus/node_modules/@oxc-project/types": { + "version": "0.159.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.159.0.tgz", + "integrity": "sha512-QWjWhxheluOJ82kDHNyps00UvRpQCtI34B5A/SzpgQycUD/79FuvT4I0aQIfE/bdPwKmX4QPftnywFBH6FxJhQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/vite/node_modules/@oxc-project/types": { + "version": "0.159.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.159.0.tgz", + "integrity": "sha512-QWjWhxheluOJ82kDHNyps00UvRpQCtI34B5A/SzpgQycUD/79FuvT4I0aQIfE/bdPwKmX4QPftnywFBH6FxJhQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/vitest": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz", + "integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.1.0", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.3", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-preview": "5.1.0", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.1.0", + "@vitest/coverage-v8": "5.1.0", + "@vitest/ui": "5.1.0", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, "node_modules/w3c-xmlserializer": { "version": "6.0.0", "resolved": "https://registry.npmmirror.com/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz", @@ -11012,6 +12776,19 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -11035,6 +12812,28 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/ws": { + "version": "8.23.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.0.tgz", + "integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xml-name-validator": { "version": "5.0.0", "resolved": "https://registry.npmmirror.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz", @@ -11113,6 +12912,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yuku-core": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/yuku-core/-/yuku-core-0.19.0.tgz", + "integrity": "sha512-kYK9e1XdfirNhkipzW0wmMcSWcVF/CWnuugodfVYRCUwvoBefweL9HzB96OiKEhsx78V5WbUxbJqlizMX869Qg==", + "deprecated": "Yuku is now one package with one core. Use \"yuku\" instead: https://yuku.fyi/javascript/. Existing installs keep working but get no more fixes.", + "dev": true, + "license": "MIT", + "dependencies": { + "@yuku-toolchain/types": "^0.19.0" + }, + "engines": { + "node": ">=14.18.0" + }, + "optionalDependencies": { + "@yuku-core/binding-android-arm64": "0.19.0", + "@yuku-core/binding-darwin-arm64": "0.19.0", + "@yuku-core/binding-darwin-x64": "0.19.0", + "@yuku-core/binding-freebsd-x64": "0.19.0", + "@yuku-core/binding-linux-arm-gnu": "0.19.0", + "@yuku-core/binding-linux-arm-musl": "0.19.0", + "@yuku-core/binding-linux-arm64-gnu": "0.19.0", + "@yuku-core/binding-linux-arm64-musl": "0.19.0", + "@yuku-core/binding-linux-x64-gnu": "0.19.0", + "@yuku-core/binding-linux-x64-musl": "0.19.0", + "@yuku-core/binding-win32-arm64": "0.19.0", + "@yuku-core/binding-win32-x64": "0.19.0" + } + }, + "node_modules/yuku-parser": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/yuku-parser/-/yuku-parser-0.19.0.tgz", + "integrity": "sha512-XrBh9ZiQK5mJVRxZBAvD6LwRyAYrK3MFtH3+onyuxFL5hFD44EC3QOmIC1FjTj6H2MMwq46/NAI+NZxLZPZgxg==", + "deprecated": "Yuku is now one package with one core. Use \"yuku\" instead: https://yuku.fyi/javascript/. Existing installs keep working but get no more fixes.", + "dev": true, + "license": "MIT", + "dependencies": { + "@yuku-toolchain/types": "^0.19.0", + "yuku-core": "0.19.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, "node_modules/zod": { "version": "4.6.7", "resolved": "https://registry.npmmirror.com/zod/-/zod-4.6.7.tgz", diff --git a/package.json b/package.json index 697c7c7b..4cc4f5bf 100644 --- a/package.json +++ b/package.json @@ -16,25 +16,28 @@ "fetch:ffmpeg": "node scripts/fetch-ffmpeg.mjs", "fetch:hawdb": "node scripts/fetch-hawdb.mjs", "start": "electron-vite preview", - "typecheck": "tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.web.json", - "test": "node --test \"tests/*.test.mjs\"" + "test": "vp run ctest", + "check": "vp run ccheck" }, "overrides": { "app-builder-lib": { "@electron/get": "5.1.0" }, "katex": "^0.18.2", - "minimatch": "11.0.3" + "minimatch": "11.0.3", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000" }, "devDependencies": { "@assistant-ui/react": "^0.15.37", "@assistant-ui/react-markdown": "^0.14.26", "@base-ui/react": "^1.9.0", + "@liangmi/vp-config": "^1.0.2", "@sentry/electron": "^8.0.0", "@tailwindcss/vite": "^4.3.5", "@types/node": "^26.6.3", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", + "@typescript/typescript6": "^6.0.2", "@vitejs/plugin-react": "^5.2.0", "cesium": "^1.145.0", "class-variance-authority": "^0.7.1", @@ -43,7 +46,7 @@ "echarts": "^6.1.0", "electron": "^44.9.1", "electron-builder": "^26.15.3", - "electron-vite": "^5.0.0", + "electron-vite": "^6.0.0", "jsdom": "^31.0.1", "lucide-react": "^1.77.0", "markdown-it": "^15.0.3", @@ -54,8 +57,9 @@ "tailwind-merge": "^3.7.1", "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", - "typescript": "^5.9.3", - "vite": "^7.3.7", + "typescript": "^7.0.2", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000", + "vite-plus": "1.7.0", "zustand": "^5.1.0" }, "dependencies": { diff --git a/scripts/fetch-ffmpeg.mjs b/scripts/fetch-ffmpeg.mjs index 721b8ba3..5241f797 100644 --- a/scripts/fetch-ffmpeg.mjs +++ b/scripts/fetch-ffmpeg.mjs @@ -5,9 +5,10 @@ import { chmod, copyFile, mkdir, mkdtemp, rm, stat } from 'node:fs/promises' import { dirname, join, resolve } from 'node:path' import { Readable } from 'node:stream' import { pipeline } from 'node:stream/promises' -import { fileURLToPath, pathToFileURL } from 'node:url' +import { pathToFileURL } from 'node:url' import { promisify } from 'node:util' +// oxlint-disable-next-line typescript/strict-void-return -- `promisify` reads `execFile`'s callback overload const runFile = promisify(execFile) const ffmpegVersion = '8.1.3' @@ -19,11 +20,11 @@ export const FFMPEG_BUILDS = { arch: 'x64', archiveName: 'ffmpeg-8.1.3-win32-x64-lgpl.tar.xz', archiveSha256: '73422b77282a70b3012e4dc43ce6acbb220399a75039cc2bf15ce7b1ccf7993b', - archiveBytes: 127358740, + archiveBytes: 127_358_740, binaryMemberPath: 'ffmpeg-8.1.3-win32-x64-lgpl/bin/ffmpeg.exe', binaryName: 'ffmpeg.exe', binarySha256: '77e7a67a4651fad7b7b4e5802272229a15f7e8b9491ace4c637a160594889b85', - binaryBytes: 132246016 + binaryBytes: 132_246_016 }, 'linux-x64': { version: ffmpegVersion, @@ -31,11 +32,11 @@ export const FFMPEG_BUILDS = { arch: 'x64', archiveName: 'ffmpeg-8.1.3-linux-x64-lgpl.tar.xz', archiveSha256: 'f31e025dc380fd4aa99dd4dc98eeeea631e16f0a9f3703c31e4cc02e653a5a60', - archiveBytes: 136051144, + archiveBytes: 136_051_144, binaryMemberPath: 'ffmpeg-8.1.3-linux-x64-lgpl/bin/ffmpeg', binaryName: 'ffmpeg', binarySha256: 'c52d9dd02bb63874f9d2c5ab96c96f043ca450f4ec6ecdf495a0c93659be1066', - binaryBytes: 140970184 + binaryBytes: 140_970_184 }, 'linux-arm64': { version: ffmpegVersion, @@ -43,11 +44,11 @@ export const FFMPEG_BUILDS = { arch: 'arm64', archiveName: 'ffmpeg-8.1.3-linux-arm64-lgpl.tar.xz', archiveSha256: 'cdfcf36dc159c8173df9b970bc145d41a9092a26de0e49bc56c61ad171de1c59', - archiveBytes: 115301160, + archiveBytes: 115_301_160, binaryMemberPath: 'ffmpeg-8.1.3-linux-arm64-lgpl/bin/ffmpeg', binaryName: 'ffmpeg', binarySha256: 'bda9af06fd166c83dc43097477d34c25eebe077ebe4e21d646b605f710d59c70', - binaryBytes: 116169984 + binaryBytes: 116_169_984 } } @@ -62,8 +63,8 @@ const maxArchiveRedirects = 5 const pinnedArchiveNames = new Set(Object.values(FFMPEG_BUILDS).map((build) => build.archiveName)) export function normalizeFfmpegArch(arch) { - if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') return 'x64' - if (arch === 'arm64' || arch === 'aarch64') return 'arm64' + if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') {return 'x64'} + if (arch === 'arm64' || arch === 'aarch64') {return 'arm64'} return arch } @@ -102,18 +103,18 @@ function rejectedArchiveLabel(url) { export function isApprovedArchiveUrl(url) { const parsed = parseArchiveUrl(url) - return parsed != null && parsed.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) + return parsed?.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) } export function isApprovedArchiveRedirectUrl(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.protocol !== 'https:') return false + if (parsed?.protocol !== 'https:') {return false} return APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) || APPROVED_ARCHIVE_REDIRECT_HOSTS.includes(parsed.hostname) } export function archiveRedirectTarget(location, currentUrl) { - if (location == null || location === '') throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`) - let resolved = null + if (location == null || location === '') {throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`)} + let resolved try { resolved = new URL(location, currentUrl).href } catch { @@ -127,7 +128,7 @@ export function archiveRedirectTarget(location, currentUrl) { export function matchesPinnedArchivePath(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.search !== '' || parsed.hash !== '') return false + if (parsed?.search !== '' || parsed.hash !== '') {return false} const name = parsed.pathname.slice(parsed.pathname.lastIndexOf('/') + 1) return pinnedArchiveNames.has(name) && parsed.pathname.endsWith(`/v${ffmpegVersion}/${name}`) } @@ -158,7 +159,7 @@ export function assertArchiveSource(url) { export function archiveSources(overrideUrl, build = hostFfmpegBuild()) { const pinned = pinnedArchiveUrls(build) - if (!overrideUrl) return [...pinned] + if (!overrideUrl) {return [...pinned]} return [approvedArchiveSource(overrideUrl), ...pinned] } @@ -169,18 +170,18 @@ export function sha256Text(text) { export function defaultBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeFfmpegArch(arch) const build = FFMPEG_BUILDS[`${platform}-${normalized}`] - if (!build) return join(repoRoot, 'resources', 'bin', 'ffmpeg.exe') - if (build.platform !== 'linux') return join(repoRoot, 'resources', 'bin', build.binaryName) + if (!build) {return join(repoRoot, 'resources', 'bin', 'ffmpeg.exe')} + if (build.platform !== 'linux') {return join(repoRoot, 'resources', 'bin', build.binaryName)} const isHost = platform === process.platform && normalized === normalizeFfmpegArch(process.arch) - if (isHost) return join(repoRoot, 'resources', 'bin', build.binaryName) + if (isHost) {return join(repoRoot, 'resources', 'bin', build.binaryName)} return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) } export function packagedBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeFfmpegArch(arch) const build = FFMPEG_BUILDS[`${platform}-${normalized}`] - if (!build) return defaultBinaryPath(repoRoot, platform, arch) - if (build.platform === 'linux') return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) + if (!build) {return defaultBinaryPath(repoRoot, platform, arch)} + if (build.platform === 'linux') {return join(repoRoot, 'resources', 'bin', normalized, build.binaryName)} return join(repoRoot, 'resources', 'bin', build.binaryName) } @@ -193,7 +194,7 @@ function outputPaths(repoRoot, build) { async function sha256File(path) { const hash = createHash('sha256') - for await (const chunk of createReadStream(path)) hash.update(chunk) + for await (const chunk of createReadStream(path)) {hash.update(chunk)} return hash.digest('hex') } @@ -203,24 +204,24 @@ export async function verifyFile(path, { sha256, bytes }) { return { ok: false, reason: `大小不符(期望 ${bytes} 字节,实际 ${info.size} 字节)` } } const digest = await sha256File(path) - if (digest !== sha256) return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` } + if (digest !== sha256) {return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` }} return { ok: true } } export async function verifyFfmpegBinary(path, build = hostFfmpegBuild()) { - if (!existsSync(path)) return { ok: false, reason: `文件不存在:${path}` } + if (!existsSync(path)) {return { ok: false, reason: `文件不存在:${path}` }} return verifyFile(path, { sha256: build.binarySha256, bytes: build.binaryBytes }) } async function binaryMatches(path, build) { - if (!existsSync(path)) return false + if (!existsSync(path)) {return false} const current = await verifyFile(path, { sha256: build.binarySha256, bytes: build.binaryBytes }) return current.ok } function tarCommand() { - if (process.platform !== 'win32') return 'tar' - const systemTar = join(process.env.SystemRoot ?? 'C:\\Windows', 'System32', 'tar.exe') + if (process.platform !== 'win32') {return 'tar'} + const systemTar = join(process.env.SystemRoot ?? String.raw`C:\Windows`, 'System32', 'tar.exe') return existsSync(systemTar) ? systemTar : 'tar' } @@ -229,8 +230,8 @@ async function fetchArchive(url) { let current = url for (let hop = 0; hop <= maxArchiveRedirects; hop += 1) { const response = await fetch(current, { redirect: 'manual', headers: { 'user-agent': 'GuEarth-FFmpeg-Fetch' } }) - if (response.status < 300 || response.status >= 400) return response - if (hop === maxArchiveRedirects) break + if (response.status < 300 || response.status >= 400) {return response} + if (hop === maxArchiveRedirects) {break} current = archiveRedirectTarget(response.headers.get('location'), current) } throw new Error(`下载重定向次数过多:${rejectedArchiveLabel(url)}`) @@ -239,7 +240,7 @@ async function fetchArchive(url) { async function download(url, destination) { console.log(`下载内置视频编码器:${url}`) const response = await fetchArchive(url) - if (!response.ok || response.body == null) throw new Error(`HTTP ${response.status}`) + if (!response.ok || response.body == null) {throw new Error(`HTTP ${response.status}`)} await pipeline(Readable.fromWeb(response.body), createWriteStream(destination)) } @@ -248,7 +249,7 @@ async function placeBinary(extracted, targets) { await mkdir(dirname(target), { recursive: true }) await rm(target, { force: true }) await copyFile(extracted, target) - if (process.platform !== 'win32') await chmod(target, 0o755) + if (process.platform !== 'win32') {await chmod(target, 0o755)} } } @@ -271,14 +272,14 @@ export async function fetchFfmpeg({ repoRoot, force = false, platform = process. await copyFile(localArchive, archivePath) console.log(`使用本地归档:${localArchive}`) const localCheck = await verifyFile(archivePath, { sha256: build.archiveSha256, bytes: build.archiveBytes }) - if (!localCheck.ok) throw new Error(`归档校验失败:${localCheck.reason}`) + if (!localCheck.ok) {throw new Error(`归档校验失败:${localCheck.reason}`)} } else { let lastError = null for (const source of archiveSources(process.env.FFMPEG_FETCH_URL, build)) { try { await download(source, archivePath) const sourceCheck = await verifyFile(archivePath, { sha256: build.archiveSha256, bytes: build.archiveBytes }) - if (!sourceCheck.ok) throw new Error(`归档校验失败:${sourceCheck.reason}`) + if (!sourceCheck.ok) {throw new Error(`归档校验失败:${sourceCheck.reason}`)} lastError = null break } catch (error) { @@ -286,12 +287,13 @@ export async function fetchFfmpeg({ repoRoot, force = false, platform = process. console.warn(`来源不可用:${error instanceof Error ? error.message : String(error)}`) } } - if (lastError) throw lastError + // oxlint-disable-next-line typescript/only-throw-error -- rethrows the last download error as it was caught + if (lastError) {throw lastError} } await runFile(tarCommand(), ['-xf', archivePath, '-C', workDirectory, build.binaryMemberPath], { windowsHide: true }) const extracted = join(workDirectory, build.binaryMemberPath) const binaryCheck = await verifyFile(extracted, { sha256: build.binarySha256, bytes: build.binaryBytes }) - if (!binaryCheck.ok) throw new Error(`编码器校验失败:${binaryCheck.reason}`) + if (!binaryCheck.ok) {throw new Error(`编码器校验失败:${binaryCheck.reason}`)} await placeBinary(extracted, targets) console.log(`内置视频编码器已更新:${targets.join('、')}`) return targets[0] @@ -302,18 +304,18 @@ export async function fetchFfmpeg({ repoRoot, force = false, platform = process. function buildsFromArgs(argv) { const index = argv.indexOf('--arch') - if (index < 0) return [ffmpegBuildFor(process.platform, process.arch)] + if (index === -1) {return [ffmpegBuildFor(process.platform, process.arch)]} const value = argv[index + 1] - if (!value || value.startsWith('--')) throw new Error('请在 --arch 后指定 x64、arm64 或 all') - if (value === 'all') return [FFMPEG_BUILDS['linux-x64'], FFMPEG_BUILDS['linux-arm64']] - if (argv.includes('--linux') || process.platform === 'linux') return [ffmpegBuildFor('linux', value)] + if (!value || value.startsWith('--')) {throw new Error('请在 --arch 后指定 x64、arm64 或 all')} + if (value === 'all') {return [FFMPEG_BUILDS['linux-x64'], FFMPEG_BUILDS['linux-arm64']]} + if (argv.includes('--linux') || process.platform === 'linux') {return [ffmpegBuildFor('linux', value)]} return [ffmpegBuildFor(process.platform, value)] } const runsAsScript = process.argv[1] != null && pathToFileURL(resolve(process.argv[1])).href === import.meta.url if (runsAsScript) { - const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..') + const repoRoot = resolve(import.meta.dirname, '..') const force = process.argv.includes('--force') Promise.all(buildsFromArgs(process.argv).map((build) => fetchFfmpeg({ repoRoot, diff --git a/scripts/fetch-hawdb.mjs b/scripts/fetch-hawdb.mjs index f9780341..cca7a2b9 100644 --- a/scripts/fetch-hawdb.mjs +++ b/scripts/fetch-hawdb.mjs @@ -8,6 +8,7 @@ import { pipeline } from 'node:stream/promises' import { fileURLToPath, pathToFileURL } from 'node:url' import { promisify } from 'node:util' +// oxlint-disable-next-line typescript/strict-void-return -- `promisify` reads `execFile`'s callback overload const runFile = promisify(execFile) export const HAWDB_VERSION = '0.35.1' @@ -82,8 +83,8 @@ const maxArchiveRedirects = 5 const pinnedArchiveNames = new Set(Object.values(HAWDB_BUILDS).map((build) => build.archiveName)) export function normalizeHawdbArch(arch) { - if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') return 'x64' - if (arch === 'arm64' || arch === 'aarch64') return 'arm64' + if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') {return 'x64'} + if (arch === 'arm64' || arch === 'aarch64') {return 'arm64'} return arch } @@ -119,18 +120,18 @@ function rejectedArchiveLabel(url) { export function isApprovedArchiveUrl(url) { const parsed = parseArchiveUrl(url) - return parsed != null && parsed.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) + return parsed?.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) } export function isApprovedArchiveRedirectUrl(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.protocol !== 'https:') return false + if (parsed?.protocol !== 'https:') {return false} return APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) || APPROVED_ARCHIVE_REDIRECT_HOSTS.includes(parsed.hostname) } export function archiveRedirectTarget(location, currentUrl) { - if (location == null || location === '') throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`) - let resolved = null + if (location == null || location === '') {throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`)} + let resolved try { resolved = new URL(location, currentUrl).href } catch { @@ -144,7 +145,7 @@ export function archiveRedirectTarget(location, currentUrl) { export function matchesPinnedArchivePath(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.search !== '' || parsed.hash !== '') return false + if (parsed?.search !== '' || parsed.hash !== '') {return false} const name = parsed.pathname.slice(parsed.pathname.lastIndexOf('/') + 1) return pinnedArchiveNames.has(name) && parsed.pathname.endsWith(`/v${HAWDB_VERSION}/${name}`) } @@ -166,18 +167,18 @@ export function assertFetchableUrl(url) { export function defaultHawdbBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeHawdbArch(arch) const build = HAWDB_BUILDS[`${platform}-${normalized}`] - if (!build) return join(repoRoot, 'resources', 'bin', 'hawdb_ffi.dll') - if (build.platform === 'win32') return join(repoRoot, 'resources', 'bin', build.binaryName) + if (!build) {return join(repoRoot, 'resources', 'bin', 'hawdb_ffi.dll')} + if (build.platform === 'win32') {return join(repoRoot, 'resources', 'bin', build.binaryName)} const isHost = platform === process.platform && normalized === normalizeHawdbArch(process.arch) - if (isHost) return join(repoRoot, 'resources', 'bin', build.binaryName) + if (isHost) {return join(repoRoot, 'resources', 'bin', build.binaryName)} return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) } export function packagedHawdbBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeHawdbArch(arch) const build = HAWDB_BUILDS[`${platform}-${normalized}`] - if (!build) return defaultHawdbBinaryPath(repoRoot, platform, arch) - if (build.platform === 'win32') return join(repoRoot, 'resources', 'bin', build.binaryName) + if (!build) {return defaultHawdbBinaryPath(repoRoot, platform, arch)} + if (build.platform === 'win32') {return join(repoRoot, 'resources', 'bin', build.binaryName)} return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) } @@ -194,7 +195,7 @@ function stampPath(binaryPath) { async function sha256File(path) { const hash = createHash('sha256') - for await (const chunk of createReadStream(path)) hash.update(chunk) + for await (const chunk of createReadStream(path)) {hash.update(chunk)} return hash.digest('hex') } @@ -204,12 +205,12 @@ export async function verifyFile(path, { sha256, bytes }) { return { ok: false, reason: `大小不符(期望 ${bytes} 字节,实际 ${info.size} 字节)` } } const digest = await sha256File(path) - if (digest !== sha256) return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` } + if (digest !== sha256) {return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` }} return { ok: true } } async function binaryMatchesStamp(path, build) { - if (!existsSync(path) || !existsSync(stampPath(path))) return false + if (!existsSync(path) || !existsSync(stampPath(path))) {return false} try { const stamp = JSON.parse(await readFile(stampPath(path), 'utf8')) if (stamp.version !== build.version || stamp.triple !== build.triple || stamp.archiveSha256 !== build.archiveSha256) { @@ -223,8 +224,8 @@ async function binaryMatchesStamp(path, build) { } function tarCommand() { - if (process.platform !== 'win32') return 'tar' - const systemTar = join(process.env.SystemRoot ?? 'C:\\Windows', 'System32', 'tar.exe') + if (process.platform !== 'win32') {return 'tar'} + const systemTar = join(process.env.SystemRoot ?? String.raw`C:\Windows`, 'System32', 'tar.exe') return existsSync(systemTar) ? systemTar : 'tar' } @@ -232,8 +233,8 @@ async function fetchArchive(url) { let current = assertArchiveSource(url) for (let hop = 0; hop <= maxArchiveRedirects; hop += 1) { const response = await fetch(assertFetchableUrl(current), { redirect: 'manual', headers: { 'user-agent': 'GuEarth-HawDB-Fetch' } }) - if (response.status < 300 || response.status >= 400) return response - if (hop === maxArchiveRedirects) break + if (response.status < 300 || response.status >= 400) {return response} + if (hop === maxArchiveRedirects) {break} current = archiveRedirectTarget(response.headers.get('location'), current) } throw new Error(`下载重定向次数过多:${rejectedArchiveLabel(url)}`) @@ -242,7 +243,7 @@ async function fetchArchive(url) { async function download(url, destination) { console.log(`下载 HawDB 引擎库:${url}`) const response = await fetchArchive(url) - if (!response.ok || response.body == null) throw new Error(`HTTP ${response.status}`) + if (!response.ok || response.body == null) {throw new Error(`HTTP ${response.status}`)} await pipeline(Readable.fromWeb(response.body), createWriteStream(destination)) } @@ -261,7 +262,7 @@ async function placeBinary(extracted, targets, stamp) { await mkdir(dirname(target), { recursive: true }) await rm(target, { force: true }) await copyFile(extracted, target) - if (process.platform !== 'win32') await chmod(target, 0o755) + if (process.platform !== 'win32') {await chmod(target, 0o755)} await writeFile(stampPath(target), stampText, 'utf8') } } @@ -285,11 +286,11 @@ export async function fetchHawdb({ repoRoot, force = false, platform = process.p await copyFile(localArchive, archivePath) console.log(`使用本地 HawDB 归档:${localArchive}`) const localCheck = await verifyFile(archivePath, { sha256: build.archiveSha256 }) - if (!localCheck.ok) throw new Error(`归档校验失败:${localCheck.reason}`) + if (!localCheck.ok) {throw new Error(`归档校验失败:${localCheck.reason}`)} } else { await download(pinnedArchiveUrl(build), archivePath) const sourceCheck = await verifyFile(archivePath, { sha256: build.archiveSha256 }) - if (!sourceCheck.ok) throw new Error(`归档校验失败:${sourceCheck.reason}`) + if (!sourceCheck.ok) {throw new Error(`归档校验失败:${sourceCheck.reason}`)} } await extractMembers(archivePath, [build.binaryMemberPath, build.manifestMemberPath], workDirectory) const extractedBinary = join(workDirectory, ...build.binaryMemberPath.split('/')) diff --git a/src/common/aiTelemetry.ts b/src/common/aiTelemetry.ts index 5db6a1e2..f33ef5bf 100644 --- a/src/common/aiTelemetry.ts +++ b/src/common/aiTelemetry.ts @@ -27,12 +27,12 @@ export function stripMemoryFromPrompt(content: string): string { } export function redactApiKey(text: string, apiKey: string): string { - if (!text || !apiKey) return text + if (!text || !apiKey) {return text} return text.replaceAll(apiKey, REDACTED_MARKER) } function sanitizeToolArguments(name: string, rawArguments: string): string { - if (name !== 'save_memory') return rawArguments + if (name !== 'save_memory') {return rawArguments} try { const parsed: unknown = JSON.parse(rawArguments) if (isRecord(parsed)) { @@ -56,9 +56,9 @@ export function formatTelemetryToolCalls(toolCalls: TelemetryToolCall[]): Record } function sanitizeToolContentValue(value: unknown, depth = 0): unknown { - if (depth > 6 || value === null || value === undefined) return value - if (Array.isArray(value)) return value.map((item) => sanitizeToolContentValue(item, depth + 1)) - if (!isRecord(value)) return value + if (depth > 6 || value === null || value === undefined) {return value} + if (Array.isArray(value)) {return value.map((item) => sanitizeToolContentValue(item, depth + 1))} + if (!isRecord(value)) {return value} const sanitized: Record = {} for (const [key, entry] of Object.entries(value)) { if (key === 'image' && isRecord(entry) && typeof entry.data === 'string') { @@ -94,7 +94,7 @@ function sanitizeToolMessageContent(name: string | undefined, content: string, h const parsed: unknown = JSON.parse(content) nextContent = JSON.stringify(sanitizeToolContentValue(parsed)) } catch { - nextContent = content.replace(/data:image\/[^;\s"']+;base64,[A-Za-z0-9+/=]+/g, '[image omitted]') + nextContent = content.replaceAll(/data:image\/[^;\s"']+;base64,[A-Za-z0-9+/=]+/g, '[image omitted]') } } return hadImage ? `${nextContent}\n[image omitted]` : nextContent @@ -154,10 +154,10 @@ export function normalizeModelTestOutput(protocol: AiProtocol, payload: Record[] = [] for (const choice of choices) { - if (!isRecord(choice) || !isRecord(choice.message)) continue + if (!isRecord(choice) || !isRecord(choice.message)) {continue} const role = typeof choice.message.role === 'string' ? choice.message.role : 'assistant' const content = typeof choice.message.content === 'string' ? choice.message.content : '' messages.push({ role, content }) } - return messages.length ? messages : [{ role: 'assistant', content: '' }] + return messages.length > 0 ? messages : [{ role: 'assistant', content: '' }] } diff --git a/src/common/flightStops.ts b/src/common/flightStops.ts index c9d01cb1..e223795a 100644 --- a/src/common/flightStops.ts +++ b/src/common/flightStops.ts @@ -23,8 +23,8 @@ export interface StopSwitchRequest { name?: unknown } -export const DEFAULT_FLIGHT_HEIGHT = 60000 -export const MAX_FLIGHT_HEIGHT = 20000000 +export const DEFAULT_FLIGHT_HEIGHT = 60_000 +export const MAX_FLIGHT_HEIGHT = 20_000_000 export const MAX_FLIGHT_STOPS = 12 const SWITCH_INTENT_PATTERN = /切换|切到|切回|换到|换个地点|下一|上一|下个|上个|下[一]?站|上[一]?站|跳到|跳转|飞到|飞往|飞去|移到|定位到|带我看|带我去|(?:看看|看|查看|去|回|回到)\s*第\s*[一二三四五六七八九十百\d]+|^\s*第\s*[一二三四五六七八九十百\d]+\s*[个站处地点]*\s*$|回到|去看看|过去看|switch|next|prev|previous|fly\s*to|go\s*to/i @@ -37,14 +37,14 @@ const SWITCH_CLAUSE_SEPARATOR = /[,。;!?:,;.!?:\n]+/ export function hasExplicitStopSwitchIntent(userText: string): boolean { const normalized = userText.trim() - if (!normalized) return false + if (!normalized) {return false} return normalized .split(SWITCH_CLAUSE_SEPARATOR) - .some((clause) => !NEGATED_SWITCH_PATTERN.test(clause) && SWITCH_INTENT_PATTERN.test(clause.replace(NON_FLIGHT_SWITCH_PATTERN, ' '))) + .some((clause) => !NEGATED_SWITCH_PATTERN.test(clause) && SWITCH_INTENT_PATTERN.test(clause.replaceAll(NON_FLIGHT_SWITCH_PATTERN, ' '))) } function cleanText(value: unknown, maxLength: number): string { - if (typeof value !== 'string') return '' + if (typeof value !== 'string') {return ''} return value.trim().slice(0, maxLength) } @@ -53,8 +53,8 @@ function isNearCoordinate(a: FlightStop, b: FlightStop): boolean { } function toNumber(value: unknown): number { - if (typeof value === 'number') return value - if (typeof value === 'string' && value.trim() !== '') return Number(value.trim()) + if (typeof value === 'number') {return value} + if (typeof value === 'string' && value.trim() !== '') {return Number(value.trim())} return Number.NaN } @@ -84,18 +84,18 @@ export function normalizeFlightStop(raw: FlightStopInput, index = 0): { stop?: F } export function normalizeFlightStopList(rawItems: unknown, startIndex = 0): { stops: FlightStop[]; errors: string[] } { - if (!Array.isArray(rawItems)) return { stops: [], errors: ['locations 需要是地点数组'] } + if (!Array.isArray(rawItems)) {return { stops: [], errors: ['locations 需要是地点数组'] }} const stops: FlightStop[] = [] const errors: string[] = [] for (const item of rawItems) { - if (stops.length >= MAX_FLIGHT_STOPS) break + if (stops.length >= MAX_FLIGHT_STOPS) {break} if (typeof item !== 'object' || item === null) { errors.push('地点项格式无效') continue } const normalized = normalizeFlightStop(item as FlightStopInput, startIndex + stops.length) if (normalized.error || !normalized.stop) { - if (normalized.error) errors.push(normalized.error) + if (normalized.error) {errors.push(normalized.error)} continue } if (!stops.some((existing) => isNearCoordinate(existing, normalized.stop!))) { @@ -108,8 +108,8 @@ export function normalizeFlightStopList(rawItems: unknown, startIndex = 0): { st export function mergeFlightStops(existing: readonly FlightStop[], incoming: readonly FlightStop[]): FlightStop[] { const result = [...existing] for (const candidate of incoming) { - if (result.length >= MAX_FLIGHT_STOPS) break - if (result.some((item) => isNearCoordinate(item, candidate))) continue + if (result.length >= MAX_FLIGHT_STOPS) {break} + if (result.some((item) => isNearCoordinate(item, candidate))) {continue} result.push({ ...candidate, id: `${result.length}:${candidate.longitude.toFixed(5)},${candidate.latitude.toFixed(5)}`, @@ -122,7 +122,7 @@ export function mergeFlightStops(existing: readonly FlightStop[], incoming: read export function parseFlyToArgs(args: Record, existingCount = 0): { stops: FlightStop[]; isBatch: boolean; error?: string } { if (args.locations !== undefined) { const { stops, errors } = normalizeFlightStopList(args.locations, existingCount) - if (!stops.length) return { stops: [], isBatch: true, error: errors[0] ?? 'locations 至少需要包含一个有效坐标地点' } + if (stops.length === 0) {return { stops: [], isBatch: true, error: errors[0] ?? 'locations 至少需要包含一个有效坐标地点' }} return { stops, isBatch: true } } const normalized = normalizeFlightStop( @@ -142,12 +142,12 @@ export function parseFlyToArgs(args: Record, existingCount = 0) } export function clampStopIndex(index: number, total: number): number { - if (total <= 0) return 0 + if (total <= 0) {return 0} return Math.max(0, Math.min(total - 1, Math.trunc(index))) } export function resolveStopTarget(stops: readonly FlightStop[], currentIndex: number, request: StopSwitchRequest): { index?: number; error?: string } { - if (!stops.length) return { error: '当前没有可切换的飞行地点列表' } + if (stops.length === 0) {return { error: '当前没有可切换的飞行地点列表' }} const rawAction = typeof request.action === 'string' ? request.action.trim().toLowerCase() : '' const action: StopSwitchAction = rawAction === 'prev' || rawAction === 'previous' ? 'prev' @@ -157,11 +157,11 @@ export function resolveStopTarget(stops: readonly FlightStop[], currentIndex: nu ? 'goto' : 'next' if (action === 'next') { - if (currentIndex >= stops.length - 1) return { error: '已经是最后一个地点' } + if (currentIndex >= stops.length - 1) {return { error: '已经是最后一个地点' }} return { index: currentIndex + 1 } } if (action === 'prev') { - if (currentIndex <= 0) return { error: '已经是第一个地点' } + if (currentIndex <= 0) {return { error: '已经是第一个地点' }} return { index: currentIndex - 1 } } if (request.index !== undefined && request.index !== null && request.index !== '') { @@ -174,9 +174,9 @@ export function resolveStopTarget(stops: readonly FlightStop[], currentIndex: nu const query = typeof request.name === 'string' ? request.name.trim().toLowerCase() : '' if (query) { const exact = stops.findIndex((stop) => stop.name.trim().toLowerCase() === query) - if (exact >= 0) return { index: exact } + if (exact !== -1) {return { index: exact }} const partial = stops.findIndex((stop) => stop.name.trim().toLowerCase().includes(query) || query.includes(stop.name.trim().toLowerCase())) - if (partial >= 0) return { index: partial } + if (partial !== -1) {return { index: partial }} return { error: `未在当前飞行地点列表中找到「${typeof request.name === 'string' ? request.name.trim() : ''}」` } } return { error: '请指定切换方向(next/prev)、地点序号或地点名称' } @@ -224,7 +224,7 @@ export function evaluateFlightToolGuard(guard: TurnFlightGuard, name: string, ar } if (name === 'fly_to') { const parsed = parseFlyToArgs(args) - if (parsed.error) return { allow: true, dispatchArgs: args } + if (parsed.error) {return { allow: true, dispatchArgs: args }} const flightMode = guard.flewInTurn ? 'queue' : 'initial' return { allow: true, diff --git a/src/common/globeSurface.ts b/src/common/globeSurface.ts index ca1bcb58..f19c0e52 100644 --- a/src/common/globeSurface.ts +++ b/src/common/globeSurface.ts @@ -73,7 +73,7 @@ export function contextOptionsForAttempt(attempt: WebGlContextAttempt): WebGlCon } export function errorText(error: unknown): string { - if (error instanceof Error) return error.message ? `${error.name}: ${error.message}` : error.name + if (error instanceof Error) {return error.message ? `${error.name}: ${error.message}` : error.name} return typeof error === 'string' ? error : '' } @@ -91,7 +91,7 @@ export function isContextLostError(error: unknown): boolean { } export function classifyRenderFault(error: unknown, contextLost: boolean): RenderFaultKind { - if (contextLost || isZeroFramebufferError(error) || isContextLostError(error)) return 'recover' + if (contextLost || isZeroFramebufferError(error) || isContextLostError(error)) {return 'recover'} return 'report' } @@ -100,7 +100,7 @@ export function shouldStopRenderLoop(kind: RenderFaultKind, consecutiveFaults: n } export function surfaceFailureCopy(contextLost: boolean): { message: string; detail: string } { - if (contextLost) return { message: WEBGL_UNAVAILABLE_MESSAGE, detail: WEBGL_UNAVAILABLE_DETAIL } + if (contextLost) {return { message: WEBGL_UNAVAILABLE_MESSAGE, detail: WEBGL_UNAVAILABLE_DETAIL }} return { message: SURFACE_UNAVAILABLE_MESSAGE, detail: SURFACE_UNAVAILABLE_DETAIL } } @@ -109,9 +109,9 @@ export function surfaceIsRenderable(size: SurfaceSize): boolean { } export function decideRenderFrame(size: SurfaceSize, recoveryAttempted: boolean): RenderFrameDecision { - if (size.clientWidth < 1 || size.clientHeight < 1) return { action: 'tick', reason: 'awaiting-layout' } - if (size.drawingBufferWidth >= 1 && size.drawingBufferHeight >= 1) return { action: 'render' } - if (!recoveryAttempted) return { action: 'recover-resize' } + if (size.clientWidth < 1 || size.clientHeight < 1) {return { action: 'tick', reason: 'awaiting-layout' }} + if (size.drawingBufferWidth >= 1 && size.drawingBufferHeight >= 1) {return { action: 'render' }} + if (!recoveryAttempted) {return { action: 'recover-resize' }} return { action: 'tick', reason: 'buffer-missing' } } @@ -125,9 +125,9 @@ export function advanceBufferGap(state: BufferGapState, kind: SurfaceFrameKind, state.since = 0 return 'ok' } - if (!state.since) state.since = now - if (state.reported) return 'waiting' - if (now - state.since < limitMs) return 'waiting' + if (!state.since) {state.since = now} + if (state.reported) {return 'waiting'} + if (now - state.since < limitMs) {return 'waiting'} state.reported = true return 'report' } @@ -140,7 +140,7 @@ export function backingStoreSize(clientWidth: number, clientHeight: number, pixe } export function nudgedCanvasSize(currentWidth: number, currentHeight: number, targetWidth: number, targetHeight: number): { width: number; height: number } { - if (currentWidth === targetWidth && currentHeight === targetHeight) return { width: targetWidth + 1, height: targetHeight } + if (currentWidth === targetWidth && currentHeight === targetHeight) {return { width: targetWidth + 1, height: targetHeight }} return { width: targetWidth, height: targetHeight } } @@ -155,7 +155,7 @@ export interface GlRendererSource { } export function glRendererName(gl: GlRendererSource | null): string { - if (!gl) return '' + if (!gl) {return ''} try { const info = gl.getExtension('WEBGL_debug_renderer_info') const value = info ? gl.getParameter(info.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER) diff --git a/src/common/logger.ts b/src/common/logger.ts index cbadd294..86da4632 100644 --- a/src/common/logger.ts +++ b/src/common/logger.ts @@ -19,20 +19,20 @@ function clamp(text: string): string { } export function stringifyLogValue(value: unknown, depth = 0, seen?: WeakSet): string { - if (typeof value === 'string') return value - if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return String(value) + if (typeof value === 'string') {return value} + if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') {return String(value)} if (value instanceof Error) { const stack = typeof value.stack === 'string' ? value.stack.split('\n').slice(0, 4).join('\n') : '' return clamp(stack ? `${value.name}: ${value.message}\n${stack}` : `${value.name}: ${value.message}`) } - if (depth >= 4) return '[深层结构省略]' - const marker = seen ?? new WeakSet() + if (depth >= 4) {return '[深层结构省略]'} + const marker = seen ?? new WeakSet() if (typeof value === 'object') { - if (marker.has(value)) return '[循环引用]' + if (marker.has(value)) {return '[循环引用]'} marker.add(value) if (Array.isArray(value)) { const items = value.slice(0, 20).map((item) => stringifyLogValue(item, depth + 1, marker)) - if (value.length > 20) items.push(`…共 ${value.length} 项`) + if (value.length > 20) {items.push(`…共 ${value.length} 项`)} return `[${items.join(', ')}]` } const parts = Object.entries(value as Record).slice(0, 20).map(([key, item]) => `${key}: ${stringifyLogValue(item, depth + 1, marker)}`) @@ -49,7 +49,7 @@ function push(level: LogLevel, scope: string, message: string, detail: unknown): message: clamp(message), detail: detail === undefined || detail === '' ? '' : clamp(stringifyLogValue(detail)) }) - if (entries.length > MAX_ENTRIES) entries.splice(0, entries.length - MAX_ENTRIES) + if (entries.length > MAX_ENTRIES) {entries.splice(0, entries.length - MAX_ENTRIES)} } function pad(value: number, width = 2): string { @@ -87,7 +87,7 @@ export const logger = { let consoleTeeInstalled = false export function attachConsoleLogTee(scope: string): void { - if (consoleTeeInstalled) return + if (consoleTeeInstalled) {return} consoleTeeInstalled = true const originalWarn = console.warn.bind(console) const originalError = console.error.bind(console) diff --git a/src/common/mirrorPolicies.ts b/src/common/mirrorPolicies.ts index 21a42dbc..a9afad28 100644 --- a/src/common/mirrorPolicies.ts +++ b/src/common/mirrorPolicies.ts @@ -13,7 +13,7 @@ export interface ParsedPolicyMarkdown { } export function parsePolicyMarkdown(markdown: string, fallbackTitle: string): ParsedPolicyMarkdown { - const normalized = markdown.replace(/^/, '').replace(/\r\n?/g, '\n').trim() + const normalized = markdown.replace(/^/, '').replaceAll(/\r\n?/g, '\n').trim() const match = /^#\s+(.+?)(?:\n+([\s\S]*))?$/.exec(normalized) if (!match) { return { diff --git a/src/common/networkProxy.ts b/src/common/networkProxy.ts index 5a6b0921..6bffda39 100644 --- a/src/common/networkProxy.ts +++ b/src/common/networkProxy.ts @@ -4,17 +4,17 @@ const PROXY_URL_PATTERN = /^(https?|socks[45]):\/\/[^\s]+$/ const HOST_PORT_PATTERN = /^[a-zA-Z0-9.-]+:\d{1,5}$/ export function normalizeNetworkProxy(value: unknown): string { - if (typeof value !== 'string') return '' + if (typeof value !== 'string') {return ''} const trimmed = value.trim() - if (trimmed === '' || trimmed === 'direct') return trimmed - if (trimmed.length > 200) return '' - if (PROXY_URL_PATTERN.test(trimmed)) return trimmed - if (HOST_PORT_PATTERN.test(trimmed)) return `http://${trimmed}` + if (trimmed === '' || trimmed === 'direct') {return trimmed} + if (trimmed.length > 200) {return ''} + if (PROXY_URL_PATTERN.test(trimmed)) {return trimmed} + if (HOST_PORT_PATTERN.test(trimmed)) {return `http://${trimmed}`} return '' } export function networkProxyMode(value: string): NetworkProxyMode { - if (value === '') return 'system' - if (value === 'direct') return 'direct' + if (value === '') {return 'system'} + if (value === 'direct') {return 'direct'} return 'custom' } diff --git a/src/common/onlineData.ts b/src/common/onlineData.ts index 9ac7661d..5879b18c 100644 --- a/src/common/onlineData.ts +++ b/src/common/onlineData.ts @@ -51,14 +51,14 @@ export interface OnlineDataSnapshot { } export function validateQWeatherApiKey(value: unknown): string { - if (typeof value !== 'string' || !/^[\x21-\x7e]{1,512}$/.test(value.trim())) { + if (typeof value !== 'string' || !/^[\u0021-\u007E]{1,512}$/.test(value.trim())) { throw new Error('API Key 仅支持可见 ASCII 字符,长度 1-512,且不能包含空格或换行') } return value.trim() } export function normalizeQWeatherHost(value: unknown): string { - if (typeof value !== 'string') throw new Error('请输入和风天气 API Host') + if (typeof value !== 'string') {throw new TypeError('请输入和风天气 API Host')} const host = value.trim().replace(/^https:\/\//i, '').replace(/\/$/, '').toLowerCase() if (host.length > 253 || !/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*qweatherapi\.com$/.test(host)) { throw new Error('API Host 必须为 qweatherapi.com 或其子域名,不含路径或端口') diff --git a/src/common/passport.ts b/src/common/passport.ts index ff18a128..f3b827e2 100644 --- a/src/common/passport.ts +++ b/src/common/passport.ts @@ -32,10 +32,10 @@ export function utf8ByteLength(value: string): number { let length = 0 for (const character of value) { const code = character.codePointAt(0) ?? 0 - if (code < 0x80) length += 1 - else if (code < 0x800) length += 2 - else if (code < 0x10000) length += 3 - else length += 4 + if (code < 0x80) {length += 1} + else if (code < 0x8_00) {length += 2} + else if (code < 0x1_00_00) {length += 3} + else {length += 4} } return length } @@ -49,19 +49,19 @@ export function encodeBase64Url(bytes: Uint8Array): string { bits += 8 while (bits >= 6) { bits -= 6 - output += BASE64URL_ALPHABET[(accumulator >>> bits) & 0x3f] + output += BASE64URL_ALPHABET[(accumulator >>> bits) & 0x3F] } } - if (bits > 0) output += BASE64URL_ALPHABET[(accumulator << (6 - bits)) & 0x3f] + if (bits > 0) {output += BASE64URL_ALPHABET[(accumulator << (6 - bits)) & 0x3F]} return output } export function truncateToUtf8Bytes(value: string, maxBytes: number): string { - if (utf8ByteLength(value) <= maxBytes) return value + if (utf8ByteLength(value) <= maxBytes) {return value} let output = '' for (const character of value) { const candidate = output + character - if (utf8ByteLength(candidate) > maxBytes) break + if (utf8ByteLength(candidate) > maxBytes) {break} output = candidate } return output @@ -72,14 +72,16 @@ export function isValidInstallationId(value: unknown): value is string { } export function sanitizeDeviceNameText(value: string): string { - return value.replace(/[\u0000-\u001f\u007f]/g, ' ').replace(/\s+/g, ' ').trim() + // oxlint-disable-next-line eslint/no-control-regex -- device names must not contain control characters + return value.replaceAll(/[\u0000-\u001F\u007F]/g, ' ').replaceAll(/\s+/g, ' ').trim() } export function isValidDeviceName(value: unknown): value is string { - if (typeof value !== 'string') return false - if (value !== value.trim()) return false - if (value === '') return false - if (/[\u0000\u000a\u000d]/.test(value)) return false + if (typeof value !== 'string') {return false} + if (value !== value.trim()) {return false} + if (value === '') {return false} + // oxlint-disable-next-line eslint/no-control-regex -- device names must not contain NUL or line breaks + if (/[\u0000\u000A\u000D]/.test(value)) {return false} return utf8ByteLength(value) <= MAX_DEVICE_NAME_BYTES } @@ -91,11 +93,11 @@ export function buildDeviceName(hostname: string): string { } export function passportPlatform(platform: string): PassportPlatform { - if (platform === 'win32') return 'windows' - if (platform === 'darwin') return 'macos' - if (platform === 'linux') return 'linux' - if (platform === 'android') return 'android' - if (PASSPORT_PLATFORMS.includes(platform as PassportPlatform)) return platform as PassportPlatform + if (platform === 'win32') {return 'windows'} + if (platform === 'darwin') {return 'macos'} + if (platform === 'linux') {return 'linux'} + if (platform === 'android') {return 'android'} + if (PASSPORT_PLATFORMS.includes(platform as PassportPlatform)) {return platform as PassportPlatform} return 'other' } @@ -108,30 +110,30 @@ function isLocalHostname(hostname: string): boolean { } export function parseAbsoluteUrl(value: unknown): URL | null { - if (typeof value !== 'string' || value.trim() === '') return null + if (typeof value !== 'string' || value.trim() === '') {return null} let url: URL try { url = new URL(value.trim()) } catch { return null } - if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLocalHostname(url.hostname))) return null + if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLocalHostname(url.hostname))) {return null} return url } export function isTrustedVerificationUri(value: unknown, accountOrigin: string): value is string { const url = parseAbsoluteUrl(value) const origin = parseAbsoluteUrl(accountOrigin) - if (!url || !origin) return false - if (url.origin !== origin.origin) return false + if (!url || !origin) {return false} + if (url.origin !== origin.origin) {return false} return url.pathname === PASSPORT_DEVICE_VERIFICATION_PATH } export function isTrustedVerificationUriComplete(value: unknown, accountOrigin: string): value is string { - if (!isTrustedVerificationUri(value, accountOrigin)) return false + if (!isTrustedVerificationUri(value, accountOrigin)) {return false} const url = new URL(value) for (const key of url.searchParams.keys()) { - if (key !== 'user_code') return false + if (key !== 'user_code') {return false} } return true } @@ -145,16 +147,16 @@ export function buildVerificationUriComplete(verificationUri: string, userCode: export function deviceListUrl(accountOrigin: string): string { const origin = parseAbsoluteUrl(accountOrigin) - if (!origin) return '' + if (!origin) {return ''} origin.pathname = PASSPORT_DEVICE_LIST_PATH origin.search = '' return origin.toString() } export function retryAfterSeconds(headerValue: string | null): number { - if (typeof headerValue !== 'string') return 0 + if (typeof headerValue !== 'string') {return 0} const seconds = Number.parseInt(headerValue.trim(), 10) - if (!Number.isFinite(seconds) || seconds < 0) return 0 + if (!Number.isFinite(seconds) || seconds < 0) {return 0} return Math.min(MAX_RETRY_AFTER_SECONDS, seconds) } @@ -168,14 +170,14 @@ export interface PassportEndpoints { function endpointUnderIssuer(payload: Record, key: string, issuerUrl: URL): string { const url = parseAbsoluteUrl(payload[key]) - if (!url) return '' - if (url.origin !== issuerUrl.origin) return '' + if (!url) {return ''} + if (url.origin !== issuerUrl.origin) {return ''} return url.toString() } export function normalizeIssuer(value: unknown): string { const url = parseAbsoluteUrl(value) - if (!url) return '' + if (!url) {return ''} url.pathname = url.pathname === '/' ? '' : url.pathname.replace(/\/+$/, '') url.search = '' url.hash = '' @@ -183,17 +185,17 @@ export function normalizeIssuer(value: unknown): string { } export function parseDiscovery(payload: unknown, expectedIssuer?: string): PassportEndpoints | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const issuer = normalizeIssuer(payload.issuer) - if (!issuer) return null - if (expectedIssuer !== undefined && normalizeIssuer(expectedIssuer) !== issuer) return null + if (!issuer) {return null} + if (expectedIssuer !== undefined && normalizeIssuer(expectedIssuer) !== issuer) {return null} const issuerUrl = parseAbsoluteUrl(issuer) - if (!issuerUrl) return null + if (!issuerUrl) {return null} const deviceAuthorizationEndpoint = endpointUnderIssuer(payload, 'device_authorization_endpoint', issuerUrl) const tokenEndpoint = endpointUnderIssuer(payload, 'token_endpoint', issuerUrl) const userinfoEndpoint = endpointUnderIssuer(payload, 'userinfo_endpoint', issuerUrl) const revocationEndpoint = endpointUnderIssuer(payload, 'revocation_endpoint', issuerUrl) - if (!deviceAuthorizationEndpoint || !tokenEndpoint || !userinfoEndpoint || !revocationEndpoint) return null + if (!deviceAuthorizationEndpoint || !tokenEndpoint || !userinfoEndpoint || !revocationEndpoint) {return null} return { issuer, deviceAuthorizationEndpoint, tokenEndpoint, userinfoEndpoint, revocationEndpoint } } @@ -207,32 +209,32 @@ export interface DeviceAuthorizationChallenge { } function boundedString(value: unknown, maxBytes: number): string { - if (typeof value !== 'string') return '' + if (typeof value !== 'string') {return ''} const trimmed = value.trim() - if (trimmed === '' || utf8ByteLength(trimmed) > maxBytes) return '' + if (trimmed === '' || utf8ByteLength(trimmed) > maxBytes) {return ''} return trimmed } function positiveNumber(value: unknown, fallback: number, max: number): number { - if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return fallback + if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) {return fallback} return Math.min(max, value) } export function parseDeviceAuthorization(payload: unknown, accountOrigin: string): DeviceAuthorizationChallenge | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const deviceCode = boundedString(payload.device_code, 512) const userCode = boundedString(payload.user_code, 64) - if (!deviceCode || !userCode) return null - if (!isTrustedVerificationUri(payload.verification_uri, accountOrigin)) return null - const verificationUri = new URL(payload.verification_uri as string) + if (!deviceCode || !userCode) {return null} + if (!isTrustedVerificationUri(payload.verification_uri, accountOrigin)) {return null} + const verificationUri = new URL(payload.verification_uri) verificationUri.search = '' const advertisedComplete = payload.verification_uri_complete const hasAdvertisedComplete = advertisedComplete !== undefined && advertisedComplete !== null && advertisedComplete !== '' - if (hasAdvertisedComplete && !isTrustedVerificationUriComplete(advertisedComplete, accountOrigin)) return null + if (hasAdvertisedComplete && !isTrustedVerificationUriComplete(advertisedComplete, accountOrigin)) {return null} const complete = hasAdvertisedComplete - ? (advertisedComplete as string) + ? (advertisedComplete) : buildVerificationUriComplete(verificationUri.toString(), userCode) - if (!isTrustedVerificationUriComplete(complete, accountOrigin)) return null + if (!isTrustedVerificationUriComplete(complete, accountOrigin)) {return null} return { deviceCode, userCode, @@ -252,12 +254,12 @@ export interface PassportTokenResponse { } export function parseTokenResponse(payload: unknown): PassportTokenResponse | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const accessToken = boundedString(payload.access_token, MAX_SECRET_BYTES) const refreshToken = boundedString(payload.refresh_token, MAX_SECRET_BYTES) - if (!accessToken || !refreshToken) return null + if (!accessToken || !refreshToken) {return null} const tokenType = typeof payload.token_type === 'string' ? payload.token_type.trim().toLowerCase() : '' - if (tokenType !== '' && tokenType !== 'bearer') return null + if (tokenType !== '' && tokenType !== 'bearer') {return null} return { accessToken, refreshToken, @@ -276,9 +278,9 @@ export interface PassportUserInfo { } export function parseUserInfo(payload: unknown): PassportUserInfo | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const sub = boundedString(payload.sub, 256) - if (!sub) return null + if (!sub) {return null} return { sub, username: boundedString(payload.preferred_username, 256), @@ -298,16 +300,16 @@ export interface AuthorizationFailure { } export function parseOAuthError(payload: unknown): { error: string; description: string } | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const error = typeof payload.error === 'string' ? payload.error.trim() : '' - if (!error) return null + if (!error) {return null} return { error, description: typeof payload.error_description === 'string' ? payload.error_description : '' } } export function parseErrorEnvelope(payload: unknown): { code: string; message: string } | null { - if (!isRecord(payload) || !isRecord(payload.error)) return null + if (!isRecord(payload) || !isRecord(payload.error)) {return null} const code = typeof payload.error.code === 'string' ? payload.error.code.trim() : '' - if (!code) return null + if (!code) {return null} return { code, message: typeof payload.error.message === 'string' ? payload.error.message : '' } } @@ -381,9 +383,9 @@ export function describeAuthorizationFailure(status: number, payload: unknown, r retryAfterSeconds: retryAfter }) } - if (status === 429) return failure(ENVELOPE_MESSAGES.rate_limited, { retryable: true, retryAfterSeconds: retryAfter }) - if (status >= 500) return failure('鸽巢通行证服务暂时不可用,请稍后再试', { retryable: true, retryAfterSeconds: retryAfter }) - if (status === 401 || status === 403) return failure('登录服务拒绝了本次请求,请稍后再试', { terminal: true }) + if (status === 429) {return failure(ENVELOPE_MESSAGES.rate_limited, { retryable: true, retryAfterSeconds: retryAfter })} + if (status >= 500) {return failure('鸽巢通行证服务暂时不可用,请稍后再试', { retryable: true, retryAfterSeconds: retryAfter })} + if (status === 401 || status === 403) {return failure('登录服务拒绝了本次请求,请稍后再试', { terminal: true })} return failure('登录服务暂时不可用,请稍后再试', { terminal: status < 500 }) } @@ -436,19 +438,26 @@ export function signedOutAccountState(deviceListUrlValue: string, error = '', pe export function accountPhaseLabel(phase: AccountPhase): string { switch (phase) { - case 'creating': + case 'creating': { return '正在发起登录' - case 'awaiting-approval': + } + case 'awaiting-approval': { return '等待浏览器确认' - case 'finalizing': + } + case 'finalizing': { return '正在完成登录' - case 'restoring': + } + case 'restoring': { return '正在恢复登录状态' - case 'signing-out': + } + case 'signing-out': { return '正在退出登录' - case 'signed-in': + } + case 'signed-in': { return '已登录' - default: + } + default: { return '未登录' + } } } diff --git a/src/common/privacy.ts b/src/common/privacy.ts index 919860c3..956761e4 100644 --- a/src/common/privacy.ts +++ b/src/common/privacy.ts @@ -24,7 +24,7 @@ export const DEFAULT_PRIVACY_SETTINGS: PrivacySettings = { } export function resolvePrivacySettings(raw: Record | null | undefined): PrivacySettings { - if (!raw) return { ...DEFAULT_PRIVACY_SETTINGS } + if (!raw) {return { ...DEFAULT_PRIVACY_SETTINGS }} return { errorReportingEnabled: typeof raw.errorReportingEnabled === 'boolean' ? raw.errorReportingEnabled @@ -82,14 +82,14 @@ export const PRIVACY_DISCLOSURES: readonly PrivacyDisclosureItem[] = [ export function privacyDisclosureFor(key: PrivacySettingKey): PrivacyDisclosureItem { const item = PRIVACY_DISCLOSURES.find((entry) => entry.key === key) - if (!item) throw new Error(`Unknown privacy setting key: ${key}`) + if (!item) {throw new Error(`Unknown privacy setting key: ${key}`)} return item } export function filterPosthogEvent(event: T | null | undefined, privacy: PrivacySettings): T | null { - if (!event) return null + if (!event) {return null} const name = event.event ?? '' - if (name === '$exception') return privacy.errorReportingEnabled ? event : null - if (name === 'ai_prompt_submitted' || name.startsWith('$ai_')) return privacy.aiTelemetryEnabled ? event : null + if (name === '$exception') {return privacy.errorReportingEnabled ? event : null} + if (name === 'ai_prompt_submitted' || name.startsWith('$ai_')) {return privacy.aiTelemetryEnabled ? event : null} return privacy.telemetryEnabled ? event : null } diff --git a/src/common/resourceFailure.ts b/src/common/resourceFailure.ts index 8066a19b..245f041f 100644 --- a/src/common/resourceFailure.ts +++ b/src/common/resourceFailure.ts @@ -5,9 +5,9 @@ export interface RequestErrorShape { } export function isRequestErrorShape(reason: unknown): reason is RequestErrorShape { - if (!reason || typeof reason !== 'object' || reason instanceof Error || Array.isArray(reason)) return false + if (!reason || typeof reason !== 'object' || reason instanceof Error || Array.isArray(reason)) {return false} const keys = Object.keys(reason) - if (keys.length !== REQUEST_ERROR_KEYS.length) return false + if (keys.length !== REQUEST_ERROR_KEYS.length) {return false} return REQUEST_ERROR_KEYS.every((key) => keys.includes(key)) } diff --git a/src/common/terrainAvailability.ts b/src/common/terrainAvailability.ts index 70628624..8f31e359 100644 --- a/src/common/terrainAvailability.ts +++ b/src/common/terrainAvailability.ts @@ -6,13 +6,13 @@ interface AvailabilityFlagged { _hasAvailability?: boolean } -const availabilityStripped = new WeakSet() +const availabilityStripped = new WeakSet() export function withoutTileAvailability(terrain: Terrain): Terrain { availabilityStripped.add(terrain) const flagged = terrain as Terrain & AvailabilityFlagged flagged._hasAvailability = false - flagged.getTileDataAvailable = () => undefined + flagged.getTileDataAvailable = () => {} return terrain } @@ -47,7 +47,7 @@ export function attachOriginTerrainFallback< let resolvedOrigin: Terrain | undefined const getOriginProvider = (): Promise => { - if (resolvedOrigin) return Promise.resolve(resolvedOrigin) + if (resolvedOrigin) {return Promise.resolve(resolvedOrigin)} if (!originPromise) { originPromise = createOrigin().then( (origin) => { @@ -65,15 +65,15 @@ export function attachOriginTerrainFallback< mirrorProvider.requestTileGeometry = (x: number, y: number, level: number, request?: Request) => { if (fallenBackToOrigin) { - if (resolvedOrigin) return resolvedOrigin.requestTileGeometry(x, y, level, request) + if (resolvedOrigin) {return resolvedOrigin.requestTileGeometry(x, y, level, request)} return getOriginProvider().then((origin) => { const fallbackAttempt = origin.requestTileGeometry(x, y, level, request) - if (!fallbackAttempt) return Promise.reject(new Error('Origin terrain tile request deferred')) + if (!fallbackAttempt) {throw new Error('Origin terrain tile request deferred');} return fallbackAttempt }) } const attempt = mirrorRequestTileGeometry(x, y, level, request) - if (!attempt) return attempt + if (!attempt) {return attempt} return attempt.then( (tile) => { consecutiveFailures = 0 @@ -81,10 +81,10 @@ export function attachOriginTerrainFallback< }, async (error) => { consecutiveFailures += 1 - if (consecutiveFailures >= failureThreshold) fallenBackToOrigin = true + if (consecutiveFailures >= failureThreshold) {fallenBackToOrigin = true} const origin = await getOriginProvider() const fallbackAttempt = origin.requestTileGeometry(x, y, level, request) - if (!fallbackAttempt) throw error + if (!fallbackAttempt) {throw error} return fallbackAttempt } ) diff --git a/src/common/themeMode.ts b/src/common/themeMode.ts index e2d134c3..3c47bfb7 100644 --- a/src/common/themeMode.ts +++ b/src/common/themeMode.ts @@ -12,6 +12,6 @@ export function normalizeThemeMode(value: unknown): ThemeMode { } export function resolveTheme(mode: ThemeMode, systemPrefersDark: boolean): ResolvedTheme { - if (mode === 'system') return systemPrefersDark ? 'dark' : 'light' + if (mode === 'system') {return systemPrefersDark ? 'dark' : 'light'} return mode } diff --git a/src/common/tileMirror.ts b/src/common/tileMirror.ts index 5eca2938..0383280e 100644 --- a/src/common/tileMirror.ts +++ b/src/common/tileMirror.ts @@ -43,7 +43,7 @@ export const mirrorEndpoints: Record = { } } -export const MIRROR_ENDPOINT_PROBE_TIMEOUT_MS = 5_000 +export const MIRROR_ENDPOINT_PROBE_TIMEOUT_MS = 5000 export function isMirrorEndpointId(value: unknown): value is MirrorEndpointId { return value === 'edgeone' || value === 'cloudflare' @@ -96,8 +96,8 @@ export function selectBestMirrorEndpoint( const reachable = probes .filter((probe) => probe.ok && typeof probe.latencyMs === 'number' && Number.isFinite(probe.latencyMs)) .sort((a, b) => { - const diff = (a.latencyMs as number) - (b.latencyMs as number) - if (diff !== 0) return diff + const diff = a.latencyMs! - b.latencyMs! + if (diff !== 0) {return diff} return mirrorEndpointIds.indexOf(a.endpoint) - mirrorEndpointIds.indexOf(b.endpoint) }) return reachable[0]?.endpoint ?? fallback @@ -142,8 +142,8 @@ export function withinMirrorSatelliteDetail(longitude: number, latitude: number) } export function isValidTileCoordinate(level: number, x: number, y: number, maxLevel: number): boolean { - if (!Number.isInteger(level) || !Number.isInteger(x) || !Number.isInteger(y)) return false - if (level < 0 || level > maxLevel || x < 0 || y < 0) return false + if (!Number.isInteger(level) || !Number.isInteger(x) || !Number.isInteger(y)) {return false} + if (level < 0 || level > maxLevel || x < 0 || y < 0) {return false} const span = 2 ** level return x < span && y < span } @@ -157,13 +157,13 @@ export function mirrorTileUrl( endpoint: MirrorEndpointId = DEFAULT_MIRROR_ENDPOINT ): string | undefined { const maxLevel = mirrorMaxZoomByProvider[providerId] - if (maxLevel === undefined || !isValidTileCoordinate(level, x, y, maxLevel)) return undefined + if (maxLevel === undefined || !isValidTileCoordinate(level, x, y, maxLevel)) {return undefined} const baseUrl = mirrorBaseUrl(endpoint) - if (providerId === 'osm') return `${baseUrl}/tiles/osm/${level}/${x}/${y}.png` - if (providerId === 'esri-imagery') return `${baseUrl}/tiles/esri/${level}/${y}/${x}` - if (providerId === 'opentopomap') return `${baseUrl}/tiles/opentopo/${level}/${x}/${y}.png` + if (providerId === 'osm') {return `${baseUrl}/tiles/osm/${level}/${x}/${y}.png`} + if (providerId === 'esri-imagery') {return `${baseUrl}/tiles/esri/${level}/${y}/${x}`} + if (providerId === 'opentopomap') {return `${baseUrl}/tiles/opentopo/${level}/${x}/${y}.png`} if (providerId === 'viirs-night') { - if (typeof granuleDate !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(granuleDate)) return undefined + if (typeof granuleDate !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(granuleDate)) {return undefined} return `${baseUrl}/tiles/viirs/${granuleDate}/${level}/${y}/${x}.jpeg` } return undefined @@ -214,7 +214,7 @@ export function isTileMirrorMode(value: unknown): value is TileMirrorMode { } export function normalizeTileMirrorMode(value: unknown, legacyEnabled?: unknown): TileMirrorMode { - if (isTileMirrorMode(value)) return value + if (isTileMirrorMode(value)) {return value} return legacyEnabled === true ? 'on' : 'auto' } @@ -246,8 +246,8 @@ export function originProbeReachable(status: number): boolean { } export function isMirrorCoverageNotFound(status: number, headers: Pick): boolean { - if (status !== 404) return false - if (headers.get('x-proxy-upstream')) return true + if (status !== 404) {return false} + if (headers.get('x-proxy-upstream')) {return true} const contentType = headers.get('content-type') ?? '' return contentType.toLowerCase().includes('application/json') } @@ -267,7 +267,7 @@ export class TileMirrorRouter { private isMirrorFallbackActive(providerId: string): boolean { const until = this.mirrorFallbackUntil.get(providerId) - if (until === undefined) return false + if (until === undefined) {return false} if (this.now() >= until) { this.mirrorFallbackUntil.delete(providerId) this.mirrorFailures.delete(providerId) @@ -289,8 +289,8 @@ export class TileMirrorRouter { } sourceFor(providerId: string): TileSource { - if (this.mode === 'off') return 'origin' - if (this.mode === 'on') return this.isMirrorFallbackActive(providerId) ? 'origin' : 'mirror' + if (this.mode === 'off') {return 'origin'} + if (this.mode === 'on') {return this.isMirrorFallbackActive(providerId) ? 'origin' : 'mirror'} return this.reachability.get(providerId) === 'blocked' ? 'mirror' : 'origin' } @@ -299,7 +299,7 @@ export class TileMirrorRouter { } fallenBackProviders(providerIds: readonly string[]): string[] { - if (this.mode !== 'on') return [] + if (this.mode !== 'on') {return []} return providerIds.filter((providerId) => this.isMirrorFallbackActive(providerId)) } @@ -309,8 +309,8 @@ export class TileMirrorRouter { noteOriginSuccess(providerId: string): boolean { this.originFailures.set(providerId, 0) - if (this.mode !== 'auto') return false - if (this.reachability.get(providerId) !== 'blocked') return false + if (this.mode !== 'auto') {return false} + if (this.reachability.get(providerId) !== 'blocked') {return false} this.reachability.set(providerId, 'reachable') return true } @@ -318,9 +318,9 @@ export class TileMirrorRouter { noteOriginFailure(providerId: string): boolean { const failures = (this.originFailures.get(providerId) ?? 0) + 1 this.originFailures.set(providerId, failures) - if (this.mode !== 'auto') return false - if (failures < ORIGIN_FAILURES_BEFORE_MIRROR) return false - if (this.reachability.get(providerId) === 'blocked') return false + if (this.mode !== 'auto') {return false} + if (failures < ORIGIN_FAILURES_BEFORE_MIRROR) {return false} + if (this.reachability.get(providerId) === 'blocked') {return false} this.reachability.set(providerId, 'blocked') this.mirrorFailures.set(providerId, 0) return true @@ -332,12 +332,12 @@ export class TileMirrorRouter { const next: OriginReachability = reachable ? 'reachable' : 'blocked' const previous = this.reachability.get(providerId) ?? 'unknown' this.reachability.set(providerId, next) - if (this.mode !== 'auto') return false + if (this.mode !== 'auto') {return false} return previous !== next } nextMirrorFallbackExpiryAt(): number | null { - if (this.mode !== 'on') return null + if (this.mode !== 'on') {return null} let earliest: number | null = null const current = this.now() for (const [providerId, until] of [...this.mirrorFallbackUntil.entries()]) { @@ -345,43 +345,43 @@ export class TileMirrorRouter { this.mirrorFallbackUntil.delete(providerId) continue } - if (earliest === null || until < earliest) earliest = until + if (earliest === null || until < earliest) {earliest = until} } return earliest } noteMirrorSuccess(providerId: string, expectedGeneration?: number): void { - if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) return + if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) {return} this.mirrorFailures.set(providerId, 0) this.mirrorFallbackUntil.delete(providerId) } recordMirrorFailure(providerId: string, expectedGeneration?: number): boolean { - if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) return false + if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) {return false} if (this.mode === 'on') { - if (this.isMirrorFallbackActive(providerId)) return false + if (this.isMirrorFallbackActive(providerId)) {return false} } else if (this.mode === 'auto') { - if (this.reachability.get(providerId) !== 'blocked') return false + if (this.reachability.get(providerId) !== 'blocked') {return false} } else { return false } const failures = (this.mirrorFailures.get(providerId) ?? 0) + 1 this.mirrorFailures.set(providerId, failures) - if (failures < MIRROR_FAILURES_BEFORE_FALLBACK) return false + if (failures < MIRROR_FAILURES_BEFORE_FALLBACK) {return false} this.mirrorFailures.set(providerId, 0) return true } commitMirrorFallback(providerId: string, expectedGeneration?: number): boolean { - if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) return false + if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) {return false} if (this.mode === 'on') { - if (this.isMirrorFallbackActive(providerId)) return false + if (this.isMirrorFallbackActive(providerId)) {return false} this.mirrorFailures.set(providerId, 0) this.mirrorFallbackUntil.set(providerId, this.now() + MIRROR_FALLBACK_COOLDOWN_MS) return true } - if (this.mode !== 'auto') return false - if (this.reachability.get(providerId) !== 'blocked') return false + if (this.mode !== 'auto') {return false} + if (this.reachability.get(providerId) !== 'blocked') {return false} this.mirrorFailures.set(providerId, 0) this.originFailures.set(providerId, 0) this.reachability.set(providerId, 'reachable') @@ -389,7 +389,7 @@ export class TileMirrorRouter { } noteMirrorFailure(providerId: string, expectedGeneration?: number): boolean { - if (!this.recordMirrorFailure(providerId, expectedGeneration)) return false + if (!this.recordMirrorFailure(providerId, expectedGeneration)) {return false} return this.commitMirrorFallback(providerId, expectedGeneration) } @@ -402,7 +402,7 @@ export class TileMirrorRouter { } let hadFallback = false for (const id of [...this.mirrorFallbackUntil.keys()]) { - if (this.isMirrorFallbackActive(id)) hadFallback = true + if (this.isMirrorFallbackActive(id)) {hadFallback = true} } this.mirrorFailures.clear() this.mirrorFallbackUntil.clear() @@ -424,7 +424,7 @@ export class MirrorEndpointManager { private isEndpointFailed(endpoint: MirrorEndpointId): boolean { const until = this.failedUntil.get(endpoint) - if (until === undefined) return false + if (until === undefined) {return false} if (this.now() >= until) { this.failedUntil.delete(endpoint) this.failedAt.delete(endpoint) @@ -468,11 +468,11 @@ export class MirrorEndpointManager { this.preference = preference this.failedUntil.clear() this.failedAt.clear() - if (preference !== 'auto') { - this.active = preference - } else { + if (preference === 'auto') { const probes = this.getProbeResults() - if (probes.length > 0) this.active = selectBestMirrorEndpoint(probes, this.active) + if (probes.length > 0) {this.active = selectBestMirrorEndpoint(probes, this.active)} + } else { + this.active = preference } return this.active !== previousActive } @@ -509,13 +509,13 @@ export class MirrorEndpointManager { } tryFailover(failedEndpoint: MirrorEndpointId): MirrorEndpointId | null { - if (this.preference !== 'auto') return null - if (this.active !== failedEndpoint) return null + if (this.preference !== 'auto') {return null} + if (this.active !== failedEndpoint) {return null} const now = this.now() this.failedUntil.set(failedEndpoint, now + MIRROR_FALLBACK_COOLDOWN_MS) this.failedAt.set(failedEndpoint, now) const candidate = alternateMirrorEndpoint(failedEndpoint) - if (this.isEndpointFailed(candidate)) return null + if (this.isEndpointFailed(candidate)) {return null} this.active = candidate return candidate } diff --git a/src/common/tileProtocol.ts b/src/common/tileProtocol.ts index dd80ee97..63f7fd5b 100644 --- a/src/common/tileProtocol.ts +++ b/src/common/tileProtocol.ts @@ -1,6 +1,6 @@ export const TILE_FAILURE_STATUS = 502 -export const TILE_FETCH_TIMEOUT_MS = 8_000 +export const TILE_FETCH_TIMEOUT_MS = 8000 export const TILE_FETCH_ATTEMPTS = 3 @@ -29,11 +29,11 @@ export function tileRetryDelayMs(attempt: number, baseDelayMs = TILE_RETRY_BASE_ } function defaultSleep(ms: number): Promise { - return new Promise((resolve) => setTimeout(resolve, ms)) + return new Promise((resolve) => { setTimeout(resolve, ms) }) } function normalizeRetryAttempts(attempts: number | undefined): number { - if (attempts === undefined || !Number.isFinite(attempts)) return TILE_FETCH_ATTEMPTS + if (attempts === undefined || !Number.isFinite(attempts)) {return TILE_FETCH_ATTEMPTS} return Math.max(1, Math.trunc(attempts)) } @@ -53,14 +53,14 @@ export async function fetchTilePayloadWithRetry( const data = await response.arrayBuffer() return { ok: true, status: response.status, headers: response.headers, data } } - void response.body?.cancel().catch(() => undefined) + void response.body?.cancel().catch(() => {}) if (!isRetryableTileStatus(response.status) || attempt === attempts - 1) { return { ok: false, status: response.status, headers: response.headers } } await sleep(tileRetryDelayMs(attempt, baseDelayMs)) } catch (error) { lastError = error - if (attempt < attempts - 1) await sleep(tileRetryDelayMs(attempt, baseDelayMs)) + if (attempt < attempts - 1) {await sleep(tileRetryDelayMs(attempt, baseDelayMs))} } } throw lastError diff --git a/src/common/touchInteraction.ts b/src/common/touchInteraction.ts index 1c88de7a..206be0c6 100644 --- a/src/common/touchInteraction.ts +++ b/src/common/touchInteraction.ts @@ -16,7 +16,7 @@ export interface TouchEnvironment { } export function resolveTouchInteractionActive(mode: TouchInteractionMode, environment: TouchEnvironment): boolean { - if (mode === 'on') return true - if (mode === 'off') return false + if (mode === 'on') {return true} + if (mode === 'off') {return false} return environment.coarsePointer || environment.maxTouchPoints > 0 } diff --git a/src/main/account.ts b/src/main/account.ts index 08070544..a0627716 100644 --- a/src/main/account.ts +++ b/src/main/account.ts @@ -1,41 +1,10 @@ import { app, BrowserWindow, ipcMain, net, shell } from 'electron' -import { randomBytes } from 'crypto' -import { hostname } from 'os' -import { join } from 'path' +import { randomBytes } from 'node:crypto' +import { hostname } from 'node:os' +import { join } from 'node:path' import { logger } from '../common/logger' -import { - accountPhaseLabel, - buildDeviceName, - describeAuthorizationFailure, - deviceListUrl, - encodeBase64Url, - isValidDeviceName, - isValidInstallationId, - isTrustedVerificationUriComplete, - normalizeIssuer, - parseDeviceAuthorization, - parseDiscovery, - parseTokenResponse, - parseUserInfo, - passportPlatform, - retryAfterSeconds, - scopeParameter, - signedOutAccountState, - truncateToUtf8Bytes, - PASSPORT_DEFAULT_ACCOUNT_ORIGIN, - PASSPORT_DEFAULT_CLIENT_ID, - PASSPORT_DEFAULT_ISSUER, - PASSPORT_DEVICE_GRANT_TYPE, - PASSPORT_DISCOVERY_PATH, - PASSPORT_REFRESH_GRANT_TYPE, - PASSPORT_SCOPES, - SLOW_DOWN_INCREMENT_SECONDS, - type AccountPhase, - type AccountProfile, - type AccountState, - type PassportEndpoints, - type PassportTokenResponse -} from '../common/passport' +import { accountPhaseLabel, buildDeviceName, describeAuthorizationFailure, deviceListUrl, encodeBase64Url, isValidDeviceName, isValidInstallationId, isTrustedVerificationUriComplete, normalizeIssuer, parseDeviceAuthorization, parseDiscovery, parseTokenResponse, parseUserInfo, passportPlatform, retryAfterSeconds, scopeParameter, signedOutAccountState, truncateToUtf8Bytes, PASSPORT_DEFAULT_ACCOUNT_ORIGIN, PASSPORT_DEFAULT_CLIENT_ID, PASSPORT_DEFAULT_ISSUER, PASSPORT_DEVICE_GRANT_TYPE, PASSPORT_DISCOVERY_PATH, PASSPORT_REFRESH_GRANT_TYPE, PASSPORT_SCOPES, SLOW_DOWN_INCREMENT_SECONDS } from '../common/passport'; +import type { AccountPhase, AccountProfile, AccountState, PassportEndpoints, PassportTokenResponse } from '../common/passport'; import { clearProviderKey, readProviderKey, writeProviderKey } from './keyVault' import { readJson, serialQueue, writeJson } from './jsonStore' @@ -79,11 +48,11 @@ let restoring = false const enqueueAccount = serialQueue() function passportIssuer(): string { - return normalizeIssuer(process.env['GUEARTH_PASSPORT_ISSUER'] ?? PASSPORT_DEFAULT_ISSUER) || PASSPORT_DEFAULT_ISSUER + return normalizeIssuer(process.env.GUEARTH_PASSPORT_ISSUER ?? PASSPORT_DEFAULT_ISSUER) || PASSPORT_DEFAULT_ISSUER } function passportAccountOrigin(): string { - const raw = process.env['GUEARTH_PASSPORT_ACCOUNT_ORIGIN'] ?? PASSPORT_DEFAULT_ACCOUNT_ORIGIN + const raw = process.env.GUEARTH_PASSPORT_ACCOUNT_ORIGIN ?? PASSPORT_DEFAULT_ACCOUNT_ORIGIN try { return new URL(raw).origin } catch { @@ -92,7 +61,7 @@ function passportAccountOrigin(): string { } function passportClientId(): string { - const raw = process.env['GUEARTH_PASSPORT_CLIENT_ID'] ?? PASSPORT_DEFAULT_CLIENT_ID + const raw = process.env.GUEARTH_PASSPORT_CLIENT_ID ?? PASSPORT_DEFAULT_CLIENT_ID return truncateToUtf8Bytes(raw.trim(), 128) } @@ -113,7 +82,7 @@ function snapshot(): AccountState { function emitState(): void { const state = snapshot() for (const window of BrowserWindow.getAllWindows()) { - if (!window.isDestroyed()) window.webContents.send('account:event', state) + if (!window.isDestroyed()) {window.webContents.send('account:event', state)} } } @@ -160,7 +129,7 @@ async function readPayload(response: Response): Promise { async function resolveEndpoints(signal?: AbortSignal): Promise { const issuer = passportIssuer() const cached = endpoints - if (cached && cached.issuer === issuer && Date.now() - endpointsFetchedAt < DISCOVERY_TTL_MS) return cached + if (cached?.issuer === issuer && Date.now() - endpointsFetchedAt < DISCOVERY_TTL_MS) {return cached} const timeoutSignal = requestSignal(signal) try { const response = await net.fetch(`${issuer}${PASSPORT_DISCOVERY_PATH}`, { @@ -190,9 +159,9 @@ async function resolveEndpoints(signal?: AbortSignal): Promise - if (typeof record.profile !== 'object' || record.profile === null || Array.isArray(record.profile)) return null + if (typeof record.profile !== 'object' || record.profile === null || Array.isArray(record.profile)) {return null} const cached = record.profile as Record - if (typeof cached.sub !== 'string' || cached.sub === '') return null + if (typeof cached.sub !== 'string' || cached.sub === '') {return null} const scopes = Array.isArray(cached.scopes) ? cached.scopes.filter((scope): scope is string => typeof scope === 'string') : [] return { sub: cached.sub, @@ -267,7 +236,7 @@ function delay(ms: number, signal: AbortSignal): Promise { } function clampInterval(seconds: number): number { - if (!Number.isFinite(seconds) || seconds <= 0) return 5 + if (!Number.isFinite(seconds) || seconds <= 0) {return 5} return Math.min(MAX_POLL_INTERVAL_SECONDS, Math.max(1, Math.round(seconds))) } @@ -284,7 +253,7 @@ async function fetchUserInfo(token: string, signal?: AbortSignal): Promise= expiresAt) throw new Error('登录确认已超时,请重新发起登录') + if (Date.now() >= expiresAt) {throw new Error('登录确认已超时,请重新发起登录')} let tokens: PassportTokenResponse try { tokens = await requestToken( @@ -330,7 +299,7 @@ async function exchangeDeviceCode(deviceCode: string, initialInterval: number, e signal ) } catch (error) { - if (signal.aborted) throw new LoginCancelledError() + if (signal.aborted) {throw new LoginCancelledError()} const failure = error as Error & { terminal?: boolean; slowDown?: boolean; retryable?: boolean; retryAfterSeconds?: number } if (failure.slowDown) { interval = clampInterval(interval + SLOW_DOWN_INCREMENT_SECONDS) @@ -368,11 +337,11 @@ async function adoptTokens(tokens: PassportTokenResponse): Promise { - if (loginController) throw new Error('已有登录流程正在进行') - if (phase === 'signed-in') throw new Error('当前已登录,请先退出登录') + if (loginController) {throw new Error('已有登录流程正在进行')} + if (phase === 'signed-in') {throw new Error('当前已登录,请先退出登录')} if (readRefreshToken()) { await restoreSession() - if (snapshot().phase === 'signed-in') return snapshot() + if (snapshot().phase === 'signed-in') {return snapshot()} } const controller = new AbortController() loginController = controller @@ -383,8 +352,8 @@ async function startLogin(): Promise { setPhase('creating') const installation = installationId() const deviceName = buildDeviceName(hostname()) - if (!isValidInstallationId(installation)) throw new Error('本机安装标识无效,无法发起登录') - if (!isValidDeviceName(deviceName)) throw new Error('设备名称无效,无法发起登录') + if (!isValidInstallationId(installation)) {throw new Error('本机安装标识无效,无法发起登录')} + if (!isValidDeviceName(deviceName)) {throw new Error('设备名称无效,无法发起登录')} const created = await resolveEndpoints(controller.signal) const response = await postForm( created.deviceAuthorizationEndpoint, @@ -404,7 +373,7 @@ async function startLogin(): Promise { } const accountOrigin = passportAccountOrigin() const authorization = parseDeviceAuthorization(payload, accountOrigin) - if (!authorization) throw new Error('登录确认信息无效,请重新发起登录') + if (!authorization) {throw new Error('登录确认信息无效,请重新发起登录')} if (!isTrustedVerificationUriComplete(authorization.verificationUriComplete, accountOrigin)) { throw new Error('登录确认页地址不受信任,已终止本次登录') } @@ -417,13 +386,13 @@ async function startLogin(): Promise { } verificationUriComplete = authorization.verificationUriComplete setPhase('awaiting-approval') - void shell.openExternal(authorization.verificationUriComplete).catch(() => undefined) + void shell.openExternal(authorization.verificationUriComplete).catch(() => {}) const tokens = await exchangeDeviceCode(authorization.deviceCode, authorization.interval, expiresAt, controller.signal) - if (controller.signal.aborted) throw new LoginCancelledError() + if (controller.signal.aborted) {throw new LoginCancelledError()} setPhase('finalizing') await adoptTokens(tokens) adopted = true - if (controller.signal.aborted) throw new LoginCancelledError() + if (controller.signal.aborted) {throw new LoginCancelledError()} challenge = null verificationUriComplete = '' setPhase('signed-in') @@ -432,8 +401,8 @@ async function startLogin(): Promise { challenge = null verificationUriComplete = '' if (error instanceof LoginCancelledError || controller.signal.aborted) { - if (adopted) await discardAdoptedSession() - else setPhase('signed-out') + if (adopted) {await discardAdoptedSession()} + else {setPhase('signed-out')} return snapshot() } const message = error instanceof Error ? error.message : '登录失败,请稍后再试' @@ -450,25 +419,25 @@ function cancelLogin(): void { } function beginLogin(): Promise { - if (loginTask) return Promise.reject(new Error('已有登录流程正在进行')) + if (loginTask) {return Promise.reject(new Error('已有登录流程正在进行'))} const task = startLogin() loginTask = task void task.then( () => { - if (loginTask === task) loginTask = null + if (loginTask === task) {loginTask = null} }, () => { - if (loginTask === task) loginTask = null + if (loginTask === task) {loginTask = null} } ) return task } async function refreshAccessToken(): Promise { - if (accessToken && Date.now() < accessTokenExpiresAt - ACCESS_TOKEN_MARGIN_MS) return accessToken - if (refreshInFlight) return refreshInFlight + if (accessToken && Date.now() < accessTokenExpiresAt - ACCESS_TOKEN_MARGIN_MS) {return accessToken} + if (refreshInFlight) {return refreshInFlight} const refreshToken = readRefreshToken() - if (!refreshToken) throw new Error('登录状态已失效,请重新登录') + if (!refreshToken) {throw new Error('登录状态已失效,请重新登录')} const controller = new AbortController() const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS) const task = (async () => { @@ -491,7 +460,7 @@ async function refreshAccessToken(): Promise { return await task } catch (error) { const failure = error as Error & { invalidatesSession?: boolean } - if (failure.invalidatesSession) await endSessionLocally('登录状态已失效,请重新登录') + if (failure.invalidatesSession) {await endSessionLocally('登录状态已失效,请重新登录')} throw error } finally { refreshInFlight = null @@ -527,7 +496,7 @@ async function revokeRemote(refreshToken: string, signal: AbortSignal): Promise< body.set('token', refreshToken) body.set('token_type_hint', 'refresh_token') const response = await postForm(active.revocationEndpoint, body, signal) - if (response.ok) return true + if (response.ok) {return true} logger.warn('account', `Passport 撤销请求返回 HTTP ${response.status}`) return false } catch (error) { @@ -537,9 +506,9 @@ async function revokeRemote(refreshToken: string, signal: AbortSignal): Promise< } async function signOut(): Promise { - if (phase === 'signing-out') return snapshot() + if (phase === 'signing-out') {return snapshot()} cancelLogin() - await loginTask?.catch(() => undefined) + await loginTask?.catch(() => {}) const refreshToken = readRefreshToken() setPhase('signing-out') let revokedRemotely = true @@ -562,7 +531,7 @@ async function signOut(): Promise { } async function restoreSession(): Promise { - if (restoring) return + if (restoring) {return} const refreshToken = readRefreshToken() if (!refreshToken) { if (profile || signedInAt) { @@ -581,11 +550,11 @@ async function restoreSession(): Promise { const info = await fetchUserInfo(accessToken) profile = { ...info, scopes: profile?.scopes?.length ? profile.scopes : info.scopes } } catch (error) { - if ((error as Error & { invalidatesSession?: boolean }).invalidatesSession) throw error - if (!profile) throw error + if ((error as Error & { invalidatesSession?: boolean }).invalidatesSession) {throw error} + if (!profile) {throw error} logger.warn('account', '恢复登录状态时获取账户信息失败,已沿用本机缓存的账户信息', error) } - signedInAt = signedInAt || Date.now() + signedInAt ||= Date.now() pendingRemoteRevocation = false await persistAccount() setPhase('signed-in') @@ -603,7 +572,7 @@ async function restoreSession(): Promise { } async function dismissRevocationWarning(): Promise { - if (!pendingRemoteRevocation) return snapshot() + if (!pendingRemoteRevocation) {return snapshot()} pendingRemoteRevocation = false await persistAccount() setPhase('signed-out') @@ -612,13 +581,13 @@ async function dismissRevocationWarning(): Promise { async function openAccountDevices(): Promise { const url = accountDeviceListUrl() - if (!url) throw new Error('账号页地址不可用') + if (!url) {throw new Error('账号页地址不可用')} await shell.openExternal(url) } async function openVerificationPage(): Promise { const url = verificationUriComplete - if (!url || !isTrustedVerificationUriComplete(url, passportAccountOrigin())) throw new Error('当前没有可打开的登录确认页') + if (!url || !isTrustedVerificationUriComplete(url, passportAccountOrigin())) {throw new Error('当前没有可打开的登录确认页')} await shell.openExternal(url) } @@ -628,7 +597,7 @@ export function initAccount(): void { ipcMain.handle('account:login', (): Promise => beginLogin()) ipcMain.handle('account:cancel-login', async (): Promise => { cancelLogin() - await loginTask?.catch(() => undefined) + await loginTask?.catch(() => {}) return snapshot() }) ipcMain.handle('account:sign-out', (): Promise => signOut()) @@ -642,7 +611,7 @@ export function initAccount(): void { profile = persisted.profile signedInAt = persisted.signedInAt pendingRemoteRevocation = persisted.pendingRemoteRevocation - if (profile) emitState() + if (profile) {emitState()} } catch { profile = null } diff --git a/src/main/ai/agent.ts b/src/main/ai/agent.ts index 95b3e5a9..1931fbfa 100644 --- a/src/main/ai/agent.ts +++ b/src/main/ai/agent.ts @@ -1,5 +1,6 @@ import { randomUUID } from 'node:crypto' -import { ipcMain, net, type IpcMainInvokeEvent, type WebContents } from 'electron' +import { ipcMain, net } from 'electron'; +import type { IpcMainInvokeEvent, WebContents } from 'electron'; import type { AgentMemory, AiChatEvent, @@ -24,7 +25,8 @@ import type { AiChatHistoryStore } from './chatHistoryStore' import type { AiSettingsStore } from './settingsStore' import type { AiMemoryStore } from './memoryStore' import type { EoqHawdbClient } from './hawdb/client' -import { createTurnFlightGuard, evaluateFlightToolGuard, type TurnFlightGuard } from '../../common/flightStops' +import { createTurnFlightGuard, evaluateFlightToolGuard } from '../../common/flightStops'; +import type { TurnFlightGuard } from '../../common/flightStops'; import { formatTelemetryToolCalls, redactApiKey, sanitizeTelemetryMessages, sanitizeTelemetryToolSpan } from '../../common/aiTelemetry' import { captureAiGeneration, captureAiSpan } from './posthog' @@ -183,18 +185,18 @@ interface MemoryRuntime { } function selectMemoriesForPrompt(allMemories: AgentMemory[], recalled?: AgentMemory[]): AgentMemory[] { - if (allMemories.length <= MEMORY_FULL_INJECT_LIMIT) return allMemories + if (allMemories.length <= MEMORY_FULL_INJECT_LIMIT) {return allMemories} const selected: AgentMemory[] = [] const seen = new Set() for (const item of recalled ?? []) { - if (seen.has(item.id)) continue + if (seen.has(item.id)) {continue} seen.add(item.id) selected.push(item) - if (selected.length >= MEMORY_RECALL_LIMIT) break + if (selected.length >= MEMORY_RECALL_LIMIT) {break} } const recent = [...allMemories].slice(-MEMORY_RECENT_LIMIT).reverse() for (const item of recent) { - if (seen.has(item.id)) continue + if (seen.has(item.id)) {continue} seen.add(item.id) selected.push(item) } @@ -209,7 +211,7 @@ function memoryPromptLines(memories: AgentMemory[], totalCount: number): string[ '- 一次性的临时信息(当前视角、本次会话的临时问题与数据)不要保存。', '- 发现某条记忆过时或错误时,调用 delete_memory 按 id 删除,需要时再保存新的。' ] - if (!memories.length) return [...rules, '当前暂无已保存的用户记忆。'] + if (memories.length === 0) {return [...rules, '当前暂无已保存的用户记忆。']} const heading = totalCount > memories.length ? `与当前话题最相关及最近保存的用户记忆(共 ${totalCount} 条,展示 ${memories.length} 条,id:内容):` : '已保存的用户记忆(id:内容):' @@ -225,7 +227,7 @@ const SOCRATIC_PROMPT_LINES = [ function buildSystemPrompt(memory: MemoryRuntime, socratic = false, recalledMemories?: AgentMemory[]): string { const blocks = [SYSTEM_PROMPT] - if (socratic) blocks.push(SOCRATIC_PROMPT_LINES) + if (socratic) {blocks.push(SOCRATIC_PROMPT_LINES)} if (memory.enabled) { const allMemories = memory.store.list() blocks.push(...memoryPromptLines(selectMemoriesForPrompt(allMemories, recalledMemories), allMemories.length)) @@ -275,7 +277,7 @@ interface AgentSession { const MAX_TOOL_ROUNDS = 16 const TOOL_RESULT_LIMIT = 24_000 const RENDERER_TOOL_TIMEOUT_MS = 60_000 -const ANALYZE_TERRAIN_TIMEOUT_MS = 8_000 +const ANALYZE_TERRAIN_TIMEOUT_MS = 8000 const SEARCH_FAILURE_GUIDANCE_THRESHOLD = 3 const SEARCH_FAILURE_GUIDANCE = [ @@ -294,12 +296,12 @@ const watchedSenders = new WeakSet() function abortSenderWork(sender: WebContents): void { for (const [sessionId, session] of sessions) { - if (session.sender !== sender) continue + if (session.sender !== sender) {continue} session.controller.abort() sessions.delete(sessionId) } for (const [callId, entry] of pendingRendererTools) { - if (entry.sender !== sender) continue + if (entry.sender !== sender) {continue} clearTimeout(entry.timer) pendingRendererTools.delete(callId) entry.resolve({ ok: false, content: JSON.stringify({ error: '页面已关闭或刷新,工具执行中止' }) }) @@ -307,11 +309,11 @@ function abortSenderWork(sender: WebContents): void { } function watchSenderLifecycle(sender: WebContents): void { - if (watchedSenders.has(sender)) return + if (watchedSenders.has(sender)) {return} watchedSenders.add(sender) sender.on('destroyed', () => abortSenderWork(sender)) sender.on('did-start-navigation', (_event, _url, isInPlace, isMainFrame) => { - if (isInPlace || !isMainFrame) return + if (isInPlace || !isMainFrame) {return} abortSenderWork(sender) }) } @@ -326,20 +328,20 @@ function safeParseJson(text: string): Record { } function clampToolResult(value: string): string { - if (value.length <= TOOL_RESULT_LIMIT) return value + if (value.length <= TOOL_RESULT_LIMIT) {return value} return `${value.slice(0, TOOL_RESULT_LIMIT / 2)}\n…(结果过长已截断)…\n${value.slice(-TOOL_RESULT_LIMIT / 2)}` } function extractImage(value: unknown): ToolImage | undefined { - if (typeof value !== 'object' || value === null) return undefined + if (typeof value !== 'object' || value === null) {return undefined} const image = (value as Record).image - if (typeof image !== 'string') return undefined + if (typeof image !== 'string') {return undefined} const match = /^data:([^;]+);base64,(.+)$/.exec(image) return match ? { mediaType: match[1], data: match[2] } : undefined } function withoutImage(value: unknown): unknown { - if (typeof value !== 'object' || value === null) return value + if (typeof value !== 'object' || value === null) {return value} const { image, ...rest } = value as Record return image === undefined ? value : rest } @@ -352,31 +354,25 @@ function streamError(message: string): Error { function streamErrorText(payload: Record): string { const raw = payload.error - if (typeof raw === 'string' && raw) return raw + if (typeof raw === 'string' && raw) {return raw} if (typeof raw === 'object' && raw !== null) { const record = raw as Record - if (typeof record.message === 'string' && record.message) return record.message - if (typeof record.type === 'string' && record.type) return record.type + if (typeof record.message === 'string' && record.message) {return record.message} + if (typeof record.type === 'string' && record.type) {return record.type} } - if (!Array.isArray(payload.choices) && typeof payload.message === 'string' && payload.message) return payload.message + if (!Array.isArray(payload.choices) && typeof payload.message === 'string' && payload.message) {return payload.message} return '' } function imageUnsupported(error: unknown): boolean { - if (error instanceof Error && error.name === 'StreamError') return false + if (error instanceof Error && error.name === 'StreamError') {return false} const message = error instanceof Error ? error.message : String(error) return /image|vision|multimodal|modal|unsupported|不支持|图片/i.test(message) } -function stringifyArgSummary(args: unknown): string { - if (typeof args !== 'object' || args === null) return '' - const entries = Object.entries(args as Record).filter(([, value]) => value !== undefined) - return entries.map(([key, value]) => `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}`).join(' ') -} - function estimateTokens(text: string): number { let cjk = 0 - for (const char of text) if (/[\u4e00-\u9fff\u3000-\u303f\uff00-\uffef]/.test(char)) cjk += 1 + for (const char of text) {if (/[\u4E00-\u9FFF\u3000-\u303F\uFF00-\uFFEF]/.test(char)) {cjk += 1}} return cjk + Math.ceil((text.length - cjk) / 3.5) } @@ -397,9 +393,9 @@ function contextStatsForMessages(messages: WireMessage[], contextWindow: number) const cost = messageTokenCost(message) usedTokens += cost const category = categoryByKey.get(message.role) - if (category) category.tokens += cost + if (category) {category.tokens += cost} } - for (const category of categories) category.ratio = usedTokens ? Math.round(category.tokens / usedTokens * 100) : 0 + for (const category of categories) {category.ratio = usedTokens ? Math.round(category.tokens / usedTokens * 100) : 0} return { usedTokens, contextWindow, @@ -423,13 +419,13 @@ function contextMessagesForEntries(entries: AiContextEntry[], systemContent: str function retainedTurns(messages: WireMessage[]): AiChatTurn[] { return messages.flatMap((message): AiChatTurn[] => { - if (message.role !== 'user' && message.role !== 'assistant') return [] + if (message.role !== 'user' && message.role !== 'assistant') {return []} return [{ role: message.role, content: message.content }] }) } function trimHistory(messages: WireMessage[], contextWindow: number): WireMessage[] { - const budget = Math.max(2_000, Math.floor(contextWindow * 0.6)) + const budget = Math.max(2000, Math.floor(contextWindow * 0.6)) const system = messages.filter((message) => message.role === 'system') const rest = messages.filter((message) => message.role !== 'system') let total = system.reduce((sum, message) => sum + estimateTokens(message.content), 0) @@ -437,7 +433,7 @@ function trimHistory(messages: WireMessage[], contextWindow: number): WireMessag for (let index = rest.length - 1; index >= 0; index -= 1) { const message = rest[index] const cost = messageTokenCost(message) - if (kept.length >= 4 && total + cost > budget) break + if (kept.length >= 4 && total + cost > budget) {break} kept.unshift(message) total += cost } @@ -446,22 +442,22 @@ function trimHistory(messages: WireMessage[], contextWindow: number): WireMessag function apiEndpoint(baseUrl: string, protocol: AiProviderConfig['protocol'], path: string): string { let base = baseUrl.trim().replace(/\/+$/, '') - if (/^https?:\/\/[^/]+$/i.test(base)) base = `${base}/v1` + if (/^https?:\/\/[^/]+$/i.test(base)) {base = `${base}/v1`} return `${base}${path}` } function openaiThinkingBody(model: AiModelConfig, baseUrl: string): Record { - if (!model.thinking) return {} - if (/dashscope|qwen/i.test(baseUrl)) return { enable_thinking: true } + if (!model.thinking) {return {}} + if (/dashscope|qwen/i.test(baseUrl)) {return { enable_thinking: true }} return { reasoning_effort: model.thinkingLevel } } -const anthropicBudget: Record = { low: 1_024, medium: 4_096, high: 16_384 } +const anthropicBudget: Record = { low: 1024, medium: 4096, high: 16_384 } function toOpenAiMessages(messages: WireMessage[]): unknown[] { return messages.map((message) => { - if (message.role === 'system') return { role: 'system', content: message.content } - if (message.role === 'user') return { role: 'user', content: message.content } + if (message.role === 'system') {return { role: 'system', content: message.content }} + if (message.role === 'user') {return { role: 'user', content: message.content }} if (message.role === 'assistant') { const entry: Record = { role: 'assistant', content: message.content || '' } if (message.toolCalls?.length) { @@ -485,18 +481,16 @@ function toOpenAiMessages(messages: WireMessage[]): unknown[] { function toAnthropicMessages(messages: WireMessage[]): unknown[] { const result: { role: string; content: unknown }[] = [] for (const message of messages) { - if (message.role === 'system') continue + if (message.role === 'system') {continue} if (message.role === 'user') { result.push({ role: 'user', content: message.content }) continue } if (message.role === 'assistant') { - const blocks: Record[] = [ - ...(message.thinkingBlocks ?? []).map((block) => ({ type: 'thinking', thinking: block.thinking, signature: block.signature })) - ] - if (message.content) blocks.push({ type: 'text', text: message.content }) - for (const call of message.toolCalls ?? []) blocks.push({ type: 'tool_use', id: call.id, name: call.name, input: safeParseJson(call.arguments) }) - result.push({ role: 'assistant', content: blocks.length ? blocks : [{ type: 'text', text: '' }] }) + const blocks: Record[] = (message.thinkingBlocks ?? []).map((block) => ({ type: 'thinking', thinking: block.thinking, signature: block.signature })) + if (message.content) {blocks.push({ type: 'text', text: message.content })} + for (const call of message.toolCalls ?? []) {blocks.push({ type: 'tool_use', id: call.id, name: call.name, input: safeParseJson(call.arguments) })} + result.push({ role: 'assistant', content: blocks.length > 0 ? blocks : [{ type: 'text', text: '' }] }) continue } const content = message.image @@ -507,20 +501,20 @@ function toAnthropicMessages(messages: WireMessage[]): unknown[] { : message.content const block = { type: 'tool_result', tool_use_id: message.callId, content, is_error: message.isError === true } const last = result[result.length - 1] - if (last && last.role === 'user' && Array.isArray(last.content)) last.content.push(block) - else result.push({ role: 'user', content: [block] }) + if (last?.role === 'user' && Array.isArray(last.content)) {last.content.push(block)} + else {result.push({ role: 'user', content: [block] })} } return result } async function readSse(response: Response, onEvent: (data: string) => void): Promise { const reader = response.body?.getReader() - if (!reader) throw new Error('响应缺少数据流') + if (!reader) {throw new Error('响应缺少数据流')} const decoder = new TextDecoder() let buffer = '' for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) {break} buffer += decoder.decode(value, { stream: true }) let newlineIndex = buffer.indexOf('\n') while (newlineIndex >= 0) { @@ -528,7 +522,7 @@ async function readSse(response: Response, onEvent: (data: string) => void): Pro buffer = buffer.slice(newlineIndex + 1) if (line.startsWith('data:')) { const data = line.slice(5).trim() - if (data) onEvent(data) + if (data) {onEvent(data)} } newlineIndex = buffer.indexOf('\n') } @@ -571,8 +565,8 @@ function observabilityProvider(provider: AiProviderConfig): string { [/cerebras\.ai$/, 'cerebras'] ] const known = knownProviders.find(([pattern]) => pattern.test(hostname)) - if (known) return known[1] - const configuredName = provider.name.trim().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '') + if (known) {return known[1]} + const configuredName = provider.name.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g, '_').replaceAll(/^_+|_+$/g, '') return configuredName || provider.id } @@ -590,7 +584,7 @@ function captureModelGeneration(observability: AiObservabilityContext, provider: { role: 'assistant', content: result.text, - ...(result.toolCalls.length ? { tool_calls: formatTelemetryToolCalls(result.toolCalls) } : {}) + ...(result.toolCalls.length > 0 ? { tool_calls: formatTelemetryToolCalls(result.toolCalls) } : {}) } ] } @@ -599,7 +593,7 @@ function captureModelGeneration(observability: AiObservabilityContext, provider: requestUrl: apiEndpoint(provider.baseUrl, provider.protocol, provider.protocol === 'anthropic' ? '/messages' : '/chat/completions'), latencyMs: Date.now() - startedAt, stream: model.streaming, - ...(tools.length ? { tools } : {}), + ...(tools.length > 0 ? { tools } : {}), ...(failure ? { error: failure } : {}) }) } @@ -612,9 +606,9 @@ function httpFailureError(provider: AiProviderConfig, model: AiModelConfig, url: `接口:${url}` ] const requestId = response.headers.get('x-request-id') ?? response.headers.get('request-id') - if (requestId) parts.push(`请求ID:${requestId}`) + if (requestId) {parts.push(`请求ID:${requestId}`)} const detail = body.trim() - if (detail) parts.push(`服务端返回:${detail.slice(0, 1200)}`) + if (detail) {parts.push(`服务端返回:${detail.slice(0, 1200)}`)} return new Error(parts.join(';')) } @@ -622,9 +616,9 @@ async function fetchResponse(url: string, init: RequestInit, provider: AiProvide try { return await net.fetch(url, init) } catch (error) { - if (error instanceof DOMException && error.name === 'AbortError') throw error + if (error instanceof DOMException && error.name === 'AbortError') {throw error} const reason = error instanceof Error ? error.message : String(error) - throw new Error(`网络请求异常(供应商:${provider.name};模型:${model.id};接口:${url}):${reason}`) + throw new Error(`网络请求异常(供应商:${provider.name};模型:${model.id};接口:${url}):${reason}`, { cause: error }) } } @@ -647,8 +641,8 @@ function sleepAbortable(ms: number, signal: AbortSignal): Promise { signal.removeEventListener('abort', onAbort) reject(new DOMException('Aborted', 'AbortError')) } - if (signal.aborted) onAbort() - else signal.addEventListener('abort', onAbort) + if (signal.aborted) {onAbort()} + else {signal.addEventListener('abort', onAbort)} }) } @@ -658,14 +652,14 @@ async function fetchWithRetry(url: string, init: RequestInit, provider: AiProvid try { response = await fetchResponse(url, init, provider, model) } catch (error) { - if (isAbortError(error) || attempt >= MAX_LLM_RETRIES) throw error + if (isAbortError(error) || attempt >= MAX_LLM_RETRIES) {throw error} const reason = error instanceof Error ? error.message : String(error) const tail = reason.includes(':') ? reason.split(':').pop() ?? reason : reason onRetry?.(attempt + 1, MAX_LLM_RETRIES, `网络异常(${tail.slice(0, 60)})`) await sleepAbortable(RETRY_BASE_DELAY_MS * 2 ** attempt, signal) continue } - if (response.ok) return response + if (response.ok) {return response} const body = await response.text().catch(() => '') if (!RETRYABLE_STATUSES.has(response.status) || attempt >= MAX_LLM_RETRIES) { throw httpFailureError(provider, model, url, response, body) @@ -678,22 +672,22 @@ async function fetchWithRetry(url: string, init: RequestInit, provider: AiProvid async function fetchJson(url: string, init: RequestInit, provider: AiProviderConfig, model: AiModelConfig, signal: AbortSignal, onRetry?: (attempt: number, maxRetries: number, reason: string) => void): Promise> { const response = await fetchWithRetry(url, init, provider, model, signal, onRetry) const parsed: unknown = await response.json() - if (typeof parsed !== 'object' || parsed === null) throw new Error('响应格式错误') + if (typeof parsed !== 'object' || parsed === null) {throw new Error('响应格式错误')} return parsed as Record } function collectOpenAiToolCalls(raw: unknown): WireToolCall[] { - if (!Array.isArray(raw)) return [] + if (!Array.isArray(raw)) {return []} const byIndex = new Map() for (const [position, fragment] of raw.entries()) { - if (typeof fragment !== 'object' || fragment === null) continue + if (typeof fragment !== 'object' || fragment === null) {continue} const piece = fragment as { index?: unknown; id?: unknown; function?: { name?: unknown; arguments?: unknown } } const index = typeof piece.index === 'number' ? piece.index : position const current = byIndex.get(index) ?? { id: '', name: '', args: '' } - if (typeof piece.id === 'string' && piece.id) current.id = piece.id + if (typeof piece.id === 'string' && piece.id) {current.id = piece.id} if (piece.function) { - if (typeof piece.function.name === 'string' && piece.function.name && !current.name) current.name = piece.function.name - if (typeof piece.function.arguments === 'string') current.args += piece.function.arguments + if (typeof piece.function.name === 'string' && piece.function.name && !current.name) {current.name = piece.function.name} + if (typeof piece.function.arguments === 'string') {current.args += piece.function.arguments} } byIndex.set(index, current) } @@ -718,7 +712,7 @@ async function runOpenAiTurn(options: { messages: toOpenAiMessages(messages), ...openaiThinkingBody(model, provider.baseUrl) } - if (tools.length) { + if (tools.length > 0) { body.tools = tools.map((tool) => ({ type: 'function', function: { name: tool.name, description: tool.description, parameters: tool.parameters } })) body.tool_choice = 'auto' } @@ -726,11 +720,11 @@ async function runOpenAiTurn(options: { if (!model.streaming) { const json = await fetchJson(url, { method: 'POST', headers, body: JSON.stringify(body), signal }, provider, model, signal, onRetry) const jsonError = streamErrorText(json) - if (jsonError) throw streamError(`模型服务返回错误(${model.id}):${jsonError}`) + if (jsonError) {throw streamError(`模型服务返回错误(${model.id}):${jsonError}`)} const choice = Array.isArray(json.choices) && json.choices[0] && typeof json.choices[0] === 'object' ? json.choices[0] as Record : {} const message = typeof choice.message === 'object' && choice.message !== null ? choice.message as Record : {} const reasoning = typeof message.reasoning_content === 'string' ? message.reasoning_content : '' - if (reasoning) onReasoningDelta(reasoning) + if (reasoning) {onReasoningDelta(reasoning)} return { text: typeof message.content === 'string' ? message.content : '', reasoning, @@ -744,14 +738,14 @@ async function runOpenAiTurn(options: { let reasoning = '' const toolAccumulator = new Map() await readSse(response, (data) => { - if (data === '[DONE]') return + if (data === '[DONE]') {return} const json = safeParseJson(data) const errorText = streamErrorText(json) - if (errorText) throw streamError(`模型服务返回错误(${model.id}):${errorText}`) + if (errorText) {throw streamError(`模型服务返回错误(${model.id}):${errorText}`)} const choices = json.choices - if (!Array.isArray(choices) || !choices.length) return + if (!Array.isArray(choices) || choices.length === 0) {return} const delta = (typeof choices[0] === 'object' && choices[0] !== null ? (choices[0] as Record).delta : null) as Record | null - if (!delta) return + if (!delta) {return} if (typeof delta.content === 'string' && delta.content) { text += delta.content onTextDelta(delta.content) @@ -763,14 +757,14 @@ async function runOpenAiTurn(options: { } if (Array.isArray(delta.tool_calls)) { for (const fragment of delta.tool_calls) { - if (typeof fragment !== 'object' || fragment === null) continue + if (typeof fragment !== 'object' || fragment === null) {continue} const piece = fragment as { index?: unknown; id?: unknown; function?: { name?: unknown; arguments?: unknown } } const index = typeof piece.index === 'number' ? piece.index : 0 const current = toolAccumulator.get(index) ?? { id: '', name: '', args: '' } - if (typeof piece.id === 'string' && piece.id) current.id = piece.id + if (typeof piece.id === 'string' && piece.id) {current.id = piece.id} if (piece.function) { - if (typeof piece.function.name === 'string' && piece.function.name && !current.name) current.name = piece.function.name - if (typeof piece.function.arguments === 'string') current.args += piece.function.arguments + if (typeof piece.function.name === 'string' && piece.function.name && !current.name) {current.name = piece.function.name} + if (typeof piece.function.arguments === 'string') {current.args += piece.function.arguments} } toolAccumulator.set(index, current) } @@ -794,7 +788,7 @@ async function runAnthropicTurn(options: { const { provider, model, apiKey, messages, tools, signal, onTextDelta, onReasoningDelta, onRetry } = options const url = apiEndpoint(provider.baseUrl, provider.protocol, '/messages') const budgetTokens = anthropicBudget[model.thinkingLevel] ?? anthropicBudget.medium - const maxTokens = model.thinking ? Math.max(8_192, budgetTokens * 2) : 8_192 + const maxTokens = model.thinking ? Math.max(8192, budgetTokens * 2) : 8192 const systemContent = messages.find((message) => message.role === 'system')?.content ?? SYSTEM_PROMPT const body: Record = { model: model.id, @@ -802,19 +796,19 @@ async function runAnthropicTurn(options: { system: systemContent, messages: toAnthropicMessages(messages) } - if (model.thinking) body.thinking = { type: 'enabled', budget_tokens: budgetTokens } - if (tools.length) body.tools = tools.map((tool) => ({ name: tool.name, description: tool.description, input_schema: tool.parameters })) + if (model.thinking) {body.thinking = { type: 'enabled', budget_tokens: budgetTokens }} + if (tools.length > 0) {body.tools = tools.map((tool) => ({ name: tool.name, description: tool.description, input_schema: tool.parameters }))} const headers = { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' } if (!model.streaming) { const json = await fetchJson(url, { method: 'POST', headers, body: JSON.stringify(body), signal }, provider, model, signal, onRetry) const jsonError = streamErrorText(json) - if (jsonError) throw streamError(`模型服务返回错误(${model.id}):${jsonError}`) + if (jsonError) {throw streamError(`模型服务返回错误(${model.id}):${jsonError}`)} const blocks = Array.isArray(json.content) ? json.content.filter((block): block is Record => typeof block === 'object' && block !== null) : [] const text = blocks.filter((block) => block.type === 'text').map((block) => String(block.text ?? '')).join('') const thinkingBlocks = blocks.filter((block) => block.type === 'thinking').map((block) => ({ thinking: String(block.thinking ?? ''), signature: String(block.signature ?? '') })) const reasoning = thinkingBlocks.map((block) => block.thinking).join('') - if (reasoning) onReasoningDelta(reasoning) - if (text) onTextDelta(text) + if (reasoning) {onReasoningDelta(reasoning)} + if (text) {onTextDelta(text)} return { text, reasoning, @@ -831,7 +825,7 @@ async function runAnthropicTurn(options: { await readSse(response, (data) => { const json = safeParseJson(data) const type = json.type - if (type === 'error') throw streamError(`模型服务返回错误(${model.id}):${streamErrorText(json) || '未知错误'}`) + if (type === 'error') {throw streamError(`模型服务返回错误(${model.id}):${streamErrorText(json) || '未知错误'}`)} if (type === 'content_block_start') { const index = Number(json.index ?? 0) const block = typeof json.content_block === 'object' && json.content_block !== null ? json.content_block as Record : {} @@ -842,7 +836,7 @@ async function runAnthropicTurn(options: { const index = Number(json.index ?? 0) const block = blockTypes.get(index) const delta = typeof json.delta === 'object' && json.delta !== null ? json.delta as Record : {} - if (!block) return + if (!block) {return} if (delta.type === 'text_delta' && typeof delta.text === 'string') { text += delta.text onTextDelta(delta.text) @@ -859,9 +853,9 @@ async function runAnthropicTurn(options: { if (type === 'content_block_stop') { const index = Number(json.index ?? 0) const block = blockTypes.get(index) - if (!block) return - if (block.type === 'thinking' && block.thinking) thinkingBlocks.push({ thinking: block.thinking, signature: block.signature }) - if (block.type === 'tool_use' && block.name) toolCalls.push({ id: block.id || `call_${index}`, name: block.name, arguments: block.args || '{}' }) + if (!block) {return} + if (block.type === 'thinking' && block.thinking) {thinkingBlocks.push({ thinking: block.thinking, signature: block.signature })} + if (block.type === 'tool_use' && block.name) {toolCalls.push({ id: block.id || `call_${index}`, name: block.name, arguments: block.args || '{}' })} } }) const reasoning = thinkingBlocks.map((block) => block.thinking).join('') @@ -869,7 +863,7 @@ async function runAnthropicTurn(options: { } function emit(sender: WebContents, event: AiChatEvent): void { - if (sender.isDestroyed()) return + if (sender.isDestroyed()) {return} sender.send('ai:event', event) } @@ -911,7 +905,7 @@ async function runModelTurn(options: { try { return await invoke(messages) } catch (error) { - if (signal.aborted || !messages.some((message) => message.image) || !imageUnsupported(error)) throw error + if (signal.aborted || !messages.some((message) => message.image) || !imageUnsupported(error)) {throw error} return invoke(messages.map((message) => (message.image ? { ...message, image: undefined } : message))) } } @@ -942,7 +936,7 @@ async function executeTool( ): Promise { const startedAt = Date.now() const args = safeParseJson(argsJson) - if (name === 'web_search') args.query = typeof args.query === 'string' ? args.query.trim().slice(0, 500) : '' + if (name === 'web_search') {args.query = typeof args.query === 'string' ? args.query.trim().slice(0, 500) : ''} const callId = `${name}:${Date.now()}:${randomUUID()}` emit(sender, { sessionId, type: 'tool-start', callId, name, args }) let outcome: ToolOutcome @@ -965,11 +959,11 @@ async function executeTool( const limit = typeof args.limit === 'number' ? args.limit : 5 if (!query) { outcome = { ok: false, content: JSON.stringify({ error: '缺少检索关键词' }) } - } else if (!chatHistoryStore) { - outcome = { ok: false, content: JSON.stringify({ error: '历史对话检索暂不可用' }) } - } else { + } else if (chatHistoryStore) { const hits = await chatHistoryStore.search(query, limit) outcome = { ok: true, content: clampToolResult(JSON.stringify({ query, hits, total: hits.length })) } + } else { + outcome = { ok: false, content: JSON.stringify({ error: '历史对话检索暂不可用' }) } } } else if (name === 'web_search') { const result = await searchWeb(searchProvider, args.query, signal) @@ -981,7 +975,7 @@ async function executeTool( if (result.error) { const failures = (searchFailuresBySession.get(sessionId) ?? 0) + 1 searchFailuresBySession.set(sessionId, failures) - if (failures >= SEARCH_FAILURE_GUIDANCE_THRESHOLD) result.guidance = SEARCH_FAILURE_GUIDANCE + if (failures >= SEARCH_FAILURE_GUIDANCE_THRESHOLD) {result.guidance = SEARCH_FAILURE_GUIDANCE} } else { searchFailuresBySession.delete(sessionId) } @@ -1015,33 +1009,33 @@ async function executeTool( terrainTimer = setTimeout(() => resolve({ ok: false, content: JSON.stringify({ error: '地形查询超时' }) }), ANALYZE_TERRAIN_TIMEOUT_MS) }) ]) - if (terrainTimer) clearTimeout(terrainTimer) + if (terrainTimer) {clearTimeout(terrainTimer)} const terrain = safeParseJson(terrainOutcome.content) - if (typeof terrain.height === 'number') result.elevationMeters = terrain.height + if (typeof terrain.height === 'number') {result.elevationMeters = terrain.height} } outcome = { ok: !result.error, content: clampToolResult(JSON.stringify(result)) } } else if (name === 'save_memory') { - if (!memory?.enabled) { - outcome = { ok: false, content: JSON.stringify({ error: '记忆功能未开启,请在 AI 设置 → 记忆 中开启' }) } - } else { + if (memory?.enabled) { try { const saved = await memory.store.add(typeof args.content === 'string' ? args.content : '', 'agent') outcome = { ok: true, content: JSON.stringify({ memorySaved: true, id: saved.id, content: saved.content, message: '已写入记忆' }) } } catch (error) { outcome = { ok: false, content: JSON.stringify({ error: error instanceof Error ? error.message : '记忆写入失败' }) } } + } else { + outcome = { ok: false, content: JSON.stringify({ error: '记忆功能未开启,请在 AI 设置 → 记忆 中开启' }) } } } else if (name === 'delete_memory') { const id = typeof args.id === 'string' ? args.id.trim() : '' if (!memory?.enabled) { outcome = { ok: false, content: JSON.stringify({ error: '记忆功能未开启,请在 AI 设置 → 记忆 中开启' }) } - } else if (!id) { - outcome = { ok: false, content: JSON.stringify({ error: '缺少记忆 id' }) } - } else { + } else if (id) { const deleted = await memory.store.delete(id) outcome = deleted ? { ok: true, content: JSON.stringify({ memoryDeleted: true, id, message: '已删除记忆' }) } : { ok: false, content: JSON.stringify({ error: `未找到 id 为 ${id} 的记忆` }) } + } else { + outcome = { ok: false, content: JSON.stringify({ error: '缺少记忆 id' }) } } } else { outcome = await dispatchRendererTool(sender, sessionId, callId, name, guard.dispatchArgs) @@ -1060,7 +1054,7 @@ async function executeTool( input: sanitizedSpan.input, output: sanitizedSpan.output, latencyMs: Date.now() - startedAt, - ...(!outcome.ok ? { error: summarizeToolResult(outcome.content) } : {}) + ...(outcome.ok ? {} : { error: summarizeToolResult(outcome.content) }) }) return { ...outcome, callId, summary: summarizeToolResult(outcome.content) } } @@ -1086,7 +1080,7 @@ async function compressMessages(options: { const keepCount = Math.min(4, rest.length) const hasOlderMessages = rest.length > keepCount const older = hasOlderMessages ? rest.slice(0, rest.length - keepCount) : rest - if (!older.length) throw new Error('无法压缩上下文') + if (older.length === 0) {throw new Error('无法压缩上下文')} const transcript = older.map((message) => { const role = message.role === 'user' ? '用户' : message.role === 'assistant' ? '助手' : '工具' return `${role}:${message.content}` @@ -1117,7 +1111,7 @@ async function compressMessages(options: { throw error } const summary = summaryResult.text.trim() - if (!summary) throw new Error('无法压缩上下文') + if (!summary) {throw new Error('无法压缩上下文')} const summaryMessage: WireMessage = { role: 'assistant', content: `[上下文摘要]\n${summary}` } const kept = hasOlderMessages ? rest.slice(-keepCount) : [] const compressedMessages = [...(system ? [system] : []), summaryMessage, ...kept] @@ -1160,7 +1154,7 @@ async function runAgent(options: { for (const turn of turns) { if (turn.content.trim()) { conversationMessages.push({ role: turn.role, content: turn.content }) - if (turn.role === 'user') lastUserMessage = turn.content + if (turn.role === 'user') {lastUserMessage = turn.content} } } const recalledMemories = memory.enabled && memory.store.list().length > MEMORY_FULL_INJECT_LIMIT && lastUserMessage.trim() @@ -1172,7 +1166,7 @@ async function runAgent(options: { const historyTools = hawdb?.isReady() ? [SEARCH_CONVERSATIONS_TOOL] : [] const toolset: AiToolDefinition[] = [...tools.filter((tool) => !['retrieve_knowledge', 'search_conversations', 'search_place', 'web_search', 'save_memory', 'delete_memory', 'poi_statistics', 'analyze_location'].includes(tool.name)), KNOWLEDGE_TOOL, ...historyTools, SEARCH_PLACE_TOOL, POI_STATISTICS_TOOL, ANALYZE_LOCATION_TOOL, WEB_SEARCH_TOOL, ...memoryTools] for (let round = 0; round < MAX_TOOL_ROUNDS; round += 1) { - if (signal.aborted) throw new DOMException('Aborted', 'AbortError') + if (signal.aborted) {throw new DOMException('Aborted', 'AbortError')} const currentStats = contextStatsForMessages(messages, model.contextWindow) send({ sessionId, type: 'context-stats', stats: currentStats }) if (currentStats.usagePercent >= 80) { @@ -1200,8 +1194,8 @@ async function runAgent(options: { onRetry }) signal.throwIfAborted() - if (!model.streaming && result.text) send({ sessionId, type: 'text-delta', text: result.text }) - if (!result.toolCalls.length) { + if (!model.streaming && result.text) {send({ sessionId, type: 'text-delta', text: result.text })} + if (result.toolCalls.length === 0) { messages.push({ role: 'assistant', content: result.text }) if (!result.text.trim()) { send({ sessionId, type: 'error', message: result.reasoning.trim() ? '模型只返回了思考过程,没有给出结论,请重试' : '模型没有返回内容,请重试' }) @@ -1237,7 +1231,7 @@ async function runAgent(options: { onRetry }) signal.throwIfAborted() - if (!model.streaming && finalResult.text) send({ sessionId, type: 'text-delta', text: finalResult.text }) + if (!model.streaming && finalResult.text) {send({ sessionId, type: 'text-delta', text: finalResult.text })} messages.push({ role: 'assistant', content: finalResult.text }) if (!finalResult.text.trim()) { send({ sessionId, type: 'error', message: '工具调用轮次过多,已停止' }) @@ -1248,7 +1242,7 @@ async function runAgent(options: { function summarizeToolResult(content: string): string { const parsed = safeParseJson(content) - if (typeof parsed.error === 'string') return parsed.error.slice(0, 60) + if (typeof parsed.error === 'string') {return parsed.error.slice(0, 60)} if (parsed.status === 'queued' && typeof parsed.total === 'number') { const addedName = typeof parsed.addedName === 'string' && parsed.addedName ? `「${parsed.addedName}」` : '' return `已加入地点列表${addedName}(共 ${parsed.total} 个,停留在第 1 个)` @@ -1258,21 +1252,21 @@ function summarizeToolResult(content: string): string { const label = typeof current === 'string' && current ? `「${current}」` : '' return `已创建 ${parsed.stops.length} 个地点,停留在 1/${parsed.stops.length}${label}` } - if (typeof parsed.message === 'string' && parsed.message.trim()) return parsed.message.slice(0, 60) - if (parsed.memorySaved === true) return `已记住:${typeof parsed.content === 'string' ? parsed.content.slice(0, 40) : ''}` - if (parsed.memoryDeleted === true) return '已删除记忆' - if (Array.isArray(parsed.hits)) return parsed.hits.length ? `${parsed.hits.length} 条历史对话` : '未找到相关历史对话' - if (Array.isArray(parsed.matches)) return parsed.matches.length ? `${parsed.matches.length} 条知识条目` : '知识库未命中' - if (Array.isArray(parsed.references)) return parsed.references.length ? `${parsed.references.length} 条来源` : '未找到相关网页' - if (Array.isArray(parsed.places)) return `${parsed.places.length} 个地点` - if (parsed.status === 'vision_disabled') return '模型未开启视觉,已返回文字视角' - if (parsed.screenshot) return '已截图' - if (Array.isArray(parsed.shapes)) return `${parsed.shapes.length} 个标注` - if (typeof parsed.removed === 'number') return `已删除 ${parsed.removed} 个标注` - if (typeof parsed.added === 'number') return `已添加标记 ${parsed.added} 个${typeof parsed.skipped === 'number' ? `(${parsed.skipped} 个无效跳过)` : ''}` - if (typeof parsed.name === 'string' && parsed.name) return parsed.kind === 'point' ? `已添加标记「${parsed.name}」` : `已绘制「${parsed.name}」` - if (typeof parsed.measurement === 'string' && parsed.measurement) return parsed.measurement - if (typeof parsed.height === 'number') return `海拔 ${Math.round(parsed.height)} m` + if (typeof parsed.message === 'string' && parsed.message.trim()) {return parsed.message.slice(0, 60)} + if (parsed.memorySaved === true) {return `已记住:${typeof parsed.content === 'string' ? parsed.content.slice(0, 40) : ''}`} + if (parsed.memoryDeleted === true) {return '已删除记忆'} + if (Array.isArray(parsed.hits)) {return parsed.hits.length > 0 ? `${parsed.hits.length} 条历史对话` : '未找到相关历史对话'} + if (Array.isArray(parsed.matches)) {return parsed.matches.length > 0 ? `${parsed.matches.length} 条知识条目` : '知识库未命中'} + if (Array.isArray(parsed.references)) {return parsed.references.length > 0 ? `${parsed.references.length} 条来源` : '未找到相关网页'} + if (Array.isArray(parsed.places)) {return `${parsed.places.length} 个地点`} + if (parsed.status === 'vision_disabled') {return '模型未开启视觉,已返回文字视角'} + if (parsed.screenshot) {return '已截图'} + if (Array.isArray(parsed.shapes)) {return `${parsed.shapes.length} 个标注`} + if (typeof parsed.removed === 'number') {return `已删除 ${parsed.removed} 个标注`} + if (typeof parsed.added === 'number') {return `已添加标记 ${parsed.added} 个${typeof parsed.skipped === 'number' ? `(${parsed.skipped} 个无效跳过)` : ''}`} + if (typeof parsed.name === 'string' && parsed.name) {return parsed.kind === 'point' ? `已添加标记「${parsed.name}」` : `已绘制「${parsed.name}」`} + if (typeof parsed.measurement === 'string' && parsed.measurement) {return parsed.measurement} + if (typeof parsed.height === 'number') {return `海拔 ${Math.round(parsed.height)} m`} if (parsed.province === '全国' && typeof parsed.populationWan === 'number' && typeof parsed.urbanizationPct === 'number') { return `${parsed.province}:人口 ${parsed.populationWan} 万、城镇化 ${parsed.urbanizationPct}%` } @@ -1280,7 +1274,7 @@ function summarizeToolResult(content: string): string { const population = typeof parsed.populationWan === 'number' ? `人口 ${parsed.populationWan} 万、` : '' return `${parsed.province}:${population}密度约 ${parsed.densityPerKm2} 人/km²` } - if (typeof parsed.longitude === 'number') return '已定位' + if (typeof parsed.longitude === 'number') {return '已定位'} const center = typeof parsed.center === 'object' && parsed.center !== null ? parsed.center as { name?: unknown } : null if (center && Array.isArray(parsed.categories)) { const name = typeof center.name === 'string' && center.name ? center.name : '该地点' @@ -1291,21 +1285,21 @@ function summarizeToolResult(content: string): string { } function validateTurns(turns: unknown): AiChatTurn[] { - if (!Array.isArray(turns)) throw new Error('无效的对话历史') + if (!Array.isArray(turns)) {throw new TypeError('无效的对话历史')} return turns.flatMap((turn): AiChatTurn[] => { - if (typeof turn !== 'object' || turn === null) return [] + if (typeof turn !== 'object' || turn === null) {return []} const record = turn as { role?: unknown; content?: unknown } - if ((record.role !== 'user' && record.role !== 'assistant') || typeof record.content !== 'string') return [] + if ((record.role !== 'user' && record.role !== 'assistant') || typeof record.content !== 'string') {return []} return [{ role: record.role, content: record.content.slice(0, 20_000) }] }) } function validateContextEntries(entries: unknown): AiContextEntry[] { - if (!Array.isArray(entries)) throw new Error('无效的上下文') + if (!Array.isArray(entries)) {throw new TypeError('无效的上下文')} return entries.flatMap((entry): AiContextEntry[] => { - if (typeof entry !== 'object' || entry === null) return [] + if (typeof entry !== 'object' || entry === null) {return []} const record = entry as { role?: unknown; content?: unknown; callId?: unknown; name?: unknown; isError?: unknown } - if ((record.role !== 'user' && record.role !== 'assistant' && record.role !== 'tool') || typeof record.content !== 'string') return [] + if ((record.role !== 'user' && record.role !== 'assistant' && record.role !== 'tool') || typeof record.content !== 'string') {return []} return [{ role: record.role, content: record.content.slice(0, TOOL_RESULT_LIMIT), @@ -1317,15 +1311,15 @@ function validateContextEntries(entries: unknown): AiContextEntry[] { } function validateChatRequest(sessionId: unknown, turns: unknown, tools: unknown, aiSessionId: unknown, distinctId: unknown): { sessionId: string; aiSessionId: string; distinctId: string; turns: AiChatTurn[]; tools: AiToolDefinition[] } { - if (typeof sessionId !== 'string' || !/^[a-zA-Z0-9_-]{1,64}$/.test(sessionId)) throw new Error('无效的会话标识') + if (typeof sessionId !== 'string' || !/^[a-zA-Z0-9_-]{1,64}$/.test(sessionId)) {throw new Error('无效的会话标识')} const normalizedAiSessionId = typeof aiSessionId === 'string' && /^[a-zA-Z0-9_-]{1,64}$/.test(aiSessionId) ? aiSessionId : sessionId const normalizedDistinctId = typeof distinctId === 'string' ? distinctId.trim().slice(0, 256) : '' const normalizedTurns = validateTurns(turns) const normalizedTools = Array.isArray(tools) ? tools.flatMap((tool): AiToolDefinition[] => { - if (typeof tool !== 'object' || tool === null) return [] + if (typeof tool !== 'object' || tool === null) {return []} const record = tool as { name?: unknown; description?: unknown; parameters?: unknown } - if (typeof record.name !== 'string' || !/^[a-z0-9_]{1,64}$/i.test(record.name) || typeof record.description !== 'string') return [] - return [{ name: record.name, description: record.description.slice(0, 2_000), parameters: typeof record.parameters === 'object' && record.parameters !== null ? record.parameters as Record : { type: 'object', properties: {} } }] + if (typeof record.name !== 'string' || !/^[a-z0-9_]{1,64}$/i.test(record.name) || typeof record.description !== 'string') {return []} + return [{ name: record.name, description: record.description.slice(0, 2000), parameters: typeof record.parameters === 'object' && record.parameters !== null ? record.parameters as Record : { type: 'object', properties: {} } }] }) : [] return { sessionId, aiSessionId: normalizedAiSessionId, distinctId: normalizedDistinctId, turns: normalizedTurns, tools: normalizedTools } } @@ -1344,32 +1338,32 @@ export function registerAiIpcHandlers( ipcMain.handle('ai:history-get', (_event, id: unknown) => typeof id === 'string' ? chatHistoryStore.get(id) : null) ipcMain.handle('ai:history-save', (_event, value: unknown) => chatHistoryStore.save(value)) ipcMain.handle('ai:history-delete', (_event, id: unknown) => { - if (typeof id !== 'string' || !id) return chatHistoryStore.list() + if (typeof id !== 'string' || !id) {return chatHistoryStore.list()} return chatHistoryStore.delete(id) }) ipcMain.handle('ai:history-search', (_event, query: unknown, limit: unknown, excludeId: unknown) => { - if (typeof query !== 'string' || !query.trim()) return [] + if (typeof query !== 'string' || !query.trim()) {return []} const capped = typeof limit === 'number' && Number.isFinite(limit) ? limit : 5 return chatHistoryStore.search(query, capped, typeof excludeId === 'string' ? excludeId : undefined) }) ipcMain.handle('ai:memory-list', () => memoryStore.list()) ipcMain.handle('ai:memory-add', async (_event, content: unknown) => { - if (typeof content !== 'string') throw new Error('无效的记忆内容') + if (typeof content !== 'string') {throw new TypeError('无效的记忆内容')} await memoryStore.add(content, 'user') return memoryStore.list() }) ipcMain.handle('ai:memory-delete', async (_event, id: unknown) => { - if (typeof id !== 'string' || !id.trim()) throw new Error('无效的记忆标识') - if (!await memoryStore.delete(id.trim())) throw new Error('未找到该记忆,可能已被删除') + if (typeof id !== 'string' || !id.trim()) {throw new Error('无效的记忆标识')} + if (!await memoryStore.delete(id.trim())) {throw new Error('未找到该记忆,可能已被删除')} return memoryStore.list() }) ipcMain.handle('ai:memory-recall', (_event, query: unknown, limit: unknown) => { - if (typeof query !== 'string' || !query.trim()) return [] + if (typeof query !== 'string' || !query.trim()) {return []} const capped = typeof limit === 'number' && Number.isFinite(limit) ? limit : 8 return memoryStore.recall(query, capped) }) ipcMain.handle('ai:hawdb-status', async () => { - if (hawdb?.isReady()) return hawdb.status() + if (hawdb?.isReady()) {return hawdb.status()} return { ready: false, storageMode: 'disk' as const, @@ -1392,9 +1386,9 @@ export function registerAiIpcHandlers( const settings = settingsStore.snapshot() const provider = settings.providers.find((item) => item.id === settings.activeProviderId) const model = provider?.models.find((item) => item.id === settings.activeModelId) - if (!provider || !model) throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认') + if (!provider || !model) {throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认')} const apiKey = readProviderKey(`ai-${provider.id}`) - if (!apiKey) throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`) + if (!apiKey) {throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`)} const controller = new AbortController() const normalizedAiSessionId = typeof aiSessionId === 'string' && /^[a-zA-Z0-9_-]{1,64}$/.test(aiSessionId) ? aiSessionId : null const normalizedDistinctId = typeof distinctId === 'string' ? distinctId.trim().slice(0, 256) : '' @@ -1420,9 +1414,9 @@ export function registerAiIpcHandlers( const searchProvider = settings.searchProviders.find((item) => item.id === settings.activeSearchProviderId) const provider = settings.providers.find((item) => item.id === settings.activeProviderId) const model = provider?.models.find((item) => item.id === settings.activeModelId) - if (!provider || !model) throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认') + if (!provider || !model) {throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认')} const apiKey = readProviderKey(`ai-${provider.id}`) - if (!apiKey) throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`) + if (!apiKey) {throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`)} const existing = sessions.get(request.sessionId) existing?.controller.abort() const controller = new AbortController() @@ -1443,17 +1437,17 @@ export function registerAiIpcHandlers( }) .finally(() => { searchFailuresBySession.delete(request.sessionId) - if (sessions.get(request.sessionId)?.sender === sender) sessions.delete(request.sessionId) + if (sessions.get(request.sessionId)?.sender === sender) {sessions.delete(request.sessionId)} }) }) ipcMain.handle('ai:stop', (_event, sessionId: unknown) => { - if (typeof sessionId !== 'string') return + if (typeof sessionId !== 'string') {return} sessions.get(sessionId)?.controller.abort() }) ipcMain.handle('ai:tool-result', (_event, sessionId: unknown, callId: unknown, ok: unknown, result: unknown) => { - if (typeof sessionId !== 'string' || typeof callId !== 'string') return + if (typeof sessionId !== 'string' || typeof callId !== 'string') {return} const entry = pendingRendererTools.get(callId) - if (!entry) return + if (!entry) {return} clearTimeout(entry.timer) pendingRendererTools.delete(callId) const image = extractImage(result) @@ -1463,6 +1457,6 @@ export function registerAiIpcHandlers( } function signalAborted(controller: AbortController, error: unknown): boolean { - if (controller.signal.aborted) return true + if (controller.signal.aborted) {return true} return error instanceof Error && /abort/i.test(error.message) } diff --git a/src/main/ai/amap.ts b/src/main/ai/amap.ts index 0bfa8cd8..d529864c 100644 --- a/src/main/ai/amap.ts +++ b/src/main/ai/amap.ts @@ -1,6 +1,6 @@ -import { createHash } from 'crypto' +import { createHash } from 'node:crypto' import { net } from 'electron' -import type { PoiCategoryCount, PoiStatisticsRequest, PoiStatisticsResult } from '../../common/poiStatistics' +import type { PoiStatisticsRequest, PoiStatisticsResult } from '../../common/poiStatistics' import { gcj02ToWgs84, wgs84ToGcj02 } from '../geo' import { readProviderKey } from '../keyVault' import { @@ -53,7 +53,7 @@ function toPlaces(pois: AmapPoi[]): AmapPlace[] { const location = typeof poi.location === 'string' ? poi.location.split(',') : [] const longitude = Number(location[0]) const latitude = Number(location[1]) - if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) return [] + if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {return []} const [wgsLongitude, wgsLatitude] = gcj02ToWgs84(longitude, latitude) const text = (value: unknown): string => (typeof value === 'string' ? value : '') return [{ @@ -77,16 +77,16 @@ interface AmapPoisResponse { } function parsePois(body: unknown): AmapPoisResponse { - if (typeof body !== 'object' || body === null) return { pois: [], total: 0, error: '高德返回了无效响应' } + if (typeof body !== 'object' || body === null) {return { pois: [], total: 0, error: '高德返回了无效响应' }} const result = body as { status?: unknown; info?: unknown; infocode?: unknown; count?: unknown; pois?: unknown } if (result.status !== '1') { - if (result.infocode === '10009') return { pois: [], total: 0, error: '高德 Key 的平台类型不匹配,请在高德控制台配置「Web 服务」类型的 Key (10009)' } + if (result.infocode === '10009') {return { pois: [], total: 0, error: '高德 Key 的平台类型不匹配,请在高德控制台配置「Web 服务」类型的 Key (10009)' }} const info = typeof result.info === 'string' ? result.info : '未知错误' const code = typeof result.infocode === 'string' ? ` (${result.infocode})` : '' const retryable = !/DAILY/i.test(info) && /QPS|FREQUENT/i.test(info) return { pois: [], total: 0, error: `高德地点搜索失败:${info}${code}`, retryable } } - if (!Array.isArray(result.pois)) return { pois: [], total: 0, error: '高德返回了无效地点数据' } + if (!Array.isArray(result.pois)) {return { pois: [], total: 0, error: '高德返回了无效地点数据' }} const total = typeof result.count === 'string' || typeof result.count === 'number' ? Number(result.count) : 0 return { pois: result.pois.filter((poi): poi is AmapPoi => typeof poi === 'object' && poi !== null), total: Number.isFinite(total) ? total : 0 } } @@ -121,9 +121,9 @@ function requestUrl(base: string, params: Record, securityKey?: return `${base}?${query.join('&')}` } -const SEARCH_MIN_INTERVAL_MS = 1_000 +const SEARCH_MIN_INTERVAL_MS = 1000 const SEARCH_MAX_RETRIES = 2 -const SEARCH_RETRY_DELAY_MS = 2_000 +const SEARCH_RETRY_DELAY_MS = 2000 const SEARCH_REQUEST_TIMEOUT_MS = 10_000 const amapThrottle = createSearchThrottle(SEARCH_MIN_INTERVAL_MS) @@ -175,7 +175,7 @@ export async function poiStatistics(request: PoiStatisticsRequest): Promise requestPois(url)) if (!first) { @@ -231,10 +231,10 @@ export async function poiStatistics(request: PoiStatisticsRequest): Promise = { ...aroundParams, page: String(page) } const pageUrl = requestUrl('https://restapi.amap.com/v3/place/around', pageParams, securityKey) const pageResult = await amapThrottle.run(() => requestPois(pageUrl)) - if (!pageResult || pageResult.error || pageResult.pois.length === 0) break + if (!pageResult || pageResult.error || pageResult.pois.length === 0) {break} pagesFetched = page aggregatePois(aggregation, pageResult.pois) - if (pageResult.pois.length < POI_STATS_PAGE_SIZE) break + if (pageResult.pois.length < POI_STATS_PAGE_SIZE) {break} } } const truncated = poiTruncated(reportedTotal, pagesFetched) @@ -255,9 +255,9 @@ export async function poiStatistics(request: PoiStatisticsRequest): Promise { const keywords = query.trim().slice(0, 90) - if (!keywords) return { query, places: [], error: '缺少搜索关键词' } + if (!keywords) {return { query, places: [], error: '缺少搜索关键词' }} const isSuperseded = (): boolean => isPlacesRequestSuperseded(requestId) - if (isSuperseded()) return { query, places: [], superseded: true } + if (isSuperseded()) {return { query, places: [], superseded: true }} const key = readProviderKey('amap') const securityKey = readProviderKey('amap-sk') if (!key) { @@ -268,19 +268,19 @@ export async function searchPlaces(query: string, city?: string, requestId?: num } } const params: Record = { key, keywords, offset: '8', page: '1', extensions: 'base' } - if (city?.trim()) params.city = city.trim().slice(0, 40) + if (city?.trim()) {params.city = city.trim().slice(0, 40)} const url = requestUrl('https://restapi.amap.com/v3/place/text', params, securityKey) const first = await amapThrottle.run(() => requestPois(url), isSuperseded) - if (!first) return { query, places: [], superseded: true } + if (!first) {return { query, places: [], superseded: true }} let result = first for (let attempt = 1; result.error !== undefined && result.retryable === true && attempt <= SEARCH_MAX_RETRIES; attempt += 1) { await delay(SEARCH_RETRY_DELAY_MS * attempt) const next = await amapThrottle.run(() => requestPois(url), isSuperseded) - if (!next) return { query, places: [], superseded: true } + if (!next) {return { query, places: [], superseded: true }} result = next } - if (result.error) return { query, places: [], error: result.error } + if (result.error) {return { query, places: [], error: result.error }} const places = toPlaces(result.pois).slice(0, 8) - if (places.length === 0) return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' } + if (places.length === 0) {return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' }} return { query, places } } diff --git a/src/main/ai/baidu.ts b/src/main/ai/baidu.ts index a2b3875b..f01a5128 100644 --- a/src/main/ai/baidu.ts +++ b/src/main/ai/baidu.ts @@ -1,4 +1,4 @@ -import { createHash } from 'crypto' +import { createHash } from 'node:crypto' import { net } from 'electron' import type { PlaceSearchResult, PlaceSuggestion } from '../../preload' import { gcj02ToWgs84 } from '../geo' @@ -21,9 +21,9 @@ interface BaiduSuggestionsResponse { retryable?: boolean } -const SEARCH_MIN_INTERVAL_MS = 1_000 +const SEARCH_MIN_INTERVAL_MS = 1000 const SEARCH_MAX_RETRIES = 2 -const SEARCH_RETRY_DELAY_MS = 2_000 +const SEARCH_RETRY_DELAY_MS = 2000 const SEARCH_REQUEST_TIMEOUT_MS = 10_000 const SUGGEST_PATH = '/place/v3/suggestion' const baiduThrottle = createSearchThrottle(SEARCH_MIN_INTERVAL_MS) @@ -38,13 +38,13 @@ function roundCoordinate(value: number): number { function toPlaces(results: BaiduSuggestion[]): PlaceSuggestion[] { return results.flatMap((result) => { - if (typeof result.location !== 'object' || result.location === null) return [] + if (typeof result.location !== 'object' || result.location === null) {return []} const location = result.location as { lng?: unknown; lat?: unknown } const longitude = location.lng const latitude = location.lat - if (typeof longitude !== 'number' || typeof latitude !== 'number') return [] - if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) return [] - if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90 || !text(result.name).trim()) return [] + if (typeof longitude !== 'number' || typeof latitude !== 'number') {return []} + if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {return []} + if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90 || !text(result.name).trim()) {return []} const [wgsLongitude, wgsLatitude] = gcj02ToWgs84(longitude, latitude) return [{ name: text(result.name), @@ -60,14 +60,14 @@ function toPlaces(results: BaiduSuggestion[]): PlaceSuggestion[] { } function parseSuggestions(body: unknown): BaiduSuggestionsResponse { - if (typeof body !== 'object' || body === null) return { results: [], error: '百度返回了无效响应' } + if (typeof body !== 'object' || body === null) {return { results: [], error: '百度返回了无效响应' }} const result = body as { status?: unknown; message?: unknown; results?: unknown } if (result.status !== 0) { const message = text(result.message) || '未知错误' const code = typeof result.status === 'number' || typeof result.status === 'string' ? ` (${result.status})` : '' return { results: [], error: `百度地点搜索失败:${message}${code}` } } - if (!Array.isArray(result.results)) return { results: [], error: '百度返回了无效地点数据' } + if (!Array.isArray(result.results)) {return { results: [], error: '百度返回了无效地点数据' }} return { results: result.results.filter((item): item is BaiduSuggestion => typeof item === 'object' && item !== null) } } @@ -89,32 +89,32 @@ async function requestSuggestions(url: string): Promise = { query: keywords, region: '全国', region_limit: 'false', ak: key, ret_coordtype: 'gcj02ll', output: 'json' } - if (securityKey) params.timestamp = String(Math.floor(Date.now() / 1000)) + if (securityKey) {params.timestamp = String(Math.floor(Date.now() / 1000))} const query = Object.entries(params).map(([name, value]) => `${name}=${encodeURIComponent(value)}`).join('&') - if (!securityKey) return `https://api.map.baidu.com${SUGGEST_PATH}?${query}` + if (!securityKey) {return `https://api.map.baidu.com${SUGGEST_PATH}?${query}`} const sn = createHash('md5').update(encodeURIComponent(`${SUGGEST_PATH}?${query}${securityKey}`)).digest('hex') return `https://api.map.baidu.com${SUGGEST_PATH}?${query}&sn=${sn}` } export async function searchBaiduPlaces(query: string, requestId?: number): Promise { const keywords = query.trim().slice(0, 90) - if (!keywords) return { query, places: [], error: '缺少搜索关键词' } + if (!keywords) {return { query, places: [], error: '缺少搜索关键词' }} const isSuperseded = (): boolean => isPlacesRequestSuperseded(requestId) - if (isSuperseded()) return { query, places: [], superseded: true } + if (isSuperseded()) {return { query, places: [], superseded: true }} const key = readProviderKey('baidu') - if (!key) return { query, places: [], error: '未配置百度地图 API Key:请在「图层管理 → 供应商密钥」中保存 API Key' } + if (!key) {return { query, places: [], error: '未配置百度地图 API Key:请在「图层管理 → 供应商密钥」中保存 API Key' }} const securityKey = readProviderKey('baidu-sk') const first = await baiduThrottle.run(() => requestSuggestions(suggestUrl(keywords, key, securityKey)), isSuperseded) - if (!first) return { query, places: [], superseded: true } + if (!first) {return { query, places: [], superseded: true }} let result = first for (let attempt = 1; result.error !== undefined && result.retryable === true && attempt <= SEARCH_MAX_RETRIES; attempt += 1) { await delay(SEARCH_RETRY_DELAY_MS * attempt) const next = await baiduThrottle.run(() => requestSuggestions(suggestUrl(keywords, key, securityKey)), isSuperseded) - if (!next) return { query, places: [], superseded: true } + if (!next) {return { query, places: [], superseded: true }} result = next } - if (result.error) return { query, places: [], error: result.error } + if (result.error) {return { query, places: [], error: result.error }} const places = toPlaces(result.results).slice(0, 10) - if (places.length === 0) return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' } + if (places.length === 0) {return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' }} return { query, places } } diff --git a/src/main/ai/chatHistoryStore.ts b/src/main/ai/chatHistoryStore.ts index 18060b51..31db6234 100644 --- a/src/main/ai/chatHistoryStore.ts +++ b/src/main/ai/chatHistoryStore.ts @@ -1,5 +1,5 @@ -import { copyFile, mkdir, unlink } from 'fs/promises' -import { randomUUID } from 'crypto' +import { copyFile, mkdir, unlink } from 'node:fs/promises' +import { randomUUID } from 'node:crypto' import { storageChildPath } from '../storagePath' import { readJson, serialQueue, writeJson } from '../jsonStore' import type { AiSearchReference, StoredAiCompression, StoredAiConversation, StoredAiConversationSummary, StoredAiMessage, StoredAiPart, StoredAiToolStep } from '../../preload' @@ -23,12 +23,12 @@ function clampTimestamp(value: unknown, fallback: number): number { } function normalizeReferences(value: unknown): AiSearchReference[] { - if (!Array.isArray(value)) return [] + if (!Array.isArray(value)) {return []} return value.flatMap((item): AiSearchReference[] => { - if (!isRecord(item)) return [] + if (!isRecord(item)) {return []} const title = clampString(item.title, 300) const url = clampString(item.url, 2000) - if (!title && !url) return [] + if (!title && !url) {return []} return [{ title, url, @@ -40,10 +40,10 @@ function normalizeReferences(value: unknown): AiSearchReference[] { } function normalizeToolStep(value: unknown): StoredAiToolStep | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const callId = clampString(value.callId, 128) const name = clampString(value.name, 64) - if (!callId || !name) return null + if (!callId || !name) {return null} const status: StoredAiToolStep['status'] = value.status === 'error' ? 'error' : 'ok' return { callId, @@ -57,13 +57,13 @@ function normalizeToolStep(value: unknown): StoredAiToolStep | null { } function normalizePart(value: unknown): StoredAiPart | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} if (value.kind === 'reasoning') { const id = clampString(value.id, 128) - if (!id) return null + if (!id) {return null} return { kind: 'reasoning', id, text: clampString(value.text, 100_000), ms: clampTimestamp(value.ms, 0), startedAt: clampTimestamp(value.startedAt, 0) } } - if (value.kind === 'text') return { kind: 'text', text: clampString(value.text, 100_000) } + if (value.kind === 'text') {return { kind: 'text', text: clampString(value.text, 100_000) }} if (value.kind === 'tool') { const step = normalizeToolStep(value.step) return step ? { kind: 'tool', step } : null @@ -72,11 +72,11 @@ function normalizePart(value: unknown): StoredAiPart | null { } function normalizeMessage(value: unknown): StoredAiMessage | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = clampString(value.id, 128) - if (!id) return null + if (!id) {return null} const role = value.role === 'user' ? 'user' : value.role === 'assistant' ? 'assistant' : null - if (!role) return null + if (!role) {return null} const parts = Array.isArray(value.parts) ? value.parts.map(normalizePart).filter((part): part is StoredAiPart => part !== null).slice(0, 200) : [] @@ -91,23 +91,23 @@ function normalizeMessage(value: unknown): StoredAiMessage | null { } function normalizeCompression(value: unknown): StoredAiCompression | undefined { - if (!isRecord(value)) return undefined + if (!isRecord(value)) {return undefined} const summary = clampString(value.summary, 100_000) const coveredMessageIds = Array.isArray(value.coveredMessageIds) ? value.coveredMessageIds.filter((id): id is string => typeof id === 'string' && id.length > 0).map((id) => id.slice(0, 128)).slice(0, MAX_MESSAGES) : [] - if (!summary || !coveredMessageIds.length) return undefined + if (!summary || coveredMessageIds.length === 0) {return undefined} return { summary, coveredMessageIds } } export function normalizeConversation(value: unknown): StoredAiConversation | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = clampString(value.id, 64) - if (!ID_PATTERN.test(id)) return null + if (!ID_PATTERN.test(id)) {return null} const messages = Array.isArray(value.messages) ? value.messages.map(normalizeMessage).filter((message): message is StoredAiMessage => message !== null).slice(-MAX_MESSAGES) : [] - if (!messages.some((message) => message.role === 'user')) return null + if (!messages.some((message) => message.role === 'user')) {return null} const updatedAt = clampTimestamp(value.updatedAt, Date.now()) const compression = normalizeCompression(value.compression) return { @@ -140,23 +140,23 @@ interface RecoveryManifest { function sortedEntries(list: HistoryEntry[]): HistoryEntry[] { const unique = new Map() - for (const item of list) if (!unique.has(item.id)) unique.set(item.id, item) + for (const item of list) {if (!unique.has(item.id)) {unique.set(item.id, item)}} return [...unique.values()].sort((a, b) => b.updatedAt - a.updatedAt).slice(0, MAX_CONVERSATIONS) } function normalizeEntries(value: unknown): HistoryEntry[] { - if (!isRecord(value) || value.version !== 1 || !Array.isArray(value.conversations)) throw new Error('无效的会话索引') + if (!isRecord(value) || value.version !== 1 || !Array.isArray(value.conversations)) {throw new Error('无效的会话索引')} return sortedEntries(value.conversations.flatMap((item): HistoryEntry[] => { - if (!isRecord(item) || typeof item.id !== 'string' || !ID_PATTERN.test(item.id)) return [] + if (!isRecord(item) || typeof item.id !== 'string' || !ID_PATTERN.test(item.id)) {return []} const updatedAt = clampTimestamp(item.updatedAt, Date.now()) const file = typeof item.file === 'string' ? item.file : `${item.id}.json` - if (file === 'index.json' || file === 'recovery.json' || !/^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)?\.json$/.test(file)) return [] + if (file === 'index.json' || file === 'recovery.json' || !/^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)?\.json$/.test(file)) {return []} return [{ id: item.id, title: clampString(item.title, 80), createdAt: clampTimestamp(item.createdAt, updatedAt), updatedAt, file }] })) } function normalizeRecoveryManifest(value: unknown): RecoveryManifest { - if (!isRecord(value)) throw new Error('无效的会话恢复名单') + if (!isRecord(value)) {throw new Error('无效的会话恢复名单')} const migration = value.migration === 'pending' || value.migration === 'complete' ? value.migration : null return { entries: normalizeEntries(value), migration } } @@ -167,7 +167,7 @@ export class AiChatHistoryStore { private hawdb: EoqHawdbClient | null = null private hawdbSummaries: StoredAiConversationSummary[] = [] private migration: MigrationState = 'complete' - private enqueue = serialQueue() + private readonly enqueue = serialQueue() async init(path: string): Promise { this.hawdb = null @@ -220,13 +220,13 @@ export class AiChatHistoryStore { try { legacy = await readJson(path) } catch (error) { - if ((error as NodeJS.ErrnoException).code !== 'ENOENT') console.warn('[ai] 会话历史读取失败', error) + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {console.warn('[ai] 会话历史读取失败', error)} } const normalized = Array.isArray(legacy) ? legacy.map(normalizeConversation).filter((item): item is StoredAiConversation => item !== null) : [] const migrated = sortedEntries(normalized.map((item) => ({ ...summary(item), file: `${item.id}.${randomUUID()}.json` }))) for (const item of migrated) { const conversation = normalized.find((entry) => entry.id === item.id) - if (conversation) await writeJson(this.conversationPath(item.file), conversation) + if (conversation) {await writeJson(this.conversationPath(item.file), conversation)} } await this.persistIndex(migrated) this.migration = 'complete' @@ -250,7 +250,7 @@ export class AiChatHistoryStore { for (const entry of entries) { try { const item = normalizeConversation(await readJson(this.conversationPath(entry.file))) - if (item?.id === entry.id) recovered.push({ ...summary(item), file: entry.file }) + if (item?.id === entry.id) {recovered.push({ ...summary(item), file: entry.file })} } catch { continue } @@ -297,7 +297,7 @@ export class AiChatHistoryStore { private assertBackend(): 'hawdb' | 'json' { if (this.hawdb) { - if (!this.hawdb.isReady()) throw new Error('EOQ HawDB 后端不可用,请重启应用后重试') + if (!this.hawdb.isReady()) {throw new Error('EOQ HawDB 后端不可用,请重启应用后重试')} return 'hawdb' } return 'json' @@ -309,14 +309,14 @@ export class AiChatHistoryStore { return this.hawdb!.getConversation(id) } const entry = this.conversations.find((item) => item.id === id) - if (!entry) return null + if (!entry) {return null} return normalizeConversation(await readJson(this.conversationPath(entry.file))) }) } save(value: unknown): Promise { const conversation = normalizeConversation(value) - if (!conversation) return Promise.reject(new Error('无效的会话数据')) + if (!conversation) {return Promise.reject(new Error('无效的会话数据'))} return this.enqueue(async () => { if (this.assertBackend() === 'hawdb') { this.hawdbSummaries = (await this.hawdb!.saveConversation(conversation)).map(summary) @@ -329,11 +329,11 @@ export class AiChatHistoryStore { try { await this.persistIndex(next) } catch (error) { - await unlink(this.conversationPath(entry.file)).catch(() => undefined) + await unlink(this.conversationPath(entry.file)).catch(() => {}) throw error } - await Promise.all(removed.map((item) => unlink(this.conversationPath(item.file)).catch(() => undefined))) - if (!next.some((item) => item.file === entry.file)) await unlink(this.conversationPath(entry.file)).catch(() => undefined) + await Promise.all(removed.map((item) => unlink(this.conversationPath(item.file)).catch(() => {}))) + if (!next.some((item) => item.file === entry.file)) {await unlink(this.conversationPath(entry.file)).catch(() => {})} return this.list() }) } @@ -347,14 +347,14 @@ export class AiChatHistoryStore { const removed = this.conversations.find((item) => item.id === id) const next = this.conversations.filter((item) => item.id !== id) await this.persistIndex(next) - if (removed) await unlink(this.conversationPath(removed.file)).catch(() => undefined) + if (removed) {await unlink(this.conversationPath(removed.file)).catch(() => {})} return this.list() }) } async search(query: string, limit = 5, excludeId?: string): Promise { const clean = typeof query === 'string' ? query.trim() : '' - if (!clean) return [] + if (!clean) {return []} if (this.assertBackend() === 'hawdb') { return this.hawdb!.searchConversations(clean, limit, excludeId) } diff --git a/src/main/ai/hawdb/client.ts b/src/main/ai/hawdb/client.ts index f770d5b4..01fb7a9b 100644 --- a/src/main/ai/hawdb/client.ts +++ b/src/main/ai/hawdb/client.ts @@ -1,6 +1,5 @@ import { existsSync } from 'node:fs' -import { dirname, join } from 'node:path' -import { fileURLToPath } from 'node:url' +import { join } from 'node:path' import { Worker } from 'node:worker_threads' import type { AgentMemory, StoredAiConversation, StoredAiConversationSummary } from '../../../preload' import { EoqHawdbEngine } from './engine' @@ -17,7 +16,7 @@ import type { } from './protocol' const REQUEST_TIMEOUT_MS = 30_000 -const CLOSE_TIMEOUT_MS = 3_000 +const CLOSE_TIMEOUT_MS = 3000 interface PendingRequest { resolve: (value: unknown) => void @@ -46,8 +45,8 @@ type RequestBody = | { op: 'knowledge:retrieve'; payload: { query: string; module?: string; topK?: number } } function defaultWorkerPath(): string { - if (typeof __dirname === 'string') return join(__dirname, 'hawdbWorker.js') - return join(dirname(fileURLToPath(import.meta.url)), 'hawdbWorker.js') + if (typeof __dirname === 'string') {return join(__dirname, 'hawdbWorker.js')} + return join(import.meta.dirname, 'hawdbWorker.js') } export class EoqHawdbClient { @@ -56,7 +55,7 @@ export class EoqHawdbClient { private worker: Worker | null = null private inProcessEngine: EoqHawdbEngine | null = null private inProcessQueue: Promise = Promise.resolve() - private pending = new Map() + private readonly pending = new Map() private nextRequestId = 1 private ready = false private lastStatus: HawdbStatusInfo | null = null @@ -83,11 +82,11 @@ export class EoqHawdbClient { } private ensureWorker(): Worker { - if (this.worker) return this.worker + if (this.worker) {return this.worker} const worker = new Worker(this.workerPath) worker.on('message', (response: HawdbWorkerResponse) => { const entry = this.pending.get(response.id) - if (!entry) return + if (!entry) {return} clearTimeout(entry.timer) this.pending.delete(response.id) if (response.ok) { @@ -103,7 +102,7 @@ export class EoqHawdbClient { }) worker.on('exit', (code) => { this.ready = false - if (this.worker === worker) this.worker = null + if (this.worker === worker) {this.worker = null} if (this.pending.size > 0) { this.rejectAllPending(new Error(`HawDB 工作线程已退出(code=${code})`)) } @@ -113,10 +112,10 @@ export class EoqHawdbClient { } private runInProcess(task: (engine: EoqHawdbEngine) => T | Promise): Promise { - if (!this.inProcessEngine) this.inProcessEngine = new EoqHawdbEngine() + if (!this.inProcessEngine) {this.inProcessEngine = new EoqHawdbEngine()} const engine = this.inProcessEngine const next = this.inProcessQueue.then(() => task(engine)) - this.inProcessQueue = next.catch(() => undefined) + this.inProcessQueue = next.catch(() => {}) return next } @@ -127,7 +126,7 @@ export class EoqHawdbClient { const worker = this.ensureWorker() const id = this.nextRequestId this.nextRequestId += 1 - const request: HawdbWorkerRequest = { ...body, id } as HawdbWorkerRequest + const request: HawdbWorkerRequest = { ...body, id } return new Promise((resolve, reject) => { const timer = setTimeout(() => { this.pending.delete(id) @@ -146,33 +145,46 @@ export class EoqHawdbClient { private dispatchInProcess(body: RequestBody): Promise { return this.runInProcess((engine) => { switch (body.op) { - case 'open': + case 'open': { return engine.open(body.payload) as Promise - case 'close': + } + case 'close': { engine.close() return true as T - case 'status': + } + case 'status': { return engine.status() as T - case 'memory:list': + } + case 'memory:list': { return engine.listMemories() as T - case 'memory:add': + } + case 'memory:add': { return engine.addMemory(body.payload.content, body.payload.source) as Promise - case 'memory:delete': + } + case 'memory:delete': { return engine.deleteMemory(body.payload.id) as Promise - case 'memory:recall': + } + case 'memory:recall': { return engine.recallMemories(body.payload.query, body.payload.limit) as T - case 'history:list': + } + case 'history:list': { return engine.listConversations() as T - case 'history:get': + } + case 'history:get': { return engine.getConversation(body.payload.id) as T - case 'history:save': + } + case 'history:save': { return engine.saveConversation(body.payload.conversation) as Promise - case 'history:delete': + } + case 'history:delete': { return engine.deleteConversation(body.payload.id) as Promise - case 'history:search': + } + case 'history:search': { return engine.searchConversations(body.payload.query, body.payload.limit, body.payload.excludeId) as T - case 'knowledge:retrieve': + } + case 'knowledge:retrieve': { return engine.retrieveKnowledge(body.payload.query, body.payload.module, body.payload.topK) as T + } } }) } @@ -194,14 +206,14 @@ export class EoqHawdbClient { } } const worker = this.worker - if (!worker) return + if (!worker) {return} try { await this.send({ op: 'close' }, CLOSE_TIMEOUT_MS) } catch { void 0 } finally { this.worker = null - await worker.terminate().catch(() => undefined) + await worker.terminate().catch(() => {}) } } diff --git a/src/main/ai/hawdb/engine.ts b/src/main/ai/hawdb/engine.ts index 6443a524..2615bb3e 100644 --- a/src/main/ai/hawdb/engine.ts +++ b/src/main/ai/hawdb/engine.ts @@ -8,7 +8,8 @@ import { storageChildPath } from '../../storagePath' import { conversationSummary, MAX_CONVERSATIONS, normalizeConversation } from '../chatHistoryStore' import type { KnowledgeEntry, KnowledgeMatch } from '../knowledge' import { MAX_MEMORIES, MAX_MEMORY_CONTENT_LENGTH, normalizeMemory } from '../memoryStore' -import { HawdbDatabase, HawdbError, HawdbLibrary } from './ffi' +import type { HawdbDatabase} from './ffi'; +import { HawdbError, HawdbLibrary } from './ffi' import { buildConversationSearchText, buildConversationSnippet, @@ -55,14 +56,14 @@ async function readJsonSafe(path: string): Promise { } async function loadLegacyMemories(path?: string): Promise { - if (!path || !existsSync(path)) return [] + if (!path || !existsSync(path)) {return []} const parsed = await readJsonSafe(path) - if (!Array.isArray(parsed)) return [] + if (!Array.isArray(parsed)) {return []} const seen = new Set() const memories: AgentMemory[] = [] for (const item of parsed) { const normalized = normalizeMemory(item) - if (!normalized || seen.has(normalized.id)) continue + if (!normalized || seen.has(normalized.id)) {continue} seen.add(normalized.id) memories.push(normalized) } @@ -70,7 +71,7 @@ async function loadLegacyMemories(path?: string): Promise { } async function loadLegacyConversations(path?: string): Promise { - if (!path) return [] + if (!path) {return []} const directory = `${path}.d` const byId = new Map() let indexValid = false @@ -80,12 +81,12 @@ async function loadLegacyConversations(path?: string): Promise { - if (!existsSync(path)) return null + if (!existsSync(path)) {return null} const parsed = await readJsonSafe(path) - if (!isRecord(parsed)) return null + if (!isRecord(parsed)) {return null} const memories: AgentMemory[] = [] const seenMemories = new Set() if (Array.isArray(parsed.memories)) { for (const item of parsed.memories) { const normalized = normalizeMemory(item) - if (!normalized || seenMemories.has(normalized.id)) continue + if (!normalized || seenMemories.has(normalized.id)) {continue} seenMemories.add(normalized.id) memories.push(normalized) } @@ -125,7 +126,7 @@ async function loadSnapshot(path: string): Promise { if (Array.isArray(parsed.conversations)) { for (const item of parsed.conversations) { const normalized = normalizeConversation(item) - if (!normalized || seenConversations.has(normalized.id)) continue + if (!normalized || seenConversations.has(normalized.id)) {continue} seenConversations.add(normalized.id) conversations.push(normalized) } @@ -141,7 +142,7 @@ async function loadSnapshot(path: string): Promise { function fieldMatchCount(value: string, terms: string[]): number { const normalized = normalizeLookupText(value) - if (!normalized) return 0 + if (!normalized) {return 0} return terms.reduce((score, term) => score + (normalized.includes(term) ? 1 : 0), 0) } @@ -158,10 +159,10 @@ function scoreEntryFields(entry: KnowledgeEntry, terms: string[], module?: strin boost += 25 matchedFields.push('module') } - if (nameScore) matchedFields.push('name') - if (aliasScore) matchedFields.push('aliases') - if (keywordScore) matchedFields.push('keywords') - if (contentScore) matchedFields.push('content') + if (nameScore) {matchedFields.push('name')} + if (aliasScore) {matchedFields.push('aliases')} + if (keywordScore) {matchedFields.push('keywords')} + if (contentScore) {matchedFields.push('content')} return { boost, matchedFields } } @@ -192,10 +193,10 @@ export class EoqHawdbEngine { private dbRoot = '' private hawdbVersion = '' private formatVersion = 0 - private knowledgeById = new Map() + private readonly knowledgeById = new Map() private requireDb(): HawdbDatabase { - if (!this.db) throw new HawdbError('not_open', 'HawDB 引擎尚未初始化') + if (!this.db) {throw new HawdbError('not_open', 'HawDB 引擎尚未初始化')} return this.db } @@ -216,10 +217,10 @@ export class EoqHawdbEngine { } private insertMemories(memories: AgentMemory[]): void { - if (!memories.length) return + if (memories.length === 0) {return} const existingIds = new Set(this.listMemories().map((item) => item.id)) const toInsert = memories.filter((item) => !existingIds.has(item.id)).slice(0, Math.max(0, MAX_MEMORIES - existingIds.size)) - if (!toInsert.length) return + if (toInsert.length === 0) {return} this.requireDb().transaction((tx) => { for (const memory of toInsert) { tx.querySQL( @@ -231,10 +232,10 @@ export class EoqHawdbEngine { } private insertConversations(conversations: StoredAiConversation[]): void { - if (!conversations.length) return + if (conversations.length === 0) {return} const existingIds = new Set(this.listConversations().map((item) => item.id)) const toInsert = conversations.filter((item) => !existingIds.has(item.id)) - if (!toInsert.length) return + if (toInsert.length === 0) {return} this.requireDb().transaction((tx) => { for (const conversation of toInsert) { tx.querySQL( @@ -256,7 +257,7 @@ export class EoqHawdbEngine { private trimConversations(): void { const db = this.requireDb() const rows = db.querySQL('SELECT id FROM eoq_conversations ORDER BY updated_at DESC, id ASC').dicts() - if (rows.length <= MAX_CONVERSATIONS) return + if (rows.length <= MAX_CONVERSATIONS) {return} const staleIds = rows.slice(MAX_CONVERSATIONS).map((row) => String(row.id)) db.transaction((tx) => { for (const id of staleIds) { @@ -271,10 +272,10 @@ export class EoqHawdbEngine { .dicts() const list: StoredAiConversation[] = [] for (const row of rows) { - if (typeof row.payload_json !== 'string') continue + if (typeof row.payload_json !== 'string') {continue} try { const normalized = normalizeConversation(JSON.parse(row.payload_json)) - if (normalized) list.push(normalized) + if (normalized) {list.push(normalized)} } catch { continue } @@ -283,7 +284,7 @@ export class EoqHawdbEngine { } private async persistSnapshotIfNeeded(): Promise { - if (this.storageMode !== 'memory-snapshot') return + if (this.storageMode !== 'memory-snapshot') {return} const doc: SnapshotDocument = { version: 1, memories: this.listMemories(), @@ -355,7 +356,7 @@ export class EoqHawdbEngine { await mkdir(this.dbRoot, { recursive: true }) const lib = new HawdbLibrary(payload.libraryPath) let db: HawdbDatabase - let dbOwned = false + let dbOwned: boolean if (process.platform === 'win32') { db = lib.openInMemory() dbOwned = true @@ -369,7 +370,7 @@ export class EoqHawdbEngine { this.storageMode = 'memory-snapshot' } else { let diskDb: HawdbDatabase | null = null - let schemaReady = false + let schemaReady: boolean try { diskDb = lib.open(join(this.dbRoot, 'db'), { durability: 'sync_on_every_write' }) ensureEoqSchema(diskDb) @@ -477,10 +478,10 @@ export class EoqHawdbEngine { async addMemory(content: string, source: AgentMemory['source']): Promise { const trimmed = typeof content === 'string' ? content.trim().slice(0, MAX_MEMORY_CONTENT_LENGTH) : '' - if (!trimmed) throw new Error('记忆内容不能为空') + if (!trimmed) {throw new Error('记忆内容不能为空')} const db = this.requireDb() const count = Number(db.querySQL('SELECT COUNT(*) AS cnt FROM eoq_memories').dicts()[0]?.cnt ?? 0) - if (count >= MAX_MEMORIES) throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`) + if (count >= MAX_MEMORIES) {throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`)} const memory: AgentMemory = { id: `m${randomUUID()}`, content: trimmed, @@ -509,7 +510,7 @@ export class EoqHawdbEngine { async deleteMemory(id: string): Promise { const db = this.requireDb() const existing = db.querySQL('SELECT id, content, source, created_at FROM eoq_memories WHERE id = $1', [id]).dicts() - if (!existing.length) return false + if (existing.length === 0) {return false} db.querySQL('DELETE FROM eoq_memories WHERE id = $1', [id]) try { await this.persistSnapshotIfNeeded() @@ -534,7 +535,7 @@ export class EoqHawdbEngine { recallMemories(query: string, limit = 8): MemoryRecallMatch[] { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return [] + if (!cleanQuery) {return []} const topK = Math.min(20, Math.max(1, Math.round(limit))) try { const rows = this.requireDb() @@ -579,13 +580,13 @@ export class EoqHawdbEngine { const rows = this.requireDb() .querySQL('SELECT payload_json FROM eoq_conversations WHERE id = $1', [id]) .dicts() - if (!rows.length || typeof rows[0].payload_json !== 'string') return null + if (rows.length === 0 || typeof rows[0].payload_json !== 'string') {return null} return normalizeConversation(JSON.parse(rows[0].payload_json)) } async saveConversation(value: unknown): Promise { const conversation = normalizeConversation(value) - if (!conversation) throw new Error('无效的会话数据') + if (!conversation) {throw new Error('无效的会话数据')} const db = this.requireDb() const searchText = buildConversationSearchText(conversation) const payloadJson = JSON.stringify(conversation) @@ -609,7 +610,7 @@ export class EoqHawdbEngine { searchConversations(query: string, limit = 5, excludeId?: string): ConversationSearchHit[] { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return [] + if (!cleanQuery) {return []} const cappedLimit = Math.min(10, Math.max(1, Math.round(limit))) const fetchLimit = cappedLimit + (excludeId ? 2 : 0) const hits: ConversationSearchHit[] = [] @@ -622,11 +623,11 @@ export class EoqHawdbEngine { .dicts() for (const row of rows) { const id = String(row.id) - if (excludeId && id === excludeId) continue - if (typeof row.payload_json !== 'string') continue + if (excludeId && id === excludeId) {continue} + if (typeof row.payload_json !== 'string') {continue} try { const conversation = normalizeConversation(JSON.parse(row.payload_json)) - if (!conversation) continue + if (!conversation) {continue} hits.push({ id: conversation.id, title: conversation.title, @@ -638,9 +639,9 @@ export class EoqHawdbEngine { } catch { continue } - if (hits.length >= cappedLimit) break + if (hits.length >= cappedLimit) {break} } - if (hits.length > 0) return hits + if (hits.length > 0) {return hits} } catch { void 0 } @@ -676,7 +677,7 @@ export class EoqHawdbEngine { const related: KnowledgeRelatedConcept[] = [] for (const row of rows) { const id = String(row.id ?? '') - if (!id || id === conceptId || seen.has(id)) continue + if (!id || id === conceptId || seen.has(id)) {continue} seen.add(id) related.push({ id, @@ -688,7 +689,7 @@ export class EoqHawdbEngine { } return related .sort((left, right) => { - if (left.relation !== right.relation) return left.relation === 'contrasts_with' ? -1 : 1 + if (left.relation !== right.relation) {return left.relation === 'contrasts_with' ? -1 : 1} return left.name.localeCompare(right.name, 'zh-CN') }) .slice(0, MAX_RELATED_CONCEPTS) @@ -699,7 +700,7 @@ export class EoqHawdbEngine { retrieveKnowledge(query: string, module?: string, topK = DEFAULT_TOP_K): KnowledgeSearchResult { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return { query: '', matches: [], total: 0 } + if (!cleanQuery) {return { query: '', matches: [], total: 0 }} const limit = Math.min(MAX_TOP_K, Math.max(1, Math.round(topK))) const terms = extractQueryTerms(cleanQuery) const bm25Scores = new Map() @@ -716,15 +717,15 @@ export class EoqHawdbEngine { } catch { void 0 } - const ranked: Array<{ entry: KnowledgeEntry; score: number; matchedFields: string[] }> = [] + const ranked: { entry: KnowledgeEntry; score: number; matchedFields: string[] }[] = [] for (const entry of this.knowledgeById.values()) { - if (entry.status === 'deprecated') continue + if (entry.status === 'deprecated') {continue} const bm25 = bm25Scores.get(entry.id) ?? 0 const { boost, matchedFields } = scoreEntryFields(entry, terms, module) const combinedScore = Math.round((bm25 * 15 + boost) * 100) / 100 - if (combinedScore <= 0) continue + if (combinedScore <= 0) {continue} const fields = [...matchedFields] - if (bm25 > 0 && !fields.includes('bm25')) fields.push('bm25') + if (bm25 > 0 && !fields.includes('bm25')) {fields.push('bm25')} ranked.push({ entry, score: combinedScore, matchedFields: fields }) } ranked.sort((left, right) => right.score - left.score || left.entry.name.localeCompare(right.entry.name, 'zh-CN')) diff --git a/src/main/ai/hawdb/ffi.ts b/src/main/ai/hawdb/ffi.ts index 6857fba5..e3954a34 100644 --- a/src/main/ai/hawdb/ffi.ts +++ b/src/main/ai/hawdb/ffi.ts @@ -74,7 +74,7 @@ interface NativeSymbols { let bufferStructRegistered = false function ensureBufferStruct(): void { - if (bufferStructRegistered) return + if (bufferStructRegistered) {return} koffi.struct('HawdbBuffer', { ptr: 'void *', len: 'size_t' @@ -86,7 +86,7 @@ const EMPTY_BYTES = Buffer.alloc(1) const utf8Decoder = new TextDecoder() function encodeUtf8(value: string): { buf: Buffer; len: number } { - if (!value.length) return { buf: EMPTY_BYTES, len: 0 } + if (value.length === 0) {return { buf: EMPTY_BYTES, len: 0 }} const buf = Buffer.from(value, 'utf8') return { buf, len: buf.length } } @@ -96,13 +96,13 @@ function emptyBuffer(): RawHawdbBuffer { } function serializeOpenOptions(options?: HawdbOpenOptions): string { - if (!options) return '{}' + if (!options) {return '{}'} const payload: Record = {} - if (options.readOnly !== undefined) payload.read_only = options.readOnly - if (options.durability !== undefined) payload.durability = options.durability - if (options.maxReadResultRows !== undefined) payload.max_read_result_rows = options.maxReadResultRows - if (options.maxReadIntermediateRows !== undefined) payload.max_read_intermediate_rows = options.maxReadIntermediateRows - if (options.maxReadResultPayloadBytes !== undefined) payload.max_read_result_payload_bytes = options.maxReadResultPayloadBytes + if (options.readOnly !== undefined) {payload.read_only = options.readOnly} + if (options.durability !== undefined) {payload.durability = options.durability} + if (options.maxReadResultRows !== undefined) {payload.max_read_result_rows = options.maxReadResultRows} + if (options.maxReadIntermediateRows !== undefined) {payload.max_read_intermediate_rows = options.maxReadIntermediateRows} + if (options.maxReadResultPayloadBytes !== undefined) {payload.max_read_result_payload_bytes = options.maxReadResultPayloadBytes} if (options.relationalMonotonicAppendFastPath !== undefined) { payload.relational_monotonic_append_fast_path = options.relationalMonotonicAppendFastPath } @@ -110,11 +110,11 @@ function serializeOpenOptions(options?: HawdbOpenOptions): string { } function decodeResultPayload(text: string | null): HawdbQueryResult { - if (!text) return new HawdbQueryResult([], []) + if (!text) {return new HawdbQueryResult([], [])} const parsed = parseLosslessJson(text) - if (typeof parsed !== 'object' || parsed === null) return new HawdbQueryResult([], []) + if (typeof parsed !== 'object' || parsed === null) {return new HawdbQueryResult([], [])} const record = parsed as Record - const columns = Array.isArray(record.columns) ? record.columns.map((item) => String(item)) : [] + const columns = Array.isArray(record.columns) ? record.columns.map(String) : [] const rows = Array.isArray(record.rows) ? (record.rows as unknown[][]) : [] return new HawdbQueryResult(columns, rows) } @@ -134,7 +134,7 @@ export class HawdbTransaction { } private assertActive(): void { - if (!this.active) throw new HawdbError('transaction_expired', '事务已结束,不可继续使用') + if (!this.active) {throw new HawdbError('transaction_expired', '事务已结束,不可继续使用')} } query(cypher: string, params?: Record): HawdbQueryResult { @@ -164,18 +164,18 @@ export class HawdbDatabase { } private assertOpen(): void { - if (this.closed) throw new HawdbError('database_closed', 'HawDB 数据库句柄已关闭') + if (this.closed) {throw new HawdbError('database_closed', 'HawDB 数据库句柄已关闭')} } query(cypher: string, params?: Record): HawdbQueryResult { this.assertOpen() - if (this.inTransaction) throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询') + if (this.inTransaction) {throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询')} return this.library.runQuery(this.handle, cypher, params ?? {}, false, false) } querySQL(sql: string, params?: unknown[]): HawdbQueryResult { this.assertOpen() - if (this.inTransaction) throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询') + if (this.inTransaction) {throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询')} return this.library.runQuery(this.handle, sql, params ?? [], false, true) } @@ -185,7 +185,7 @@ export class HawdbDatabase { transaction(body: (tx: HawdbTransaction) => T): T { this.assertOpen() - if (this.inTransaction) throw new HawdbError('nested_transaction', 'HawDB 不支持嵌套事务') + if (this.inTransaction) {throw new HawdbError('nested_transaction', 'HawDB 不支持嵌套事务')} this.library.beginTransaction(this.handle) this.inTransaction = true const tx = new HawdbTransaction(this.library, this.handle) @@ -227,8 +227,8 @@ export class HawdbDatabase { } close(): void { - if (this.closed) return - if (this.inTransaction) throw new HawdbError('active_transaction', '事务未结束前不可关闭数据库') + if (this.closed) {return} + if (this.inTransaction) {throw new HawdbError('active_transaction', '事务未结束前不可关闭数据库')} this.closed = true this.library.closeHandle(this.handle) } @@ -246,6 +246,7 @@ export class HawdbLibrary { this.symbols = { hawdb_open: this.lib.func('void * hawdb_open(const uint8_t *path, size_t path_len, const uint8_t *options_json, size_t options_len, _Inout_ HawdbBuffer *err_out)'), hawdb_open_in_memory: this.lib.func('void * hawdb_open_in_memory(_Inout_ HawdbBuffer *err_out)'), + // oxlint-disable-next-line typescript/strict-void-return -- koffi types every native function as value-returning hawdb_close: this.lib.func('void hawdb_close(void *db)'), hawdb_query: this.lib.func('bool hawdb_query(void *db, const uint8_t *cypher, size_t cypher_len, const uint8_t *params_json, size_t params_len, _Inout_ HawdbBuffer *result_out, _Inout_ HawdbBuffer *err_out)'), hawdb_query_sql: this.lib.func('bool hawdb_query_sql(void *db, const uint8_t *sql, size_t sql_len, const uint8_t *params_json, size_t params_len, _Inout_ HawdbBuffer *result_out, _Inout_ HawdbBuffer *err_out)'), @@ -263,7 +264,9 @@ export class HawdbLibrary { hawdb_scrub: this.lib.func('bool hawdb_scrub(void *db, _Inout_ HawdbBuffer *report_out, _Inout_ HawdbBuffer *err_out)'), hawdb_format_version: this.lib.func('uint32_t hawdb_format_version()'), hawdb_dump_format_version: this.lib.func('uint32_t hawdb_dump_format_version()'), + // oxlint-disable-next-line typescript/strict-void-return -- koffi types every native function as value-returning hawdb_version: this.lib.func('void hawdb_version(_Inout_ HawdbBuffer *out)'), + // oxlint-disable-next-line typescript/strict-void-return -- koffi types every native function as value-returning hawdb_buffer_free: this.lib.func('void hawdb_buffer_free(_Inout_ HawdbBuffer *buf)') } } @@ -271,11 +274,11 @@ export class HawdbLibrary { private takeBuffer(buffer: RawHawdbBuffer): string | null { const length = Number(buffer.len) if (!buffer.ptr) { - if (length !== 0) throw new TypeError('HawDB 返回了空指针但长度非零的缓冲区') + if (length !== 0) {throw new TypeError('HawDB 返回了空指针但长度非零的缓冲区')} return null } try { - if (length === 0) return '' + if (length === 0) {return ''} const bytes = koffi.decode(buffer.ptr, 'uint8_t', length) as Uint8Array return utf8Decoder.decode(bytes) } finally { @@ -285,7 +288,7 @@ export class HawdbLibrary { private errorFrom(errorBuffer: RawHawdbBuffer, fallback: string): HawdbError { const text = this.takeBuffer(errorBuffer) - if (!text) return new HawdbError('ffi', fallback) + if (!text) {return new HawdbError('ffi', fallback)} try { const parsed = parseLosslessJson(text) if (typeof parsed === 'object' && parsed !== null) { @@ -301,7 +304,7 @@ export class HawdbLibrary { } private assertOpen(): void { - if (this.closed) throw new HawdbError('library_closed', 'HawDB 动态库已卸载,不可继续调用') + if (this.closed) {throw new HawdbError('library_closed', 'HawDB 动态库已卸载,不可继续调用')} } version(): string { @@ -309,7 +312,7 @@ export class HawdbLibrary { const out = emptyBuffer() this.symbols.hawdb_version(out) const text = this.takeBuffer(out) - if (text === null) throw new HawdbError('ffi', '无法读取 HawDB 版本号') + if (text === null) {throw new HawdbError('ffi', '无法读取 HawDB 版本号')} return text } @@ -329,7 +332,7 @@ export class HawdbLibrary { const optionBytes = encodeUtf8(serializeOpenOptions(options)) const errOut = emptyBuffer() const handle = this.symbols.hawdb_open(pathBytes.buf, pathBytes.len, optionBytes.buf, optionBytes.len, errOut) - if (!handle) throw this.errorFrom(errOut, `无法打开 HawDB 数据库:${path}`) + if (!handle) {throw this.errorFrom(errOut, `无法打开 HawDB 数据库:${path}`)} const stray = this.takeBuffer(errOut) if (stray !== null) { this.symbols.hawdb_close(handle) @@ -343,7 +346,7 @@ export class HawdbLibrary { this.assertOpen() const errOut = emptyBuffer() const handle = this.symbols.hawdb_open_in_memory(errOut) - if (!handle) throw this.errorFrom(errOut, '无法创建内存 HawDB 数据库') + if (!handle) {throw this.errorFrom(errOut, '无法创建内存 HawDB 数据库')} const stray = this.takeBuffer(errOut) if (stray !== null) { this.symbols.hawdb_close(handle) @@ -354,9 +357,9 @@ export class HawdbLibrary { } closeHandle(handle: unknown): void { - if (!this.handles.has(handle)) return + if (!this.handles.has(handle)) {return} this.handles.delete(handle) - if (!this.closed) this.symbols.hawdb_close(handle) + if (!this.closed) {this.symbols.hawdb_close(handle)} } runQuery(handle: unknown, statement: string, params: unknown, inTransaction: boolean, sql: boolean): HawdbQueryResult { @@ -378,7 +381,7 @@ export class HawdbLibrary { } const payload = this.takeBuffer(resultOut) const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} return decodeResultPayload(payload) } @@ -389,7 +392,7 @@ export class HawdbLibrary { throw this.errorFrom(errOut, '无法开启 HawDB 事务') } const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} } commitTransaction(handle: unknown): void { @@ -398,18 +401,18 @@ export class HawdbLibrary { const errOut = emptyBuffer() const ok = this.symbols.hawdb_commit_transaction(handle, resultOut, errOut) this.takeBuffer(resultOut) - if (!ok) throw this.errorFrom(errOut, '提交 HawDB 事务失败') + if (!ok) {throw this.errorFrom(errOut, '提交 HawDB 事务失败')} const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} } rollbackTransaction(handle: unknown): void { this.assertOpen() const errOut = emptyBuffer() const ok = this.symbols.hawdb_rollback_transaction(handle, errOut) - if (!ok) throw this.errorFrom(errOut, '回滚 HawDB 事务失败') + if (!ok) {throw this.errorFrom(errOut, '回滚 HawDB 事务失败')} const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} } private parseReport(reportOut: RawHawdbBuffer, errOut: RawHawdbBuffer, ok: boolean, fallback: string): Record { @@ -420,8 +423,8 @@ export class HawdbLibrary { } const payload = this.takeBuffer(reportOut) const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) - if (!payload) return {} + if (stray !== null) {throw new HawdbError('ffi', stray)} + if (!payload) {return {}} const parsed = parseLosslessJson(payload) return typeof parsed === 'object' && parsed !== null ? (parsed as Record) : {} } @@ -467,7 +470,7 @@ export class HawdbLibrary { } close(): void { - if (this.closed) return + if (this.closed) {return} if (this.handles.size > 0) { throw new HawdbError('open_handles', '关闭 HawDB 动态库前必须先关闭全部数据库句柄') } diff --git a/src/main/ai/hawdb/graphBuilder.ts b/src/main/ai/hawdb/graphBuilder.ts index 82f8ad5d..ffc056b6 100644 --- a/src/main/ai/hawdb/graphBuilder.ts +++ b/src/main/ai/hawdb/graphBuilder.ts @@ -13,19 +13,19 @@ const MAX_RELATED_PER_ENTRY = 6 const MAX_SNIPPET_CHARS = 180 export function normalizeLookupText(value: string): string { - return value.toLocaleLowerCase('zh-CN').replace(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') + return value.toLocaleLowerCase('zh-CN').replaceAll(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') } export function extractQueryTerms(query: string): string[] { const normalized = normalizeLookupText(query) const terms = new Set() - if (normalized) terms.add(normalized) + if (normalized) {terms.add(normalized)} const words = query.toLocaleLowerCase('zh-CN').split(/[^\p{L}\p{N}]+/u).filter(Boolean) for (const word of words) { const clean = normalizeLookupText(word) - if (clean) terms.add(clean) + if (clean) {terms.add(clean)} } - const cjk = normalized.replace(/[^㐀-鿿]/g, '') + const cjk = normalized.replaceAll(/[^㐀-鿿]/g, '') for (let index = 0; index < cjk.length - 1; index += 1) { terms.add(cjk.slice(index, index + 2)) } @@ -52,11 +52,11 @@ export function buildKnowledgeSearchText(entry: KnowledgeEntry): string { export function buildConversationSearchText(conversation: StoredAiConversation): string { const summary = conversation.compression?.summary - const summaryBudget = summary ? Math.min(summary.length, 4_000) : 0 + const summaryBudget = summary ? Math.min(summary.length, 4000) : 0 let messageBudget = MAX_CONVERSATION_SEARCH_CHARS - conversation.title.length - (summaryBudget > 0 ? summaryBudget + 1 : 0) - if (messageBudget <= 0) messageBudget = 0 + if (messageBudget <= 0) {messageBudget = 0} const messageChunks: string[] = [] for (let i = conversation.messages.length - 1; i >= 0 && messageBudget > 0; i -= 1) { const message = conversation.messages[i] @@ -67,20 +67,20 @@ export function buildConversationSearchText(conversation: StoredAiConversation): .map((part) => part.text.trim()) .join(' ') } - if (!text) continue + if (!text) {continue} const chunk = text.length > messageBudget ? text.slice(0, messageBudget) : text messageChunks.unshift(chunk) messageBudget -= chunk.length + 1 } const chunks: string[] = [conversation.title] - if (summary && summaryBudget > 0) chunks.push(summary.slice(0, summaryBudget)) + if (summary && summaryBudget > 0) {chunks.push(summary.slice(0, summaryBudget))} chunks.push(...messageChunks) return chunks.join('\n').slice(0, MAX_CONVERSATION_SEARCH_CHARS) } export function buildConversationSnippet(conversation: StoredAiConversation, query: string): string { const candidates: string[] = [conversation.title] - if (conversation.compression?.summary) candidates.push(conversation.compression.summary) + if (conversation.compression?.summary) {candidates.push(conversation.compression.summary)} for (let i = conversation.messages.length - 1; i >= 0; i -= 1) { const msg = conversation.messages[i] if (msg.content.trim()) { @@ -90,7 +90,7 @@ export function buildConversationSnippet(conversation: StoredAiConversation, que .filter((part): part is { kind: 'text'; text: string } => part.kind === 'text' && Boolean(part.text.trim())) .map((part) => part.text.trim()) .join(' ') - if (partText) candidates.push(partText) + if (partText) {candidates.push(partText)} } } const terms = extractQueryTerms(query).sort((left, right) => right.length - left.length) @@ -98,17 +98,17 @@ export function buildConversationSnippet(conversation: StoredAiConversation, que for (const text of candidates) { const lower = text.toLocaleLowerCase('zh-CN') const idx = lower.indexOf(term) - if (idx >= 0) { + if (idx !== -1) { const start = Math.max(0, idx - 40) const end = Math.min(text.length, start + MAX_SNIPPET_CHARS) const prefix = start > 0 ? '…' : '' const suffix = end < text.length ? '…' : '' - return `${prefix}${text.slice(start, end).replace(/\s+/g, ' ').trim()}${suffix}` + return `${prefix}${text.slice(start, end).replaceAll(/\s+/g, ' ').trim()}${suffix}` } } } const fallback = candidates[0] ?? conversation.title - const clean = fallback.replace(/\s+/g, ' ').trim() + const clean = fallback.replaceAll(/\s+/g, ' ').trim() return clean.length > MAX_SNIPPET_CHARS ? `${clean.slice(0, MAX_SNIPPET_CHARS)}…` : clean } @@ -119,10 +119,10 @@ function pairKey(a: string, b: string): string { function candidateLabels(entry: KnowledgeEntry): string[] { const labels = new Set() const name = normalizeLookupText(entry.name) - if (name.length >= 2) labels.add(name) + if (name.length >= 2) {labels.add(name)} for (const alias of entry.aliases) { const clean = normalizeLookupText(alias) - if (clean.length >= 2) labels.add(clean) + if (clean.length >= 2) {labels.add(clean)} } return [...labels] } @@ -138,14 +138,14 @@ export function extractKnowledgeGraphEdges(entries: KnowledgeEntry[]): Knowledge for (const source of active) { const confusions = source.commonConfusions ?? [] - if (!confusions.length) continue + if (confusions.length === 0) {continue} for (const sentence of confusions) { const normSentence = normalizeLookupText(sentence) - if (!normSentence) continue + if (!normSentence) {continue} for (const target of active) { - if (target.id === source.id) continue + if (target.id === source.id) {continue} const key = pairKey(source.id, target.id) - if (seenPairs.has(key)) continue + if (seenPairs.has(key)) {continue} const targetLabels = labelsById.get(target.id) ?? [] if (targetLabels.some((label) => normSentence.includes(label))) { seenPairs.add(key) @@ -164,15 +164,15 @@ export function extractKnowledgeGraphEdges(entries: KnowledgeEntry[]): Knowledge const bodyText = normalizeLookupText( [source.definition, ...(source.formation ?? []), ...(source.features ?? [])].join(' ') ) - if (!bodyText) continue + if (!bodyText) {continue} let added = 0 for (const target of active) { - if (added >= MAX_RELATED_PER_ENTRY) break - if (target.id === source.id) continue + if (added >= MAX_RELATED_PER_ENTRY) {break} + if (target.id === source.id) {continue} const key = pairKey(source.id, target.id) - if (seenPairs.has(key)) continue + if (seenPairs.has(key)) {continue} const targetName = normalizeLookupText(target.name) - if (targetName.length < 2) continue + if (targetName.length < 2) {continue} if (bodyText.includes(targetName)) { seenPairs.add(key) edges.push({ diff --git a/src/main/ai/hawdb/jsonCodec.ts b/src/main/ai/hawdb/jsonCodec.ts index b8b25ed6..52f5278f 100644 --- a/src/main/ai/hawdb/jsonCodec.ts +++ b/src/main/ai/hawdb/jsonCodec.ts @@ -11,18 +11,18 @@ function isPlainObject(value: object): boolean { } function serializeValue(value: unknown, seen: WeakSet): string { - if (value === null) return 'null' - if (typeof value === 'boolean') return value ? 'true' : 'false' - if (typeof value === 'string') return JSON.stringify(value) + if (value === null) {return 'null'} + if (typeof value === 'boolean') {return value ? 'true' : 'false'} + if (typeof value === 'string') {return JSON.stringify(value)} if (typeof value === 'number') { - if (!Number.isFinite(value)) throw new TypeError('HawDB 参数不支持 NaN 或 Infinity') + if (!Number.isFinite(value)) {throw new TypeError('HawDB 参数不支持 NaN 或 Infinity')} if (Number.isInteger(value) && !Number.isSafeInteger(value)) { throw new TypeError('超出安全整数范围的整数必须使用 bigint 传入') } return JSON.stringify(value) } if (typeof value === 'bigint') { - if (value < INT64_MIN || value > INT64_MAX) throw new RangeError('bigint 超出 64 位有符号整数范围') + if (value < INT64_MIN || value > INT64_MAX) {throw new RangeError('bigint 超出 64 位有符号整数范围')} return value.toString() } if (typeof value !== 'object') { @@ -31,18 +31,18 @@ function serializeValue(value: unknown, seen: WeakSet): string { if (value instanceof Uint8Array) { return JSON.stringify({ $binary: encodeBinaryBase64(value) }) } - if (seen.has(value)) throw new TypeError('HawDB 参数存在循环引用') + if (seen.has(value)) {throw new TypeError('HawDB 参数存在循环引用')} seen.add(value) try { if (Array.isArray(value)) { const parts: string[] = [] for (let i = 0; i < value.length; i += 1) { - if (!Object.hasOwn(value, i)) throw new TypeError('HawDB 不支持稀疏数组参数') + if (!Object.hasOwn(value, i)) {throw new TypeError('HawDB 不支持稀疏数组参数')} parts.push(serializeValue(value[i], seen)) } return `[${parts.join(',')}]` } - if (!isPlainObject(value)) throw new TypeError('HawDB 仅支持普通对象参数') + if (!isPlainObject(value)) {throw new TypeError('HawDB 仅支持普通对象参数')} const entries = Object.entries(value) const parts = entries.map(([key, entryValue]) => `${JSON.stringify(key)}:${serializeValue(entryValue, seen)}`) return `{${parts.join(',')}}` @@ -76,22 +76,22 @@ class LosslessJsonParser { private skipWhitespace(): void { while (this.index < this.text.length) { const ch = this.text.charCodeAt(this.index) - if (ch === 0x20 || ch === 0x0a || ch === 0x0d || ch === 0x09) this.index += 1 - else break + if (ch === 0x20 || ch === 0x0A || ch === 0x0D || ch === 0x09) {this.index += 1} + else {break} } } private parseValue(): unknown { this.skipWhitespace() - if (this.index >= this.text.length) throw new SyntaxError(`HawDB JSON 意外结束,偏移 ${this.index}`) + if (this.index >= this.text.length) {throw new SyntaxError(`HawDB JSON 意外结束,偏移 ${this.index}`)} const ch = this.text[this.index] - if (ch === '"') return this.parseString() - if (ch === '{') return this.parseObject() - if (ch === '[') return this.parseArray() - if (ch === 't') return this.parseLiteral('true', true) - if (ch === 'f') return this.parseLiteral('false', false) - if (ch === 'n') return this.parseLiteral('null', null) - if (ch === '-' || (ch >= '0' && ch <= '9')) return this.parseNumber() + if (ch === '"') {return this.parseString()} + if (ch === '{') {return this.parseObject()} + if (ch === '[') {return this.parseArray()} + if (ch === 't') {return this.parseLiteral('true', true)} + if (ch === 'f') {return this.parseLiteral('false', false)} + if (ch === 'n') {return this.parseLiteral('null', null)} + if (ch === '-' || (ch >= '0' && ch <= '9')) {return this.parseNumber()} throw new SyntaxError(`HawDB JSON 遇到无效字符 ${ch},偏移 ${this.index}`) } @@ -123,12 +123,12 @@ class LosslessJsonParser { private parseNumber(): number | bigint { const start = this.index - if (this.text[this.index] === '-') this.index += 1 - if (this.index >= this.text.length) throw new SyntaxError(`HawDB JSON 数字无效,偏移 ${start}`) + if (this.text[this.index] === '-') {this.index += 1} + if (this.index >= this.text.length) {throw new SyntaxError(`HawDB JSON 数字无效,偏移 ${start}`)} if (this.text[this.index] === '0') { this.index += 1 const next = this.text[this.index] - if (next && next >= '0' && next <= '9') throw new SyntaxError(`HawDB JSON 不允许前导零,偏移 ${start}`) + if (next && next >= '0' && next <= '9') {throw new SyntaxError(`HawDB JSON 不允许前导零,偏移 ${start}`)} } else if (this.text[this.index] >= '1' && this.text[this.index] <= '9') { while (this.index < this.text.length && this.text[this.index] >= '0' && this.text[this.index] <= '9') { this.index += 1 @@ -144,20 +144,20 @@ class LosslessJsonParser { while (this.index < this.text.length && this.text[this.index] >= '0' && this.text[this.index] <= '9') { this.index += 1 } - if (this.index === fracStart) throw new SyntaxError(`HawDB JSON 小数部分为空,偏移 ${start}`) + if (this.index === fracStart) {throw new SyntaxError(`HawDB JSON 小数部分为空,偏移 ${start}`)} } if (this.text[this.index] === 'e' || this.text[this.index] === 'E') { isFloat = true this.index += 1 - if (this.text[this.index] === '+' || this.text[this.index] === '-') this.index += 1 + if (this.text[this.index] === '+' || this.text[this.index] === '-') {this.index += 1} const expStart = this.index while (this.index < this.text.length && this.text[this.index] >= '0' && this.text[this.index] <= '9') { this.index += 1 } - if (this.index === expStart) throw new SyntaxError(`HawDB JSON 指数部分为空,偏移 ${start}`) + if (this.index === expStart) {throw new SyntaxError(`HawDB JSON 指数部分为空,偏移 ${start}`)} } const token = this.text.slice(start, this.index) - if (isFloat) return Number(token) + if (isFloat) {return Number(token)} const big = BigInt(token) if (big >= BigInt(Number.MIN_SAFE_INTEGER) && big <= BigInt(Number.MAX_SAFE_INTEGER)) { return Number(big) @@ -181,7 +181,7 @@ class LosslessJsonParser { this.index += 1 return result } - if (ch !== ',') throw new SyntaxError(`HawDB JSON 数组缺少逗号或右括号,偏移 ${this.index}`) + if (ch !== ',') {throw new SyntaxError(`HawDB JSON 数组缺少逗号或右括号,偏移 ${this.index}`)} this.index += 1 } } @@ -196,10 +196,10 @@ class LosslessJsonParser { } while (true) { this.skipWhitespace() - if (this.text[this.index] !== '"') throw new SyntaxError(`HawDB JSON 对象键必须为字符串,偏移 ${this.index}`) + if (this.text[this.index] !== '"') {throw new SyntaxError(`HawDB JSON 对象键必须为字符串,偏移 ${this.index}`)} const key = this.parseString() this.skipWhitespace() - if (this.text[this.index] !== ':') throw new SyntaxError(`HawDB JSON 对象缺少冒号,偏移 ${this.index}`) + if (this.text[this.index] !== ':') {throw new SyntaxError(`HawDB JSON 对象缺少冒号,偏移 ${this.index}`)} this.index += 1 result[key] = this.parseValue() this.skipWhitespace() @@ -208,7 +208,7 @@ class LosslessJsonParser { this.index += 1 return result } - if (ch !== ',') throw new SyntaxError(`HawDB JSON 对象缺少逗号或右花括号,偏移 ${this.index}`) + if (ch !== ',') {throw new SyntaxError(`HawDB JSON 对象缺少逗号或右花括号,偏移 ${this.index}`)} this.index += 1 } } diff --git a/src/main/ai/hawdb/paths.ts b/src/main/ai/hawdb/paths.ts index 003b39c2..eee11185 100644 --- a/src/main/ai/hawdb/paths.ts +++ b/src/main/ai/hawdb/paths.ts @@ -2,8 +2,8 @@ import { existsSync } from 'node:fs' import { join } from 'node:path' export function hawdbBinaryFileName(platform: string = process.platform): string { - if (platform === 'win32') return 'hawdb_ffi.dll' - if (platform === 'darwin') return 'libhawdb_ffi.dylib' + if (platform === 'win32') {return 'hawdb_ffi.dll'} + if (platform === 'darwin') {return 'libhawdb_ffi.dylib'} return 'libhawdb_ffi.so' } @@ -24,7 +24,7 @@ export function findHawdbBinary( platform: string = process.platform ): string | null { const envOverride = process.env.GUEARTH_HAWDB_LIB - if (envOverride && existsSync(envOverride)) return envOverride + if (envOverride && existsSync(envOverride)) {return envOverride} const binary = hawdbBinaryPathFor(appPath, resourcesPath, packaged, platform) return existsSync(binary) ? binary : null } @@ -36,7 +36,7 @@ export function resolveHawdbBinary( platform: string = process.platform ): string { const binary = findHawdbBinary(appPath, resourcesPath, packaged, platform) - if (binary) return binary + if (binary) {return binary} const expected = hawdbBinaryPathFor(appPath, resourcesPath, packaged, platform) throw new Error( packaged diff --git a/src/main/ai/hawdb/protocol.ts b/src/main/ai/hawdb/protocol.ts index b58af9fb..d91dbf3c 100644 --- a/src/main/ai/hawdb/protocol.ts +++ b/src/main/ai/hawdb/protocol.ts @@ -1,4 +1,4 @@ -import type { AgentMemory, StoredAiConversation, StoredAiConversationSummary } from '../../../preload' +import type { AgentMemory, StoredAiConversationSummary } from '../../../preload' import type { KnowledgeEntry, KnowledgeMatch } from '../knowledge' export type HawdbStorageMode = 'disk' | 'memory-snapshot' diff --git a/src/main/ai/hawdb/schema.ts b/src/main/ai/hawdb/schema.ts index 89d45f0a..00bfded8 100644 --- a/src/main/ai/hawdb/schema.ts +++ b/src/main/ai/hawdb/schema.ts @@ -12,7 +12,7 @@ function tableExists(db: HawdbDatabase, tableName: string): boolean { } function ensureTable(db: HawdbDatabase, tableName: string, ddl: string): void { - if (tableExists(db, tableName)) return + if (tableExists(db, tableName)) {return} db.querySQL(ddl) } diff --git a/src/main/ai/hawdb/worker.ts b/src/main/ai/hawdb/worker.ts index 9414a0d1..bb0192b4 100644 --- a/src/main/ai/hawdb/worker.ts +++ b/src/main/ai/hawdb/worker.ts @@ -8,33 +8,46 @@ let queue: Promise = Promise.resolve() async function dispatch(request: HawdbWorkerRequest): Promise { switch (request.op) { - case 'open': + case 'open': { return engine.open(request.payload) - case 'close': + } + case 'close': { engine.close() return true - case 'status': + } + case 'status': { return engine.status() - case 'memory:list': + } + case 'memory:list': { return engine.listMemories() - case 'memory:add': + } + case 'memory:add': { return engine.addMemory(request.payload.content, request.payload.source) - case 'memory:delete': + } + case 'memory:delete': { return engine.deleteMemory(request.payload.id) - case 'memory:recall': + } + case 'memory:recall': { return engine.recallMemories(request.payload.query, request.payload.limit) - case 'history:list': + } + case 'history:list': { return engine.listConversations() - case 'history:get': + } + case 'history:get': { return engine.getConversation(request.payload.id) - case 'history:save': + } + case 'history:save': { return engine.saveConversation(request.payload.conversation) - case 'history:delete': + } + case 'history:delete': { return engine.deleteConversation(request.payload.id) - case 'history:search': + } + case 'history:search': { return engine.searchConversations(request.payload.query, request.payload.limit, request.payload.excludeId) - case 'knowledge:retrieve': + } + case 'knowledge:retrieve': { return engine.retrieveKnowledge(request.payload.query, request.payload.module, request.payload.topK) + } } } @@ -58,6 +71,6 @@ if (parentPort) { }) } }) - .catch(() => undefined) + .catch(() => {}) }) } diff --git a/src/main/ai/knowledge/index.ts b/src/main/ai/knowledge/index.ts index af884b80..ea850cc2 100644 --- a/src/main/ai/knowledge/index.ts +++ b/src/main/ai/knowledge/index.ts @@ -60,17 +60,17 @@ const DEFAULT_TOP_K = 3 const MAX_TOP_K = 5 function normalize(value: string): string { - return value.toLocaleLowerCase('zh-CN').replace(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') + return value.toLocaleLowerCase('zh-CN').replaceAll(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') } function queryTerms(query: string): string[] { const normalized = normalize(query) const terms = new Set() - if (normalized) terms.add(normalized) + if (normalized) {terms.add(normalized)} const words = query.toLocaleLowerCase('zh-CN').split(/[^\p{L}\p{N}]+/u).filter(Boolean) - for (const word of words) terms.add(normalize(word)) - const cjk = normalized.replace(/[^\u3400-\u9fff]/g, '') - for (let index = 0; index < cjk.length - 1; index += 1) terms.add(cjk.slice(index, index + 2)) + for (const word of words) {terms.add(normalize(word))} + const cjk = normalized.replaceAll(/[^\u3400-\u9FFF]/g, '') + for (let index = 0; index < cjk.length - 1; index += 1) {terms.add(cjk.slice(index, index + 2))} return [...terms].filter((term) => term.length > 0) } @@ -92,10 +92,10 @@ function scoreEntry(entry: KnowledgeEntry, terms: string[], module?: string): { score += 25 matchedFields.push('module') } - if (nameScore) matchedFields.push('name') - if (aliasScore) matchedFields.push('aliases') - if (keywordScore) matchedFields.push('keywords') - if (contentScore) matchedFields.push('content') + if (nameScore) {matchedFields.push('name')} + if (aliasScore) {matchedFields.push('aliases')} + if (keywordScore) {matchedFields.push('keywords')} + if (contentScore) {matchedFields.push('content')} return { score, matchedFields } } @@ -121,7 +121,7 @@ function toMatch(entry: KnowledgeEntry, score: number, matchedFields: string[]): export function retrieveKnowledge(query: string, module?: string, topK = DEFAULT_TOP_K): { query: string; matches: KnowledgeMatch[]; total: number } { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return { query: '', matches: [], total: 0 } + if (!cleanQuery) {return { query: '', matches: [], total: 0 }} const terms = queryTerms(cleanQuery) const limit = Math.min(MAX_TOP_K, Math.max(1, Math.round(topK))) const ranked = knowledgeEntries diff --git a/src/main/ai/locationAnalysis.ts b/src/main/ai/locationAnalysis.ts index 285e0653..03674da1 100644 --- a/src/main/ai/locationAnalysis.ts +++ b/src/main/ai/locationAnalysis.ts @@ -1,4 +1,5 @@ -import { poiStatistics, type PoiCategoryCount } from './amap' +import { poiStatistics } from './amap'; +import type { PoiCategoryCount } from './amap'; import { retrieveKnowledge } from './knowledge' export interface AnalyzeLocationRequest { @@ -45,7 +46,7 @@ const DAILY_LIFE_CATEGORY_CODES = new Set(['05', '06', '07', '08', '09']) export async function analyzeLocation(request: AnalyzeLocationRequest): Promise { const focus = typeof request.focus === 'string' && FOCUS_LABELS[request.focus] ? request.focus : 'general' - const radiusMeters = Math.round(Math.min(50_000, Math.max(200, request.radiusMeters ?? 5_000))) + const radiusMeters = Math.round(Math.min(50_000, Math.max(200, request.radiusMeters ?? 5000))) const base: AnalyzeLocationResult = { center: { name: typeof request.centerName === 'string' ? request.centerName.trim().slice(0, 40) : '', @@ -71,7 +72,7 @@ export async function analyzeLocation(request: AnalyzeLocationRequest): Promise< radiusMeters, maxSamples: 400 }) - if (poi.error) return { ...base, center: poi.center, error: poi.error } + if (poi.error) {return { ...base, center: poi.center, error: poi.error }} const knowledge = retrieveKnowledge(`${poi.center.name} ${FOCUS_LABELS[focus]}区位因素`, '产业区位', 3) const highOrderCategories = poi.categories .filter((item) => HIGH_ORDER_CATEGORY_CODES.has(item.code) && item.count > 0) @@ -80,11 +81,11 @@ export async function analyzeLocation(request: AnalyzeLocationRequest): Promise< .filter((item) => DAILY_LIFE_CATEGORY_CODES.has(item.code) && item.count > 0) .map((item) => `${item.label}(${item.count})`) const notes: string[] = [] - if (poi.sampled < 60) notes.push('该地点周边 POI 样本较少,可能为乡村、低等级中心地或专业化功能区,POI 构成对区位判断的参考有限') - else if (highOrderCategories.length === 0) notes.push('统计半径内未见金融保险、科教文化、商务住宅、公司企业等高级职能类别,职能层级较低') - else notes.push(`出现高级职能类别:${highOrderCategories.join('、')},中心地等级较高`) - if (focus === 'agriculture') notes.push('农业区位以自然条件(气候、地形、土壤、水源)与社会经济条件(市场、交通、政策)为主,POI 构成仅反映周边聚落与市场概况,请结合海拔与你的地理知识分析') - if (focus === 'transport') notes.push('交通区位请关注 POI 中的交通设施服务(15 类)与道路附属设施(18 类)数量,并结合海陆位置、地形起伏综合判断') + if (poi.sampled < 60) {notes.push('该地点周边 POI 样本较少,可能为乡村、低等级中心地或专业化功能区,POI 构成对区位判断的参考有限')} + else if (highOrderCategories.length === 0) {notes.push('统计半径内未见金融保险、科教文化、商务住宅、公司企业等高级职能类别,职能层级较低')} + else {notes.push(`出现高级职能类别:${highOrderCategories.join('、')},中心地等级较高`)} + if (focus === 'agriculture') {notes.push('农业区位以自然条件(气候、地形、土壤、水源)与社会经济条件(市场、交通、政策)为主,POI 构成仅反映周边聚落与市场概况,请结合海拔与你的地理知识分析')} + if (focus === 'transport') {notes.push('交通区位请关注 POI 中的交通设施服务(15 类)与道路附属设施(18 类)数量,并结合海陆位置、地形起伏综合判断')} return { ...base, center: poi.center, diff --git a/src/main/ai/memoryStore.ts b/src/main/ai/memoryStore.ts index db162ee4..a189e0d3 100644 --- a/src/main/ai/memoryStore.ts +++ b/src/main/ai/memoryStore.ts @@ -14,10 +14,10 @@ function isRecord(value: unknown): value is Record { } export function normalizeMemory(value: unknown): AgentMemory | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = typeof value.id === 'string' ? value.id.trim() : '' const content = typeof value.content === 'string' ? value.content.trim().slice(0, MAX_MEMORY_CONTENT_LENGTH) : '' - if (!ID_PATTERN.test(id) || !content) return null + if (!ID_PATTERN.test(id) || !content) {return null} return { id, content, @@ -31,7 +31,7 @@ export class AiMemoryStore { private memories: AgentMemory[] = [] private hawdb: EoqHawdbClient | null = null - private enqueue = serialQueue() + private readonly enqueue = serialQueue() async init(path: string): Promise { this.path = path @@ -51,7 +51,7 @@ export class AiMemoryStore { const seen = new Set() const memories: AgentMemory[] = [] for (const memory of list) { - if (!memory || seen.has(memory.id)) continue + if (!memory || seen.has(memory.id)) {continue} seen.add(memory.id) memories.push(memory) } @@ -67,7 +67,7 @@ export class AiMemoryStore { private assertBackend(): 'hawdb' | 'json' { if (this.hawdb) { - if (!this.hawdb.isReady()) throw new Error('EOQ HawDB 后端不可用,请重启应用后重试') + if (!this.hawdb.isReady()) {throw new Error('EOQ HawDB 后端不可用,请重启应用后重试')} return 'hawdb' } return 'json' @@ -81,8 +81,8 @@ export class AiMemoryStore { return memory } const trimmed = typeof content === 'string' ? content.trim().slice(0, MAX_MEMORY_CONTENT_LENGTH) : '' - if (!trimmed) throw new Error('记忆内容不能为空') - if (this.memories.length >= MAX_MEMORIES) throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`) + if (!trimmed) {throw new Error('记忆内容不能为空')} + if (this.memories.length >= MAX_MEMORIES) {throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`)} const memory: AgentMemory = { id: `m${randomUUID()}`, content: trimmed, @@ -100,11 +100,11 @@ export class AiMemoryStore { return this.enqueue(async () => { if (this.assertBackend() === 'hawdb') { const deleted = await this.hawdb!.deleteMemory(id) - if (deleted) this.memories = this.memories.filter((memory) => memory.id !== id) + if (deleted) {this.memories = this.memories.filter((memory) => memory.id !== id)} return deleted } const next = this.memories.filter((memory) => memory.id !== id) - if (next.length === this.memories.length) return false + if (next.length === this.memories.length) {return false} await writeJson(this.path, next) this.memories = next return true @@ -113,7 +113,7 @@ export class AiMemoryStore { async recall(query: string, limit = 8): Promise { const clean = typeof query === 'string' ? query.trim() : '' - if (!clean) return [] + if (!clean) {return []} if (this.assertBackend() === 'hawdb') { return this.hawdb!.recallMemories(clean, limit) } diff --git a/src/main/ai/modelImporter.ts b/src/main/ai/modelImporter.ts index 42a03ab7..428eb021 100644 --- a/src/main/ai/modelImporter.ts +++ b/src/main/ai/modelImporter.ts @@ -6,14 +6,15 @@ import type { AiProtocol, AiProviderConfig } from '../../preload' -import { DEFAULT_MIRROR_ENDPOINT, mirrorModelsDevUrl, type MirrorEndpointId } from '../../common/tileMirror' +import { DEFAULT_MIRROR_ENDPOINT, mirrorModelsDevUrl } from '../../common/tileMirror'; +import type { MirrorEndpointId } from '../../common/tileMirror'; import { readProviderKey } from '../keyVault' import { readResponseText, ResponseTooLargeError } from './responseReader' const MODELS_DEV_URL = 'https://models.dev/api.json' const REQUEST_TIMEOUT_MS = 20_000 const MAX_RESPONSE_BYTES = 16 * 1024 * 1024 -const MAX_PROVIDER_MODELS = 2_000 +const MAX_PROVIDER_MODELS = 2000 const MAX_ANTHROPIC_PAGES = 100 const modelsDevCache: { expiresAt: number; value: Record | null } = { expiresAt: 0, value: null } let modelsDevMirrorEndpoint: MirrorEndpointId | null = null @@ -48,25 +49,20 @@ function isRecord(value: unknown): value is Record { } function normalized(value: string): string { - return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, '') + return value.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g, '') } function safeUrl(value: string): URL { const url = new URL(value.trim()) - if (!['http:', 'https:'].includes(url.protocol)) throw new Error('接口地址必须使用 HTTP 或 HTTPS') + if (!['http:', 'https:'].includes(url.protocol)) {throw new Error('接口地址必须使用 HTTP 或 HTTPS')} return url } -function endpoint(baseUrl: string, protocol: AiProtocol): string { +function endpoint(baseUrl: string): string { const base = safeUrl(baseUrl) const path = base.pathname.replace(/\/+$/, '') - if (protocol === 'anthropic') { - if (!path || path === '/') base.pathname = '/v1/models' - else base.pathname = `${path}/models` - } else { - if (!path || path === '/') base.pathname = '/v1/models' - else base.pathname = `${path}/models` - } + if (!path || path === '/') {base.pathname = '/v1/models'} + else {base.pathname = `${path}/models`} base.search = '' base.hash = '' return base.toString() @@ -86,11 +82,11 @@ async function fetchText(url: string, init: RequestInit): Promise { controller, tooLargeMessage: '模型列表响应过大' }) - if (!response.ok) throw new Error(`模型列表请求失败(HTTP ${response.status})`) + if (!response.ok) {throw new Error(`模型列表请求失败(HTTP ${response.status})`)} return body } catch (error) { - if (error instanceof ResponseTooLargeError) throw error - if (timedOut || controller.signal.aborted) throw new Error('模型列表请求超时') + if (error instanceof ResponseTooLargeError) {throw error} + if (timedOut || controller.signal.aborted) {throw new Error('模型列表请求超时', { cause: error })} throw error instanceof Error ? error : new Error('模型列表请求失败') } finally { clearTimeout(timer) @@ -100,25 +96,25 @@ async function fetchText(url: string, init: RequestInit): Promise { function parseJson(body: string): Record { try { const value: unknown = JSON.parse(body) - if (!isRecord(value)) throw new Error('响应格式错误') + if (!isRecord(value)) {throw new Error('响应格式错误')} return value } catch (error) { - if (error instanceof Error && error.message === '响应格式错误') throw error - throw new Error('模型列表响应不是有效 JSON') + if (error instanceof Error && error.message === '响应格式错误') {throw error} + throw new Error('模型列表响应不是有效 JSON', { cause: error }) } } function modelIds(payload: Record): string[] { - if (!Array.isArray(payload.data)) throw new Error('模型列表响应缺少 data 数组') + if (!Array.isArray(payload.data)) {throw new TypeError('模型列表响应缺少 data 数组')} const seen = new Set() const ids: string[] = [] for (const item of payload.data) { - if (!isRecord(item) || typeof item.id !== 'string') continue + if (!isRecord(item) || typeof item.id !== 'string') {continue} const id = item.id.trim().slice(0, 200) - if (!id || seen.has(id)) continue + if (!id || seen.has(id)) {continue} seen.add(id) ids.push(id) - if (ids.length >= MAX_PROVIDER_MODELS) break + if (ids.length >= MAX_PROVIDER_MODELS) {break} } return ids } @@ -127,8 +123,8 @@ async function fetchProviderIds(provider: AiProviderConfig, apiKey: string): Pro const headers = provider.protocol === 'anthropic' ? { 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' } : { Authorization: `Bearer ${apiKey}` } - const url = endpoint(provider.baseUrl, provider.protocol) - if (provider.protocol === 'openai') return modelIds(parseJson(await fetchText(url, { headers }))) + const url = endpoint(provider.baseUrl) + if (provider.protocol === 'openai') {return modelIds(parseJson(await fetchText(url, { headers })))} const ids: string[] = [] const seen = new Set() const seenCursors = new Set() @@ -141,11 +137,11 @@ async function fetchProviderIds(provider: AiProviderConfig, apiKey: string): Pro ids.push(id) } } - if (payload.has_more !== true) return ids - if (typeof payload.last_id !== 'string' || !payload.last_id) throw new Error('Anthropic 模型列表缺少下一页游标') - if (seenCursors.has(payload.last_id)) throw new Error('Anthropic 模型列表分页游标未推进') + if (payload.has_more !== true) {return ids} + if (typeof payload.last_id !== 'string' || !payload.last_id) {throw new Error('Anthropic 模型列表缺少下一页游标')} + if (seenCursors.has(payload.last_id)) {throw new Error('Anthropic 模型列表分页游标未推进')} seenCursors.add(payload.last_id) - if (page + 1 >= MAX_ANTHROPIC_PAGES) throw new Error('Anthropic 模型列表页数超出上限') + if (page + 1 >= MAX_ANTHROPIC_PAGES) {throw new Error('Anthropic 模型列表页数超出上限')} const pageUrl = new URL(url) pageUrl.searchParams.set('limit', '1000') pageUrl.searchParams.set('after_id', payload.last_id) @@ -155,7 +151,7 @@ async function fetchProviderIds(provider: AiProviderConfig, apiKey: string): Pro } async function modelsDev(): Promise> { - if (modelsDevCache.value && modelsDevCache.expiresAt > Date.now()) return modelsDevCache.value + if (modelsDevCache.value && modelsDevCache.expiresAt > Date.now()) {return modelsDevCache.value} let payload: Record if (modelsDevMirrorEndpoint) { try { @@ -173,10 +169,10 @@ async function modelsDev(): Promise> { function providersFromCatalog(payload: Record): ProviderMetadata[] { return Object.entries(payload).flatMap(([id, value]): ProviderMetadata[] => { - if (!isRecord(value) || !isRecord(value.models)) return [] + if (!isRecord(value) || !isRecord(value.models)) {return []} const models = Object.fromEntries(Object.entries(value.models).flatMap(([modelId, model]) => { - if (!isRecord(model)) return [] - return [[modelId, model as ModelMetadata]] + if (!isRecord(model)) {return []} + return [[modelId, model]] })) return [{ id, name: typeof value.name === 'string' ? value.name : id, api: typeof value.api === 'string' ? value.api : undefined, models }] }) @@ -187,15 +183,15 @@ function providerCandidates(provider: AiProviderConfig, catalogs: ProviderMetada let host = '' try { host = safeUrl(provider.baseUrl).hostname.toLowerCase() } catch { return [] } const matches = catalogs.filter((catalog) => { - if (providerTokens.has(normalized(catalog.id)) || providerTokens.has(normalized(catalog.name))) return true - if (!catalog.api) return false + if (providerTokens.has(normalized(catalog.id)) || providerTokens.has(normalized(catalog.name))) {return true} + if (!catalog.api) {return false} try { return new URL(catalog.api).hostname.toLowerCase() === host } catch { return false } }) return matches } function effortLevel(options: unknown): { thinking: boolean; thinkingLevel: 'low' | 'medium' | 'high'; note?: string } { - if (!Array.isArray(options)) return { thinking: false, thinkingLevel: 'medium' } + if (!Array.isArray(options)) {return { thinking: false, thinkingLevel: 'medium' }} const effort = options.find((item): item is { type: string; values?: unknown[] } => isRecord(item) && item.type === 'effort') if (!effort || !Array.isArray(effort.values)) { return { thinking: false, thinkingLevel: 'medium', note: '元数据仅声明开关或预算控制,当前协议未自动启用思考参数' } @@ -203,7 +199,7 @@ function effortLevel(options: unknown): { thinking: boolean; thinkingLevel: 'low const values = effort.values.filter((value): value is string => typeof value === 'string').map((value) => value.toLowerCase()) const rank: Record = { none: 0, minimal: 1, low: 2, medium: 3, high: 4, xhigh: 5, max: 6 } const supported = values.filter((value) => value !== 'none' && value !== 'default' && value in rank) - if (!supported.length) return { thinking: false, thinkingLevel: 'medium', note: '元数据没有可用的思考等级' } + if (supported.length === 0) {return { thinking: false, thinkingLevel: 'medium', note: '元数据没有可用的思考等级' }} const selected = supported.includes('high') ? 'high' : supported.reduce((best, value) => rank[value] > rank[best] ? value : best, supported[0]) return { thinking: true, thinkingLevel: selected === 'low' || selected === 'minimal' ? 'low' : selected === 'medium' ? 'medium' : 'high' } } @@ -226,7 +222,7 @@ function metadataSignature(metadata: ModelMetadata): string { const effort = effortLevel(metadata.reasoning_options) return JSON.stringify({ name: typeof metadata.name === 'string' ? metadata.name.trim() : '', - context: Math.min(2_000_000, Math.max(4_096, Math.round(limit))), + context: Math.min(2_000_000, Math.max(4096, Math.round(limit))), vision: modalities.includes('image'), thinking: metadata.reasoning === true && effort.thinking, level: effort.thinkingLevel @@ -237,11 +233,11 @@ function resolveAmbiguous(matches: CatalogMatch[]): CatalogMatch | null { const labs = new Set(matches.flatMap((match) => typeof match.metadata.canonical_model_id === 'string' && match.metadata.canonical_model_id ? [match.metadata.canonical_model_id.split('/')[0].toLowerCase()] : [])) - if (labs.size > 1) return null + if (labs.size > 1) {return null} if (labs.size === 1) { const lab = [...labs][0] const official = matches.find((match) => normalized(match.catalog.id) === normalized(lab)) - if (official) return official + if (official) {return official} } const signatures = new Set(matches.map((match) => metadataSignature(match.metadata))) return signatures.size === 1 ? matches[0] : null @@ -258,16 +254,16 @@ function candidateScore(match: CatalogMatch): [number, number, number, number] { } function bestEffortMatch(result: MetadataMatch): MetadataMatch { - if (!result.candidates?.length) return result + if (!result.candidates?.length) {return result} const labs = new Set(result.candidates.flatMap((match) => typeof match.metadata.canonical_model_id === 'string' && match.metadata.canonical_model_id ? [match.metadata.canonical_model_id.split('/')[0].toLowerCase()] : [])) - if (labs.size > 1) return result + if (labs.size > 1) {return result} const candidate = [...result.candidates].sort((a, b) => { const left = candidateScore(a) const right = candidateScore(b) for (let index = 0; index < left.length; index += 1) { - if (left[index] !== right[index]) return right[index] - left[index] + if (left[index] !== right[index]) {return right[index] - left[index]} } return 0 })[0] @@ -277,22 +273,22 @@ function bestEffortMatch(result: MetadataMatch): MetadataMatch { function matchMetadata(id: string, provider: AiProviderConfig, catalogs: ProviderMetadata[]): MetadataMatch { const candidates = providerCandidates(provider, catalogs) const direct = candidates.flatMap((catalog) => catalog.models[id] ? [{ catalog, metadata: catalog.models[id] }] : []) - if (direct.length === 1) return direct[0] + if (direct.length === 1) {return direct[0]} if (direct.length > 1) { const resolved = resolveAmbiguous(direct) return resolved ?? { note: '多个供应商元数据均匹配,无法安全确定来源', conflict: true, candidates: direct } } const global = catalogs.flatMap((catalog) => catalog.models[id] ? [{ catalog, metadata: catalog.models[id] }] : []) - if (global.length === 1) return global[0] + if (global.length === 1) {return global[0]} if (global.length > 1) { const resolved = resolveAmbiguous(global) return resolved ?? { note: '多个供应商元数据均匹配,无法安全确定来源', conflict: true, candidates: global } } const canonical = catalogs.flatMap((catalog) => Object.values(catalog.models).flatMap((metadata) => { - if (typeof metadata.canonical_model_id === 'string' && normalized(metadata.canonical_model_id) === normalized(`${catalog.id}/${id}`)) return [{ catalog, metadata }] + if (typeof metadata.canonical_model_id === 'string' && normalized(metadata.canonical_model_id) === normalized(`${catalog.id}/${id}`)) {return [{ catalog, metadata }]} return [] })) - if (canonical.length === 1) return canonical[0] + if (canonical.length === 1) {return canonical[0]} if (canonical.length > 1) { const resolved = resolveAmbiguous(canonical) return resolved ?? { note: '多个供应商元数据均匹配,无法安全确定来源', conflict: true, candidates: canonical } @@ -302,16 +298,16 @@ function matchMetadata(id: string, provider: AiProviderConfig, catalogs: Provide function metadataFor(id: string, provider: AiProviderConfig, catalogs: ProviderMetadata[], modelGroupCompat: boolean): MetadataMatch { const direct = matchMetadata(id, provider, catalogs) - if (direct.metadata) return direct - if (direct.conflict) return modelGroupCompat ? bestEffortMatch(direct) : direct - if (!modelGroupCompat) return direct + if (direct.metadata) {return direct} + if (direct.conflict) {return modelGroupCompat ? bestEffortMatch(direct) : direct} + if (!modelGroupCompat) {return direct} const slash = id.indexOf('/') - if (slash < 0) return direct + if (slash === -1) {return direct} const grouped = id.slice(slash + 1).trim() - if (!grouped) return direct + if (!grouped) {return direct} const result = matchMetadata(grouped, provider, catalogs) - if (result.metadata) return result - if (result.conflict) return bestEffortMatch(result) + if (result.metadata) {return result} + if (result.conflict) {return bestEffortMatch(result)} return { note: result.note ? `模型组兼容:${result.note}` : '模型组兼容未找到匹配' } } @@ -324,7 +320,7 @@ function toRow(id: string, metadata: ModelMetadata | undefined, note: string | u return { id, label: typeof metadata?.name === 'string' && metadata.name.trim() ? metadata.name.trim().slice(0, 80) : id, - contextWindow: Math.min(2_000_000, Math.max(4_096, Math.round(limit))), + contextWindow: Math.min(2_000_000, Math.max(4096, Math.round(limit))), streaming: true, vision: modalities.includes('image'), thinking: reasoning && (provider.protocol === 'anthropic' || !effort.note) ? effort.thinking : false, @@ -337,12 +333,12 @@ function toRow(id: string, metadata: ModelMetadata | undefined, note: string | u } function validateRequest(value: unknown): AiModelImportRequest { - if (!isRecord(value)) throw new Error('无效的模型导入请求') - if (!['openai', 'anthropic'].includes(value.protocol as string)) throw new Error('该协议不支持自动导入模型') + if (!isRecord(value)) {throw new Error('无效的模型导入请求')} + if (!['openai', 'anthropic'].includes(value.protocol as string)) {throw new Error('该协议不支持自动导入模型')} const id = typeof value.id === 'string' ? value.id.trim() : '' const name = typeof value.name === 'string' ? value.name.trim() : '' const baseUrl = typeof value.baseUrl === 'string' ? value.baseUrl.trim() : '' - if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !baseUrl) throw new Error('供应商信息不完整') + if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !baseUrl) {throw new Error('供应商信息不完整')} safeUrl(baseUrl) const ids = Array.isArray(value.ids) ? [...new Set(value.ids.flatMap((item): string[] => typeof item === 'string' && item.trim() ? [item.trim().slice(0, 200)] : []))].slice(0, MAX_PROVIDER_MODELS) @@ -365,15 +361,15 @@ export async function importModels(value: unknown): Promise name: request.name, protocol: request.protocol, baseUrl: request.baseUrl, - models: request.models as AiProviderConfig['models'] + models: request.models } - const idsPromise = request.ids !== undefined - ? Promise.resolve(request.ids) - : (() => { + const idsPromise = request.ids === undefined + ? (() => { const apiKey = readProviderKey(`ai-${provider.id}`) - if (!apiKey) return Promise.reject(new Error(`未配置「${provider.name}」的 API Key,请先保存 API Key`)) + if (!apiKey) {return Promise.reject(new Error(`未配置「${provider.name}」的 API Key,请先保存 API Key`))} return fetchProviderIds(provider, apiKey) })() + : Promise.resolve(request.ids) const [ids, catalog] = await Promise.all([idsPromise, modelsDev()]) const catalogs = providersFromCatalog(catalog) const rows = ids.map((id) => { diff --git a/src/main/ai/modelTest.ts b/src/main/ai/modelTest.ts index 6476432d..eb3a218a 100644 --- a/src/main/ai/modelTest.ts +++ b/src/main/ai/modelTest.ts @@ -1,4 +1,4 @@ -import { randomUUID } from 'crypto' +import { randomUUID } from 'node:crypto' import { net } from 'electron' import type { AiModelTestRequest, AiModelTestResult, AiProtocol } from '../../preload' import { normalizeModelTestOutput, redactApiKey } from '../../common/aiTelemetry' @@ -15,17 +15,17 @@ function isRecord(value: unknown): value is Record { function endpoint(baseUrl: string, protocol: AiProtocol): string { let base = baseUrl.trim().replace(/\/+$/, '') - if (/^https?:\/\/[^/]+$/i.test(base)) base = `${base}/v1` + if (/^https?:\/\/[^/]+$/i.test(base)) {base = `${base}/v1`} return `${base}${protocol === 'anthropic' ? '/messages' : '/chat/completions'}` } function extractPayloadError(payload: Record): { message: string; code: string } | null { const raw = payload.error - if (typeof raw === 'string' && raw.trim()) return { message: raw, code: '' } + if (typeof raw === 'string' && raw.trim()) {return { message: raw, code: '' }} if (isRecord(raw)) { const message = typeof raw.message === 'string' ? raw.message : '' const code = typeof raw.code === 'string' ? raw.code : typeof raw.type === 'string' ? raw.type : '' - if (message || code || Object.keys(raw).length > 0) return { message, code } + if (message || code || Object.keys(raw).length > 0) {return { message, code }} } if (payload.type === 'error') { const message = typeof payload.message === 'string' ? payload.message : '' @@ -53,31 +53,31 @@ function failureMessage(status: number, text: string, apiKey: string): string { message = text } const hint = `${code} ${message}`.toLowerCase() - if (status === 402 || /insufficient|balance|quota|credit/.test(hint)) return '账户余额不足或额度已用尽' - if (status === 401 || status === 403 || /api.?key|unauthor|forbidden|auth/.test(hint)) return 'API Key 无效或无权限' - if (status === 404 || /model.*(not.*found|not.*exist|no such)/.test(hint)) return '模型不存在' - if (status === 429 || /rate.?limit|too many/.test(hint)) return '请求过于频繁,请稍后重试' + if (status === 402 || /insufficient|balance|quota|credit/.test(hint)) {return '账户余额不足或额度已用尽'} + if (status === 401 || status === 403 || /api.?key|unauthor|forbidden|auth/.test(hint)) {return 'API Key 无效或无权限'} + if (status === 404 || /model.*(not.*found|not.*exist|no such)/.test(hint)) {return '模型不存在'} + if (status === 429 || /rate.?limit|too many/.test(hint)) {return '请求过于频繁,请稍后重试'} const detail = (message || text).trim().replaceAll(apiKey, '[redacted]').slice(0, 160) return `响应失败(HTTP ${status})${detail ? `:${detail}` : ''}` } function validate(value: unknown): AiModelTestRequest { - if (!isRecord(value)) throw new Error('无效的响应测试请求') - if (!['openai', 'anthropic'].includes(value.protocol as string)) throw new Error('该协议不支持响应测试') + if (!isRecord(value)) {throw new Error('无效的响应测试请求')} + if (!['openai', 'anthropic'].includes(value.protocol as string)) {throw new Error('该协议不支持响应测试')} const id = typeof value.id === 'string' ? value.id.trim() : '' const name = typeof value.name === 'string' ? value.name.trim() : '' const baseUrl = typeof value.baseUrl === 'string' ? value.baseUrl.trim() : '' const modelId = typeof value.modelId === 'string' ? value.modelId.trim().slice(0, 200) : '' - if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !modelId) throw new Error('模型信息不完整') + if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !modelId) {throw new Error('模型信息不完整')} const url = new URL(baseUrl) - if (!['http:', 'https:'].includes(url.protocol)) throw new Error('接口地址必须使用 HTTP 或 HTTPS') + if (!['http:', 'https:'].includes(url.protocol)) {throw new Error('接口地址必须使用 HTTP 或 HTTPS')} return { id, name: name.slice(0, 80), protocol: value.protocol as AiProtocol, baseUrl: baseUrl.slice(0, 500), modelId } } export async function testModel(value: unknown): Promise { const request = validate(value) const apiKey = readProviderKey(`ai-${request.id}`) - if (!apiKey) throw new Error('请先保存 API Key') + if (!apiKey) {throw new Error('请先保存 API Key')} const headers = request.protocol === 'anthropic' ? { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' } : { 'Content-Type': 'application/json', Authorization: `Bearer ${apiKey}` } @@ -105,10 +105,10 @@ export async function testModel(value: unknown): Promise { controller, tooLargeMessage: '响应内容过大' }) - if (!response.ok) throw new Error(failureMessage(response.status, text, apiKey)) + if (!response.ok) {throw new Error(failureMessage(response.status, text, apiKey))} const payload: unknown = JSON.parse(text) - if (!isRecord(payload)) throw new Error('响应格式错误') - if (extractPayloadError(payload)) throw new Error(failureMessage(response.status, text, apiKey)) + if (!isRecord(payload)) {throw new Error('响应格式错误')} + if (extractPayloadError(payload)) {throw new Error(failureMessage(response.status, text, apiKey))} captureAiGeneration({ distinctId: `ai-model-test:${traceId}`, traceId, diff --git a/src/main/ai/poiAggregation.ts b/src/main/ai/poiAggregation.ts index 985e49e8..3d60b063 100644 --- a/src/main/ai/poiAggregation.ts +++ b/src/main/ai/poiAggregation.ts @@ -22,7 +22,7 @@ export function aggregatePois(target: PoiAggregation, pois: readonly PoiSample[] for (const poi of pois) { target.fetched += 1 const code = poiBigCategory(poi) - if (!code) continue + if (!code) {continue} target.counts.set(code, (target.counts.get(code) ?? 0) + 1) target.sampled += 1 } diff --git a/src/main/ai/poiCategories.ts b/src/main/ai/poiCategories.ts index 1dbe9456..b590ba16 100644 --- a/src/main/ai/poiCategories.ts +++ b/src/main/ai/poiCategories.ts @@ -27,7 +27,7 @@ export interface PoiLike { } export function poiBigCategory(poi: PoiLike): string | undefined { - if (typeof poi.typecode !== 'string') return undefined + if (typeof poi.typecode !== 'string') {return undefined} const code = poi.typecode.slice(0, 2) return POI_CATEGORY_LABELS[code] === undefined ? undefined : code } diff --git a/src/main/ai/posthog.ts b/src/main/ai/posthog.ts index b3d14391..4793fa3a 100644 --- a/src/main/ai/posthog.ts +++ b/src/main/ai/posthog.ts @@ -8,12 +8,12 @@ let posthogClient: PostHog | null = null let missingWarned = false function ensureClient(): PostHog | null { - if (!aiPosthogEnabled) return null - if (posthogClient) return posthogClient + if (!aiPosthogEnabled) {return null} + if (posthogClient) {return posthogClient} if (!projectToken || !host) { if (!missingWarned && import.meta.env.DEV) { missingWarned = true - const missingConfiguration = !projectToken ? 'VITE_POSTHOG_PROJECT_TOKEN' : 'VITE_POSTHOG_HOST' + const missingConfiguration = projectToken ? 'VITE_POSTHOG_HOST' : 'VITE_POSTHOG_PROJECT_TOKEN' console.warn(`${missingConfiguration} variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once ${missingConfiguration} is configured`) } return null @@ -28,7 +28,7 @@ function ensureClient(): PostHog | null { export function setAiPosthogEnabled(enabled: boolean): void { aiPosthogEnabled = enabled - if (enabled) ensureClient() + if (enabled) {ensureClient()} } export function isAiPosthogEnabled(): boolean { @@ -64,7 +64,7 @@ interface AiSpanCapture extends AiCaptureBase { export function captureAiGeneration(capture: AiGenerationCapture): void { const client = ensureClient() - if (!client) return + if (!client) {return} try { client.capture({ distinctId: capture.distinctId, @@ -76,7 +76,7 @@ export function captureAiGeneration(capture: AiGenerationCapture): void { $ai_provider: capture.provider, $ai_input: capture.input, ...(capture.output === undefined ? {} : { $ai_output_choices: capture.output }), - $ai_latency: capture.latencyMs / 1_000, + $ai_latency: capture.latencyMs / 1000, $ai_base_url: capture.baseUrl, $ai_request_url: capture.requestUrl, $ai_stream: capture.stream, @@ -85,13 +85,13 @@ export function captureAiGeneration(capture: AiGenerationCapture): void { } }) } catch { - return + // Best effort, so the failure is ignored. } } export function captureAiSpan(capture: AiSpanCapture): void { const client = ensureClient() - if (!client) return + if (!client) {return} try { client.capture({ distinctId: capture.distinctId, @@ -103,29 +103,29 @@ export function captureAiSpan(capture: AiSpanCapture): void { $ai_span_name: capture.name, $ai_input_state: capture.input, $ai_output_state: capture.output, - $ai_latency: capture.latencyMs / 1_000, + $ai_latency: capture.latencyMs / 1000, ...(capture.error ? { $ai_is_error: true, $ai_error: capture.error } : {}) } }) } catch { - return + // Best effort, so the failure is ignored. } } export async function shutdownPosthog(): Promise { - if (!posthogClient) return + if (!posthogClient) {return} let timeout: NodeJS.Timeout | undefined try { await Promise.race([ posthogClient.shutdown(), new Promise((resolve) => { - timeout = setTimeout(resolve, 1_000) + timeout = setTimeout(resolve, 1000) timeout.unref() }) ]) } catch { - return + // Best effort, so the failure is ignored. } finally { - if (timeout) clearTimeout(timeout) + if (timeout) {clearTimeout(timeout)} } } diff --git a/src/main/ai/responseReader.ts b/src/main/ai/responseReader.ts index ab3a5508..94823733 100644 --- a/src/main/ai/responseReader.ts +++ b/src/main/ai/responseReader.ts @@ -10,7 +10,7 @@ export async function readResponseText( options: { maxBytes: number; controller: AbortController; tooLargeMessage: string } ): Promise { const { maxBytes, controller, tooLargeMessage } = options - if (!response.body) return '' + if (!response.body) {return ''} const reader = response.body.getReader() const decoder = new TextDecoder() const chunks: string[] = [] @@ -18,7 +18,7 @@ export async function readResponseText( try { while (true) { const { done, value } = await reader.read() - if (done) break + if (done) {break} totalBytes += value.byteLength if (totalBytes > maxBytes) { const error = new ResponseTooLargeError(tooLargeMessage) @@ -34,7 +34,7 @@ export async function readResponseText( try { reader.releaseLock() } catch { - // reader may already be released or canceled + // Reader may already be released or canceled } } } diff --git a/src/main/ai/search/baidu.ts b/src/main/ai/search/baidu.ts index 41fc5b3a..0f4746f7 100644 --- a/src/main/ai/search/baidu.ts +++ b/src/main/ai/search/baidu.ts @@ -12,13 +12,13 @@ function text(value: unknown, limit: number): string { } function referenceFrom(value: unknown): AiSearchReference | null { - if (!isRecord(value) || (value.type !== undefined && value.type !== 'web')) return null - if (typeof value.url !== 'string' || value.url.length > 2048) return null + if (!isRecord(value) || (value.type !== undefined && value.type !== 'web')) {return null} + if (typeof value.url !== 'string' || value.url.length > 2048) {return null} try { const url = new URL(value.url) - if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password) return null + if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password) {return null} const title = text(value.title, 300) - if (!title) return null + if (!title) {return null} return { title, url: url.href, @@ -32,7 +32,7 @@ function referenceFrom(value: unknown): AiSearchReference | null { } function providerError(body: unknown, apiKey: string): string { - if (!isRecord(body) || body.code === undefined || body.code === null || body.code === 0 || body.code === '0') return '' + if (!isRecord(body) || body.code === undefined || body.code === null || body.code === 0 || body.code === '0') {return ''} const code = typeof body.code === 'number' || typeof body.code === 'string' ? String(body.code) : '' const message = typeof body.message === 'string' ? body.message : '未知错误' return `百度千帆搜索失败:${message}${code ? ` (${code})` : ''}`.replaceAll(apiKey, '[已隐藏]').slice(0, 400) @@ -58,23 +58,23 @@ export async function searchBaiduWeb(query: string, apiKey: string, signal: Abor const body: unknown = await response.json().catch(() => null) requestSignal.throwIfAborted() const error = providerError(body, apiKey) - if (error) return { query, error } - if (!response.ok) return { query, error: `百度千帆搜索请求失败 (HTTP ${response.status})` } - if (!isRecord(body) || !Array.isArray(body.references)) return { query, error: '百度千帆返回了无效搜索数据' } + if (error) {return { query, error }} + if (!response.ok) {return { query, error: `百度千帆搜索请求失败 (HTTP ${response.status})` }} + if (!isRecord(body) || !Array.isArray(body.references)) {return { query, error: '百度千帆返回了无效搜索数据' }} const references: AiSearchReference[] = [] const urls = new Set() for (const value of body.references) { const reference = referenceFrom(value) - if (!reference || urls.has(reference.url)) continue - if (JSON.stringify({ query, references: [...references, reference] }).length > 24_000) break + if (!reference || urls.has(reference.url)) {continue} + if (JSON.stringify({ query, references: [...references, reference] }).length > 24_000) {break} references.push(reference) urls.add(reference.url) - if (references.length === 10) break + if (references.length === 10) {break} } return { query, references } } catch { - if (signal.aborted) return { query, error: '搜索已取消' } - if (timeout.aborted) return { query, error: '百度千帆搜索超时,请稍后重试' } + if (signal.aborted) {return { query, error: '搜索已取消' }} + if (timeout.aborted) {return { query, error: '百度千帆搜索超时,请稍后重试' }} return { query, error: '百度千帆搜索网络请求失败,请稍后重试' } } } diff --git a/src/main/ai/search/index.ts b/src/main/ai/search/index.ts index 9df794ce..373b8d31 100644 --- a/src/main/ai/search/index.ts +++ b/src/main/ai/search/index.ts @@ -1,7 +1,8 @@ import { net } from 'electron' import type { AiSearchProviderConfig } from '../../../preload' import { readProviderKey } from '../../keyVault' -import { searchBaiduWeb, type SearchFetch, type WebSearchResult } from './baidu' +import { searchBaiduWeb } from './baidu'; +import type { SearchFetch, WebSearchResult } from './baidu'; type SearchAdapter = (query: string, apiKey: string, signal: AbortSignal, fetch: SearchFetch) => Promise @@ -9,12 +10,12 @@ const searchAdapters: Record = { export async function searchWeb(provider: AiSearchProviderConfig | undefined, input: unknown, signal: AbortSignal): Promise { const query = typeof input === 'string' ? input.trim().slice(0, 500) : '' - if (signal.aborted) return { query, error: '搜索已取消' } - if (!query) return { query, error: '缺少搜索关键词' } - if (!provider) return { query, error: '请在「AI 设置 → 搜索供应商」中选择搜索供应商' } + if (signal.aborted) {return { query, error: '搜索已取消' }} + if (!query) {return { query, error: '缺少搜索关键词' }} + if (!provider) {return { query, error: '请在「AI 设置 → 搜索供应商」中选择搜索供应商' }} const adapter = searchAdapters[provider.kind] - if (!adapter) return { query, error: '不支持的搜索供应商' } + if (!adapter) {return { query, error: '不支持的搜索供应商' }} const apiKey = readProviderKey(`ai-search-${provider.id}`) - if (!apiKey) return { query, error: `未配置「${provider.name}」的 AppBuilder API Key,请在「AI 设置 → 搜索供应商」中保存` } + if (!apiKey) {return { query, error: `未配置「${provider.name}」的 AppBuilder API Key,请在「AI 设置 → 搜索供应商」中保存` }} return adapter(query, apiKey, signal, (url, init) => net.fetch(url, init)) } diff --git a/src/main/ai/searchThrottle.ts b/src/main/ai/searchThrottle.ts index e2ead187..7d613449 100644 --- a/src/main/ai/searchThrottle.ts +++ b/src/main/ai/searchThrottle.ts @@ -1,5 +1,5 @@ export function delay(ms: number): Promise { - return new Promise((resolve) => setTimeout(resolve, ms)) + return new Promise((resolve) => { setTimeout(resolve, ms) }) } export interface SearchThrottle { @@ -13,12 +13,12 @@ export function createSearchThrottle(minIntervalMs: number): SearchThrottle { run: (task: () => Promise, isSuperseded?: () => boolean): Promise => { const scheduled: Promise = tail.then(async (): Promise => { const wait = lastStartedAt + minIntervalMs - Date.now() - if (wait > 0) await delay(wait) - if (isSuperseded?.()) return null + if (wait > 0) {await delay(wait)} + if (isSuperseded?.()) {return null} lastStartedAt = Date.now() return task() }) - tail = scheduled.catch(() => undefined) + tail = scheduled.catch(() => {}) return scheduled } } diff --git a/src/main/ai/settingsStore.ts b/src/main/ai/settingsStore.ts index 24be7449..1d35a53a 100644 --- a/src/main/ai/settingsStore.ts +++ b/src/main/ai/settingsStore.ts @@ -2,8 +2,8 @@ import { readJson, serialQueue, writeJson } from '../jsonStore' import type { AiModelConfig, AiProviderConfig, AiProtocol, AiSearchProviderConfig, AiSettings, AiThinkingLevel } from '../../preload' import { defaultAiSettings, defaultSearchProviders } from '../../shared/aiSettings' -const thinkingLevels: AiThinkingLevel[] = ['low', 'medium', 'high'] -const protocols: AiProtocol[] = ['openai', 'anthropic'] +const thinkingLevels = new Set(['low', 'medium', 'high']) +const protocols = new Set(['openai', 'anthropic']) const idPattern = /^[a-z0-9][a-z0-9_-]{0,63}$/i const maxModelsPerProvider = 256 @@ -12,14 +12,14 @@ function isRecord(value: unknown): value is Record { } function normalizeModel(value: unknown): AiModelConfig | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = typeof value.id === 'string' ? value.id.trim().slice(0, 200) : '' - if (!id) return null + if (!id) {return null} const label = typeof value.label === 'string' && value.label.trim() ? value.label.trim().slice(0, 80) : id const contextWindow = typeof value.contextWindow === 'number' && Number.isFinite(value.contextWindow) - ? Math.min(2_000_000, Math.max(4_096, Math.round(value.contextWindow))) + ? Math.min(2_000_000, Math.max(4096, Math.round(value.contextWindow))) : 128_000 - const thinkingLevel = thinkingLevels.includes(value.thinkingLevel as AiThinkingLevel) ? value.thinkingLevel as AiThinkingLevel : 'medium' + const thinkingLevel = thinkingLevels.has(value.thinkingLevel as AiThinkingLevel) ? value.thinkingLevel as AiThinkingLevel : 'medium' return { id, label, @@ -33,13 +33,13 @@ function normalizeModel(value: unknown): AiModelConfig | null { } function normalizeProvider(value: unknown): AiProviderConfig | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = typeof value.id === 'string' && idPattern.test(value.id) ? value.id : '' - if (!id) return null + if (!id) {return null} const name = typeof value.name === 'string' && value.name.trim() ? value.name.trim().slice(0, 80) : id - const protocol = protocols.includes(value.protocol as AiProtocol) ? value.protocol as AiProtocol : 'openai' + const protocol = protocols.has(value.protocol as AiProtocol) ? value.protocol as AiProtocol : 'openai' let baseUrl = typeof value.baseUrl === 'string' ? value.baseUrl.trim() : '' - if (!baseUrl) baseUrl = protocol === 'anthropic' ? 'https://api.anthropic.com' : '' + if (!baseUrl) {baseUrl = protocol === 'anthropic' ? 'https://api.anthropic.com' : ''} baseUrl = baseUrl.replace(/\/+$/, '').slice(0, 500) const models = Array.isArray(value.models) ? value.models.map(normalizeModel).filter((model): model is AiModelConfig => model !== null).slice(0, maxModelsPerProvider) : [] return { id, name, protocol, baseUrl, models } @@ -60,14 +60,14 @@ export function normalizeAiSettings(value: unknown): AiSettings { const seenSearchIds = new Set() const searchProviders = Array.isArray(source.searchProviders) ? source.searchProviders.flatMap((value): AiSearchProviderConfig[] => { - if (!isRecord(value) || value.kind !== 'baidu' || typeof value.id !== 'string') return [] - if (!/^[a-z0-9][a-z0-9_-]{0,53}$/i.test(value.id) || seenSearchIds.has(value.id)) return [] + if (!isRecord(value) || value.kind !== 'baidu' || typeof value.id !== 'string') {return []} + if (!/^[a-z0-9][a-z0-9_-]{0,53}$/i.test(value.id) || seenSearchIds.has(value.id)) {return []} seenSearchIds.add(value.id) const name = typeof value.name === 'string' && value.name.trim() ? value.name.trim().slice(0, 80) : '百度千帆' return [{ id: value.id, name, kind: 'baidu' }] }).slice(0, 16) : [] - if (!searchProviders.length) searchProviders.push(...defaultSearchProviders()) + if (searchProviders.length === 0) {searchProviders.push(...defaultSearchProviders())} const activeSearchProviderId = searchProviders.some((provider) => provider.id === source.activeSearchProviderId) ? source.activeSearchProviderId as string : searchProviders[0].id @@ -87,7 +87,7 @@ export class AiSettingsStore { private path = '' private settings: AiSettings = defaultAiSettings() - private enqueue = serialQueue() + private readonly enqueue = serialQueue() async init(path: string): Promise { this.path = path diff --git a/src/main/datasets.ts b/src/main/datasets.ts index 1eca529a..cdfa4531 100644 --- a/src/main/datasets.ts +++ b/src/main/datasets.ts @@ -1,14 +1,15 @@ -import { existsSync, readFileSync } from 'fs' -import { join } from 'path' +import { existsSync, readFileSync } from 'node:fs' +import { join } from 'node:path' import { net } from 'electron' import type { EarthquakeFeed, ProvinceFeature, ProvinceGeoDocument } from '../preload' -import { DEFAULT_MIRROR_ENDPOINT, mirrorEarthquakesUrl, type MirrorEndpointId } from '../common/tileMirror' +import { DEFAULT_MIRROR_ENDPOINT, mirrorEarthquakesUrl } from '../common/tileMirror'; +import type { MirrorEndpointId } from '../common/tileMirror'; import { gcj02ToWgs84 } from './geo/gcj02' import { writeJson } from './jsonStore' import provincesAssetPath from '../../resources/geo/china-provinces.geojson?asset' const EARTHQUAKE_FEED_URL = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson' -const FETCH_TIMEOUT_MS = 15000 +const FETCH_TIMEOUT_MS = 15_000 let earthquakesPath = '' let datasetMirrorEndpoint: MirrorEndpointId | null = null @@ -31,10 +32,10 @@ export function initDatasets(userDataPath: string): void { } function readCachedFeed(): EarthquakeFeed | null { - if (!existsSync(earthquakesPath)) return null + if (!existsSync(earthquakesPath)) {return null} try { const parsed: unknown = JSON.parse(readFileSync(earthquakesPath, 'utf8')) - if (!isRecord(parsed) || typeof parsed.fetchedAt !== 'number' || !Array.isArray(parsed.events)) return null + if (!isRecord(parsed) || typeof parsed.fetchedAt !== 'number' || !Array.isArray(parsed.events)) {return null} const events = parsed.events.filter((item): item is EarthquakeFeed['events'][number] => isRecord(item) && typeof item.magnitude === 'number' @@ -52,17 +53,17 @@ function readCachedFeed(): EarthquakeFeed | null { } function parseFeed(json: unknown): EarthquakeFeed['events'] { - if (!isRecord(json) || !Array.isArray(json.features)) throw new Error('USGS response is invalid') + if (!isRecord(json) || !Array.isArray(json.features)) {throw new Error('USGS response is invalid')} const events: EarthquakeFeed['events'] = [] for (const feature of json.features) { - if (!isRecord(feature)) continue + if (!isRecord(feature)) {continue} const properties = isRecord(feature.properties) ? feature.properties : {} const geometry = isRecord(feature.geometry) ? feature.geometry : {} const coordinates = Array.isArray(geometry.coordinates) ? geometry.coordinates : [] const [longitude, latitude, depth] = coordinates const magnitude = Number(properties.mag) - if (!Number.isFinite(magnitude) || magnitude < 4.5) continue - if (typeof longitude !== 'number' || typeof latitude !== 'number') continue + if (!Number.isFinite(magnitude) || magnitude < 4.5) {continue} + if (typeof longitude !== 'number' || typeof latitude !== 'number') {continue} events.push({ magnitude: Math.round(magnitude * 10) / 10, longitude: Math.max(-180, Math.min(180, longitude)), @@ -80,7 +81,7 @@ async function fetchFeedFromUrl(url: string): Promise headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) GuEarth/0.1' }, signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) }) - if (!response.ok) throw new Error(`USGS request failed: ${response.status}`) + if (!response.ok) {throw new Error(`USGS request failed: ${response.status}`)} return parseFeed(await response.json()) } @@ -102,46 +103,46 @@ export async function loadEarthquakeFeed(): Promise { const events = await fetchFeed() feed = { fetchedAt: Date.now(), events } } catch { - if (cached) return { ...cached, stale: true } + if (cached) {return { ...cached, stale: true }} throw new Error('USGS 地震数据获取失败,请检查网络后重新启动') } - await writeJson(earthquakesPath, feed).catch(() => undefined) + await writeJson(earthquakesPath, feed).catch(() => {}) return feed } function toLatLngPair(value: unknown): [number, number] | null { - if (!Array.isArray(value) || value.length < 2) return null + if (!Array.isArray(value) || value.length < 2) {return null} const [longitude, latitude] = value - if (typeof longitude !== 'number' || typeof latitude !== 'number') return null + if (typeof longitude !== 'number' || typeof latitude !== 'number') {return null} return [longitude, latitude] } function normalizePolygons(geometry: unknown): number[][][][] { - if (!isRecord(geometry) || !Array.isArray(geometry.coordinates)) return [] + if (!isRecord(geometry) || !Array.isArray(geometry.coordinates)) {return []} const sets = geometry.type === 'Polygon' ? [geometry.coordinates] : geometry.type === 'MultiPolygon' ? geometry.coordinates : [] const polygons: number[][][][] = [] for (const set of sets) { - if (!Array.isArray(set)) continue + if (!Array.isArray(set)) {continue} const rings = set .filter((ring): ring is number[][] => Array.isArray(ring) && ring.length >= 3) .map((ring) => ring.map((point) => gcj02ToWgs84(point[0], point[1]))) - if (rings.length > 0) polygons.push(rings) + if (rings.length > 0) {polygons.push(rings)} } return polygons } function normalizeProvinceFeatures(json: unknown): ProvinceFeature[] { - if (!isRecord(json) || !Array.isArray(json.features)) return [] + if (!isRecord(json) || !Array.isArray(json.features)) {return []} const features: ProvinceFeature[] = [] for (const feature of json.features) { - if (!isRecord(feature) || !isRecord(feature.properties)) continue + if (!isRecord(feature) || !isRecord(feature.properties)) {continue} const name = feature.properties.name const adcode = feature.properties.adcode const center = toLatLngPair(feature.properties.center) - if (typeof name !== 'string' || !name || typeof adcode !== 'number' || !center) continue + if (typeof name !== 'string' || !name || typeof adcode !== 'number' || !center) {continue} const centroid = toLatLngPair(feature.properties.centroid) ?? center const polygons = normalizePolygons(feature.geometry) - if (polygons.length === 0) continue + if (polygons.length === 0) {continue} features.push({ name, adcode, @@ -154,11 +155,11 @@ function normalizeProvinceFeatures(json: unknown): ProvinceFeature[] { } export function loadProvinceGeometry(): ProvinceGeoDocument { - if (provinceGeometry) return provinceGeometry + if (provinceGeometry) {return provinceGeometry} try { const parsed: unknown = JSON.parse(readFileSync(provincesAssetPath, 'utf8')) const features = normalizeProvinceFeatures(parsed) - if (features.length === 0) throw new Error('省级行政区划数据为空') + if (features.length === 0) {throw new Error('省级行政区划数据为空')} provinceGeometry = { features } } catch (error) { throw error instanceof Error ? error : new Error(String(error)) diff --git a/src/main/ffmpeg.ts b/src/main/ffmpeg.ts index 1589da8f..9a8a94eb 100644 --- a/src/main/ffmpeg.ts +++ b/src/main/ffmpeg.ts @@ -13,13 +13,13 @@ function binaryPathFor(appPath: string, resourcesPath: string, packaged: boolean } function platformLabel(platform: string): string { - if (platform === 'win32') return 'Windows x64' - if (platform === 'linux') return 'Linux x64/arm64' + if (platform === 'win32') {return 'Windows x64'} + if (platform === 'linux') {return 'Linux x64/arm64'} return platform } export function assertOffscreenRecordingSupported(platform: string): void { - if (platform === 'win32' || platform === 'linux') return + if (platform === 'win32' || platform === 'linux') {return} throw new Error(`离屏视频录制目前提供 Windows x64 与 Linux x64/arm64 构建,当前平台 ${platform} 暂不支持录制`) } @@ -38,6 +38,6 @@ function missingEncoderMessage(binary: string, packaged: boolean, platform: stri export function resolveFfmpegBinary(appPath: string, resourcesPath: string, packaged: boolean, platform: string = process.platform): string { assertOffscreenRecordingSupported(platform) const binary = binaryPathFor(appPath, resourcesPath, packaged, platform) - if (!existsSync(binary)) throw new Error(missingEncoderMessage(binary, packaged, platform)) + if (!existsSync(binary)) {throw new Error(missingEncoderMessage(binary, packaged, platform))} return binary } diff --git a/src/main/geo.ts b/src/main/geo.ts index 7839c129..06c63415 100644 --- a/src/main/geo.ts +++ b/src/main/geo.ts @@ -1,5 +1,5 @@ const coordinatePi = Math.PI -const coordinateAxis = 6378245 +const coordinateAxis = 6_378_245 const coordinateEccentricity = 0.006693421622965943 function outOfChina(longitude: number, latitude: number): boolean { @@ -23,7 +23,7 @@ function transformLongitude(x: number, y: number): number { } export function wgs84ToGcj02(longitude: number, latitude: number): [number, number] { - if (outOfChina(longitude, latitude)) return [longitude, latitude] + if (outOfChina(longitude, latitude)) {return [longitude, latitude]} const deltaLatitude = transformLatitude(longitude - 105, latitude - 35) const deltaLongitude = transformLongitude(longitude - 105, latitude - 35) const latitudeRadians = latitude / 180 * coordinatePi @@ -35,12 +35,13 @@ export function wgs84ToGcj02(longitude: number, latitude: number): [number, numb } export function gcj02ToWgs84(longitude: number, latitude: number): [number, number] { - if (outOfChina(longitude, latitude)) return [longitude, latitude] + if (outOfChina(longitude, latitude)) {return [longitude, latitude]} const [guessedLongitude, guessedLatitude] = wgs84ToGcj02(longitude, latitude) return [longitude * 2 - guessedLongitude, latitude * 2 - guessedLatitude] } function gcj02ToBd09(longitude: number, latitude: number): [number, number] { + // oxlint-disable-next-line unicorn/prefer-modern-math-apis -- keeps the published BD-09 formula exactly const z = Math.sqrt(longitude * longitude + latitude * latitude) + 0.00002 * Math.sin(latitude * coordinatePi) const theta = Math.atan2(latitude, longitude) + 0.000003 * Math.cos(longitude * coordinatePi) return [z * Math.cos(theta) + 0.0065, z * Math.sin(theta) + 0.006] @@ -61,12 +62,12 @@ export function tileCenter(level: number, x: number, y: number): [number, number const baiduMercatorBands = [75, 60, 45, 30, 15, 0] const baiduMercatorFactors = [ - [-0.0015702102444, 111320.7020616939, 1704480524535203, -10338987376042340, 26112667856603880, -35149669176653700, 26595700718403920, -10725012454188240, 1800819912950474, 82.5], - [0.0008277824516172526, 111320.7020463578, 647795574.6671607, -4082003173.6413164, 10774905661.35142, -15171875531.51559, 12052655338.62167, -5124939663.577472, 913311935.9512032, 67.5], - [0.00337398766765, 111320.7020202162, 4481351.045890365, -23393751.19931662, 79682215.47186455, -115964993.2797253, 97236711.15602145, -43661946.33352821, 8477230.501135234, 52.5], - [0.00220636496208, 111320.7020209128, 51751.86112841131, 3796837.749470245, 992013.7397791013, -1221952.21711287, 1340652.697009075, -620943.6990984312, 144416.9293806241, 37.5], - [-0.0003441963504368392, 111320.7020576856, 278.2353980772752, 2485758.690035394, 6070.750963243378, 54821.18345352118, 9540.606633304236, -2710.55326746643, 1405.483844121726, 22.5], - [-0.0003218135878613132, 111320.7020701615, 0.00369383431289, 823725.6402795718, 0.46104986909093, 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238584252424, 7.45] + [-0.0015702102444, 111_320.7020616939, 1_704_480_524_535_203, -10_338_987_376_042_340, 26_112_667_856_603_880, -35_149_669_176_653_700, 26_595_700_718_403_920, -10_725_012_454_188_240, 1_800_819_912_950_474, 82.5], + [0.0008277824516172526, 111_320.7020463578, 647_795_574.6671607, -4_082_003_173.6413164, 10_774_905_661.35142, -15_171_875_531.51559, 12_052_655_338.62167, -5_124_939_663.577472, 913_311_935.9512032, 67.5], + [0.00337398766765, 111_320.7020202162, 4_481_351.045890365, -23_393_751.19931662, 79_682_215.47186455, -115_964_993.2797253, 97_236_711.15602145, -43_661_946.33352821, 8_477_230.501135234, 52.5], + [0.00220636496208, 111_320.7020209128, 51_751.86112841131, 3_796_837.749470245, 992_013.7397791013, -1_221_952.21711287, 1_340_652.697009075, -620_943.6990984312, 144_416.9293806241, 37.5], + [-0.0003441963504368392, 111_320.7020576856, 278.2353980772752, 2_485_758.690035394, 6070.750963243378, 54_821.18345352118, 9540.606633304236, -2710.55326746643, 1405.483844121726, 22.5], + [-0.0003218135878613132, 111_320.7020701615, 0.00369383431289, 823_725.6402795718, 0.46104986909093, 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238584252424, 7.45] ] export function baiduLngLatToPoint(longitude: number, latitude: number): [number, number] { diff --git a/src/main/geo/gcj02.ts b/src/main/geo/gcj02.ts index 75a56e76..a2e52a1c 100644 --- a/src/main/geo/gcj02.ts +++ b/src/main/geo/gcj02.ts @@ -1,5 +1,5 @@ -const GCJ_ELLIPSE_A = 6378245 -const GCJ_ELLIPSE_EE = 0.00669342162296594323 +const GCJ_ELLIPSE_A = 6_378_245 +const GCJ_ELLIPSE_EE = 0.006693421622965943 const GCJ_MAGIC_LAT = 35 const GCJ_MAGIC_LON = 105 @@ -24,7 +24,7 @@ export function outsideChina(lon: number, lat: number): boolean { } export function wgs84ToGcj02(lon: number, lat: number): [number, number] { - if (outsideChina(lon, lat)) return [lon, lat] + if (outsideChina(lon, lat)) {return [lon, lat]} const dLat = offsetLat(lon - GCJ_MAGIC_LON, lat - GCJ_MAGIC_LAT) const dLon = offsetLon(lon - GCJ_MAGIC_LON, lat - GCJ_MAGIC_LAT) const radLat = (lat / 180) * Math.PI diff --git a/src/main/index.ts b/src/main/index.ts index 4a3443b3..aebd2f86 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -23,13 +23,52 @@ import { } from '../common/tileMirror' import type { MirrorEndpointId, MirrorEndpointPreference, MirrorEndpointProbeResult, MirrorTileKind, TileMirrorMode, TileSource } from '../common/tileMirror' import { viirsCacheStyleId, viirsGranuleDate } from '../common/viirs' -import { describeTileFetchError, fetchTilePayloadWithRetry, isRetryableTileStatus, sanitizeTileUrlForLog, serveTileResponse, TILE_FETCH_TIMEOUT_MS, type FetchedTilePayload } from '../common/tileProtocol' +import { describeTileFetchError, fetchTilePayloadWithRetry, isRetryableTileStatus, sanitizeTileUrlForLog, serveTileResponse, TILE_FETCH_TIMEOUT_MS } from '../common/tileProtocol'; +import type { FetchedTilePayload } from '../common/tileProtocol'; import { THEMATIC_LAYER_ID_SET } from '../common/thematicLayers' import { TERRAIN_PROVIDER_ID_SET } from '../common/terrainProviders' -import { isTouchInteractionMode, normalizeTouchInteractionMode, type TouchInteractionMode } from '../common/touchInteraction' -import { isThemeMode, normalizeThemeMode, type ThemeMode } from '../common/themeMode' -import { ENSO_PHASE_SET, HSR_END_YEAR, HSR_START_YEAR, SEA_LEVEL_SCENARIOS, type EnsoPhase } from '../common/thematicState' +import { isTouchInteractionMode, normalizeTouchInteractionMode } from '../common/touchInteraction'; +import type { TouchInteractionMode } from '../common/touchInteraction'; +import { isThemeMode, normalizeThemeMode } from '../common/themeMode'; +import type { ThemeMode } from '../common/themeMode'; +import { ENSO_PHASE_SET, HSR_END_YEAR, HSR_START_YEAR, SEA_LEVEL_SCENARIOS } from '../common/thematicState'; +import type { EnsoPhase } from '../common/thematicState'; import { DEFAULT_PRIVACY_SETTINGS, resolvePrivacySettings } from '../common/privacy' +import { execFileSync, spawn } from 'node:child_process' +import { readFileSync, rmSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { flushJsonWrites, readJson, serialQueue, writeAtomic, writeJson } from './jsonStore' +import { listTileFiles, pruneTileFiles } from './tileCacheFiles' +import { storageChildPath } from './storagePath' +import { access, constants, mkdtemp, mkdir, readFile, readdir, rename as renameFile, stat, rm, writeFile } from 'node:fs/promises' +import { createHash, randomUUID } from 'node:crypto' +import icon from '../../resources/icon.png?asset' +import type { AnnotationDocument, AnnotationEntry, GeoPosition, GuEarthSettings, GuEarthSettingsPatch, NetworkProxyTestResult, OffscreenRecordingProbeResult, OffscreenRecordingScript, PlaceSearchProvider, ProviderCredentialStatus, RecordingSaveResult, SceneCamera, SceneDocument, SceneSnapshot, SceneSimTime, StoredShape, TeachingScene, TileCacheEntry, TileCacheStats, TileKey, TileMirrorStatus, WindowControlsState } from '../preload' +import { assertOffscreenRecordingSupported, offscreenVideoEncoderArgs, resolveFfmpegBinary } from './ffmpeg' +import { resolveOffscreenEntry } from './offscreenPaths' +import { offscreenCaptureSize, offscreenConcatPlaylist, offscreenFrameDurations, offscreenFrameRate, offscreenScriptDurationMs } from './offscreenTiming' +import { deliverMacOffscreenVideo, deliverMacOffscreenVideoComplete, encodeMacOffscreenRecording, noteMacOffscreenFrameAck } from './offscreenMac'; +import type { OffscreenMacSessionHost } from './offscreenMac'; +import { assertSafeId, clearProviderKey, hasProviderKey, initKeyVault, readProviderKey, writeProviderKey } from './keyVault' +import { baiduLngLatToTile, tileCenter, wgs84ToBd09 } from './geo' +import { AiSettingsStore } from './ai/settingsStore' +import { AiChatHistoryStore } from './ai/chatHistoryStore' +import { AiMemoryStore } from './ai/memoryStore' +import { EoqHawdbClient } from './ai/hawdb/client' +import { findHawdbBinary } from './ai/hawdb/paths' +import { getAllKnowledgeEntries, knowledgeDatasetHash } from './ai/knowledge' +import { registerAiIpcHandlers } from './ai/agent' +import { poiStatistics, searchPlaces } from './ai/amap' +import { searchBaiduPlaces } from './ai/baidu' +import { beginPlacesRequest } from './ai/searchThrottle' +import { setModelsDevMirrorEndpoint } from './ai/modelImporter' +import { initDatasets, loadProvinceGeometry, setDatasetMirrorEndpoint } from './datasets' +import { ensureTyphoons, getOnlineData, getStartupEarthquakes, invalidateTyphoons, refreshEarthquakes, startOnlineData } from './onlineData' +import { listLaboratoryProviders, removeLaboratoryProvider, saveLaboratoryProvider } from './laboratory' +import { initUpdater } from './updater' +import { initAccount } from './account' +import { setAiPosthogEnabled, shutdownPosthog } from './ai/posthog' +import { capturePosthogLog, setPosthogLogsEnabled, shutdownPosthogLogs } from './posthogLogs' attachConsoleLogTee('main') @@ -43,7 +82,7 @@ function readInitialErrorReportingEnabled(): boolean { return resolvePrivacySettings(parsed as Record).errorReportingEnabled } catch (error) { const code = (error as NodeJS.ErrnoException | null)?.code - if (code === 'ENOENT') return DEFAULT_PRIVACY_SETTINGS.errorReportingEnabled + if (code === 'ENOENT') {return DEFAULT_PRIVACY_SETTINGS.errorReportingEnabled} return false } } @@ -56,45 +95,11 @@ Sentry.init({ enabled: errorReportingEnabled, sendClientReports: false, beforeSend(event) { - if (!errorReportingEnabled) return null + if (!errorReportingEnabled) {return null} event.extra = { ...event.extra, mainProcessLogs: logger.dump(80) } return event } }) -import { execFileSync, spawn } from 'child_process' -import { readFileSync, rmSync } from 'fs' -import { dirname, join } from 'path' -import { flushJsonWrites, readJson, serialQueue, writeAtomic, writeJson } from './jsonStore' -import { listTileFiles, pruneTileFiles } from './tileCacheFiles' -import { storageChildPath } from './storagePath' -import { access, constants, mkdtemp, mkdir, readFile, readdir, rename as renameFile, stat, rm, writeFile } from 'fs/promises' -import { createHash, randomUUID } from 'crypto' -import icon from '../../resources/icon.png?asset' -import type { AnnotationDocument, AnnotationEntry, GeoPosition, GuEarthSettings, GuEarthSettingsPatch, NetworkProxyTestResult, OffscreenRecordingProbeResult, OffscreenRecordingScript, PlaceSearchProvider, ProviderCredentialStatus, RecordingSaveResult, SceneCamera, SceneDocument, SceneSnapshot, SceneSimTime, StoredShape, TeachingScene, TileCacheEntry, TileCacheStats, TileKey, TileMirrorStatus, WindowControlsState } from '../preload' -import { assertOffscreenRecordingSupported, offscreenVideoEncoderArgs, resolveFfmpegBinary } from './ffmpeg' -import { resolveOffscreenEntry } from './offscreenPaths' -import { offscreenCaptureSize, offscreenConcatPlaylist, offscreenFrameDurations, offscreenFrameRate, offscreenScriptDurationMs } from './offscreenTiming' -import { deliverMacOffscreenVideo, deliverMacOffscreenVideoComplete, encodeMacOffscreenRecording, noteMacOffscreenFrameAck, type OffscreenMacSessionHost } from './offscreenMac' -import { assertEncryptionAvailable, assertSafeId, clearProviderKey, hasProviderKey, initKeyVault, readProviderKey, writeProviderKey } from './keyVault' -import { baiduLngLatToTile, tileCenter, wgs84ToBd09 } from './geo' -import { AiSettingsStore } from './ai/settingsStore' -import { AiChatHistoryStore } from './ai/chatHistoryStore' -import { AiMemoryStore } from './ai/memoryStore' -import { EoqHawdbClient } from './ai/hawdb/client' -import { findHawdbBinary } from './ai/hawdb/paths' -import { getAllKnowledgeEntries, knowledgeDatasetHash } from './ai/knowledge' -import { registerAiIpcHandlers } from './ai/agent' -import { poiStatistics, searchPlaces } from './ai/amap' -import { searchBaiduPlaces } from './ai/baidu' -import { beginPlacesRequest } from './ai/searchThrottle' -import { setModelsDevMirrorEndpoint } from './ai/modelImporter' -import { initDatasets, loadProvinceGeometry, setDatasetMirrorEndpoint } from './datasets' -import { ensureTyphoons, getOnlineData, getStartupEarthquakes, invalidateTyphoons, refreshEarthquakes, startOnlineData } from './onlineData' -import { listLaboratoryProviders, removeLaboratoryProvider, saveLaboratoryProvider } from './laboratory' -import { initUpdater } from './updater' -import { initAccount } from './account' -import { setAiPosthogEnabled, shutdownPosthog } from './ai/posthog' -import { capturePosthogLog, setPosthogLogsEnabled, shutdownPosthogLogs } from './posthogLogs' interface PersistedSettings { selectedImageryProviderId: string @@ -189,12 +194,12 @@ const safeId = assertSafeId async function readSettings(): Promise { try { const parsed: unknown = await readJson(settingsPath) - if (!isRecord(parsed)) return { ...defaultSettings, providerCredentials: {} } + if (!isRecord(parsed)) {return { ...defaultSettings, providerCredentials: {} }} const credentials = isRecord(parsed.providerCredentials) ? parsed.providerCredentials : {} const providerCredentials: Record = {} for (const [providerId, value] of Object.entries(credentials)) { - if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId)) continue - if (!isRecord(value)) continue + if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId)) {continue} + if (!isRecord(value)) {continue} providerCredentials[providerId] = { configured: value.configured === true, updatedAt: typeof value.updatedAt === 'number' ? value.updatedAt : null @@ -203,7 +208,7 @@ async function readSettings(): Promise { const providerStyles = isRecord(parsed.providerStyles) ? parsed.providerStyles : {} const normalizedStyles: Record = { ...defaultSettings.providerStyles } for (const [providerId, styleId] of Object.entries(providerStyles)) { - if (/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId) && typeof styleId === 'string' && /^[a-z0-9][a-z0-9_-]{0,63}$/i.test(styleId)) normalizedStyles[providerId] = styleId + if (/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId) && typeof styleId === 'string' && /^[a-z0-9][a-z0-9_-]{0,63}$/i.test(styleId)) {normalizedStyles[providerId] = styleId} } const legacyTerrain = parsed.terrainExaggeration === undefined const storedTerrainProviderId = typeof parsed.selectedTerrainProviderId === 'string' ? parsed.selectedTerrainProviderId : defaultSettings.selectedTerrainProviderId @@ -247,8 +252,8 @@ function saveSettings(update: (current: PersistedSettings) => PersistedSettings) } function proxyConfig(proxy: string): Parameters[0] { - if (proxy === '') return { mode: 'system' } - if (proxy === 'direct') return { mode: 'direct' } + if (proxy === '') {return { mode: 'system' }} + if (proxy === 'direct') {return { mode: 'direct' }} return { mode: 'fixed_servers', proxyRules: proxy, proxyBypassRules: '' } } @@ -263,16 +268,16 @@ async function applyNetworkProxy(): Promise { function credentialStatus(providerId: string): ProviderCredentialStatus { const configured = hasProviderKey(providerId) const saved = settings.providerCredentials[providerId] - if (!configured) return { configured: false, updatedAt: saved?.updatedAt ?? null } + if (!configured) {return { configured: false, updatedAt: saved?.updatedAt ?? null }} return { configured: true, updatedAt: saved?.updatedAt ?? null } } async function usableRecordingDirectory(): Promise { const directory = settings.recordingDirectory - if (!directory) return null + if (!directory) {return null} try { const info = await stat(directory) - if (!info.isDirectory()) return null + if (!info.isDirectory()) {return null} await access(directory, constants.W_OK) return directory } catch { @@ -297,12 +302,12 @@ function applyPrivacySettings(current: PersistedSettings): void { function settingsSnapshot(): GuEarthSettings { const providerCredentials: Record = {} const providerIds = new Set([...Object.keys(settings.providerCredentials), 'amap', 'baidu']) - for (const providerId of providerIds) providerCredentials[providerId] = credentialStatus(providerId) + for (const providerId of providerIds) {providerCredentials[providerId] = credentialStatus(providerId)} return { ...settings, providerCredentials } } function pathPart(value: number): string { - if (!Number.isInteger(value)) throw new Error('无效的瓦片坐标') + if (!Number.isInteger(value)) {throw new TypeError('无效的瓦片坐标')} return value < 0 ? `n${Math.abs(value)}` : String(value) } @@ -328,9 +333,9 @@ async function readTile(key: TileKey, allowExpired = false): Promise { - if (!settings.tileCacheEnabled) return null + if (!settings.tileCacheEnabled) {return null} const cached = await readTile(key, allowExpired) - if (!cached) return null + if (!cached) {return null} const expired = cached.expiresAt !== null && cached.expiresAt <= Date.now() return new Response(cached.data, { headers: { 'content-type': cached.contentType, 'x-guearth-cache': expired ? 'stale' : 'hit' } }) } @@ -349,9 +354,9 @@ let tilePruneAt = 0 let tilePrunePromise: Promise | undefined async function enforceTileCacheLimit(): Promise { - if (tilePrunePromise) return tilePrunePromise + if (tilePrunePromise) {return tilePrunePromise} const now = Date.now() - if (now - tilePruneAt < TILE_CACHE_PRUNE_INTERVAL_MS) return + if (now - tilePruneAt < TILE_CACHE_PRUNE_INTERVAL_MS) {return} tilePruneAt = now tilePrunePromise = (async () => { await pruneTileFiles(tileCachePath, TILE_CACHE_MAX_BYTES) @@ -365,7 +370,7 @@ const enqueueTileMutation = serialQueue() let quitting = false function writeTile(entry: TileCacheEntry): Promise { - if (quitting) return Promise.resolve() + if (quitting) {return Promise.resolve()} return enqueueTileMutation(async () => { const key: TileKey = { providerId: entry.providerId, styleId: entry.styleId, level: entry.level, x: entry.x, y: entry.y } const basePath = tileBasePath(key) @@ -373,7 +378,7 @@ function writeTile(entry: TileCacheEntry): Promise { await mkdir(dirname(basePath), { recursive: true }) await writeAtomic(`${basePath}.bin`, Buffer.from(entry.data)) await writeJson(`${basePath}.json`, { contentType: entry.contentType, expiresAt: entry.expiresAt }) - void enqueueTileMutation(enforceTileCacheLimit).catch(() => undefined) + void enqueueTileMutation(enforceTileCacheLimit).catch(() => {}) } catch { void 0 } @@ -383,7 +388,7 @@ function writeTile(entry: TileCacheEntry): Promise { async function cacheStats(): Promise { const files = await listTileFiles(tileCachePath) return files.reduce((result, file) => { - if (file.path.endsWith('.bin')) result.files += 1 + if (file.path.endsWith('.bin')) {result.files += 1} result.bytes += file.size return result }, { files: 0, bytes: 0 }) @@ -395,28 +400,28 @@ function computeBaiduSn(path: string, queryString: string, sk: string): string { } function tileRemoteUrl(providerId: string, styleId: string, level: number, x: number, y: number, granuleDate?: string): string | undefined { - if (providerId === 'osm') return `https://tile.openstreetmap.org/${level}/${x}/${y}.png` + if (providerId === 'osm') {return `https://tile.openstreetmap.org/${level}/${x}/${y}.png`} if (providerId === 'viirs-night') { - if (level > 8) return undefined + if (level > 8) {return undefined} return `https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_SNPP_DayNightBand_AtSensor_M15/default/${granuleDate ?? viirsGranuleDate()}/GoogleMapsCompatible_Level8/${level}/${y}/${x}.jpeg` } - if (providerId === 'esri-imagery') return `https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${level}/${y}/${x}` - if (providerId === 'opentopomap') return `https://${['a', 'b', 'c'][((x % 3) + 3) % 3]}.tile.opentopomap.org/${level}/${x}/${y}.png` + if (providerId === 'esri-imagery') {return `https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${level}/${y}/${x}`} + if (providerId === 'opentopomap') {return `https://${['a', 'b', 'c'][((x % 3) + 3) % 3]}.tile.opentopomap.org/${level}/${x}/${y}.png`} if (providerId === 'baidu') { const key = readProviderKey(providerId) - if (!key) return undefined + if (!key) {return undefined} const subdomain = String(((x % 4) + 4) % 4) const [translatedX, translatedY] = baiduLngLatToTile(level, ...wgs84ToBd09(...tileCenter(level, x, y))) const ak = key const sk = readProviderKey(`${providerId}-sk`) if (styleId === 'satellite') { const baseQueryString = `qt=satepc&x=${translatedX}&y=${translatedY}&z=${level}&udt=20230101&ak=${encodeURIComponent(ak)}` - if (!sk) return `https://maponline${subdomain}.bdimg.com/tile/?${baseQueryString}` + if (!sk) {return `https://maponline${subdomain}.bdimg.com/tile/?${baseQueryString}`} const sn = computeBaiduSn('/tile/', baseQueryString, sk) return `https://maponline${subdomain}.bdimg.com/tile/?${baseQueryString}&sn=${sn}` } const baseQueryString = `x=${translatedX}&y=${translatedY}&z=${level}&ak=${encodeURIComponent(ak)}` - if (!sk) return `https://online${subdomain}.map.bdimg.com/onlinelabel/?qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101` + if (!sk) {return `https://online${subdomain}.map.bdimg.com/onlinelabel/?qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101`} const pathWithQuery = `/onlinelabel/?qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101` const sn = computeBaiduSn('/onlinelabel/', `qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101`, sk) return `https://online${subdomain}.map.bdimg.com${pathWithQuery}&sn=${sn}` @@ -428,13 +433,13 @@ const TILE_FETCH_HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Accept': 'image/webp,image/apng,image/*,*/*;q=0.8' } -const TILE_ERROR_LOG_INTERVAL_MS = 5_000 +const TILE_ERROR_LOG_INTERVAL_MS = 5000 const tileErrorLogTimestamps = new Map() function shouldLogTileFailure(key: string): boolean { const now = Date.now() const last = tileErrorLogTimestamps.get(key) ?? 0 - if (now - last < TILE_ERROR_LOG_INTERVAL_MS) return false + if (now - last < TILE_ERROR_LOG_INTERVAL_MS) {return false} tileErrorLogTimestamps.set(key, now) return true } @@ -454,7 +459,7 @@ const mirrorEndpointManager = new MirrorEndpointManager() const MIRROR_PROBE_TIMEOUT_MS = 4000 const MIRROR_PROBE_INTERVAL_MS = 10 * 60 * 1000 -const STARTUP_MIRROR_PROBE_BUDGET_MS = 1_500 +const STARTUP_MIRROR_PROBE_BUDGET_MS = 1500 let mirrorEndpointProbing = false let mirrorEndpointProbeSeq = 0 @@ -472,13 +477,13 @@ function scheduleMirrorFallbackExpirySync(): void { mirrorFallbackExpiryTimer = undefined } const nextExpiryAt = tileMirrorRouter.nextMirrorFallbackExpiryAt() - if (nextExpiryAt === null) return + if (nextExpiryAt === null) {return} const delayMs = Math.max(1, nextExpiryAt - Date.now() + 20) mirrorFallbackExpiryTimer = setTimeout(() => { mirrorFallbackExpiryTimer = undefined const activeFallbacks = new Set(tileMirrorRouter.fallenBackProviders(mirrorEligibleProviderIds())) for (const providerId of [...mirrorFallenBackProviders]) { - if (!activeFallbacks.has(providerId)) mirrorFallenBackProviders.delete(providerId) + if (!activeFallbacks.has(providerId)) {mirrorFallenBackProviders.delete(providerId)} } broadcastMirrorStatus('') scheduleMirrorFallbackExpirySync() @@ -543,7 +548,7 @@ async function probeSingleMirrorEndpoint(endpoint: MirrorEndpointId): Promise undefined) + void response.body?.cancel().catch(() => {}) return { endpoint, ok: false, latencyMs: null, error: `HTTP ${response.status}`, checkedAt: startedAt } } const buffer = await response.arrayBuffer() @@ -560,7 +565,7 @@ async function probeMirrorEndpoints( reason: 'startup' | 'settings' | 'network' | 'manual', onFirstReachable?: () => void ): Promise { - if (reason !== 'manual' && (settings.tileMirrorMode !== 'on' || settings.tileMirrorSource !== 'auto')) return + if (reason !== 'manual' && (settings.tileMirrorMode !== 'on' || settings.tileMirrorSource !== 'auto')) {return} const seq = ++mirrorEndpointProbeSeq mirrorEndpointProbing = true broadcastMirrorStatus('') @@ -568,7 +573,7 @@ async function probeMirrorEndpoints( const roundProbes: MirrorEndpointProbeResult[] = [] const probePromises = mirrorEndpointIds.map((endpoint) => probeSingleMirrorEndpoint(endpoint).then((result) => { - if (seq !== mirrorEndpointProbeSeq) return result + if (seq !== mirrorEndpointProbeSeq) {return result} roundProbes.push(result) const outcome = mirrorEndpointManager.applyProbeResult(result, roundProbes) if (outcome.changed) { @@ -588,7 +593,7 @@ async function probeMirrorEndpoints( }) ) const results = await Promise.all(probePromises) - if (seq !== mirrorEndpointProbeSeq) return + if (seq !== mirrorEndpointProbeSeq) {return} mirrorEndpointProbing = false logger.info( 'tiles', @@ -604,12 +609,12 @@ async function clearProviderTileCache(providerId: string): Promise { } async function clearMirrorProviderTileCaches(): Promise { - for (const providerId of mirrorEligibleProviderIds()) await clearProviderTileCache(providerId) + for (const providerId of mirrorEligibleProviderIds()) {await clearProviderTileCache(providerId)} } function mirrorRouteNotice(previous: readonly string[], next: readonly string[]): string { - if (next.length === 0) return '已恢复直连原地图源' - if (previous.length === 0) return '已自动切换到国内加速地图源' + if (next.length === 0) {return '已恢复直连原地图源'} + if (previous.length === 0) {return '已自动切换到国内加速地图源'} return `已自动优化 ${next.length} 个地图源的网络线路` } @@ -620,8 +625,8 @@ function mirrorFallbackNotice(): string { } function mirrorModeNotice(mode: TileMirrorMode): string { - if (mode === 'off') return '国内地图加速已关闭' - if (mode === 'on') return '国内地图加速已开启' + if (mode === 'off') {return '国内地图加速已关闭'} + if (mode === 'on') {return '国内地图加速已开启'} return '国内地图加速已设为自动' } @@ -633,13 +638,13 @@ function notifyMirrorRouteChange(previous: readonly string[]): void { function originProbeUrl(providerId: string): string | undefined { const styleId = settings.providerStyles[providerId] ?? 'standard' const url = tileRemoteUrl(providerId, styleId, 0, 0, 0) - if (!url) return undefined + if (!url) {return undefined} return `${url}${url.includes('?') ? '&' : '?'}guearth-probe=${Date.now()}` } async function probeOriginProvider(providerId: string): Promise { const url = originProbeUrl(providerId) - if (!url) return null + if (!url) {return null} try { const response = await net.fetch(url, { headers: TILE_FETCH_HEADERS, signal: AbortSignal.timeout(MIRROR_PROBE_TIMEOUT_MS) }) await response.arrayBuffer() @@ -654,7 +659,7 @@ let mirrorProbeQueued = false let mirrorProbeTimer: NodeJS.Timeout | undefined async function refreshMirrorRoutes(reason: 'startup' | 'settings' | 'probe' | 'network'): Promise { - if (settings.tileMirrorMode !== 'auto') return + if (settings.tileMirrorMode !== 'auto') {return} if (mirrorProbePromise) { mirrorProbeQueued = true return mirrorProbePromise @@ -663,17 +668,17 @@ async function refreshMirrorRoutes(reason: 'startup' | 'settings' | 'probe' | 'n const previous = tileMirrorRouter.mirroredProviders(mirrorEligibleProviderIds()) const probes = await Promise.all(mirrorEligibleProviderIds().map(async (providerId) => [providerId, await probeOriginProvider(providerId)] as const)) for (const [providerId, reachable] of probes) { - if (reachable === null) continue + if (reachable === null) {continue} tileMirrorRouter.noteProbeResult(providerId, reachable) } - if (settings.tileMirrorMode !== 'auto') return + if (settings.tileMirrorMode !== 'auto') {return} const next = tileMirrorRouter.mirroredProviders(mirrorEligibleProviderIds()) - if (previous.join(',') === next.join(',')) return + if (previous.join(',') === next.join(',')) {return} logger.info('tiles', `网络环境检测(${reason})完成,镜像瓦片源:${next.join('、') || '未启用'}`) notifyMirrorRouteChange(previous) })().finally(() => { mirrorProbePromise = undefined - if (!mirrorProbeQueued) return + if (!mirrorProbeQueued) {return} mirrorProbeQueued = false void refreshMirrorRoutes(reason) }) @@ -681,12 +686,12 @@ async function refreshMirrorRoutes(reason: 'startup' | 'settings' | 'probe' | 'n } function scheduleMirrorRefresh(reason: 'startup' | 'settings' | 'probe' | 'network'): void { - if (settings.tileMirrorMode !== 'auto') return + if (settings.tileMirrorMode !== 'auto') {return} void refreshMirrorRoutes(reason) } function startMirrorProbeTimer(): void { - if (mirrorProbeTimer) return + if (mirrorProbeTimer) {return} mirrorProbeTimer = setInterval(() => scheduleMirrorRefresh('probe'), MIRROR_PROBE_INTERVAL_MS) mirrorProbeTimer.unref() } @@ -703,15 +708,15 @@ async function mirrorTileResponse( endpoint: MirrorEndpointId ): Promise { const url = mirrorTileUrl(providerId, key.level, key.x, key.y, granuleDate, endpoint) - if (!url) return { failure: 'coverage' } + if (!url) {return { failure: 'coverage' }} try { const payload = await fetchTilePayload(url) if (!payload.ok || !payload.data) { - if (isMirrorCoverageNotFound(payload.status, payload.headers)) return { failure: 'coverage' } + if (isMirrorCoverageNotFound(payload.status, payload.headers)) {return { failure: 'coverage' }} return { failure: 'network', detail: `HTTP ${payload.status} ${describeTileTarget(key, url)}` } } const contentType = payload.headers.get('content-type') ?? (providerId === 'viirs-night' ? 'image/jpeg' : 'image/png') - if (settings.tileCacheEnabled) void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS }) + if (settings.tileCacheEnabled) {void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS })} return { response: new Response(payload.data, { headers: { 'content-type': contentType, 'x-guearth-cache': 'miss', 'x-guearth-mirror': endpoint } }) } } catch (error) { return { failure: 'network', detail: `${describeTileFetchError(error)} ${describeTileTarget(key, url)}` } @@ -749,7 +754,7 @@ async function serveMirrorTile( } return outcome.response } - if (outcome.failure !== 'network') return null + if (outcome.failure !== 'network') {return null} if ( routeGeneration !== mirrorRouteGeneration || modeGeneration !== tileMirrorRouter.currentModeGeneration() @@ -785,7 +790,7 @@ async function serveMirrorTile( return null } if (tileMirrorRouter.commitMirrorFallback(providerId, modeGeneration)) { - if (settings.tileMirrorMode === 'on') mirrorFallenBackProviders.add(providerId) + if (settings.tileMirrorMode === 'on') {mirrorFallenBackProviders.add(providerId)} scheduleMirrorFallbackExpirySync() logger.warn('tiles', `镜像瓦片源(${mirrorEndpointLabel(endpoint)})连续失败,${providerId} 已临时回退到原影像源`, outcome.detail) broadcastMirrorStatus(mirrorFallbackNotice()) @@ -804,28 +809,28 @@ async function serveOriginTile(providerId: string, key: TileKey, remoteUrl: stri const payload = await fetchTilePayload(remoteUrl) if (payload.ok && payload.data) { const contentType = payload.headers.get('content-type') ?? 'image/png' - if (settings.tileCacheEnabled) void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS }) - if (tileMirrorRouter.noteOriginSuccess(providerId)) notifyMirrorRouteChange(previous) + if (settings.tileCacheEnabled) {void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS })} + if (tileMirrorRouter.noteOriginSuccess(providerId)) {notifyMirrorRouteChange(previous)} return new Response(payload.data, { headers: { 'content-type': contentType, 'x-guearth-cache': 'miss' } }) } if (shouldLogTileFailure(`origin:${providerId}`)) { logger.warn('tiles', `原影像瓦片请求失败,${providerId}`, `HTTP ${payload.status} ${describeTileTarget(key, remoteUrl)}`) } if (isRetryableTileStatus(payload.status)) { - if (tileMirrorRouter.noteOriginFailure(providerId)) notifyMirrorRouteChange(previous) + if (tileMirrorRouter.noteOriginFailure(providerId)) {notifyMirrorRouteChange(previous)} const stale = await cachedTileResponse(key, true) - if (stale) return stale - } else { - if (tileMirrorRouter.noteOriginSuccess(providerId)) notifyMirrorRouteChange(previous) + if (stale) {return stale} + } else if (tileMirrorRouter.noteOriginSuccess(providerId)) { + notifyMirrorRouteChange(previous) } return new Response(`Tile request failed: ${payload.status}`, { status: payload.status }) } catch (error) { if (shouldLogTileFailure(`origin:${providerId}`)) { logger.warn('tiles', `原影像瓦片请求异常,${providerId}`, `${describeTileFetchError(error)} ${describeTileTarget(key, remoteUrl)}`) } - if (tileMirrorRouter.noteOriginFailure(providerId)) notifyMirrorRouteChange(previous) + if (tileMirrorRouter.noteOriginFailure(providerId)) {notifyMirrorRouteChange(previous)} const stale = await cachedTileResponse(key, true) - if (stale) return stale + if (stale) {return stale} return new Response('Tile unavailable', { status: 502 }) } } @@ -834,9 +839,9 @@ async function handleTileProtocol(request: Request): Promise { const parsed = new URL(request.url) const providerId = safeId(parsed.hostname) const parts = parsed.pathname.split('/').filter(Boolean) - if (parts.length !== 4) return new Response('Bad tile path', { status: 400 }) + if (parts.length !== 4) {return new Response('Bad tile path', { status: 400 })} const coordinates = parts.slice(1).map(Number) - if (!Number.isInteger(coordinates[0]) || coordinates[0] < 0 || !Number.isInteger(coordinates[1]) || !Number.isInteger(coordinates[2])) return new Response('Bad tile path', { status: 400 }) + if (!Number.isInteger(coordinates[0]) || coordinates[0] < 0 || !Number.isInteger(coordinates[1]) || !Number.isInteger(coordinates[2])) {return new Response('Bad tile path', { status: 400 })} const [level, x, y] = coordinates const granuleDate = viirsGranuleDate() const requestStyleId = providerId === 'viirs-night' ? viirsCacheStyleId(safeId(parts[0]), granuleDate) : safeId(parts[0]) @@ -849,33 +854,33 @@ async function handleTileProtocol(request: Request): Promise { const mirrored = Boolean(kind) && Boolean(mirrorTileUrl(providerId, level, x, y, granuleDate, endpoint)) && mirrorSource(providerId) === 'mirror' const key = mirrored ? mirrorKey : originKey const cached = await cachedTileResponse(key, false) - if (cached) return cached + if (cached) {return cached} const remoteUrl = tileRemoteUrl(providerId, requestStyleId, level, x, y, granuleDate) - if (!remoteUrl) return new Response('Unknown provider', { status: 404 }) + if (!remoteUrl) {return new Response('Unknown provider', { status: 404 })} if (kind && mirrored) { const mirror = await serveMirrorTile(providerId, kind, mirrorKey, granuleDate, modeGeneration, routeGeneration, endpoint) - if (mirror) return mirror + if (mirror) {return mirror} } return serveOriginTile(providerId, originKey, remoteUrl) } function normalizeShape(value: unknown): StoredShape { - if (!isRecord(value)) throw new Error('无效的标注数据') + if (!isRecord(value)) {throw new Error('无效的标注数据')} const id = safeId(value.id) - if (value.kind !== 'point' && value.kind !== 'polyline' && value.kind !== 'polygon' && value.kind !== 'arrow' && value.kind !== 'text') throw new Error('无效的标注类型') - if (!Array.isArray(value.positions)) throw new Error('无效的标注坐标') + if (value.kind !== 'point' && value.kind !== 'polyline' && value.kind !== 'polygon' && value.kind !== 'arrow' && value.kind !== 'text') {throw new Error('无效的标注类型')} + if (!Array.isArray(value.positions)) {throw new TypeError('无效的标注坐标')} const positions: GeoPosition[] = value.positions.map((item) => { - if (!isRecord(item)) throw new Error('无效的标注坐标') + if (!isRecord(item)) {throw new Error('无效的标注坐标')} const { longitude, latitude, height } = item - if (typeof longitude !== 'number' || !Number.isFinite(longitude) || longitude < -180 || longitude > 180) throw new Error('无效的标注坐标') - if (typeof latitude !== 'number' || !Number.isFinite(latitude) || latitude < -90 || latitude > 90) throw new Error('无效的标注坐标') - if (typeof height !== 'number' || !Number.isFinite(height) || height < -11000 || height > 20000) throw new Error('无效的标注坐标') + if (typeof longitude !== 'number' || !Number.isFinite(longitude) || longitude < -180 || longitude > 180) {throw new Error('无效的标注坐标')} + if (typeof latitude !== 'number' || !Number.isFinite(latitude) || latitude < -90 || latitude > 90) {throw new Error('无效的标注坐标')} + if (typeof height !== 'number' || !Number.isFinite(height) || height < -11_000 || height > 20_000) {throw new Error('无效的标注坐标')} return { longitude, latitude, height } }) const minimum = value.kind === 'point' || value.kind === 'text' ? 1 : value.kind === 'polygon' ? 3 : 2 - if (positions.length < minimum || positions.length > 500) throw new Error('无效的标注坐标') + if (positions.length < minimum || positions.length > 500) {throw new Error('无效的标注坐标')} const validColor = (color: unknown, fallback: string): string => typeof color === 'string' && /^#[\da-f]{6}$/i.test(color) ? color.toLowerCase() : fallback - const fontFamily = typeof value.fontFamily === 'string' && value.fontFamily.length <= 128 && /^[\p{L}\p{N} .,'()&_\-]+$/u.test(value.fontFamily) ? value.fontFamily : 'Arial' + const fontFamily = typeof value.fontFamily === 'string' && value.fontFamily.length <= 128 && /^[\p{L}\p{N} .,'()&_-]+$/u.test(value.fontFamily) ? value.fontFamily : 'Arial' const fontSize = typeof value.fontSize === 'number' && Number.isFinite(value.fontSize) ? Math.min(72, Math.max(8, value.fontSize)) : 13 const lineWidth = typeof value.lineWidth === 'number' && Number.isFinite(value.lineWidth) ? Math.min(12, Math.max(1, value.lineWidth)) : 3 return { @@ -894,39 +899,39 @@ function normalizeShape(value: unknown): StoredShape { } function normalizeAnnotations(value: unknown): AnnotationDocument { - if (!isRecord(value) || !Array.isArray(value.shapes) || !Array.isArray(value.entries)) throw new Error('无效的标注目录') + if (!isRecord(value) || !Array.isArray(value.shapes) || !Array.isArray(value.entries)) {throw new Error('无效的标注目录')} const shapes = value.shapes.map(normalizeShape) const shapeIds = new Set(shapes.map((shape) => shape.id)) - if (shapeIds.size !== shapes.length) throw new Error('重复的标注') + if (shapeIds.size !== shapes.length) {throw new Error('重复的标注')} const referenced = new Set() const folderIds = new Set() function normalizeEntries(items: unknown[], depth: number): AnnotationEntry[] { - if (items.length > 10000) throw new Error('标注目录过大') + if (items.length > 10_000) {throw new Error('标注目录过大')} return items.map((item) => { - if (!isRecord(item)) throw new Error('无效的目录项') + if (!isRecord(item)) {throw new Error('无效的目录项')} const id = safeId(item.id) if (item.type === 'shape') { - if (!shapeIds.has(id) || referenced.has(id)) throw new Error('无效的标注引用') + if (!shapeIds.has(id) || referenced.has(id)) {throw new Error('无效的标注引用')} referenced.add(id) return { type: 'shape', id } } - if (item.type !== 'folder' || depth > 5 || !Array.isArray(item.children) || typeof item.name !== 'string') throw new Error('无效的文件夹') - if (folderIds.has(id) || shapeIds.has(id)) throw new Error('重复的文件夹') + if (item.type !== 'folder' || depth > 5 || !Array.isArray(item.children) || typeof item.name !== 'string') {throw new Error('无效的文件夹')} + if (folderIds.has(id) || shapeIds.has(id)) {throw new Error('重复的文件夹')} folderIds.add(id) const name = item.name.trim().slice(0, 80) - if (!name) throw new Error('文件夹名称不能为空') + if (!name) {throw new Error('文件夹名称不能为空')} return { type: 'folder', id, name, children: normalizeEntries(item.children, depth + 1) } }) } const entries = normalizeEntries(value.entries, 1) - if (referenced.size !== shapeIds.size) throw new Error('缺少标注引用') + if (referenced.size !== shapeIds.size) {throw new Error('缺少标注引用')} return { shapes, entries } } async function readAnnotations(): Promise { try { const parsed: unknown = await readJson(annotationsPath) - if (!Array.isArray(parsed)) return normalizeAnnotations(parsed) + if (!Array.isArray(parsed)) {return normalizeAnnotations(parsed)} const shapes = parsed.flatMap((item) => { try { return [normalizeShape(item)] @@ -956,21 +961,21 @@ function normalizeNumber(value: unknown, min: number, max: number, fallback: num } function normalizeSceneCamera(value: unknown): SceneCamera { - if (!isRecord(value)) throw new Error('无效的场景视角') + if (!isRecord(value)) {throw new Error('无效的场景视角')} const longitude = Number(value.longitude) const latitude = Number(value.latitude) const height = Number(value.height) - if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180) throw new Error('无效的场景视角') - if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) throw new Error('无效的场景视角') - if (!Number.isFinite(height) || height <= 0 || height > 20000000) throw new Error('无效的场景视角') + if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180) {throw new Error('无效的场景视角')} + if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) {throw new Error('无效的场景视角')} + if (!Number.isFinite(height) || height <= 0 || height > 20_000_000) {throw new Error('无效的场景视角')} const heading = normalizeNumber(value.heading, -360, 360, 0) const pitch = normalizeNumber(value.pitch, -90, 90, -90) return { longitude, latitude, height, heading, pitch } } function normalizeSceneSimTime(value: unknown): SceneSimTime | null { - if (value === null || value === undefined) return null - if (!isRecord(value) || typeof value.date !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value.date)) throw new Error('无效的模拟时间') + if (value === null || value === undefined) {return null} + if (!isRecord(value) || typeof value.date !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value.date)) {throw new Error('无效的模拟时间')} return { date: value.date, hour: normalizeNumber(value.hour, 0, 24, 12) } } @@ -990,7 +995,7 @@ function normalizeStyleId(value: unknown): string | undefined { } function normalizeSceneSnapshot(value: unknown): SceneSnapshot { - if (!isRecord(value)) throw new Error('无效的场景快照') + if (!isRecord(value)) {throw new Error('无效的场景快照')} const overlays = Array.isArray(value.overlays) ? [...new Set(value.overlays.filter((item): item is string => typeof item === 'string' && THEMATIC_LAYER_ID_SET.has(item)))] : [] @@ -1010,26 +1015,26 @@ function normalizeSceneSnapshot(value: unknown): SceneSnapshot { } function normalizeTeachingScene(value: unknown): TeachingScene { - if (!isRecord(value)) throw new Error('无效的教学场景') + if (!isRecord(value)) {throw new Error('无效的教学场景')} const id = safeId(value.id) const name = typeof value.name === 'string' ? value.name.trim().slice(0, 80) : '' - if (!name) throw new Error('场景名称不能为空') + if (!name) {throw new Error('场景名称不能为空')} return { id, name, narration: typeof value.narration === 'string' ? value.narration.slice(0, 500) : '', - dwellMs: Math.round(normalizeNumber(value.dwellMs, 1000, 60000, 6000)), - flyDurationMs: Math.round(normalizeNumber(value.flyDurationMs, 500, 15000, 3500)), + dwellMs: Math.round(normalizeNumber(value.dwellMs, 1000, 60_000, 6000)), + flyDurationMs: Math.round(normalizeNumber(value.flyDurationMs, 500, 15_000, 3500)), snapshot: normalizeSceneSnapshot(value.snapshot), createdAt: typeof value.createdAt === 'number' && Number.isFinite(value.createdAt) ? value.createdAt : Date.now() } } function normalizeSceneDocument(value: unknown): SceneDocument { - if (!isRecord(value) || !Array.isArray(value.scenes)) throw new Error('无效的场景目录') - if (value.scenes.length > SCENE_MAX) throw new Error('场景目录过大') + if (!isRecord(value) || !Array.isArray(value.scenes)) {throw new Error('无效的场景目录')} + if (value.scenes.length > SCENE_MAX) {throw new Error('场景目录过大')} const scenes = value.scenes.map(normalizeTeachingScene) - if (new Set(scenes.map((scene) => scene.id)).size !== scenes.length) throw new Error('重复的场景') + if (new Set(scenes.map((scene) => scene.id)).size !== scenes.length) {throw new Error('重复的场景')} return { scenes } } @@ -1055,9 +1060,9 @@ function ffmpegPath(): string { const macRecordingHost: OffscreenMacSessionHost = { setCancelHook: (hook) => { cancelOffscreenRecording = hook }, - clearCancelHook: (hook) => { if (cancelOffscreenRecording === hook) cancelOffscreenRecording = null }, + clearCancelHook: (hook) => { if (cancelOffscreenRecording === hook) {cancelOffscreenRecording = null} }, setTeardownHook: (hook) => { teardownOffscreenRecording = hook }, - clearTeardownHook: (hook) => { if (teardownOffscreenRecording === hook) teardownOffscreenRecording = null }, + clearTeardownHook: (hook) => { if (teardownOffscreenRecording === hook) {teardownOffscreenRecording = null} }, adoptWindow: (window) => { offscreenRecordingWindow = window }, dropWindow: stopOffscreenRecordingWindow, notePaintFrame: () => { offscreenPaintFrames += 1 }, @@ -1098,11 +1103,11 @@ function registerIpcHandlers(): void { }) ipcMain.handle('window:minimize', (event): void => { const win = BrowserWindow.fromWebContents(event.sender) ?? mainWindow - if (win && !win.isDestroyed()) win.minimize() + if (win && !win.isDestroyed()) {win.minimize()} }) ipcMain.handle('window:toggle-maximize', (event): void => { const win = BrowserWindow.fromWebContents(event.sender) ?? mainWindow - if (!win || win.isDestroyed()) return + if (!win || win.isDestroyed()) {return} if (win.isFullScreen()) { win.setFullScreen(false) } else if (win.isMaximized()) { @@ -1113,26 +1118,27 @@ function registerIpcHandlers(): void { }) ipcMain.handle('window:close', (event): void => { const win = BrowserWindow.fromWebContents(event.sender) ?? mainWindow - if (win && !win.isDestroyed()) win.close() + if (win && !win.isDestroyed()) {win.close()} }) ipcMain.handle('system:fonts', (): string[] => { const families = new Set(process.platform === 'linux' ? ['Arial', 'Noto Sans', 'Noto Sans CJK SC', 'Noto Sans SC', 'WenQuanYi Micro Hei', 'DejaVu Sans'] : ['Arial', 'Segoe UI', 'Microsoft YaHei']) const registryKeys = [ - 'HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts', - 'HKCU\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts' + String.raw`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts`, + String.raw`HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts` ] if (process.platform === 'win32') { for (const key of registryKeys) { try { const result = execFileSync('reg.exe', ['query', key], { encoding: 'utf8', windowsHide: true, timeout: 5000 }) for (const line of result.split(/\r?\n/)) { - const match = line.match(/^\s+(.+?)\s+REG_\w+\s+/) - if (!match) continue + const match = /^\s+(.+?)\s+REG_\w+\s+/.exec(line) + if (!match) {continue} for (const family of match[1].replace(/\s*\([^)]*\)\s*$/, '').split(/\s*&\s*/)) { const name = family.trim() - if (name && name.length <= 128) families.add(name) + // oxlint-disable-next-line eslint/max-depth -- one level per registry line and font family + if (name && name.length <= 128) {families.add(name)} } } } catch { @@ -1145,7 +1151,7 @@ function registerIpcHandlers(): void { for (const line of result.split(/\r?\n/)) { for (const family of line.split(',')) { const name = family.trim() - if (name && name.length <= 128) families.add(name) + if (name && name.length <= 128) {families.add(name)} } } } catch { @@ -1156,7 +1162,7 @@ function registerIpcHandlers(): void { }) ipcMain.handle('settings:get', () => settingsSnapshot()) ipcMain.handle('settings:update', async (_event, patch: GuEarthSettingsPatch): Promise => { - if (!isRecord(patch)) throw new Error('无效的设置') + if (!isRecord(patch)) {throw new Error('无效的设置')} let tileMirrorModeChanged = false let tileMirrorModeNow: TileMirrorMode = settings.tileMirrorMode let tileMirrorSourceChanged = false @@ -1167,53 +1173,53 @@ function registerIpcHandlers(): void { ...settings, providerCredentials: settings.providerCredentials } - if (patch.selectedImageryProviderId !== undefined) nextSettings.selectedImageryProviderId = safeId(patch.selectedImageryProviderId) - if (patch.selectedTerrainProviderId !== undefined) nextSettings.selectedTerrainProviderId = safeId(patch.selectedTerrainProviderId) + if (patch.selectedImageryProviderId !== undefined) {nextSettings.selectedImageryProviderId = safeId(patch.selectedImageryProviderId)} + if (patch.selectedTerrainProviderId !== undefined) {nextSettings.selectedTerrainProviderId = safeId(patch.selectedTerrainProviderId)} if (patch.terrainExaggeration !== undefined) { - if (typeof patch.terrainExaggeration !== 'number' || !Number.isFinite(patch.terrainExaggeration)) throw new Error('无效的地形夸张设置') + if (typeof patch.terrainExaggeration !== 'number' || !Number.isFinite(patch.terrainExaggeration)) {throw new TypeError('无效的地形夸张设置')} nextSettings.terrainExaggeration = Math.min(5, Math.max(1, patch.terrainExaggeration)) } if (patch.terrainLighting !== undefined) { - if (typeof patch.terrainLighting !== 'boolean') throw new Error('无效的光照设置') + if (typeof patch.terrainLighting !== 'boolean') {throw new TypeError('无效的光照设置')} nextSettings.terrainLighting = patch.terrainLighting } if (patch.tileCacheEnabled !== undefined) { - if (typeof patch.tileCacheEnabled !== 'boolean') throw new Error('无效的缓存设置') + if (typeof patch.tileCacheEnabled !== 'boolean') {throw new TypeError('无效的缓存设置')} nextSettings.tileCacheEnabled = patch.tileCacheEnabled } if (patch.tileMirrorMode !== undefined) { - if (!isTileMirrorMode(patch.tileMirrorMode)) throw new Error('无效的镜像瓦片设置') + if (!isTileMirrorMode(patch.tileMirrorMode)) {throw new Error('无效的镜像瓦片设置')} tileMirrorModeChanged = patch.tileMirrorMode !== nextSettings.tileMirrorMode tileMirrorModeNow = patch.tileMirrorMode nextSettings.tileMirrorMode = patch.tileMirrorMode } if (patch.tileMirrorSource !== undefined) { - if (!isMirrorEndpointPreference(patch.tileMirrorSource)) throw new Error('无效的镜像源设置') + if (!isMirrorEndpointPreference(patch.tileMirrorSource)) {throw new Error('无效的镜像源设置')} tileMirrorSourceChanged = patch.tileMirrorSource !== nextSettings.tileMirrorSource tileMirrorSourceNow = patch.tileMirrorSource nextSettings.tileMirrorSource = patch.tileMirrorSource } if (patch.mirrorConsentPrompted !== undefined) { - if (typeof patch.mirrorConsentPrompted !== 'boolean') throw new Error('无效的镜像协议确认设置') + if (typeof patch.mirrorConsentPrompted !== 'boolean') {throw new TypeError('无效的镜像协议确认设置')} nextSettings.mirrorConsentPrompted = patch.mirrorConsentPrompted } if (patch.touchInteractionMode !== undefined) { - if (!isTouchInteractionMode(patch.touchInteractionMode)) throw new Error('无效的触摸操作设置') + if (!isTouchInteractionMode(patch.touchInteractionMode)) {throw new Error('无效的触摸操作设置')} nextSettings.touchInteractionMode = patch.touchInteractionMode } if (patch.themeMode !== undefined) { - if (!isThemeMode(patch.themeMode)) throw new Error('无效的外观主题设置') + if (!isThemeMode(patch.themeMode)) {throw new Error('无效的外观主题设置')} nextSettings.themeMode = patch.themeMode } if (patch.networkProxy !== undefined) { - if (typeof patch.networkProxy !== 'string') throw new Error('无效的代理设置') + if (typeof patch.networkProxy !== 'string') {throw new TypeError('无效的代理设置')} const normalized = normalizeNetworkProxy(patch.networkProxy) - if (normalized === '' && patch.networkProxy.trim() !== '') throw new Error('无效的代理地址') + if (normalized === '' && patch.networkProxy.trim() !== '') {throw new Error('无效的代理地址')} networkProxyChanged = normalized !== nextSettings.networkProxy nextSettings.networkProxy = normalized } if (patch.providerStyles !== undefined) { - if (!isRecord(patch.providerStyles)) throw new Error('无效的影像样式') + if (!isRecord(patch.providerStyles)) {throw new Error('无效的影像样式')} const providerStyles = { ...settings.providerStyles } for (const [providerId, styleId] of Object.entries(patch.providerStyles)) { providerStyles[safeId(providerId)] = safeId(styleId) @@ -1221,19 +1227,19 @@ function registerIpcHandlers(): void { nextSettings.providerStyles = providerStyles } if (patch.setupGuideDismissed !== undefined) { - if (typeof patch.setupGuideDismissed !== 'boolean') throw new Error('无效的向导设置') + if (typeof patch.setupGuideDismissed !== 'boolean') {throw new TypeError('无效的向导设置')} nextSettings.setupGuideDismissed = patch.setupGuideDismissed } if (patch.errorReportingEnabled !== undefined) { - if (typeof patch.errorReportingEnabled !== 'boolean') throw new Error('无效的错误报告设置') + if (typeof patch.errorReportingEnabled !== 'boolean') {throw new TypeError('无效的错误报告设置')} nextSettings.errorReportingEnabled = patch.errorReportingEnabled } if (patch.telemetryEnabled !== undefined) { - if (typeof patch.telemetryEnabled !== 'boolean') throw new Error('无效的遥测设置') + if (typeof patch.telemetryEnabled !== 'boolean') {throw new TypeError('无效的遥测设置')} nextSettings.telemetryEnabled = patch.telemetryEnabled } if (patch.aiTelemetryEnabled !== undefined) { - if (typeof patch.aiTelemetryEnabled !== 'boolean') throw new Error('无效的 AI 使用信息上报设置') + if (typeof patch.aiTelemetryEnabled !== 'boolean') {throw new TypeError('无效的 AI 使用信息上报设置')} nextSettings.aiTelemetryEnabled = patch.aiTelemetryEnabled } return nextSettings @@ -1288,11 +1294,11 @@ function registerIpcHandlers(): void { logger.info('tiles', `镜像服务源已切换为「${sourceDesc}」,当前使用 ${mirrorEndpointLabel(mirrorEndpointManager.getActive())}`) } broadcastMirrorStatus(tileMirrorModeChanged ? mirrorModeNotice(tileMirrorModeNow) : '') - if (tileMirrorModeChanged) scheduleMirrorRefresh('settings') + if (tileMirrorModeChanged) {scheduleMirrorRefresh('settings')} if (settings.tileMirrorMode === 'on' && settings.tileMirrorSource === 'auto') { void probeMirrorEndpoints('settings') } - if (tileMirrorModeChanged && tileMirrorModeNow === 'on') void refreshEarthquakes().catch(() => undefined) + if (tileMirrorModeChanged && tileMirrorModeNow === 'on') {void refreshEarthquakes().catch(() => {})} } return settingsSnapshot() }) @@ -1314,13 +1320,13 @@ function registerIpcHandlers(): void { ipcMain.handle('settings:test-network-proxy', async (_event, proxy: unknown): Promise => { const raw = typeof proxy === 'string' ? proxy : '' const normalized = normalizeNetworkProxy(raw) - if (normalized === '' && raw.trim() !== '') return { ok: false, elapsedMs: 0, error: '无效的代理地址' } + if (normalized === '' && raw.trim() !== '') {return { ok: false, elapsedMs: 0, error: '无效的代理地址' }} const startedAt = Date.now() try { const testSession = session.fromPartition('guearth-network-test') await testSession.setProxy(proxyConfig(normalized)) const response = await testSession.fetch('https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/0/0/0', { headers: TILE_FETCH_HEADERS, signal: AbortSignal.timeout(TILE_FETCH_TIMEOUT_MS) }) - if (!response.ok) return { ok: false, elapsedMs: Date.now() - startedAt, error: `HTTP ${response.status}` } + if (!response.ok) {return { ok: false, elapsedMs: Date.now() - startedAt, error: `HTTP ${response.status}` }} await response.arrayBuffer() return { ok: true, elapsedMs: Date.now() - startedAt, error: '' } } catch (error) { @@ -1328,20 +1334,20 @@ function registerIpcHandlers(): void { } }) ipcMain.handle('places:search', async (_event, keyword: unknown, provider: unknown) => { - if (typeof keyword !== 'string') throw new Error('无效的搜索关键词') - if (provider !== undefined && provider !== 'amap' && provider !== 'baidu') throw new Error('无效的搜索源') + if (typeof keyword !== 'string') {throw new TypeError('无效的搜索关键词')} + if (provider !== undefined && provider !== 'amap' && provider !== 'baidu') {throw new Error('无效的搜索源')} const preferred: PlaceSearchProvider = provider ?? (hasProviderKey('amap') ? 'amap' : hasProviderKey('baidu') ? 'baidu' : 'amap') const requestId = beginPlacesRequest() const primary = preferred === 'baidu' ? await searchBaiduPlaces(keyword, requestId) : await searchPlaces(keyword, undefined, requestId) - if (primary.superseded || !primary.error) return { ...primary, source: preferred } + if (primary.superseded || !primary.error) {return { ...primary, source: preferred }} const alternative: PlaceSearchProvider = preferred === 'baidu' ? 'amap' : 'baidu' - if (!hasProviderKey(alternative)) return { ...primary, source: preferred } + if (!hasProviderKey(alternative)) {return { ...primary, source: preferred }} const fallback = alternative === 'baidu' ? await searchBaiduPlaces(keyword) : await searchPlaces(keyword) - if (fallback.error || fallback.superseded) return { ...primary, source: preferred } + if (fallback.error || fallback.superseded) {return { ...primary, source: preferred }} return { ...fallback, source: alternative, fellBackFrom: preferred } }) ipcMain.handle('places:poi-statistics', async (_event, request: unknown) => { - if (!isRecord(request)) throw new Error('无效的 POI 统计请求') + if (!isRecord(request)) {throw new Error('无效的 POI 统计请求')} const numberArg = (value: unknown): number | undefined => typeof value === 'number' && Number.isFinite(value) ? value : undefined const stringArg = (value: unknown): string | undefined => typeof value === 'string' && value.trim() ? value : undefined return poiStatistics({ @@ -1378,12 +1384,12 @@ function registerIpcHandlers(): void { advanceMirrorRouteGeneration() const recovered = tileMirrorRouter.resetMirrorFallback(id) mirrorEndpointManager.clearFailures() - if (id) mirrorFallenBackProviders.delete(id) - else mirrorFallenBackProviders.clear() + if (id) {mirrorFallenBackProviders.delete(id)} + else {mirrorFallenBackProviders.clear()} scheduleMirrorFallbackExpirySync() if (recovered) { logger.info('tiles', `已重置镜像回退状态,${id ?? '全部底图源'} 重新尝试镜像服务`) - if (notify !== false) broadcastMirrorStatus('') + if (notify !== false) {broadcastMirrorStatus('')} } return mirrorStatus() }) @@ -1395,7 +1401,7 @@ function registerIpcHandlers(): void { ipcMain.handle('tiles:clear', (_event, providerId?: string) => { const target = providerId === undefined ? tileCachePath : storageChildPath(tileCachePath, safeId(providerId)) return enqueueTileMutation(async () => { - if (tilePrunePromise) await tilePrunePromise + if (tilePrunePromise) {await tilePrunePromise} await rm(target, { recursive: true, force: true }) await mkdir(tileCachePath, { recursive: true }) tilePruneAt = 0 @@ -1425,11 +1431,11 @@ function registerIpcHandlers(): void { properties: ['openDirectory', 'createDirectory'] as ('openDirectory' | 'createDirectory')[] } const result = owner ? await dialog.showOpenDialog(owner, options) : await dialog.showOpenDialog(options) - if (result.canceled || !result.filePaths[0]) return null + if (result.canceled || !result.filePaths[0]) {return null} const directory = result.filePaths[0] try { const info = await stat(directory) - if (!info.isDirectory()) throw new Error('请选择文件夹') + if (!info.isDirectory()) {throw new Error('请选择文件夹')} await access(directory, constants.W_OK) } catch { throw new Error('所选文件夹不可写,请选择其他文件夹') @@ -1439,7 +1445,7 @@ function registerIpcHandlers(): void { }) ipcMain.handle('recordings:offscreen-probe', async (_event, script: unknown): Promise => { assertOffscreenRecordingIdle() - if (script === undefined) return startOffscreenRecordingWindow() + if (script === undefined) {return startOffscreenRecordingWindow()} return startOffscreenRecordingWindow(normalizeOffscreenRecordingScript(script)) }) ipcMain.handle('recordings:offscreen-encode', async (event, script: unknown): Promise => { @@ -1450,7 +1456,7 @@ function registerIpcHandlers(): void { try { return await encodeMacOffscreenRecording(normalizeOffscreenRecordingScript(script), macRecordingHost) } finally { - if (offscreenRecordRequester === requester) offscreenRecordRequester = null + if (offscreenRecordRequester === requester) {offscreenRecordRequester = null} } } assertOffscreenRecordingSupported(process.platform) @@ -1460,13 +1466,13 @@ function registerIpcHandlers(): void { try { return await encodeOffscreenRecording(normalizeOffscreenRecordingScript(script)) } finally { - if (offscreenRecordRequester === requester) offscreenRecordRequester = null + if (offscreenRecordRequester === requester) {offscreenRecordRequester = null} } }) ipcMain.on('recordings:offscreen-progress', (event, payload: unknown): void => { const target = offscreenRecordRequester - if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) return - if (!isRecord(payload)) return + if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) {return} + if (!isRecord(payload)) {return} const sceneIndex = normalizeNumber(payload.sceneIndex, 0, 1000, 0) const totalScenes = normalizeNumber(payload.totalScenes, 0, 1000, 0) const preparing = payload.phase === 'preparing' @@ -1482,8 +1488,8 @@ function registerIpcHandlers(): void { }) ipcMain.on('recordings:offscreen-notice', (event, message: unknown): void => { const target = offscreenRecordRequester - if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) return - if (typeof message !== 'string' || !message.trim()) return + if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) {return} + if (typeof message !== 'string' || !message.trim()) {return} target.send('recordings:offscreen-notice', message.trim().slice(0, 200)) }) ipcMain.on('recordings:offscreen-next', (event): void => { @@ -1498,9 +1504,9 @@ function registerIpcHandlers(): void { }) ipcMain.handle('recordings:offscreen-cancel', (): void => { cancelOffscreenRecording?.() }) ipcMain.handle('recordings:offscreen-stats', (): OffscreenRecordingProbeResult => offscreenRecordingStats()) - ipcMain.handle('logging:copy-report', (_event, rendererDump: unknown): void => { - if (typeof rendererDump !== 'string') throw new Error('无效的日志数据') - clipboard.writeText([ + ipcMain.handle('logging:copy-report', async (_event, rendererDump: unknown): Promise => { + if (typeof rendererDump !== 'string') {throw new TypeError('无效的日志数据')} + await clipboard.writeText([ '=== 咕咕地球诊断日志 ===', `版本 ${app.getVersion()} | Electron ${process.versions.electron} | Chrome ${process.versions.chrome} | Node ${process.versions.node} | ${process.platform} ${process.getSystemVersion()}`, `生成时间 ${new Date().toLocaleString()}`, @@ -1513,29 +1519,29 @@ function registerIpcHandlers(): void { ].join('\n')) }) ipcMain.on('recordings:offscreen-frame-ack', (event, count: unknown): void => { - if (event.sender !== offscreenRecordingWindow?.webContents) return + if (event.sender !== offscreenRecordingWindow?.webContents) {return} noteMacOffscreenFrameAck(count) }) ipcMain.on('recordings:offscreen-video-chunk', (event, bytes: unknown, position: unknown): void => { - if (event.sender !== offscreenRecordingWindow?.webContents) return + if (event.sender !== offscreenRecordingWindow?.webContents) {return} deliverMacOffscreenVideo(bytes, position) }) ipcMain.on('recordings:offscreen-video-complete', (event): void => { - if (event.sender !== offscreenRecordingWindow?.webContents) return + if (event.sender !== offscreenRecordingWindow?.webContents) {return} deliverMacOffscreenVideoComplete() }) } function assertOffscreenRecordingIdle(): void { - if (!offscreenRecordingWindow && !cancelOffscreenRecording && !teardownOffscreenRecording && !offscreenRecordRequester) return + if (!offscreenRecordingWindow && !cancelOffscreenRecording && !teardownOffscreenRecording && !offscreenRecordRequester) {return} throw new Error('已有离屏录制任务正在进行,请稍后再试') } function stopOffscreenRecordingWindow(): void { const window = offscreenRecordingWindow offscreenRecordingWindow = null - if (!window || window.isDestroyed()) return - if (!window.webContents.isDestroyed()) window.webContents.stopPainting() + if (!window || window.isDestroyed()) {return} + if (!window.webContents.isDestroyed()) {window.webContents.stopPainting()} window.destroy() } @@ -1549,12 +1555,12 @@ function taskkillProcessTree(pid: number): boolean { } function terminateOffscreenEncoder(encoder: ReturnType | null): void { - if (!encoder) return - if (process.platform === 'win32' && encoder.pid && taskkillProcessTree(encoder.pid)) return + if (!encoder) {return} + if (process.platform === 'win32' && encoder.pid && taskkillProcessTree(encoder.pid)) {return} try { encoder.kill() } catch { - return + // Best effort, so the failure is ignored. } } @@ -1590,27 +1596,27 @@ async function startOffscreenRecordingWindow(script?: OffscreenRecordingScript): window.webContents.once('did-finish-load', () => resolve()) window.webContents.once('did-fail-load', (_event, code, description) => reject(new Error(`${code}: ${description}`))) }) - const loading = process.env['ELECTRON_RENDERER_URL'] - ? window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}/offscreen.html`) + const loading = process.env.ELECTRON_RENDERER_URL + ? window.loadURL(`${process.env.ELECTRON_RENDERER_URL}/offscreen.html`) : window.loadFile(join(__dirname, '../renderer/offscreen.html')) await Promise.all([loading, ready]) if (script) { - const serialized = JSON.stringify(script).replace(/ setTimeout(resolve, 1000)) + await new Promise((resolve) => { setTimeout(resolve, 1000) }) } const elapsed = Math.max(1, Date.now() - offscreenPaintStartedAt) return { fps: Math.round(offscreenPaintFrames * 1000 / elapsed), frames: offscreenPaintFrames } } finally { - if (created && offscreenRecordingWindow === created) stopOffscreenRecordingWindow() + if (created && offscreenRecordingWindow === created) {stopOffscreenRecordingWindow()} } } @@ -1620,7 +1626,7 @@ function offscreenRecordingStats(): { fps: number; frames: number } { } function normalizeOffscreenTerrain(value: unknown): OffscreenRecordingScript['terrain'] { - if (!isRecord(value)) return { providerId: 'ellipsoid', exaggeration: 1, lighting: false } + if (!isRecord(value)) {return { providerId: 'ellipsoid', exaggeration: 1, lighting: false }} return { providerId: typeof value.providerId === 'string' && TERRAIN_PROVIDER_ID_SET.has(value.providerId) ? value.providerId : 'ellipsoid', exaggeration: normalizeNumber(value.exaggeration, 1, 5, 1), @@ -1629,16 +1635,16 @@ function normalizeOffscreenTerrain(value: unknown): OffscreenRecordingScript['te } function normalizeOffscreenRecordingScript(value: unknown): OffscreenRecordingScript { - if (!isRecord(value) || !Array.isArray(value.scenes)) throw new Error('无效的离屏录制脚本') + if (!isRecord(value) || !Array.isArray(value.scenes)) {throw new Error('无效的离屏录制脚本')} const sceneDocument = normalizeSceneDocument({ scenes: value.scenes }) return { title: typeof value.title === 'string' ? value.title.slice(0, 120) : '', scenes: sceneDocument.scenes, annotations: Array.isArray(value.annotations) ? value.annotations.flatMap((entry) => { - if (!isRecord(entry) || typeof entry.sceneId !== 'string' || typeof entry.name !== 'string' || !Array.isArray(entry.positions)) return [] - if (entry.kind !== 'point' && entry.kind !== 'polyline' && entry.kind !== 'polygon') return [] - const positions = entry.positions.flatMap((position) => isRecord(position) ? [{ longitude: normalizeNumber(position.longitude, -180, 180, 0), latitude: normalizeNumber(position.latitude, -90, 90, 0), height: normalizeNumber(position.height, -10000, 100000000, 0) }] : []) - if (!positions.length) return [] + if (!isRecord(entry) || typeof entry.sceneId !== 'string' || typeof entry.name !== 'string' || !Array.isArray(entry.positions)) {return []} + if (entry.kind !== 'point' && entry.kind !== 'polyline' && entry.kind !== 'polygon') {return []} + const positions = entry.positions.flatMap((position) => isRecord(position) ? [{ longitude: normalizeNumber(position.longitude, -180, 180, 0), latitude: normalizeNumber(position.latitude, -90, 90, 0), height: normalizeNumber(position.height, -10_000, 100_000_000, 0) }] : []) + if (positions.length === 0) {return []} return [{ sceneId: entry.sceneId, kind: entry.kind, @@ -1683,25 +1689,25 @@ function withOffscreenTimeout(task: Promise, timeoutMs: number, message: s } function forwardOffscreenCommand(event: Electron.IpcMainEvent, expression: string): void { - if (event.sender !== offscreenRecordRequester) return + if (event.sender !== offscreenRecordRequester) {return} const window = offscreenRecordingWindow - if (!window || window.isDestroyed() || window.webContents.isDestroyed()) return - void window.webContents.executeJavaScript(expression).catch(() => undefined) + if (!window || window.isDestroyed() || window.webContents.isDestroyed()) {return} + void window.webContents.executeJavaScript(expression).catch(() => {}) } async function offscreenFrameDirectoryActive(directory: string, entryName: string): Promise { const path = resolveOffscreenEntry(directory, entryName) - if (!path) return true + if (!path) {return true} try { const owner = Number.parseInt((await readFile(join(path, OFFSCREEN_OWNER_FILE), 'utf8')).trim(), 10) - if (!Number.isInteger(owner) || owner <= 0) return false - if (owner === process.pid) return true + if (!Number.isInteger(owner) || owner <= 0) {return false} + if (owner === process.pid) {return true} process.kill(owner, 0) return true } catch (error) { const code = (error as NodeJS.ErrnoException).code - if (code === 'ESRCH') return false - if (code !== 'ENOENT') return true + if (code === 'ESRCH') {return false} + if (code !== 'ENOENT') {return true} try { const info = await stat(path) return Date.now() - info.mtimeMs < OFFSCREEN_SWEEP_GRACE_MS @@ -1717,13 +1723,13 @@ async function removeStaleOffscreenDirectories(directory: string): Promise await Promise.all(entries .filter((entry) => entry.isDirectory() && entry.name.startsWith(OFFSCREEN_TEMP_PREFIX)) .map(async (entry) => { - if (await offscreenFrameDirectoryActive(directory, entry.name)) return + if (await offscreenFrameDirectoryActive(directory, entry.name)) {return} const path = resolveOffscreenEntry(directory, entry.name) - if (!path) return - await rm(path, { recursive: true, force: true }).catch(() => undefined) + if (!path) {return} + await rm(path, { recursive: true, force: true }).catch(() => {}) })) } catch { - return + // Best effort, so the failure is ignored. } } @@ -1734,36 +1740,36 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise | null = null let recorderWindow: BrowserWindow | null = null const release = (): void => { - if (cancelOffscreenRecording === cancel) cancelOffscreenRecording = null - if (teardownOffscreenRecording === teardown) teardownOffscreenRecording = null + if (cancelOffscreenRecording === cancel) {cancelOffscreenRecording = null} + if (teardownOffscreenRecording === teardown) {teardownOffscreenRecording = null} stopOffscreenRecordingWindow() terminateOffscreenEncoder(ffmpeg) ffmpeg = null - if (tempDir) void rm(tempDir, { recursive: true, force: true }).catch(() => undefined) + if (tempDir) {void rm(tempDir, { recursive: true, force: true }).catch(() => {})} } const teardown = (): void => { const pending = !settled settled = true - if (cancelOffscreenRecording === cancel) cancelOffscreenRecording = null - if (teardownOffscreenRecording === teardown) teardownOffscreenRecording = null + if (cancelOffscreenRecording === cancel) {cancelOffscreenRecording = null} + if (teardownOffscreenRecording === teardown) {teardownOffscreenRecording = null} stopOffscreenRecordingWindow() terminateOffscreenEncoder(ffmpeg) ffmpeg = null const directory = tempDir tempDir = null - if (directory) rmSync(directory, { recursive: true, force: true }) + if (directory) {rmSync(directory, { recursive: true, force: true })} logger.info('recording', pending ? '应用退出,已中止离屏录制并清理临时文件' : '应用退出,已清理离屏录制临时文件') - if (pending) resolve({ path: '', bytes: 0, cancelled: true }) + if (pending) {resolve({ path: '', bytes: 0, cancelled: true })} } teardownOffscreenRecording = teardown const fail = (error: unknown): void => { - if (settled) return + if (settled) {return} settled = true release() reject(error instanceof Error ? error : new Error(String(error))) } const cancel = (): void => { - if (settled) return + if (settled) {return} settled = true release() logger.info('recording', '离屏录制已取消,未生成视频文件') @@ -1774,18 +1780,18 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise { stopOffscreenRecordingWindow() const directory = await usableRecordingDirectory() - if (settled) return - if (!directory) throw new Error('请先选择可用的视频保存文件夹') + if (settled) {return} + if (!directory) {throw new Error('请先选择可用的视频保存文件夹')} await removeStaleOffscreenDirectories(directory) - if (settled) return + if (settled) {return} const createdTempDir = await mkdtemp(join(directory, OFFSCREEN_TEMP_PREFIX)) if (settled) { - void rm(createdTempDir, { recursive: true, force: true }).catch(() => undefined) + void rm(createdTempDir, { recursive: true, force: true }).catch(() => {}) return } tempDir = createdTempDir await writeFile(join(tempDir, OFFSCREEN_OWNER_FILE), String(process.pid), 'utf8') - if (settled) return + if (settled) {return} const frameDirectory = createdTempDir const temporaryPath = join(frameDirectory, 'recording.mp4.part') const now = new Date() @@ -1828,15 +1834,15 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise { offscreenPaintFrames += 1 - if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) return + if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) {return} const size = image.getSize() if (!captureLogged) { captureLogged = true logger.info('recording', `离屏采集 ${size.width}x${size.height},输出 ${script.width}x${script.height}`, `窗口 ${capture.width}x${capture.height} 工作区 ${workArea.width}x${workArea.height}`) - if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配') + if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) {logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配')} } const frame = image.toJPEG(95) - if (frame.length === 0) return + if (frame.length === 0) {return} const name = `frame-${String(frameIndex).padStart(8, '0')}.jpg` frameNames.push(name) frameTimes.push(Date.now() - recordingStartedAt) @@ -1848,13 +1854,13 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise resolveReady()) window.webContents.once('did-fail-load', (_event, code, description) => rejectReady(new Error(`${code}: ${description}`))) }) - const loading = process.env['ELECTRON_RENDERER_URL'] - ? window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}/offscreen.html`) + const loading = process.env.ELECTRON_RENDERER_URL + ? window.loadURL(`${process.env.ELECTRON_RENDERER_URL}/offscreen.html`) : window.loadFile(join(__dirname, '../renderer/offscreen.html')) await Promise.all([loading, ready]) - if (settled) return + if (settled) {return} window.webContents.setFrameRate(targetFps) - const serialized = JSON.stringify(script).replace(/ total + seconds, 0) await writeFile(join(frameDirectory, 'frames.txt'), offscreenConcatPlaylist(frameNames, durations), 'utf8') - if (settled) return + if (settled) {return} const outputFps = Math.min(60, Math.max(1, Math.round(script.fps))) const stderr: Buffer[] = [] const encoder = spawn(ffmpegPath(), [ @@ -1901,30 +1907,30 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise stderr.push(chunk)) + encoder.stderr?.on('data', (chunk: Buffer) => { stderr.push(chunk) }) const code = await new Promise((resolveClose, rejectClose) => { encoder.once('error', rejectClose) encoder.once('close', resolveClose) }).catch((error) => { throw error instanceof Error ? error : new Error(String(error)) }) - if (settled) return + if (settled) {return} if (code !== 0) { const detail = Buffer.concat(stderr).toString('utf8').trim() fail(new Error(`离屏视频编码失败(FFmpeg 退出码 ${code ?? '未知'})${detail ? `:${detail.slice(-1000)}` : ''}`)) return } const bytes = await readFileSize(temporaryPath) - if (settled) return + if (settled) {return} if (bytes === 0) { fail(new Error('未能生成离屏视频数据')) return } await renameFile(temporaryPath, outputPath) - if (settled) return - await rm(frameDirectory, { recursive: true, force: true }).catch(() => undefined) - if (settled) return + if (settled) {return} + await rm(frameDirectory, { recursive: true, force: true }).catch(() => {}) + if (settled) {return} settled = true - if (cancelOffscreenRecording === cancel) cancelOffscreenRecording = null - if (teardownOffscreenRecording === teardown) teardownOffscreenRecording = null + if (cancelOffscreenRecording === cancel) {cancelOffscreenRecording = null} + if (teardownOffscreenRecording === teardown) {teardownOffscreenRecording = null} ffmpeg = null tempDir = null stopOffscreenRecordingWindow() @@ -1980,7 +1986,7 @@ function createWindow(): void { win.on('enter-full-screen', emitWindowState) win.on('leave-full-screen', emitWindowState) win.on('closed', () => { - if (mainWindow === win) mainWindow = null + if (mainWindow === win) {mainWindow = null} }) win.on('ready-to-show', () => win.show()) @@ -1990,7 +1996,7 @@ function createWindow(): void { }) win.webContents.setWindowOpenHandler((details) => { - if (/^https?:\/\//i.test(details.url)) void shell.openExternal(details.url) + if (/^https?:\/\//i.test(details.url)) {void shell.openExternal(details.url)} return { action: 'deny' } }) @@ -2002,17 +2008,17 @@ function createWindow(): void { }) win.webContents.on('did-fail-load', (_event, errorCode, errorDescription, validatedURL, isMainFrame) => { - if (!isMainFrame || errorCode === -3) return + if (!isMainFrame || errorCode === -3) {return} logger.error('window', '页面加载失败', `${errorCode} ${errorDescription} ${validatedURL}`) if (errorReportingEnabled) { Sentry.captureMessage('渲染页面加载失败', { level: 'error', extra: { errorCode, errorDescription, url: validatedURL } }) } }) - if (process.env['ELECTRON_RENDERER_URL']) { - win.loadURL(process.env['ELECTRON_RENDERER_URL']) + if (process.env.ELECTRON_RENDERER_URL) { + void win.loadURL(process.env.ELECTRON_RENDERER_URL) } else { - win.loadFile(join(__dirname, '../renderer/index.html')) + void win.loadFile(join(__dirname, '../renderer/index.html')) } } @@ -2024,13 +2030,13 @@ if (!hasSingleInstanceLock) { app.on('second-instance', () => { const window = mainWindow - if (!window || window.isDestroyed()) return - if (window.isMinimized()) window.restore() + if (!window || window.isDestroyed()) {return} + if (window.isMinimized()) {window.restore()} window.focus() }) -app.whenReady().then(async () => { - if (!hasSingleInstanceLock) return +void app.whenReady().then(async () => { + if (!hasSingleInstanceLock) {return} logger.info('app', '应用启动', `version=${app.getVersion()} packaged=${app.isPackaged}`) const userDataPath = app.getPath('userData') settingsPath = join(userDataPath, 'settings.json') @@ -2063,7 +2069,7 @@ app.whenReady().then(async () => { void probeMirrorEndpoints('startup', () => resolveReady?.()).finally(() => resolveReady?.()) startupMirrorProbeReady = Promise.race([ firstOrAllReady, - new Promise((resolve) => setTimeout(resolve, STARTUP_MIRROR_PROBE_BUDGET_MS)) + new Promise((resolve) => { setTimeout(resolve, STARTUP_MIRROR_PROBE_BUDGET_MS) }) ]) } const legacyHistoryPath = join(userDataPath, 'ai-chat-history.json') @@ -2090,7 +2096,8 @@ app.whenReady().then(async () => { return } catch (error) { logger.warn('ai', 'EOQ HawDB 初始化失败,已降级为 JSON 存储', error) - await eoqHawdb.close().catch(() => undefined) + // oxlint-disable-next-line promise/no-nesting -- closing is best effort while falling back to JSON storage + await eoqHawdb.close().catch(() => {}) } } else { logger.warn('ai', '未找到内置 HawDB 引擎库,已降级为 JSON 存储') @@ -2106,10 +2113,10 @@ app.whenReady().then(async () => { aiSettings.init(join(userDataPath, 'ai-settings.json')), initEoqStores() ]) - if (startupMirrorProbeReady) await startupMirrorProbeReady + if (startupMirrorProbeReady) {await startupMirrorProbeReady} void startOnlineData(userDataPath, (snapshot) => { for (const window of BrowserWindow.getAllWindows()) { - if (!window.isDestroyed() && !window.webContents.isDestroyed()) window.webContents.send('datasets:online-data-changed', snapshot) + if (!window.isDestroyed() && !window.webContents.isDestroyed()) {window.webContents.send('datasets:online-data-changed', snapshot)} } }) ;[annotations, scenes] = loaded @@ -2132,19 +2139,19 @@ app.whenReady().then(async () => { scheduleMirrorRefresh('startup') app.on('activate', () => { - if (BrowserWindow.getAllWindows().length === 0) createWindow() + if (BrowserWindow.getAllWindows().length === 0) {createWindow()} }) }) app.on('before-quit', (event) => { - if (quitting) return + if (quitting) {return} event.preventDefault() quitting = true void Promise.all([shutdownPosthog(), shutdownPosthogLogs()]) - .catch(() => undefined) - .finally(() => flushJsonWrites()) + .catch(() => {}) + .then(() => flushJsonWrites()) .then(() => eoqHawdb.close()) - .catch(() => undefined) + .catch(() => {}) .finally(() => app.quit()) }) @@ -2152,7 +2159,7 @@ app.on('will-quit', () => { try { teardownOffscreenRecording?.() } catch { - return + // Best effort, so the failure is ignored. } finally { if (mirrorFallbackExpiryTimer) { clearTimeout(mirrorFallbackExpiryTimer) @@ -2162,20 +2169,20 @@ app.on('will-quit', () => { }) app.on('window-all-closed', () => { - if (process.platform !== 'darwin') app.quit() + if (process.platform !== 'darwin') {app.quit()} }) let gpuCrashReportedAt = 0 app.on('child-process-gone', (_event, details) => { - if (details.type !== 'GPU') return + if (details.type !== 'GPU') {return} logger.error('gpu', `GPU 进程退出(${details.reason})`, `exitCode=${details.exitCode}`) capturePosthogLog('error', 'gpu_process_exited', { exit_code: details.exitCode, reason: details.reason }) - if (!errorReportingEnabled) return - if (Date.now() - gpuCrashReportedAt < 60_000) return + if (!errorReportingEnabled) {return} + if (Date.now() - gpuCrashReportedAt < 60_000) {return} gpuCrashReportedAt = Date.now() Sentry.captureMessage(`GPU 进程退出:${details.reason}`, { level: 'error', extra: { exitCode: details.exitCode } }) }) diff --git a/src/main/jsonStore.ts b/src/main/jsonStore.ts index 8d6ca464..43b93669 100644 --- a/src/main/jsonStore.ts +++ b/src/main/jsonStore.ts @@ -1,13 +1,13 @@ -import { readFile, rename, unlink, writeFile } from 'fs/promises' -import { randomUUID } from 'crypto' +import { readFile, rename, unlink, writeFile } from 'node:fs/promises' +import { randomUUID } from 'node:crypto' const pending = new Set>() export function serialQueue() { let tail: Promise = Promise.resolve() - return function enqueue(operation: () => Promise): Promise { + return function (operation: () => Promise): Promise { const result = tail.then(operation) - tail = result.catch(() => undefined) + tail = result.catch(() => {}) pending.add(result) void result.then(() => pending.delete(result), () => pending.delete(result)) return result @@ -32,15 +32,15 @@ export async function writeAtomic(path: string, data: string | Buffer): Promise< break } catch (error) { const code = (error as NodeJS.ErrnoException).code - if (attempt >= 4 || !['EACCES', 'EBUSY', 'EEXIST', 'EPERM'].includes(code ?? '')) throw error - await new Promise((resolve) => setTimeout(resolve, 20 * (attempt + 1))) + if (attempt >= 4 || !['EACCES', 'EBUSY', 'EEXIST', 'EPERM'].includes(code ?? '')) {throw error} + await new Promise((resolve) => { setTimeout(resolve, 20 * (attempt + 1)) }) } } } finally { - await unlink(temporaryPath).catch(() => undefined) + await unlink(temporaryPath).catch(() => {}) } } export async function flushJsonWrites(): Promise { - while (pending.size) await Promise.allSettled([...pending]) + while (pending.size > 0) {await Promise.allSettled(pending)} } diff --git a/src/main/keyVault.ts b/src/main/keyVault.ts index 41b2ab04..23119e23 100644 --- a/src/main/keyVault.ts +++ b/src/main/keyVault.ts @@ -1,6 +1,6 @@ import { safeStorage } from 'electron' -import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs' -import { join } from 'path' +import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs' +import { join } from 'node:path' let credentialsPath = '' @@ -14,7 +14,7 @@ export function isSafeId(value: unknown): value is string { } export function assertSafeId(value: unknown): string { - if (!isSafeId(value)) throw new Error('无效的供应商标识') + if (!isSafeId(value)) {throw new Error('无效的供应商标识')} return value } @@ -27,23 +27,23 @@ export function hasProviderKey(providerId: string): boolean { } export function assertEncryptionAvailable(): void { - if (!safeStorage.isEncryptionAvailable()) throw new Error('系统安全存储不可用') + if (!safeStorage.isEncryptionAvailable()) {throw new Error('系统安全存储不可用')} } export function writeProviderKey(providerId: string, apiKey: string): void { assertEncryptionAvailable() - if (typeof apiKey !== 'string' || apiKey.length < 1 || apiKey.length > 4096) throw new Error('无效的供应商密钥') + if (typeof apiKey !== 'string' || apiKey.length === 0 || apiKey.length > 4096) {throw new Error('无效的供应商密钥')} writeFileSync(credentialPath(providerId), safeStorage.encryptString(apiKey)) } export function clearProviderKey(providerId: string): void { const path = credentialPath(providerId) - if (existsSync(path)) unlinkSync(path) + if (existsSync(path)) {unlinkSync(path)} } export function readProviderKey(providerId: string): string | undefined { const path = credentialPath(providerId) - if (!existsSync(path) || !safeStorage.isEncryptionAvailable()) return undefined + if (!existsSync(path) || !safeStorage.isEncryptionAvailable()) {return undefined} try { return safeStorage.decryptString(readFileSync(path)) } catch { diff --git a/src/main/laboratory.ts b/src/main/laboratory.ts index ffb98001..bea25a22 100644 --- a/src/main/laboratory.ts +++ b/src/main/laboratory.ts @@ -10,10 +10,10 @@ export interface QWeatherCredentials { } export function getQWeatherCredentials(): QWeatherCredentials | null { - if (!hasProviderKey(CREDENTIAL_ID)) return null + if (!hasProviderKey(CREDENTIAL_ID)) {return null} try { const saved = readProviderKey(CREDENTIAL_ID) - if (!saved) throw new Error('无法解密') + if (!saved) {throw new Error('无法解密')} const value = JSON.parse(saved) return { apiHost: normalizeQWeatherHost(value.apiHost), apiKey: validateQWeatherApiKey(value.apiKey) } } catch { @@ -31,18 +31,18 @@ export function listLaboratoryProviders(): LaboratoryProvider[] { } export function saveLaboratoryProvider(input: LaboratoryProviderInput): LaboratoryProvider[] { - if (!input || input.category !== 'weather' || input.provider !== 'qweather') throw new Error('不支持的数据源或提供商') + if (input?.category !== 'weather' || input.provider !== 'qweather') {throw new Error('不支持的数据源或提供商')} const apiHost = normalizeQWeatherHost(input.apiHost) const apiKey = input.apiKey === undefined || input.apiKey === '' ? getQWeatherCredentials()?.apiKey : validateQWeatherApiKey(input.apiKey) - if (!apiKey) throw new Error('请输入 API Key') + if (!apiKey) {throw new Error('请输入 API Key')} writeProviderKey(CREDENTIAL_ID, JSON.stringify({ apiHost, apiKey })) return listLaboratoryProviders() } export function removeLaboratoryProvider(provider: unknown): LaboratoryProvider[] { - if (provider !== 'qweather') throw new Error('不支持的提供商') + if (provider !== 'qweather') {throw new Error('不支持的提供商')} clearProviderKey(CREDENTIAL_ID) return [] } diff --git a/src/main/offscreenMac.ts b/src/main/offscreenMac.ts index 8e587adb..c1bf2330 100644 --- a/src/main/offscreenMac.ts +++ b/src/main/offscreenMac.ts @@ -1,311 +1,311 @@ -import { rmSync } from 'fs' -import { mkdtemp, open, rename as renameFile, rm, stat, writeFile, type FileHandle } from 'fs/promises' -import { randomUUID } from 'crypto' -import { format, join } from 'path' -import { BrowserWindow, shell } from 'electron' -import { logger } from '../common/logger' -import type { OffscreenRecordingScript, RecordingSaveResult } from '../preload' -import { offscreenFrameRate, offscreenScriptDurationMs } from './offscreenTiming' - -export interface OffscreenMacSessionHost { - setCancelHook(hook: () => void): void - clearCancelHook(hook: () => void): void - setTeardownHook(hook: () => void): void - clearTeardownHook(hook: () => void): void - adoptWindow(window: BrowserWindow): void - dropWindow(): void - notePaintFrame(): void - resetPaintStats(): void - resetPrewarnWarned(): void - usableDirectory(): Promise - sweepStaleDirectories(directory: string): Promise -} - -interface OffscreenMacIpcSession { - noteFrameAck: (count: number) => void - appendVideoChunk: (bytes: Uint8Array, position: number) => void - completeVideo: () => void -} - -const OFFSCREEN_TEMP_PREFIX = '.guearth-offscreen-' -const OFFSCREEN_OWNER_FILE = '.owner' -const OFFSCREEN_PLAY_TIMEOUT_MARGIN_MS = 90_000 -const OFFSCREEN_PREPARE_TIMEOUT_MS = 180_000 -const OFFSCREEN_MIN_FLUENT_FPS = 24 -const OFFSCREEN_MAX_PENDING_FRAMES = 24 -const OFFSCREEN_ENCODE_TIMEOUT_MS = 120_000 -const OFFSCREEN_ENCODE_MS_PER_FRAME = 50 -const OFFSCREEN_ACK_DRAIN_TIMEOUT_MS = 10_000 -const OFFSCREEN_MAC_BITRATE = 2_000_000 - -function recordingPath(directory: string, name: string): string { - return format({ dir: directory, base: name }) -} - -let activeMacSession: OffscreenMacIpcSession | null = null - -export function noteMacOffscreenFrameAck(count: unknown): void { - const session = activeMacSession - if (!session || typeof count !== 'number' || !Number.isFinite(count) || count <= 0) return - session.noteFrameAck(Math.min(1024, Math.round(count))) -} - -export function deliverMacOffscreenVideo(value: unknown, position: unknown): void { - const session = activeMacSession - if (!session || !ArrayBuffer.isView(value)) return - if (typeof position !== 'number' || !Number.isSafeInteger(position) || position < 0) return - session.appendVideoChunk(new Uint8Array(value.buffer, value.byteOffset, value.byteLength), position) -} - -export function deliverMacOffscreenVideoComplete(): void { - activeMacSession?.completeVideo() -} - -async function readFileSize(path: string): Promise { - return (await stat(path)).size -} - -function withOffscreenTimeout(task: Promise, timeoutMs: number, message: string): Promise { - return Promise.race([ - task, - new Promise((_resolveTimeout, rejectTimeout) => { - const timer = setTimeout(() => rejectTimeout(new Error(message)), timeoutMs) - timer.unref?.() - }) - ]) -} - -export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, host: OffscreenMacSessionHost): Promise { - return new Promise((resolve, reject) => { - let settled = false - let tempDir: string | null = null - let recorderWindow: BrowserWindow | null = null - let videoFile: FileHandle | null = null - let videoWrite = Promise.resolve() - let videoCompleteResolve: (() => void) | null = null - let videoCompleteReject: ((error: unknown) => void) | null = null - let pendingFrames = 0 - let frameDrainResolve: (() => void) | null = null - const release = (): void => { - host.clearCancelHook(cancel) - host.clearTeardownHook(teardown) - activeMacSession = null - host.dropWindow() - if (videoFile) void videoFile.close().catch(() => undefined) - if (tempDir) void rm(tempDir, { recursive: true, force: true }).catch(() => undefined) - } - const teardown = (): void => { - const pending = !settled - settled = true - host.clearCancelHook(cancel) - host.clearTeardownHook(teardown) - activeMacSession = null - host.dropWindow() - if (videoFile) void videoFile.close().catch(() => undefined) - const directory = tempDir - tempDir = null - if (directory) rmSync(directory, { recursive: true, force: true }) - logger.info('recording', pending ? '应用退出,已中止离屏录制并清理临时文件' : '应用退出,已清理离屏录制临时文件') - if (pending) resolve({ path: '', bytes: 0, cancelled: true }) - } - host.setTeardownHook(teardown) - const fail = (error: unknown): void => { - if (settled) return - settled = true - release() - reject(error instanceof Error ? error : new Error(String(error))) - } - const cancel = (): void => { - if (settled) return - settled = true - release() - logger.info('recording', '离屏录制已取消,未生成视频文件') - resolve({ path: '', bytes: 0, cancelled: true }) - } - host.resetPrewarnWarned() - host.setCancelHook(cancel) - activeMacSession = { - noteFrameAck: (count) => { - pendingFrames = Math.max(0, pendingFrames - count) - if (pendingFrames === 0) frameDrainResolve?.() - }, - appendVideoChunk: (bytes, position) => { - if (!videoFile) return - const copy = new Uint8Array(bytes) - videoWrite = videoWrite.then(() => videoFile!.write(copy, 0, copy.byteLength, position)).then(() => undefined) - }, - completeVideo: () => { - void videoWrite.then(() => videoCompleteResolve?.(), (error) => videoCompleteReject?.(error)) - } - } - void (async () => { - const directory = await host.usableDirectory() - if (settled) return - if (!directory) throw new Error('请先选择可用的视频保存文件夹') - await host.sweepStaleDirectories(directory) - if (settled) return - const createdTempDir = await mkdtemp(recordingPath(directory, OFFSCREEN_TEMP_PREFIX)) - if (settled) { - void rm(createdTempDir, { recursive: true, force: true }).catch(() => undefined) - return - } - tempDir = createdTempDir - await writeFile(recordingPath(tempDir, OFFSCREEN_OWNER_FILE), String(process.pid), 'utf8') - if (settled) return - const temporaryPath = recordingPath(tempDir, 'recording.mp4.part') - videoFile = await open(temporaryPath, 'w') - const now = new Date() - const pad = (value: number): string => String(value).padStart(2, '0') - const stamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}-${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}` - const outputPath = recordingPath(directory, `GuEarth-${stamp}-${randomUUID().slice(0, 8)}.mp4`) - const targetFps = script.fps - recorderWindow = new BrowserWindow({ - show: false, - width: script.width, - height: script.height, - webPreferences: { - preload: join(__dirname, '../preload/index.js'), - offscreen: true, - backgroundThrottling: false, - sandbox: false, - contextIsolation: true, - nodeIntegration: false - } - }) - const window = recorderWindow - host.adoptWindow(window) - window.webContents.on('render-process-gone', (_event, details) => { - fail(new Error(`离屏录制渲染进程异常退出(${details.reason})`)) - }) - window.on('unresponsive', () => { - fail(new Error('离屏录制渲染进程无响应,已中止录制')) - }) - host.resetPaintStats() - let capturing = false - let captureLogged = false - let recordingStartedAt = 0 - let frameIndex = 0 - window.webContents.on('paint', (_event, _dirty, image) => { - host.notePaintFrame() - if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) return - const size = image.getSize() - if (!captureLogged) { - captureLogged = true - logger.info('recording', `离屏采集 ${size.width}x${size.height},输出 ${script.width}x${script.height}`, `窗口 ${script.width}x${script.height}(未按工作区缩放)`) - if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配') - } - const frame = image.toJPEG(95) - if (frame.length === 0) return - const captureTimeMs = Date.now() - recordingStartedAt - pendingFrames += 1 - window.webContents.send('recordings:offscreen-frame', frameIndex, captureTimeMs, frame) - frameIndex += 1 - }) - const ready = new Promise((resolveReady, rejectReady) => { - window.webContents.once('did-finish-load', () => resolveReady()) - window.webContents.once('did-fail-load', (_event, code, description) => rejectReady(new Error(`${code}: ${description}`))) - }) - const loading = process.env['ELECTRON_RENDERER_URL'] - ? window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}/offscreen.html`) - : window.loadFile(join(__dirname, '../renderer/offscreen.html')) - await Promise.all([loading, ready]) - if (settled) return - window.webContents.setFrameRate(targetFps) - const serialized = JSON.stringify(script).replace(/((resolveDrain) => { - if (pendingFrames === 0) { - resolveDrain() - return - } - const timer = setTimeout(() => { - frameDrainResolve = null - if (!settled) logger.warn('recording', '部分离屏帧尚未送达编码页,已按已到达帧继续编码') - resolveDrain() - }, OFFSCREEN_ACK_DRAIN_TIMEOUT_MS) - timer.unref?.() - frameDrainResolve = (): void => { - clearTimeout(timer) - frameDrainResolve = null - resolveDrain() - } - }) - if (settled) return - if (frameIndex === 0) { - fail(new Error('离屏渲染未产生有效视频帧')) - return - } - const measuredFps = offscreenFrameRate(frameIndex, recordingElapsedMs) - logger.info('recording', `离屏录制 ${frameIndex} 帧 / ${(recordingElapsedMs / 1000).toFixed(1)} 秒,实测约 ${measuredFps.toFixed(1)} FPS`) - if (measuredFps < OFFSCREEN_MIN_FLUENT_FPS) logger.warn('recording', `离屏采集帧率偏低(${measuredFps.toFixed(1)} FPS),画面可能不够流畅`) - const videoReady = new Promise((resolveVideo, rejectVideo) => { - videoCompleteResolve = resolveVideo - videoCompleteReject = rejectVideo - }) - const encodeStartedAt = Date.now() - const encodeBudgetMs = Math.max(OFFSCREEN_ENCODE_TIMEOUT_MS, frameIndex * OFFSCREEN_ENCODE_MS_PER_FRAME) - await Promise.all([ - withOffscreenTimeout( - window.webContents.executeJavaScript('window.guEarthOffscreenMacEncoder.finish()'), - encodeBudgetMs, - '离屏视频编码超时,已中止录制' - ), - withOffscreenTimeout(videoReady, encodeBudgetMs, '离屏视频编码超时,已中止录制') - ]) - if (settled) return - await videoWrite - await videoFile?.close() - videoFile = null - const bytes = await readFileSize(temporaryPath) - if (settled) return - await renameFile(temporaryPath, outputPath) - if (settled) { - await rm(outputPath, { force: true }).catch(() => undefined) - return - } - await rm(tempDir, { recursive: true, force: true }).catch(() => undefined) - if (settled) { - await rm(outputPath, { force: true }).catch(() => undefined) - return - } - settled = true - host.clearCancelHook(cancel) - host.clearTeardownHook(teardown) - activeMacSession = null - tempDir = null - host.dropWindow() - logger.info('recording', `离屏录制完成:${outputPath}`, `${(bytes / 1024 / 1024).toFixed(1)} MB`) - shell.showItemInFolder(outputPath) - resolve({ path: outputPath, bytes, fps: measuredFps }) - })().catch((error) => fail(error)) - }) -} +import { rmSync } from 'node:fs' +import { mkdtemp, open, rename as renameFile, rm, stat, writeFile } from 'node:fs/promises'; +import type { FileHandle } from 'node:fs/promises'; +import { randomUUID } from 'node:crypto' +import { format, join } from 'node:path' +import { BrowserWindow, shell } from 'electron' +import { logger } from '../common/logger' +import type { OffscreenRecordingScript, RecordingSaveResult } from '../preload' +import { offscreenFrameRate, offscreenScriptDurationMs } from './offscreenTiming' + +export interface OffscreenMacSessionHost { + setCancelHook(hook: () => void): void + clearCancelHook(hook: () => void): void + setTeardownHook(hook: () => void): void + clearTeardownHook(hook: () => void): void + adoptWindow(window: BrowserWindow): void + dropWindow(): void + notePaintFrame(): void + resetPaintStats(): void + resetPrewarnWarned(): void + usableDirectory(): Promise + sweepStaleDirectories(directory: string): Promise +} + +interface OffscreenMacIpcSession { + noteFrameAck: (count: number) => void + appendVideoChunk: (bytes: Uint8Array, position: number) => void + completeVideo: () => void +} + +const OFFSCREEN_TEMP_PREFIX = '.guearth-offscreen-' +const OFFSCREEN_OWNER_FILE = '.owner' +const OFFSCREEN_PLAY_TIMEOUT_MARGIN_MS = 90_000 +const OFFSCREEN_PREPARE_TIMEOUT_MS = 180_000 +const OFFSCREEN_MIN_FLUENT_FPS = 24 +const OFFSCREEN_MAX_PENDING_FRAMES = 24 +const OFFSCREEN_ENCODE_TIMEOUT_MS = 120_000 +const OFFSCREEN_ENCODE_MS_PER_FRAME = 50 +const OFFSCREEN_ACK_DRAIN_TIMEOUT_MS = 10_000 +const OFFSCREEN_MAC_BITRATE = 2_000_000 + +function recordingPath(directory: string, name: string): string { + return format({ dir: directory, base: name }) +} + +let activeMacSession: OffscreenMacIpcSession | null = null + +export function noteMacOffscreenFrameAck(count: unknown): void { + const session = activeMacSession + if (!session || typeof count !== 'number' || !Number.isFinite(count) || count <= 0) {return} + session.noteFrameAck(Math.min(1024, Math.round(count))) +} + +export function deliverMacOffscreenVideo(value: unknown, position: unknown): void { + const session = activeMacSession + if (!session || !ArrayBuffer.isView(value)) {return} + if (typeof position !== 'number' || !Number.isSafeInteger(position) || position < 0) {return} + session.appendVideoChunk(new Uint8Array(value.buffer, value.byteOffset, value.byteLength), position) +} + +export function deliverMacOffscreenVideoComplete(): void { + activeMacSession?.completeVideo() +} + +async function readFileSize(path: string): Promise { + return (await stat(path)).size +} + +function withOffscreenTimeout(task: Promise, timeoutMs: number, message: string): Promise { + return Promise.race([ + task, + new Promise((_resolveTimeout, rejectTimeout) => { + const timer = setTimeout(() => rejectTimeout(new Error(message)), timeoutMs) + timer.unref?.() + }) + ]) +} + +export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, host: OffscreenMacSessionHost): Promise { + return new Promise((resolve, reject) => { + let settled = false + let tempDir: string | null = null + let recorderWindow: BrowserWindow | null = null + let videoFile: FileHandle | null = null + let videoWrite = Promise.resolve() + let videoCompleteResolve: (() => void) | null = null + let videoCompleteReject: ((error: unknown) => void) | null = null + let pendingFrames = 0 + let frameDrainResolve: (() => void) | null = null + const release = (): void => { + host.clearCancelHook(cancel) + host.clearTeardownHook(teardown) + activeMacSession = null + host.dropWindow() + if (videoFile) {void videoFile.close().catch(() => {})} + if (tempDir) {void rm(tempDir, { recursive: true, force: true }).catch(() => {})} + } + const teardown = (): void => { + const pending = !settled + settled = true + host.clearCancelHook(cancel) + host.clearTeardownHook(teardown) + activeMacSession = null + host.dropWindow() + if (videoFile) {void videoFile.close().catch(() => {})} + const directory = tempDir + tempDir = null + if (directory) {rmSync(directory, { recursive: true, force: true })} + logger.info('recording', pending ? '应用退出,已中止离屏录制并清理临时文件' : '应用退出,已清理离屏录制临时文件') + if (pending) {resolve({ path: '', bytes: 0, cancelled: true })} + } + host.setTeardownHook(teardown) + const fail = (error: unknown): void => { + if (settled) {return} + settled = true + release() + reject(error instanceof Error ? error : new Error(String(error))) + } + const cancel = (): void => { + if (settled) {return} + settled = true + release() + logger.info('recording', '离屏录制已取消,未生成视频文件') + resolve({ path: '', bytes: 0, cancelled: true }) + } + host.resetPrewarnWarned() + host.setCancelHook(cancel) + activeMacSession = { + noteFrameAck: (count) => { + pendingFrames = Math.max(0, pendingFrames - count) + if (pendingFrames === 0) {frameDrainResolve?.()} + }, + appendVideoChunk: (bytes, position) => { + if (!videoFile) {return} + const copy = new Uint8Array(bytes) + videoWrite = videoWrite.then(() => videoFile!.write(copy, 0, copy.byteLength, position)).then(() => {}) + }, + completeVideo: () => { + void videoWrite.then(() => videoCompleteResolve?.(), (error) => videoCompleteReject?.(error)) + } + } + void (async () => { + const directory = await host.usableDirectory() + if (settled) {return} + if (!directory) {throw new Error('请先选择可用的视频保存文件夹')} + await host.sweepStaleDirectories(directory) + if (settled) {return} + const createdTempDir = await mkdtemp(recordingPath(directory, OFFSCREEN_TEMP_PREFIX)) + if (settled) { + void rm(createdTempDir, { recursive: true, force: true }).catch(() => {}) + return + } + tempDir = createdTempDir + await writeFile(recordingPath(tempDir, OFFSCREEN_OWNER_FILE), String(process.pid), 'utf8') + if (settled) {return} + const temporaryPath = recordingPath(tempDir, 'recording.mp4.part') + videoFile = await open(temporaryPath, 'w') + const now = new Date() + const pad = (value: number): string => String(value).padStart(2, '0') + const stamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}-${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}` + const outputPath = recordingPath(directory, `GuEarth-${stamp}-${randomUUID().slice(0, 8)}.mp4`) + const targetFps = script.fps + recorderWindow = new BrowserWindow({ + show: false, + width: script.width, + height: script.height, + webPreferences: { + preload: join(__dirname, '../preload/index.js'), + offscreen: true, + backgroundThrottling: false, + sandbox: false, + contextIsolation: true, + nodeIntegration: false + } + }) + const window = recorderWindow + host.adoptWindow(window) + window.webContents.on('render-process-gone', (_event, details) => { + fail(new Error(`离屏录制渲染进程异常退出(${details.reason})`)) + }) + window.on('unresponsive', () => { + fail(new Error('离屏录制渲染进程无响应,已中止录制')) + }) + host.resetPaintStats() + let capturing = false + let captureLogged = false + let recordingStartedAt = 0 + let frameIndex = 0 + window.webContents.on('paint', (_event, _dirty, image) => { + host.notePaintFrame() + if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) {return} + const size = image.getSize() + if (!captureLogged) { + captureLogged = true + logger.info('recording', `离屏采集 ${size.width}x${size.height},输出 ${script.width}x${script.height}`, `窗口 ${script.width}x${script.height}(未按工作区缩放)`) + if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) {logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配')} + } + const frame = image.toJPEG(95) + if (frame.length === 0) {return} + const captureTimeMs = Date.now() - recordingStartedAt + pendingFrames += 1 + window.webContents.send('recordings:offscreen-frame', frameIndex, captureTimeMs, frame) + frameIndex += 1 + }) + const ready = new Promise((resolveReady, rejectReady) => { + window.webContents.once('did-finish-load', () => resolveReady()) + window.webContents.once('did-fail-load', (_event, code, description) => rejectReady(new Error(`${code}: ${description}`))) + }) + const loading = process.env.ELECTRON_RENDERER_URL + ? window.loadURL(`${process.env.ELECTRON_RENDERER_URL}/offscreen.html`) + : window.loadFile(join(__dirname, '../renderer/offscreen.html')) + await Promise.all([loading, ready]) + if (settled) {return} + window.webContents.setFrameRate(targetFps) + const serialized = JSON.stringify(script).replaceAll('<', String.raw`\u003c`) + const encoderConfig = JSON.stringify({ width: script.width, height: script.height, framerate: targetFps, bitrate: OFFSCREEN_MAC_BITRATE }) + host.resetPaintStats() + window.webContents.startPainting() + await withOffscreenTimeout( + window.webContents.executeJavaScript(`window.guEarthOffscreenMacEncoder.begin(${encoderConfig})`), + OFFSCREEN_PREPARE_TIMEOUT_MS, + '离屏视频编码器初始化超时,已中止录制' + ) + if (settled) {return} + const prepareStartedAt = Date.now() + await withOffscreenTimeout( + window.webContents.executeJavaScript(`window.guEarthOffscreenRecorder.prepare(${serialized})`), + OFFSCREEN_PREPARE_TIMEOUT_MS, + '离屏渲染初始化超时,已中止录制' + ) + logger.info('recording', `离屏渲染准备完成,耗时 ${((Date.now() - prepareStartedAt) / 1000).toFixed(1)} 秒`) + if (settled) {return} + const captureBudgetMs = offscreenScriptDurationMs(script.scenes) + OFFSCREEN_PLAY_TIMEOUT_MARGIN_MS + host.resetPaintStats() + recordingStartedAt = Date.now() + capturing = true + await withOffscreenTimeout( + window.webContents.executeJavaScript(`window.guEarthOffscreenRecorder.play(${serialized})`), + captureBudgetMs, + '离屏渲染超时,已中止录制' + ) + const recordingElapsedMs = Math.max(1, Date.now() - recordingStartedAt) + capturing = false + if (settled) {return} + window.webContents.stopPainting() + await new Promise((resolveDrain) => { + if (pendingFrames === 0) { + resolveDrain() + return + } + const timer = setTimeout(() => { + frameDrainResolve = null + if (!settled) {logger.warn('recording', '部分离屏帧尚未送达编码页,已按已到达帧继续编码')} + resolveDrain() + }, OFFSCREEN_ACK_DRAIN_TIMEOUT_MS) + timer.unref?.() + frameDrainResolve = (): void => { + clearTimeout(timer) + frameDrainResolve = null + resolveDrain() + } + }) + if (settled) {return} + if (frameIndex === 0) { + fail(new Error('离屏渲染未产生有效视频帧')) + return + } + const measuredFps = offscreenFrameRate(frameIndex, recordingElapsedMs) + logger.info('recording', `离屏录制 ${frameIndex} 帧 / ${(recordingElapsedMs / 1000).toFixed(1)} 秒,实测约 ${measuredFps.toFixed(1)} FPS`) + if (measuredFps < OFFSCREEN_MIN_FLUENT_FPS) {logger.warn('recording', `离屏采集帧率偏低(${measuredFps.toFixed(1)} FPS),画面可能不够流畅`)} + const videoReady = new Promise((resolveVideo, rejectVideo) => { + videoCompleteResolve = resolveVideo + videoCompleteReject = rejectVideo + }) + const encodeBudgetMs = Math.max(OFFSCREEN_ENCODE_TIMEOUT_MS, frameIndex * OFFSCREEN_ENCODE_MS_PER_FRAME) + await Promise.all([ + withOffscreenTimeout( + window.webContents.executeJavaScript('window.guEarthOffscreenMacEncoder.finish()'), + encodeBudgetMs, + '离屏视频编码超时,已中止录制' + ), + withOffscreenTimeout(videoReady, encodeBudgetMs, '离屏视频编码超时,已中止录制') + ]) + if (settled) {return} + await videoWrite + await videoFile?.close() + videoFile = null + const bytes = await readFileSize(temporaryPath) + if (settled) {return} + await renameFile(temporaryPath, outputPath) + if (settled) { + await rm(outputPath, { force: true }).catch(() => {}) + return + } + await rm(tempDir, { recursive: true, force: true }).catch(() => {}) + if (settled) { + await rm(outputPath, { force: true }).catch(() => {}) + return + } + settled = true + host.clearCancelHook(cancel) + host.clearTeardownHook(teardown) + activeMacSession = null + tempDir = null + host.dropWindow() + logger.info('recording', `离屏录制完成:${outputPath}`, `${(bytes / 1024 / 1024).toFixed(1)} MB`) + shell.showItemInFolder(outputPath) + resolve({ path: outputPath, bytes, fps: measuredFps }) + })().catch((error) => fail(error)) + }) +} diff --git a/src/main/offscreenPaths.ts b/src/main/offscreenPaths.ts index a56ef489..7d30dedb 100644 --- a/src/main/offscreenPaths.ts +++ b/src/main/offscreenPaths.ts @@ -1,11 +1,11 @@ import { isAbsolute, relative, resolve, sep } from 'node:path' export function resolveOffscreenEntry(directory: string, name: string): string | null { - if (!name || name.includes('/') || name.includes('\\')) return null - if (isAbsolute(name)) return null + if (!name || name.includes('/') || name.includes('\\')) {return null} + if (isAbsolute(name)) {return null} const base = resolve(directory) const candidate = resolve(base, name) const within = relative(base, candidate) - if (!within || within === '..' || within.startsWith(`..${sep}`) || isAbsolute(within)) return null + if (!within || within === '..' || within.startsWith(`..${sep}`) || isAbsolute(within)) {return null} return candidate } diff --git a/src/main/offscreenTiming.ts b/src/main/offscreenTiming.ts index e25e3aa4..feeca304 100644 --- a/src/main/offscreenTiming.ts +++ b/src/main/offscreenTiming.ts @@ -8,8 +8,8 @@ export function offscreenScriptDurationMs(scenes: OffscreenSceneTiming[]): numbe } export function offscreenFrameRate(frameCount: number, elapsedMs: number): number { - if (!Number.isFinite(frameCount) || frameCount <= 0) return 1 - if (!Number.isFinite(elapsedMs) || elapsedMs <= 0) return 1 + if (!Number.isFinite(frameCount) || frameCount <= 0) {return 1} + if (!Number.isFinite(elapsedMs) || elapsedMs <= 0) {return 1} return Math.max(1, frameCount * 1000 / elapsedMs) } @@ -49,7 +49,7 @@ export function offscreenConcatPlaylist(frameNames: string[], durations: number[ lines.push(`option framerate ${concatFileFramerate}`) lines.push(`duration ${(durations[index] ?? 1 / 30).toFixed(6)}`) }) - if (frameNames.length) { + if (frameNames.length > 0) { lines.push(`file '${frameNames[frameNames.length - 1]}'`) lines.push(`option framerate ${concatFileFramerate}`) } diff --git a/src/main/onlineData.ts b/src/main/onlineData.ts index 2f1a7570..78dca800 100644 --- a/src/main/onlineData.ts +++ b/src/main/onlineData.ts @@ -1,5 +1,5 @@ -import { createHash } from 'crypto' -import { join } from 'path' +import { createHash } from 'node:crypto' +import { join } from 'node:path' import type { EarthquakeFeed } from '../preload' import type { OnlineDataSnapshot, TyphoonFeed } from '../common/onlineData' import { loadEarthquakeFeed } from './datasets' @@ -29,14 +29,14 @@ async function loadTyphoons(signal: AbortSignal): Promise { let cached: TyphoonFeed | null = null try { const credentials = getQWeatherCredentials() - if (!credentials) return { typhoons: null, typhoonError: '', typhoonConfigured: false, typhoonStatus: 'unconfigured' } + if (!credentials) {return { typhoons: null, typhoonError: '', typhoonConfigured: false, typhoonStatus: 'unconfigured' }} const hostId = createHash('sha256').update(credentials.apiHost).digest('hex').slice(0, 16) const cachePath = join(dataPath, `typhoons-${hostId}.json`) cached = parseCachedTyphoons(await readJson(cachePath).catch(() => null)) signal.throwIfAborted() const typhoons = await fetchTyphoonFeed(credentials, signal) signal.throwIfAborted() - await writeJson(cachePath, typhoons).catch(() => undefined) + await writeJson(cachePath, typhoons).catch(() => {}) return { typhoons, typhoonError: '', typhoonConfigured: true, typhoonStatus: 'ready' } } catch (error) { return { typhoons: cached, typhoonError: error instanceof Error ? error.message : '台风数据获取失败', typhoonConfigured: true, typhoonStatus: 'error' } @@ -51,13 +51,13 @@ export function invalidateTyphoons(configured: boolean): void { } export function ensureTyphoons(retry = false): Promise { - if (typhoonRequest) return typhoonRequest - if (snapshot.typhoonStatus !== 'pending' && !(retry && snapshot.typhoonStatus === 'error')) return Promise.resolve(snapshot) + if (typhoonRequest) {return typhoonRequest} + if (snapshot.typhoonStatus !== 'pending' && !(retry && snapshot.typhoonStatus === 'error')) {return Promise.resolve(snapshot)} const controller = new AbortController() typhoonController = controller publish({ typhoonStatus: 'loading' }) const request = loadTyphoons(controller.signal).then((typhoons) => { - if (!controller.signal.aborted) publish(typhoons) + if (!controller.signal.aborted) {publish(typhoons)} return snapshot }).finally(() => { if (typhoonRequest === request) { @@ -83,19 +83,19 @@ export function startOnlineData(userDataPath: string, listener: (snapshot: Onlin } export async function getOnlineData(): Promise { - if (!startupData) throw new Error('在线数据尚未初始化') + if (!startupData) {throw new Error('在线数据尚未初始化')} await startupData return snapshot } export async function getStartupEarthquakes(): Promise { const data = await getOnlineData() - if (!data.earthquakes) throw new Error(data.earthquakeError) + if (!data.earthquakes) {throw new Error(data.earthquakeError)} return data.earthquakes } export function refreshEarthquakes(): Promise { - if (earthquakeRequest) return earthquakeRequest + if (earthquakeRequest) {return earthquakeRequest} const request = loadEarthquakeFeed().then((earthquakes) => { publish({ earthquakes, earthquakeError: earthquakes.stale ? '地震数据更新失败,暂显示上次数据' : '' }) return earthquakes @@ -103,7 +103,7 @@ export function refreshEarthquakes(): Promise { publish({ earthquakeError: '地震数据更新失败,请检查网络后重试' }) throw error instanceof Error ? error : new Error('地震数据更新失败,请检查网络后重试') }).finally(() => { - if (earthquakeRequest === request) earthquakeRequest = null + if (earthquakeRequest === request) {earthquakeRequest = null} }) earthquakeRequest = request return request diff --git a/src/main/posthogLogs.ts b/src/main/posthogLogs.ts index 51811832..417e33ad 100644 --- a/src/main/posthogLogs.ts +++ b/src/main/posthogLogs.ts @@ -1,6 +1,7 @@ import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http' import { resourceFromAttributes } from '@opentelemetry/resources' -import { BatchLogRecordProcessor, LoggerProvider, type LogRecordExporter } from '@opentelemetry/sdk-logs' +import { BatchLogRecordProcessor, LoggerProvider } from '@opentelemetry/sdk-logs'; +import type { LogRecordExporter } from '@opentelemetry/sdk-logs'; const viteEnv = import.meta.env as Partial | undefined const projectToken = (viteEnv ? import.meta.env.VITE_POSTHOG_PROJECT_TOKEN : undefined) || process.env.VITE_POSTHOG_PROJECT_TOKEN @@ -20,13 +21,14 @@ export function createGatedLogRecordExporter( return { export(logs, resultCallback) { if (!isEnabled()) { + // oxlint-disable-next-line typescript/no-unsafe-enum-assignment -- 0 is `ExportResultCode.SUCCESS`, and `@opentelemetry/core` is not a direct dependency resultCallback({ code: 0 }) return } exporter.export(logs, resultCallback) }, forceFlush() { - if (!isEnabled()) return Promise.resolve() + if (!isEnabled()) {return Promise.resolve()} return exporter.forceFlush() }, shutdown() { @@ -36,12 +38,12 @@ export function createGatedLogRecordExporter( } function ensureLogger(): ReturnType | null { - if (!posthogLogsEnabled) return null - if (posthogLogger) return posthogLogger + if (!posthogLogsEnabled) {return null} + if (posthogLogger) {return posthogLogger} if (!projectToken || !host) { if (!missingWarned && isDev) { missingWarned = true - const missingConfiguration = !projectToken ? 'VITE_POSTHOG_PROJECT_TOKEN' : 'VITE_POSTHOG_HOST' + const missingConfiguration = projectToken ? 'VITE_POSTHOG_HOST' : 'VITE_POSTHOG_PROJECT_TOKEN' console.warn(`${missingConfiguration} variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once ${missingConfiguration} is configured`) } return null @@ -65,7 +67,7 @@ function ensureLogger(): ReturnType | null { activeExporterController = controller posthogLogger = provider.getLogger('guearth.posthog') } catch (error) { - if (isDev) console.warn('PostHog log export could not be initialized', error) + if (isDev) {console.warn('PostHog log export could not be initialized', error)} } return posthogLogger } @@ -80,7 +82,7 @@ export function setPosthogLogsEnabled(enabled: boolean): void { const activeProvider = provider provider = null posthogLogger = null - if (activeProvider) void activeProvider.shutdown().catch(() => undefined) + if (activeProvider) {void activeProvider.shutdown().catch(() => {})} return } ensureLogger() @@ -92,18 +94,18 @@ export function capturePosthogLog( attributes?: Record ): void { const activeLogger = ensureLogger() - if (!activeLogger) return + if (!activeLogger) {return} try { activeLogger.emit({ severityText, body, attributes }) } catch { - return + // Best effort, so the failure is ignored. } } export async function shutdownPosthogLogs(): Promise { const activeProvider = provider const controller = activeExporterController - if (!activeProvider) return + if (!activeProvider) {return} provider = null posthogLogger = null activeExporterController = null @@ -112,14 +114,14 @@ export async function shutdownPosthogLogs(): Promise { await Promise.race([ activeProvider.shutdown(), new Promise((resolve) => { - timeout = setTimeout(resolve, 1_000) + timeout = setTimeout(resolve, 1000) timeout.unref() }) ]) } catch { - return + // Best effort, so the failure is ignored. } finally { - if (controller) controller.active = false - if (timeout) clearTimeout(timeout) + if (controller) {controller.active = false} + if (timeout) {clearTimeout(timeout)} } } diff --git a/src/main/qweather.ts b/src/main/qweather.ts index 93649f63..d564336c 100644 --- a/src/main/qweather.ts +++ b/src/main/qweather.ts @@ -1,5 +1,6 @@ import { net } from 'electron' -import { normalizeQWeatherHost, type LiveStorm, type StormPoint, type TyphoonFeed } from '../common/onlineData' +import { normalizeQWeatherHost } from '../common/onlineData'; +import type { LiveStorm, StormPoint, TyphoonFeed } from '../common/onlineData'; import type { QWeatherCredentials } from './laboratory' function isRecord(value: unknown): value is Record { @@ -7,18 +8,18 @@ function isRecord(value: unknown): value is Record { } function numberValue(value: unknown): number | null { - if ((typeof value !== 'string' && typeof value !== 'number') || String(value).trim() === '') return null + if ((typeof value !== 'string' && typeof value !== 'number') || String(value).trim() === '') {return null} const number = Number(value) return Number.isFinite(number) ? number : null } function parsePoint(value: unknown, timeKey: 'time' | 'pubTime' | 'fxTime'): StormPoint { - if (!isRecord(value)) throw new Error('和风天气台风路径格式无效') + if (!isRecord(value)) {throw new Error('和风天气台风路径格式无效')} const longitude = numberValue(value.lon) const latitude = numberValue(value.lat) const time = value[timeKey] if (longitude === null || latitude === null || Math.abs(longitude) > 180 || Math.abs(latitude) > 90 - || typeof time !== 'string' || !Number.isFinite(Date.parse(time))) throw new Error('和风天气台风坐标或时间无效') + || typeof time !== 'string' || !Number.isFinite(Date.parse(time))) {throw new Error('和风天气台风坐标或时间无效')} const pressure = numberValue(value.pressure) const windSpeed = numberValue(value.windSpeed) return { @@ -30,23 +31,23 @@ function parsePoint(value: unknown, timeKey: 'time' | 'pubTime' | 'fxTime'): Sto } function parsePoints(value: unknown, timeKey: 'time' | 'fxTime'): StormPoint[] { - if (!Array.isArray(value) || value.length > 5000) throw new Error('和风天气台风路径格式无效') + if (!Array.isArray(value) || value.length > 5000) {throw new Error('和风天气台风路径格式无效')} const points = value.map((point) => parsePoint(point, timeKey)) return [...new Map(points.map((point) => [point.time, point])).values()].sort((a, b) => Date.parse(a.time) - Date.parse(b.time)) } -export function parseStormList(value: unknown): Array<{ id: string; name: string }> { - if (!Array.isArray(value) || value.length > 200) throw new Error('和风天气台风列表格式无效') +export function parseStormList(value: unknown): { id: string; name: string }[] { + if (!Array.isArray(value) || value.length > 200) {throw new Error('和风天气台风列表格式无效')} return value.flatMap((storm) => { if (!isRecord(storm) || !['0', '1'].includes(String(storm.isActive)) || typeof storm.id !== 'string' - || !/^[a-z0-9_-]{1,64}$/i.test(storm.id)) throw new Error('和风天气台风列表格式无效') - if (String(storm.isActive) !== '1') return [] + || !/^[a-z0-9_-]{1,64}$/i.test(storm.id)) {throw new Error('和风天气台风列表格式无效')} + if (String(storm.isActive) !== '1') {return []} return [{ id: storm.id, name: typeof storm.name === 'string' && storm.name ? storm.name.slice(0, 100) : storm.id }] }) } export function parseStormTrack(id: string, name: string, value: unknown): LiveStorm { - if (!isRecord(value) || !['0', '1'].includes(String(value.isActive))) throw new Error('和风天气台风实况格式无效') + if (!isRecord(value) || !['0', '1'].includes(String(value.isActive))) {throw new Error('和风天气台风实况格式无效')} return { id, name, active: String(value.isActive) === '1', now: value.now == null ? null : parsePoint(value.now, 'pubTime'), @@ -74,32 +75,32 @@ function apiError(code: string): Error { export async function fetchTyphoonFeed(credentials: QWeatherCredentials, cancellation?: AbortSignal): Promise { const host = normalizeQWeatherHost(credentials.apiHost) const controller = new AbortController() - const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(20000), ...(cancellation ? [cancellation] : [])]) + const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(20_000), ...(cancellation ? [cancellation] : [])]) const sources = new Set() const license = new Set() async function request(endpoint: string, params: Record): Promise> { signal.throwIfAborted() let response: Response try { - response = await net.fetch(`https://${host}/v7/tropical/${endpoint}?${new URLSearchParams({ ...params, unit: 'm' })}`, { + response = await net.fetch(`https://${host}/v7/tropical/${endpoint}?${new URLSearchParams({ ...params, unit: 'm' }).toString()}`, { headers: { 'X-QW-Api-Key': credentials.apiKey }, redirect: 'error', signal }) } catch { throw new Error(signal.aborted ? '请求超时,请重试' : '连接失败,请检查网络或配置') } - if (!response.ok) throw apiError(String(response.status)) - if (response.status === 204) return { storm: [], forecast: [] } + if (!response.ok) {throw apiError(String(response.status))} + if (response.status === 204) {return { storm: [], forecast: [] }} const body = await response.text() - if (body.length > 5_000_000) throw new Error('返回数据异常') + if (body.length > 5_000_000) {throw new Error('返回数据异常')} let data: unknown try { data = JSON.parse(body) } catch { throw new Error('返回数据异常') } - if (!isRecord(data)) throw new Error('返回数据异常') + if (!isRecord(data)) {throw new Error('返回数据异常')} const code = String(data.code) - if (code === '204') return { storm: [], forecast: [] } - if (code !== '200') throw apiError(code) + if (code === '204') {return { storm: [], forecast: [] }} + if (code !== '200') {throw apiError(code)} if (isRecord(data.refer)) { - strings(data.refer.sources).forEach((source) => sources.add(source)) - strings(data.refer.license).forEach((item) => license.add(item)) + strings(data.refer.sources).forEach((source) => { sources.add(source) }) + strings(data.refer.license).forEach((item) => { license.add(item) }) } return data } @@ -132,15 +133,15 @@ export async function fetchTyphoonFeed(credentials: QWeatherCredentials, cancell export function parseCachedTyphoons(value: unknown): TyphoonFeed | null { if (!isRecord(value) || typeof value.fetchedAt !== 'number' || !Number.isFinite(value.fetchedAt) - || !Array.isArray(value.storms) || value.storms.length > 200) return null + || !Array.isArray(value.storms) || value.storms.length > 200) {return null} try { const fromCachedPoint = (point: unknown): StormPoint => { - if (!isRecord(point)) throw new Error('无效缓存') + if (!isRecord(point)) {throw new Error('无效缓存')} return parsePoint({ ...point, lon: point.longitude, lat: point.latitude }, 'time') } const storms: LiveStorm[] = value.storms.map((storm) => { if (!isRecord(storm) || typeof storm.id !== 'string' || typeof storm.name !== 'string' || typeof storm.active !== 'boolean' - || !Array.isArray(storm.track) || !Array.isArray(storm.forecast) || storm.track.length > 5000 || storm.forecast.length > 5000) throw new Error('无效缓存') + || !Array.isArray(storm.track) || !Array.isArray(storm.forecast) || storm.track.length > 5000 || storm.forecast.length > 5000) {throw new Error('无效缓存')} return { id: storm.id, name: storm.name, active: storm.active, now: storm.now === null ? null : fromCachedPoint(storm.now), track: storm.track.map(fromCachedPoint), forecast: storm.forecast.map(fromCachedPoint), diff --git a/src/main/storagePath.ts b/src/main/storagePath.ts index 1d647ff7..ce9075bf 100644 --- a/src/main/storagePath.ts +++ b/src/main/storagePath.ts @@ -1,7 +1,7 @@ -import { isAbsolute, join, normalize, relative } from 'path' +import { isAbsolute, join, normalize, relative } from 'node:path' function sanitizeStorageRoot(value: string): string { - if (!isAbsolute(value) || value.includes('\0')) throw new Error('Invalid storage directory') + if (!isAbsolute(value) || value.includes('\0')) {throw new Error('Invalid storage directory')} return normalize(value) } @@ -13,11 +13,11 @@ function sanitizeStorageSegment(value: string): string { } export function storageChildPath(directory: string, ...segments: string[]): string { - if (!segments.length) throw new Error('Missing storage path segment') + if (segments.length === 0) {throw new Error('Missing storage path segment')} const root = sanitizeStorageRoot(directory) let result = root - for (const segment of segments) result = join(result, sanitizeStorageSegment(segment)) + for (const segment of segments) {result = join(result, sanitizeStorageSegment(segment))} const child = relative(root, result) - if (!child || child.startsWith('..') || isAbsolute(child)) throw new Error('Storage path escapes its directory') + if (!child || child.startsWith('..') || isAbsolute(child)) {throw new Error('Storage path escapes its directory')} return result } diff --git a/src/main/tileCacheFiles.ts b/src/main/tileCacheFiles.ts index f30d52b8..8962544e 100644 --- a/src/main/tileCacheFiles.ts +++ b/src/main/tileCacheFiles.ts @@ -1,5 +1,5 @@ -import { readdir, stat, unlink } from 'fs/promises' -import { sep } from 'path' +import { readdir, stat, unlink } from 'node:fs/promises' +import { sep } from 'node:path' interface TileFile { path: string @@ -10,7 +10,7 @@ interface TileFile { export async function listTileFiles(directory: string): Promise { const files: TileFile[] = [] const pending = [directory] - while (pending.length) { + while (pending.length > 0) { const current = pending.pop()! let entries try { @@ -19,7 +19,7 @@ export async function listTileFiles(directory: string): Promise { continue } for (const entry of entries) { - if (entry.name === '.' || entry.name === '..' || entry.name.includes('/') || entry.name.includes('\\')) continue + if (entry.name === '.' || entry.name === '..' || entry.name.includes('/') || entry.name.includes('\\')) {continue} const path = `${current}${sep}${entry.name}` if (entry.isDirectory()) { pending.push(path) @@ -48,13 +48,13 @@ export async function pruneTileFiles(directory: string, maxBytes: number): Promi } const oldestFirst = [...tiles.values()].sort((a, b) => Math.max(...a.map((file) => file.mtimeMs)) - Math.max(...b.map((file) => file.mtimeMs))) for (const pair of oldestFirst) { - if (total <= maxBytes) break + if (total <= maxBytes) {break} for (const file of pair) { try { await unlink(file.path) total -= file.size } catch (error) { - if ((error as NodeJS.ErrnoException).code === 'ENOENT') total -= file.size + if ((error as NodeJS.ErrnoException).code === 'ENOENT') {total -= file.size} } } } diff --git a/src/main/tileWarp.ts b/src/main/tileWarp.ts index 16388473..178fdae6 100644 --- a/src/main/tileWarp.ts +++ b/src/main/tileWarp.ts @@ -1,5 +1,5 @@ import { nativeImage } from 'electron' -import { endianness } from 'os' +import { endianness } from 'node:os' import { tileCenter, wgs84ToGcj02 } from './geo' const TILE_SIZE = 256 @@ -28,16 +28,16 @@ export function tileWgs84ShiftPixels(level: number, x: number, y: number): { dx: const [gcjLongitude, gcjLatitude] = wgs84ToGcj02(longitude, latitude) const deltaLongitude = gcjLongitude - longitude const deltaLatitude = gcjLatitude - latitude - if (deltaLongitude === 0 && deltaLatitude === 0) return null + if (deltaLongitude === 0 && deltaLatitude === 0) {return null} const worldPixels = TILE_SIZE * 2 ** level const dx = (deltaLongitude / 360) * worldPixels const dy = mercatorYFromLatitude(latitude + deltaLatitude, worldPixels) - mercatorYFromLatitude(latitude, worldPixels) - if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) return null + if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) {return null} return { dx, dy } } function swapRedBlueChannels(pixels: Buffer): void { - if (!NATIVE_BITMAP_IS_BGRA) return + if (!NATIVE_BITMAP_IS_BGRA) {return} for (let offset = 0; offset < pixels.length; offset += 4) { const first = pixels[offset] pixels[offset] = pixels[offset + 2] @@ -47,9 +47,9 @@ function swapRedBlueChannels(pixels: Buffer): void { function decodeTilePixels(tile: WarpSourceTile): Buffer | null { const image = nativeImage.createFromBuffer(Buffer.from(tile.buffer)) - if (image.isEmpty()) return null + if (image.isEmpty()) {return null} const size = image.getSize() - if (size.width !== TILE_SIZE || size.height !== TILE_SIZE) return null + if (size.width !== TILE_SIZE || size.height !== TILE_SIZE) {return null} const pixels = image.toBitmap() swapRedBlueChannels(pixels) return pixels @@ -61,7 +61,7 @@ function bufferToArrayBuffer(data: Buffer): ArrayBuffer { export async function warpTileToWgs84(level: number, x: number, y: number, fetchSourceTile: WarpSourceFetcher): Promise { const shift = tileWgs84ShiftPixels(level, x, y) - if (!shift) return null + if (!shift) {return null} const worldTiles = 2 ** level const baseX = x * TILE_SIZE const baseY = y * TILE_SIZE @@ -87,11 +87,11 @@ export async function warpTileToWgs84(level: number, x: number, y: number, fetch let contentType: string | null = null for (let index = 0; index < fetched.length; index += 1) { const tile = fetched[index] - if (!tile) return null + if (!tile) {return null} const pixels = decodeTilePixels(tile) - if (!pixels) return null - if (tile.contentType.includes('png')) contentType = 'image/png' - else if (contentType === null) contentType = 'image/jpeg' + if (!pixels) {return null} + if (tile.contentType.includes('png')) {contentType = 'image/png'} + else if (contentType === null) {contentType = 'image/jpeg'} const canvasX = (index % columns) * TILE_SIZE const canvasY = Math.floor(index / columns) * TILE_SIZE for (let line = 0; line < TILE_SIZE; line += 1) { @@ -182,7 +182,7 @@ export async function warpTileToWgs84(level: number, x: number, y: number, fetch } swapRedBlueChannels(output) const image = nativeImage.createFromBitmap(output, { width: TILE_SIZE, height: TILE_SIZE }) - if (image.isEmpty()) return null + if (image.isEmpty()) {return null} const data = contentType === 'image/png' ? image.toPNG() : image.toJPEG(92) return { data: bufferToArrayBuffer(data), contentType: contentType ?? 'image/png' } } diff --git a/src/main/updateChannel.ts b/src/main/updateChannel.ts index dd5cdf9f..17060587 100644 --- a/src/main/updateChannel.ts +++ b/src/main/updateChannel.ts @@ -1,5 +1,5 @@ -import { chmodSync, copyFileSync, linkSync, lstatSync, realpathSync, renameSync, rmSync } from 'fs' -import { basename, dirname, isAbsolute, join, resolve, sep } from 'path' +import { chmodSync, copyFileSync, linkSync, lstatSync, realpathSync, renameSync, rmSync } from 'node:fs' +import { basename, dirname, isAbsolute, join, resolve, sep } from 'node:path' const SAFE_ASSET_NAME = /^[A-Za-z0-9][A-Za-z0-9._+-]*$/ const VERSIONED_FILE_NAME = /\d+\.\d+\.\d+/ @@ -54,9 +54,9 @@ export interface CommandPlan { } export function canonicalHazelPlatform(platform: string): string | null { - if (Object.prototype.hasOwnProperty.call(HAZEL_ALIASES, platform)) return platform + if (Object.hasOwn(HAZEL_ALIASES, platform)) {return platform} for (const [guess, aliases] of Object.entries(HAZEL_ALIASES)) { - if (aliases.includes(platform)) return guess + if (aliases.includes(platform)) {return guess} } return null } @@ -65,25 +65,25 @@ export function hazelPlatformForAssetName(fileName: string): string | null { const slash = Math.max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\')) const base = slash >= 0 ? fileName.slice(slash + 1) : fileName const dot = base.lastIndexOf('.') - if (dot <= 0) return null + if (dot <= 0) {return null} const extension = base.slice(dot + 1) - if (!HAZEL_EXTENSIONS.has(extension)) return null + if (!HAZEL_EXTENSIONS.has(extension)) {return null} const archSuffix = base.includes('arm64') || base.includes('aarch64') ? '_arm64' : '' return `${extension}${archSuffix}` } export function assetNameFromUrl(downloadUrl: string): string | null { - let pathname = '' + let pathname: string try { const parsed = new URL(downloadUrl) - if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') return null + if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {return null} pathname = parsed.pathname } catch { return null } const raw = pathname.split('/').pop() ?? '' - if (!raw) return null - let name = '' + if (!raw) {return null} + let name: string try { name = decodeURIComponent(raw) } catch { @@ -103,44 +103,44 @@ export function updateFeedPath(baseUrl: string, feedPlatform: string, currentVer } export function feedPlatformFor(kind: UpdatePackageKind, arch: UpdateArch): string | null { - if (kind === 'nsis' && arch === 'x64') return 'win32' - if (kind === 'appimage' && arch === 'x64') return 'appimage' - if (kind === 'appimage' && arch === 'arm64') return 'appimage_arm64' - if (kind === 'deb' && arch === 'x64') return 'deb' - if (kind === 'deb' && arch === 'arm64') return 'deb_arm64' + if (kind === 'nsis' && arch === 'x64') {return 'win32'} + if (kind === 'appimage' && arch === 'x64') {return 'appimage'} + if (kind === 'appimage' && arch === 'arm64') {return 'appimage_arm64'} + if (kind === 'deb' && arch === 'x64') {return 'deb'} + if (kind === 'deb' && arch === 'arm64') {return 'deb_arm64'} return null } function asArch(arch: string): UpdateArch | null { - if (arch === 'x64' || arch === 'arm64') return arch + if (arch === 'x64' || arch === 'arm64') {return arch} return null } export function resolveLinuxPackageKind(runtime: UpdateRuntime): 'appimage' | 'deb' | null { const override = runtime.packageKindOverride?.trim() - if (runtime.allowPackageKindOverride && (override === 'appimage' || override === 'deb')) return override - if (runtime.appImagePath && runtime.appImagePath.trim()) return 'appimage' - if (runtime.debInstalled) return 'deb' + if (runtime.allowPackageKindOverride && (override === 'appimage' || override === 'deb')) {return override} + if (runtime.appImagePath?.trim()) {return 'appimage'} + if (runtime.debInstalled) {return 'deb'} return null } export function resolveUpdateTarget(runtime: UpdateRuntime): UpdateTarget | null { const arch = asArch(runtime.arch) - if (!arch) return null + if (!arch) {return null} if (runtime.platform === 'win32') { - if (arch !== 'x64') return null + if (arch !== 'x64') {return null} return { kind: 'nsis', arch, feedPlatform: 'win32' } } - if (runtime.platform !== 'linux') return null + if (runtime.platform !== 'linux') {return null} const kind = resolveLinuxPackageKind(runtime) - if (!kind) return null + if (!kind) {return null} const feedPlatform = feedPlatformFor(kind, arch) - if (!feedPlatform) return null + if (!feedPlatform) {return null} return { kind, arch, feedPlatform } } export function isPathInsideDirectory(filePath: string, directory: string): boolean { - if (!filePath || !directory) return false + if (!filePath || !directory) {return false} const root = resolve(directory) const target = resolve(filePath) const prefix = root.endsWith(sep) ? root : `${root}${sep}` @@ -148,17 +148,17 @@ export function isPathInsideDirectory(filePath: string, directory: string): bool } export function appImageInstallDestination(currentPath: string, assetFileName: string): string | null { - if (!isAbsolute(currentPath) || currentPath.includes('\0')) return null - if (!SAFE_ASSET_NAME.test(assetFileName)) return null + if (!isAbsolute(currentPath) || currentPath.includes('\0')) {return null} + if (!SAFE_ASSET_NAME.test(assetFileName)) {return null} const existingBaseName = basename(currentPath) - if (existingBaseName === assetFileName || !VERSIONED_FILE_NAME.test(existingBaseName)) return currentPath + if (existingBaseName === assetFileName || !VERSIONED_FILE_NAME.test(existingBaseName)) {return currentPath} return join(dirname(currentPath), assetFileName) } export function installAppImageFile(installerPath: string, currentAppImage: string, assetFileName: string): string { - if (!ABSOLUTE_PATH.test(installerPath)) throw new Error('更新包路径无效') + if (!ABSOLUTE_PATH.test(installerPath)) {throw new Error('更新包路径无效')} const destination = appImageInstallDestination(currentAppImage, assetFileName) - if (!destination) throw new Error('AppImage 路径无效,无法安装更新') + if (!destination) {throw new Error('AppImage 路径无效,无法安装更新')} chmodSync(installerPath, 0o755) const staged = join(dirname(destination), `.${basename(destination)}.update`) rmSync(staged, { force: true }) @@ -173,37 +173,37 @@ export function installAppImageFile(installerPath: string, currentAppImage: stri } catch (error) { rmSync(staged, { force: true }) const reason = error instanceof Error ? error.message : String(error) - throw new Error(`无法替换 AppImage:${reason}`) + throw new Error(`无法替换 AppImage:${reason}`, { cause: error }) } chmodSync(destination, 0o755) - if (installerPath !== destination) rmSync(installerPath, { force: true }) - if (destination !== currentAppImage) rmSync(currentAppImage, { force: true }) + if (installerPath !== destination) {rmSync(installerPath, { force: true })} + if (destination !== currentAppImage) {rmSync(currentAppImage, { force: true })} return destination } function isTrustedDebTool(filePath: string | null, name: string): filePath is string { - if (!filePath || !ABSOLUTE_PATH.test(filePath)) return false + if (!filePath || !ABSOLUTE_PATH.test(filePath)) {return false} return basename(filePath) === name && TRUSTED_EXECUTABLE_DIRS.includes(dirname(filePath)) } export function findTrustedExecutable(name: string, directories: readonly string[] = TRUSTED_EXECUTABLE_DIRS): string | null { - if (!TRUSTED_DEB_TOOLS.has(name)) return null + if (!TRUSTED_DEB_TOOLS.has(name)) {return null} const seen = new Set() for (const dir of directories) { - if (!isAbsolute(dir) || dir.includes('\0')) continue + if (!isAbsolute(dir) || dir.includes('\0')) {continue} let root: string try { root = realpathSync(dir) } catch { continue } - if (seen.has(root)) continue + if (seen.has(root)) {continue} seen.add(root) const candidate = join(root, name) try { - if (!lstatSync(candidate).isFile()) continue + if (!lstatSync(candidate).isFile()) {continue} const real = realpathSync(candidate) - if (dirname(real) !== root || basename(real) !== name) continue + if (dirname(real) !== root || basename(real) !== name) {continue} return real } catch { void 0 @@ -213,9 +213,9 @@ export function findTrustedExecutable(name: string, directories: readonly string } export function debInstallPlan(installerPath: string, uid: number, dpkgPath: string | null, pkexecPath: string | null): CommandPlan | null { - if (!ABSOLUTE_PATH.test(installerPath)) return null - if (!isTrustedDebTool(dpkgPath, 'dpkg')) return null - if (uid === 0) return { command: dpkgPath, args: ['-i', installerPath] } - if (!isTrustedDebTool(pkexecPath, 'pkexec')) return null + if (!ABSOLUTE_PATH.test(installerPath)) {return null} + if (!isTrustedDebTool(dpkgPath, 'dpkg')) {return null} + if (uid === 0) {return { command: dpkgPath, args: ['-i', installerPath] }} + if (!isTrustedDebTool(pkexecPath, 'pkexec')) {return null} return { command: pkexecPath, args: ['--disable-internal-agent', dpkgPath, '-i', installerPath] } } diff --git a/src/main/updateIntegrity.ts b/src/main/updateIntegrity.ts index dfb76505..482b528d 100644 --- a/src/main/updateIntegrity.ts +++ b/src/main/updateIntegrity.ts @@ -1,21 +1,21 @@ -import { createHash } from 'crypto' -import { createReadStream } from 'fs' +import { createHash } from 'node:crypto' +import { createReadStream } from 'node:fs' const SHA256_HEX_PATTERN = /^[0-9a-f]{64}$/ const SHA256_BASE64_PATTERN = /^[A-Za-z0-9+/]{43}=$/ function stripSha256Prefix(value: string): { prefixed: boolean; value: string } { const lowered = value.toLowerCase() - if (lowered.startsWith('sha256-')) return { prefixed: true, value: value.slice('sha256-'.length) } - if (lowered.startsWith('sha256:')) return { prefixed: true, value: value.slice('sha256:'.length) } + if (lowered.startsWith('sha256-')) {return { prefixed: true, value: value.slice('sha256-'.length) }} + if (lowered.startsWith('sha256:')) {return { prefixed: true, value: value.slice('sha256:'.length) }} return { prefixed: false, value } } export function parseSha256(raw: unknown): string | null { - if (typeof raw !== 'string') return null + if (typeof raw !== 'string') {return null} const { prefixed, value } = stripSha256Prefix(raw.trim()) const lowered = value.toLowerCase() - if (SHA256_HEX_PATTERN.test(lowered)) return lowered + if (SHA256_HEX_PATTERN.test(lowered)) {return lowered} if (prefixed && SHA256_BASE64_PATTERN.test(value)) { const decoded = Buffer.from(value, 'base64').toString('hex') return SHA256_HEX_PATTERN.test(decoded) ? decoded : null @@ -28,7 +28,7 @@ export function hashFile(path: string): Promise { const hash = createHash('sha256') const stream = createReadStream(path) stream.on('error', reject) - stream.on('data', (chunk) => hash.update(chunk)) + stream.on('data', (chunk) => { hash.update(chunk) }) stream.on('end', () => resolve(hash.digest('hex'))) }) } @@ -41,24 +41,24 @@ export function releaseTagCandidates(rawName: unknown, version: string): string[ const candidates: string[] = [] if (typeof rawName === 'string') { const name = rawName.trim() - if (name) candidates.push(name) + if (name) {candidates.push(name)} } for (const candidate of [`v${version}`, version]) { - if (!candidates.includes(candidate)) candidates.push(candidate) + if (!candidates.includes(candidate)) {candidates.push(candidate)} } return candidates } export function extractAssetDigest(release: unknown, downloadUrl: string): string | null { - if (!isRecord(release) || !Array.isArray(release['assets'])) return null + if (!isRecord(release) || !Array.isArray(release.assets)) {return null} const fileName = downloadUrl.split('/').pop() ?? '' - for (const entry of release['assets']) { - if (!isRecord(entry) || entry['state'] !== 'uploaded') continue - const urlMatches = entry['browser_download_url'] === downloadUrl - const nameMatches = fileName !== '' && entry['name'] === fileName - if (!urlMatches && !nameMatches) continue - const digest = parseSha256(entry['digest']) - if (digest) return digest + for (const entry of release.assets) { + if (!isRecord(entry) || entry.state !== 'uploaded') {continue} + const urlMatches = entry.browser_download_url === downloadUrl + const nameMatches = fileName !== '' && entry.name === fileName + if (!urlMatches && !nameMatches) {continue} + const digest = parseSha256(entry.digest) + if (digest) {return digest} } return null } @@ -66,8 +66,8 @@ export function extractAssetDigest(release: unknown, downloadUrl: string): strin function splitVersion(version: string): [number[], string] { const withoutBuild = version.trim().replace(/^v/, '').split('+')[0] const hyphen = withoutBuild.indexOf('-') - const core = hyphen >= 0 ? withoutBuild.slice(0, hyphen) : withoutBuild - const prerelease = hyphen >= 0 ? withoutBuild.slice(hyphen + 1) : '' + const core = hyphen === -1 ? withoutBuild : withoutBuild.slice(0, hyphen) + const prerelease = hyphen === -1 ? '' : withoutBuild.slice(hyphen + 1) const numbers = core.split('.').map((part) => Number.parseInt(part, 10) || 0) return [numbers, prerelease] } @@ -77,20 +77,20 @@ function isNumericIdentifier(identifier: string): boolean { } function comparePrerelease(left: string, right: string): number { - if (left === right) return 0 - if (!left) return 1 - if (!right) return -1 + if (left === right) {return 0} + if (!left) {return 1} + if (!right) {return -1} const leftParts = left.split('.') const rightParts = right.split('.') const length = Math.max(leftParts.length, rightParts.length) for (let index = 0; index < length; index += 1) { const leftPart = leftParts[index] const rightPart = rightParts[index] - if (leftPart === undefined) return -1 - if (rightPart === undefined) return 1 + if (leftPart === undefined) {return -1} + if (rightPart === undefined) {return 1} if (isNumericIdentifier(leftPart) && isNumericIdentifier(rightPart)) { const diff = Number(leftPart) - Number(rightPart) - if (diff !== 0) return diff < 0 ? -1 : 1 + if (diff !== 0) {return diff < 0 ? -1 : 1} } else if (isNumericIdentifier(leftPart) !== isNumericIdentifier(rightPart)) { return isNumericIdentifier(leftPart) ? -1 : 1 } else if (leftPart !== rightPart) { @@ -106,7 +106,7 @@ export function compareVersions(left: string, right: string): number { const length = Math.max(leftCore.length, rightCore.length) for (let index = 0; index < length; index += 1) { const diff = (leftCore[index] ?? 0) - (rightCore[index] ?? 0) - if (diff !== 0) return diff < 0 ? -1 : 1 + if (diff !== 0) {return diff < 0 ? -1 : 1} } return comparePrerelease(leftPre, rightPre) } diff --git a/src/main/updater.ts b/src/main/updater.ts index 1b1eaa5c..ae33d70c 100644 --- a/src/main/updater.ts +++ b/src/main/updater.ts @@ -1,29 +1,19 @@ import { app, BrowserWindow, ipcMain, net } from 'electron' -import { spawn } from 'child_process' -import { createHash } from 'crypto' -import { createWriteStream, existsSync, mkdirSync, readdirSync, realpathSync, renameSync, rmSync, type WriteStream } from 'fs' -import { join } from 'path' +import { spawn } from 'node:child_process' +import { createHash } from 'node:crypto' +import { createWriteStream, existsSync, mkdirSync, readdirSync, realpathSync, renameSync, rmSync } from 'node:fs'; +import type { WriteStream } from 'node:fs'; +import { join } from 'node:path' import { logger } from '../common/logger' import type { UpdateCheckOutcome, UpdateState, UpdaterEvent } from '../preload' -import { - assetNameFromUrl, - assetNameMatchesFeed, - debInstallPlan, - findTrustedExecutable, - installAppImageFile, - isDebInstallLocation, - isPathInsideDirectory, - resolveUpdateTarget, - updateFeedPath, - type UpdateRuntime, - type UpdateTarget -} from './updateChannel' +import { assetNameFromUrl, assetNameMatchesFeed, debInstallPlan, findTrustedExecutable, installAppImageFile, isDebInstallLocation, isPathInsideDirectory, resolveUpdateTarget, updateFeedPath } from './updateChannel'; +import type { UpdateRuntime, UpdateTarget } from './updateChannel'; import { compareVersions, extractAssetDigest, hashFile, isRecord, parseSha256, releaseTagCandidates } from './updateIntegrity' const DEFAULT_UPDATE_BASE_URL = 'https://guearth-updater.isla.fan' const GITHUB_API_BASE = 'https://api.github.com' const RELEASES_REPO = 'Proj-Pigeon/GuEarth' -const CHECK_TIMEOUT_MS = 15000 +const CHECK_TIMEOUT_MS = 15_000 const PROGRESS_EMIT_INTERVAL_MS = 400 const VERSION_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/ const INSTALL_QUIT_DELAY_MS = 300 @@ -48,7 +38,7 @@ function debInstallDetected(): boolean { resolved.push(candidate) try { const real = realpathSync(candidate) - if (real !== candidate) resolved.push(real) + if (real !== candidate) {resolved.push(real)} } catch { void 0 } @@ -60,10 +50,10 @@ function updateRuntime(): UpdateRuntime { return { platform: process.platform, arch: process.arch, - appImagePath: process.env['APPIMAGE'], + appImagePath: process.env.APPIMAGE, debInstalled: debInstallDetected(), - packageKindOverride: process.env['GUEARTH_UPDATE_PACKAGE'], - allowPackageKindOverride: process.env['GUEARTH_UPDATE_URL'] !== undefined + packageKindOverride: process.env.GUEARTH_UPDATE_PACKAGE, + allowPackageKindOverride: process.env.GUEARTH_UPDATE_URL !== undefined } } @@ -72,16 +62,16 @@ function currentTarget(): UpdateTarget | null { } function updateCheckEnabled(): boolean { - return (app.isPackaged || process.env['GUEARTH_UPDATE_URL'] !== undefined) && currentTarget() !== null + return (app.isPackaged || process.env.GUEARTH_UPDATE_URL !== undefined) && currentTarget() !== null } function updateBaseUrl(): string { - return process.env['GUEARTH_UPDATE_URL'] ?? DEFAULT_UPDATE_BASE_URL + return process.env.GUEARTH_UPDATE_URL ?? DEFAULT_UPDATE_BASE_URL } function installerPathFor(target: UpdateTarget, targetVersion: string): string { - if (target.kind === 'nsis') return join(downloadsDir, `guearth-${targetVersion}-setup.exe`) - if (target.kind === 'appimage') return join(downloadsDir, `guearth-${targetVersion}-${target.arch}.AppImage`) + if (target.kind === 'nsis') {return join(downloadsDir, `guearth-${targetVersion}-setup.exe`)} + if (target.kind === 'appimage') {return join(downloadsDir, `guearth-${targetVersion}-${target.arch}.AppImage`)} return join(downloadsDir, `guearth-${targetVersion}-${target.arch}.deb`) } @@ -99,12 +89,12 @@ function snapshot(): UpdateState { function emit(event: UpdaterEvent): void { for (const win of BrowserWindow.getAllWindows()) { - if (!win.isDestroyed()) win.webContents.send('updater:event', event) + if (!win.isDestroyed()) {win.webContents.send('updater:event', event)} } } function cleanupStaleInstallers(keepPath: string): void { - if (!existsSync(downloadsDir)) return + if (!existsSync(downloadsDir)) {return} for (const name of readdirSync(downloadsDir)) { const path = join(downloadsDir, name) if (path !== keepPath) { @@ -124,7 +114,7 @@ async function resolveDigestFromGitHub(rawName: unknown, version: string, downlo headers: { Accept: 'application/vnd.github+json' }, signal: AbortSignal.timeout(CHECK_TIMEOUT_MS) }) - if (response.status !== 200) continue + if (response.status !== 200) {continue} const digest = extractAssetDigest(await response.json(), downloadUrl) if (digest) { logger.info('updater', '更新源清单未携带 sha256,已从 GitHub 发布资产摘要解析校验值', { tag }) @@ -138,20 +128,20 @@ async function resolveDigestFromGitHub(rawName: unknown, version: string, downlo } async function checkForUpdate(): Promise { - if (status === 'downloading' || status === 'ready') return 'available' + if (status === 'downloading' || status === 'ready') {return 'available'} const target = currentTarget() - if (!target) return 'disabled' + if (!target) {return 'disabled'} try { const response = await net.fetch(updateFeedPath(updateBaseUrl(), target.feedPlatform, app.getVersion()), { signal: AbortSignal.timeout(CHECK_TIMEOUT_MS) }) - if (response.status === 204) return 'latest' - if (!response.ok) return 'failed' + if (response.status === 204) {return 'latest'} + if (!response.ok) {return 'failed'} const payload: unknown = await response.json() - if (!isRecord(payload)) return 'failed' + if (!isRecord(payload)) {return 'failed'} const remoteVersion = typeof payload.name === 'string' ? payload.name.replace(/^v/, '').trim() : '' const url = typeof payload.url === 'string' ? payload.url.trim() : '' - if (!VERSION_PATTERN.test(remoteVersion)) return 'failed' - if (compareVersions(remoteVersion, app.getVersion()) <= 0) return 'latest' - if (!/^https?:\/\/\S+$/i.test(url)) return 'failed' + if (!VERSION_PATTERN.test(remoteVersion)) {return 'failed'} + if (compareVersions(remoteVersion, app.getVersion()) <= 0) {return 'latest'} + if (!/^https?:\/\/\S+$/i.test(url)) {return 'failed'} const assetName = assetNameFromUrl(url) if (!assetName || !assetNameMatchesFeed(assetName, target.feedPlatform)) { logger.warn('updater', '更新包与当前安装平台不匹配,已忽略该更新', { feedPlatform: target.feedPlatform, assetName: assetName ?? '' }) @@ -186,7 +176,7 @@ function finishStream(stream: WriteStream): Promise { } async function cachedInstallerIsTrustworthy(path: string): Promise { - if (!expectedSha256) return false + if (!expectedSha256) {return false} try { return (await hashFile(path)) === expectedSha256 } catch { @@ -196,7 +186,7 @@ async function cachedInstallerIsTrustworthy(path: string): Promise { async function downloadUpdate(): Promise { const target = activeTarget - if (status !== 'available' || !downloadUrl || !target) throw new Error('当前没有可用更新') + if (status !== 'available' || !downloadUrl || !target) {throw new Error('当前没有可用更新')} status = 'downloading' const finalPath = installerPathFor(target, version) if (existsSync(finalPath) && (await cachedInstallerIsTrustworthy(finalPath))) { @@ -226,23 +216,23 @@ async function downloadUpdate(): Promise { const streamFailure = new Promise((_, reject) => { activeStream.once('error', (error) => reject(error)) }) - void streamFailure.catch(() => undefined) + void streamFailure.catch(() => {}) const response = await net.fetch(downloadUrl, { redirect: 'follow' }) - if (!response.ok || !response.body) throw new Error(`下载失败(HTTP ${response.status})`) + if (!response.ok || !response.body) {throw new Error(`下载失败(HTTP ${response.status})`)} const contentType = response.headers.get('content-type') ?? '' - if (contentType.includes('text/html')) throw new Error('更新下载地址无效') + if (contentType.includes('text/html')) {throw new Error('更新下载地址无效')} const lengthHeader = Number(response.headers.get('content-length') ?? 0) totalBytes = Number.isFinite(lengthHeader) && lengthHeader > 0 ? lengthHeader : 0 reader = response.body.getReader() let lastEmitAt = 0 for (;;) { const { done, value } = await Promise.race([reader.read(), streamFailure]) - if (done) break - if (!value?.byteLength) continue + if (done) {break} + if (!value?.byteLength) {continue} receivedBytes += value.byteLength hash.update(value) if (!activeStream.write(Buffer.from(value))) { - await Promise.race([new Promise((resolve) => activeStream.once('drain', () => resolve())), streamFailure]) + await Promise.race([new Promise((resolve) => { activeStream.once('drain', () => resolve()) }), streamFailure]) } const now = Date.now() if (now - lastEmitAt >= PROGRESS_EMIT_INTERVAL_MS) { @@ -250,9 +240,9 @@ async function downloadUpdate(): Promise { emit({ type: 'progress', received: receivedBytes, total: totalBytes }) } } - if (totalBytes > 0 && receivedBytes !== totalBytes) throw new Error('更新下载不完整') + if (totalBytes > 0 && receivedBytes !== totalBytes) {throw new Error('更新下载不完整')} await Promise.race([finishStream(activeStream), streamFailure]) - if (hash.digest('hex') !== expectedSha256) throw new Error('更新包校验失败,安装包可能与发布版本不一致') + if (hash.digest('hex') !== expectedSha256) {throw new Error('更新包校验失败,安装包可能与发布版本不一致')} renameSync(tempPath, finalPath) installerPath = finalPath status = 'ready' @@ -266,7 +256,7 @@ async function downloadUpdate(): Promise { stream!.destroy() }) } - void reader?.cancel().catch(() => undefined) + void reader?.cancel().catch(() => {}) try { rmSync(tempPath, { force: true }) } catch { @@ -323,19 +313,19 @@ function relaunch(binary: string, extraEnv?: Record): void { async function installDebPackage(filePath: string): Promise { const uid = typeof process.getuid === 'function' ? process.getuid() : -1 const plan = debInstallPlan(filePath, uid, findTrustedExecutable('dpkg'), findTrustedExecutable('pkexec')) - if (!plan) throw new Error('未找到 dpkg 或 pkexec,无法安装 deb 更新') + if (!plan) {throw new Error('未找到 dpkg 或 pkexec,无法安装 deb 更新')} const code = await runCommand(plan.command, plan.args) - if (code === 0) return - if (code === 126 || code === 127) throw new Error('系统授权未完成,更新未安装') + if (code === 0) {return} + if (code === 126 || code === 127) {throw new Error('系统授权未完成,更新未安装')} throw new Error(`deb 安装失败(退出码 ${code})`) } async function installUpdate(): Promise { - if (installing) return + if (installing) {return} const target = activeTarget const filePath = installerPath - if (status !== 'ready' || !filePath || !target || !existsSync(filePath)) throw new Error('更新尚未下载完成') - if (!isPathInsideDirectory(filePath, downloadsDir)) throw new Error('更新包路径无效') + if (status !== 'ready' || !filePath || !target || !existsSync(filePath)) {throw new Error('更新尚未下载完成')} + if (!isPathInsideDirectory(filePath, downloadsDir)) {throw new Error('更新包路径无效')} installing = true try { if (!(await cachedInstallerIsTrustworthy(filePath))) { @@ -349,10 +339,10 @@ async function installUpdate(): Promise { installWindows(filePath) return } - if (!assetNameMatchesFeed(assetFileName, target.feedPlatform)) throw new Error('更新包与当前平台不匹配') + if (!assetNameMatchesFeed(assetFileName, target.feedPlatform)) {throw new Error('更新包与当前平台不匹配')} if (target.kind === 'appimage') { - const appImagePath = process.env['APPIMAGE'] - if (!appImagePath) throw new Error('当前不是 AppImage 运行环境,无法替换安装文件') + const appImagePath = process.env.APPIMAGE + if (!appImagePath) {throw new Error('当前不是 AppImage 运行环境,无法替换安装文件')} const destination = installAppImageFile(filePath, appImagePath, assetFileName) relaunch(destination, { APPIMAGE: destination, APPIMAGE_SILENT_INSTALL: 'true' }) return @@ -374,16 +364,16 @@ export function initUpdater(userDataUpdatesPath: string): void { downloadsDir = userDataUpdatesPath ipcMain.handle('updater:get-state', () => snapshot()) ipcMain.handle('updater:download', () => { - if (status === 'downloading') throw new Error('更新正在下载中') - if (status === 'ready') return - if (status !== 'available' || !downloadUrl || !activeTarget) throw new Error('当前没有可用更新') + if (status === 'downloading') {throw new Error('更新正在下载中')} + if (status === 'ready') {return} + if (status !== 'available' || !downloadUrl || !activeTarget) {throw new Error('当前没有可用更新')} void downloadUpdate() }) ipcMain.handle('updater:install', () => installUpdate()) ipcMain.handle('updater:check', (): Promise => { - if (!updateCheckEnabled()) return Promise.resolve('disabled') + if (!updateCheckEnabled()) {return Promise.resolve('disabled')} return checkForUpdate() }) - if (!updateCheckEnabled()) return + if (!updateCheckEnabled()) {return} void checkForUpdate() } diff --git a/src/preload/index.d.ts b/src/preload/index.d.ts index bdfb254e..a1055dcc 100644 --- a/src/preload/index.d.ts +++ b/src/preload/index.d.ts @@ -6,4 +6,4 @@ declare global { } } -export {} + diff --git a/src/preload/index.ts b/src/preload/index.ts index 287b12de..7bce04b0 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -4,9 +4,11 @@ import type { PoiStatisticsRequest, PoiStatisticsResult } from '../common/poiSta import type { AccountDeviceChallenge, AccountPhase, AccountProfile, AccountState } from '../common/passport' import type { MirrorEndpointId, MirrorEndpointPreference, MirrorEndpointProbeResult, TileMirrorMode } from '../common/tileMirror' import type { TouchInteractionMode } from '../common/touchInteraction' -import { isThemeMode, type ResolvedTheme, type ThemeMode } from '../common/themeMode' +import { isThemeMode } from '../common/themeMode'; +import type { ResolvedTheme, ThemeMode } from '../common/themeMode'; import type { EnsoPhase } from '../common/thematicState' import type { LaboratoryProvider, LaboratoryProviderInput, OnlineDataSnapshot } from '../common/onlineData' +import type { ConversationSearchHit, HawdbStatusInfo, MemoryRecallMatch } from '../main/ai/hawdb/protocol' export interface ProviderCredentialStatus { configured: boolean @@ -302,7 +304,6 @@ export interface StoredAiConversation extends StoredAiConversationSummary { compression?: StoredAiCompression } -import type { ConversationSearchHit, HawdbStatusInfo, MemoryRecallMatch } from '../main/ai/hawdb/protocol' export type { ConversationSearchHit as AiConversationSearchHit, HawdbStatusInfo as AiHawdbStatus, MemoryRecallMatch as AiMemoryRecallMatch } @@ -435,7 +436,7 @@ export interface OffscreenRecordingScript { scenes: TeachingScene[] annotations: OffscreenRecordingAnnotation[] terrain: OffscreenRecordingTerrain - seaLevelHeights?: Array + seaLevelHeights?: (number | null)[] prewarmQuality: OffscreenPrewarmQuality centerTarget: boolean width: number @@ -511,7 +512,7 @@ interface PreloadGlobal { function applyInitialDocumentAttributes(): void { const host = globalThis as unknown as PreloadGlobal const root = host.document?.documentElement - if (!root) return + if (!root) {return} root.classList.toggle('dark', initialTheme.resolvedTheme === 'dark') root.style.colorScheme = initialTheme.resolvedTheme root.dataset.platform = process.platform @@ -558,7 +559,7 @@ const api = { onMirrorStatus: (listener: (status: TileMirrorStatus) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: TileMirrorStatus): void => listener(payload) ipcRenderer.on('tiles:mirror-status', wrapped) - return () => ipcRenderer.removeListener('tiles:mirror-status', wrapped) + return () => { ipcRenderer.removeListener('tiles:mirror-status', wrapped) } } }, annotations: { @@ -579,13 +580,13 @@ const api = { onOffscreenProgress: (listener: (progress: OffscreenRecordingProgress) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: OffscreenRecordingProgress): void => listener(payload) ipcRenderer.on('recordings:offscreen-progress', wrapped) - return () => ipcRenderer.removeListener('recordings:offscreen-progress', wrapped) + return () => { ipcRenderer.removeListener('recordings:offscreen-progress', wrapped) } }, offscreenNotice: (message: string): void => ipcRenderer.send('recordings:offscreen-notice', message), onOffscreenNotice: (listener: (message: string) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: string): void => listener(payload) ipcRenderer.on('recordings:offscreen-notice', wrapped) - return () => ipcRenderer.removeListener('recordings:offscreen-notice', wrapped) + return () => { ipcRenderer.removeListener('recordings:offscreen-notice', wrapped) } }, offscreenNext: (): void => ipcRenderer.send('recordings:offscreen-next'), offscreenSkipPrewarm: (): void => ipcRenderer.send('recordings:offscreen-skip-prewarm'), @@ -594,7 +595,7 @@ const api = { onOffscreenFrame: (listener: (index: number, captureTimeMs: number, jpeg: Uint8Array) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, index: number, captureTimeMs: number, jpeg: Uint8Array): void => listener(index, captureTimeMs, jpeg) ipcRenderer.on('recordings:offscreen-frame', wrapped) - return () => ipcRenderer.removeListener('recordings:offscreen-frame', wrapped) + return () => { ipcRenderer.removeListener('recordings:offscreen-frame', wrapped) } }, sendOffscreenFrameAck: (count: number): void => ipcRenderer.send('recordings:offscreen-frame-ack', count), sendOffscreenVideoChunk: (bytes: Uint8Array, position: number): void => ipcRenderer.send('recordings:offscreen-video-chunk', bytes, position), @@ -611,7 +612,7 @@ const api = { onStateChange: (listener: (state: WindowControlsState) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: WindowControlsState): void => listener(payload) ipcRenderer.on('window:state-changed', wrapped) - return () => ipcRenderer.removeListener('window:state-changed', wrapped) + return () => { ipcRenderer.removeListener('window:state-changed', wrapped) } } }, account: { @@ -625,7 +626,7 @@ const api = { onState: (listener: (state: AccountState) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: AccountState): void => listener(payload) ipcRenderer.on('account:event', wrapped) - return () => ipcRenderer.removeListener('account:event', wrapped) + return () => { ipcRenderer.removeListener('account:event', wrapped) } } }, logs: { @@ -646,7 +647,7 @@ const api = { onOnlineData: (listener: (snapshot: OnlineDataSnapshot) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: OnlineDataSnapshot): void => listener(payload) ipcRenderer.on('datasets:online-data-changed', wrapped) - return () => ipcRenderer.removeListener('datasets:online-data-changed', wrapped) + return () => { ipcRenderer.removeListener('datasets:online-data-changed', wrapped) } }, getEarthquakes: (refresh = false): Promise => ipcRenderer.invoke('datasets:earthquakes', refresh), getProvinces: (): Promise => ipcRenderer.invoke('datasets:provinces') @@ -659,7 +660,7 @@ const api = { onEvent: (listener: (event: UpdaterEvent) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: UpdaterEvent): void => listener(payload) ipcRenderer.on('updater:event', wrapped) - return () => ipcRenderer.removeListener('updater:event', wrapped) + return () => { ipcRenderer.removeListener('updater:event', wrapped) } } }, ai: { @@ -689,7 +690,7 @@ const api = { onEvent: (listener: (event: AiChatEvent) => void): (() => void) => { const wrapped = (_event: Electron.IpcRendererEvent, payload: AiChatEvent): void => listener(payload) ipcRenderer.on('ai:event', wrapped) - return () => ipcRenderer.removeListener('ai:event', wrapped) + return () => { ipcRenderer.removeListener('ai:event', wrapped) } } } } diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 73d7adda..eb26c864 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -1,10 +1,12 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent as ReactMouseEvent } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { MouseEvent as ReactMouseEvent } from 'react'; import { RotateCwIcon } from 'lucide-react' import { Alert, Button, Modal, Spinner, useConfirm, useToast } from '@renderer/components/ui' import 'cesium/Build/Cesium/Widgets/widgets.css' import { isLikelyMainlandChinaEnv } from '../../common/tileMirror' import type { PlaceSuggestion } from '../../preload' -import { registerGlobeTools, type GlobeToolsBridge } from '@renderer/ai/registerGlobeTools' +import { registerGlobeTools } from '@renderer/ai/registerGlobeTools'; +import type { GlobeToolsBridge } from '@renderer/ai/registerGlobeTools'; import { useCesiumViewer } from '@renderer/composables/useCesiumViewer' import { useDrawing } from '@renderer/composables/useDrawing' import { useScenePlayer } from '@renderer/composables/useScenePlayer' @@ -18,7 +20,8 @@ import { useAiStore } from '@renderer/stores/ai' import { useAtmosphereStore } from '@renderer/stores/atmosphere' import { thematicLayerCatalog, useClimateStore } from '@renderer/stores/climate' import { useDecisionStore } from '@renderer/stores/decision' -import { useDrawingStore, type DrawTool } from '@renderer/stores/drawing' +import { useDrawingStore } from '@renderer/stores/drawing'; +import type { DrawTool } from '@renderer/stores/drawing'; import { useEnvironmentStore } from '@renderer/stores/environment' import { useFailureStore } from '@renderer/stores/failure' import { useGlobeStore } from '@renderer/stores/globe' @@ -39,7 +42,8 @@ import AtmosphereLayersPanel from '@renderer/components/AtmosphereLayersPanel' import CameraStatus from '@renderer/components/CameraStatus' import CitiesPanel from '@renderer/components/CitiesPanel' import CrashDialog from '@renderer/components/CrashDialog' -import DrawingEditToolbar, { type DrawnShapeStylePatch } from '@renderer/components/DrawingEditToolbar' +import DrawingEditToolbar from '@renderer/components/DrawingEditToolbar'; +import type { DrawnShapeStylePatch } from '@renderer/components/DrawingEditToolbar'; import DrawingTouchBar from '@renderer/components/DrawingTouchBar' import EarthLayersPanel from '@renderer/components/EarthLayersPanel' import EnsoPanel from '@renderer/components/EnsoPanel' @@ -47,7 +51,8 @@ import EnvironmentPanel from '@renderer/components/EnvironmentPanel' import EoqAssistant from '@renderer/components/EoqAssistant' import ExogenicPanel from '@renderer/components/ExogenicPanel' import FailureBanner from '@renderer/components/FailureBanner' -import FirstUseGuide, { type FirstUseGuideHandle } from '@renderer/components/FirstUseGuide' +import FirstUseGuide from '@renderer/components/FirstUseGuide'; +import type { FirstUseGuideHandle } from '@renderer/components/FirstUseGuide'; import FlightStopSwitcher from '@renderer/components/FlightStopSwitcher' import FoldFaultPanel from '@renderer/components/FoldFaultPanel' import FrontalCyclone from '@renderer/components/FrontalCyclone' @@ -66,7 +71,8 @@ import PlaceSearchBox from '@renderer/components/PlaceSearchBox' import PopulationPanel from '@renderer/components/PopulationPanel' import RiverLandformPanel from '@renderer/components/RiverLandformPanel' import RotationSpeedPanel from '@renderer/components/RotationSpeedPanel' -import SceneBookmarksPanel, { type SceneEditPayload } from '@renderer/components/SceneBookmarksPanel' +import SceneBookmarksPanel from '@renderer/components/SceneBookmarksPanel'; +import type { SceneEditPayload } from '@renderer/components/SceneBookmarksPanel'; import ScenePlayerOverlay from '@renderer/components/ScenePlayerOverlay' import SettingsModal from '@renderer/components/SettingsModal' import SolarPathPanel from '@renderer/components/SolarPathPanel' @@ -181,7 +187,7 @@ export function App() { () => shapes.find((shape) => shape.id === selectedShapeId) ?? null, [selectedShapeId, shapes] ) - const levelSwitcherVisible = isGlobeReady && camera.height < 5000000 + const levelSwitcherVisible = isGlobeReady && camera.height < 5_000_000 const showGlobeLoading = !isGlobeReady || onlineDataLoading || Boolean(webglNotice) const globeLoadingText = webglNotice ? webglNotice.message @@ -209,9 +215,8 @@ export function App() { zonationPanel !== null || activeTool === 'timezone' - const drawHint = !activeTool - ? '' - : activeTool === 'timezone' + const drawHint = activeTool + ? activeTool === 'timezone' ? touchInteractionActive ? '点按选取两个地点对比地方时 · 用下方按钮退出' : '单击选取两个地点对比地方时 · Esc 退出' @@ -230,10 +235,11 @@ export function App() { : touchInteractionActive ? '点按加点 · 用下方按钮撤销或完成' : '单击加点 · 双击或右键完成 · Esc 取消' + : '' const handleGlobeContextMenu = useCallback( (event: ReactMouseEvent) => { - if (!touchInteractionActive) return + if (!touchInteractionActive) {return} event.preventDefault() }, [touchInteractionActive] @@ -256,22 +262,22 @@ export function App() { const closeAllTeachingFeatures = useCallback(() => { closeAllTeachingPanels() const climate = useClimateStore.getState() - for (const layer of thematicLayerCatalog) climate.setOverlay(layer.id, false) + for (const layer of thematicLayerCatalog) {climate.setOverlay(layer.id, false)} }, [closeAllTeachingPanels]) useEffect(() => { - if (!nightBasemapActive) return + if (!nightBasemapActive) {return} closeAllTeachingFeatures() setIsLabOpen(false) }, [closeAllTeachingFeatures, nightBasemapActive]) const ensureRecordingDirectory = useCallback(async (): Promise => { try { - if (await window.guEarth.recordings.getDirectory()) return true + if (await window.guEarth.recordings.getDirectory()) {return true} } catch { setRecordingDirectoryDialogError('暂时无法检查视频保存文件夹,请重新选择') } - if (recordingDirectoryResolverRef.current) return false + if (recordingDirectoryResolverRef.current) {return false} setRecordingDirectoryDialogError('') setRecordingDirectoryDialogOpen(true) return new Promise((resolve) => { @@ -343,8 +349,8 @@ export function App() { }, []) useEffect(() => { - if (!settingsHydrated) return - if (mirrorConsentPrompted || mirrorConsentOpen) return + if (!settingsHydrated) {return} + if (mirrorConsentPrompted || mirrorConsentOpen) {return} const timeZone = (() => { try { return Intl.DateTimeFormat().resolvedOptions().timeZone @@ -360,7 +366,7 @@ export function App() { useGlobeStore.getState().openMirrorConsent('slow') return } - if (isGlobeReady) return + if (isGlobeReady) {return} const timer = window.setTimeout(() => { const current = useGlobeStore.getState() if (!current.mirrorConsentPrompted && !current.mirrorConsentOpen && !current.isGlobeReady) { @@ -384,11 +390,11 @@ export function App() { void (async () => { try { const installedFonts = await window.guEarth.system.fonts() - if (cancelled) return + if (cancelled) {return} const existingFonts = useDrawingStore.getState().shapes.map((shape) => shape.fontFamily) setSystemFonts([...new Set([...installedFonts, ...existingFonts])].sort((first, second) => first.localeCompare(second))) } catch { - if (!cancelled) setSystemFonts(DEFAULT_SYSTEM_FONTS) + if (!cancelled) {setSystemFonts(DEFAULT_SYSTEM_FONTS)} } })() return () => { @@ -410,8 +416,8 @@ export function App() { const settingsWindow = useSettingsWindowStore.getState() settingsWindow.close() useAiStore.getState().setPanelOpen(false) - if (step === 6) settingsWindow.open('map') - if (step === 8) settingsWindow.open('ai') + if (step === 6) {settingsWindow.open('map')} + if (step === 8) {settingsWindow.open('ai')} }, []) const handleRestartGuide = useCallback(() => { @@ -427,13 +433,13 @@ export function App() { }, []) const handleHome = useCallback(() => { - void flyTo(105, 35, 15000000) + void flyTo(105, 35, 15_000_000) }, [flyTo]) const handleRetry = useCallback(() => { const failureStore = useFailureStore.getState() for (const notice of failureStore.active) { - if (notice.retryable) void failureStore.retry(notice.scope) + if (notice.retryable) {void failureStore.retry(notice.scope)} } }, []) @@ -475,7 +481,7 @@ export function App() { const scenesStore = useScenesStore.getState() await scenesStore.addScene(scene) const nextState = useScenesStore.getState() - if (!nextState.saveError) captureTelemetryEvent('scene_saved', { scene_count: nextState.scenes.length }) + if (!nextState.saveError) {captureTelemetryEvent('scene_saved', { scene_count: nextState.scenes.length })} } catch (error) { toast.warning(error instanceof Error ? error.message : '地球尚未就绪,暂时无法保存场景') } @@ -486,7 +492,7 @@ export function App() { const handlePreviewScene = useCallback( (id: string) => { const scene = useScenesStore.getState().scenes.find((item) => item.id === id) - if (scene) void scenePlayer.previewScene(scene) + if (scene) {void scenePlayer.previewScene(scene)} }, [scenePlayer] ) @@ -506,7 +512,7 @@ export function App() { const handlePlayScenes = useCallback( (mode: 'manual' | 'auto') => { const currentScenes = useScenesStore.getState().scenes - if (!currentScenes.length) return + if (currentScenes.length === 0) {return} const drawingStore = useDrawingStore.getState() drawingStore.setActiveTool(null) drawingStore.setSelectedShapeId(null) @@ -545,19 +551,19 @@ export function App() { const handleFlyShape = useCallback( (id: string) => { const shape = useDrawingStore.getState().shapes.find((item) => item.id === id) - if (shape) flyToShape(shape) + if (shape) {flyToShape(shape)} }, [flyToShape] ) const updateSelectedShape = useCallback((changes: DrawnShapeStylePatch) => { const id = useDrawingStore.getState().selectedShapeId - if (id) useDrawingStore.getState().updateShape(id, changes) + if (id) {useDrawingStore.getState().updateShape(id, changes)} }, []) const deleteSelectedShape = useCallback(() => { const id = useDrawingStore.getState().selectedShapeId - if (id) useDrawingStore.getState().removeShape(id) + if (id) {useDrawingStore.getState().removeShape(id)} }, []) return ( @@ -600,11 +606,11 @@ export function App() { {thematicOverlays['wind-particles'] && } {thematicOverlays['frontal-cyclone'] && } - {thematicOverlays['typhoon'] && + {thematicOverlays.typhoon && (onlineSnapshot?.typhoonConfigured === false || typhoonMode === 'history') && ( )} - {thematicOverlays['enso'] && } + {thematicOverlays.enso && } {thematicOverlays['hu-line'] && } {!isPresenting && ( @@ -671,7 +677,7 @@ export function App() { {atmospherePanel === 'layers' && ( useAtmosphereStore.getState().setPanel(null)} /> )} - {thematicOverlays['enso'] && ( + {thematicOverlays.enso && ( useClimateStore.getState().setOverlay('enso', false)} /> )} {hydrologyPanel === 'water-cycle' && ( diff --git a/src/renderer/src/ai/annotationTools.ts b/src/renderer/src/ai/annotationTools.ts index 885c40e7..b0c7f178 100644 --- a/src/renderer/src/ai/annotationTools.ts +++ b/src/renderer/src/ai/annotationTools.ts @@ -1,6 +1,7 @@ import type { AnnotationEntry } from '../../../preload' import { useAiStore } from '@renderer/stores/ai' -import { DEFAULT_DRAW_STYLE, useDrawingStore, type DrawnShape, type GeoPosition } from '@renderer/stores/drawing' +import { DEFAULT_DRAW_STYLE, useDrawingStore } from '@renderer/stores/drawing'; +import type { DrawnShape, GeoPosition } from '@renderer/stores/drawing'; import { measureShape } from '@renderer/composables/useDrawing' type FolderEntry = Extract @@ -10,31 +11,31 @@ const MAX_FOLDER_OPERATIONS = 20 const COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/ export function parsePositions(raw: unknown, minCount: number): GeoPosition[] | null { - if (!Array.isArray(raw)) return null + if (!Array.isArray(raw)) {return null} const positions: GeoPosition[] = [] for (const item of raw) { - if (typeof item !== 'object' || item === null) continue + if (typeof item !== 'object' || item === null) {continue} const record = item as Record const longitude = Number(record.longitude) const latitude = Number(record.latitude) - if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) continue - if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) continue - if (!positions.some((existing) => existing.longitude === longitude && existing.latitude === latitude)) positions.push({ longitude, latitude, height: 0 }) + if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {continue} + if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) {continue} + if (!positions.some((existing) => existing.longitude === longitude && existing.latitude === latitude)) {positions.push({ longitude, latitude, height: 0 })} } return positions.length >= minCount && positions.length <= 500 ? positions : null } export function collectStrings(raw: unknown): string[] { - if (!Array.isArray(raw)) return [] + if (!Array.isArray(raw)) {return []} return raw.flatMap((item) => (typeof item === 'string' && item.trim() ? [item.trim()] : [])) } function entryById(entries: AnnotationEntry[], id: string): AnnotationEntry | undefined { for (const entry of entries) { - if (entry.id === id) return entry + if (entry.id === id) {return entry} if (entry.type === 'folder') { const found = entryById(entry.children, id) - if (found) return found + if (found) {return found} } } return undefined @@ -45,11 +46,11 @@ function folderSegments(path: string): string[] { } function folderByPath(entries: AnnotationEntry[], segments: string[]): FolderEntry | undefined { - if (!segments.length) return undefined + if (segments.length === 0) {return undefined} const [head, ...rest] = segments const child = entries.find((entry) => entry.type === 'folder' && entry.name === head) - if (!child || child.type !== 'folder') return undefined - return rest.length ? folderByPath(child.children, rest) : child + if (child?.type !== 'folder') {return undefined} + return rest.length > 0 ? folderByPath(child.children, rest) : child } function countShapes(entries: AnnotationEntry[]): number { @@ -58,21 +59,21 @@ function countShapes(entries: AnnotationEntry[]): number { function folderRefId(ref: string): string | null { const trimmed = ref.trim() - if (!trimmed) return null + if (!trimmed) {return null} const { entries } = useDrawingStore.getState() const byId = entryById(entries, trimmed) - if (byId) return byId.type === 'folder' ? byId.id : null + if (byId) {return byId.type === 'folder' ? byId.id : null} return folderByPath(entries, folderSegments(trimmed))?.id ?? null } function folderPathOf(id: string): string { const walk = (entries: AnnotationEntry[], prefix: string): string => { for (const entry of entries) { - if (entry.type !== 'folder') continue + if (entry.type !== 'folder') {continue} const path = prefix ? `${prefix}/${entry.name}` : entry.name - if (entry.id === id) return path + if (entry.id === id) {return path} const found = walk(entry.children, path) - if (found) return found + if (found) {return found} } return '' } @@ -80,7 +81,7 @@ function folderPathOf(id: string): string { } function ensureFolderPath(segments: string[]): string | null { - if (!segments.length) return null + if (segments.length === 0) {return null} let parentId: string | null = null for (const segment of segments) { const drawingStore = useDrawingStore.getState() @@ -88,7 +89,7 @@ function ensureFolderPath(segments: string[]): string | null { const siblings: AnnotationEntry[] = parent?.type === 'folder' ? parent.children : drawingStore.entries const existing: AnnotationEntry | undefined = siblings.find((entry) => entry.type === 'folder' && entry.name === segment) parentId = existing?.id ?? drawingStore.addFolder(segment, parentId) - if (!parentId) return null + if (!parentId) {return null} } return parentId } @@ -125,7 +126,7 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const entries: unknown[] = Array.isArray(args.markers) ? args.markers : [args] - if (entries.length > MAX_MARKER_BATCH) return { error: `单次最多添加 ${MAX_MARKER_BATCH} 个标记,请分批调用` } + if (entries.length > MAX_MARKER_BATCH) {return { error: `单次最多添加 ${MAX_MARKER_BATCH} 个标记,请分批调用` }} const added: { id: string; name: string; longitude: number; latitude: number }[] = [] let skipped = 0 for (const entry of entries) { @@ -137,8 +138,8 @@ export function registerAnnotationTools(): void { useDrawingStore.getState().addShape({ ...DEFAULT_DRAW_STYLE, id, kind: 'point', positions, annotation: name, createdAt: Date.now() }) added.push({ id, name, longitude: positions[0].longitude, latitude: positions[0].latitude }) } - if (!added.length) return { error: '没有有效标记:需要名称与 WGS-84 经纬度坐标' } - if (entries.length === 1) return { status: 'ok', id: added[0].id, kind: 'point', name: added[0].name, longitude: added[0].longitude, latitude: added[0].latitude } + if (added.length === 0) {return { error: '没有有效标记:需要名称与 WGS-84 经纬度坐标' }} + if (entries.length === 1) {return { status: 'ok', id: added[0].id, kind: 'point', name: added[0].name, longitude: added[0].longitude, latitude: added[0].latitude }} return { status: 'ok', added: added.length, skipped: skipped || undefined, markers: added } } }) @@ -162,18 +163,18 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const text = typeof args.text === 'string' ? args.text.trim().slice(0, 200) : '' - if (!text) return { error: 'text 不能为空' } + if (!text) {return { error: 'text 不能为空' }} const positions = parsePositions([args], 1) - if (!positions) return { error: '坐标无效,需要 WGS-84 经纬度' } + if (!positions) {return { error: '坐标无效,需要 WGS-84 经纬度' }} let fontSize = DEFAULT_DRAW_STYLE.fontSize if (args.fontSize !== undefined) { const value = Number(args.fontSize) - if (!Number.isFinite(value) || value < 8 || value > 48) return { error: 'fontSize 需为 8-48 的数字' } + if (!Number.isFinite(value) || value < 8 || value > 48) {return { error: 'fontSize 需为 8-48 的数字' }} fontSize = Math.round(value) } let textColor = DEFAULT_DRAW_STYLE.textColor if (args.color !== undefined) { - if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) return { error: 'color 需为 #RRGGBB 格式' } + if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) {return { error: 'color 需为 #RRGGBB 格式' }} textColor = args.color } const id = crypto.randomUUID() @@ -206,17 +207,17 @@ export function registerAnnotationTools(): void { { longitude: args.fromLongitude, latitude: args.fromLatitude }, { longitude: args.toLongitude, latitude: args.toLatitude } ], 2) - if (!positions) return { error: '坐标无效:箭头需要起点与终点两个不同位置的 WGS-84 经纬度' } + if (!positions) {return { error: '坐标无效:箭头需要起点与终点两个不同位置的 WGS-84 经纬度' }} const name = typeof args.name === 'string' ? args.name.trim().slice(0, 200) : '' let color = DEFAULT_DRAW_STYLE.color if (args.color !== undefined) { - if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) return { error: 'color 需为 #RRGGBB 格式' } + if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) {return { error: 'color 需为 #RRGGBB 格式' }} color = args.color } let lineWidth = DEFAULT_DRAW_STYLE.lineWidth if (args.lineWidth !== undefined) { const value = Number(args.lineWidth) - if (!Number.isFinite(value) || value < 1 || value > 10) return { error: 'lineWidth 需为 1-10 的数字' } + if (!Number.isFinite(value) || value < 1 || value > 10) {return { error: 'lineWidth 需为 1-10 的数字' }} lineWidth = Math.round(value) } const id = crypto.randomUUID() @@ -253,11 +254,11 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { let kind: 'polyline' | 'polygon' | null = null - if (args.kind === 'polygon') kind = 'polygon' - else if (args.kind === 'polyline') kind = 'polyline' - if (!kind) return { error: 'kind 必须为 polyline 或 polygon' } + if (args.kind === 'polygon') {kind = 'polygon'} + else if (args.kind === 'polyline') {kind = 'polyline'} + if (!kind) {return { error: 'kind 必须为 polyline 或 polygon' }} const positions = parsePositions(args.points, kind === 'polygon' ? 3 : 2) - if (!positions) return { error: `坐标无效:${kind === 'polygon' ? '多边形需要至少 3 个' : '线需要至少 2 个'}有效且不重复的经纬度顶点` } + if (!positions) {return { error: `坐标无效:${kind === 'polygon' ? '多边形需要至少 3 个' : '线需要至少 2 个'}有效且不重复的经纬度顶点` }} const name = typeof args.name === 'string' ? args.name.trim().slice(0, 200) : '' const shape: DrawnShape = { ...DEFAULT_DRAW_STYLE, id: crypto.randomUUID(), kind, positions, annotation: name, createdAt: Date.now() } useDrawingStore.getState().addShape(shape) @@ -282,7 +283,7 @@ export function registerAnnotationTools(): void { const path = prefix ? `${prefix}/${entry.name}` : entry.name folders.push({ id: entry.id, name: entry.name, path, shapes: countShapes(entry.children) }) walk(entry.children, path) - } else shapeFolder.set(entry.id, prefix) + } else {shapeFolder.set(entry.id, prefix)} } } const { entries, shapes } = useDrawingStore.getState() @@ -294,11 +295,11 @@ export function registerAnnotationTools(): void { name: shape.annotation || undefined, folder: shapeFolder.get(shape.id) || undefined, vertices: shape.positions.length, - longitude: shape.positions.length ? Math.round(shape.positions[0].longitude * 10000) / 10000 : undefined, - latitude: shape.positions.length ? Math.round(shape.positions[0].latitude * 10000) / 10000 : undefined, + longitude: shape.positions.length > 0 ? Math.round(shape.positions[0].longitude * 10_000) / 10_000 : undefined, + latitude: shape.positions.length > 0 ? Math.round(shape.positions[0].latitude * 10_000) / 10_000 : undefined, measurement: measureShape(shape) || undefined })), - folders: folders.length ? folders : undefined + folders: folders.length > 0 ? folders : undefined } } }) @@ -320,10 +321,10 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const ids = new Set(collectStrings(args.ids)) - if (typeof args.id === 'string' && args.id.trim()) ids.add(args.id.trim()) + if (typeof args.id === 'string' && args.id.trim()) {ids.add(args.id.trim())} const names = new Set(collectStrings(args.names)) - if (typeof args.name === 'string' && args.name.trim()) names.add(args.name.trim()) - if (!ids.size && !names.size) return { error: '需要提供 id/ids 或 name/names' } + if (typeof args.name === 'string' && args.name.trim()) {names.add(args.name.trim())} + if (ids.size === 0 && names.size === 0) {return { error: '需要提供 id/ids 或 name/names' }} const missingIds: string[] = [] const missingNames: string[] = [] let removed = 0 @@ -336,8 +337,8 @@ export function registerAnnotationTools(): void { for (const name of names) { const drawingStore = useDrawingStore.getState() const matched = drawingStore.shapes.filter((shape) => shape.annotation === name) - if (!matched.length) { missingNames.push(name); continue } - for (const shape of matched) useDrawingStore.getState().removeShape(shape.id) + if (matched.length === 0) { missingNames.push(name); continue } + for (const shape of matched) {useDrawingStore.getState().removeShape(shape.id)} removed += matched.length } if (!removed) { @@ -348,8 +349,8 @@ export function registerAnnotationTools(): void { status: 'ok', removed, message: `已删除 ${removed} 个标注`, - missingIds: missingIds.length ? missingIds : undefined, - missingNames: missingNames.length ? missingNames : undefined + missingIds: missingIds.length > 0 ? missingIds : undefined, + missingNames: missingNames.length > 0 ? missingNames : undefined } } }) @@ -384,8 +385,8 @@ export function registerAnnotationTools(): void { } }, execute: async (args) => { - const operations = Array.isArray(args.operations) && args.operations.length ? args.operations : [args] - if (operations.length > MAX_FOLDER_OPERATIONS) return { error: `单次最多 ${MAX_FOLDER_OPERATIONS} 个操作,请分批调用` } + const operations = Array.isArray(args.operations) && args.operations.length > 0 ? args.operations : [args] + if (operations.length > MAX_FOLDER_OPERATIONS) {return { error: `单次最多 ${MAX_FOLDER_OPERATIONS} 个操作,请分批调用` }} const created: { id: string; name: string; path: string }[] = [] let renamed = 0 let removed = 0 @@ -407,8 +408,8 @@ export function registerAnnotationTools(): void { if (!folderRef || !name) { errors.push('rename 操作需要 folder 与 name'); continue } const id = folderRefId(folderRef) if (!id) { errors.push(`未找到文件夹「${folderRef}」`); continue } - if (useDrawingStore.getState().renameFolder(id, name)) renamed += 1 - else errors.push(`无法重命名「${folderRef}」`) + if (useDrawingStore.getState().renameFolder(id, name)) {renamed += 1} + else {errors.push(`无法重命名「${folderRef}」`)} } else if (record.action === 'remove') { const folderRef = typeof record.folder === 'string' ? record.folder.trim() : '' if (!folderRef) { errors.push('remove 操作需要 folder'); continue } @@ -416,17 +417,17 @@ export function registerAnnotationTools(): void { if (!id) { errors.push(`未找到文件夹「${folderRef}」`); continue } useDrawingStore.getState().removeFolder(id) removed += 1 - } else errors.push(`未知 action「${String(record.action)}」,需为 create、rename 或 remove`) + } else {errors.push(`未知 action「${String(record.action)}」,需为 create、rename 或 remove`)} } - if (!created.length && !renamed && !removed) return { error: errors[0] ?? '没有有效操作' } + if (created.length === 0 && !renamed && !removed) {return { error: errors[0] ?? '没有有效操作' }} const parts: string[] = [] - if (created.length === 1) parts.push(`已创建文件夹「${created[0].name}」`) - else if (created.length > 1) parts.push(`已创建 ${created.length} 个文件夹`) - if (renamed === 1) parts.push('已重命名 1 个文件夹') - else if (renamed > 1) parts.push(`已重命名 ${renamed} 个文件夹`) - if (removed === 1) parts.push('已删除 1 个文件夹(其中标注上移一级)') - else if (removed > 1) parts.push(`已删除 ${removed} 个文件夹(其中标注上移一级)`) - return { status: 'ok', created, renamed, removed, message: parts.join(','), errors: errors.length ? errors : undefined } + if (created.length === 1) {parts.push(`已创建文件夹「${created[0].name}」`)} + else if (created.length > 1) {parts.push(`已创建 ${created.length} 个文件夹`)} + if (renamed === 1) {parts.push('已重命名 1 个文件夹')} + else if (renamed > 1) {parts.push(`已重命名 ${renamed} 个文件夹`)} + if (removed === 1) {parts.push('已删除 1 个文件夹(其中标注上移一级)')} + else if (removed > 1) {parts.push(`已删除 ${removed} 个文件夹(其中标注上移一级)`)} + return { status: 'ok', created, renamed, removed, message: parts.join(','), errors: errors.length > 0 ? errors : undefined } } }) @@ -449,10 +450,10 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const ids = new Set(collectStrings(args.ids)) - if (typeof args.id === 'string' && args.id.trim()) ids.add(args.id.trim()) + if (typeof args.id === 'string' && args.id.trim()) {ids.add(args.id.trim())} const names = new Set(collectStrings(args.names)) - if (typeof args.name === 'string' && args.name.trim()) names.add(args.name.trim()) - if (!ids.size && !names.size) return { error: '需要提供 id/ids 或 name/names' } + if (typeof args.name === 'string' && args.name.trim()) {names.add(args.name.trim())} + if (ids.size === 0 && names.size === 0) {return { error: '需要提供 id/ids 或 name/names' }} const missingIds: string[] = [] const missingNames: string[] = [] const seen = new Set() @@ -465,22 +466,22 @@ export function registerAnnotationTools(): void { } for (const name of names) { const matched = shapes.filter((item) => item.annotation === name) - if (!matched.length) { missingNames.push(name); continue } + if (matched.length === 0) { missingNames.push(name); continue } for (const shape of matched) { if (!seen.has(shape.id)) { seen.add(shape.id); targets.push(shape) } } } - if (!targets.length) return { error: `未找到标注「${missingIds[0] ?? missingNames[0]}」,可先调用 list_shapes 查看` } + if (targets.length === 0) {return { error: `未找到标注「${missingIds[0] ?? missingNames[0]}」,可先调用 list_shapes 查看` }} const folderRef = typeof args.folder === 'string' ? args.folder.trim() : '' let folderId: string | null = null if (folderRef) { folderId = folderRefId(folderRef) - if (!folderId && args.createFolder === true) folderId = ensureFolderPath(folderSegments(folderRef)) - if (!folderId) return { error: `未找到文件夹「${folderRef}」:可先用 manage_folders 创建,或设置 createFolder 为 true 自动创建` } + if (!folderId && args.createFolder === true) {folderId = ensureFolderPath(folderSegments(folderRef))} + if (!folderId) {return { error: `未找到文件夹「${folderRef}」:可先用 manage_folders 创建,或设置 createFolder 为 true 自动创建` }} } let moved = 0 for (const shape of targets) { - if (useDrawingStore.getState().moveEntry(shape.id, folderId, 'inside')) moved += 1 + if (useDrawingStore.getState().moveEntry(shape.id, folderId, 'inside')) {moved += 1} } const targetLabel = folderId ? folderPathOf(folderId) : '根目录' return { @@ -488,8 +489,8 @@ export function registerAnnotationTools(): void { moved, folder: targetLabel, message: `已移动 ${moved} 个标注到「${targetLabel}」`, - missingIds: missingIds.length ? missingIds : undefined, - missingNames: missingNames.length ? missingNames : undefined + missingIds: missingIds.length > 0 ? missingIds : undefined, + missingNames: missingNames.length > 0 ? missingNames : undefined } } }) diff --git a/src/renderer/src/ai/populationTools.ts b/src/renderer/src/ai/populationTools.ts index 0f922fcf..3a2bf2c7 100644 --- a/src/renderer/src/ai/populationTools.ts +++ b/src/renderer/src/ai/populationTools.ts @@ -27,20 +27,20 @@ export function registerPopulationTools(): void { }, execute: async (args) => { const name = typeof args.province === 'string' ? args.province.trim() : '' - if (!name) return { error: '需要 province 参数,省级行政区全称或「全国」' } + if (!name) {return { error: '需要 province 参数,省级行政区全称或「全国」' }} if (name === '全国') { return { province: '全国', year: POPULATION_CENSUS_YEAR, populationWan: national.populationWan, - mainland31Wan: 140978, + mainland31Wan: 140_978, urbanizationPct: latestUrbanization[1], urbanizationYear: latestUrbanization[0], note: `全国人口 ${national.populationWan} 万为大陆口径(含现役军人);大陆31个省区市合计约140978万。城镇化率 ${latestUrbanization[1]}% 为常住人口口径(${latestUrbanization[0]} 年)。` } } const province = provincePopulation.find((item) => item.name === name) - if (!province) return { error: `未收录省级行政区「${name}」,请使用枚举中的全称`, available: provinceNames } + if (!province) {return { error: `未收录省级行政区「${name}」,请使用枚举中的全称`, available: provinceNames }} const density = Math.round(densityOf(province) * 10) / 10 return { province: province.name, diff --git a/src/renderer/src/ai/registerGlobeTools.ts b/src/renderer/src/ai/registerGlobeTools.ts index e92e2056..afa818eb 100644 --- a/src/renderer/src/ai/registerGlobeTools.ts +++ b/src/renderer/src/ai/registerGlobeTools.ts @@ -19,7 +19,8 @@ import { registerPopulationTools } from '@renderer/ai/populationTools' import type { RecordingStep } from '@renderer/composables/useScenePlayer' import { flyTransect } from '@renderer/composables/useTransectFlight' import { hidesThematicLayers, visibleThematicLayers } from '@renderer/lib/nightBasemap' -import { ensoPhaseOptions, type EnsoPhase } from '@renderer/thematic/ensoPhases' +import { ensoPhaseOptions } from '@renderer/thematic/ensoPhases'; +import type { EnsoPhase } from '@renderer/thematic/ensoPhases'; import { HSR_END_YEAR, HSR_START_YEAR } from '@renderer/thematic/hsrLines' import { mountainById, zonationMountains } from '@renderer/thematic/mountainZonation' import { findPeaksNear, nearestPeaks } from '@renderer/thematic/notablePeaks' @@ -46,22 +47,22 @@ export interface GlobeToolsBridge { } const optionalFiniteNumber = (value: unknown): number | undefined => { - if (value === null || value === undefined || value === '') return undefined + if (value === null || value === undefined || value === '') {return undefined} const parsed = Number(value) return Number.isFinite(parsed) ? parsed : undefined } export function parseRecordingStep(raw: unknown, index: number): RecordingStep | { error: string } { - if (typeof raw !== 'object' || raw === null) return { error: `第 ${index + 1} 步格式无效` } + if (typeof raw !== 'object' || raw === null) {return { error: `第 ${index + 1} 步格式无效` }} const record = raw as Record const longitude = Number(record.longitude) const latitude = Number(record.latitude) if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180 || !Number.isFinite(latitude) || latitude < -90 || latitude > 90) { return { error: `第 ${index + 1} 步缺少有效经纬度` } } - const height = record.height === undefined ? 600000 : Number(record.height) - if (!Number.isFinite(height) || height <= 0 || height > 20000000) return { error: `第 ${index + 1} 步视点高度无效` } - const clampedHeight = Math.min(12000000, Math.max(10000, height)) + const height = record.height === undefined ? 600_000 : Number(record.height) + if (!Number.isFinite(height) || height <= 0 || height > 20_000_000) {return { error: `第 ${index + 1} 步视点高度无效` }} + const clampedHeight = Math.min(12_000_000, Math.max(10_000, height)) const heading = record.heading === undefined ? 0 : Number(record.heading) const pitch = record.pitch === undefined ? -90 : Number(record.pitch) if (!Number.isFinite(heading) || heading < -360 || heading > 360 || !Number.isFinite(pitch) || pitch < -90 || pitch > 90) { @@ -73,19 +74,19 @@ export function parseRecordingStep(raw: unknown, index: number): RecordingStep | const requestedOverlays = collectStrings(record.overlays) const knownOverlays = thematicLayerCatalog.filter((layer) => requestedOverlays.includes(layer.id)).map((layer) => layer.id) const month = record.month === undefined ? climateStore.month : Number(record.month) - if (!Number.isFinite(month) || month < 1 || month > 12) return { error: `第 ${index + 1} 步 month 需为 1-12` } + if (!Number.isFinite(month) || month < 1 || month > 12) {return { error: `第 ${index + 1} 步 month 需为 1-12` }} let simTime: { date: string; hour: number } | null = null if (record.simTime !== null && record.simTime !== undefined) { - if (typeof record.simTime !== 'object') return { error: `第 ${index + 1} 步 simTime 格式无效` } + if (typeof record.simTime !== 'object') {return { error: `第 ${index + 1} 步 simTime 格式无效` }} const time = record.simTime as Record - if (typeof time.date !== 'string' || !isValidDate(time.date)) return { error: `第 ${index + 1} 步 simTime.date 需为合法 YYYY-MM-DD` } + if (typeof time.date !== 'string' || !isValidDate(time.date)) {return { error: `第 ${index + 1} 步 simTime.date 需为合法 YYYY-MM-DD` }} const hour = time.hour === undefined ? 12 : Number(time.hour) - if (!Number.isFinite(hour) || hour < 0 || hour >= 24) return { error: `第 ${index + 1} 步 simTime.hour 需为 0-24` } + if (!Number.isFinite(hour) || hour < 0 || hour >= 24) {return { error: `第 ${index + 1} 步 simTime.hour 需为 0-24` }} simTime = { date: time.date, hour } } const markers = Array.isArray(record.markers) ? record.markers.flatMap((item) => { - if (typeof item !== 'object' || item === null) return [] + if (typeof item !== 'object' || item === null) {return []} const entry = item as Record const name = typeof entry.name === 'string' ? entry.name.trim().slice(0, 200) : '' const markerLon = Number(entry.longitude) @@ -98,13 +99,14 @@ export function parseRecordingStep(raw: unknown, index: number): RecordingStep | : [] const shapes = Array.isArray(record.shapes) ? record.shapes.flatMap((item) => { - if (typeof item !== 'object' || item === null) return [] + if (typeof item !== 'object' || item === null) {return []} const entry = item as Record - if (entry.kind !== 'polyline' && entry.kind !== 'polygon') return [] + if (entry.kind !== 'polyline' && entry.kind !== 'polygon') {return []} const positions = parsePositions(entry.points, entry.kind === 'polygon' ? 3 : 2) - if (!positions) return [] + if (!positions) {return []} const name = typeof entry.name === 'string' ? entry.name.trim().slice(0, 200) : '' - return [{ kind: entry.kind as 'polyline' | 'polygon', name, positions }] + const kind: 'polyline' | 'polygon' = entry.kind + return [{ kind, name, positions }] }) : [] const dwellMs = record.dwellMs === undefined ? 6000 : Number(record.dwellMs) @@ -128,8 +130,8 @@ export function parseRecordingStep(raw: unknown, index: number): RecordingStep | ensoPhase, seaLevelRise, transportYear, - dwellMs: Math.min(60000, Math.max(1000, dwellMs)), - flyDurationMs: Math.min(15000, Math.max(500, flyDurationMs)), + dwellMs: Math.min(60_000, Math.max(1000, dwellMs)), + flyDurationMs: Math.min(15_000, Math.max(500, flyDurationMs)), markers, shapes } @@ -211,10 +213,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { const turnToken = typeof args.__turnToken === 'string' ? args.__turnToken : '' const flightMode = args.__flightMode === 'queue' ? 'queue' : 'initial' const parsed = parseFlyToArgs(args, flightMode === 'queue' ? flightStopsStore.total : 0) - if (parsed.error || !parsed.stops.length) return { error: parsed.error ?? '坐标无效,需要 WGS-84 经纬度' } + if (parsed.error || parsed.stops.length === 0) {return { error: parsed.error ?? '坐标无效,需要 WGS-84 经纬度' }} if (flightMode === 'queue') { const { added, total } = flightStopsStore.appendTurnStops(turnToken, parsed.stops) - if (!added.length) return { error: `「${parsed.stops[0].name}」未加入待查看列表:列表已满或地点重复(共 ${total} 个)` } + if (added.length === 0) {return { error: `「${parsed.stops[0].name}」未加入待查看列表:列表已满或地点重复(共 ${total} 个)` }} const current = useFlightStopsStore.getState().currentStop const addedName = added[0].name return { @@ -227,7 +229,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } } const first = flightStopsStore.beginTurnStops(turnToken, parsed.stops) - if (!first) return { error: '没有有效飞行地点' } + if (!first) {return { error: '没有有效飞行地点' }} const actualHeight = await bridge.flyTo(first.longitude, first.latitude, first.height) if (actualHeight === undefined) { useFlightStopsStore.getState().clear() @@ -312,7 +314,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} const longitude = Number(args.longitude) const latitude = Number(args.latitude) if (!Number.isFinite(longitude) || !Number.isFinite(latitude) || longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) { @@ -321,7 +323,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { const cartographic = Cesium.Cartographic.fromDegrees(longitude, latitude) try { const [sampled] = await Cesium.sampleTerrainMostDetailed(current.terrainProvider, [cartographic.clone()]) - if (sampled && Number.isFinite(sampled.height)) return { height: Math.round(sampled.height * 100) / 100, unit: '米(WGS-84 椭球高)', longitude, latitude } + if (sampled && Number.isFinite(sampled.height)) {return { height: Math.round(sampled.height * 100) / 100, unit: '米(WGS-84 椭球高)', longitude, latitude }} } catch { void 0 } @@ -358,13 +360,13 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { return { error: '坐标无效,需要 WGS-84 经纬度' } } const radiusKm = args.radiusKm === undefined ? 300 : Number(args.radiusKm) - if (!Number.isFinite(radiusKm) || radiusKm < 10 || radiusKm > 3000) return { error: 'radiusKm 需为 10-3000 的千米数' } + if (!Number.isFinite(radiusKm) || radiusKm < 10 || radiusKm > 3000) {return { error: 'radiusKm 需为 10-3000 的千米数' }} const found = findPeaksNear(longitude, latitude, radiusKm) - if (!found.length) { + if (found.length === 0) { const nearest = nearestPeaks(longitude, latitude, 3) return { status: 'none', - center: { longitude: Math.round(longitude * 10000) / 10000, latitude: Math.round(latitude * 10000) / 10000 }, + center: { longitude: Math.round(longitude * 10_000) / 10_000, latitude: Math.round(latitude * 10_000) / 10_000 }, radiusKm, nearest, message: '查询范围内没有收录的名山高峰,nearest 为全球范围内距该点最近的三座;名录仅收录教材常用名山,不代表当地没有其他山峰' @@ -372,7 +374,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } return { status: 'ok', - center: { longitude: Math.round(longitude * 10000) / 10000, latitude: Math.round(latitude * 10000) / 10000 }, + center: { longitude: Math.round(longitude * 10_000) / 10_000, latitude: Math.round(latitude * 10_000) / 10_000 }, radiusKm, peaks: found.slice(0, 8), totalMatches: found.length, @@ -392,7 +394,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { mountainId: { type: 'string', enum: zonationMountains.map((mountain) => mountain.id), - description: '内置剖面:' + zonationMountains.map((mountain) => `${mountain.id}(${mountain.name})`).join('、') + description: `内置剖面:${ zonationMountains.map((mountain) => `${mountain.id}(${mountain.name})`).join('、')}` }, waypoints: { type: 'array', @@ -412,12 +414,12 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } - let waypoints: Array<[number, number]> + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} + let waypoints: [number, number][] let expectedMaxGroundM: number | undefined if (typeof args.mountainId === 'string') { const mountain = mountainById(args.mountainId) - if (!mountain) return { error: `未知山脉 ${String(args.mountainId)},可用剖面:${zonationMountains.map((item) => `${item.id}(${item.name})`).join('、')}` } + if (!mountain) {return { error: `未知山脉 ${String(args.mountainId)},可用剖面:${zonationMountains.map((item) => `${item.id}(${item.name})`).join('、')}` }} waypoints = mountain.transect expectedMaxGroundM = mountain.summitM } else if (Array.isArray(args.waypoints)) { @@ -426,10 +428,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { return { error: '请提供 mountainId(内置山脉剖面)或 waypoints(2-6 个途经点)' } } const result = await flyTransect(current, waypoints, args.altitudeM === undefined ? { expectedMaxGroundM } : { altitudeM: Number(args.altitudeM), expectedMaxGroundM }) - if ('error' in result) return result - const samplingNote = result.maxGroundM !== undefined - ? `沿线采样最高地表 ${result.maxGroundM} 米${result.degraded ? '(地形数据不完整,已启用安全盲飞高度)' : ''}` - : '' + if ('error' in result) {return result} + const samplingNote = result.maxGroundM === undefined + ? '' + : `沿线采样最高地表 ${result.maxGroundM} 米${result.degraded ? '(地形数据不完整,已启用安全盲飞高度)' : ''}` if (result.status === 'interrupted') { const reason = result.reason === 'exaggeration-changed' ? '飞行中垂直夸张被调整,高度计划已失效,飞行自动中断' @@ -457,8 +459,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { execute: async () => { const camera = useGlobeStore.getState().camera return { - longitude: Math.round(camera.longitude * 10000) / 10000, - latitude: Math.round(camera.latitude * 10000) / 10000, + longitude: Math.round(camera.longitude * 10_000) / 10_000, + latitude: Math.round(camera.latitude * 10_000) / 10_000, height: Math.round(camera.height), heading: Math.round(camera.heading * 10) / 10, pitch: Math.round(camera.pitch * 10) / 10 @@ -475,7 +477,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async () => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} const canvas = current.scene.canvas const viewContext = () => { const cartographic = current.camera.positionCartographic @@ -486,16 +488,16 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { .map((cartesian) => Cesium.Cartographic.fromCartesian(cartesian)) const extent = picked.length >= 3 ? { - west: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.longitude))) * 10000) / 10000, - south: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.latitude))) * 10000) / 10000, - east: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.longitude))) * 10000) / 10000, - north: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.latitude))) * 10000) / 10000 + west: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.longitude))) * 10_000) / 10_000, + south: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.latitude))) * 10_000) / 10_000, + east: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.longitude))) * 10_000) / 10_000, + north: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.latitude))) * 10_000) / 10_000 } : undefined return { camera: { - longitude: Math.round(Cesium.Math.toDegrees(cartographic.longitude) * 10000) / 10000, - latitude: Math.round(Cesium.Math.toDegrees(cartographic.latitude) * 10000) / 10000, + longitude: Math.round(Cesium.Math.toDegrees(cartographic.longitude) * 10_000) / 10_000, + latitude: Math.round(Cesium.Math.toDegrees(cartographic.latitude) * 10_000) / 10_000, height: Math.round(cartographic.height), heading: Math.round(headingDegrees < 0 ? headingDegrees + 360 : headingDegrees), pitch: Math.round(Cesium.Math.toDegrees(current.camera.pitch) * 10) / 10 @@ -512,17 +514,17 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } const loadStart = Date.now() while (!current.scene.globe.tilesLoaded && Date.now() - loadStart < 3000) { - await new Promise((resolve) => setTimeout(resolve, 100)) + await new Promise((resolve) => { setTimeout(resolve, 100) }) } const scale = Math.min(1, 1280 / Math.max(canvas.width, canvas.height)) const offscreen = document.createElement('canvas') offscreen.width = Math.max(1, Math.round(canvas.width * scale)) offscreen.height = Math.max(1, Math.round(canvas.height * scale)) const context = offscreen.getContext('2d') - if (!context) return { error: '截图失败' } + if (!context) {return { error: '截图失败' }} context.drawImage(canvas, 0, 0, offscreen.width, offscreen.height) const image = offscreen.toDataURL('image/jpeg', 0.85) - if (!image.startsWith('data:image/')) return { error: '截图失败' } + if (!image.startsWith('data:image/')) {return { error: '截图失败' }} return { status: 'ok', screenshot: true, @@ -551,12 +553,12 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { execute: async (args) => { const solarStore = useSolarStore.getState() if (args.date !== undefined) { - if (!isValidDate(args.date)) return { error: 'date 需为合法的 YYYY-MM-DD 日期' } + if (!isValidDate(args.date)) {return { error: 'date 需为合法的 YYYY-MM-DD 日期' }} solarStore.setDate(args.date) } if (args.hour !== undefined) { const hour = Number(args.hour) - if (!Number.isFinite(hour) || hour < 0 || hour >= 24) return { error: 'hour 需为 0-24 的小时数' } + if (!Number.isFinite(hour) || hour < 0 || hour >= 24) {return { error: 'hour 需为 0-24 的小时数' }} solarStore.setHour(hour) } if (typeof args.play === 'boolean') { @@ -594,10 +596,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const latitude = Number(args.latitude) - if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) return { error: '纬度无效,需 -90 到 90' } + if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) {return { error: '纬度无效,需 -90 到 90' }} let dateStr = useSolarStore.getState().date if (args.date !== undefined) { - if (!isValidDate(args.date)) return { error: 'date 需为合法的 YYYY-MM-DD 日期' } + if (!isValidDate(args.date)) {return { error: 'date 需为合法的 YYYY-MM-DD 日期' }} dateStr = args.date } const { month, day } = datePartsOf(dateStr) @@ -612,8 +614,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { noonAltitudeDeg: round1(noonAltitudeDeg(latitude, declination)), dayLengthHours: round1(length.hours), polar: length.state === 'polar-day' ? '极昼' : length.state === 'polar-night' ? '极夜' : undefined, - sunriseLocalSolarTime: times.sunrise !== undefined ? formatClock(times.sunrise) : undefined, - sunsetLocalSolarTime: times.sunset !== undefined ? formatClock(times.sunset) : undefined, + sunriseLocalSolarTime: times.sunrise === undefined ? undefined : formatClock(times.sunrise), + sunsetLocalSolarTime: times.sunset === undefined ? undefined : formatClock(times.sunset), note: '日出日落为地方时(平太阳时近似)' } } @@ -637,7 +639,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { city: { type: 'string', enum: functionalZoneCities.map((city) => city.id), - description: '仅 functional-zones 城市功能分区图层使用:切换展示的城市(' + functionalZoneCities.map((city) => `${city.id}(${city.name})`).join('、') + '),默认武汉' + description: `仅 functional-zones 城市功能分区图层使用:切换展示的城市(${ functionalZoneCities.map((city) => `${city.id}(${city.name})`).join('、') }),默认武汉` } }, required: ['layerId', 'enabled'] @@ -645,23 +647,23 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const layer = thematicLayerCatalog.find((item) => item.id === args.layerId) - if (!layer) return { error: `未知图层 ${String(args.layerId)},可用图层:${thematicLayerCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` } - if (typeof args.enabled !== 'boolean') return { error: 'enabled 需为布尔值' } + if (!layer) {return { error: `未知图层 ${String(args.layerId)},可用图层:${thematicLayerCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` }} + if (typeof args.enabled !== 'boolean') {return { error: 'enabled 需为布尔值' }} const nightActive = hidesThematicLayers(useGlobeStore.getState().selectedLayerId) - if (args.enabled && nightActive) return { error: '夜光底图下教学图层已隐藏,请先用 set_basemap 切换回其他底图再开启图层' } + if (args.enabled && nightActive) {return { error: '夜光底图下教学图层已隐藏,请先用 set_basemap 切换回其他底图再开启图层' }} const climateStore = useClimateStore.getState() let cityName: string | undefined if (args.city !== undefined) { - if (layer.id !== 'functional-zones') return { error: 'city 参数仅用于 functional-zones 城市功能分区图层' } + if (layer.id !== 'functional-zones') {return { error: 'city 参数仅用于 functional-zones 城市功能分区图层' }} const city = functionalZoneCityById(String(args.city)) - if (!city) return { error: `未知城市 ${String(args.city)},可用城市:${functionalZoneCities.map((item) => `${item.id}(${item.name})`).join('、')}` } + if (!city) {return { error: `未知城市 ${String(args.city)},可用城市:${functionalZoneCities.map((item) => `${item.id}(${item.name})`).join('、')}` }} climateStore.setFunctionalZoneCity(city.id) cityName = city.name } climateStore.setOverlay(layer.id, args.enabled) if (args.month !== undefined) { const month = Number(args.month) - if (!Number.isFinite(month) || month < 1 || month > 12) return { error: 'month 需为 1-12 的月份' } + if (!Number.isFinite(month) || month < 1 || month > 12) {return { error: 'month 需为 1-12 的月份' }} climateStore.setMonth(month) useClimateStore.setState({ isPlaying: false }) } @@ -674,7 +676,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { month: nextMonth, city: cityName, message: args.enabled - ? `已开启「${layer.name}」图层${cityName ? `,展示城市:${cityName}` : ''}${args.month !== undefined ? `并设置月份为 ${nextMonth} 月` : ''};可在地球上点击图层要素查看成因` + ? `已开启「${layer.name}」图层${cityName ? `,展示城市:${cityName}` : ''}${args.month === undefined ? '' : `并设置月份为 ${nextMonth} 月`};可在地球上点击图层要素查看成因` : `已关闭「${layer.name}」图层` } } @@ -691,7 +693,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { panelId: { type: 'string', enum: teachingPanelCatalog.map((panel) => panel.id), - description: '面板 id:' + teachingPanelCatalog.map((panel) => `${panel.id}(${panel.name})`).join('、') + description: `面板 id:${ teachingPanelCatalog.map((panel) => `${panel.id}(${panel.name})`).join('、')}` }, close: { type: 'boolean', description: 'true 时关闭全部教学面板并退出地方时点选模式,忽略 panelId' } } @@ -703,8 +705,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { return { status: 'ok', closed: true, message: '已关闭全部教学演示面板' } } const panel = teachingPanelCatalog.find((item) => item.id === args.panelId) - if (!panel) return { error: `未知面板 ${String(args.panelId)},可用面板:${teachingPanelCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` } - if (hidesThematicLayers(useGlobeStore.getState().selectedLayerId)) return { error: '夜光模式下教学面板不可用,请先用 set_basemap 切回其他底图' } + if (!panel) {return { error: `未知面板 ${String(args.panelId)},可用面板:${teachingPanelCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` }} + if (hidesThematicLayers(useGlobeStore.getState().selectedLayerId)) {return { error: '夜光模式下教学面板不可用,请先用 set_basemap 切回其他底图' }} panel.open() return { status: 'ok', panelId: panel.id, name: panel.name, message: `已打开「${panel.name}」面板:${panel.hint}` } } @@ -721,7 +723,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { basemapId: { type: 'string', enum: basemapChoices.map((provider) => provider.id), - description: '底图 id:' + basemapChoices.map((provider) => `${provider.id}(${provider.name},${provider.description})`).join('、') + description: `底图 id:${ basemapChoices.map((provider) => `${provider.id}(${provider.name},${provider.description})`).join('、')}` } }, required: ['basemapId'] @@ -729,8 +731,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const basemap = basemapChoices.find((provider) => provider.id === args.basemapId) - if (!basemap) return { error: `未知底图 ${String(args.basemapId)},可用底图:${basemapChoices.map((provider) => `${provider.id}(${provider.name})`).join('、')}` } - if (useGlobeStore.getState().selectedLayerId === basemap.id) return { status: 'ok', basemapId: basemap.id, name: basemap.name, message: `当前已是「${basemap.name}」底图` } + if (!basemap) {return { error: `未知底图 ${String(args.basemapId)},可用底图:${basemapChoices.map((provider) => `${provider.id}(${provider.name})`).join('、')}` }} + if (useGlobeStore.getState().selectedLayerId === basemap.id) {return { status: 'ok', basemapId: basemap.id, name: basemap.name, message: `当前已是「${basemap.name}」底图` }} bridge.switchBasemap(basemap.id) return { status: 'ok', basemapId: basemap.id, name: basemap.name, message: `已切换到「${basemap.name}」底图(${basemap.description})` } } @@ -747,7 +749,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { terrainId: { type: 'string', enum: terrainCatalog.map((terrain) => terrain.id), - description: '地形数据源:' + terrainCatalog.map((terrain) => `${terrain.id}(${terrain.name},${terrain.description})`).join('、') + description: `地形数据源:${ terrainCatalog.map((terrain) => `${terrain.id}(${terrain.name},${terrain.description})`).join('、')}` }, exaggeration: { type: 'number', description: '垂直夸张倍数(1-5):1 为真实比例,讲山系褶皱、峡谷下切可用 3-5' }, lighting: { type: 'boolean', description: '地形太阳光照开关,开启后山脉有明暗立体感' } @@ -758,20 +760,20 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { let terrain: (typeof terrainCatalog)[number] | undefined if (args.terrainId !== undefined) { terrain = terrainCatalog.find((item) => item.id === args.terrainId) - if (!terrain) return { error: `未知地形 ${String(args.terrainId)},可用地形:${terrainCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` } + if (!terrain) {return { error: `未知地形 ${String(args.terrainId)},可用地形:${terrainCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` }} } let exaggeration: number | undefined if (args.exaggeration !== undefined) { const value = Number(args.exaggeration) - if (!Number.isFinite(value) || value < 1 || value > 5) return { error: 'exaggeration 需为 1-5 的数字' } + if (!Number.isFinite(value) || value < 1 || value > 5) {return { error: 'exaggeration 需为 1-5 的数字' }} exaggeration = Math.round(value * 10) / 10 } let lighting: boolean | undefined if (args.lighting !== undefined) { - if (typeof args.lighting !== 'boolean') return { error: 'lighting 需为布尔值' } + if (typeof args.lighting !== 'boolean') {return { error: 'lighting 需为布尔值' }} lighting = args.lighting } - if (!terrain && exaggeration === undefined && lighting === undefined) return { error: '请至少提供 terrainId、exaggeration 或 lighting 之一' } + if (!terrain && exaggeration === undefined && lighting === undefined) {return { error: '请至少提供 terrainId、exaggeration 或 lighting 之一' }} const applied: string[] = [] if (terrain) { bridge.setTerrain(terrain.id) @@ -806,7 +808,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} const longitude = Number(args.longitude) const latitude = Number(args.latitude) if (!Number.isFinite(longitude) || !Number.isFinite(latitude) || longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) { @@ -816,13 +818,13 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { let heightMeters: number | null = null try { const [sampled] = await Cesium.sampleTerrainMostDetailed(current.terrainProvider, [cartographic.clone()]) - if (sampled && Number.isFinite(sampled.height)) heightMeters = Math.round(sampled.height * 100) / 100 + if (sampled && Number.isFinite(sampled.height)) {heightMeters = Math.round(sampled.height * 100) / 100} } catch { void 0 } if (heightMeters === null) { const fallback = current.scene.globe.getHeight(cartographic) - if (typeof fallback === 'number' && Number.isFinite(fallback)) heightMeters = Math.round(fallback * 100) / 100 + if (typeof fallback === 'number' && Number.isFinite(fallback)) {heightMeters = Math.round(fallback * 100) / 100} } const nearest = nearestBoundary(longitude, latitude) const distanceKm = Math.round(nearest.distanceKm) @@ -860,14 +862,14 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const name = typeof args.name === 'string' ? args.name.trim().slice(0, 80) : '' - if (!name) return { error: '需要提供场景名称' } + if (!name) {return { error: '需要提供场景名称' }} const narration = typeof args.narration === 'string' ? args.narration.trim().slice(0, 500) : '' try { const scene = bridge.captureScene(name, narration) const scenesStore = useScenesStore.getState() await scenesStore.addScene(scene) const saveError = useScenesStore.getState().saveError - if (saveError) return { error: `场景保存失败:${saveError}` } + if (saveError) {return { error: `场景保存失败:${saveError}` }} return { status: 'ok', id: scene.id, name, hint: '场景已保存,可在底部工具栏「教学场景」面板中查看、排序与播放' } } catch (error) { return { error: error instanceof Error ? error.message : '地球尚未就绪,无法捕获当前画面' } @@ -896,8 +898,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { month: scene.snapshot.month, solarSimulation: Boolean(scene.snapshot.simTime), camera: { - longitude: Math.round(scene.snapshot.camera.longitude * 10000) / 10000, - latitude: Math.round(scene.snapshot.camera.latitude * 10000) / 10000, + longitude: Math.round(scene.snapshot.camera.longitude * 10_000) / 10_000, + latitude: Math.round(scene.snapshot.camera.latitude * 10_000) / 10_000, height: Math.round(scene.snapshot.camera.height) } })) @@ -926,7 +928,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { height: { type: 'number', description: '本幕视点高度(米),默认 600000。宁远勿近,观众要看清地理格局而非街道:国家/大区域尺度 800000-3000000,省域/城市群 200000-800000,单个城市 80000-200000,地貌细节也不低于 15000' }, heading: { type: 'number', description: '可选朝向角(度,默认 0)' }, pitch: { type: 'number', description: '可选俯仰角(度,-90 正俯视为默认,看地形起伏可用 -55 至 -70,中心点仍保持画面居中)' }, - overlays: { type: 'array', description: '本幕开启的教学图层 id 列表(未列出的图层会被关闭),可选项:' + thematicLayerCatalog.map((layer) => `${layer.id}(${layer.name})`).join('、'), items: { type: 'string' } }, + overlays: { type: 'array', description: `本幕开启的教学图层 id 列表(未列出的图层会被关闭),可选项:${ thematicLayerCatalog.map((layer) => `${layer.id}(${layer.name})`).join('、')}`, items: { type: 'string' } }, month: { type: 'number', description: '可选专题月份 1-12(配合季节性图层对比 1 月/7 月)' }, simTime: { type: 'object', description: '可选昼夜模拟 { date: "YYYY-MM-DD", hour: 北京时间 0-24 },如夏至 2026-06-22', properties: { date: { type: 'string' }, hour: { type: 'number' } } }, ensoPhase: { type: 'string', description: '可选 ENSO 相位:normal(正常)/ el-nino(厄尔尼诺)/ la-nina(拉尼娜),配合 enso 图层讲解', enum: ['normal', 'el-nino', 'la-nina'] }, @@ -946,18 +948,18 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } }, execute: async (args) => { - if (!Array.isArray(args.steps) || !args.steps.length) return { error: 'steps 需为非空数组' } - if (args.steps.length > MAX_RECORD_STEPS) return { error: `单次录制最多 ${MAX_RECORD_STEPS} 幕,请精简剧本` } + if (!Array.isArray(args.steps) || args.steps.length === 0) {return { error: 'steps 需为非空数组' }} + if (args.steps.length > MAX_RECORD_STEPS) {return { error: `单次录制最多 ${MAX_RECORD_STEPS} 幕,请精简剧本` }} const title = typeof args.title === 'string' && args.title.trim() ? args.title.trim().slice(0, 80) : '地理教学视频' const steps: RecordingStep[] = [] for (let index = 0; index < args.steps.length; index += 1) { const step = parseRecordingStep(args.steps[index], index) - if ('error' in step) return { error: step.error } + if ('error' in step) {return { error: step.error }} steps.push(step) } - if (!await bridge.ensureRecordingDirectory()) return { error: '已取消视频保存文件夹选择,录制未开始' } + if (!await bridge.ensureRecordingDirectory()) {return { error: '已取消视频保存文件夹选择,录制未开始' }} const result = await bridge.recordVideo(title, steps) - if ('error' in result) return { error: result.error } + if ('error' in result) {return { error: result.error }} return { status: 'started', title, diff --git a/src/renderer/src/components/AnnotationPanel.tsx b/src/renderer/src/components/AnnotationPanel.tsx index 0fc3ab99..5cc30e96 100644 --- a/src/renderer/src/components/AnnotationPanel.tsx +++ b/src/renderer/src/components/AnnotationPanel.tsx @@ -1,4 +1,5 @@ -import { useMemo, useRef, useState, type DragEvent, type KeyboardEvent, type ReactNode } from 'react' +import { useMemo, useRef, useState } from 'react'; +import type { DragEvent, KeyboardEvent, ReactNode } from 'react'; import { ChevronRightIcon, FolderIcon, @@ -24,9 +25,11 @@ import { useConfirm, useToast } from '@renderer/components/ui' -import { flattenVisibleTree, resolveTreeKeyAction, type TreeNavNode } from '@renderer/lib/treeNavigation' +import { flattenVisibleTree, resolveTreeKeyAction } from '@renderer/lib/treeNavigation'; +import type { TreeNavNode } from '@renderer/lib/treeNavigation'; import type { AnnotationEntry } from '../../../preload' -import { useDrawingStore, type DrawnShape } from '@renderer/stores/drawing' +import { useDrawingStore } from '@renderer/stores/drawing'; +import type { DrawnShape } from '@renderer/stores/drawing'; import styles from './AnnotationPanel.module.css' export interface AnnotationPanelProps { @@ -61,10 +64,10 @@ const kindLabels: Record = { } function renderKindIcon(kind: DrawnShape['kind']): ReactNode { - if (kind === 'point') return - if (kind === 'polyline') return - if (kind === 'polygon') return - if (kind === 'arrow') return + if (kind === 'point') {return } + if (kind === 'polyline') {return } + if (kind === 'polygon') {return } + if (kind === 'arrow') {return } return } @@ -176,7 +179,7 @@ export function AnnotationPanel({ function saveFolder(): void { const name = folderName.trim() - if (!name) return + if (!name) {return} if (folderDialogMode === 'create') { const id = addFolder(name, folderTargetId) if (!id) { @@ -227,8 +230,8 @@ export function AnnotationPanel({ const rect = event.currentTarget.getBoundingClientRect() const ratio = (event.clientY - rect.top) / Math.max(1, rect.height) if (node.nodeType === 'folder') { - if (ratio < 0.28) return 'before' - if (ratio > 0.72) return 'after' + if (ratio < 0.28) {return 'before'} + if (ratio > 0.72) {return 'after'} return 'inside' } return ratio < 0.5 ? 'before' : 'after' @@ -241,7 +244,7 @@ export function AnnotationPanel({ const placement = resolvePlacement(event, node) setDraggingId(null) setDropHint(null) - if (!sourceId || sourceId === node.entryId) return + if (!sourceId || sourceId === node.entryId) {return} if (!moveEntry(sourceId, node.entryId, placement)) { toast.warning('无法移动到这里,文件夹最多嵌套 5 层') return @@ -252,7 +255,7 @@ export function AnnotationPanel({ } function dropAtTopLevel(): void { - if (draggingId) moveEntry(draggingId, null, 'inside') + if (draggingId) {moveEntry(draggingId, null, 'inside')} setDraggingId(null) setDropHint(null) } @@ -260,12 +263,12 @@ export function AnnotationPanel({ function selectNode(node: AnnotationTreeNode): void { setSelectedEntryKey(node.key) setFocusedKey(node.key) - if (node.nodeType === 'shape') onFly(node.entryId) - else toggleExpand(node.key) + if (node.nodeType === 'shape') {onFly(node.entryId)} + else {toggleExpand(node.key)} } function handleTreeKeyDown(event: KeyboardEvent, node: AnnotationTreeNode): void { - if (event.target !== event.currentTarget) return + if (event.target !== event.currentTarget) {return} const action = resolveTreeKeyAction(event.key, node.key, visibleItems, expandedSet) if ( action || @@ -278,7 +281,7 @@ export function AnnotationPanel({ ) { event.preventDefault() } - if (!action) return + if (!action) {return} if (action.type === 'focus') { focusTreeItem(action.key) } else if (action.type === 'expand') { @@ -303,8 +306,8 @@ export function AnnotationPanel({
{ - if (element) treeItemRefs.current.set(node.key, element) - else treeItemRefs.current.delete(node.key) + if (element) {treeItemRefs.current.set(node.key, element)} + else {treeItemRefs.current.delete(node.key)} }} role="treeitem" aria-level={depth + 1} @@ -316,7 +319,7 @@ export function AnnotationPanel({ tabIndex={node.key === rovingKey ? 0 : -1} className={styles.treeNodeWrap} onFocus={(event) => { - if (event.target === event.currentTarget) setFocusedKey(node.key) + if (event.target === event.currentTarget) {setFocusedKey(node.key)} }} onKeyDown={(event) => handleTreeKeyDown(event, node)} > @@ -343,7 +346,7 @@ export function AnnotationPanel({ setDropHint(null) }} onDragOver={(event) => { - if (!draggingId || draggingId === node.entryId) return + if (!draggingId || draggingId === node.entryId) {return} event.preventDefault() event.stopPropagation() setDropHint({ key: node.key, placement: resolvePlacement(event, node) }) diff --git a/src/renderer/src/components/AtmosphereLayersPanel.tsx b/src/renderer/src/components/AtmosphereLayersPanel.tsx index 4110d0b1..5f308b99 100644 --- a/src/renderer/src/components/AtmosphereLayersPanel.tsx +++ b/src/renderer/src/components/AtmosphereLayersPanel.tsx @@ -1,7 +1,8 @@ import { useMemo } from 'react' import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './AtmosphereLayersPanel.module.css' export interface AtmosphereLayersPanelProps { @@ -10,10 +11,10 @@ export interface AtmosphereLayersPanelProps { const TEMP_COLOR = '#1677ff' -const profilePoints: Array<[number, number]> = [] -for (let h = 0; h <= 12; h += 1) profilePoints.push([15 - (h * 70) / 12, h]) -for (let h = 13; h <= 50; h += 1) profilePoints.push([-55 + ((h - 12) * 52) / 38, h]) -for (let h = 51; h <= 85; h += 1) profilePoints.push([-3 - ((h - 50) * 87) / 35, h]) +const profilePoints: [number, number][] = [] +for (let h = 0; h <= 12; h += 1) {profilePoints.push([15 - (h * 70) / 12, h])} +for (let h = 13; h <= 50; h += 1) {profilePoints.push([-55 + ((h - 12) * 52) / 38, h])} +for (let h = 51; h <= 85; h += 1) {profilePoints.push([-3 - ((h - 50) * 87) / 35, h])} const layers = [ { diff --git a/src/renderer/src/components/CameraStatus.tsx b/src/renderer/src/components/CameraStatus.tsx index 066d499d..796497b6 100644 --- a/src/renderer/src/components/CameraStatus.tsx +++ b/src/renderer/src/components/CameraStatus.tsx @@ -12,8 +12,8 @@ function formatCoordinate(value: number, isLongitude: boolean): string { } function formatHeight(height: number): string { - if (height > 1000000) return `${(height / 1000000).toFixed(2)} Mm` - if (height > 1000) return `${(height / 1000).toFixed(2)} km` + if (height > 1_000_000) {return `${(height / 1_000_000).toFixed(2)} Mm`} + if (height > 1000) {return `${(height / 1000).toFixed(2)} km`} return `${height.toFixed(0)} m` } diff --git a/src/renderer/src/components/CitiesPanel.tsx b/src/renderer/src/components/CitiesPanel.tsx index bf23bb41..776e0fc3 100644 --- a/src/renderer/src/components/CitiesPanel.tsx +++ b/src/renderer/src/components/CitiesPanel.tsx @@ -4,14 +4,10 @@ import { Button, Select } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' import { useGlobeStore } from '@renderer/stores/globe' import type { PoiStatisticsResult } from '../../../preload' -import { - CENTRAL_PLACE_CASES, - CITY_TIER_META, - centralPlaceFacts, - urbanCities, - type CentralPlaceCase -} from '@renderer/thematic/urbanCities' -import BarChart, { type BarSeries } from './charts/BarChart' +import { CENTRAL_PLACE_CASES, CITY_TIER_META, centralPlaceFacts, urbanCities } from '@renderer/thematic/urbanCities'; +import type { CentralPlaceCase } from '@renderer/thematic/urbanCities'; +import BarChart from './charts/BarChart'; +import type { BarSeries } from './charts/BarChart'; import styles from './CitiesPanel.module.css' export interface CitiesPanelProps { @@ -40,21 +36,21 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { const [statusText, setStatusText] = useState('') const requestSeqRef = useRef(0) - useEffect(() => { - return () => { + useEffect(() => + () => { requestSeqRef.current += 1 } - }, []) + , []) function selectCase(tier: 'high' | 'low', name: string): void { const item = CENTRAL_PLACE_CASES.find((candidate) => candidate.name === name) - if (!item) return + if (!item) {return} requestSeqRef.current += 1 if (tier === 'high') { - if (item.name === selectedLow.name) setSelectedLow(selectedHigh) + if (item.name === selectedLow.name) {setSelectedLow(selectedHigh)} setSelectedHigh(item) } else { - if (item.name === selectedHigh.name) setSelectedHigh(selectedLow) + if (item.name === selectedHigh.name) {setSelectedHigh(selectedLow)} setSelectedLow(item) } setRunning(false) @@ -64,7 +60,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { } async function runVerification(): Promise { - if (running) return + if (running) {return} requestSeqRef.current += 1 const seq = requestSeqRef.current setRunning(true) @@ -86,7 +82,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { maxSamples: 400 }) ]) - if (requestSeqRef.current !== seq) return + if (requestSeqRef.current !== seq) {return} setHighResult(high) setLowResult(low) if (high.error || low.error) { @@ -103,17 +99,17 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { }` ) } catch (error) { - if (requestSeqRef.current !== seq) return + if (requestSeqRef.current !== seq) {return} setStatusText(error instanceof Error ? error.message : '数据请求失败,请重试') } finally { - if (requestSeqRef.current === seq) setRunning(false) + if (requestSeqRef.current === seq) {setRunning(false)} } } const topCategories = useMemo(() => { const union = new Map() - for (const item of highResult?.categories ?? []) union.set(item.code, item.label) - for (const item of lowResult?.categories ?? []) union.set(item.code, item.label) + for (const item of highResult?.categories ?? []) {union.set(item.code, item.label)} + for (const item of lowResult?.categories ?? []) {union.set(item.code, item.label)} const rank = (code: string, result: PoiStatisticsResult | null): number => result?.categories.find((item) => item.code === code)?.count ?? 0 return [...union.entries()] @@ -177,7 +173,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { className={styles.caseSelect} options={caseOptions} onChange={(value) => { - if (value) selectCase('high', String(value)) + if (value) {selectCase('high', String(value))} }} /> vs @@ -187,7 +183,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { className={styles.caseSelect} options={caseOptions} onChange={(value) => { - if (value) selectCase('low', String(value)) + if (value) {selectCase('low', String(value))} }} />
diff --git a/src/renderer/src/components/ContextMeter.tsx b/src/renderer/src/components/ContextMeter.tsx index 77b2e095..1b983a80 100644 --- a/src/renderer/src/components/ContextMeter.tsx +++ b/src/renderer/src/components/ContextMeter.tsx @@ -31,10 +31,10 @@ const FREE_COLOR = 'var(--muted)' function formatTokens(tokens: number): string { const trim = (value: string): string => value.replace(/\.0$/, '') - if (tokens >= 1_000_000) return `${trim((tokens / 1_000_000).toFixed(1))}M` - if (tokens <= 0) return '0' - if (tokens < 1_000) return `${Math.max(0.1, tokens / 1_000).toFixed(1)}k` - return `${trim((tokens / 1_000).toFixed(1))}k` + if (tokens >= 1_000_000) {return `${trim((tokens / 1_000_000).toFixed(1))}M`} + if (tokens <= 0) {return '0'} + if (tokens < 1000) {return `${Math.max(0.1, tokens / 1000).toFixed(1)}k`} + return `${trim((tokens / 1000).toFixed(1))}k` } function formatShare(share: number | undefined): string { diff --git a/src/renderer/src/components/DrawingEditToolbar.tsx b/src/renderer/src/components/DrawingEditToolbar.tsx index 2ce85d61..d2c9ea3f 100644 --- a/src/renderer/src/components/DrawingEditToolbar.tsx +++ b/src/renderer/src/components/DrawingEditToolbar.tsx @@ -68,7 +68,7 @@ export function DrawingEditToolbar({ shape, fonts, onChange, onRemove }: Drawing className={styles.numberControl} aria-label="线宽" onChange={(value) => { - if (typeof value === 'number') onChange({ lineWidth: value }) + if (typeof value === 'number') {onChange({ lineWidth: value })} }} /> @@ -94,7 +94,7 @@ export function DrawingEditToolbar({ shape, fonts, onChange, onRemove }: Drawing className={styles.fontSelect} aria-label="系统字体" onChange={(value) => { - if (value) onChange({ fontFamily: value }) + if (value) {onChange({ fontFamily: value })} }} /> @@ -108,7 +108,7 @@ export function DrawingEditToolbar({ shape, fonts, onChange, onRemove }: Drawing className={styles.numberControl} aria-label="字号" onChange={(value) => { - if (typeof value === 'number') onChange({ fontSize: value }) + if (typeof value === 'number') {onChange({ fontSize: value })} }} /> diff --git a/src/renderer/src/components/DrawingTouchBar.tsx b/src/renderer/src/components/DrawingTouchBar.tsx index e7442dd4..b5dc353f 100644 --- a/src/renderer/src/components/DrawingTouchBar.tsx +++ b/src/renderer/src/components/DrawingTouchBar.tsx @@ -18,7 +18,7 @@ export function DrawingTouchBar({ onUndo, onFinish }: DrawingTouchBarProps) { - if (!activeTool) return null + if (!activeTool) {return null} const canUndo = activeTool === 'line' || activeTool === 'polygon' || activeTool === 'arrow' const canFinish = activeTool === 'line' || activeTool === 'polygon' diff --git a/src/renderer/src/components/EarthLayersPanel.tsx b/src/renderer/src/components/EarthLayersPanel.tsx index a762327f..340d9c6f 100644 --- a/src/renderer/src/components/EarthLayersPanel.tsx +++ b/src/renderer/src/components/EarthLayersPanel.tsx @@ -60,9 +60,9 @@ const layers: Record = { } } -const layerEntries = Object.entries(layers) as Array<[LayerId, LayerMeta]> +const layerEntries = Object.entries(layers) as [LayerId, LayerMeta][] -const arcs: Array<{ id: LayerId; r: number }> = [ +const arcs: { id: LayerId; r: number }[] = [ { id: 'inner-core', r: 40 }, { id: 'outer-core', r: 86 }, { id: 'mantle', r: 138 }, @@ -71,7 +71,7 @@ const arcs: Array<{ id: LayerId; r: number }> = [ const reversedArcs = [...arcs].reverse() -const callouts: Array<{ id: LayerId; x: number; y: number; anchorX: number; anchorY: number; side: 'left' | 'right' }> = [ +const callouts: { id: LayerId; x: number; y: number; anchorX: number; anchorY: number; side: 'left' | 'right' }[] = [ { id: 'crust', x: 44, y: 40, anchorX: 100, anchorY: 40, side: 'left' }, { id: 'mantle', x: 40, y: 96, anchorX: 82, anchorY: 118, side: 'left' }, { id: 'outer-core', x: 306, y: 84, anchorX: 262, anchorY: 116, side: 'right' }, diff --git a/src/renderer/src/components/EnsoPanel.tsx b/src/renderer/src/components/EnsoPanel.tsx index 762e188d..c323043e 100644 --- a/src/renderer/src/components/EnsoPanel.tsx +++ b/src/renderer/src/components/EnsoPanel.tsx @@ -1,7 +1,7 @@ import { XIcon } from 'lucide-react' import { Button, Segmented } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' -import { ensoPhaseMeta, ensoPhaseOptions, type EnsoPhase } from '@renderer/thematic/ensoPhases' +import { ensoPhaseMeta, ensoPhaseOptions } from '@renderer/thematic/ensoPhases'; import styles from './EnsoPanel.module.css' export interface EnsoPanelProps { @@ -24,7 +24,7 @@ export function EnsoPanel({ onClose }: EnsoPanelProps) { options={ensoPhaseOptions} size="sm" aria-label="ENSO 相位" - onChange={(value) => setEnsoPhase(value as EnsoPhase)} + onChange={(value) => setEnsoPhase(value)} />
{meta.summary}
diff --git a/src/renderer/src/components/EnvironmentPanel.tsx b/src/renderer/src/components/EnvironmentPanel.tsx index 13f48b0b..910b337b 100644 --- a/src/renderer/src/components/EnvironmentPanel.tsx +++ b/src/renderer/src/components/EnvironmentPanel.tsx @@ -3,18 +3,10 @@ import * as Cesium from 'cesium' import { MapPinIcon, XIcon } from 'lucide-react' import { Button, Segmented } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' -import { - SEA_LEVEL_SCENARIOS, - coastalZones, - inundationByZone, - scenarioSummary, - seaLevelFacts, - totalGridCellCount, - useSeaLevelStore, - type SeaLevelScenario -} from '@renderer/thematic/seaLevelRise' +import { SEA_LEVEL_SCENARIOS, coastalZones, inundationByZone, scenarioSummary, seaLevelFacts, totalGridCellCount, useSeaLevelStore } from '@renderer/thematic/seaLevelRise'; import { ensureSeaLevelSamples } from '@renderer/composables/seaLevelSampling' -import BarChart, { type BarSeries } from './charts/BarChart' +import BarChart from './charts/BarChart'; +import type { BarSeries } from './charts/BarChart'; import styles from './EnvironmentPanel.module.css' export interface EnvironmentPanelProps { @@ -56,7 +48,7 @@ export function EnvironmentPanel({ viewer, onClose }: EnvironmentPanelProps) { ) const beginSampling = useCallback(async (): Promise => { - if (!viewer || viewer.isDestroyed()) return + if (!viewer || viewer.isDestroyed()) {return} await ensureSeaLevelSamples(viewer) }, [viewer]) @@ -65,8 +57,8 @@ export function EnvironmentPanel({ viewer, onClose }: EnvironmentPanelProps) { }, [beginSampling]) function flyToZone(index: number): void { - if (flyingRef.current) return - if (!viewer || viewer.isDestroyed()) return + if (flyingRef.current) {return} + if (!viewer || viewer.isDestroyed()) {return} flyingRef.current = true try { const zone = coastalZones[index] @@ -91,7 +83,7 @@ export function EnvironmentPanel({ viewer, onClose }: EnvironmentPanelProps) { value={rise} options={scenarioOptions} className={styles.scenarioPicker} - onChange={(value) => setSeaLevelRise(value as SeaLevelScenario)} + onChange={(value) => setSeaLevelRise(value)} /> {sampledReady ? ( diff --git a/src/renderer/src/components/EoqAssistant.tsx b/src/renderer/src/components/EoqAssistant.tsx index 147982e6..4b3650c7 100644 --- a/src/renderer/src/components/EoqAssistant.tsx +++ b/src/renderer/src/components/EoqAssistant.tsx @@ -1,4 +1,5 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent, type MouseEvent, type PointerEvent as ReactPointerEvent } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { KeyboardEvent, MouseEvent, PointerEvent as ReactPointerEvent } from 'react'; import { ThreadPrimitive } from '@assistant-ui/react' import { HistoryIcon, @@ -8,11 +9,13 @@ import { Trash2Icon, XIcon } from 'lucide-react' -import { Button, Checkbox, Drawer, DropdownMenu, Modal, Tooltip, type DropdownMenuEntry } from '@renderer/components/ui' +import { Button, Checkbox, Drawer, DropdownMenu, Modal, Tooltip } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; import { useAiStore } from '@renderer/stores/ai' import { useSettingsWindowStore } from '@renderer/stores/settingsWindow' import type { StoredAiConversationSummary } from '../../../preload' -import EoqComposer, { type EoqSlashCommand } from './eoq/EoqComposer' +import EoqComposer from './eoq/EoqComposer'; +import type { EoqSlashCommand } from './eoq/EoqComposer'; import EoqIconButton from './eoq/EoqIconButton' import EoqMessages from './eoq/EoqMessages' import EoqRuntimeProvider from './eoq/EoqRuntimeProvider' @@ -22,7 +25,7 @@ import styles from './EoqAssistant.module.css' function formatConversationTime(timestamp: number): string { const date = new Date(timestamp) const time = date.toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' }) - if (date.toDateString() === new Date().toDateString()) return time + if (date.toDateString() === new Date().toDateString()) {return time} if (date.getFullYear() === new Date().getFullYear()) { return `${date.toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })} ${time}` } @@ -76,7 +79,7 @@ export function EoqAssistant() { try { window.localStorage.setItem('guearth.eoq-drawer-width', String(width)) } catch { - return + // Best effort, so the failure is ignored. } }, []) @@ -88,7 +91,7 @@ export function EoqAssistant() { setDrawerWidth(clampDrawerWidth(stored, maxWidth)) } } catch { - return + // Best effort, so the failure is ignored. } }, [clampDrawerWidth]) @@ -104,7 +107,7 @@ export function EoqAssistant() { }, [clampDrawerWidth]) const stopDrawerResize = useCallback(() => { - if (!resizingRef.current) return + if (!resizingRef.current) {return} resizingRef.current = false document.body.style.userSelect = '' persistDrawerWidth(drawerWidthRef.current) @@ -112,7 +115,7 @@ export function EoqAssistant() { useEffect(() => { const handleDrawerResize = (event: PointerEvent): void => { - if (!resizingRef.current) return + if (!resizingRef.current) {return} const maxWidth = Math.max(0, Math.floor(window.innerWidth / 3)) setDrawerWidth(clampDrawerWidth(window.innerWidth - event.clientX, maxWidth)) } @@ -128,7 +131,7 @@ export function EoqAssistant() { }, [clampDrawerWidth, stopDrawerResize]) const startDrawerResize = useCallback((event: ReactPointerEvent) => { - if (event.button !== 0) return + if (event.button !== 0) {return} resizingRef.current = true document.body.style.userSelect = 'none' event.preventDefault() @@ -146,10 +149,10 @@ export function EoqAssistant() { } const step = event.shiftKey ? 80 : 20 let nextWidth = drawerWidthRef.current - if (event.key === 'ArrowLeft') nextWidth = clampDrawerWidth(drawerWidthRef.current + step) - if (event.key === 'ArrowRight') nextWidth = clampDrawerWidth(drawerWidthRef.current - step) - if (event.key === 'Home') nextWidth = drawerMinWidth - if (event.key === 'End') nextWidth = drawerMaxWidth + if (event.key === 'ArrowLeft') {nextWidth = clampDrawerWidth(drawerWidthRef.current + step)} + if (event.key === 'ArrowRight') {nextWidth = clampDrawerWidth(drawerWidthRef.current - step)} + if (event.key === 'Home') {nextWidth = drawerMinWidth} + if (event.key === 'End') {nextWidth = drawerMaxWidth} setDrawerWidth(nextWidth) persistDrawerWidth(nextWidth) event.preventDefault() @@ -169,10 +172,10 @@ export function EoqAssistant() { const handleInterceptSend = useCallback( (text: string): boolean => { - const command = text.trim().match(/^\/([^\s]+)(?:\s+.*)?$/)?.[1].toLowerCase() - if (!command) return false + const command = (/^\/([^\s]+)(?:\s+.*)?$/.exec(text.trim()))?.[1].toLowerCase() + if (!command) {return false} const matched = agentCommands.find((item) => item.name.slice(1) === command) - if (!matched) return false + if (!matched) {return false} void matched.run() return true }, @@ -182,7 +185,7 @@ export function EoqAssistant() { const handleSubmitPrompt = useCallback( (prompt: string) => { const text = prompt.trim() - if (!text || isStreaming) return + if (!text || isStreaming) {return} void send(text) }, [isStreaming, send] @@ -215,8 +218,8 @@ export function EoqAssistant() { const target = deleteTarget setDeleteConfirmOpen(false) setDeleteTarget(null) - if (!target) return - if (deleteNoAsk) setSkipDeleteConversationConfirm(true) + if (!target) {return} + if (deleteNoAsk) {setSkipDeleteConversationConfirm(true)} void deleteConversation(target.id) }, [deleteConversation, deleteNoAsk, deleteTarget, setSkipDeleteConversationConfirm]) diff --git a/src/renderer/src/components/ExogenicPanel.tsx b/src/renderer/src/components/ExogenicPanel.tsx index 9d59c5e6..64fa876d 100644 --- a/src/renderer/src/components/ExogenicPanel.tsx +++ b/src/renderer/src/components/ExogenicPanel.tsx @@ -25,7 +25,7 @@ const stages: ChainStage[] = [ force: '温差、冻融、水、生物', description: '岩石原地被破坏、崩解碎裂,不发生位移。花岗岩球状风化、石灰岩化学溶蚀都属于风化。', color: '#faad14', - site: { label: '黄山球状风化', longitude: 118.17, latitude: 30.13, height: 30000 } + site: { label: '黄山球状风化', longitude: 118.17, latitude: 30.13, height: 30_000 } }, { id: 'erosion', @@ -33,7 +33,7 @@ const stages: ChainStage[] = [ force: '流水、风力、冰川、海浪', description: '风化产物与岩石被外力破坏并搬离原地:流水下切成 V 形谷、风蚀雅丹、冰川刨蚀 U 形谷、海浪蚀出海蚀崖。', color: '#fa8c16', - site: { label: '虎跳峡流水侵蚀', longitude: 100.05, latitude: 27.25, height: 45000 } + site: { label: '虎跳峡流水侵蚀', longitude: 100.05, latitude: 27.25, height: 45_000 } }, { id: 'transportation', @@ -41,7 +41,7 @@ const stages: ChainStage[] = [ force: '流水、风力、冰川', description: '外力将碎屑物质搬运离开:河流挟带泥沙(黄河“一碗水半碗沙”)、风沙运移、冰川携带冰碛物。', color: '#722ed1', - site: { label: '黄河中游泥沙搬运', longitude: 110.5, latitude: 35.5, height: 400000 } + site: { label: '黄河中游泥沙搬运', longitude: 110.5, latitude: 35.5, height: 400_000 } }, { id: 'deposition', @@ -49,7 +49,7 @@ const stages: ChainStage[] = [ force: '流速/风速降低、冰川消融', description: '外力减弱,物质沉积:山前冲积扇、河流三角洲、风积沙丘、冰碛垄。粒径大的先沉积、小的后沉积,出现分选性。', color: '#13c2c2', - site: { label: '长江三角洲堆积', longitude: 120.7, latitude: 31.6, height: 300000 } + site: { label: '长江三角洲堆积', longitude: 120.7, latitude: 31.6, height: 300_000 } }, { id: 'lithification', @@ -68,7 +68,7 @@ export function ExogenicPanel({ viewer, onClose }: ExogenicPanelProps) { } function flyToSite(stage: ChainStage): void { - if (!stage.site) return + if (!stage.site) {return} if (viewer && !viewer.isDestroyed()) { viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(stage.site.longitude, stage.site.latitude, stage.site.height), diff --git a/src/renderer/src/components/FailureBanner.tsx b/src/renderer/src/components/FailureBanner.tsx index 75a992b4..d487edf6 100644 --- a/src/renderer/src/components/FailureBanner.tsx +++ b/src/renderer/src/components/FailureBanner.tsx @@ -1,7 +1,8 @@ import { useEffect } from 'react' import { RotateCwIcon, XIcon } from 'lucide-react' import { Alert, Button, Tooltip, useToast } from '@renderer/components/ui' -import { useFailureStore, type FailureNotice } from '@renderer/stores/failure' +import { useFailureStore } from '@renderer/stores/failure'; +import type { FailureNotice } from '@renderer/stores/failure'; import styles from './FailureBanner.module.css' export interface FailureBannerProps {} @@ -20,14 +21,14 @@ export function FailureBanner(_props: FailureBannerProps) { const clearFailure = useFailureStore((state) => state.clearFailure) useEffect(() => { - if (!degradationCount) return + if (!degradationCount) {return} for (const notice of takeDegradations()) { toast.warning(notice.message, 6) } }, [degradationCount, takeDegradations, toast]) const bannerNotices = active.filter((notice) => notice.scope !== 'webgl') - if (!bannerNotices.length) return null + if (bannerNotices.length === 0) {return null} return (
diff --git a/src/renderer/src/components/FirstUseGuide.tsx b/src/renderer/src/components/FirstUseGuide.tsx index 98aec863..09b7e438 100644 --- a/src/renderer/src/components/FirstUseGuide.tsx +++ b/src/renderer/src/components/FirstUseGuide.tsx @@ -1,22 +1,10 @@ -import { - useCallback, - useEffect, - useImperativeHandle, - useLayoutEffect, - useMemo, - useRef, - useState, - type ReactNode, - type Ref -} from 'react' +import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react'; +import type { ReactNode, Ref } from 'react'; import { createPortal } from 'react-dom' import { XIcon } from 'lucide-react' import { Button, Checkbox } from '@renderer/components/ui' -import { - computeGuideCardPosition, - type GuidePlacement, - type GuideRectBox -} from '@renderer/lib/guidePosition' +import { computeGuideCardPosition } from '@renderer/lib/guidePosition'; +import type { GuidePlacement, GuideRectBox } from '@renderer/lib/guidePosition'; export interface FirstUseGuideHandle { start: () => void @@ -55,7 +43,7 @@ function clearLegacyCompletion(): void { try { window.localStorage.removeItem(legacyCompletedKey) } catch { - return + // Best effort, so the failure is ignored. } } @@ -70,7 +58,7 @@ function waitNextFrame(): Promise { } function getFocusableElements(container: HTMLElement): HTMLElement[] { - return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter( + return [...container.querySelectorAll(FOCUSABLE_SELECTOR)].filter( (element) => element.getClientRects().length > 0 ) } @@ -82,8 +70,8 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) const [targetRect, setTargetRect] = useState(null) const [cardSize, setCardSize] = useState({ width: DEFAULT_CARD_WIDTH, height: DEFAULT_CARD_HEIGHT }) const [viewport, setViewport] = useState(() => ({ - width: typeof window !== 'undefined' ? window.innerWidth : 1440, - height: typeof window !== 'undefined' ? window.innerHeight : 900 + width: typeof window === 'undefined' ? 1440 : window.innerWidth, + height: typeof window === 'undefined' ? 900 : window.innerHeight })) const cardRef = useRef(null) @@ -198,9 +186,9 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) const activeStep = steps[current] ?? steps[0] const measureTarget = useCallback(() => { - if (!openRef.current) return + if (!openRef.current) {return} const step = steps[currentRef.current] - if (!step) return + if (!step) {return} const element = getTargetElement(step.targetName) if (!element) { setTargetRect(null) @@ -220,7 +208,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [steps]) useEffect(() => { - if (!open) return + if (!open) {return} const handleViewportResize = (): void => { setViewport({ width: window.innerWidth, height: window.innerHeight }) measureTarget() @@ -237,9 +225,9 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [open, current, measureTarget]) useLayoutEffect(() => { - if (!open) return + if (!open) {return} const card = cardRef.current - if (!card) return + if (!card) {return} const measureCard = (): void => { const rect = card.getBoundingClientRect() const nextWidth = Math.round(rect.width) || DEFAULT_CARD_WIDTH @@ -251,19 +239,19 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) ) } measureCard() - if (typeof ResizeObserver === 'undefined') return + if (typeof ResizeObserver === 'undefined') {return} const observer = new ResizeObserver(measureCard) observer.observe(card) return () => observer.disconnect() }, [open, current]) async function handleChange(nextStep: number): Promise { - if (transitioningRef.current) return + if (transitioningRef.current) {return} transitioningRef.current = true onStepChangeRef.current?.(nextStep) await waitNextFrame() if ([6, 7, 8].includes(nextStep) || [6, 7, 8].includes(currentRef.current)) { - await new Promise((resolve) => window.setTimeout(resolve, 320)) + await new Promise((resolve) => { window.setTimeout(resolve, 320) }) } if (!unmountedRef.current) { currentRef.current = nextStep @@ -277,7 +265,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) const savePreference = useCallback((value: boolean): void => { dontPromptAgainRef.current = value setDontPromptAgain(value) - void window.guEarth.settings.update({ setupGuideDismissed: value }).catch(() => undefined) + void window.guEarth.settings.update({ setupGuideDismissed: value }).catch(() => {}) }, []) const handleClose = useCallback((): void => { @@ -299,15 +287,15 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) useEffect(() => { async function checkFirstUse(): Promise { - if (!readyRef.current || autoPromptCheckedRef.current) return + if (!readyRef.current || autoPromptCheckedRef.current) {return} autoPromptCheckedRef.current = true try { const settings = await window.guEarth.settings.get() - if (unmountedRef.current) return + if (unmountedRef.current) {return} if (settings.setupGuideDismissed !== null) { dontPromptAgainRef.current = settings.setupGuideDismissed setDontPromptAgain(settings.setupGuideDismissed) - if (!settings.setupGuideDismissed && readyRef.current && !openRef.current) start() + if (!settings.setupGuideDismissed && readyRef.current && !openRef.current) {start()} return } if (readLegacyCompletion()) { @@ -323,12 +311,12 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) } dontPromptAgainRef.current = true setDontPromptAgain(true) - if (readyRef.current && !openRef.current) start() + if (readyRef.current && !openRef.current) {start()} } catch { - if (unmountedRef.current) return + if (unmountedRef.current) {return} dontPromptAgainRef.current = true setDontPromptAgain(true) - if (readyRef.current && !openRef.current) start() + if (readyRef.current && !openRef.current) {start()} } } @@ -336,39 +324,39 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [ready, start]) useEffect(() => { - if (!open) return + if (!open) {return} previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null cardRef.current?.focus({ preventScroll: true }) return () => { const previous = previousFocusRef.current previousFocusRef.current = null - if (previous && previous.isConnected) { + if (previous?.isConnected) { previous.focus({ preventScroll: true }) } } }, [open]) useEffect(() => { - if (!open) return + if (!open) {return} const card = cardRef.current - if (!card) return + if (!card) {return} if (!card.contains(document.activeElement)) { card.focus({ preventScroll: true }) } }, [open, current]) useEffect(() => { - if (!open) return + if (!open) {return} const handleKeyDown = (event: KeyboardEvent): void => { if (event.key === 'Escape') { event.preventDefault() handleClose() return } - if (event.key !== 'Tab') return + if (event.key !== 'Tab') {return} const card = cardRef.current - if (!card) return + if (!card) {return} const focusables = getFocusableElements(card) if (focusables.length === 0) { event.preventDefault() @@ -397,7 +385,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) return () => window.removeEventListener('keydown', handleKeyDown) }, [open, handleClose]) - if (!open || typeof document === 'undefined') return null + if (!open || typeof document === 'undefined') {return null} const { top: cardTop, left: cardLeft } = computeGuideCardPosition( targetRect, @@ -482,8 +470,8 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) size="sm" variant="primary" onClick={() => { - if (isLast) handleFinish() - else void handleChange(current + 1) + if (isLast) {handleFinish()} + else {void handleChange(current + 1)} }} > {isLast ? '完成' : '下一步'} diff --git a/src/renderer/src/components/FlightStopSwitcher.tsx b/src/renderer/src/components/FlightStopSwitcher.tsx index 7b643e79..dc091883 100644 --- a/src/renderer/src/components/FlightStopSwitcher.tsx +++ b/src/renderer/src/components/FlightStopSwitcher.tsx @@ -1,7 +1,9 @@ import { useState } from 'react' import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, XIcon } from 'lucide-react' -import { Button, DropdownMenu, Separator, Tooltip, type DropdownMenuEntry } from '@renderer/components/ui' -import { useFlightStopsStore, type FlyToExecutor } from '@renderer/stores/flightStops' +import { Button, DropdownMenu, Separator, Tooltip } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; +import { useFlightStopsStore } from '@renderer/stores/flightStops'; +import type { FlyToExecutor } from '@renderer/stores/flightStops'; import styles from './FlightStopSwitcher.module.css' export interface FlightStopSwitcherProps { @@ -23,7 +25,7 @@ export function FlightStopSwitcher({ flyTo }: FlightStopSwitcherProps) { const [menuOpen, setMenuOpen] = useState(false) - if (!visible) return null + if (!visible) {return null} function handlePrev(): void { setMenuOpen(false) @@ -38,7 +40,7 @@ export function FlightStopSwitcher({ flyTo }: FlightStopSwitcherProps) { function handleSelect(key: string): void { const index = Number(key) setMenuOpen(false) - if (Number.isInteger(index)) void goTo(index, flyTo) + if (Number.isInteger(index)) {void goTo(index, flyTo)} } function handleClose(): void { diff --git a/src/renderer/src/components/FoldFaultPanel.tsx b/src/renderer/src/components/FoldFaultPanel.tsx index bb82dace..f0d83aa2 100644 --- a/src/renderer/src/components/FoldFaultPanel.tsx +++ b/src/renderer/src/components/FoldFaultPanel.tsx @@ -40,14 +40,14 @@ const faultFacts = [ ] const foldCases: GlobeCase[] = [ - { name: '喜马拉雅褶皱山系', longitude: 86.9, latitude: 27.9, height: 900000, summary: '板块碰撞挤压形成的典型褶皱山系' }, - { name: '欧洲阿尔卑斯山', longitude: 9.5, latitude: 46.5, height: 900000, summary: '非洲板块与亚欧板块挤压形成' } + { name: '喜马拉雅褶皱山系', longitude: 86.9, latitude: 27.9, height: 900_000, summary: '板块碰撞挤压形成的典型褶皱山系' }, + { name: '欧洲阿尔卑斯山', longitude: 9.5, latitude: 46.5, height: 900_000, summary: '非洲板块与亚欧板块挤压形成' } ] const faultCases: GlobeCase[] = [ - { name: '东非大裂谷(地堑)', longitude: 36, latitude: -3, height: 1200000, summary: '大陆断裂拉伸下陷形成的巨型地堑带' }, - { name: '华山(地垒)', longitude: 110.08, latitude: 34.48, height: 45000, summary: '秦岭北麓断层上升形成的块状山地' }, - { name: '渭河平原(地堑)', longitude: 109.2, latitude: 34.4, height: 260000, summary: '断陷下陷形成的地堑谷地' } + { name: '东非大裂谷(地堑)', longitude: 36, latitude: -3, height: 1_200_000, summary: '大陆断裂拉伸下陷形成的巨型地堑带' }, + { name: '华山(地垒)', longitude: 110.08, latitude: 34.48, height: 45_000, summary: '秦岭北麓断层上升形成的块状山地' }, + { name: '渭河平原(地堑)', longitude: 109.2, latitude: 34.4, height: 260_000, summary: '断陷下陷形成的地堑谷地' } ] export function FoldFaultPanel({ viewer, onClose }: FoldFaultPanelProps) { diff --git a/src/renderer/src/components/FrontalCyclone.tsx b/src/renderer/src/components/FrontalCyclone.tsx index 3c2335d4..682e1177 100644 --- a/src/renderer/src/components/FrontalCyclone.tsx +++ b/src/renderer/src/components/FrontalCyclone.tsx @@ -13,7 +13,7 @@ interface Dot { } const ANCHOR = Cesium.Cartesian3.fromDegrees(125, 34) -const ANCHOR_VIEW_HEIGHT = 4800000 +const ANCHOR_VIEW_HEIGHT = 4_800_000 const warmRainDots: Dot[] = [] for (let row = 0; row < 3; row += 1) { @@ -35,13 +35,13 @@ for (let row = 0; row < 2; row += 1) { } } -const coldFrontBarbs: Array<{ x: number; y: number; angle: number }> = [ +const coldFrontBarbs: { x: number; y: number; angle: number }[] = [ { x: 156, y: 213, angle: 35 }, { x: 136, y: 241, angle: 40 }, { x: 116, y: 271, angle: 48 } ] -const warmFrontBarbs: Array<{ x: number; y: number; angle: number }> = [ +const warmFrontBarbs: { x: number; y: number; angle: number }[] = [ { x: 221, y: 199, angle: -60 }, { x: 252, y: 217, angle: -55 }, { x: 282, y: 238, angle: -55 } @@ -53,7 +53,7 @@ export function FrontalCyclone({ viewer }: FrontalCycloneProps) { useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (overlayRef.current) overlayRef.current.style.display = 'none' + if (overlayRef.current) {overlayRef.current.style.display = 'none'} return } const scratch = new Cesium.Cartesian2() @@ -62,7 +62,7 @@ export function FrontalCyclone({ viewer }: FrontalCycloneProps) { function frame(): void { const element = overlayRef.current - if (!activeViewer || activeViewer.isDestroyed() || !element) return + if (!activeViewer || activeViewer.isDestroyed() || !element) {return} let facing = true if (activeViewer.scene.mode === Cesium.SceneMode.SCENE3D) { activeViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(ANCHOR, scratchNormal) diff --git a/src/renderer/src/components/GlobeToolbar.tsx b/src/renderer/src/components/GlobeToolbar.tsx index 966fa684..6236fb68 100644 --- a/src/renderer/src/components/GlobeToolbar.tsx +++ b/src/renderer/src/components/GlobeToolbar.tsx @@ -46,7 +46,7 @@ export interface GlobeToolbarProps { onUpdateClick: () => void } -const tools: Array<{ id: DrawTool; label: string; icon: ReactNode }> = [ +const tools: { id: DrawTool; label: string; icon: ReactNode }[] = [ { id: 'point', label: '绘制点', icon: }, { id: 'line', label: '绘制线', icon: }, { id: 'polygon', label: '绘制多边形', icon: }, diff --git a/src/renderer/src/components/HuLineOverlay.tsx b/src/renderer/src/components/HuLineOverlay.tsx index 55ae33a2..72de9754 100644 --- a/src/renderer/src/components/HuLineOverlay.tsx +++ b/src/renderer/src/components/HuLineOverlay.tsx @@ -13,7 +13,7 @@ interface CardScratch { toCamera: Cesium.Cartesian3 } -const ANCHOR_VIEW_HEIGHT = 9000000 +const ANCHOR_VIEW_HEIGHT = 9_000_000 const eastAnchor = Cesium.Cartesian3.fromDegrees(119.5, 33) const westAnchor = Cesium.Cartesian3.fromDegrees(96, 37.5) @@ -23,7 +23,7 @@ function updateCard( anchor: Cesium.Cartesian3, scratch: CardScratch ): void { - if (!element) return + if (!element) {return} let facing = true if (current.scene.mode === Cesium.SceneMode.SCENE3D) { current.scene.globe.ellipsoid.geodeticSurfaceNormal(anchor, scratch.normal) @@ -50,8 +50,8 @@ export function HuLineOverlay({ viewer }: HuLineOverlayProps) { useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (eastRef.current) eastRef.current.style.display = 'none' - if (westRef.current) westRef.current.style.display = 'none' + if (eastRef.current) {eastRef.current.style.display = 'none'} + if (westRef.current) {westRef.current.style.display = 'none'} return } const eastScratch: CardScratch = { @@ -66,7 +66,7 @@ export function HuLineOverlay({ viewer }: HuLineOverlayProps) { } function frame(): void { - if (!activeViewer || activeViewer.isDestroyed()) return + if (!activeViewer || activeViewer.isDestroyed()) {return} updateCard(activeViewer, eastRef.current, eastAnchor, eastScratch) updateCard(activeViewer, westRef.current, westAnchor, westScratch) } diff --git a/src/renderer/src/components/InlineTextEditor.tsx b/src/renderer/src/components/InlineTextEditor.tsx index e5b75699..7aecd705 100644 --- a/src/renderer/src/components/InlineTextEditor.tsx +++ b/src/renderer/src/components/InlineTextEditor.tsx @@ -1,4 +1,5 @@ -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, type CSSProperties } from 'react' +import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react'; +import type { CSSProperties } from 'react'; import * as Cesium from 'cesium' import type { DrawnShape } from '@renderer/stores/drawing' import styles from './InlineTextEditor.module.css' @@ -10,9 +11,9 @@ export interface InlineTextEditorProps { } function editorTextShadow(color: string, framed: boolean): string { - if (framed) return 'none' + if (framed) {return 'none'} const match = /^#([\da-f]{6})$/i.exec(color) - if (!match) return '0 0 3px rgba(0, 0, 0, 0.9)' + if (!match) {return '0 0 3px rgba(0, 0, 0, 0.9)'} const red = Number.parseInt(match[1].slice(0, 2), 16) const green = Number.parseInt(match[1].slice(2, 4), 16) const blue = Number.parseInt(match[1].slice(4, 6), 16) @@ -35,7 +36,7 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr const currentShape = shapeRef.current const root = rootRef.current const editor = editorRef.current - if (!editor) return + if (!editor) {return} if (!currentViewer || currentViewer.isDestroyed() || !root || !currentShape || currentShape.kind !== 'text') { editor.style.visibility = 'hidden' return @@ -67,7 +68,7 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr const resizeEditor = useCallback((): void => { const editor = editorRef.current - if (!editor) return + if (!editor) {return} editor.style.height = 'auto' editor.style.height = `${Math.max(32, editor.scrollHeight)}px` }, []) @@ -85,7 +86,7 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr }, [viewer, updatePosition]) useLayoutEffect(() => { - if (!shape || shape.kind !== 'text') return + if (shape?.kind !== 'text') {return} const editor = editorRef.current if (editor) { editor.focus() @@ -96,13 +97,13 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr }, [shape?.id, shape?.kind, resizeEditor, updatePosition]) useLayoutEffect(() => { - if (!shape || shape.kind !== 'text') return + if (shape?.kind !== 'text') {return} resizeEditor() updatePosition() }, [shape?.annotation, shape?.positions, shape?.fontSize, shape?.fontFamily, shape?.textFrame, shape?.kind, resizeEditor, updatePosition]) const editorStyle = useMemo(() => { - if (!shape || shape.kind !== 'text') return {} + if (shape?.kind !== 'text') {return {}} return { color: shape.textColor, fontFamily: `"${shape.fontFamily}", sans-serif`, diff --git a/src/renderer/src/components/LandformGuidePanel.tsx b/src/renderer/src/components/LandformGuidePanel.tsx index da31f4e7..1d5aeb95 100644 --- a/src/renderer/src/components/LandformGuidePanel.tsx +++ b/src/renderer/src/components/LandformGuidePanel.tsx @@ -28,8 +28,8 @@ const sites: LandformSite[] = [ type: '流水溶蚀(湿蚀)', color: '#52c41a', longitude: 110.5, - latitude: 25.0, - height: 70000, + latitude: 25, + height: 70_000, features: ['峰林、峰丛、孤峰,溶洞与地下河', '地面崎岖,地表水易渗漏', '“山水甲天下”的塔状山体'], cause: '石灰岩(可溶性岩石)+ 湿热气候:流水对碳酸盐岩长期溶蚀与沉积,形成地上峰林、地下溶洞的双重喀斯特景观。云贵高原为上游,多溶洞洼地;广西盆地边缘水流集中,峰林发育最典型。' }, @@ -40,7 +40,7 @@ const sites: LandformSite[] = [ color: '#fa8c16', longitude: 92.9, latitude: 40.4, - height: 90000, + height: 90_000, features: ['沟垄相间、垄脊与沟槽定向排列', '“魔鬼城”式残丘、风蚀蘑菇、风蚀柱', '地表干旱、植被稀少'], cause: '干旱区风力侵蚀:古湖沉积的固结较差的泥岩、粉砂岩,经受盛行风长期吹蚀与磨蚀,软弱处形成沟槽、坚硬处残留为垄岗,延伸方向与盛行风向一致。' }, @@ -51,7 +51,7 @@ const sites: LandformSite[] = [ color: '#1677ff', longitude: 101.95, latitude: 29.6, - height: 100000, + height: 100_000, features: ['U 形谷(槽谷)、角峰、刃脊', '冰碛垄、冰碛湖等堆积地貌', '现代海洋性冰川伸入森林带'], cause: '高山高纬地区冰川运动:冰川体对谷地底部与两侧强烈刨蚀、磨蚀,把 V 形谷改造为 U 形谷;冰川消融后携带的碎屑(冰碛物)堆积形成冰碛地貌。' }, @@ -62,7 +62,7 @@ const sites: LandformSite[] = [ color: '#13c2c2', longitude: 122.05, latitude: 39.08, - height: 60000, + height: 60_000, features: ['海蚀崖、海蚀拱桥、海蚀柱', '邻近海湾发育沙滩等堆积地貌', '基岩海岸与沙质海岸并存'], cause: '海浪长期拍击基岩海岸,软弱处被掏蚀形成海蚀穴→海蚀洞→海蚀拱桥→海蚀柱的演变链;被侵蚀的泥沙在波浪动能减弱的海湾堆积,形成沙滩与沙嘴。' }, @@ -73,7 +73,7 @@ const sites: LandformSite[] = [ color: '#faad14', longitude: 109.5, latitude: 36.5, - height: 400000, + height: 400_000, features: ['塬、梁、峁千沟万壑', '水土流失严重,河流含沙量大', '黄土直立性强、多孔隙'], cause: '风力从西北内陆搬运的粉尘堆积形成厚层黄土;黄土疏松多孔,夏季暴雨冲刷形成密集沟壑,塬被切割为梁、峁,是“风成黄土、流水塑造”的组合地貌。' } diff --git a/src/renderer/src/components/LayerPanel.tsx b/src/renderer/src/components/LayerPanel.tsx index 1b08e976..ce16b49a 100644 --- a/src/renderer/src/components/LayerPanel.tsx +++ b/src/renderer/src/components/LayerPanel.tsx @@ -1,4 +1,5 @@ -import { useMemo, useState, type MouseEvent } from 'react' +import { useMemo, useState } from 'react'; +import type { MouseEvent } from 'react'; import { MoreHorizontalIcon, RotateCwIcon, XIcon } from 'lucide-react' import { Accordion, @@ -14,13 +15,8 @@ import { Switch, Tooltip } from '@renderer/components/ui' -import { - basemapCategories, - providerCatalog, - terrainCatalog, - type LayerMeta, - type ProviderMeta -} from '@renderer/stores/globe' +import { basemapCategories, providerCatalog, terrainCatalog } from '@renderer/stores/globe'; +import type { LayerMeta, ProviderMeta } from '@renderer/stores/globe'; import styles from './LayerPanel.module.css' export interface LayerPanelProps { @@ -119,7 +115,7 @@ export function LayerPanel({ function handleSettingsOpacity(value: number): void { const layer = settingsCategory?.activeLayer - if (layer) onOpacity(layer.id, value / 100) + if (layer) {onOpacity(layer.id, value / 100)} } return ( @@ -207,7 +203,7 @@ export function LayerPanel({ options={terrainSelectOptions} aria-label="选择 3D 地形" onChange={(value) => { - if (value) onTerrain(value) + if (value) {onTerrain(value)} }} /> {terrainDegraded && ( diff --git a/src/renderer/src/components/LocationDecisionPanel.tsx b/src/renderer/src/components/LocationDecisionPanel.tsx index 30c8dae8..631d0aab 100644 --- a/src/renderer/src/components/LocationDecisionPanel.tsx +++ b/src/renderer/src/components/LocationDecisionPanel.tsx @@ -47,8 +47,8 @@ export function LocationDecisionPanel({ viewer, onClose }: LocationDecisionPanel } function flyToPlace(): void { - if (flyingRef.current) return - if (!viewer || viewer.isDestroyed()) return + if (flyingRef.current) {return} + if (!viewer || viewer.isDestroyed()) {return} flyingRef.current = true const settle = (): void => { flyingRef.current = false @@ -56,7 +56,7 @@ export function LocationDecisionPanel({ viewer, onClose }: LocationDecisionPanel try { const [lon, lat] = activeCase.placeLonLat viewer.camera.flyTo({ - destination: Cesium.Cartesian3.fromDegrees(lon, lat, 220000), + destination: Cesium.Cartesian3.fromDegrees(lon, lat, 220_000), duration: 1.5, complete: settle, cancel: settle diff --git a/src/renderer/src/components/MemorySettings.tsx b/src/renderer/src/components/MemorySettings.tsx index 32a91ee3..e10b9f41 100644 --- a/src/renderer/src/components/MemorySettings.tsx +++ b/src/renderer/src/components/MemorySettings.tsx @@ -31,19 +31,19 @@ export function MemorySettings({ active }: MemorySettingsProps) { const sortedMemories = useMemo(() => [...memories].reverse(), [memories]) useEffect(() => { - if (!active) return + if (!active) {return} let cancelled = false setLoading(true) window.guEarth.ai.memory .list() .then((list) => { - if (!cancelled) setMemories(list) + if (!cancelled) {setMemories(list)} }) .catch(() => { - if (!cancelled) toast.error('无法读取记忆列表,请重试') + if (!cancelled) {toast.error('无法读取记忆列表,请重试')} }) .finally(() => { - if (!cancelled) setLoading(false) + if (!cancelled) {setLoading(false)} }) return () => { cancelled = true @@ -52,7 +52,7 @@ export function MemorySettings({ active }: MemorySettingsProps) { async function addMemory(): Promise { const content = draft.trim() - if (!content || adding) return + if (!content || adding) {return} setAdding(true) try { const next = await window.guEarth.ai.memory.add(content) @@ -77,7 +77,7 @@ export function MemorySettings({ active }: MemorySettingsProps) { } async function toggleEnabled(value: boolean): Promise { - if (switchBusy) return + if (switchBusy) {return} setSwitchBusy(true) try { await setMemoryEnabled(value) diff --git a/src/renderer/src/components/MirrorConsentModal.tsx b/src/renderer/src/components/MirrorConsentModal.tsx index 15bdbeb9..6d800e52 100644 --- a/src/renderer/src/components/MirrorConsentModal.tsx +++ b/src/renderer/src/components/MirrorConsentModal.tsx @@ -1,4 +1,5 @@ -import { useEffect, useState, type MouseEvent } from 'react' +import { useEffect, useState } from 'react'; +import type { MouseEvent } from 'react'; import { Button, Checkbox, Modal } from '@renderer/components/ui' import type { MirrorPolicyId } from '../../../common/mirrorPolicies' import { useGlobeStore } from '@renderer/stores/globe' @@ -16,7 +17,7 @@ export function MirrorConsentModal(_props: MirrorConsentModalProps) { const [agreed, setAgreed] = useState(false) useEffect(() => { - if (mirrorConsentOpen) setAgreed(false) + if (mirrorConsentOpen) {setAgreed(false)} }, [mirrorConsentOpen]) const detectionNotice = @@ -41,7 +42,7 @@ export function MirrorConsentModal(_props: MirrorConsentModalProps) { } function handleAccept(): void { - if (!agreed) return + if (!agreed) {return} acceptMirrorConsent() } diff --git a/src/renderer/src/components/MirrorPolicyModal.tsx b/src/renderer/src/components/MirrorPolicyModal.tsx index 76fa7292..08a74ae4 100644 --- a/src/renderer/src/components/MirrorPolicyModal.tsx +++ b/src/renderer/src/components/MirrorPolicyModal.tsx @@ -1,13 +1,10 @@ import { useEffect, useMemo, useRef } from 'react' -import { Button, Modal, Tabs, type TabItem } from '@renderer/components/ui' +import { Button, Modal, Tabs } from '@renderer/components/ui'; +import type { TabItem } from '@renderer/components/ui'; import agreementMarkdown from '../../../../docs/policies/MIRROR-SERVICE-AGREEMENT.md?raw' import acceptableUseMarkdown from '../../../../docs/policies/ACCEPTABLE-USE-POLICY.md?raw' -import { - MIRROR_POLICY_FALLBACK_TITLES, - parsePolicyMarkdown, - type MirrorPolicyId, - type ParsedPolicyMarkdown -} from '../../../common/mirrorPolicies' +import { MIRROR_POLICY_FALLBACK_TITLES, parsePolicyMarkdown } from '../../../common/mirrorPolicies'; +import type { MirrorPolicyId, ParsedPolicyMarkdown } from '../../../common/mirrorPolicies'; import { useGlobeStore } from '@renderer/stores/globe' import { renderMarkdown } from '@renderer/utils/markdown' import styles from './MirrorPolicyModal.module.css' @@ -36,8 +33,8 @@ export function MirrorPolicyModal(_props: MirrorPolicyModalProps) { const renderedNodes = useMemo(() => renderMarkdown(activePolicy.body), [activePolicy.body]) useEffect(() => { - if (!mirrorPolicyOpen) return - if (policyBodyRef.current) policyBodyRef.current.scrollTop = 0 + if (!mirrorPolicyOpen) {return} + if (policyBodyRef.current) {policyBodyRef.current.scrollTop = 0} }, [mirrorPolicyOpen, mirrorPolicyActiveId]) function handleTabChange(key: string): void { diff --git a/src/renderer/src/components/MonthTimeline.tsx b/src/renderer/src/components/MonthTimeline.tsx index b83c3ff6..5540ae1f 100644 --- a/src/renderer/src/components/MonthTimeline.tsx +++ b/src/renderer/src/components/MonthTimeline.tsx @@ -25,15 +25,15 @@ export function MonthTimeline({ viewer }: MonthTimelineProps) { const flightStopsVisible = useFlightStopsStore((state) => state.visible) useVisibleAnimation(isPlaying && hasSeasonalOverlay, (dt) => { - if (dt > 0) advance(dt) - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (dt > 0) {advance(dt)} + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }) useEffect(() => { - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }, [month, viewer]) - if (!hasSeasonalOverlay) return null + if (!hasSeasonalOverlay) {return null} const displayMonth = Math.min(12, Math.floor(month)) const seasonText = diff --git a/src/renderer/src/components/OceanPropertyPanel.tsx b/src/renderer/src/components/OceanPropertyPanel.tsx index 923eb4df..cf8ffa98 100644 --- a/src/renderer/src/components/OceanPropertyPanel.tsx +++ b/src/renderer/src/components/OceanPropertyPanel.tsx @@ -1,14 +1,15 @@ import { useMemo } from 'react' import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './OceanPropertyPanel.module.css' export interface OceanPropertyPanelProps { onClose: () => void } -const temperatureStops: Array<[number, number]> = [ +const temperatureStops: [number, number][] = [ [-60, 2.5], [-50, 4.5], [-40, 9], @@ -24,7 +25,7 @@ const temperatureStops: Array<[number, number]> = [ [60, 8] ] -const salinityStops: Array<[number, number]> = [ +const salinityStops: [number, number][] = [ [-60, 33.6], [-50, 33.9], [-40, 34.4], diff --git a/src/renderer/src/components/PlaceSearchBox.tsx b/src/renderer/src/components/PlaceSearchBox.tsx index d74aeaa2..b5f68c63 100644 --- a/src/renderer/src/components/PlaceSearchBox.tsx +++ b/src/renderer/src/components/PlaceSearchBox.tsx @@ -1,7 +1,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Autocomplete as BaseAutocomplete } from '@base-ui/react/autocomplete' import { ChevronDownIcon, Loader2Icon, SearchIcon, XIcon } from 'lucide-react' -import { Button, DropdownMenu, type DropdownMenuEntry } from '@renderer/components/ui' +import { Button, DropdownMenu } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; import { useGlobeStore } from '@renderer/stores/globe' import { useFailureStore } from '@renderer/stores/failure' import type { PlaceSearchProvider, PlaceSuggestion } from '../../../preload' @@ -22,7 +23,7 @@ interface PlaceOption { place?: PlaceSuggestion } -const providerDefinitions: Array<{ id: PlaceSearchProvider; name: string }> = [ +const providerDefinitions: { id: PlaceSearchProvider; name: string }[] = [ { id: 'amap', name: '高德' }, { id: 'baidu', name: '百度' } ] @@ -31,7 +32,7 @@ function regionText(place: PlaceSuggestion): string { const region = [place.province, place.city, place.district] .filter((part) => part && part !== place.name) .join(' · ') - return [region, place.address].filter((part) => part).join(' · ') + return [region, place.address].filter(Boolean).join(' · ') } function providerName(id?: PlaceSearchProvider): string { @@ -105,7 +106,7 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { } const retryLast = (): void => { const query = lastQueryRef.current.trim() - if (query) void search(query) + if (query) {void search(query)} } setOptions([ { @@ -125,14 +126,14 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { } return } - if (seq !== requestSeqRef.current) return - if (result.superseded) return + if (seq !== requestSeqRef.current) {return} + if (result.superseded) {return} if (result.fellBackFrom) { reportDegrade(`${providerName(result.fellBackFrom)}不可用,已改用${providerName(result.source)}`) } if (result.error) { setOptions([statusOption(result.error, true, retryLast)]) - } else if (!result.places.length) { + } else if (result.places.length === 0) { setOptions([ statusOption(result.note ?? '没有找到匹配的地点,可换个说法或切换搜索源', false) ]) @@ -148,34 +149,34 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { const previousProvider = previousRef.current.providerId previousRef.current = { text: keyword, providerId } - if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current) + if (debounceTimerRef.current) {clearTimeout(debounceTimerRef.current)} requestSeqRef.current += 1 setOptions([]) if (suppressWatchRef.current) { suppressWatchRef.current = false - if (providerId === previousProvider && keyword !== previousText) return + if (providerId === previousProvider && keyword !== previousText) {return} } const query = keyword.trim() - if (!query) return + if (!query) {return} debounceTimerRef.current = setTimeout(() => { void search(query) }, 300) }, [keyword, providerId, credentialUpdatedAt, search]) useEffect(() => { - if (!showProviderSelect) setProviderMenuOpen(false) + if (!showProviderSelect) {setProviderMenuOpen(false)} }, [showProviderSelect]) - useEffect(() => { - return () => { - if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current) + useEffect(() => + () => { + if (debounceTimerRef.current) {clearTimeout(debounceTimerRef.current)} requestSeqRef.current += 1 } - }, []) + , []) function handleSelectOption(option: PlaceOption): void { - if (!option.place) return - if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current) + if (!option.place) {return} + if (debounceTimerRef.current) {clearTimeout(debounceTimerRef.current)} requestSeqRef.current += 1 suppressWatchRef.current = keyword !== option.place.name setKeyword(option.place.name) @@ -185,8 +186,8 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { } function handleProviderSelect(key: string): void { - if (key !== 'amap' && key !== 'baidu') return - if (!availableProviders.some((item) => item.id === key)) return + if (key !== 'amap' && key !== 'baidu') {return} + if (!availableProviders.some((item) => item.id === key)) {return} setPreferredProvider(key) setProviderMenuOpen(false) requestAnimationFrame(() => { @@ -262,7 +263,7 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { aria-expanded={providerMenuOpen} onMouseDown={(event) => event.stopPropagation()} onKeyDown={(event) => { - if (event.key === 'Escape') setProviderMenuOpen(false) + if (event.key === 'Escape') {setProviderMenuOpen(false)} }} > {provider?.name} diff --git a/src/renderer/src/components/PopulationPanel.tsx b/src/renderer/src/components/PopulationPanel.tsx index 2eb0e0f4..29d2e38a 100644 --- a/src/renderer/src/components/PopulationPanel.tsx +++ b/src/renderer/src/components/PopulationPanel.tsx @@ -14,8 +14,10 @@ import { urbanizationFacts, urbanizationSeries } from '@renderer/thematic/populationCensus' -import BarChart, { type BarSeries } from './charts/BarChart' -import LineChart, { type ChartSeries } from './charts/LineChart' +import BarChart from './charts/BarChart'; +import type { BarSeries } from './charts/BarChart'; +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './PopulationPanel.module.css' export interface PopulationPanelProps { @@ -24,7 +26,7 @@ export interface PopulationPanelProps { type Tab = 'pyramid' | 'urbanization' | 'hu-line' -const tabOptions: Array<{ value: Tab; label: string }> = [ +const tabOptions: { value: Tab; label: string }[] = [ { value: 'pyramid', label: '金字塔' }, { value: 'urbanization', label: '城镇化' }, { value: 'hu-line', label: '胡焕庸线' } @@ -69,7 +71,7 @@ export function PopulationPanel({ onClose }: PopulationPanelProps) { size="sm" options={tabOptions} aria-label="人口面板标签" - onChange={(value) => setTab(value as Tab)} + onChange={(value) => setTab(value)} />
diff --git a/src/renderer/src/components/RiverLandformPanel.tsx b/src/renderer/src/components/RiverLandformPanel.tsx index b2c4717f..428d2848 100644 --- a/src/renderer/src/components/RiverLandformPanel.tsx +++ b/src/renderer/src/components/RiverLandformPanel.tsx @@ -2,7 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import * as Cesium from 'cesium' import { Loader2Icon, XIcon } from 'lucide-react' import { Alert, Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './RiverLandformPanel.module.css' export interface RiverLandformPanelProps { @@ -15,7 +16,7 @@ interface RiverReach { name: string stage: string center: [number, number, number] - waypoints: Array<[number, number]> + waypoints: [number, number][] landform: string facts: string[] } @@ -25,7 +26,7 @@ const reaches: RiverReach[] = [ id: 'upper', name: '上游 · 金沙江虎跳峡', stage: '上游:V 形谷', - center: [100.05, 27.25, 46000], + center: [100.05, 27.25, 46_000], waypoints: [ [99.8, 27.48], [99.92, 27.37], @@ -44,13 +45,13 @@ const reaches: RiverReach[] = [ id: 'middle', name: '中游 · 荆江河曲', stage: '中游:河曲', - center: [112.5, 29.75, 150000], + center: [112.5, 29.75, 150_000], waypoints: [ [111.8, 29.9], [112.1, 29.72], [112.4, 29.82], [112.7, 29.62], - [113.0, 29.72] + [113, 29.72] ], landform: '河曲:侧蚀为主,凹岸侵蚀、凸岸堆积', facts: [ @@ -63,13 +64,13 @@ const reaches: RiverReach[] = [ id: 'lower', name: '下游 · 长江三角洲', stage: '下游:三角洲', - center: [120.7, 31.6, 300000], + center: [120.7, 31.6, 300_000], waypoints: [ [118.8, 31.95], [119.8, 31.75], [120.6, 31.58], [121.4, 31.42], - [122.0, 31.3] + [122, 31.3] ], landform: '三角洲:流速骤降,泥沙堆积为主', facts: [ @@ -80,8 +81,8 @@ const reaches: RiverReach[] = [ } ] -function interpolate(waypoints: Array<[number, number]>): Array<[number, number]> { - const points: Array<[number, number]> = [] +function interpolate(waypoints: [number, number][]): [number, number][] { + const points: [number, number][] = [] for (let index = 0; index < waypoints.length - 1; index += 1) { const [x0, y0] = waypoints[index] const [x1, y1] = waypoints[index + 1] @@ -95,7 +96,7 @@ function interpolate(waypoints: Array<[number, number]>): Array<[number, number] export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) { const [activeReach, setActiveReach] = useState(reaches[0]) - const [profile, setProfile] = useState>([]) + const [profile, setProfile] = useState<[number, number][]>([]) const [sampling, setSampling] = useState(false) const [degraded, setDegraded] = useState(false) @@ -108,7 +109,7 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) sampleSeqRef.current += 1 const seq = sampleSeqRef.current setProfile([]) - if (!targetViewer || targetViewer.isDestroyed()) return + if (!targetViewer || targetViewer.isDestroyed()) {return} setSampling(true) setDegraded(false) try { @@ -118,7 +119,7 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) let isDegraded = false try { const sampled = await Cesium.sampleTerrainMostDetailed(targetViewer.terrainProvider, cartographics) - if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) return + if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) {return} heights = sampled.map((item) => Number.isFinite(item.height) ? item.height @@ -128,11 +129,11 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) ) isDegraded = sampled.some((item) => !Number.isFinite(item.height)) } catch { - if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) return + if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) {return} heights = cartographics.map((item) => targetViewer.scene.globe.getHeight(item) ?? 0) isDegraded = true } - if (sampleSeqRef.current !== seq) return + if (sampleSeqRef.current !== seq) {return} setDegraded(isDegraded) let distance = 0 setProfile( @@ -180,8 +181,8 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) } const xMax = Math.max(60, Math.ceil(profile[profile.length - 1]?.[0] ?? 60)) - const yMin = Math.min(0, Math.floor((profile.length ? Math.min(...profile.map((p) => p[1])) : 0) / 500) * 500) - const yMax = Math.ceil((profile.length ? Math.max(...profile.map((p) => p[1])) : 1000) / 500) * 500 + const yMin = Math.min(0, Math.floor((profile.length > 0 ? Math.min(...profile.map((p) => p[1])) : 0) / 500) * 500) + const yMax = Math.ceil((profile.length > 0 ? Math.max(...profile.map((p) => p[1])) : 1000) / 500) * 500 return (
diff --git a/src/renderer/src/components/RotationSpeedPanel.tsx b/src/renderer/src/components/RotationSpeedPanel.tsx index 57f290a1..9f3e264f 100644 --- a/src/renderer/src/components/RotationSpeedPanel.tsx +++ b/src/renderer/src/components/RotationSpeedPanel.tsx @@ -1,7 +1,8 @@ import { useMemo } from 'react' import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './RotationSpeedPanel.module.css' export interface RotationSpeedPanelProps { @@ -46,7 +47,7 @@ const facts = [ export function RotationSpeedPanel({ onClose }: RotationSpeedPanelProps) { const speedSeries = useMemo(() => { - const points: Array<[number, number]> = [] + const points: [number, number][] = [] for (let lat = -90; lat <= 90; lat += 2) { points.push([lat, EQUATOR_SPEED_KMH * Math.cos((lat * Math.PI) / 180)]) } diff --git a/src/renderer/src/components/SceneBookmarksPanel.tsx b/src/renderer/src/components/SceneBookmarksPanel.tsx index b8408dfa..2e591fbd 100644 --- a/src/renderer/src/components/SceneBookmarksPanel.tsx +++ b/src/renderer/src/components/SceneBookmarksPanel.tsx @@ -35,9 +35,9 @@ export interface SceneBookmarksPanelProps { scenes: TeachingScene[] saveError: string onClose: () => void - onSave: (name: string, narration: string) => void + onSave: (name: string, narration: string) => void | Promise onPreview: (id: string) => void - onUpdate: (id: string, changes: SceneEditPayload) => void + onUpdate: (id: string, changes: SceneEditPayload) => void | Promise onRemove: (id: string) => void onMove: (id: string, offset: -1 | 1) => void onPlay: (mode: 'manual' | 'auto') => void @@ -51,7 +51,7 @@ const narrationPreview = (scene: TeachingScene): string => const sceneTags = (scene: TeachingScene): string[] => { const names = scene.snapshot.overlays.slice(0, 2).map(layerNameOf) - if (scene.snapshot.overlays.length > 2) names.push(`+${scene.snapshot.overlays.length - 2}`) + if (scene.snapshot.overlays.length > 2) {names.push(`+${scene.snapshot.overlays.length - 2}`)} return names } @@ -86,9 +86,9 @@ export function SceneBookmarksPanel({ function confirmSave(): void { const name = saveName.trim() - if (!name) return + if (!name) {return} setSaveVisible(false) - onSave(name, saveNarration.trim()) + void onSave(name, saveNarration.trim()) } function openEdit(scene: TeachingScene): void { @@ -101,9 +101,9 @@ export function SceneBookmarksPanel({ function confirmEdit(): void { const name = editName.trim() - if (!name) return + if (!name) {return} setEditVisible(false) - onUpdate(editId, { + void onUpdate(editId, { name, narration: editNarration.trim(), dwellSeconds: Math.min(60, Math.max(1, editDwellSeconds ?? 6)) @@ -138,7 +138,7 @@ export function SceneBookmarksPanel({ {saveError && }
- {!scenes.length ? ( + {scenes.length === 0 ? (
将当前视角与图层保存为场景,方便课堂播放。 diff --git a/src/renderer/src/components/ScenePlayerOverlay.tsx b/src/renderer/src/components/ScenePlayerOverlay.tsx index 581931b5..f15697f6 100644 --- a/src/renderer/src/components/ScenePlayerOverlay.tsx +++ b/src/renderer/src/components/ScenePlayerOverlay.tsx @@ -1,7 +1,8 @@ import { useEffect } from 'react' import { SkipForwardIcon } from 'lucide-react' import { Button, Segmented, Spinner } from '@renderer/components/ui' -import { useScenesStore, type RecordingPrewarmQuality } from '@renderer/stores/scenes' +import { useScenesStore } from '@renderer/stores/scenes'; +import type { RecordingPrewarmQuality } from '@renderer/stores/scenes'; import type { PlayerState } from '@renderer/composables/useScenePlayer' import styles from './ScenePlayerOverlay.module.css' @@ -11,7 +12,7 @@ export interface ScenePlayerOverlayProps { onStop: () => void } -const prewarmQualityOptions: Array<{ label: string; value: RecordingPrewarmQuality }> = [ +const prewarmQualityOptions: { label: string; value: RecordingPrewarmQuality }[] = [ { label: '标准', value: 'standard' }, { label: '高清', value: 'high' }, { label: '极清', value: 'ultra' } @@ -24,7 +25,7 @@ export function ScenePlayerOverlay({ player, onNext, onStop }: ScenePlayerOverla useEffect(() => { function handleKeydown(event: KeyboardEvent): void { - if (!player.active) return + if (!player.active) {return} if (event.key === 'Escape') { event.preventDefault() onStop() @@ -39,7 +40,7 @@ export function ScenePlayerOverlay({ player, onNext, onStop }: ScenePlayerOverla return () => window.removeEventListener('keydown', handleKeydown) }, [player.active, onNext, onStop]) - if (!player.active) return null + if (!player.active) {return null} const recordingActive = recording.state === 'recording' || recording.state === 'preparing' const isRecordingPreparing = recording.state === 'preparing' @@ -52,10 +53,10 @@ export function ScenePlayerOverlay({ player, onNext, onStop }: ScenePlayerOverla : '' let recordNotice = '' - if (recording.state === 'preparing') recordNotice = '正在准备录制…' - else if (recording.state === 'recording') recordNotice = `录制中 ${recording.currentStep}/${recording.totalSteps}` - else if (recording.state === 'saving') recordNotice = '正在保存视频…' - else if (recording.state === 'error') recordNotice = `录制失败:${recording.error}` + if (recording.state === 'preparing') {recordNotice = '正在准备录制…'} + else if (recording.state === 'recording') {recordNotice = `录制中 ${recording.currentStep}/${recording.totalSteps}`} + else if (recording.state === 'saving') {recordNotice = '正在保存视频…'} + else if (recording.state === 'error') {recordNotice = `录制失败:${recording.error}`} return (
diff --git a/src/renderer/src/components/SearchProviderSettings.tsx b/src/renderer/src/components/SearchProviderSettings.tsx index 3c89b40e..8c2f5b4e 100644 --- a/src/renderer/src/components/SearchProviderSettings.tsx +++ b/src/renderer/src/components/SearchProviderSettings.tsx @@ -38,16 +38,16 @@ export function SearchProviderSettings({ const [error, setError] = useState('') const refreshCredential = useCallback(async (providerId = selectedIdRef.current): Promise => { - if (!providerId) return + if (!providerId) {return} setLoading(true) setError('') try { const status = await window.guEarth.settings.hasProviderApiKey(`ai-search-${providerId}`) - if (selectedIdRef.current === providerId) setCredential(status) + if (selectedIdRef.current === providerId) {setCredential(status)} } catch { - if (selectedIdRef.current === providerId) setError('无法读取搜索密钥状态,请重试') + if (selectedIdRef.current === providerId) {setError('无法读取搜索密钥状态,请重试')} } finally { - if (selectedIdRef.current === providerId) setLoading(false) + if (selectedIdRef.current === providerId) {setLoading(false)} } }, []) @@ -65,7 +65,7 @@ export function SearchProviderSettings({ async function saveKey(): Promise { const providerId = selectedIdRef.current const key = apiKeyDraft.trim() - if (!providerId || !key || saving || clearing) return + if (!providerId || !key || saving || clearing) {return} setSaving(true) setError('') try { @@ -84,7 +84,7 @@ export function SearchProviderSettings({ async function clearKey(): Promise { const providerId = selectedIdRef.current - if (!providerId || saving || clearing) return + if (!providerId || saving || clearing) {return} setClearing(true) setError('') try { @@ -111,7 +111,7 @@ export function SearchProviderSettings({ aria-label="默认搜索供应商" className={styles.searchProviderSelect} onChange={(value) => { - if (value) onActiveProviderIdChange(value) + if (value) {onActiveProviderIdChange(value)} }} /> )} diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsx index d891ce0c..760dcb2d 100644 --- a/src/renderer/src/components/SettingsModal.tsx +++ b/src/renderer/src/components/SettingsModal.tsx @@ -1,20 +1,14 @@ import { useCallback, useRef, useState } from 'react' -import { - BotIcon, - FlaskConicalIcon, - GlobeIcon, - InfoIcon, - ShieldCheckIcon, - SlidersHorizontalIcon, - UserIcon, - type LucideIcon -} from 'lucide-react' +import { BotIcon, FlaskConicalIcon, GlobeIcon, InfoIcon, ShieldCheckIcon, SlidersHorizontalIcon, UserIcon } from 'lucide-react'; +import type { LucideIcon } from 'lucide-react'; import { Modal } from '@renderer/components/ui' -import { useSettingsWindowStore, type SettingsSection } from '@renderer/stores/settingsWindow' +import { useSettingsWindowStore } from '@renderer/stores/settingsWindow'; +import type { SettingsSection } from '@renderer/stores/settingsWindow'; import AccountSettings from './settings/AccountSettings' import GeneralSettings from './settings/GeneralSettings' import MapSettings from './settings/MapSettings' -import AiSettingsSection, { type AiSettingsSectionHandle } from './settings/AiSettingsSection' +import AiSettingsSection from './settings/AiSettingsSection'; +import type { AiSettingsSectionHandle } from './settings/AiSettingsSection'; import PrivacySettings from './settings/PrivacySettings' import LaboratorySettings from './settings/LaboratorySettings' import AboutSettings from './settings/AboutSettings' @@ -81,7 +75,7 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { const unsavedBarOpen = activeSection === 'ai' && aiDirty && !confirmOpen const handleBarSave = useCallback(async () => { - if (barSaving) return + if (barSaving) {return} setBarSaving(true) try { await aiSectionRef.current?.saveDrafts() @@ -96,16 +90,16 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { const runPendingAction = useCallback( (action: PendingAction | null) => { - if (!action) return - if (action.kind === 'navigate') setActiveSection(action.section) - else closeWindow() + if (!action) {return} + if (action.kind === 'navigate') {setActiveSection(action.section)} + else {closeWindow()} }, [closeWindow, setActiveSection] ) const requestNavigate = useCallback( (section: SettingsSection) => { - if (!settingsInteractive || section === activeSection) return + if (!settingsInteractive || section === activeSection) {return} const dirty = aiSectionRef.current?.isDirty() ?? aiDirty if (activeSection === 'ai' && dirty) { setPendingAction({ kind: 'navigate', section }) @@ -118,7 +112,7 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { ) const requestClose = useCallback(() => { - if (!settingsInteractive) return + if (!settingsInteractive) {return} const dirty = aiSectionRef.current?.isDirty() ?? aiDirty if (dirty) { setPendingAction({ kind: 'close' }) @@ -129,7 +123,7 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { }, [aiDirty, closeWindow, settingsInteractive]) const handleConfirmIgnore = useCallback(() => { - if (confirmSaving) return + if (confirmSaving) {return} aiSectionRef.current?.discardDrafts() const action = pendingAction setPendingAction(null) @@ -138,14 +132,14 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { }, [confirmSaving, pendingAction, runPendingAction]) const handleConfirmSave = useCallback(async () => { - if (confirmSaving) return + if (confirmSaving) {return} setConfirmSaving(true) try { const saved = await (aiSectionRef.current?.saveDrafts() ?? Promise.resolve(false)) const action = pendingAction setPendingAction(null) setConfirmOpen(false) - if (saved) runPendingAction(action) + if (saved) {runPendingAction(action)} } finally { setConfirmSaving(false) } diff --git a/src/renderer/src/components/SolarChartPanel.tsx b/src/renderer/src/components/SolarChartPanel.tsx index de4aa1f7..18d08485 100644 --- a/src/renderer/src/components/SolarChartPanel.tsx +++ b/src/renderer/src/components/SolarChartPanel.tsx @@ -3,7 +3,8 @@ import { XIcon } from 'lucide-react' import { Button, Segmented, Slider } from '@renderer/components/ui' import { useSolarStore } from '@renderer/stores/solar' import { dayLength, declinationForDate, monthStartDayOfYear, noonAltitudeDeg, solarDeclinationDeg } from '@renderer/thematic/solarMath' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './SolarChartPanel.module.css' export interface SolarChartPanelProps { @@ -31,7 +32,7 @@ const latitudeFormatter = (value: number): string => (value === 0 ? '0°' : `${M const dateFormatter = (value: number): string => { const index = monthStarts.findIndex((start, i) => value >= start && value < (monthStarts[i + 1] ?? 366)) - return index >= 0 ? `${index + 1}月` : '' + return index === -1 ? '' : `${index + 1}月` } export function SolarChartPanel({ className, onClose }: SolarChartPanelProps) { @@ -45,23 +46,23 @@ export function SolarChartPanel({ className, onClose }: SolarChartPanelProps) { const dayLengthSeries = useMemo(() => { if (mode === 'latitude') { - const points: Array<[number, number]> = [] - for (let lat = -90; lat <= 90; lat += 2) points.push([lat, dayLength(lat, declination).hours]) + const points: [number, number][] = [] + for (let lat = -90; lat <= 90; lat += 2) {points.push([lat, dayLength(lat, declination).hours])} return [{ name: '昼长', color: DAY_LENGTH_COLOR, points, markY: [12] }] } - const points: Array<[number, number]> = [] - for (let day = 1; day <= 365; day += 2) points.push([day, dayLength(latitude, solarDeclinationDeg(day)).hours]) + const points: [number, number][] = [] + for (let day = 1; day <= 365; day += 2) {points.push([day, dayLength(latitude, solarDeclinationDeg(day)).hours])} return [{ name: `昼长(${latLabel(latitude)})`, color: DAY_LENGTH_COLOR, points, markY: [12] }] }, [mode, declination, latitude]) const altitudeSeries = useMemo(() => { if (mode === 'latitude') { - const points: Array<[number, number]> = [] - for (let lat = -90; lat <= 90; lat += 2) points.push([lat, noonAltitudeDeg(lat, declination)]) + const points: [number, number][] = [] + for (let lat = -90; lat <= 90; lat += 2) {points.push([lat, noonAltitudeDeg(lat, declination)])} return [{ name: '正午太阳高度', color: ALTITUDE_COLOR, points, markY: [0] }] } - const points: Array<[number, number]> = [] - for (let day = 1; day <= 365; day += 2) points.push([day, noonAltitudeDeg(latitude, solarDeclinationDeg(day))]) + const points: [number, number][] = [] + for (let day = 1; day <= 365; day += 2) {points.push([day, noonAltitudeDeg(latitude, solarDeclinationDeg(day))])} return [{ name: `正午太阳高度(${latLabel(latitude)})`, color: ALTITUDE_COLOR, points, markY: [0] }] }, [mode, declination, latitude]) diff --git a/src/renderer/src/components/SolarPathPanel.tsx b/src/renderer/src/components/SolarPathPanel.tsx index e235c0d4..4fd4f895 100644 --- a/src/renderer/src/components/SolarPathPanel.tsx +++ b/src/renderer/src/components/SolarPathPanel.tsx @@ -3,15 +3,8 @@ import { PauseIcon, PlayIcon, XIcon } from 'lucide-react' import { Button, MonthDayPicker, Slider } from '@renderer/components/ui' import { useVisibleAnimation } from '@renderer/composables/useVisibleAnimation' import { useSolarStore } from '@renderer/stores/solar' -import { - dayLength, - declinationForDate, - formatClock, - horizonCrossingsDeg, - noonAltitudeDeg, - solarHorizontalPositionDeg, - type DayState -} from '@renderer/thematic/solarMath' +import { dayLength, declinationForDate, formatClock, horizonCrossingsDeg, noonAltitudeDeg, solarHorizontalPositionDeg } from '@renderer/thematic/solarMath'; +import type { DayState } from '@renderer/thematic/solarMath'; import styles from './SolarPathPanel.module.css' export interface SolarPathPanelProps { @@ -47,7 +40,7 @@ function polarPoint(azimuthDeg: number, altitudeDeg: number): { x: number; y: nu function directionText(azimuthDeg: number): string { const sector = Math.round(azimuthDeg / 45) % 8 const offset = Math.round(azimuthDeg - sector * 45) - if (offset === 0) return sector % 2 === 0 ? `正${DIRECTION_NAMES[sector]}` : DIRECTION_NAMES[sector] + if (offset === 0) {return sector % 2 === 0 ? `正${DIRECTION_NAMES[sector]}` : DIRECTION_NAMES[sector]} return offset > 0 ? `${DIRECTION_NAMES[sector]}偏${DIRECTION_NAMES[(sector + 1) % 8]}${offset}°` : `${DIRECTION_NAMES[sector]}偏${DIRECTION_NAMES[(sector + 7) % 8]}${-offset}°` @@ -78,13 +71,13 @@ export function SolarPathPanel({ onClose }: SolarPathPanelProps) { const sunNow = useMemo(() => solarHorizontalPositionDeg(latitude, declination, localHour), [latitude, declination, localHour]) const pathPoints = useMemo(() => { - if (length.state === 'polar-night') return '' - const points: Array<{ x: number; y: number }> = [] + if (length.state === 'polar-night') {return ''} + const points: { x: number; y: number }[] = [] for (let t = 0; t <= 24.001; t += 0.1) { const position = solarHorizontalPositionDeg(latitude, declination, t) - if (position.altitudeDeg > 0.3) points.push(polarPoint(position.azimuthDeg, position.altitudeDeg)) + if (position.altitudeDeg > 0.3) {points.push(polarPoint(position.azimuthDeg, position.altitudeDeg))} } - if (length.state === 'polar-day' && points.length > 1) points.push(points[0]) + if (length.state === 'polar-day' && points.length > 1) {points.push(points[0])} return points.map((point, index) => `${index === 0 ? 'M' : 'L'}${point.x.toFixed(1)},${point.y.toFixed(1)}`).join(' ') }, [length.state, latitude, declination]) @@ -112,7 +105,7 @@ export function SolarPathPanel({ onClose }: SolarPathPanelProps) { ) const noonSkyText = useMemo(() => { - if (noonPosition.altitudeDeg > 89) return '太阳位于天顶' + if (noonPosition.altitudeDeg > 89) {return '太阳位于天顶'} return noonPosition.azimuthDeg <= 22.5 || noonPosition.azimuthDeg >= 337.5 ? '正午太阳位于正北天空' : '正午太阳位于正南天空' @@ -120,13 +113,13 @@ export function SolarPathPanel({ onClose }: SolarPathPanelProps) { const stateText = useMemo(() => { const state: DayState = length.state - if (state === 'polar-day') return '当日极昼:太阳整日不落,轨迹为完整圆环' - if (state === 'polar-night') return '当日极夜:太阳始终位于地平圈以下,无视运动轨迹' + if (state === 'polar-day') {return '当日极昼:太阳整日不落,轨迹为完整圆环'} + if (state === 'polar-night') {return '当日极夜:太阳始终位于地平圈以下,无视运动轨迹'} return '' }, [length.state]) useVisibleAnimation(isPlaying, (dt) => { - if (dt > 0) setLocalHour((prev) => (prev + dt * LOCAL_HOURS_PER_SECOND) % 24) + if (dt > 0) {setLocalHour((prev) => (prev + dt * LOCAL_HOURS_PER_SECOND) % 24)} }) return ( diff --git a/src/renderer/src/components/SolarTimePanel.tsx b/src/renderer/src/components/SolarTimePanel.tsx index fdea5f6d..302b73df 100644 --- a/src/renderer/src/components/SolarTimePanel.tsx +++ b/src/renderer/src/components/SolarTimePanel.tsx @@ -1,4 +1,5 @@ -import { useEffect, useState, type ReactNode } from 'react' +import { useEffect, useState } from 'react'; +import type { ReactNode } from 'react'; import { LineChartIcon, PauseIcon, PlayIcon, RepeatIcon } from 'lucide-react' import type * as Cesium from 'cesium' import { Button, MonthDayPicker, Slider, Tooltip } from '@renderer/components/ui' @@ -43,15 +44,15 @@ export function SolarTimePanel({ viewer, renderChart }: SolarTimePanelProps) { const [chartOpen, setChartOpen] = useState(false) useVisibleAnimation(active && (isPlaying || isAnnualPlaying), (dt) => { - if (dt > 0) advance(dt) - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (dt > 0) {advance(dt)} + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }) useEffect(() => { - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }, [date, hour, active, viewer]) - if (!active) return null + if (!active) {return null} const panelClasses = [ styles.solarPanel, diff --git a/src/renderer/src/components/StreamingMarkdown.tsx b/src/renderer/src/components/StreamingMarkdown.tsx index 63c4cd16..963b6ddb 100644 --- a/src/renderer/src/components/StreamingMarkdown.tsx +++ b/src/renderer/src/components/StreamingMarkdown.tsx @@ -1,12 +1,7 @@ -import { useLayoutEffect, useRef, useState, type ReactNode } from 'react' -import { - createStreamingDelayState, - renderMarkdown, - renderStreamingMarkdown, - resetStreamingDelayState, - settleStreamingDelayState, - type StreamingDelayState -} from '@renderer/utils/markdown' +import { useLayoutEffect, useRef, useState } from 'react'; +import type { ReactNode } from 'react'; +import { createStreamingDelayState, renderMarkdown, renderStreamingMarkdown, resetStreamingDelayState, settleStreamingDelayState } from '@renderer/utils/markdown'; +import type { StreamingDelayState } from '@renderer/utils/markdown'; import styles from './StreamingMarkdown.module.css' const STREAM_RENDER_INTERVAL_MS = 50 @@ -55,7 +50,7 @@ export function StreamingMarkdown({ text, streaming = false, onRendered }: Strea function settle(): void { settleTimerRef.current = undefined const current = latestPropsRef.current - if (!current.streaming) return + if (!current.streaming) {return} settledRef.current = true settleStreamingDelayState(delayStateRef.current!, current.text) const nextNodes = renderMarkdown(current.text) @@ -68,18 +63,18 @@ export function StreamingMarkdown({ text, streaming = false, onRendered }: Strea settledRef.current = false const current = latestPropsRef.current const delayState = delayStateRef.current! - if (!current.streaming) { - resetStreamingDelayState(delayState) - const nextNodes = renderMarkdown(current.text) - hasNodesRef.current = nextNodes.length > 0 - setNodes(nextNodes) - } else { + if (current.streaming) { const nextNodes = renderStreamingMarkdown(current.text, delayState) hasNodesRef.current = nextNodes.length > 0 setNodes(nextNodes) if (current.text) { settleTimerRef.current = setTimeout(settle, STREAM_IDLE_SETTLE_MS) } + } else { + resetStreamingDelayState(delayState) + const nextNodes = renderMarkdown(current.text) + hasNodesRef.current = nextNodes.length > 0 + setNodes(nextNodes) } onRenderedRef.current?.() } @@ -108,11 +103,11 @@ export function StreamingMarkdown({ text, streaming = false, onRendered }: Strea } }, [text, streaming]) - useLayoutEffect(() => { - return () => { + useLayoutEffect(() => + () => { clearTimers() } - }, []) + , []) return
{nodes}
} diff --git a/src/renderer/src/components/TeachingLab.tsx b/src/renderer/src/components/TeachingLab.tsx index 921409bc..cfa5e3a1 100644 --- a/src/renderer/src/components/TeachingLab.tsx +++ b/src/renderer/src/components/TeachingLab.tsx @@ -1,10 +1,15 @@ import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import { thematicLayerCatalog, useClimateStore, type ThematicLayerId } from '@renderer/stores/climate' -import { useSolarStore, type MotionPanel as SolarMotionPanel } from '@renderer/stores/solar' -import { useAtmosphereStore, type AtmospherePanel } from '@renderer/stores/atmosphere' -import { useHydrologyStore, type HydrologyPanel } from '@renderer/stores/hydrology' -import { useLandformStore, type LandformPanel } from '@renderer/stores/landform' +import { thematicLayerCatalog, useClimateStore } from '@renderer/stores/climate'; +import type { ThematicLayerId } from '@renderer/stores/climate'; +import { useSolarStore } from '@renderer/stores/solar'; +import type { MotionPanel as SolarMotionPanel } from '@renderer/stores/solar'; +import { useAtmosphereStore } from '@renderer/stores/atmosphere'; +import type { AtmospherePanel } from '@renderer/stores/atmosphere'; +import { useHydrologyStore } from '@renderer/stores/hydrology'; +import type { HydrologyPanel } from '@renderer/stores/hydrology'; +import { useLandformStore } from '@renderer/stores/landform'; +import type { LandformPanel } from '@renderer/stores/landform'; import { usePopulationStore } from '@renderer/stores/population' import { useTransportStore } from '@renderer/stores/transport' import { useEnvironmentStore } from '@renderer/stores/environment' @@ -60,7 +65,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { const zonationPanel = useZonationStore((state) => state.panel) const drawingActiveTool = useDrawingStore((state) => state.activeTool) - if (!open) return null + if (!open) {return null} function layerEntry(id: ThematicLayerId): LabEntry { const layer = thematicLayerCatalog.find((item) => item.id === id) @@ -86,7 +91,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useSolarStore.getState().motionPanel !== panel closeAllPanels() - if (next) useSolarStore.getState().setMotionPanel(panel) + if (next) {useSolarStore.getState().setMotionPanel(panel)} return next } } @@ -101,7 +106,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useAtmosphereStore.getState().panel !== panel closeAllPanels() - if (next) useAtmosphereStore.getState().setPanel(panel) + if (next) {useAtmosphereStore.getState().setPanel(panel)} return next } } @@ -116,7 +121,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useHydrologyStore.getState().panel !== panel closeAllPanels() - if (next) useHydrologyStore.getState().setPanel(panel) + if (next) {useHydrologyStore.getState().setPanel(panel)} return next } } @@ -131,7 +136,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useLandformStore.getState().panel !== panel closeAllPanels() - if (next) useLandformStore.getState().setPanel(panel) + if (next) {useLandformStore.getState().setPanel(panel)} return next } } @@ -146,7 +151,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = usePopulationStore.getState().panel !== 'population' closeAllPanels() - if (next) usePopulationStore.getState().setPanel('population') + if (next) {usePopulationStore.getState().setPanel('population')} return next } } @@ -161,7 +166,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = usePopulationStore.getState().panel !== 'cities' closeAllPanels() - if (next) usePopulationStore.getState().setPanel('cities') + if (next) {usePopulationStore.getState().setPanel('cities')} return next } } @@ -176,7 +181,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useTransportStore.getState().panel !== 'transport' closeAllPanels() - if (next) useTransportStore.getState().setPanel('transport') + if (next) {useTransportStore.getState().setPanel('transport')} return next } } @@ -191,7 +196,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useEnvironmentStore.getState().panel !== 'environment' closeAllPanels() - if (next) useEnvironmentStore.getState().setPanel('environment') + if (next) {useEnvironmentStore.getState().setPanel('environment')} return next } } @@ -206,7 +211,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useDecisionStore.getState().panel !== 'location' closeAllPanels() - if (next) useDecisionStore.getState().setPanel('location') + if (next) {useDecisionStore.getState().setPanel('location')} return next } } @@ -221,7 +226,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useZonationStore.getState().panel !== 'zonation-profile' closeAllPanels() - if (next) useZonationStore.getState().setPanel('zonation-profile') + if (next) {useZonationStore.getState().setPanel('zonation-profile')} return next } } @@ -254,7 +259,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = !useClimateStore.getState().overlays['temperature-zones'] useClimateStore.getState().setOverlay('temperature-zones', next) - if (next) useSolarStore.getState().setActive(true) + if (next) {useSolarStore.getState().setActive(true)} return next } }, @@ -266,7 +271,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useDrawingStore.getState().activeTool !== 'timezone' closeAllPanels() - if (next) useDrawingStore.getState().setActiveTool('timezone') + if (next) {useDrawingStore.getState().setActiveTool('timezone')} return next } }, @@ -299,9 +304,9 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { key: 'enso', name: 'ENSO(厄尔尼诺与拉尼娜)', description: '三相位海温距平着色 + 沃克环流剖面,点击海区看影响', - active: overlays['enso'], + active: overlays.enso, toggle: () => { - const next = !useClimateStore.getState().overlays['enso'] + const next = !useClimateStore.getState().overlays.enso useClimateStore.getState().setOverlay('enso', next) return next } diff --git a/src/renderer/src/components/ThematicInfoCard.tsx b/src/renderer/src/components/ThematicInfoCard.tsx index d94abdb4..39dc68fe 100644 --- a/src/renderer/src/components/ThematicInfoCard.tsx +++ b/src/renderer/src/components/ThematicInfoCard.tsx @@ -15,10 +15,10 @@ export function ThematicInfoCard(_props: ThematicInfoCardProps) { const isLayerPanelOpen = useGlobeStore((state) => state.isLayerPanelOpen) const setLayerPanelOpen = useGlobeStore((state) => state.setLayerPanelOpen) - if (!focused) return null + if (!focused) {return null} function explainWithAi(): void { - if (!focused) return + if (!focused) {return} setAiPanelOpen(true) void sendAi( `请结合「${focused.layerName}」图层,讲解${focused.name}的成因、分布规律及其对地理环境的影响。参考信息:${focused.summary}` diff --git a/src/renderer/src/components/ThematicLegend.tsx b/src/renderer/src/components/ThematicLegend.tsx index e5176bde..bb04bc8e 100644 --- a/src/renderer/src/components/ThematicLegend.tsx +++ b/src/renderer/src/components/ThematicLegend.tsx @@ -7,7 +7,8 @@ import { densityBins } from '@renderer/thematic/populationCensus' import { CITY_TIER_META, FUNCTIONAL_ZONES, functionalZoneCities } from '@renderer/thematic/urbanCities' import { AGRI_CATEGORY_META } from '@renderer/thematic/agriculturalRegions' import { industrialBases } from '@renderer/thematic/industrialBases' -import { useOnlineDataStore, type TyphoonMode } from '@renderer/stores/onlineData' +import { useOnlineDataStore } from '@renderer/stores/onlineData'; +import type { TyphoonMode } from '@renderer/stores/onlineData'; import { useSettingsWindowStore } from '@renderer/stores/settingsWindow' import { typhoonIntensityStyles } from '@renderer/thematic/typhoonTracks' import { @@ -28,7 +29,7 @@ const liveTyphoonEntries = [ })), unknownTyphoonIntensityStyle ] -const typhoonModeOptions: Array<{ label: string; value: TyphoonMode }> = [ +const typhoonModeOptions: { label: string; value: TyphoonMode }[] = [ { label: '实时台风', value: 'live' }, { label: '历史案例', value: 'history' } ] @@ -72,7 +73,7 @@ export function ThematicLegend(_props: ThematicLegendProps) { const openSettingsWindow = useSettingsWindowStore((state) => state.open) - if (!hasActiveOverlay) return null + if (!hasActiveOverlay) {return null} const typhoonFeed = snapshot?.typhoons const typhoonHistory = snapshot?.typhoonConfigured === false || typhoonMode === 'history' @@ -140,7 +141,7 @@ export function ThematicLegend(_props: ThematicLegendProps) { ))}
)} - {overlays['enso'] && ( + {overlays.enso && (
@@ -180,7 +181,7 @@ export function ThematicLegend(_props: ThematicLegendProps) {
)} - {overlays['typhoon'] && ( + {overlays.typhoon && (
台风(热带气旋)
{snapshot?.typhoonConfigured && ( @@ -231,16 +232,16 @@ export function ThematicLegend(_props: ThematicLegendProps) {

更新时间:{formatOnlineTime(typhoonFeed.fetchedAt)}

- {!activeStormCount ? ( + {activeStormCount ? ( +

+ 当前有 {activeStormCount} 个活跃台风,点击路径点查看详情 +

+ ) : ( - ) : ( -

- 当前有 {activeStormCount} 个活跃台风,点击路径点查看详情 -

)} {forecastErrors && ( { - if (value) setFunctionalZoneCity(value) + if (value) {setFunctionalZoneCity(value)} }} /> {functionalZoneEntries.map((zone) => ( diff --git a/src/renderer/src/components/ThermalCirculationPanel.tsx b/src/renderer/src/components/ThermalCirculationPanel.tsx index 58a943b5..3d99b591 100644 --- a/src/renderer/src/components/ThermalCirculationPanel.tsx +++ b/src/renderer/src/components/ThermalCirculationPanel.tsx @@ -26,7 +26,7 @@ interface GroundShape { interface SceneConfig { grounds: GroundShape[] arrows: FlowArrow[] - placeLabels: Array<{ text: string; at: [number, number] }> + placeLabels: { text: string; at: [number, number] }[] caption: string } @@ -45,7 +45,7 @@ const periodOptions = [ { value: 'night', label: '夜晚' } ] -const BUILDINGS: Array<[number, number, number]> = [ +const BUILDINGS: [number, number, number][] = [ [128, 24, 14], [144, 34, 12], [160, 20, 16], @@ -53,7 +53,7 @@ const BUILDINGS: Array<[number, number, number]> = [ [188, 16, 11] ] -const SUBURB_HOUSES: Array<[number, number]> = [ +const SUBURB_HOUSES: [number, number][] = [ [30, 6], [46, 8], [248, 7], @@ -160,8 +160,8 @@ export function ThermalCirculationPanel({ onClose }: ThermalCirculationPanelProp const [period, setPeriod] = useState('day') const sceneConfig = useMemo(() => { - if (scene === 'sea-land') return seaLandConfig(period) - if (scene === 'valley') return valleyConfig(period) + if (scene === 'sea-land') {return seaLandConfig(period)} + if (scene === 'valley') {return valleyConfig(period)} return urbanConfig() }, [scene, period]) diff --git a/src/renderer/src/components/TideWavePanel.tsx b/src/renderer/src/components/TideWavePanel.tsx index 56ef836e..3cb6f88c 100644 --- a/src/renderer/src/components/TideWavePanel.tsx +++ b/src/renderer/src/components/TideWavePanel.tsx @@ -21,7 +21,7 @@ const tideModeOptions = [ { value: 'neap', label: '小潮(上下弦)' } ] -const waveParticles: Array<{ cx: number; cy: number; r: number; delay: number }> = [ +const waveParticles: { cx: number; cy: number; r: number; delay: number }[] = [ { cx: 62, cy: 100, r: 7, delay: 0 }, { cx: 122, cy: 100, r: 7, delay: -0.7 }, { cx: 182, cy: 100, r: 7, delay: -1.4 }, diff --git a/src/renderer/src/components/TimezonePanel.tsx b/src/renderer/src/components/TimezonePanel.tsx index 5467038c..461c0ebe 100644 --- a/src/renderer/src/components/TimezonePanel.tsx +++ b/src/renderer/src/components/TimezonePanel.tsx @@ -21,7 +21,7 @@ export function TimezonePanel({ comparison, onClear }: TimezonePanelProps) { const beijingClock = useSolarStore((state) => state.beijingClock) const utcHours = useMemo(() => { - if (solarActive) return solarUtcHour + if (solarActive) {return solarUtcHour} const now = new Date() return now.getUTCHours() + now.getUTCMinutes() / 60 }, [solarActive, solarUtcHour]) @@ -30,7 +30,7 @@ export function TimezonePanel({ comparison, onClear }: TimezonePanelProps) { const differenceText = useMemo(() => { const difference = comparison.differenceHours - if (Math.abs(difference) < 1 / 60) return '两地经度相近,地方时基本相同' + if (Math.abs(difference) < 1 / 60) {return '两地经度相近,地方时基本相同'} const abs = Math.abs(difference) const hours = Math.floor(abs) const minutes = Math.round((abs - hours) * 60) diff --git a/src/renderer/src/components/TransportPanel.tsx b/src/renderer/src/components/TransportPanel.tsx index d161298a..e0442351 100644 --- a/src/renderer/src/components/TransportPanel.tsx +++ b/src/renderer/src/components/TransportPanel.tsx @@ -1,20 +1,14 @@ import { useRef } from 'react' -import * as Cesium from 'cesium' +import type * as Cesium from 'cesium' import { MapPinIcon, XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' import { useTransportStore } from '@renderer/stores/transport' -import { - HSR_END_YEAR, - hsrFacts, - hsrGrowthSeries, - hsrLines, - hsrLinesUpTo, - hsrMileageAt, - type HsrLine -} from '@renderer/thematic/hsrLines' +import { HSR_END_YEAR, hsrFacts, hsrGrowthSeries, hsrLines, hsrLinesUpTo, hsrMileageAt } from '@renderer/thematic/hsrLines'; +import type { HsrLine } from '@renderer/thematic/hsrLines'; import { resolveFlightDestination } from '@renderer/composables/terrainFlight' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import YearTimeline from './YearTimeline' import styles from './TransportPanel.module.css' @@ -43,18 +37,18 @@ export function TransportPanel({ viewer, onClose }: TransportPanelProps) { const flyingRef = useRef(false) const displayYear = Math.floor(year) - const mileageWan = (hsrMileageAt(displayYear) / 10000).toFixed(2) + const mileageWan = (hsrMileageAt(displayYear) / 10_000).toFixed(2) const openedCount = hsrLinesUpTo(displayYear).length async function flyToLine(line: HsrLine): Promise { - if (flyingRef.current) return - if (!viewer || viewer.isDestroyed()) return + if (flyingRef.current) {return} + if (!viewer || viewer.isDestroyed()) {return} flyingRef.current = true try { const mid = line.path[Math.floor(line.path.length / 2)] - const span = Math.min(1200000, Math.max(250000, line.lengthKm * 420)) + const span = Math.min(1_200_000, Math.max(250_000, line.lengthKm * 420)) const destination = await resolveFlightDestination(viewer.scene, mid[0], mid[1], span) - if (!destination || viewer.isDestroyed()) return + if (!destination || viewer.isDestroyed()) {return} viewer.camera.flyTo({ destination, duration: 1.6 }) } finally { flyingRef.current = false diff --git a/src/renderer/src/components/TyphoonOverlay.tsx b/src/renderer/src/components/TyphoonOverlay.tsx index 20b1f281..c239baa2 100644 --- a/src/renderer/src/components/TyphoonOverlay.tsx +++ b/src/renderer/src/components/TyphoonOverlay.tsx @@ -8,7 +8,7 @@ export interface TyphoonOverlayProps { } const ANCHOR = Cesium.Cartesian3.fromDegrees(138, 15) -const ANCHOR_VIEW_HEIGHT = 6200000 +const ANCHOR_VIEW_HEIGHT = 6_200_000 function spiralArm(startAngle: number): string { const cx = 170 @@ -27,7 +27,7 @@ function spiralArm(startAngle: number): string { const arms = [spiralArm(20), spiralArm(140), spiralArm(260)] -const inflowArrows: Array<{ x: number; y: number; angle: number }> = [ +const inflowArrows: { x: number; y: number; angle: number }[] = [ { x: 300, y: 96, angle: 145 }, { x: 62, y: 122, angle: -55 }, { x: 100, y: 286, angle: -20 }, @@ -40,7 +40,7 @@ export function TyphoonOverlay({ viewer }: TyphoonOverlayProps) { useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (overlayRef.current) overlayRef.current.style.display = 'none' + if (overlayRef.current) {overlayRef.current.style.display = 'none'} return } const scratch = new Cesium.Cartesian2() @@ -49,7 +49,7 @@ export function TyphoonOverlay({ viewer }: TyphoonOverlayProps) { function frame(): void { const element = overlayRef.current - if (!activeViewer || activeViewer.isDestroyed() || !element) return + if (!activeViewer || activeViewer.isDestroyed() || !element) {return} let facing = true if (activeViewer.scene.mode === Cesium.SceneMode.SCENE3D) { activeViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(ANCHOR, scratchNormal) diff --git a/src/renderer/src/components/UpdateDialog.tsx b/src/renderer/src/components/UpdateDialog.tsx index 7f431e71..f6c300fc 100644 --- a/src/renderer/src/components/UpdateDialog.tsx +++ b/src/renderer/src/components/UpdateDialog.tsx @@ -1,4 +1,5 @@ -import { Component, useMemo, useState, type ReactNode } from 'react' +import { Component, useMemo, useState } from 'react'; +import type { ReactNode } from 'react'; import { Modal } from '@renderer/components/ui' import { useUpdaterStore } from '@renderer/stores/updater' import { tryRenderMarkdown } from '@renderer/utils/markdown' @@ -27,7 +28,7 @@ class MarkdownNotesBoundary extends Component = { normal: [ @@ -54,7 +55,7 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (overlayRef.current) overlayRef.current.style.display = 'none' + if (overlayRef.current) {overlayRef.current.style.display = 'none'} return } const scratch = new Cesium.Cartesian2() @@ -63,7 +64,7 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve function frame(): void { const element = overlayRef.current - if (!activeViewer || activeViewer.isDestroyed() || !element) return + if (!activeViewer || activeViewer.isDestroyed() || !element) {return} let facing = true if (activeViewer.scene.mode === Cesium.SceneMode.SCENE3D) { activeViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(ANCHOR, scratchNormal) @@ -109,10 +110,10 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve - {phase !== 'el-nino' ? ( - - ) : ( + {phase === 'el-nino' ? ( + ) : ( + )} 东太平洋(南美沿岸) - {phase !== 'el-nino' ? ( - - 上升气流 - - ) : ( + {phase === 'el-nino' ? ( 上升气流东移 + ) : ( + + 上升气流 + )} 下沉气流 @@ -160,14 +161,14 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve 高空向东流 - {phase !== 'el-nino' ? ( - - 信风(近地面自东向西) - - ) : ( + {phase === 'el-nino' ? ( 信风减弱甚至转向 + ) : ( + + 信风(近地面自东向西) + )} 温跃层 diff --git a/src/renderer/src/components/WaterBodyPanel.tsx b/src/renderer/src/components/WaterBodyPanel.tsx index c15ea761..9882e606 100644 --- a/src/renderer/src/components/WaterBodyPanel.tsx +++ b/src/renderer/src/components/WaterBodyPanel.tsx @@ -1,7 +1,8 @@ import { useMemo, useState } from 'react' import { XIcon } from 'lucide-react' import { Button, Segmented } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './WaterBodyPanel.module.css' export interface WaterBodyPanelProps { @@ -22,7 +23,7 @@ const rechargeOptions = [ { value: 'lake', label: '湖泊水' } ] -const monthlyDischarge: Record> = { +const monthlyDischarge: Record = { rain: [ [1, 2.2], [2, 2.8], @@ -47,7 +48,7 @@ const monthlyDischarge: Record> = { [7, 8.8], [8, 7.2], [9, 2.6], - [10, 1.0], + [10, 1], [11, 0.5], [12, 0.4] ], @@ -57,17 +58,17 @@ const monthlyDischarge: Record> = { [3, 4.6], [4, 4.6], [5, 4.8], - [6, 5.0], + [6, 5], [7, 5.3], [8, 5.2], - [9, 5.0], + [9, 5], [10, 4.9], [11, 4.8], [12, 4.8] ], lake: [ [1, 3.6], - [2, 4.0], + [2, 4], [3, 4.8], [4, 5.8], [5, 6.8], diff --git a/src/renderer/src/components/WaterCyclePanel.tsx b/src/renderer/src/components/WaterCyclePanel.tsx index b39e340a..31bc8ae9 100644 --- a/src/renderer/src/components/WaterCyclePanel.tsx +++ b/src/renderer/src/components/WaterCyclePanel.tsx @@ -26,7 +26,7 @@ export function WaterCyclePanel({ viewer, onClose }: WaterCyclePanelProps) { playingRef.current = playing useEffect(() => { - if (!playing) return + if (!playing) {return} const timer = setInterval(() => { setAnimationStep((prev) => (prev + 1) % (STEPS.length + 1)) }, 1600) @@ -36,15 +36,15 @@ export function WaterCyclePanel({ viewer, onClose }: WaterCyclePanelProps) { }, [playing]) useEffect(() => { - if (!playingRef.current) return + if (!playingRef.current) {return} if (viewer && !viewer.isDestroyed()) { - viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(128, 22, 7200000), duration: 1.2 }) + viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(128, 22, 7_200_000), duration: 1.2 }) } }, [viewer]) function stepActive(step: number): boolean { - if (animationStep === 0) return false - if (animationStep === 4) return true + if (animationStep === 0) {return false} + if (animationStep === 4) {return true} return animationStep >= step } diff --git a/src/renderer/src/components/WindParticles.tsx b/src/renderer/src/components/WindParticles.tsx index 0f306043..ce71b9cb 100644 --- a/src/renderer/src/components/WindParticles.tsx +++ b/src/renderer/src/components/WindParticles.tsx @@ -35,9 +35,9 @@ const SPAWN_ROWS = 12 function hexToRgb(hex: string): [number, number, number] { const value = hex.replace('#', '') return [ - parseInt(value.slice(0, 2), 16), - parseInt(value.slice(2, 4), 16), - parseInt(value.slice(4, 6), 16) + Number.parseInt(value.slice(0, 2), 16), + Number.parseInt(value.slice(2, 4), 16), + Number.parseInt(value.slice(4, 6), 16) ] } @@ -64,7 +64,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { useEffect(() => { const canvas = canvasRef.current - if (!canvas) return + if (!canvas) {return} const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined const trailBins: number[][] = Array.from({ length: COLOR_BINS }, () => []) @@ -101,7 +101,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { if (currentViewer.scene.mode === Cesium.SceneMode.SCENE3D) { currentViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(position, scratchNormal) Cesium.Cartesian3.subtract(currentViewer.camera.positionWC, position, scratchToCamera) - if (Cesium.Cartesian3.dot(scratchNormal, scratchToCamera) <= 0) return false + if (Cesium.Cartesian3.dot(scratchNormal, scratchToCamera) <= 0) {return false} } const projected = Cesium.SceneTransforms.worldToWindowCoordinates(currentViewer.scene, position, result) return Boolean(projected && Number.isFinite(projected.x) && Number.isFinite(projected.y)) @@ -131,7 +131,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { particle.trailScreens.length = 0 particle.age = 0 particle.maxAge = 3 + Math.random() * 3 - for (let attempt = 0; attempt < 8 && spawnCells.length; attempt += 1) { + for (let attempt = 0; attempt < 8 && spawnCells.length > 0; attempt += 1) { const cell = spawnCells[Math.floor(Math.random() * spawnCells.length)] scratchScreen.x = (((cell % SPAWN_COLUMNS) + Math.random()) * cssWidth) / SPAWN_COLUMNS scratchScreen.y = ((Math.floor(cell / SPAWN_COLUMNS) + Math.random()) * cssHeight) / SPAWN_ROWS @@ -140,13 +140,13 @@ export function WindParticles({ viewer }: WindParticlesProps) { currentViewer.scene.globe.ellipsoid, scratchPosition ) - if (!position) continue + if (!position) {continue} const location = currentViewer.scene.globe.ellipsoid.cartesianToCartographic(position, scratchCartographic) particle.lon = Cesium.Math.toDegrees(location.longitude) particle.lat = Cesium.Math.toDegrees(location.latitude) particle.height = 0 updatePosition(particle, currentViewer) - if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) continue + if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) {continue} particle.trail.push(Cesium.Cartesian3.clone(particle.position)) particle.trailScreens.push(scratchHead.x, scratchHead.y) return true @@ -179,10 +179,10 @@ export function WindParticles({ viewer }: WindParticlesProps) { } } const visibleArea = (cssWidth * cssHeight * spawnCells.length) / (SPAWN_COLUMNS * SPAWN_ROWS) - const target = spawnCells.length + const target = spawnCells.length > 0 ? Math.min(MAX_PARTICLES, Math.max(MIN_PARTICLES, Math.round(visibleArea / AREA_PER_PARTICLE))) : 0 - if (particles.length > target) particles.length = target + if (particles.length > target) {particles.length = target} while (particles.length < target) { const particle: Particle = { lon: 0, @@ -194,15 +194,15 @@ export function WindParticles({ viewer }: WindParticlesProps) { trail: [], trailScreens: [] } - if (respawn(particle, currentViewer)) particle.age = Math.random() * particle.maxAge + if (respawn(particle, currentViewer)) {particle.age = Math.random() * particle.maxAge} particles.push(particle) } } function resizeCanvas(): void { - if (!canvas) return + if (!canvas) {return} const dpr = Math.min(2, window.devicePixelRatio || 1) - if (cssWidth === canvas.clientWidth && cssHeight === canvas.clientHeight && pixelRatio === dpr) return + if (cssWidth === canvas.clientWidth && cssHeight === canvas.clientHeight && pixelRatio === dpr) {return} cssWidth = canvas.clientWidth cssHeight = canvas.clientHeight pixelRatio = dpr @@ -231,7 +231,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { const last = particle.trail[particle.trail.length - 1] if (!last || Cesium.Cartesian3.distance(last, particle.position) >= metersPerPixel * TRAIL_SAMPLE_PIXELS) { const recycled = particle.trail.length >= TRAIL_MAX_POINTS ? particle.trail.shift() : undefined - if (recycled) particle.trailScreens.splice(0, 2) + if (recycled) {particle.trailScreens.splice(0, 2)} particle.trail.push(Cesium.Cartesian3.clone(particle.position, recycled)) if (projectToScreen(particle.position, currentViewer, scratchTrail)) { particle.trailScreens.push(scratchTrail.x, scratchTrail.y) @@ -245,8 +245,8 @@ export function WindParticles({ viewer }: WindParticlesProps) { const screens = particle.trailScreens screens.length = 0 for (const point of particle.trail) { - if (projectToScreen(point, currentViewer, scratchTrail)) screens.push(scratchTrail.x, scratchTrail.y) - else screens.push(Number.NaN, Number.NaN) + if (projectToScreen(point, currentViewer, scratchTrail)) {screens.push(scratchTrail.x, scratchTrail.y)} + else {screens.push(Number.NaN, Number.NaN)} } } @@ -258,7 +258,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { currentViewer.scene.globe.ellipsoid, scratchPosition ) - if (!center) return 0 + if (!center) {return 0} Cesium.Cartesian3.clone(center, particleBounds.center) const value = currentViewer.camera.getPixelSize(particleBounds, cssWidth, cssHeight) return Number.isFinite(value) && value > 0 ? value : 0 @@ -274,10 +274,10 @@ export function WindParticles({ viewer }: WindParticlesProps) { for (let i = screens.length - 2; i >= 0 && remaining > 0; i -= 2) { const trailX = screens[i] const trailY = screens[i + 1] - if (!Number.isFinite(trailX) || !Number.isFinite(trailY)) break + if (!Number.isFinite(trailX) || !Number.isFinite(trailY)) {break} const distance = Math.hypot(trailX - x, trailY - y) - if (distance < 0.01) continue - if (distance > Math.max(cssWidth, cssHeight) * 0.5) break + if (distance < 0.01) {continue} + if (distance > Math.max(cssWidth, cssHeight) * 0.5) {break} const ratio = Math.min(1, remaining / distance) x += (trailX - x) * ratio y += (trailY - y) * ratio @@ -291,7 +291,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { function frame(): void { const currentViewer = activeViewer const ctx = context - if (!currentViewer || currentViewer.isDestroyed() || !ctx || !cssWidth || !cssHeight) return + if (!currentViewer || currentViewer.isDestroyed() || !ctx || !cssWidth || !cssHeight) {return} if (document.hidden) { lastTime = 0 return @@ -310,7 +310,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { !Cesium.Matrix4.equals(previousView, currentViewer.camera.viewMatrix) || !Cesium.Matrix4.equals(previousProjection, currentViewer.camera.frustum.projectionMatrix) if (viewMoved) { - for (const particle of particles) particle.trailScreens.length = 0 + for (const particle of particles) {particle.trailScreens.length = 0} trailsStale = true reprojectIndex = 0 } @@ -322,27 +322,27 @@ export function WindParticles({ viewer }: WindParticlesProps) { reprojectIndex += 1 remaining -= 1 } - if (reprojectIndex >= particles.length) trailsStale = false + if (reprojectIndex >= particles.length) {trailsStale = false} } const metersPerPixel = frameMetersPerPixel(currentViewer) - for (const bin of trailBins) bin.length = 0 - for (const bin of headBins) bin.length = 0 + for (const bin of trailBins) {bin.length = 0} + for (const bin of headBins) {bin.length = 0} const month = useClimateStore.getState().month for (const particle of particles) { particle.age += dt if ( particle.age > particle.maxAge || - !particle.trail.length || + particle.trail.length === 0 || !projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead) ) { - if (!respawn(particle, currentViewer)) continue + if (!respawn(particle, currentViewer)) {continue} } const wind = sampleWind(particle.lon, particle.lat, month) const speed = Math.hypot(wind.u, wind.v) - if (metersPerPixel > 0) advanceParticle(particle, currentViewer, dt, wind.u, wind.v, metersPerPixel) - if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) continue + if (metersPerPixel > 0) {advanceParticle(particle, currentViewer, dt, wind.u, wind.v, metersPerPixel)} + if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) {continue} const bin = Math.min(COLOR_BINS - 1, Math.floor((speed / WIND_RAMP_MAX_SPEED) * COLOR_BINS)) collectTrail(particle, bin) } @@ -356,8 +356,8 @@ export function WindParticles({ viewer }: WindParticlesProps) { ctx.beginPath() let drawing = false for (let i = 0; i < segments.length; i += 2) { - if (Number.isNaN(segments[i])) drawing = false - else if (drawing) ctx.lineTo(segments[i], segments[i + 1]) + if (Number.isNaN(segments[i])) {drawing = false} + else if (drawing) {ctx.lineTo(segments[i], segments[i + 1])} else { ctx.moveTo(segments[i], segments[i + 1]) drawing = true @@ -383,8 +383,8 @@ export function WindParticles({ viewer }: WindParticlesProps) { function animate(now: number): void { animationFrame = 0 - if (document.hidden || !activeViewer || activeViewer.isDestroyed()) return - if (!lastTime || now - lastTime >= 1000 / 60) frame() + if (document.hidden || !activeViewer || activeViewer.isDestroyed()) {return} + if (!lastTime || now - lastTime >= 1000 / 60) {frame()} animationFrame = requestAnimationFrame(animate) } diff --git a/src/renderer/src/components/WindowControls.tsx b/src/renderer/src/components/WindowControls.tsx index 928dd9a0..f7bda642 100644 --- a/src/renderer/src/components/WindowControls.tsx +++ b/src/renderer/src/components/WindowControls.tsx @@ -32,13 +32,13 @@ export function WindowControls() { useEffect(() => { const api = window.guEarth?.windowControls - if (!api) return + if (!api) {return} let active = true void api.getState().then((initial) => { - if (active) setState(initial) + if (active) {setState(initial)} }) const unsubscribe = api.onStateChange((next) => { - if (active) setState(next) + if (active) {setState(next)} }) return () => { active = false @@ -47,14 +47,14 @@ export function WindowControls() { }, []) useEffect(() => { - if (typeof document === 'undefined') return + if (typeof document === 'undefined') {return} document.documentElement.dataset.fullscreen = state.fullScreen ? 'true' : 'false' return () => { delete document.documentElement.dataset.fullscreen } }, [state.fullScreen]) - if (!window.guEarth?.windowControls) return null + if (!window.guEarth?.windowControls) {return null} const isMac = state.platform === 'darwin' const expanded = state.maximized || state.fullScreen diff --git a/src/renderer/src/components/YearTimeline.tsx b/src/renderer/src/components/YearTimeline.tsx index 431f161f..fffc8320 100644 --- a/src/renderer/src/components/YearTimeline.tsx +++ b/src/renderer/src/components/YearTimeline.tsx @@ -23,11 +23,11 @@ export function YearTimeline(_props: YearTimelineProps) { const advance = useTransportStore((state) => state.advance) useVisibleAnimation(isPlaying, (dt) => { - if (dt > 0) advance(dt) + if (dt > 0) {advance(dt)} }) const displayYear = Math.floor(year) - const mileageText = `约 ${(hsrMileageAt(displayYear) / 10000).toFixed(2)} 万公里` + const mileageText = `约 ${(hsrMileageAt(displayYear) / 10_000).toFixed(2)} 万公里` return (
diff --git a/src/renderer/src/components/ZonationFlightHud.tsx b/src/renderer/src/components/ZonationFlightHud.tsx index 308a7468..8d013f2f 100644 --- a/src/renderer/src/components/ZonationFlightHud.tsx +++ b/src/renderer/src/components/ZonationFlightHud.tsx @@ -1,5 +1,6 @@ import { Button, Progress } from '@renderer/components/ui' -import { useZonationStore, type ZonationFlightStage } from '@renderer/stores/zonation' +import { useZonationStore } from '@renderer/stores/zonation'; +import type { ZonationFlightStage } from '@renderer/stores/zonation'; import { cancelTransectFlight } from '@renderer/composables/useTransectFlight' import styles from './ZonationFlightHud.module.css' @@ -14,7 +15,7 @@ const stageText: Record = { export function ZonationFlightHud(_props: ZonationFlightHudProps) { const flightHud = useZonationStore((state) => state.flightHud) - if (!flightHud) return null + if (!flightHud) {return null} const percent = flightHud.total > 0 ? Math.min(100, Math.round((flightHud.completed / flightHud.total) * 100)) : 0 diff --git a/src/renderer/src/components/ZonationPanel.tsx b/src/renderer/src/components/ZonationPanel.tsx index ff050831..4262c153 100644 --- a/src/renderer/src/components/ZonationPanel.tsx +++ b/src/renderer/src/components/ZonationPanel.tsx @@ -2,14 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import * as Cesium from 'cesium' import { Loader2Icon, XIcon } from 'lucide-react' import { Alert, Button, Select } from '@renderer/components/ui' -import { - mountainById, - snowlineM, - zonationMountains, - zonationPrinciples, - type ZonationMountain, - type ZonationSlope -} from '@renderer/thematic/mountainZonation' +import { mountainById, snowlineM, zonationMountains, zonationPrinciples } from '@renderer/thematic/mountainZonation'; +import type { ZonationMountain, ZonationSlope } from '@renderer/thematic/mountainZonation'; import { greatCircleKm } from '@renderer/lib/transect' import { cancelTransectFlight, @@ -47,7 +41,7 @@ function spectrumY(mountain: ZonationMountain, elevationM: number): number { export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { const [activeId, setActiveId] = useState(zonationMountains[0].id) - const [profile, setProfile] = useState>([]) + const [profile, setProfile] = useState<[number, number][]>([]) const [sampling, setSampling] = useState(false) const [degraded, setDegraded] = useState(false) const [flying, setFlying] = useState(false) @@ -80,7 +74,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { clipId: `zonation-clip-${active.id}-${index}`, triangle: `M ${cx - halfW} ${SPECTRUM_BASE_Y} L ${cx} ${SPECTRUM_TOP_Y} L ${cx + halfW} ${SPECTRUM_BASE_Y} Z`, belts, - snowY: snow !== undefined ? spectrumY(active, snow) : undefined + snowY: snow === undefined ? undefined : spectrumY(active, snow) } }) }, [active]) @@ -93,7 +87,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { PROFILE_TOP + (1 - elevationM / elevMax) * (PROFILE_H - PROFILE_TOP - PROFILE_BOTTOM) let summit: { x: number; y: number; elevationM: number } | undefined for (const [km, elevationM] of profile) { - if (!summit || elevationM > summit.elevationM) summit = { x: toX(km), y: toY(elevationM), elevationM } + if (!summit || elevationM > summit.elevationM) {summit = { x: toX(km), y: toY(elevationM), elevationM }} } const stripeSlope = active.slopes[0] const snow = snowlineM(stripeSlope) @@ -105,7 +99,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { y: toY(belt.toM), height: Math.max(1, toY(belt.fromM) - toY(belt.toM)) })), - snowY: snow !== undefined ? toY(snow) : undefined, + snowY: snow === undefined ? undefined : toY(snow), summit, baseY: toY(0), peakElevation: summit ? Math.round(summit.elevationM) : active.summitM, @@ -118,7 +112,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { profileRequestIdRef.current += 1 const requestId = profileRequestIdRef.current setProfile([]) - if (!targetViewer || targetViewer.isDestroyed()) return + if (!targetViewer || targetViewer.isDestroyed()) {return} setSampling(true) setDegraded(false) try { @@ -128,7 +122,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { undefined, mountain.summitM ) - if (requestId !== profileRequestIdRef.current) return + if (requestId !== profileRequestIdRef.current) {return} setDegraded(sampledDegraded) let distance = 0 setProfile( @@ -141,7 +135,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { }) ) } finally { - if (requestId === profileRequestIdRef.current) setSampling(false) + if (requestId === profileRequestIdRef.current) {setSampling(false)} } }, [] @@ -180,7 +174,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { function selectMountain(mountainId: string): void { const mountain = mountainById(mountainId) - if (!mountain) return + if (!mountain) {return} activeIdRef.current = mountain.id setActiveId(mountain.id) setFlightNote('') @@ -188,7 +182,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { } async function startFlight(): Promise { - if (flying) return + if (flying) {return} if (!viewer || viewer.isDestroyed()) { setFlightNote('地球尚未就绪,稍后再试') return @@ -199,7 +193,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { const result = await flyTransect(viewer, active.transect, { expectedMaxGroundM: active.summitM, onProgress: ({ stage, completed, total }) => { - if (!mountedRef.current) return + if (!mountedRef.current) {return} if (stage === 'prewarm') { setFlightNote(`飞行准备:并发预载沿线影像(画面短暂降暗)${completed}/${total}…`) } else if (stage === 'flying') { @@ -207,7 +201,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { } } }) - if (!mountedRef.current) return + if (!mountedRef.current) {return} if ('error' in result) { setFlightNote(result.error) } else if (result.status === 'interrupted') { @@ -220,15 +214,15 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { setFlightNote(reason) } else { const samplingNote = - result.maxGroundM !== undefined - ? `,沿线最高地表 ${result.maxGroundM} 米${result.degraded ? '(数据不完整,已用安全盲飞高度)' : ''}` - : '' + result.maxGroundM === undefined + ? '' + : `,沿线最高地表 ${result.maxGroundM} 米${result.degraded ? '(数据不完整,已用安全盲飞高度)' : ''}` setFlightNote( `剖面飞行完成:全程约 ${result.totalKm} 千米,最高飞行高度约 ${result.flightAltitudeM} 米${samplingNote}` ) } } finally { - if (mountedRef.current) setFlying(false) + if (mountedRef.current) {setFlying(false)} } } @@ -245,7 +239,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { options={mountainOptions} aria-label="选择山脉" onChange={(value) => { - if (value) selectMountain(String(value)) + if (value) {selectMountain(String(value))} }} /> diff --git a/src/renderer/src/components/charts/BarChart.tsx b/src/renderer/src/components/charts/BarChart.tsx index 73bde95f..fbdf1f57 100644 --- a/src/renderer/src/components/charts/BarChart.tsx +++ b/src/renderer/src/components/charts/BarChart.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { use, type EChartsCoreOption } from 'echarts/core' +import { use as registerEcharts } from 'echarts/core'; +import type { EChartsCoreOption } from 'echarts/core'; import { BarChart as EChartsBarChart } from 'echarts/charts' import { GridComponent, LegendComponent, TooltipComponent } from 'echarts/components' import { SVGRenderer } from 'echarts/renderers' @@ -7,7 +8,7 @@ import { useGlobeStore } from '@renderer/stores/globe' import EChartBase from './EChartBase' import styles from './BarChart.module.css' -use([EChartsBarChart, GridComponent, TooltipComponent, LegendComponent, SVGRenderer]) +registerEcharts([EChartsBarChart, GridComponent, TooltipComponent, LegendComponent, SVGRenderer]) export interface BarSeries { name: string @@ -116,9 +117,9 @@ export function BarChart({ textStyle: { color: '#ffffff', fontSize: 12, lineHeight: 20 }, formatter: (params: unknown) => { const list = Array.isArray(params) ? (params as TooltipParam[]) : [params as TooltipParam] - if (!list.length) return '' + if (list.length === 0) {return ''} const rows = list - .filter((item) => item && item.seriesName) + .filter((item) => item?.seriesName) .map( (item) => `${item.marker}${item.seriesName} ${absValues ? formatNumber(Math.abs(item.value)) : formatNumber(item.value)}` diff --git a/src/renderer/src/components/charts/EChartBase.tsx b/src/renderer/src/components/charts/EChartBase.tsx index 32a10776..25149d03 100644 --- a/src/renderer/src/components/charts/EChartBase.tsx +++ b/src/renderer/src/components/charts/EChartBase.tsx @@ -1,8 +1,10 @@ -import { useEffect, useRef, type CSSProperties } from 'react' -import { init, use, type EChartsCoreOption, type EChartsType } from 'echarts/core' +import { useEffect, useRef } from 'react'; +import type { CSSProperties } from 'react'; +import { init, use as registerEcharts } from 'echarts/core'; +import type { EChartsCoreOption, EChartsType } from 'echarts/core'; import { SVGRenderer } from 'echarts/renderers' -use([SVGRenderer]) +registerEcharts([SVGRenderer]) export interface EChartBaseProps { option: EChartsCoreOption @@ -17,7 +19,7 @@ export function EChartBase({ option, className, style, notMerge = true }: EChart useEffect(() => { const element = containerRef.current - if (!element) return + if (!element) {return} const chart = init(element, undefined, { renderer: 'svg' }) chartRef.current = chart const observer = new ResizeObserver(() => { diff --git a/src/renderer/src/components/charts/LineChart.tsx b/src/renderer/src/components/charts/LineChart.tsx index 7dd149f9..5693ae95 100644 --- a/src/renderer/src/components/charts/LineChart.tsx +++ b/src/renderer/src/components/charts/LineChart.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { use, type EChartsCoreOption } from 'echarts/core' +import { use as registerEcharts } from 'echarts/core'; +import type { EChartsCoreOption } from 'echarts/core'; import { LineChart as EChartsLineChart } from 'echarts/charts' import { GridComponent, MarkLineComponent, TooltipComponent } from 'echarts/components' import { SVGRenderer } from 'echarts/renderers' @@ -7,12 +8,12 @@ import { useGlobeStore } from '@renderer/stores/globe' import EChartBase from './EChartBase' import styles from './LineChart.module.css' -use([EChartsLineChart, GridComponent, TooltipComponent, MarkLineComponent, SVGRenderer]) +registerEcharts([EChartsLineChart, GridComponent, TooltipComponent, MarkLineComponent, SVGRenderer]) export interface ChartSeries { name: string color: string - points: Array<[number, number]> + points: [number, number][] dashed?: boolean markY?: number[] } @@ -69,7 +70,7 @@ export function LineChart({ textStyle: { color: '#ffffff', fontSize: 12, lineHeight: 20 }, formatter: (params: unknown) => { const list = Array.isArray(params) ? (params as TooltipParam[]) : [] - if (!list.length) return '' + if (list.length === 0) {return ''} const head = xFormatter ? xFormatter(list[0].value[0]) : String(list[0].value[0]) const rows = list .map((item) => `${item.marker}${item.seriesName} ${Math.round(item.value[1] * 10) / 10}`) diff --git a/src/renderer/src/components/eoq/EoqComposer.tsx b/src/renderer/src/components/eoq/EoqComposer.tsx index de074691..4d310d76 100644 --- a/src/renderer/src/components/eoq/EoqComposer.tsx +++ b/src/renderer/src/components/eoq/EoqComposer.tsx @@ -1,7 +1,10 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { KeyboardEvent } from 'react'; import { AuiIf, ComposerPrimitive, useAui, useAuiState } from '@assistant-ui/react' -import { ArrowUpIcon, ChevronUpIcon, SquareIcon, type LucideIcon } from 'lucide-react' -import { DropdownMenu, type DropdownMenuEntry } from '@renderer/components/ui' +import { ArrowUpIcon, ChevronUpIcon, SquareIcon } from 'lucide-react'; +import type { LucideIcon } from 'lucide-react'; +import { DropdownMenu } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; import { useAiStore } from '@renderer/stores/ai' import type { AiModelConfig, AiProviderConfig } from '../../../../preload' import { cn } from '@renderer/lib/utils' @@ -78,8 +81,8 @@ export function EoqComposer({ commands }: EoqComposerProps) { const handleKeyDown = useCallback( (event: KeyboardEvent) => { - if (event.nativeEvent.isComposing || event.keyCode === 229) return - if (!commandMenuOpen || filteredCommands.length === 0) return + if (event.nativeEvent.isComposing || event.keyCode === 229) {return} + if (!commandMenuOpen || filteredCommands.length === 0) {return} if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { const offset = event.key === 'ArrowDown' ? 1 : -1 @@ -128,7 +131,7 @@ export function EoqComposer({ commands }: EoqComposerProps) { const handleModelSelect = useCallback( (choice: string) => { const separatorIndex = choice.indexOf(':') - if (separatorIndex < 0) return + if (separatorIndex === -1) {return} setModelMenuOpen(false) void setActiveModel(choice.slice(0, separatorIndex), choice.slice(separatorIndex + 1)) }, @@ -209,7 +212,7 @@ export function EoqComposer({ commands }: EoqComposerProps) {
{ - if (event.target === event.currentTarget) inputRef.current?.focus() + if (event.target === event.currentTarget) {inputRef.current?.focus()} }} className="flex cursor-text flex-col gap-2 rounded-2xl border border-border-strong bg-elevated px-3 pt-2.5 pb-2 transition-[border-color,box-shadow] duration-200 hover:border-ink/25 focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/12 motion-reduce:transition-none" > diff --git a/src/renderer/src/components/eoq/EoqIconButton.tsx b/src/renderer/src/components/eoq/EoqIconButton.tsx index 6868c27f..794d3f52 100644 --- a/src/renderer/src/components/eoq/EoqIconButton.tsx +++ b/src/renderer/src/components/eoq/EoqIconButton.tsx @@ -1,5 +1,7 @@ -import { forwardRef, type ButtonHTMLAttributes } from 'react' -import { cva, type VariantProps } from 'class-variance-authority' +import { forwardRef } from 'react'; +import type { ButtonHTMLAttributes } from 'react'; +import { cva } from 'class-variance-authority'; +import type { VariantProps } from 'class-variance-authority'; import { Tooltip } from '@renderer/components/ui' import { cn } from '@renderer/lib/utils' @@ -37,7 +39,7 @@ export interface EoqIconButtonProps } export const EoqIconButton = forwardRef( - function EoqIconButton( + ( { tooltip, tooltipPlacement = 'top', @@ -49,7 +51,7 @@ export const EoqIconButton = forwardRef( ...props }, ref - ) { + ) => { const button = ( ) - if (!tooltip) return button + if (!tooltip) {return button} return ( diff --git a/src/renderer/src/components/eoq/EoqMarkdownText.tsx b/src/renderer/src/components/eoq/EoqMarkdownText.tsx index 37696251..d87350e9 100644 --- a/src/renderer/src/components/eoq/EoqMarkdownText.tsx +++ b/src/renderer/src/components/eoq/EoqMarkdownText.tsx @@ -1,4 +1,5 @@ -import { memo, type FC } from 'react' +import { memo } from 'react'; +import type { FC } from 'react'; import { useMessagePartText } from '@assistant-ui/react' import StreamingMarkdown from '../StreamingMarkdown' diff --git a/src/renderer/src/components/eoq/EoqMessages.tsx b/src/renderer/src/components/eoq/EoqMessages.tsx index 4fd6d3e9..4e8db275 100644 --- a/src/renderer/src/components/eoq/EoqMessages.tsx +++ b/src/renderer/src/components/eoq/EoqMessages.tsx @@ -1,20 +1,7 @@ -import { - createContext, - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, - type KeyboardEvent -} from 'react' -import { - ActionBarPrimitive, - MessagePrimitive, - ThreadPrimitive, - useAuiState, - type PartState -} from '@assistant-ui/react' +import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; +import type { KeyboardEvent } from 'react'; +import { ActionBarPrimitive, MessagePrimitive, ThreadPrimitive, useAuiState } from '@assistant-ui/react'; +import type { PartState } from '@assistant-ui/react'; import { AlertCircleIcon, AlertTriangleIcon, @@ -25,7 +12,8 @@ import { RefreshCwIcon } from 'lucide-react' import { useConfirm, useToast } from '@renderer/components/ui' -import { useAiStore, type ChatMessage, type ToolStep } from '@renderer/stores/ai' +import { useAiStore } from '@renderer/stores/ai'; +import type { ChatMessage, ToolStep } from '@renderer/stores/ai'; import { cn } from '@renderer/lib/utils' import EoqIconButton from './EoqIconButton' import EoqMarkdownText from './EoqMarkdownText' @@ -37,8 +25,8 @@ import EoqWebSearch from './EoqWebSearch' type EoqGroupKey = 'group-reasoning' | 'group-tool' const eoqGroupBy = (part: PartState): readonly EoqGroupKey[] => { - if (part.type === 'reasoning') return ['group-reasoning'] - if (part.type === 'tool-call' && part.toolName !== 'web_search') return ['group-tool'] + if (part.type === 'reasoning') {return ['group-reasoning']} + if (part.type === 'tool-call' && part.toolName !== 'web_search') {return ['group-tool']} return [] } @@ -60,7 +48,7 @@ const EoqThreadActionsContext = createContext { const map = new Map() - if (!chatMessage) return map + if (!chatMessage) {return map} for (const part of chatMessage.parts) { - if (part.kind === 'tool') map.set(part.step.callId, part.step) + if (part.kind === 'tool') {map.set(part.step.callId, part.step)} } return map }, [chatMessage]) - if (!chatMessage) return null + if (!chatMessage) {return null} return ( @@ -169,7 +157,7 @@ function EoqAssistantMessage() { let durationMs = 0 for (const index of part.indices) { const raw = chatMessage.parts[index] - if (raw?.kind === 'reasoning') durationMs += raw.ms + if (raw?.kind === 'reasoning') {durationMs += raw.ms} } return ( @@ -181,7 +169,7 @@ function EoqAssistantMessage() { let failedCount = 0 for (const index of part.indices) { const raw = chatMessage.parts[index] - if (raw?.kind === 'tool' && raw.step.status === 'error') failedCount += 1 + if (raw?.kind === 'tool' && raw.step.status === 'error') {failedCount += 1} } return ( @@ -189,10 +177,12 @@ function EoqAssistantMessage() { ) } - case 'reasoning': + case 'reasoning': { return
{part.text}
- case 'text': + } + case 'text': { return + } case 'tool-call': { const step = toolStepsById.get(part.toolCallId) if (part.toolName === 'web_search' && step) { @@ -207,7 +197,7 @@ function EoqAssistantMessage() { return ( } + args={(part.args ?? {})} argsText={part.argsText} result={part.result} isError={part.isError} @@ -216,14 +206,16 @@ function EoqAssistantMessage() { /> ) } - case 'indicator': + case 'indicator': { return ( 思考中… ) - default: + } + default: { return null + } } }} @@ -321,16 +313,16 @@ export function EoqMessages({ onSubmitPrompt }: EoqMessagesProps) { setEditingDraft('') }, [currentConversationId]) - useEffect(() => { - return () => { - if (copiedTimerRef.current !== undefined) clearTimeout(copiedTimerRef.current) + useEffect(() => + () => { + if (copiedTimerRef.current !== undefined) {clearTimeout(copiedTimerRef.current)} } - }, []) + , []) const discardsFollowing = useCallback((messageId: string): boolean => { const currentMessages = useAiStore.getState().messages const index = currentMessages.findIndex((item) => item.id === messageId) - return index >= 0 && index < currentMessages.length - 1 + return index !== -1 && index < currentMessages.length - 1 }, []) const startEdit = useCallback((chatMessage: ChatMessage) => { @@ -346,7 +338,7 @@ export function EoqMessages({ onSubmitPrompt }: EoqMessagesProps) { const confirmEdit = useCallback( (chatMessage: ChatMessage) => { const text = editingDraft.trim() - if (!text) return + if (!text) {return} if (!discardsFollowing(chatMessage.id)) { cancelEdit() void resendFrom(chatMessage.id, text) @@ -368,7 +360,7 @@ export function EoqMessages({ onSubmitPrompt }: EoqMessagesProps) { const handleEditKeydown = useCallback( (event: KeyboardEvent, chatMessage: ChatMessage) => { - if (event.nativeEvent.isComposing || event.keyCode === 229) return + if (event.nativeEvent.isComposing || event.keyCode === 229) {return} if (event.key === 'Enter' && !event.shiftKey) { event.preventDefault() confirmEdit(chatMessage) @@ -388,7 +380,7 @@ export function EoqMessages({ onSubmitPrompt }: EoqMessagesProps) { .writeText(chatMessage.content) .then(() => { setCopiedMessageId(chatMessage.id) - if (copiedTimerRef.current !== undefined) clearTimeout(copiedTimerRef.current) + if (copiedTimerRef.current !== undefined) {clearTimeout(copiedTimerRef.current)} copiedTimerRef.current = setTimeout(() => { setCopiedMessageId('') copiedTimerRef.current = undefined diff --git a/src/renderer/src/components/eoq/EoqReasoning.tsx b/src/renderer/src/components/eoq/EoqReasoning.tsx index ff3d3c34..da5287f5 100644 --- a/src/renderer/src/components/eoq/EoqReasoning.tsx +++ b/src/renderer/src/components/eoq/EoqReasoning.tsx @@ -1,4 +1,5 @@ -import { useCallback, useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react' +import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'; +import type { ReactNode } from 'react'; import { useScrollLock } from '@assistant-ui/react' import { BrainIcon, ChevronDownIcon } from 'lucide-react' import { cn } from '@renderer/lib/utils' @@ -7,7 +8,7 @@ import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from './colla const ANIMATION_DURATION = 200 function formatReasoningDuration(durationMs?: number): string { - if (durationMs === undefined || durationMs <= 0) return '已深度思考' + if (durationMs === undefined || durationMs <= 0) {return '已深度思考'} const seconds = durationMs / 1000 return seconds < 1 ? '已思考 <1s' : `已思考 ${Math.round(seconds)}s` } @@ -30,9 +31,9 @@ export function EoqReasoning({ streaming, durationMs, children }: EoqReasoningPr const prevStreamingRef = useRef(streaming) useLayoutEffect(() => { - if (prevStreamingRef.current === streaming) return + if (prevStreamingRef.current === streaming) {return} prevStreamingRef.current = streaming - if (userOpen === null) lockScroll() + if (userOpen === null) {lockScroll()} }, [lockScroll, streaming, userOpen]) const handleOpenChange = useCallback( @@ -44,10 +45,10 @@ export function EoqReasoning({ streaming, durationMs, children }: EoqReasoningPr ) useEffect(() => { - if (!isPreview) return + if (!isPreview) {return} const scrollEl = scrollRef.current const contentEl = contentRef.current - if (!scrollEl || !contentEl) return + if (!scrollEl || !contentEl) {return} let pinned = true let lastScrollTop = scrollEl.scrollTop @@ -58,7 +59,7 @@ export function EoqReasoning({ streaming, durationMs, children }: EoqReasoningPr scrollEl.scrollHeight <= scrollEl.clientHeight const pin = () => { - if (!pinned) return + if (!pinned) {return} scrollEl.scrollTop = scrollEl.scrollHeight } diff --git a/src/renderer/src/components/eoq/EoqRuntimeProvider.tsx b/src/renderer/src/components/eoq/EoqRuntimeProvider.tsx index 4aad6fc4..62f7c661 100644 --- a/src/renderer/src/components/eoq/EoqRuntimeProvider.tsx +++ b/src/renderer/src/components/eoq/EoqRuntimeProvider.tsx @@ -1,14 +1,9 @@ -import { useMemo, useRef, type ReactNode } from 'react' -import { - AssistantRuntimeProvider, - useExternalStoreRuntime, - type AppendMessage, - type ExternalStoreAdapter, - type MessageStatus, - type ThreadMessageLike, - type ToolCallMessagePart -} from '@assistant-ui/react' -import { useAiStore, type ChatMessage } from '@renderer/stores/ai' +import { useMemo, useRef } from 'react'; +import type { ReactNode } from 'react'; +import { AssistantRuntimeProvider, useExternalStoreRuntime } from '@assistant-ui/react'; +import type { AppendMessage, ExternalStoreAdapter, MessageStatus, ThreadMessageLike, ToolCallMessagePart } from '@assistant-ui/react'; +import { useAiStore } from '@renderer/stores/ai'; +import type { ChatMessage } from '@renderer/stores/ai'; export interface EoqRuntimeProviderProps { children: ReactNode @@ -34,7 +29,7 @@ function toToolArgs(args: Record): ToolCallArgs { } function parseToolResult(result: string): unknown { - if (!result) return '' + if (!result) {return ''} try { return JSON.parse(result) } catch { @@ -51,7 +46,7 @@ function extractAppendText(message: AppendMessage): string { } function toMessageStatus(message: ChatMessage): MessageStatus { - if (message.status === 'streaming') return { type: 'running' } + if (message.status === 'streaming') {return { type: 'running' }} if (message.status === 'error') { return { type: 'incomplete', @@ -90,7 +85,7 @@ export function convertChatMessage(message: ChatMessage): ThreadMessageLike { ? { timing: { startedAt: part.startedAt, - ...(completedAt !== undefined ? { completedAt } : {}) + ...(completedAt === undefined ? {} : { completedAt }) } } : {}) @@ -111,14 +106,14 @@ export function convertChatMessage(message: ChatMessage): ThreadMessageLike { argsText: serializeArgs(part.step.args), result: part.step.status === 'running' ? undefined : parseToolResult(part.step.result), isError: part.step.status === 'error', - ...(part.step.startedAt !== undefined - ? { + ...(part.step.startedAt === undefined + ? {} + : { timing: { startedAt: part.step.startedAt, - ...(part.step.completedAt !== undefined ? { completedAt: part.step.completedAt } : {}) + ...(part.step.completedAt === undefined ? {} : { completedAt: part.step.completedAt }) } - } - : {}) + }) } }) @@ -148,13 +143,13 @@ export function EoqRuntimeProvider({ children, onInterceptSend }: EoqRuntimeProv convertMessage: convertChatMessage, async onNew(message: AppendMessage): Promise { const text = extractAppendText(message) - if (!text) return - if (onInterceptSendRef.current?.(text)) return + if (!text) {return} + if (onInterceptSendRef.current?.(text)) {return} await useAiStore.getState().send(text) }, async onEdit(message: AppendMessage): Promise { const text = extractAppendText(message) - if (!text) return + if (!text) {return} const state = useAiStore.getState() const targetId = message.sourceId ?? @@ -179,7 +174,7 @@ export function EoqRuntimeProvider({ children, onInterceptSend }: EoqRuntimeProv return } const parentIndex = state.messages.findIndex((item) => item.id === parentId) - if (parentIndex < 0) return + if (parentIndex === -1) {return} const nextMessage = state.messages[parentIndex + 1] if (nextMessage?.role === 'assistant') { await state.regenerate(nextMessage.id) diff --git a/src/renderer/src/components/eoq/EoqToolCall.tsx b/src/renderer/src/components/eoq/EoqToolCall.tsx index 046d88e6..ec5df4e3 100644 --- a/src/renderer/src/components/eoq/EoqToolCall.tsx +++ b/src/renderer/src/components/eoq/EoqToolCall.tsx @@ -1,11 +1,9 @@ import { useCallback, useRef, useState } from 'react' -import { - useScrollLock, - useToolCallElapsed, - type ToolCallMessagePartStatus -} from '@assistant-ui/react' +import { useScrollLock, useToolCallElapsed } from '@assistant-ui/react'; +import type { ToolCallMessagePartStatus } from '@assistant-ui/react'; import { CheckIcon, ChevronRightIcon, Loader2Icon, XCircleIcon } from 'lucide-react' -import { toolLabel, type ToolStep } from '@renderer/stores/ai' +import { toolLabel } from '@renderer/stores/ai'; +import type { ToolStep } from '@renderer/stores/ai'; import { cn } from '@renderer/lib/utils' import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from './collapsible' @@ -14,20 +12,20 @@ const ANIMATION_DURATION = 200 const PRIMARY_ARG_KEYS = ['query', 'name', 'place', 'location', 'city', 'layer', 'panel', 'title', 'topic'] function formatElapsed(ms: number): string { - if (ms < 1000) return '<1s' + if (ms < 1000) {return '<1s'} const seconds = ms / 1000 - if (seconds < 10) return `${(Math.floor(seconds * 10) / 10).toFixed(1)}s` - if (seconds < 60) return `${Math.floor(seconds)}s` + if (seconds < 10) {return `${(Math.floor(seconds * 10) / 10).toFixed(1)}s`} + if (seconds < 60) {return `${Math.floor(seconds)}s`} return `${Math.floor(seconds / 60)}m ${Math.floor(seconds % 60)}s` } function primaryArgPreview(args: Record): string { for (const key of PRIMARY_ARG_KEYS) { const value = args[key] - if (typeof value === 'string' && value.trim()) return value.trim() + if (typeof value === 'string' && value.trim()) {return value.trim()} } for (const value of Object.values(args)) { - if (typeof value === 'string' && value.trim()) return value.trim() + if (typeof value === 'string' && value.trim()) {return value.trim()} } return '' } @@ -41,7 +39,7 @@ function formatInput(args: Record, argsText: string): string { return argsText || '(无输入)' } } - if (argsText && argsText !== '{}') return argsText + if (argsText && argsText !== '{}') {return argsText} return '(无输入)' } diff --git a/src/renderer/src/components/eoq/EoqToolGroup.tsx b/src/renderer/src/components/eoq/EoqToolGroup.tsx index 3bbbe2a0..97526201 100644 --- a/src/renderer/src/components/eoq/EoqToolGroup.tsx +++ b/src/renderer/src/components/eoq/EoqToolGroup.tsx @@ -1,5 +1,7 @@ -import { useCallback, useRef, useState, type ReactNode } from 'react' -import { useScrollLock, type MessagePrimitive } from '@assistant-ui/react' +import { useCallback, useRef, useState } from 'react'; +import type { ReactNode } from 'react'; +import { useScrollLock } from '@assistant-ui/react'; +import type { MessagePrimitive } from '@assistant-ui/react'; import { CheckIcon, ChevronRightIcon, Loader2Icon, XCircleIcon } from 'lucide-react' import { cn } from '@renderer/lib/utils' import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from './collapsible' @@ -29,7 +31,7 @@ export function EoqToolGroup({ group, failedCount, children }: EoqToolGroupProps const total = group.indices.length if (total <= 1) { - return <>{children} + return children } const running = group.status.type === 'running' diff --git a/src/renderer/src/components/eoq/EoqWebSearch.tsx b/src/renderer/src/components/eoq/EoqWebSearch.tsx index cc5672c6..a8f149c9 100644 --- a/src/renderer/src/components/eoq/EoqWebSearch.tsx +++ b/src/renderer/src/components/eoq/EoqWebSearch.tsx @@ -8,7 +8,7 @@ const VISIBLE_COUNT = 3 const ALLOWED_SCHEMES = new Set(['http:', 'https:']) function domainOf(reference: AiSearchReference): string { - if (reference.website) return reference.website + if (reference.website) {return reference.website} try { return new URL(reference.url).hostname } catch { diff --git a/src/renderer/src/components/eoq/collapsible.tsx b/src/renderer/src/components/eoq/collapsible.tsx index 0c818f3f..505bd283 100644 --- a/src/renderer/src/components/eoq/collapsible.tsx +++ b/src/renderer/src/components/eoq/collapsible.tsx @@ -1,13 +1,14 @@ import { Collapsible } from '@base-ui/react/collapsible' -import { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react' +import { forwardRef } from 'react'; +import type { ComponentPropsWithoutRef, ComponentRef } from 'react'; import { cn } from '@renderer/lib/utils' export const CollapsibleRoot = forwardRef< ComponentRef, ComponentPropsWithoutRef ->(function CollapsibleRoot(props, ref) { - return -}) +>((props, ref) => + +) export function CollapsibleTrigger({ className, ...props }: Collapsible.Trigger.Props) { return ( diff --git a/src/renderer/src/components/settings/AboutSettings.tsx b/src/renderer/src/components/settings/AboutSettings.tsx index 2618ed1d..c909c9a4 100644 --- a/src/renderer/src/components/settings/AboutSettings.tsx +++ b/src/renderer/src/components/settings/AboutSettings.tsx @@ -18,7 +18,7 @@ export function AboutSettings(_props: AboutSettingsProps) { const versionText = currentVersion ? `v${currentVersion}` : '未知' async function copyDiagnostics(): Promise { - if (copying) return + if (copying) {return} setCopying(true) try { await window.guEarth.logs.copy(logger.dump()) diff --git a/src/renderer/src/components/settings/AccountSettings.tsx b/src/renderer/src/components/settings/AccountSettings.tsx index 093b7441..015acbd4 100644 --- a/src/renderer/src/components/settings/AccountSettings.tsx +++ b/src/renderer/src/components/settings/AccountSettings.tsx @@ -35,7 +35,7 @@ export function AccountSettings(_props: AccountSettingsProps) { const awaitingApproval = phase === 'awaiting-approval' || phase === 'finalizing' useEffect(() => { - if (!awaitingApproval) return + if (!awaitingApproval) {return} setNow(Date.now()) const ticker = setInterval(() => { setNow(Date.now()) @@ -43,23 +43,24 @@ export function AccountSettings(_props: AccountSettingsProps) { return () => clearInterval(ticker) }, [awaitingApproval]) - useEffect(() => { - return () => { - if (copiedTimerRef.current !== undefined) clearTimeout(copiedTimerRef.current) + useEffect(() => + () => { + if (copiedTimerRef.current !== undefined) {clearTimeout(copiedTimerRef.current)} } - }, []) + , []) const remainingSeconds = challengeExpiresAt ? Math.max(0, Math.ceil((challengeExpiresAt - now) / 1000)) : 0 const remainingText = `${Math.floor(remainingSeconds / 60)}:${String(remainingSeconds % 60).padStart(2, '0')}` const challengeExpired = phase === 'awaiting-approval' && remainingSeconds <= 0 const displayName = storeDisplayName || '未命名账户' - const avatarInitial = Array.from(displayName)[0]?.toUpperCase() || 'U' + // oxlint-disable-next-line typescript/no-misused-spread -- spreading splits by code point, so the initial keeps surrogate pairs whole + const avatarInitial = [...displayName][0]?.toUpperCase() || 'U' const emailText = profile?.email || profile?.username || '' const loginLoading = phase === 'creating' || phase === 'restoring' async function copyUserCode(): Promise { - if (!userCode) return + if (!userCode) {return} try { await navigator.clipboard.writeText(userCode) } catch { @@ -67,7 +68,7 @@ export function AccountSettings(_props: AccountSettingsProps) { return } setCopied(true) - if (copiedTimerRef.current !== undefined) clearTimeout(copiedTimerRef.current) + if (copiedTimerRef.current !== undefined) {clearTimeout(copiedTimerRef.current)} copiedTimerRef.current = setTimeout(() => { setCopied(false) copiedTimerRef.current = undefined diff --git a/src/renderer/src/components/settings/AiSettingsSection.tsx b/src/renderer/src/components/settings/AiSettingsSection.tsx index 31410590..5d18986b 100644 --- a/src/renderer/src/components/settings/AiSettingsSection.tsx +++ b/src/renderer/src/components/settings/AiSettingsSection.tsx @@ -1,4 +1,5 @@ -import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, type KeyboardEvent, type Ref } from 'react' +import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'; +import type { KeyboardEvent, Ref } from 'react'; import { EyeIcon, LightbulbIcon, @@ -40,14 +41,8 @@ import type { import { useAiStore } from '@renderer/stores/ai' import { useSettingsWindowStore } from '@renderer/stores/settingsWindow' import { ipcErrorMessage } from '@renderer/lib/ipcError' -import { - isAiDraftDirty, - normalizeActiveChoice, - parseActiveChoice, - type AiDraftModel, - type AiDraftProvider, - type AiPersistedState -} from '@renderer/lib/aiSettingsDraft' +import { isAiDraftDirty, normalizeActiveChoice, parseActiveChoice } from '@renderer/lib/aiSettingsDraft'; +import type { AiDraftModel, AiDraftProvider, AiPersistedState } from '@renderer/lib/aiSettingsDraft'; import SearchProviderSettings from '../SearchProviderSettings' import MemorySettings from '../MemorySettings' import styles from './AiSettingsSection.module.css' @@ -86,7 +81,7 @@ const PROTOCOL_OPTIONS: { value: AiProviderConfig['protocol']; label: string }[] const EMPTY_MODEL_DRAFT: AiModelConfig = { id: '', label: '', - contextWindow: 128000, + contextWindow: 128_000, streaming: true, vision: false, thinking: false, @@ -197,7 +192,7 @@ export function AiSettingsSection({ const filteredModels = useMemo(() => { const query = modelSearch.trim().toLowerCase() const models = selectedProvider?.models ?? [] - if (!query) return models + if (!query) {return models} return models.filter( (model) => model.label.toLowerCase().includes(query) || model.id.toLowerCase().includes(query) ) @@ -222,7 +217,7 @@ export function AiSettingsSection({ ) const dirty = useMemo(() => { - if (settingsReading || settingsReadFailed) return false + if (settingsReading || settingsReadFailed) {return false} return isAiDraftDirty( { providers: draftProviders, @@ -275,17 +270,17 @@ export function AiSettingsSection({ void (async () => { try { await hydrate() - if (cancelled) return + if (cancelled) {return} const failed = !useAiStore.getState().hydrated setSettingsReadFailed(failed) - if (failed) return + if (failed) {return} const providers = syncDraftsFromStore() setApiKeyDraft('') void refreshCredentialStatuses(providers) } catch { - if (!cancelled) setSettingsReadFailed(true) + if (!cancelled) {setSettingsReadFailed(true)} } finally { - if (!cancelled) setSettingsReading(false) + if (!cancelled) {setSettingsReading(false)} } })() return () => { @@ -306,7 +301,7 @@ export function AiSettingsSection({ useEffect(() => { const lastPage = Math.max(1, Math.ceil(filteredModels.length / MODEL_PAGE_SIZE)) - if (modelPage > lastPage) setModelPage(lastPage) + if (modelPage > lastPage) {setModelPage(lastPage)} }, [filteredModels.length, modelPage]) const updateSelectedProvider = useCallback( @@ -337,10 +332,10 @@ export function AiSettingsSection({ const removeProvider = useCallback( (providerId: string) => { const provider = draftProviders.find((item) => item.id === providerId) - if (!provider) return + if (!provider) {return} confirm({ title: '删除服务商?', - content: provider.models.length + content: provider.models.length > 0 ? `将同时删除其下的 ${provider.models.length} 个模型。` : '该服务商将从列表中移除。', okText: '删除', @@ -361,7 +356,7 @@ export function AiSettingsSection({ ) const addModel = useCallback(() => { - if (!selectedProvider) return + if (!selectedProvider) {return} setModelEditorKey('') setModelEditorTitle('添加模型') setModelDraft({ ...EMPTY_MODEL_DRAFT }) @@ -385,7 +380,7 @@ export function AiSettingsSection({ }, []) const saveModel = useCallback(() => { - if (!selectedProvider) return + if (!selectedProvider) {return} const id = modelDraft.id.trim() if (!id) { toast.warning('请填写模型代号') @@ -411,7 +406,7 @@ export function AiSettingsSection({ } if (modelEditorKey) { const existing = selectedProvider.models.find((item) => item.key === modelEditorKey) - if (!existing) return + if (!existing) {return} const previousId = existing.id const providerId = selectedProvider.id updateSelectedProvider((provider) => ({ @@ -437,9 +432,9 @@ export function AiSettingsSection({ const removeModel = useCallback( (modelKey: string) => { - if (!selectedProvider) return + if (!selectedProvider) {return} const model = selectedProvider.models.find((item) => item.key === modelKey) - if (!model) return + if (!model) {return} const providerId = selectedProvider.id confirm({ title: '删除模型?', @@ -465,7 +460,7 @@ export function AiSettingsSection({ const toggleModel = useCallback( (model: AiDraftModel, checked: boolean) => { - if (!selectedProvider) return + if (!selectedProvider) {return} const providerId = selectedProvider.id updateSelectedProvider((provider) => ({ ...provider, @@ -480,7 +475,7 @@ export function AiSettingsSection({ const testModel = useCallback( async (model: AiDraftModel): Promise => { - if (!selectedProvider || testingModelKey) return + if (!selectedProvider || testingModelKey) {return} if (!selectedProvider.baseUrl.trim()) { toast.warning('请先填写接口地址') return @@ -521,12 +516,12 @@ export function AiSettingsSection({ useEffect(() => { const lastPage = Math.max(1, Math.ceil(importRows.length / importPageSize)) - if (importPage > lastPage) setImportPage(lastPage) + if (importPage > lastPage) {setImportPage(lastPage)} }, [importPage, importPageSize, importRows.length]) const canImport = useCallback( (provider: AiDraftProvider | undefined): boolean => - Boolean(provider && provider.baseUrl.trim() && credentialStatuses[provider.id]?.configured && !settingsLocked), + Boolean(provider?.baseUrl?.trim() && credentialStatuses[provider.id]?.configured && !settingsLocked), [credentialStatuses, settingsLocked] ) @@ -551,7 +546,7 @@ export function AiSettingsSection({ }, [invalidateImportSession]) const openImport = useCallback(async (): Promise => { - if (!selectedProvider) return + if (!selectedProvider) {return} if (!selectedProvider.baseUrl.trim()) { toast.warning('请先填写接口地址') return @@ -576,24 +571,24 @@ export function AiSettingsSection({ models: selectedProvider.models.map(({ key: _key, ...model }) => model), modelGroupCompat }) - if (token !== importRequestTokenRef.current) return + if (token !== importRequestTokenRef.current) {return} applyImportRows(result.models) toast.success(`已获取 ${result.models.length} 个模型`) } catch (error) { - if (token !== importRequestTokenRef.current) return + if (token !== importRequestTokenRef.current) {return} setImportOpen(false) toast.error(ipcErrorMessage(error, '模型导入失败')) } finally { - if (token === importRequestTokenRef.current) setImportLoading(false) + if (token === importRequestTokenRef.current) {setImportLoading(false)} } }, [applyImportRows, credentialStatuses, modelGroupCompat, selectedProvider, toast]) const refreshImportMatches = useCallback( async (next = modelGroupCompat): Promise => { - if (!importProvider || importLoading || importMatching) return + if (!importProvider || importLoading || importMatching) {return} const previous = modelGroupCompat setModelGroupCompat(next) - if (!importRows.length) return + if (importRows.length === 0) {return} const token = ++importRequestTokenRef.current setImportMatching(true) try { @@ -606,14 +601,14 @@ export function AiSettingsSection({ ids: importRows.map((row) => row.id), modelGroupCompat: next }) - if (token !== importRequestTokenRef.current) return + if (token !== importRequestTokenRef.current) {return} applyImportRows(result.models) } catch (error) { - if (token !== importRequestTokenRef.current) return + if (token !== importRequestTokenRef.current) {return} setModelGroupCompat(previous) toast.error(ipcErrorMessage(error, '模型匹配失败')) } finally { - if (token === importRequestTokenRef.current) setImportMatching(false) + if (token === importRequestTokenRef.current) {setImportMatching(false)} } }, [applyImportRows, importLoading, importMatching, importProvider, importRows, modelGroupCompat, toast] @@ -622,11 +617,11 @@ export function AiSettingsSection({ const updateImportRow = useCallback((key: string, patch: Partial, revalidate = false): void => { setImportRows((previous) => previous.map((row) => { - if (row.key !== key) return row + if (row.key !== key) {return row} const next: ImportRowDraft = { ...row, ...patch } if (revalidate) { next.matched = Boolean(next.id.trim() && next.contextWindow >= 4096) - if (next.matched) next.failureReason = undefined + if (next.matched) {next.failureReason = undefined} } return next }) @@ -638,7 +633,7 @@ export function AiSettingsSection({ }, []) const confirmImport = useCallback((): void => { - if (!importProvider) return + if (!importProvider) {return} const invalid = importRows.find((row) => row.selected && (!row.id.trim() || row.contextWindow < 4096)) if (invalid) { toast.warning('请先修正选中的模型') @@ -647,7 +642,7 @@ export function AiSettingsSection({ const ids = new Set(importProvider.models.map((model) => model.id.trim())) const seenSelected = new Set() for (const row of importRows) { - if (!row.selected) continue + if (!row.selected) {continue} const id = row.id.trim() if (seenSelected.has(id)) { toast.warning(`选中的模型中存在重复 ID:${id}`) @@ -657,13 +652,13 @@ export function AiSettingsSection({ } const rows: ImportRowDraft[] = [] for (const row of importRows) { - if (!row.selected) continue + if (!row.selected) {continue} const id = row.id.trim() - if (ids.has(id)) continue + if (ids.has(id)) {continue} ids.add(id) rows.push(row) } - if (!rows.length) { + if (rows.length === 0) { toast.info('没有可加入的模型') return } @@ -710,7 +705,7 @@ export function AiSettingsSection({ const saveApiKey = useCallback(async (): Promise => { const key = apiKeyDraft.trim() - if (!selectedProvider || !key) return + if (!selectedProvider || !key) {return} const providerId = selectedProvider.id try { const status = await window.guEarth.settings.setProviderApiKey(credentialId(providerId), key) @@ -723,7 +718,7 @@ export function AiSettingsSection({ }, [apiKeyDraft, selectedProvider, toast]) const clearApiKey = useCallback(async (): Promise => { - if (!selectedProvider) return + if (!selectedProvider) {return} const providerId = selectedProvider.id try { const status = await window.guEarth.settings.clearProviderApiKey(credentialId(providerId)) @@ -736,7 +731,7 @@ export function AiSettingsSection({ const toggleSocratic = useCallback( async (value: boolean): Promise => { - if (socraticBusy || settingsLocked) return + if (socraticBusy || settingsLocked) {return} setSocraticBusy(true) try { await setSocraticEnabled(value) @@ -751,17 +746,17 @@ export function AiSettingsSection({ const validate = useCallback((providers: AiDraftProvider[]): string => { for (const provider of providers) { - if (!provider.name.trim()) return '供应商名称不能为空' - if (!provider.baseUrl.trim()) return `「${provider.name}」的接口地址不能为空` + if (!provider.name.trim()) {return '供应商名称不能为空'} + if (!provider.baseUrl.trim()) {return `「${provider.name}」的接口地址不能为空`} for (const model of provider.models) { - if (!model.id.trim()) return `「${provider.name}」下存在未填写 ID 的模型` + if (!model.id.trim()) {return `「${provider.name}」下存在未填写 ID 的模型`} } } return '' }, []) const saveDrafts = useCallback(async (): Promise => { - if (settingsReading) return false + if (settingsReading) {return false} if (settingsReadFailed) { toast.error('AI 设置读取失败,无法保存') return false @@ -817,7 +812,7 @@ export function AiSettingsSection({ latest.searchProviders, latest.activeSearchProviderId ) !== submittedSignature - if (!editedDuringSave) syncDraftsFromStore() + if (!editedDuringSave) {syncDraftsFromStore()} toast.success(editedDuringSave ? '此前的改动已保存,新的改动尚未保存' : 'AI 设置已保存') return true } catch { @@ -832,7 +827,7 @@ export function AiSettingsSection({ const handleSave = useCallback(async (): Promise => { const saved = await saveDrafts() - if (!saved) return + if (!saved) {return} const latest = latestDraftsRef.current const currentSettings = useAiStore.getState().settings const stillDirty = isAiDraftDirty(latest, { @@ -842,7 +837,7 @@ export function AiSettingsSection({ searchProviders: currentSettings.searchProviders, activeSearchProviderId: currentSettings.activeSearchProviderId }) - if (!stillDirty) closeSettingsWindow() + if (!stillDirty) {closeSettingsWindow()} }, [closeSettingsWindow, saveDrafts]) useImperativeHandle( @@ -872,7 +867,7 @@ export function AiSettingsSection({ ) const handleModelRowKeyDown = (event: KeyboardEvent, model: AiDraftModel): void => { - if (event.target !== event.currentTarget) return + if (event.target !== event.currentTarget) {return} if (event.key === 'Enter' || event.key === ' ') { event.preventDefault() editModel(model) @@ -1160,8 +1155,8 @@ export function AiSettingsSection({ value={modelDraft.contextWindow} className={styles.modelContextInput} min={4096} - max={2000000} - step={32000} + max={2_000_000} + step={32_000} aria-label="最大上下文长度" onChange={(value) => setModelDraft((previous) => ({ @@ -1211,7 +1206,7 @@ export function AiSettingsSection({ options={THINKING_LEVEL_OPTIONS} aria-label="思考深度" onChange={(thinkingLevel) => { - if (thinkingLevel) setModelDraft((previous) => ({ ...previous, thinkingLevel })) + if (thinkingLevel) {setModelDraft((previous) => ({ ...previous, thinkingLevel }))} }} /> @@ -1315,7 +1310,7 @@ export function AiSettingsSection({ diff --git a/src/renderer/src/components/settings/GeneralSettings.tsx b/src/renderer/src/components/settings/GeneralSettings.tsx index c97982e1..47b29f27 100644 --- a/src/renderer/src/components/settings/GeneralSettings.tsx +++ b/src/renderer/src/components/settings/GeneralSettings.tsx @@ -10,7 +10,7 @@ export interface GeneralSettingsProps { onRestartGuide?: () => void } -const themeModeOptions: Array<{ value: ThemeMode; label: string }> = [ +const themeModeOptions: { value: ThemeMode; label: string }[] = [ { value: 'light', label: '浅色' }, { value: 'dark', label: '深色' }, { value: 'system', label: '跟随系统' } @@ -30,16 +30,16 @@ export function GeneralSettings({ onRestartGuide }: GeneralSettingsProps) { window.guEarth.recordings .getDirectory() .then((value) => { - if (!cancelled) setDirectory(value) + if (!cancelled) {setDirectory(value)} }) - .catch(() => undefined) + .catch(() => {}) return () => { cancelled = true } }, []) async function chooseDirectory(): Promise { - if (choosing) return + if (choosing) {return} setChoosing(true) try { const next = await window.guEarth.recordings.chooseDirectory() @@ -55,7 +55,7 @@ export function GeneralSettings({ onRestartGuide }: GeneralSettingsProps) { } async function restartGuide(): Promise { - await window.guEarth.settings.update({ setupGuideDismissed: false }).catch(() => undefined) + await window.guEarth.settings.update({ setupGuideDismissed: false }).catch(() => {}) closeSettingsWindow() onRestartGuide?.() } diff --git a/src/renderer/src/components/settings/LaboratorySettings.tsx b/src/renderer/src/components/settings/LaboratorySettings.tsx index bd1c67e1..81639091 100644 --- a/src/renderer/src/components/settings/LaboratorySettings.tsx +++ b/src/renderer/src/components/settings/LaboratorySettings.tsx @@ -14,12 +14,8 @@ import { useToast } from '@renderer/components/ui' import { useOnlineDataStore } from '@renderer/stores/onlineData' -import { - normalizeQWeatherHost, - validateQWeatherApiKey, - type LaboratoryProvider, - type LaboratoryProviderInput -} from '../../../../common/onlineData' +import { normalizeQWeatherHost, validateQWeatherApiKey } from '../../../../common/onlineData'; +import type { LaboratoryProvider, LaboratoryProviderInput } from '../../../../common/onlineData'; import styles from './LaboratorySettings.module.css' export interface LaboratorySettingsProps { @@ -62,7 +58,7 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP const busy = operation !== null const provider = providers.find((item) => item.provider === 'qweather') - const providerIssue = !provider?.configured ? '配置异常,请重新填写' : snapshot?.typhoonError || '' + const providerIssue = provider?.configured ? snapshot?.typhoonError || '' : '配置异常,请重新填写' const keyRequired = !editing || !provider?.configured const actionsDisabled = busy || editorOpen || removeOpen @@ -83,7 +79,7 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP }, []) const loadProviders = useCallback(async (): Promise => { - if (actionsDisabledRef.current) return + if (actionsDisabledRef.current) {return} setOperation('load') setLoadError('') try { @@ -98,29 +94,29 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP }, []) const closeDialogs = useCallback(() => { - if (busyRef.current) return + if (busyRef.current) {return} setEditorOpen(false) setRemoveOpen(false) clearDraft() }, [clearDraft]) useEffect(() => { - if (active && !loadedRef.current) void loadProviders() - if (!active) closeDialogs() + if (active && !loadedRef.current) {void loadProviders()} + if (!active) {closeDialogs()} }, [active, loadProviders, closeDialogs]) useEffect(() => { onBusyChangeRef.current?.(operation === 'save' || operation === 'remove') }, [operation]) - useEffect(() => { - return () => { + useEffect(() => + () => { onBusyChangeRef.current?.(false) } - }, []) + , []) function openEditor(edit: boolean): void { - if (actionsDisabled || !loaded || (edit ? !provider : Boolean(provider))) return + if (actionsDisabled || !loaded || (edit ? !provider : Boolean(provider))) {return} clearDraft() setEditing(edit) setDraft({ @@ -131,19 +127,19 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP } async function saveProvider(): Promise { - if (busy || !editorOpen || (!editing && provider)) return + if (busy || !editorOpen || (!editing && provider)) {return} let nextHostError = '' let nextKeyError = '' const rawKey = draft.apiKey.trim() let apiKey = '' - if (!rawKey) { - nextKeyError = keyRequired ? '请输入 API Key' : '' - } else { + if (rawKey) { try { apiKey = validateQWeatherApiKey(rawKey) } catch (error) { nextKeyError = error instanceof Error ? error.message : '请输入有效的 API Key' } + } else { + nextKeyError = keyRequired ? '请输入 API Key' : '' } let apiHost = '' try { @@ -153,9 +149,9 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP } setHostError(nextHostError) setKeyError(nextKeyError) - if (nextHostError || nextKeyError) return + if (nextHostError || nextKeyError) {return} const input: LaboratoryProviderInput = { category: draft.category, provider: draft.provider, apiHost } - if (apiKey) input.apiKey = apiKey + if (apiKey) {input.apiKey = apiKey} setOperation('save') setOperationError('') try { @@ -172,13 +168,13 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP } function confirmRemove(): void { - if (actionsDisabled || !provider) return + if (actionsDisabled || !provider) {return} setOperationError('') setRemoveOpen(true) } async function removeProvider(): Promise { - if (busy || !removeOpen || !provider) return + if (busy || !removeOpen || !provider) {return} setOperation('remove') setOperationError('') try { @@ -310,7 +306,7 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP options={CATEGORY_OPTIONS} aria-label="数据源类型" onChange={(value) => { - if (value) setDraft((prev) => ({ ...prev, category: value })) + if (value) {setDraft((prev) => ({ ...prev, category: value }))} }} />
@@ -322,7 +318,7 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP options={PROVIDER_OPTIONS} aria-label="数据源平台" onChange={(value) => { - if (value) setDraft((prev) => ({ ...prev, provider: value })) + if (value) {setDraft((prev) => ({ ...prev, provider: value }))} }} />
diff --git a/src/renderer/src/components/settings/MapSettings.tsx b/src/renderer/src/components/settings/MapSettings.tsx index 4d601045..a9ffa6ae 100644 --- a/src/renderer/src/components/settings/MapSettings.tsx +++ b/src/renderer/src/components/settings/MapSettings.tsx @@ -2,17 +2,12 @@ import { useEffect, useMemo, useState } from 'react' import { SaveIcon, Trash2Icon } from 'lucide-react' import { Alert, Button, PasswordInput, Input, Segmented, Select, Switch, Tag, useToast } from '@renderer/components/ui' import { credentialOnlyProviders, providerCatalog, useGlobeStore } from '@renderer/stores/globe' -import { networkProxyMode, normalizeNetworkProxy, type NetworkProxyMode } from '../../../../common/networkProxy' -import { - mirrorEndpointLabel, - mirrorEndpointShortLabel, - type MirrorEndpointPreference -} from '../../../../common/tileMirror' -import { - normalizeTouchInteractionMode, - touchInteractionModes, - type TouchInteractionMode -} from '../../../../common/touchInteraction' +import { networkProxyMode, normalizeNetworkProxy } from '../../../../common/networkProxy'; +import type { NetworkProxyMode } from '../../../../common/networkProxy'; +import { mirrorEndpointLabel, mirrorEndpointShortLabel } from '../../../../common/tileMirror'; +import type { MirrorEndpointPreference } from '../../../../common/tileMirror'; +import { normalizeTouchInteractionMode, touchInteractionModes } from '../../../../common/touchInteraction'; +import type { TouchInteractionMode } from '../../../../common/touchInteraction'; import styles from './MapSettings.module.css' export interface MapSettingsProps {} @@ -36,13 +31,13 @@ const touchInteractionModeOptions = touchInteractionModes.map((mode) => ({ label: touchInteractionModeLabels[mode] })) -const proxyModeOptions: Array<{ value: NetworkProxyMode; label: string }> = [ +const proxyModeOptions: { value: NetworkProxyMode; label: string }[] = [ { value: 'system', label: '跟随系统' }, { value: 'direct', label: '直连' }, { value: 'custom', label: '自定义' } ] -const mirrorSourceOptions: Array<{ value: MirrorEndpointPreference; label: string }> = [ +const mirrorSourceOptions: { value: MirrorEndpointPreference; label: string }[] = [ { value: 'auto', label: '自动匹配' }, { value: 'edgeone', label: 'EdgeOne' }, { value: 'cloudflare', label: 'Cloudflare' } @@ -84,13 +79,13 @@ export function MapSettings(_props: MapSettingsProps) { const [proxyTestResult, setProxyTestResult] = useState<{ ok: boolean; text: string } | null>(null) useEffect(() => { - if (typeof window.guEarth?.tiles?.getMirrorStatus !== 'function') return + if (typeof window.guEarth?.tiles?.getMirrorStatus !== 'function') {return} void window.guEarth.tiles .getMirrorStatus() .then((status) => { applyTileMirrorStatus(status) }) - .catch(() => undefined) + .catch(() => {}) }, [applyTileMirrorStatus]) useEffect(() => { @@ -164,14 +159,14 @@ export function MapSettings(_props: MapSettingsProps) { const proxyApplyEnabled = normalizedProxyDraft !== '' && normalizedProxyDraft !== networkProxy function handleCredentialProviderChange(nextId: string | undefined): void { - if (!nextId) return + if (!nextId) {return} setCredentialProviderId(nextId) setCredentialDraft('') setCredentialSkDraft('') } async function reprobeMirrorEndpoints(): Promise { - if (mirrorProbingEndpoints || typeof window.guEarth?.tiles?.probeMirrorEndpoints !== 'function') return + if (mirrorProbingEndpoints || typeof window.guEarth?.tiles?.probeMirrorEndpoints !== 'function') {return} try { const status = await window.guEarth.tiles.probeMirrorEndpoints() applyTileMirrorStatus(status) @@ -193,7 +188,7 @@ export function MapSettings(_props: MapSettingsProps) { } async function retryTileMirror(): Promise { - if (typeof window.guEarth?.tiles?.resetMirrorFallback !== 'function') return + if (typeof window.guEarth?.tiles?.resetMirrorFallback !== 'function') {return} try { const status = await window.guEarth.tiles.resetMirrorFallback() applyTileMirrorStatus(status) @@ -215,7 +210,7 @@ export function MapSettings(_props: MapSettingsProps) { const id = credentialProviderId const value = credentialDraft.trim() const sk = credentialSkDraft.trim() - if (!id || !value || (requiresSecurityKey && !sk)) return + if (!id || !value || (requiresSecurityKey && !sk)) {return} const touchesSecurityKey = sk !== '' || id === 'amap' try { const status = await window.guEarth.settings.setProviderApiKey(id, value) @@ -242,7 +237,7 @@ export function MapSettings(_props: MapSettingsProps) { async function clearCredential(): Promise { const id = credentialProviderId - if (!id) return + if (!id) {return} try { const status = await window.guEarth.settings.clearProviderApiKey(id) setCredentialStatus(id, status) @@ -266,12 +261,12 @@ export function MapSettings(_props: MapSettingsProps) { } function applyProxy(): void { - if (!proxyApplyEnabled) return + if (!proxyApplyEnabled) {return} setNetworkProxy(normalizedProxyDraft) } async function testProxy(): Promise { - if (proxyTesting) return + if (proxyTesting) {return} if (proxyModeView === 'custom' && normalizedProxyDraft === '') { setProxyTestResult({ ok: false, text: '请输入有效的代理地址' }) return diff --git a/src/renderer/src/components/settings/PrivacySettings.tsx b/src/renderer/src/components/settings/PrivacySettings.tsx index 1f894cdc..8552237c 100644 --- a/src/renderer/src/components/settings/PrivacySettings.tsx +++ b/src/renderer/src/components/settings/PrivacySettings.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' import { Button, Modal, Switch, Tag, useToast } from '@renderer/components/ui' -import { PRIVACY_DISCLOSURES, privacyDisclosureFor, type PrivacySettingKey } from '../../../../common/privacy' +import { PRIVACY_DISCLOSURES, privacyDisclosureFor } from '../../../../common/privacy'; +import type { PrivacySettingKey } from '../../../../common/privacy'; import { usePrivacyStore } from '@renderer/stores/privacy' import styles from './PrivacySettings.module.css' @@ -26,13 +27,13 @@ export function PrivacySettings(_props: PrivacySettingsProps) { }, [hydrate]) function isEnabled(key: PrivacySettingKey): boolean { - if (key === 'errorReportingEnabled') return errorReportingEnabled - if (key === 'telemetryEnabled') return telemetryEnabled + if (key === 'errorReportingEnabled') {return errorReportingEnabled} + if (key === 'telemetryEnabled') {return telemetryEnabled} return aiTelemetryEnabled } async function handleSwitchChange(key: PrivacySettingKey, checked: boolean): Promise { - if (!hydrated || savingKey || confirmLoading) return + if (!hydrated || savingKey || confirmLoading) {return} if (checked) { setPendingKey(key) return @@ -40,21 +41,21 @@ export function PrivacySettings(_props: PrivacySettingsProps) { setSavingKey(key) try { const saved = await setPrivacySetting(key, false) - if (saved) toast.success(`已关闭“${privacyDisclosureFor(key).title}”`) - else toast.error('隐私设置保存失败,请重试') + if (saved) {toast.success(`已关闭“${privacyDisclosureFor(key).title}”`)} + else {toast.error('隐私设置保存失败,请重试')} } finally { setSavingKey(null) } } function cancelEnable(): void { - if (confirmLoading) return + if (confirmLoading) {return} setPendingKey(null) } async function confirmEnable(): Promise { const key = pendingKey - if (!key || confirmLoading) return + if (!key || confirmLoading) {return} setConfirmLoading(true) try { const saved = await setPrivacySetting(key, true) diff --git a/src/renderer/src/components/settings/UnsavedChangesBar.tsx b/src/renderer/src/components/settings/UnsavedChangesBar.tsx index 1d7d3853..c05c9ef7 100644 --- a/src/renderer/src/components/settings/UnsavedChangesBar.tsx +++ b/src/renderer/src/components/settings/UnsavedChangesBar.tsx @@ -29,7 +29,7 @@ export function UnsavedChangesBar({ open, saving, onSave, onDiscard }: UnsavedCh return () => clearTimeout(timer) }, [open]) - if (!rendered) return null + if (!rendered) {return null} return (
{ - if (!open) setRendered(false) + if (!open) {setRendered(false)} }} >