commit 6396eabb87b3786855a88674e6b8c358bde1da35 Author: nanxun Date: Fri Jul 24 23:11:20 2026 +0800 Initial project import diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f76b2b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,55 @@ +# Local secrets and environment files +.env +.env.* +**/.env +**/.env.* +*.local + +# Build outputs and dependency caches +node_modules/ +dist/ +dist-ssr/ +build/ +.dart_tool/ +.gradle/ +bin/ +obj/ +coverage/ +.downloads/ + +# Flutter/Dart generated files +**/doc/api/ +**/ios/Flutter/.last_build_id +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +app.*.symbols +app.*.map.json +frontend/android/app/debug/ +frontend/android/app/profile/ +frontend/android/app/release/ + +# Release, filing, and backup artifacts +release/ +backups/ +filing/ +*.apk +*.sql +*.pem +*.der +*.p12 +*.jks +*.keystore +!frontend/android/app/src/internal/res/raw/ +!frontend/android/app/src/internal/res/raw/sakura_frp_test_ca.pem + +# Local tool metadata +.agents/ +.codex/ +.git-local/ +.idea/ +.vscode/ +.DS_Store +*.log +*.tmp +*.swp diff --git a/admin-web/.gitignore b/admin-web/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/admin-web/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/admin-web/index.html b/admin-web/index.html new file mode 100644 index 0000000..0c4e307 --- /dev/null +++ b/admin-web/index.html @@ -0,0 +1,13 @@ + + + + + + + admin-web + + +
+ + + diff --git a/admin-web/package-lock.json b/admin-web/package-lock.json new file mode 100644 index 0000000..76e87b6 --- /dev/null +++ b/admin-web/package-lock.json @@ -0,0 +1,1854 @@ +{ + "name": "admin-web", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "admin-web", + "version": "0.0.0", + "dependencies": { + "@ant-design/icons-vue": "^7.0.1", + "ant-design-vue": "^4.2.6", + "axios": "^1.18.1", + "dayjs": "^1.11.21", + "vue": "^3.5.39", + "vue-router": "^4.6.4" + }, + "devDependencies": { + "@types/node": "^24.13.2", + "@vitejs/plugin-vue": "^6.0.7", + "@vue/tsconfig": "^0.9.1", + "typescript": "~6.0.2", + "vite": "^8.1.1", + "vue-tsc": "^3.3.5" + } + }, + "node_modules/@ant-design/colors": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/@ant-design/colors/-/colors-6.0.0.tgz", + "integrity": "sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^3.4.0" + } + }, + "node_modules/@ant-design/icons-svg": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.5.0.tgz", + "integrity": "sha512-1BTUFyKPTBZ53MuTP8s0k5SFEXL7o3VHEOwLgzaoWKwnBeqIcqUtVshc4SKzhI6uACfqhJqBwBUE9FsWR3uULA==", + "license": "MIT" + }, + "node_modules/@ant-design/icons-vue": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/@ant-design/icons-vue/-/icons-vue-7.0.1.tgz", + "integrity": "sha512-eCqY2unfZK6Fe02AwFlDHLfoyEFreP6rBwAZMIJ1LugmfMiVgwWDYlp1YsRugaPtICYOabV1iWxXdP12u9U43Q==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^6.0.0", + "@ant-design/icons-svg": "^4.2.1" + }, + "peerDependencies": { + "vue": ">=3.0.3" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmmirror.com/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmmirror.com/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emotion/hash": { + "version": "0.9.2", + "resolved": "https://registry.npmmirror.com/@emotion/hash/-/hash-0.9.2.tgz", + "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", + "license": "MIT" + }, + "node_modules/@emotion/unitless": { + "version": "0.8.1", + "resolved": "https://registry.npmmirror.com/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", + "license": "MIT" + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.139.0", + "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.139.0.tgz", + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", + "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.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", + "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.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", + "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.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", + "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.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", + "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.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@simonwep/pickr": { + "version": "1.8.2", + "resolved": "https://registry.npmmirror.com/@simonwep/pickr/-/pickr-1.8.2.tgz", + "integrity": "sha512-/l5w8BIkrpP6n1xsetx9MWPWlU6OblN5YgZZphxan0Tq4BByTCETL6lyIeY8lagalS2Nbt4F2W034KHLIiunKA==", + "license": "MIT", + "dependencies": { + "core-js": "^3.15.1", + "nanopop": "^2.1.0" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmmirror.com/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/node": { + "version": "24.13.3", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-24.13.3.tgz", + "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.8", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-6.0.8.tgz", + "integrity": "sha512-0ZjgOg7oO6farnNGup7yvoM/YXZV84OZxHAwtflItNa/6zzQyVb5LNxyea3FEKEX2XlagIKzrlH7wwxkKgtiew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.28", + "resolved": "https://registry.npmmirror.com/@volar/language-core/-/language-core-2.4.28.tgz", + "integrity": "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.28" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.28", + "resolved": "https://registry.npmmirror.com/@volar/source-map/-/source-map-2.4.28.tgz", + "integrity": "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.28", + "resolved": "https://registry.npmmirror.com/@volar/typescript/-/typescript-2.4.28.tgz", + "integrity": "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.40.tgz", + "integrity": "sha512-39E8IgOhTbVDnoJFMKc2DvYnypcZwUqgUhQkccva/0m6FUwtIKSGV7n1hpVmYcFaoRAwf9pBcwnKlCEsN63ZEQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.7", + "@vue/shared": "3.5.40", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.40.tgz", + "integrity": "sha512-pwkx4vqlqOspFstrcmzwkKLePVMD3PT65imRzLhanU2V1Fj4K13g6OXjanOyzw3aTAuRk84BOmY8f3rEHqPaVA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.40", + "@vue/shared": "3.5.40" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.40.tgz", + "integrity": "sha512-gIf497P4kpuALcvs5n3AEg1Vdn0pSY4XbjASIfHNYF1/MP3T2Mf2STERTubysBxCRxzJGJYtF/O7vwJrxFB3Vw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.7", + "@vue/compiler-core": "3.5.40", + "@vue/compiler-dom": "3.5.40", + "@vue/compiler-ssr": "3.5.40", + "@vue/shared": "3.5.40", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.19", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.40.tgz", + "integrity": "sha512-rrE5xiXG663+vHCHa3J9p2z5OcBRjXmoqenprJxAFQxg5pSshzeBiCE6pu46axapRJ2Adk0YDA2BRZVjiHXnhg==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.40", + "@vue/shared": "3.5.40" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/language-core": { + "version": "3.3.7", + "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-3.3.7.tgz", + "integrity": "sha512-LzmkKinXAMMoh8Jfi/jMUSDUjuPdv8mynH5WJGKfXyZtDw3hQ6GBaoI6Bcnl/Xqlu32q/0Z6i/trp4VXykzyLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "@vue/compiler-dom": "^3.5.0", + "@vue/shared": "^3.5.0", + "alien-signals": "^3.2.1", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1", + "picomatch": "^4.0.4" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.40.tgz", + "integrity": "sha512-B7ot9UlUZOi1zbq61/LvE88ZLTV8IlajTdiZTAEiDQgrnIMIZoPr9kGw0Zw46ObW62O9+H/Be3kMbfb7kYPQZA==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.40" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.40.tgz", + "integrity": "sha512-KAZLweuZ6uUJPK1PMSQPgBU5gCjgrrfjUhSglmU9NhH+Zjepa8cnwSydPWDWHDwOgY4g3VcZ+PljbiHlURNCbw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.40", + "@vue/shared": "3.5.40" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.40.tgz", + "integrity": "sha512-ZfrX8ssZQds900L9pr8AuK05ddnMsR4MPMZr8cPN9GoqoPWcXLhjvvbIA2SMv+7a97sJ1vv9pj/zxK0Cq/eEFQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.40", + "@vue/runtime-core": "3.5.40", + "@vue/shared": "3.5.40", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.40.tgz", + "integrity": "sha512-XNJym9WpevhTVt1HuwOrCRJ5Q+9z4BjTMrDtjTrvx74SmUll8spNTw6whWJa9mEkO4PKn5TihI/bm/8ds2QVJw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.40", + "@vue/runtime-dom": "3.5.40", + "@vue/shared": "3.5.40" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.40.tgz", + "integrity": "sha512-WxnBtruIqOoV3rA4jeKDWzrYI5h7Cp4+pjwDi8kWGHz+IslhiN+wguLVVhtv2l8VoU02rzDCVfDjgCl1lNpZVg==", + "license": "MIT" + }, + "node_modules/@vue/tsconfig": { + "version": "0.9.1", + "resolved": "https://registry.npmmirror.com/@vue/tsconfig/-/tsconfig-0.9.1.tgz", + "integrity": "sha512-buvjm+9NzLCJL29KY1j1991YYJ5e6275OiK+G4jtmfIb+z4POywbdm0wXusT9adVWqe0xqg70TbI7+mRx4uU9w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typescript": ">= 5.8", + "vue": "^3.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "vue": { + "optional": true + } + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/alien-signals": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/alien-signals/-/alien-signals-3.2.1.tgz", + "integrity": "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==", + "dev": true, + "license": "MIT" + }, + "node_modules/ant-design-vue": { + "version": "4.2.6", + "resolved": "https://registry.npmmirror.com/ant-design-vue/-/ant-design-vue-4.2.6.tgz", + "integrity": "sha512-t7eX13Yj3i9+i5g9lqFyYneoIb3OzTvQjq9Tts1i+eiOd3Eva/6GagxBSXM1fOCjqemIu0FYVE1ByZ/38epR3Q==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^6.0.0", + "@ant-design/icons-vue": "^7.0.0", + "@babel/runtime": "^7.10.5", + "@ctrl/tinycolor": "^3.5.0", + "@emotion/hash": "^0.9.0", + "@emotion/unitless": "^0.8.0", + "@simonwep/pickr": "~1.8.0", + "array-tree-filter": "^2.1.0", + "async-validator": "^4.0.0", + "csstype": "^3.1.1", + "dayjs": "^1.10.5", + "dom-align": "^1.12.1", + "dom-scroll-into-view": "^2.0.0", + "lodash": "^4.17.21", + "lodash-es": "^4.17.15", + "resize-observer-polyfill": "^1.5.1", + "scroll-into-view-if-needed": "^2.2.25", + "shallow-equal": "^1.0.0", + "stylis": "^4.1.3", + "throttle-debounce": "^5.0.0", + "vue-types": "^3.0.0", + "warning": "^4.0.0" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ant-design-vue" + }, + "peerDependencies": { + "vue": ">=3.2.0" + } + }, + "node_modules/array-tree-filter": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz", + "integrity": "sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==", + "license": "MIT" + }, + "node_modules/async-validator": { + "version": "4.2.5", + "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz", + "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.18.1", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.18.1.tgz", + "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.5", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/compute-scroll-into-view": { + "version": "1.0.20", + "resolved": "https://registry.npmmirror.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.20.tgz", + "integrity": "sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==", + "license": "MIT" + }, + "node_modules/core-js": { + "version": "3.49.0", + "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.49.0.tgz", + "integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/dayjs": { + "version": "1.11.21", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.21.tgz", + "integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/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, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dom-align": { + "version": "1.12.4", + "resolved": "https://registry.npmmirror.com/dom-align/-/dom-align-1.12.4.tgz", + "integrity": "sha512-R8LUSEay/68zE5c8/3BDxiTEvgb4xZTF0RKmAHfiEVN3klfIpXfi2/QCoiWPccVQ0J/ZGdz9OjzL4uJEP/MRAw==", + "license": "MIT" + }, + "node_modules/dom-scroll-into-view": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/dom-scroll-into-view/-/dom-scroll-into-view-2.0.1.tgz", + "integrity": "sha512-bvVTQe1lfaUr1oFzZX80ce9KLDlZ3iU+XGNE/bz9HnGdklTieqsbmsLHe+rT2XWqopvL0PckkYqN7ksmm5pe3w==", + "license": "MIT" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/is-plain-object": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/is-plain-object/-/is-plain-object-3.0.1.tgz", + "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmmirror.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.18.1", + "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.18.1.tgz", + "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.16", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nanopop": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/nanopop/-/nanopop-2.4.2.tgz", + "integrity": "sha512-NzOgmMQ+elxxHeIha+OG/Pv3Oc3p4RU2aBhwWwAqDpXrdTbtRylbRLQztLy8dMMwfl6pclznBdfUhccEn9ZIzw==", + "license": "MIT" + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.19", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.19.tgz", + "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", + "license": "MIT" + }, + "node_modules/rolldown": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/rolldown/-/rolldown-1.1.5.tgz", + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.139.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.1.5", + "@rolldown/binding-darwin-arm64": "1.1.5", + "@rolldown/binding-darwin-x64": "1.1.5", + "@rolldown/binding-freebsd-x64": "1.1.5", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", + "@rolldown/binding-linux-arm64-gnu": "1.1.5", + "@rolldown/binding-linux-arm64-musl": "1.1.5", + "@rolldown/binding-linux-ppc64-gnu": "1.1.5", + "@rolldown/binding-linux-s390x-gnu": "1.1.5", + "@rolldown/binding-linux-x64-gnu": "1.1.5", + "@rolldown/binding-linux-x64-musl": "1.1.5", + "@rolldown/binding-openharmony-arm64": "1.1.5", + "@rolldown/binding-wasm32-wasi": "1.1.5", + "@rolldown/binding-win32-arm64-msvc": "1.1.5", + "@rolldown/binding-win32-x64-msvc": "1.1.5" + } + }, + "node_modules/scroll-into-view-if-needed": { + "version": "2.2.31", + "resolved": "https://registry.npmmirror.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.31.tgz", + "integrity": "sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==", + "license": "MIT", + "dependencies": { + "compute-scroll-into-view": "^1.0.20" + } + }, + "node_modules/shallow-equal": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/shallow-equal/-/shallow-equal-1.2.1.tgz", + "integrity": "sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stylis": { + "version": "4.4.0", + "resolved": "https://registry.npmmirror.com/stylis/-/stylis-4.4.0.tgz", + "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==", + "license": "MIT" + }, + "node_modules/throttle-debounce": { + "version": "5.0.2", + "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-5.0.2.tgz", + "integrity": "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==", + "license": "MIT", + "engines": { + "node": ">=12.22" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.1.5", + "resolved": "https://registry.npmmirror.com/vite/-/vite-8.1.5.tgz", + "integrity": "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.17", + "rolldown": "~1.1.5", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.3.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "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", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vscode-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/vue": { + "version": "3.5.40", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.40.tgz", + "integrity": "sha512-+8PJ4SJXdn/cHGImF4CKdxlWHIN5Dkt7DoufRREM6h6uVCx2m7QxgcEQmmzyOK8A9mcafg7sFbJFYsdFVubTig==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.40", + "@vue/compiler-sfc": "3.5.40", + "@vue/runtime-dom": "3.5.40", + "@vue/server-renderer": "3.5.40", + "@vue/shared": "3.5.40" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.6.4", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.6.4.tgz", + "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/vue-tsc": { + "version": "3.3.7", + "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-3.3.7.tgz", + "integrity": "sha512-+C+rgD49wAQ5bUTl2sp5a8Bzg4YoldMNXM+g7CFe604MYcQ8PrZPMQhIjJSzKXtPBCa+C5ayMipqjbA7splekQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/typescript": "2.4.28", + "@vue/language-core": "3.3.7" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + } + }, + "node_modules/vue-types": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/vue-types/-/vue-types-3.0.2.tgz", + "integrity": "sha512-IwUC0Aq2zwaXqy74h4WCvFCUtoV0iSWr0snWnE9TnU18S66GAQyqQbRf2qfJtUuiFsBf6qp0MEwdonlwznlcrw==", + "license": "MIT", + "dependencies": { + "is-plain-object": "3.0.1" + }, + "engines": { + "node": ">=10.15.0" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, + "node_modules/warning": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + } + } +} diff --git a/admin-web/package.json b/admin-web/package.json new file mode 100644 index 0000000..f827bad --- /dev/null +++ b/admin-web/package.json @@ -0,0 +1,27 @@ +{ + "name": "admin-web", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vue-tsc -b && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@ant-design/icons-vue": "^7.0.1", + "ant-design-vue": "^4.2.6", + "axios": "^1.18.1", + "dayjs": "^1.11.21", + "vue": "^3.5.39", + "vue-router": "^4.6.4" + }, + "devDependencies": { + "@types/node": "^24.13.2", + "@vitejs/plugin-vue": "^6.0.7", + "@vue/tsconfig": "^0.9.1", + "typescript": "~6.0.2", + "vite": "^8.1.1", + "vue-tsc": "^3.3.5" + } +} diff --git a/admin-web/public/favicon.svg b/admin-web/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/admin-web/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin-web/public/icons.svg b/admin-web/public/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/admin-web/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin-web/src/App.vue b/admin-web/src/App.vue new file mode 100644 index 0000000..0c0d402 --- /dev/null +++ b/admin-web/src/App.vue @@ -0,0 +1,48 @@ + + + diff --git a/admin-web/src/api/index.ts b/admin-web/src/api/index.ts new file mode 100644 index 0000000..9ab0076 --- /dev/null +++ b/admin-web/src/api/index.ts @@ -0,0 +1,52 @@ +import axios from 'axios' +import { message } from 'ant-design-vue' + +const ADMIN_KEY = localStorage.getItem('miaoji_admin_key') || '' + +const http = axios.create({ + baseURL: import.meta.env.VITE_API_BASE || '', + headers: { 'X-Admin-Key': ADMIN_KEY }, +}) + +http.interceptors.response.use( + r => r, + err => { + if (err.response?.status === 401) { + message.error('管理密钥无效,请在 localStorage 设置 miaoji_admin_key') + } + return Promise.reject(err) + } +) + +export const api = { + dashboard: () => http.get('/api/admin/dashboard').then(r => r.data), + configs: () => http.get('/api/admin/configs').then(r => r.data), + updateConfig: (id: number, value: string) => http.put(`/api/admin/configs/${id}`, { value }).then(r => r.data), + createConfig: (key: string, value: string) => http.post('/api/admin/configs', { key, value }).then(r => r.data), + personas: () => http.get('/api/admin/personas').then(r => r.data), + createPersona: (d: any) => http.post('/api/admin/personas', d).then(r => r.data), + updatePersona: (id: number, d: any) => http.put(`/api/admin/personas/${id}`, d).then(r => r.data), + deletePersona: (id: number) => http.delete(`/api/admin/personas/${id}`), + avatars: () => http.get('/api/admin/avatars').then(r => r.data), + createAvatar: (d: any) => http.post('/api/admin/avatars', d).then(r => r.data), + updateAvatar: (id: number, d: any) => http.put(`/api/admin/avatars/${id}`, d).then(r => r.data), + deleteAvatar: (id: number) => http.delete(`/api/admin/avatars/${id}`), + stickers: () => http.get('/api/admin/stickers').then(r => r.data), + createSticker: (d: any) => http.post('/api/admin/stickers', d).then(r => r.data), + updateSticker: (id: number, d: any) => http.put(`/api/admin/stickers/${id}`, d).then(r => r.data), + deleteSticker: (id: number) => http.delete(`/api/admin/stickers/${id}`), + users: (params: any) => http.get('/api/admin/users', { params }).then(r => r.data), + toggleBan: (id: number) => http.put(`/api/admin/users/${id}/ban`).then(r => r.data), + updateUserPermissions: (id: number, ai: boolean) => http.put(`/api/admin/users/${id}/permissions`, { ai }).then(r => r.data), + updateAiChatQuota: (id: number, limit: number, period: string, resetUsage: boolean) => http.put(`/api/admin/users/${id}/ai-quota`, { limit, period, resetUsage }).then(r => r.data), + cancelAccountClosure: (id: number) => http.put(`/api/admin/users/${id}/cancel-closure`).then(r => r.data), + userStats: (id: number) => http.get(`/api/admin/users/${id}/stats`).then(r => r.data), + sysCategories: () => http.get('/api/admin/categories').then(r => r.data), + createSysCategory: (d: { name: string; iconKey: string; type: string }) => http.post('/api/admin/categories', d).then(r => r.data), + updateSysCategory: (id: number, d: { name: string; iconKey: string; type: string }) => http.put(`/api/admin/categories/${id}`, d).then(r => r.data), + deleteSysCategory: (id: number) => http.delete(`/api/admin/categories/${id}`), + testLlm: () => http.post('/api/admin/llm/test').then(r => r.data), +} + +export default http + diff --git a/admin-web/src/main.ts b/admin-web/src/main.ts new file mode 100644 index 0000000..526c5d8 --- /dev/null +++ b/admin-web/src/main.ts @@ -0,0 +1,10 @@ +import { createApp } from 'vue' +import Antd from 'ant-design-vue' +import 'ant-design-vue/dist/reset.css' +import App from './App.vue' +import router from './router' + +const app = createApp(App) +app.use(router) +app.use(Antd) +app.mount('#app') \ No newline at end of file diff --git a/admin-web/src/router/index.ts b/admin-web/src/router/index.ts new file mode 100644 index 0000000..d9d2407 --- /dev/null +++ b/admin-web/src/router/index.ts @@ -0,0 +1,18 @@ +import { createRouter, createWebHashHistory } from 'vue-router' + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + { path: '/', redirect: '/dashboard' }, + { path: '/dashboard', name: 'Dashboard', component: () => import('../views/Dashboard.vue') }, + { path: '/settings', name: 'Settings', component: () => import('../views/Settings.vue') }, + { path: '/configs', name: 'Configs', component: () => import('../views/Configs.vue') }, + { path: '/categories', name: 'SysCategories', component: () => import('../views/SysCategories.vue') }, + { path: '/personas', name: 'Personas', component: () => import('../views/Personas.vue') }, + { path: '/avatars', name: 'Avatars', component: () => import('../views/Avatars.vue') }, + { path: '/stickers', name: 'Stickers', component: () => import('../views/Stickers.vue') }, + { path: '/users', name: 'Users', component: () => import('../views/Users.vue') }, + ], +}) + +export default router \ No newline at end of file diff --git a/admin-web/src/utils/time.ts b/admin-web/src/utils/time.ts new file mode 100644 index 0000000..756abe4 --- /dev/null +++ b/admin-web/src/utils/time.ts @@ -0,0 +1,14 @@ +const shanghaiDateFormatter = new Intl.DateTimeFormat('zh-CN', { + timeZone: 'Asia/Shanghai', + year: 'numeric', + month: '2-digit', + day: '2-digit', +}) + +export function formatShanghaiDate(value?: string | null): string { + if (!value) return '' + const normalized = /(?:Z|[+-]\d{2}:?\d{2})$/i.test(value) ? value : value + 'Z' + const date = new Date(normalized) + if (Number.isNaN(date.getTime())) return '' + return shanghaiDateFormatter.format(date).replaceAll('/', '-') +} \ No newline at end of file diff --git a/admin-web/src/views/Avatars.vue b/admin-web/src/views/Avatars.vue new file mode 100644 index 0000000..404095e --- /dev/null +++ b/admin-web/src/views/Avatars.vue @@ -0,0 +1,91 @@ + + + \ No newline at end of file diff --git a/admin-web/src/views/Configs.vue b/admin-web/src/views/Configs.vue new file mode 100644 index 0000000..3a8b411 --- /dev/null +++ b/admin-web/src/views/Configs.vue @@ -0,0 +1,117 @@ + + + \ No newline at end of file diff --git a/admin-web/src/views/Dashboard.vue b/admin-web/src/views/Dashboard.vue new file mode 100644 index 0000000..05dc4b2 --- /dev/null +++ b/admin-web/src/views/Dashboard.vue @@ -0,0 +1,86 @@ + + + \ No newline at end of file diff --git a/admin-web/src/views/Personas.vue b/admin-web/src/views/Personas.vue new file mode 100644 index 0000000..eaece69 --- /dev/null +++ b/admin-web/src/views/Personas.vue @@ -0,0 +1,97 @@ + + + \ No newline at end of file diff --git a/admin-web/src/views/Settings.vue b/admin-web/src/views/Settings.vue new file mode 100644 index 0000000..ae711c8 --- /dev/null +++ b/admin-web/src/views/Settings.vue @@ -0,0 +1,234 @@ + + + diff --git a/admin-web/src/views/Stickers.vue b/admin-web/src/views/Stickers.vue new file mode 100644 index 0000000..70786b8 --- /dev/null +++ b/admin-web/src/views/Stickers.vue @@ -0,0 +1,108 @@ + + + \ No newline at end of file diff --git a/admin-web/src/views/SysCategories.vue b/admin-web/src/views/SysCategories.vue new file mode 100644 index 0000000..681c690 --- /dev/null +++ b/admin-web/src/views/SysCategories.vue @@ -0,0 +1,122 @@ + + + \ No newline at end of file diff --git a/admin-web/src/views/Users.vue b/admin-web/src/views/Users.vue new file mode 100644 index 0000000..7e59ed3 --- /dev/null +++ b/admin-web/src/views/Users.vue @@ -0,0 +1,226 @@ + + + diff --git a/admin-web/tsconfig.app.json b/admin-web/tsconfig.app.json new file mode 100644 index 0000000..d72aa75 --- /dev/null +++ b/admin-web/tsconfig.app.json @@ -0,0 +1,15 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "types": ["vite/client"], + "allowArbitraryExtensions": true, + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/admin-web/tsconfig.json b/admin-web/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/admin-web/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/admin-web/tsconfig.node.json b/admin-web/tsconfig.node.json new file mode 100644 index 0000000..8455dcb --- /dev/null +++ b/admin-web/tsconfig.node.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023"], + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "module": "nodenext", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["vite.config.ts"] +} diff --git a/admin-web/vite.config.ts b/admin-web/vite.config.ts new file mode 100644 index 0000000..ad58e81 --- /dev/null +++ b/admin-web/vite.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +export default defineConfig({ + plugins: [vue()], + server: { + port: 5173, + proxy: { '/api': { target: 'http://localhost:5000', changeOrigin: true } }, + }, + build: { outDir: 'dist', assetsDir: 'assets' }, +}) \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api.Tests/ApiIntegrationTests.cs b/backend/MiaoJiZhang.Api.Tests/ApiIntegrationTests.cs new file mode 100644 index 0000000..53dee2f --- /dev/null +++ b/backend/MiaoJiZhang.Api.Tests/ApiIntegrationTests.cs @@ -0,0 +1,532 @@ +using System.IO.Compression; +using System.Net; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Reflection; +using System.Text.Json; +using MiaoJiZhang.Api.Services; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.TestHost; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Testcontainers.MySql; + +namespace MiaoJiZhang.Api.Tests; + +[CollectionDefinition(Name)] +public sealed class ApiCollection : ICollectionFixture +{ + public const string Name = "api"; +} + +public sealed class ApiFixture : IAsyncLifetime +{ + private readonly MySqlContainer _database = new MySqlBuilder("mysql:8.4") + .WithDatabase("miaoji_test") + .WithUsername("miaoji_test") + .WithPassword("miaoji_test_password") + .WithCleanUp(true) + .Build(); + + public WebApplicationFactory Factory { get; private set; } = null!; + + public async Task InitializeAsync() + { + await _database.StartAsync(); + Environment.SetEnvironmentVariable( + "ConnectionStrings__Default", + _database.GetConnectionString()); + Environment.SetEnvironmentVariable( + "Jwt__Secret", + "test-only-jwt-secret-at-least-thirty-two-characters"); + Environment.SetEnvironmentVariable( + "Admin__Key", + "test-only-admin-key-at-least-24-characters"); + + Factory = new WebApplicationFactory().WithWebHostBuilder( + builder => + { + builder.UseEnvironment("Development"); + builder.ConfigureTestServices(services => + { + services.RemoveAll(); + services.AddSingleton(); + }); + }); + using var client = Factory.CreateClient(); + var ping = await client.GetAsync("/api/ping"); + ping.EnsureSuccessStatusCode(); + } + + public async Task DisposeAsync() + { + Factory?.Dispose(); + await _database.DisposeAsync(); + Environment.SetEnvironmentVariable("ConnectionStrings__Default", null); + Environment.SetEnvironmentVariable("Jwt__Secret", null); + Environment.SetEnvironmentVariable("Admin__Key", null); + } + + public async Task RegisterAsync(string username) + { + var client = Factory.CreateClient(); + var response = await client.PostAsJsonAsync( + "/api/auth/register", + new { username, password = "test-password-123", agreedToTerms = true }); + response.EnsureSuccessStatusCode(); + var payload = await response.Content.ReadFromJsonAsync(); + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( + "Bearer", + payload.GetProperty("token").GetString()); + return client; + } +} + +[Collection(ApiCollection.Name)] +public sealed class ApiIntegrationTests(ApiFixture fixture) +{ + [Fact] + public async Task DataIsolation_TimeZone_Recycle_Budget_AndExport_WorkTogether() + { + using var owner = await fixture.RegisterAsync("owner_account"); + using var stranger = await fixture.RegisterAsync("stranger_account"); + + var ledgers = await owner.GetFromJsonAsync("/api/ledgers"); + var ledgerId = ledgers[0].GetProperty("id").GetInt64(); + var incomeCategories = await owner.GetFromJsonAsync( + "/api/categories?type=income"); + var expenseCategories = await owner.GetFromJsonAsync( + "/api/categories?type=expense"); + var incomeCategoryId = incomeCategories[0].GetProperty("id").GetInt64(); + var expenseCategoryId = expenseCategories[0].GetProperty("id").GetInt64(); + + var forbiddenLedger = await stranger.PutAsJsonAsync( + $"/api/ledgers/{ledgerId}/default", + new { }); + Assert.Equal(HttpStatusCode.NotFound, forbiddenLedger.StatusCode); + + var mismatch = await owner.PostAsJsonAsync( + "/api/transactions", + new + { + ledgerId, + categoryId = expenseCategoryId, + type = "income", + amount = 100, + occurredAt = "2026-06-30T16:30:00Z", + }); + Assert.Equal(HttpStatusCode.BadRequest, mismatch.StatusCode); + + var createdResponse = await owner.PostAsJsonAsync( + "/api/transactions", + new + { + ledgerId, + categoryId = incomeCategoryId, + type = "income", + amount = 100, + note = "跨月收入", + occurredAt = "2026-06-30T16:30:00Z", + }); + createdResponse.EnsureSuccessStatusCode(); + var created = await createdResponse.Content.ReadFromJsonAsync(); + var transactionId = created.GetProperty("id").GetInt64(); + + var july = await owner.GetFromJsonAsync( + $"/api/transactions/month?year=2026&month=7&ledgerId={ledgerId}"); + Assert.Equal(1, july.GetProperty("count").GetInt32()); + Assert.Equal(100m, july.GetProperty("income").GetDecimal()); + Assert.Equal(0m, july.GetProperty("expense").GetDecimal()); + var persistedOccurredAt = july.GetProperty("days")[0] + .GetProperty("items")[0] + .GetProperty("occurredAt") + .GetString(); + Assert.EndsWith("Z", persistedOccurredAt, StringComparison.Ordinal); + + var recurringBudget = await owner.PutAsJsonAsync( + $"/api/budgets?year=2026&month=7&ledgerId={ledgerId}", + new + { + categoryId = expenseCategoryId, + amount = 800, + recurring = true, + }); + recurringBudget.EnsureSuccessStatusCode(); + var augustBudget = await owner.GetFromJsonAsync( + $"/api/budgets?year=2026&month=8&ledgerId={ledgerId}"); + Assert.True( + augustBudget.GetProperty("categories")[0] + .GetProperty("isRecurring") + .GetBoolean()); + + var delete = await owner.DeleteAsync( + $"/api/transactions/{transactionId}"); + Assert.Equal(HttpStatusCode.NoContent, delete.StatusCode); + var recycle = await owner.GetFromJsonAsync( + $"/api/transactions/recycle-bin?ledgerId={ledgerId}"); + Assert.Single(recycle.EnumerateArray()); + + var restore = await owner.PostAsync( + $"/api/transactions/{transactionId}/restore", + null); + restore.EnsureSuccessStatusCode(); + recycle = await owner.GetFromJsonAsync( + $"/api/transactions/recycle-bin?ledgerId={ledgerId}"); + Assert.Empty(recycle.EnumerateArray()); + + var export = await owner.GetByteArrayAsync("/api/users/me/export"); + using var archive = new ZipArchive(new MemoryStream(export)); + Assert.Contains(archive.Entries, entry => entry.Name == "transactions.csv"); + Assert.Contains(archive.Entries, entry => entry.Name == "budgets.csv"); + var backupEntry = Assert.Single( + archive.Entries, entry => entry.Name == "backup.json"); + using var reader = new StreamReader(backupEntry.Open()); + var backup = await reader.ReadToEndAsync(); + Assert.DoesNotContain( + "passwordHash", + backup, + StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain( + "apiKey", + backup, + StringComparison.OrdinalIgnoreCase); + } + + [Fact] + public async Task AccountClosure_RevokesOldToken_AndLoginCancelsDuringGracePeriod() + { + using var client = await fixture.RegisterAsync("closure_account"); + var closure = await client.PostAsJsonAsync( + "/api/users/me/closure", + new + { + password = "test-password-123", + confirmationText = "注销账号", + }); + Assert.Equal(HttpStatusCode.Accepted, closure.StatusCode); + + var oldSession = await client.GetAsync("/api/users/me"); + Assert.Equal(HttpStatusCode.Unauthorized, oldSession.StatusCode); + + using var restored = fixture.Factory.CreateClient(); + var login = await restored.PostAsJsonAsync( + "/api/auth/login", + new + { + username = "closure_account", + password = "test-password-123", + }); + login.EnsureSuccessStatusCode(); + var payload = await login.Content.ReadFromJsonAsync(); + Assert.True(payload.GetProperty("accountClosureCancelled").GetBoolean()); + restored.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( + "Bearer", + payload.GetProperty("token").GetString()); + Assert.Equal( + HttpStatusCode.OK, + (await restored.GetAsync("/api/users/me")).StatusCode); + } + + [Fact] + public async Task CategoryReorder_RejectsUnknownIcons_AndReportsUseLedgerPeriod() + { + using var client = await fixture.RegisterAsync("report_account"); + var ledgers = await client.GetFromJsonAsync("/api/ledgers"); + var ledgerId = ledgers[0].GetProperty("id").GetInt64(); + + var invalid = await client.PostAsJsonAsync( + "/api/categories", + new { name = "未知图标", iconKey = "not-real", type = "expense" }); + Assert.Equal(HttpStatusCode.BadRequest, invalid.StatusCode); + + async Task CreateCategory(string name, string iconKey) + { + var response = await client.PostAsJsonAsync( + "/api/categories", + new { name, iconKey, type = "expense" }); + response.EnsureSuccessStatusCode(); + return (await response.Content.ReadFromJsonAsync()) + .GetProperty("id").GetInt64(); + } + + var firstId = await CreateCategory("养车", "car"); + var secondId = await CreateCategory("宠物", "pet"); + var reorder = await client.PutAsJsonAsync( + "/api/categories/reorder", + new { type = "expense", categoryIds = new[] { secondId, firstId } }); + Assert.Equal(HttpStatusCode.NoContent, reorder.StatusCode); + var categories = await client.GetFromJsonAsync( + "/api/categories?type=expense"); + var customIds = categories.EnumerateArray() + .Where(item => item.GetProperty("isCustom").GetBoolean()) + .Select(item => item.GetProperty("id").GetInt64()) + .ToArray(); + Assert.Equal(new[] { secondId, firstId }, customIds); + + var weekly = await client.GetAsync( + $"/api/reports/weekly?date=2026-07-19&ledgerId={ledgerId}"); + weekly.EnsureSuccessStatusCode(); + var yearly = await client.GetAsync( + $"/api/reports/yearly?year=2026&ledgerId={ledgerId}"); + yearly.EnsureSuccessStatusCode(); + } + [Fact] + public async Task RegistrationDefaultAndUserAiPermission_AreEnforcedImmediately() + { + async Task SetDefaultAsync(bool enabled) + { + await using var scope = fixture.Factory.Services.CreateAsyncScope(); + var db = scope.ServiceProvider.GetRequiredService< + MiaoJiZhang.Infrastructure.Persistence.AppDbContext>(); + var config = await db.AppConfigs.SingleAsync(item => + item.Key == "permission.default.ai_enabled"); + config.Value = enabled ? "true" : "false"; + config.Version++; + config.UpdatedAt = DateTime.UtcNow; + await db.SaveChangesAsync(); + } + + await SetDefaultAsync(false); + try + { + using var client = await fixture.RegisterAsync("permission_default_off"); + var profile = await client.GetFromJsonAsync("/api/users/me"); + Assert.False( + profile.GetProperty("permissions").GetProperty("ai").GetBoolean()); + + var denied = await client.PostAsJsonAsync( + "/api/chat/messages", + new { content = "本月花了多少" }); + Assert.Equal(HttpStatusCode.Forbidden, denied.StatusCode); + var error = await denied.Content.ReadFromJsonAsync(); + Assert.Equal( + "AI_PERMISSION_DENIED", + error.GetProperty("code").GetString()); + } + finally + { + await SetDefaultAsync(true); + } + } + + [Fact] + public async Task AiChatQuota_IsBoundToUserAndUsesConfiguredPeriod() + { + using var client = await fixture.RegisterAsync("ai_quota_account"); + var profile = await client.GetFromJsonAsync("/api/users/me"); + var userId = profile.GetProperty("userId").GetInt64(); + + using var admin = fixture.Factory.CreateClient(); + admin.DefaultRequestHeaders.Add( + "X-Admin-Key", + "test-only-admin-key-at-least-24-characters"); + var update = await admin.PutAsJsonAsync( + $"/api/admin/users/{userId}/ai-quota", + new { limit = 1, period = "week", resetUsage = true }); + update.EnsureSuccessStatusCode(); + + var first = await client.PostAsJsonAsync( + "/api/chat/messages", + new { content = "本周花了多少" }); + first.EnsureSuccessStatusCode(); + + var denied = await client.PostAsJsonAsync( + "/api/chat/messages", + new { content = "再查一次本周支出" }); + Assert.Equal(HttpStatusCode.TooManyRequests, denied.StatusCode); + var error = await denied.Content.ReadFromJsonAsync(); + Assert.Equal( + "AI_CHAT_QUOTA_EXCEEDED", + error.GetProperty("code").GetString()); + Assert.Equal( + "week", + error.GetProperty("quota").GetProperty("period").GetString()); + + profile = await client.GetFromJsonAsync("/api/users/me"); + var quota = profile.GetProperty("aiChatQuota"); + Assert.Equal(1, quota.GetProperty("limit").GetInt32()); + Assert.Equal(1, quota.GetProperty("used").GetInt32()); + Assert.Equal(0, quota.GetProperty("remaining").GetInt32()); + Assert.Equal("week", quota.GetProperty("period").GetString()); + } + + [Fact] + public async Task RecognitionClientRequestId_IsIdempotentAcrossConcurrentChannels() + { + using var client = await fixture.RegisterAsync("recognition_idempotency"); + var ledgers = await client.GetFromJsonAsync("/api/ledgers"); + var ledgerId = ledgers[0].GetProperty("id").GetInt64(); + var categories = await client.GetFromJsonAsync( + "/api/categories?type=expense"); + var categoryId = categories[0].GetProperty("id").GetInt64(); + const string clientRequestId = "wx-order-20260721-001"; + var payload = new + { + ledgerId, + categoryId, + type = "expense", + amount = 28.50m, + note = "微信支付", + occurredAt = "2026-07-21T10:30:00+08:00", + source = "local_ocr", + clientRequestId, + }; + + var responses = await Task.WhenAll( + client.PostAsJsonAsync("/api/transactions", payload), + client.PostAsJsonAsync("/api/transactions", payload)); + Assert.All(responses, response => response.EnsureSuccessStatusCode()); + + var created = await Task.WhenAll( + responses.Select(response => + response.Content.ReadFromJsonAsync())); + Assert.Equal( + created[0].GetProperty("id").GetInt64(), + created[1].GetProperty("id").GetInt64()); + Assert.Equal("local_ocr", created[0].GetProperty("source").GetString()); + + var month = await client.GetFromJsonAsync( + $"/api/transactions/month?year=2026&month=7&ledgerId={ledgerId}"); + Assert.Equal(1, month.GetProperty("count").GetInt32()); + } +} + +public sealed class ChinaClockTests +{ + [Fact] + public void ShanghaiMonthRange_MapsUtcBoundaryCorrectly() + { + var (start, end) = ChinaClock.MonthRangeUtc(2026, 7); + Assert.Equal( + new DateTime(2026, 6, 30, 16, 0, 0, DateTimeKind.Utc), + start); + Assert.Equal( + new DateTime(2026, 7, 31, 16, 0, 0, DateTimeKind.Utc), + end); + } + [Fact] + public void ShanghaiWeekAndYearRanges_UseLocalCalendarBoundaries() + { + var (weekStart, weekEnd) = ChinaClock.WeekRangeUtc( + new DateTime(2026, 7, 19)); + Assert.Equal( + new DateTime(2026, 7, 12, 16, 0, 0, DateTimeKind.Utc), + weekStart); + Assert.Equal( + new DateTime(2026, 7, 19, 16, 0, 0, DateTimeKind.Utc), + weekEnd); + + var (yearStart, yearEnd) = ChinaClock.YearRangeUtc(2026); + Assert.Equal( + new DateTime(2025, 12, 31, 16, 0, 0, DateTimeKind.Utc), + yearStart); + Assert.Equal( + new DateTime(2026, 12, 31, 16, 0, 0, DateTimeKind.Utc), + yearEnd); + } +} +public sealed class ImageParseResultTests +{ + private static readonly MethodInfo ParseMethod = + typeof(OpenAiVisionClient).GetMethod( + "ParseImageResults", + BindingFlags.NonPublic | BindingFlags.Static) + ?? throw new InvalidOperationException("Image parser not found"); + + [Fact] + public void FullTimes_AreParsedPerBill_AndDateOnlyFallsBack() + { + const string payload = + """ + { + "bills": [ + { + "type": "expense", + "amount": 18, + "categoryName": "饮品", + "note": "奶茶", + "occurredAt": "2026-07-18T14:30:00+08:00" + }, + { + "type": "income", + "amount": 100, + "categoryName": "兼职", + "note": "稿费", + "occurredAt": "2026-07-17T09:15:00+08:00" + }, + { + "type": "expense", + "amount": 30, + "categoryName": "餐饮", + "note": "午饭", + "occurredAt": "2026-07-16" + } + ] + } + """; + + var results = Assert.IsAssignableFrom>( + ParseMethod.Invoke(null, [payload])); + + Assert.Equal(3, results.Count); + Assert.Equal( + new DateTime(2026, 7, 18, 6, 30, 0, DateTimeKind.Utc), + results[0].OccurredAt); + Assert.Equal( + new DateTime(2026, 7, 17, 1, 15, 0, DateTimeKind.Utc), + results[1].OccurredAt); + Assert.Null(results[2].OccurredAt); + } +} + +public sealed class BudgetRecommendationValidationTests +{ + [Fact] + public void Draft_IsClampedToSpent_AndKeepsUnmentionedCategories() + { + var contexts = + new Dictionary + { + [1] = new(1, "餐饮", "food", "coral", 80, 120, "high"), + [2] = new(2, "交通", "transport", "teal", 20, 60, "medium"), + }; + var request = new MiaoJiZhang.Api.Contracts.RefineBudgetRecommendationRequest( + null, + 2026, + 7, + "餐饮降到十元,其他不变", + new MiaoJiZhang.Api.Contracts.BudgetDraftRequest( + 150, + [ + new(1, 100), + new(2, 50), + ])); + const string arguments = + """ + { + "suggestedTotal": 20, + "items": [ + { "categoryId": 1, "amount": 10 } + ], + "summary": "已降低餐饮预算" + } + """; + + var result = BudgetRecommendationService.ValidateToolDraft( + request, + contexts, + new Dictionary { [1] = 100, [2] = 50 }, + 100, + arguments, + out var summary); + + Assert.Equal("已降低餐饮预算", summary); + Assert.Equal(130, result.SuggestedTotal); + Assert.Equal(80, result.Items.Single(item => item.CategoryId == 1).SuggestedAmount); + Assert.Equal(50, result.Items.Single(item => item.CategoryId == 2).SuggestedAmount); + Assert.Contains(result.Warnings!, warning => warning.Contains("不能低于已花")); + Assert.Contains(result.Warnings!, warning => warning.Contains("保留原值")); + } +} diff --git a/backend/MiaoJiZhang.Api.Tests/MiaoJiZhang.Api.Tests.csproj b/backend/MiaoJiZhang.Api.Tests/MiaoJiZhang.Api.Tests.csproj new file mode 100644 index 0000000..fee1927 --- /dev/null +++ b/backend/MiaoJiZhang.Api.Tests/MiaoJiZhang.Api.Tests.csproj @@ -0,0 +1,28 @@ + + + + net9.0 + enable + enable + false + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/MiaoJiZhang.Api/Contracts/AuthContracts.cs b/backend/MiaoJiZhang.Api/Contracts/AuthContracts.cs new file mode 100644 index 0000000..1865c3a --- /dev/null +++ b/backend/MiaoJiZhang.Api/Contracts/AuthContracts.cs @@ -0,0 +1,27 @@ +namespace MiaoJiZhang.Api.Contracts; + +// ---- Auth(当前仅用户名密码;快捷登录接口预留不实现)---- +public record RegisterRequest(string Username, string Password, bool AgreedToTerms = false); +public record LoginRequest(string Username, string Password); +public record AuthResponse(long UserId, string Username, string Token, DateTime ExpiresAt, bool AccountClosureCancelled = false); + +// ---- Onboarding ---- +public record OnboardingRequest(string AppMode, string AvatarKey, string PersonaKey, string? CustomName); +public record SwitchModeRequest(string AppMode); +public record UpdateCompanionRequest(string? AvatarKey, string? PersonaKey, string? CustomName, int? RoastLevel, int? StickerFrequency, int? ProactiveLevel); + +// ---- User profile ---- +public record AiCompanionDto(string AvatarKey, string PersonaKey, string? CustomName, int RoastLevel, int StickerFrequency, int ProactiveLevel); +public record UserPermissionsDto(bool Ai); +public record AiChatQuotaDto(int Limit, int Used, int Remaining, string Period, DateTime ResetAt); +public record UserProfileResponse(long UserId, string Username, string? Nickname, string AppMode, AiCompanionDto? AiCompanion, bool OnboardingDone, UserPermissionsDto Permissions, AiChatQuotaDto AiChatQuota); +public record UpdateProfileRequest(string? Nickname); +public record ChangePasswordRequest(string CurrentPassword, string NewPassword); +public record DeleteAccountRequest(string Password, string? ConfirmationText = null); +public record AccountClosureResponse(DateTime RequestedAt, DateTime ScheduledAt); +public record UpdateUserPermissionsRequest(bool Ai); +public record UpdateAiChatQuotaRequest(int Limit, string Period, bool ResetUsage = false); + +// ---- 通用 ---- +public record ApiError(string Code, string Message); + diff --git a/backend/MiaoJiZhang.Api/Contracts/BusinessContracts.cs b/backend/MiaoJiZhang.Api/Contracts/BusinessContracts.cs new file mode 100644 index 0000000..79824ff --- /dev/null +++ b/backend/MiaoJiZhang.Api/Contracts/BusinessContracts.cs @@ -0,0 +1,147 @@ +namespace MiaoJiZhang.Api.Contracts; + +// ---- Ledger / Category ---- +public record LedgerDto(long Id, string Name, string IconKey, bool IsDefault); +public record CategoryDto( + long Id, string Name, string IconKey, string Type, + int SortOrder, bool IsCustom, string ColorKey = "mint"); +public record CreateCategoryRequest( + string Name, string IconKey, string Type, string? ColorKey = null); +public record UpdateCategoryRequest( + string Name, string IconKey, int SortOrder, string? ColorKey = null); + +// ---- Transaction ---- +public record CreateTransactionRequest( + long? LedgerId, // null = 默认账本 + long CategoryId, + string Type, // expense | income + decimal Amount, + string? Note, + string? PaymentMethod, + DateTime? OccurredAt, // null = 现在 + string? Source, // manual | voice | ocr + string? SourceText, + string? ClientRequestId = null); + +public record UpdateTransactionRequest( + long LedgerId, + long CategoryId, + string Type, + decimal Amount, + string? Note, + string? PaymentMethod, + DateTime OccurredAt, + DateTime? BaseUpdatedAt = null); + +public record TransactionDto( + long Id, long LedgerId, long CategoryId, string CategoryName, string CategoryIcon, + string Type, decimal Amount, string? Note, string? PaymentMethod, + DateTime OccurredAt, string Source, string? SourceText, + bool IsDeleted = false, string CategoryColor = "mint", + DateTime? UpdatedAt = null); + +public record DailyGroupDto(DateOnly Date, decimal Expense, decimal Income, List Items); + +public record MonthSummaryDto( + int Year, int Month, decimal Income, decimal Expense, decimal Balance, + int Count, List Days); + +public record CategoryStatDto( + long CategoryId, string Name, string IconKey, + decimal Amount, double Percent, string ColorKey = "mint"); +public record MonthStatsDto(int Year, int Month, decimal TotalExpense, decimal TotalIncome, List ByCategory, List DailyExpenses) +{ + public string? AiAnalysis { get; set; } +} +public record PeriodTrendPointDto( + string Label, DateTime Date, decimal Expense, decimal Income); +public record PeriodStatsDto( + string PeriodType, string PeriodLabel, DateTime StartDate, DateTime EndDate, + decimal TotalExpense, decimal TotalIncome, decimal Balance, int Count, + List ByCategory, List Trend, + string? Analysis); + +// ---- Budget ---- +public record BudgetItemDto( + long? CategoryId, string? CategoryName, string? CategoryIcon, + decimal Amount, decimal Spent, bool IsRecurring, + string? CategoryColor = null); +public record BudgetsResponse(int Year, int Month, BudgetItemDto? Total, List Categories); +public record UpsertBudgetRequest(long? CategoryId, decimal Amount, bool Recurring = false); // Amount<=0 表示删除该预算 +public record BudgetAmountRequest(long? CategoryId, decimal Amount); +public record ApplyBudgetBatchRequest(bool Recurring, List Items); +public record BudgetRecommendationItemDto( + long CategoryId, + string CategoryName, + string CategoryIcon, + decimal SuggestedAmount, + decimal CurrentSpent, + decimal HistoricalAverage, + string Confidence, + string ColorKey = "mint"); +public record BudgetRecommendationResponse( + int Year, + int Month, + decimal SuggestedTotal, + string Message, + List Items, + string? AdjustmentSummary = null, + List? Warnings = null); +public record BudgetDraftItemRequest(long CategoryId, decimal Amount); +public record BudgetDraftRequest( + decimal SuggestedTotal, + List Items); +public record BudgetRefinementTurn(string Role, string Content); +public record RefineBudgetRecommendationRequest( + long? LedgerId, + int Year, + int Month, + string Instruction, + BudgetDraftRequest CurrentDraft, + List? History = null); + +// ---- Sticker ---- +public record StickerDto(string Key, string Label, string GroupKey); + +// ---- Monthly report ---- +public record MonthlyReportDto( + int Year, int Month, decimal Income, decimal Expense, decimal Balance, int Count, + double AiRatio, + string? TopDay, decimal TopDayAmount, string? TopDayNote, + string? TopCategory, decimal TopCategoryAmount, double TopCategoryPercent, + List CategoryRanking, + string Roast); + +public record CategoryRankDto( + string Name, string IconKey, decimal Amount, double Percent, + string ColorKey = "mint"); + +public record PeriodReportDto( + string PeriodType, string PeriodLabel, DateTime StartDate, DateTime EndDate, + decimal Income, decimal Expense, decimal Balance, int Count, double AiRatio, + string? PeakLabel, decimal PeakAmount, string? PeakNote, + string? TopCategory, decimal TopCategoryAmount, double TopCategoryPercent, + List CategoryRanking, + string Commentary); + +// ---- OCR ---- +public record OcrParseRequest(string Text, string? Source = null); +public record OcrParseResponse( + bool Matched, long CategoryId, string CategoryName, string CategoryIcon, + decimal Amount, string? PaymentMethod, string Note, string Type); +public record ImageParseItemResponse( + bool Matched, long CategoryId, string CategoryName, string CategoryIcon, + string Type, decimal Amount, string? PaymentMethod, string Note, + DateTime? OccurredAt); +public record ImageParseResponse( + bool Matched, long CategoryId, string CategoryName, string CategoryIcon, + decimal Amount, string? PaymentMethod, string Note, string Type, + List Items, DateTime? OccurredAt); + +// ---- Chat ---- +public record SendChatRequest(string Content, string Type = "text", long? LedgerId = null); // text | sticker +public record ChatMessageDto( + long Id, string Role, string Type, string Content, + TransactionDto? Transaction, DateTime CreatedAt); +public record SendChatResponse(List Messages); + diff --git a/backend/MiaoJiZhang.Api/Controllers/AdminController.cs b/backend/MiaoJiZhang.Api/Controllers/AdminController.cs new file mode 100644 index 0000000..607516e --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/AdminController.cs @@ -0,0 +1,280 @@ +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[AdminAuth] +[Route("api/admin")] +public class AdminController(AppDbContext db) : ControllerBase +{ + [HttpGet("dashboard")] public async Task Dashboard() { var tu = await db.Users.CountAsync(); var ta = await db.Users.CountAsync(u => u.LastLoginAt.HasValue && u.LastLoginAt.Value >= ChinaClock.ToUtc(ChinaClock.Now.Date) && u.LastLoginAt.Value < ChinaClock.ToUtc(ChinaClock.Now.Date.AddDays(1))); var tt = await db.Transactions.IgnoreQueryFilters().CountAsync(); var ai = await db.Transactions.IgnoreQueryFilters().CountAsync(t => TransactionSourceRules.AiAssisted.Contains(t.Source)); var at = await db.Transactions.IgnoreQueryFilters().Where(t => TransactionSourceRules.AiAssisted.Contains(t.Source)).CountAsync(); var ud = await db.Transactions.IgnoreQueryFilters().CountAsync(t => t.IsDeleted && TransactionSourceRules.AiAssisted.Contains(t.Source)); return Ok(new { users = new { total = tu, activeToday = ta }, transactions = new { total = tt, aiBooked = ai }, aiAccuracy = at == 0 ? 0 : Math.Round((1.0 - (double)ud / at) * 100, 1), undoRate = at == 0 ? 0 : Math.Round((double)ud / at * 100, 1), aiMessages = await db.ChatMessages.CountAsync(m => m.Role == ChatRole.Assistant) }); } + + [HttpGet("configs")] + public async Task ListConfigs() + { + var configs = await db.AppConfigs.OrderBy(c => c.Key).ToListAsync(); + return Ok(configs.Select(c => new + { + c.Id, + c.Key, + Value = IsSecret(c.Key) ? "********" : c.Value, + IsSecret = IsSecret(c.Key), + c.Version, + c.UpdatedAt, + })); + } + [HttpPut("configs/{id:long}")] + public async Task UpdateConfig(long id, [FromBody] UpdateConfigRequest req) + { + var cfg = await db.AppConfigs.FindAsync(id); + if (cfg is null) return NotFound(); + if (IsSecret(cfg.Key)) + return BadRequest(new { error = "secret_env_only", detail = "密钥只能通过服务端环境变量修改" }); + cfg.Value = req.Value; + cfg.Version++; + cfg.UpdatedAt = DateTime.UtcNow; + await db.SaveChangesAsync(); + return Ok(new { cfg.Id, cfg.Key, cfg.Value, cfg.Version }); + } + [HttpPost("configs")] + public async Task CreateConfig([FromBody] CreateConfigRequest req) + { + if (string.IsNullOrWhiteSpace(req.Key)) return BadRequest(new { error = "key_required" }); + if (IsSecret(req.Key)) + return BadRequest(new { error = "secret_env_only", detail = "密钥只能通过服务端环境变量配置" }); + if (await db.AppConfigs.AnyAsync(c => c.Key == req.Key)) + return Conflict(new { error = "key_exists", detail = "该配置 Key 已存在,请用 PUT 更新" }); + var cfg = new AppConfig { Key = req.Key.Trim(), Value = req.Value ?? "", Version = 1, UpdatedAt = DateTime.UtcNow }; + db.AppConfigs.Add(cfg); + await db.SaveChangesAsync(); + return Ok(new { cfg.Id, cfg.Key, cfg.Value, cfg.Version }); + } + + [HttpGet("personas")] public async Task ListPersonas() => Ok(await db.AiPersonas.OrderBy(p => p.Key).ToListAsync()); + [HttpPost("personas")] public async Task CreatePersona([FromBody] UpsertPersonaRequest req) { if (await db.AiPersonas.AnyAsync(p => p.Key == req.Key)) return Conflict(new { error = "key_exists" }); var p = new AiPersona { Key = req.Key, Name = req.Name, Description = req.Description, SampleLine = req.SampleLine, PromptTemplate = req.PromptTemplate, IsEnabled = true, Version = 1 }; db.AiPersonas.Add(p); await db.SaveChangesAsync(); return Ok(p); } + [HttpPut("personas/{id:long}")] public async Task UpdatePersona(long id, [FromBody] UpsertPersonaRequest req) { var p = await db.AiPersonas.FindAsync(id); if (p is null) return NotFound(); p.Key = req.Key; p.Name = req.Name; p.Description = req.Description; p.SampleLine = req.SampleLine; p.PromptTemplate = req.PromptTemplate; p.IsEnabled = req.IsEnabled; p.Version++; await db.SaveChangesAsync(); return Ok(p); } + [HttpDelete("personas/{id:long}")] public async Task DeletePersona(long id) { var p = await db.AiPersonas.FindAsync(id); if (p is null) return NotFound(); db.AiPersonas.Remove(p); await db.SaveChangesAsync(); return NoContent(); } + + [HttpGet("avatars")] public async Task ListAvatars() => Ok(await db.AiAvatars.OrderBy(a => a.Key).ToListAsync()); + [HttpPost("avatars")] public async Task CreateAvatar([FromBody] UpsertAvatarRequest req) { if (await db.AiAvatars.AnyAsync(a => a.Key == req.Key)) return Conflict(new { error = "key_exists" }); var a = new AiAvatar { Key = req.Key, DefaultName = req.Name, SpeechTic = req.SpeechTic, ImageUrl = req.ImageUrl, IsEnabled = true }; db.AiAvatars.Add(a); await db.SaveChangesAsync(); return Ok(a); } + [HttpPut("avatars/{id:long}")] public async Task UpdateAvatar(long id, [FromBody] UpsertAvatarRequest req) { var a = await db.AiAvatars.FindAsync(id); if (a is null) return NotFound(); a.Key = req.Key; a.DefaultName = req.Name; a.SpeechTic = req.SpeechTic; a.ImageUrl = req.ImageUrl; a.IsEnabled = req.IsEnabled; await db.SaveChangesAsync(); return Ok(a); } + [HttpDelete("avatars/{id:long}")] public async Task DeleteAvatar(long id) { var a = await db.AiAvatars.FindAsync(id); if (a is null) return NotFound(); db.AiAvatars.Remove(a); await db.SaveChangesAsync(); return NoContent(); } + + [HttpGet("stickers")] public async Task ListStickers() => Ok(await db.Stickers.OrderBy(s => s.GroupKey).ThenBy(s => s.Key).ToListAsync()); + [HttpPost("stickers")] public async Task CreateSticker([FromBody] UpsertStickerRequest req) { if (await db.Stickers.AnyAsync(s => s.Key == req.Key)) return Conflict(new { error = "key_exists" }); var s = new Sticker { Key = req.Key, Label = req.Label, GroupKey = req.GroupKey, TriggerTags = req.TriggerTags, ImageUrl = req.ImageUrl, IsEnabled = true }; db.Stickers.Add(s); await db.SaveChangesAsync(); return Ok(s); } + [HttpPut("stickers/{id:long}")] public async Task UpdateSticker(long id, [FromBody] UpsertStickerRequest req) { var s = await db.Stickers.FindAsync(id); if (s is null) return NotFound(); s.Key = req.Key; s.Label = req.Label; s.GroupKey = req.GroupKey; s.TriggerTags = req.TriggerTags; s.ImageUrl = req.ImageUrl; s.IsEnabled = req.IsEnabled; await db.SaveChangesAsync(); return Ok(s); } + [HttpDelete("stickers/{id:long}")] public async Task DeleteSticker(long id) { var s = await db.Stickers.FindAsync(id); if (s is null) return NotFound(); db.Stickers.Remove(s); await db.SaveChangesAsync(); return NoContent(); } + + [HttpPost("llm/test")] public async Task TestLlm([FromServices] ILlmClient llm) { var (ok, error) = await llm.TestConnectionAsync(); return Ok(new { ok, error = ok ? (string?)null : error, detail = ok ? "LLM 连接正常" : error }); } + + [HttpPost("configs/init")] public async Task InitConfigs() { var now = DateTime.UtcNow; var defaults = new Dictionary { ["brand.app_name"] = "记之", ["brand.slogan"] = "会聊天的记账本 · 让 AI 帮你管钱", ["brand.logo_url"] = "", ["llm.protocol"] = "responses", ["llm.base_url"] = "https://api.openai.com/v1", ["llm.model"] = "gpt-4o-mini", ["llm.max_tokens"] = "1024", ["llm.temperature"] = "0.8", ["limit.daily_ai_messages"] = "200", ["limit.daily_ai_messages_per_user"] = "50", ["limit.max_monthly_budget"] = "99999999", ["feature.ocr_enabled"] = "true", ["feature.voice_enabled"] = "true", ["feature.ai_auto_book"] = "true", ["feature.sticker_enabled"] = "true", ["system.default_ledger_name"] = "日常账本", ["system.max_ledgers_per_user"] = "10", ["feature.screenshot_bookkeeping_enabled"] = "true", ["permission.default.ai_enabled"] = "true", ["quota.default_ai_chat_limit"] = "50", ["quota.default_ai_chat_period"] = "day" }; var existing = await db.AppConfigs.Select(c => c.Key).ToListAsync(); var added = 0; foreach (var (key, value) in defaults) { if (!existing.Contains(key)) { db.AppConfigs.Add(new AppConfig { Key = key, Value = value, Version = 1, UpdatedAt = now }); added++; } } if (added > 0) await db.SaveChangesAsync(); return Ok(new { added, total = defaults.Count }); } + + [HttpGet("categories")] public async Task ListSystemCategories() => Ok(await db.Categories.Where(c => c.UserId == null && !c.IsDeleted).OrderBy(c => c.Type).ThenBy(c => c.SortOrder).ToListAsync()); +[HttpPost("categories")] + public async Task CreateSystemCategory([FromBody] UpsertCategoryRequest req) + { + if (req.Type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + var iconKey = CategoriesController.NormalizeIcon(req.IconKey); + if (!CategoriesController.AllowedIcons.Contains(iconKey)) + return BadRequest(new ApiError("ICON_INVALID", "分类图标不存在")); + var type = req.Type == "income" ? TransactionType.Income : TransactionType.Expense; + var maxSort = await db.Categories + .Where(category => category.UserId == null && category.Type == type) + .MaxAsync(category => (int?)category.SortOrder) ?? 0; + var category = new Category + { + Type = type, + Name = req.Name, + IconKey = iconKey, + SortOrder = maxSort + 1, + }; + db.Categories.Add(category); + await db.SaveChangesAsync(); + return Ok(category); + } +[HttpPut("categories/{id:long}")] + public async Task UpdateSystemCategory(long id, [FromBody] UpsertCategoryRequest req) + { + if (req.Type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + var iconKey = CategoriesController.NormalizeIcon(req.IconKey); + if (!CategoriesController.AllowedIcons.Contains(iconKey)) + return BadRequest(new ApiError("ICON_INVALID", "分类图标不存在")); + var category = await db.Categories.FirstOrDefaultAsync( + item => item.Id == id && item.UserId == null); + if (category is null) return NotFound(); + category.Name = req.Name; + category.IconKey = iconKey; + category.Type = req.Type == "income" + ? TransactionType.Income + : TransactionType.Expense; + await db.SaveChangesAsync(); + return Ok(category); + } + [HttpDelete("categories/{id:long}")] public async Task DeleteSystemCategory(long id) { var cat = await db.Categories.FirstOrDefaultAsync(c => c.Id == id && c.UserId == null); if (cat is null) return NotFound(); cat.IsDeleted = true; await db.SaveChangesAsync(); return NoContent(); } + + [HttpGet("users")] + public async Task ListUsers( + [FromQuery] string? search, + [FromQuery] bool? banned, + [FromQuery] int page = 1, + [FromQuery] int limit = 20) + { + var query = db.Users + .Include(user => user.AiCompanion) + .Include(user => user.FeaturePermissions) + .AsQueryable(); + if (!string.IsNullOrWhiteSpace(search)) + query = query.Where(user => user.Username.Contains(search)); + if (banned.HasValue) + query = query.Where(user => user.IsBanned == banned.Value); + + var total = await query.CountAsync(); + var users = await query + .OrderByDescending(user => user.CreatedAt) + .Skip((Math.Max(1, page) - 1) * Math.Clamp(limit, 1, 100)) + .Take(Math.Clamp(limit, 1, 100)) + .ToListAsync(); + var ids = users.Select(user => user.Id).ToArray(); + var transactionCounts = await db.Transactions + .IgnoreQueryFilters() + .Where(transaction => ids.Contains(transaction.UserId)) + .GroupBy(transaction => transaction.UserId) + .Select(group => new { UserId = group.Key, Count = group.Count() }) + .ToDictionaryAsync(item => item.UserId, item => item.Count); + var aiTransactionCounts = await db.Transactions + .IgnoreQueryFilters() + .Where(transaction => + ids.Contains(transaction.UserId) && + TransactionSourceRules.AiAssisted.Contains(transaction.Source)) + .GroupBy(transaction => transaction.UserId) + .Select(group => new { UserId = group.Key, Count = group.Count() }) + .ToDictionaryAsync(item => item.UserId, item => item.Count); + + var list = users.Select(user => + { + var quota = AiChatQuotaService.GetStatus(user); + return new + { + user.Id, + user.Username, + user.Nickname, + AppMode = user.AppMode == AppMode.AiFirst ? "ai" : "normal", + user.IsBanned, + user.CreatedAt, + user.LastLoginAt, + user.AccountClosureRequestedAt, + user.AccountClosureScheduledAt, + AiEnabled = user.FeaturePermissions.Any(permission => + permission.PermissionKey == FeaturePermissionKeys.Ai && + permission.IsEnabled), + AiChatLimit = quota.Limit, + AiChatUsed = quota.Used, + AiChatRemaining = quota.Remaining, + AiChatPeriod = AiChatQuotaService.PeriodKey(quota.Period), + AiChatResetAt = quota.ResetAt, + Companion = user.AiCompanion == null + ? null + : new + { + user.AiCompanion.AvatarKey, + user.AiCompanion.PersonaKey, + user.AiCompanion.CustomName, + }, + TxCount = transactionCounts.GetValueOrDefault(user.Id), + AiTxCount = aiTransactionCounts.GetValueOrDefault(user.Id), + }; + }).ToList(); + return Ok(new { total, page, list }); + } + [HttpPut("users/{id:long}/ban")] public async Task ToggleBan(long id) { var u = await db.Users.FindAsync(id); if (u is null) return NotFound(); u.IsBanned = !u.IsBanned; u.AuthVersion++; await db.SaveChangesAsync(); return Ok(new { u.Id, u.Username, u.IsBanned }); } + [HttpPut("users/{id:long}/cancel-closure")] public async Task CancelClosure(long id) { var u = await db.Users.FindAsync(id); if (u is null) return NotFound(); if (!u.AccountClosureScheduledAt.HasValue) return Conflict(new ApiError("CLOSURE_NOT_PENDING", "账号未处于注销流程")); u.AccountClosureRequestedAt = null; u.AccountClosureScheduledAt = null; u.AuthVersion++; await db.SaveChangesAsync(); return Ok(new { u.Id, u.Username, cancelled = true }); } + [HttpPut("users/{id:long}/permissions")] + public async Task UpdatePermissions(long id, UpdateUserPermissionsRequest req) + { + var user = await db.Users.FindAsync(id); + if (user is null) return NotFound(); + var permission = await db.UserFeaturePermissions.FirstOrDefaultAsync(p => + p.UserId == id && p.PermissionKey == FeaturePermissionKeys.Ai); + var now = DateTime.UtcNow; + if (permission is null) + { + permission = new UserFeaturePermission + { + UserId = id, + PermissionKey = FeaturePermissionKeys.Ai, + CreatedAt = now, + }; + db.UserFeaturePermissions.Add(permission); + } + permission.IsEnabled = req.Ai; + permission.UpdatedAt = now; + if (!req.Ai) user.AppMode = AppMode.Normal; + await db.SaveChangesAsync(); + return Ok(new { user.Id, permissions = new { ai = permission.IsEnabled } }); + } + + [HttpPut("users/{id:long}/ai-quota")] + public async Task UpdateAiChatQuota( + long id, + UpdateAiChatQuotaRequest req) + { + if (req.Limit is < 0 or > 1_000_000) + return BadRequest(new ApiError( + "AI_QUOTA_LIMIT_INVALID", + "AI 对话次数必须在 0 到 1000000 之间,0 表示不限次数")); + if (!AiChatQuotaService.TryParsePeriod(req.Period, out var period)) + return BadRequest(new ApiError( + "AI_QUOTA_PERIOD_INVALID", + "周期仅支持 day、week 或 month")); + + var user = await db.Users.FindAsync(id); + if (user is null) return NotFound(); + var periodChanged = user.AiChatPeriod != period; + user.AiChatLimit = req.Limit; + user.AiChatPeriod = period; + if (periodChanged || req.ResetUsage) + { + var (windowStart, _) = AiChatQuotaService.CurrentWindow(period); + user.AiChatWindowStartedAt = windowStart; + user.AiChatUsed = 0; + } + await db.SaveChangesAsync(); + var quota = AiChatQuotaService.GetStatus(user); + return Ok(new + { + user.Id, + aiChatQuota = new + { + quota.Limit, + quota.Used, + quota.Remaining, + period = AiChatQuotaService.PeriodKey(quota.Period), + quota.ResetAt, + }, + }); + } + + [HttpGet("users/{id:long}/stats")] public async Task UserStats(long id) { var u = await db.Users.FindAsync(id); if (u is null) return NotFound(); var txCount = await db.Transactions.IgnoreQueryFilters().CountAsync(t => t.UserId == id); var aiCount = await db.Transactions.IgnoreQueryFilters().CountAsync(t => t.UserId == id && TransactionSourceRules.AiAssisted.Contains(t.Source)); var undone = await db.Transactions.IgnoreQueryFilters().CountAsync(t => t.UserId == id && t.IsDeleted && TransactionSourceRules.AiAssisted.Contains(t.Source)); return Ok(new { totalTransactions = txCount, aiBooked = aiCount, aiAccuracy = aiCount == 0 ? 0 : Math.Round((1.0 - (double)undone / aiCount) * 100, 1) }); } + + private static bool IsSecret(string key) => + key.Equals("llm.api_key", StringComparison.OrdinalIgnoreCase) || + key.Contains("secret", StringComparison.OrdinalIgnoreCase) || + key.Contains("password", StringComparison.OrdinalIgnoreCase) || + key.EndsWith("token", StringComparison.OrdinalIgnoreCase); +} + +public record UpdateConfigRequest(string Value); +public record CreateConfigRequest(string Key, string Value); +public record UpsertPersonaRequest(string Key, string Name, string Description, string SampleLine, string PromptTemplate, bool IsEnabled = true); +public record UpsertAvatarRequest(string Key, string Name, string SpeechTic, string? ImageUrl, bool IsEnabled = true); +public record UpsertStickerRequest(string Key, string Label, string GroupKey, string? TriggerTags, string? ImageUrl, bool IsEnabled = true); +public record UpsertCategoryRequest(string Name, string IconKey, string Type); + diff --git a/backend/MiaoJiZhang.Api/Controllers/AuthController.cs b/backend/MiaoJiZhang.Api/Controllers/AuthController.cs new file mode 100644 index 0000000..62b7c37 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/AuthController.cs @@ -0,0 +1,103 @@ +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.RateLimiting; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[EnableRateLimiting("auth")] +[Route("api/auth")] +public class AuthController(AppDbContext db, JwtService jwt) : ControllerBase +{ + [HttpPost("register")] + public async Task> Register(RegisterRequest req) + { + if (!req.AgreedToTerms) + return BadRequest(new ApiError("TERMS_NOT_ACCEPTED", "请先阅读并同意用户协议与隐私政策")); + if (req.Username.Length is < 3 or > 32) return BadRequest(new ApiError("USERNAME_INVALID", "用户名长度需在 3-32 之间")); + if (req.Password.Length < 6) return BadRequest(new ApiError("PASSWORD_TOO_SHORT", "密码至少 6 位")); + if (await db.Users.AnyAsync(u => u.Username == req.Username)) return Conflict(new ApiError("USERNAME_TAKEN", "用户名已被占用")); + + var now = DateTime.UtcNow; + var defaultAiEnabled = !string.Equals( + (await db.AppConfigs.FirstOrDefaultAsync(c => c.Key == "permission.default.ai_enabled"))?.Value, + "false", + StringComparison.OrdinalIgnoreCase); + var quotaConfig = await db.AppConfigs + .Where(c => c.Key == "quota.default_ai_chat_limit" || + c.Key == "quota.default_ai_chat_period") + .ToDictionaryAsync(c => c.Key, c => c.Value); + var defaultAiChatLimit = + quotaConfig.TryGetValue("quota.default_ai_chat_limit", out var limitValue) && + int.TryParse(limitValue, out var parsedLimit) + ? Math.Clamp(parsedLimit, 0, 1_000_000) + : 50; + var periodValue = quotaConfig.GetValueOrDefault( + "quota.default_ai_chat_period", + "day"); + if (!AiChatQuotaService.TryParsePeriod(periodValue, out var defaultAiChatPeriod)) + defaultAiChatPeriod = AiQuotaPeriod.Day; + var (quotaWindowStart, _) = + AiChatQuotaService.CurrentWindow(defaultAiChatPeriod); + var user = new User + { + Username = req.Username, + PasswordHash = BCrypt.Net.BCrypt.HashPassword(req.Password), + AiChatLimit = defaultAiChatLimit, + AiChatPeriod = defaultAiChatPeriod, + AiChatWindowStartedAt = quotaWindowStart, + CreatedAt = now, + }; + user.FeaturePermissions.Add(new UserFeaturePermission + { + PermissionKey = FeaturePermissionKeys.Ai, + IsEnabled = defaultAiEnabled, + CreatedAt = now, + UpdatedAt = now, + }); + var defaultLedgerName = (await db.AppConfigs.FirstOrDefaultAsync(c => c.Key == "system.default_ledger_name"))?.Value ?? "日常账本"; + user.Ledgers.Add(new Ledger { Name = defaultLedgerName, IsDefault = true, CreatedAt = DateTime.UtcNow }); + db.Users.Add(user); + await db.SaveChangesAsync(); + + var (token, expires) = jwt.Issue(user); + return Ok(new AuthResponse(user.Id, user.Username, token, expires)); + } + + [HttpPost("login")] + public async Task> Login(LoginRequest req) + { + var user = await db.Users.FirstOrDefaultAsync(u => u.Username == req.Username); + if (user is null || !BCrypt.Net.BCrypt.Verify(req.Password, user.PasswordHash)) return Unauthorized(new ApiError("BAD_CREDENTIALS", "用户名或密码错误")); + if (user.IsBanned) + return Unauthorized(new ApiError("USER_BANNED", "账号已被封禁")); + + var closureCancelled = false; + if (user.AccountClosureScheduledAt.HasValue) + { + if (user.AccountClosureScheduledAt <= DateTime.UtcNow) + return Unauthorized(new ApiError( + "ACCOUNT_CLOSED", + "账号注销等待期已结束,无法恢复")); + user.AccountClosureRequestedAt = null; + user.AccountClosureScheduledAt = null; + user.AuthVersion++; + closureCancelled = true; + } + + user.LastLoginAt = DateTime.UtcNow; + await db.SaveChangesAsync(); + var (token, expires) = jwt.Issue(user); + return Ok(new AuthResponse( + user.Id, + user.Username, + token, + expires, + closureCancelled)); + } +} diff --git a/backend/MiaoJiZhang.Api/Controllers/BudgetsController.cs b/backend/MiaoJiZhang.Api/Controllers/BudgetsController.cs new file mode 100644 index 0000000..287c796 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/BudgetsController.cs @@ -0,0 +1,349 @@ +using System.Security.Claims; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.RateLimiting; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/budgets")] +public class BudgetsController( + AppDbContext db, + LedgerResolver ledgers, + BudgetRecommendationService recommendations) : ControllerBase +{ + private long Uid => long.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier) ?? User.FindFirstValue("sub")!); + + [HttpGet] + public async Task> Get( + [FromQuery] int year, + [FromQuery] int month, + [FromQuery] long? ledgerId = null) + { + if (month is < 1 or > 12) return BadRequest(new ApiError("MONTH_INVALID", "月份无效")); + var period = year * 100 + month; + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var targetLedgerId = resolvedLedgerId.Value; + + var rows = await db.Budgets + .Where(b => b.UserId == Uid && b.LedgerId == targetLedgerId && (b.Period == period || b.Period == 0)) + .ToListAsync(); + var budgets = rows + .GroupBy(b => b.CategoryId) + .Select(g => g.FirstOrDefault(b => b.Period == period) ?? g.First(b => b.Period == 0)) + .ToList(); + + var (start, end) = ChinaClock.MonthRangeUtc(year, month); + var spentByCat = await db.Transactions + .Where(t => t.UserId == Uid && t.LedgerId == targetLedgerId && + t.Type == TransactionType.Expense && t.OccurredAt >= start && t.OccurredAt < end) + .GroupBy(t => t.CategoryId) + .Select(g => new { g.Key, Amount = g.Sum(t => t.Amount) }) + .ToDictionaryAsync(x => x.Key, x => x.Amount); + var totalSpent = spentByCat.Values.Sum(); + var cats = await db.Categories + .Where(c => !c.IsDeleted && (c.UserId == null || c.UserId == Uid)) + .ToDictionaryAsync(c => c.Id); + + BudgetItemDto? total = null; + var items = new List(); + foreach (var budget in budgets) + { + if (budget.CategoryId is null) + { + total = new BudgetItemDto(null, null, null, budget.Amount, totalSpent, budget.Period == 0); + } + else if (cats.TryGetValue(budget.CategoryId.Value, out var category)) + { + items.Add(new BudgetItemDto( + category.Id, + category.Name, + category.IconKey, + budget.Amount, + spentByCat.GetValueOrDefault(category.Id, 0), + budget.Period == 0, + category.ColorKey)); + } + } + + return Ok(new BudgetsResponse( + year, + month, + total, + items.OrderByDescending(i => i.Amount <= 0 ? 0 : i.Spent / i.Amount).ToList())); + } + + [HttpPut] + public async Task Upsert( + UpsertBudgetRequest req, + [FromQuery] int year, + [FromQuery] int month, + [FromQuery(Name = "ledgerId")] long? requestedLedgerId = null) + { + if (month is < 1 or > 12) return BadRequest(new ApiError("MONTH_INVALID", "月份无效")); + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, requestedLedgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var ledgerId = resolvedLedgerId.Value; + if (req.Recurring) + { + var overrideRow = await db.Budgets.FirstOrDefaultAsync(b => + b.UserId == Uid && b.LedgerId == ledgerId && + b.Period == year * 100 + month && b.CategoryId == req.CategoryId); + if (overrideRow is not null) db.Budgets.Remove(overrideRow); + } + await UpsertCore(ledgerId, req.Recurring ? 0 : year * 100 + month, req.CategoryId, req.Amount); + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpPut("batch")] + public async Task Batch( + ApplyBudgetBatchRequest req, + [FromQuery] int year, + [FromQuery] int month, + [FromQuery(Name = "ledgerId")] long? requestedLedgerId = null) + { + if (month is < 1 or > 12) return BadRequest(new ApiError("MONTH_INVALID", "月份无效")); + if (req.Items.Count == 0) return BadRequest(new ApiError("BUDGET_EMPTY", "没有可应用的预算")); + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, requestedLedgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var ledgerId = resolvedLedgerId.Value; + var targetPeriod = req.Recurring ? 0 : year * 100 + month; + if (req.Recurring) + { + var affectedCategories = req.Items.Select(i => i.CategoryId).ToHashSet(); + var overrides = await db.Budgets + .Where(b => b.UserId == Uid && b.LedgerId == ledgerId && + b.Period == year * 100 + month) + .ToListAsync(); + db.Budgets.RemoveRange(overrides.Where(b => affectedCategories.Contains(b.CategoryId))); + } + foreach (var item in req.Items) + await UpsertCore(ledgerId, targetPeriod, item.CategoryId, item.Amount); + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpGet("recommendations")] + [RequireAiPermission] + public async Task> Recommendations( + [FromQuery] int year, + [FromQuery] int month, + [FromQuery(Name = "ledgerId")] long? requestedLedgerId = null) + { + if (month is < 1 or > 12) return BadRequest(new ApiError("MONTH_INVALID", "月份无效")); + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, requestedLedgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var ledgerId = resolvedLedgerId.Value; + var (currentStart, currentEnd) = ChinaClock.MonthRangeUtc(year, month); + var historyStart = currentStart.AddMonths(-3); + + var transactions = await db.Transactions + .Where(t => t.UserId == Uid && t.LedgerId == ledgerId && + t.Type == TransactionType.Expense && + t.OccurredAt >= historyStart && t.OccurredAt < currentEnd) + .Select(t => new { t.CategoryId, t.Amount, t.OccurredAt }) + .ToListAsync(); + var categories = await db.Categories + .Where(c => !c.IsDeleted && c.Type == TransactionType.Expense && + (c.UserId == null || c.UserId == Uid)) + .ToDictionaryAsync(c => c.Id); + + var currentTransactions = transactions + .Where(t => t.OccurredAt >= currentStart && t.OccurredAt < currentEnd) + .ToList(); + var currentByCategory = currentTransactions + .GroupBy(t => t.CategoryId) + .ToDictionary(g => g.Key, g => g.Sum(t => t.Amount)); + var localNow = ChinaClock.Now; + var projectionAllowed = localNow.Year == year && localNow.Month == month && + localNow.Day >= 14 && currentTransactions.Count >= 10; + + var categoryIds = transactions.Select(t => t.CategoryId).Distinct().ToList(); + var suggestions = new List(); + foreach (var categoryId in categoryIds) + { + if (!categories.TryGetValue(categoryId, out var category)) continue; + var history = Enumerable.Range(1, 3) + .Select(offset => + { + var start = currentStart.AddMonths(-offset); + var end = start.AddMonths(1); + return transactions + .Where(t => t.CategoryId == categoryId && t.OccurredAt >= start && t.OccurredAt < end) + .Sum(t => t.Amount); + }) + .Where(value => value > 0) + .OrderBy(value => value) + .ToList(); + + var currentSpent = currentByCategory.GetValueOrDefault(categoryId, 0); + decimal baseline; + string confidence; + if (history.Count > 0) + { + baseline = Median(history); + confidence = history.Count >= 3 ? "high" : "medium"; + if (projectionAllowed && currentSpent > 0) + { + var projection = currentSpent / localNow.Day * DateTime.DaysInMonth(year, month); + baseline = baseline * 0.8m + projection * 0.2m; + } + } + else if (projectionAllowed && currentSpent > 0) + { + baseline = currentSpent / localNow.Day * DateTime.DaysInMonth(year, month); + confidence = "low"; + } + else + { + continue; + } + + var p75 = history.Count == 0 + ? baseline + : history[(int)Math.Ceiling(history.Count * 0.75) - 1]; + var target = baseline * 1.05m; + var cap = p75 * 1.2m; + target = Math.Min(target, cap); + if (currentSpent >= target) target = currentSpent * 1.05m; + target = RoundFriendly(target); + + suggestions.Add(new BudgetRecommendationItemDto( + categoryId, + category.Name, + category.IconKey, + target, + currentSpent, + history.Count == 0 ? baseline : history.Average(), + confidence, + category.ColorKey)); + } + + var message = suggestions.Count == 0 + ? "历史数据不足。至少记录 1 个完整月,或本月满 14 天且达到 10 笔支出后再试。" + : "建议基于最近 3 个完整月,并确保不低于本月已发生支出。"; + var currentSpentTotal = currentTransactions.Sum(t => t.Amount); + return Ok(new BudgetRecommendationResponse( + year, + month, + Math.Max(suggestions.Sum(s => s.SuggestedAmount), currentSpentTotal), + message, + suggestions.OrderByDescending(s => s.SuggestedAmount).ToList())); + } + + [HttpPost("recommendations/refine")] + [RequireAiPermission] + [EnableRateLimiting("ai")] + public async Task> RefineRecommendation( + RefineBudgetRecommendationRequest request, + CancellationToken ct) + { + if (request.Year is < 2000 or > 2200 || request.Month is < 1 or > 12) + return BadRequest(new ApiError("MONTH_INVALID", "月份无效")); + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, request.LedgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + + try + { + return Ok(await recommendations.RefineAsync( + Uid, + resolvedLedgerId.Value, + request, + ct)); + } + catch (ArgumentException exception) + { + return BadRequest(new ApiError("BUDGET_DRAFT_INVALID", exception.Message)); + } + catch (InvalidOperationException exception) + { + return StatusCode(503, new ApiError("BUDGET_AI_UNAVAILABLE", exception.Message)); + } + catch (HttpRequestException exception) + { + return StatusCode(502, new ApiError("BUDGET_AI_FAILED", exception.Message)); + } + } + + private async Task UpsertCore(long ledgerId, int period, long? categoryId, decimal amount) + { + if (categoryId.HasValue && !await db.Categories.AnyAsync(c => + c.Id == categoryId && !c.IsDeleted && c.Type == TransactionType.Expense && + (c.UserId == null || c.UserId == Uid))) + throw new ArgumentException("预算分类无效"); + + var existing = await db.Budgets.FirstOrDefaultAsync(b => + b.UserId == Uid && b.LedgerId == ledgerId && + b.Period == period && b.CategoryId == categoryId); + if (amount <= 0) + { + if (existing != null) db.Budgets.Remove(existing); + } + else if (existing != null) + { + existing.Amount = amount; + } + else + { + db.Budgets.Add(new Budget + { + UserId = Uid, + LedgerId = ledgerId, + Period = period, + CategoryId = categoryId, + Amount = amount, + }); + } + } + + private static decimal Median(IReadOnlyList values) + { + if (values.Count == 0) return 0; + var middle = values.Count / 2; + return values.Count % 2 == 0 + ? (values[middle - 1] + values[middle]) / 2 + : values[middle]; + } + + private static decimal RoundFriendly(decimal value) + { + var unit = value < 100 ? 10m : value < 1000 ? 50m : 100m; + return Math.Ceiling(value / unit) * unit; + } + + private async Task DefaultLedgerId() => + await db.Ledgers.Where(l => l.OwnerId == Uid && l.IsDefault).Select(l => l.Id).FirstAsync(); +} + +[ApiController] +[Authorize] +[Route("api/stickers")] +public class StickersController(AppDbContext db) : ControllerBase +{ + [HttpGet] + public async Task>> List() + { + var enabled = await db.AppConfigs + .Where(config => config.Key == "feature.sticker_enabled") + .Select(config => config.Value) + .FirstOrDefaultAsync(); + if (enabled?.Equals("false", StringComparison.OrdinalIgnoreCase) == true) + return Ok(new List()); + return Ok(await db.Stickers.Where(s => s.IsEnabled) + .Select(s => new StickerDto(s.Key, s.Label, s.GroupKey)).ToListAsync()); + } +} diff --git a/backend/MiaoJiZhang.Api/Controllers/ChatController.cs b/backend/MiaoJiZhang.Api/Controllers/ChatController.cs new file mode 100644 index 0000000..c0bec58 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/ChatController.cs @@ -0,0 +1,533 @@ +using System.Security.Claims; +using System.Text; +using System.Text.Json; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.RateLimiting; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/chat")] +[RequireAiPermission] +public class ChatController( + AppDbContext db, + ILlmClient llm, + LedgerResolver ledgers, + AgentService agent, + AiChatQuotaService quotas, + ILogger logger) : ControllerBase +{ + private long Uid => long.Parse( + User.FindFirstValue(ClaimTypes.NameIdentifier) ?? + User.FindFirstValue("sub")!); + + [HttpGet("messages")] + public async Task>> History( + [FromQuery] int limit = 50, + [FromQuery] long? beforeId = null) + { + var boundaryId = await CurrentBoundaryId(); + var query = db.ChatMessages.Where(m => + m.UserId == Uid && + m.Id > boundaryId && + m.Type != ChatMessageType.ContextBoundary); + if (beforeId.HasValue) + query = query.Where(m => m.Id < beforeId.Value); + + var list = await query + .OrderByDescending(m => m.Id) + .Take(Math.Min(limit, 100)) + .ToListAsync(); + list.Reverse(); + + var transactionIds = list + .Where(m => m.TransactionId.HasValue) + .Select(m => m.TransactionId!.Value) + .ToList(); + var transactions = await db.Transactions + .Include(t => t.Category) + .IgnoreQueryFilters() + .Where(t => t.UserId == Uid && transactionIds.Contains(t.Id)) + .ToDictionaryAsync(t => t.Id); + return Ok(list.Select(m => ToDto(m, transactions)).ToList()); + } + + [HttpPost("context/clear")] + public async Task ClearContext() + { + db.ChatMessages.Add(new ChatMessage + { + UserId = Uid, + Role = ChatRole.System, + Type = ChatMessageType.ContextBoundary, + Content = "新会话", + CreatedAt = DateTime.UtcNow, + }); + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpPost("messages")] + [EnableRateLimiting("ai")] + public async Task> Send( + SendChatRequest req, + CancellationToken ct) + { + return await SendWithAgent(req, ct); + } + + [HttpPost("messages/stream")] + [EnableRateLimiting("ai")] + public async Task StreamSend(SendChatRequest req, CancellationToken ct) + { + await StreamWithAgent(req, ct); + } + + private async Task> SendWithAgent( + SendChatRequest req, + CancellationToken ct) + { + if (string.IsNullOrWhiteSpace(req.Content)) + return BadRequest(new ApiError("CONTENT_EMPTY", "内容不能为空")); + var ledgerId = await ledgers.ResolveAsync(Uid, req.LedgerId, ct); + if (!ledgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + if (req.Type == "sticker" && !await FeatureEnabled("feature.sticker_enabled", ct)) + return StatusCode(403, new ApiError("FEATURE_DISABLED", "表情包功能已由后台关闭")); + var allowAutoBook = await FeatureEnabled("feature.ai_auto_book", ct); + var quota = await quotas.TryConsumeAsync(Uid, ct); + if (!quota.Allowed) + return StatusCode( + StatusCodes.Status429TooManyRequests, + QuotaExceededPayload(quota)); + + var content = req.Content.Trim(); + var now = DateTime.UtcNow; + var userMessage = new ChatMessage + { + UserId = Uid, + Role = ChatRole.User, + Type = req.Type == "sticker" + ? ChatMessageType.Sticker + : ChatMessageType.Text, + Content = content, + CreatedAt = now, + }; + db.ChatMessages.Add(userMessage); + await db.SaveChangesAsync(ct); + + var (_, _, tic, personaPrompt) = await LoadUserConfig(ct); + var replies = new List(); + var transactions = new List(); + + if (userMessage.Type == ChatMessageType.Sticker) + { + var (text, sticker) = await StickerLlmAsync(content, tic, ct); + replies.Add(AssistantText(text, now.AddMilliseconds(1))); + if (sticker is not null) + { + replies.Add(new ChatMessage + { + UserId = Uid, + Role = ChatRole.Assistant, + Type = ChatMessageType.Sticker, + Content = sticker, + CreatedAt = now.AddMilliseconds(2), + }); + } + } + else + { + try + { + var result = await agent.RunAsync( + Uid, + ledgerId.Value, + allowAutoBook, + content, + userMessage, + MakeSys(personaPrompt, tic, ""), + await LoadConversationContext(userMessage.Id, ct), + ct: ct); + transactions.AddRange(result.Transactions); + var reply = string.IsNullOrWhiteSpace(result.Reply) + ? AgentFallback(transactions, tic) + : result.Reply; + replies.Add(AssistantText(reply, now.AddMilliseconds(1))); + } + catch (Exception ex) + { + logger.LogWarning(ex, "Agent chat failed for user {UserId}", Uid); + transactions.AddRange(await TransactionsForMessage( + userMessage.Id, + ct)); + var reply = transactions.Count > 0 + ? AgentFallback(transactions, tic) + : "AI 暂时无法完成这次操作,没有写入任何账单,请稍后重试"; + replies.Add(AssistantText(reply, now.AddMilliseconds(1))); + } + + for (var index = 0; index < transactions.Count; index++) + { + replies.Add(BillCard( + transactions[index].Id, + now.AddMilliseconds(index + 2))); + } + } + + db.ChatMessages.AddRange(replies); + await db.SaveChangesAsync(ct); + var transactionMap = transactions.ToDictionary(t => t.Id); + return Ok(new SendChatResponse( + new[] { userMessage } + .Concat(replies) + .Select(message => ToDto(message, transactionMap)) + .ToList())); + } + + private async Task StreamWithAgent( + SendChatRequest req, + CancellationToken ct) + { + if (string.IsNullOrWhiteSpace(req.Content)) + { + HttpContext.Response.StatusCode = 400; + return; + } + var ledgerId = await ledgers.ResolveAsync(Uid, req.LedgerId, ct); + if (!ledgerId.HasValue) + { + HttpContext.Response.StatusCode = 400; + await HttpContext.Response.WriteAsJsonAsync( + new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问"), + ct); + return; + } + + var quota = await quotas.TryConsumeAsync(Uid, ct); + if (!quota.Allowed) + { + HttpContext.Response.StatusCode = StatusCodes.Status429TooManyRequests; + await HttpContext.Response.WriteAsJsonAsync( + QuotaExceededPayload(quota), + ct); + return; + } + + var allowAutoBook = await FeatureEnabled("feature.ai_auto_book", ct); + var content = req.Content.Trim(); + var now = DateTime.UtcNow; + var userMessage = new ChatMessage + { + UserId = Uid, + Role = ChatRole.User, + Type = ChatMessageType.Text, + Content = content, + CreatedAt = now, + }; + db.ChatMessages.Add(userMessage); + await db.SaveChangesAsync(ct); + + HttpContext.Response.ContentType = "text/event-stream; charset=utf-8"; + HttpContext.Response.Headers["Cache-Control"] = "no-cache, no-transform"; + HttpContext.Response.Headers["Connection"] = "keep-alive"; + HttpContext.Response.Headers["X-Accel-Buffering"] = "no"; + await HttpContext.Response.Body.FlushAsync(ct); + await WriteSsePayload(new { status = "thinking" }, ct); + + var (_, _, tic, personaPrompt) = await LoadUserConfig(ct); + var fullReply = new StringBuilder(); + var transactions = new List(); + var responseDisconnected = false; + try + { + var result = await agent.RunAsync( + Uid, + ledgerId.Value, + allowAutoBook, + content, + userMessage, + MakeSys(personaPrompt, tic, ""), + await LoadConversationContext(userMessage.Id, ct), + async (token, tokenCt) => + { + fullReply.Append(token); + await WriteSse("t", token, tokenCt); + }, + (tool, toolCt) => WriteSsePayload( + new { status = "tool_running", tool }, + toolCt), + ct); + transactions.AddRange(result.Transactions); + if (fullReply.Length == 0 && !string.IsNullOrWhiteSpace(result.Reply)) + fullReply.Append(result.Reply); + } + catch (OperationCanceledException) when (ct.IsCancellationRequested) + { + responseDisconnected = true; + fullReply.Clear(); + transactions.AddRange(await TransactionsForMessage( + userMessage.Id, + CancellationToken.None)); + if (transactions.Count == 0) return; + } + catch (Exception ex) + { + logger.LogWarning(ex, "Streaming agent chat failed for user {UserId}", Uid); + transactions.AddRange(await TransactionsForMessage( + userMessage.Id, + CancellationToken.None)); + } + + if (responseDisconnected || fullReply.Length == 0) + { + var fallback = transactions.Count > 0 + ? AgentFallback(transactions, tic) + : "AI 暂时无法完成这次操作,没有写入任何账单,请稍后重试"; + fullReply.Clear(); + fullReply.Append(fallback); + if (!responseDisconnected) await WriteSse("t", fallback, ct); + } + + var replies = new List + { + AssistantText(fullReply.ToString(), now.AddMilliseconds(1)), + }; + for (var index = 0; index < transactions.Count; index++) + { + replies.Add(BillCard( + transactions[index].Id, + now.AddMilliseconds(index + 2))); + } + + db.ChatMessages.AddRange(replies); + await db.SaveChangesAsync( + responseDisconnected ? CancellationToken.None : ct); + if (responseDisconnected) return; + var transactionMap = transactions.ToDictionary(t => t.Id); + await WriteSsePayload( + new + { + done = true, + messages = replies + .Select(message => ToDto(message, transactionMap)) + .ToList(), + }, + ct); + } + + private static object QuotaExceededPayload(AiChatQuotaStatus quota) => new + { + code = "AI_CHAT_QUOTA_EXCEEDED", + message = $"本周期 AI 对话次数已用完,将于 {ChinaClock.ToLocal(quota.ResetAt):MM月dd日 HH:mm} 重置", + quota = new + { + quota.Limit, + quota.Used, + quota.Remaining, + period = AiChatQuotaService.PeriodKey(quota.Period), + quota.ResetAt, + }, + }; + + private async Task> TransactionsForMessage( + long messageId, + CancellationToken ct) => + await db.Transactions + .Include(transaction => transaction.Category) + .Where(transaction => + transaction.UserId == Uid && + transaction.SourceChatMessageId == messageId) + .OrderBy(transaction => transaction.Id) + .ToListAsync(ct); + + private static string AgentFallback( + IReadOnlyList transactions, + string tic) + { + if (transactions.Count == 0) + return "这句话里的金额或收支方向还不够明确,可以再说具体一点"; + if (transactions.Count == 1) + { + var transaction = transactions[0]; + var type = transaction.Type == TransactionType.Income + ? "收入" + : "支出"; + return $"已记录{type}:{transaction.Category.Name} ¥{transaction.Amount:F2}{tic}"; + } + + var income = transactions + .Where(t => t.Type == TransactionType.Income) + .Sum(t => t.Amount); + var expense = transactions + .Where(t => t.Type == TransactionType.Expense) + .Sum(t => t.Amount); + return $"已记录 {transactions.Count} 笔,其中收入 ¥{income:F2}、支出 ¥{expense:F2}{tic}"; + } + + private ChatMessage AssistantText(string content, DateTime createdAt) => new() + { + UserId = Uid, + Role = ChatRole.Assistant, + Type = ChatMessageType.Text, + Content = content, + CreatedAt = createdAt, + }; + + private ChatMessage BillCard(long transactionId, DateTime createdAt) => new() + { + UserId = Uid, + Role = ChatRole.Assistant, + Type = ChatMessageType.BillCard, + Content = "", + TransactionId = transactionId, + CreatedAt = createdAt, + }; + + private async Task CurrentBoundaryId(CancellationToken ct = default) => + await db.ChatMessages + .Where(m => + m.UserId == Uid && + m.Type == ChatMessageType.ContextBoundary) + .MaxAsync(m => (long?)m.Id, ct) ?? 0; + + private async Task LoadConversationContext( + long beforeMessageId, + CancellationToken ct) + { + var boundaryId = await CurrentBoundaryId(ct); + var messages = await db.ChatMessages + .Where(m => + m.UserId == Uid && + m.Id > boundaryId && + m.Id < beforeMessageId && + m.Type == ChatMessageType.Text && + m.Role != ChatRole.System) + .OrderByDescending(m => m.Id) + .Take(12) + .Select(m => new { m.Role, m.Content }) + .ToListAsync(ct); + if (messages.Count == 0) return string.Empty; + + messages.Reverse(); + var lines = messages.Select(m => + (m.Role == ChatRole.User ? "用户:" : "助手:") + + (m.Content.Length > 240 ? m.Content[..240] : m.Content)); + return "\n当前会话最近消息(仅用于保持上下文,不要重复):\n" + + string.Join("\n", lines); + } + + private async Task WriteSse( + string key, + string value, + CancellationToken ct) + { + var json = JsonSerializer.Serialize( + new Dictionary { [key] = value }, + new JsonSerializerOptions(JsonSerializerDefaults.Web)); + await HttpContext.Response.WriteAsync($"data: {json}\n\n", ct); + await HttpContext.Response.Body.FlushAsync(ct); + } + + private async Task WriteSsePayload(object payload, CancellationToken ct) + { + var json = JsonSerializer.Serialize( + payload, + new JsonSerializerOptions(JsonSerializerDefaults.Web)); + await HttpContext.Response.WriteAsync($"data: {json}\n\n", ct); + await HttpContext.Response.Body.FlushAsync(ct); + } + + private async Task FeatureEnabled(string key, CancellationToken ct) + { + var value = await db.AppConfigs + .Where(config => config.Key == key) + .Select(config => config.Value) + .FirstOrDefaultAsync(ct); + return value is null || !value.Equals("false", StringComparison.OrdinalIgnoreCase); + } + + private async Task<(string PersonaKey, string AvatarKey, string Tic, string? PersonaPrompt)> + LoadUserConfig(CancellationToken ct) + { + var config = await db.AiCompanionSettings + .FirstOrDefaultAsync(s => s.UserId == Uid, ct); + var personaKey = config?.PersonaKey ?? "sassy_cat"; + var avatarKey = config?.AvatarKey ?? "cat"; + var tic = await db.AiAvatars + .Where(a => a.Key == avatarKey) + .Select(a => a.SpeechTic) + .FirstOrDefaultAsync(ct) ?? ""; + var personaPrompt = await db.AiPersonas + .Where(p => p.Key == personaKey && p.IsEnabled) + .Select(p => p.PromptTemplate) + .FirstOrDefaultAsync(ct); + return (personaKey, avatarKey, tic, personaPrompt); + } + + private async Task<(string Text, string? Sticker)> StickerLlmAsync( + string stickerKey, + string tic, + CancellationToken ct) + { + var prompt = stickerKey == "salary" + ? "用户发了发工资的表情。问他发了多少。口癖: " + tic + : "用户发了表情包。简短回复1句话。口癖: " + tic; + var reply = llm.IsEnabled + ? await llm.TryGenerateReplyAsync(prompt, stickerKey, ct) + : null; + return ( + reply ?? (stickerKey == "salary" + ? "发工资了?多少" + tic + : "收到" + tic), + stickerKey == "salary" ? null : "happy"); + } + + private static string MakeSys( + string? personaPrompt, + string tic, + string context) + { + var basePrompt = !string.IsNullOrWhiteSpace(personaPrompt) + ? personaPrompt.Replace("{tic}", tic).Trim() + : "你是记之 AI 助手。回复简短风趣。口癖: " + tic; + return basePrompt + "\n" + context; + } + + private static ChatMessageDto ToDto( + ChatMessage message, + IReadOnlyDictionary transactions) + { + TransactionDto? transaction = null; + if (message.TransactionId.HasValue && + transactions.TryGetValue( + message.TransactionId.Value, + out var value)) + { + transaction = TransactionsController.ToDto( + value, + value.Category); + } + + return new ChatMessageDto( + message.Id, + message.Role == ChatRole.User ? "user" : "assistant", + message.Type switch + { + ChatMessageType.Sticker => "sticker", + ChatMessageType.BillCard => "bill_card", + _ => "text", + }, + message.Content, + transaction, + message.CreatedAt); + } +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/Controllers/LedgersController.cs b/backend/MiaoJiZhang.Api/Controllers/LedgersController.cs new file mode 100644 index 0000000..a3f8e84 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/LedgersController.cs @@ -0,0 +1,269 @@ +using System.Security.Claims; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/ledgers")] +public class LedgersController(AppDbContext db) : ControllerBase +{ + private long Uid => long.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier) ?? User.FindFirstValue("sub")!); + + [HttpGet] + public async Task List() => + Ok(await db.Ledgers.Where(l => l.OwnerId == Uid) + .OrderByDescending(l => l.IsDefault).ThenBy(l => l.CreatedAt) + .Select(l => new { l.Id, l.Name, l.IconKey, l.IsDefault, TxCount = db.Transactions.IgnoreQueryFilters().Count(t => t.LedgerId == l.Id && t.UserId == Uid) }) + .ToListAsync()); + + [HttpPost] + public async Task Create([FromBody] CreateLedgerReq req) + { + if (string.IsNullOrWhiteSpace(req.Name) || req.Name.Length > 12) + return BadRequest(new ApiError("NAME_INVALID", "账本名 1-12 个字")); + var maxCount = int.TryParse((await db.AppConfigs.FirstOrDefaultAsync(c => c.Key == "system.max_ledgers_per_user"))?.Value, out var v) ? v : 10; + if (await db.Ledgers.CountAsync(l => l.OwnerId == Uid) >= maxCount) + return BadRequest(new ApiError("LIMIT_REACHED", $"每人最多 {maxCount} 个账本")); + var ledger = new Ledger { OwnerId = Uid, Name = req.Name.Trim(), IconKey = req.IconKey ?? "wallet" }; + db.Ledgers.Add(ledger); + await db.SaveChangesAsync(); + return Ok(new { ledger.Id, ledger.Name, ledger.IconKey, ledger.IsDefault, TxCount = 0 }); + } + + [HttpPut("{id:long}/default")] + public async Task SetDefault(long id) + { + var target = await db.Ledgers.FirstOrDefaultAsync(l => l.Id == id && l.OwnerId == Uid); + if (target is null) return NotFound(new ApiError("LEDGER_NOT_FOUND", "账本不存在")); + await db.Ledgers.Where(l => l.OwnerId == Uid && l.IsDefault).ExecuteUpdateAsync(s => s.SetProperty(l => l.IsDefault, false)); + target.IsDefault = true; + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpPut("{id:long}")] + public async Task Rename(long id, UpdateLedgerReq req) + { + if (string.IsNullOrWhiteSpace(req.Name) || req.Name.Trim().Length > 12) + return BadRequest(new ApiError("NAME_INVALID", "账本名 1-12 个字")); + var ledger = await db.Ledgers.FirstOrDefaultAsync(l => l.Id == id && l.OwnerId == Uid); + if (ledger is null) return NotFound(new ApiError("LEDGER_NOT_FOUND", "账本不存在")); + ledger.Name = req.Name.Trim(); + if (!string.IsNullOrWhiteSpace(req.IconKey)) ledger.IconKey = req.IconKey.Trim(); + await db.SaveChangesAsync(); + return Ok(new LedgerDto(ledger.Id, ledger.Name, ledger.IconKey, ledger.IsDefault)); + } + + [HttpPut("reorder")] + public async Task Reorder(ReorderCategoriesRequest req) + { + if (req.Type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + if (req.CategoryIds.Count != req.CategoryIds.Distinct().Count()) + return BadRequest(new ApiError("ORDER_INVALID", "分类排序中存在重复项")); + + var type = req.Type == "income" + ? TransactionType.Income + : TransactionType.Expense; + var categories = await db.Categories + .Where(c => c.UserId == Uid && c.Type == type && !c.IsDeleted) + .ToListAsync(); + if (categories.Count != req.CategoryIds.Count || + categories.Select(c => c.Id).ToHashSet() + .SetEquals(req.CategoryIds) is false) + return BadRequest(new ApiError("ORDER_INVALID", "请提交完整的自定义分类顺序")); + + var byId = categories.ToDictionary(c => c.Id); + for (var index = 0; index < req.CategoryIds.Count; index++) + byId[req.CategoryIds[index]].SortOrder = 1000 + index; + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpDelete("{id:long}")] + public async Task Delete(long id) + { + var ledger = await db.Ledgers.FirstOrDefaultAsync(l => l.Id == id && l.OwnerId == Uid); + if (ledger is null) return NotFound(new ApiError("LEDGER_NOT_FOUND", "账本不存在")); + if (ledger.IsDefault) + return Conflict(new ApiError("DEFAULT_LEDGER", "默认账本不能删除,请先切换到其他账本")); + var hasTransactions = await db.Transactions.IgnoreQueryFilters() + .AnyAsync(t => t.UserId == Uid && t.LedgerId == id); + var hasBudgets = await db.Budgets.AnyAsync(b => b.UserId == Uid && b.LedgerId == id); + if (hasTransactions || hasBudgets) + return Conflict(new ApiError("LEDGER_NOT_EMPTY", "仅可删除没有账单和预算的账本")); + db.Ledgers.Remove(ledger); + await db.SaveChangesAsync(); + return NoContent(); + } +} + +public record CreateLedgerReq(string Name, string? IconKey); +public record UpdateLedgerReq(string Name, string? IconKey); + +[ApiController] +[Authorize] +[Route("api/categories")] +public class CategoriesController(AppDbContext db) : ControllerBase +{ + internal static readonly HashSet AllowedIcons = + [ + "food", "cup", "cart", "house", "rent", "metro", "car", "plane", + "phone", "wifi", "shirt", "beauty", "pill", "sport", "book", "baby", + "pet", "game", "gift", "wallet", "money", "briefcase", "chart", + "interest", "refund", "card", "insurance", "tax", "receipt", + "camera", "target", "sparkle", "tag", + ]; + + internal static readonly HashSet AllowedColors = + [ + "mint", "teal", "aqua", "cyan", "sky", "blue", + "navy", "indigo", "violet", "plum", "orchid", "rose", + "coral", "red", "orange", "amber", "peach", "sand", + "lime", "olive", "forest", "slate", "cocoa", "graphite", + ]; + + private long Uid => long.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier) ?? User.FindFirstValue("sub")!); + + internal static string NormalizeIcon(string? iconKey) => iconKey?.Trim() switch + { + "shopping" => "cart", + "transport" => "metro", + "home" => "house", + "salary" => "money", + { Length: > 0 } value => value, + _ => "tag", + }; + + [HttpGet] + public async Task>> List([FromQuery] string type = "expense") + { + if (type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + var t = type == "income" ? TransactionType.Income : TransactionType.Expense; + var list = await db.Categories + .Where(c => !c.IsDeleted && c.Type == t && (c.UserId == null || c.UserId == Uid)) + .OrderBy(c => c.SortOrder) + .Select(c => new CategoryDto( + c.Id, c.Name, c.IconKey, type, + c.SortOrder, c.UserId != null, c.ColorKey)) + .ToListAsync(); + return Ok(list); + } + + [HttpPost] + public async Task> Create(CreateCategoryRequest req) + { + if (string.IsNullOrWhiteSpace(req.Name) || req.Name.Length > 8) + return BadRequest(new ApiError("NAME_INVALID", "分类名 1-8 个字")); + if (req.Type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + var t = req.Type == "income" ? TransactionType.Income : TransactionType.Expense; + var iconKey = NormalizeIcon(req.IconKey); + if (!AllowedIcons.Contains(iconKey)) + return BadRequest(new ApiError("ICON_INVALID", "分类图标不存在")); + var colorKey = string.IsNullOrWhiteSpace(req.ColorKey) + ? "mint" + : req.ColorKey.Trim(); + if (!AllowedColors.Contains(colorKey)) + return BadRequest(new ApiError("COLOR_INVALID", "分类颜色不存在")); + if (await db.Categories.AnyAsync(c => !c.IsDeleted && c.Type == t && c.Name == req.Name && (c.UserId == null || c.UserId == Uid))) + return Conflict(new ApiError("NAME_TAKEN", "分类已存在")); + var maxSort = await db.Categories + .Where(c => c.Type == t && (c.UserId == null || c.UserId == Uid)) + .MaxAsync(c => (int?)c.SortOrder) ?? 0; + var cat = new Category + { + UserId = Uid, + Type = t, + Name = req.Name.Trim(), + IconKey = iconKey, + ColorKey = colorKey, + SortOrder = Math.Max(999, maxSort) + 1, + }; + db.Categories.Add(cat); + await db.SaveChangesAsync(); + return Ok(new CategoryDto( + cat.Id, cat.Name, cat.IconKey, req.Type, + cat.SortOrder, true, cat.ColorKey)); + } + + [HttpPut("{id:long}")] + public async Task> Update(long id, UpdateCategoryRequest req) + { + if (string.IsNullOrWhiteSpace(req.Name) || req.Name.Trim().Length > 8) + return BadRequest(new ApiError("NAME_INVALID", "分类名 1-8 个字")); + var category = await db.Categories.FirstOrDefaultAsync(c => + c.Id == id && c.UserId == Uid && !c.IsDeleted); + if (category is null) + return NotFound(new ApiError("CATEGORY_NOT_FOUND", "分类不存在或非自定义分类")); + var name = req.Name.Trim(); + if (await db.Categories.AnyAsync(c => c.Id != id && !c.IsDeleted && + c.Type == category.Type && c.Name == name && + (c.UserId == null || c.UserId == Uid))) + return Conflict(new ApiError("NAME_TAKEN", "分类已存在")); + var iconKey = NormalizeIcon(req.IconKey); + if (!AllowedIcons.Contains(iconKey)) + return BadRequest(new ApiError("ICON_INVALID", "分类图标不存在")); + var colorKey = req.ColorKey is null + ? category.ColorKey + : req.ColorKey.Trim(); + if (!AllowedColors.Contains(colorKey)) + return BadRequest(new ApiError("COLOR_INVALID", "分类颜色不存在")); + category.Name = name; + category.IconKey = iconKey; + category.ColorKey = colorKey; + category.SortOrder = Math.Max(1000, req.SortOrder); + await db.SaveChangesAsync(); + return Ok(new CategoryDto( + category.Id, category.Name, category.IconKey, + category.Type == TransactionType.Income ? "income" : "expense", + category.SortOrder, true, category.ColorKey)); + } + + [HttpPut("reorder")] + public async Task Reorder(ReorderCategoriesRequest req) + { + if (req.Type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + if (req.CategoryIds.Count != req.CategoryIds.Distinct().Count()) + return BadRequest(new ApiError("ORDER_INVALID", "分类排序中存在重复项")); + + var type = req.Type == "income" + ? TransactionType.Income + : TransactionType.Expense; + var categories = await db.Categories + .Where(c => c.UserId == Uid && c.Type == type && !c.IsDeleted) + .ToListAsync(); + if (categories.Count != req.CategoryIds.Count || + categories.Select(c => c.Id).ToHashSet() + .SetEquals(req.CategoryIds) is false) + return BadRequest(new ApiError("ORDER_INVALID", "请提交完整的自定义分类顺序")); + + var byId = categories.ToDictionary(c => c.Id); + for (var index = 0; index < req.CategoryIds.Count; index++) + byId[req.CategoryIds[index]].SortOrder = 1000 + index; + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpDelete("{id:long}")] + public async Task Delete(long id) + { + var cat = await db.Categories.FirstOrDefaultAsync(c => c.Id == id && c.UserId == Uid); + if (cat is null) return NotFound(new ApiError("CATEGORY_NOT_FOUND", "分类不存在或非自定义分类")); + cat.IsDeleted = true; + await db.SaveChangesAsync(); + return NoContent(); + } +} + +public record ReorderCategoriesRequest(string Type, List CategoryIds); + diff --git a/backend/MiaoJiZhang.Api/Controllers/ParseController.cs b/backend/MiaoJiZhang.Api/Controllers/ParseController.cs new file mode 100644 index 0000000..237c3e8 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/ParseController.cs @@ -0,0 +1,239 @@ +using System.Security.Claims; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.RateLimiting; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +/// +/// OCR/语音/图片辅助解析。客户端确认后再调用交易接口正式入账。 +/// 图片模式由后端多模态模型提取一笔或多笔账单草稿。 +/// +[ApiController] +[Authorize] +[Route("api/parse")] +[RequireAiPermission] +public class ParseController(AppDbContext db, ILlmClient llm, AgentService agent) : ControllerBase +{ + private long Uid => long.Parse( + User.FindFirstValue(ClaimTypes.NameIdentifier) ?? + User.FindFirstValue("sub")!); + + [HttpPost] + [EnableRateLimiting("ai")] + public async Task> Parse(OcrParseRequest req) + { + return await ParseWithAgent(req, HttpContext.RequestAborted); + } + + private async Task> ParseWithAgent( + OcrParseRequest req, + CancellationToken ct) + { + if (string.IsNullOrWhiteSpace(req.Text)) + return BadRequest(new ApiError("TEXT_EMPTY", "内容不能为空")); + var featureKey = req.Source == "voice" + ? "feature.voice_enabled" + : "feature.ocr_enabled"; + if (!await FeatureEnabled(featureKey)) + return StatusCode(403, new ApiError("FEATURE_DISABLED", "该解析功能已由后台关闭")); + + IReadOnlyList drafts; + try + { + drafts = await agent.ParseDraftsAsync(Uid, req.Text.Trim(), ct); + } + catch (InvalidOperationException ex) + { + return StatusCode( + 503, + new ApiError("AGENT_PARSE_UNAVAILABLE", ex.Message)); + } + catch (Exception) + { + return StatusCode( + 502, + new ApiError( + "AGENT_PARSE_FAILED", + "AI 暂时无法解析,没有生成账单草稿")); + } + + if (drafts.Count == 0) + { + var fallback = await db.Categories.FirstAsync( + c => c.Name == "其他" && + c.Type == TransactionType.Expense && + c.UserId == null, + ct); + return Ok(new OcrParseResponse( + false, + fallback.Id, + fallback.Name, + fallback.IconKey, + 0, + null, + req.Text, + "expense")); + } + + var bill = drafts[0]; + var category = await db.Categories.FirstAsync( + c => c.Id == bill.CategoryId && c.Type == bill.Type, + ct); + return Ok(new OcrParseResponse( + true, + category.Id, + category.Name, + category.IconKey, + bill.Amount, + bill.PaymentMethod, + bill.Note, + bill.Type == TransactionType.Income ? "income" : "expense")); + } + + /// 上传截屏或小票,提取其中全部独立交易。 + [HttpPost("image")] + [EnableRateLimiting("upload")] + [RequestSizeLimit(10 * 1024 * 1024)] + [RequestFormLimits(MultipartBodyLengthLimit = 10 * 1024 * 1024)] + public async Task> ParseImage( + IFormFile file, + [FromQuery] string source = "image", + CancellationToken ct = default) + { + var featureKey = source == "screenshot" + ? "feature.screenshot_bookkeeping_enabled" + : "feature.ocr_enabled"; + if (!await FeatureEnabled(featureKey)) + return StatusCode(403, new ApiError("FEATURE_DISABLED", "该图片识别功能已由后台关闭")); + if (file is null || file.Length == 0) + return BadRequest(new ApiError("FILE_EMPTY", "请上传图片")); + if (!file.ContentType.StartsWith("image/")) + return BadRequest(new ApiError("NOT_IMAGE", "仅支持图片文件")); + if (file.Length > 10 * 1024 * 1024) + return BadRequest(new ApiError("FILE_TOO_LARGE", "图片不能超过 10MB")); + + if (!llm.IsEnabled) + { + return StatusCode( + 503, + new ApiError( + "LLM_NOT_CONFIGURED", + "AI 图片解析未配置,请在管理后台设置 LLM API Key")); + } + + using var stream = new MemoryStream(); + await file.CopyToAsync(stream, ct); + + IReadOnlyList? results; + try + { + results = await llm.AnalyzeImageAsync( + stream.ToArray(), + file.ContentType, + ct); + } + catch (InvalidOperationException ex) + { + return StatusCode(502, new ApiError("LLM_IMAGE_ERROR", ex.Message)); + } + + if (results is null) + return StatusCode(500, new ApiError("LLM_ERROR", "AI 解析失败,请稍后重试")); + + var categories = await db.Categories + .Where(c => !c.IsDeleted && (c.UserId == null || c.UserId == Uid)) + .ToListAsync(ct); + + if (results.Count == 0) + { + return Ok(new ImageParseResponse( + false, + 0, + "待确认", + "tag", + 0, + null, + "", + "unknown", + [], + null)); + } + + var items = new List(); + foreach (var result in results.Take(20)) + { + var normalizedType = result.Type.Trim().ToLowerInvariant(); + if (normalizedType is not ("income" or "expense")) + { + items.Add(new ImageParseItemResponse( + false, 0, "待确认", "tag", "unknown", + result.Amount, result.PaymentMethod, result.Note, + result.OccurredAt)); + continue; + } + var type = normalizedType == "income" + ? TransactionType.Income + : TransactionType.Expense; + var category = FindCategory(categories, type, result.CategoryName); + items.Add(new ImageParseItemResponse( + true, + category.Id, + category.Name, + category.IconKey, + normalizedType, + result.Amount, + result.PaymentMethod, + result.Note, + result.OccurredAt)); + } + + var first = items[0]; + return Ok(new ImageParseResponse( + true, + first.CategoryId, + first.CategoryName, + first.CategoryIcon, + first.Amount, + first.PaymentMethod, + first.Note, + first.Type, + items, + first.OccurredAt)); + } + + private async Task FeatureEnabled(string key) + { + var value = await db.AppConfigs + .Where(config => config.Key == key) + .Select(config => config.Value) + .FirstOrDefaultAsync(); + return value is null || !value.Equals("false", StringComparison.OrdinalIgnoreCase); + } + + private Category FindCategory( + List categories, + TransactionType type, + string requestedName) + { + if (type == TransactionType.Income && + requestedName is "退款" or "返现" or "退回") + { + requestedName = "报销"; + } + return categories + .Where(c => c.Type == type && c.Name == requestedName) + .OrderByDescending(c => c.UserId == Uid) + .FirstOrDefault() + ?? categories.First( + c => c.Type == type && + c.Name == "其他" && + c.UserId == null); + } +} diff --git a/backend/MiaoJiZhang.Api/Controllers/PublicConfigController.cs b/backend/MiaoJiZhang.Api/Controllers/PublicConfigController.cs new file mode 100644 index 0000000..b87768e --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/PublicConfigController.cs @@ -0,0 +1,49 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +/// 公开配置:前端拉取品牌信息、可用形象/性格列表(无需管理员权限) +[ApiController] +[Route("api/public")] +public class PublicConfigController(AppDbContext db) : ControllerBase +{ + /// 品牌配置(App 名称、Slogan、Logo) + [HttpGet("brand")] + public async Task Brand() + { + var configs = await db.AppConfigs + .Where(c => c.Key.StartsWith("brand.") || c.Key.StartsWith("feature.")) + .ToDictionaryAsync(c => c.Key, c => c.Value); + bool Enabled(string key) => + !configs.TryGetValue(key, out var value) || + !value.Equals("false", StringComparison.OrdinalIgnoreCase); + return Ok(new + { + appName = configs.GetValueOrDefault("brand.app_name", "记之"), + slogan = configs.GetValueOrDefault("brand.slogan", ""), + logoUrl = configs.GetValueOrDefault("brand.logo_url", ""), + features = new + { + voice = Enabled("feature.voice_enabled"), + image = Enabled("feature.ocr_enabled"), + screenshot = Enabled("feature.screenshot_bookkeeping_enabled"), + stickers = Enabled("feature.sticker_enabled"), + aiAutoBook = Enabled("feature.ai_auto_book"), + }, + }); + } + + /// 可用的 AI 形象列表(按 Key 排序) + [HttpGet("avatars")] + public async Task Avatars() => + Ok(await db.AiAvatars.Where(a => a.IsEnabled).OrderBy(a => a.Key) + .Select(a => new { a.Key, a.DefaultName, a.SpeechTic, a.ImageUrl }).ToListAsync()); + + /// 可用的 AI 性格列表(按 Key 排序) + [HttpGet("personas")] + public async Task Personas() => + Ok(await db.AiPersonas.Where(p => p.IsEnabled).OrderBy(p => p.Key) + .Select(p => new { p.Key, p.Name, p.Description, p.SampleLine }).ToListAsync()); +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/Controllers/ReportsController.cs b/backend/MiaoJiZhang.Api/Controllers/ReportsController.cs new file mode 100644 index 0000000..c2ee26d --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/ReportsController.cs @@ -0,0 +1,284 @@ +using System.Security.Claims; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/reports")] +public class ReportsController( + AppDbContext db, + ReplyService reply, + LedgerResolver ledgers, + AiPermissionService aiPermissions) : ControllerBase +{ + private long Uid => long.Parse( + User.FindFirstValue(ClaimTypes.NameIdentifier) ?? + User.FindFirstValue("sub")!); + + [HttpGet("weekly")] + public async Task> Weekly( + [FromQuery] DateTime? date = null, + [FromQuery] long? ledgerId = null) + { + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError( + "LEDGER_NOT_FOUND", + "账本不存在或无权访问")); + + var selected = DateTime.SpecifyKind( + (date ?? ChinaClock.Now).Date, + DateTimeKind.Unspecified); + var (start, end) = ChinaClock.WeekRangeUtc(selected); + var localStart = ChinaClock.ToLocal(start).Date; + var localEnd = ChinaClock.ToLocal(end).Date.AddDays(-1); + return Ok(await BuildAsync( + resolvedLedgerId.Value, + start, + end, + "weekly", + $"{localStart:MM月dd日} - {localEnd:MM月dd日}", + groupByMonth: false)); + } + + [HttpGet("monthly")] + public async Task> Monthly( + [FromQuery] int year, + [FromQuery] int month, + [FromQuery] long? ledgerId = null) + { + if (month is < 1 or > 12) + return BadRequest(new ApiError("MONTH_INVALID", "月份无效")); + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError( + "LEDGER_NOT_FOUND", + "账本不存在或无权访问")); + + var (start, end) = ChinaClock.MonthRangeUtc(year, month); + var report = await BuildAsync( + resolvedLedgerId.Value, + start, + end, + "monthly", + $"{year}年{month}月", + groupByMonth: false); + return Ok(new MonthlyReportDto( + year, + month, + report.Income, + report.Expense, + report.Balance, + report.Count, + report.AiRatio, + report.PeakLabel, + report.PeakAmount, + report.PeakNote, + report.TopCategory, + report.TopCategoryAmount, + report.TopCategoryPercent, + report.CategoryRanking, + report.Commentary)); + } + + [HttpGet("yearly")] + public async Task> Yearly( + [FromQuery] int year, + [FromQuery] long? ledgerId = null) + { + if (year is < 2000 or > 2200) + return BadRequest(new ApiError("YEAR_INVALID", "年份无效")); + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError( + "LEDGER_NOT_FOUND", + "账本不存在或无权访问")); + + var (start, end) = ChinaClock.YearRangeUtc(year); + return Ok(await BuildAsync( + resolvedLedgerId.Value, + start, + end, + "yearly", + $"{year}年", + groupByMonth: true)); + } + + private async Task BuildAsync( + long ledgerId, + DateTime start, + DateTime end, + string periodType, + string periodLabel, + bool groupByMonth) + { + var list = await db.Transactions + .Include(transaction => transaction.Category) + .Where(transaction => + transaction.UserId == Uid && + transaction.LedgerId == ledgerId && + transaction.OccurredAt >= start && + transaction.OccurredAt < end) + .ToListAsync(); + + var income = list + .Where(transaction => transaction.Type == TransactionType.Income) + .Sum(transaction => transaction.Amount); + var expenses = list + .Where(transaction => transaction.Type == TransactionType.Expense) + .ToList(); + var expense = expenses.Sum(transaction => transaction.Amount); + var aiCount = list.Count( + transaction => transaction.Source.IsAiAssisted()); + var aiRatio = list.Count == 0 + ? 0 + : (double)aiCount / list.Count * 100; + + var peak = expenses + .GroupBy(transaction => + { + var local = ChinaClock.ToLocal(transaction.OccurredAt); + return groupByMonth + ? new DateTime(local.Year, local.Month, 1) + : local.Date; + }) + .OrderByDescending(group => group.Sum(item => item.Amount)) + .FirstOrDefault(); + var categoryRanking = expenses + .GroupBy(transaction => new + { + transaction.Category.Name, + transaction.Category.IconKey, + transaction.Category.ColorKey, + }) + .Select(group => new CategoryRankDto( + group.Key.Name, + group.Key.IconKey, + group.Sum(item => item.Amount), + expense == 0 + ? 0 + : (double)(group.Sum(item => item.Amount) / expense * 100), + group.Key.ColorKey)) + .OrderByDescending(item => item.Amount) + .ThenBy(item => item.Name) + .Take(5) + .ToList(); + var topCategory = categoryRanking.FirstOrDefault(); + + var commentary = await aiPermissions.IsEnabledAsync(Uid, HttpContext.RequestAborted) + ? await reply.PeriodRoastAsync( + Uid, + periodType switch + { + "weekly" => "这周", + "yearly" => "这一年", + _ => "这个月", + }, + income, + expense, + topCategory?.Name ?? "无", + topCategory?.Amount ?? 0) + : string.Empty; + + var localStart = ChinaClock.ToLocal(start).Date; + var localEnd = ChinaClock.ToLocal(end).Date; + return new PeriodReportDto( + periodType, + periodLabel, + localStart, + localEnd, + income, + expense, + income - expense, + list.Count, + aiRatio, + peak is null + ? null + : groupByMonth + ? $"{peak.Key.Month}月" + : $"{peak.Key.Month}月{peak.Key.Day}日", + peak?.Sum(item => item.Amount) ?? 0, + peak?.OrderByDescending(item => item.Amount).First().Note, + topCategory?.Name, + topCategory?.Amount ?? 0, + expense == 0 || topCategory is null + ? 0 + : (double)(topCategory.Amount / expense * 100), + categoryRanking, + commentary); + } +} +[ApiController] +[Authorize] +[Route("api/search")] +public class SearchController(AppDbContext db, LedgerResolver ledgers) : ControllerBase +{ + private long Uid => long.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier) ?? User.FindFirstValue("sub")!); + + /// 账单搜索:过滤全部在数据库执行,使用时间和 ID 作为稳定游标。 + [HttpGet] + public async Task>> Search( + [FromQuery] string? q, + [FromQuery] long? ledgerId, + [FromQuery] long? categoryId, + [FromQuery] string? type, + [FromQuery] decimal? minAmount, + [FromQuery] decimal? maxAmount, + [FromQuery] DateTime? from, + [FromQuery] DateTime? to, + [FromQuery] bool aiOnly = false, + [FromQuery] DateTime? beforeOccurredAt = null, + [FromQuery] long? beforeId = null, + [FromQuery] int limit = 50) + { + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + if (type is not null && type is not ("income" or "expense")) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + + var query = db.Transactions.Include(t => t.Category) + .Where(t => t.UserId == Uid && t.LedgerId == resolvedLedgerId.Value); + if (!string.IsNullOrWhiteSpace(q)) + { + var keyword = q.Trim(); + query = query.Where(t => + (t.Note != null && t.Note.Contains(keyword)) || + t.Category.Name.Contains(keyword) || + (t.SourceText != null && t.SourceText.Contains(keyword))); + } + if (categoryId.HasValue) query = query.Where(t => t.CategoryId == categoryId.Value); + if (type == "income") query = query.Where(t => t.Type == TransactionType.Income); + if (type == "expense") query = query.Where(t => t.Type == TransactionType.Expense); + if (minAmount.HasValue) query = query.Where(t => t.Amount >= minAmount.Value); + if (maxAmount.HasValue) query = query.Where(t => t.Amount <= maxAmount.Value); + if (from.HasValue) query = query.Where(t => t.OccurredAt >= NormalizeTime(from.Value)); + if (to.HasValue) query = query.Where(t => t.OccurredAt < NormalizeTime(to.Value)); + if (aiOnly) query = query.Where(t => TransactionSourceRules.AiAssisted.Contains(t.Source)); + if (beforeOccurredAt.HasValue) + { + var cursorTime = NormalizeTime(beforeOccurredAt.Value); + query = query.Where(t => + t.OccurredAt < cursorTime || + (t.OccurredAt == cursorTime && (!beforeId.HasValue || t.Id < beforeId.Value))); + } + + var list = await query + .OrderByDescending(t => t.OccurredAt) + .ThenByDescending(t => t.Id) + .Take(Math.Clamp(limit, 1, 100)) + .ToListAsync(); + return Ok(list.Select(t => TransactionsController.ToDto(t, t.Category)).ToList()); + } + + private static DateTime NormalizeTime(DateTime value) => + value.Kind == DateTimeKind.Utc ? value : ChinaClock.ToUtc(value); +} + diff --git a/backend/MiaoJiZhang.Api/Controllers/TransactionsController.cs b/backend/MiaoJiZhang.Api/Controllers/TransactionsController.cs new file mode 100644 index 0000000..5b399ff --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/TransactionsController.cs @@ -0,0 +1,544 @@ +using System.Security.Claims; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/transactions")] +public class TransactionsController(AppDbContext db, LedgerResolver ledgers) : ControllerBase +{ + private long Uid => long.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier) ?? User.FindFirstValue("sub")!); + + /// 手动记一笔 + [HttpPost] + public async Task> Create(CreateTransactionRequest req) + { + if (req.Amount <= 0) return BadRequest(new ApiError("AMOUNT_INVALID", "金额必须大于 0")); + var type = ParseType(req.Type); + if (!type.HasValue) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + + var clientRequestId = string.IsNullOrWhiteSpace(req.ClientRequestId) + ? null + : req.ClientRequestId.Trim(); + if (clientRequestId?.Length > 64) + return BadRequest(new ApiError("CLIENT_REQUEST_ID_INVALID", "幂等标识最长 64 个字符")); + if (clientRequestId != null) + { + var existing = await db.Transactions + .Include(t => t.Category) + .FirstOrDefaultAsync(t => + t.UserId == Uid && t.ClientRequestId == clientRequestId); + if (existing is not null) return Ok(ToDto(existing, existing.Category)); + } + + var ledgerId = await ledgers.ResolveAsync(Uid, req.LedgerId); + if (!ledgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + + var cat = await db.Categories.FirstOrDefaultAsync(c => + c.Id == req.CategoryId && !c.IsDeleted && c.Type == type.Value && + (c.UserId == null || c.UserId == Uid)); + if (cat is null) return BadRequest(new ApiError("CATEGORY_TYPE_MISMATCH", "分类与收支类型不一致")); + + var tx = new Transaction + { + LedgerId = ledgerId.Value, + UserId = Uid, + CategoryId = cat.Id, + OccurredAt = req.OccurredAt.HasValue + ? NormalizeOccurredAt(req.OccurredAt.Value) + : DateTime.UtcNow, + Type = type.Value, + Amount = req.Amount, + Note = req.Note, + PaymentMethod = req.PaymentMethod, + Source = req.Source switch + { + "voice" => TransactionSource.Voice, + "ocr" => TransactionSource.ReceiptOcr, + "screenshot" => TransactionSource.Screenshot, + "accessibility" => TransactionSource.Accessibility, + "notification" => TransactionSource.Notification, + "recognition_ai" => TransactionSource.RecognitionAi, + "local_ocr" => TransactionSource.LocalOcr, + _ => TransactionSource.Manual, + }, + SourceText = req.SourceText, + ClientRequestId = clientRequestId, + CreatedAt = DateTime.UtcNow, + UpdatedAt = DateTime.UtcNow, + }; + db.Transactions.Add(tx); + try + { + await db.SaveChangesAsync(); + return Ok(ToDto(tx, cat)); + } + catch (DbUpdateException) when (clientRequestId is not null) + { + // Another channel may have committed the same recognition candidate + // after the initial lookup. Resolve the unique-key race as idempotent success. + db.Entry(tx).State = EntityState.Detached; + var existing = await db.Transactions + .AsNoTracking() + .Include(t => t.Category) + .FirstOrDefaultAsync(t => + t.UserId == Uid && t.ClientRequestId == clientRequestId); + if (existing is not null) return Ok(ToDto(existing, existing.Category)); + throw; + } + } + + /// 账单详情(P11:AI 来源追溯、分类、备注、时间) + [HttpGet("{id:long}")] + public async Task> Detail(long id) + { + var tx = await db.Transactions.Include(t => t.Category) + .FirstOrDefaultAsync(t => t.Id == id && t.UserId == Uid); + if (tx is null) return NotFound(new ApiError("TX_NOT_FOUND", "账单不存在")); + return Ok(ToDto(tx, tx.Category)); + } + + [HttpPut("{id:long}")] + public async Task> Update(long id, UpdateTransactionRequest req) + { + if (req.Amount <= 0) return BadRequest(new ApiError("AMOUNT_INVALID", "金额必须大于 0")); + var type = ParseType(req.Type); + if (!type.HasValue) + return BadRequest(new ApiError("TYPE_INVALID", "收支类型必须是 expense 或 income")); + var ledgerId = await ledgers.ResolveAsync(Uid, req.LedgerId); + if (!ledgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var category = await db.Categories.FirstOrDefaultAsync(c => + c.Id == req.CategoryId && !c.IsDeleted && c.Type == type.Value && + (c.UserId == null || c.UserId == Uid)); + if (category is null) return BadRequest(new ApiError("CATEGORY_TYPE_MISMATCH", "分类与收支类型不一致")); + var tx = await db.Transactions.FirstOrDefaultAsync(t => t.Id == id && t.UserId == Uid); + if (tx is null) return NotFound(new ApiError("TX_NOT_FOUND", "账单不存在")); + + if (HasVersionConflict(tx, req.BaseUpdatedAt)) + return Conflict(new + { + code = "SYNC_CONFLICT", + message = "账单已在其他设备修改,请选择保留本地或云端版本", + server = ToDto(tx, await db.Categories.FindAsync(tx.CategoryId) ?? category), + }); + tx.LedgerId = ledgerId.Value; + tx.CategoryId = category.Id; + tx.Category = category; + tx.Type = type.Value; + tx.Amount = req.Amount; + tx.Note = req.Note?.Trim(); + tx.PaymentMethod = req.PaymentMethod?.Trim(); + tx.OccurredAt = NormalizeOccurredAt(req.OccurredAt); + tx.UpdatedAt = DateTime.UtcNow; + await db.SaveChangesAsync(); + return Ok(ToDto(tx, category)); + } + + /// 撤销/删除(软删除,决策 18) + [HttpDelete("{id:long}")] + public async Task Delete(long id, [FromQuery] DateTime? baseUpdatedAt = null) + { + var tx = await db.Transactions.FirstOrDefaultAsync(t => t.Id == id && t.UserId == Uid); + if (tx is null) return NotFound(new ApiError("TX_NOT_FOUND", "账单不存在")); + if (HasVersionConflict(tx, baseUpdatedAt)) + return Conflict(new + { + code = "SYNC_CONFLICT", + message = "账单已在其他设备修改,请确认后再删除", + server = ToDto(tx, await db.Categories.FindAsync(tx.CategoryId) ?? tx.Category), + }); tx.IsDeleted = true; + tx.DeletedAt = DateTime.UtcNow; + tx.UpdatedAt = DateTime.UtcNow; + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpGet("recycle-bin")] + public async Task>> RecycleBin( + [FromQuery] long? ledgerId = null, + [FromQuery] long? beforeId = null, + [FromQuery] int limit = 50) + { + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var query = db.Transactions + .IgnoreQueryFilters() + .Include(t => t.Category) + .Where(t => t.UserId == Uid && t.LedgerId == resolvedLedgerId.Value && t.IsDeleted); + if (beforeId.HasValue) query = query.Where(t => t.Id < beforeId.Value); + var items = await query.OrderByDescending(t => t.DeletedAt) + .ThenByDescending(t => t.Id) + .Take(Math.Clamp(limit, 1, 100)) + .ToListAsync(); + return Ok(items.Select(t => ToDto(t, t.Category)).ToList()); + } + + [HttpPost("{id:long}/restore")] + public async Task> Restore(long id, [FromQuery] DateTime? baseUpdatedAt = null) + { + var tx = await db.Transactions.IgnoreQueryFilters().Include(t => t.Category) + .FirstOrDefaultAsync(t => t.Id == id && t.UserId == Uid && t.IsDeleted); + if (tx is null) return NotFound(new ApiError("TX_NOT_FOUND", "回收站中没有这笔账单")); + if (HasVersionConflict(tx, baseUpdatedAt)) + return Conflict(new + { + code = "SYNC_CONFLICT", + message = "账单已在其他设备修改,请确认后再恢复", + server = ToDto(tx, tx.Category), + }); tx.IsDeleted = false; + tx.DeletedAt = null; + tx.UpdatedAt = DateTime.UtcNow; + await db.SaveChangesAsync(); + return Ok(ToDto(tx, tx.Category)); + } + + [HttpDelete("{id:long}/permanent")] + public async Task PermanentDelete(long id) + { + var tx = await db.Transactions.IgnoreQueryFilters() + .FirstOrDefaultAsync(t => t.Id == id && t.UserId == Uid && t.IsDeleted); + if (tx is null) return NotFound(new ApiError("TX_NOT_FOUND", "回收站中没有这笔账单")); + await PermanentDeleteCore(tx); + await db.SaveChangesAsync(); + return NoContent(); + } + + [HttpDelete("recycle-bin")] + public async Task ClearRecycleBin([FromQuery] long? ledgerId = null) + { + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var items = await db.Transactions.IgnoreQueryFilters() + .Where(t => t.UserId == Uid && t.LedgerId == resolvedLedgerId.Value && t.IsDeleted) + .ToListAsync(); + foreach (var item in items) await PermanentDeleteCore(item); + await db.SaveChangesAsync(); + return NoContent(); + } + + /// 月账单(按日分组,首页明细用) + [HttpGet("month")] + public async Task> Month([FromQuery] int year, [FromQuery] int month, [FromQuery] long? ledgerId = null) + { + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var (start, end) = ChinaClock.MonthRangeUtc(year, month); + + var q = db.Transactions + .Include(t => t.Category) + .Where(t => t.UserId == Uid && t.LedgerId == resolvedLedgerId.Value && + t.OccurredAt >= start && t.OccurredAt < end); + + var list = await q.OrderByDescending(t => t.OccurredAt).ToListAsync(); + + var income = list.Where(t => t.Type == TransactionType.Income).Sum(t => t.Amount); + var expense = list.Where(t => t.Type == TransactionType.Expense).Sum(t => t.Amount); + + var days = list + .GroupBy(t => DateOnly.FromDateTime(ChinaClock.ToLocal(t.OccurredAt))) + .OrderByDescending(g => g.Key) + .Select(g => new DailyGroupDto( + g.Key, + g.Where(t => t.Type == TransactionType.Expense).Sum(t => t.Amount), + g.Where(t => t.Type == TransactionType.Income).Sum(t => t.Amount), + g.Select(t => ToDto(t, t.Category)).ToList())) + .ToList(); + + return Ok(new MonthSummaryDto(year, month, income, expense, income - expense, list.Count, days)); + } + + /// 月统计(统计页:分类占比 + 每日趋势 + AI 分析) + [HttpGet("stats")] + public async Task> Stats( + [FromQuery] int year, + [FromQuery] int month, + [FromQuery] long? ledgerId = null) + { + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError("LEDGER_NOT_FOUND", "账本不存在或无权访问")); + var (start, end) = ChinaClock.MonthRangeUtc(year, month); + var daysInMonth = DateTime.DaysInMonth(year, month); + + var list = await db.Transactions + .Include(t => t.Category) + .Where(t => t.UserId == Uid && t.LedgerId == resolvedLedgerId.Value && + t.OccurredAt >= start && t.OccurredAt < end) + .ToListAsync(); + + var expenses = list.Where(t => t.Type == TransactionType.Expense).ToList(); + var totalExpense = expenses.Sum(t => t.Amount); + var totalIncome = list.Where(t => t.Type == TransactionType.Income).Sum(t => t.Amount); + + var byCat = expenses + .GroupBy(t => t.Category) + .Select(g => new CategoryStatDto( + g.Key.Id, g.Key.Name, g.Key.IconKey, + g.Sum(t => t.Amount), + totalExpense == 0 ? 0 : (double)(g.Sum(t => t.Amount) / totalExpense * 100), + g.Key.ColorKey)) + .OrderByDescending(c => c.Amount) + .ToList(); + + var daily = Enumerable.Range(1, daysInMonth) + .Select(d => expenses.Where(t => ChinaClock.ToLocal(t.OccurredAt).Day == d).Sum(t => t.Amount)) + .ToList(); + + // AI 分析卡文案 + var topCat = byCat.FirstOrDefault(); + var prevMonth = month == 1 ? 12 : month - 1; + var prevYear = month == 1 ? year - 1 : year; + var (prevStart, _) = ChinaClock.MonthRangeUtc(prevYear, prevMonth); + var prevExpense = await db.Transactions + .Where(t => t.UserId == Uid && t.LedgerId == resolvedLedgerId.Value && + t.Type == TransactionType.Expense && t.OccurredAt >= prevStart && t.OccurredAt < start) + .SumAsync(t => t.Amount); + var trend = prevExpense == 0 ? "这是你的第一个月记账哦" + : totalExpense > prevExpense * 1.05m ? $"比上月多花了 ¥{(totalExpense - prevExpense):F0}" + : totalExpense < prevExpense * 0.95m ? $"比上月省了 ¥{(prevExpense - totalExpense):F0}" : "和上月差不多"; + var aiText = topCat is null + ? "这个月还没开始花钱呢,快去记一笔吧" + : $"这个月「{topCat.Name}」花最多,共 ¥{topCat.Amount:F0}(占 {topCat.Percent:F0}%),{trend}。"; + + return Ok(new MonthStatsDto(year, month, totalExpense, totalIncome, byCat, daily) { AiAnalysis = aiText }); + } + + [HttpGet("stats/period")] + public async Task> PeriodStats( + [FromQuery] string period = "month", + [FromQuery] DateTime? anchor = null, + [FromQuery] long? ledgerId = null) + { + var normalizedPeriod = period.Trim().ToLowerInvariant(); + if (normalizedPeriod is not ("week" or "month" or "year")) + return BadRequest(new ApiError( + "PERIOD_INVALID", + "统计周期必须是 week、month 或 year")); + + var resolvedLedgerId = await ledgers.ResolveAsync(Uid, ledgerId); + if (!resolvedLedgerId.HasValue) + return BadRequest(new ApiError( + "LEDGER_NOT_FOUND", + "账本不存在或无权访问")); + + var selected = DateTime.SpecifyKind( + (anchor ?? ChinaClock.Now).Date, + DateTimeKind.Unspecified); + DateTime localStart; + DateTime localEnd; + DateTime previousLocalStart; + string periodLabel; + switch (normalizedPeriod) + { + case "week": + { + var offset = ((int)selected.DayOfWeek + 6) % 7; + localStart = selected.AddDays(-offset); + localEnd = localStart.AddDays(7); + previousLocalStart = localStart.AddDays(-7); + periodLabel = $"{localStart:MM月dd日} - {localEnd.AddDays(-1):MM月dd日}"; + break; + } + case "year": + localStart = new DateTime(selected.Year, 1, 1); + localEnd = localStart.AddYears(1); + previousLocalStart = localStart.AddYears(-1); + periodLabel = $"{localStart.Year}年"; + break; + default: + localStart = new DateTime(selected.Year, selected.Month, 1); + localEnd = localStart.AddMonths(1); + previousLocalStart = localStart.AddMonths(-1); + periodLabel = $"{localStart.Year}年{localStart.Month}月"; + break; + } + + var start = ChinaClock.ToUtc(localStart); + var end = ChinaClock.ToUtc(localEnd); + var previousStart = ChinaClock.ToUtc(previousLocalStart); + var list = await db.Transactions + .Include(transaction => transaction.Category) + .Where(transaction => + transaction.UserId == Uid && + transaction.LedgerId == resolvedLedgerId.Value && + transaction.OccurredAt >= start && + transaction.OccurredAt < end) + .ToListAsync(); + + var expenses = list + .Where(transaction => transaction.Type == TransactionType.Expense) + .ToList(); + var totalExpense = expenses.Sum(transaction => transaction.Amount); + var totalIncome = list + .Where(transaction => transaction.Type == TransactionType.Income) + .Sum(transaction => transaction.Amount); + var byCategory = expenses + .GroupBy(transaction => transaction.Category) + .Select(group => new CategoryStatDto( + group.Key.Id, + group.Key.Name, + group.Key.IconKey, + group.Sum(transaction => transaction.Amount), + totalExpense == 0 + ? 0 + : (double)(group.Sum(transaction => transaction.Amount) / totalExpense * 100), + group.Key.ColorKey)) + .OrderByDescending(item => item.Amount) + .ThenBy(item => item.Name) + .ToList(); + + List trend; + if (normalizedPeriod == "year") + { + trend = Enumerable.Range(0, 12) + .Select(index => + { + var pointStart = localStart.AddMonths(index); + var pointEnd = pointStart.AddMonths(1); + var pointItems = list.Where(transaction => + { + var local = ChinaClock.ToLocal(transaction.OccurredAt); + return local >= pointStart && local < pointEnd; + }); + return new PeriodTrendPointDto( + $"{pointStart.Month}月", + pointStart, + pointItems.Where(item => item.Type == TransactionType.Expense).Sum(item => item.Amount), + pointItems.Where(item => item.Type == TransactionType.Income).Sum(item => item.Amount)); + }) + .ToList(); + } + else + { + var dayCount = (localEnd - localStart).Days; + trend = Enumerable.Range(0, dayCount) + .Select(index => + { + var date = localStart.AddDays(index); + var dayItems = list.Where(transaction => + ChinaClock.ToLocal(transaction.OccurredAt).Date == date.Date); + var label = normalizedPeriod == "week" + ? new[] { "周一", "周二", "周三", "周四", "周五", "周六", "周日" }[index] + : $"{date.Day}日"; + return new PeriodTrendPointDto( + label, + date, + dayItems.Where(item => item.Type == TransactionType.Expense).Sum(item => item.Amount), + dayItems.Where(item => item.Type == TransactionType.Income).Sum(item => item.Amount)); + }) + .ToList(); + } + + var previousExpense = await db.Transactions + .Where(transaction => + transaction.UserId == Uid && + transaction.LedgerId == resolvedLedgerId.Value && + transaction.Type == TransactionType.Expense && + transaction.OccurredAt >= previousStart && + transaction.OccurredAt < start) + .SumAsync(transaction => transaction.Amount); + var topCategory = byCategory.FirstOrDefault(); + string analysis; + if (topCategory is null) + { + analysis = "这个周期还没有支出记录"; + } + else if (previousExpense == 0) + { + analysis = $"{topCategory.Name}支出最多,共 ¥{topCategory.Amount:F0}"; + } + else + { + var difference = totalExpense - previousExpense; + analysis = Math.Abs(difference) < previousExpense * 0.05m + ? $"{topCategory.Name}支出最多,与上个周期基本持平" + : difference > 0 + ? $"{topCategory.Name}支出最多,比上个周期多 ¥{difference:F0}" + : $"{topCategory.Name}支出最多,比上个周期少 ¥{-difference:F0}"; + } + + return Ok(new PeriodStatsDto( + normalizedPeriod, + periodLabel, + localStart, + localEnd, + totalExpense, + totalIncome, + totalIncome - totalExpense, + list.Count, + byCategory, + trend, + analysis)); + } + private async Task PermanentDeleteCore(Transaction transaction) + { + var cards = await db.ChatMessages + .Where(message => message.TransactionId == transaction.Id) + .ToListAsync(); + foreach (var card in cards) + { + card.TransactionId = null; + card.Content = """{"deleted":true}"""; + } + db.Transactions.Remove(transaction); + } + + private static TransactionType? ParseType(string? value) => value switch + { + "income" => TransactionType.Income, + "expense" => TransactionType.Expense, + _ => null, + }; + + private static bool HasVersionConflict(Transaction transaction, DateTime? baseUpdatedAt) + { + if (!baseUpdatedAt.HasValue) return false; + var baseline = baseUpdatedAt.Value.Kind == DateTimeKind.Utc + ? baseUpdatedAt.Value + : baseUpdatedAt.Value.ToUniversalTime(); + return transaction.UpdatedAt > baseline.AddMilliseconds(1); + } + private static DateTime NormalizeOccurredAt(DateTime value) => + value.Kind == DateTimeKind.Utc ? value : ChinaClock.ToUtc(value); + + internal static TransactionDto ToDto(Transaction t, Category c) => new( + t.Id, t.LedgerId, c.Id, c.Name, c.IconKey, + t.Type == TransactionType.Income ? "income" : "expense", + t.Amount, + t.Source == TransactionSource.AiChat + && !string.IsNullOrWhiteSpace(t.SourceText) + && string.Equals(t.Note?.Trim(), t.SourceText.Trim(), StringComparison.Ordinal) + ? TransactionNoteFormatter.BuildNote(t.SourceText, c.Name) + : t.Note, + t.PaymentMethod, t.OccurredAt, + t.Source switch + { + TransactionSource.AiChat => "ai_chat", + TransactionSource.Voice => "voice", + TransactionSource.ReceiptOcr => "ocr", + TransactionSource.Screenshot => "screenshot", + TransactionSource.Accessibility => "accessibility", + TransactionSource.Notification => "notification", + TransactionSource.RecognitionAi => "recognition_ai", + TransactionSource.LocalOcr => "local_ocr", + _ => "manual", + }, + t.SourceText, + t.IsDeleted, + c.ColorKey, + t.UpdatedAt); +} diff --git a/backend/MiaoJiZhang.Api/Controllers/UsersController.cs b/backend/MiaoJiZhang.Api/Controllers/UsersController.cs new file mode 100644 index 0000000..498b392 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Controllers/UsersController.cs @@ -0,0 +1,370 @@ +using System.IO.Compression; +using System.Security.Claims; +using System.Text; +using System.Text.Json; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Api.Services; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/users/me")] +public class UsersController( + AppDbContext db, + JwtService jwt, + AiPermissionService aiPermissions) : ControllerBase +{ + private long CurrentUserId => + long.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier) + ?? User.FindFirstValue("sub")!); + + /// 当前用户信息(含 AI 伙伴设置与模式) + [HttpGet] + public async Task> Me() + { + var user = await db.Users + .Include(u => u.AiCompanion) + .Include(u => u.FeaturePermissions) + .FirstOrDefaultAsync(u => u.Id == CurrentUserId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + + return Ok(ToProfile(user)); + } + + /// 完成首次引导:选模式 + 选 AI 伙伴(形象/性格/昵称) + [HttpPost("onboarding")] + public async Task> Onboarding(OnboardingRequest req) + { + var user = await db.Users + .Include(u => u.AiCompanion) + .Include(u => u.FeaturePermissions) + .FirstOrDefaultAsync(u => u.Id == CurrentUserId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + + if (!await aiPermissions.IsEnabledAsync(CurrentUserId)) + { + user.AppMode = AppMode.Normal; + await db.SaveChangesAsync(); + return Ok(ToProfile(user)); + } + + if (!await db.AiAvatars.AnyAsync(a => a.Key == req.AvatarKey && a.IsEnabled)) + return BadRequest(new ApiError("AVATAR_INVALID", "形象不存在")); + if (!await db.AiPersonas.AnyAsync(p => p.Key == req.PersonaKey && p.IsEnabled)) + return BadRequest(new ApiError("PERSONA_INVALID", "性格不存在")); + + user.AppMode = req.AppMode == "ai" ? AppMode.AiFirst : AppMode.Normal; + user.AiCompanion ??= new AiCompanionSetting { UserId = user.Id }; + user.AiCompanion.AvatarKey = req.AvatarKey; + user.AiCompanion.PersonaKey = req.PersonaKey; + user.AiCompanion.CustomName = string.IsNullOrWhiteSpace(req.CustomName) ? null : req.CustomName.Trim(); + + await db.SaveChangesAsync(); + return Ok(ToProfile(user)); + } + + /// 切换 App 模式(决策:双模式可随时切换) + [HttpPut("mode")] + public async Task> SwitchMode(SwitchModeRequest req) + { + var user = await db.Users + .Include(u => u.AiCompanion) + .Include(u => u.FeaturePermissions) + .FirstOrDefaultAsync(u => u.Id == CurrentUserId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + + if (req.AppMode == "ai" && !await aiPermissions.IsEnabledAsync(CurrentUserId)) + return StatusCode(403, new ApiError("AI_PERMISSION_DENIED", "当前账号未开通 AI 功能")); + user.AppMode = req.AppMode == "ai" ? AppMode.AiFirst : AppMode.Normal; + await db.SaveChangesAsync(); + return Ok(ToProfile(user)); + } + + /// 更新 AI 伙伴设置(性格设置页 P5) + [HttpPut("companion")] + public async Task> UpdateCompanion(UpdateCompanionRequest req) + { + var user = await db.Users + .Include(u => u.AiCompanion) + .Include(u => u.FeaturePermissions) + .FirstOrDefaultAsync(u => u.Id == CurrentUserId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + if (!await aiPermissions.IsEnabledAsync(CurrentUserId)) + return StatusCode(403, new ApiError("AI_PERMISSION_DENIED", "当前账号未开通 AI 功能")); + if (user.AiCompanion is null) return BadRequest(new ApiError("ONBOARDING_REQUIRED", "请先完成引导")); + + if (req.AvatarKey != null) + { + if (!await db.AiAvatars.AnyAsync(a => a.Key == req.AvatarKey && a.IsEnabled)) + return BadRequest(new ApiError("AVATAR_INVALID", "形象不存在")); + user.AiCompanion.AvatarKey = req.AvatarKey; + } + if (req.PersonaKey != null) + { + if (!await db.AiPersonas.AnyAsync(p => p.Key == req.PersonaKey && p.IsEnabled)) + return BadRequest(new ApiError("PERSONA_INVALID", "性格不存在")); + user.AiCompanion.PersonaKey = req.PersonaKey; + } + if (req.CustomName != null) + user.AiCompanion.CustomName = string.IsNullOrWhiteSpace(req.CustomName) ? null : req.CustomName.Trim(); + if (req.RoastLevel is >= 0 and <= 100) user.AiCompanion.RoastLevel = req.RoastLevel.Value; + if (req.StickerFrequency is >= 0 and <= 100) user.AiCompanion.StickerFrequency = req.StickerFrequency.Value; + if (req.ProactiveLevel is >= 0 and <= 100) user.AiCompanion.ProactiveLevel = req.ProactiveLevel.Value; + + await db.SaveChangesAsync(); + return Ok(ToProfile(user)); + } + + [HttpPut("profile")] + public async Task> UpdateProfile(UpdateProfileRequest req) + { + var user = await db.Users.Include(u => u.AiCompanion).Include(u => u.FeaturePermissions) + .FirstOrDefaultAsync(u => u.Id == CurrentUserId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + var nickname = req.Nickname?.Trim(); + if (nickname?.Length > 32) + return BadRequest(new ApiError("NICKNAME_INVALID", "昵称最多 32 个字")); + user.Nickname = string.IsNullOrWhiteSpace(nickname) ? null : nickname; + await db.SaveChangesAsync(); + return Ok(ToProfile(user)); + } + + [HttpPut("password")] + public async Task> ChangePassword(ChangePasswordRequest req) + { + if (req.NewPassword.Length < 6) + return BadRequest(new ApiError("PASSWORD_TOO_SHORT", "新密码至少 6 位")); + var user = await db.Users.FirstOrDefaultAsync(u => u.Id == CurrentUserId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + if (!BCrypt.Net.BCrypt.Verify(req.CurrentPassword, user.PasswordHash)) + return Unauthorized(new ApiError("BAD_CREDENTIALS", "当前密码错误")); + user.PasswordHash = BCrypt.Net.BCrypt.HashPassword(req.NewPassword); + user.AuthVersion++; + await db.SaveChangesAsync(); + var (token, expires) = jwt.Issue(user); + return Ok(new AuthResponse(user.Id, user.Username, token, expires)); + } + + [HttpGet("export")] + public async Task Export() + { + var userId = CurrentUserId; + var user = await db.Users.Include(u => u.AiCompanion).Include(u => u.FeaturePermissions) + .FirstOrDefaultAsync(u => u.Id == userId); + if (user is null) return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + + var ledgers = await db.Ledgers.Where(l => l.OwnerId == userId) + .OrderBy(l => l.Id).ToListAsync(); + var transactions = await db.Transactions.IgnoreQueryFilters() + .Include(t => t.Category) + .Where(t => t.UserId == userId) + .OrderBy(t => t.Id).ToListAsync(); + var budgets = await db.Budgets.Where(b => b.UserId == userId) + .OrderBy(b => b.Id).ToListAsync(); + var categories = await db.Categories + .Where(c => c.UserId == null || c.UserId == userId) + .OrderBy(c => c.Type).ThenBy(c => c.SortOrder).ToListAsync(); + var messages = await db.ChatMessages.Where(m => m.UserId == userId) + .OrderBy(m => m.Id).ToListAsync(); + + var snapshot = new + { + formatVersion = 1, + exportedAt = DateTime.UtcNow, + timezone = "Asia/Shanghai", + user = new + { + user.Id, + user.Username, + user.Nickname, + appMode = user.AppMode.ToString(), + user.CreatedAt, + companion = user.AiCompanion is null ? null : new + { + user.AiCompanion.AvatarKey, + user.AiCompanion.CustomName, + user.AiCompanion.PersonaKey, + user.AiCompanion.RoastLevel, + user.AiCompanion.StickerFrequency, + }, + }, + ledgers = ledgers.Select(l => new + { + l.Id, l.Name, l.IconKey, l.IsDefault, l.CreatedAt, + }), + categories = categories.Select(c => new + { + c.Id, c.UserId, type = c.Type.ToString().ToLowerInvariant(), + c.Name, c.IconKey, c.ColorKey, c.SortOrder, c.IsDeleted, + }), + transactions = transactions.Select(t => new + { + t.Id, t.LedgerId, t.CategoryId, + type = t.Type.ToString().ToLowerInvariant(), + t.Amount, t.Note, t.PaymentMethod, t.OccurredAt, + source = t.Source.ToString(), t.SourceText, + t.IsDeleted, t.DeletedAt, t.CreatedAt, t.UpdatedAt, + }), + budgets = budgets.Select(b => new + { + b.Id, b.LedgerId, b.CategoryId, b.Period, b.Amount, + }), + chatMessages = messages.Select(m => new + { + m.Id, role = m.Role.ToString(), type = m.Type.ToString(), + m.Content, m.TransactionId, m.CreatedAt, + }), + }; + + var ledgerNames = ledgers.ToDictionary(l => l.Id, l => l.Name); + var transactionCsv = new StringBuilder( + "ID,账本,类型,金额,分类,备注,支付方式,发生时间,来源,已删除\r\n"); + foreach (var tx in transactions) + { + transactionCsv.AppendJoin(',', new[] + { + Csv(tx.Id), + Csv(ledgerNames.GetValueOrDefault(tx.LedgerId, "")), + Csv(tx.Type == TransactionType.Income ? "收入" : "支出"), + Csv(tx.Amount), + Csv(tx.Category.Name), + Csv(tx.Note), + Csv(tx.PaymentMethod), + Csv(ChinaClock.ToLocal(tx.OccurredAt).ToString("yyyy-MM-dd HH:mm:ss")), + Csv(tx.Source.ToString()), + Csv(tx.IsDeleted ? "是" : "否"), + }).Append("\r\n"); + } + + var categoryNames = categories.ToDictionary(c => c.Id, c => c.Name); + var budgetCsv = new StringBuilder("ID,账本,周期,分类,金额\r\n"); + foreach (var budget in budgets) + { + budgetCsv.AppendJoin(',', new[] + { + Csv(budget.Id), + Csv(ledgerNames.GetValueOrDefault(budget.LedgerId, "")), + Csv(budget.Period == 0 ? "周期预算" : budget.Period.ToString()), + Csv(budget.CategoryId.HasValue + ? categoryNames.GetValueOrDefault(budget.CategoryId.Value, "") + : "总预算"), + Csv(budget.Amount), + }).Append("\r\n"); + } + + await using var output = new MemoryStream(); + using (var archive = new ZipArchive(output, ZipArchiveMode.Create, true)) + { + await WriteEntry(archive, "transactions.csv", transactionCsv.ToString(), new UTF8Encoding(true)); + await WriteEntry(archive, "budgets.csv", budgetCsv.ToString(), new UTF8Encoding(true)); + var json = JsonSerializer.Serialize( + snapshot, + new JsonSerializerOptions(JsonSerializerDefaults.Web) { WriteIndented = true }); + await WriteEntry(archive, "backup.json", json, new UTF8Encoding(false)); + } + return File( + output.ToArray(), + "application/zip", + $"miaoji-export-{ChinaClock.Now:yyyyMMdd-HHmmss}.zip"); + } + + [HttpPost("closure")] + public Task RequestAccountClosure( + DeleteAccountRequest request) => + ScheduleAccountClosure(request, requireConfirmation: true); + + // 兼容旧客户端:不再立即物理删除,统一进入 15 天注销等待期。 + [HttpDelete] + public Task DeleteAccount(DeleteAccountRequest request) => + ScheduleAccountClosure(request, requireConfirmation: false); + + private async Task ScheduleAccountClosure( + DeleteAccountRequest request, + bool requireConfirmation) + { + var user = await db.Users.FirstOrDefaultAsync( + item => item.Id == CurrentUserId); + if (user is null) + return NotFound(new ApiError("USER_NOT_FOUND", "用户不存在")); + if (!BCrypt.Net.BCrypt.Verify(request.Password, user.PasswordHash)) + return Unauthorized(new ApiError("BAD_CREDENTIALS", "密码错误")); + if (requireConfirmation && + request.ConfirmationText?.Trim() != "注销账号") + return BadRequest(new ApiError( + "CONFIRMATION_INVALID", + "请输入“注销账号”完成确认")); + + if (!user.AccountClosureScheduledAt.HasValue) + { + var now = DateTime.UtcNow; + user.AccountClosureRequestedAt = now; + user.AccountClosureScheduledAt = now.AddDays(15); + user.AuthVersion++; + await db.SaveChangesAsync(); + } + + return Accepted(new AccountClosureResponse( + user.AccountClosureRequestedAt!.Value, + user.AccountClosureScheduledAt.Value)); + } + private static async Task WriteEntry( + ZipArchive archive, + string name, + string content, + Encoding encoding) + { + var entry = archive.CreateEntry(name, CompressionLevel.Fastest); + await using var stream = entry.Open(); + await using var writer = new StreamWriter(stream, encoding); + await writer.WriteAsync(content); + } + + private static string Csv(object? value) + { + var text = value switch + { + null => "", + IFormattable formattable => formattable.ToString(null, System.Globalization.CultureInfo.InvariantCulture), + _ => value.ToString() ?? "", + }; + if (text.Length > 0 && "=+-@".Contains(text[0])) text = "'" + text; + return "\"" + text.Replace("\"", "\"\"") + "\""; + } + + private static UserProfileResponse ToProfile(User u) + { + var aiEnabled = u.FeaturePermissions + .FirstOrDefault(x => x.PermissionKey == FeaturePermissionKeys.Ai)?.IsEnabled ?? true; + var quota = AiChatQuotaService.GetStatus(u); + return new UserProfileResponse( + u.Id, + u.Username, + u.Nickname, + u.AppMode == AppMode.AiFirst ? "ai" : "normal", + u.AiCompanion is null + ? null + : new AiCompanionDto( + u.AiCompanion.AvatarKey, + u.AiCompanion.PersonaKey, + u.AiCompanion.CustomName, + u.AiCompanion.RoastLevel, + u.AiCompanion.StickerFrequency, + u.AiCompanion.ProactiveLevel), + u.AiCompanion is not null || !aiEnabled, + new UserPermissionsDto(aiEnabled), + new AiChatQuotaDto( + quota.Limit, + quota.Used, + quota.Remaining, + AiChatQuotaService.PeriodKey(quota.Period), + quota.ResetAt)); + } +} + diff --git a/backend/MiaoJiZhang.Api/MiaoJiZhang.Api.csproj b/backend/MiaoJiZhang.Api/MiaoJiZhang.Api.csproj new file mode 100644 index 0000000..953e53e --- /dev/null +++ b/backend/MiaoJiZhang.Api/MiaoJiZhang.Api.csproj @@ -0,0 +1,25 @@ + + + + net9.0 + enable + enable + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + diff --git a/backend/MiaoJiZhang.Api/MiaoJiZhang.Api.http b/backend/MiaoJiZhang.Api/MiaoJiZhang.Api.http new file mode 100644 index 0000000..12d59c8 --- /dev/null +++ b/backend/MiaoJiZhang.Api/MiaoJiZhang.Api.http @@ -0,0 +1,6 @@ +@MiaoJiZhang.Api_HostAddress = http://localhost:5169 + +GET {{MiaoJiZhang.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/backend/MiaoJiZhang.Api/Program.cs b/backend/MiaoJiZhang.Api/Program.cs new file mode 100644 index 0000000..dc73dda --- /dev/null +++ b/backend/MiaoJiZhang.Api/Program.cs @@ -0,0 +1,151 @@ +using System.Text; +using System.Threading.RateLimiting; +using MiaoJiZhang.Api.Services; +using Microsoft.AspNetCore.RateLimiting; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.EntityFrameworkCore; +using Microsoft.IdentityModel.Tokens; + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllers(); +builder.Services.AddOpenApi(); +builder.Services.AddRateLimiter(options => +{ + options.RejectionStatusCode = StatusCodes.Status429TooManyRequests; + options.AddPolicy("auth", context => + RateLimitPartition.GetFixedWindowLimiter( + context.Connection.RemoteIpAddress?.ToString() ?? "unknown", + _ => new FixedWindowRateLimiterOptions + { + PermitLimit = 10, + Window = TimeSpan.FromMinutes(1), + QueueLimit = 0, + })); + options.AddPolicy("ai", context => + RateLimitPartition.GetConcurrencyLimiter( + context.User.FindFirst("sub")?.Value ?? + context.Connection.RemoteIpAddress?.ToString() ?? "unknown", + _ => new ConcurrencyLimiterOptions + { + PermitLimit = 2, + QueueLimit = 0, + })); + options.AddPolicy("upload", context => + RateLimitPartition.GetFixedWindowLimiter( + context.User.FindFirst("sub")?.Value ?? + context.Connection.RemoteIpAddress?.ToString() ?? "unknown", + _ => new FixedWindowRateLimiterOptions + { + PermitLimit = 10, + Window = TimeSpan.FromMinutes(1), + QueueLimit = 0, + })); +}); +builder.Services.AddSingleton(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddHttpClient("LlmClient"); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(sp => sp.GetRequiredService()); +builder.Services.AddHostedService(); +builder.Services.AddScoped(); +builder.Services.AddHostedService(); + +var conn = builder.Configuration.GetConnectionString("Default"); +if (string.IsNullOrWhiteSpace(conn)) + throw new InvalidOperationException("必须通过 ConnectionStrings__Default 配置数据库连接"); +var jwtSecret = builder.Configuration["Jwt:Secret"]; +if (string.IsNullOrWhiteSpace(jwtSecret) || jwtSecret.Length < 32) + throw new InvalidOperationException("必须通过 Jwt__Secret 配置至少 32 位的 JWT 密钥"); +var adminKey = builder.Configuration["Admin:Key"]; +if (string.IsNullOrWhiteSpace(adminKey) || adminKey.Length < 24) + throw new InvalidOperationException("必须通过 Admin__Key 配置至少 24 位的管理密钥"); +builder.Services.AddDbContext(o => + o.UseMySql(conn, ServerVersion.AutoDetect(conn))); + +builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(o => + { + o.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateIssuerSigningKey = true, + ValidIssuer = builder.Configuration["Jwt:Issuer"], + ValidAudience = builder.Configuration["Jwt:Audience"], + IssuerSigningKey = new SymmetricSecurityKey( + Encoding.UTF8.GetBytes(jwtSecret)), + }; + o.Events = new JwtBearerEvents + { + OnTokenValidated = async context => + { + var idValue = context.Principal?.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value + ?? context.Principal?.FindFirst("sub")?.Value; + if (!long.TryParse(idValue, out var userId)) + { + context.Fail("Invalid user identity"); + return; + } + + var versionValue = context.Principal?.FindFirst("auth_version")?.Value; + var tokenVersion = int.TryParse(versionValue, out var parsedVersion) + ? parsedVersion + : 0; + var db = context.HttpContext.RequestServices.GetRequiredService(); + var userState = await db.Users + .AsNoTracking() + .Where(user => user.Id == userId) + .Select(user => new + { + user.AuthVersion, + user.IsBanned, + user.AccountClosureScheduledAt, + }) + .FirstOrDefaultAsync(context.HttpContext.RequestAborted); + if (userState is null || userState.IsBanned || + userState.AccountClosureScheduledAt != null || + userState.AuthVersion != tokenVersion) + { + context.Fail("Account session has been revoked"); + } + }, + }; + }); +builder.Services.AddAuthorization(); + +var app = builder.Build(); + +using (var scope = app.Services.CreateScope()) +{ + var db = scope.ServiceProvider.GetRequiredService(); + await db.Database.MigrateAsync(); + if (app.Environment.IsDevelopment()) + await DbSeeder.SeedAsync(db); +} +if (app.Environment.IsDevelopment()) + app.MapOpenApi(); + +var buildTime = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss") + " UTC"; +var apiVersion = builder.Configuration["Build:Version"] ?? "dev"; + +app.UseAuthentication(); +app.UseRateLimiter(); +app.UseAuthorization(); +app.MapControllers(); +app.MapGet("/api/ping", () => Results.Ok(new { status = "ok", version = apiVersion, built = buildTime })); +app.MapGet("/api/version", () => Results.Ok(new { app = "记之 API", version = apiVersion, built = buildTime })); +app.UseDefaultFiles(); +app.UseStaticFiles(); + +app.Run(); + +public partial class Program; + diff --git a/backend/MiaoJiZhang.Api/Properties/AssemblyInfo.cs b/backend/MiaoJiZhang.Api/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..96b81e1 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("MiaoJiZhang.Api.Tests")] diff --git a/backend/MiaoJiZhang.Api/Properties/launchSettings.json b/backend/MiaoJiZhang.Api/Properties/launchSettings.json new file mode 100644 index 0000000..07badfa --- /dev/null +++ b/backend/MiaoJiZhang.Api/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5169", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7241;http://localhost:5169", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/backend/MiaoJiZhang.Api/Services/AccountClosureCleanupService.cs b/backend/MiaoJiZhang.Api/Services/AccountClosureCleanupService.cs new file mode 100644 index 0000000..3f8bb7e --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AccountClosureCleanupService.cs @@ -0,0 +1,50 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public class AccountClosureCleanupService( + IServiceScopeFactory scopeFactory, + ILogger logger) : BackgroundService +{ + protected override async Task ExecuteAsync( + CancellationToken stoppingToken) + { + await Cleanup(stoppingToken); + using var timer = new PeriodicTimer(TimeSpan.FromHours(1)); + while (await timer.WaitForNextTickAsync(stoppingToken)) + await Cleanup(stoppingToken); + } + + private async Task Cleanup(CancellationToken ct) + { + try + { + using var scope = scopeFactory.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var eraser = + scope.ServiceProvider.GetRequiredService(); + var ids = await db.Users + .Where(user => + user.AccountClosureScheduledAt.HasValue && + user.AccountClosureScheduledAt <= DateTime.UtcNow) + .Select(user => user.Id) + .ToListAsync(ct); + foreach (var userId in ids) + { + await eraser.EraseAsync(userId, ct); + logger.LogInformation( + "Permanently removed account {UserId} after closure grace period", + userId); + } + } + catch (OperationCanceledException) when (ct.IsCancellationRequested) + { + } + catch (Exception exception) + { + logger.LogError(exception, "Account closure cleanup failed"); + } + } +} + diff --git a/backend/MiaoJiZhang.Api/Services/AccountDataEraser.cs b/backend/MiaoJiZhang.Api/Services/AccountDataEraser.cs new file mode 100644 index 0000000..ce54421 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AccountDataEraser.cs @@ -0,0 +1,37 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public class AccountDataEraser(AppDbContext db) +{ + public async Task EraseAsync(long userId, CancellationToken ct = default) + { + await using var transaction = + await db.Database.BeginTransactionAsync(ct); + await db.ChatMessages + .Where(message => message.UserId == userId) + .ExecuteDeleteAsync(ct); + await db.Transactions + .IgnoreQueryFilters() + .Where(item => item.UserId == userId) + .ExecuteDeleteAsync(ct); + await db.Budgets + .Where(item => item.UserId == userId) + .ExecuteDeleteAsync(ct); + await db.Categories + .Where(item => item.UserId == userId) + .ExecuteDeleteAsync(ct); + await db.AiCompanionSettings + .Where(item => item.UserId == userId) + .ExecuteDeleteAsync(ct); + await db.Ledgers + .Where(item => item.OwnerId == userId) + .ExecuteDeleteAsync(ct); + await db.Users + .Where(item => item.Id == userId) + .ExecuteDeleteAsync(ct); + await transaction.CommitAsync(ct); + } +} + diff --git a/backend/MiaoJiZhang.Api/Services/AdminAuthAttribute.cs b/backend/MiaoJiZhang.Api/Services/AdminAuthAttribute.cs new file mode 100644 index 0000000..5fb99e2 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AdminAuthAttribute.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace MiaoJiZhang.Api.Services; + +/// +/// 管理后台鉴权:请求头 X-Admin-Key 与 appsettings.Admin:Key 匹配即可。 +/// 仅内部使用,不依赖 JWT/用户体系。 +/// +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] +public class AdminAuthAttribute : Attribute, IAuthorizationFilter +{ + public void OnAuthorization(AuthorizationFilterContext context) + { + var config = context.HttpContext.RequestServices.GetRequiredService(); + var key = config["Admin:Key"]; + if (string.IsNullOrWhiteSpace(key) || + !context.HttpContext.Request.Headers.TryGetValue("X-Admin-Key", out var provided) || + provided != key) + { + context.Result = new UnauthorizedObjectResult(new { error = "admin_key_required", message = "请在 Header 中提供 X-Admin-Key" }); + } + } +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/Services/AgentService.cs b/backend/MiaoJiZhang.Api/Services/AgentService.cs new file mode 100644 index 0000000..86bb14f --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AgentService.cs @@ -0,0 +1,749 @@ +using System.Globalization; +using System.Text.Json; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public record AgentTurnResult( + string Reply, + IReadOnlyList Transactions); + +public class AgentService( + AppDbContext db, + ILlmClient llm, + ILogger logger) +{ + private static readonly JsonSerializerOptions JsonOptions = + new(JsonSerializerDefaults.Web); + + private static readonly object TransactionItemsSchema = Schema( + """ + { + "type": "object", + "properties": { + "items": { + "type": "array", + "minItems": 1, + "maxItems": 10, + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["expense", "income"], + "description": "交易方向,收入必须是 income,支出必须是 expense" + }, + "amount": { + "type": "number", + "exclusiveMinimum": 0 + }, + "categoryName": { + "type": "string", + "description": "支出分类:餐饮、饮品、购物、交通、住房、娱乐、医疗、学习、服饰、人情、旅行、其他;收入分类:工资、奖金、理财、兼职、红包、报销、其他" + }, + "note": { + "type": "string", + "description": "适合明细列表展示的简短备注,不要照抄用户整句话" + }, + "paymentMethod": { + "type": "string", + "description": "可选,例如微信支付、支付宝、现金" + }, + "occurredAt": { + "type": "string", + "description": "可选,ISO 8601 时间;未提时间不要填写" + } + }, + "required": ["type", "amount", "categoryName", "note"], + "additionalProperties": false + } + } + }, + "required": ["items"], + "additionalProperties": false + } + """); + + private static readonly IReadOnlyList ChatTools = + [ + new( + "create_transactions", + "仅当每笔交易的金额和收入/支出方向都明确时,创建一笔或多笔账单。裸金额、方向冲突或不确定时不得调用,应先询问用户。", + TransactionItemsSchema), + new( + "get_financial_summary", + "读取用户默认账本在指定周期内的真实收入、支出、结余和分类汇总。", + Schema( + """ + { + "type": "object", + "properties": { + "period": { + "type": "string", + "enum": ["today", "yesterday", "this_week", "this_month", "last_month", "this_year"] + } + }, + "required": ["period"], + "additionalProperties": false + } + """)), + new( + "list_transactions", + "读取用户默认账本的近期真实账单,可按周期、收支方向和分类筛选。", + Schema( + """ + { + "type": "object", + "properties": { + "period": { + "type": "string", + "enum": ["today", "yesterday", "this_week", "this_month", "last_month", "this_year"] + }, + "type": { + "type": "string", + "enum": ["expense", "income"] + }, + "categoryName": { + "type": "string" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 10 + } + }, + "required": ["period"], + "additionalProperties": false + } + """)), + new( + "get_budget_status", + "读取用户默认账本某月的总预算、分类预算、已花金额和周期预算状态。", + Schema( + """ + { + "type": "object", + "properties": { + "year": { + "type": "integer", + "minimum": 2000, + "maximum": 2200 + }, + "month": { + "type": "integer", + "minimum": 1, + "maximum": 12 + } + }, + "required": ["year", "month"], + "additionalProperties": false + } + """)), + ]; + + private static readonly IReadOnlyList DraftTools = + [ + new( + "prepare_transactions", + "解析明确的自然语言交易草稿。金额或收支方向不明确时不要调用。", + TransactionItemsSchema), + ]; + + public async Task RunAsync( + long userId, + long ledgerId, + bool allowWrites, + string userText, + ChatMessage sourceMessage, + string personaPrompt, + string conversationContext, + Func? onToken = null, + Func? onToolRunning = null, + CancellationToken ct = default) + { + if (!llm.IsEnabled) + throw new InvalidOperationException("AI 功能尚未配置"); + if (sourceMessage.Id == 0) + await db.SaveChangesAsync(ct); + + var created = new List(); + var writeExecuted = false; + var response = await llm.RunAgentAsync( + BuildSystemPrompt(personaPrompt, conversationContext), + userText, + ChatTools, + async (call, toolCt) => + { + logger.LogInformation( + "Executing AI agent tool. user={UserId} tool={Tool} callId={CallId}", + userId, + call.Name, + call.CallId); + return call.Name switch + { + "create_transactions" when allowWrites => await CreateTransactionsAsync( + userId, + ledgerId, + userText, + sourceMessage, + call.Arguments, + created, + () => writeExecuted, + () => writeExecuted = true, + toolCt), + "create_transactions" => Serialize(new + { + ok = false, + error = "AI 自动入账已关闭,请在记一笔页面手动确认", + }), + "get_financial_summary" => await FinancialSummaryAsync( + userId, + ledgerId, + call.Arguments, + toolCt), + "list_transactions" => await ListTransactionsAsync( + userId, + ledgerId, + call.Arguments, + toolCt), + "get_budget_status" => await BudgetStatusAsync( + userId, + ledgerId, + call.Arguments, + toolCt), + _ => Serialize(new { ok = false, error = "未知工具" }), + }; + }, + onToken, + onToolRunning, + ct); + + return new AgentTurnResult(response.Text, created); + } + + public async Task> ParseDraftsAsync( + long userId, + string text, + CancellationToken ct = default) + { + if (!llm.IsEnabled) + throw new InvalidOperationException("AI 功能尚未配置"); + + var drafts = new List(); + await llm.RunAgentAsync( + """ + 你是记账草稿解析器。只有金额和收入/支出方向都明确时才调用 prepare_transactions。 + 收入包括赚到、工资到账、奖金、兼职、稿费、红包、报销、退款、理财收益、收款等。 + “100”这类裸金额、查询问题和普通聊天都不要调用工具。 + 可以一次提取多笔交易。不得把收入写成支出,也不得虚构金额。 + """, + text, + DraftTools, + async (call, toolCt) => + { + if (call.Name != "prepare_transactions") + return Serialize(new { ok = false, error = "未知工具" }); + var parsed = await ParseTransactionItemsAsync( + userId, + call.Arguments, + toolCt); + drafts.AddRange(parsed); + return Serialize(new + { + ok = true, + count = parsed.Count, + items = parsed.Select(ToToolItem), + }); + }, + ct: ct); + return drafts; + } + + private string BuildSystemPrompt(string personaPrompt, string conversationContext) + { + var now = ChinaClock.Now; + return $""" + {personaPrompt} + + 你同时是记之的财务 Agent。当前北京时间:{now:yyyy-MM-dd HH:mm:ss}。 + 记账必须通过 create_transactions;查询账本必须调用对应只读工具,不能凭空回答金额。 + 只有每笔金额和收入/支出方向都明确时才允许自动入账。 + “我赚了100”“工资到账5000”“收到退款20”是收入;“午饭30”“买衣服200”是支出。 + “100”这类裸金额、方向冲突或不确定表达必须先追问,不得默认支出。 + 同一句有多笔交易时一次传入全部 items,可以同时包含收入和支出。 + 工具参数 type 是必填项,绝不能省略;工具报错时向用户说明,不得假装已入账。 + 工具返回的数据是唯一事实来源。回复简短自然,已入账时明确说收入或支出。 + 不得删除账单、修改历史账单或修改预算。 + {conversationContext} + """; + } + + private async Task CreateTransactionsAsync( + long userId, + long ledgerId, + string sourceText, + ChatMessage sourceMessage, + string arguments, + List created, + Func wasExecuted, + Action markExecuted, + CancellationToken ct) + { + if (wasExecuted()) + return Serialize(new { ok = false, error = "本轮已经执行过入账,不能重复写入" }); + + var bills = await ParseTransactionItemsAsync(userId, arguments, ct); + if (bills.Count == 0) + return Serialize(new { ok = false, error = "没有有效交易,未写入" }); + + markExecuted(); + var now = DateTime.UtcNow; + var pending = new List(); + foreach (var bill in bills) + { + var category = await db.Categories.FirstAsync( + c => c.Id == bill.CategoryId && c.Type == bill.Type, + ct); + if (category.Type != bill.Type) + throw new InvalidOperationException("交易类型与分类类型不一致"); + + pending.Add(new Transaction + { + LedgerId = ledgerId, + UserId = userId, + CategoryId = category.Id, + Category = category, + Type = bill.Type, + Amount = bill.Amount, + Note = NormalizeNote(bill.Note, sourceText, category.Name), + PaymentMethod = bill.PaymentMethod, + OccurredAt = bill.OccurredAt ?? now, + Source = TransactionSource.AiChat, + SourceText = sourceText, + SourceChatMessageId = sourceMessage.Id, + CreatedAt = now, + UpdatedAt = now, + }); + } + + db.Transactions.AddRange(pending); + try + { + await db.SaveChangesAsync(ct); + } + catch + { + foreach (var transaction in pending) + db.Entry(transaction).State = EntityState.Detached; + throw; + } + created.AddRange(pending); + + return Serialize(new + { + ok = true, + count = created.Count, + items = created.Select(transaction => new + { + id = transaction.Id, + type = transaction.Type == TransactionType.Income + ? "income" + : "expense", + amount = transaction.Amount, + categoryName = transaction.Category.Name, + note = transaction.Note, + }), + }); + } + + private async Task> ParseTransactionItemsAsync( + long userId, + string arguments, + CancellationToken ct) + { + using var document = JsonDocument.Parse(arguments); + var root = document.RootElement; + if (root.ValueKind != JsonValueKind.Object || + !root.TryGetProperty("items", out var items) || + items.ValueKind != JsonValueKind.Array) + { + throw new InvalidOperationException("工具参数缺少 items"); + } + if (items.GetArrayLength() is < 1 or > 10) + throw new InvalidOperationException("每次只能处理 1 到 10 笔交易"); + + var bills = new List(); + foreach (var item in items.EnumerateArray()) + { + var typeText = RequiredString(item, "type").ToLowerInvariant(); + var type = typeText switch + { + "income" => TransactionType.Income, + "expense" => TransactionType.Expense, + _ => throw new InvalidOperationException( + "交易 type 必须是 income 或 expense"), + }; + if (!item.TryGetProperty("amount", out var amountNode) || + !amountNode.TryGetDecimal(out var amount) || + amount <= 0) + { + throw new InvalidOperationException("交易金额必须大于 0"); + } + + var categoryName = RequiredString(item, "categoryName").Trim(); + var note = RequiredString(item, "note").Trim(); + if (categoryName.Length > 20) categoryName = categoryName[..20]; + if (note.Length > 30) note = note[..30]; + var category = await ResolveCategoryAsync( + userId, + type, + categoryName, + ct); + + string? paymentMethod = null; + if (item.TryGetProperty("paymentMethod", out var paymentNode) && + paymentNode.ValueKind == JsonValueKind.String) + { + paymentMethod = paymentNode.GetString()?.Trim(); + if (paymentMethod?.Length > 20) + paymentMethod = paymentMethod[..20]; + } + + DateTime? occurredAt = null; + if (item.TryGetProperty("occurredAt", out var occurredNode) && + occurredNode.ValueKind == JsonValueKind.String && + !string.IsNullOrWhiteSpace(occurredNode.GetString())) + { + if (!DateTimeOffset.TryParse( + occurredNode.GetString(), + CultureInfo.InvariantCulture, + DateTimeStyles.AssumeLocal, + out var parsedTime)) + { + throw new InvalidOperationException("交易时间格式无效"); + } + occurredAt = parsedTime.UtcDateTime; + } + + bills.Add(new ParsedBill( + type, + category.Id, + category.Name, + string.IsNullOrWhiteSpace(note) ? category.Name : note, + amount, + paymentMethod, + occurredAt)); + } + return bills; + } + + private async Task FinancialSummaryAsync( + long userId, + long ledgerId, + string arguments, + CancellationToken ct) + { + using var document = JsonDocument.Parse(arguments); + var period = RequiredString(document.RootElement, "period"); + var (start, end, label) = ResolvePeriod(period); + var transactions = await db.Transactions + .Include(t => t.Category) + .Where(t => t.UserId == userId && + t.LedgerId == ledgerId && + t.OccurredAt >= start && + t.OccurredAt < end) + .ToListAsync(ct); + + var income = transactions + .Where(t => t.Type == TransactionType.Income) + .Sum(t => t.Amount); + var expense = transactions + .Where(t => t.Type == TransactionType.Expense) + .Sum(t => t.Amount); + var categories = transactions + .GroupBy(t => new { t.Type, t.Category.Name }) + .Select(group => new + { + type = group.Key.Type == TransactionType.Income + ? "income" + : "expense", + categoryName = group.Key.Name, + amount = group.Sum(t => t.Amount), + }) + .OrderByDescending(item => item.amount) + .ToList(); + + return Serialize(new + { + ok = true, + period = label, + income, + expense, + balance = income - expense, + count = transactions.Count, + categories, + }); + } + + private async Task ListTransactionsAsync( + long userId, + long ledgerId, + string arguments, + CancellationToken ct) + { + using var document = JsonDocument.Parse(arguments); + var root = document.RootElement; + var period = RequiredString(root, "period"); + var (start, end, label) = ResolvePeriod(period); + var query = db.Transactions + .Include(t => t.Category) + .Where(t => t.UserId == userId && + t.LedgerId == ledgerId && + t.OccurredAt >= start && + t.OccurredAt < end); + + if (root.TryGetProperty("type", out var typeNode) && + typeNode.ValueKind == JsonValueKind.String) + { + var type = typeNode.GetString() switch + { + "income" => TransactionType.Income, + "expense" => TransactionType.Expense, + _ => throw new InvalidOperationException("筛选类型无效"), + }; + query = query.Where(t => t.Type == type); + } + if (root.TryGetProperty("categoryName", out var categoryNode) && + categoryNode.ValueKind == JsonValueKind.String && + !string.IsNullOrWhiteSpace(categoryNode.GetString())) + { + var categoryName = categoryNode.GetString()!.Trim(); + query = query.Where(t => t.Category.Name == categoryName); + } + var limit = root.TryGetProperty("limit", out var limitNode) && + limitNode.TryGetInt32(out var requestedLimit) + ? Math.Clamp(requestedLimit, 1, 10) + : 10; + var transactions = await query + .OrderByDescending(t => t.OccurredAt) + .Take(limit) + .ToListAsync(ct); + + return Serialize(new + { + ok = true, + period = label, + count = transactions.Count, + items = transactions.Select(transaction => new + { + id = transaction.Id, + type = transaction.Type == TransactionType.Income + ? "income" + : "expense", + transaction.Amount, + categoryName = transaction.Category.Name, + transaction.Note, + occurredAt = transaction.OccurredAt, + }), + }); + } + + private async Task BudgetStatusAsync( + long userId, + long ledgerId, + string arguments, + CancellationToken ct) + { + using var document = JsonDocument.Parse(arguments); + var root = document.RootElement; + if (!root.TryGetProperty("year", out var yearNode) || + !yearNode.TryGetInt32(out var year) || + !root.TryGetProperty("month", out var monthNode) || + !monthNode.TryGetInt32(out var month) || + year is < 2000 or > 2200 || + month is < 1 or > 12) + { + throw new InvalidOperationException("预算年月无效"); + } + + var period = year * 100 + month; + var (start, end) = ChinaClock.MonthRangeUtc(year, month); + var budgetRows = await db.Budgets + .Where(b => b.UserId == userId && + b.LedgerId == ledgerId && + (b.Period == period || b.Period == 0)) + .ToListAsync(ct); + var effective = budgetRows + .GroupBy(b => b.CategoryId) + .Select(group => group + .OrderByDescending(b => b.Period == period) + .First()) + .ToList(); + var categoryIds = effective + .Where(budget => budget.CategoryId.HasValue) + .Select(budget => budget.CategoryId!.Value) + .Distinct() + .ToList(); + var categoryNames = await db.Categories + .Where(category => categoryIds.Contains(category.Id)) + .ToDictionaryAsync(category => category.Id, category => category.Name, ct); + var expenses = await db.Transactions + .Where(t => t.UserId == userId && + t.LedgerId == ledgerId && + t.Type == TransactionType.Expense && + t.OccurredAt >= start && + t.OccurredAt < end) + .Select(t => new { t.CategoryId, t.Amount }) + .ToListAsync(ct); + var spentByCategory = expenses + .GroupBy(t => t.CategoryId) + .ToDictionary(group => group.Key, group => group.Sum(t => t.Amount)); + var totalSpent = expenses.Sum(t => t.Amount); + + return Serialize(new + { + ok = true, + year, + month, + totalSpent, + budgets = effective.Select(budget => new + { + categoryName = budget.CategoryId.HasValue + ? categoryNames.GetValueOrDefault(budget.CategoryId.Value, "其他") + : "总预算", + amount = budget.Amount, + spent = budget.CategoryId.HasValue + ? spentByCategory.GetValueOrDefault(budget.CategoryId.Value) + : totalSpent, + remaining = budget.Amount - ( + budget.CategoryId.HasValue + ? spentByCategory.GetValueOrDefault(budget.CategoryId.Value) + : totalSpent), + recurring = budget.Period == 0, + }), + }); + } + + private static string NormalizeNote( + string note, + string sourceText, + string categoryName) + { + var trimmed = note.Trim(); + var comparableNote = string.Concat(trimmed.Where(char.IsLetterOrDigit)); + var comparableSource = string.Concat( + sourceText.Trim().Where(char.IsLetterOrDigit)); + if (string.Equals( + comparableNote, + comparableSource, + StringComparison.OrdinalIgnoreCase)) + { + return categoryName; + } + return trimmed.Length > 16 ? trimmed[..16] : trimmed; + } + + private async Task ResolveCategoryAsync( + long userId, + TransactionType type, + string requestedName, + CancellationToken ct) + { + var category = await db.Categories + .Where(c => !c.IsDeleted && + c.Type == type && + c.Name == requestedName && + (c.UserId == null || c.UserId == userId)) + .OrderByDescending(c => c.UserId == userId) + .FirstOrDefaultAsync(ct); + return category ?? await db.Categories.FirstAsync( + c => !c.IsDeleted && + c.UserId == null && + c.Type == type && + c.Name == "其他", + ct); + } + + private async Task DefaultLedgerIdAsync(long userId, CancellationToken ct) => + await db.Ledgers + .Where(l => l.OwnerId == userId && l.IsDefault) + .Select(l => l.Id) + .FirstAsync(ct); + + private static object ToToolItem(ParsedBill bill) => new + { + type = bill.Type == TransactionType.Income ? "income" : "expense", + bill.Amount, + bill.CategoryName, + bill.Note, + bill.PaymentMethod, + occurredAt = bill.OccurredAt, + }; + + private static string RequiredString(JsonElement root, string name) + { + if (!root.TryGetProperty(name, out var node) || + node.ValueKind != JsonValueKind.String || + string.IsNullOrWhiteSpace(node.GetString())) + { + throw new InvalidOperationException($"工具参数缺少 {name}"); + } + return node.GetString()!; + } + + private static (DateTime Start, DateTime End, string Label) ResolvePeriod( + string period) + { + var localNow = ChinaClock.Now; + var today = localNow.Date; + DateTime startLocal; + DateTime endLocal; + string label; + switch (period) + { + case "today": + startLocal = today; + endLocal = today.AddDays(1); + label = "今天"; + break; + case "yesterday": + startLocal = today.AddDays(-1); + endLocal = today; + label = "昨天"; + break; + case "this_week": + var offset = ((int)today.DayOfWeek + 6) % 7; + startLocal = today.AddDays(-offset); + endLocal = startLocal.AddDays(7); + label = "本周"; + break; + case "this_month": + startLocal = new DateTime(today.Year, today.Month, 1); + endLocal = startLocal.AddMonths(1); + label = "本月"; + break; + case "last_month": + endLocal = new DateTime(today.Year, today.Month, 1); + startLocal = endLocal.AddMonths(-1); + label = "上月"; + break; + case "this_year": + startLocal = new DateTime(today.Year, 1, 1); + endLocal = startLocal.AddYears(1); + label = "今年"; + break; + default: + throw new InvalidOperationException("查询周期无效"); + } + return (ChinaClock.ToUtc(startLocal), ChinaClock.ToUtc(endLocal), label); + } + + private static object Schema(string json) => + JsonSerializer.Deserialize(json); + + private static string Serialize(object value) => + JsonSerializer.Serialize(value, JsonOptions); +} diff --git a/backend/MiaoJiZhang.Api/Services/AiChatQuotaService.cs b/backend/MiaoJiZhang.Api/Services/AiChatQuotaService.cs new file mode 100644 index 0000000..4195f56 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AiChatQuotaService.cs @@ -0,0 +1,98 @@ +using System.Data; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public sealed record AiChatQuotaStatus( + int Limit, + int Used, + int Remaining, + AiQuotaPeriod Period, + DateTime WindowStartedAt, + DateTime ResetAt, + bool Allowed); + +public sealed class AiChatQuotaService(AppDbContext db) +{ + public async Task TryConsumeAsync( + long userId, + CancellationToken ct = default) + { + await using var transaction = await db.Database.BeginTransactionAsync( + IsolationLevel.Serializable, + ct); + var user = await db.Users.SingleAsync(item => item.Id == userId, ct); + var status = GetStatus(user); + if (!status.Allowed) + { + await transaction.CommitAsync(ct); + return status; + } + + if (user.AiChatWindowStartedAt != status.WindowStartedAt) + { + user.AiChatWindowStartedAt = status.WindowStartedAt; + user.AiChatUsed = 0; + } + user.AiChatUsed++; + await db.SaveChangesAsync(ct); + await transaction.CommitAsync(ct); + return GetStatus(user) with { Allowed = true }; + } + + public static AiChatQuotaStatus GetStatus(User user) + { + var (start, end) = CurrentWindow(user.AiChatPeriod); + var used = user.AiChatWindowStartedAt == start + ? Math.Max(0, user.AiChatUsed) + : 0; + var limit = Math.Max(0, user.AiChatLimit); + var remaining = limit == 0 ? -1 : Math.Max(0, limit - used); + return new AiChatQuotaStatus( + limit, + used, + remaining, + user.AiChatPeriod, + start, + end, + limit == 0 || used < limit); + } + + public static (DateTime Start, DateTime End) CurrentWindow( + AiQuotaPeriod period) + { + var now = ChinaClock.Now; + var start = period switch + { + AiQuotaPeriod.Week => now.Date.AddDays(-(now.DayOfWeek == DayOfWeek.Sunday + ? 6 + : (int)now.DayOfWeek - 1)), + AiQuotaPeriod.Month => new DateTime(now.Year, now.Month, 1), + _ => now.Date, + }; + var end = period switch + { + AiQuotaPeriod.Week => start.AddDays(7), + AiQuotaPeriod.Month => start.AddMonths(1), + _ => start.AddDays(1), + }; + return (ChinaClock.ToUtc(start), ChinaClock.ToUtc(end)); + } + + public static bool TryParsePeriod(string? value, out AiQuotaPeriod period) + { + period = value?.Trim().ToLowerInvariant() switch + { + "week" => AiQuotaPeriod.Week, + "month" => AiQuotaPeriod.Month, + _ => AiQuotaPeriod.Day, + }; + return value?.Trim().ToLowerInvariant() is "day" or "week" or "month"; + } + + public static string PeriodKey(AiQuotaPeriod period) => + period.ToString().ToLowerInvariant(); +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/Services/AiPermissionService.cs b/backend/MiaoJiZhang.Api/Services/AiPermissionService.cs new file mode 100644 index 0000000..1b9b122 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AiPermissionService.cs @@ -0,0 +1,58 @@ +using System.Security.Claims; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public static class FeaturePermissionKeys +{ + public const string Ai = "ai"; +} + +public sealed class AiPermissionService(AppDbContext db) +{ + public async Task IsEnabledAsync(long userId, CancellationToken ct = default) + { + var value = await db.UserFeaturePermissions + .AsNoTracking() + .Where(x => x.UserId == userId && x.PermissionKey == FeaturePermissionKeys.Ai) + .Select(x => (bool?)x.IsEnabled) + .FirstOrDefaultAsync(ct); + // Existing installations remain compatible if a migration has not backfilled yet. + return value ?? true; + } +} + +public sealed class RequireAiPermissionAttribute : TypeFilterAttribute +{ + public RequireAiPermissionAttribute() : base(typeof(AiPermissionFilter)) + { + } +} + +public sealed class AiPermissionFilter(AiPermissionService permissions) : IAsyncActionFilter +{ + public async Task OnActionExecutionAsync( + ActionExecutingContext context, + ActionExecutionDelegate next) + { + var value = context.HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier) + ?? context.HttpContext.User.FindFirstValue("sub"); + if (!long.TryParse(value, out var userId) || + !await permissions.IsEnabledAsync(userId, context.HttpContext.RequestAborted)) + { + context.Result = new ObjectResult(new ApiError( + "AI_PERMISSION_DENIED", + "当前账号暂无 AI 功能权限")) + { + StatusCode = StatusCodes.Status403Forbidden, + }; + return; + } + + await next(); + } +} diff --git a/backend/MiaoJiZhang.Api/Services/AiServices.cs b/backend/MiaoJiZhang.Api/Services/AiServices.cs new file mode 100644 index 0000000..a68a388 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/AiServices.cs @@ -0,0 +1,170 @@ +using System.Text.RegularExpressions; +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public record ParsedBill( + TransactionType Type, + long CategoryId, + string CategoryName, + string Note, + decimal Amount, + string? PaymentMethod, + DateTime? OccurredAt = null); + +public record IntentResult(string Kind, ParsedBill? Bill); // bill | query | chat + +/// +/// Cleans legacy AI notes for list display only. It never decides intent, type, or category. +/// +public static class TransactionNoteFormatter +{ + private static readonly Regex AmountRegex = new( + @"(? 20 ? note[..20] : note; + } +} +/// +/// AI 回复文案生成。当前为模板版(性格 × 口癖),后续接 LLM。 +/// 性格模板与口癖均来自数据库(后台可配 —— 决策:Prompt 后台可调)。 +/// +public class ReplyService(AppDbContext db) +{ + public async Task BillReplyAsync(long userId, ParsedBill bill) + { + var (persona, tic) = await GetPersonaAsync(userId); + var action = bill.Type == TransactionType.Income ? "收入" : "支出"; + var body = persona switch + { + "gentle" => $"{action}记好啦~{bill.CategoryName} ¥{bill.Amount:F2}", + "strict" => $"已记录{action}:{bill.CategoryName} ¥{bill.Amount:F2}。", + "meme" => $"{action}记上了!{bill.CategoryName} ¥{bill.Amount:F2},家人们谁懂啊", + _ => bill.Type == TransactionType.Income + ? $"收入到账!{bill.CategoryName} ¥{bill.Amount:F2},钱包回血啦" + : $"记好了!{bill.CategoryName} ¥{bill.Amount:F2},这笔支出我帮你盯着", + }; + return ApplyTic(body, persona, tic); + } + public async Task QueryReplyAsync(long userId, decimal topAmount, string topCategory, double percent) + { + var (persona, tic) = await GetPersonaAsync(userId); + var body = persona switch + { + "gentle" => $"这个月「{topCategory}」花得最多,¥{topAmount:F0}(占 {percent:F0}%)~ 要不要我帮你定个小目标呀?", + "strict" => $"本月最大支出分类:{topCategory} ¥{topAmount:F2},占总支出 {percent:F0}%。建议设置分类预算。", + "meme" => $"必须是「{topCategory}」!¥{topAmount:F0},占了 {percent:F0}%,你这钱包是碎钞机吧 2333", + _ => $"是「{topCategory}」¥{topAmount:F0}(占 {percent:F0}%)!继续这么花,月底吃土", + }; + return ApplyTic(body, persona, tic); + } + + public async Task ChatReplyAsync(long userId) + { + var (persona, tic) = await GetPersonaAsync(userId); + var body = persona == "gentle" + ? "嗯嗯我在听~要记账直接说金额就行哦" + : "在听。想记账就直接说,比如「午饭 26」"; + return ApplyTic(body, persona, tic); + } + + public Task MonthlyRoastAsync( + long userId, + decimal income, + decimal expense, + string topCategory, + decimal topAmount) => + PeriodRoastAsync(userId, "这个月", income, expense, topCategory, topAmount); + + public async Task PeriodRoastAsync( + long userId, + string periodLabel, + decimal income, + decimal expense, + string topCategory, + decimal topAmount) + { + var (persona, tic) = await GetPersonaAsync(userId); + var ratio = income == 0 ? "N/A" : $"{expense / income * 100:F0}%"; + var body = persona switch + { + "gentle" => $"{periodLabel}收入 ¥{income:F0}、支出 ¥{expense:F0},「{topCategory}」花了 ¥{topAmount:F0}。我们一起把结余慢慢提高一点吧。", + "strict" => $"{periodLabel}收支比 {ratio}。最大支出分类「{topCategory}」¥{topAmount:F2},建议继续按预算复盘。", + "meme" => $"{periodLabel}收入 ¥{income:F0},支出 ¥{expense:F0},「{topCategory}」就干掉 ¥{topAmount:F0},钱包这波压力不小。", + _ => $"{periodLabel}收入 ¥{income:F0},「{topCategory}」花了 ¥{topAmount:F0}。下个周期这个分类我会继续帮你盯着。", + }; + return ApplyTic(body, persona, tic); + } + /// 表情包回复(按性格;用户发表情包时调用) + public async Task<(string Text, string? StickerKey)> StickerReplyAsync(long userId, string stickerKey) + { + var (persona, tic) = await GetPersonaAsync(userId); + if (stickerKey == "salary") + { + var t = persona == "strict" ? "检测到收入信号。请报具体金额,我来记录。" : ApplyTic("哦?发工资了?多少多少,快报数,我帮你记收入!", persona, tic); + return (t, null); + } + var text = persona switch + { + "gentle" => "哈哈收到~心情好最重要啦", + "strict" => "已收到。请继续保持记账习惯。", + "meme" => "哈哈哈哈这表情包我先存了", + _ => ApplyTic("卖萌也没用!该省还得省", persona, tic), + }; + // 回一个表情包(毒舌回生气,温柔回开心) + var replySticker = persona == "gentle" ? "happy" : "angry"; + return (text, replySticker); + } + + private async Task<(string Persona, string Tic)> GetPersonaAsync(long userId) + { + var setting = await db.AiCompanionSettings.FirstOrDefaultAsync(s => s.UserId == userId); + var personaKey = setting?.PersonaKey ?? "sassy_cat"; + var avatarKey = setting?.AvatarKey ?? "cat"; + var tic = await db.AiAvatars.Where(a => a.Key == avatarKey) + .Select(a => a.SpeechTic).FirstOrDefaultAsync() ?? ""; + return (personaKey, tic); + } + + /// 口癖跟随形象(决策 20);严格管家不用口癖 + private static string ApplyTic(string text, string persona, string tic) + { + if (string.IsNullOrEmpty(tic) || persona == "strict") return text; + return text + tic; + } +} + + diff --git a/backend/MiaoJiZhang.Api/Services/BudgetRecommendationService.cs b/backend/MiaoJiZhang.Api/Services/BudgetRecommendationService.cs new file mode 100644 index 0000000..f2697a1 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/BudgetRecommendationService.cs @@ -0,0 +1,377 @@ +using System.Text.Json; +using MiaoJiZhang.Api.Contracts; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public sealed class BudgetRecommendationService( + AppDbContext db, + ILlmClient llm, + ILogger logger) +{ + private static readonly AgentToolDefinition AdjustBudgetTool = new( + "adjust_budget_draft", + "根据用户追加指令调整当前预算草稿。必须返回完整预算草稿,不能直接写入数据库。", + JsonSerializer.Deserialize( + """ + { + "type": "object", + "properties": { + "suggestedTotal": { + "type": "number", + "minimum": 0 + }, + "items": { + "type": "array", + "maxItems": 50, + "items": { + "type": "object", + "properties": { + "categoryId": { "type": "integer" }, + "amount": { "type": "number", "minimum": 0 } + }, + "required": ["categoryId", "amount"], + "additionalProperties": false + } + }, + "summary": { + "type": "string", + "description": "一句话说明本次调整了什么" + } + }, + "required": ["suggestedTotal", "items", "summary"], + "additionalProperties": false + } + """)); + + public async Task RefineAsync( + long userId, + long ledgerId, + RefineBudgetRecommendationRequest request, + CancellationToken ct) + { + if (!llm.IsEnabled) + throw new InvalidOperationException("AI 预算调整尚未配置"); + + var instruction = request.Instruction.Trim(); + if (instruction.Length == 0) + throw new ArgumentException("请输入预算调整要求"); + if (instruction.Length > 500) + throw new ArgumentException("单次调整要求不能超过 500 个字符"); + if (request.CurrentDraft.Items.Count > 50) + throw new ArgumentException("预算分类数量过多"); + + var contexts = await LoadCategoryContextsAsync( + userId, + ledgerId, + request.Year, + request.Month, + ct); + var (currentStart, currentEnd) = + ChinaClock.MonthRangeUtc(request.Year, request.Month); + var currentSpentTotal = await db.Transactions + .Where(transaction => + transaction.UserId == userId && + transaction.LedgerId == ledgerId && + transaction.Type == TransactionType.Expense && + transaction.OccurredAt >= currentStart && + transaction.OccurredAt < currentEnd) + .SumAsync(transaction => transaction.Amount, ct); + if (contexts.Count == 0) + throw new ArgumentException("没有可用于预算的支出分类"); + + var currentItems = request.CurrentDraft.Items + .Where(item => contexts.ContainsKey(item.CategoryId)) + .GroupBy(item => item.CategoryId) + .ToDictionary(group => group.Key, group => Math.Max(0, group.Last().Amount)); + + BudgetRecommendationResponse? validated = null; + string? toolSummary = null; + var response = await llm.RunAgentAsync( + BuildSystemPrompt(request, contexts, currentItems, currentSpentTotal), + instruction, + [AdjustBudgetTool], + (call, _) => + { + if (call.Name != AdjustBudgetTool.Name) + return Task.FromResult(JsonSerializer.Serialize(new + { + ok = false, + error = "未知预算工具", + })); + + try + { + validated = ValidateToolDraft( + request, + contexts, + currentItems, + currentSpentTotal, + call.Arguments, + out toolSummary); + return Task.FromResult(JsonSerializer.Serialize(new + { + ok = true, + draft = new + { + suggestedTotal = validated.SuggestedTotal, + items = validated.Items.Select(item => new + { + categoryId = item.CategoryId, + amount = item.SuggestedAmount, + }), + }, + warnings = validated.Warnings, + })); + } + catch (Exception exception) when ( + exception is JsonException or ArgumentException) + { + return Task.FromResult(JsonSerializer.Serialize(new + { + ok = false, + error = exception.Message, + })); + } + }, + ct: ct); + + if (validated is null) + { + logger.LogWarning( + "Budget refinement completed without tool call. user={UserId} ledger={LedgerId}", + userId, + ledgerId); + throw new InvalidOperationException("AI 没有生成可用的预算调整草稿"); + } + + var summary = string.IsNullOrWhiteSpace(response.Text) + ? toolSummary ?? "已根据你的要求调整预算草稿" + : response.Text.Trim(); + return validated with { AdjustmentSummary = summary }; + } + + private async Task> LoadCategoryContextsAsync( + long userId, + long ledgerId, + int year, + int month, + CancellationToken ct) + { + var (currentStart, currentEnd) = ChinaClock.MonthRangeUtc(year, month); + var historyStart = currentStart.AddMonths(-3); + var categories = await db.Categories + .Where(category => + !category.IsDeleted && + category.Type == TransactionType.Expense && + (category.UserId == null || category.UserId == userId)) + .Select(category => new + { + category.Id, + category.Name, + category.IconKey, + category.ColorKey, + }) + .ToListAsync(ct); + var transactions = await db.Transactions + .Where(transaction => + transaction.UserId == userId && + transaction.LedgerId == ledgerId && + transaction.Type == TransactionType.Expense && + transaction.OccurredAt >= historyStart && + transaction.OccurredAt < currentEnd) + .Select(transaction => new + { + transaction.CategoryId, + transaction.Amount, + transaction.OccurredAt, + }) + .ToListAsync(ct); + + return categories.ToDictionary(category => category.Id, category => + { + var currentSpent = transactions + .Where(transaction => + transaction.CategoryId == category.Id && + transaction.OccurredAt >= currentStart) + .Sum(transaction => transaction.Amount); + var history = Enumerable.Range(1, 3) + .Select(offset => + { + var start = currentStart.AddMonths(-offset); + var end = start.AddMonths(1); + return transactions + .Where(transaction => + transaction.CategoryId == category.Id && + transaction.OccurredAt >= start && + transaction.OccurredAt < end) + .Sum(transaction => transaction.Amount); + }) + .Where(amount => amount > 0) + .ToList(); + return new CategoryContext( + category.Id, + category.Name, + category.IconKey, + category.ColorKey, + currentSpent, + history.Count == 0 ? 0 : history.Average(), + history.Count >= 3 ? "high" : history.Count > 0 ? "medium" : "low"); + }); + } + + private static string BuildSystemPrompt( + RefineBudgetRecommendationRequest request, + IReadOnlyDictionary contexts, + IReadOnlyDictionary currentItems, + decimal currentSpentTotal) + { + var history = (request.History ?? []) + .Where(turn => turn.Role is "user" or "assistant") + .TakeLast(12) + .Select(turn => new + { + role = turn.Role, + content = turn.Content.Length <= 500 + ? turn.Content + : turn.Content[..500], + }); + var payload = new + { + year = request.Year, + month = request.Month, + currentDraft = new + { + suggestedTotal = request.CurrentDraft.SuggestedTotal, + items = currentItems.Select(item => new + { + categoryId = item.Key, + amount = item.Value, + }), + }, + allowedCategories = contexts.Values.Select(context => new + { + categoryId = context.Id, + name = context.Name, + currentSpent = context.CurrentSpent, + historicalAverage = context.HistoricalAverage, + }), + currentSpentTotal, + recentConversation = history, + }; + return """ + 你是预算草稿调整 Agent。根据用户的最新指令和给定真实数据,必须调用 adjust_budget_draft。 + 工具参数必须返回完整草稿;没有要求改变的分类保持不变。只能使用 allowedCategories 中的 categoryId。 + 分类金额不得低于 currentSpent,总预算不得低于所有分类预算之和,也不得低于本月总支出。 + 如果用户要求违反约束,给出最接近的有效草稿,并在 summary 中说明。 + 工具成功后只回复一句简短、自然的调整说明,不要声称预算已经保存。 + + 财务上下文: + """ + JsonSerializer.Serialize(payload); + } + + internal static BudgetRecommendationResponse ValidateToolDraft( + RefineBudgetRecommendationRequest request, + IReadOnlyDictionary contexts, + IReadOnlyDictionary currentItems, + decimal currentSpentTotal, + string arguments, + out string summary) + { + using var document = JsonDocument.Parse(arguments); + var root = document.RootElement; + if (!root.TryGetProperty("items", out var itemsNode) || + itemsNode.ValueKind != JsonValueKind.Array) + throw new ArgumentException("AI 返回的预算分类无效"); + + summary = root.TryGetProperty("summary", out var summaryNode) + ? summaryNode.GetString()?.Trim() ?? "" + : ""; + var warnings = new List(); + var proposed = new Dictionary(); + foreach (var item in itemsNode.EnumerateArray()) + { + if (!item.TryGetProperty("categoryId", out var categoryNode) || + !categoryNode.TryGetInt64(out var categoryId) || + !contexts.TryGetValue(categoryId, out var context)) + { + warnings.Add("已忽略不存在或不可用的分类"); + continue; + } + if (!item.TryGetProperty("amount", out var amountNode) || + !amountNode.TryGetDecimal(out var amount)) + { + warnings.Add($"“{context.Name}”金额无效,已保留原值"); + continue; + } + amount = Math.Max(0, decimal.Round(amount, 2)); + if (amount < context.CurrentSpent) + { + amount = context.CurrentSpent; + warnings.Add($"“{context.Name}”不能低于已花 ¥{context.CurrentSpent:0.##}"); + } + proposed[categoryId] = amount; + } + + foreach (var current in currentItems) + { + if (!proposed.ContainsKey(current.Key)) + { + proposed[current.Key] = current.Value; + warnings.Add($"“{contexts[current.Key].Name}”未明确调整,已保留原值"); + } + } + if (proposed.Count == 0) + throw new ArgumentException("AI 没有返回可用的分类预算"); + + var requestedTotal = + root.TryGetProperty("suggestedTotal", out var totalNode) && + totalNode.TryGetDecimal(out var parsedTotal) + ? Math.Max(0, decimal.Round(parsedTotal, 2)) + : Math.Max(0, request.CurrentDraft.SuggestedTotal); + var categoryTotal = proposed.Values.Sum(); + var minimumTotal = Math.Max(categoryTotal, currentSpentTotal); + if (requestedTotal < minimumTotal) + { + requestedTotal = minimumTotal; + warnings.Add($"总预算不能低于分类合计或本月已花,已调整为 ¥{minimumTotal:0.##}"); + } + + var recommendationItems = proposed + .Where(item => item.Value > 0) + .Select(item => + { + var context = contexts[item.Key]; + return new BudgetRecommendationItemDto( + context.Id, + context.Name, + context.IconKey, + item.Value, + context.CurrentSpent, + context.HistoricalAverage, + context.Confidence, + context.ColorKey); + }) + .OrderByDescending(item => item.SuggestedAmount) + .ToList(); + return new BudgetRecommendationResponse( + request.Year, + request.Month, + requestedTotal, + "预算草稿已调整,确认应用前不会写入正式预算。", + recommendationItems, + summary, + warnings.Distinct().ToList()); + } + + internal sealed record CategoryContext( + long Id, + string Name, + string IconKey, + string ColorKey, + decimal CurrentSpent, + decimal HistoricalAverage, + string Confidence); +} diff --git a/backend/MiaoJiZhang.Api/Services/ChinaClock.cs b/backend/MiaoJiZhang.Api/Services/ChinaClock.cs new file mode 100644 index 0000000..1933967 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/ChinaClock.cs @@ -0,0 +1,49 @@ +namespace MiaoJiZhang.Api.Services; + +public static class ChinaClock +{ + private static readonly Lazy Zone = new(() => + { + try + { + return TimeZoneInfo.FindSystemTimeZoneById("Asia/Shanghai"); + } + catch (TimeZoneNotFoundException) + { + return TimeZoneInfo.FindSystemTimeZoneById("China Standard Time"); + } + }); + + public static DateTime Now => ToLocal(DateTime.UtcNow); + + public static DateTime ToLocal(DateTime utc) => + TimeZoneInfo.ConvertTimeFromUtc( + DateTime.SpecifyKind(utc, DateTimeKind.Utc), + Zone.Value); + + public static DateTime ToUtc(DateTime local) => + TimeZoneInfo.ConvertTimeToUtc( + DateTime.SpecifyKind(local, DateTimeKind.Unspecified), + Zone.Value); + + public static (DateTime Start, DateTime End) WeekRangeUtc(DateTime localDate) + { + var date = DateTime.SpecifyKind(localDate.Date, DateTimeKind.Unspecified); + var offset = ((int)date.DayOfWeek + 6) % 7; + var start = date.AddDays(-offset); + return (ToUtc(start), ToUtc(start.AddDays(7))); + } + + public static (DateTime Start, DateTime End) MonthRangeUtc(int year, int month) + { + var start = new DateTime(year, month, 1); + return (ToUtc(start), ToUtc(start.AddMonths(1))); + } + + public static (DateTime Start, DateTime End) YearRangeUtc(int year) + { + var start = new DateTime(year, 1, 1); + return (ToUtc(start), ToUtc(start.AddYears(1))); + } +} + diff --git a/backend/MiaoJiZhang.Api/Services/JwtService.cs b/backend/MiaoJiZhang.Api/Services/JwtService.cs new file mode 100644 index 0000000..56f2c23 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/JwtService.cs @@ -0,0 +1,29 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; +using MiaoJiZhang.Domain.Entities; +using Microsoft.IdentityModel.Tokens; + +namespace MiaoJiZhang.Api.Services; + +public class JwtService(IConfiguration config) +{ + public (string Token, DateTime ExpiresAt) Issue(User user) + { + var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(config["Jwt:Secret"]!)); + var expires = DateTime.UtcNow.AddDays(int.Parse(config["Jwt:ExpireDays"] ?? "30")); + var token = new JwtSecurityToken( + issuer: config["Jwt:Issuer"], + audience: config["Jwt:Audience"], + claims: + [ + new Claim(JwtRegisteredClaimNames.Sub, user.Id.ToString()), + new Claim(JwtRegisteredClaimNames.UniqueName, user.Username), + new Claim("auth_version", user.AuthVersion.ToString()), + ], + expires: expires, + signingCredentials: new SigningCredentials(key, SecurityAlgorithms.HmacSha256)); + return (new JwtSecurityTokenHandler().WriteToken(token), expires); + } +} + diff --git a/backend/MiaoJiZhang.Api/Services/LedgerResolver.cs b/backend/MiaoJiZhang.Api/Services/LedgerResolver.cs new file mode 100644 index 0000000..0e46205 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/LedgerResolver.cs @@ -0,0 +1,26 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public class LedgerResolver(AppDbContext db) +{ + public async Task ResolveAsync( + long userId, + long? requestedLedgerId, + CancellationToken ct = default) + { + if (requestedLedgerId.HasValue) + { + return await db.Ledgers + .Where(l => l.Id == requestedLedgerId.Value && l.OwnerId == userId) + .Select(l => (long?)l.Id) + .FirstOrDefaultAsync(ct); + } + + return await db.Ledgers + .Where(l => l.OwnerId == userId && l.IsDefault) + .Select(l => (long?)l.Id) + .FirstOrDefaultAsync(ct); + } +} diff --git a/backend/MiaoJiZhang.Api/Services/LlmClient.cs b/backend/MiaoJiZhang.Api/Services/LlmClient.cs new file mode 100644 index 0000000..64a87f7 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/LlmClient.cs @@ -0,0 +1,96 @@ +namespace MiaoJiZhang.Api.Services; + +public interface ILlmClient +{ + bool IsEnabled { get; } + Task TryParseIntentAsync(string userText, CancellationToken ct = default); + Task TryGenerateReplyAsync(string systemPrompt, string userText, CancellationToken ct = default); + Task?> AnalyzeImageAsync( + byte[] imageBytes, + string mimeType, + CancellationToken ct = default); + Task<(bool Ok, string? Error)> TestConnectionAsync(CancellationToken ct = default); + + Task RunAgentAsync( + string systemPrompt, + string userText, + IReadOnlyList tools, + Func> executeTool, + Func? onToken = null, + Func? onToolRunning = null, + CancellationToken ct = default); + + /// 流式生成回复。将 LLM 返回的 token 逐个写入 writer,完成时返回。 + Task StreamReplyAsync( + string systemPrompt, + string userText, + Func onToken, + CancellationToken ct = default); +} + +public record AgentToolDefinition( + string Name, + string Description, + object Parameters); + +public record AgentToolCall( + string CallId, + string Name, + string Arguments); + +public record AgentRunResponse( + string Text, + int ToolCallCount); + +public record ImageParseResult( + string Type, + decimal Amount, + string CategoryName, + string? PaymentMethod, + string Note, + DateTime? OccurredAt); + +public class NullLlmClient : ILlmClient +{ + public bool IsEnabled => false; + + public Task TryParseIntentAsync( + string userText, + CancellationToken ct = default) => + Task.FromResult(null); + + public Task TryGenerateReplyAsync( + string systemPrompt, + string userText, + CancellationToken ct = default) => + Task.FromResult(null); + + public Task?> AnalyzeImageAsync( + byte[] imageBytes, + string mimeType, + CancellationToken ct = default) => + Task.FromResult?>(null); + + public Task<(bool Ok, string? Error)> TestConnectionAsync( + CancellationToken ct = default) => + Task.FromResult<(bool, string?)>((false, "API Key 为空")); + + public Task RunAgentAsync( + string systemPrompt, + string userText, + IReadOnlyList tools, + Func> executeTool, + Func? onToken = null, + Func? onToolRunning = null, + CancellationToken ct = default) => + Task.FromResult(new AgentRunResponse("", 0)); + + public async Task StreamReplyAsync( + string systemPrompt, + string userText, + Func onToken, + CancellationToken ct = default) + { + await Task.CompletedTask; + } +} diff --git a/backend/MiaoJiZhang.Api/Services/OpenAiAgentClient.cs b/backend/MiaoJiZhang.Api/Services/OpenAiAgentClient.cs new file mode 100644 index 0000000..cca3fcc --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/OpenAiAgentClient.cs @@ -0,0 +1,338 @@ +using System.Text; +using System.Text.Json; + +namespace MiaoJiZhang.Api.Services; + +public partial class OpenAiVisionClient +{ + public async Task RunAgentAsync( + string systemPrompt, + string userText, + IReadOnlyList tools, + Func> executeTool, + Func? onToken = null, + Func? onToolRunning = null, + CancellationToken ct = default) + { + Load(); + if (string.IsNullOrWhiteSpace(_apiKey)) + throw new InvalidOperationException("AI 功能尚未配置"); + if (_protocol != "responses") + throw new InvalidOperationException("AI Agent 记账要求使用 Responses 协议"); + + var providerTools = tools.Select(tool => new + { + type = "function", + name = tool.Name, + description = tool.Description, + parameters = tool.Parameters, + }).ToArray(); + var input = new object[] + { + new { role = "system", content = systemPrompt }, + new { role = "user", content = userText }, + }; + + string? previousResponseId = null; + IReadOnlyList? toolOutputs = null; + var text = new StringBuilder(); + var toolCallCount = 0; + + for (var round = 0; round < 4; round++) + { + object body = previousResponseId is null + ? new + { + model = _model, + input, + tools = providerTools, + tool_choice = "auto", + max_output_tokens = _maxTokens, + temperature = 0.3, + thinking = new { type = "disabled" }, + store = true, + stream = true, + } + : new + { + model = _model, + previous_response_id = previousResponseId, + input = toolOutputs, + tools = providerTools, + tool_choice = "auto", + max_output_tokens = _maxTokens, + temperature = 0.3, + thinking = new { type = "disabled" }, + store = true, + stream = true, + }; + + var turn = await StreamAgentTurnAsync( + body, + async (token, tokenCt) => + { + text.Append(token); + if (onToken is not null) await onToken(token, tokenCt); + }, + ct); + previousResponseId = turn.ResponseId; + + if (turn.Calls.Count == 0) + return new AgentRunResponse(text.ToString().Trim(), toolCallCount); + if (string.IsNullOrWhiteSpace(previousResponseId)) + throw new InvalidOperationException("AI 工具调用缺少响应 ID"); + + var outputs = new List(); + foreach (var call in turn.Calls) + { + toolCallCount++; + if (toolCallCount > 12) + throw new InvalidOperationException("AI 工具调用次数过多,请重新描述需求"); + if (onToolRunning is not null) + await onToolRunning(call.Name, ct); + + string output; + try + { + output = await executeTool(call, ct); + } + catch (Exception ex) + { + _logger.LogWarning( + ex, + "Agent tool failed. tool={Tool} callId={CallId}", + call.Name, + call.CallId); + output = JsonSerializer.Serialize(new + { + ok = false, + error = ex.Message, + }); + } + outputs.Add(new + { + type = "function_call_output", + call_id = call.CallId, + output, + }); + } + toolOutputs = outputs; + } + + throw new InvalidOperationException("AI 工具调用轮次过多,请重新描述需求"); + } + + private async Task StreamAgentTurnAsync( + object body, + Func onToken, + CancellationToken ct) + { + var request = new HttpRequestMessage( + HttpMethod.Post, + _baseUrl + "/responses") + { + Content = new StringContent( + JsonSerializer.Serialize(body), + Encoding.UTF8, + "application/json"), + }; + request.Headers.Add("Authorization", "Bearer " + _apiKey); + + using var response = await _http.SendAsync( + request, + HttpCompletionOption.ResponseHeadersRead, + ct); + if (!response.IsSuccessStatusCode) + { + var detail = await response.Content.ReadAsStringAsync(ct); + throw new HttpRequestException( + $"AI Agent 请求失败 ({(int)response.StatusCode}):{ReadAgentError(detail)}"); + } + + using var stream = await response.Content.ReadAsStreamAsync(ct); + using var reader = new StreamReader(stream); + var calls = new Dictionary(); + string? responseId = null; + var emittedText = false; + + while (!reader.EndOfStream && !ct.IsCancellationRequested) + { + var line = await reader.ReadLineAsync(ct); + if (string.IsNullOrWhiteSpace(line) || line == "data: [DONE]") continue; + if (!line.StartsWith("data:", StringComparison.Ordinal)) continue; + + var payload = line[5..].TrimStart(); + if (payload.Length == 0 || payload == "[DONE]") continue; + using var document = JsonDocument.Parse(payload); + var root = document.RootElement; + var eventType = TryGetProperty(root, "type", out var typeNode) + ? typeNode.GetString() + : null; + + if (eventType is "response.failed" or "error") + throw new InvalidOperationException(ReadAgentError(payload)); + + if (TryGetProperty(root, "response", out var responseNode) && + responseNode.ValueKind == JsonValueKind.Object && + TryGetProperty(responseNode, "id", out var responseIdNode)) + { + responseId = responseIdNode.GetString() ?? responseId; + } + + if (eventType == "response.output_text.delta" && + TryGetProperty(root, "delta", out var deltaNode) && + deltaNode.ValueKind == JsonValueKind.String) + { + var token = deltaNode.GetString(); + if (!string.IsNullOrEmpty(token)) + { + emittedText = true; + await onToken(token, ct); + } + continue; + } + + if (eventType == "response.output_item.added" && + TryGetProperty(root, "item", out var itemNode)) + { + AddFunctionCall(itemNode, calls); + continue; + } + + if (eventType == "response.function_call_arguments.delta") + { + var key = ReadCallKey(root); + if (key is not null && calls.TryGetValue(key, out var builder) && + TryGetProperty(root, "delta", out var argumentDelta)) + { + builder.Arguments.Append(argumentDelta.GetString()); + } + continue; + } + + if (eventType == "response.function_call_arguments.done") + { + var key = ReadCallKey(root); + if (key is not null && calls.TryGetValue(key, out var builder) && + TryGetProperty(root, "arguments", out var argumentsNode)) + { + builder.Arguments.Clear(); + builder.Arguments.Append(argumentsNode.GetString()); + } + continue; + } + + if (eventType == "response.completed" && + TryGetProperty(root, "response", out var completedResponse)) + { + AddFunctionCallsFromResponse(completedResponse, calls); + if (!emittedText) + { + var completeText = ExtractResponseText(completedResponse); + if (!string.IsNullOrWhiteSpace(completeText)) + { + emittedText = true; + await onToken(completeText, ct); + } + } + } + } + + return new AgentProviderTurn( + responseId, + calls.Values + .Where(call => !string.IsNullOrWhiteSpace(call.CallId) && + !string.IsNullOrWhiteSpace(call.Name)) + .Select(call => new AgentToolCall( + call.CallId, + call.Name, + call.Arguments.ToString())) + .ToList()); + } + + private static void AddFunctionCallsFromResponse( + JsonElement response, + Dictionary calls) + { + if (!TryGetProperty(response, "output", out var output) || + output.ValueKind != JsonValueKind.Array) return; + foreach (var item in output.EnumerateArray()) AddFunctionCall(item, calls); + } + + private static void AddFunctionCall( + JsonElement item, + Dictionary calls) + { + if (!TryGetProperty(item, "type", out var type) || + type.GetString() != "function_call") return; + + var itemId = TryGetProperty(item, "id", out var idNode) + ? idNode.GetString() + : null; + var callId = TryGetProperty(item, "call_id", out var callIdNode) + ? callIdNode.GetString() + : null; + var name = TryGetProperty(item, "name", out var nameNode) + ? nameNode.GetString() + : null; + var key = itemId ?? callId; + if (string.IsNullOrWhiteSpace(key) || string.IsNullOrWhiteSpace(callId)) return; + + if (!calls.TryGetValue(key, out var builder)) + { + builder = new AgentCallBuilder(callId!, name ?? ""); + calls[key] = builder; + } + if (!string.IsNullOrWhiteSpace(name)) builder.Name = name!; + if (TryGetProperty(item, "arguments", out var arguments) && + arguments.ValueKind == JsonValueKind.String && + !string.IsNullOrWhiteSpace(arguments.GetString())) + { + builder.Arguments.Clear(); + builder.Arguments.Append(arguments.GetString()); + } + } + + private static string? ReadCallKey(JsonElement root) + { + if (TryGetProperty(root, "item_id", out var itemId)) + return itemId.GetString(); + if (TryGetProperty(root, "call_id", out var callId)) + return callId.GetString(); + return null; + } + + private static string ReadAgentError(string raw) + { + try + { + using var document = JsonDocument.Parse(raw); + var root = document.RootElement; + if (TryGetProperty(root, "error", out var error)) + { + if (error.ValueKind == JsonValueKind.String) + return error.GetString() ?? "AI 服务返回错误"; + if (TryGetProperty(error, "message", out var message)) + return message.GetString() ?? error.ToString(); + return error.ToString(); + } + if (TryGetProperty(root, "message", out var directMessage)) + return directMessage.GetString() ?? "AI 服务返回错误"; + } + catch (JsonException) + { + } + return raw.Length > 300 ? raw[..300] : raw; + } + + private sealed record AgentProviderTurn( + string? ResponseId, + IReadOnlyList Calls); + + private sealed class AgentCallBuilder(string callId, string name) + { + public string CallId { get; } = callId; + public string Name { get; set; } = name; + public StringBuilder Arguments { get; } = new(); + } +} diff --git a/backend/MiaoJiZhang.Api/Services/OpenAiVisionClient.cs b/backend/MiaoJiZhang.Api/Services/OpenAiVisionClient.cs new file mode 100644 index 0000000..f98b2cc --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/OpenAiVisionClient.cs @@ -0,0 +1,812 @@ +using System.Globalization; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using MiaoJiZhang.Domain.Enums; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace MiaoJiZhang.Api.Services; + +public partial class OpenAiVisionClient : ILlmClient +{ + private readonly IServiceScopeFactory _sf; + private readonly HttpClient _http; + private readonly ILogger _logger; + private string? _baseUrl, _apiKey, _model, _protocol; + private int _maxTokens = 1024; + private DateTime _last = DateTime.MinValue; + private static readonly object _lk = new(); + + public OpenAiVisionClient( + IServiceScopeFactory sf, + IHttpClientFactory hf, + ILogger logger) + { + _sf = sf; + _http = hf.CreateClient("LlmClient"); + _http.Timeout = TimeSpan.FromSeconds(120); + _logger = logger; + } + public bool IsEnabled { get { Load(); return !string.IsNullOrEmpty(_apiKey); } } + + public async Task TryParseIntentAsync( + string userText, + CancellationToken ct = default) + { + if (!IsEnabled) return null; + const string prompt = + "你是记账意图识别器。只返回 JSON:" + + "{\"kind\":\"bill\"|\"query\"|\"chat\",\"type\":\"expense\"|\"income\"," + + "\"amount\":0,\"categoryName\":\"\",\"note\":\"\"}。" + + "收入信号包括赚了、工资到账、奖金、兼职、稿费、红包、报销、退款、理财收益、收款;" + + "支出分类:餐饮/饮品/购物/交通/住房/娱乐/医疗/学习/服饰/人情/旅行/其他;" + + "收入分类:工资/奖金/理财/兼职/红包/报销/其他。" + + "查询句不得返回 bill,未明确表示收入的金额默认 expense。"; + var response = await L(prompt, userText, ct); + return response is null ? null : PI(response); + } + public async Task TryGenerateReplyAsync(string s, string u, CancellationToken ct = default) + { if (!IsEnabled) return null; return await L(s, u, ct); } + + public async Task?> AnalyzeImageAsync( + byte[] img, + string mime, + CancellationToken ct = default) + { + if (!IsEnabled) return null; + + var b64 = Convert.ToBase64String(img); + var shanghaiNow = ChinaClock.Now; + var systemPrompt = $$""" + 你是账单截图识别器。逐条提取图片中所有独立、真实发生的交易,只返回 JSON: + {"bills":[{"type":"expense","amount":0,"categoryName":"","paymentMethod":null,"note":"","occurredAt":"2026-07-18T14:30:00+08:00"}]} + type 只能是 expense 或 income。 + 支出分类只能是:餐饮/饮品/购物/交通/住房/娱乐/医疗/学习/服饰/人情/旅行/其他。 + 收入分类只能是:工资/奖金/理财/兼职/红包/报销/其他。 + note 只写简短商户、商品或交易对象,不要抄整行原文。 + 当前上海时间是 {{shanghaiNow:yyyy-MM-dd HH:mm:ss}}。截图明确显示完整日期和时间时,occurredAt 返回带 +08:00 的 ISO 8601 时间; + “今天、昨天、前天”等相对日期按当前上海时间换算。缺少日期或缺少具体时分时 occurredAt 必须返回 null,不得猜测。 + 不要把总计、余额、优惠、原价、待支付、统计数字或重复展示的同一笔交易当成独立账单。 + 无法确认真实交易时返回 {"bills":[]},最多返回 20 笔。 + """; + var messages = new List(); + + if (_protocol == "messages") + { + messages.Add(new + { + role = "user", + content = new object[] + { + new + { + type = "image", + source = new { type = "base64", media_type = mime, data = b64 }, + }, + new { type = "text", text = systemPrompt }, + }, + }); + } + else if (_protocol == "responses") + { + messages.Add(new { role = "system", content = systemPrompt }); + messages.Add(new + { + role = "user", + content = new object[] + { + new { type = "input_image", image_url = "data:" + mime + ";base64," + b64 }, + new { type = "input_text", text = "提取截图中的全部独立交易" }, + }, + }); + } + else + { + messages.Add(new { role = "system", content = systemPrompt }); + messages.Add(new + { + role = "user", + content = new object[] + { + new + { + type = "image_url", + image_url = new { url = "data:" + mime + ";base64," + b64 }, + }, + new { type = "text", text = "提取截图中的全部独立交易" }, + }, + }); + } + + var diagnosticId = Guid.NewGuid().ToString("N")[..12]; + var (json, error) = await CA(BuildBody(messages, 1536, 0.1), ct); + if (json is null) + { + _logger.LogWarning( + "Image model request failed. model={Model} protocol={Protocol} requestId={RequestId} error={Error}", + _model, + _protocol, + diagnosticId, + error); + throw new InvalidOperationException(error ?? "图片模型未返回内容"); + } + + var providerRequestId = ReadProviderRequestId(json) ?? diagnosticId; + var output = EX(json); + try + { + var results = ParseImageResults(output); + _logger.LogInformation( + "Image model parse completed. model={Model} protocol={Protocol} requestId={RequestId} items={Count}", + _model, + _protocol, + providerRequestId, + results.Count); + return results; + } + catch (Exception ex) when (ex is JsonException or InvalidOperationException) + { + _logger.LogWarning( + ex, + "Image model parse failed. model={Model} protocol={Protocol} requestId={RequestId} output={Output}", + _model, + _protocol, + providerRequestId, + SanitizeOutputSnippet(output)); + throw new InvalidOperationException("图片模型返回格式无法解析,请重试", ex); + } + } + + private static IReadOnlyList ParseImageResults(string raw) + { + if (string.IsNullOrWhiteSpace(raw)) + throw new InvalidOperationException("模型没有返回可解析内容"); + + InvalidOperationException? shapeError = null; + foreach (var candidate in EnumerateJsonCandidates(raw)) + { + try + { + using var document = JsonDocument.Parse( + candidate, + new JsonDocumentOptions + { + AllowTrailingCommas = true, + CommentHandling = JsonCommentHandling.Skip, + }); + var results = new List(); + if (TryReadImageRoot(document.RootElement, results)) + return results; + shapeError = new InvalidOperationException("JSON 中没有账单字段"); + } + catch (JsonException) + { + // Keep scanning: models often add prose or multiple fenced blocks. + } + } + + if (LooksLikeNoBillReply(raw)) return []; + throw shapeError ?? new InvalidOperationException("未找到完整 JSON"); + } + + private static IEnumerable EnumerateJsonCandidates(string raw) + { + for (var start = 0; start < raw.Length; start++) + { + var opening = raw[start]; + if (opening is not ('{' or '[')) continue; + + var stack = new Stack(); + var inString = false; + var escaped = false; + for (var index = start; index < raw.Length; index++) + { + var current = raw[index]; + if (inString) + { + if (escaped) + { + escaped = false; + } + else if (current == '\\') + { + escaped = true; + } + else if (current == '"') + { + inString = false; + } + continue; + } + + if (current == '"') + { + inString = true; + continue; + } + if (current is '{' or '[') + { + stack.Push(current); + continue; + } + if (current is not ('}' or ']')) continue; + if ( + stack.Count == 0 || + (current == '}' && stack.Peek() != '{') || + (current == ']' && stack.Peek() != '[') + ) { + break; + } + + stack.Pop(); + if (stack.Count == 0) + { + yield return raw[start..(index + 1)]; + break; + } + } + } + } + + private static bool TryReadImageRoot( + JsonElement root, + List results) + { + if (root.ValueKind == JsonValueKind.Array) + { + foreach (var item in root.EnumerateArray()) AddBill(item, results); + return true; + } + if (root.ValueKind != JsonValueKind.Object) return false; + + foreach (var name in new[] { "bills", "items", "transactions", "data" }) + { + if (!TryGetProperty(root, name, out var items)) continue; + if (items.ValueKind == JsonValueKind.Array) + { + foreach (var item in items.EnumerateArray()) AddBill(item, results); + return true; + } + if (items.ValueKind == JsonValueKind.Object) + return TryReadImageRoot(items, results); + if (items.ValueKind == JsonValueKind.Null) return true; + } + + if (TryGetProperty(root, "result", out var nested)) + return TryReadImageRoot(nested, results); + if ( + TryGetProperty(root, "matched", out var matched) && + matched.ValueKind == JsonValueKind.False + ) { + return true; + } + if (TryGetProperty(root, "amount", out _)) + { + AddBill(root, results); + return true; + } + return false; + } + + private static void AddBill( + JsonElement item, + List results) + { + if (results.Count >= 20 || item.ValueKind != JsonValueKind.Object) return; + var amount = ReadAmount(item); + if (amount <= 0) return; + + var rawType = ReadText(item, "type", "transactionType", "direction"); + var type = rawType?.Trim().ToLowerInvariant() switch + { + "income" or "收入" or "入账" => "income", + "expense" or "支出" or "出账" => "expense", + _ => null, + }; + if (type is null) return; + var category = ReadText( + item, + "categoryName", + "category_name", + "category"); + var payment = ReadText( + item, + "paymentMethod", + "payment_method", + "payment", + "payMethod"); + var note = ReadText( + item, + "note", + "merchant", + "description", + "title", + "counterparty"); + var occurredAt = ReadOccurredAt(item); + + results.Add(new ImageParseResult( + type, + amount, + string.IsNullOrWhiteSpace(category) ? "其他" : category.Trim(), + string.IsNullOrWhiteSpace(payment) ? null : payment.Trim(), + string.IsNullOrWhiteSpace(note) ? "" : note.Trim(), + occurredAt)); + } + + private static DateTime? ReadOccurredAt(JsonElement item) + { + var text = ReadText( + item, + "occurredAt", + "occurred_at", + "transactionTime", + "transaction_time", + "dateTime"); + if (string.IsNullOrWhiteSpace(text)) return null; + + // Reject date-only values so the client can deliberately fall back to now. + if (!Regex.IsMatch(text, @"\b\d{4}[-/.年]\d{1,2}[-/.月]\d{1,2}") || + !Regex.IsMatch(text, @"\b\d{1,2}:\d{2}\b")) + return null; + + if (DateTimeOffset.TryParse( + text, + CultureInfo.InvariantCulture, + DateTimeStyles.AllowWhiteSpaces, + out var offsetValue)) + { + var utc = offsetValue.UtcDateTime; + return utc <= DateTime.UtcNow.AddMinutes(10) ? utc : null; + } + + if (!DateTime.TryParse( + text, + CultureInfo.GetCultureInfo("zh-CN"), + DateTimeStyles.AllowWhiteSpaces, + out var localValue)) + return null; + var localUtc = ChinaClock.ToUtc(localValue); + return localUtc <= DateTime.UtcNow.AddMinutes(10) ? localUtc : null; + } + + private static decimal ReadAmount(JsonElement item) + { + JsonElement amount = default; + var found = + TryGetProperty(item, "amount", out amount) || + TryGetProperty(item, "money", out amount) || + TryGetProperty(item, "price", out amount); + if (!found) return 0; + if ( + amount.ValueKind == JsonValueKind.Number && + amount.TryGetDecimal(out var number) + ) { + return number; + } + if (amount.ValueKind != JsonValueKind.String) return 0; + + var text = amount.GetString()?.Replace(",", ""); + if (string.IsNullOrWhiteSpace(text)) return 0; + var match = Regex.Match(text, @"-?\d+(?:\.\d+)?"); + return match.Success && + decimal.TryParse( + match.Value, + NumberStyles.Number, + CultureInfo.InvariantCulture, + out var parsed) + ? parsed + : 0; + } + + private static string? ReadText(JsonElement item, params string[] names) + { + foreach (var name in names) + { + if (!TryGetProperty(item, name, out var value)) continue; + if (value.ValueKind == JsonValueKind.String) return value.GetString(); + if (value.ValueKind is JsonValueKind.Number or JsonValueKind.True or JsonValueKind.False) + return value.ToString(); + } + return null; + } + + private static bool TryGetProperty( + JsonElement element, + string name, + out JsonElement value) + { + foreach (var property in element.EnumerateObject()) + { + if (!property.Name.Equals(name, StringComparison.OrdinalIgnoreCase)) + continue; + value = property.Value; + return true; + } + value = default; + return false; + } + + private static bool LooksLikeNoBillReply(string raw) + { + return raw.Contains("没有账单", StringComparison.OrdinalIgnoreCase) || + raw.Contains("未发现交易", StringComparison.OrdinalIgnoreCase) || + raw.Contains("无法确认", StringComparison.OrdinalIgnoreCase) || + raw.Contains("no transaction", StringComparison.OrdinalIgnoreCase); + } + + private static string? ReadProviderRequestId(string json) + { + try + { + using var document = JsonDocument.Parse(json); + var root = document.RootElement; + foreach (var name in new[] { "id", "request_id", "requestId" }) + { + if ( + TryGetProperty(root, name, out var value) && + value.ValueKind == JsonValueKind.String + ) { + return value.GetString(); + } + } + } + catch (JsonException) + { + // The normal response parser will report the malformed payload. + } + return null; + } + + private static string SanitizeOutputSnippet(string raw) + { + var sanitized = Regex.Replace( + raw, + @"(?i)""(note|merchant|description|counterparty|paymentMethod|payment_method)""\s*:\s*""(?:\\.|[^""])*""", + @"""$1"":""***"""); + sanitized = Regex.Replace(sanitized, @"\b\d{4,}\b", "***"); + sanitized = Regex.Replace(sanitized, @"\s+", " ").Trim(); + return sanitized.Length <= 500 ? sanitized : sanitized[..500] + "…"; + } + + public async Task<(bool, string?)> TestConnectionAsync(CancellationToken ct = default) + { + Load(); + if (string.IsNullOrEmpty(_apiKey)) return (false, "API Key 为空"); + if (_protocol != "responses") + return (false, "AI Agent 记账要求使用 Responses 协议"); + + try + { + var tool = new AgentToolDefinition( + "diagnostic_echo", + "连接测试时必须调用的无副作用工具", + JsonSerializer.Deserialize( + """{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}""")); + var response = await RunAgentAsync( + "你正在执行连接测试。必须调用 diagnostic_echo,参数 value 填 ok。", + "执行工具调用测试", + [tool], + (_, _) => Task.FromResult("{\"ok\":true}"), + ct: ct); + return response.ToolCallCount > 0 + ? (true, null) + : (false, "模型返回了文本,但没有触发 Function Calling"); + } + catch (Exception ex) + { + return (false, ex.Message); + } + } + + public async Task StreamReplyAsync(string s, string u, Func onToken, CancellationToken ct = default) + { + if (!IsEnabled) return; + Load(); + + + var msgs = new List(); + if (_protocol == "messages") msgs.Add(new { role = "user", content = s + "\n\n" + u }); + else { msgs.Add(new { role = "system", content = s }); msgs.Add(new { role = "user", content = u }); } + await SA(BuildBody(msgs, _maxTokens, 0.7), onToken, ct); + } + + void Load() + { + if ((DateTime.UtcNow - _last).TotalMinutes < 5) return; + lock (_lk) + { + if ((DateTime.UtcNow - _last).TotalMinutes < 5) return; + try + { + using var scope = _sf.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var config = db.AppConfigs.ToDictionary(x => x.Key, x => x.Value); + _apiKey = Environment.GetEnvironmentVariable("LLM_API_KEY") ?? ""; + _baseUrl = ( + Environment.GetEnvironmentVariable("LLM_BASE_URL") ?? + config.GetValueOrDefault("llm.base_url", "https://api.openai.com/v1") ?? + "").TrimEnd('/'); + _model = Environment.GetEnvironmentVariable("LLM_MODEL") ?? + config.GetValueOrDefault("llm.model", "gpt-4o-mini"); + _protocol = Environment.GetEnvironmentVariable("LLM_PROTOCOL") ?? + config.GetValueOrDefault("llm.protocol", "chat_completions"); + _maxTokens = int.TryParse( + config.GetValueOrDefault("llm.max_tokens"), + out var maxTokens) + ? Math.Clamp(maxTokens, 64, 4096) + : 1024; + _last = DateTime.UtcNow; + } + catch (Exception exception) + { + _logger.LogError(exception, "Failed to load LLM configuration"); + } + } + } + + async Task L(string sys, string user, CancellationToken ct) + { Load(); var msgs = new List(); if (_protocol == "messages") msgs.Add(new { role = "user", content = sys + "\n\n" + user }); else { msgs.Add(new { role = "system", content = sys }); msgs.Add(new { role = "user", content = user }); } var (j, _) = await CA(BuildBody(msgs, _maxTokens, 0.7), ct); if (j is null) return null; var content = EX(j).Trim(); return content.Length > 0 ? content : null; } + + object BuildBody(List msgs, int maxT, double temp) => _protocol switch + { "messages" => new { model = _model, messages = msgs, max_tokens = maxT, temperature = temp }, "responses" => new { model = _model, input = msgs, max_output_tokens = maxT, temperature = temp, thinking = new { type = "disabled" } }, _ => new { model = _model, messages = msgs, max_tokens = maxT, temperature = temp } }; + + async Task<(string?, string?)> CA(object body, CancellationToken ct) + { + Load(); + try + { + var ep = _protocol switch { "messages" => "/messages", "responses" => "/responses", _ => "/chat/completions" }; + var json = JsonSerializer.Serialize(body); + var req = new HttpRequestMessage(HttpMethod.Post, _baseUrl + ep) { Content = new StringContent(json, Encoding.UTF8, "application/json") }; + if (_protocol == "messages") { req.Headers.Add("x-api-key", _apiKey); req.Headers.Add("anthropic-version", "2023-06-01"); } + else req.Headers.Add("Authorization", "Bearer " + _apiKey); + var r = await _http.SendAsync(req, ct); var t = await r.Content.ReadAsStringAsync(ct); + if (r.IsSuccessStatusCode) return (t, null); + var detail = ""; + try { var e = JsonDocument.Parse(t).RootElement; if (e.TryGetProperty("error", out var er)) { string? em = null; if (er.TryGetProperty("message", out var m)) em = m.GetString(); detail = ": " + (em ?? er.ToString()); } } catch { } + var msg = ((int)r.StatusCode) switch { 401 => "401 认证失败", 403 => "403 禁止访问", 404 => "404 接口不存在", 429 => "429 频率过高", 500 => "500 服务异常", _ => ((int)r.StatusCode).ToString() }; + return (null, msg + detail); + } + catch (TaskCanceledException) { return (null, "请求超时"); } + catch (HttpRequestException ex) { return (null, "网络错误: " + (ex.InnerException?.Message ?? ex.Message)); } + catch (Exception ex) { return (null, ex.Message); } + } + + async Task SA(object body, Func onToken, CancellationToken ct) + { + Load(); + var ep = _protocol switch { "messages" => "/messages", "responses" => "/responses", _ => "/chat/completions" }; + var serialized = JsonSerializer.Serialize(body); + var json = serialized[..^1] + ",\"stream\":true}"; + var req = new HttpRequestMessage(HttpMethod.Post, _baseUrl + ep) { Content = new StringContent(json, Encoding.UTF8, "application/json") }; + if (_protocol == "messages") { req.Headers.Add("x-api-key", _apiKey); req.Headers.Add("anthropic-version", "2023-06-01"); } + else req.Headers.Add("Authorization", "Bearer " + _apiKey); + var resp = await _http.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, ct); + if (!resp.IsSuccessStatusCode) + throw new HttpRequestException($"LLM 流式请求失败 ({(int)resp.StatusCode})"); + using var stream = await resp.Content.ReadAsStreamAsync(ct); + using var reader = new StreamReader(stream); + var emitted = false; + while (!reader.EndOfStream && !ct.IsCancellationRequested) + { + var line = await reader.ReadLineAsync(ct); + if (string.IsNullOrWhiteSpace(line) || line == "data: [DONE]") continue; + var failure = StreamFailure(line); + if (failure is not null) throw new InvalidOperationException(failure); + var tok = ET(line); + if (!string.IsNullOrWhiteSpace(tok)) { emitted = true; await onToken(tok, ct); } + } + if (!emitted) throw new InvalidOperationException("AI 未返回内容"); + } + + static string? StreamFailure(string line) + { + var i = line.IndexOf('{'); + if (i < 0) return null; + try + { + var d = JsonDocument.Parse(line[i..]).RootElement; + if (!d.TryGetProperty("type", out var type)) return null; + var value = type.GetString(); + if (value == "response.incomplete") + { + var reason = d.TryGetProperty("response", out var response) + && response.TryGetProperty("incomplete_details", out var details) + && details.TryGetProperty("reason", out var reasonElement) + ? reasonElement.GetString() : null; + return reason == "length" ? "AI 输出长度不足,请稍后重试" : "AI 回复未完成"; + } + if (value is "response.failed" or "error") return "AI 服务返回失败"; + return null; + } + catch { return null; } + } + static string? ET(string line) + { + if (!line.StartsWith("data: ") && !line.StartsWith("data:")) return null; + var i = line.IndexOf('{'); if (i < 0) return null; + try + { + var d = JsonDocument.Parse(line[i..]).RootElement; + if (d.TryGetProperty("choices", out var ch) && ch.ValueKind == JsonValueKind.Array && ch.GetArrayLength() > 0 && ch[0].TryGetProperty("delta", out var dt) && dt.TryGetProperty("content", out var ct)) return ct.GetString(); + if (d.TryGetProperty("type", out var t)) + { var ty = t.GetString(); if ((ty == "response.output_text.delta" || ty == "content_block_delta") && d.TryGetProperty("delta", out var dl)) { if (dl.ValueKind == JsonValueKind.String) return dl.GetString(); if (dl.TryGetProperty("text", out var tx)) return tx.GetString(); } } + return null; + } + catch { return null; } + } + + string EX(string json) + { + try + { + using var document = JsonDocument.Parse(json); + return ExtractResponseText(document.RootElement); + } + catch (JsonException) + { + return ""; + } + } + + private static string ExtractResponseText(JsonElement root) + { + if ( + TryGetProperty(root, "output_text", out var directOutput) && + directOutput.ValueKind == JsonValueKind.String + ) { + return directOutput.GetString() ?? ""; + } + + if (TryGetProperty(root, "choices", out var choices) && + choices.ValueKind == JsonValueKind.Array) + { + foreach (var choice in choices.EnumerateArray()) + { + if (!TryGetProperty(choice, "message", out var message)) continue; + if (!TryGetProperty(message, "content", out var content)) continue; + var value = ExtractTextParts(content); + if (value.Length > 0) return value; + } + } + + if (TryGetProperty(root, "content", out var anthropicContent)) + { + var value = ExtractTextParts(anthropicContent); + if (value.Length > 0) return value; + } + + if (TryGetProperty(root, "output", out var output) && + output.ValueKind == JsonValueKind.Array) + { + var messageParts = new List(); + var fallbackParts = new List(); + foreach (var item in output.EnumerateArray()) + { + var type = TryGetProperty(item, "type", out var typeElement) + ? typeElement.GetString() + : null; + if (type == "message" && + TryGetProperty(item, "content", out var messageContent)) + { + var value = ExtractTextParts(messageContent); + if (value.Length > 0) messageParts.Add(value); + } + if (TryGetProperty(item, "summary", out var summary)) + { + var value = ExtractTextParts(summary); + if (value.Length > 0) fallbackParts.Add(value); + } + } + if (messageParts.Count > 0) return string.Join("", messageParts); + if (fallbackParts.Count > 0) return string.Join("", fallbackParts); + } + + if ( + TryGetProperty(root, "response", out var response) && + response.ValueKind == JsonValueKind.Object + ) { + return ExtractResponseText(response); + } + return ""; + } + + private static string ExtractTextParts(JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + return element.GetString() ?? ""; + if (element.ValueKind == JsonValueKind.Array) + { + var parts = new List(); + foreach (var item in element.EnumerateArray()) + { + var value = ExtractTextParts(item); + if (value.Length > 0) parts.Add(value); + } + return string.Join("", parts); + } + if (element.ValueKind != JsonValueKind.Object) return ""; + + if (TryGetProperty(element, "text", out var text)) + { + if (text.ValueKind == JsonValueKind.String) + return text.GetString() ?? ""; + if ( + text.ValueKind == JsonValueKind.Object && + TryGetProperty(text, "value", out var textValue) && + textValue.ValueKind == JsonValueKind.String + ) { + return textValue.GetString() ?? ""; + } + } + if ( + TryGetProperty(element, "output_text", out var outputText) && + outputText.ValueKind == JsonValueKind.String + ) { + return outputText.GetString() ?? ""; + } + if (TryGetProperty(element, "content", out var content)) + return ExtractTextParts(content); + return ""; + } + + static IntentResult? PI(string response) + { + try + { + var json = response.Trim(); + var fence = new string((char)96, 3); + if (json.StartsWith(fence)) + { + json = json.Replace(fence, "").Trim(); + if (json.StartsWith("json", StringComparison.OrdinalIgnoreCase)) + json = json[4..].Trim(); + } + + var document = JsonDocument.Parse(json).RootElement; + var kind = document.TryGetProperty("kind", out var kindNode) + ? kindNode.GetString() ?? "chat" + : "chat"; + if (kind != "bill") return new IntentResult(kind, null); + + var typeText = document.TryGetProperty("type", out var typeNode) + ? typeNode.GetString() + : null; + typeText = typeText?.Trim().ToLowerInvariant(); + if (typeText is null || + typeText is not ("income" or "expense")) + return new IntentResult("chat", null); + var type = typeText == "income" + ? TransactionType.Income + : TransactionType.Expense; + var category = document.TryGetProperty( + "categoryName", + out var categoryNode) + ? categoryNode.GetString() ?? "其他" + : "其他"; + var note = document.TryGetProperty("note", out var noteNode) + ? noteNode.GetString() ?? category + : category; + var amount = document.TryGetProperty("amount", out var amountNode) && + amountNode.TryGetDecimal(out var value) + ? value + : 0; + return new IntentResult( + "bill", + new ParsedBill( + type, + 0, + category, + note, + amount, + null)); + } + catch + { + return null; + } + } +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/Services/RecycleBinCleanupService.cs b/backend/MiaoJiZhang.Api/Services/RecycleBinCleanupService.cs new file mode 100644 index 0000000..7a0d838 --- /dev/null +++ b/backend/MiaoJiZhang.Api/Services/RecycleBinCleanupService.cs @@ -0,0 +1,53 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Api.Services; + +public class RecycleBinCleanupService( + IServiceScopeFactory scopeFactory, + ILogger logger) : BackgroundService +{ + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + await Cleanup(stoppingToken); + using var timer = new PeriodicTimer(TimeSpan.FromHours(24)); + while (await timer.WaitForNextTickAsync(stoppingToken)) + await Cleanup(stoppingToken); + } + + private async Task Cleanup(CancellationToken ct) + { + try + { + using var scope = scopeFactory.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var cutoff = DateTime.UtcNow.AddDays(-30); + var ids = await db.Transactions.IgnoreQueryFilters() + .Where(t => t.IsDeleted && t.DeletedAt < cutoff) + .Select(t => t.Id) + .ToListAsync(ct); + if (ids.Count == 0) return; + + await db.ChatMessages + .Where(message => + message.TransactionId.HasValue && + ids.Contains(message.TransactionId.Value)) + .ExecuteUpdateAsync(setters => setters + .SetProperty(message => message.TransactionId, (long?)null) + .SetProperty(message => message.Content, """{"deleted":true}"""), ct); + await db.Transactions.IgnoreQueryFilters() + .Where(t => ids.Contains(t.Id)) + .ExecuteDeleteAsync(ct); + logger.LogInformation( + "Permanently removed {Count} transactions after recycle-bin retention", + ids.Count); + } + catch (OperationCanceledException) when (ct.IsCancellationRequested) + { + } + catch (Exception exception) + { + logger.LogError(exception, "Recycle-bin cleanup failed"); + } + } +} diff --git a/backend/MiaoJiZhang.Api/appsettings.Development.json b/backend/MiaoJiZhang.Api/appsettings.Development.json new file mode 100644 index 0000000..ff66ba6 --- /dev/null +++ b/backend/MiaoJiZhang.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/backend/MiaoJiZhang.Api/appsettings.json b/backend/MiaoJiZhang.Api/appsettings.json new file mode 100644 index 0000000..d27d5a3 --- /dev/null +++ b/backend/MiaoJiZhang.Api/appsettings.json @@ -0,0 +1,22 @@ +{ + "Urls": "http://127.0.0.1:3000;http://0.0.0.0:5000", + "ConnectionStrings": { + "Default": "" + }, + "Jwt": { + "Secret": "", + "Issuer": "MiaoJiZhang.Api", + "Audience": "MiaoJiZhang.App", + "ExpireDays": "30" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "Admin": { + "Key": "" + } +} diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Avatars-C3PMIHdp.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Avatars-C3PMIHdp.js new file mode 100644 index 0000000..aac42ec --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Avatars-C3PMIHdp.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,vn as p,xn as m,yn as h}from"./config-provider-q7ATIdCu.js";import{n as g,r as _,t as v}from"./EditOutlined-CeylGsUo.js";import{t as y}from"./api-BV_Zb8mM.js";var b={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},x=t({__name:`Avatars`,setup(t){let x=a([]),S=a(!0),C=a(!1),w=a(null),T=a({key:``,name:``,speechTic:``,imageUrl:``,isEnabled:!0}),E=[{title:`Key`,dataIndex:`key`,key:`key`,width:90},{title:`默认名`,dataIndex:`defaultName`,key:`name`,width:100},{title:`口癖`,dataIndex:`speechTic`,key:`tic`,width:80},{title:`状态`,dataIndex:`isEnabled`,key:`on`,width:70},{title:``,key:`act`,width:150}];i(D);async function D(){S.value=!0;try{x.value=await y.avatars()}finally{S.value=!1}}function O(){w.value=null,T.value={key:``,name:``,speechTic:``,imageUrl:``,isEnabled:!0},C.value=!0}function k(e){w.value=e,T.value={key:e.key,name:e.defaultName,speechTic:e.speechTic,imageUrl:e.imageUrl||``,isEnabled:e.isEnabled},C.value=!0}async function A(){let e={...T.value,imageUrl:T.value.imageUrl||null};w.value?await y.updateAvatar(w.value.id,e):await y.createAvatar(e),c.success(w.value?`已更新`:`已创建`),C.value=!1,D()}async function j(e){await y.deleteAvatar(e),c.success(`已删除`),D()}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),y=e(`a-popconfirm`),D=e(`a-table`),M=e(`a-input`),N=e(`a-form-item`),P=e(`a-col`),F=e(`a-row`),I=e(`a-switch`),L=e(`a-form`),R=e(`a-modal`);return r(),u(d,null,[s(`div`,b,[i[7]||=s(`h2`,null,`AI 形象管理`,-1),o(a,{type:`primary`,onClick:O},{default:n(()=>[o(l(_)),i[6]||=m(` 新建形象`,-1)]),_:1})]),o(D,{columns:E,dataSource:x.value,loading:S.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`on`?(r(),p(c,{key:0,color:t.isEnabled?`green`:`default`},{default:n(()=>[m(f(t.isEnabled?`启用`:`禁用`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>k(t)},{default:n(()=>[o(l(v))]),_:1},8,[`onClick`]),o(y,{title:`确定删除?`,onConfirm:e=>j(t.id)},{default:n(()=>[o(a,{size:`small`,danger:``},{default:n(()=>[o(l(g))]),_:1})]),_:1},8,[`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`]),o(R,{open:C.value,"onUpdate:open":i[5]||=e=>C.value=e,title:w.value?`编辑形象`:`新建形象`,onOk:A,width:500},{default:n(()=>[o(L,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(F,{gutter:12},{default:n(()=>[o(P,{span:12},{default:n(()=>[o(N,{label:`Key`},{default:n(()=>[o(M,{value:T.value.key,"onUpdate:value":i[0]||=e=>T.value.key=e,placeholder:`cat`},null,8,[`value`])]),_:1})]),_:1}),o(P,{span:12},{default:n(()=>[o(N,{label:`默认名`},{default:n(()=>[o(M,{value:T.value.name,"onUpdate:value":i[1]||=e=>T.value.name=e,placeholder:`小账喵`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(N,{label:`口癖后缀`},{default:n(()=>[o(M,{value:T.value.speechTic,"onUpdate:value":i[2]||=e=>T.value.speechTic=e,placeholder:`喵 / 汪 / 留空=无口癖`},null,8,[`value`]),i[8]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`4px`}},`口癖跟随形象——决策 20`,-1)]),_:1}),o(N,{label:`头像图片 URL`},{default:n(()=>[o(M,{value:T.value.imageUrl,"onUpdate:value":i[3]||=e=>T.value.imageUrl=e,placeholder:`可选,CDN 地址`},null,8,[`value`])]),_:1}),o(N,{label:`是否启用`},{default:n(()=>[o(I,{checked:T.value.isEnabled,"onUpdate:checked":i[4]||=e=>T.value.isEnabled=e},null,8,[`checked`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{x as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Avatars-MuMOZ3tF.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Avatars-MuMOZ3tF.js new file mode 100644 index 0000000..2fb9b07 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Avatars-MuMOZ3tF.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,vn as p,xn as m,yn as h}from"./config-provider-q7ATIdCu.js";import{n as g,r as _,t as v}from"./EditOutlined-CeylGsUo.js";import{t as y}from"./api-C4vz6nB3.js";var b={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},x=t({__name:`Avatars`,setup(t){let x=a([]),S=a(!0),C=a(!1),w=a(null),T=a({key:``,name:``,speechTic:``,imageUrl:``,isEnabled:!0}),E=[{title:`Key`,dataIndex:`key`,key:`key`,width:90},{title:`默认名`,dataIndex:`defaultName`,key:`name`,width:100},{title:`口癖`,dataIndex:`speechTic`,key:`tic`,width:80},{title:`状态`,dataIndex:`isEnabled`,key:`on`,width:70},{title:``,key:`act`,width:150}];i(D);async function D(){S.value=!0;try{x.value=await y.avatars()}finally{S.value=!1}}function O(){w.value=null,T.value={key:``,name:``,speechTic:``,imageUrl:``,isEnabled:!0},C.value=!0}function k(e){w.value=e,T.value={key:e.key,name:e.defaultName,speechTic:e.speechTic,imageUrl:e.imageUrl||``,isEnabled:e.isEnabled},C.value=!0}async function A(){let e={...T.value,imageUrl:T.value.imageUrl||null};w.value?await y.updateAvatar(w.value.id,e):await y.createAvatar(e),c.success(w.value?`已更新`:`已创建`),C.value=!1,D()}async function j(e){await y.deleteAvatar(e),c.success(`已删除`),D()}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),y=e(`a-popconfirm`),D=e(`a-table`),M=e(`a-input`),N=e(`a-form-item`),P=e(`a-col`),F=e(`a-row`),I=e(`a-switch`),L=e(`a-form`),R=e(`a-modal`);return r(),u(d,null,[s(`div`,b,[i[7]||=s(`h2`,null,`AI 形象管理`,-1),o(a,{type:`primary`,onClick:O},{default:n(()=>[o(l(_)),i[6]||=m(` 新建形象`,-1)]),_:1})]),o(D,{columns:E,dataSource:x.value,loading:S.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`on`?(r(),p(c,{key:0,color:t.isEnabled?`green`:`default`},{default:n(()=>[m(f(t.isEnabled?`启用`:`禁用`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>k(t)},{default:n(()=>[o(l(v))]),_:1},8,[`onClick`]),o(y,{title:`确定删除?`,onConfirm:e=>j(t.id)},{default:n(()=>[o(a,{size:`small`,danger:``},{default:n(()=>[o(l(g))]),_:1})]),_:1},8,[`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`]),o(R,{open:C.value,"onUpdate:open":i[5]||=e=>C.value=e,title:w.value?`编辑形象`:`新建形象`,onOk:A,width:500},{default:n(()=>[o(L,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(F,{gutter:12},{default:n(()=>[o(P,{span:12},{default:n(()=>[o(N,{label:`Key`},{default:n(()=>[o(M,{value:T.value.key,"onUpdate:value":i[0]||=e=>T.value.key=e,placeholder:`cat`},null,8,[`value`])]),_:1})]),_:1}),o(P,{span:12},{default:n(()=>[o(N,{label:`默认名`},{default:n(()=>[o(M,{value:T.value.name,"onUpdate:value":i[1]||=e=>T.value.name=e,placeholder:`小账喵`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(N,{label:`口癖后缀`},{default:n(()=>[o(M,{value:T.value.speechTic,"onUpdate:value":i[2]||=e=>T.value.speechTic=e,placeholder:`喵 / 汪 / 留空=无口癖`},null,8,[`value`]),i[8]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`4px`}},`口癖跟随形象——决策 20`,-1)]),_:1}),o(N,{label:`头像图片 URL`},{default:n(()=>[o(M,{value:T.value.imageUrl,"onUpdate:value":i[3]||=e=>T.value.imageUrl=e,placeholder:`可选,CDN 地址`},null,8,[`value`])]),_:1}),o(N,{label:`是否启用`},{default:n(()=>[o(I,{checked:T.value.isEnabled,"onUpdate:checked":i[4]||=e=>T.value.isEnabled=e},null,8,[`checked`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{x as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Configs-B71XpYgR.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Configs-B71XpYgR.js new file mode 100644 index 0000000..9e29dcb --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Configs-B71XpYgR.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,bn as l,fn as u,gn as d,or as f,vn as p,xn as m,zn as h}from"./config-provider-q7ATIdCu.js";import{t as g}from"./api-BV_Zb8mM.js";var _={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`20px`}},v={style:{display:`flex`,"justify-content":`space-between`,"align-items":`flex-start`}},y={style:{"font-size":`13px`,"font-weight":`600`,"margin-bottom":`2px`}},b={style:{color:`#999`,"font-size":`11px`,"margin-bottom":`6px`}},x={key:0,style:{"margin-top":`6px`,"font-size":`18px`}},S={key:0,style:{color:`#00B386`}},C={key:1,style:{color:`#ccc`}},w={key:1,style:{"margin-top":`6px`,"font-size":`16px`,"font-weight":`700`,"word-break":`break-all`}},T={style:{color:`#999`,"font-size":`10px`,"margin-top":`4px`}},E={style:{"margin-bottom":`10px`,color:`#999`,"font-size":`12px`}},D=t({__name:`Configs`,setup(t){let D=a([]),O=a(!0),k={"brand.app_name":{label:`App 名称`,desc:`App 内展示名称`,type:`text`},"brand.slogan":{label:`App 标语`,desc:`启动页/关于页口号`,type:`text`},"brand.logo_url":{label:`Logo URL`,desc:`品牌 Logo 远程地址`,type:`url`},"limit.daily_ai_messages":{label:`全局日限额`,desc:`全站每日 AI 消息上限`,type:`number`},"limit.daily_ai_messages_per_user":{label:`每人日限额`,desc:`单用户每日 AI 消息上限`,type:`number`},"limit.max_monthly_budget":{label:`最大月预算`,desc:`用户可设置的最高月预算金额`,type:`number`},"feature.ocr_enabled":{label:`OCR 拍照识别`,desc:`是否开放 OCR 小票识别功能`,type:`switch`},"feature.voice_enabled":{label:`语音输入`,desc:`是否开放语音记账功能`,type:`switch`},"feature.ai_auto_book":{label:`AI 自动入账`,desc:`AI 识别记账意图后是否直接写库`,type:`switch`},"feature.sticker_enabled":{label:`表情包功能`,desc:`是否开放表情包面板和 AI 表情回复`,type:`switch`},"system.default_ledger_name":{label:`默认账本名`,desc:`新用户注册时自动创建`,type:`text`},"system.max_ledgers_per_user":{label:`每人最多账本`,desc:`单用户可创建账本上限`,type:`number`}},A=[{key:`brand`,label:`品牌`,prefix:`brand.`},{key:`limit`,label:`限额`,prefix:`limit.`},{key:`feature`,label:`功能开关`,prefix:`feature.`},{key:`system`,label:`系统`,prefix:`system.`}],j=d(()=>{let e={};for(let t of D.value){let n=A.find(e=>t.key.startsWith(e.prefix))?.key||`other`;e[n]||(e[n]=[]),e[n].push(t)}return e});i(M);async function M(){O.value=!0;try{D.value=await g.configs()}finally{O.value=!1}}let N=a(!1),P=a(null),F=a(``),I=d(()=>P.value?k[P.value.key]:null);function L(e){P.value=e,F.value=e.value,N.value=!0}async function R(){P.value&&(await g.updateConfig(P.value.id,F.value),c.success(`已更新 ${P.value.key}`),N.value=!1,M())}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),d=e(`a-card`),g=e(`a-col`),D=e(`a-row`),O=e(`a-tab-pane`),z=e(`a-tabs`),B=e(`a-switch`),V=e(`a-input-number`),H=e(`a-select`),U=e(`a-input`),W=e(`a-modal`);return r(),l(`div`,null,[s(`div`,_,[i[6]||=s(`h2`,{style:{margin:`0`}},`品牌配置`,-1),o(a,{onClick:M},{default:n(()=>[...i[5]||=[m(`刷新`,-1)]]),_:1})]),o(z,null,{default:n(()=>[(r(),l(u,null,h(A,e=>o(O,{key:e.key,tab:e.label},{default:n(()=>[o(D,{gutter:[16,12]},{default:n(()=>[(r(!0),l(u,null,h(j.value[e.key],e=>(r(),p(g,{key:e.id,span:8},{default:n(()=>[o(d,{size:`small`,hoverable:``,onClick:t=>L(e)},{default:n(()=>[s(`div`,v,[s(`div`,null,[s(`div`,y,f(k[e.key]?.label||e.key),1),s(`div`,b,f(k[e.key]?.desc||``),1)]),o(c,{color:`blue`,style:{"margin-left":`8px`}},{default:n(()=>[m(`v`+f(e.version),1)]),_:2},1024)]),k[e.key]?.type===`switch`?(r(),l(`div`,x,[e.value===`true`?(r(),l(`span`,S,`✅ 已开启`)):(r(),l(`span`,C,`❌ 已关闭`))])):(r(),l(`div`,w,f(e.key.includes(`key`)?`••••••••`:e.value||`(空)`),1)),s(`div`,T,f(e.updatedAt?.split(`T`)[0]),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,[`tab`])),64))]),_:1}),o(W,{open:N.value,"onUpdate:open":i[4]||=e=>N.value=e,title:`编辑配置: ${P.value?.key}`,onOk:R,width:440},{default:n(()=>[s(`div`,E,f(I.value?.desc),1),I.value?.type===`switch`?(r(),p(B,{key:0,checked:F.value===`true`,onChange:i[0]||=e=>F.value=String(e),"checked-children":`开启`,"un-checked-children":`关闭`},null,8,[`checked`])):I.value?.type===`number`?(r(),p(V,{key:1,value:F.value,"onUpdate:value":i[1]||=e=>F.value=e,style:{width:`100%`}},null,8,[`value`])):I.value?.type===`select`&&I.value.options?(r(),p(H,{key:2,value:F.value,"onUpdate:value":i[2]||=e=>F.value=e,style:{width:`100%`},options:I.value.options.map(e=>({value:e,label:e}))},null,8,[`value`,`options`])):(r(),p(U,{key:3,value:F.value,"onUpdate:value":i[3]||=e=>F.value=e},null,8,[`value`]))]),_:1},8,[`open`,`title`])])}}});export{D as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Configs-CBb0vA8L.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Configs-CBb0vA8L.js new file mode 100644 index 0000000..4a5f031 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Configs-CBb0vA8L.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,bn as l,fn as u,gn as d,or as f,vn as p,xn as m,zn as h}from"./config-provider-q7ATIdCu.js";import{t as g}from"./api-C4vz6nB3.js";var _={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`20px`}},v={style:{display:`flex`,"justify-content":`space-between`,"align-items":`flex-start`}},y={style:{"font-size":`13px`,"font-weight":`600`,"margin-bottom":`2px`}},b={style:{color:`#999`,"font-size":`11px`,"margin-bottom":`6px`}},x={key:0,style:{"margin-top":`6px`,"font-size":`18px`}},S={key:0,style:{color:`#00B386`}},C={key:1,style:{color:`#ccc`}},w={key:1,style:{"margin-top":`6px`,"font-size":`16px`,"font-weight":`700`,"word-break":`break-all`}},T={style:{color:`#999`,"font-size":`10px`,"margin-top":`4px`}},E={style:{"margin-bottom":`10px`,color:`#999`,"font-size":`12px`}},D=t({__name:`Configs`,setup(t){let D=a([]),O=a(!0),k={"brand.app_name":{label:`App 名称`,desc:`App 内展示名称`,type:`text`},"brand.slogan":{label:`App 标语`,desc:`启动页/关于页口号`,type:`text`},"brand.logo_url":{label:`Logo URL`,desc:`品牌 Logo 远程地址`,type:`url`},"limit.daily_ai_messages":{label:`全局日限额`,desc:`全站每日 AI 消息上限`,type:`number`},"limit.daily_ai_messages_per_user":{label:`每人日限额`,desc:`单用户每日 AI 消息上限`,type:`number`},"limit.max_monthly_budget":{label:`最大月预算`,desc:`用户可设置的最高月预算金额`,type:`number`},"feature.ocr_enabled":{label:`OCR 拍照识别`,desc:`是否开放 OCR 小票识别功能`,type:`switch`},"feature.voice_enabled":{label:`语音输入`,desc:`是否开放语音记账功能`,type:`switch`},"feature.ai_auto_book":{label:`AI 自动入账`,desc:`AI 识别记账意图后是否直接写库`,type:`switch`},"feature.sticker_enabled":{label:`表情包功能`,desc:`是否开放表情包面板和 AI 表情回复`,type:`switch`},"system.default_ledger_name":{label:`默认账本名`,desc:`新用户注册时自动创建`,type:`text`},"system.max_ledgers_per_user":{label:`每人最多账本`,desc:`单用户可创建账本上限`,type:`number`}},A=[{key:`brand`,label:`品牌`,prefix:`brand.`},{key:`limit`,label:`限额`,prefix:`limit.`},{key:`feature`,label:`功能开关`,prefix:`feature.`},{key:`system`,label:`系统`,prefix:`system.`}],j=d(()=>{let e={};for(let t of D.value){let n=A.find(e=>t.key.startsWith(e.prefix))?.key||`other`;e[n]||(e[n]=[]),e[n].push(t)}return e});i(M);async function M(){O.value=!0;try{D.value=await g.configs()}finally{O.value=!1}}let N=a(!1),P=a(null),F=a(``),I=d(()=>P.value?k[P.value.key]:null);function L(e){P.value=e,F.value=e.value,N.value=!0}async function R(){P.value&&(await g.updateConfig(P.value.id,F.value),c.success(`已更新 ${P.value.key}`),N.value=!1,M())}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),d=e(`a-card`),g=e(`a-col`),D=e(`a-row`),O=e(`a-tab-pane`),z=e(`a-tabs`),B=e(`a-switch`),V=e(`a-input-number`),H=e(`a-select`),U=e(`a-input`),W=e(`a-modal`);return r(),l(`div`,null,[s(`div`,_,[i[6]||=s(`h2`,{style:{margin:`0`}},`品牌配置`,-1),o(a,{onClick:M},{default:n(()=>[...i[5]||=[m(`刷新`,-1)]]),_:1})]),o(z,null,{default:n(()=>[(r(),l(u,null,h(A,e=>o(O,{key:e.key,tab:e.label},{default:n(()=>[o(D,{gutter:[16,12]},{default:n(()=>[(r(!0),l(u,null,h(j.value[e.key],e=>(r(),p(g,{key:e.id,span:8},{default:n(()=>[o(d,{size:`small`,hoverable:``,onClick:t=>L(e)},{default:n(()=>[s(`div`,v,[s(`div`,null,[s(`div`,y,f(k[e.key]?.label||e.key),1),s(`div`,b,f(k[e.key]?.desc||``),1)]),o(c,{color:`blue`,style:{"margin-left":`8px`}},{default:n(()=>[m(`v`+f(e.version),1)]),_:2},1024)]),k[e.key]?.type===`switch`?(r(),l(`div`,x,[e.value===`true`?(r(),l(`span`,S,`✅ 已开启`)):(r(),l(`span`,C,`❌ 已关闭`))])):(r(),l(`div`,w,f(e.key.includes(`key`)?`••••••••`:e.value||`(空)`),1)),s(`div`,T,f(e.updatedAt?.split(`T`)[0]),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,[`tab`])),64))]),_:1}),o(W,{open:N.value,"onUpdate:open":i[4]||=e=>N.value=e,title:`编辑配置: ${P.value?.key}`,onOk:R,width:440},{default:n(()=>[s(`div`,E,f(I.value?.desc),1),I.value?.type===`switch`?(r(),p(B,{key:0,checked:F.value===`true`,onChange:i[0]||=e=>F.value=String(e),"checked-children":`开启`,"un-checked-children":`关闭`},null,8,[`checked`])):I.value?.type===`number`?(r(),p(V,{key:1,value:F.value,"onUpdate:value":i[1]||=e=>F.value=e,style:{width:`100%`}},null,8,[`value`])):I.value?.type===`select`&&I.value.options?(r(),p(H,{key:2,value:F.value,"onUpdate:value":i[2]||=e=>F.value=e,style:{width:`100%`},options:I.value.options.map(e=>({value:e,label:e}))},null,8,[`value`,`options`])):(r(),p(U,{key:3,value:F.value,"onUpdate:value":i[3]||=e=>F.value=e},null,8,[`value`]))]),_:1},8,[`open`,`title`])])}}});export{D as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Dashboard-Bz-m6xqH.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Dashboard-Bz-m6xqH.js new file mode 100644 index 0000000..0d7e917 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Dashboard-Bz-m6xqH.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,ar as c,bn as l,fn as u,h as d,y as f,yn as p}from"./config-provider-q7ATIdCu.js";import{t as m}from"./TeamOutlined-0klbs6LP.js";import{t as h}from"./api-BV_Zb8mM.js";var g={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z`}}]},name:`dollar`,theme:`outlined`};function _(e){for(var t=1;t{try{f.value=await h.dashboard()}finally{g.value=!1}}),(t,i)=>{let a=e(`a-spin`),h=e(`a-statistic`),_=e(`a-card`),v=e(`a-col`),b=e(`a-row`),x=e(`a-progress`),S=e(`a-alert`);return g.value?(r(),l(`div`,I,[o(a,{size:`large`})])):f.value?(r(),l(u,{key:1},[i[1]||=s(`h2`,{style:{"margin-bottom":`18px`}},`📊 仪表盘`,-1),o(b,{gutter:14,style:{"margin-bottom":`14px`}},{default:n(()=>[o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`总用户`,value:f.value.users.total},{prefix:n(()=>[o(c(m))]),_:1},8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`今日活跃`,value:f.value.users.activeToday},{prefix:n(()=>[o(c(F))]),_:1},8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`总账单`,value:f.value.transactions.total},null,8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`AI 记账`,value:f.value.transactions.aiBooked},{prefix:n(()=>[o(c(j))]),_:1},8,[`value`])]),_:1})]),_:1})]),_:1}),o(b,{gutter:14,style:{"margin-bottom":`14px`}},{default:n(()=>[o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`AI 准确率`,value:f.value.aiAccuracy,suffix:`%`,"value-style":{color:f.value.aiAccuracy>=70?`#00B386`:`#F0642D`}},{prefix:n(()=>[o(c(d))]),_:1},8,[`value`,`value-style`]),o(x,{percent:f.value.aiAccuracy,showInfo:!1,size:`small`,strokeColor:f.value.aiAccuracy>=70?`#00B386`:`#F0642D`,style:{"margin-top":`6px`}},null,8,[`percent`,`strokeColor`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`撤销率`,value:f.value.undoRate,suffix:`%`,"value-style":{color:f.value.undoRate<=20?`#00B386`:`#F5A623`}},{prefix:n(()=>[o(c(D))]),_:1},8,[`value`,`value-style`]),o(x,{percent:f.value.undoRate,showInfo:!1,size:`small`,strokeColor:f.value.undoRate<=20?`#00B386`:`#F5A623`,style:{"margin-top":`6px`}},null,8,[`percent`,`strokeColor`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`AI 消息总数`,value:f.value.aiMessages},{prefix:n(()=>[o(c(C))]),_:1},8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`估算 Token 成本`,value:(f.value.aiMessages*500*.01/1e3).toFixed(2),prefix:`$`},{prefix:n(()=>[o(c(y))]),_:1},8,[`value`]),i[0]||=s(`div`,{style:{"font-size":`10px`,color:`#999`,"margin-top":`4px`}},`基于 500 token/条 × $0.01/1K 估算`,-1)]),_:1})]),_:1})]),_:1}),o(b,{gutter:14},{default:n(()=>[o(v,{span:12},{default:n(()=>[o(S,{type:`info`,"show-icon":``,message:`AI 准确率 = (AI记账总数 − 撤销数) / AI记账总数。撤销率高 → 需要调整 AI 性格 Prompt 模板。`})]),_:1}),o(v,{span:12},{default:n(()=>[o(S,{type:`warning`,"show-icon":``,message:`注意:撤销率、AI 消息数、估算成本是运营核心指标,建议每周跟踪,及时优化 Prompt 和限流阈值。`})]),_:1})]),_:1})],64)):p(``,!0)}}});export{L as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Dashboard-CQIRtW2A.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Dashboard-CQIRtW2A.js new file mode 100644 index 0000000..5c47810 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Dashboard-CQIRtW2A.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,ar as c,bn as l,fn as u,h as d,y as f,yn as p}from"./config-provider-q7ATIdCu.js";import{t as m}from"./TeamOutlined-0klbs6LP.js";import{t as h}from"./api-C4vz6nB3.js";var g={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z`}}]},name:`dollar`,theme:`outlined`};function _(e){for(var t=1;t{try{f.value=await h.dashboard()}finally{g.value=!1}}),(t,i)=>{let a=e(`a-spin`),h=e(`a-statistic`),_=e(`a-card`),v=e(`a-col`),b=e(`a-row`),x=e(`a-progress`),S=e(`a-alert`);return g.value?(r(),l(`div`,I,[o(a,{size:`large`})])):f.value?(r(),l(u,{key:1},[i[1]||=s(`h2`,{style:{"margin-bottom":`18px`}},`📊 仪表盘`,-1),o(b,{gutter:14,style:{"margin-bottom":`14px`}},{default:n(()=>[o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`总用户`,value:f.value.users.total},{prefix:n(()=>[o(c(m))]),_:1},8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`今日活跃`,value:f.value.users.activeToday},{prefix:n(()=>[o(c(F))]),_:1},8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`总账单`,value:f.value.transactions.total},null,8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`AI 记账`,value:f.value.transactions.aiBooked},{prefix:n(()=>[o(c(j))]),_:1},8,[`value`])]),_:1})]),_:1})]),_:1}),o(b,{gutter:14,style:{"margin-bottom":`14px`}},{default:n(()=>[o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`AI 准确率`,value:f.value.aiAccuracy,suffix:`%`,"value-style":{color:f.value.aiAccuracy>=70?`#00B386`:`#F0642D`}},{prefix:n(()=>[o(c(d))]),_:1},8,[`value`,`value-style`]),o(x,{percent:f.value.aiAccuracy,showInfo:!1,size:`small`,strokeColor:f.value.aiAccuracy>=70?`#00B386`:`#F0642D`,style:{"margin-top":`6px`}},null,8,[`percent`,`strokeColor`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`撤销率`,value:f.value.undoRate,suffix:`%`,"value-style":{color:f.value.undoRate<=20?`#00B386`:`#F5A623`}},{prefix:n(()=>[o(c(D))]),_:1},8,[`value`,`value-style`]),o(x,{percent:f.value.undoRate,showInfo:!1,size:`small`,strokeColor:f.value.undoRate<=20?`#00B386`:`#F5A623`,style:{"margin-top":`6px`}},null,8,[`percent`,`strokeColor`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`AI 消息总数`,value:f.value.aiMessages},{prefix:n(()=>[o(c(C))]),_:1},8,[`value`])]),_:1})]),_:1}),o(v,{span:6},{default:n(()=>[o(_,{size:`small`},{default:n(()=>[o(h,{title:`估算 Token 成本`,value:(f.value.aiMessages*500*.01/1e3).toFixed(2),prefix:`$`},{prefix:n(()=>[o(c(y))]),_:1},8,[`value`]),i[0]||=s(`div`,{style:{"font-size":`10px`,color:`#999`,"margin-top":`4px`}},`基于 500 token/条 × $0.01/1K 估算`,-1)]),_:1})]),_:1})]),_:1}),o(b,{gutter:14},{default:n(()=>[o(v,{span:12},{default:n(()=>[o(S,{type:`info`,"show-icon":``,message:`AI 准确率 = (AI记账总数 − 撤销数) / AI记账总数。撤销率高 → 需要调整 AI 性格 Prompt 模板。`})]),_:1}),o(v,{span:12},{default:n(()=>[o(S,{type:`warning`,"show-icon":``,message:`注意:撤销率、AI 消息数、估算成本是运营核心指标,建议每周跟踪,及时优化 Prompt 和限流阈值。`})]),_:1})]),_:1})],64)):p(``,!0)}}});export{L as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/EditOutlined-CeylGsUo.js b/backend/MiaoJiZhang.Api/wwwroot/assets/EditOutlined-CeylGsUo.js new file mode 100644 index 0000000..3ef1932 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/EditOutlined-CeylGsUo.js @@ -0,0 +1 @@ +import{Sn as e,y as t}from"./config-provider-q7ATIdCu.js";var n={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z`}},{tag:`path`,attrs:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z`}}]},name:`plus`,theme:`outlined`};function r(e){for(var t=1;t{let a=e(`a-button`),c=e(`a-tag`),y=e(`a-popconfirm`),D=e(`a-table`),M=e(`a-input`),N=e(`a-form-item`),P=e(`a-col`),F=e(`a-row`),I=e(`a-textarea`),L=e(`a-switch`),R=e(`a-form`),z=e(`a-modal`);return r(),u(d,null,[s(`div`,b,[i[8]||=s(`h2`,null,`AI 性格管理`,-1),o(a,{type:`primary`,onClick:O},{default:n(()=>[o(l(_)),i[7]||=m(` 新建性格`,-1)]),_:1})]),o(D,{columns:E,dataSource:x.value,loading:S.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`on`?(r(),p(c,{key:0,color:t.isEnabled?`green`:`default`},{default:n(()=>[m(f(t.isEnabled?`启用`:`禁用`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>k(t)},{default:n(()=>[o(l(v))]),_:1},8,[`onClick`]),o(y,{title:`确定删除?`,onConfirm:e=>j(t.id)},{default:n(()=>[o(a,{size:`small`,danger:``},{default:n(()=>[o(l(g))]),_:1})]),_:1},8,[`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`]),o(z,{open:C.value,"onUpdate:open":i[6]||=e=>C.value=e,title:w.value?`编辑性格`:`新建性格`,onOk:A,width:560},{default:n(()=>[o(R,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(F,{gutter:12},{default:n(()=>[o(P,{span:12},{default:n(()=>[o(N,{label:`Key`},{default:n(()=>[o(M,{value:T.value.key,"onUpdate:value":i[0]||=e=>T.value.key=e,placeholder:`sassy_cat`},null,8,[`value`])]),_:1})]),_:1}),o(P,{span:12},{default:n(()=>[o(N,{label:`名称`},{default:n(()=>[o(M,{value:T.value.name,"onUpdate:value":i[1]||=e=>T.value.name=e,placeholder:`毒舌猫娘`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(N,{label:`描述`},{default:n(()=>[o(M,{value:T.value.description,"onUpdate:value":i[2]||=e=>T.value.description=e,placeholder:`一句话描述`},null,8,[`value`])]),_:1}),o(N,{label:`示例台词`},{default:n(()=>[o(M,{value:T.value.sampleLine,"onUpdate:value":i[3]||=e=>T.value.sampleLine=e,placeholder:`这句会展示给用户选性格时看`},null,8,[`value`])]),_:1}),o(N,{label:`Prompt 模板`},{default:n(()=>[o(I,{value:T.value.promptTemplate,"onUpdate:value":i[4]||=e=>T.value.promptTemplate=e,rows:5,placeholder:`系统提示词模板,支持 {tic} 占位符,此字段可调不发版`},null,8,[`value`]),i[9]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`4px`}},[m(` ⚡ 调这个不需要发版,前端实时生效。可用占位符:`),s(`code`,null,`{'{tic}'}`),m(` = 口癖(喵/汪/无) `)],-1)]),_:1}),o(N,{label:`是否启用`},{default:n(()=>[o(L,{checked:T.value.isEnabled,"onUpdate:checked":i[5]||=e=>T.value.isEnabled=e},null,8,[`checked`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{x as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Personas-DuQ1Lxau.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Personas-DuQ1Lxau.js new file mode 100644 index 0000000..750596a --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Personas-DuQ1Lxau.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,vn as p,xn as m,yn as h}from"./config-provider-q7ATIdCu.js";import{n as g,r as _,t as v}from"./EditOutlined-CeylGsUo.js";import{t as y}from"./api-BV_Zb8mM.js";var b={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},x=t({__name:`Personas`,setup(t){let x=a([]),S=a(!0),C=a(!1),w=a(null),T=a({key:``,name:``,description:``,sampleLine:``,promptTemplate:``,isEnabled:!0}),E=[{title:`Key`,dataIndex:`key`,key:`key`,width:110},{title:`名称`,dataIndex:`name`,key:`name`,width:100},{title:`描述`,dataIndex:`description`,key:`desc`,ellipsis:!0},{title:`版本`,dataIndex:`version`,key:`ver`,width:60},{title:`状态`,dataIndex:`isEnabled`,key:`on`,width:70},{title:``,key:`act`,width:150}];i(D);async function D(){S.value=!0;try{x.value=await y.personas()}finally{S.value=!1}}function O(){w.value=null,T.value={key:``,name:``,description:``,sampleLine:``,promptTemplate:``,isEnabled:!0},C.value=!0}function k(e){w.value=e,T.value={key:e.key,name:e.name,description:e.description,sampleLine:e.sampleLine,promptTemplate:e.promptTemplate,isEnabled:e.isEnabled},C.value=!0}async function A(){let e={...T.value,isEnabled:T.value.isEnabled};w.value?await y.updatePersona(w.value.id,e):await y.createPersona(e),c.success(w.value?`已更新(版本号+1)`:`已创建`),C.value=!1,D()}async function j(e){await y.deletePersona(e),c.success(`已删除`),D()}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),y=e(`a-popconfirm`),D=e(`a-table`),M=e(`a-input`),N=e(`a-form-item`),P=e(`a-col`),F=e(`a-row`),I=e(`a-textarea`),L=e(`a-switch`),R=e(`a-form`),z=e(`a-modal`);return r(),u(d,null,[s(`div`,b,[i[8]||=s(`h2`,null,`AI 性格管理`,-1),o(a,{type:`primary`,onClick:O},{default:n(()=>[o(l(_)),i[7]||=m(` 新建性格`,-1)]),_:1})]),o(D,{columns:E,dataSource:x.value,loading:S.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`on`?(r(),p(c,{key:0,color:t.isEnabled?`green`:`default`},{default:n(()=>[m(f(t.isEnabled?`启用`:`禁用`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>k(t)},{default:n(()=>[o(l(v))]),_:1},8,[`onClick`]),o(y,{title:`确定删除?`,onConfirm:e=>j(t.id)},{default:n(()=>[o(a,{size:`small`,danger:``},{default:n(()=>[o(l(g))]),_:1})]),_:1},8,[`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`]),o(z,{open:C.value,"onUpdate:open":i[6]||=e=>C.value=e,title:w.value?`编辑性格`:`新建性格`,onOk:A,width:560},{default:n(()=>[o(R,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(F,{gutter:12},{default:n(()=>[o(P,{span:12},{default:n(()=>[o(N,{label:`Key`},{default:n(()=>[o(M,{value:T.value.key,"onUpdate:value":i[0]||=e=>T.value.key=e,placeholder:`sassy_cat`},null,8,[`value`])]),_:1})]),_:1}),o(P,{span:12},{default:n(()=>[o(N,{label:`名称`},{default:n(()=>[o(M,{value:T.value.name,"onUpdate:value":i[1]||=e=>T.value.name=e,placeholder:`毒舌猫娘`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(N,{label:`描述`},{default:n(()=>[o(M,{value:T.value.description,"onUpdate:value":i[2]||=e=>T.value.description=e,placeholder:`一句话描述`},null,8,[`value`])]),_:1}),o(N,{label:`示例台词`},{default:n(()=>[o(M,{value:T.value.sampleLine,"onUpdate:value":i[3]||=e=>T.value.sampleLine=e,placeholder:`这句会展示给用户选性格时看`},null,8,[`value`])]),_:1}),o(N,{label:`Prompt 模板`},{default:n(()=>[o(I,{value:T.value.promptTemplate,"onUpdate:value":i[4]||=e=>T.value.promptTemplate=e,rows:5,placeholder:`系统提示词模板,支持 {tic} 占位符,此字段可调不发版`},null,8,[`value`]),i[9]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`4px`}},[m(` ⚡ 调这个不需要发版,前端实时生效。可用占位符:`),s(`code`,null,`{'{tic}'}`),m(` = 口癖(喵/汪/无) `)],-1)]),_:1}),o(N,{label:`是否启用`},{default:n(()=>[o(L,{checked:T.value.isEnabled,"onUpdate:checked":i[5]||=e=>T.value.isEnabled=e},null,8,[`checked`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{x as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/ReloadOutlined-CVrW_3-b.js b/backend/MiaoJiZhang.Api/wwwroot/assets/ReloadOutlined-CVrW_3-b.js new file mode 100644 index 0000000..084a56f --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/ReloadOutlined-CVrW_3-b.js @@ -0,0 +1 @@ +import{Sn as e,y as t}from"./config-provider-q7ATIdCu.js";var n={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z`}}]},name:`reload`,theme:`outlined`};function r(e){for(var t=1;t{try{let e=await g.configs(),t={};for(let n of e)t[n.key]=n;x.value=t,t[`llm.protocol`]||N(`llm.protocol`,`chat_completions`),P.value=M(`llm.protocol`)||`chat_completions`}finally{S.value=!1}});function M(e){let t=x.value[e];if(!t)return``;let n=j[e];return n?.type===`number`?Number(t.value)||0:n?.type===`switch`?t.value===`true`:t.value}function N(e,t){let n=String(t);x.value[e]?x.value[e].value=n:x.value[e]={id:0,key:e,value:n,version:0}}let P=a(`chat_completions`);async function F(e){N(`llm.protocol`,P.value);let t=e.filter(e=>x.value[e]).map(async e=>{let t=x.value[e];try{if(t.id>0){let e=await g.updateConfig(t.id,t.value);t&&(t.id=e.id)}else{let e=await g.createConfig(t.key,t.value);t&&(t.id=e.id)}}catch(t){c.error(e+` 保存失败: `+(t?.response?.data?.detail||t?.response?.data?.error||t.message))}});if(t.length===0){c.warning(`没有可保存的配置`);return}await Promise.all(t),c.success(`已保存 `+t.length+` 项配置`)}async function I(){C.value=!0,w.value=null,T.value=``;try{let e=await g.testLlm();w.value=e.ok,T.value=e.detail||e.error||``,e.ok?c.success(`LLM 连接正常`):c.error(e.error||`连接失败`)}catch(e){w.value=!1;let t=e?.response?.data;T.value=t?.detail||t?.error||t?.message||e.message||`未知错误`,c.error(`连接失败`)}finally{C.value=!1}}return(t,i)=>{let a=e(`a-spin`),c=e(`a-button`),g=e(`a-space`),x=e(`a-alert`),L=e(`a-radio`),R=e(`a-col`),z=e(`a-row`),B=e(`a-radio-group`),V=e(`a-descriptions-item`),H=e(`a-input`),U=e(`a-input-number`),W=e(`a-descriptions`),G=e(`a-card`),K=e(`a-switch`);return S.value?(r(),l(`div`,_,[o(a,{size:`large`})])):(r(),l(u,{key:1},[i[15]||=s(`h2`,{style:{"margin-bottom":`18px`}},`系统设置`,-1),o(G,{title:`LLM 大模型配置`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(g,null,{default:n(()=>[o(c,{size:`small`,onClick:I,loading:C.value},{default:n(()=>[...i[9]||=[p(`测试连接`,-1)]]),_:1},8,[`loading`]),o(c,{size:`small`,type:`primary`,onClick:i[0]||=e=>F(E)},{default:n(()=>[...i[10]||=[p(`保存`,-1)]]),_:1})]),_:1})]),default:n(()=>[w.value===null?m(``,!0):(r(),f(x,{key:0,type:w.value?`success`:`error`,message:w.value?`连接成功`:`连接失败`,description:T.value,"show-icon":``,style:{"margin-bottom":`14px`},closable:``},null,8,[`type`,`message`,`description`])),o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[o(V,{label:`API 协议`,span:2},{default:n(()=>[o(B,{value:P.value,"onUpdate:value":i[1]||=e=>P.value=e,style:{width:`100%`}},{default:n(()=>[o(z,{gutter:[8,8]},{default:n(()=>[(r(),l(u,null,h(A,e=>o(R,{key:e.value,span:8},{default:n(()=>[o(L,{value:e.value,style:{display:`block`}},{default:n(()=>[s(`span`,v,d(e.label),1),s(`div`,y,d(e.desc),1),s(`div`,b,d(e.endpoint),1)]),_:2},1032,[`value`])]),_:2},1024)),64))]),_:1})]),_:1},8,[`value`])]),_:1}),o(V,{label:`API 地址`,span:2},{default:n(()=>[o(H,{value:M(`llm.base_url`),onChange:i[2]||=e=>N(`llm.base_url`,e.target.value),placeholder:`https://api.openai.com/v1`},null,8,[`value`]),i[11]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`2px`}},`会自动拼上协议路径`,-1)]),_:1}),o(V,{label:`API Key`,span:2},{default:n(()=>[o(x,{type:`info`,message:`API Key 仅通过服务器环境变量 LLM_API_KEY 配置,后台不会读取或显示完整密钥。`,"show-icon":``})]),_:1}),o(V,{label:`模型名称`,span:2},{default:n(()=>[o(H,{value:M(`llm.model`),onChange:i[3]||=e=>N(`llm.model`,e.target.value),placeholder:`gpt-4o-mini`},null,8,[`value`])]),_:1}),o(V,{label:`最大输出 Token`,span:1},{default:n(()=>[o(U,{value:M(`llm.max_tokens`),onChange:i[4]||=e=>N(`llm.max_tokens`,e),style:{width:`100%`},min:1},null,8,[`value`])]),_:1}),o(V,{label:`温度`,span:1},{default:n(()=>[o(U,{value:M(`llm.temperature`),onChange:i[5]||=e=>N(`llm.temperature`,e),style:{width:`100%`},min:0,max:2,step:.1},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(G,{title:`限额配置`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(c,{size:`small`,type:`primary`,onClick:i[6]||=e=>F(D)},{default:n(()=>[...i[12]||=[p(`保存`,-1)]]),_:1})]),default:n(()=>[o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[(r(),l(u,null,h(D,e=>o(V,{key:e,label:j[e]?.label,span:1},{default:n(()=>[o(U,{value:M(e),onChange:t=>N(e,t),style:{width:`100%`},min:0},null,8,[`value`,`onChange`])]),_:2},1032,[`label`])),64))]),_:1})]),_:1}),o(G,{title:`功能开关`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(c,{size:`small`,type:`primary`,onClick:i[7]||=e=>F(O)},{default:n(()=>[...i[13]||=[p(`保存`,-1)]]),_:1})]),default:n(()=>[o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[(r(),l(u,null,h(O,e=>o(V,{key:e,label:j[e]?.label,span:1},{default:n(()=>[o(K,{checked:M(e),onChange:t=>N(e,t)},null,8,[`checked`,`onChange`])]),_:2},1032,[`label`])),64))]),_:1})]),_:1}),o(G,{title:`系统 & 品牌`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(c,{size:`small`,type:`primary`,onClick:i[8]||=e=>F(k)},{default:n(()=>[...i[14]||=[p(`保存`,-1)]]),_:1})]),default:n(()=>[o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[(r(),l(u,null,h(k,e=>o(V,{key:e,label:j[e]?.label,span:e===`brand.slogan`||e===`brand.logo_url`?2:1},{default:n(()=>[e===`system.max_ledgers_per_user`?(r(),f(U,{key:0,value:M(e),onChange:t=>N(e,t),style:{width:`100%`},min:1,max:50},null,8,[`value`,`onChange`])):(r(),f(H,{key:1,value:M(e),onChange:t=>N(e,t.target.value)},null,8,[`value`,`onChange`]))]),_:2},1032,[`label`,`span`])),64))]),_:1})]),_:1})],64))}}});export{x as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Settings-EMIo5EVq.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Settings-EMIo5EVq.js new file mode 100644 index 0000000..5cfeb47 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Settings-EMIo5EVq.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,bn as l,fn as u,or as d,vn as f,xn as p,yn as m,zn as h}from"./config-provider-q7ATIdCu.js";import{t as g}from"./api-C4vz6nB3.js";var _={key:0,style:{"text-align":`center`,padding:`60px`}},v={style:{"font-weight":`600`}},y={style:{"font-size":`11px`,color:`#999`,"margin-top":`2px`,"white-space":`normal`}},b={style:{"font-size":`10px`,color:`#bbb`,"margin-top":`2px`,"font-family":`monospace`}},x=t({__name:`Settings`,setup(t){let x=a({}),S=a(!0),C=a(!1),w=a(null),T=a(``),E=[`llm.protocol`,`llm.base_url`,`llm.model`,`llm.max_tokens`,`llm.temperature`],D=[`limit.daily_ai_messages`,`limit.daily_ai_messages_per_user`,`limit.max_monthly_budget`],O=[`feature.ocr_enabled`,`feature.voice_enabled`,`feature.ai_auto_book`,`feature.sticker_enabled`],k=[`system.default_ledger_name`,`system.max_ledgers_per_user`,`brand.app_name`,`brand.slogan`,`brand.logo_url`],A=[{value:`chat_completions`,label:`Chat Completions`,desc:`OpenAI Chat Completions API。POST /v1/chat/completions`,endpoint:`/chat/completions`},{value:`responses`,label:`Responses`,desc:`OpenAI Responses API(新版)。POST /v1/responses`,endpoint:`/responses`},{value:`messages`,label:`Messages`,desc:`Anthropic Messages API。POST /v1/messages,用于 Claude 系列`,endpoint:`/messages`}],j={"llm.protocol":{label:`API 协议`,desc:``,type:`protocol`},"llm.base_url":{label:`API 地址`,desc:``,type:`url`},"llm.model":{label:`模型名称`,desc:``,type:`text`},"llm.max_tokens":{label:`最大输出 Token`,desc:`单次请求上限`,type:`number`},"llm.temperature":{label:`温度 (Temperature)`,desc:`0=确定 1=创意`,type:`number`},"limit.daily_ai_messages":{label:`全站每日 AI 消息上限`,desc:``,type:`number`},"limit.daily_ai_messages_per_user":{label:`每人每日 AI 消息上限`,desc:``,type:`number`},"limit.max_monthly_budget":{label:`最大月预算金额`,desc:``,type:`number`},"feature.ocr_enabled":{label:`OCR 小票识别`,desc:`拍照记账功能`,type:`switch`},"feature.voice_enabled":{label:`语音记账`,desc:`语音输入转文字`,type:`switch`},"feature.ai_auto_book":{label:`AI 自动入账`,desc:`AI 识别记账意图直接入账`,type:`switch`},"feature.sticker_enabled":{label:`表情包功能`,desc:`聊天表情包面板 + AI 表情回复`,type:`switch`},"system.default_ledger_name":{label:`新用户默认账本名`,desc:``,type:`text`},"system.max_ledgers_per_user":{label:`每人最多账本数`,desc:``,type:`number`},"brand.app_name":{label:`App 名称`,desc:``,type:`text`},"brand.slogan":{label:`App 标语`,desc:``,type:`text`},"brand.logo_url":{label:`Logo URL`,desc:``,type:`url`}};i(async()=>{try{let e=await g.configs(),t={};for(let n of e)t[n.key]=n;x.value=t,t[`llm.protocol`]||N(`llm.protocol`,`chat_completions`),P.value=M(`llm.protocol`)||`chat_completions`}finally{S.value=!1}});function M(e){let t=x.value[e];if(!t)return``;let n=j[e];return n?.type===`number`?Number(t.value)||0:n?.type===`switch`?t.value===`true`:t.value}function N(e,t){let n=String(t);x.value[e]?x.value[e].value=n:x.value[e]={id:0,key:e,value:n,version:0}}let P=a(`chat_completions`);async function F(e){N(`llm.protocol`,P.value);let t=e.filter(e=>x.value[e]).map(async e=>{let t=x.value[e];try{if(t.id>0){let e=await g.updateConfig(t.id,t.value);t&&(t.id=e.id)}else{let e=await g.createConfig(t.key,t.value);t&&(t.id=e.id)}}catch(t){c.error(e+` 保存失败: `+(t?.response?.data?.detail||t?.response?.data?.error||t.message))}});if(t.length===0){c.warning(`没有可保存的配置`);return}await Promise.all(t),c.success(`已保存 `+t.length+` 项配置`)}async function I(){C.value=!0,w.value=null,T.value=``;try{let e=await g.testLlm();w.value=e.ok,T.value=e.detail||e.error||``,e.ok?c.success(`LLM 连接正常`):c.error(e.error||`连接失败`)}catch(e){w.value=!1;let t=e?.response?.data;T.value=t?.detail||t?.error||t?.message||e.message||`未知错误`,c.error(`连接失败`)}finally{C.value=!1}}return(t,i)=>{let a=e(`a-spin`),c=e(`a-button`),g=e(`a-space`),x=e(`a-alert`),L=e(`a-radio`),R=e(`a-col`),z=e(`a-row`),B=e(`a-radio-group`),V=e(`a-descriptions-item`),H=e(`a-input`),U=e(`a-input-number`),W=e(`a-descriptions`),G=e(`a-card`),K=e(`a-switch`);return S.value?(r(),l(`div`,_,[o(a,{size:`large`})])):(r(),l(u,{key:1},[i[15]||=s(`h2`,{style:{"margin-bottom":`18px`}},`系统设置`,-1),o(G,{title:`LLM 大模型配置`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(g,null,{default:n(()=>[o(c,{size:`small`,onClick:I,loading:C.value},{default:n(()=>[...i[9]||=[p(`测试连接`,-1)]]),_:1},8,[`loading`]),o(c,{size:`small`,type:`primary`,onClick:i[0]||=e=>F(E)},{default:n(()=>[...i[10]||=[p(`保存`,-1)]]),_:1})]),_:1})]),default:n(()=>[w.value===null?m(``,!0):(r(),f(x,{key:0,type:w.value?`success`:`error`,message:w.value?`连接成功`:`连接失败`,description:T.value,"show-icon":``,style:{"margin-bottom":`14px`},closable:``},null,8,[`type`,`message`,`description`])),o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[o(V,{label:`API 协议`,span:2},{default:n(()=>[o(B,{value:P.value,"onUpdate:value":i[1]||=e=>P.value=e,style:{width:`100%`}},{default:n(()=>[o(z,{gutter:[8,8]},{default:n(()=>[(r(),l(u,null,h(A,e=>o(R,{key:e.value,span:8},{default:n(()=>[o(L,{value:e.value,style:{display:`block`}},{default:n(()=>[s(`span`,v,d(e.label),1),s(`div`,y,d(e.desc),1),s(`div`,b,d(e.endpoint),1)]),_:2},1032,[`value`])]),_:2},1024)),64))]),_:1})]),_:1},8,[`value`])]),_:1}),o(V,{label:`API 地址`,span:2},{default:n(()=>[o(H,{value:M(`llm.base_url`),onChange:i[2]||=e=>N(`llm.base_url`,e.target.value),placeholder:`https://api.openai.com/v1`},null,8,[`value`]),i[11]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`2px`}},`会自动拼上协议路径`,-1)]),_:1}),o(V,{label:`API Key`,span:2},{default:n(()=>[o(x,{type:`info`,message:`API Key 仅通过服务器环境变量 LLM_API_KEY 配置,后台不会读取或显示完整密钥。`,"show-icon":``})]),_:1}),o(V,{label:`模型名称`,span:2},{default:n(()=>[o(H,{value:M(`llm.model`),onChange:i[3]||=e=>N(`llm.model`,e.target.value),placeholder:`gpt-4o-mini`},null,8,[`value`])]),_:1}),o(V,{label:`最大输出 Token`,span:1},{default:n(()=>[o(U,{value:M(`llm.max_tokens`),onChange:i[4]||=e=>N(`llm.max_tokens`,e),style:{width:`100%`},min:1},null,8,[`value`])]),_:1}),o(V,{label:`温度`,span:1},{default:n(()=>[o(U,{value:M(`llm.temperature`),onChange:i[5]||=e=>N(`llm.temperature`,e),style:{width:`100%`},min:0,max:2,step:.1},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(G,{title:`限额配置`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(c,{size:`small`,type:`primary`,onClick:i[6]||=e=>F(D)},{default:n(()=>[...i[12]||=[p(`保存`,-1)]]),_:1})]),default:n(()=>[o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[(r(),l(u,null,h(D,e=>o(V,{key:e,label:j[e]?.label,span:1},{default:n(()=>[o(U,{value:M(e),onChange:t=>N(e,t),style:{width:`100%`},min:0},null,8,[`value`,`onChange`])]),_:2},1032,[`label`])),64))]),_:1})]),_:1}),o(G,{title:`功能开关`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(c,{size:`small`,type:`primary`,onClick:i[7]||=e=>F(O)},{default:n(()=>[...i[13]||=[p(`保存`,-1)]]),_:1})]),default:n(()=>[o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[(r(),l(u,null,h(O,e=>o(V,{key:e,label:j[e]?.label,span:1},{default:n(()=>[o(K,{checked:M(e),onChange:t=>N(e,t)},null,8,[`checked`,`onChange`])]),_:2},1032,[`label`])),64))]),_:1})]),_:1}),o(G,{title:`系统 & 品牌`,size:`small`,style:{"margin-bottom":`14px`}},{extra:n(()=>[o(c,{size:`small`,type:`primary`,onClick:i[8]||=e=>F(k)},{default:n(()=>[...i[14]||=[p(`保存`,-1)]]),_:1})]),default:n(()=>[o(W,{column:2,size:`small`,bordered:``},{default:n(()=>[(r(),l(u,null,h(k,e=>o(V,{key:e,label:j[e]?.label,span:e===`brand.slogan`||e===`brand.logo_url`?2:1},{default:n(()=>[e===`system.max_ledgers_per_user`?(r(),f(U,{key:0,value:M(e),onChange:t=>N(e,t),style:{width:`100%`},min:1,max:50},null,8,[`value`,`onChange`])):(r(),f(H,{key:1,value:M(e),onChange:t=>N(e,t.target.value)},null,8,[`value`,`onChange`]))]),_:2},1032,[`label`,`span`])),64))]),_:1})]),_:1})],64))}}});export{x as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Stickers-5pBxfoSQ.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Stickers-5pBxfoSQ.js new file mode 100644 index 0000000..4c0c32d --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Stickers-5pBxfoSQ.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,vn as p,xn as m,yn as h,zn as g}from"./config-provider-q7ATIdCu.js";import{n as _,r as v,t as y}from"./EditOutlined-CeylGsUo.js";import{t as b}from"./api-C4vz6nB3.js";var x={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},S={key:1,style:{color:`#ccc`}},C=t({__name:`Stickers`,setup(t){let C=a([]),w=a(!0),T=a(!1),E=a(null),D=a({key:``,label:``,groupKey:`classic`,triggerTags:``,imageUrl:``,isEnabled:!0}),O=[{title:`Key`,dataIndex:`key`,key:`key`,width:110},{title:`名称`,dataIndex:`label`,key:`label`,width:100},{title:`分组`,dataIndex:`groupKey`,key:`group`,width:90},{title:`触发标签`,dataIndex:`triggerTags`,key:`tags`,width:200},{title:`状态`,dataIndex:`isEnabled`,key:`on`,width:70},{title:``,key:`act`,width:150}];i(k);async function k(){w.value=!0;try{C.value=await b.stickers()}finally{w.value=!1}}function A(){E.value=null,D.value={key:``,label:``,groupKey:`classic`,triggerTags:``,imageUrl:``,isEnabled:!0},T.value=!0}function j(e){E.value=e,D.value={key:e.key,label:e.label,groupKey:e.groupKey,triggerTags:e.triggerTags||``,imageUrl:e.imageUrl||``,isEnabled:e.isEnabled},T.value=!0}async function M(){let e={...D.value,triggerTags:D.value.triggerTags||null,imageUrl:D.value.imageUrl||null};E.value?await b.updateSticker(E.value.id,e):await b.createSticker(e),c.success(E.value?`已更新`:`已创建`),T.value=!1,k()}async function N(e){await b.deleteSticker(e),c.success(`已删除`),k()}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),b=e(`a-popconfirm`),k=e(`a-table`),P=e(`a-input`),F=e(`a-form-item`),I=e(`a-col`),L=e(`a-row`),R=e(`a-select-option`),z=e(`a-select`),B=e(`a-switch`),V=e(`a-form`),H=e(`a-modal`);return r(),u(d,null,[s(`div`,x,[i[8]||=s(`h2`,null,`表情包库`,-1),o(a,{type:`primary`,onClick:A},{default:n(()=>[o(l(v)),i[7]||=m(` 新建表情包`,-1)]),_:1})]),o(k,{columns:O,dataSource:C.value,loading:w.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`tags`?(r(),u(d,{key:0},[t.triggerTags?(r(!0),u(d,{key:0},g((t.triggerTags||``).split(`,`).filter(Boolean),e=>(r(),p(c,{key:e,color:`blue`,style:{margin:`1px 2px`}},{default:n(()=>[m(f(e),1)]),_:2},1024))),128)):(r(),u(`span`,S,`-`))],64)):h(``,!0),e.key===`on`?(r(),p(c,{key:1,color:t.isEnabled?`green`:`default`},{default:n(()=>[m(f(t.isEnabled?`启用`:`禁用`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`act`?(r(),u(d,{key:2},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>j(t)},{default:n(()=>[o(l(y))]),_:1},8,[`onClick`]),o(b,{title:`确定删除?`,onConfirm:e=>N(t.id)},{default:n(()=>[o(a,{size:`small`,danger:``},{default:n(()=>[o(l(_))]),_:1})]),_:1},8,[`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`]),o(H,{open:T.value,"onUpdate:open":i[6]||=e=>T.value=e,title:E.value?`编辑表情包`:`新建表情包`,onOk:M,width:520},{default:n(()=>[o(V,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(L,{gutter:12},{default:n(()=>[o(I,{span:12},{default:n(()=>[o(F,{label:`Key`},{default:n(()=>[o(P,{value:D.value.key,"onUpdate:value":i[0]||=e=>D.value.key=e,placeholder:`salary`},null,8,[`value`])]),_:1})]),_:1}),o(I,{span:12},{default:n(()=>[o(F,{label:`名称`},{default:n(()=>[o(P,{value:D.value.label,"onUpdate:value":i[1]||=e=>D.value.label=e,placeholder:`发工资啦`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(L,{gutter:12},{default:n(()=>[o(I,{span:12},{default:n(()=>[o(F,{label:`分组`},{default:n(()=>[o(z,{value:D.value.groupKey,"onUpdate:value":i[2]||=e=>D.value.groupKey=e},{default:n(()=>[o(R,{value:`ai_exclusive`},{default:n(()=>[...i[9]||=[m(`🤖 AI 专属`,-1)]]),_:1}),o(R,{value:`classic`},{default:n(()=>[...i[10]||=[m(`📦 经典`,-1)]]),_:1})]),_:1},8,[`value`])]),_:1})]),_:1}),o(I,{span:12},{default:n(()=>[o(F,{label:`图片 URL`},{default:n(()=>[o(P,{value:D.value.imageUrl,"onUpdate:value":i[3]||=e=>D.value.imageUrl=e,placeholder:`可选 CDN 地址`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(F,{label:`触发标签`},{default:n(()=>[o(P,{value:D.value.triggerTags,"onUpdate:value":i[4]||=e=>D.value.triggerTags=e,placeholder:`over_budget,salary,forgive,逗号分隔`},null,8,[`value`]),i[11]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`4px`}},`标签匹配用户场景,AI 自动选择对应表情包`,-1)]),_:1}),o(F,{label:`是否启用`},{default:n(()=>[o(B,{checked:D.value.isEnabled,"onUpdate:checked":i[5]||=e=>D.value.isEnabled=e},null,8,[`checked`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{C as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Stickers-CJkJknEj.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Stickers-CJkJknEj.js new file mode 100644 index 0000000..59b3098 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Stickers-CJkJknEj.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,vn as p,xn as m,yn as h,zn as g}from"./config-provider-q7ATIdCu.js";import{n as _,r as v,t as y}from"./EditOutlined-CeylGsUo.js";import{t as b}from"./api-BV_Zb8mM.js";var x={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},S={key:1,style:{color:`#ccc`}},C=t({__name:`Stickers`,setup(t){let C=a([]),w=a(!0),T=a(!1),E=a(null),D=a({key:``,label:``,groupKey:`classic`,triggerTags:``,imageUrl:``,isEnabled:!0}),O=[{title:`Key`,dataIndex:`key`,key:`key`,width:110},{title:`名称`,dataIndex:`label`,key:`label`,width:100},{title:`分组`,dataIndex:`groupKey`,key:`group`,width:90},{title:`触发标签`,dataIndex:`triggerTags`,key:`tags`,width:200},{title:`状态`,dataIndex:`isEnabled`,key:`on`,width:70},{title:``,key:`act`,width:150}];i(k);async function k(){w.value=!0;try{C.value=await b.stickers()}finally{w.value=!1}}function A(){E.value=null,D.value={key:``,label:``,groupKey:`classic`,triggerTags:``,imageUrl:``,isEnabled:!0},T.value=!0}function j(e){E.value=e,D.value={key:e.key,label:e.label,groupKey:e.groupKey,triggerTags:e.triggerTags||``,imageUrl:e.imageUrl||``,isEnabled:e.isEnabled},T.value=!0}async function M(){let e={...D.value,triggerTags:D.value.triggerTags||null,imageUrl:D.value.imageUrl||null};E.value?await b.updateSticker(E.value.id,e):await b.createSticker(e),c.success(E.value?`已更新`:`已创建`),T.value=!1,k()}async function N(e){await b.deleteSticker(e),c.success(`已删除`),k()}return(t,i)=>{let a=e(`a-button`),c=e(`a-tag`),b=e(`a-popconfirm`),k=e(`a-table`),P=e(`a-input`),F=e(`a-form-item`),I=e(`a-col`),L=e(`a-row`),R=e(`a-select-option`),z=e(`a-select`),B=e(`a-switch`),V=e(`a-form`),H=e(`a-modal`);return r(),u(d,null,[s(`div`,x,[i[8]||=s(`h2`,null,`表情包库`,-1),o(a,{type:`primary`,onClick:A},{default:n(()=>[o(l(v)),i[7]||=m(` 新建表情包`,-1)]),_:1})]),o(k,{columns:O,dataSource:C.value,loading:w.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`tags`?(r(),u(d,{key:0},[t.triggerTags?(r(!0),u(d,{key:0},g((t.triggerTags||``).split(`,`).filter(Boolean),e=>(r(),p(c,{key:e,color:`blue`,style:{margin:`1px 2px`}},{default:n(()=>[m(f(e),1)]),_:2},1024))),128)):(r(),u(`span`,S,`-`))],64)):h(``,!0),e.key===`on`?(r(),p(c,{key:1,color:t.isEnabled?`green`:`default`},{default:n(()=>[m(f(t.isEnabled?`启用`:`禁用`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`act`?(r(),u(d,{key:2},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>j(t)},{default:n(()=>[o(l(y))]),_:1},8,[`onClick`]),o(b,{title:`确定删除?`,onConfirm:e=>N(t.id)},{default:n(()=>[o(a,{size:`small`,danger:``},{default:n(()=>[o(l(_))]),_:1})]),_:1},8,[`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`]),o(H,{open:T.value,"onUpdate:open":i[6]||=e=>T.value=e,title:E.value?`编辑表情包`:`新建表情包`,onOk:M,width:520},{default:n(()=>[o(V,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(L,{gutter:12},{default:n(()=>[o(I,{span:12},{default:n(()=>[o(F,{label:`Key`},{default:n(()=>[o(P,{value:D.value.key,"onUpdate:value":i[0]||=e=>D.value.key=e,placeholder:`salary`},null,8,[`value`])]),_:1})]),_:1}),o(I,{span:12},{default:n(()=>[o(F,{label:`名称`},{default:n(()=>[o(P,{value:D.value.label,"onUpdate:value":i[1]||=e=>D.value.label=e,placeholder:`发工资啦`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(L,{gutter:12},{default:n(()=>[o(I,{span:12},{default:n(()=>[o(F,{label:`分组`},{default:n(()=>[o(z,{value:D.value.groupKey,"onUpdate:value":i[2]||=e=>D.value.groupKey=e},{default:n(()=>[o(R,{value:`ai_exclusive`},{default:n(()=>[...i[9]||=[m(`🤖 AI 专属`,-1)]]),_:1}),o(R,{value:`classic`},{default:n(()=>[...i[10]||=[m(`📦 经典`,-1)]]),_:1})]),_:1},8,[`value`])]),_:1})]),_:1}),o(I,{span:12},{default:n(()=>[o(F,{label:`图片 URL`},{default:n(()=>[o(P,{value:D.value.imageUrl,"onUpdate:value":i[3]||=e=>D.value.imageUrl=e,placeholder:`可选 CDN 地址`},null,8,[`value`])]),_:1})]),_:1})]),_:1}),o(F,{label:`触发标签`},{default:n(()=>[o(P,{value:D.value.triggerTags,"onUpdate:value":i[4]||=e=>D.value.triggerTags=e,placeholder:`over_budget,salary,forgive,逗号分隔`},null,8,[`value`]),i[11]||=s(`div`,{style:{color:`#999`,"font-size":`11px`,"margin-top":`4px`}},`标签匹配用户场景,AI 自动选择对应表情包`,-1)]),_:1}),o(F,{label:`是否启用`},{default:n(()=>[o(B,{checked:D.value.isEnabled,"onUpdate:checked":i[5]||=e=>D.value.isEnabled=e},null,8,[`checked`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{C as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/SysCategories-BGspm7GG.js b/backend/MiaoJiZhang.Api/wwwroot/assets/SysCategories-BGspm7GG.js new file mode 100644 index 0000000..df9daf4 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/SysCategories-BGspm7GG.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,xn as p,yn as m}from"./config-provider-q7ATIdCu.js";import{n as h,r as g,t as _}from"./EditOutlined-CeylGsUo.js";import{t as v}from"./api-C4vz6nB3.js";var y={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},b={key:0,style:{"font-size":`18px`}},x={key:0,style:{"font-size":`18px`}},S=t({__name:`SysCategories`,setup(t){let S=a([]),C=a(!0),w=a(!1),T=a(null),E=a({name:``,iconKey:`tag`,type:`expense`}),D=[{value:`food`,label:`🍜 餐饮`},{value:`cup`,label:`🥤 饮品`},{value:`cart`,label:`🛒 购物`},{value:`metro`,label:`🚇 交通`},{value:`house`,label:`🏠 住房`},{value:`game`,label:`🎮 娱乐`},{value:`pill`,label:`💊 医疗`},{value:`book`,label:`📖 学习`},{value:`shirt`,label:`👕 服饰`},{value:`gift`,label:`🎁 人情`},{value:`plane`,label:`✈️ 旅行`},{value:`tag`,label:`🏷️ 其他`},{value:`money`,label:`💰 工资`},{value:`briefcase`,label:`💼 兼职`},{value:`chart`,label:`📈 理财`},{value:`card`,label:`💳 报销`},{value:`sparkle`,label:`✨ 奖金`}],O=()=>S.value.filter(e=>e.type===`Expense`),k=()=>S.value.filter(e=>e.type===`Income`);i(A);async function A(){C.value=!0;try{S.value=await v.sysCategories()}finally{C.value=!1}}function j(){T.value=null,E.value={name:``,iconKey:`tag`,type:`expense`},w.value=!0}function M(e){T.value=e,E.value={name:e.name,iconKey:e.iconKey,type:e.type===`Income`?`income`:`expense`},w.value=!0}async function N(){let e={name:E.value.name,iconKey:E.value.iconKey,type:E.value.type};T.value?await v.updateSysCategory(T.value.id,e):await v.createSysCategory(e),c.success(T.value?`已更新`:`已创建`),w.value=!1,A()}async function P(e){await v.deleteSysCategory(e),c.success(`已删除(软删)`),A()}return(t,i)=>{let a=e(`a-button`),c=e(`a-popconfirm`),v=e(`a-table`),S=e(`a-card`),A=e(`a-col`),F=e(`a-row`),I=e(`a-input`),L=e(`a-form-item`),R=e(`a-select`),z=e(`a-radio`),B=e(`a-radio-group`),V=e(`a-form`),H=e(`a-modal`);return r(),u(d,null,[s(`div`,y,[i[5]||=s(`h2`,null,`系统默认分类`,-1),o(a,{type:`primary`,onClick:j},{default:n(()=>[o(l(g)),i[4]||=p(` 新建分类`,-1)]),_:1})]),i[8]||=s(`p`,{style:{color:`#999`,"font-size":`12px`,"margin-bottom":`14px`}},` 此处管理新用户注册时获得的默认分类。删除后已分配用户的分类不受影响(软删除,仅对新用户隐藏)。 `,-1),o(F,{gutter:16},{default:n(()=>[o(A,{span:12},{default:n(()=>[o(S,{title:`💸 支出分类`,size:`small`},{default:n(()=>[o(v,{columns:[{title:`排序`,dataIndex:`sortOrder`,width:55},{title:`图标`,key:`icon`,width:55},{title:`名称`,dataIndex:`name`,key:`name`},{title:``,key:`act`,width:90}],dataSource:O(),loading:C.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`icon`?(r(),u(`span`,b,f(D.find(e=>e.value===t.iconKey)?.label?.split(` `)[0]||`🏷️`),1)):m(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,type:`link`,onClick:e=>M(t)},{default:n(()=>[o(l(_))]),_:1},8,[`onClick`]),o(c,{title:`确定软删除?`,onConfirm:e=>P(t.id)},{default:n(()=>[o(a,{size:`small`,type:`link`,danger:``},{default:n(()=>[o(l(h))]),_:1})]),_:1},8,[`onConfirm`])],64)):m(``,!0)]),_:1},8,[`dataSource`,`loading`])]),_:1})]),_:1}),o(A,{span:12},{default:n(()=>[o(S,{title:`💰 收入分类`,size:`small`},{default:n(()=>[o(v,{columns:[{title:`排序`,dataIndex:`sortOrder`,width:55},{title:`图标`,key:`icon`,width:55},{title:`名称`,dataIndex:`name`,key:`name`},{title:``,key:`act`,width:90}],dataSource:k(),loading:C.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`icon`?(r(),u(`span`,x,f(D.find(e=>e.value===t.iconKey)?.label?.split(` `)[0]||`🏷️`),1)):m(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,type:`link`,onClick:e=>M(t)},{default:n(()=>[o(l(_))]),_:1},8,[`onClick`]),o(c,{title:`确定软删除?`,onConfirm:e=>P(t.id)},{default:n(()=>[o(a,{size:`small`,type:`link`,danger:``},{default:n(()=>[o(l(h))]),_:1})]),_:1},8,[`onConfirm`])],64)):m(``,!0)]),_:1},8,[`dataSource`,`loading`])]),_:1})]),_:1})]),_:1}),o(H,{open:w.value,"onUpdate:open":i[3]||=e=>w.value=e,title:T.value?`编辑分类`:`新建系统分类`,onOk:N,width:400},{default:n(()=>[o(V,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(L,{label:`分类名称`},{default:n(()=>[o(I,{value:E.value.name,"onUpdate:value":i[0]||=e=>E.value.name=e,placeholder:`如:宠物`},null,8,[`value`])]),_:1}),o(L,{label:`图标`},{default:n(()=>[o(R,{value:E.value.iconKey,"onUpdate:value":i[1]||=e=>E.value.iconKey=e,options:D},null,8,[`value`])]),_:1}),o(L,{label:`类型`},{default:n(()=>[o(B,{value:E.value.type,"onUpdate:value":i[2]||=e=>E.value.type=e},{default:n(()=>[o(z,{value:`expense`},{default:n(()=>[...i[6]||=[p(`💸 支出`,-1)]]),_:1}),o(z,{value:`income`},{default:n(()=>[...i[7]||=[p(`💰 收入`,-1)]]),_:1})]),_:1},8,[`value`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{S as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/SysCategories-BOgkBEQn.js b/backend/MiaoJiZhang.Api/wwwroot/assets/SysCategories-BOgkBEQn.js new file mode 100644 index 0000000..7d2b918 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/SysCategories-BOgkBEQn.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,xn as p,yn as m}from"./config-provider-q7ATIdCu.js";import{n as h,r as g,t as _}from"./EditOutlined-CeylGsUo.js";import{t as v}from"./api-BV_Zb8mM.js";var y={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},b={key:0,style:{"font-size":`18px`}},x={key:0,style:{"font-size":`18px`}},S=t({__name:`SysCategories`,setup(t){let S=a([]),C=a(!0),w=a(!1),T=a(null),E=a({name:``,iconKey:`tag`,type:`expense`}),D=[{value:`food`,label:`🍜 餐饮`},{value:`cup`,label:`🥤 饮品`},{value:`cart`,label:`🛒 购物`},{value:`metro`,label:`🚇 交通`},{value:`house`,label:`🏠 住房`},{value:`game`,label:`🎮 娱乐`},{value:`pill`,label:`💊 医疗`},{value:`book`,label:`📖 学习`},{value:`shirt`,label:`👕 服饰`},{value:`gift`,label:`🎁 人情`},{value:`plane`,label:`✈️ 旅行`},{value:`tag`,label:`🏷️ 其他`},{value:`money`,label:`💰 工资`},{value:`briefcase`,label:`💼 兼职`},{value:`chart`,label:`📈 理财`},{value:`card`,label:`💳 报销`},{value:`sparkle`,label:`✨ 奖金`}],O=()=>S.value.filter(e=>e.type===`Expense`),k=()=>S.value.filter(e=>e.type===`Income`);i(A);async function A(){C.value=!0;try{S.value=await v.sysCategories()}finally{C.value=!1}}function j(){T.value=null,E.value={name:``,iconKey:`tag`,type:`expense`},w.value=!0}function M(e){T.value=e,E.value={name:e.name,iconKey:e.iconKey,type:e.type===`Income`?`income`:`expense`},w.value=!0}async function N(){let e={name:E.value.name,iconKey:E.value.iconKey,type:E.value.type};T.value?await v.updateSysCategory(T.value.id,e):await v.createSysCategory(e),c.success(T.value?`已更新`:`已创建`),w.value=!1,A()}async function P(e){await v.deleteSysCategory(e),c.success(`已删除(软删)`),A()}return(t,i)=>{let a=e(`a-button`),c=e(`a-popconfirm`),v=e(`a-table`),S=e(`a-card`),A=e(`a-col`),F=e(`a-row`),I=e(`a-input`),L=e(`a-form-item`),R=e(`a-select`),z=e(`a-radio`),B=e(`a-radio-group`),V=e(`a-form`),H=e(`a-modal`);return r(),u(d,null,[s(`div`,y,[i[5]||=s(`h2`,null,`系统默认分类`,-1),o(a,{type:`primary`,onClick:j},{default:n(()=>[o(l(g)),i[4]||=p(` 新建分类`,-1)]),_:1})]),i[8]||=s(`p`,{style:{color:`#999`,"font-size":`12px`,"margin-bottom":`14px`}},` 此处管理新用户注册时获得的默认分类。删除后已分配用户的分类不受影响(软删除,仅对新用户隐藏)。 `,-1),o(F,{gutter:16},{default:n(()=>[o(A,{span:12},{default:n(()=>[o(S,{title:`💸 支出分类`,size:`small`},{default:n(()=>[o(v,{columns:[{title:`排序`,dataIndex:`sortOrder`,width:55},{title:`图标`,key:`icon`,width:55},{title:`名称`,dataIndex:`name`,key:`name`},{title:``,key:`act`,width:90}],dataSource:O(),loading:C.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`icon`?(r(),u(`span`,b,f(D.find(e=>e.value===t.iconKey)?.label?.split(` `)[0]||`🏷️`),1)):m(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,type:`link`,onClick:e=>M(t)},{default:n(()=>[o(l(_))]),_:1},8,[`onClick`]),o(c,{title:`确定软删除?`,onConfirm:e=>P(t.id)},{default:n(()=>[o(a,{size:`small`,type:`link`,danger:``},{default:n(()=>[o(l(h))]),_:1})]),_:1},8,[`onConfirm`])],64)):m(``,!0)]),_:1},8,[`dataSource`,`loading`])]),_:1})]),_:1}),o(A,{span:12},{default:n(()=>[o(S,{title:`💰 收入分类`,size:`small`},{default:n(()=>[o(v,{columns:[{title:`排序`,dataIndex:`sortOrder`,width:55},{title:`图标`,key:`icon`,width:55},{title:`名称`,dataIndex:`name`,key:`name`},{title:``,key:`act`,width:90}],dataSource:k(),loading:C.value,rowKey:`id`,size:`small`,pagination:{pageSize:10}},{bodyCell:n(({column:e,record:t})=>[e.key===`icon`?(r(),u(`span`,x,f(D.find(e=>e.value===t.iconKey)?.label?.split(` `)[0]||`🏷️`),1)):m(``,!0),e.key===`act`?(r(),u(d,{key:1},[o(a,{size:`small`,type:`link`,onClick:e=>M(t)},{default:n(()=>[o(l(_))]),_:1},8,[`onClick`]),o(c,{title:`确定软删除?`,onConfirm:e=>P(t.id)},{default:n(()=>[o(a,{size:`small`,type:`link`,danger:``},{default:n(()=>[o(l(h))]),_:1})]),_:1},8,[`onConfirm`])],64)):m(``,!0)]),_:1},8,[`dataSource`,`loading`])]),_:1})]),_:1})]),_:1}),o(H,{open:w.value,"onUpdate:open":i[3]||=e=>w.value=e,title:T.value?`编辑分类`:`新建系统分类`,onOk:N,width:400},{default:n(()=>[o(V,{layout:`vertical`,style:{"margin-top":`8px`}},{default:n(()=>[o(L,{label:`分类名称`},{default:n(()=>[o(I,{value:E.value.name,"onUpdate:value":i[0]||=e=>E.value.name=e,placeholder:`如:宠物`},null,8,[`value`])]),_:1}),o(L,{label:`图标`},{default:n(()=>[o(R,{value:E.value.iconKey,"onUpdate:value":i[1]||=e=>E.value.iconKey=e,options:D},null,8,[`value`])]),_:1}),o(L,{label:`类型`},{default:n(()=>[o(B,{value:E.value.type,"onUpdate:value":i[2]||=e=>E.value.type=e},{default:n(()=>[o(z,{value:`expense`},{default:n(()=>[...i[6]||=[p(`💸 支出`,-1)]]),_:1}),o(z,{value:`income`},{default:n(()=>[...i[7]||=[p(`💰 收入`,-1)]]),_:1})]),_:1},8,[`value`])]),_:1})]),_:1})]),_:1},8,[`open`,`title`])],64)}}});export{S as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/TeamOutlined-0klbs6LP.js b/backend/MiaoJiZhang.Api/wwwroot/assets/TeamOutlined-0klbs6LP.js new file mode 100644 index 0000000..4be0187 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/TeamOutlined-0klbs6LP.js @@ -0,0 +1 @@ +import{Sn as e,y as t}from"./config-provider-q7ATIdCu.js";var n={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z`}}]},name:`team`,theme:`outlined`};function r(e){for(var t=1;t{let a=e(`a-button`),c=e(`a-input-search`),_=e(`a-tag`),L=e(`a-popconfirm`),R=e(`a-table`),z=e(`a-statistic`),B=e(`a-card`),V=e(`a-col`),H=e(`a-row`),U=e(`a-modal`);return r(),u(d,null,[s(`div`,v,[i[3]||=s(`h2`,null,`用户管理`,-1),o(a,{onClick:N},{default:n(()=>[o(l(g)),i[2]||=m(` 刷新`,-1)]),_:1})]),s(`div`,y,[o(c,{value:D.value,"onUpdate:value":i[0]||=e=>D.value=e,placeholder:`搜索用户名...`,style:{"max-width":`280px`},onSearch:P},null,8,[`value`])]),o(R,{columns:k,dataSource:w.value,loading:E.value,rowKey:`id`,size:`small`,pagination:{current:O.value,total:T.value,pageSize:C,showTotal:e=>`共 ${e} 人`,onChange:e=>{O.value=e,N()}}},{bodyCell:n(({column:e,record:t})=>[e.key===`mode`?(r(),p(_,{key:0,color:t.appMode===`ai`?`blue`:`green`},{default:n(()=>[m(f(t.appMode===`ai`?`全AI`:`普通`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`comp`?(r(),u(d,{key:1},[t.companion?(r(),u(`span`,b,`形象:`+f(t.companion.avatarKey)+` · 性格:`+f(t.companion.personaKey),1)):(r(),u(`span`,x,`未设置`))],64)):h(``,!0),e.key===`tx`?(r(),u(d,{key:2},[m(f(t.txCount)+` `,1),s(`span`,S,`(AI:`+f(t.aiTxCount)+`)`,1)],64)):h(``,!0),e.key===`ban`?(r(),p(_,{key:3,color:t.isBanned?`red`:`default`},{default:n(()=>[m(f(t.isBanned?`已封`:`正常`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`reg`?(r(),u(d,{key:4},[m(f(t.createdAt?.split(`T`)[0]),1)],64)):h(``,!0),e.key===`login`?(r(),u(d,{key:5},[m(f(t.lastLoginAt?t.lastLoginAt.split(`T`)[0]:`从未`),1)],64)):h(``,!0),e.key===`act`?(r(),u(d,{key:6},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>I(t)},{default:n(()=>[...i[4]||=[m(`📊 统计`,-1)]]),_:1},8,[`onClick`]),o(L,{title:t.isBanned?`确定解封?`:`确定封禁?`,onConfirm:e=>F(t)},{default:n(()=>[o(a,{size:`small`,danger:!t.isBanned},{default:n(()=>[m(f(t.isBanned?`解封`:`封禁`),1)]),_:2},1032,[`danger`])]),_:2},1032,[`title`,`onConfirm`])],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`,`pagination`]),o(U,{open:A.value,"onUpdate:open":i[1]||=e=>A.value=e,title:`${j.value} 使用统计`,footer:null,width:420},{default:n(()=>[M.value?(r(),p(H,{key:0,gutter:12},{default:n(()=>[o(V,{span:8},{default:n(()=>[o(B,{size:`small`},{default:n(()=>[o(z,{title:`总账单`,value:M.value.totalTransactions},null,8,[`value`])]),_:1})]),_:1}),o(V,{span:8},{default:n(()=>[o(B,{size:`small`},{default:n(()=>[o(z,{title:`AI 记账`,value:M.value.aiBooked},null,8,[`value`])]),_:1})]),_:1}),o(V,{span:8},{default:n(()=>[o(B,{size:`small`},{default:n(()=>[o(z,{title:`AI 准确率`,value:M.value.aiAccuracy,suffix:`%`,"value-style":{color:M.value.aiAccuracy>=70?`#00B386`:`#F0642D`}},null,8,[`value`,`value-style`])]),_:1})]),_:1})]),_:1})):h(``,!0)]),_:1},8,[`open`,`title`])],64)}}});export{w as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/Users-DYYWsaDQ.js b/backend/MiaoJiZhang.Api/wwwroot/assets/Users-DYYWsaDQ.js new file mode 100644 index 0000000..5f4214c --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/Users-DYYWsaDQ.js @@ -0,0 +1 @@ +import{Bn as e,Cn as t,Kn as n,Ln as r,Pn as i,Qn as a,Sn as o,_n as s,a as c,ar as l,bn as u,fn as d,or as f,vn as p,xn as m,yn as h}from"./config-provider-q7ATIdCu.js";import{t as g}from"./ReloadOutlined-CVrW_3-b.js";import{t as _}from"./api-BV_Zb8mM.js";var v={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`,"margin-bottom":`16px`}},y={style:{"margin-bottom":`14px`,display:`flex`,gap:`8px`}},b={key:0},x={key:1,style:{color:`#ccc`}},S={style:{color:`#999`}},C={key:2,style:{"font-size":`10px`,color:`#999`,"margin-top":`3px`}},w=15,T=t({__name:`Users`,setup(t){let T=a([]),E=a(0),D=a(!0),O=a(``),k=a(1),A=[{title:`ID`,dataIndex:`id`,key:`id`,width:60},{title:`用户名`,dataIndex:`username`,key:`un`,width:120},{title:`模式`,dataIndex:`appMode`,key:`mode`,width:80},{title:`AI 伙伴`,key:`comp`,width:150},{title:`账单(总/AI)`,key:`tx`},{title:`状态`,key:`status`,width:100},{title:`注册时间`,dataIndex:`createdAt`,key:`reg`,width:110},{title:`最后登录`,dataIndex:`lastLoginAt`,key:`login`,width:110},{title:``,key:`act`,width:200}],j=a(!1),M=a(``),N=a(null);i(P);async function P(){D.value=!0;try{let e=await _.users({search:O.value||void 0,page:k.value,limit:w});T.value=e.list,E.value=e.total}finally{D.value=!1}}async function F(){k.value=1,P()}async function I(e){let t=await _.toggleBan(e.id);c.success(t.isBanned?`已封禁 ${e.username}`:`已解封 ${e.username}`),P()}async function L(e){await _.cancelAccountClosure(e.id),c.success(`已取消 `+e.username+` 的注销流程`),P()}async function R(e){M.value=e.nickname||e.username,j.value=!0,N.value=await _.userStats(e.id)}return(t,i)=>{let a=e(`a-button`),c=e(`a-input-search`),_=e(`a-tag`),z=e(`a-popconfirm`),B=e(`a-table`),V=e(`a-statistic`),H=e(`a-card`),U=e(`a-col`),W=e(`a-row`),G=e(`a-modal`);return r(),u(d,null,[s(`div`,v,[i[3]||=s(`h2`,null,`用户管理`,-1),o(a,{onClick:P},{default:n(()=>[o(l(g)),i[2]||=m(` 刷新`,-1)]),_:1})]),s(`div`,y,[o(c,{value:O.value,"onUpdate:value":i[0]||=e=>O.value=e,placeholder:`搜索用户名...`,style:{"max-width":`280px`},onSearch:F},null,8,[`value`])]),o(B,{columns:A,dataSource:T.value,loading:D.value,rowKey:`id`,size:`small`,pagination:{current:k.value,total:E.value,pageSize:w,showTotal:e=>`共 ${e} 人`,onChange:e=>{k.value=e,P()}}},{bodyCell:n(({column:e,record:t})=>[e.key===`mode`?(r(),p(_,{key:0,color:t.appMode===`ai`?`blue`:`green`},{default:n(()=>[m(f(t.appMode===`ai`?`全AI`:`普通`),1)]),_:2},1032,[`color`])):h(``,!0),e.key===`comp`?(r(),u(d,{key:1},[t.companion?(r(),u(`span`,b,`形象:`+f(t.companion.avatarKey)+` · 性格:`+f(t.companion.personaKey),1)):(r(),u(`span`,x,`未设置`))],64)):h(``,!0),e.key===`tx`?(r(),u(d,{key:2},[m(f(t.txCount)+` `,1),s(`span`,S,`(AI:`+f(t.aiTxCount)+`)`,1)],64)):h(``,!0),e.key===`status`?(r(),u(d,{key:3},[t.accountClosureScheduledAt?(r(),p(_,{key:0,color:`orange`},{default:n(()=>[...i[4]||=[m(`注销中`,-1)]]),_:1})):(r(),p(_,{key:1,color:t.isBanned?`red`:`default`},{default:n(()=>[m(f(t.isBanned?`已封`:`正常`),1)]),_:2},1032,[`color`])),t.accountClosureScheduledAt?(r(),u(`div`,C,f(t.accountClosureScheduledAt.split(`T`)[0])+` 删除 `,1)):h(``,!0)],64)):h(``,!0),e.key===`reg`?(r(),u(d,{key:4},[m(f(t.createdAt?.split(`T`)[0]),1)],64)):h(``,!0),e.key===`login`?(r(),u(d,{key:5},[m(f(t.lastLoginAt?t.lastLoginAt.split(`T`)[0]:`从未`),1)],64)):h(``,!0),e.key===`act`?(r(),u(d,{key:6},[o(a,{size:`small`,style:{"margin-right":`6px`},onClick:e=>R(t)},{default:n(()=>[...i[5]||=[m(`📊 统计`,-1)]]),_:1},8,[`onClick`]),t.accountClosureScheduledAt?(r(),p(z,{key:0,title:`确定取消该用户的注销流程?`,onConfirm:e=>L(t)},{default:n(()=>[o(a,{size:`small`,type:`primary`},{default:n(()=>[...i[6]||=[m(`取消注销`,-1)]]),_:1})]),_:1},8,[`onConfirm`])):(r(),p(z,{key:1,title:t.isBanned?`确定解封?`:`确定封禁?`,onConfirm:e=>I(t)},{default:n(()=>[o(a,{size:`small`,danger:!t.isBanned},{default:n(()=>[m(f(t.isBanned?`解封`:`封禁`),1)]),_:2},1032,[`danger`])]),_:2},1032,[`title`,`onConfirm`]))],64)):h(``,!0)]),_:1},8,[`dataSource`,`loading`,`pagination`]),o(G,{open:j.value,"onUpdate:open":i[1]||=e=>j.value=e,title:`${M.value} 使用统计`,footer:null,width:420},{default:n(()=>[N.value?(r(),p(W,{key:0,gutter:12},{default:n(()=>[o(U,{span:8},{default:n(()=>[o(H,{size:`small`},{default:n(()=>[o(V,{title:`总账单`,value:N.value.totalTransactions},null,8,[`value`])]),_:1})]),_:1}),o(U,{span:8},{default:n(()=>[o(H,{size:`small`},{default:n(()=>[o(V,{title:`AI 记账`,value:N.value.aiBooked},null,8,[`value`])]),_:1})]),_:1}),o(U,{span:8},{default:n(()=>[o(H,{size:`small`},{default:n(()=>[o(V,{title:`AI 准确率`,value:N.value.aiAccuracy,suffix:`%`,"value-style":{color:N.value.aiAccuracy>=70?`#00B386`:`#F0642D`}},null,8,[`value`,`value-style`])]),_:1})]),_:1})]),_:1})):h(``,!0)]),_:1},8,[`open`,`title`])],64)}}});export{T as default}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/api-BV_Zb8mM.js b/backend/MiaoJiZhang.Api/wwwroot/assets/api-BV_Zb8mM.js new file mode 100644 index 0000000..8f04294 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/api-BV_Zb8mM.js @@ -0,0 +1,9 @@ +import{a as e}from"./config-provider-q7ATIdCu.js";import{t}from"./index-BSN4-dIH.js";function n(e,t){return function(){return e.apply(t,arguments)}}var{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:a,toStringTag:o}=Symbol,s=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=(e,t)=>{let n=e,r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),s(n,t))return!0;n=i(n)}return!1},l=(e,t)=>e!=null&&c(e,t)?e[t]:void 0,u=(e=>t=>{let n=r.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),d=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:p}=Array,m=f(`undefined`);function h(e){return e!==null&&!m(e)&&e.constructor!==null&&!m(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var g=d(`ArrayBuffer`);function _(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t}var v=f(`string`),y=f(`function`),b=f(`number`),x=e=>typeof e==`object`&&!!e,S=e=>e===!0||e===!1,C=e=>{if(!x(e))return!1;let t=i(e);return(t===null||t===Object.prototype||i(t)===null)&&!c(e,o)&&!c(e,a)},w=e=>{if(!x(e)||h(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},T=d(`Date`),E=d(`File`),D=e=>!!(e&&e.uri!==void 0),ee=e=>e&&e.getParts!==void 0,te=d(`Blob`),O=d(`FileList`),k=e=>x(e)&&y(e.pipe);function A(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var j=A(),M=j.FormData===void 0?void 0:j.FormData,ne=e=>{if(!e)return!1;if(M&&e instanceof M)return!0;let t=i(e);if(!t||t===Object.prototype||!y(e.append))return!1;let n=u(e);return n===`formdata`||n===`object`&&y(e.toString)&&e.toString()===`[object FormData]`},re=d(`URLSearchParams`),[ie,N,ae,oe]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(d),P=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function F(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),p(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}var I=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,ce=e=>!m(e)&&e!==I;function le(...e){let{caseless:t,skipUndefined:n}=ce(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&se(r,i)||i,o=s(r,a)?r[a]:void 0;C(o)&&C(e)?r[a]=le(o,e):C(e)?r[a]=le({},e):p(e)?r[a]=e.slice():(!n||!m(e))&&(r[a]=e)};for(let t=0,n=e.length;t(F(t,(t,i)=>{r&&y(t)?Object.defineProperty(e,i,{__proto__:null,value:n(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),de=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),fe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},pe=(e,t,n,r)=>{let a,o,s,c={};if(t||={},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-->0;)s=a[o],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},me=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},he=e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!b(t))return null;let n=Array(t);for(;t-->0;)n[t]=e[t];return n},ge=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&i(Uint8Array)),_e=(e,t)=>{let n=(e&&e[a]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},ve=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ye=d(`HTMLFormElement`),be=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:xe}=Object.prototype,Se=d(`RegExp`),Ce=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};F(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},we=e=>{Ce(e,(t,n)=>{if(y(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(y(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Te=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return p(e)?r(e):r(String(e).split(t)),n},Ee=()=>{},De=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Oe(e){return!!(e&&y(e.append)&&e[o]===`FormData`&&e[a])}var ke=e=>{let t=new WeakSet,n=e=>{if(x(e)){if(t.has(e))return;if(h(e))return e;if(!(`toJSON`in e)){t.add(e);let r=p(e)?[]:{};return F(e,(e,t)=>{let i=n(e);!m(i)&&(r[t]=i)}),t.delete(e),r}}return e};return n(e)},Ae=d(`AsyncFunction`),je=e=>e&&(x(e)||y(e))&&y(e.then)&&y(e.catch),Me=((e,t)=>e?setImmediate:t?((e,t)=>(I.addEventListener(`message`,({source:n,data:r})=>{n===I&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),I.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,y(I.postMessage)),Ne=typeof queueMicrotask<`u`?queueMicrotask.bind(I):typeof process<`u`&&process.nextTick||Me,Pe=e=>e!=null&&y(e[a]),L={isArray:p,isArrayBuffer:g,isBuffer:h,isFormData:ne,isArrayBufferView:_,isString:v,isNumber:b,isBoolean:S,isObject:x,isPlainObject:C,isEmptyObject:w,isReadableStream:ie,isRequest:N,isResponse:ae,isHeaders:oe,isUndefined:m,isDate:T,isFile:E,isReactNativeBlob:D,isReactNative:ee,isBlob:te,isRegExp:Se,isFunction:y,isStream:k,isURLSearchParams:re,isTypedArray:ge,isFileList:O,forEach:F,merge:le,extend:ue,trim:P,stripBOM:de,inherits:fe,toFlatObject:pe,kindOf:u,kindOfTest:d,endsWith:me,toArray:he,forEachEntry:_e,matchAll:ve,isHTMLForm:ye,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:c,getSafeProp:l,reduceDescriptors:Ce,freezeMethods:we,toObjectSet:Te,toCamelCase:be,noop:Ee,toFiniteNumber:De,findKey:se,global:I,isContextDefined:ce,isSpecCompliantForm:Oe,toJSONObject:ke,isAsyncFn:Ae,isThenable:je,setImmediate:Me,asap:Ne,isIterable:Pe,isSafeIterable:e=>e!=null&&c(e,a)&&Pe(e)},Fe=L.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Ie=e=>{let t={},n,r,i;return e&&e.split(` +`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Fe[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};function Le(e){let t=0,n=e.length;for(;tt;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var Re=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),ze=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function Be(e,t){return L.isArray(e)?e.map(e=>Be(e,t)):Le(String(e).replace(t,``))}var Ve=e=>Be(e,Re),He=e=>Be(e,ze);function Ue(e){let t=Object.create(null);return L.forEach(e.toJSON(),(e,n)=>{t[n]=He(e)}),t}var We=Symbol(`internals`);function R(e){return e&&String(e).trim().toLowerCase()}function Ge(e){return e===!1||e==null?e:L.isArray(e)?e.map(Ge):Ve(String(e))}function Ke(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var qe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Je(e,t,n,r,i){if(L.isFunction(r))return r.call(this,t,n);if(i&&(t=n),L.isString(t)){if(L.isString(r))return t.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(t)}}function Ye(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Xe(e,t){let n=L.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var z=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=R(t);if(!i)return;let a=L.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Ge(e))}let a=(e,t)=>L.forEach(e,(e,n)=>i(e,n,t));if(L.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(L.isString(e)&&(e=e.trim())&&!qe(e))a(Ie(e),t);else if(L.isObject(e)&&L.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!L.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],L.hasOwnProp(n,i)?(r=n[i],n[i]=L.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=R(e),e){let n=L.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Ke(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=R(e),e){let n=L.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Je(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=R(e),e){let i=L.findKey(n,e);i&&(!t||Je(n,n[i],i,t))&&(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Je(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return L.forEach(this,(r,i)=>{let a=L.findKey(n,i);if(a){t[a]=Ge(r),delete t[i];return}let o=e?Ye(i):String(i).trim();o!==i&&delete t[i],t[o]=Ge(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return L.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&L.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` +`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[We]=this[We]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=R(e);t[r]||(Xe(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};z.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),L.reduceDescriptors(z.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),L.freezeMethods(z);var Ze=`[REDACTED ****]`;function Qe(e){if(L.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function $e(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||L.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof z&&(e=e.toJSON()),r.push(e);let t;if(L.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);L.isUndefined(r)||(t[n]=r)});else{if(!L.isPlainObject(e)&&Qe(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?Ze:i(a);L.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var B=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&L.hasOwnProp(e,`redact`)?e.redact:void 0,n=L.isArray(t)&&t.length>0?$e(e,t):L.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};B.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,B.ERR_BAD_OPTION=`ERR_BAD_OPTION`,B.ECONNABORTED=`ECONNABORTED`,B.ETIMEDOUT=`ETIMEDOUT`,B.ECONNREFUSED=`ECONNREFUSED`,B.ERR_NETWORK=`ERR_NETWORK`,B.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,B.ERR_DEPRECATED=`ERR_DEPRECATED`,B.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,B.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,B.ERR_CANCELED=`ERR_CANCELED`,B.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,B.ERR_INVALID_URL=`ERR_INVALID_URL`,B.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function et(e){return L.isPlainObject(e)||L.isArray(e)}function tt(e){return L.endsWith(e,`[]`)?e.slice(0,-2):e}function nt(e,t,n){return e?e.concat(t).map(function(e,t){return e=tt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function rt(e){return L.isArray(e)&&!e.some(et)}var it=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function V(e,t,n){if(!L.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!L.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||m,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&L.isSpecCompliantForm(t),u=[];if(!L.isFunction(i))throw TypeError(`visitor must be a function`);function d(e){if(e===null)return``;if(L.isDate(e))return e.toISOString();if(L.isBoolean(e))return e.toString();if(!l&&L.isBlob(e))throw new B(`Blob is not supported. Use a Buffer instead.`);if(L.isArrayBuffer(e)||L.isTypedArray(e)){if(l&&typeof s==`function`)return new s([e]);if(typeof Buffer<`u`)return Buffer.from(e);throw new B(`Blob is not supported. Use a Buffer instead.`,B.ERR_NOT_SUPPORT)}return e}function f(e){if(e>c)throw new B(`Object is too deeply nested (`+e+` levels). Max depth: `+c,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,t){if(c===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!L.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),f(t+n.length-1),r})}function m(e,n,i){let s=e;if(L.isReactNative(t)&&L.isReactNativeBlob(e))return t.append(nt(i,n,a),d(e)),!1;if(e&&!i&&typeof e==`object`){if(L.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=p(e,1);else if(L.isArray(e)&&rt(e)||(L.isFileList(e)||L.endsWith(n,`[]`))&&(s=L.toArray(e)))return n=tt(n),s.forEach(function(e,r){!(L.isUndefined(e)||e===null)&&t.append(o===!0?nt([n],r,a):o===null?n:n+`[]`,d(e))}),!1}return et(e)?!0:(t.append(nt(i,n,a),d(e)),!1)}let h=Object.assign(it,{defaultVisitor:m,convertValue:d,isVisitable:et});function g(e,n,r=0){if(!L.isUndefined(e)){if(f(r),u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),L.forEach(e,function(e,a){(!(L.isUndefined(e)||e===null)&&i.call(t,e,L.isString(a)?a.trim():a,n,h))===!0&&g(e,n?n.concat(a):[a],r+1)}),u.pop()}}if(!L.isObject(e))throw TypeError(`data must be an object`);return g(e),t}function at(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ot(e,t){this._pairs=[],e&&V(e,this,t)}var st=ot.prototype;st.append=function(e,t){this._pairs.push([e,t])},st.toString=function(e){let t=e?t=>e.call(this,t,at):at;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function ct(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function lt(e,t,n){if(!t)return e;e||=``;let r=L.isFunction(n)?{serialize:n}:n,i=L.getSafeProp(r,`encode`)||ct,a=L.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):L.isURLSearchParams(t)?t.toString():new ot(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var ut=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){L.forEach(this.handlers,function(t){t!==null&&e(t)})}},dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ft={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:ot,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},pt=t({hasBrowserEnv:()=>mt,hasStandardBrowserEnv:()=>gt,hasStandardBrowserWebWorkerEnv:()=>_t,navigator:()=>ht,origin:()=>vt}),mt=typeof window<`u`&&typeof document<`u`,ht=typeof navigator==`object`&&navigator||void 0,gt=mt&&(!ht||[`ReactNative`,`NativeScript`,`NS`].indexOf(ht.product)<0),_t=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,vt=mt&&window.location.href||`http://localhost`,H={...pt,...ft};function yt(e,t){return V(e,new H.classes.URLSearchParams,{visitor:function(e,t,n,r){return H.isNode&&L.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}var bt=100;function xt(e){if(e>bt)throw new B(`FormData field is too deeply nested (`+e+` levels). Max depth: `+bt,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function St(e){let t=[],n=/\w+|\[(\w*)]/g,r;for(;(r=n.exec(e))!==null;)xt(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Ct(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r=e.length;return a=!a&&L.isArray(r)?r.length:a,s?(L.hasOwnProp(r,a)?r[a]=L.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!L.hasOwnProp(r,a)||!L.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=Ct(r[a])),!o)}if(L.isFormData(e)&&L.isFunction(e.entries)){let n={};return L.forEachEntry(e,(e,r)=>{t(St(e),r,n,0)}),n}return null}var U=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function Tt(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var W={transitional:dt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r?JSON.stringify(wt(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=U(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return yt(e,t).toString();if((a=L.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=U(this,`env`),r=n&&n.FormData;return V(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Tt(e)):e}],transformResponse:[function(e){let t=U(this,`transitional`)||W.transitional,n=t&&t.forcedJSONParsing,r=U(this,`responseType`),i=r===`json`;if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,U(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?B.from(e,B.ERR_BAD_RESPONSE,this,null,U(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:H.classes.FormData,Blob:H.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{W.headers[e]={}});function Et(e,t){let n=this||W,r=t||n,i=z.from(r.headers),a=r.data;return L.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Dt(e){return!!(e&&e.__CANCEL__)}var G=class extends B{constructor(e,t,n){super(e??`canceled`,B.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Ot(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new B(`Request failed with status code `+n.status,n.status>=400&&n.status<500?B.ERR_BAD_REQUEST:B.ERR_BAD_RESPONSE,n.config,n.request,n))}function kt(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function At(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var K=(e,t,n=3)=>{let r=0,i=At(50,250);return jt(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Mt=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Nt=e=>(...t)=>L.asap(()=>e(...t)),Pt=H.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,H.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(H.origin),H.navigator&&/(msie|trident)/i.test(H.navigator.userAgent)):()=>!0,Ft=H.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&s.push(`path=${r}`),L.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),L.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;ne instanceof z?{...e}:e;function q(e,t){e||={},t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:r},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n,i){if(!L.isUndefined(t))return r(e,t,n,i);if(!L.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){if(!L.isUndefined(t))return r(void 0,t);if(!L.isUndefined(e))return r(void 0,e)}function s(n){let r=L.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!L.isUndefined(r))if(L.isPlainObject(r)){if(L.hasOwnProp(r,n))return r[n]}else return;let i=L.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(L.isPlainObject(i)&&L.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(L.hasOwnProp(t,a))return r(n,i);if(L.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(Wt(e),Wt(t),n,!0)};return L.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=L.hasOwnProp(l,r)?l[r]:i,o=a(L.hasOwnProp(e,r)?e[r]:void 0,L.hasOwnProp(t,r)?t[r]:void 0,r);L.isUndefined(o)&&a!==c||(n[r]=o)}),L.hasOwnProp(t,`validateStatus`)&&L.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(L.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Gt=[`content-type`,`content-length`];function Kt(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{Gt.includes(t.toLowerCase())&&e.set(t,n)})}var qt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function Jt(e){let t=q({},e),n=e=>L.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=z.from(s),t.url=lt(Ut(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=L.getSafeProp(c,`username`)||``,n=L.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?qt(n):``)))}catch(t){throw B.from(t,B.ERR_BAD_OPTION_VALUE,e)}}if(L.isFormData(r)&&(H.hasStandardBrowserEnv||H.hasStandardBrowserWebWorkerEnv||L.isReactNative(r)?s.setContentType(void 0):L.isFunction(r.getHeaders)&&Kt(s,r.getHeaders(),n(`formDataHeaderPolicy`))),H.hasStandardBrowserEnv&&(L.isFunction(i)&&(i=i(t)),i===!0||i==null&&Pt(t.url))){let e=a&&o&&Ft.read(o);e&&s.set(a,e)}return t}var Yt=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=Jt(e),i=r.data,a=z.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=z.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Ot(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new B(`Request aborted`,B.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new B(t&&t.message?t.message:`Network Error`,B.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||dt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new B(t,i.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&L.forEach(Ue(a),function(e,t){h.setRequestHeader(t,e)}),L.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=K(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=K(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new G(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=kt(r.url);if(_&&!H.protocols.includes(_)){n(new B(`Unsupported protocol `+_+`:`,B.ERR_BAD_REQUEST,e)),m();return}h.send(i||null)})},Xt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof B?t:new G(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new B(`timeout of ${t}ms exceeded`,B.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i,{once:!0}));let{signal:s}=n;return s.unsubscribe=()=>L.asap(o),s},Zt=function*(e,t){let n=e.byteLength;if(!t||n{let i=Qt(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},J=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,tn=(e,t,n)=>t+2e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}let i=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var rn=`1.18.1`,an=64*1024,{isFunction:on}=L,sn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),cn=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},ln=(e,...t)=>{try{return!!e(...t)}catch{return!1}},un=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},dn=e=>{let t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?on(i):typeof fetch==`function`,c=on(a),l=on(o);if(!s)return!1;let u=s&&on(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&ln(()=>{let e=!1,t=new a(H.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&ln(()=>L.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new B(`Response type '${e}' is not supported`,B.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(L.isBlob(e))return e.size;if(L.isSpecCompliantForm(e))return(await new a(H.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(L.isArrayBufferView(e)||L.isArrayBuffer(e))return e.byteLength;if(L.isURLSearchParams(e)&&(e+=``),L.isString(e))return(await d(e)).byteLength},g=async(e,t)=>L.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:S=`same-origin`,fetchOptions:C,maxContentLength:w,maxBodyLength:T}=Jt(e),E=L.isNumber(w)&&w>-1,D=L.isNumber(T)&&T>-1,ee=t=>L.hasOwnProp(e,t)?e[t]:void 0,te=i||fetch;b=b?(b+``).toLowerCase():`text`;let O=Xt([l,d&&d.toAbortSignal()],_),k=null,A=O&&O.unsubscribe&&(()=>{O.unsubscribe()}),j,M=null,ne=()=>new B(`Request body larger than maxBodyLength limit`,B.ERR_BAD_REQUEST,e,k);try{let i,l=ee(`auth`);if(l&&(i={username:L.getSafeProp(l,`username`)||``,password:L.getSafeProp(l,`password`)||``}),un(t)){let e=new URL(t,H.origin);!i&&(e.username||e.password)&&(i={username:cn(e.username),password:cn(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(sn((i.username||``)+`:`+(i.password||``))))),E&&typeof t==`string`&&t.startsWith(`data:`)&&nn(t)>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k);if(D&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(j=e,e>T))throw ne()}let d=D&&(L.isReadableStream(s)||L.isStream(s)),_=(e,t,n)=>en(e,an,e=>{if(D&&e>T)throw M=ne();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(j??=await g(x,s),j!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(L.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&Mt(j,K(Nt(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new B(`Stream request bodies are not supported by the current fetch implementation`,B.ERR_NOT_SUPPORT,e,k);L.isString(S)||(S=S?`include`:`omit`);let re=c&&`credentials`in a.prototype;if(L.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+rn,!1);let ie={...C,signal:O,method:n.toUpperCase(),headers:Ue(x.normalize()),body:s,duplex:`half`,credentials:re?S:void 0};k=c&&new a(t,ie);let N=await(c?te(k,C):te(t,ie)),ae=z.from(N.headers);if(E){let t=L.toFiniteNumber(ae.getContentLength());if(t!=null&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k)}let oe=p&&(b===`stream`||b===`response`);if(p&&N.body&&(v||E||oe&&A)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=N[e]});let n=L.toFiniteNumber(ae.getContentLength()),[r,i]=v&&Mt(n,K(Nt(v),!0))||[],a=0;N=new o(en(N.body,an,t=>{if(E&&(a=t,a>w))throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k);r&&r(t)},()=>{i&&i(),A&&A()}),t)}b||=`text`;let P=await m[L.findKey(m,b)||`text`](N,e);if(E&&!p&&!oe){let t;if(P!=null&&(typeof P.byteLength==`number`?t=P.byteLength:typeof P.size==`number`?t=P.size:typeof P==`string`&&(t=typeof r==`function`?new r().encode(P).byteLength:P.length)),typeof t==`number`&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k)}return!oe&&A&&A(),await new Promise((t,n)=>{Ot(t,n,{data:P,headers:z.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:k})})}catch(t){if(A&&A(),O&&O.aborted&&O.reason instanceof B){let n=O.reason;throw n.config=e,k&&(n.request=k),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(M)throw k&&!M.request&&(M.request=k),M;if(t instanceof B)throw k&&!t.request&&(t.request=k),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new B(`Network Error`,B.ERR_NETWORK,e,k,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw B.from(t,t&&t.code,e,k,t&&t.response)}}},fn=new Map,pn=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=fn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:dn(t)),l=c;return c};pn();var mn={http:null,xhr:Yt,fetch:{get:pn}};L.forEach(mn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var hn=e=>`- ${e}`,gn=e=>L.isFunction(e)||e===null||e===!1;function _n(e,t){e=L.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new B(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since : +`+e.map(hn).join(` +`):` `+hn(e[0]):`as no adapter specified`),B.ERR_NOT_SUPPORT)}return i}var vn={getAdapter:_n,adapters:mn};function yn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new G(null,e)}function bn(e){return yn(e),e.headers=z.from(e.headers),e.data=Et.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),vn.getAdapter(e.adapter||W.adapter,e)(e).then(function(t){yn(e),e.response=t;try{t.data=Et.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=z.from(t.headers),t},function(t){if(!Dt(t)&&(yn(e),t&&t.response)){e.response=t.response;try{t.response.data=Et.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=z.from(t.response.headers)}return Promise.reject(t)})}var xn={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{xn[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Sn={};xn.transitional=function(e,t,n){function r(e,t){return`[Axios v`+rn+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new B(r(i,` has been removed`+(t?` in `+t:``)),B.ERR_DEPRECATED);return t&&!Sn[i]&&(Sn[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),!e||e(n,i,a)}},xn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Cn(e,t,n){if(typeof e!=`object`||!e)throw new B(`options must be an object`,B.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-->0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new B(`option `+a+` must be `+n,B.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new B(`Unknown option `+a,B.ERR_BAD_OPTION)}}var Y={assertOptions:Cn,validators:xn},X=Y.validators,Z=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ut,response:new ut}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(` +`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(` +`),r=t===-1?-1:n.indexOf(` +`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=` +`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=q(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Y.assertOptions(n,{silentJSONParsing:X.transitional(X.boolean),forcedJSONParsing:X.transitional(X.boolean),clarifyTimeoutError:X.transitional(X.boolean),legacyInterceptorReqResOrdering:X.transitional(X.boolean),advertiseZstdAcceptEncoding:X.transitional(X.boolean),validateStatusUndefinedResolves:X.transitional(X.boolean)},!1),r!=null&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Y.assertOptions(r,{encode:X.function,serialize:X.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Y.assertOptions(t,{baseUrl:X.spelling(`baseURL`),withXsrfToken:X.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&L.merge(i.common,i[t.method]);i&&L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=z.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||dt;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[bn.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new G(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Tn(e){return function(t){return e.apply(null,t)}}function En(e){return L.isObject(e)&&e.isAxiosError===!0}var Dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Dn).forEach(([e,t])=>{Dn[t]=e});function On(e){let t=new Z(e),r=n(Z.prototype.request,t);return L.extend(r,Z.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(t){return On(q(e,t))},r}var Q=On(W);Q.Axios=Z,Q.CanceledError=G,Q.CancelToken=wn,Q.isCancel=Dt,Q.VERSION=rn,Q.toFormData=V,Q.AxiosError=B,Q.Cancel=Q.CanceledError,Q.all=function(e){return Promise.all(e)},Q.spread=Tn,Q.isAxiosError=En,Q.mergeConfig=q,Q.AxiosHeaders=z,Q.formToJSON=e=>wt(L.isHTMLForm(e)?new FormData(e):e),Q.getAdapter=vn.getAdapter,Q.HttpStatusCode=Dn,Q.default=Q;var kn=localStorage.getItem(`miaoji_admin_key`)||``,$=Q.create({baseURL:``,headers:{"X-Admin-Key":kn}});$.interceptors.response.use(e=>e,t=>(t.response?.status===401&&e.error(`管理密钥无效,请在 localStorage 设置 miaoji_admin_key`),Promise.reject(t)));var An={dashboard:()=>$.get(`/api/admin/dashboard`).then(e=>e.data),configs:()=>$.get(`/api/admin/configs`).then(e=>e.data),updateConfig:(e,t)=>$.put(`/api/admin/configs/${e}`,{value:t}).then(e=>e.data),createConfig:(e,t)=>$.post(`/api/admin/configs`,{key:e,value:t}).then(e=>e.data),personas:()=>$.get(`/api/admin/personas`).then(e=>e.data),createPersona:e=>$.post(`/api/admin/personas`,e).then(e=>e.data),updatePersona:(e,t)=>$.put(`/api/admin/personas/${e}`,t).then(e=>e.data),deletePersona:e=>$.delete(`/api/admin/personas/${e}`),avatars:()=>$.get(`/api/admin/avatars`).then(e=>e.data),createAvatar:e=>$.post(`/api/admin/avatars`,e).then(e=>e.data),updateAvatar:(e,t)=>$.put(`/api/admin/avatars/${e}`,t).then(e=>e.data),deleteAvatar:e=>$.delete(`/api/admin/avatars/${e}`),stickers:()=>$.get(`/api/admin/stickers`).then(e=>e.data),createSticker:e=>$.post(`/api/admin/stickers`,e).then(e=>e.data),updateSticker:(e,t)=>$.put(`/api/admin/stickers/${e}`,t).then(e=>e.data),deleteSticker:e=>$.delete(`/api/admin/stickers/${e}`),users:e=>$.get(`/api/admin/users`,{params:e}).then(e=>e.data),toggleBan:e=>$.put(`/api/admin/users/${e}/ban`).then(e=>e.data),cancelAccountClosure:e=>$.put(`/api/admin/users/${e}/cancel-closure`).then(e=>e.data),userStats:e=>$.get(`/api/admin/users/${e}/stats`).then(e=>e.data),sysCategories:()=>$.get(`/api/admin/categories`).then(e=>e.data),createSysCategory:e=>$.post(`/api/admin/categories`,e).then(e=>e.data),updateSysCategory:(e,t)=>$.put(`/api/admin/categories/${e}`,t).then(e=>e.data),deleteSysCategory:e=>$.delete(`/api/admin/categories/${e}`),testLlm:()=>$.post(`/api/admin/llm/test`).then(e=>e.data)};export{An as t}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/api-C4vz6nB3.js b/backend/MiaoJiZhang.Api/wwwroot/assets/api-C4vz6nB3.js new file mode 100644 index 0000000..44d985b --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/api-C4vz6nB3.js @@ -0,0 +1,9 @@ +import{a as e}from"./config-provider-q7ATIdCu.js";import{t}from"./index-Dt7HDEKz.js";function n(e,t){return function(){return e.apply(t,arguments)}}var{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:a,toStringTag:o}=Symbol,s=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=(e,t)=>{let n=e,r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),s(n,t))return!0;n=i(n)}return!1},l=(e,t)=>e!=null&&c(e,t)?e[t]:void 0,u=(e=>t=>{let n=r.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),d=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:p}=Array,m=f(`undefined`);function h(e){return e!==null&&!m(e)&&e.constructor!==null&&!m(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var g=d(`ArrayBuffer`);function _(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t}var v=f(`string`),y=f(`function`),b=f(`number`),x=e=>typeof e==`object`&&!!e,S=e=>e===!0||e===!1,C=e=>{if(!x(e))return!1;let t=i(e);return(t===null||t===Object.prototype||i(t)===null)&&!c(e,o)&&!c(e,a)},w=e=>{if(!x(e)||h(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},T=d(`Date`),E=d(`File`),D=e=>!!(e&&e.uri!==void 0),ee=e=>e&&e.getParts!==void 0,te=d(`Blob`),O=d(`FileList`),k=e=>x(e)&&y(e.pipe);function A(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var j=A(),M=j.FormData===void 0?void 0:j.FormData,ne=e=>{if(!e)return!1;if(M&&e instanceof M)return!0;let t=i(e);if(!t||t===Object.prototype||!y(e.append))return!1;let n=u(e);return n===`formdata`||n===`object`&&y(e.toString)&&e.toString()===`[object FormData]`},re=d(`URLSearchParams`),[ie,N,ae,oe]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(d),P=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function F(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),p(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}var I=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,ce=e=>!m(e)&&e!==I;function le(...e){let{caseless:t,skipUndefined:n}=ce(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&se(r,i)||i,o=s(r,a)?r[a]:void 0;C(o)&&C(e)?r[a]=le(o,e):C(e)?r[a]=le({},e):p(e)?r[a]=e.slice():(!n||!m(e))&&(r[a]=e)};for(let t=0,n=e.length;t(F(t,(t,i)=>{r&&y(t)?Object.defineProperty(e,i,{__proto__:null,value:n(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),de=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),fe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},pe=(e,t,n,r)=>{let a,o,s,c={};if(t||={},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-->0;)s=a[o],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},me=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},he=e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!b(t))return null;let n=Array(t);for(;t-->0;)n[t]=e[t];return n},ge=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&i(Uint8Array)),_e=(e,t)=>{let n=(e&&e[a]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},ve=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ye=d(`HTMLFormElement`),be=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:xe}=Object.prototype,Se=d(`RegExp`),Ce=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};F(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},we=e=>{Ce(e,(t,n)=>{if(y(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(y(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Te=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return p(e)?r(e):r(String(e).split(t)),n},Ee=()=>{},De=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Oe(e){return!!(e&&y(e.append)&&e[o]===`FormData`&&e[a])}var ke=e=>{let t=new WeakSet,n=e=>{if(x(e)){if(t.has(e))return;if(h(e))return e;if(!(`toJSON`in e)){t.add(e);let r=p(e)?[]:{};return F(e,(e,t)=>{let i=n(e);!m(i)&&(r[t]=i)}),t.delete(e),r}}return e};return n(e)},Ae=d(`AsyncFunction`),je=e=>e&&(x(e)||y(e))&&y(e.then)&&y(e.catch),Me=((e,t)=>e?setImmediate:t?((e,t)=>(I.addEventListener(`message`,({source:n,data:r})=>{n===I&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),I.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,y(I.postMessage)),Ne=typeof queueMicrotask<`u`?queueMicrotask.bind(I):typeof process<`u`&&process.nextTick||Me,Pe=e=>e!=null&&y(e[a]),L={isArray:p,isArrayBuffer:g,isBuffer:h,isFormData:ne,isArrayBufferView:_,isString:v,isNumber:b,isBoolean:S,isObject:x,isPlainObject:C,isEmptyObject:w,isReadableStream:ie,isRequest:N,isResponse:ae,isHeaders:oe,isUndefined:m,isDate:T,isFile:E,isReactNativeBlob:D,isReactNative:ee,isBlob:te,isRegExp:Se,isFunction:y,isStream:k,isURLSearchParams:re,isTypedArray:ge,isFileList:O,forEach:F,merge:le,extend:ue,trim:P,stripBOM:de,inherits:fe,toFlatObject:pe,kindOf:u,kindOfTest:d,endsWith:me,toArray:he,forEachEntry:_e,matchAll:ve,isHTMLForm:ye,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:c,getSafeProp:l,reduceDescriptors:Ce,freezeMethods:we,toObjectSet:Te,toCamelCase:be,noop:Ee,toFiniteNumber:De,findKey:se,global:I,isContextDefined:ce,isSpecCompliantForm:Oe,toJSONObject:ke,isAsyncFn:Ae,isThenable:je,setImmediate:Me,asap:Ne,isIterable:Pe,isSafeIterable:e=>e!=null&&c(e,a)&&Pe(e)},Fe=L.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Ie=e=>{let t={},n,r,i;return e&&e.split(` +`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Fe[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};function Le(e){let t=0,n=e.length;for(;tt;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var Re=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),ze=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function Be(e,t){return L.isArray(e)?e.map(e=>Be(e,t)):Le(String(e).replace(t,``))}var Ve=e=>Be(e,Re),He=e=>Be(e,ze);function Ue(e){let t=Object.create(null);return L.forEach(e.toJSON(),(e,n)=>{t[n]=He(e)}),t}var We=Symbol(`internals`);function R(e){return e&&String(e).trim().toLowerCase()}function Ge(e){return e===!1||e==null?e:L.isArray(e)?e.map(Ge):Ve(String(e))}function Ke(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var qe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Je(e,t,n,r,i){if(L.isFunction(r))return r.call(this,t,n);if(i&&(t=n),L.isString(t)){if(L.isString(r))return t.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(t)}}function Ye(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Xe(e,t){let n=L.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var z=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=R(t);if(!i)return;let a=L.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Ge(e))}let a=(e,t)=>L.forEach(e,(e,n)=>i(e,n,t));if(L.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(L.isString(e)&&(e=e.trim())&&!qe(e))a(Ie(e),t);else if(L.isObject(e)&&L.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!L.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],L.hasOwnProp(n,i)?(r=n[i],n[i]=L.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=R(e),e){let n=L.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Ke(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=R(e),e){let n=L.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Je(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=R(e),e){let i=L.findKey(n,e);i&&(!t||Je(n,n[i],i,t))&&(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Je(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return L.forEach(this,(r,i)=>{let a=L.findKey(n,i);if(a){t[a]=Ge(r),delete t[i];return}let o=e?Ye(i):String(i).trim();o!==i&&delete t[i],t[o]=Ge(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return L.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&L.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` +`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[We]=this[We]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=R(e);t[r]||(Xe(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};z.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),L.reduceDescriptors(z.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),L.freezeMethods(z);var Ze=`[REDACTED ****]`;function Qe(e){if(L.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function $e(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||L.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof z&&(e=e.toJSON()),r.push(e);let t;if(L.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);L.isUndefined(r)||(t[n]=r)});else{if(!L.isPlainObject(e)&&Qe(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?Ze:i(a);L.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var B=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&L.hasOwnProp(e,`redact`)?e.redact:void 0,n=L.isArray(t)&&t.length>0?$e(e,t):L.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};B.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,B.ERR_BAD_OPTION=`ERR_BAD_OPTION`,B.ECONNABORTED=`ECONNABORTED`,B.ETIMEDOUT=`ETIMEDOUT`,B.ECONNREFUSED=`ECONNREFUSED`,B.ERR_NETWORK=`ERR_NETWORK`,B.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,B.ERR_DEPRECATED=`ERR_DEPRECATED`,B.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,B.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,B.ERR_CANCELED=`ERR_CANCELED`,B.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,B.ERR_INVALID_URL=`ERR_INVALID_URL`,B.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function et(e){return L.isPlainObject(e)||L.isArray(e)}function tt(e){return L.endsWith(e,`[]`)?e.slice(0,-2):e}function nt(e,t,n){return e?e.concat(t).map(function(e,t){return e=tt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function rt(e){return L.isArray(e)&&!e.some(et)}var it=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function V(e,t,n){if(!L.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!L.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||m,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&L.isSpecCompliantForm(t),u=[];if(!L.isFunction(i))throw TypeError(`visitor must be a function`);function d(e){if(e===null)return``;if(L.isDate(e))return e.toISOString();if(L.isBoolean(e))return e.toString();if(!l&&L.isBlob(e))throw new B(`Blob is not supported. Use a Buffer instead.`);if(L.isArrayBuffer(e)||L.isTypedArray(e)){if(l&&typeof s==`function`)return new s([e]);if(typeof Buffer<`u`)return Buffer.from(e);throw new B(`Blob is not supported. Use a Buffer instead.`,B.ERR_NOT_SUPPORT)}return e}function f(e){if(e>c)throw new B(`Object is too deeply nested (`+e+` levels). Max depth: `+c,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,t){if(c===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!L.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),f(t+n.length-1),r})}function m(e,n,i){let s=e;if(L.isReactNative(t)&&L.isReactNativeBlob(e))return t.append(nt(i,n,a),d(e)),!1;if(e&&!i&&typeof e==`object`){if(L.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=p(e,1);else if(L.isArray(e)&&rt(e)||(L.isFileList(e)||L.endsWith(n,`[]`))&&(s=L.toArray(e)))return n=tt(n),s.forEach(function(e,r){!(L.isUndefined(e)||e===null)&&t.append(o===!0?nt([n],r,a):o===null?n:n+`[]`,d(e))}),!1}return et(e)?!0:(t.append(nt(i,n,a),d(e)),!1)}let h=Object.assign(it,{defaultVisitor:m,convertValue:d,isVisitable:et});function g(e,n,r=0){if(!L.isUndefined(e)){if(f(r),u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),L.forEach(e,function(e,a){(!(L.isUndefined(e)||e===null)&&i.call(t,e,L.isString(a)?a.trim():a,n,h))===!0&&g(e,n?n.concat(a):[a],r+1)}),u.pop()}}if(!L.isObject(e))throw TypeError(`data must be an object`);return g(e),t}function at(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ot(e,t){this._pairs=[],e&&V(e,this,t)}var st=ot.prototype;st.append=function(e,t){this._pairs.push([e,t])},st.toString=function(e){let t=e?t=>e.call(this,t,at):at;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function ct(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function lt(e,t,n){if(!t)return e;e||=``;let r=L.isFunction(n)?{serialize:n}:n,i=L.getSafeProp(r,`encode`)||ct,a=L.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):L.isURLSearchParams(t)?t.toString():new ot(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var ut=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){L.forEach(this.handlers,function(t){t!==null&&e(t)})}},dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ft={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:ot,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},pt=t({hasBrowserEnv:()=>mt,hasStandardBrowserEnv:()=>gt,hasStandardBrowserWebWorkerEnv:()=>_t,navigator:()=>ht,origin:()=>vt}),mt=typeof window<`u`&&typeof document<`u`,ht=typeof navigator==`object`&&navigator||void 0,gt=mt&&(!ht||[`ReactNative`,`NativeScript`,`NS`].indexOf(ht.product)<0),_t=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,vt=mt&&window.location.href||`http://localhost`,H={...pt,...ft};function yt(e,t){return V(e,new H.classes.URLSearchParams,{visitor:function(e,t,n,r){return H.isNode&&L.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}var bt=100;function xt(e){if(e>bt)throw new B(`FormData field is too deeply nested (`+e+` levels). Max depth: `+bt,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function St(e){let t=[],n=/\w+|\[(\w*)]/g,r;for(;(r=n.exec(e))!==null;)xt(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Ct(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r=e.length;return a=!a&&L.isArray(r)?r.length:a,s?(L.hasOwnProp(r,a)?r[a]=L.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!L.hasOwnProp(r,a)||!L.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=Ct(r[a])),!o)}if(L.isFormData(e)&&L.isFunction(e.entries)){let n={};return L.forEachEntry(e,(e,r)=>{t(St(e),r,n,0)}),n}return null}var U=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function Tt(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var W={transitional:dt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r?JSON.stringify(wt(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=U(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return yt(e,t).toString();if((a=L.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=U(this,`env`),r=n&&n.FormData;return V(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Tt(e)):e}],transformResponse:[function(e){let t=U(this,`transitional`)||W.transitional,n=t&&t.forcedJSONParsing,r=U(this,`responseType`),i=r===`json`;if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,U(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?B.from(e,B.ERR_BAD_RESPONSE,this,null,U(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:H.classes.FormData,Blob:H.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{W.headers[e]={}});function Et(e,t){let n=this||W,r=t||n,i=z.from(r.headers),a=r.data;return L.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Dt(e){return!!(e&&e.__CANCEL__)}var G=class extends B{constructor(e,t,n){super(e??`canceled`,B.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Ot(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new B(`Request failed with status code `+n.status,n.status>=400&&n.status<500?B.ERR_BAD_REQUEST:B.ERR_BAD_RESPONSE,n.config,n.request,n))}function kt(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function At(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var K=(e,t,n=3)=>{let r=0,i=At(50,250);return jt(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Mt=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Nt=e=>(...t)=>L.asap(()=>e(...t)),Pt=H.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,H.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(H.origin),H.navigator&&/(msie|trident)/i.test(H.navigator.userAgent)):()=>!0,Ft=H.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&s.push(`path=${r}`),L.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),L.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;ne instanceof z?{...e}:e;function q(e,t){e||={},t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:r},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n,i){if(!L.isUndefined(t))return r(e,t,n,i);if(!L.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){if(!L.isUndefined(t))return r(void 0,t);if(!L.isUndefined(e))return r(void 0,e)}function s(n){let r=L.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!L.isUndefined(r))if(L.isPlainObject(r)){if(L.hasOwnProp(r,n))return r[n]}else return;let i=L.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(L.isPlainObject(i)&&L.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(L.hasOwnProp(t,a))return r(n,i);if(L.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(Wt(e),Wt(t),n,!0)};return L.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=L.hasOwnProp(l,r)?l[r]:i,o=a(L.hasOwnProp(e,r)?e[r]:void 0,L.hasOwnProp(t,r)?t[r]:void 0,r);L.isUndefined(o)&&a!==c||(n[r]=o)}),L.hasOwnProp(t,`validateStatus`)&&L.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(L.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Gt=[`content-type`,`content-length`];function Kt(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{Gt.includes(t.toLowerCase())&&e.set(t,n)})}var qt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function Jt(e){let t=q({},e),n=e=>L.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=z.from(s),t.url=lt(Ut(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=L.getSafeProp(c,`username`)||``,n=L.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?qt(n):``)))}catch(t){throw B.from(t,B.ERR_BAD_OPTION_VALUE,e)}}if(L.isFormData(r)&&(H.hasStandardBrowserEnv||H.hasStandardBrowserWebWorkerEnv||L.isReactNative(r)?s.setContentType(void 0):L.isFunction(r.getHeaders)&&Kt(s,r.getHeaders(),n(`formDataHeaderPolicy`))),H.hasStandardBrowserEnv&&(L.isFunction(i)&&(i=i(t)),i===!0||i==null&&Pt(t.url))){let e=a&&o&&Ft.read(o);e&&s.set(a,e)}return t}var Yt=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=Jt(e),i=r.data,a=z.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=z.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Ot(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new B(`Request aborted`,B.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new B(t&&t.message?t.message:`Network Error`,B.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||dt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new B(t,i.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&L.forEach(Ue(a),function(e,t){h.setRequestHeader(t,e)}),L.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=K(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=K(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new G(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=kt(r.url);if(_&&!H.protocols.includes(_)){n(new B(`Unsupported protocol `+_+`:`,B.ERR_BAD_REQUEST,e)),m();return}h.send(i||null)})},Xt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof B?t:new G(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new B(`timeout of ${t}ms exceeded`,B.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i,{once:!0}));let{signal:s}=n;return s.unsubscribe=()=>L.asap(o),s},Zt=function*(e,t){let n=e.byteLength;if(!t||n{let i=Qt(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},J=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,tn=(e,t,n)=>t+2e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}let i=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var rn=`1.18.1`,an=64*1024,{isFunction:on}=L,sn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),cn=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},ln=(e,...t)=>{try{return!!e(...t)}catch{return!1}},un=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},dn=e=>{let t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?on(i):typeof fetch==`function`,c=on(a),l=on(o);if(!s)return!1;let u=s&&on(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&ln(()=>{let e=!1,t=new a(H.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&ln(()=>L.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new B(`Response type '${e}' is not supported`,B.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(L.isBlob(e))return e.size;if(L.isSpecCompliantForm(e))return(await new a(H.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(L.isArrayBufferView(e)||L.isArrayBuffer(e))return e.byteLength;if(L.isURLSearchParams(e)&&(e+=``),L.isString(e))return(await d(e)).byteLength},g=async(e,t)=>L.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:S=`same-origin`,fetchOptions:C,maxContentLength:w,maxBodyLength:T}=Jt(e),E=L.isNumber(w)&&w>-1,D=L.isNumber(T)&&T>-1,ee=t=>L.hasOwnProp(e,t)?e[t]:void 0,te=i||fetch;b=b?(b+``).toLowerCase():`text`;let O=Xt([l,d&&d.toAbortSignal()],_),k=null,A=O&&O.unsubscribe&&(()=>{O.unsubscribe()}),j,M=null,ne=()=>new B(`Request body larger than maxBodyLength limit`,B.ERR_BAD_REQUEST,e,k);try{let i,l=ee(`auth`);if(l&&(i={username:L.getSafeProp(l,`username`)||``,password:L.getSafeProp(l,`password`)||``}),un(t)){let e=new URL(t,H.origin);!i&&(e.username||e.password)&&(i={username:cn(e.username),password:cn(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(sn((i.username||``)+`:`+(i.password||``))))),E&&typeof t==`string`&&t.startsWith(`data:`)&&nn(t)>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k);if(D&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(j=e,e>T))throw ne()}let d=D&&(L.isReadableStream(s)||L.isStream(s)),_=(e,t,n)=>en(e,an,e=>{if(D&&e>T)throw M=ne();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(j??=await g(x,s),j!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(L.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&Mt(j,K(Nt(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new B(`Stream request bodies are not supported by the current fetch implementation`,B.ERR_NOT_SUPPORT,e,k);L.isString(S)||(S=S?`include`:`omit`);let re=c&&`credentials`in a.prototype;if(L.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+rn,!1);let ie={...C,signal:O,method:n.toUpperCase(),headers:Ue(x.normalize()),body:s,duplex:`half`,credentials:re?S:void 0};k=c&&new a(t,ie);let N=await(c?te(k,C):te(t,ie)),ae=z.from(N.headers);if(E){let t=L.toFiniteNumber(ae.getContentLength());if(t!=null&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k)}let oe=p&&(b===`stream`||b===`response`);if(p&&N.body&&(v||E||oe&&A)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=N[e]});let n=L.toFiniteNumber(ae.getContentLength()),[r,i]=v&&Mt(n,K(Nt(v),!0))||[],a=0;N=new o(en(N.body,an,t=>{if(E&&(a=t,a>w))throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k);r&&r(t)},()=>{i&&i(),A&&A()}),t)}b||=`text`;let P=await m[L.findKey(m,b)||`text`](N,e);if(E&&!p&&!oe){let t;if(P!=null&&(typeof P.byteLength==`number`?t=P.byteLength:typeof P.size==`number`?t=P.size:typeof P==`string`&&(t=typeof r==`function`?new r().encode(P).byteLength:P.length)),typeof t==`number`&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k)}return!oe&&A&&A(),await new Promise((t,n)=>{Ot(t,n,{data:P,headers:z.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:k})})}catch(t){if(A&&A(),O&&O.aborted&&O.reason instanceof B){let n=O.reason;throw n.config=e,k&&(n.request=k),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(M)throw k&&!M.request&&(M.request=k),M;if(t instanceof B)throw k&&!t.request&&(t.request=k),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new B(`Network Error`,B.ERR_NETWORK,e,k,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw B.from(t,t&&t.code,e,k,t&&t.response)}}},fn=new Map,pn=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=fn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:dn(t)),l=c;return c};pn();var mn={http:null,xhr:Yt,fetch:{get:pn}};L.forEach(mn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var hn=e=>`- ${e}`,gn=e=>L.isFunction(e)||e===null||e===!1;function _n(e,t){e=L.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new B(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since : +`+e.map(hn).join(` +`):` `+hn(e[0]):`as no adapter specified`),B.ERR_NOT_SUPPORT)}return i}var vn={getAdapter:_n,adapters:mn};function yn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new G(null,e)}function bn(e){return yn(e),e.headers=z.from(e.headers),e.data=Et.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),vn.getAdapter(e.adapter||W.adapter,e)(e).then(function(t){yn(e),e.response=t;try{t.data=Et.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=z.from(t.headers),t},function(t){if(!Dt(t)&&(yn(e),t&&t.response)){e.response=t.response;try{t.response.data=Et.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=z.from(t.response.headers)}return Promise.reject(t)})}var xn={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{xn[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Sn={};xn.transitional=function(e,t,n){function r(e,t){return`[Axios v`+rn+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new B(r(i,` has been removed`+(t?` in `+t:``)),B.ERR_DEPRECATED);return t&&!Sn[i]&&(Sn[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),!e||e(n,i,a)}},xn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Cn(e,t,n){if(typeof e!=`object`||!e)throw new B(`options must be an object`,B.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-->0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new B(`option `+a+` must be `+n,B.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new B(`Unknown option `+a,B.ERR_BAD_OPTION)}}var Y={assertOptions:Cn,validators:xn},X=Y.validators,Z=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ut,response:new ut}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(` +`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(` +`),r=t===-1?-1:n.indexOf(` +`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=` +`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=q(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Y.assertOptions(n,{silentJSONParsing:X.transitional(X.boolean),forcedJSONParsing:X.transitional(X.boolean),clarifyTimeoutError:X.transitional(X.boolean),legacyInterceptorReqResOrdering:X.transitional(X.boolean),advertiseZstdAcceptEncoding:X.transitional(X.boolean),validateStatusUndefinedResolves:X.transitional(X.boolean)},!1),r!=null&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Y.assertOptions(r,{encode:X.function,serialize:X.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Y.assertOptions(t,{baseUrl:X.spelling(`baseURL`),withXsrfToken:X.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&L.merge(i.common,i[t.method]);i&&L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=z.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||dt;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[bn.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new G(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Tn(e){return function(t){return e.apply(null,t)}}function En(e){return L.isObject(e)&&e.isAxiosError===!0}var Dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Dn).forEach(([e,t])=>{Dn[t]=e});function On(e){let t=new Z(e),r=n(Z.prototype.request,t);return L.extend(r,Z.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(t){return On(q(e,t))},r}var Q=On(W);Q.Axios=Z,Q.CanceledError=G,Q.CancelToken=wn,Q.isCancel=Dt,Q.VERSION=rn,Q.toFormData=V,Q.AxiosError=B,Q.Cancel=Q.CanceledError,Q.all=function(e){return Promise.all(e)},Q.spread=Tn,Q.isAxiosError=En,Q.mergeConfig=q,Q.AxiosHeaders=z,Q.formToJSON=e=>wt(L.isHTMLForm(e)?new FormData(e):e),Q.getAdapter=vn.getAdapter,Q.HttpStatusCode=Dn,Q.default=Q;var kn=localStorage.getItem(`miaoji_admin_key`)||``,$=Q.create({baseURL:``,headers:{"X-Admin-Key":kn}});$.interceptors.response.use(e=>e,t=>(t.response?.status===401&&e.error(`管理密钥无效,请在 localStorage 设置 miaoji_admin_key`),Promise.reject(t)));var An={dashboard:()=>$.get(`/api/admin/dashboard`).then(e=>e.data),configs:()=>$.get(`/api/admin/configs`).then(e=>e.data),updateConfig:(e,t)=>$.put(`/api/admin/configs/${e}`,{value:t}).then(e=>e.data),createConfig:(e,t)=>$.post(`/api/admin/configs`,{key:e,value:t}).then(e=>e.data),personas:()=>$.get(`/api/admin/personas`).then(e=>e.data),createPersona:e=>$.post(`/api/admin/personas`,e).then(e=>e.data),updatePersona:(e,t)=>$.put(`/api/admin/personas/${e}`,t).then(e=>e.data),deletePersona:e=>$.delete(`/api/admin/personas/${e}`),avatars:()=>$.get(`/api/admin/avatars`).then(e=>e.data),createAvatar:e=>$.post(`/api/admin/avatars`,e).then(e=>e.data),updateAvatar:(e,t)=>$.put(`/api/admin/avatars/${e}`,t).then(e=>e.data),deleteAvatar:e=>$.delete(`/api/admin/avatars/${e}`),stickers:()=>$.get(`/api/admin/stickers`).then(e=>e.data),createSticker:e=>$.post(`/api/admin/stickers`,e).then(e=>e.data),updateSticker:(e,t)=>$.put(`/api/admin/stickers/${e}`,t).then(e=>e.data),deleteSticker:e=>$.delete(`/api/admin/stickers/${e}`),users:e=>$.get(`/api/admin/users`,{params:e}).then(e=>e.data),toggleBan:e=>$.put(`/api/admin/users/${e}/ban`).then(e=>e.data),userStats:e=>$.get(`/api/admin/users/${e}/stats`).then(e=>e.data),sysCategories:()=>$.get(`/api/admin/categories`).then(e=>e.data),createSysCategory:e=>$.post(`/api/admin/categories`,e).then(e=>e.data),updateSysCategory:(e,t)=>$.put(`/api/admin/categories/${e}`,t).then(e=>e.data),deleteSysCategory:e=>$.delete(`/api/admin/categories/${e}`),testLlm:()=>$.post(`/api/admin/llm/test`).then(e=>e.data)};export{An as t}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/config-provider-q7ATIdCu.js b/backend/MiaoJiZhang.Api/wwwroot/assets/config-provider-q7ATIdCu.js new file mode 100644 index 0000000..b44f421 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/config-provider-q7ATIdCu.js @@ -0,0 +1,111 @@ +function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ee=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),te=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ne=/-\w/g,T=te(e=>e.replace(ne,e=>e.slice(1).toUpperCase())),re=/\B([A-Z])/g,ie=te(e=>e.replace(re,`-$1`).toLowerCase()),ae=te(e=>e.charAt(0).toUpperCase()+e.slice(1)),oe=te(e=>e?`on${ae(e)}`:``),se=(e,t)=>!Object.is(e,t),ce=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},le=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ue=e=>{let t=g(e)?Number(e):NaN;return isNaN(t)?e:t},de,fe=()=>de||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function pe(e){if(d(e)){let t={};for(let n=0;n{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ve(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n!!(e&&e.__v_isRef===!0),Te=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?we(e)?Te(e.value):JSON.stringify(e,Ee,2):String(e),Ee=(e,t)=>we(t)?Ee(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[De(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>De(e))}:_(t)?De(t):v(t)&&!d(t)&&!C(t)?String(t):t,De=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,D,Oe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&D&&(D.active?(this.parent=D,this.index=(D.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e0&&--this._on===0){if(D===this)D=this.prevScope;else{let e=D;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Fe){let e=Fe;for(Fe=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Pe;){let t=Pe;for(Pe=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function ze(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Be(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ue(r),We(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ve(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(He(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function He(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Xe)||(e.globalVersion=Xe,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ve(e))))return;e.flags|=2;let t=e.dep,n=O,r=Ge;O=e,Ge=!0;try{ze(e);let n=e.fn(e._value);(t.version===0||se(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{O=n,Ge=r,Be(e),e.flags&=-3}}function Ue(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ue(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function We(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ge=!0,Ke=[];function qe(){Ke.push(Ge),Ge=!1}function Je(){let e=Ke.pop();Ge=e===void 0||e}function Ye(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=O;O=void 0;try{t()}finally{O=e}}}var Xe=0,Ze=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Qe=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!O||!Ge||O===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==O)t=this.activeLink=new Ze(O,this),O.deps?(t.prevDep=O.depsTail,O.depsTail.nextDep=t,O.depsTail=t):O.deps=O.depsTail=t,$e(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=O.depsTail,t.nextDep=void 0,O.depsTail.nextDep=t,O.depsTail=t,O.deps===t&&(O.deps=e)}return t}trigger(e){this.version++,Xe++,this.notify(e)}notify(e){Le();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Re()}}};function $e(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)$e(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var et=new WeakMap,tt=Symbol(``),nt=Symbol(``),rt=Symbol(``);function k(e,t,n){if(Ge&&O){let t=et.get(e);t||et.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Qe),r.map=t,r.key=n),r.track()}}function it(e,t,n,r,i,a){let o=et.get(e);if(!o){Xe++;return}let s=e=>{e&&e.trigger()};if(Le(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===rt||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(rt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(tt)),f(e)&&s(o.get(nt)));break;case`delete`:i||(s(o.get(tt)),f(e)&&s(o.get(nt)));break;case`set`:f(e)&&s(o.get(tt));break}}Re()}function at(e,t){let n=et.get(e);return n&&n.get(t)}function ot(e){let t=A(e);return t===e?t:(k(t,`iterate`,rt),Gt(e)?t:t.map(Jt))}function st(e){return k(e=A(e),`iterate`,rt),e}function ct(e,t){return Wt(e)?Yt(Ut(e)?Jt(t):t):Jt(t)}var lt={__proto__:null,[Symbol.iterator](){return ut(this,Symbol.iterator,e=>ct(this,e))},concat(...e){return ot(this).concat(...e.map(e=>d(e)?ot(e):e))},entries(){return ut(this,`entries`,e=>(e[1]=ct(this,e[1]),e))},every(e,t){return ft(this,`every`,e,t,void 0,arguments)},filter(e,t){return ft(this,`filter`,e,t,e=>e.map(e=>ct(this,e)),arguments)},find(e,t){return ft(this,`find`,e,t,e=>ct(this,e),arguments)},findIndex(e,t){return ft(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return ft(this,`findLast`,e,t,e=>ct(this,e),arguments)},findLastIndex(e,t){return ft(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return ft(this,`forEach`,e,t,void 0,arguments)},includes(...e){return mt(this,`includes`,e)},indexOf(...e){return mt(this,`indexOf`,e)},join(e){return ot(this).join(e)},lastIndexOf(...e){return mt(this,`lastIndexOf`,e)},map(e,t){return ft(this,`map`,e,t,void 0,arguments)},pop(){return ht(this,`pop`)},push(...e){return ht(this,`push`,e)},reduce(e,...t){return pt(this,`reduce`,e,t)},reduceRight(e,...t){return pt(this,`reduceRight`,e,t)},shift(){return ht(this,`shift`)},some(e,t){return ft(this,`some`,e,t,void 0,arguments)},splice(...e){return ht(this,`splice`,e)},toReversed(){return ot(this).toReversed()},toSorted(e){return ot(this).toSorted(e)},toSpliced(...e){return ot(this).toSpliced(...e)},unshift(...e){return ht(this,`unshift`,e)},values(){return ut(this,`values`,e=>ct(this,e))}};function ut(e,t,n){let r=st(e),i=r[t]();return r!==e&&!Gt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var dt=Array.prototype;function ft(e,t,n,r,i,a){let o=st(e),s=o!==e&&!Gt(e),c=o[t];if(c!==dt[t]){let t=c.apply(e,a);return s?Jt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,ct(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function pt(e,t,n,r){let i=st(e),a=i!==e&&!Gt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=ct(e,t)),n.call(this,t,ct(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?ct(e,c):c}function mt(e,t,n){let r=A(e);k(r,`iterate`,rt);let i=r[t](...n);return(i===-1||i===!1)&&Kt(n[0])?(n[0]=A(n[0]),r[t](...n)):i}function ht(e,t,n=[]){qe(),Le();let r=A(e)[t].apply(e,n);return Re(),Je(),r}var gt=e(`__proto__,__v_isRef,__isVue`),_t=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function vt(e){_(e)||(e=String(e));let t=A(this);return k(t,`has`,e),t.hasOwnProperty(e)}var yt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Lt:It:i?Ft:Pt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=lt[t]))return e;if(t===`hasOwnProperty`)return vt}let o=Reflect.get(e,t,j(e)?e:n);if((_(t)?_t.has(t):gt(t))||(r||k(e,`get`,t),i))return o;if(j(o)){let e=a&&w(t)?o:o.value;return r&&v(e)?Vt(e):e}return v(o)?r?Vt(o):zt(o):o}},bt=class extends yt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&w(t);if(!this._isShallow){let e=Wt(i);if(!Gt(n)&&!Wt(n)&&(i=A(i),n=A(n)),!a&&j(i)&&!j(n))return e||(i.value=n),!0}let o=a?Number(t)e,Et=e=>Reflect.getPrototypeOf(e);function Dt(e,t,n){return function(...r){let i=this.__v_raw,a=A(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?Tt:t?Yt:Jt;return!t&&k(a,`iterate`,l?nt:tt),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Ot(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function kt(e,t){let n={get(n){let r=this.__v_raw,i=A(r),a=A(n);e||(se(n,a)&&k(i,`get`,n),k(i,`get`,a));let{has:o}=Et(i),s=t?Tt:e?Yt:Jt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&k(A(t),`iterate`,tt),t.size},has(t){let n=this.__v_raw,r=A(n),i=A(t);return e||(se(t,i)&&k(r,`has`,t),k(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=A(a),s=t?Tt:e?Yt:Jt;return!e&&k(o,`iterate`,tt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:Ot(`add`),set:Ot(`set`),delete:Ot(`delete`),clear:Ot(`clear`)}:{add(e){let n=A(this),r=Et(n),i=A(e),a=!t&&!Gt(e)&&!Wt(e)?i:e;return r.has.call(n,a)||se(e,a)&&r.has.call(n,e)||se(i,a)&&r.has.call(n,i)||(n.add(a),it(n,`add`,a,a)),this},set(e,n){!t&&!Gt(n)&&!Wt(n)&&(n=A(n));let r=A(this),{has:i,get:a}=Et(r),o=i.call(r,e);o||=(e=A(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?se(n,s)&&it(r,`set`,e,n,s):it(r,`add`,e,n),this},delete(e){let t=A(this),{has:n,get:r}=Et(t),i=n.call(t,e);i||=(e=A(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&it(t,`delete`,e,void 0,a),o},clear(){let e=A(this),t=e.size!==0,n=e.clear();return t&&it(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Dt(r,e,t)}),n}function At(e,t){let n=kt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var jt={get:At(!1,!1)},Mt={get:At(!1,!0)},Nt={get:At(!0,!1)},Pt=new WeakMap,Ft=new WeakMap,It=new WeakMap,Lt=new WeakMap;function Rt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function zt(e){return Wt(e)?e:Ht(e,!1,St,jt,Pt)}function Bt(e){return Ht(e,!1,wt,Mt,Ft)}function Vt(e){return Ht(e,!0,Ct,Nt,It)}function Ht(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Rt(S(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Ut(e){return Wt(e)?Ut(e.__v_raw):!!(e&&e.__v_isReactive)}function Wt(e){return!!(e&&e.__v_isReadonly)}function Gt(e){return!!(e&&e.__v_isShallow)}function Kt(e){return e?!!e.__v_raw:!1}function A(e){let t=e&&e.__v_raw;return t?A(t):e}function qt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&E(e,`__v_skip`,!0),e}var Jt=e=>v(e)?zt(e):e,Yt=e=>v(e)?Vt(e):e;function j(e){return e?e.__v_isRef===!0:!1}function Xt(e){return Qt(e,!1)}function Zt(e){return Qt(e,!0)}function Qt(e,t){return j(e)?e:new $t(e,t)}var $t=class{constructor(e,t){this.dep=new Qe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:A(e),this._value=t?e:Jt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Gt(e)||Wt(e);e=n?e:A(e),se(e,t)&&(this._rawValue=e,this._value=n?e:Jt(e),this.dep.trigger())}};function en(e){e.dep&&e.dep.trigger()}function tn(e){return j(e)?e.value:e}var nn={get:(e,t,n)=>t===`__v_raw`?e:tn(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return j(i)&&!j(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function rn(e){return Ut(e)?e:new Proxy(e,nn)}function an(e){let t=d(e)?Array(e.length):{};for(let n in e)t[n]=ln(e,n);return t}var on=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=_(t)?t:String(t),this._raw=A(e);let r=!0,i=e;if(!d(e)||_(this._key)||!w(this._key))do r=!Kt(i)||Gt(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=tn(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&j(this._raw[this._key])){let t=this._object[this._key];if(j(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return at(this._raw,this._key)}},sn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function cn(e,t,n){return j(e)?e:h(e)?new sn(e):v(e)&&arguments.length>1?ln(e,t,n):Xt(e)}function ln(e,t,n){return new on(e,t,n)}var un=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Qe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Xe-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&O!==this)return Ie(this,!0),!0}get value(){let e=this.dep.track();return He(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function dn(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new un(r,i,n)}var fn={},pn=new WeakMap,mn=void 0;function hn(e,t=!1,n=mn){if(n){let t=pn.get(n);t||pn.set(n,t=[]),t.push(e)}}function gn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:Gt(e)||o===!1||o===0?_n(e,1):_n(e),m,g,_,v,y=!1,b=!1;if(j(e)?(g=()=>e.value,y=Gt(e)):Ut(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>Ut(e)||Gt(e)),g=()=>e.map(e=>{if(j(e))return e.value;if(Ut(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){qe();try{_()}finally{Je()}}let t=mn;mn=m;try{return f?f(e,3,[v]):e(v)}finally{mn=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>_n(e(),t)}let x=ke(),S=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(fn):fn,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e))if(n){let t=m.run();if(e||o||y||(b?t.some((e,t)=>se(e,C[t])):se(t,C))){_&&_();let e=mn;mn=m;try{let e=[t,C===fn?void 0:b&&C[0]===fn?[]:C,v];C=t,f?f(n,3,e):n(...e)}finally{mn=e}}}else m.run()};return u&&u(w),m=new Me(g),m.scheduler=l?()=>l(w,!1):w,v=e=>hn(e,!1,m),_=m.onStop=()=>{let e=pn.get(m);if(e){if(f)f(e,4);else for(let t of e)t();pn.delete(m)}},n?a?w(!0):C=m.run():l?l(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function _n(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,j(e))_n(e.value,t,n);else if(d(e))for(let r=0;r{_n(e,t,n)});else if(C(e)){for(let r in e)_n(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&_n(e[r],t,n)}return e}function vn(e,t,n,r){try{return r?e(...r):e()}catch(e){bn(e,t,n)}}function yn(e,t,n,r){if(h(e)){let i=vn(e,t,n,r);return i&&y(i)&&i.catch(e=>{bn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a>>1,i=M[r],a=Fn(i);a=Fn(n)?M.push(e):M.splice(kn(t),0,e),e.flags|=1,jn()}}function jn(){Dn||=En.then(In)}function Mn(e){d(e)?Cn.push(...e):wn&&e.id===-1?wn.splice(Tn+1,0,e):e.flags&1||(Cn.push(e),e.flags|=1),jn()}function Nn(e,t,n=Sn+1){for(;nFn(e)-Fn(t));if(Cn.length=0,wn){wn.push(...e);return}for(wn=e,Tn=0;Tne.id==null?e.flags&2?-1:1/0:e.id;function In(e){try{for(Sn=0;Sn{r._d&&wa(-1);let i=zn(t),a=ya.length,o;try{o=e(...n)}finally{for(let e=ya.length;e>a;e--)Sa();zn(i),r._d&&wa(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Vn(e,n){if(Ln===null)return e;let r=so(Ln),i=e.dirs||=[];for(let e=0;e1)return n&&h(t)?t.call(r&&r.proxy):t}}var Wn=Symbol.for(`v-scx`),Gn=()=>N(Wn);function Kn(e,t){return Jn(e,null,t)}function qn(e,t,n){return Jn(e,t,n)}function Jn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(Qa){if(c===`sync`){let e=Gn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=B;u.call=(e,t,n)=>yn(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{I(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():An(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=gn(e,n,u);return Qa&&(f?f.push(h):d&&h()),h}function Yn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?Xn(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=Ya(this),s=Jn(i,a.bind(r),n);return o(),s}function Xn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,er=e=>e&&(e.disabled||e.disabled===``),tr=e=>e&&(e.defer||e.defer===``),nr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,rr=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,ir=(e,t)=>{let n=e&&e.to;return g(n)?t?t(n):null:n},ar={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=er(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=er(e.props),r=e.target=ir(e.props,m),a=ur(r,e,h,p);r&&(o!==`svg`&&nr(r)?o=`svg`:o!==`mathml`&&rr(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),lr(e,!1)))},S=e=>{let t=()=>{if(Zn.get(e)===t){if(Zn.delete(e),er(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),lr(e,!0)}x(e)}};Zn.set(e,t),I(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),tr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),lr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Zn.get(e);if(u){u.flags|=8,Zn.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=er(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||nr(p)?o=`svg`:(o===`mathml`||rr(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),ua(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):or(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=ir(t.props,m);e&&(t.target=e,or(t,e,null,l,0))}else g&&or(t,p,h,l,1);lr(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=er(f),m=a||!p,h=Zn.get(e);if(h&&(h.flags|=8,Zn.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e{e.isMounted=!0}),Ur(()=>{e.isUnmounting=!0}),e}var mr=[Function,Array],hr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mr,onEnter:mr,onAfterEnter:mr,onEnterCancelled:mr,onBeforeLeave:mr,onLeave:mr,onAfterLeave:mr,onLeaveCancelled:mr,onBeforeAppear:mr,onAppear:mr,onAfterAppear:mr,onAppearCancelled:mr},gr=e=>{let t=e.subTree;return t.component?gr(t.component):t},_r={name:`BaseTransition`,props:hr,setup(e,{slots:t}){let n=Ka(),r=pr();return()=>{let i=t.default&&Tr(t.default(),!0),a=i&&i.length?vr(i):n.subTree?La():void 0;if(!a)return;let o=A(e),{mode:s}=o;if(r.isLeaving)return Sr(a);let c=Cr(a);if(!c)return Sr(a);let l=xr(c,o,r,n,e=>l=e);c.type!==R&&wr(c,l);let u=n.subTree&&Cr(n.subTree);if(u&&u.type!==R&&!ka(u,c)&&gr(n).type!==R){let e=xr(u,o,r,n);if(wr(u,e),s===`out-in`&&c.type!==R)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},Sr(a);s===`in-out`&&c.type!==R?e.delayLeave=(e,t,n)=>{let i=br(r,u);i[String(u.key)]=u,e[dr]=()=>{t(),e[dr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function vr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==R){t=n;break}}return t}var yr=_r;function br(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function xr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=br(n,e),C=(e,t)=>{e&&yn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),d(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},ee={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=_||c;else return;t[dr]&&t[dr](!0);let i=S[x];i&&ka(e,i)&&i.el[dr]&&i.el[dr](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=f;if(!n.isMounted)if(a)r=v||l,i=y||u,o=b||f;else return;let s=!1;t[fr]=e=>{s||(s=!0,C(e?o:i,[t]),ee.delayedLeave&&ee.delayedLeave(),t[fr]=void 0)};let c=t[fr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[fr]&&t[fr](!0),n.isUnmounting)return r();C(p,[t]);let a=!1;t[dr]=n=>{a||(a=!0,r(),C(n?g:h,[t]),t[dr]=void 0,S[i]===e&&delete S[i])};let o=t[dr].bind(null,!1);S[i]=e,m?w(m,[t,o]):o()},clone(e){let a=xr(e,t,n,r,i);return i&&i(a),a}};return ee}function Sr(e){if(Mr(e))return e=Fa(e),e.children=null,e}function Cr(e){if(!Mr(e))return $n(e.type)&&e.children?vr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function wr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,wr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Tr(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;ekr(e,n&&(d(n)?n[t]:n),r,a,o));return}if(jr(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&kr(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?so(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=A(v),b=v===t?i:e=>!Dr(_,e)&&u(y,e),x=(e,t)=>!(t&&Dr(_,t));if(m!=null&&m!==p){if(Ar(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(j(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))vn(p,f,12,[l,_]);else{let t=g(p),n=j(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),Or.delete(e)};t.id=-1,Or.set(e,t),I(t,r)}else Ar(e),i()}}}function Ar(e){let t=Or.get(e);t&&(t.flags|=8,Or.delete(e))}fe().requestIdleCallback,fe().cancelIdleCallback;var jr=e=>!!e.type.__asyncLoader,Mr=e=>e.type.__isKeepAlive;function Nr(e,t){Fr(e,`a`,t)}function Pr(e,t){Fr(e,`da`,t)}function Fr(e,t,n=B){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Lr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Mr(e.parent.vnode)&&Ir(r,t,n,e),e=e.parent}}function Ir(e,t,n,r){let i=Lr(t,e,r,!0);Wr(()=>{c(r[t],i)},n)}function Lr(e,t,n=B,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{qe();let i=Ya(n),a=yn(t,n,e,r);return i(),Je(),a};return r?i.unshift(a):i.push(a),a}}var Rr=e=>(t,n=B)=>{(!Qa||e===`sp`)&&Lr(e,(...e)=>t(...e),n)},zr=Rr(`bm`),Br=Rr(`m`),Vr=Rr(`bu`),Hr=Rr(`u`),Ur=Rr(`bum`),Wr=Rr(`um`),Gr=Rr(`sp`),Kr=Rr(`rtg`),qr=Rr(`rtc`);function Jr(e,t=B){Lr(`ec`,e,t)}var Yr=`components`,Xr=`directives`;function Zr(e,t){return ti(Yr,e,!0,t)||e}var Qr=Symbol.for(`v-ndc`);function $r(e){return g(e)?ti(Yr,e,!1)||e:e||Qr}function ei(e){return ti(Xr,e)}function ti(e,t,n=!0,r=!1){let i=Ln||B;if(i){let n=i.type;if(e===Yr){let e=co(n,!1);if(e&&(e===t||e===T(t)||e===ae(T(t))))return n}let a=ni(i[e]||n[e],t)||ni(i.appContext[e],t);return!a&&r?n:a}}function ni(e,t){return e&&(e[t]||e[T(t)]||e[ae(T(t))])}function ri(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Ut(e),r=!1,s=!1;n&&(r=!Gt(e),s=Wt(e),e=st(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;re?Za(e)?so(e):ii(e.parent):null,ai=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ii(e.parent),$root:e=>ii(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>gi(e),$forceUpdate:e=>e.f||=()=>{An(e.update)},$nextTick:e=>e.n||=On.bind(e.proxy),$watch:e=>Yn.bind(e)}),oi=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),si={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(oi(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else di&&(s[n]=0)}let d=ai[n],f,p;if(d)return n===`$attrs`&&k(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return oi(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||oi(n,c)||u(o,c)||u(i,c)||u(ai,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ci(){return li(`useAttrs`).attrs}function li(e){let t=Ka();return t.setupContext||=oo(t)}function ui(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var di=!0;function fi(e){let t=gi(e),n=e.proxy,i=e.ctx;di=!1,t.beforeCreate&&mi(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:ee,renderTracked:te,renderTriggered:ne,errorCaptured:T,serverPrefetch:re,expose:ie,inheritAttrs:ae,components:oe,directives:se,filters:ce}=t;if(u&&pi(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=zt(t))}if(di=!0,o)for(let e in o){let t=o[e],a=V({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)hi(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Un(t,e[t])})}f&&mi(f,e,`c`);function E(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(E(zr,p),E(Br,m),E(Vr,g),E(Hr,_),E(Nr,y),E(Pr,b),E(Jr,T),E(qr,te),E(Kr,ne),E(Ur,S),E(Wr,w),E(Gr,re),d(ie))if(ie.length){let t=e.exposed||={};ie.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};ee&&e.render===r&&(e.render=ee),ae!=null&&(e.inheritAttrs=ae),oe&&(e.components=oe),se&&(e.directives=se),re&&Er(e)}function pi(e,t,n=r){d(e)&&(e=xi(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?N(r.from||n,r.default,!0):N(r.from||n):N(r),j(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function mi(e,t,n){yn(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function hi(e,t,n,r){let i=r.includes(`.`)?Xn(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&qn(i,n)}else if(h(e))qn(i,e.bind(n));else if(v(e))if(d(e))e.forEach(e=>hi(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&qn(i,r,e)}}function gi(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>_i(c,e,o,!0)),_i(c,t,o)),v(t)&&a.set(t,c),c}function _i(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&_i(e,a,n,!0),i&&i.forEach(t=>_i(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=vi[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var vi={data:yi,props:Ci,emits:Ci,methods:Si,computed:Si,beforeCreate:F,created:F,beforeMount:F,mounted:F,beforeUpdate:F,updated:F,beforeDestroy:F,beforeUnmount:F,destroyed:F,unmounted:F,activated:F,deactivated:F,errorCaptured:F,serverPrefetch:F,components:Si,directives:Si,watch:wi,provide:yi,inject:bi};function yi(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function bi(e,t){return Si(xi(e),xi(t))}function xi(e){if(d(e)){let t={};for(let n=0;nt===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${T(t)}Modifiers`]||e[`${ie(t)}Modifiers`];function Ai(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&ki(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=r.map(le)));let c,l=i[c=oe(n)]||i[c=oe(T(n))];!l&&o&&(l=i[c=oe(ie(n))]),l&&yn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,yn(u,e,6,a)}}var ji=new WeakMap;function Mi(e,t,n=!1){let r=n?ji:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Mi(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function Ni(e,t){return!e||!a(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,ie(t))||u(e,t))}function Pi(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=zn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Ra(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Ra(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Fi(c)}}catch(t){ya.length=0,bn(t,e,1),v=z(R)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=Ii(y,a)),b=Fa(b,y,!1,!0))}return n.dirs&&(b=Fa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&wr(b,n.transition),v=b,zn(_),v}var Fi=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},Ii=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Li(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ri(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(Vi),Ui=e=>Object.getPrototypeOf(e)===Vi;function Wi(e,t,n,r=!1){let i={},a=Hi();e.propsDefaults=Object.create(null),Ki(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Bt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Gi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=A(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{p=!0;let[t,n]=Yi(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Qi=e=>d(e)?e.map(Ra):[Ra(e)],$i=(e,t,n)=>{if(t._n)return t;let r=Bn((...e)=>Qi(t(...e)),n);return r._c=!1,r},ea=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Zi(n))continue;let i=e[n];if(h(i))t[n]=$i(n,i,r);else if(i!=null){let e=Qi(i);t[n]=()=>e}}},ta=(e,t)=>{let n=Qi(t);e.slots.default=()=>n},na=(e,t,n)=>{for(let r in t)(n||!Zi(r))&&(e[r]=t[r])},ra=(e,t,n)=>{let r=e.slots=Hi();if(e.vnode.shapeFlag&32){let e=t._;e?(na(r,t,n),n&&E(r,`_`,e,!0)):ea(t,r)}else t&&ta(e,t)},ia=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:na(a,n,r):(o=!n.$stable,ea(n,a)),s=n}else n&&(ta(e,n),s={default:1});if(o)for(let e in a)!Zi(e)&&s[e]==null&&delete a[e]},I=ga;function aa(e){return oa(e)}function oa(e,i){let a=fe();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!ka(e,t)&&(r=Se(e),_e(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case _a:y(e,t,n,r);break;case R:b(e,t,n,r);break;case va:e??x(t,n,r,o);break;case L:oe(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?se(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,Te)}u!=null&&i?kr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&kr(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)te(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),re(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},te=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&T(e.children,d,null,r,i,sa(e,a),s,u),_&&Hn(e,null,r,`created`),ne(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!ee(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Ha(f,r,e)}_&&Hn(e,null,r,`beforeMount`);let v=la(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&I(()=>{try{f&&Ha(f,r,e),v&&g.enter(d),_&&Hn(e,null,r,`mounted`)}finally{}},i)},ne=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&ca(r,!1),(g=h.onVnodeBeforeUpdate)&&Ha(g,r,n,e),f&&Hn(n,e,r,`beforeUpdate`),r&&ca(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?ie(e.dynamicChildren,d,l,r,i,sa(n,a),o):s||pe(e,n,l,null,r,i,sa(n,a),o,!1),u>0){if(u&16)ae(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t{g&&Ha(g,r,n,e),f&&Hn(n,e,r,`updated`)},i)},ie=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(n!==r){if(n!==t)for(let t in n)!ee(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(ee(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},oe=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),T(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ie(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&ua(e,t,!0)):pe(e,t,n,f,i,a,s,c,l)},se=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):E(t,n,r,i,a,o,c):le(e,t,c)},E=(e,t,n,r,i,a,o)=>{let s=e.component=Ga(e,r,i);if(Mr(e)&&(s.ctx.renderer=Te),$a(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ue,o),!e.el){let r=s.subTree=z(R);b(null,r,t,n),e.placeholder=r.el}}else ue(s,e,t,n,i,a,o)},le=(e,t,n)=>{let r=t.component=e.component;if(Li(e,t,n))if(r.asyncDep&&!r.asyncResolved){de(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},ue=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=fa(e);if(n){t&&(t.el=c.el,de(e,t,o)),n.asyncDep.then(()=>{I(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;ca(e,!1),t?(t.el=c.el,de(e,t,o)):t=c,n&&ce(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Ha(d,s,t,c),ca(e,!0);let f=Pi(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),Se(p),e,i,a),t.el=f.el,u===null&&Bi(e,f.el),r&&I(r,i),(d=t.props&&t.props.onVnodeUpdated)&&I(()=>Ha(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=jr(t);if(ca(e,!1),l&&ce(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Ha(o,d,t),ca(e,!0),s&&De){let t=()=>{e.subTree=Pi(e),De(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Pi(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&I(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;I(()=>Ha(o,d,e),i)}(t.shapeFlag&256||d&&jr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&I(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Me(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>An(u),ca(e,!0),l()},de=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Gi(e,t.props,r,n),ia(e,t.children,n),qe(),Nn(e),Je()},pe=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){he(l,d,n,r,i,a,o,s,c);return}else if(f&256){me(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&xe(l,i,a),d!==l&&p(n,d)):u&16?m&16?he(l,d,n,r,i,a,o,s,c):xe(l,i,a,!0):(u&8&&p(n,``),m&16&&T(d,n,r,i,a,o,s,c))},me=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?xe(e,a,o,!0,!1,f):T(t,r,i,a,o,s,c,l,f)},he=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?za(t[u]):Ra(t[u]);if(ka(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?za(t[p]):Ra(t[p]);if(ka(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=ep)for(;u<=f;)_e(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?za(t[u]):Ra(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){_e(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&ka(n,t[_])){i=_;break}i===void 0?_e(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?da(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ge(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,Te);return}if(c===L){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[dr];a._isLeaving&&a[dr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}else o(a,t,n)},_e=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(qe(),kr(s,null,n,e,!0),Je()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!jr(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Ha(_,t,e),u&6)be(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Hn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Te,r):l&&!l.hasOnce&&(a!==L||d>0&&d&64)?xe(l,t,n,!1,!0):(a===L&&d&384||!i&&u&16)&&xe(c,t,n),r&&ve(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&I(()=>{_&&Ha(_,t,e),h&&Hn(e,null,t,`unmounted`),v&&(e.el=null)},n)},ve=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===L){ye(n,r);return}if(t===va){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ye=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},be=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;pa(c),pa(l),r&&ce(r),i.stop(),a&&(a.flags|=8,_e(o,e,t,n)),s&&I(s,t),I(()=>{e.isUnmounted=!0},t)},xe=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return Se(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Qn];return n?h(n):t},Ce=!1,we=(e,t,n)=>{let r;e==null?t._vnode&&(_e(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,Ce||=(Ce=!0,Nn(r),Pn(),!1)},Te={p:v,um:_e,m:ge,r:ve,mt:E,mc:T,pc:pe,pbc:ie,n:Se,o:e},Ee,De;return i&&([Ee,De]=i(Te)),{render:we,hydrate:Ee,createApp:Di(we,Ee)}}function sa({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function ca({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function la(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ua(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function fa(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:fa(t)}function pa(e){if(e)for(let t=0;te.__isSuspense;function ga(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):Mn(e)}var L=Symbol.for(`v-fgt`),_a=Symbol.for(`v-txt`),R=Symbol.for(`v-cmt`),va=Symbol.for(`v-stc`),ya=[],ba=null;function xa(e=!1){ya.push(ba=e?null:[])}function Sa(){ya.pop(),ba=ya[ya.length-1]||null}var Ca=1;function wa(e,t=!1){Ca+=e,e<0&&ba&&t&&(ba.hasOnce=!0)}function Ta(e){return e.dynamicChildren=Ca>0?ba||n:null,Sa(),Ca>0&&ba&&ba.push(e),e}function Ea(e,t,n,r,i,a){return Ta(Ma(e,t,n,r,i,a,!0))}function Da(e,t,n,r,i){return Ta(z(e,t,n,r,i,!0))}function Oa(e){return e?e.__v_isVNode===!0:!1}function ka(e,t){return e.type===t.type&&e.key===t.key}var Aa=({key:e})=>e??null,ja=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||j(e)||h(e)?{i:Ln,r:e,k:t,f:!!n}:e);function Ma(e,t=null,n=null,r=0,i=null,a=e===L?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Aa(t),ref:t&&ja(t),scopeId:Rn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Ln};return s?(Ba(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),Ca>0&&!o&&ba&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&ba.push(c),c}var z=Na;function Na(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Qr)&&(e=R),Oa(e)){let r=Fa(e,t,!0);return n&&Ba(r,n),Ca>0&&!a&&ba&&(r.shapeFlag&6?ba[ba.indexOf(e)]=r:ba.push(r)),r.patchFlag=-2,r}if(lo(e)&&(e=e.__vccOpts),t){t=Pa(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=ve(e)),v(n)&&(Kt(n)&&!d(n)&&(n=s({},n)),t.style=pe(n))}let o=g(e)?1:ha(e)?128:$n(e)?64:v(e)?4:h(e)?2:0;return Ma(e,t,n,r,i,o,a,!0)}function Pa(e){return e?Kt(e)||Ui(e)?s({},e):e:null}function Fa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Va(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Aa(l),ref:t&&t.ref?n&&a?d(a)?a.concat(ja(t)):[a,ja(t)]:ja(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==L?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Fa(e.ssContent),ssFallback:e.ssFallback&&Fa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&wr(u,c.clone(u)),u}function Ia(e=` `,t=0){return z(_a,null,e,t)}function La(e=``,t=!1){return t?(xa(),Da(R,null,e)):z(R,null,e)}function Ra(e){return e==null||typeof e==`boolean`?z(R):d(e)?z(L,null,e.slice()):Oa(e)?za(e):z(_a,null,String(e))}function za(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Fa(e)}function Ba(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Ba(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Ui(t)?t._ctx=Ln:r===3&&Ln&&(Ln.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(h(t)){if(r&65){Ba(e,{default:t});return}t={default:t,_ctx:Ln},n=32}else t=String(t),r&64?(n=16,t=[Ia(t)]):n=8;e.children=t,e.shapeFlag|=n}function Va(...e){let t={};for(let n=0;nB||Ln,qa,Ja;{let e=fe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};qa=t(`__VUE_INSTANCE_SETTERS__`,e=>B=e),Ja=t(`__VUE_SSR_SETTERS__`,e=>Qa=e)}var Ya=e=>{let t=B;return qa(e),e.scope.on(),()=>{e.scope.off(),qa(t)}},Xa=()=>{B&&B.scope.off(),qa(null)};function Za(e){return e.vnode.shapeFlag&4}var Qa=!1;function $a(e,t=!1,n=!1){t&&Ja(t);let{props:r,children:i}=e.vnode,a=Za(e);Wi(e,r,a,t),ra(e,i,n||t);let o=a?eo(e,t):void 0;return t&&Ja(!1),o}function eo(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,si);let{setup:r}=n;if(r){qe();let n=e.setupContext=r.length>1?oo(e):null,i=Ya(e),a=vn(r,e,0,[e.props,n]),o=y(a);if(Je(),i(),(o||e.sp)&&!jr(e)&&Er(e),o){if(a.then(Xa,Xa),t)return a.then(n=>{to(e,n,t)}).catch(t=>{bn(t,e,0)});e.asyncDep=a}else to(e,a,t)}else io(e,t)}function to(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=rn(t)),io(e,n)}var no,ro;function io(e,t,n){let i=e.type;if(!e.render){if(!t&&no&&!i.render){let t=i.template||gi(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:o}=i;i.render=no(t,s(s({isCustomElement:n,delimiters:a},r),o))}}e.render=i.render||r,ro&&ro(e)}{let t=Ya(e);qe();try{fi(e)}finally{Je(),t()}}}var ao={get(e,t){return k(e,`get`,``),e[t]}};function oo(e){return{attrs:new Proxy(e.attrs,ao),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function so(e){return e.exposed?e.exposeProxy||=new Proxy(rn(qt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ai)return ai[n](e)},has(e,t){return t in e||t in ai}}):e.proxy}function co(e,t=!0){return h(e)?e.displayName||e.name:e.name||t&&e.__name}function lo(e){return h(e)&&`__vccOpts`in e}var V=(e,t)=>dn(e,t,Qa);function uo(e,t,n){try{wa(-1);let r=arguments.length;return r===2?v(t)&&!d(t)?Oa(t)?z(e,null,[t]):z(e,t):z(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Oa(n)&&(n=[n]),z(e,t,n))}finally{wa(1)}}var fo=`3.5.40`,po=void 0,mo=typeof window<`u`&&window.trustedTypes;if(mo)try{po=mo.createPolicy(`vue`,{createHTML:e=>e})}catch{}var ho=po?e=>po.createHTML(e):e=>e,go=`http://www.w3.org/2000/svg`,_o=`http://www.w3.org/1998/Math/MathML`,vo=typeof document<`u`?document:null,yo=vo&&vo.createElement(`template`),bo={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?vo.createElementNS(go,e):t===`mathml`?vo.createElementNS(_o,e):n?vo.createElement(e,{is:n}):vo.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>vo.createTextNode(e),createComment:e=>vo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>vo.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{yo.innerHTML=ho(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=yo.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},xo=`transition`,So=`animation`,Co=Symbol(`_vtc`),wo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},To=s({},hr,wo),Eo=(e=>(e.displayName=`Transition`,e.props=To,e))((e,{slots:t})=>uo(yr,ko(e),t)),Do=(e,t=[])=>{d(e)?e.forEach(e=>e(...t)):e&&e(...t)},Oo=e=>e?d(e)?e.some(e=>e.length>1):e.length>1:!1;function ko(e){let t={};for(let n in e)n in wo||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=Ao(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:ee=b}=t,te=(e,t,n,r)=>{e._enterCancelled=r,No(e,t?d:c),No(e,t?u:o),n&&n()},ne=(e,t)=>{e._isLeaving=!1,No(e,f),No(e,m),No(e,p),t&&t()},T=e=>(t,n)=>{let i=e?w:y,o=()=>te(t,e,n);Do(i,[t,o]),Po(()=>{No(t,e?l:a),Mo(t,e?d:c),Oo(i)||Io(t,r,g,o)})};return s(t,{onBeforeEnter(e){Do(v,[e]),Mo(e,a),Mo(e,o)},onBeforeAppear(e){Do(C,[e]),Mo(e,l),Mo(e,u)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ne(e,t);Mo(e,f),e._enterCancelled?(Mo(e,p),Bo(e)):(Bo(e),Mo(e,p)),Po(()=>{e._isLeaving&&(No(e,f),Mo(e,m),Oo(x)||Io(e,r,_,n))}),Do(x,[e,n])},onEnterCancelled(e){te(e,!1,void 0,!0),Do(b,[e])},onAppearCancelled(e){te(e,!0,void 0,!0),Do(ee,[e])},onLeaveCancelled(e){ne(e),Do(S,[e])}})}function Ao(e){if(e==null)return null;if(v(e))return[jo(e.enter),jo(e.leave)];{let t=jo(e);return[t,t]}}function jo(e){return ue(e)}function Mo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Co]||(e[Co]=new Set)).add(t)}function No(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Co];n&&(n.delete(t),n.size||(e[Co]=void 0))}function Po(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Fo=0;function Io(e,t,n,r){let i=e._endId=++Fo,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Lo(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${xo}Delay`),a=r(`${xo}Duration`),o=Ro(i,a),s=r(`${So}Delay`),c=r(`${So}Duration`),l=Ro(s,c),u=null,d=0,f=0;t===xo?o>0&&(u=xo,d=o,f=a.length):t===So?l>0&&(u=So,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?xo:So:null,f=u?u===xo?a.length:c.length:0);let p=u===xo&&/\b(?:transform|all)(?:,|$)/.test(r(`${xo}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Ro(e,t){for(;e.lengthzo(t)+zo(e[n])))}function zo(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Bo(e){return(e?e.ownerDocument:document).body.offsetHeight}function Vo(e,t,n){let r=e[Co];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Ho=Symbol(`_vod`),Uo=Symbol(`_vsh`),Wo={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Ho]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Go(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Go(e,!0),r.enter(e)):r.leave(e,()=>{Go(e,!1)}):Go(e,t))},beforeUnmount(e,{value:t}){Go(e,t)}};function Go(e,t){e.style.display=t?e[Ho]:`none`,e[Uo]=!t}var Ko=Symbol(``),qo=/(?:^|;)\s*display\s*:/;function Jo(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t)if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Xo(r,t,``)}else for(let e in t)n[e]??Xo(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Xo(r,i,``):es(e,i,!g(t)&&t?t[i]:void 0,o)||Xo(r,i,o)}}else if(i){if(t!==n){let e=r[Ko];e&&(n+=`;`+e),r.cssText=n,a=qo.test(n)}}else t&&e.removeAttribute(`style`);Ho in e&&(e[Ho]=a?r.display:``,e[Uo]&&(r.display=`none`))}var Yo=/\s*!important$/;function Xo(e,t,n){if(d(n))n.forEach(n=>Xo(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=$o(e,t);Yo.test(n)?e.setProperty(ie(r),n.replace(Yo,``),`important`):e[r]=n}}var Zo=[`Webkit`,`Moz`,`ms`],Qo={};function $o(e,t){let n=Qo[t];if(n)return n;let r=T(t);if(r!==`filter`&&r in e)return Qo[t]=r;r=ae(r);for(let n=0;nds||=(fs.then(()=>ds=0),Date.now());function ms(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,gs=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?Vo(e,r,c):t===`style`?Jo(e,n,r):a(t)?o(t)||ss(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):_s(e,t,r,c))?(rs(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&ns(e,t,r,c,s,t!==`value`)):e._isVueCE&&(vs(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?rs(e,T(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),ns(e,t,r,c))};function _s(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&hs(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return hs(t)&&g(n)?!1:t in e}function vs(e,t){let n=e._def.props;if(!n)return!1;let r=T(t);return Array.isArray(n)?n.some(e=>T(e)===r):Object.keys(n).some(e=>T(e)===r)}var ys=new WeakMap,bs=new WeakMap,xs=Symbol(`_moveCb`),Ss=Symbol(`_enterCb`),Cs=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:s({},To,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Ka(),r=pr(),i,a;return Hr(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!Os(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(ws),i.forEach(Ts);let r=i.filter(Es);Bo(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;Mo(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[xs]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[xs]=null,No(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=A(e),s=ko(o),c=o.tag||L;if(i=[],a)for(let e=0;e{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Lo(r);return a.removeChild(r),o}var ks=[`ctrl`,`shift`,`alt`,`meta`],As={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>ks.some(n=>e[`${n}Key`]&&!t.includes(n))},js=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{Ps().render(...e)}),Is=((...e)=>{let t=Ps().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Rs(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ls(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Ls(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Rs(e){return g(e)?document.querySelector(e):e}function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zs(e)}function Bs(e,t){if(zs(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zs(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vs(e){var t=Bs(e,`string`);return zs(t)==`symbol`?t:t+``}function Hs(e,t,n){return(t=Vs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Us(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;ttypeof e==`function`,Gs=Array.isArray,Ks=e=>typeof e==`string`,qs=e=>typeof e==`object`&&!!e,Js=/^on[^a-z]/,Ys=e=>Js.test(e),Xs=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Zs=/-(\w)/g,Qs=Xs(e=>e.replace(Zs,(e,t)=>t?t.toUpperCase():``)),$s=/\B([A-Z])/g,ec=Xs(e=>e.replace($s,`-$1`).toLowerCase()),tc=Xs(e=>e.charAt(0).toUpperCase()+e.slice(1)),nc=Object.prototype.hasOwnProperty,rc=(e,t)=>nc.call(e,t);function ic(e,t,n,r){let i=e[n];if(i!=null){let e=rc(i,`default`);if(e&&r===void 0){let e=i.default;r=i.type!==Function&&Ws(e)?e():e}i.type===Boolean&&(!rc(t,n)&&!e?r=!1:r===``&&(r=!0))}return r}function ac(e){return Object.keys(e).reduce((t,n)=>((n.startsWith(`data-`)||n.startsWith(`aria-`))&&(t[n]=e[n]),t),{})}function oc(e){return typeof e==`number`?`${e}px`:e}function sc(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return typeof e==`function`?e(t):e??n}function cc(e){let t,n=new Promise(n=>{t=e(()=>{n(!0)})}),r=()=>{t?.()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}function W(){let e=[];for(let t=0;te!=null&&e!==``,uc=e=>{let t=Object.keys(e),n={},r={},i={};for(let a=0,o=t.length;a0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n={},r=/;(?![^(]*\))/g,i=/:(.+)/;return typeof e==`object`?e:(e.split(r).forEach(function(e){if(e){let r=e.split(i);if(r.length>1){let e=t?Qs(r[0].trim()):r[0].trim();n[e]=r[1].trim()}}}),n)},fc=(e,t)=>e[t]!==void 0,pc=Symbol(`skipFlatten`),mc=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=Array.isArray(e)?e:[e],r=[];return n.forEach(e=>{Array.isArray(e)?r.push(...mc(e,t)):e&&e.type===L?e.key===pc?r.push(e):r.push(...mc(e.children,t)):e&&Oa(e)?t&&!wc(e)?r.push(e):t||r.push(e):lc(e)&&r.push(e)}),r},hc=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`default`,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Oa(e)?e.type===L?t==="default"?mc(e.children):[]:e.children&&e.children[t]?mc(e.children[t](n)):[]:mc(e.$slots[t]&&e.$slots[t](n))},gc=e=>{let t=e?.vnode?.el||e&&(e.$el||e);for(;t&&!t.tagName;)t=t.nextSibling;return t},_c=e=>{let t={};if(e.$&&e.$.vnode){let n=e.$.vnode.props||{};Object.keys(e.$props).forEach(r=>{let i=e.$props[r],a=ec(r);(i!==void 0||a in n)&&(t[r]=i)})}else if(Oa(e)&&typeof e.type==`object`){let n=e.props||{},r={};Object.keys(n).forEach(e=>{r[Qs(e)]=n[e]});let i=e.type.props||{};Object.keys(i).forEach(e=>{let n=ic(i,r,e,r[e]);(n!==void 0||e in r)&&(t[e]=n)})}return t},vc=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`default`,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i;if(e.$){let a=e[t];if(a!==void 0)return typeof a==`function`&&r?a(n):a;i=e.$slots[t],i=r&&i?i(n):i}else if(Oa(e)){let a=e.props&&e.props[t];if(a!==void 0&&e.props!==null)return typeof a==`function`&&r?a(n):a;e.type===L?i=e.children:e.children&&e.children[t]&&(i=e.children[t],i=r&&i?i(n):i)}return Array.isArray(i)&&(i=mc(i),i=i.length===1?i[0]:i,i=i.length===0?void 0:i),i};function yc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n={};return n=e.$?U(U({},n),e.$attrs):U(U({},n),e.props),uc(n)[t?`onEvents`:`events`]}function bc(e){let t=((Oa(e)?e.props:e.$attrs)||{}).class||{},n={};return typeof t==`string`?t.split(` `).forEach(e=>{n[e.trim()]=!0}):Array.isArray(t)?W(t).split(` `).forEach(e=>{n[e.trim()]=!0}):n=U(U({},n),t),n}function xc(e,t){let n=((Oa(e)?e.props:e.$attrs)||{}).style||{};if(typeof n==`string`)n=dc(n,t);else if(t&&n){let e={};return Object.keys(n).forEach(t=>e[Qs(t)]=n[t]),e}return n}function Sc(e){return e.length===1&&e[0].type===L}function Cc(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function wc(e){return e&&(e.type===R||e.type===L&&e.children.length===0||e.type===_a&&e.children.trim()===``)}function Tc(e){return e&&e.type===_a}function Ec(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...e):e?.type===L?t.push(...Ec(e.children)):t.push(e)}),t.filter(e=>!wc(e))}function Dc(e){if(e){let t=Ec(e);return t.length?t:void 0}else return e}function Oc(e){return Array.isArray(e)&&e.length===1&&(e=e[0]),e&&e.__v_isVNode&&typeof e.type!=`symbol`}function kc(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`default`;return t[n]??e[n]?.call(e)}var Ac=function(){return[...arguments]},jc=function(){return[...arguments]},Mc=e=>{let t=e;return t.install=function(n){n.component(t.displayName||t.name,e)},e};function Nc(){return{type:[Function,Array]}}function G(e){return{type:Object,default:e}}function Pc(e){return{type:Boolean,default:e}}function Fc(e){return{type:Function,default:e}}function Ic(e,t){return{validator:()=>!0,default:e}}function Lc(){return{validator:()=>!0}}function Rc(e){return{type:Array,default:e}}function zc(e){return{type:String,default:e}}function Bc(e,t){return e?{type:e,default:t}:Ic(t)}var Vc=`anticon`,Hc=Symbol(`GlobalFormContextKey`),Uc=e=>{Un(Hc,e)},Wc=()=>N(Hc,{validateMessages:V(()=>void 0)}),Gc=()=>({iconPrefixCls:String,getTargetContainer:{type:Function},getPopupContainer:{type:Function},prefixCls:String,getPrefixCls:{type:Function},renderEmpty:{type:Function},transformCellText:{type:Function},csp:G(),input:G(),autoInsertSpaceInButton:{type:Boolean,default:void 0},locale:G(),pageHeader:G(),componentSize:{type:String},componentDisabled:{type:Boolean,default:void 0},direction:{type:String,default:`ltr`},space:G(),virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},form:G(),pagination:G(),theme:G(),select:G(),wave:G()}),Kc=Symbol(`configProvider`),qc={getPrefixCls:(e,t)=>t||(e?`ant-${e}`:`ant`),iconPrefixCls:V(()=>Vc),getPopupContainer:V(()=>()=>document.body),direction:V(()=>`ltr`)},Jc=()=>N(Kc,qc),Yc=e=>Un(Kc,e),Xc=Symbol(`DisabledContextKey`),Zc=()=>N(Xc,Xt(void 0)),Qc=e=>{let t=Zc();return Un(Xc,V(()=>e.value??t.value)),e},$c={items_per_page:`/ page`,jump_to:`Go to`,jump_to_confirm:`confirm`,page:``,prev_page:`Previous Page`,next_page:`Next Page`,prev_5:`Previous 5 Pages`,next_5:`Next 5 Pages`,prev_3:`Previous 3 Pages`,next_3:`Next 3 Pages`},el={locale:`en_US`,today:`Today`,now:`Now`,backToToday:`Back to today`,ok:`Ok`,clear:`Clear`,month:`Month`,year:`Year`,timeSelect:`select time`,dateSelect:`select date`,weekSelect:`Choose a week`,monthSelect:`Choose a month`,yearSelect:`Choose a year`,decadeSelect:`Choose a decade`,yearFormat:`YYYY`,dateFormat:`M/D/YYYY`,dayFormat:`D`,dateTimeFormat:`M/D/YYYY HH:mm:ss`,monthBeforeYear:!0,previousMonth:`Previous month (PageUp)`,nextMonth:`Next month (PageDown)`,previousYear:`Last year (Control + left)`,nextYear:`Next year (Control + right)`,previousDecade:`Last decade`,nextDecade:`Next decade`,previousCentury:`Last century`,nextCentury:`Next century`},tl={placeholder:`Select time`,rangePlaceholder:[`Start time`,`End time`]},nl={lang:U({placeholder:`Select date`,yearPlaceholder:`Select year`,quarterPlaceholder:`Select quarter`,monthPlaceholder:`Select month`,weekPlaceholder:`Select week`,rangePlaceholder:[`Start date`,`End date`],rangeYearPlaceholder:[`Start year`,`End year`],rangeQuarterPlaceholder:[`Start quarter`,`End quarter`],rangeMonthPlaceholder:[`Start month`,`End month`],rangeWeekPlaceholder:[`Start week`,`End week`]},el),timePickerLocale:U({},tl)},rl=nl,il="${label} is not a valid ${type}",al={locale:`en`,Pagination:$c,DatePicker:nl,TimePicker:tl,Calendar:rl,global:{placeholder:`Please select`},Table:{filterTitle:`Filter menu`,filterConfirm:`OK`,filterReset:`Reset`,filterEmptyText:`No filters`,filterCheckall:`Select all items`,filterSearchPlaceholder:`Search in filters`,emptyText:`No data`,selectAll:`Select current page`,selectInvert:`Invert current page`,selectNone:`Clear all data`,selectionAll:`Select all data`,sortTitle:`Sort`,expand:`Expand row`,collapse:`Collapse row`,triggerDesc:`Click to sort descending`,triggerAsc:`Click to sort ascending`,cancelSort:`Click to cancel sorting`},Tour:{Next:`Next`,Previous:`Previous`,Finish:`Finish`},Modal:{okText:`OK`,cancelText:`Cancel`,justOkText:`OK`},Popconfirm:{okText:`OK`,cancelText:`Cancel`},Transfer:{titles:[``,``],searchPlaceholder:`Search here`,itemUnit:`item`,itemsUnit:`items`,remove:`Remove`,selectCurrent:`Select current page`,removeCurrent:`Remove current page`,selectAll:`Select all data`,removeAll:`Remove all data`,selectInvert:`Invert current page`},Upload:{uploading:`Uploading...`,removeFile:`Remove file`,uploadError:`Upload error`,previewFile:`Preview file`,downloadFile:`Download file`},Empty:{description:`No data`},Icon:{icon:`icon`},Text:{edit:`Edit`,copy:`Copy`,copied:`Copied`,expand:`Expand`},PageHeader:{back:`Back`},Form:{optional:`(optional)`,defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:il,method:il,array:il,object:il,number:il,date:il,boolean:il,integer:il,float:il,regexp:il,email:il,url:il,hex:il},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:`Preview`},QRCode:{expired:`QR code expired`,refresh:`Refresh`,scanned:`Scanned`}},ol=P({compatConfig:{MODE:3},name:`LocaleReceiver`,props:{componentName:String,defaultLocale:{type:[Object,Function]},children:{type:Function}},setup(e,t){let{slots:n}=t,r=N(`localeData`,{}),i=V(()=>{let{componentName:t=`global`,defaultLocale:n}=e,i=n||al[t||`global`],{antLocale:a}=r,o=t&&a?a[t]:{};return U(U({},typeof i==`function`?i():i),o||{})}),a=V(()=>{let{antLocale:e}=r,t=e&&e.locale;return e&&e.exist&&!t?al.locale:t});return()=>{let t=e.children||n.default,{antLocale:o}=r;return t?.(i.value,a.value,o)}}});function sl(e,t,n){let r=N(`localeData`,{});return[V(()=>{let{antLocale:i}=r,a=tn(t)||al[e||`global`],o=e&&i?i[e]:{};return U(U(U({},typeof a==`function`?a():a),o||{}),tn(n)||{})})]}var cl=ol;function ll(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ul=`%`,dl=class{constructor(e){this.cache=new Map,this.instanceId=e}get(e){return this.cache.get(Array.isArray(e)?e.join(ul):e)||null}update(e,t){let n=Array.isArray(e)?e.join(ul):e,r=t(this.cache.get(n));r===null?this.cache.delete(n):this.cache.set(n,r)}},fl=`data-token-hash`,pl=`data-css-hash`,ml=`__cssinjs_instance__`;function hl(){let e=Math.random().toString(12).slice(2);if(typeof document<`u`&&document.head&&document.body){let t=document.body.querySelectorAll(`style[data-css-hash]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(t=>{t[ml]=t.__cssinjs_instance__||e,t.__cssinjs_instance__===e&&document.head.insertBefore(t,n)});let r={};Array.from(document.querySelectorAll(`style[${pl}]`)).forEach(t=>{var n;let i=t.getAttribute(pl);r[i]?t.__cssinjs_instance__===e&&((n=t.parentNode)==null||n.removeChild(t)):r[i]=!0})}return new dl(e)}var gl=Symbol(`StyleContextKey`),_l=()=>{let e=Ka(),t;if(e&&e.appContext){let n=e.appContext?.config?.globalProperties?.__ANTDV_CSSINJS_CACHE__;n?t=n:(t=hl(),e.appContext.config.globalProperties&&(e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__=t))}else t=hl();return t},vl={cache:hl(),defaultCache:!0,hashPriority:`low`},yl=()=>{let e=_l();return N(gl,Zt(U(U({},vl),{cache:e})))},bl=e=>{let t=yl(),n=Zt(U(U({},vl),{cache:hl()}));return qn([()=>tn(e),t],()=>{let r=U({},t.value),i=tn(e);Object.keys(i).forEach(e=>{let t=i[e];i[e]!==void 0&&(r[e]=t)});let{cache:a}=i;r.cache=r.cache||hl(),r.defaultCache=!a&&t.value.defaultCache,n.value=r},{immediate:!0}),Un(gl,n),n},xl=Mc(P({name:`AStyleProvider`,inheritAttrs:!1,props:{autoClear:Pc(),mock:zc(),cache:G(),defaultCache:Pc(),hashPriority:zc(),container:Bc(),ssrInline:Pc(),transformers:Rc(),linters:Rc()},setup(e,t){let{slots:n}=t;return bl(e),()=>n.default?.call(n)}}));function Sl(e,t,n,r){let i=yl(),a=Zt(``),o=Zt();Kn(()=>{a.value=[e,...t.value].join(`%`)});let s=e=>{i.value.cache.update(e,e=>{let[t=0,n]=e||[];return t-1==0?(r?.(n,!1),null):[t-1,n]})};return qn(a,(e,t)=>{t&&s(t),i.value.cache.update(e,e=>{let[t=0,r]=e||[],i=r||n();return[t+1,i]}),o.value=i.value.cache.get(a.value)[1]},{immediate:!0}),Ur(()=>{s(a.value)}),o}function Cl(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function wl(e,t){return e&&e.contains?e.contains(t):!1}var Tl=`data-vc-order`,El=`vc-util-key`,Dl=new Map;function Ol(){let{mark:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e?e.startsWith(`data-`)?e:`data-${e}`:El}function kl(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function Al(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function jl(e){return Array.from((Dl.get(e)||e).children).filter(e=>e.tagName===`STYLE`)}function Ml(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Cl())return null;let{csp:n,prepend:r}=t,i=document.createElement(`style`);i.setAttribute(Tl,Al(r)),n?.nonce&&(i.nonce=n?.nonce),i.innerHTML=e;let a=kl(t),{firstChild:o}=a;if(r){if(r===`queue`){let e=jl(a).filter(e=>[`prepend`,`prependQueue`].includes(e.getAttribute(Tl)));if(e.length)return a.insertBefore(i,e[e.length-1].nextSibling),i}a.insertBefore(i,o)}else a.appendChild(i);return i}function Nl(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return jl(kl(t)).find(n=>n.getAttribute(Ol(t))===e)}function Pl(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Nl(e,t);n&&kl(t).removeChild(n)}function Fl(e,t){let n=Dl.get(e);if(!n||!wl(document,n)){let n=Ml(``,t),{parentNode:r}=n;Dl.set(e,r),e.removeChild(n)}}function Il(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Fl(kl(n),n);let r=Nl(t,n);if(r)return n.csp?.nonce&&r.nonce!==n.csp?.nonce&&(r.nonce=n.csp?.nonce),r.innerHTML!==e&&(r.innerHTML=e),r;let i=Ml(e,n);return i.setAttribute(Ol(n),t),i}function Ll(e,t){if(e.length!==t.length)return!1;for(let n=0;n1&&arguments[1]!==void 0&&arguments[1],n={map:this.cache};return e.forEach(e=>{n=n?(n?.map)?.get(e):void 0}),n?.value&&t&&(n.value[1]=this.cacheCallTimes++),n?.value}get(e){return this.internalGet(e,!0)?.[0]}has(e){return!!this.internalGet(e)}set(t,n){if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){let[e]=this.keys.reduce((e,t)=>{let[,n]=e;return this.internalGet(t)[1]{if(i===t.length-1)r.set(e,{value:[n,this.cacheCallTimes++]});else{let t=r.get(e);t?t.map||=new Map:r.set(e,{map:new Map}),r=r.get(e).map}})}deleteByPath(e,t){let n=e.get(t[0]);if(t.length===1)return n.map?e.set(t[0],{map:n.map}):e.delete(t[0]),n.value?.[0];let r=this.deleteByPath(n.map,t.slice(1));return(!n.map||n.map.size===0)&&!n.value&&e.delete(t[0]),r}delete(e){if(this.has(e))return this.keys=this.keys.filter(t=>!Ll(t,e)),this.deleteByPath(this.cache,e)}};Rl.MAX_CACHE_SIZE=20,Rl.MAX_CACHE_OFFSET=5;function zl(){}var Bl=zl,Vl=0,Hl=class{constructor(e){this.derivatives=Array.isArray(e)?e:[e],this.id=Vl,e.length===0&&Bl(e.length>0,`[Ant Design Vue CSS-in-JS] Theme should have at least one derivative function.`),Vl+=1}getDerivativeToken(e){return this.derivatives.reduce((t,n)=>n(e,t),void 0)}},Ul=new Rl;function Wl(e){let t=Array.isArray(e)?e:[e];return Ul.has(t)||Ul.set(t,new Hl(t)),Ul.get(t)}var Gl=new WeakMap;function Kl(e){let t=Gl.get(e)||``;return t||(Object.keys(e).forEach(n=>{let r=e[n];t+=n,r instanceof Hl?t+=r.id:r&&typeof r==`object`?t+=Kl(r):t+=r}),Gl.set(e,t)),t}function ql(e,t){return ll(`${t}_${Kl(e)}`)}var Jl=`random-${Date.now()}-${Math.random()}`.replace(/\./g,``),Yl=`_bAmBoO_`;function Xl(e,t,n){var r;if(Cl()){Il(e,Jl);let i=document.createElement(`div`);i.style.position=`fixed`,i.style.left=`0`,i.style.top=`0`,t?.(i),document.body.appendChild(i);let a=n?n(i):getComputedStyle(i).content?.includes(Yl);return(r=i.parentNode)==null||r.removeChild(i),Pl(Jl),a}return!1}var Zl=void 0;function Ql(){return Zl===void 0&&(Zl=Xl(`@layer ${Jl} { .${Jl} { content: "${Yl}"!important; } }`,e=>{e.className=Jl})),Zl}var $l={},eu=`css`,tu=new Map;function nu(e){tu.set(e,(tu.get(e)||0)+1)}function ru(e,t){typeof document<`u`&&document.querySelectorAll(`style[${fl}="${e}"]`).forEach(e=>{var n;e.__cssinjs_instance__===t&&((n=e.parentNode)==null||n.removeChild(e))})}var iu=0;function au(e,t){tu.set(e,(tu.get(e)||0)-1);let n=Array.from(tu.keys()),r=n.filter(e=>(tu.get(e)||0)<=0);n.length-r.length>iu&&r.forEach(e=>{ru(e,t),tu.delete(e)})}var ou=(e,t,n,r)=>{let i=U(U({},n.getDerivativeToken(e)),t);return r&&(i=r(i)),i};function su(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xt({}),r=yl(),i=V(()=>U({},...t.value)),a=V(()=>Kl(i.value)),o=V(()=>Kl(n.value.override||$l));return Sl(`token`,V(()=>[n.value.salt||``,e.value.id,a.value,o.value]),()=>{let{salt:t=``,override:r=$l,formatToken:a,getComputedToken:o}=n.value,s=o?o(i.value,r,e.value):ou(i.value,r,e.value,a),c=ql(s,t);s._tokenKey=c,nu(c);let l=`${eu}-${ll(c)}`;return s._hashId=l,[s,l]},e=>{au(e[0]._tokenKey,r.value?.cache.instanceId)})}var cu={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lu=`comm`,uu=`rule`,du=`decl`,fu=`@import`,pu=`@namespace`,mu=`@keyframes`,hu=`@layer`,gu=Math.abs,_u=String.fromCharCode;function vu(e){return e.trim()}function yu(e,t,n){return e.replace(t,n)}function bu(e,t){return e.charCodeAt(t)|0}function xu(e,t,n){return e.slice(t,n)}function Su(e){return e.length}function Cu(e){return e.length}function wu(e,t){return t.push(e),e}var Tu=1,Eu=1,Du=0,Ou=0,K=0,ku=``;function Au(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Tu,column:Eu,length:o,return:``,siblings:s}}function ju(){return K}function Mu(){return K=Ou>0?bu(ku,--Ou):0,Eu--,K===10&&(Eu=1,Tu--),K}function Nu(){return K=Ou2||Lu(K)>3?``:` `}function Hu(e,t){for(;--t&&Nu()&&!(K<48||K>102||K>57&&K<65||K>70&&K<97););return Iu(e,Fu()+(t<6&&Pu()==32&&Nu()==32))}function Uu(e){for(;Nu();)switch(K){case e:return Ou;case 34:case 39:e!==34&&e!==39&&Uu(K);break;case 40:e===41&&Uu(e);break;case 92:Nu();break}return Ou}function Wu(e,t){for(;Nu()&&e+K!==57&&!(e+K===84&&Pu()===47););return`/*`+Iu(t,Ou-1)+`*`+_u(e===47?e:Nu())}function Gu(e){for(;!Lu(Pu());)Nu();return Iu(e,Ou)}function Ku(e){return zu(qu(``,null,null,null,[``],e=Ru(e),0,[0],e))}function qu(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=Nu()){case 40:m!=108&&bu(w,d-1)==58?(v++,w+=`(`):w+=Bu(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Bu(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=_u(y);break}w+=Vu(m);break;case 92:w+=Hu(Fu()-1,7);continue;case 47:switch(Pu()){case 42:case 47:wu(Yu(Wu(Nu(),Fu()),t,n,c),c),(Lu(m||1)==5||Lu(Pu()||1)==5)&&Su(w)&&xu(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=Su(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=_u(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=yu(w,/\f/g,``)),p>0&&(Su(w)-d||h===0)&&wu(p>32?Xu(w+`;`,r,n,d-1,c):Xu(yu(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(wu(C=Ju(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)qu(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(bu(w,3)===110)break;case 108:if(bu(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?qu(e,C,C,r&&wu(Ju(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):qu(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+Su(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Mu()==125)continue}switch(w+=_u(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(Su(w)-1)*_,_=1;break;case 64:Pu()===45&&(w+=Bu(Nu())),f=Pu(),u=d=Su(b=w+=Gu(Fu())),y++;break;case 45:m===45&&Su(w)==2&&(h=0)}}return a}function Ju(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Cu(p),h=0,g=0,_=0;h0?p[v]+` `+y:yu(y,/&\f/g,p[v])))&&(c[_++]=b);return Au(e,t,n,i===0?uu:s,c,l,u,d)}function Yu(e,t,n,r){return Au(e,t,n,lu,_u(ju()),xu(e,2,-2),0,r)}function Xu(e,t,n,r,i){return Au(e,t,n,du,xu(e,0,r),xu(e,r+1,-1),r,i)}function Zu(e,t){for(var n=``,r=0;r`${t}:${e[t]}`).join(`;`)}var nd,rd=!0;function id(){var e;if(!nd&&(nd={},Cl())){let t=document.createElement(`div`);t.className=$u,t.style.position=`fixed`,t.style.visibility=`hidden`,t.style.top=`-9999px`,document.body.appendChild(t);let n=getComputedStyle(t).content||``;n=n.replace(/^"/,``).replace(/"$/,``),n.split(`;`).forEach(e=>{let[t,n]=e.split(`:`);nd[t]=n});let r=document.querySelector(`style[${$u}]`);r&&(rd=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function ad(e){return id(),!!nd[e]}function od(e){let t=nd[e],n=null;if(t&&Cl())if(rd)n=ed;else{let t=document.querySelector(`style[${pl}="${nd[e]}"]`);t?n=t.innerHTML:delete nd[e]}return[n,t]}var sd=Cl(),cd=`_skip_check_`,ld=`_multi_value_`;function ud(e){return Zu(Ku(e),Qu).replace(/\{%%%\:[^;];}/g,`;`)}function dd(e){return typeof e==`object`&&e&&(cd in e||ld in e)}function fd(e,t,n){if(!t)return e;let r=`.${t}`,i=n===`low`?`:where(${r})`:r;return e.split(`,`).map(e=>{let t=e.trim().split(/\s+/),n=t[0]||``,r=n.match(/^\w+/)?.[0]||``;return n=`${r}${i}${n.slice(r.length)}`,[n,...t.slice(1)].join(` `)}).join(`,`)}var pd=new Set,md=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{root:n,injectHash:r,parentSelectors:i}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},{hashId:a,layer:o,path:s,hashPriority:c,transformers:l=[],linters:u=[]}=t,d=``,f={};function p(e){let n=e.getName(a);if(!f[n]){let[r]=md(e.style,t,{root:!1,parentSelectors:i});f[n]=`@keyframes ${e.getName(a)}${r}`}}function m(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.forEach(e=>{Array.isArray(e)?m(e,t):e&&t.push(e)}),t}if(m(Array.isArray(e)?e:[e]).forEach(e=>{let o=typeof e==`string`&&!n?{}:e;if(typeof o==`string`)d+=`${o}\n`;else if(o._keyframe)p(o);else{let e=l.reduce((e,t)=>(t?.visit)?.call(t,e)||e,o);Object.keys(e).forEach(o=>{let s=e[o];if(typeof s==`object`&&s&&(o!==`animationName`||!s._keyframe)&&!dd(s)){let e=!1,l=o.trim(),u=!1;(n||r)&&a?l.startsWith(`@`)?e=!0:l=fd(o,a,c):n&&!a&&(l===`&`||l===``)&&(l=``,u=!0);let[p,m]=md(s,t,{root:u,injectHash:e,parentSelectors:[...i,l]});f=U(U({},f),m),d+=`${l}${p}`}else{function e(e,t){let n=e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),r=t;!cu[e]&&typeof r==`number`&&r!==0&&(r=`${r}px`),e===`animationName`&&t?._keyframe&&(p(t),r=t.getName(a)),d+=`${n}:${r};`}let t=s?.value??s;typeof s==`object`&&s?.[ld]&&Array.isArray(t)?t.forEach(t=>{e(o,t)}):e(o,t)}})}}),!n)d=`{${d}}`;else if(o&&Ql()){let e=o.split(`,`);d=`@layer ${e[e.length-1].trim()} {${d}}`,e.length>1&&(d=`@layer ${o}{%%%:%}${d}`)}return[d,f]};function hd(e,t){return ll(`${e.join(`%`)}${t}`)}function gd(e,t){let n=yl(),r=V(()=>e.value.token._tokenKey),i=V(()=>[r.value,...e.value.path]),a=sd;return Sl(`style`,i,()=>{let{path:o,hashId:s,layer:c,nonce:l,clientOnly:u,order:d=0}=e.value,f=i.value.join(`|`);if(ad(f)){let[e,t]=od(f);if(e)return[e,r.value,t,{},u,d]}let p=t(),{hashPriority:m,container:h,transformers:g,linters:_,cache:v}=n.value,[y,b]=md(p,{hashId:s,hashPriority:m,layer:c,path:o.join(`-`),transformers:g,linters:_}),x=ud(y),S=hd(i.value,x);if(a){let e={mark:pl,prepend:`queue`,attachTo:h,priority:d},t=typeof l==`function`?l():l;t&&(e.csp={nonce:t});let n=Il(x,S,e);n[ml]=v.instanceId,n.setAttribute(fl,r.value),Object.keys(b).forEach(e=>{pd.has(e)||(pd.add(e),Il(ud(b[e]),`_effect-${e}`,{mark:pl,prepend:`queue`,attachTo:h}))})}return[x,r.value,S,b,u,d]},(e,t)=>{let[,,r]=e;(t||n.value.autoClear)&&sd&&Pl(r,{mark:pl})}),e=>e}function _d(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=Array.from(e.cache.keys()).filter(e=>e.startsWith(`style%`)),r={},i={},a=``;function o(e,n,r){let i=U(U({},arguments.length>3&&arguments[3]!==void 0?arguments[3]:{}),{[fl]:n,[pl]:r}),a=Object.keys(i).map(e=>{let t=i[e];return t?`${e}="${t}"`:null}).filter(e=>e).join(` `);return t?e:``}return n.map(t=>{let n=t.slice(6).replace(/%/g,`|`),[a,s,c,l,u,d]=e.cache.get(t)[1];if(u)return null;let f={"data-vc-order":`prependQueue`,"data-vc-priority":`${d}`},p=o(a,s,c,f);return i[n]=c,l&&Object.keys(l).forEach(e=>{r[e]||(r[e]=!0,p+=o(ud(l[e]),s,`_effect-${e}`,f))}),[d,p]}).filter(e=>e).sort((e,t)=>e[0]-t[0]).forEach(e=>{let[,t]=e;a+=t}),a+=o(`.${$u}{content:"${td(i)}";}`,void 0,void 0,{[$u]:$u}),a}var vd=class{constructor(e,t){this._keyframe=!0,this.name=e,this.style=t}getName(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return e?`${e}-${this.name}`:this.name}},yd=`4.2.6`;function q(e,t){xd(e)&&(e=`100%`);var n=Sd(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t)),e)}function bd(e){return Math.min(1,Math.max(0,e))}function xd(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&parseFloat(e)===1}function Sd(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function Cd(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function wd(e){return e<=1?`${Number(e)*100}%`:e}function Td(e){return e.length===1?`0`+e:String(e)}function Ed(e,t,n){return{r:q(e,255)*255,g:q(t,255)*255,b:q(n,255)*255}}function Dd(e,t,n){e=q(e,255),t=q(t,255),n=q(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r===i)o=0,a=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kd(e,t,n){var r,i,a;if(e=q(e,360),t=q(t,100),n=q(n,100),t===0)i=n,a=n,r=n;else{var o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=Od(s,o,e+1/3),i=Od(s,o,e),a=Od(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function Ad(e,t,n){e=q(e,255),t=q(t,255),n=q(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var Rd={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function zd(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e==`string`&&(e=Wd(e)),typeof e==`object`&&(Gd(e.r)&&Gd(e.g)&&Gd(e.b)?(t=Ed(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):Gd(e.h)&&Gd(e.s)&&Gd(e.v)?(r=wd(e.s),i=wd(e.v),t=jd(e.h,r,i),o=!0,s=`hsv`):Gd(e.h)&&Gd(e.s)&&Gd(e.l)&&(r=wd(e.s),a=wd(e.l),t=kd(e.h,r,a),o=!0,s=`hsl`),Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)),n=Cd(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Bd=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,Vd=`[\\s|\\(]+(${Bd})[,|\\s]+(${Bd})[,|\\s]+(${Bd})\\s*\\)?`,Hd=`[\\s|\\(]+(${Bd})[,|\\s]+(${Bd})[,|\\s]+(${Bd})[,|\\s]+(${Bd})\\s*\\)?`,Ud={CSS_UNIT:new RegExp(Bd),rgb:RegExp(`rgb`+Vd),rgba:RegExp(`rgba`+Hd),hsl:RegExp(`hsl`+Vd),hsla:RegExp(`hsla`+Hd),hsv:RegExp(`hsv`+Vd),hsva:RegExp(`hsva`+Hd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Wd(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Rd[e])e=Rd[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n=Ud.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Ud.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ud.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Ud.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ud.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Ud.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ud.hex8.exec(e),n?{r:Id(n[1]),g:Id(n[2]),b:Id(n[3]),a:Fd(n[4]),format:t?`name`:`hex8`}:(n=Ud.hex6.exec(e),n?{r:Id(n[1]),g:Id(n[2]),b:Id(n[3]),format:t?`name`:`hex`}:(n=Ud.hex4.exec(e),n?{r:Id(n[1]+n[1]),g:Id(n[2]+n[2]),b:Id(n[3]+n[3]),a:Fd(n[4]+n[4]),format:t?`name`:`hex8`}:(n=Ud.hex3.exec(e),n?{r:Id(n[1]+n[1]),g:Id(n[2]+n[2]),b:Id(n[3]+n[3]),format:t?`name`:`hex`}:!1)))))))))}function Gd(e){return!!Ud.CSS_UNIT.exec(String(e))}var J=function(){function e(t,n){if(t===void 0&&(t=``),n===void 0&&(n={}),t instanceof e)return t;typeof t==`number`&&(t=Ld(t)),this.originalInput=t;var r=zd(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=Cd(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return this.toHsl().s===0},e.prototype.toHsv=function(){var e=Ad(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=Ad(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHsl=function(){var e=Dd(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Dd(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHex=function(e){return e===void 0&&(e=!1),Md(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return e===void 0&&(e=!1),`#`+this.toHex(e)},e.prototype.toHex8=function(e){return e===void 0&&(e=!1),Nd(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return e===void 0&&(e=!1),`#`+this.toHex8(e)},e.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`},e.prototype.toPercentageRgb=function(){var e=function(e){return`${Math.round(q(e,255)*100)}%`};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(q(e,255)*100)};return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`},e.prototype.toName=function(){if(this.a===0)return`transparent`;if(this.a<1)return!1;for(var e=`#`+Md(this.r,this.g,this.b,!1),t=0,n=Object.entries(Rd);t=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=bd(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=bd(n.l),new e(n)},e.prototype.tint=function(e){return e===void 0&&(e=10),this.mix(`white`,e)},e.prototype.shade=function(e){return e===void 0&&(e=10),this.mix(`black`,e)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=bd(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=bd(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),a=n/100;return new e({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],a=360/t,o=1;o=60&&Math.round(e.h)<=240?n?Math.round(e.h)-Kd*t:Math.round(e.h)+Kd*t:n?Math.round(e.h)+Kd*t:Math.round(e.h)-Kd*t;return r<0?r+=360:r>=360&&(r-=360),r}function af(e,t,n){if(e.h===0&&e.s===0)return e.s;var r=n?e.s-qd*t:t===Qd?e.s+qd:e.s+Jd*t;return r>1&&(r=1),n&&t===Zd&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function of(e,t,n){var r=n?e.v+Yd*t:e.v-Xd*t;return r>1&&(r=1),Number(r.toFixed(2))}function sf(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=zd(e),i=Zd;i>0;--i){var a=ef(r),o=tf(zd({h:rf(a,i,!0),s:af(a,i,!0),v:of(a,i,!0)}));n.push(o)}n.push(tf(r));for(var s=1;s<=Qd;s+=1){var c=ef(r),l=tf(zd({h:rf(c,s),s:af(c,s),v:of(c,s)}));n.push(l)}return t.theme===`dark`?$d.map(function(e){var r=e.index,i=e.opacity;return tf(nf(zd(t.backgroundColor||`#141414`),zd(n[r]),i*100))}):n}var cf={red:`#F5222D`,volcano:`#FA541C`,orange:`#FA8C16`,gold:`#FAAD14`,yellow:`#FADB14`,lime:`#A0D911`,green:`#52C41A`,cyan:`#13C2C2`,blue:`#1890FF`,geekblue:`#2F54EB`,purple:`#722ED1`,magenta:`#EB2F96`,grey:`#666666`},Y={},lf={};Object.keys(cf).forEach(function(e){Y[e]=sf(cf[e]),Y[e].primary=Y[e][5],lf[e]=sf(cf[e],{theme:`dark`,backgroundColor:`#141414`}),lf[e].primary=lf[e][5]}),Y.red,Y.volcano;var uf=Y.gold;Y.orange,Y.yellow,Y.lime,Y.green,Y.cyan;var df=Y.blue;Y.geekblue,Y.purple,Y.magenta,Y.grey;var ff=e=>{let{controlHeight:t}=e;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}};function pf(e){let{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}var mf={blue:`#1677ff`,purple:`#722ED1`,cyan:`#13C2C2`,green:`#52C41A`,magenta:`#EB2F96`,pink:`#eb2f96`,red:`#F5222D`,orange:`#FA8C16`,yellow:`#FADB14`,volcano:`#FA541C`,geekblue:`#2F54EB`,gold:`#FAAD14`,lime:`#A0D911`},hf=U(U({},mf),{colorPrimary:`#1677ff`,colorSuccess:`#52c41a`,colorWarning:`#faad14`,colorError:`#ff4d4f`,colorInfo:`#1677ff`,colorTextBase:``,colorBgBase:``,fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, +'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', +'Noto Color Emoji'`,fontSize:14,lineWidth:1,lineType:`solid`,motionUnit:.1,motionBase:0,motionEaseOutCirc:`cubic-bezier(0.08, 0.82, 0.17, 1)`,motionEaseInOutCirc:`cubic-bezier(0.78, 0.14, 0.15, 0.86)`,motionEaseOut:`cubic-bezier(0.215, 0.61, 0.355, 1)`,motionEaseInOut:`cubic-bezier(0.645, 0.045, 0.355, 1)`,motionEaseOutBack:`cubic-bezier(0.12, 0.4, 0.29, 1.46)`,motionEaseInBack:`cubic-bezier(0.71, -0.46, 0.88, 0.6)`,motionEaseInQuint:`cubic-bezier(0.755, 0.05, 0.855, 0.06)`,motionEaseOutQuint:`cubic-bezier(0.23, 1, 0.32, 1)`,borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1});function gf(e,t){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=t,{colorSuccess:i,colorWarning:a,colorError:o,colorInfo:s,colorPrimary:c,colorBgBase:l,colorTextBase:u}=e,d=n(c),f=n(i),p=n(a),m=n(o),h=n(s);return U(U({},r(l,u)),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:f[1],colorSuccessBgHover:f[2],colorSuccessBorder:f[3],colorSuccessBorderHover:f[4],colorSuccessHover:f[4],colorSuccess:f[6],colorSuccessActive:f[7],colorSuccessTextHover:f[8],colorSuccessText:f[9],colorSuccessTextActive:f[10],colorErrorBg:m[1],colorErrorBgHover:m[2],colorErrorBorder:m[3],colorErrorBorderHover:m[4],colorErrorHover:m[5],colorError:m[6],colorErrorActive:m[7],colorErrorTextHover:m[8],colorErrorText:m[9],colorErrorTextActive:m[10],colorWarningBg:p[1],colorWarningBgHover:p[2],colorWarningBorder:p[3],colorWarningBorderHover:p[4],colorWarningHover:p[4],colorWarning:p[6],colorWarningActive:p[7],colorWarningTextHover:p[8],colorWarningText:p[9],colorWarningTextActive:p[10],colorInfoBg:h[1],colorInfoBgHover:h[2],colorInfoBorder:h[3],colorInfoBorderHover:h[4],colorInfoHover:h[4],colorInfo:h[6],colorInfoActive:h[7],colorInfoTextHover:h[8],colorInfoText:h[9],colorInfoTextActive:h[10],colorBgMask:new J(`#000`).setAlpha(.45).toRgbString(),colorWhite:`#fff`})}var _f=e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e>16?16:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}};function vf(e){let{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return U({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+t*2).toFixed(1)}s`,motionDurationSlow:`${(n+t*3).toFixed(1)}s`,lineWidthBold:i+1},_f(r))}var yf=(e,t)=>new J(e).setAlpha(t).toRgbString(),bf=(e,t)=>new J(e).darken(t).toHexString(),xf=e=>{let t=sf(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},Sf=(e,t)=>{let n=e||`#fff`,r=t||`#000`;return{colorBgBase:n,colorTextBase:r,colorText:yf(r,.88),colorTextSecondary:yf(r,.65),colorTextTertiary:yf(r,.45),colorTextQuaternary:yf(r,.25),colorFill:yf(r,.15),colorFillSecondary:yf(r,.06),colorFillTertiary:yf(r,.04),colorFillQuaternary:yf(r,.02),colorBgLayout:bf(n,4),colorBgContainer:bf(n,0),colorBgElevated:bf(n,0),colorBgSpotlight:yf(r,.85),colorBorder:bf(n,15),colorBorderSecondary:bf(n,6)}};function Cf(e){let t=Array(10).fill(null).map((t,n)=>{let r=e*2.71828**((n-1)/5);return Math.floor((n>1?Math.floor(r):Math.ceil(r))/2)*2});return t[1]=e,t.map(e=>({size:e,lineHeight:(e+8)/e}))}var wf=e=>{let t=Cf(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight);return{fontSizeSM:n[0],fontSize:n[1],fontSizeLG:n[2],fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:r[1],lineHeightLG:r[2],lineHeightSM:r[0],lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function Tf(e){let t=Object.keys(mf).map(t=>{let n=sf(e[t]);return Array(10).fill(1).reduce((e,r,i)=>(e[`${t}-${i+1}`]=n[i],e),{})}).reduce((e,t)=>(e=U(U({},e),t),e),{});return U(U(U(U(U(U(U({},e),t),gf(e,{generateColorPalettes:xf,generateNeutralColorPalettes:Sf})),wf(e.fontSize)),pf(e)),ff(e)),vf(e))}function Ef(e){return e>=0&&e<=255}function Df(e,t){let{r:n,g:r,b:i,a}=new J(e).toRgb();if(a<1)return e;let{r:o,g:s,b:c}=new J(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-o*(1-e))/e),a=Math.round((r-s*(1-e))/e),l=Math.round((i-c*(1-e))/e);if(Ef(t)&&Ef(a)&&Ef(l))return new J({r:t,g:a,b:l,a:Math.round(e*100)/100}).toRgbString()}return new J({r:n,g:r,b:i,a:1}).toRgbString()}var Of=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{delete r[e]});let i=U(U({},n),r),a=1200,o=1600,s=2e3;return U(U(U({},i),{colorLink:i.colorInfoText,colorLinkHover:i.colorInfoHover,colorLinkActive:i.colorInfoActive,colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:Df(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:Df(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:Df(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:Df(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:`none`,linkHoverDecoration:`none`,linkFocusDecoration:`none`,controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:` + 0 1px 2px 0 rgba(0, 0, 0, 0.03), + 0 1px 6px -1px rgba(0, 0, 0, 0.02), + 0 2px 4px 0 rgba(0, 0, 0, 0.02) + `,boxShadowSecondary:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowTertiary:` + 0 1px 2px 0 rgba(0, 0, 0, 0.03), + 0 1px 6px -1px rgba(0, 0, 0, 0.02), + 0 2px 4px 0 rgba(0, 0, 0, 0.02) + `,screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:a-1,screenXL:a,screenXLMin:a,screenXLMax:o-1,screenXXL:o,screenXXLMin:o,screenXXLMax:s-1,screenXXXL:s,screenXXXLMin:s,boxShadowPopoverArrow:`3px 3px 7px rgba(0, 0, 0, 0.1)`,boxShadowCard:` + 0 1px 2px -2px ${new J(`rgba(0, 0, 0, 0.16)`).toRgbString()}, + 0 3px 6px 0 ${new J(`rgba(0, 0, 0, 0.12)`).toRgbString()}, + 0 5px 12px 4px ${new J(`rgba(0, 0, 0, 0.09)`).toRgbString()} + `,boxShadowDrawerRight:` + -6px 0 16px 0 rgba(0, 0, 0, 0.08), + -3px 0 6px -4px rgba(0, 0, 0, 0.12), + -9px 0 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerLeft:` + 6px 0 16px 0 rgba(0, 0, 0, 0.08), + 3px 0 6px -4px rgba(0, 0, 0, 0.12), + 9px 0 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerUp:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerDown:` + 0 -6px 16px 0 rgba(0, 0, 0, 0.08), + 0 -3px 6px -4px rgba(0, 0, 0, 0.12), + 0 -9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowTabsOverflowLeft:`inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowRight:`inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowTop:`inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowBottom:`inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)`}),r)}var Af={overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},jf=e=>({boxSizing:`border-box`,margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:`none`,fontFamily:e.fontFamily}),Mf=()=>({display:`inline-flex`,alignItems:`center`,color:`inherit`,fontStyle:`normal`,lineHeight:0,textAlign:`center`,textTransform:`none`,verticalAlign:`-0.125em`,textRendering:`optimizeLegibility`,"-webkit-font-smoothing":`antialiased`,"-moz-osx-font-smoothing":`grayscale`,"> *":{lineHeight:1},svg:{display:`inline-block`}}),Nf=()=>({"&::before":{display:`table`,content:`""`},"&::after":{display:`table`,clear:`both`,content:`""`}}),Pf=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:`transparent`,outline:`none`,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":`objects`,"&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active,\n &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:`not-allowed`}}}),Ff=(e,t)=>{let{fontFamily:n,fontSize:r}=e,i=`[class^="${t}"], [class*=" ${t}"]`;return{[i]:{fontFamily:n,fontSize:r,boxSizing:`border-box`,"&::before, &::after":{boxSizing:`border-box`},[i]:{boxSizing:`border-box`,"&::before, &::after":{boxSizing:`border-box`}}}}},If=e=>({outline:`${e.lineWidthBold}px solid ${e.colorPrimaryBorder}`,outlineOffset:1,transition:`outline-offset 0s, outline 0s`}),Lf=e=>({"&:focus-visible":U({},If(e))});function Rf(e,t,n){return r=>{let i=V(()=>r?.value),[a,o,s]=Zf(),{getPrefixCls:c,iconPrefixCls:l}=Jc(),u=V(()=>c());return gd(V(()=>({theme:a.value,token:o.value,hashId:s.value,path:[`Shared`,u.value]})),()=>[{"&":Pf(o.value)}]),[gd(V(()=>({theme:a.value,token:o.value,hashId:s.value,path:[e,i.value,l.value]})),()=>{let{token:r,flush:a}=Wf(o.value),c=U(U({},typeof n==`function`?n(r):n),o.value[e]),d=t(Vf(r,{componentCls:`.${i.value}`,prefixCls:i.value,iconCls:`.${l.value}`,antCls:`.${u.value}`},c),{hashId:s.value,prefixCls:i.value,rootPrefixCls:u.value,iconPrefixCls:l.value,overrideComponentToken:o.value[e]});return a(e,c),[Ff(o.value,i.value),d]}),s]}}var zf=typeof CSSINJS_STATISTIC<`u`,Bf=!0;function Vf(){var e=[...arguments];if(!zf)return U({},...e);Bf=!1;let t={};return e.forEach(e=>{Object.keys(e).forEach(n=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>e[n]})})}),Bf=!0,t}var Hf={};function Uf(){}function Wf(e){let t,n=e,r=Uf;return zf&&(t=new Set,n=new Proxy(e,{get(e,n){return Bf&&t.add(n),e[n]}}),r=(e,n)=>{Hf[e]={global:Array.from(t),component:n}}),{token:n,keys:t,flush:r}}var Gf=Wl(Tf),Kf={token:hf,hashed:!0},qf=Symbol(`DesignTokenContext`),Jf=Zt(),Yf=e=>{Un(qf,e),qn(e,()=>{Jf.value=tn(e),en(Jf)},{immediate:!0,deep:!0})},Xf=P({props:{value:G()},setup(e,t){let{slots:n}=t;return Yf(V(()=>e.value)),()=>n.default?.call(n)}});function Zf(){let e=N(qf,V(()=>Jf.value||Kf)),t=V(()=>`${yd}-${e.value.hashed||``}`),n=V(()=>e.value.theme||Gf),r=su(n,V(()=>[hf,e.value.token]),V(()=>({salt:t.value,override:U({override:e.value.token},e.value.components),formatToken:kf})));return[n,V(()=>r.value[0]),V(()=>e.value.hashed?r.value[1]:``)]}var Qf=P({compatConfig:{MODE:3},setup(){let[,e]=Zf(),t=V(()=>new J(e.value.colorBgBase).toHsl().l<.5?{opacity:.65}:{});return()=>z(`svg`,{style:t.value,width:`184`,height:`152`,viewBox:`0 0 184 152`,xmlns:`http://www.w3.org/2000/svg`},[z(`g`,{fill:`none`,"fill-rule":`evenodd`},[z(`g`,{transform:`translate(24 31.67)`},[z(`ellipse`,{"fill-opacity":`.8`,fill:`#F5F5F7`,cx:`67.797`,cy:`106.89`,rx:`67.797`,ry:`12.668`},null),z(`path`,{d:`M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z`,fill:`#AEB8C2`},null),z(`path`,{d:`M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z`,fill:`url(#linearGradient-1)`,transform:`translate(13.56)`},null),z(`path`,{d:`M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z`,fill:`#F5F5F7`},null),z(`path`,{d:`M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z`,fill:`#DCE0E6`},null)]),z(`path`,{d:`M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z`,fill:`#DCE0E6`},null),z(`g`,{transform:`translate(149.65 15.383)`,fill:`#FFF`},[z(`ellipse`,{cx:`20.654`,cy:`3.167`,rx:`2.849`,ry:`2.815`},null),z(`path`,{d:`M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z`},null)])])])}});Qf.PRESENTED_IMAGE_DEFAULT=!0;var $f=P({compatConfig:{MODE:3},setup(){let[,e]=Zf(),t=V(()=>{let{colorFill:t,colorFillTertiary:n,colorFillQuaternary:r,colorBgContainer:i}=e.value;return{borderColor:new J(t).onBackground(i).toHexString(),shadowColor:new J(n).onBackground(i).toHexString(),contentColor:new J(r).onBackground(i).toHexString()}});return()=>z(`svg`,{width:`64`,height:`41`,viewBox:`0 0 64 41`,xmlns:`http://www.w3.org/2000/svg`},[z(`g`,{transform:`translate(0 1)`,fill:`none`,"fill-rule":`evenodd`},[z(`ellipse`,{fill:t.value.shadowColor,cx:`32`,cy:`33`,rx:`32`,ry:`7`},null),z(`g`,{"fill-rule":`nonzero`,stroke:t.value.borderColor},[z(`path`,{d:`M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z`},null),z(`path`,{d:`M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z`,fill:t.value.contentColor},null)])])])}});$f.PRESENTED_IMAGE_SIMPLE=!0;var ep=e=>{let{componentCls:t,margin:n,marginXS:r,marginXL:i,fontSize:a,lineHeight:o}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:o,textAlign:`center`,[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:`100%`},svg:{height:`100%`,margin:`auto`}},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:e.colorTextDisabled,[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDisabled,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}},tp=Rf(`Empty`,e=>{let{componentCls:t,controlHeightLG:n}=e;return[ep(Vf(e,{emptyImgCls:`${t}-img`,emptyImgHeight:n*2.5,emptyImgHeightMD:n,emptyImgHeightSM:n*.875}))]}),np=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=a.value,c=U(U({},e),r),{image:l=n.image?.call(n)||uo(Qf),description:u=n.description?.call(n)||void 0,imageStyle:d,class:f=``}=c,p=np(c,[`image`,`description`,`imageStyle`,`class`]),m=typeof l==`function`?l():l,h=typeof m==`object`&&`type`in m&&m.type.PRESENTED_IMAGE_SIMPLE;return o(z(cl,{componentName:`Empty`,children:e=>{let r=u===void 0?e.description:u,a=typeof r==`string`?r:`empty`,o=null;return o=typeof m==`string`?z(`img`,{alt:a,src:m},null):m,z(`div`,H({class:W(t,f,s.value,{[`${t}-normal`]:h,[`${t}-rtl`]:i.value===`rtl`})},p),[z(`div`,{class:`${t}-image`,style:d},[o]),r&&z(`p`,{class:`${t}-description`},[r]),n.default&&z(`div`,{class:`${t}-footer`},[Ec(n.default())])])}},null))}}});rp.PRESENTED_IMAGE_DEFAULT=()=>uo(Qf),rp.PRESENTED_IMAGE_SIMPLE=()=>uo($f);var ip=Mc(rp),ap=e=>{let{prefixCls:t}=up(`empty`,e);return(e=>{switch(e){case`Table`:case`List`:return z(ip,{image:ip.PRESENTED_IMAGE_SIMPLE},null);case`Select`:case`TreeSelect`:case`Cascader`:case`Transfer`:case`Mentions`:return z(ip,{image:ip.PRESENTED_IMAGE_SIMPLE,class:`${t.value}-small`},null);default:return z(ip,null,null)}})(e.componentName)};function op(e){return z(ap,{componentName:e},null)}var sp=Symbol(`SizeContextKey`),cp=()=>N(sp,Xt(void 0)),lp=e=>{let t=cp();return Un(sp,V(()=>e.value||t.value)),e},up=((e,t)=>{let n=cp(),r=Zc(),i=N(Kc,U(U({},qc),{renderEmpty:e=>uo(ap,{componentName:e})})),a=V(()=>i.getPrefixCls(e,t.prefixCls)),o=V(()=>t.direction??i.direction?.value),s=V(()=>t.iconPrefixCls??i.iconPrefixCls.value),c=V(()=>i.getPrefixCls()),l=V(()=>i.autoInsertSpaceInButton?.value),u=i.renderEmpty,d=i.space,f=i.pageHeader,p=i.form,m=V(()=>t.getTargetContainer??i.getTargetContainer?.value),h=V(()=>t.getContainer??t.getPopupContainer??i.getPopupContainer?.value),g=V(()=>t.dropdownMatchSelectWidth??i.dropdownMatchSelectWidth?.value),_=V(()=>(t.virtual===void 0?i.virtual?.value!==!1:t.virtual!==!1)&&g.value!==!1),v=V(()=>t.size||n.value),y=V(()=>t.autocomplete??i.input?.value?.autocomplete),b=V(()=>t.disabled??r.value),x=V(()=>t.csp??i.csp),S=V(()=>t.wave??i.wave?.value);return{configProvider:i,prefixCls:a,direction:o,size:v,getTargetContainer:m,getPopupContainer:h,space:d,pageHeader:f,form:p,autoInsertSpaceInButton:l,renderEmpty:u,virtual:_,dropdownMatchSelectWidth:g,rootPrefixCls:c,getPrefixCls:i.getPrefixCls,autocomplete:y,csp:x,iconPrefixCls:s,disabled:b,select:i.select,wave:S}});function dp(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}function gp(e){return((t=e)!=null&&typeof t==`object`&&!1===Array.isArray(t))==1&&Object.prototype.toString.call(e)===`[object Object]`;var t}var _p=Object.prototype,vp=_p.toString,yp=_p.hasOwnProperty,bp=/^\s*function (\w+)/;function xp(e){var t=e?.type??e;if(t){var n=t.toString().match(bp);return n?n[1]:``}return``}var Sp=function(e){var t,n;return!1!==gp(e)&&typeof(t=e.constructor)==`function`&&!1!==gp(n=t.prototype)&&!1!==n.hasOwnProperty(`isPrototypeOf`)},X=function(e){return e},Cp=function(e,t){return yp.call(e,t)},wp=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},Tp=Array.isArray||function(e){return vp.call(e)===`[object Array]`},Ep=function(e){return vp.call(e)===`[object Function]`},Dp=function(e){return Sp(e)&&Cp(e,`_vueTypes_name`)},Op=function(e){return Sp(e)&&(Cp(e,`type`)||[`_vueTypes_name`,`validator`,`default`,`required`].some(function(t){return Cp(e,t)}))};function kp(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function Ap(e,t,n){var r;n===void 0&&(n=!1);var i=!0,a=``;r=Sp(e)?e:{type:e};var o=Dp(r)?r._vueTypes_name+` - `:``;if(Op(r)&&r.type!==null){if(r.type===void 0||!0===r.type||!r.required&&t===void 0)return i;Tp(r.type)?(i=r.type.some(function(e){return!0===Ap(e,t,!0)}),a=r.type.map(function(e){return xp(e)}).join(` or `)):i=(a=xp(r))===`Array`?Tp(t):a===`Object`?Sp(t):a===`String`||a===`Number`||a===`Boolean`||a===`Function`?function(e){if(e==null)return``;var t=e.constructor.toString().match(bp);return t?t[1]:``}(t)===a:t instanceof r.type}if(!i){var s=o+`value "`+t+`" should be of type "`+a+`"`;return!1===n?(X(s),!1):s}if(Cp(r,`validator`)&&Ep(r.validator)){var c=X,l=[];if(X=function(e){l.push(e)},i=r.validator(t),X=c,!i){var u=(l.length>1?`* `:``)+l.join(` +* `);return l.length=0,!1===n?(X(u),i):u}}return i}function jp(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return e!==void 0||this.default?Ep(e)||!0===Ap(this,e,!0)?(this.default=Tp(e)?function(){return[].concat(e)}:Sp(e)?function(){return Object.assign({},e)}:e,this):(X(this._vueTypes_name+` - invalid default value: "`+e+`"`),this):this}}}),r=n.validator;return Ep(r)&&(n.validator=kp(r,n)),n}function Mp(e,t){var n=jp(e,t);return Object.defineProperty(n,"validate",{value:function(e){return Ep(this.validator)&&X(this._vueTypes_name+` - calling .validate() will overwrite the current custom validator function. Validator info: +`+JSON.stringify(this)),this.validator=kp(e,this),this}})}function Np(e,t,n){var r,i,a=(r=t,i={},Object.getOwnPropertyNames(r).forEach(function(e){i[e]=Object.getOwnPropertyDescriptor(r,e)}),Object.defineProperties({},i));if(a._vueTypes_name=e,!Sp(n))return a;var o,s=n.validator,c=hp(n,[`validator`]);if(Ep(s)){var l=a.validator;l&&=(o=l).__original??o,a.validator=kp(l?function(e){return l.call(this,e)&&s.call(this,e)}:s,a)}return Object.assign(a,c)}function Pp(e){return e.replace(/^(?!\s*$)/gm,` `)}var Fp=function(){return Mp(`any`,{})},Ip=function(){return Mp(`function`,{type:Function})},Lp=function(){return Mp(`boolean`,{type:Boolean})},Rp=function(){return Mp(`string`,{type:String})},zp=function(){return Mp(`number`,{type:Number})},Bp=function(){return Mp(`array`,{type:Array})},Vp=function(){return Mp(`object`,{type:Object})},Hp=function(){return jp(`integer`,{type:Number,validator:function(e){return wp(e)}})},Up=function(){return jp(`symbol`,{validator:function(e){return typeof e==`symbol`}})};function Wp(e,t){if(t===void 0&&(t=`custom validation failed`),typeof e!=`function`)throw TypeError(`[VueTypes error]: You must provide a function as argument`);return jp(e.name||`<>`,{validator:function(n){var r=e(n);return r||X(this._vueTypes_name+` - `+t),r}})}function Gp(e){if(!Tp(e))throw TypeError(`[VueTypes error]: You must provide an array as argument.`);var t=`oneOf - value should be one of "`+e.join(`", "`)+`".`,n=e.reduce(function(e,t){if(t!=null){var n=t.constructor;e.indexOf(n)===-1&&e.push(n)}return e},[]);return jp(`oneOf`,{type:n.length>0?n:void 0,validator:function(n){var r=e.indexOf(n)!==-1;return r||X(t),r}})}function Kp(e){if(!Tp(e))throw TypeError(`[VueTypes error]: You must provide an array as argument`);for(var t=!1,n=[],r=0;r0&&n.some(function(e){return a.indexOf(e)===-1})){var o=n.filter(function(e){return a.indexOf(e)===-1});return X(o.length===1?`shape - required property "`+o[0]+`" is not defined.`:`shape - required properties "`+o.join(`", "`)+`" are not defined.`),!1}return a.every(function(n){if(t.indexOf(n)===-1)return!0===i._vueTypes_isLoose||(X(`shape - shape definition does not include a "`+n+`" property. Allowed keys: "`+t.join(`", "`)+`".`),!1);var a=Ap(e[n],r[n],!0);return typeof a==`string`&&X(`shape - "`+n+`" property validation error: + `+Pp(a)),!0===a})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),r}var Zp=function(){function e(){}return e.extend=function(e){var t=this;if(Tp(e))return e.forEach(function(e){return t.extend(e)}),this;var n=e.name,r=e.validate,i=r!==void 0&&r,a=e.getter,o=a!==void 0&&a,s=hp(e,[`name`,`validate`,`getter`]);if(Cp(this,n))throw TypeError(`[VueTypes error]: Type "`+n+`" already defined`);var c,l=s.type;return Dp(l)?(delete s.type,Object.defineProperty(this,n,o?{get:function(){return Np(n,l,s)}}:{value:function(){var e,t=Np(n,l,s);return t.validator&&=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments))),t}})):(c=o?{get:function(){var e=Object.assign({},s);return i?Mp(n,e):jp(n,e)},enumerable:!0}:{value:function(){var e,t,r=Object.assign({},s);return e=i?Mp(n,r):jp(n,r),r.validator&&(e.validator=(t=r.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,c))},fp(e,null,[{key:`any`,get:function(){return Fp()}},{key:`func`,get:function(){return Ip().def(this.defaults.func)}},{key:`bool`,get:function(){return Lp().def(this.defaults.bool)}},{key:`string`,get:function(){return Rp().def(this.defaults.string)}},{key:`number`,get:function(){return zp().def(this.defaults.number)}},{key:`array`,get:function(){return Bp().def(this.defaults.array)}},{key:`object`,get:function(){return Vp().def(this.defaults.object)}},{key:`integer`,get:function(){return Hp().def(this.defaults.integer)}},{key:`symbol`,get:function(){return Up()}}]),e}();function Qp(e){var t;return e===void 0&&(e={func:function(){},bool:!0,string:``,number:0,array:function(){return[]},object:function(){return{}},integer:0}),(t=function(t){function n(){return t.apply(this,arguments)||this}return mp(n,t),fp(n,null,[{key:`sensibleDefaults`,get:function(){return pp({},this.defaults)},set:function(t){this.defaults=!1===t?{}:pp({},!0===t?e:t)}}]),n}(Zp)).defaults=pp({},e),t}Zp.defaults={},Zp.custom=Wp,Zp.oneOf=Gp,Zp.instanceOf=Jp,Zp.oneOfType=Kp,Zp.arrayOf=qp,Zp.objectOf=Yp,Zp.shape=Xp,Zp.utils={validate:function(e,t){return!0===Ap(t,e,!0)},toType:function(e,t,n){return n===void 0&&(n=!1),n?Mp(e,t):jp(e,t)}},function(e){function t(){return e.apply(this,arguments)||this}return mp(t,e),t}(Qp());var $p=Qp({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});$p.extend([{name:`looseBool`,getter:!0,type:Boolean,default:void 0},{name:`style`,getter:!0,type:[String,Object],default:void 0},{name:`VueNode`,getter:!0,type:null}]);function em(e){return e.default=void 0,e}function tm(e){let{prefixCls:t,animation:n,transitionName:r}=e;return n?{name:`${t}-${n}`}:r?{name:r}:{}}var nm=e=>e!==void 0&&(e===`topLeft`||e===`topRight`)?`slide-down`:`slide-up`,rm=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return U(e?{name:e,appear:!0,enterFromClass:`${e}-enter ${e}-enter-prepare ${e}-enter-start`,enterActiveClass:`${e}-enter ${e}-enter-prepare`,enterToClass:`${e}-enter ${e}-enter-active`,leaveFromClass:` ${e}-leave`,leaveActiveClass:`${e}-leave ${e}-leave-active`,leaveToClass:`${e}-leave ${e}-leave-active`}:{css:!1},t)},im=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return U(e?{name:e,appear:!0,appearActiveClass:`${e}`,appearToClass:`${e}-appear ${e}-appear-active`,enterFromClass:`${e}-appear ${e}-enter ${e}-appear-prepare ${e}-enter-prepare`,enterActiveClass:`${e}`,enterToClass:`${e}-enter ${e}-appear ${e}-appear-active ${e}-enter-active`,leaveActiveClass:`${e} ${e}-leave`,leaveToClass:`${e}-leave-active`}:{css:!1},t)},am=(e,t,n)=>n===void 0?`${e}-${t}`:n,om=Symbol(`PortalContextKey`),sm=function(e){Un(om,{inTriggerContext:(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0}).inTriggerContext,shouldRender:V(()=>{let{sPopupVisible:t,popupRef:n,forceRender:r,autoDestroy:i}=e||{},a=!1;return(t||n||r)&&(a=!0),!t&&i&&(a=!1),a})})},cm=()=>{sm({},{inTriggerContext:!1});let e=N(om,{shouldRender:V(()=>!1),inTriggerContext:!1});return{shouldRender:V(()=>e.shouldRender.value||e.inTriggerContext===!1)}},lm=P({compatConfig:{MODE:3},name:`Portal`,inheritAttrs:!1,props:{getContainer:$p.func.isRequired,didUpdate:Function},setup(e,t){let{slots:n}=t,r=!0,i,{shouldRender:a}=cm();function o(){a.value&&(i=e.getContainer())}zr(()=>{r=!1,o()}),Br(()=>{i||o()});let s=qn(a,()=>{a.value&&!i&&(i=e.getContainer()),i&&s()});return Hr(()=>{On(()=>{var t;a.value&&((t=e.didUpdate)==null||t.call(e,e))})}),()=>a.value?r?n.default?.call(n):i?z(cr,{to:i},n):null:null}}),um=Symbol(`iconContext`),dm=function(){return N(um,{prefixCls:Xt(`anticon`),rootClassName:Xt(``),csp:Xt()})};function fm(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function pm(e,t){return e&&e.contains?e.contains(t):!1}var mm=`data-vc-order`,hm=`vc-icon-key`,gm=new Map;function _m(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).mark;return e?e.startsWith(`data-`)?e:`data-${e}`:hm}function vm(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function ym(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function bm(e){return Array.from((gm.get(e)||e).children).filter(function(e){return e.tagName===`STYLE`})}function xm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!fm())return null;var n=t.csp,r=t.prepend,i=document.createElement(`style`);i.setAttribute(mm,ym(r)),n&&n.nonce&&(i.nonce=n.nonce),i.innerHTML=e;var a=vm(t),o=a.firstChild;if(r){if(r===`queue`){var s=bm(a).filter(function(e){return[`prepend`,`prependQueue`].includes(e.getAttribute(mm))});if(s.length)return a.insertBefore(i,s[s.length-1].nextSibling),i}a.insertBefore(i,o)}else a.appendChild(i);return i}function Sm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return bm(vm(t)).find(function(n){return n.getAttribute(_m(t))===e})}function Cm(e,t){var n=gm.get(e);if(!n||!pm(document,n)){var r=xm(``,t),i=r.parentNode;gm.set(e,i),e.removeChild(r)}}function wm(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Cm(vm(n),n);var r=Sm(t,n);if(r)return n.csp&&n.csp.nonce&&r.nonce!==n.csp.nonce&&(r.nonce=n.csp.nonce),r.innerHTML!==e&&(r.innerHTML=e),r;var i=xm(e,n);return i.setAttribute(_m(n),t),i}function Tm(e){for(var t=1;t * { + line-height: 1; +} + +.anticon svg { + display: inline-block; +} + +.anticon::before { + display: none; +} + +.anticon .anticon-icon { + display: block; +} + +.anticon[tabindex] { + cursor: pointer; +} + +.anticon-spin::before, +.anticon-spin { + display: inline-block; + -webkit-animation: loadingCircle 1s infinite linear; + animation: loadingCircle 1s infinite linear; +} + +@-webkit-keyframes loadingCircle { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes loadingCircle { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +`;function Nm(e){return e&&e.getRootNode&&e.getRootNode()}function Pm(e){return fm()?Nm(e)instanceof ShadowRoot:!1}function Fm(e){return Pm(e)?Nm(e):null}var Im=function(){var e=dm(),t=e.prefixCls,n=e.csp,r=Ka(),i=Mm;t&&(i=i.replace(/anticon/g,t.value)),On(function(){if(fm()){var e=r.vnode.el,t=Fm(e);wm(i,`@ant-design-vue-icons`,{prepend:!0,csp:n.value,attachTo:t})}})},Lm=[`icon`,`primaryColor`,`secondaryColor`];function Rm(e,t){if(e==null)return{};var n=zm(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zm(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a=0)&&(n[i]=e[i]);return n}function Bm(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dh(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a=0)&&(n[i]=e[i]);return n}Qm(df.primary);var Z=function(e,t){var n,r=ch({},e,t.attrs),i=r.class,a=r.icon,o=r.spin,s=r.rotate,c=r.tabindex,l=r.twoToneColor,u=r.onClick,d=uh(r,th),f=dm(),p=f.prefixCls,m=f.rootClassName,h=(n={},lh(n,m.value,!!m.value),lh(n,p.value,!0),lh(n,`${p.value}-${a.name}`,!!a.name),lh(n,`${p.value}-spin`,!!o||a.name===`loading`),n),g=c;g===void 0&&u&&(g=-1);var _=s?{msTransform:`rotate(${s}deg)`,transform:`rotate(${s}deg)`}:void 0,v=nh(jm(l),2),y=v[0],b=v[1];return z(`span`,ch({role:`img`,"aria-label":a.name},d,{onClick:u,class:[h,i],tabindex:g}),[z(Gm,{icon:a,primaryColor:y,secondaryColor:b,style:_},null),z(eh,null,null)])};Z.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:[String,Array]},Z.displayName=`AntdIcon`,Z.inheritAttrs=!1,Z.getTwoToneColor=$m,Z.setTwoToneColor=Qm;var fh={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z`}}]},name:`loading`,theme:`outlined`};function ph(e){for(var t=1;te.locale,e=>{$h(e&&e.Modal),r.antLocale=U(U({},e),{exist:!0})},{immediate:!0}),()=>n.default?.call(n)}});ng.install=function(e){return e.component(ng.name,ng),e};var rg=Mc(ng),ig=P({name:`Notice`,inheritAttrs:!1,props:[`prefixCls`,`duration`,`updateMark`,`noticeKey`,`closeIcon`,`closable`,`props`,`onClick`,`onClose`,`holder`,`visible`],setup(e,t){let{attrs:n,slots:r}=t,i,a=!1,o=V(()=>e.duration===void 0?4.5:e.duration),s=()=>{o.value&&!a&&(i=setTimeout(()=>{l()},o.value*1e3))},c=()=>{i&&=(clearTimeout(i),null)},l=t=>{t&&t.stopPropagation(),c();let{onClose:n,noticeKey:r}=e;n&&n(r)},u=()=>{c(),s()};return Br(()=>{s()}),Wr(()=>{a=!0,c()}),qn([o,()=>e.updateMark,()=>e.visible],(e,t)=>{let[n,r,i]=e,[a,o,s]=t;(n!==a||r!==o||i!==s&&s)&&u()},{flush:`post`}),()=>{let{prefixCls:t,closable:i,closeIcon:a=r.closeIcon?.call(r),onClick:o,holder:u}=e,{class:d,style:f}=n,p=`${t}-notice`,m=Object.keys(n).reduce((e,t)=>((t.startsWith(`data-`)||t.startsWith(`aria-`)||t===`role`)&&(e[t]=n[t]),e),{}),h=z(`div`,H({class:W(p,d,{[`${p}-closable`]:i}),style:f,onMouseenter:c,onMouseleave:s,onClick:o},m),[z(`div`,{class:`${p}-content`},[r.default?.call(r)]),i?z(`a`,{tabindex:0,onClick:l,class:`${p}-close`},[a||z(`span`,{class:`${p}-close-x`},null)]):null]);return u?z(cr,{to:u},{default:()=>h}):h}}}),ag=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{prefixCls:t,animation:n=`fade`}=e,r=e.transitionName;return!r&&n&&(r=`${t}-${n}`),im(r)}),c=(t,n)=>{let r=t.key||cg(),i=U(U({},t),{key:r}),{maxCount:a}=e,s=o.value.map(e=>e.notice.key).indexOf(r),c=o.value.concat();s===-1?(a&&o.value.length>=a&&(i.key=c[0].notice.key,i.updateMark=cg(),i.userPassKey=r,c.shift()),c.push({notice:i,holderCallback:n})):c.splice(s,1,{notice:i,holderCallback:n}),o.value=c},l=e=>{o.value=A(o.value).filter(t=>{let{notice:{key:n,userPassKey:r}}=t;return(r||n)!==e})};return r({add:c,remove:l,notices:o}),()=>{let{prefixCls:t,closeIcon:r=i.closeIcon?.call(i,{prefixCls:t})}=e,c=o.value.map((n,i)=>{let{notice:s,holderCallback:c}=n,u=i===o.value.length-1?s.updateMark:void 0,{key:d,userPassKey:f}=s,{content:p}=s,m=U(U(U({prefixCls:t,closeIcon:typeof r==`function`?r({prefixCls:t}):r},s),s.props),{key:d,noticeKey:f||d,updateMark:u,onClose:e=>{var t;l(e),(t=s.onClose)==null||t.call(s)},onClick:s.onClick});return c?z(`div`,{key:d,class:`${t}-hook-holder`,ref:e=>{d!==void 0&&(e?(a.set(d,e),c(e,m)):a.delete(d))}},null):z(ig,H(H({},m),{},{class:W(m.class,e.hashId)}),{default:()=>[typeof p==`function`?p({prefixCls:t}):p]})});return z(`div`,{class:{[t]:1,[n.class]:!!n.class,[e.hashId]:!0},style:n.style||{top:`65px`,left:`50%`}},[z(Cs,H({tag:`div`},s.value),{default:()=>[c]})])}}});lg.newInstance=function(e,t){let n=e||{},{name:r=`notification`,getContainer:i,appContext:a,prefixCls:o,rootPrefixCls:s,transitionName:c,hasTransitionName:l,useStyle:u}=n,d=ag(n,[`name`,`getContainer`,`appContext`,`prefixCls`,`rootPrefixCls`,`transitionName`,`hasTransitionName`,`useStyle`]),f=document.createElement(`div`);i?i().appendChild(f):document.body.appendChild(f);let p=z(P({compatConfig:{MODE:3},name:`NotificationWrapper`,setup(e,n){let{attrs:i}=n,a=Zt(),d=V(()=>$.getPrefixCls(r,o)),[,p]=u(d);return Br(()=>{t({notice(e){var t;(t=a.value)==null||t.add(e)},removeNotice(e){var t;(t=a.value)==null||t.remove(e)},destroy(){Fs(null,f),f.parentNode&&f.parentNode.removeChild(f)},component:a})}),()=>{let e=$,t=e.getRootPrefixCls(s,d.value),n=l?c:`${d.value}-${c}`;return z(I_,H(H({},e),{},{prefixCls:t}),{default:()=>[z(lg,H(H({ref:a},i),{},{prefixCls:d.value,transitionName:n,hashId:p.value}),null)]})}}}),d);p.appContext=a||p.appContext,Fs(p,f)};var ug=0,dg=Date.now();function fg(){let e=ug;return ug+=1,`rcNotification_${dg}_${e}`}var pg=P({name:`HookNotification`,inheritAttrs:!1,props:[`prefixCls`,`transitionName`,`animation`,`maxCount`,`closeIcon`,`hashId`,`remove`,`notices`,`getStyles`,`getClassName`,`onAllRemoved`,`getContainer`],setup(e,t){let{attrs:n,slots:r}=t,i=new Map,a=V(()=>e.notices),o=V(()=>{let t=e.transitionName;if(!t&&e.animation)switch(typeof e.animation){case`string`:t=e.animation;break;case`function`:t=e.animation().name;break;case`object`:t=e.animation.name;break;default:t=`${e.prefixCls}-fade`;break}return im(t)}),s=t=>e.remove(t),c=Xt({});qn(a,()=>{let t={};Object.keys(c.value).forEach(e=>{t[e]=[]}),e.notices.forEach(e=>{let{placement:n=`topRight`}=e.notice;n&&(t[n]=t[n]||[],t[n].push(e))}),c.value=t});let l=V(()=>Object.keys(c.value));return()=>{let{prefixCls:t,closeIcon:u=r.closeIcon?.call(r,{prefixCls:t})}=e,d=l.value.map(r=>{let l=c.value[r],d=e.getClassName?.call(e,r),f=e.getStyles?.call(e,r),p=l.map((n,r)=>{let{notice:o,holderCallback:c}=n,l=r===a.value.length-1?o.updateMark:void 0,{key:d,userPassKey:f}=o,{content:p}=o,m=U(U(U({prefixCls:t,closeIcon:typeof u==`function`?u({prefixCls:t}):u},o),o.props),{key:d,noticeKey:f||d,updateMark:l,onClose:e=>{var t;s(e),(t=o.onClose)==null||t.call(o)},onClick:o.onClick});return c?z(`div`,{key:d,class:`${t}-hook-holder`,ref:e=>{d!==void 0&&(e?(i.set(d,e),c(e,m)):i.delete(d))}},null):z(ig,H(H({},m),{},{class:W(m.class,e.hashId)}),{default:()=>[typeof p==`function`?p({prefixCls:t}):p]})}),m={[t]:1,[`${t}-${r}`]:1,[n.class]:!!n.class,[e.hashId]:!0,[d]:!!d};function h(){var t;l.length>0||(Reflect.deleteProperty(c.value,r),(t=e.onAllRemoved)==null||t.call(e))}return z(`div`,{key:r,class:m,style:n.style||f||{top:`65px`,left:`50%`}},[z(Cs,H(H({tag:`div`},o.value),{},{onAfterLeave:h}),{default:()=>[p]})])});return z(lm,{getContainer:e.getContainer},{default:()=>[d]})}}}),mg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);idocument.body,gg=0;function _g(){let e={};return[...arguments].forEach(t=>{t&&Object.keys(t).forEach(n=>{let r=t[n];r!==void 0&&(e[n]=r)})}),e}function vg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{getContainer:t=hg,motion:n,prefixCls:r,maxCount:i,getClassName:a,getStyles:o,onAllRemoved:s}=e,c=mg(e,[`getContainer`,`motion`,`prefixCls`,`maxCount`,`getClassName`,`getStyles`,`onAllRemoved`]),l=Zt([]),u=Zt(),d=(e,t)=>{let n=e.key||fg(),r=U(U({},e),{key:n}),a=l.value.map(e=>e.notice.key).indexOf(n),o=l.value.concat();a===-1?(i&&l.value.length>=i&&(r.key=o[0].notice.key,r.updateMark=fg(),r.userPassKey=n,o.shift()),o.push({notice:r,holderCallback:t})):o.splice(a,1,{notice:r,holderCallback:t}),l.value=o},f=e=>{l.value=l.value.filter(t=>{let{notice:{key:n,userPassKey:r}}=t;return(r||n)!==e})},p=()=>{l.value=[]},m=()=>z(pg,{ref:u,prefixCls:r,maxCount:i,notices:l.value,remove:f,getClassName:a,getStyles:o,animation:n,hashId:e.hashId,onAllRemoved:s,getContainer:t},null),h=Zt([]);return qn(h,()=>{h.value.length&&(h.value.forEach(e=>{switch(e.type){case`open`:d(e.config);break;case`close`:f(e.key);break;case`destroy`:p();break}}),h.value=[])}),[{open:e=>{let t=_g(c,e);(t.key===null||t.key===void 0)&&(t.key=`vc-notification-${gg}`,gg+=1),h.value=[...h.value,{type:`open`,config:t}]},close:e=>{h.value=[...h.value,{type:`close`,key:e}]},destroy:()=>{h.value=[...h.value,{type:`destroy`}]}},m]}var yg=lg,bg=e=>{let{componentCls:t,iconCls:n,boxShadowSecondary:r,colorBgElevated:i,colorSuccess:a,colorError:o,colorWarning:s,colorInfo:c,fontSizeLG:l,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:p,borderRadiusLG:m,zIndexPopup:h,messageNoticeContentPadding:g}=e,_=new vd(`MessageMoveIn`,{"0%":{padding:0,transform:`translateY(-100%)`,opacity:0},"100%":{padding:p,transform:`translateY(0)`,opacity:1}}),v=new vd(`MessageMoveOut`,{"0%":{maxHeight:e.height,padding:p,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}});return[{[t]:U(U({},jf(e)),{position:`fixed`,top:f,left:`50%`,transform:`translateX(-50%)`,width:`100%`,pointerEvents:`none`,zIndex:h,[`${t}-move-up`]:{animationFillMode:`forwards`},[` + ${t}-move-up-appear, + ${t}-move-up-enter + `]:{animationName:_,animationDuration:d,animationPlayState:`paused`,animationTimingFunction:u},[` + ${t}-move-up-appear${t}-move-up-appear-active, + ${t}-move-up-enter${t}-move-up-enter-active + `]:{animationPlayState:`running`},[`${t}-move-up-leave`]:{animationName:v,animationDuration:d,animationPlayState:`paused`,animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:`running`},"&-rtl":{direction:`rtl`,span:{direction:`rtl`}}})},{[`${t}-notice`]:{padding:p,textAlign:`center`,[n]:{verticalAlign:`text-bottom`,marginInlineEnd:f,fontSize:l},[`${t}-notice-content`]:{display:`inline-block`,padding:g,background:i,borderRadius:m,boxShadow:r,pointerEvents:`all`},[`${t}-success ${n}`]:{color:a},[`${t}-error ${n}`]:{color:o},[`${t}-warning ${n}`]:{color:s},[` + ${t}-info ${n}, + ${t}-loading ${n}`]:{color:c}}},{[`${t}-notice-pure-panel`]:{padding:0,textAlign:`start`}}]},xg=Rf(`Message`,e=>[bg(Vf(e,{messageNoticeContentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`}))],e=>({height:150,zIndexPopup:e.zIndexPopupBase+10})),Sg={info:z(Zh,null,null),success:z(Uh,null,null),error:z(Ch,null,null),warning:z(qh,null,null),loading:z(hh,null,null)},Cg=P({name:`PureContent`,inheritAttrs:!1,props:[`prefixCls`,`type`,`icon`],setup(e,t){let{slots:n}=t;return()=>z(`div`,{class:W(`${e.prefixCls}-custom-content`,`${e.prefixCls}-${e.type}`)},[e.icon||Sg[e.type],z(`span`,null,[n.default?.call(n)])])}}),wg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ir(`message`,e.prefixCls)),[,o]=xg(a),s=()=>{let t=e.top??Tg;return{left:`50%`,transform:`translateX(-50%)`,top:typeof t==`number`?`${t}px`:t}},c=()=>W(o.value,e.rtl?`${a.value}-rtl`:``),l=()=>tm({prefixCls:a.value,animation:e.animation??`move-up`,transitionName:e.transitionName}),u=z(`span`,{class:`${a.value}-close-x`},[z(yh,{class:`${a.value}-close-icon`},null)]),[d,f]=vg({getStyles:s,prefixCls:a.value,getClassName:c,motion:l,closable:!1,closeIcon:u,duration:e.duration??Eg,getContainer:e.staticGetContainer??i.value,maxCount:e.maxCount,onAllRemoved:e.onAllRemoved});return n(U(U({},d),{prefixCls:a,hashId:o})),f}}),Og=0;function kg(e){let t=Zt(null),n=Symbol(`messageHolderKey`),r=e=>{var n;(n=t.value)==null||n.close(e)},i=e=>{if(!t.value){let e=()=>{};return e.then=()=>{},e}let{open:n,prefixCls:i,hashId:a}=t.value,o=`${i}-notice`,{content:s,icon:c,type:l,key:u,class:d,onClose:f}=e,p=wg(e,[`content`,`icon`,`type`,`key`,`class`,`onClose`]),m=u;return m??=(Og+=1,`antd-message-${Og}`),cc(e=>(n(U(U({},p),{key:m,content:()=>z(Cg,{prefixCls:i,type:l,icon:typeof c==`function`?c():c},{default:()=>[typeof s==`function`?s():s]}),placement:`top`,class:W(l&&`${o}-${l}`,a,d),onClose:()=>{f?.(),e()}})),()=>{r(m)}))},a={open:i,destroy:e=>{var n;e===void 0?(n=t.value)==null||n.destroy():r(e)}};return[`info`,`success`,`warning`,`error`,`loading`].forEach(e=>{a[e]=(t,n,r)=>{let a;a=t&&typeof t==`object`&&`content`in t?t:{content:t};let o,s;typeof n==`function`?s=n:(o=n,s=r);let c=U(U({onClose:s,duration:o},a),{type:e});return i(c)}}),[a,()=>z(Dg,H(H({key:n},e),{},{ref:t}),null)]}function Ag(e){return kg(e)}var jg=3,Mg,Q,Ng=1,Pg=``,Fg=`move-up`,Ig=!1,Lg=()=>document.body,Rg,zg=!1;function Bg(){return Ng++}function Vg(e){e.top!==void 0&&(Mg=e.top,Q=null),e.duration!==void 0&&(jg=e.duration),e.prefixCls!==void 0&&(Pg=e.prefixCls),e.getContainer!==void 0&&(Lg=e.getContainer,Q=null),e.transitionName!==void 0&&(Fg=e.transitionName,Q=null,Ig=!0),e.maxCount!==void 0&&(Rg=e.maxCount,Q=null),e.rtl!==void 0&&(zg=e.rtl)}function Hg(e,t){if(Q){t(Q);return}yg.newInstance({appContext:e.appContext,prefixCls:e.prefixCls||Pg,rootPrefixCls:e.rootPrefixCls,transitionName:Fg,hasTransitionName:Ig,style:{top:Mg},getContainer:Lg||e.getPopupContainer,maxCount:Rg,name:`message`,useStyle:xg},e=>{if(Q){t(Q);return}Q=e,t(e)})}var Ug={info:Zh,success:Uh,error:Ch,warning:qh,loading:hh},Wg=Object.keys(Ug);function Gg(e){let t=e.duration===void 0?jg:e.duration,n=e.key||Bg(),r=new Promise(r=>{let i=()=>(typeof e.onClose==`function`&&e.onClose(),r(!0));Hg(e,r=>{r.notice({key:n,duration:t,style:e.style||{},class:e.class,content:t=>{let{prefixCls:n}=t,r=Ug[e.type],i=r?z(r,null,null):``;return z(`div`,{class:W(`${n}-custom-content`,{[`${n}-${e.type}`]:e.type,[`${n}-rtl`]:zg===!0})},[typeof e.icon==`function`?e.icon():e.icon||i,z(`span`,null,[typeof e.content==`function`?e.content():e.content])])},onClose:i,onClick:e.onClick})})}),i=()=>{Q&&Q.removeNotice(n)};return i.then=(e,t)=>r.then(e,t),i.promise=r,i}function Kg(e){return Object.prototype.toString.call(e)===`[object Object]`&&!!e.content}var qg={open:Gg,config:Vg,destroy(e){if(Q)if(e){let{removeNotice:t}=Q;t(e)}else{let{destroy:e}=Q;e(),Q=null}}};function Jg(e,t){e[t]=(n,r,i)=>Kg(n)?e.open(U(U({},n),{type:t})):(typeof r==`function`&&(i=r,r=void 0),e.open({content:n,duration:r,type:t,onClose:i}))}Wg.forEach(e=>Jg(qg,e)),qg.warn=qg.warning,qg.useMessage=Ag;var Yg=e=>{let{componentCls:t,width:n,notificationMarginEdge:r}=e,i=new vd(`antNotificationTopFadeIn`,{"0%":{marginTop:`-100%`,opacity:0},"100%":{marginTop:0,opacity:1}}),a=new vd(`antNotificationBottomFadeIn`,{"0%":{marginBottom:`-100%`,opacity:0},"100%":{marginBottom:0,opacity:1}}),o=new vd(`antNotificationLeftFadeIn`,{"0%":{right:{_skip_check_:!0,value:n},opacity:0},"100%":{right:{_skip_check_:!0,value:0},opacity:1}});return{[`&${t}-top, &${t}-bottom`]:{marginInline:0},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:i}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:a}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginInlineEnd:0,marginInlineStart:r,[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:o}}}},Xg=e=>{let{iconCls:t,componentCls:n,boxShadowSecondary:r,fontSizeLG:i,notificationMarginBottom:a,borderRadiusLG:o,colorSuccess:s,colorInfo:c,colorWarning:l,colorError:u,colorTextHeading:d,notificationBg:f,notificationPadding:p,notificationMarginEdge:m,motionDurationMid:h,motionEaseInOut:g,fontSize:_,lineHeight:v,width:y,notificationIconSize:b}=e,x=`${n}-notice`,S=new vd(`antNotificationFadeIn`,{"0%":{left:{_skip_check_:!0,value:y},opacity:0},"100%":{left:{_skip_check_:!0,value:0},opacity:1}}),C=new vd(`antNotificationFadeOut`,{"0%":{maxHeight:e.animationMaxHeight,marginBottom:a,opacity:1},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[n]:U(U(U(U({},jf(e)),{position:`fixed`,zIndex:e.zIndexPopup,marginInlineEnd:m,[`${n}-hook-holder`]:{position:`relative`},[`&${n}-top, &${n}-bottom`]:{[`${n}-notice`]:{marginInline:`auto auto`}},[`&${n}-topLeft, &${n}-bottomLeft`]:{[`${n}-notice`]:{marginInlineEnd:`auto`,marginInlineStart:0}},[`${n}-fade-enter, ${n}-fade-appear`]:{animationDuration:e.motionDurationMid,animationTimingFunction:g,animationFillMode:`both`,opacity:0,animationPlayState:`paused`},[`${n}-fade-leave`]:{animationTimingFunction:g,animationFillMode:`both`,animationDuration:h,animationPlayState:`paused`},[`${n}-fade-enter${n}-fade-enter-active, ${n}-fade-appear${n}-fade-appear-active`]:{animationName:S,animationPlayState:`running`},[`${n}-fade-leave${n}-fade-leave-active`]:{animationName:C,animationPlayState:`running`}}),Yg(e)),{"&-rtl":{direction:`rtl`,[`${n}-notice-btn`]:{float:`left`}}})},{[x]:{position:`relative`,width:y,maxWidth:`calc(100vw - ${m*2}px)`,marginBottom:a,marginInlineStart:`auto`,padding:p,overflow:`hidden`,lineHeight:v,wordWrap:`break-word`,background:f,borderRadius:o,boxShadow:r,[`${n}-close-icon`]:{fontSize:_,cursor:`pointer`},[`${x}-message`]:{marginBottom:e.marginXS,color:d,fontSize:i,lineHeight:e.lineHeightLG},[`${x}-description`]:{fontSize:_},[`&${x}-closable ${x}-message`]:{paddingInlineEnd:e.paddingLG},[`${x}-with-icon ${x}-message`]:{marginBottom:e.marginXS,marginInlineStart:e.marginSM+b,fontSize:i},[`${x}-with-icon ${x}-description`]:{marginInlineStart:e.marginSM+b,fontSize:_},[`${x}-icon`]:{position:`absolute`,fontSize:b,lineHeight:0,[`&-success${t}`]:{color:s},[`&-info${t}`]:{color:c},[`&-warning${t}`]:{color:l},[`&-error${t}`]:{color:u}},[`${x}-close`]:{position:`absolute`,top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:`none`,width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:`flex`,alignItems:`center`,justifyContent:`center`,"&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?`transparent`:e.colorFillContent}},[`${x}-btn`]:{float:`right`,marginTop:e.marginSM}}},{[`${x}-pure-panel`]:{margin:0}}]},Zg=Rf(`Notification`,e=>{let t=e.paddingMD,n=e.paddingLG;return[Xg(Vf(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`,notificationMarginBottom:e.margin,notificationMarginEdge:e.marginLG,animationMaxHeight:150,notificationIconSize:e.fontSizeLG*e.lineHeightLG,notificationCloseButtonSize:e.controlHeightLG*.55}))]},e=>({zIndexPopup:e.zIndexPopupBase+50,width:384}));function Qg(e,t){return t||z(`span`,{class:`${e}-close-x`},[z(yh,{class:`${e}-close-icon`},null)])}z(Zh,null,null),z(Uh,null,null),z(Ch,null,null),z(qh,null,null),z(hh,null,null);var $g={success:Uh,info:Zh,error:Ch,warning:qh};function e_(e){let{prefixCls:t,icon:n,type:r,message:i,description:a,btn:o}=e,s=null;if(n)s=z(`span`,{class:`${t}-icon`},[sc(n)]);else if(r){let e=$g[r];s=z(e,{class:`${t}-icon ${t}-icon-${r}`},null)}return z(`div`,{class:W({[`${t}-with-icon`]:s}),role:`alert`},[s,z(`div`,{class:`${t}-message`},[i]),z(`div`,{class:`${t}-description`},[a]),o&&z(`div`,{class:`${t}-btn`},[o])])}function t_(e,t,n){let r;switch(t=typeof t==`number`?`${t}px`:t,n=typeof n==`number`?`${n}px`:n,e){case`top`:r={left:`50%`,transform:`translateX(-50%)`,right:`auto`,top:t,bottom:`auto`};break;case`topLeft`:r={left:0,top:t,bottom:`auto`};break;case`topRight`:r={right:0,top:t,bottom:`auto`};break;case`bottom`:r={left:`50%`,transform:`translateX(-50%)`,right:`auto`,top:`auto`,bottom:n};break;case`bottomLeft`:r={left:0,top:`auto`,bottom:n};break;default:r={right:0,top:`auto`,bottom:n};break}return r}function n_(e){return{name:`${e}-fade`}}var r_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.prefixCls||r(`notification`)),o=t=>t_(t,e.top??i_,e.bottom??i_),[,s]=Zg(a),[c,l]=vg({prefixCls:a.value,getStyles:o,getClassName:()=>W(s.value,{[`${a.value}-rtl`]:e.rtl}),motion:()=>n_(a.value),closable:!0,closeIcon:Qg(a.value),duration:a_,getContainer:()=>e.getPopupContainer?.call(e)||i.value?.call(i)||document.body,maxCount:e.maxCount,hashId:s.value,onAllRemoved:e.onAllRemoved});return n(U(U({},c),{prefixCls:a.value,hashId:s})),l}});function s_(e){let t=Zt(null),n=Symbol(`notificationHolderKey`),r=e=>{if(!t.value)return;let{open:n,prefixCls:r,hashId:i}=t.value,a=`${r}-notice`,{message:o,description:s,icon:c,type:l,btn:u,class:d}=e;return n(U(U({placement:`topRight`},r_(e,[`message`,`description`,`icon`,`type`,`btn`,`class`])),{content:()=>z(e_,{prefixCls:a,icon:typeof c==`function`?c():c,type:l,message:typeof o==`function`?o():o,description:typeof s==`function`?s():s,btn:typeof u==`function`?u():u},null),class:W(l&&`${a}-${l}`,i,d)}))},i={open:r,destroy:e=>{var n,r;e===void 0?(r=t.value)==null||r.destroy():(n=t.value)==null||n.close(e)}};return[`success`,`info`,`warning`,`error`].forEach(e=>{i[e]=t=>r(U(U({},t),{type:e}))}),[i,()=>z(o_,H(H({key:n},e),{},{ref:t}),null)]}function c_(e){return s_(e)}var l_={},u_=4.5,d_=`24px`,f_=`24px`,p_=``,m_=`topRight`,h_=()=>document.body,g_=null,__=!1,v_;function y_(e){let{duration:t,placement:n,bottom:r,top:i,getContainer:a,closeIcon:o,prefixCls:s}=e;s!==void 0&&(p_=s),t!==void 0&&(u_=t),n!==void 0&&(m_=n),r!==void 0&&(f_=typeof r==`number`?`${r}px`:r),i!==void 0&&(d_=typeof i==`number`?`${i}px`:i),a!==void 0&&(h_=a),o!==void 0&&(g_=o),e.rtl!==void 0&&(__=e.rtl),e.maxCount!==void 0&&(v_=e.maxCount)}function b_(e,t){let{prefixCls:n,placement:r=m_,getContainer:i=h_,top:a,bottom:o,closeIcon:s=g_,appContext:c}=e,{getPrefixCls:l}=F_(),u=l(`notification`,n||p_),d=`${u}-${r}-${__}`,f=l_[d];if(f){Promise.resolve(f).then(e=>{t(e)});return}let p=W(`${u}-${r}`,{[`${u}-rtl`]:__===!0});yg.newInstance({name:`notification`,prefixCls:n||p_,useStyle:Zg,class:p,style:t_(r,a??d_,o??f_),appContext:c,getContainer:i,closeIcon:e=>{let{prefixCls:t}=e;return z(`span`,{class:`${t}-close-x`},[sc(s,{},z(yh,{class:`${t}-close-icon`},null))])},maxCount:v_,hasTransitionName:!0},e=>{l_[d]=e,t(e)})}var x_={success:Dh,info:Fh,error:zh,warning:jh};function S_(e){let{icon:t,type:n,description:r,message:i,btn:a}=e,o=e.duration===void 0?u_:e.duration;b_(e,s=>{s.notice({content:e=>{let{prefixCls:o}=e,s=`${o}-notice`,c=null;if(t)c=()=>z(`span`,{class:`${s}-icon`},[sc(t)]);else if(n){let e=x_[n];c=()=>z(e,{class:`${s}-icon ${s}-icon-${n}`},null)}return z(`div`,{class:c?`${s}-with-icon`:``},[c&&c(),z(`div`,{class:`${s}-message`},[!r&&c?z(`span`,{class:`${s}-message-single-line-auto-margin`},null):null,sc(i)]),z(`div`,{class:`${s}-description`},[sc(r)]),a?z(`span`,{class:`${s}-btn`},[sc(a)]):null])},duration:o,closable:!0,onClose:e.onClose,onClick:e.onClick,key:e.key,style:e.style||{},class:e.class})})}var C_={open:S_,close(e){Object.keys(l_).forEach(t=>Promise.resolve(l_[t]).then(t=>{t.removeNotice(e)}))},config:y_,destroy(){Object.keys(l_).forEach(e=>{Promise.resolve(l_[e]).then(e=>{e.destroy()}),delete l_[e]})}};[`success`,`info`,`warning`,`error`].forEach(e=>{C_[e]=t=>C_.open(U(U({},t),{type:e}))}),C_.warn=C_.warning,C_.useNotification=c_;var w_=`-ant-${Date.now()}-${Math.random()}`;function T_(e,t){let n={},r=(e,t)=>{let n=e.clone();return n=t?.(n)||n,n.toRgbString()},i=(e,t)=>{let i=new J(e),a=sf(i.toRgbString());n[`${t}-color`]=r(i),n[`${t}-color-disabled`]=a[1],n[`${t}-color-hover`]=a[4],n[`${t}-color-active`]=a[6],n[`${t}-color-outline`]=i.clone().setAlpha(.2).toRgbString(),n[`${t}-color-deprecated-bg`]=a[0],n[`${t}-color-deprecated-border`]=a[2]};if(t.primaryColor){i(t.primaryColor,`primary`);let e=new J(t.primaryColor),a=sf(e.toRgbString());a.forEach((e,t)=>{n[`primary-${t+1}`]=e}),n[`primary-color-deprecated-l-35`]=r(e,e=>e.lighten(35)),n[`primary-color-deprecated-l-20`]=r(e,e=>e.lighten(20)),n[`primary-color-deprecated-t-20`]=r(e,e=>e.tint(20)),n[`primary-color-deprecated-t-50`]=r(e,e=>e.tint(50)),n[`primary-color-deprecated-f-12`]=r(e,e=>e.setAlpha(e.getAlpha()*.12));let o=new J(a[0]);n[`primary-color-active-deprecated-f-30`]=r(o,e=>e.setAlpha(e.getAlpha()*.3)),n[`primary-color-active-deprecated-d-02`]=r(o,e=>e.darken(2))}return t.successColor&&i(t.successColor,`success`),t.warningColor&&i(t.warningColor,`warning`),t.errorColor&&i(t.errorColor,`error`),t.infoColor&&i(t.infoColor,`info`),` + :root { + ${Object.keys(n).map(t=>`--${e}-${t}: ${n[t]};`).join(` +`)} + } + `.trim()}function E_(e,t){let n=T_(e,t);Cl()?Il(n,`${w_}-dynamic-theme`):Bl(!1,`ConfigProvider`,`SSR do not support dynamic theme with css variables.`)}var D_=e=>{let[t,n]=Zf();return gd(V(()=>({theme:t.value,token:n.value,hashId:``,path:[`ant-design-icons`,e.value]})),()=>[{[`.${e.value}`]:U(U({},Mf()),{[`.${e.value} .${e.value}-icon`]:{display:`block`}})}])};function O_(e,t){let n=V(()=>e?.value||{}),r=V(()=>n.value.inherit===!1||!t?.value?Kf:t.value);return V(()=>{if(!e?.value)return t?.value;let i=U({},r.value.components);return Object.keys(e.value.components||{}).forEach(t=>{i[t]=U(U({},i[t]),e.value.components[t])}),U(U(U({},r.value),n.value),{token:U(U({},r.value.token),n.value.token),components:i})})}var k_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{U($,M_),$.prefixCls=A_(),$.iconPrefixCls=j_(),$.getPrefixCls=(e,t)=>t||(e?`${$.prefixCls}-${e}`:$.prefixCls),$.getRootPrefixCls=()=>$.prefixCls?$.prefixCls:A_()});var N_,P_=e=>{N_&&N_(),N_=Kn(()=>{U(M_,zt(e)),U($,zt(e))}),e.theme&&E_(A_(),e.theme)},F_=()=>({getPrefixCls:(e,t)=>t||(e?`${A_()}-${e}`:A_()),getIconPrefixCls:j_,getRootPrefixCls:()=>$.prefixCls?$.prefixCls:A_()}),I_=P({compatConfig:{MODE:3},name:`AConfigProvider`,inheritAttrs:!1,props:Gc(),setup(e,t){let{slots:n}=t,r=Jc(),i=(t,n)=>{let{prefixCls:i=`ant`}=e;if(n)return n;let a=i||r.getPrefixCls(``);return t?`${a}-${t}`:a},a=V(()=>e.iconPrefixCls||r.iconPrefixCls.value||`anticon`),o=V(()=>a.value!==r.iconPrefixCls.value),s=V(()=>e.csp||r.csp?.value),c=D_(a),l=O_(V(()=>e.theme),V(()=>r.theme?.value)),u=t=>(e.renderEmpty||n.renderEmpty||r.renderEmpty||op)(t),d=V(()=>e.autoInsertSpaceInButton??r.autoInsertSpaceInButton?.value),f=V(()=>e.locale||r.locale?.value);qn(f,()=>{M_.locale=f.value},{immediate:!0});let p=V(()=>e.direction||r.direction?.value),m=V(()=>e.space??r.space?.value),h=V(()=>e.virtual??r.virtual?.value),g=V(()=>e.dropdownMatchSelectWidth??r.dropdownMatchSelectWidth?.value),_=V(()=>e.getTargetContainer===void 0?r.getTargetContainer?.value:e.getTargetContainer),v=V(()=>e.getPopupContainer===void 0?r.getPopupContainer?.value:e.getPopupContainer),y=V(()=>e.pageHeader===void 0?r.pageHeader?.value:e.pageHeader),b=V(()=>e.input===void 0?r.input?.value:e.input),x=V(()=>e.pagination===void 0?r.pagination?.value:e.pagination),S=V(()=>e.form===void 0?r.form?.value:e.form),C=V(()=>e.select===void 0?r.select?.value:e.select),w=V(()=>e.componentSize),ee=V(()=>e.componentDisabled),te=V(()=>e.wave??r.wave?.value),ne={csp:s,autoInsertSpaceInButton:d,locale:f,direction:p,space:m,virtual:h,dropdownMatchSelectWidth:g,getPrefixCls:i,iconPrefixCls:a,theme:V(()=>l.value??r.theme?.value),renderEmpty:u,getTargetContainer:_,getPopupContainer:v,pageHeader:y,input:b,pagination:x,form:S,select:C,componentSize:w,componentDisabled:ee,transformCellText:V(()=>e.transformCellText),wave:te},T=V(()=>{let e=l.value||{},{algorithm:t,token:n}=e,r=k_(e,[`algorithm`,`token`]),i=t&&(!Array.isArray(t)||t.length>0)?Wl(t):void 0;return U(U({},r),{theme:i,token:U(U({},hf),n)})}),re=V(()=>{let t={};return f.value&&(t=f.value.Form?.defaultValidateMessages||al.Form?.defaultValidateMessages||{}),e.form&&e.form.validateMessages&&(t=U(U({},t),e.form.validateMessages)),t});Yc(ne),Uc({validateMessages:re}),lp(w),Qc(ee);let ie=t=>{let r=o.value?c(n.default?.call(n)):n.default?.call(n);if(e.theme){let e=function(){return r}();r=z(Xf,{value:T.value},{default:()=>[e]})}return z(rg,{locale:f.value||t,ANT_MARK__:tg},{default:()=>[r]})};return Kn(()=>{p.value&&(qg.config({rtl:p.value===`rtl`}),C_.config({rtl:p.value===`rtl`}))}),()=>z(cl,{children:(e,t,n)=>ie(n)},null)}});I_.config=P_,I_.install=function(e){e.component(I_.name,I_)};export{Bl as $,Bt as $n,tc as $t,lp as A,zr as An,Mc as At,Mf as B,Zr as Bn,hc as Bt,im as C,P as Cn,Fc as Ct,$p as D,Oa as Dn,Ac as Dt,tm as E,N as En,zc as Et,Rf as F,Wr as Fn,bc as Ft,yd as G,Kn as Gn,Sc as Gt,uf as H,$r as Hn,fc as Ht,Nf as I,Hr as In,vc as It,gd as J,ke as Jn,pc as Jt,vd as K,Bn as Kn,Tc as Kt,If as L,xa as Ln,yc as Lt,ip as M,Vr as Mn,Dc as Mt,Zf as N,Pr as Nn,gc as Nt,em as O,On,jc as Ot,Vf as P,Br as Pn,mc as Pt,Hl as Q,Xt as Qn,Qs as Qt,Lf as R,Un as Rn,_c as Rt,nm as S,z as Sn,Nc as St,rm as T,uo as Tn,Bc as Tt,cf as U,ci as Un,Cc as Ut,Af as V,ei as Vn,xc as Vt,J as W,qn as Wn,wc as Wt,su as X,Ae as Xn,lc as Xt,cu as Y,j as Yn,uc as Yt,Wl as Z,zt as Zn,W as Zt,yh as _,Ma as _n,Jc as _t,qg as a,Eo as an,tn as ar,hl as at,lm as b,Ea as bn,Rc as bt,eg as c,Fs as cn,cl as ct,Uh as d,R as dn,al as dt,ac as en,Zt as er,Pl as et,zh as f,L as fn,rl as ft,Ch as g,V as gn,Qc as gt,Dh as h,Fa as hn,Zc as ht,c_ as i,H as in,en as ir,xl as it,ap as j,Ur as jn,Ec as jt,up as k,Nr as kn,Lc as kt,Zh as l,Wo as ln,ol as lt,jh as m,_a as mn,$c as mt,$ as n,oc as nn,cn as nr,wl as nt,Ag as o,Cs as on,Te as or,yl as ot,Fh as p,cr as pn,nl as pt,_d as q,Vn as qn,Oc as qt,C_ as r,U as rn,an as rr,Cl as rt,rg as s,Is as sn,bl as st,I_ as t,Ws as tn,A as tr,Il as tt,qh as u,js as un,sl as ut,hh as v,Da as vn,Wc as vt,am as w,Ka as wn,G as wt,sm as x,Ia as xn,Pc as xt,Z as y,La as yn,Ic as yt,jf as z,ri as zn,kc as zt}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/index-B6VCboLO.css b/backend/MiaoJiZhang.Api/wwwroot/assets/index-B6VCboLO.css new file mode 100644 index 0000000..2ff4c41 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/index-B6VCboLO.css @@ -0,0 +1 @@ +html,body{width:100%;height:100%}input::-ms-clear{display:none}input::-ms-reveal{display:none}*,:before,:after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:#0000;font-family:sans-serif;line-height:1.15}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}address{font-style:normal;line-height:inherit;margin-bottom:1em}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{text-align:left;caption-side:bottom;padding-top:.75em;padding-bottom:.3em}input,button,select,optgroup,textarea{color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner{border-style:none;padding:0}[type=button]::-moz-focus-inner{border-style:none;padding:0}[type=reset]::-moz-focus-inner{border-style:none;padding:0}[type=submit]::-moz-focus-inner{border-style:none;padding:0}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical;overflow:auto}fieldset{border:0;min-width:0;margin:0;padding:0}legend{width:100%;max-width:100%;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal;margin-bottom:.5em;padding:0;display:block}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button{height:auto}[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{background-color:#feffe6;padding:.2em} diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/index-BSN4-dIH.js b/backend/MiaoJiZhang.Api/wwwroot/assets/index-BSN4-dIH.js new file mode 100644 index 0000000..546e8d9 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/index-BSN4-dIH.js @@ -0,0 +1,363 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-Bz-m6xqH.js","assets/config-provider-q7ATIdCu.js","assets/TeamOutlined-0klbs6LP.js","assets/api-BV_Zb8mM.js","assets/Settings-CYKsnZ8p.js","assets/Configs-B71XpYgR.js","assets/SysCategories-BOgkBEQn.js","assets/EditOutlined-CeylGsUo.js","assets/Personas-DuQ1Lxau.js","assets/Avatars-C3PMIHdp.js","assets/Stickers-CJkJknEj.js","assets/Users-DYYWsaDQ.js","assets/ReloadOutlined-CVrW_3-b.js"])))=>i.map(i=>d[i]); +import{$ as e,$n as t,$t as n,A as r,An as i,At as a,B as o,Bn as s,Bt as c,C as l,Cn as u,Ct as d,D as f,Dn as p,Dt as m,E as h,En as g,Et as _,F as v,Fn as y,Ft as b,G as x,Gn as S,Gt as C,H as w,Hn as T,Ht as E,I as D,In as O,It as k,J as A,Jn as j,Jt as M,K as N,Kn as P,Kt as F,L as I,Ln as L,Lt as ee,M as te,Mn as ne,Mt as R,N as re,Nn as ie,Nt as ae,O as oe,On as z,Ot as se,P as B,Pn as V,Pt as ce,Q as le,Qn as H,Qt as ue,R as de,Rn as fe,Rt as pe,S as me,Sn as U,St as he,T as ge,Tn as _e,Tt as W,U as ve,Un as ye,Ut as be,V as xe,Vn as Se,Vt as Ce,W as we,Wn as G,Wt as Te,X as Ee,Xn as De,Xt as Oe,Y as ke,Yn as Ae,Yt as je,Z as Me,Zn as Ne,Zt as K,_ as Pe,_n as Fe,_t as Ie,a as Le,an as Re,ar as ze,at as Be,b as Ve,bn as He,bt as Ue,c as We,cn as Ge,ct as Ke,d as qe,dn as Je,dt as Ye,en as Xe,er as q,et as Ze,f as Qe,fn as $e,ft as et,g as tt,gn as J,gt as nt,h as rt,hn as it,ht as at,i as ot,in as Y,ir as st,it as ct,j as lt,jn as ut,jt as dt,k as X,kn as ft,kt as pt,l as mt,ln as ht,lt as gt,m as _t,mn as vt,mt as yt,n as bt,nn as xt,nr as St,nt as Ct,o as wt,on as Tt,or as Et,ot as Dt,p as Ot,pn as kt,pt as At,q as jt,qn as Mt,qt as Nt,r as Pt,rn as Z,rr as Ft,rt as It,s as Lt,sn as Rt,st as zt,t as Bt,tn as Vt,tr as Ht,tt as Ut,u as Wt,un as Gt,ut as Kt,v as qt,vn as Jt,vt as Yt,w as Xt,wn as Zt,wt as Qt,x as $t,xn as en,xt as Q,y as tn,yt as nn,z as rn,zn as an,zt as on}from"./config-provider-q7ATIdCu.js";import{n as sn,r as cn,t as ln}from"./EditOutlined-CeylGsUo.js";import{t as un}from"./ReloadOutlined-CVrW_3-b.js";import{t as dn}from"./TeamOutlined-0klbs6LP.js";var fn=Object.create,pn=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,hn=Object.getOwnPropertyNames,gn=Object.getPrototypeOf,_n=Object.prototype.hasOwnProperty,vn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),yn=(e,t)=>{let n={};for(var r in e)pn(n,r,{get:e[r],enumerable:!0});return t||pn(n,Symbol.toStringTag,{value:`Module`}),n},bn=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=hn(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=mn(t,s))||r.enumerable});return e},xn=(e,t,n)=>(n=e==null?{}:fn(gn(e)),bn(t||!e||!e.__esModule?pn(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Sn=(function(){if(typeof Map<`u`)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t?(n=r,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){!Cn||this.connected_||(document.addEventListener(`transitionend`,this.onTransitionEnd_),window.addEventListener(`resize`,this.refresh),An?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(`DOMSubtreeModified`,this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Cn||!this.connected_||(document.removeEventListener(`transitionend`,this.onTransitionEnd_),window.removeEventListener(`resize`,this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(`DOMSubtreeModified`,this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?``:t;kn.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||=new e,this.instance_},e.instance_=null,e}(),Mn=(function(e,t){for(var n=0,r=Object.keys(t);n`u`||!(Element instanceof Object))){if(!(e instanceof Nn(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)||(t.set(e,new Gn(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof Nn(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new Kn(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Jn=typeof WeakMap<`u`?new WeakMap:new Sn,Yn=function(){function e(t){if(!(this instanceof e))throw TypeError(`Cannot call a class as a function.`);if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);var n=new qn(t,jn.getInstance(),this);Jn.set(this,n)}return e}();[`observe`,`unobserve`,`disconnect`].forEach(function(e){Yn.prototype[e]=function(){var t;return(t=Jn.get(this))[e].apply(t,arguments)}});var Xn=(function(){return wn.ResizeObserver===void 0?Yn:wn.ResizeObserver})(),Zn=(e,t)=>{let n=Z({},e);return Object.keys(t).forEach(e=>{let r=n[e];if(r)r.type||r.default?r.default=t[e]:r.def?r.def(t[e]):n[e]={type:r,default:t[e]};else throw Error(`not have ${e} prop`)}),n},Qn=u({compatConfig:{MODE:3},name:`ResizeObserver`,props:{disabled:Boolean,onResize:Function},emits:[`resize`],setup(e,t){let{slots:n}=t,r=Ne({width:0,height:0,offsetHeight:0,offsetWidth:0}),i=null,a=null,o=()=>{a&&=(a.disconnect(),null)},s=t=>{let{onResize:n}=e,i=t[0].target,{width:a,height:o}=i.getBoundingClientRect(),{offsetWidth:s,offsetHeight:c}=i,l=Math.floor(a),u=Math.floor(o);if(r.width!==l||r.height!==u||r.offsetWidth!==s||r.offsetHeight!==c){let e={width:l,height:u,offsetWidth:s,offsetHeight:c};Z(r,e),n&&Promise.resolve().then(()=>{n(Z(Z({},e),{offsetWidth:s,offsetHeight:c}),i)})}},c=Zt(),l=()=>{let{disabled:t}=e;if(t){o();return}let n=ae(c);n!==i&&(o(),i=n),!a&&n&&(a=new Xn(s),a.observe(n))};return V(()=>{l()}),O(()=>{l()}),y(()=>{o()}),G(()=>e.disabled,()=>{l()},{flush:`post`}),()=>n.default?.call(n)[0]}}),$n=e=>setTimeout(e,16),er=e=>clearTimeout(e);typeof window<`u`&&`requestAnimationFrame`in window&&($n=e=>window.requestAnimationFrame(e),er=e=>window.cancelAnimationFrame(e));var tr=0,nr=new Map;function rr(e){nr.delete(e)}function ir(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;tr+=1;let n=tr;function r(t){if(t===0)rr(n),e();else{let e=$n(()=>{r(t-1)});nr.set(n,e)}}return r(t),n}ir.cancel=e=>{let t=nr.get(e);return rr(t),er(t)};function ar(e){let t,n=n=>()=>{t=null,e(...n)},r=function(){t??=ir(n([...arguments]))};return r.cancel=()=>{ir.cancel(t),t=null},r}var or=!1;try{let e=Object.defineProperty({},"passive",{get(){or=!0}});window.addEventListener(`testPassive`,null,e),window.removeEventListener(`testPassive`,null,e)}catch{}var sr=or;function cr(e,t,n,r){if(e&&e.addEventListener){let i=r;i===void 0&&sr&&(t===`touchstart`||t===`touchmove`||t===`wheel`)&&(i={passive:!1}),e.addEventListener(t,n,i)}return{remove:()=>{e&&e.removeEventListener&&e.removeEventListener(t,n)}}}function lr(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function ur(e,t,n){if(n!==void 0&&t.top>e.top-n)return`${n+t.top}px`}function dr(e,t,n){if(n!==void 0&&t.bottomt.target===e);n?n.affixList.push(t):(n={target:e,affixList:[t],eventHandlers:{}},pr.push(n),fr.forEach(t=>{n.eventHandlers[t]=cr(e,t,()=>{n.affixList.forEach(e=>{let{lazyUpdatePosition:t}=e.exposed;t()},(t===`touchstart`||t===`touchmove`)&&sr?{passive:!0}:!1)})}))}function hr(e){let t=pr.find(t=>{let n=t.affixList.some(t=>t===e);return n&&(t.affixList=t.affixList.filter(t=>t!==e)),n});t&&t.affixList.length===0&&(pr=pr.filter(e=>e!==t),fr.forEach(e=>{let n=t.eventHandlers[e];n&&n.remove&&n.remove()}))}var gr={};function _r(e,t){}function vr(e,t){}function yr(e,t,n){!t&&!gr[n]&&(e(!1,n),gr[n]=!0)}function br(e,t){yr(_r,e,t)}function xr(e,t){yr(vr,e,t)}function Sr(e,t){let{path:n,parentSelectors:r}=t;br(!1,`[Ant Design Vue CSS-in-JS] ${n?`Error in '${n}': `:``}${e}${r.length?` Selector info: ${r.join(` -> `)}`:``}`)}function Cr(e){return(e.match(/:not\(([^)]*)\)/)?.[1]||``).split(/(\[[^[]*])|(?=[.#])/).filter(e=>e).length>1}function wr(e){return e.parentSelectors.reduce((e,t)=>e?t.includes(`&`)?t.replace(/&/g,e):`${e} ${t}`:t,``)}var Tr=(e,t,n)=>{let r=wr(n).match(/:not\([^)]*\)/g)||[];r.length>0&&r.some(Cr)&&Sr(`Concat ':not' selector not support in legacy browsers.`,n)},Er=(e,t,n)=>{switch(e){case`marginLeft`:case`marginRight`:case`paddingLeft`:case`paddingRight`:case`left`:case`right`:case`borderLeft`:case`borderLeftWidth`:case`borderLeftStyle`:case`borderLeftColor`:case`borderRight`:case`borderRightWidth`:case`borderRightStyle`:case`borderRightColor`:case`borderTopLeftRadius`:case`borderTopRightRadius`:case`borderBottomLeftRadius`:case`borderBottomRightRadius`:Sr(`You seem to be using non-logical property '${e}' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n);return;case`margin`:case`padding`:case`borderWidth`:case`borderStyle`:if(typeof t==`string`){let r=t.split(` `).map(e=>e.trim());r.length===4&&r[1]!==r[3]&&Sr(`You seem to be using '${e}' property with different left ${e} and right ${e}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n)}return;case`clear`:case`textAlign`:(t===`left`||t===`right`)&&Sr(`You seem to be using non-logical value '${t}' of ${e}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n);return;case`borderRadius`:typeof t==`string`&&t.split(`/`).map(e=>e.trim()).reduce((e,t)=>{if(e)return e;let n=t.split(` `).map(e=>e.trim());return n.length>=2&&n[0]!==n[1]||n.length===3&&n[1]!==n[2]||n.length===4&&n[2]!==n[3]||e},!1)&&Sr(`You seem to be using non-logical value '${t}' of ${e}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n);return;default:}},Dr=(e,t,n)=>{n.parentSelectors.some(e=>e.split(`,`).some(e=>e.split(`&`).length>2))&&Sr("Should not use more than one `&` in a selector.",n)};function Or(e){if(typeof e==`number`)return[e];let t=String(e).split(/\s+/),n=``,r=0;return t.reduce((e,t)=>(t.includes(`(`)?(n+=t,r+=t.split(`(`).length-1):t.includes(`)`)?(n+=` ${t}`,r-=t.split(`)`).length-1,r===0&&(e.push(n),n=``)):r>0?n+=` ${t}`:e.push(t),e),[])}function kr(e){return e.notSplit=!0,e}var Ar={inset:[`top`,`right`,`bottom`,`left`],insetBlock:[`top`,`bottom`],insetBlockStart:[`top`],insetBlockEnd:[`bottom`],insetInline:[`left`,`right`],insetInlineStart:[`left`],insetInlineEnd:[`right`],marginBlock:[`marginTop`,`marginBottom`],marginBlockStart:[`marginTop`],marginBlockEnd:[`marginBottom`],marginInline:[`marginLeft`,`marginRight`],marginInlineStart:[`marginLeft`],marginInlineEnd:[`marginRight`],paddingBlock:[`paddingTop`,`paddingBottom`],paddingBlockStart:[`paddingTop`],paddingBlockEnd:[`paddingBottom`],paddingInline:[`paddingLeft`,`paddingRight`],paddingInlineStart:[`paddingLeft`],paddingInlineEnd:[`paddingRight`],borderBlock:kr([`borderTop`,`borderBottom`]),borderBlockStart:kr([`borderTop`]),borderBlockEnd:kr([`borderBottom`]),borderInline:kr([`borderLeft`,`borderRight`]),borderInlineStart:kr([`borderLeft`]),borderInlineEnd:kr([`borderRight`]),borderBlockWidth:[`borderTopWidth`,`borderBottomWidth`],borderBlockStartWidth:[`borderTopWidth`],borderBlockEndWidth:[`borderBottomWidth`],borderInlineWidth:[`borderLeftWidth`,`borderRightWidth`],borderInlineStartWidth:[`borderLeftWidth`],borderInlineEndWidth:[`borderRightWidth`],borderBlockStyle:[`borderTopStyle`,`borderBottomStyle`],borderBlockStartStyle:[`borderTopStyle`],borderBlockEndStyle:[`borderBottomStyle`],borderInlineStyle:[`borderLeftStyle`,`borderRightStyle`],borderInlineStartStyle:[`borderLeftStyle`],borderInlineEndStyle:[`borderRightStyle`],borderBlockColor:[`borderTopColor`,`borderBottomColor`],borderBlockStartColor:[`borderTopColor`],borderBlockEndColor:[`borderBottomColor`],borderInlineColor:[`borderLeftColor`,`borderRightColor`],borderInlineStartColor:[`borderLeftColor`],borderInlineEndColor:[`borderRightColor`],borderStartStartRadius:[`borderTopLeftRadius`],borderStartEndRadius:[`borderTopRightRadius`],borderEndStartRadius:[`borderBottomLeftRadius`],borderEndEndRadius:[`borderBottomRightRadius`]};function jr(e){return{_skip_check_:!0,value:e}}var Mr={visit:e=>{let t={};return Object.keys(e).forEach(n=>{let r=e[n],i=Ar[n];if(i&&(typeof r==`number`||typeof r==`string`)){let e=Or(r);i.length&&i.notSplit?i.forEach(e=>{t[e]=jr(r)}):i.length===1?t[i[0]]=jr(r):i.length===2?i.forEach((n,r)=>{t[n]=jr(e[r]??e[0])}):i.length===4?i.forEach((n,r)=>{t[n]=jr(e[r]??e[r-2]??e[0])}):t[n]=r}else t[n]=r}),t}},Nr=/url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;function Pr(e,t){let n=10**(t+1),r=Math.floor(e*n);return Math.round(r/10)*10/n}var Fr={Theme:le,createTheme:Me,useStyleRegister:A,useCacheToken:Ee,createCache:Be,useStyleInject:Dt,useStyleProvider:zt,Keyframes:N,extractStyle:jt,legacyLogicalPropertiesTransformer:Mr,px2remTransformer:function(){let{rootValue:e=16,precision:t=5,mediaQuery:n=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(n,r)=>{if(!r)return n;let i=parseFloat(r);return i<=1?n:`${Pr(i/e,t)}rem`};return{visit:e=>{let t=Z({},e);return Object.entries(e).forEach(e=>{let[i,a]=e;if(typeof a==`string`&&a.includes(`px`)){let e=a.replace(Nr,r);t[i]=e}!ke[i]&&typeof a==`number`&&a!==0&&(t[i]=`${a}px`.replace(Nr,r));let o=i.trim();if(o.startsWith(`@`)&&o.includes(`px`)&&n){let e=i.replace(Nr,r);t[e]=t[i],delete t[i]}}),t}}},logicalPropertiesLinter:Er,legacyNotSelectorLinter:Tr,parentSelectorLinter:Dr,StyleProvider:ct},Ir=[`blue`,`purple`,`cyan`,`green`,`magenta`,`pink`,`red`,`orange`,`yellow`,`volcano`,`geekblue`,`lime`,`gold`],Lr=e=>({color:e.colorLink,textDecoration:`none`,outline:`none`,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}}),Rr=(e,t,n,r,i)=>{let a=e/2,o=a,s=n*1/Math.sqrt(2),c=a-n*(1-1/Math.sqrt(2)),l=a-1/Math.sqrt(2)*t,u=n*(Math.sqrt(2)-1)+1/Math.sqrt(2)*t,d=2*a-l,f=u,p=2*a-s,m=c,h=2*a-0,g=o,_=a*Math.sqrt(2)+n*(Math.sqrt(2)-2),v=n*(Math.sqrt(2)-1);return{pointerEvents:`none`,width:e,height:e,overflow:`hidden`,"&::after":{content:`""`,position:`absolute`,width:_,height:_,bottom:0,insetInline:0,margin:`auto`,borderRadius:{_skip_check_:!0,value:`0 0 ${t}px 0`},transform:`translateY(50%) rotate(-135deg)`,boxShadow:i,zIndex:0,background:`transparent`},"&::before":{position:`absolute`,bottom:0,insetInlineStart:0,width:e,height:e/2,background:r,clipPath:{_multi_value_:!0,value:[`polygon(${v}px 100%, 50% ${v}px, ${2*a-v}px 100%, ${v}px 100%)`,`path('M 0 ${o} A ${n} ${n} 0 0 0 ${s} ${c} L ${l} ${u} A ${t} ${t} 0 0 1 ${d} ${f} L ${p} ${m} A ${n} ${n} 0 0 0 ${h} ${g} Z')`]},content:`""`}}};function zr(e,t){return Ir.reduce((n,r)=>{let i=e[`${r}-1`],a=e[`${r}-3`],o=e[`${r}-6`],s=e[`${r}-7`];return Z(Z({},n),t(r,{lightColor:i,lightBorderColor:a,darkColor:o,textColor:s}))},{})}function Br(e,t){let n=Z({},e);for(let e=0;e{let{componentCls:t}=e;return{[t]:{position:`fixed`,zIndex:e.zIndexPopup}}},Hr=v(`Affix`,e=>[Vr(B(e,{zIndexPopup:e.zIndexBase+10}))]);function Ur(){return typeof window<`u`?window:null}var Wr;(function(e){e[e.None=0]=`None`,e[e.Prepare=1]=`Prepare`})(Wr||={});var Gr=a(u({compatConfig:{MODE:3},name:`AAffix`,inheritAttrs:!1,props:{offsetTop:Number,offsetBottom:Number,target:{type:Function,default:Ur},prefixCls:String,onChange:Function,onTestUpdatePosition:Function},setup(e,t){let{slots:n,emit:r,expose:i,attrs:a}=t,o=q(),s=q(),c=Ne({affixStyle:void 0,placeholderStyle:void 0,status:Wr.None,lastAffix:!1,prevTarget:null,timeout:null}),l=Zt(),u=J(()=>e.offsetBottom===void 0&&e.offsetTop===void 0?0:e.offsetTop),d=J(()=>e.offsetBottom),f=()=>{let{status:t,lastAffix:n}=c,{target:i}=e;if(t!==Wr.Prepare||!s.value||!o.value||!i)return;let a=i();if(!a)return;let l={status:Wr.None},f=lr(o.value);if(f.top===0&&f.left===0&&f.width===0&&f.height===0)return;let p=lr(a),m=ur(f,p,u.value),h=dr(f,p,d.value);if(!(f.top===0&&f.left===0&&f.width===0&&f.height===0)){if(m!==void 0){let e=`${f.width}px`,t=`${f.height}px`;l.affixStyle={position:`fixed`,top:m,width:e,height:t},l.placeholderStyle={width:e,height:t}}else if(h!==void 0){let e=`${f.width}px`,t=`${f.height}px`;l.affixStyle={position:`fixed`,bottom:h,width:e,height:t},l.placeholderStyle={width:e,height:t}}l.lastAffix=!!l.affixStyle,n!==l.lastAffix&&r(`change`,l.lastAffix),Z(c,l)}},p=()=>{Z(c,{status:Wr.Prepare,affixStyle:void 0,placeholderStyle:void 0})},m=ar(()=>{p()}),h=ar(()=>{let{target:t}=e,{affixStyle:n}=c;if(t&&n){let e=t();if(e&&o.value){let t=lr(e),r=lr(o.value),i=ur(r,t,u.value),a=dr(r,t,d.value);if(i!==void 0&&n.top===i||a!==void 0&&n.bottom===a)return}}p()});i({updatePosition:m,lazyUpdatePosition:h}),G(()=>e.target,e=>{let t=e?.()||null;c.prevTarget!==t&&(hr(l),t&&(mr(t,l),m()),c.prevTarget=t)}),G(()=>[e.offsetTop,e.offsetBottom],m),V(()=>{let{target:t}=e;t&&(c.timeout=setTimeout(()=>{mr(t(),l),m()}))}),O(()=>{f()}),y(()=>{clearTimeout(c.timeout),hr(l),m.cancel(),h.cancel()});let{prefixCls:g}=X(`affix`,e),[_,v]=Hr(g);return()=>{let{affixStyle:t,placeholderStyle:r,status:i}=c,l=K({[g.value]:t,[v.value]:!0}),u=Br(e,[`prefixCls`,`offsetTop`,`offsetBottom`,`target`,`onChange`,`onTestUpdatePosition`]);return _(U(Qn,{onResize:m},{default:()=>[U(`div`,Y(Y(Y({},u),a),{},{ref:o,"data-measure-status":i}),[t&&U(`div`,{style:r,"aria-hidden":`true`},null),U(`div`,{class:l,ref:s,style:t},[n.default?.call(n)])])]}))}}}));function Kr(e){return typeof e==`object`&&!!e&&e.nodeType===1}function qr(e,t){return(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`}function Jr(e,t){if(e.clientHeightt||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0}var Xr=function(e,t){var n=window,r=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,c=typeof o==`function`?o:function(e){return e!==o};if(!Kr(e))throw TypeError(`Invalid target`);for(var l,u=document.scrollingElement||document.documentElement,d=[],f=e;Kr(f)&&c(f);){if((f=(l=f).parentElement??(l.getRootNode().host||null))===u){d.push(f);break}f!=null&&f===document.body&&Jr(f)&&!Jr(document.documentElement)||f!=null&&Jr(f,s)&&d.push(f)}for(var p=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,h=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,_=e.getBoundingClientRect(),v=_.height,y=_.width,b=_.top,x=_.right,S=_.bottom,C=_.left,w=i===`start`||i===`nearest`?b:i===`end`?S:b+v/2,T=a===`center`?C+y/2:a===`end`?x:C,E=[],D=0;D=0&&C>=0&&S<=m&&x<=p&&b>=M&&S<=P&&C>=F&&x<=N)return E;var I=getComputedStyle(O),L=parseInt(I.borderLeftWidth,10),ee=parseInt(I.borderTopWidth,10),te=parseInt(I.borderRightWidth,10),ne=parseInt(I.borderBottomWidth,10),R=0,re=0,ie=`offsetWidth`in O?O.offsetWidth-O.clientWidth-L-te:0,ae=`offsetHeight`in O?O.offsetHeight-O.clientHeight-ee-ne:0,oe=`offsetWidth`in O?O.offsetWidth===0?0:j/O.offsetWidth:0,z=`offsetHeight`in O?O.offsetHeight===0?0:A/O.offsetHeight:0;if(u===O)R=i===`start`?w:i===`end`?w-m:i===`nearest`?Yr(g,g+m,m,ee,ne,g+w,g+w+v,v):w-m/2,re=a===`start`?T:a===`center`?T-p/2:a===`end`?T-p:Yr(h,h+p,p,L,te,h+T,h+T+y,y),R=Math.max(0,R+g),re=Math.max(0,re+h);else{R=i===`start`?w-M-ee:i===`end`?w-P+ne+ae:i===`nearest`?Yr(M,P,A,ee,ne+ae,w,w+v,v):w-(M+A/2)+ae/2,re=a===`start`?T-F-L:a===`center`?T-(F+j/2)+ie/2:a===`end`?T-N+te+ie:Yr(F,N,j,L,te+ie,T,T+y,y);var se=O.scrollLeft,B=O.scrollTop;w+=B-(R=Math.max(0,Math.min(B+R/z,O.scrollHeight-A/z+ae))),T+=se-(re=Math.max(0,Math.min(se+re/oe,O.scrollWidth-j/oe+ie)))}E.push({el:O,top:R,left:re})}return E};function Zr(e){return e===Object(e)&&Object.keys(e).length!==0}function Qr(e,t){t===void 0&&(t=`auto`);var n=`scrollBehavior`in document.body.style;e.forEach(function(e){var r=e.el,i=e.top,a=e.left;r.scroll&&n?r.scroll({top:i,left:a,behavior:t}):(r.scrollTop=i,r.scrollLeft=a)})}function $r(e){return e===!1?{block:`end`,inline:`nearest`}:Zr(e)?e:{block:`start`,inline:`nearest`}}function ei(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(Zr(t)&&typeof t.behavior==`function`)return t.behavior(n?Xr(e,t):[]);if(n){var r=$r(t);return Qr(Xr(e,r),r.behavior)}}function ti(e,t,n,r){let i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function ni(e){return e!=null&&e===e.window}function ri(e,t){if(typeof window>`u`)return 0;let n=t?`scrollTop`:`scrollLeft`,r=0;return ni(e)?r=e[t?`scrollY`:`scrollX`]:e instanceof Document?r=e.documentElement[n]:(e instanceof HTMLElement||e)&&(r=e[n]),e&&!ni(e)&&typeof r!=`number`&&(r=(e.ownerDocument??e).documentElement?.[n]),r}function ii(e){let{getContainer:t=()=>window,callback:n,duration:r=450}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t(),a=ri(i,!0),o=Date.now(),s=()=>{let t=Date.now()-o,c=ti(t>r?r:t,a,e,r);ni(i)?i.scrollTo(window.scrollX,c):i instanceof Document?i.documentElement.scrollTop=c:i.scrollTop=c,t{fe(oi,e)},ci=()=>g(oi,{registerLink:ai,unregisterLink:ai,scrollTo:ai,activeLink:J(()=>``),handleClick:ai,direction:J(()=>`vertical`)}),li=e=>{let{componentCls:t,holderOffsetBlock:n,motionDurationSlow:r,lineWidthBold:i,colorPrimary:a,lineType:o,colorSplit:s}=e;return{[`${t}-wrapper`]:{marginBlockStart:-n,paddingBlockStart:n,backgroundColor:`transparent`,[t]:Z(Z({},rn(e)),{position:`relative`,paddingInlineStart:i,[`${t}-link`]:{paddingBlock:e.anchorPaddingBlock,paddingInline:`${e.anchorPaddingInline}px 0`,"&-title":Z(Z({},xe),{position:`relative`,display:`block`,marginBlockEnd:e.anchorTitleBlock,color:e.colorText,transition:`all ${e.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${t}-link-title`]:{color:e.colorPrimary},[`${t}-link`]:{paddingBlock:e.anchorPaddingBlockSecondary}}}),[`&:not(${t}-wrapper-horizontal)`]:{[t]:{"&::before":{position:`absolute`,left:{_skip_check_:!0,value:0},top:0,height:`100%`,borderInlineStart:`${i}px ${o} ${s}`,content:`" "`},[`${t}-ink`]:{position:`absolute`,left:{_skip_check_:!0,value:0},display:`none`,transform:`translateY(-50%)`,transition:`top ${r} ease-in-out`,width:i,backgroundColor:a,[`&${t}-ink-visible`]:{display:`inline-block`}}}},[`${t}-fixed ${t}-ink ${t}-ink`]:{display:`none`}}}},ui=e=>{let{componentCls:t,motionDurationSlow:n,lineWidthBold:r,colorPrimary:i}=e;return{[`${t}-wrapper-horizontal`]:{position:`relative`,"&::before":{position:`absolute`,left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`1px ${e.lineType} ${e.colorSplit}`,content:`" "`},[t]:{overflowX:`scroll`,position:`relative`,display:`flex`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`},[`${t}-link:first-of-type`]:{paddingInline:0},[`${t}-ink`]:{position:`absolute`,bottom:0,transition:`left ${n} ease-in-out, width ${n} ease-in-out`,height:r,backgroundColor:i}}}}},di=v(`Anchor`,e=>{let{fontSize:t,fontSizeLG:n,padding:r,paddingXXS:i}=e,a=B(e,{holderOffsetBlock:i,anchorPaddingBlock:i,anchorPaddingBlockSecondary:i/2,anchorPaddingInline:r,anchorTitleBlock:t/14*3,anchorBallSize:n/2});return[li(a),ui(a)]}),fi=u({compatConfig:{MODE:3},name:`AAnchorLink`,inheritAttrs:!1,props:Zn({prefixCls:String,href:String,title:nn(),target:String,customTitleProps:Qt()},{href:`#`}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,i=null,{handleClick:a,scrollTo:o,unregisterLink:s,registerLink:c,activeLink:l}=ci(),{prefixCls:u}=X(`anchor`,e),d=t=>{let{href:n}=e;a(t,{title:i,href:n}),o(n)};return G(()=>e.href,(e,t)=>{z(()=>{s(t),c(e)})}),V(()=>{c(e.href)}),ut(()=>{s(e.href)}),()=>{let{href:t,target:a,title:o=n.title,customTitleProps:s={}}=e,c=u.value;i=typeof o==`function`?o(s):o;let f=l.value===t,p=K(`${c}-link`,{[`${c}-link-active`]:f},r.class),m=K(`${c}-link-title`,{[`${c}-link-title-active`]:f});return U(`div`,Y(Y({},r),{},{class:p}),[U(`a`,{class:m,href:t,title:typeof i==`string`?i:``,target:a,onClick:d},[n.customTitle?n.customTitle(s):i]),n.default?.call(n)])}}}),pi=((e,t,n)=>{br(e,`[ant-design-vue: ${t}] ${n}`)});function mi(){return window}function hi(e,t){if(!e.getClientRects().length)return 0;let n=e.getBoundingClientRect();return n.width||n.height?t===window?(t=e.ownerDocument.documentElement,n.top-t.clientTop):n.top-t.getBoundingClientRect().top:n.top}var gi=/#([\S ]+)$/,_i=u({compatConfig:{MODE:3},name:`AAnchor`,inheritAttrs:!1,props:{prefixCls:String,offsetTop:Number,bounds:Number,affix:{type:Boolean,default:!0},showInkInFixed:{type:Boolean,default:!1},getContainer:Function,wrapperClass:String,wrapperStyle:{type:Object,default:void 0},getCurrentAnchor:Function,targetOffset:Number,items:Ue(),direction:f.oneOf([`vertical`,`horizontal`]).def(`vertical`),onChange:Function,onClick:Function},setup(e,t){let{emit:n,attrs:r,slots:i,expose:a}=t,{prefixCls:o,getTargetContainer:s,direction:c}=X(`anchor`,e),l=J(()=>e.direction??`vertical`),u=H(null),d=H(),f=Ne({links:[],scrollContainer:null,scrollEvent:null,animating:!1}),p=H(null),m=J(()=>{let{getContainer:t}=e;return t||s?.value||mi}),h=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5,n=[],r=m.value();return f.links.forEach(i=>{let a=gi.exec(i.toString());if(!a)return;let o=document.getElementById(a[1]);if(o){let a=hi(o,r);at.top>e.top?t:e).link:``},g=t=>{let{getCurrentAnchor:r}=e;p.value!==t&&(p.value=typeof r==`function`?r(t):t,n(`change`,t))},_=t=>{let{offsetTop:n,targetOffset:r}=e;g(t);let i=gi.exec(t);if(!i)return;let a=document.getElementById(i[1]);if(!a)return;let o=m.value(),s=ri(o,!0)+hi(a,o);s-=r===void 0?n||0:r,f.animating=!0,ii(s,{callback:()=>{f.animating=!1},getContainer:m.value})};a({scrollTo:_});let v=()=>{if(f.animating)return;let{offsetTop:t,bounds:n,targetOffset:r}=e,i=h(r===void 0?t||0:r,n);g(i)},y=()=>{let e=d.value.querySelector(`.${o.value}-link-title-active`);if(e&&u.value){let t=l.value===`horizontal`;u.value.style.top=t?``:`${e.offsetTop+e.clientHeight/2}px`,u.value.style.height=t?``:`${e.clientHeight}px`,u.value.style.left=t?`${e.offsetLeft}px`:``,u.value.style.width=t?`${e.clientWidth}px`:``,t&&ei(e,{scrollMode:`if-needed`,block:`nearest`})}};si({registerLink:e=>{f.links.includes(e)||f.links.push(e)},unregisterLink:e=>{let t=f.links.indexOf(e);t!==-1&&f.links.splice(t,1)},activeLink:p,scrollTo:_,handleClick:(e,t)=>{n(`click`,e,t)},direction:l}),V(()=>{z(()=>{let e=m.value();f.scrollContainer=e,f.scrollEvent=cr(f.scrollContainer,`scroll`,v),v()})}),ut(()=>{f.scrollEvent&&f.scrollEvent.remove()}),O(()=>{if(f.scrollEvent){let e=m.value();f.scrollContainer!==e&&(f.scrollContainer=e,f.scrollEvent.remove(),f.scrollEvent=cr(f.scrollContainer,`scroll`,v),v())}y()});let b=e=>Array.isArray(e)?e.map(e=>{let{children:t,key:n,href:r,target:a,class:o,style:s,title:c}=e;return U(fi,{key:n,href:r,target:a,class:o,style:s,title:c,customTitleProps:e},{default:()=>[l.value===`vertical`?b(t):null],customTitle:i.customTitle})}):null,[x,S]=di(o);return()=>{let{offsetTop:t,affix:n,showInkInFixed:a}=e,s=o.value,f=K(`${s}-ink`,{[`${s}-ink-visible`]:p.value}),h=K(S.value,e.wrapperClass,`${s}-wrapper`,{[`${s}-wrapper-horizontal`]:l.value===`horizontal`,[`${s}-rtl`]:c.value===`rtl`}),g=K(s,{[`${s}-fixed`]:!n&&!a}),_=U(`div`,{class:h,style:Z({maxHeight:t?`calc(100vh - ${t}px)`:`100vh`},e.wrapperStyle),ref:d},[U(`div`,{class:g},[U(`span`,{class:f,ref:u},null),Array.isArray(e.items)?b(e.items):i.default?.call(i)])]);return x(n?U(Gr,Y(Y({},r),{},{offsetTop:t,target:m.value}),{default:()=>[_]}):_)}}});_i.Link=fi,_i.install=function(e){return e.component(_i.name,_i),e.component(_i.Link.name,_i.Link),e};var vi=_i;function yi(e,t){let{key:n}=e,r;return`value`in e&&({value:r}=e),n??(r===void 0?`rc-index-key-${t}`:r)}function bi(e,t){let{label:n,value:r,options:i}=e||{};return{label:n||(t?`children`:`label`),value:r||`value`,options:i||`options`}}function xi(e){let{fieldNames:t,childrenAsData:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],{label:i,value:a,options:o}=bi(t,!1);function s(e,t){e.forEach(e=>{let c=e[i];if(t||!(o in e)){let n=e[a];r.push({key:yi(e,r.length),groupOption:t,data:e,label:c,value:n})}else{let t=c;t===void 0&&n&&(t=e.label),r.push({key:yi(e,r.length),group:!0,data:e,label:t}),s(e[o],!0)}})}return s(e,!1),r}function Si(e){let t=Z({},e);return`props`in t||Object.defineProperty(t,"props",{get(){return t}}),t}function Ci(e,t){if(!t||!t.length)return null;let n=!1;function r(e,t){let[i,...a]=t;if(!i)return[e];let o=e.split(i);return n||=o.length>1,o.reduce((e,t)=>[...e,...r(t,a)],[]).filter(e=>e)}let i=r(e,t);return n?i:null}function wi(){return``}function Ti(e){return e?e.ownerDocument:window.document}function Ei(){}var Di=()=>({action:f.oneOfType([f.string,f.arrayOf(f.string)]).def([]),showAction:f.any.def([]),hideAction:f.any.def([]),getPopupClassNameFromAlign:f.any.def(wi),onPopupVisibleChange:Function,afterPopupVisibleChange:f.func.def(Ei),popup:f.any,arrow:f.bool.def(!0),popupStyle:{type:Object,default:void 0},prefixCls:f.string.def(`rc-trigger-popup`),popupClassName:f.string.def(``),popupPlacement:String,builtinPlacements:f.object,popupTransitionName:String,popupAnimation:f.any,mouseEnterDelay:f.number.def(0),mouseLeaveDelay:f.number.def(.1),zIndex:Number,focusDelay:f.number.def(0),blurDelay:f.number.def(.15),getPopupContainer:Function,getDocument:f.func.def(Ti),forceRender:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:!1},mask:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},popupAlign:f.object.def(()=>({})),popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},maskTransitionName:String,maskAnimation:String,stretch:String,alignPoint:{type:Boolean,default:void 0},autoDestroy:{type:Boolean,default:!1},mobile:Object,getTriggerDOMNode:Function}),Oi={visible:Boolean,prefixCls:String,zIndex:Number,destroyPopupOnHide:Boolean,forceRender:Boolean,arrow:{type:Boolean,default:!0},animation:[String,Object],transitionName:String,stretch:{type:String},align:{type:Object},point:{type:Object},getRootDomNode:{type:Function},getClassNameFromAlign:{type:Function},onAlign:{type:Function},onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function},onTouchstart:{type:Function}},ki=Z(Z({},Oi),{mobile:{type:Object}}),Ai=Z(Z({},Oi),{mask:Boolean,mobile:{type:Object},maskAnimation:String,maskTransitionName:String});function ji(e){let{prefixCls:t,visible:n,zIndex:r,mask:i,maskAnimation:a,maskTransitionName:o}=e;if(!i)return null;let s={};return(o||a)&&(s=h({prefixCls:t,transitionName:o,animation:a})),U(Re,Y({appear:!0},s),{default:()=>[Mt(U(`div`,{style:{zIndex:r},class:`${t}-mask`},null),[[Se(`if`),n]])]})}ji.displayName=`Mask`;var Mi=u({compatConfig:{MODE:3},name:`MobilePopupInner`,inheritAttrs:!1,props:ki,emits:[`mouseenter`,`mouseleave`,`mousedown`,`touchstart`,`align`],setup(e,t){let{expose:n,slots:r}=t,i=H();return n({forceAlign:()=>{},getElement:()=>i.value}),()=>{let{zIndex:t,visible:n,prefixCls:a,mobile:{popupClassName:o,popupStyle:s,popupMotion:c={},popupRender:l}={}}=e,u=Z({zIndex:t},s),d=ce(r.default?.call(r));d.length>1&&(d=U(`div`,{class:`${a}-content`},[d])),l&&(d=l(d));let f=K(a,o);return U(Re,Y({ref:i},c),{default:()=>[n?U(`div`,{class:f,style:u},[d]):null]})}}}),Ni=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Pi=[`measure`,`align`,null,`motion`],Fi=((e,t)=>{let n=q(null),r=q(),i=q(!1);function a(e){i.value||(n.value=e)}function o(){ir.cancel(r.value)}function s(e){o(),r.value=ir(()=>{let t=n.value;switch(n.value){case`align`:t=`motion`;break;case`motion`:t=`stable`;break;default:}a(t),e?.()})}return G(e,()=>{a(`measure`)},{immediate:!0,flush:`post`}),V(()=>{G(n,()=>{switch(n.value){case`measure`:t();break;default:}n.value&&(r.value=ir(()=>Ni(void 0,void 0,void 0,function*(){let e=Pi.indexOf(n.value),t=Pi[e+1];t&&e!==-1&&a(t)})))},{immediate:!0,flush:`post`})}),ut(()=>{i.value=!0,o()}),[n,s]}),Ii=(e=>{let t=q({width:0,height:0});function n(e){t.value={width:e.offsetWidth,height:e.offsetHeight}}return[J(()=>{let n={};if(e.value){let{width:r,height:i}=t.value;e.value.indexOf(`height`)!==-1&&i?n.height=`${i}px`:e.value.indexOf(`minHeight`)!==-1&&i&&(n.minHeight=`${i}px`),e.value.indexOf(`width`)!==-1&&r?n.width=`${r}px`:e.value.indexOf(`minWidth`)!==-1&&r&&(n.minWidth=`${r}px`)}return n}),n]});function Li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Ua(e,t,n,r){var i=La.clone(e),a={width:t.width,height:t.height};return r.adjustX&&i.left=n.left&&i.left+a.width>n.right&&(a.width-=i.left+a.width-n.right),r.adjustX&&i.left+a.width>n.right&&(i.left=Math.max(n.right-a.width,n.left)),r.adjustY&&i.top=n.top&&i.top+a.height>n.bottom&&(a.height-=i.top+a.height-n.bottom),r.adjustY&&i.top+a.height>n.bottom&&(i.top=Math.max(n.bottom-a.height,n.top)),La.mix(i,a)}function Wa(e){var t,n,r;if(!La.isWindow(e)&&e.nodeType!==9)t=La.offset(e),n=La.outerWidth(e),r=La.outerHeight(e);else{var i=La.getWindow(e);t={left:La.getWindowScrollLeft(i),top:La.getWindowScrollTop(i)},n=La.viewportWidth(i),r=La.viewportHeight(i)}return t.width=n,t.height=r,t}function Ga(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,a=e.height,o=e.left,s=e.top;return n===`c`?s+=a/2:n===`b`&&(s+=a),r===`c`?o+=i/2:r===`r`&&(o+=i),{left:o,top:s}}function Ka(e,t,n,r,i){var a=Ga(t,n[1]),o=Ga(e,n[0]),s=[o.left-a.left,o.top-a.top];return{left:Math.round(e.left-s[0]+r[0]-i[0]),top:Math.round(e.top-s[1]+r[1]-i[1])}}function qa(e,t,n){return e.leftn.right}function Ja(e,t,n){return e.topn.bottom}function Ya(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.right||r.top>=n.bottom}function ro(e,t,n){var r=n.target||t;return to(e,Wa(r),n,!no(r,n.overflow&&n.overflow.alwaysByViewport))}ro.__getOffsetParent=za,ro.__getVisibleRectForElement=Ha;function io(e,t,n){var r,i,a=La.getDocument(e),o=a.defaultView||a.parentWindow,s=La.getWindowScrollLeft(o),c=La.getWindowScrollTop(o),l=La.viewportWidth(o),u=La.viewportHeight(o);r=`pageX`in t?t.pageX:s+t.clientX,i=`pageY`in t?t.pageY:c+t.clientY;var d={left:r,top:i,width:0,height:0},f=r>=0&&r<=s+l&&i>=0&&i<=c+u,p=[n.points[0],`cc`];return to(e,d,Ri(Ri({},n),{},{points:p}),f)}function ao(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0&&arguments[3],a=t;if(Array.isArray(t)&&(a=dt(t)[0]),!a)return null;let o=it(a,n,i);return o.props=r?Z(Z({},o.props),n):o.props,e(typeof o.props.class!=`object`,`class must be string`),o}function oo(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e.map(e=>ao(e,t,n))}function so(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(Array.isArray(e))return e.map(e=>so(e,t,n,r));{if(!p(e))return e;let i=ao(e,t,n,r);return Array.isArray(i.children)&&(i.children=so(i.children)),i}}function co(e,t,n){Ge(it(e,Z({},t)),n)}var lo=e=>(e||[]).some(e=>!p(e)||!(e.type===Je||e.type===$e&&!lo(e.children)))?e:null;function uo(e,t,n,r){let i=e[t]?.call(e,n);return lo(i)?i:r?.()}var fo=(e=>{if(!e)return!1;if(e.offsetParent)return!0;if(e.getBBox){let t=e.getBBox();if(t.width||t.height)return!0}if(e.getBoundingClientRect){let t=e.getBoundingClientRect();if(t.width||t.height)return!0}return!1});function po(e,t){return e===t?!0:!e||!t?!1:`pageX`in t&&`pageY`in t?e.pageX===t.pageX&&e.pageY===t.pageY:`clientX`in t&&`clientY`in t&&e.clientX===t.clientX&&e.clientY===t.clientY}function mo(e,t){e!==document.activeElement&&Ct(t,e)&&typeof e.focus==`function`&&e.focus()}function ho(e,t){let n=null,r=null;function i(e){let[{target:i}]=e;if(!document.documentElement.contains(i))return;let{width:a,height:o}=i.getBoundingClientRect(),s=Math.floor(a),c=Math.floor(o);(n!==s||r!==c)&&Promise.resolve().then(()=>{t({width:s,height:c})}),n=s,r=c}let a=new Xn(i);return e&&a.observe(e),()=>{a.disconnect()}}var go=((e,t)=>{let n=!1,r=null;function i(){clearTimeout(r)}function a(o){if(!n||o===!0){if(e()===!1)return;n=!0,i(),r=setTimeout(()=>{n=!1},t.value)}else i(),r=setTimeout(()=>{n=!1,a()},t.value)}return[a,()=>{n=!1,i()}]});function _o(){this.__data__=[],this.size=0}function vo(e,t){return e===t||e!==e&&t!==t}function yo(e,t){for(var n=e.length;n--;)if(vo(e[n][0],t))return n;return-1}var bo=Array.prototype.splice;function xo(e){var t=this.__data__,n=yo(t,e);return n<0?!1:(n==t.length-1?t.pop():bo.call(t,n,1),--this.size,!0)}function So(e){var t=this.__data__,n=yo(t,e);return n<0?void 0:t[n][1]}function Co(e){return yo(this.__data__,e)>-1}function wo(e,t){var n=this.__data__,r=yo(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function To(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Hs?new Rs:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=Nc}var Fc=`[object Arguments]`,Ic=`[object Array]`,Lc=`[object Boolean]`,Rc=`[object Date]`,zc=`[object Error]`,Bc=`[object Function]`,Vc=`[object Map]`,Hc=`[object Number]`,Uc=`[object Object]`,Wc=`[object RegExp]`,Gc=`[object Set]`,Kc=`[object String]`,qc=`[object WeakMap]`,Jc=`[object ArrayBuffer]`,Yc=`[object DataView]`,Xc=`[object Float32Array]`,Zc=`[object Float64Array]`,Qc=`[object Int8Array]`,$c=`[object Int16Array]`,el=`[object Int32Array]`,tl=`[object Uint8Array]`,nl=`[object Uint8ClampedArray]`,rl=`[object Uint16Array]`,il=`[object Uint32Array]`,al={};al[Xc]=al[Zc]=al[Qc]=al[$c]=al[el]=al[tl]=al[nl]=al[rl]=al[il]=!0,al[Fc]=al[Ic]=al[Jc]=al[Lc]=al[Yc]=al[Rc]=al[zc]=al[Bc]=al[Vc]=al[Hc]=al[Uc]=al[Wc]=al[Gc]=al[Kc]=al[qc]=!1;function ol(e){return vc(e)&&Pc(e.length)&&!!al[Wo(e)]}function sl(e){return function(t){return e(t)}}var cl=typeof exports==`object`&&exports&&!exports.nodeType&&exports,ll=cl&&typeof module==`object`&&module&&!module.nodeType&&module,ul=ll&&ll.exports===cl&&Ao.process,dl=function(){try{return ll&&ll.require&&ll.require(`util`).types||ul&&ul.binding&&ul.binding(`util`)}catch{}}(),fl=dl&&dl.isTypedArray,pl=fl?sl(fl):ol,ml=Object.prototype.hasOwnProperty;function hl(e,t){var n=uc(e),r=!n&&wc(e),i=!n&&!r&&kc(e),a=!n&&!r&&!i&&pl(e),o=n||r||i||a,s=o?_c(e.length,String):[],c=s.length;for(var l in e)(t||ml.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Mc(l,c)))&&s.push(l);return s}var gl=Object.prototype;function _l(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||gl)}function vl(e,t){return function(n){return e(t(n))}}var yl=vl(Object.keys,Object),bl=Object.prototype.hasOwnProperty;function xl(e){if(!_l(e))return yl(e);var t=[];for(var n in Object(e))bl.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Sl(e){return e!=null&&Pc(e.length)&&!Xo(e)}function Cl(e){return Sl(e)?hl(e):xl(e)}function wl(e){return dc(e,Cl,gc)}var Tl=1,El=Object.prototype.hasOwnProperty;function Dl(e,t,n,r,i,a){var o=n&Tl,s=wl(e),c=s.length;if(c!=wl(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:El.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l{let{disabled:t,target:n,align:r,onAlign:o}=e;if(!t&&n&&a.value){let e=a.value,t,s=eu(n),c=tu(n);i.value.element=s,i.value.point=c,i.value.align=r;let{activeElement:l}=document;return s&&fo(s)?t=ro(e,s,r):c&&(t=io(e,c,r)),mo(l,e),o&&t&&o(e,t),!0}return!1},J(()=>e.monitorBufferTime)),c=H({cancel:()=>{}}),l=H({cancel:()=>{}}),u=()=>{let t=e.target,n=eu(t),r=tu(t);a.value!==l.value.element&&(l.value.cancel(),l.value.element=a.value,l.value.cancel=ho(a.value,o)),(i.value.element!==n||!po(i.value.point,r)||!Ql(i.value.align,e.align))&&(o(),c.value.element!==n&&(c.value.cancel(),c.value.element=n,c.value.cancel=ho(n,o)))};V(()=>{z(()=>{u()})}),O(()=>{z(()=>{u()})}),G(()=>e.disabled,e=>{e?s():o()},{immediate:!0,flush:`post`});let d=H(null);return G(()=>e.monitorWindowResize,e=>{e?d.value||=cr(window,`resize`,o):d.value&&=(d.value.remove(),null)},{flush:`post`}),y(()=>{c.value.cancel(),l.value.cancel(),d.value&&d.value.remove(),s()}),n({forceAlign:()=>o(!0)}),()=>{let e=r?.default();return e?ao(e[0],{ref:a},!0,!0):null}}}),ru=u({compatConfig:{MODE:3},name:`PopupInner`,inheritAttrs:!1,props:Oi,emits:[`mouseenter`,`mouseleave`,`mousedown`,`touchstart`,`align`],setup(e,t){let{expose:n,attrs:r,slots:i}=t,a=q(),o=q(),s=q(),[c,l]=Ii(St(e,`stretch`)),u=()=>{e.stretch&&l(e.getRootDomNode())},d=q(!1),f;G(()=>e.visible,t=>{clearTimeout(f),t?f=setTimeout(()=>{d.value=e.visible}):d.value=!1},{immediate:!0});let[p,m]=Fi(d,u),g=q(),_=()=>e.point?e.point:e.getRootDomNode,v=()=>{var e;(e=a.value)==null||e.forceAlign()},y=(t,n)=>{var r;let i=e.getClassNameFromAlign(n),a=s.value;s.value!==i&&(s.value=i),p.value===`align`&&(a===i?m(()=>{var e;(e=g.value)==null||e.call(g)}):Promise.resolve().then(()=>{v()}),(r=e.onAlign)==null||r.call(e,t,n))},b=J(()=>{let t=typeof e.animation==`object`?e.animation:h(e);return[`onAfterEnter`,`onAfterLeave`].forEach(e=>{let n=t[e];t[e]=e=>{m(),p.value=`stable`,n?.(e)}}),t}),x=()=>new Promise(e=>{g.value=e});G([b,p],()=>{!b.value&&p.value===`motion`&&m()},{immediate:!0}),n({forceAlign:v,getElement:()=>o.value.$el||o.value});let S=J(()=>!(e.align?.points&&(p.value===`align`||p.value===`stable`)));return()=>{let{zIndex:t,align:n,prefixCls:l,destroyPopupOnHide:u,onMouseenter:f,onMouseleave:m,onTouchstart:h=()=>{},onMousedown:g}=e,v=p.value,C=[Z(Z({},c.value),{zIndex:t,opacity:v===`motion`||v===`stable`||!d.value?null:0,pointerEvents:!d.value&&v!==`stable`?`none`:null}),r.style],w=ce(i.default?.call(i,{visible:e.visible}));w.length>1&&(w=U(`div`,{class:`${l}-content`},[w]));let T=K(l,r.class,s.value,!e.arrow&&`${l}-arrow-hidden`),E=d.value||!e.visible?ge(b.value.name,b.value):{};return U(Re,Y(Y({ref:o},E),{},{onBeforeEnter:x}),{default:()=>!u||e.visible?Mt(U(nu,{target:_(),key:`popup`,ref:a,monitorWindowResize:!0,disabled:S.value,align:n,onAlign:y},{default:()=>U(`div`,{class:T,onMouseenter:f,onMouseleave:m,onMousedown:Gt(g,[`capture`]),[sr?`onTouchstartPassive`:`onTouchstart`]:Gt(h,[`capture`]),style:C},[w])}),[[ht,d.value]]):null})}}}),iu=u({compatConfig:{MODE:3},name:`Popup`,inheritAttrs:!1,props:Ai,setup(e,t){let{attrs:n,slots:r,expose:i}=t,a=q(!1),o=q(!1),s=q(),c=q();return G([()=>e.visible,()=>e.mobile],()=>{a.value=e.visible,e.visible&&e.mobile&&(o.value=!0)},{immediate:!0,flush:`post`}),i({forceAlign:()=>{var e;(e=s.value)==null||e.forceAlign()},getElement:()=>s.value?.getElement()}),()=>{let t=Z(Z(Z({},e),n),{visible:a.value}),i=o.value?U(Mi,Y(Y({},t),{},{mobile:e.mobile,ref:s}),{default:r.default}):U(ru,Y(Y({},t),{},{ref:s}),{default:r.default});return U(`div`,{ref:c},[U(ji,t,null),i])}}});function au(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function ou(e,t,n){return Z(Z({},e[t]||{}),n)}function su(e,t,n,r){let{points:i}=n,a=Object.keys(e);for(let n=0;n0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=typeof e==`function`?e(this.$data,this.$props):e;if(this.getDerivedStateFromProps){let e=this.getDerivedStateFromProps(pe(this),Z(Z({},this.$data),n));if(e===null)return;n=Z(Z({},n),e||{})}Z(this.$data,n),this._.isMounted&&this.$forceUpdate(),z(()=>{t&&t()})},__emit(){let e=[].slice.call(arguments,0),t=e[0];t=`on${t[0].toUpperCase()}${t.substring(1)}`;let n=this.$props[t]||this.$attrs[t];if(e.length&&n)if(Array.isArray(n))for(let t=0,r=n.length;t`u`)return 0;if(e||lu===void 0){let e=document.createElement(`div`);e.style.width=`100%`,e.style.height=`200px`;let t=document.createElement(`div`),n=t.style;n.position=`absolute`,n.top=`0`,n.left=`0`,n.pointerEvents=`none`,n.visibility=`hidden`,n.width=`200px`,n.height=`150px`,n.overflow=`hidden`,t.appendChild(e),document.body.appendChild(t);let r=e.offsetWidth;t.style.overflow=`scroll`;let i=e.offsetWidth;r===i&&(i=t.clientWidth),document.body.removeChild(t),lu=r-i}return lu}function du(e){let t=e.match(/^(.*)px$/),n=Number(t?.[1]);return Number.isNaN(n)?uu():n}function fu(e){if(typeof document>`u`||!e||!(e instanceof Element))return{width:0,height:0};let{width:t,height:n}=getComputedStyle(e,`::-webkit-scrollbar`);return{width:du(t),height:du(n)}}var pu=`vc-util-locker-${Date.now()}`,mu=0;function hu(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}function gu(e){let t=J(()=>!!e&&!!e.value);mu+=1;let n=`${pu}_${mu}`;S(e=>{if(It()){if(t.value){let e=uu();Ut(` +html body { + overflow-y: hidden; + ${hu()?`width: calc(100% - ${e}px);`:``} +}`,n)}else Ze(n);e(()=>{Ze(n)})}},{flush:`post`})}var _u=0,vu=It(),yu=e=>{if(!vu)return null;if(e){if(typeof e==`string`)return document.querySelectorAll(e)[0];if(typeof e==`function`)return e();if(typeof e==`object`&&e instanceof window.HTMLElement)return e}return document.body},bu=u({compatConfig:{MODE:3},name:`PortalWrapper`,inheritAttrs:!1,props:{wrapperClassName:String,forceRender:{type:Boolean,default:void 0},getContainer:f.any,visible:{type:Boolean,default:void 0},autoLock:Q(),didUpdate:Function},setup(e,t){let{slots:n}=t,r=q(),i=q(),a=q(),o=q(1),s=It()&&document.createElement(`div`),c=()=>{var e;r.value===s&&((e=r.value?.parentNode)==null||e.removeChild(r.value)),r.value=null},l=null,u=function(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]||r.value&&!r.value.parentNode?(l=yu(e.getContainer),l?(l.appendChild(r.value),!0):!1):!0},d=()=>vu?(r.value||(r.value=s,u(!0)),f(),r.value):null,f=()=>{let{wrapperClassName:t}=e;r.value&&t&&t!==r.value.className&&(r.value.className=t)};return O(()=>{f(),u()}),gu(J(()=>e.autoLock&&e.visible&&It()&&(r.value===document.body||r.value===s))),V(()=>{let t=!1;G([()=>e.visible,()=>e.getContainer],(n,r)=>{let[i,a]=n,[o,s]=r;vu&&(l=yu(e.getContainer),l===document.body&&(i&&!o?_u+=1:t&&--_u)),t&&(typeof a==`function`&&typeof s==`function`?a.toString()!==s.toString():a!==s)&&c(),t=!0},{immediate:!0,flush:`post`}),z(()=>{u()||(a.value=ir(()=>{o.value+=1}))})}),ut(()=>{let{visible:t}=e;vu&&l===document.body&&(_u=t&&_u?_u-1:_u),c(),ir.cancel(a.value)}),()=>{let{forceRender:t,visible:r}=e,a=null,s={getOpenCount:()=>_u,getContainer:d};return o.value&&(t||r||i.value)&&(a=U(Ve,{getContainer:d,ref:i,didUpdate:e.didUpdate},{default:()=>n.default?.call(n,s)})),a}}}),xu=[`onClick`,`onMousedown`,`onTouchstart`,`onMouseenter`,`onMouseleave`,`onFocus`,`onBlur`,`onContextmenu`],Su=u({compatConfig:{MODE:3},name:`Trigger`,mixins:[cu],inheritAttrs:!1,props:Di(),setup(e){let t=J(()=>{let{popupPlacement:t,popupAlign:n,builtinPlacements:r}=e;return t&&r?ou(r,t,n):n}),n=q(null);return{vcTriggerContext:g(`vcTriggerContext`,{}),popupRef:n,setPopupRef:e=>{n.value=e},triggerRef:q(null),align:t,focusTime:null,clickOutsideHandler:null,contextmenuOutsideHandler1:null,contextmenuOutsideHandler2:null,touchOutsideHandler:null,attachId:null,delayTimer:null,hasPopupMouseDown:!1,preClickTime:null,preTouchTime:null,mouseDownTimeout:null,childOriginEvents:{}}},data(){let e=this.$props,t;return t=this.popupVisible===void 0?!!e.defaultPopupVisible:!!e.popupVisible,xu.forEach(e=>{this[`fire${e}`]=t=>{this.fireEvents(e,t)}}),{prevPopupVisible:t,sPopupVisible:t,point:null}},watch:{popupVisible(e){e!==void 0&&(this.prevPopupVisible=this.sPopupVisible,this.sPopupVisible=e)}},created(){fe(`vcTriggerContext`,{onPopupMouseDown:this.onPopupMouseDown,onPopupMouseenter:this.onPopupMouseenter,onPopupMouseleave:this.onPopupMouseleave}),$t(this)},deactivated(){this.setPopupVisible(!1)},mounted(){this.$nextTick(()=>{this.updatedCal()})},updated(){this.$nextTick(()=>{this.updatedCal()})},beforeUnmount(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ir.cancel(this.attachId)},methods:{updatedCal(){let e=this.$props;if(this.$data.sPopupVisible){let t;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextmenuToShow())&&(t=e.getDocument(this.getRootDomNode()),this.clickOutsideHandler=cr(t,`mousedown`,this.onDocumentClick)),this.touchOutsideHandler||=(t||=e.getDocument(this.getRootDomNode()),cr(t,`touchstart`,this.onDocumentClick,sr?{passive:!1}:!1)),!this.contextmenuOutsideHandler1&&this.isContextmenuToShow()&&(t||=e.getDocument(this.getRootDomNode()),this.contextmenuOutsideHandler1=cr(t,`scroll`,this.onContextmenuClose)),!this.contextmenuOutsideHandler2&&this.isContextmenuToShow()&&(this.contextmenuOutsideHandler2=cr(window,`blur`,this.onContextmenuClose))}else this.clearOutsideHandler()},onMouseenter(e){let{mouseEnterDelay:t}=this.$props;this.fireEvents(`onMouseenter`,e),this.delaySetPopupVisible(!0,t,t?null:e)},onMouseMove(e){this.fireEvents(`onMousemove`,e),this.setPoint(e)},onMouseleave(e){this.fireEvents(`onMouseleave`,e),this.delaySetPopupVisible(!1,this.$props.mouseLeaveDelay)},onPopupMouseenter(){let{vcTriggerContext:e={}}=this;e.onPopupMouseenter&&e.onPopupMouseenter(),this.clearDelayTimer()},onPopupMouseleave(e){if(e&&e.relatedTarget&&!e.relatedTarget.setTimeout&&Ct(this.popupRef?.getElement(),e.relatedTarget))return;this.isMouseLeaveToHide()&&this.delaySetPopupVisible(!1,this.$props.mouseLeaveDelay);let{vcTriggerContext:t={}}=this;t.onPopupMouseleave&&t.onPopupMouseleave(e)},onFocus(e){this.fireEvents(`onFocus`,e),this.clearDelayTimer(),this.isFocusToShow()&&(this.focusTime=Date.now(),this.delaySetPopupVisible(!0,this.$props.focusDelay))},onMousedown(e){this.fireEvents(`onMousedown`,e),this.preClickTime=Date.now()},onTouchstart(e){this.fireEvents(`onTouchstart`,e),this.preTouchTime=Date.now()},onBlur(e){Ct(e.target,e.relatedTarget||document.activeElement)||(this.fireEvents(`onBlur`,e),this.clearDelayTimer(),this.isBlurToHide()&&this.delaySetPopupVisible(!1,this.$props.blurDelay))},onContextmenu(e){e.preventDefault(),this.fireEvents(`onContextmenu`,e),this.setPopupVisible(!0,e)},onContextmenuClose(){this.isContextmenuToShow()&&this.close()},onClick(e){if(this.fireEvents(`onClick`,e),this.focusTime){let e;if(this.preClickTime&&this.preTouchTime?e=Math.min(this.preClickTime,this.preTouchTime):this.preClickTime?e=this.preClickTime:this.preTouchTime&&(e=this.preTouchTime),Math.abs(e-this.focusTime)<20)return;this.focusTime=0}this.preClickTime=0,this.preTouchTime=0,this.isClickToShow()&&(this.isClickToHide()||this.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault(),e&&e.domEvent&&e.domEvent.preventDefault();let t=!this.$data.sPopupVisible;(this.isClickToHide()&&!t||t&&this.isClickToShow())&&this.setPopupVisible(!this.$data.sPopupVisible,e)},onPopupMouseDown(){let{vcTriggerContext:e={}}=this;this.hasPopupMouseDown=!0,clearTimeout(this.mouseDownTimeout),this.mouseDownTimeout=setTimeout(()=>{this.hasPopupMouseDown=!1},0),e.onPopupMouseDown&&e.onPopupMouseDown(...arguments)},onDocumentClick(e){if(this.$props.mask&&!this.$props.maskClosable)return;let t=e.target,n=this.getRootDomNode(),r=this.getPopupDomNode();(!Ct(n,t)||this.isContextMenuOnly())&&!Ct(r,t)&&!this.hasPopupMouseDown&&this.delaySetPopupVisible(!1,.1)},getPopupDomNode(){return this.popupRef?.getElement()||null},getRootDomNode(){let{getTriggerDOMNode:e}=this.$props;if(e)return ae(e(this.triggerRef?.$el?.nodeName===`#comment`?null:ae(this.triggerRef)));try{let e=this.triggerRef?.$el?.nodeName===`#comment`?null:ae(this.triggerRef);if(e)return e}catch{}return ae(this)},handleGetPopupClassFromAlign(e){let t=[],{popupPlacement:n,builtinPlacements:r,prefixCls:i,alignPoint:a,getPopupClassNameFromAlign:o}=this.$props;return n&&r&&t.push(su(r,i,e,a)),o&&t.push(o(e)),t.join(` `)},getPopupAlign(){let{popupPlacement:e,popupAlign:t,builtinPlacements:n}=this.$props;return e&&n?ou(n,e,t):t},getComponent(){let e={};this.isMouseEnterToShow()&&(e.onMouseenter=this.onPopupMouseenter),this.isMouseLeaveToHide()&&(e.onMouseleave=this.onPopupMouseleave),e.onMousedown=this.onPopupMouseDown,e[sr?`onTouchstartPassive`:`onTouchstart`]=this.onPopupMouseDown;let{handleGetPopupClassFromAlign:t,getRootDomNode:n,$attrs:r}=this,{prefixCls:i,destroyPopupOnHide:a,popupClassName:o,popupAnimation:s,popupTransitionName:c,popupStyle:l,mask:u,maskAnimation:d,maskTransitionName:f,zIndex:p,stretch:m,alignPoint:h,mobile:g,arrow:_,forceRender:v}=this.$props,{sPopupVisible:y,point:b}=this.$data;return U(iu,Z(Z({prefixCls:i,arrow:_,destroyPopupOnHide:a,visible:y,point:h?b:null,align:this.align,animation:s,getClassNameFromAlign:t,stretch:m,getRootDomNode:n,mask:u,zIndex:p,transitionName:c,maskAnimation:d,maskTransitionName:f,class:o,style:l,onAlign:r.onPopupAlign||Ei},e),{ref:this.setPopupRef,mobile:g,forceRender:v}),{default:this.$slots.popup||(()=>k(this,`popup`))})},attachParent(e){ir.cancel(this.attachId);let{getPopupContainer:t,getDocument:n}=this.$props,r=this.getRootDomNode(),i;t?(r||t.length===0)&&(i=t(r)):i=n(this.getRootDomNode()).body,i?i.appendChild(e):this.attachId=ir(()=>{this.attachParent(e)})},getContainer(){let{$props:e}=this,{getDocument:t}=e,n=t(this.getRootDomNode()).createElement(`div`);return n.style.position=`absolute`,n.style.top=`0`,n.style.left=`0`,n.style.width=`100%`,this.attachParent(n),n},setPopupVisible(e,t){let{alignPoint:n,sPopupVisible:r,onPopupVisibleChange:i}=this;this.clearDelayTimer(),r!==e&&(E(this,`popupVisible`)||this.setState({sPopupVisible:e,prevPopupVisible:r}),i&&i(e)),n&&t&&e&&this.setPoint(t)},setPoint(e){let{alignPoint:t}=this.$props;!t||!e||this.setState({point:{pageX:e.pageX,pageY:e.pageY}})},handlePortalUpdate(){this.prevPopupVisible!==this.sPopupVisible&&this.afterPopupVisibleChange(this.sPopupVisible)},delaySetPopupVisible(e,t,n){let r=t*1e3;if(this.clearDelayTimer(),r){let t=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=setTimeout(()=>{this.setPopupVisible(e,t),this.clearDelayTimer()},r)}else this.setPopupVisible(e,n)},clearDelayTimer(){this.delayTimer&&=(clearTimeout(this.delayTimer),null)},clearOutsideHandler(){this.clickOutsideHandler&&=(this.clickOutsideHandler.remove(),null),this.contextmenuOutsideHandler1&&=(this.contextmenuOutsideHandler1.remove(),null),this.contextmenuOutsideHandler2&&=(this.contextmenuOutsideHandler2.remove(),null),this.touchOutsideHandler&&=(this.touchOutsideHandler.remove(),null)},createTwoChains(e){let t=()=>{},n=ee(this);return this.childOriginEvents[e]&&n[e]?this[`fire${e}`]:(t=this.childOriginEvents[e]||n[e]||t,t)},isClickToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`click`)!==-1||t.indexOf(`click`)!==-1},isContextMenuOnly(){let{action:e}=this.$props;return e===`contextmenu`||e.length===1&&e[0]===`contextmenu`},isContextmenuToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`contextmenu`)!==-1||t.indexOf(`contextmenu`)!==-1},isClickToHide(){let{action:e,hideAction:t}=this.$props;return e.indexOf(`click`)!==-1||t.indexOf(`click`)!==-1},isMouseEnterToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`hover`)!==-1||t.indexOf(`mouseenter`)!==-1},isMouseLeaveToHide(){let{action:e,hideAction:t}=this.$props;return e.indexOf(`hover`)!==-1||t.indexOf(`mouseleave`)!==-1},isFocusToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`focus`)!==-1||t.indexOf(`focus`)!==-1},isBlurToHide(){let{action:e,hideAction:t}=this.$props;return e.indexOf(`focus`)!==-1||t.indexOf(`blur`)!==-1},forcePopupAlign(){var e;this.$data.sPopupVisible&&((e=this.popupRef)==null||e.forceAlign())},fireEvents(e,t){this.childOriginEvents[e]&&this.childOriginEvents[e](t);let n=this.$props[e]||this.$attrs[e];n&&n(t)},close(){this.setPopupVisible(!1)}},render(){let{$attrs:e}=this,t=dt(c(this)),{alignPoint:n,getPopupContainer:r}=this.$props,i=t[0];this.childOriginEvents=ee(i);let a={key:`trigger`};this.isContextmenuToShow()?a.onContextmenu=this.onContextmenu:a.onContextmenu=this.createTwoChains(`onContextmenu`),this.isClickToHide()||this.isClickToShow()?(a.onClick=this.onClick,a.onMousedown=this.onMousedown,a[sr?`onTouchstartPassive`:`onTouchstart`]=this.onTouchstart):(a.onClick=this.createTwoChains(`onClick`),a.onMousedown=this.createTwoChains(`onMousedown`),a[sr?`onTouchstartPassive`:`onTouchstart`]=this.createTwoChains(`onTouchstart`)),this.isMouseEnterToShow()?(a.onMouseenter=this.onMouseenter,n&&(a.onMousemove=this.onMouseMove)):a.onMouseenter=this.createTwoChains(`onMouseenter`),this.isMouseLeaveToHide()?a.onMouseleave=this.onMouseleave:a.onMouseleave=this.createTwoChains(`onMouseleave`),this.isFocusToShow()||this.isBlurToHide()?(a.onFocus=this.onFocus,a.onBlur=this.onBlur):(a.onFocus=this.createTwoChains(`onFocus`),a.onBlur=e=>{e&&(!e.relatedTarget||!Ct(e.target,e.relatedTarget))&&this.createTwoChains(`onBlur`)(e)});let o=K(i&&i.props&&i.props.class,e.class);return o&&(a.class=o),U($e,null,[ao(i,Z(Z({},a),{ref:`triggerRef`}),!0,!0),U(bu,{key:`portal`,getContainer:r&&(()=>r(this.getRootDomNode())),didUpdate:this.handlePortalUpdate,visible:this.$data.sPopupVisible},{default:this.getComponent})])}}),Cu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=e===!0?0:1;return{bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},Tu=u({name:`SelectTrigger`,inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:f.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:f.oneOfType([Number,Boolean]).def(!0),popupElement:f.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(e,t){let{slots:n,attrs:r,expose:i}=t,a=J(()=>{let{dropdownMatchSelectWidth:t}=e;return wu(t)}),o=H();return i({getPopupElement:()=>o.value}),()=>{let t=Z(Z({},e),r),{empty:i=!1}=t,{visible:s,dropdownAlign:c,prefixCls:l,popupElement:u,dropdownClassName:d,dropdownStyle:f,direction:p=`ltr`,placement:m,dropdownMatchSelectWidth:h,containerWidth:g,dropdownRender:_,animation:v,transitionName:y,getPopupContainer:b,getTriggerDOMNode:x,onPopupVisibleChange:S,onPopupMouseEnter:C,onPopupFocusin:w,onPopupFocusout:T}=Cu(t,[`empty`]),E=`${l}-dropdown`,D=u;_&&(D=_({menuNode:u,props:e}));let O=v?`${E}-${v}`:y,k=Z({minWidth:`${g}px`},f);return typeof h==`number`?k.width=`${h}px`:h&&(k.width=`${g}px`),U(Su,Y(Y({},e),{},{showAction:S?[`click`]:[],hideAction:S?[`click`]:[],popupPlacement:m||(p===`rtl`?`bottomRight`:`bottomLeft`),builtinPlacements:a.value,prefixCls:E,popupTransitionName:O,popupAlign:c,popupVisible:s,getPopupContainer:b,popupClassName:K(d,{[`${E}-empty`]:i}),popupStyle:k,getTriggerDOMNode:x,onPopupVisibleChange:S}),{default:n.default,popup:()=>U(`div`,{ref:o,onMouseenter:C,onFocusin:w,onFocusout:T},[D])})}}}),$={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){let{keyCode:t}=e;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=$.F1&&t<=$.F12)return!1;switch(t){case $.ALT:case $.CAPS_LOCK:case $.CONTEXT_MENU:case $.CTRL:case $.DOWN:case $.END:case $.ESC:case $.HOME:case $.INSERT:case $.LEFT:case $.MAC_FF_META:case $.META:case $.NUMLOCK:case $.NUM_CENTER:case $.PAGE_DOWN:case $.PAGE_UP:case $.PAUSE:case $.PRINT_SCREEN:case $.RIGHT:case $.SHIFT:case $.UP:case $.WIN_KEY:case $.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=$.ZERO&&e<=$.NINE||e>=$.NUM_ZERO&&e<=$.NUM_MULTIPLY||e>=$.A&&e<=$.Z||window.navigator.userAgent.indexOf(`WebKit`)!==-1&&e===0)return!0;switch(e){case $.SPACE:case $.QUESTION_MARK:case $.NUM_PLUS:case $.NUM_MINUS:case $.NUM_PERIOD:case $.NUM_DIVISION:case $.SEMICOLON:case $.DASH:case $.EQUALS:case $.COMMA:case $.PERIOD:case $.SLASH:case $.APOSTROPHE:case $.SINGLE_QUOTE:case $.OPEN_SQUARE_BRACKET:case $.BACKSLASH:case $.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Eu=(e,t)=>{let{slots:n}=t,{class:r,customizeIcon:i,customizeIconProps:a,onMousedown:o,onClick:s}=e,c;return c=typeof i==`function`?i(a):p(i)?it(i):i,U(`span`,{class:r,onMousedown:e=>{e.preventDefault(),o&&o(e)},style:{userSelect:`none`,WebkitUserSelect:`none`},unselectable:`on`,onClick:s,"aria-hidden":!0},[c===void 0?U(`span`,{class:r.split(/\s+/).map(e=>`${e}-icon`)},[n.default?.call(n)]):c])};Eu.inheritAttrs=!1,Eu.displayName=`TransBtn`,Eu.props={class:String,customizeIcon:f.any,customizeIconProps:f.any,onMousedown:Function,onClick:Function};var Du=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{r.value&&r.value.focus()},blur:()=>{r.value&&r.value.blur()},input:r,setSelectionRange:(e,t,n)=>{var i;(i=r.value)==null||i.setSelectionRange(e,t,n)},select:()=>{var e;(e=r.value)==null||e.select()},getSelectionStart:()=>r.value?.selectionStart,getSelectionEnd:()=>r.value?.selectionEnd,getScrollTop:()=>r.value?.scrollTop}),()=>{let{tag:t,value:n}=e;return U(t,Y(Y({},Du(e,[`tag`,`value`])),{},{ref:r,value:n}),null)}}});function ku(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function Au(e){let t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.scrollX||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.scrollY||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function ju(e){return Array.prototype.slice.apply(e).map(t=>`${t}: ${e.getPropertyValue(t)};`).join(``)}function Mu(e){return Object.keys(e).reduce((t,n)=>(e[n]==null||(t+=`${n}: ${e[n]};`),t),``)}var Nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.value,s],()=>{s.value||(o.value=e.value)},{immediate:!0});let c=e=>{n(`change`,e)},l=e=>{s.value=!0,e.target.composing=!0,n(`compositionstart`,e)},u=e=>{s.value=!1,e.target.composing=!1,n(`compositionend`,e);let t=document.createEvent(`HTMLEvents`);t.initEvent(`input`,!0,!0),e.target.dispatchEvent(t),c(e)},d=t=>{if(s.value&&e.lazy){o.value=t.target.value;return}n(`input`,t)},f=e=>{n(`blur`,e)},p=e=>{n(`focus`,e)},m=()=>{a.value&&a.value.focus()},h=()=>{a.value&&a.value.blur()},g=e=>{n(`keydown`,e)},_=e=>{n(`keyup`,e)};i({focus:m,blur:h,input:J(()=>a.value?.input),setSelectionRange:(e,t,n)=>{var r;(r=a.value)==null||r.setSelectionRange(e,t,n)},select:()=>{var e;(e=a.value)==null||e.select()},getSelectionStart:()=>a.value?.getSelectionStart(),getSelectionEnd:()=>a.value?.getSelectionEnd(),getScrollTop:()=>a.value?.getScrollTop()});let v=e=>{n(`mousedown`,e)},y=e=>{n(`paste`,e)},b=J(()=>e.style&&typeof e.style!=`string`?Mu(e.style):e.style);return()=>{let{style:t,lazy:n}=e;return U(Ou,Y(Y(Y({},Nu(e,[`style`,`lazy`])),r),{},{style:b.value,onInput:d,onChange:c,onBlur:f,onFocus:p,ref:a,value:o.value,onCompositionstart:l,onCompositionend:u,onKeyup:_,onKeydown:g,onPaste:y,onMousedown:v}),null)}}}),Fu=u({compatConfig:{MODE:3},name:`SelectInput`,inheritAttrs:!1,props:{inputRef:f.any,prefixCls:String,id:String,inputElement:f.VueNode,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,editable:{type:Boolean,default:void 0},activeDescendantId:String,value:String,open:{type:Boolean,default:void 0},tabindex:f.oneOfType([f.number,f.string]),attrs:f.object,onKeydown:{type:Function},onMousedown:{type:Function},onChange:{type:Function},onPaste:{type:Function},onCompositionstart:{type:Function},onCompositionend:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},setup(e){let t=null,n=g(`VCSelectContainerEvent`);return()=>{let{prefixCls:r,id:i,inputElement:a,disabled:o,tabindex:s,autofocus:c,autocomplete:l,editable:u,activeDescendantId:d,value:f,onKeydown:p,onMousedown:m,onChange:h,onPaste:g,onCompositionstart:_,onCompositionend:v,onFocus:y,onBlur:b,open:x,inputRef:S,attrs:C}=e,w=a||U(Pu,null,null),T=w.props||{},{onKeydown:E,onInput:D,onFocus:O,onBlur:k,onMousedown:A,onCompositionstart:j,onCompositionend:M,style:N}=T;return w=ao(w,Z(Z(Z(Z(Z({type:`search`},T),{id:i,ref:S,disabled:o,tabindex:s,lazy:!1,autocomplete:l||`off`,autofocus:c,class:K(`${r}-selection-search-input`,w?.props?.class),role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-owns":`${i}_list`,"aria-autocomplete":`list`,"aria-controls":`${i}_list`,"aria-activedescendant":d}),C),{value:u?f:``,readonly:!u,unselectable:u?null:`on`,style:Z(Z({},N),{opacity:u?null:0}),onKeydown:e=>{p(e),E&&E(e)},onMousedown:e=>{m(e),A&&A(e)},onInput:e=>{h(e),D&&D(e)},onCompositionstart(e){_(e),j&&j(e)},onCompositionend(e){v(e),M&&M(e)},onPaste:g,onFocus:function(){clearTimeout(t),O&&O(arguments.length<=0?void 0:arguments[0]),y&&y(arguments.length<=0?void 0:arguments[0]),n?.focus(arguments.length<=0?void 0:arguments[0])},onBlur:function(){var e=[...arguments];t=setTimeout(()=>{k&&k(e[0]),b&&b(e[0]),n?.blur(e[0])},100)}}),w.type===`textarea`?{}:{type:`search`}),!0,!0),w}}}),Iu=`accept acceptcharset accesskey action allowfullscreen allowtransparency +alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge +charset checked classid classname colspan cols content contenteditable contextmenu +controls coords crossorigin data datetime default defer dir disabled download draggable +enctype form formaction formenctype formmethod formnovalidate formtarget frameborder +headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity +is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media +mediagroup method min minlength multiple muted name novalidate nonce open +optimum pattern placeholder poster preload radiogroup readonly rel required +reversed role rowspan rows sandbox scope scoped scrolling seamless selected +shape size sizes span spellcheck src srcdoc srclang srcset start step style +summary tabindex target title type usemap value width wmode wrap onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown + onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick + onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown + onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel + onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough + onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata + onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),Lu=`aria-`,Ru=`data-`;function zu(e,t){return e.indexOf(t)===0}function Bu(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n;n=t===!1?{aria:!0,data:!0,attr:!0}:t===!0?{aria:!0}:Z({},t);let r={};return Object.keys(e).forEach(t=>{(n.aria&&(t===`role`||zu(t,Lu))||n.data&&zu(t,Ru)||n.attr&&(Iu.includes(t)||Iu.includes(t.toLowerCase())))&&(r[t]=e[t])}),r}var Vu=Symbol(`OverflowContextProviderKey`),Hu=u({compatConfig:{MODE:3},name:`OverflowContextProvider`,inheritAttrs:!1,props:{value:{type:Object}},setup(e,t){let{slots:n}=t;return fe(Vu,J(()=>e.value)),()=>n.default?.call(n)}}),Uu=()=>g(Vu,J(()=>null)),Wu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.responsive&&!e.display),a=H();r({itemNodeRef:a});function o(t){e.registerSize(e.itemKey,t)}return y(()=>{o(null)}),()=>{let{prefixCls:t,invalidate:r,item:s,renderItem:c,responsive:l,registerSize:u,itemKey:d,display:f,order:p,component:m=`div`}=e,h=Wu(e,[`prefixCls`,`invalidate`,`item`,`renderItem`,`responsive`,`registerSize`,`itemKey`,`display`,`order`,`component`]),g=n.default?.call(n),_=c&&s!==Gu?c(s):g,v;r||(v={opacity:+!i.value,height:i.value?0:Gu,overflowY:i.value?`hidden`:Gu,order:l?p:Gu,pointerEvents:i.value?`none`:Gu,position:i.value?`absolute`:Gu});let y={};return i.value&&(y[`aria-hidden`]=!0),U(Qn,{disabled:!l,onResize:e=>{let{offsetWidth:t}=e;o(t)}},{default:()=>U(m,Y(Y(Y({class:K(!r&&t),style:v},y),h),{},{ref:a}),{default:()=>[_]})})}}}),qu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{if(!i.value){let{component:t=`div`}=e;return U(t,Y(Y({},qu(e,[`component`])),r),{default:()=>[n.default?.call(n)]})}let t=i.value,{className:a}=t,o=qu(t,[`className`]),{class:s}=r,c=qu(r,[`class`]);return U(Hu,{value:null},{default:()=>[U(Ku,Y(Y(Y({class:K(a,s)},o),c),e),n)]})}}}),Yu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.ssr===`full`),o=q(null),s=J(()=>o.value||0),c=q(new Map),l=q(0),u=q(0),d=q(0),f=q(null),p=q(null),m=J(()=>p.value===null&&a.value?2**53-1:p.value||0),h=q(!1),g=J(()=>`${e.prefixCls}-item`),_=J(()=>Math.max(l.value,u.value)),v=J(()=>!!(e.data.length&&e.maxCount===Xu)),y=J(()=>e.maxCount===Zu),b=J(()=>v.value||typeof e.maxCount==`number`&&e.data.length>e.maxCount),x=J(()=>{let t=e.data;return v.value?t=o.value===null&&a.value?e.data:e.data.slice(0,Math.min(e.data.length,s.value/e.itemWidth)):typeof e.maxCount==`number`&&(t=e.data.slice(0,e.maxCount)),t}),S=J(()=>v.value?e.data.slice(m.value+1):e.data.slice(x.value.length)),C=(t,n)=>typeof e.itemKey==`function`?e.itemKey(t):(e.itemKey&&t?.[e.itemKey])??n,w=J(()=>e.renderItem||(e=>e)),T=(t,n)=>{p.value=t,n||(h.value=t{o.value=t.clientWidth},D=(e,t)=>{let n=new Map(c.value);t===null?n.delete(e):n.set(e,t),c.value=n},O=(e,t)=>{l.value=u.value,u.value=t},k=(e,t)=>{d.value=t},A=e=>c.value.get(C(x.value[e],e));return G([s,c,u,d,()=>e.itemKey,x],()=>{if(s.value&&_.value&&x.value){let t=d.value,n=x.value.length,r=n-1;if(!n){T(0),f.value=null;return}for(let e=0;es.value){T(e-1),f.value=t-n-d.value+u.value;break}}e.suffix&&A(0)+d.value>s.value&&(f.value=null)}}),()=>{let t=h.value&&!!S.value.length,{itemComponent:r,renderRawItem:a,renderRawRest:o,renderRest:s,prefixCls:c=`rc-overflow`,suffix:l,component:u=`div`,id:d,onMousedown:p}=e,{class:_,style:T}=n,A=Yu(n,[`class`,`style`]),j={};f.value!==null&&v.value&&(j={position:`absolute`,left:`${f.value}px`,top:0});let M={prefixCls:g.value,responsive:v.value,component:r,invalidate:y.value},N=a?(e,t)=>{let n=C(e,t);return U(Hu,{key:n,value:Z(Z({},M),{order:t,item:e,itemKey:n,registerSize:D,display:t<=m.value})},{default:()=>[a(e,t)]})}:(e,t)=>{let n=C(e,t);return U(Ku,Y(Y({},M),{},{order:t,key:n,item:e,renderItem:w.value,itemKey:n,registerSize:D,display:t<=m.value}),null)},P=()=>null,F={order:t?m.value:2**53-1,className:`${g.value} ${g.value}-rest`,registerSize:O,display:t};if(o)o&&(P=()=>U(Hu,{value:Z(Z({},M),F)},{default:()=>[o(S.value)]}));else{let e=s||Qu;P=()=>U(Ku,Y(Y({},M),F),{default:()=>typeof e==`function`?e(S.value):e})}return U(Qn,{disabled:!v.value,onResize:E},{default:()=>U(u,Y({id:d,class:K(!y.value&&c,_),style:T,onMousedown:p,role:e.role},A),{default:()=>[x.value.map(N),b.value?P():null,l&&U(Ku,Y(Y({},M),{},{order:m.value,class:`${g.value}-suffix`,registerSize:k,display:!0,style:j}),{default:()=>l}),i.default?.call(i)]})})}}});$u.Item=Ju,$u.RESPONSIVE=Xu,$u.INVALIDATE=Zu;var ed=$u,td=Symbol(`TreeSelectLegacyContextPropsKey`);function nd(e){return fe(td,e)}function rd(){return g(td,{})}var id={id:String,prefixCls:String,values:f.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:f.any,placeholder:f.any,disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:f.oneOfType([f.number,f.string]),compositionStatus:Boolean,removeIcon:f.any,choiceTransitionName:String,maxTagCount:f.oneOfType([f.number,f.string]),maxTagTextLength:Number,maxTagPlaceholder:f.any.def(()=>e=>`+ ${e.length} ...`),tagRender:Function,onToggleOpen:{type:Function},onRemove:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},ad=e=>{e.preventDefault(),e.stopPropagation()},od=u({name:`MultipleSelectSelector`,inheritAttrs:!1,props:id,setup(e){let t=q(),n=q(0),r=q(!1),i=rd(),a=J(()=>`${e.prefixCls}-selection`),o=J(()=>e.open||e.mode===`tags`?e.searchValue:``),s=J(()=>e.mode===`tags`||e.showSearch&&(e.open||r.value)),c=H(``);S(()=>{c.value=o.value}),V(()=>{G(c,()=>{n.value=t.value.scrollWidth},{flush:`post`,immediate:!0})});function l(t,n,r,i,o){return U(`span`,{class:K(`${a.value}-item`,{[`${a.value}-item-disabled`]:r}),title:typeof t==`string`||typeof t==`number`?t.toString():void 0},[U(`span`,{class:`${a.value}-item-content`},[n]),i&&U(Eu,{class:`${a.value}-item-remove`,onMousedown:ad,onClick:o,customizeIcon:e.removeIcon},{default:()=>[en(`×`)]})])}function u(t,n,r,a,o,s){let c=t=>{ad(t),e.onToggleOpen(!open)},l=s;return i.keyEntities&&(l=i.keyEntities[t]?.node||{}),U(`span`,{key:t,onMousedown:c},[e.tagRender({label:n,value:t,disabled:r,closable:a,onClose:o,option:l})])}function d(t){let{disabled:n,label:r,value:i,option:a}=t,o=!e.disabled&&!n,s=r;if(typeof e.maxTagTextLength==`number`&&(typeof r==`string`||typeof r==`number`)){let t=String(s);t.length>e.maxTagTextLength&&(s=`${t.slice(0,e.maxTagTextLength)}...`)}let c=n=>{var r;n&&n.stopPropagation(),(r=e.onRemove)==null||r.call(e,t)};return typeof e.tagRender==`function`?u(i,s,n,o,c,a):l(r,s,n,o,c)}function f(t){let{maxTagPlaceholder:n=e=>`+ ${e.length} ...`}=e,r=typeof n==`function`?n(t):n;return l(r,r,!1)}let p=t=>{let n=t.target.composing;c.value=t.target.value,n||e.onInputChange(t)};return()=>{let{id:i,prefixCls:l,values:u,open:m,inputRef:h,placeholder:g,disabled:_,autofocus:v,autocomplete:y,activeDescendantId:b,tabindex:x,compositionStatus:S,onInputPaste:C,onInputKeyDown:w,onInputMouseDown:T,onInputCompositionStart:E,onInputCompositionEnd:D}=e,O=U(`div`,{class:`${a.value}-search`,style:{width:n.value+`px`},key:`input`},[U(Fu,{inputRef:h,open:m,prefixCls:l,id:i,inputElement:null,disabled:_,autofocus:v,autocomplete:y,editable:s.value,activeDescendantId:b,value:c.value,onKeydown:w,onMousedown:T,onChange:p,onPaste:C,onCompositionstart:E,onCompositionend:D,tabindex:x,attrs:Bu(e,!0),onFocus:()=>r.value=!0,onBlur:()=>r.value=!1},null),U(`span`,{ref:t,class:`${a.value}-search-mirror`,"aria-hidden":!0},[c.value,en(`\xA0`)])]);return U($e,null,[U(ed,{prefixCls:`${a.value}-overflow`,data:u,renderItem:d,renderRest:f,suffix:O,itemKey:`key`,maxCount:e.maxTagCount,key:`overflow`},null),!u.length&&!o.value&&!S&&U(`span`,{class:`${a.value}-placeholder`},[g])])}}}),sd={inputElement:f.any,id:String,prefixCls:String,values:f.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:f.any,placeholder:f.any,compositionStatus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:f.oneOfType([f.number,f.string]),activeValue:String,backfill:{type:Boolean,default:void 0},optionLabelRender:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},cd=u({name:`SingleSelector`,setup(e){let t=q(!1),n=J(()=>e.mode===`combobox`),r=J(()=>n.value||e.showSearch),i=J(()=>{let r=e.searchValue||``;return n.value&&e.activeValue&&!t.value&&(r=e.activeValue),r}),a=rd();G([n,()=>e.activeValue],()=>{n.value&&(t.value=!1)},{immediate:!0});let o=J(()=>e.mode!==`combobox`&&!e.open&&!e.showSearch?!1:!!i.value||e.compositionStatus),s=J(()=>{let t=e.values[0];return t&&(typeof t.label==`string`||typeof t.label==`number`)?t.label.toString():void 0}),c=()=>{if(e.values[0])return null;let t=o.value?{visibility:`hidden`}:void 0;return U(`span`,{class:`${e.prefixCls}-selection-placeholder`,style:t},[e.placeholder])},l=n=>{n.target.composing||(t.value=!0,e.onInputChange(n))};return()=>{let{inputElement:t,prefixCls:u,id:d,values:f,inputRef:p,disabled:m,autofocus:h,autocomplete:g,activeDescendantId:_,open:v,tabindex:y,optionLabelRender:b,onInputKeyDown:x,onInputMouseDown:S,onInputPaste:C,onInputCompositionStart:w,onInputCompositionEnd:T}=e,E=f[0],D=null;if(E&&a.customSlots){let e=E.key??E.value,t=a.keyEntities[e]?.node||{};D=a.customSlots[t.slots?.title]||a.customSlots.title||E.label,typeof D==`function`&&(D=D(t))}else D=b&&E?b(E.option):E?.label;return U($e,null,[U(`span`,{class:`${u}-selection-search`},[U(Fu,{inputRef:p,prefixCls:u,id:d,open:v,inputElement:t,disabled:m,autofocus:h,autocomplete:g,editable:r.value,activeDescendantId:_,value:i.value,onKeydown:x,onMousedown:S,onChange:l,onPaste:C,onCompositionstart:w,onCompositionend:T,tabindex:y,attrs:Bu(e,!0)},null)]),!n.value&&E&&!o.value&&U(`span`,{class:`${u}-selection-item`,title:s.value},[U($e,{key:E.key??E.value},[D])]),c()])}}});cd.props=sd,cd.inheritAttrs=!1;function ld(e){return![$.ESC,$.SHIFT,$.BACKSPACE,$.TAB,$.WIN_KEY,$.ALT,$.META,$.WIN_KEY_RIGHT,$.CTRL,$.SEMICOLON,$.EQUALS,$.CAPS_LOCK,$.CONTEXT_MENU,$.F1,$.F2,$.F3,$.F4,$.F5,$.F6,$.F7,$.F8,$.F9,$.F10,$.F11,$.F12].includes(e)}function ud(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=null,n;ut(()=>{clearTimeout(n)});function r(r){(r||t===null)&&(t=r),clearTimeout(n),n=setTimeout(()=>{t=null},e)}return[()=>t,r]}function dd(){let e=t=>{e.current=t};return e}var fd=u({name:`Selector`,inheritAttrs:!1,props:{id:String,prefixCls:String,showSearch:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},values:f.array,multiple:{type:Boolean,default:void 0},mode:String,searchValue:String,activeValue:String,inputElement:f.any,autofocus:{type:Boolean,default:void 0},activeDescendantId:String,tabindex:f.oneOfType([f.number,f.string]),disabled:{type:Boolean,default:void 0},placeholder:f.any,removeIcon:f.any,maxTagCount:f.oneOfType([f.number,f.string]),maxTagTextLength:Number,maxTagPlaceholder:f.any,tagRender:Function,optionLabelRender:Function,tokenWithEnter:{type:Boolean,default:void 0},choiceTransitionName:String,onToggleOpen:{type:Function},onSearch:Function,onSearchSubmit:Function,onRemove:Function,onInputKeyDown:{type:Function},domRef:Function},setup(e,t){let{expose:n}=t,r=dd(),i=H(!1),[a,o]=ud(0),s=t=>{let{which:n}=t;(n===$.UP||n===$.DOWN)&&t.preventDefault(),e.onInputKeyDown&&e.onInputKeyDown(t),n===$.ENTER&&e.mode===`tags`&&!i.value&&!e.open&&e.onSearchSubmit(t.target.value),ld(n)&&e.onToggleOpen(!0)},c=()=>{o(!0)},l=null,u=t=>{e.onSearch(t,!0,i.value)!==!1&&e.onToggleOpen(!0)},d=()=>{i.value=!0},f=t=>{i.value=!1,e.mode!==`combobox`&&u(t.target.value)},p=t=>{let{target:{value:n}}=t;if(e.tokenWithEnter&&l&&/[\r\n]/.test(l)){let e=l.replace(/[\r\n]+$/,``).replace(/\r\n/g,` `).replace(/[\r\n]/g,` `);n=n.replace(e,l)}l=null,u(n)},m=e=>{let{clipboardData:t}=e;l=t.getData(`text`)},h=e=>{let{target:t}=e;t!==r.current&&(document.body.style.msTouchAction===void 0?r.current.focus():setTimeout(()=>{r.current.focus()}))},g=t=>{let n=a();t.target!==r.current&&!n&&t.preventDefault(),(e.mode!==`combobox`&&(!e.showSearch||!n)||!e.open)&&(e.open&&e.onSearch(``,!0,!1),e.onToggleOpen())};return n({focus:()=>{r.current.focus()},blur:()=>{r.current.blur()}}),()=>{let{prefixCls:t,domRef:n,mode:a}=e,o={inputRef:r,onInputKeyDown:s,onInputMouseDown:c,onInputChange:p,onInputPaste:m,compositionStatus:i.value,onInputCompositionStart:d,onInputCompositionEnd:f},l=U(a===`multiple`||a===`tags`?od:cd,Y(Y({},e),o),null);return U(`div`,{ref:n,class:`${t}-selector`,onClick:h,onMousedown:g},[l])}}});function pd(e,t,n){function r(r){let i=r.target;i.shadowRoot&&r.composed&&(i=r.composedPath()[0]||i);let a=[e[0]?.value,(e[1]?.value)?.getPopupElement()];t.value&&a.every(e=>e&&!e.contains(i)&&e!==i)&&n(!1)}V(()=>{window.addEventListener(`mousedown`,r)}),ut(()=>{window.removeEventListener(`mousedown`,r)})}function md(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=q(!1),n,r=()=>{clearTimeout(n)};return V(()=>{r()}),[t,(i,a)=>{r(),n=setTimeout(()=>{t.value=i,a&&a()},e)},r]}var hd=Symbol(`BaseSelectContextKey`);function gd(e){return fe(hd,e)}function _d(){return g(hd,{})}var vd=(()=>{if(typeof navigator>`u`||typeof window>`u`)return!1;let e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e?.substring(0,4))});function yd(e){return Ae(e)?Ne(new Proxy({},{get(t,n,r){return Reflect.get(e.value,n,r)},set(t,n,r){return e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):Ne(e)}var bd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({prefixCls:String,id:String,omitDomProps:Array,displayValues:Array,onDisplayValuesChange:Function,activeValue:String,activeDescendantId:String,onActiveValueChange:Function,searchValue:String,onSearch:Function,onSearchSplit:Function,maxLength:Number,OptionList:f.any,emptyOptions:Boolean}),Cd=()=>({showSearch:{type:Boolean,default:void 0},tagRender:{type:Function},optionLabelRender:{type:Function},direction:{type:String},tabindex:Number,autofocus:Boolean,notFoundContent:f.any,placeholder:f.any,onClear:Function,choiceTransitionName:String,mode:String,disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{type:Function},getInputElement:{type:Function},getRawInputElement:{type:Function},maxTagTextLength:Number,maxTagCount:{type:[String,Number]},maxTagPlaceholder:f.any,tokenSeparators:{type:Array},allowClear:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},inputIcon:f.any,clearIcon:f.any,removeIcon:f.any,animation:String,transitionName:String,dropdownStyle:{type:Object},dropdownClassName:String,dropdownMatchSelectWidth:{type:[Boolean,Number],default:void 0},dropdownRender:{type:Function},dropdownAlign:Object,placement:{type:String},getPopupContainer:{type:Function},showAction:{type:Array},onBlur:{type:Function},onFocus:{type:Function},onKeyup:Function,onKeydown:Function,onMousedown:Function,onPopupScroll:Function,onInputKeyDown:Function,onMouseenter:Function,onMouseleave:Function,onClick:Function}),wd=()=>Z(Z({},Sd()),Cd());function Td(e){return e===`tags`||e===`multiple`}var Ed=u({compatConfig:{MODE:3},name:`BaseSelect`,inheritAttrs:!1,props:Zn(wd(),{showAction:[],notFoundContent:`Not Found`}),setup(e,t){let{attrs:n,expose:r,slots:i}=t,a=J(()=>Td(e.mode)),o=J(()=>e.showSearch===void 0?a.value||e.mode===`combobox`:e.showSearch),s=q(!1);V(()=>{s.value=vd()});let c=rd(),l=q(null),u=dd(),d=q(null),f=q(null),p=q(null),m=H(!1),[h,g,_]=md();r({focus:()=>{var e;(e=f.value)==null||e.focus()},blur:()=>{var e;(e=f.value)==null||e.blur()},scrollTo:e=>p.value?.scrollTo(e)});let v=J(()=>{if(e.mode!==`combobox`)return e.searchValue;let t=e.displayValues[0]?.value;return typeof t==`string`||typeof t==`number`?String(t):``}),y=e.open===void 0?e.defaultOpen:e.open,b=q(y),x=q(y),C=t=>{b.value=e.open===void 0?t:e.open,x.value=b.value};G(()=>e.open,()=>{C(e.open)});let w=J(()=>!e.notFoundContent&&e.emptyOptions);S(()=>{x.value=b.value,(e.disabled||w.value&&x.value&&e.mode===`combobox`)&&(x.value=!1)});let T=J(()=>!w.value&&x.value),E=t=>{let n=t===void 0?!x.value:t;x.value!==n&&!e.disabled&&(C(n),e.onDropdownVisibleChange&&e.onDropdownVisibleChange(n),!n&&L.value&&(L.value=!1,g(!1,()=>{F.value=!1,m.value=!1})))},D=J(()=>(e.tokenSeparators||[]).some(e=>[` +`,`\r +`].includes(e))),O=(t,n,r)=>{var i,a;let o=!0,s=t;(i=e.onActiveValueChange)==null||i.call(e,null);let c=r?null:Ci(t,e.tokenSeparators);return e.mode!==`combobox`&&c&&(s=``,(a=e.onSearchSplit)==null||a.call(e,c),E(!1),o=!1),e.onSearch&&v.value!==s&&e.onSearch(s,{source:n?`typing`:`effect`}),o},k=t=>{var n;!t||!t.trim()||(n=e.onSearch)==null||n.call(e,t,{source:`submit`})};G(x,()=>{!x.value&&!a.value&&e.mode!==`combobox`&&O(``,!1,!1)},{immediate:!0,flush:`post`}),G(()=>e.disabled,()=>{b.value&&e.disabled&&C(!1),e.disabled&&!m.value&&g(!1)},{immediate:!0});let[A,j]=ud(),M=function(t){var n;let r=A(),{which:i}=t;if(i===$.ENTER&&(e.mode!==`combobox`&&t.preventDefault(),x.value||E(!0)),j(!!v.value),i===$.BACKSPACE&&!r&&a.value&&!v.value&&e.displayValues.length){let t=[...e.displayValues],n=null;for(let e=t.length-1;e>=0;--e){let r=t[e];if(!r.disabled){t.splice(e,1),n=r;break}}n&&e.onDisplayValuesChange(t,{type:`remove`,values:[n]})}var o=[...arguments].slice(1);x.value&&p.value&&p.value.onKeydown(t,...o),(n=e.onKeydown)==null||n.call(e,t,...o)},N=function(t){var n=[...arguments].slice(1);x.value&&p.value&&p.value.onKeyup(t,...n),e.onKeyup&&e.onKeyup(t,...n)},P=t=>{let n=e.displayValues.filter(e=>e!==t);e.onDisplayValuesChange(n,{type:`remove`,values:[t]})},F=q(!1),I=function(){g(!0),e.disabled||(e.onFocus&&!F.value&&e.onFocus(...arguments),e.showAction&&e.showAction.includes(`focus`)&&E(!0)),F.value=!0},L=H(!1),ee=function(){if(L.value||(m.value=!0,g(!1,()=>{F.value=!1,m.value=!1,E(!1)}),e.disabled))return;let t=v.value;t&&(e.mode===`tags`?e.onSearch(t,{source:`submit`}):e.mode===`multiple`&&e.onSearch(``,{source:`blur`})),e.onBlur&&e.onBlur(...arguments)},te=()=>{L.value=!0},ne=()=>{L.value=!1};fe(`VCSelectContainerEvent`,{focus:I,blur:ee});let R=[];V(()=>{R.forEach(e=>clearTimeout(e)),R.splice(0,R.length)}),ut(()=>{R.forEach(e=>clearTimeout(e)),R.splice(0,R.length)});let re=function(t){var n;let{target:r}=t,i=d.value?.getPopupElement();if(i&&i.contains(r)){let e=setTimeout(()=>{var t;let n=R.indexOf(e);n!==-1&&R.splice(n,1),_(),!s.value&&!i.contains(document.activeElement)&&((t=f.value)==null||t.focus())});R.push(e)}var a=[...arguments].slice(1);(n=e.onMousedown)==null||n.call(e,t,...a)},ie=q(null),ae=()=>{};return V(()=>{G(T,()=>{if(T.value){let e=Math.ceil(l.value?.offsetWidth);ie.value!==e&&!Number.isNaN(e)&&(ie.value=e)}},{immediate:!0,flush:`post`})}),pd([l,d],T,E),gd(yd(Z(Z({},Ft(e)),{open:x,triggerOpen:T,showSearch:o,multiple:a,toggleOpen:E}))),()=>{let t=Z(Z({},e),n),{prefixCls:r,id:s,open:m,defaultOpen:g,mode:_,showSearch:y,searchValue:b,onSearch:S,allowClear:C,clearIcon:w,showArrow:A,inputIcon:j,disabled:F,loading:I,getInputElement:L,getPopupContainer:ee,placement:R,animation:oe,transitionName:z,dropdownStyle:se,dropdownClassName:B,dropdownMatchSelectWidth:V,dropdownRender:ce,dropdownAlign:le,showAction:H,direction:ue,tokenSeparators:de,tagRender:fe,optionLabelRender:pe,onPopupScroll:me,onDropdownVisibleChange:he,onFocus:ge,onBlur:_e,onKeyup:W,onKeydown:ve,onMousedown:ye,onClear:be,omitDomProps:xe,getRawInputElement:Se,displayValues:Ce,onDisplayValuesChange:we,emptyOptions:G,activeDescendantId:Te,activeValue:Ee,OptionList:De}=t,Oe=bd(t,`prefixCls.id.open.defaultOpen.mode.showSearch.searchValue.onSearch.allowClear.clearIcon.showArrow.inputIcon.disabled.loading.getInputElement.getPopupContainer.placement.animation.transitionName.dropdownStyle.dropdownClassName.dropdownMatchSelectWidth.dropdownRender.dropdownAlign.showAction.direction.tokenSeparators.tagRender.optionLabelRender.onPopupScroll.onDropdownVisibleChange.onFocus.onBlur.onKeyup.onKeydown.onMousedown.onClear.omitDomProps.getRawInputElement.displayValues.onDisplayValuesChange.emptyOptions.activeDescendantId.activeValue.OptionList`.split(`.`)),ke=_===`combobox`&&L&&L()||null,Ae=typeof Se==`function`&&Se(),je=Z({},Oe),Me;Ae&&(Me=e=>{E(e)}),xd.forEach(e=>{delete je[e]}),xe?.forEach(e=>{delete je[e]});let Ne=A===void 0?I||!a.value&&_!==`combobox`:A,Pe;Ne&&(Pe=U(Eu,{class:K(`${r}-arrow`,{[`${r}-arrow-loading`]:I}),customizeIcon:j,customizeIconProps:{loading:I,searchValue:v.value,open:x.value,focused:h.value,showSearch:o.value}},null));let Fe;!F&&C&&(Ce.length||v.value)&&(Fe=U(Eu,{class:`${r}-clear`,onMousedown:()=>{be?.(),we([],{type:`clear`,values:Ce}),O(``,!1,!1)},customizeIcon:w},{default:()=>[en(`×`)]}));let Ie=U(De,{ref:p},Z(Z({},c.customSlots),{option:i.option})),Le=K(r,n.class,{[`${r}-focused`]:h.value,[`${r}-multiple`]:a.value,[`${r}-single`]:!a.value,[`${r}-allow-clear`]:C,[`${r}-show-arrow`]:Ne,[`${r}-disabled`]:F,[`${r}-loading`]:I,[`${r}-open`]:x.value,[`${r}-customize-input`]:ke,[`${r}-show-search`]:o.value}),Re=U(Tu,{ref:d,disabled:F,prefixCls:r,visible:T.value,popupElement:Ie,containerWidth:ie.value,animation:oe,transitionName:z,dropdownStyle:se,dropdownClassName:B,direction:ue,dropdownMatchSelectWidth:V,dropdownRender:ce,dropdownAlign:le,placement:R,getPopupContainer:ee,empty:G,getTriggerDOMNode:()=>u.current,onPopupVisibleChange:Me,onPopupMouseEnter:ae,onPopupFocusin:te,onPopupFocusout:ne},{default:()=>Ae?Nt(Ae)&&ao(Ae,{ref:u},!1,!0):U(fd,Y(Y({},e),{},{domRef:u,prefixCls:r,inputElement:ke,ref:f,id:s,showSearch:o.value,mode:_,activeDescendantId:Te,tagRender:fe,optionLabelRender:pe,values:Ce,open:x.value,onToggleOpen:E,activeValue:Ee,searchValue:v.value,onSearch:O,onSearchSubmit:k,onRemove:P,tokenWithEnter:D.value}),null)}),ze;return ze=Ae?Re:U(`div`,Y(Y({},je),{},{class:Le,ref:l,onMousedown:re,onKeydown:M,onKeyup:N}),[h.value&&!x.value&&U(`span`,{style:{width:0,height:0,position:`absolute`,overflow:`hidden`,opacity:0},"aria-live":`polite`},[`${Ce.map(e=>{let{label:t,value:n}=e;return[`number`,`string`].includes(typeof t)?t:n}).join(`, `)}`]),Re,Pe,Fe]),ze}}}),Dd=(e,t)=>{let{height:n,offset:r,prefixCls:i,onInnerResize:a}=e,{slots:o}=t,s={},c={display:`flex`,flexDirection:`column`};return r!==void 0&&(s={height:`${n}px`,position:`relative`,overflow:`hidden`},c=Z(Z({},c),{transform:`translateY(${r}px)`,position:`absolute`,left:0,right:0,top:0})),U(`div`,{style:s},[U(Qn,{onResize:e=>{let{offsetHeight:t}=e;t&&a&&a()}},{default:()=>[U(`div`,{style:c,class:K({[`${i}-holder-inner`]:i})},[o.default?.call(o)])]})])};Dd.displayName=`Filter`,Dd.inheritAttrs=!1,Dd.props={prefixCls:String,height:Number,offset:Number,onInnerResize:Function};var Od=(e,t)=>{let{setRef:n}=e,{slots:r}=t,i=ce(r.default?.call(r));return i&&i.length?it(i[0],{ref:n}):i};Od.props={setRef:{type:Function,default:()=>{}}};var kd=20;function Ad(e){return`touches`in e?e.touches[0].pageY:e.pageY}var jd=u({compatConfig:{MODE:3},name:`ScrollBar`,inheritAttrs:!1,props:{prefixCls:String,scrollTop:Number,scrollHeight:Number,height:Number,count:Number,onScroll:{type:Function},onStartMove:{type:Function},onStopMove:{type:Function}},setup(){return{moveRaf:null,scrollbarRef:dd(),thumbRef:dd(),visibleTimeout:null,state:Ne({dragging:!1,pageY:null,startTop:null,visible:!1})}},watch:{scrollTop:{handler(){this.delayHidden()},flush:`post`}},mounted(){var e,t;(e=this.scrollbarRef.current)==null||e.addEventListener(`touchstart`,this.onScrollbarTouchStart,sr?{passive:!1}:!1),(t=this.thumbRef.current)==null||t.addEventListener(`touchstart`,this.onMouseDown,sr?{passive:!1}:!1)},beforeUnmount(){this.removeEvents(),clearTimeout(this.visibleTimeout)},methods:{delayHidden(){clearTimeout(this.visibleTimeout),this.state.visible=!0,this.visibleTimeout=setTimeout(()=>{this.state.visible=!1},2e3)},onScrollbarTouchStart(e){e.preventDefault()},onContainerMouseDown(e){e.stopPropagation(),e.preventDefault()},patchEvents(){window.addEventListener(`mousemove`,this.onMouseMove),window.addEventListener(`mouseup`,this.onMouseUp),this.thumbRef.current.addEventListener(`touchmove`,this.onMouseMove,sr?{passive:!1}:!1),this.thumbRef.current.addEventListener(`touchend`,this.onMouseUp)},removeEvents(){window.removeEventListener(`mousemove`,this.onMouseMove),window.removeEventListener(`mouseup`,this.onMouseUp),this.scrollbarRef.current.removeEventListener(`touchstart`,this.onScrollbarTouchStart,sr?{passive:!1}:!1),this.thumbRef.current&&(this.thumbRef.current.removeEventListener(`touchstart`,this.onMouseDown,sr?{passive:!1}:!1),this.thumbRef.current.removeEventListener(`touchmove`,this.onMouseMove,sr?{passive:!1}:!1),this.thumbRef.current.removeEventListener(`touchend`,this.onMouseUp)),ir.cancel(this.moveRaf)},onMouseDown(e){let{onStartMove:t}=this.$props;Z(this.state,{dragging:!0,pageY:Ad(e),startTop:this.getTop()}),t(),this.patchEvents(),e.stopPropagation(),e.preventDefault()},onMouseMove(e){let{dragging:t,pageY:n,startTop:r}=this.state,{onScroll:i}=this.$props;if(ir.cancel(this.moveRaf),t){let t=r+(Ad(e)-n),a=this.getEnableScrollRange(),o=this.getEnableHeightRange(),s=o?t/o:0,c=Math.ceil(s*a);this.moveRaf=ir(()=>{i(c)})}},onMouseUp(){let{onStopMove:e}=this.$props;this.state.dragging=!1,e(),this.removeEvents()},getSpinHeight(){let{height:e,scrollHeight:t}=this.$props,n=e/t*100;return n=Math.max(n,kd),n=Math.min(n,e/2),Math.floor(n)},getEnableScrollRange(){let{scrollHeight:e,height:t}=this.$props;return e-t||0},getEnableHeightRange(){let{height:e}=this.$props;return e-this.getSpinHeight()||0},getTop(){let{scrollTop:e}=this.$props,t=this.getEnableScrollRange(),n=this.getEnableHeightRange();return e===0||t===0?0:e/t*n},showScroll(){let{height:e,scrollHeight:t}=this.$props;return t>e}},render(){let{dragging:e,visible:t}=this.state,{prefixCls:n}=this.$props,r=this.getSpinHeight()+`px`,i=this.getTop()+`px`,a=this.showScroll(),o=a&&t;return U(`div`,{ref:this.scrollbarRef,class:K(`${n}-scrollbar`,{[`${n}-scrollbar-show`]:a}),style:{width:`8px`,top:0,bottom:0,right:0,position:`absolute`,display:o?void 0:`none`},onMousedown:this.onContainerMouseDown,onMousemove:this.delayHidden},[U(`div`,{ref:this.thumbRef,class:K(`${n}-scrollbar-thumb`,{[`${n}-scrollbar-thumb-moving`]:e}),style:{width:`100%`,height:r,top:i,left:0,position:`absolute`,background:`rgba(0, 0, 0, 0.5)`,borderRadius:`99px`,cursor:`pointer`,userSelect:`none`},onMousedown:this.onMouseDown},null)])}});function Md(e,t,n,r){let i=new Map,a=new Map,o=H(Symbol(`update`));G(e,()=>{o.value=Symbol(`update`)});let s;function c(){ir.cancel(s)}function l(){c(),s=ir(()=>{i.forEach((e,t)=>{if(e&&e.offsetParent){let{offsetHeight:n}=e;a.get(t)!==n&&(o.value=Symbol(`update`),a.set(t,e.offsetHeight))}})})}function u(e,a){let o=t(e),s=i.get(o);a?(i.set(o,a.$el||a),l()):i.delete(o),!s!=!a&&(a?n?.(e):r?.(e))}return y(()=>{c()}),[u,l,a,o]}function Nd(e,t,n,r,i,a,o,s){let c;return l=>{if(l==null){s();return}ir.cancel(c);let u=t.value,d=r.itemHeight;if(typeof l==`number`)o(l);else if(l&&typeof l==`object`){let t,{align:r}=l;`index`in l?{index:t}=l:t=u.findIndex(e=>i(e)===l.key);let{offset:s=0}=l,f=(l,p)=>{if(l<0||!e.value)return;let m=e.value.clientHeight,h=!1,g=p;if(m){let a=p||r,c=0,l=0,f=0,_=Math.min(u.length,t);for(let e=0;e<=_;e+=1){let r=i(u[e]);l=c;let a=n.get(r);f=l+(a===void 0?d:a),c=f,e===t&&a===void 0&&(h=!0)}let v=e.value.scrollTop,y=null;switch(a){case`top`:y=l-s;break;case`bottom`:y=f-m+s;break;default:{let e=v+m;le&&(g=`bottom`)}}y!==null&&y!==v&&o(y)}c=ir(()=>{h&&a(),f(l-1,g)},2)};f(5)}}}var Pd=typeof navigator==`object`&&/Firefox/i.test(navigator.userAgent),Fd=((e,t)=>{let n=!1,r=null;function i(){clearTimeout(r),n=!0,r=setTimeout(()=>{n=!1},50)}return function(a){let o=arguments.length>1&&arguments[1]!==void 0&&arguments[1],s=a<0&&e.value||a>0&&t.value;return o&&s?(clearTimeout(r),n=!1):(!s||n)&&i(),!n&&s}});function Id(e,t,n,r){let i=0,a=null,o=null,s=!1,c=Fd(t,n);function l(t){if(!e.value)return;ir.cancel(a);let{deltaY:n}=t;i+=n,o=n,!c(n)&&(Pd||t.preventDefault(),a=ir(()=>{r(i*(s?10:1)),i=0}))}function u(t){e.value&&(s=t.detail===o)}return[l,u]}var Ld=14/15;function Rd(e,t,n){let r=!1,i=0,a=null,o=null,s=()=>{a&&(a.removeEventListener(`touchmove`,c),a.removeEventListener(`touchend`,l))},c=e=>{if(r){let t=Math.ceil(e.touches[0].pageY),r=i-t;i=t,n(r)&&e.preventDefault(),clearInterval(o),o=setInterval(()=>{r*=Ld,(!n(r,!0)||Math.abs(r)<=.1)&&clearInterval(o)},16)}},l=()=>{r=!1,s()},u=e=>{s(),e.touches.length===1&&!r&&(r=!0,i=Math.ceil(e.touches[0].pageY),a=e.target,a.addEventListener(`touchmove`,c,{passive:!1}),a.addEventListener(`touchend`,l))},d=()=>{};V(()=>{document.addEventListener(`touchmove`,d,{passive:!1}),G(e,e=>{t.value.removeEventListener(`touchstart`,u),s(),clearInterval(o),e&&t.value.addEventListener(`touchstart`,u,{passive:!1})},{immediate:!0})}),ut(()=>{document.removeEventListener(`touchmove`,d)})}var zd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let a=i(e,t+n,{});return U(Od,{key:o(e),setRef:t=>r(e,t)},{default:()=>[a]})})}var Ud=u({compatConfig:{MODE:3},name:`List`,inheritAttrs:!1,props:{prefixCls:String,data:f.array,height:Number,itemHeight:Number,fullHeight:{type:Boolean,default:void 0},itemKey:{type:[String,Number,Function],required:!0},component:{type:[String,Object]},virtual:{type:Boolean,default:void 0},children:Function,onScroll:Function,onMousedown:Function,onMouseenter:Function,onVisibleChange:Function},setup(e,t){let{expose:n}=t,r=J(()=>{let{height:t,itemHeight:n,virtual:r}=e;return!!(r!==!1&&t&&n)}),i=J(()=>{let{height:t,itemHeight:n,data:i}=e;return r.value&&i&&n*i.length>t}),a=Ne({scrollTop:0,scrollMoving:!1}),o=J(()=>e.data||Bd),s=q([]);G(o,()=>{s.value=Ht(o.value).slice()},{immediate:!0});let c=q(e=>void 0);G(()=>e.itemKey,e=>{typeof e==`function`?c.value=e:c.value=t=>t?.[e]},{immediate:!0});let l=q(),u=q(),d=q(),f=e=>c.value(e),p={getKey:f};function m(e){let t;t=typeof e==`function`?e(a.scrollTop):e;let n=C(t);l.value&&(l.value.scrollTop=n),a.scrollTop=n}let[h,g,_,v]=Md(s,f,null,null),y=Ne({scrollHeight:void 0,start:0,end:0,offset:void 0}),b=q(0);V(()=>{z(()=>{b.value=u.value?.offsetHeight||0})}),O(()=>{z(()=>{b.value=u.value?.offsetHeight||0})}),G([r,s],()=>{r.value||Z(y,{scrollHeight:void 0,start:0,end:s.value.length-1,offset:void 0})},{immediate:!0}),G([r,s,b,i],()=>{r.value&&!i.value&&Z(y,{scrollHeight:b.value,start:0,end:s.value.length-1,offset:void 0}),l.value&&(a.scrollTop=l.value.scrollTop)},{immediate:!0}),G([i,r,()=>a.scrollTop,s,v,()=>e.height,b],()=>{if(!r.value||!i.value)return;let t=0,n,o,c,l=s.value.length,u=s.value,d=a.scrollTop,{itemHeight:p,height:m}=e,h=d+m;for(let e=0;e=d&&(n=e,o=t),c===void 0&&s>h&&(c=e),t=s}n===void 0&&(n=0,o=0,c=Math.ceil(m/p)),c===void 0&&(c=l-1),c=Math.min(c+1,l),Z(y,{scrollHeight:t,start:n,end:c,offset:o})},{immediate:!0});let x=J(()=>y.scrollHeight-e.height);function C(e){let t=e;return Number.isNaN(x.value)||(t=Math.min(t,x.value)),t=Math.max(t,0),t}let w=J(()=>a.scrollTop<=0),T=J(()=>a.scrollTop>=x.value),E=Fd(w,T);function D(e){m(e)}function k(t){var n;let{scrollTop:r}=t.currentTarget;r!==a.scrollTop&&m(r),(n=e.onScroll)==null||n.call(e,t)}let[A,j]=Id(r,w,T,e=>{m(t=>t+e)});Rd(r,l,(e,t)=>E(e,t)?!1:(A({preventDefault(){},deltaY:e}),!0));function M(e){r.value&&e.preventDefault()}let N=()=>{l.value&&(l.value.removeEventListener(`wheel`,A,sr?{passive:!1}:!1),l.value.removeEventListener(`DOMMouseScroll`,j),l.value.removeEventListener(`MozMousePixelScroll`,M))};S(()=>{z(()=>{l.value&&(N(),l.value.addEventListener(`wheel`,A,sr?{passive:!1}:!1),l.value.addEventListener(`DOMMouseScroll`,j),l.value.addEventListener(`MozMousePixelScroll`,M))})}),ut(()=>{N()}),n({scrollTo:Nd(l,s,_,e,f,g,m,()=>{var e;(e=d.value)==null||e.delayHidden()})});let P=J(()=>{let t=null;return e.height&&(t=Z({[e.fullHeight?`height`:`maxHeight`]:e.height+`px`},Vd),r.value&&(t.overflowY=`hidden`,a.scrollMoving&&(t.pointerEvents=`none`))),t});return G([()=>y.start,()=>y.end,s],()=>{if(e.onVisibleChange){let t=s.value.slice(y.start,y.end+1);e.onVisibleChange(t,s.value)}},{flush:`post`}),{state:a,mergedData:s,componentStyle:P,onFallbackScroll:k,onScrollBar:D,componentRef:l,useVirtual:r,calRes:y,collectHeight:g,setInstance:h,sharedConfig:p,scrollBarRef:d,fillerInnerRef:u,delayHideScrollBar:()=>{var e;(e=d.value)==null||e.delayHidden()}}},render(){let e=Z(Z({},this.$props),this.$attrs),{prefixCls:t=`rc-virtual-list`,height:n,itemHeight:r,fullHeight:i,data:a,itemKey:o,virtual:s,component:c=`div`,onScroll:l,children:u=this.$slots.default,style:d,class:f}=e,p=zd(e,[`prefixCls`,`height`,`itemHeight`,`fullHeight`,`data`,`itemKey`,`virtual`,`component`,`onScroll`,`children`,`style`,`class`]),m=K(t,f),{scrollTop:h}=this.state,{scrollHeight:g,offset:_,start:v,end:y}=this.calRes,{componentStyle:b,onFallbackScroll:x,onScrollBar:S,useVirtual:C,collectHeight:w,sharedConfig:T,setInstance:E,mergedData:D,delayHideScrollBar:O}=this;return U(`div`,Y({style:Z(Z({},d),{position:`relative`}),class:m},p),[U(c,{class:`${t}-holder`,style:b,ref:`componentRef`,onScroll:x,onMouseenter:O},{default:()=>[U(Dd,{prefixCls:t,height:g,offset:_,onInnerResize:w,ref:`fillerInnerRef`},{default:()=>Hd(D,v,y,E,u,T)})]}),C&&U(jd,{ref:`scrollBarRef`,prefixCls:t,scrollTop:h,height:n,scrollHeight:g,count:D.length,onScroll:S,onStartMove:()=>{this.state.scrollMoving=!0},onStopMove:()=>{this.state.scrollMoving=!1}},null)])}});function Wd(e,t,n){let r=H(e());return G(t,(t,i)=>{n?n(t,i)&&(r.value=e()):r.value=e()}),r}function Gd(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Kd=Symbol(`SelectContextKey`);function qd(e){return fe(Kd,e)}function Jd(){return g(Kd,{})}var Yd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i`${i.prefixCls}-item`),s=Wd(()=>a.flattenOptions,[()=>i.open,()=>a.flattenOptions],e=>e[0]),c=dd(),l=e=>{e.preventDefault()},u=e=>{c.current&&c.current.scrollTo(typeof e==`number`?{index:e}:e)},d=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=s.value.length;for(let r=0;r1&&arguments[1]!==void 0&&arguments[1];f.activeIndex=e;let n={source:t?`keyboard`:`mouse`},r=s.value[e];if(!r){a.onActiveValue(null,-1,n);return}a.onActiveValue(r.value,e,n)};G([()=>s.value.length,()=>i.searchValue],()=>{p(a.defaultActiveFirstOption===!1?-1:d(0))},{immediate:!0});let m=e=>a.rawValues.has(e)&&i.mode!==`combobox`;G([()=>i.open,()=>i.searchValue],()=>{if(!i.multiple&&i.open&&a.rawValues.size===1){let e=Array.from(a.rawValues)[0],t=Ht(s.value).findIndex(t=>{let{data:n}=t;return n[a.fieldNames.value]===e});t!==-1&&(p(t),z(()=>{u(t)}))}i.open&&z(()=>{var e;(e=c.current)==null||e.scrollTo(void 0)})},{immediate:!0,flush:`post`});let h=e=>{e!==void 0&&a.onSelect(e,{selected:!a.rawValues.has(e)}),i.multiple||i.toggleOpen(!1)},g=e=>typeof e.label==`function`?e.label():e.label;function _(e){let t=s.value[e];if(!t)return null;let n=t.data||{},{value:r}=n,{group:a}=t,o=Bu(n,!0),c=g(t);return t?U(`div`,Y(Y({"aria-label":typeof c==`string`&&!a?c:null},o),{},{key:e,role:a?`presentation`:`option`,id:`${i.id}_list_${e}`,"aria-selected":m(r)}),[r]):null}return n({onKeydown:e=>{let{which:t,ctrlKey:n}=e;switch(t){case $.N:case $.P:case $.UP:case $.DOWN:{let e=0;if(t===$.UP?e=-1:t===$.DOWN?e=1:Gd()&&n&&(t===$.N?e=1:t===$.P&&(e=-1)),e!==0){let t=d(f.activeIndex+e,e);u(t),p(t,!0)}break}case $.ENTER:{let t=s.value[f.activeIndex];t&&!t.data.disabled?h(t.value):h(void 0),i.open&&e.preventDefault();break}case $.ESC:i.toggleOpen(!1),i.open&&e.stopPropagation()}},onKeyup:()=>{},scrollTo:e=>{u(e)}}),()=>{let{id:e,notFoundContent:t,onPopupScroll:n}=i,{menuItemSelectedIcon:u,fieldNames:d,virtual:v,listHeight:y,listItemHeight:b}=a,x=r.option,{activeIndex:S}=f,C=Object.keys(d).map(e=>d[e]);return s.value.length===0?U(`div`,{role:`listbox`,id:`${e}_list`,class:`${o.value}-empty`,onMousedown:l},[t]):U($e,null,[U(`div`,{role:`listbox`,id:`${e}_list`,style:{height:0,width:0,overflow:`hidden`}},[_(S-1),_(S),_(S+1)]),U(Ud,{itemKey:`key`,ref:c,data:s.value,height:y,itemHeight:b,fullHeight:!1,onMousedown:l,onScroll:n,virtual:v},{default:(e,t)=>{let{group:n,groupOption:r,data:i,value:a}=e,{key:s}=i,c=typeof e.label==`function`?e.label():e.label;if(n){let e=i.title??(Xd(c)&&c);return U(`div`,{class:K(o.value,`${o.value}-group`),title:e},[x?x(i):c===void 0?s:c])}let{disabled:l,title:d,children:f,style:_,class:v,className:y}=i,b=Yd(i,[`disabled`,`title`,`children`,`style`,`class`,`className`]),w=Br(b,C),T=m(a),E=`${o.value}-option`,D=K(o.value,E,v,y,{[`${E}-grouped`]:r,[`${E}-active`]:S===t&&!l,[`${E}-disabled`]:l,[`${E}-selected`]:T}),O=g(e),k=!u||typeof u==`function`||T,A=typeof O==`number`?O:O||a,j=Xd(A)?A.toString():void 0;return d!==void 0&&(j=d),U(`div`,Y(Y({},w),{},{"aria-selected":T,class:D,title:j,onMousemove:e=>{b.onMousemove&&b.onMousemove(e),!(S===t||l)&&p(t)},onClick:e=>{l||h(a),b.onClick&&b.onClick(e)},style:_}),[U(`div`,{class:`${E}-content`},[x?x(i):A]),Nt(u)||T,k&&U(Eu,{class:`${o.value}-option-state`,customizeIcon:u,customizeIconProps:{isSelected:T}},{default:()=>[T?`✓`:null]})])}})])}}}),Qd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0&&arguments[1];return ce(e).map((e,n)=>{if(!Nt(e)||!e.type)return null;let{type:{isSelectOptGroup:r},key:i,children:a,props:o}=e;if(t||!r)return $d(e);let s=a&&a.default?a.default():void 0,c=o?.label||a.label?.call(a)||i;return Z(Z({key:`__RC_SELECT_GRP__${i===null?n:String(i)}__`},o),{label:c,options:ef(s||[])})}).filter(e=>e)}function tf(e,t,n){let r=q(),i=q(),a=q(),o=q([]);return G([e,t],()=>{e.value?o.value=Ht(e.value).slice():o.value=ef(t.value)},{immediate:!0,deep:!0}),S(()=>{let e=o.value,t=new Map,s=new Map,c=n.value;function l(e){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(let r=0;r0&&arguments[0]!==void 0?arguments[0]:H(``),t=`rc_select_${af()}`;return e.value||t}function sf(e){return Array.isArray(e)?e:e===void 0?[]:[e]}typeof window<`u`&&window.document&&window.document.documentElement;function cf(e,t){return sf(e).join(``).toUpperCase().includes(t)}var lf=((e,t,n,r,i)=>J(()=>{let a=n.value,o=i?.value,s=r?.value;if(!a||s===!1)return e.value;let{options:c,label:l,value:u}=t.value,d=[],f=typeof s==`function`,p=a.toUpperCase(),m=f?s:(e,t)=>o?cf(t[o],p):t[c]?cf(t[l===`children`?`label`:l],p):cf(t[u],p),h=f?e=>Si(e):e=>e;return e.value.forEach(e=>{if(e[c]){if(m(a,h(e)))d.push(e);else{let t=e[c].filter(e=>m(a,h(e)));t.length&&d.push(Z(Z({},e),{[c]:t}))}return}m(a,h(e))&&d.push(e)}),d})),uf=((e,t)=>{let n=q({values:new Map,options:new Map});return[J(()=>{let{values:r,options:i}=n.value,a=e.value.map(e=>e.label===void 0?Z(Z({},e),{label:r.get(e.value)?.label}):e),o=new Map,s=new Map;return a.forEach(e=>{o.set(e.value,e),s.set(e.value,t.value.get(e.value)||i.get(e.value))}),n.value.values=o,n.value.options=s,a}),e=>t.value.get(e)||n.value.options.get(e)]});function df(e,t){let{defaultValue:n,value:r=H()}=t||{},i=typeof e==`function`?e():e;r.value!==void 0&&(i=ze(r)),n!==void 0&&(i=typeof n==`function`?n():n);let a=H(i),o=H(i);S(()=>{let e=r.value===void 0?a.value:r.value;t.postState&&(e=t.postState(e)),o.value=e});function s(e){let n=o.value;a.value=e,Ht(o.value)!==e&&t.onChange&&t.onChange(e,n)}return G(r,()=>{a.value=r.value}),[o,s]}function ff(e){let t=H(typeof e==`function`?e():e);function n(e){t.value=e}return[t,n]}var pf=[`inputValue`];function mf(){return Z(Z({},Cd()),{prefixCls:String,id:String,backfill:{type:Boolean,default:void 0},fieldNames:Object,inputValue:String,searchValue:String,onSearch:Function,autoClearSearchValue:{type:Boolean,default:void 0},onSelect:Function,onDeselect:Function,filterOption:{type:[Boolean,Function],default:void 0},filterSort:Function,optionFilterProp:String,optionLabelProp:String,options:Array,defaultActiveFirstOption:{type:Boolean,default:void 0},virtual:{type:Boolean,default:void 0},listHeight:Number,listItemHeight:Number,menuItemSelectedIcon:f.any,mode:String,labelInValue:{type:Boolean,default:void 0},value:f.any,defaultValue:f.any,onChange:Function,children:Array})}function hf(e){return!e||typeof e!=`object`}var gf=u({compatConfig:{MODE:3},name:`VcSelect`,inheritAttrs:!1,props:Zn(mf(),{prefixCls:`vc-select`,autoClearSearchValue:!0,listHeight:200,listItemHeight:20,dropdownMatchSelectWidth:!0}),setup(e,t){let{expose:n,attrs:r,slots:i}=t,a=of(St(e,`id`)),o=J(()=>Td(e.mode)),s=J(()=>!!(!e.options&&e.children)),c=J(()=>e.filterOption===void 0&&e.mode===`combobox`?!1:e.filterOption),l=J(()=>bi(e.fieldNames,s.value)),[u,d]=df(``,{value:J(()=>e.searchValue===void 0?e.inputValue:e.searchValue),postState:e=>e||``}),f=tf(St(e,`options`),St(e,`children`),l),{valueOptions:p,labelOptions:m,options:h}=f,g=t=>sf(t).map(t=>{let n,r,i,a;hf(t)?n=t:(i=t.key,r=t.label,n=t.value??i);let o=p.value.get(n);return o&&(r===void 0&&(r=o?.[e.optionLabelProp||l.value.label]),i===void 0&&(i=o?.key??n),a=o?.disabled),{label:r,value:n,key:i,disabled:a,option:o}}),[_,v]=df(e.defaultValue,{value:St(e,`value`)}),[y,b]=uf(J(()=>{let t=g(_.value);return e.mode===`combobox`&&!t[0]?.value?[]:t}),p),x=J(()=>{if(!e.mode&&y.value.length===1){let e=y.value[0];if(e.value===null&&(e.label===null||e.label===void 0))return[]}return y.value.map(e=>Z(Z({},e),{label:(typeof e.label==`function`?e.label():e.label)??e.value}))}),C=J(()=>new Set(y.value.map(e=>e.value)));S(()=>{if(e.mode===`combobox`){let e=y.value[0]?.value;e!=null&&d(String(e))}},{flush:`post`});let w=(e,t)=>{let n=t??e;return{[l.value.value]:e,[l.value.label]:n}},T=q();S(()=>{if(e.mode!==`tags`){T.value=h.value;return}let t=h.value.slice(),n=e=>p.value.has(e);[...y.value].sort((e,t)=>e.value{let r=e.value;n(r)||t.push(w(r,e.label))}),T.value=t});let E=lf(T,l,u,c,St(e,`optionFilterProp`)),D=J(()=>e.mode!==`tags`||!u.value||E.value.some(t=>t[e.optionFilterProp||`value`]===u.value)?E.value:[w(u.value),...E.value]),O=J(()=>e.filterSort?[...D.value].sort((t,n)=>e.filterSort(t,n)):D.value),k=J(()=>xi(O.value,{fieldNames:l.value,childrenAsData:s.value})),A=t=>{let n=g(t);if(v(n),e.onChange&&(n.length!==y.value.length||n.some((e,t)=>y.value[t]?.value!==e?.value))){let t=e.labelInValue?n.map(e=>Z(Z({},e),{originLabel:e.label,label:typeof e.label==`function`?e.label():e.label})):n.map(e=>e.value),r=n.map(e=>Si(b(e.value)));e.onChange(o.value?t:t[0],o.value?r:r[0])}},[j,M]=ff(null),[N,P]=ff(0),F=J(()=>e.defaultActiveFirstOption===void 0?e.mode!==`combobox`:e.defaultActiveFirstOption),I=function(t,n){let{source:r=`keyboard`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};P(n),e.backfill&&e.mode===`combobox`&&t!==null&&r===`keyboard`&&M(String(t))},L=(t,n)=>{let r=()=>{let n=b(t),r=n?.[l.value.label];return[e.labelInValue?{label:typeof r==`function`?r():r,originLabel:r,value:t,key:n?.key??t}:t,Si(n)]};if(n&&e.onSelect){let[t,n]=r();e.onSelect(t,n)}else if(!n&&e.onDeselect){let[t,n]=r();e.onDeselect(t,n)}},ee=(t,n)=>{let r,i=!o.value||n.selected;r=i?o.value?[...y.value,t]:[t]:y.value.filter(e=>e.value!==t),A(r),L(t,i),e.mode===`combobox`?M(``):(!o.value||e.autoClearSearchValue)&&(d(``),M(``))},te=(e,t)=>{A(e),(t.type===`remove`||t.type===`clear`)&&t.values.forEach(e=>{L(e.value,!1)})},ne=(t,n)=>{var r;if(d(t),M(null),n.source===`submit`){let e=(t||``).trim();if(e){let t=Array.from(new Set([...C.value,e]));A(t),L(e,!0),d(``)}return}n.source!==`blur`&&(e.mode===`combobox`&&A(t),(r=e.onSearch)==null||r.call(e,t))},R=t=>{let n=t;e.mode!==`tags`&&(n=t.map(e=>m.value.get(e)?.value).filter(e=>e!==void 0));let r=Array.from(new Set([...C.value,...n]));A(r),r.forEach(e=>{L(e,!0)})},re=J(()=>e.virtual!==!1&&e.dropdownMatchSelectWidth!==!1);qd(yd(Z(Z({},f),{flattenOptions:k,onActiveValue:I,defaultActiveFirstOption:F,onSelect:ee,menuItemSelectedIcon:St(e,`menuItemSelectedIcon`),rawValues:C,fieldNames:l,virtual:re,listHeight:St(e,`listHeight`),listItemHeight:St(e,`listItemHeight`),childrenAsData:s})));let ie=H();n({focus(){var e;(e=ie.value)==null||e.focus()},blur(){var e;(e=ie.value)==null||e.blur()},scrollTo(e){var t;(t=ie.value)==null||t.scrollTo(e)}});let ae=J(()=>Br(e,`id.mode.prefixCls.backfill.fieldNames.inputValue.searchValue.onSearch.autoClearSearchValue.onSelect.onDeselect.dropdownMatchSelectWidth.filterOption.filterSort.optionFilterProp.optionLabelProp.options.children.defaultActiveFirstOption.menuItemSelectedIcon.virtual.listHeight.listItemHeight.value.defaultValue.labelInValue.onChange`.split(`.`)));return()=>U(Ed,Y(Y(Y({},ae.value),r),{},{id:a,prefixCls:e.prefixCls,ref:ie,omitDomProps:pf,mode:e.mode,displayValues:x.value,onDisplayValuesChange:te,searchValue:u.value,onSearch:ne,onSearchSplit:R,dropdownMatchSelectWidth:e.dropdownMatchSelectWidth,OptionList:Zd,emptyOptions:!k.value.length,activeValue:j.value,activeDescendantId:`${a}_list_${N.value}`}),i)}}),_f=()=>null;_f.isSelectOption=!0,_f.displayName=`ASelectOption`;var vf=()=>null;vf.isSelectOptGroup=!0,vf.displayName=`ASelectOptGroup`;var yf=gf,bf={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z`}}]},name:`down`,theme:`outlined`};function xf(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{loading:n,multiple:r,prefixCls:i,hasFeedback:a,feedbackIcon:o,showArrow:s}=e,c=e.suffixIcon||t.suffixIcon&&t.suffixIcon(),l=e.clearIcon||t.clearIcon&&t.clearIcon(),u=e.menuItemSelectedIcon||t.menuItemSelectedIcon&&t.menuItemSelectedIcon(),d=e.removeIcon||t.removeIcon&&t.removeIcon(),f=l??U(tt,null,null),p=e=>U($e,null,[s!==!1&&e,a&&o]),m=null;if(c!==void 0)m=p(c);else if(n)m=p(U(qt,{spin:!0},null));else{let e=`${i}-suffix`;m=t=>{let{open:n,showSearch:r}=t;return p(U(n&&r?jf:Cf,{class:e},null))}}let h=null;h=u===void 0?r?U(Df,null,null):null:u;let g=null;return g=d===void 0?U(Pe,null,null):d,{clearIcon:f,suffixIcon:m,itemIcon:h,removeIcon:g}}function Nf(e){let t=Symbol(`contextKey`);return{useProvide:(e,n)=>{let r=Ne({});return fe(t,r),S(()=>{Z(r,e,n||{})}),r},useInject:()=>g(t,e)||{}}}var Pf=Symbol(`ContextProps`),Ff=Symbol(`InternalContextProps`),If=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:J(()=>!0),n=H(new Map);Zt(),G([t,n],()=>{}),fe(Pf,e),fe(Ff,{addFormItemField:(e,t)=>{n.value.set(e,t),n.value=new Map(n.value)},removeFormItemField:e=>{n.value.delete(e),n.value=new Map(n.value)}})},Lf={id:J(()=>void 0),onFieldBlur:()=>{},onFieldChange:()=>{},clearValidate:()=>{}},Rf={addFormItemField:()=>{},removeFormItemField:()=>{}},zf=()=>{let e=g(Ff,Rf),t=Symbol(`FormItemFieldKey`),n=Zt();return e.addFormItemField(t,n.type),ut(()=>{e.removeFormItemField(t)}),fe(Ff,Rf),fe(Pf,Lf),g(Pf,Lf)},Bf=u({compatConfig:{MODE:3},name:`AFormItemRest`,setup(e,t){let{slots:n}=t;return fe(Ff,Rf),fe(Pf,Lf),()=>n.default?.call(n)}}),Vf=Nf({}),Hf=u({name:`NoFormStatus`,setup(e,t){let{slots:n}=t;return Vf.useProvide({}),()=>n.default?.call(n)}});function Uf(e,t,n){return K({[`${e}-status-success`]:t===`success`,[`${e}-status-warning`]:t===`warning`,[`${e}-status-error`]:t===`error`,[`${e}-status-validating`]:t===`validating`,[`${e}-has-feedback`]:n})}var Wf=(e,t)=>t||e,Gf=e=>{let{componentCls:t}=e;return{[t]:{display:`inline-flex`,"&-block":{display:`flex`,width:`100%`},"&-vertical":{flexDirection:`column`}}}},Kf=e=>{let{componentCls:t}=e;return{[t]:{display:`inline-flex`,"&-rtl":{direction:`rtl`},"&-vertical":{flexDirection:`column`},"&-align":{flexDirection:`column`,"&-center":{alignItems:`center`},"&-start":{alignItems:`flex-start`},"&-end":{alignItems:`flex-end`},"&-baseline":{alignItems:`baseline`}},[`${t}-item`]:{"&:empty":{display:`none`}}}}},qf=v(`Space`,e=>[Kf(e),Gf(e)]),Jf=`[object Symbol]`;function Yf(e){return typeof e==`symbol`||vc(e)&&Wo(e)==Jf}function Xf(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=xp)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Tp(e){return function(){return e}}var Ep=function(){try{var e=ds(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Dp=wp(Ep?function(e,t){return Ep(e,`toString`,{configurable:!0,enumerable:!1,value:Tp(t),writable:!0})}:hp);function Op(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}function Pp(e,t,n){t==`__proto__`&&Ep?Ep(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Fp=Object.prototype.hasOwnProperty;function Ip(e,t,n){var r=e[t];(!(Fp.call(e,t)&&vo(r,n))||n===void 0&&!(t in e))&&Pp(e,t,n)}function Lp(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a0&&n(s)?t>1?lm(s,t-1,n,r,i):lc(i,s):r||(i[i.length]=s)}return i}function um(e){return e!=null&&e.length?lm(e,1):[]}function dm(e){return Dp(zp(e,void 0,um),e+``)}var fm=vl(Object.getPrototypeOf,Object),pm=`[object Object]`,mm=Function.prototype,hm=Object.prototype,gm=mm.toString,_m=hm.hasOwnProperty,vm=gm.call(Object);function ym(e){if(!vc(e)||Wo(e)!=pm)return!1;var t=fm(e);if(t===null)return!0;var n=_m.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&gm.call(n)==vm}function bm(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=t||n<0||d&&r>=a}function _(){var e=Sg();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Sg())}function x(){var e=Sg(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Dg(e){return vc(e)&&Sl(e)}function Og(e,t,n){for(var r=-1,i=e==null?0:e.length;++r-1?i[a?t[o]:o]:void 0}}var jg=Math.max;function Mg(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:mp(n);return i<0&&(i=jg(r+i,0)),kp(e,pg(t,3),i)}var Ng=Ag(Mg);function Pg(e){for(var t=-1,n=e==null?0:e.length,r={};++t=120&&u.length>=120)?new Rs(o&&u):void 0}u=e[0];var d=-1,f=s[0];outer:for(;++d1,t}),Lp(e,jm(e),n),r&&(n=qh(n,Yg|Xg|Zg,Jg));for(var i=t.length;i--;)qg(n,t[i]);return n});function $g(e,t,n,r){if(!Go(e))return e;t=nm(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=a_){var l=t?null:i_(e);if(l)return Ks(l);o=!1,i=Bs,c=new Rs}else c=t?[]:s;outer:for(;++r({compactSize:String,compactDirection:f.oneOf(m(`horizontal`,`vertical`)).def(`horizontal`),isFirstItem:Q(),isLastItem:Q()}),l_=Nf(null),u_=(e,t)=>{let n=l_.useInject(),r=J(()=>{if(!n||Ug(n))return``;let{compactDirection:r,isFirstItem:i,isLastItem:a}=n,o=r===`vertical`?`-vertical-`:`-`;return K({[`${e.value}-compact${o}item`]:!0,[`${e.value}-compact${o}first-item`]:i,[`${e.value}-compact${o}last-item`]:a,[`${e.value}-compact${o}item-rtl`]:t.value===`rtl`})});return{compactSize:J(()=>n?.compactSize),compactDirection:J(()=>n?.compactDirection),compactItemClassnames:r}},d_=u({name:`NoCompactStyle`,setup(e,t){let{slots:n}=t;return l_.useProvide(null),()=>n.default?.call(n)}}),f_=()=>({prefixCls:String,size:{type:String},direction:f.oneOf(m(`horizontal`,`vertical`)).def(`horizontal`),align:f.oneOf(m(`start`,`end`,`center`,`baseline`)),block:{type:Boolean,default:void 0}}),p_=u({name:`CompactItem`,props:c_(),setup(e,t){let{slots:n}=t;return l_.useProvide(e),()=>n.default?.call(n)}}),m_=u({name:`ASpaceCompact`,inheritAttrs:!1,props:f_(),setup(e,t){let{attrs:n,slots:r}=t,{prefixCls:i,direction:a}=X(`space-compact`,e),o=l_.useInject(),[s,c]=qf(i),l=J(()=>K(i.value,c.value,{[`${i.value}-rtl`]:a.value===`rtl`,[`${i.value}-block`]:e.block,[`${i.value}-vertical`]:e.direction===`vertical`}));return()=>{let t=ce(r.default?.call(r)||[]);return t.length===0?null:s(U(`div`,Y(Y({},n),{},{class:[l.value,n.class]}),[t.map((n,r)=>{let a=n&&n.key||`${i.value}-item-${r}`,s=!o||Ug(o);return U(p_,{key:a,compactSize:e.size??`middle`,compactDirection:e.direction,isFirstItem:r===0&&(s||o?.isFirstItem),isLastItem:r===t.length-1&&(s||o?.isLastItem)},{default:()=>[n]})})]))}}}),h_=e=>({animationDuration:e,animationFillMode:`both`}),g_=e=>({animationDuration:e,animationFillMode:`both`}),__=function(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0&&arguments[4]?`&`:``;return{[` + ${i}${e}-enter, + ${i}${e}-appear + `]:Z(Z({},h_(r)),{animationPlayState:`paused`}),[`${i}${e}-leave`]:Z(Z({},g_(r)),{animationPlayState:`paused`}),[` + ${i}${e}-enter${e}-enter-active, + ${i}${e}-appear${e}-appear-active + `]:{animationName:t,animationPlayState:`running`},[`${i}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:`running`,pointerEvents:`none`}}},v_=new N(`antFadeIn`,{"0%":{opacity:0},"100%":{opacity:1}}),y_=new N(`antFadeOut`,{"0%":{opacity:1},"100%":{opacity:0}}),b_=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],{antCls:n}=e,r=`${n}-fade`,i=t?`&`:``;return[__(r,v_,y_,e.motionDurationMid,t),{[` + ${i}${r}-enter, + ${i}${r}-appear + `]:{opacity:0,animationTimingFunction:`linear`},[`${i}${r}-leave`]:{animationTimingFunction:`linear`}}]},x_=new N(`antMoveDownIn`,{"0%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),S_=new N(`antMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0}}),C_=new N(`antMoveLeftIn`,{"0%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),w_=new N(`antMoveLeftOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),T_=new N(`antMoveRightIn`,{"0%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),E_=new N(`antMoveRightOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),D_={"move-up":{inKeyframes:new N(`antMoveUpIn`,{"0%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),outKeyframes:new N(`antMoveUpOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0}})},"move-down":{inKeyframes:x_,outKeyframes:S_},"move-left":{inKeyframes:C_,outKeyframes:w_},"move-right":{inKeyframes:T_,outKeyframes:E_}},O_=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=D_[t];return[__(r,i,a,e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},k_=new N(`antSlideUpIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1}}),A_=new N(`antSlideUpOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),j_=new N(`antSlideDownIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1}}),M_=new N(`antSlideDownOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0}}),N_=new N(`antSlideLeftIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1}}),P_=new N(`antSlideLeftOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),F_=new N(`antSlideRightIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1}}),I_=new N(`antSlideRightOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0}}),L_={"slide-up":{inKeyframes:k_,outKeyframes:A_},"slide-down":{inKeyframes:j_,outKeyframes:M_},"slide-left":{inKeyframes:N_,outKeyframes:P_},"slide-right":{inKeyframes:F_,outKeyframes:I_}},R_=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=L_[t];return[__(r,i,a,e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:`scale(0)`,transformOrigin:`0% 0%`,opacity:0,animationTimingFunction:e.motionEaseOutQuint},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},z_=new N(`antZoomIn`,{"0%":{transform:`scale(0.2)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),B_=new N(`antZoomOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.2)`,opacity:0}}),V_=new N(`antZoomBigIn`,{"0%":{transform:`scale(0.8)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),H_=new N(`antZoomBigOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.8)`,opacity:0}}),U_=new N(`antZoomUpIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 0%`}}),W_=new N(`antZoomUpOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 0%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0}}),G_=new N(`antZoomLeftIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`0% 50%`}}),K_=new N(`antZoomLeftOut`,{"0%":{transform:`scale(1)`,transformOrigin:`0% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0}}),q_=new N(`antZoomRightIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`100% 50%`}}),J_=new N(`antZoomRightOut`,{"0%":{transform:`scale(1)`,transformOrigin:`100% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0}}),Y_=new N(`antZoomDownIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 100%`}}),X_=new N(`antZoomDownOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 100%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0}}),Z_={zoom:{inKeyframes:z_,outKeyframes:B_},"zoom-big":{inKeyframes:V_,outKeyframes:H_},"zoom-big-fast":{inKeyframes:V_,outKeyframes:H_},"zoom-left":{inKeyframes:G_,outKeyframes:K_},"zoom-right":{inKeyframes:q_,outKeyframes:J_},"zoom-up":{inKeyframes:U_,outKeyframes:W_},"zoom-down":{inKeyframes:Y_,outKeyframes:X_}},Q_=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Z_[t];return[__(r,i,a,t===`zoom-big-fast`?e.motionDurationFast:e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:`scale(0)`,opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:`none`}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},$_=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:`hidden`,"&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, + opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:`hidden`,transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, + opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),ev=e=>{let{controlPaddingHorizontal:t}=e;return{position:`relative`,display:`block`,minHeight:e.controlHeight,padding:`${(e.controlHeight-e.fontSize*e.lineHeight)/2}px ${t}px`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,boxSizing:`border-box`}},tv=e=>{let{antCls:t,componentCls:n}=e,r=`${n}-item`;return[{[`${n}-dropdown`]:Z(Z({},rn(e)),{position:`absolute`,top:-9999,zIndex:e.zIndexPopup,boxSizing:`border-box`,padding:e.paddingXXS,overflow:`hidden`,fontSize:e.fontSize,fontVariant:`initial`,backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,[` + &${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-bottomLeft, + &${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-bottomLeft + `]:{animationName:k_},[` + &${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-topLeft, + &${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-topLeft + `]:{animationName:j_},[`&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-bottomLeft`]:{animationName:A_},[`&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-topLeft`]:{animationName:M_},"&-hidden":{display:`none`},"&-empty":{color:e.colorTextDisabled},[`${r}-empty`]:Z(Z({},ev(e)),{color:e.colorTextDisabled}),[`${r}`]:Z(Z({},ev(e)),{cursor:`pointer`,transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:`default`},"&-option":{display:`flex`,"&-content":Z({flex:`auto`},xe),"&-state":{flex:`none`},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.controlItemBgHover},[`&-selected:not(${r}-option-disabled)`]:{color:e.colorText,fontWeight:e.fontWeightStrong,backgroundColor:e.controlItemBgActive,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:`not-allowed`},"&-grouped":{paddingInlineStart:e.controlPaddingHorizontal*2}}}),"&-rtl":{direction:`rtl`}})},R_(e,`slide-up`),R_(e,`slide-down`),O_(e,`move-up`),O_(e,`move-down`)]},nv=2;function rv(e){let{controlHeightSM:t,controlHeight:n,lineWidth:r}=e,i=(n-t)/2-r;return[i,Math.ceil(i/2)]}function iv(e,t){let{componentCls:n,iconCls:r}=e,i=`${n}-selection-overflow`,a=e.controlHeightSM,[s]=rv(e);return{[`${n}-multiple${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[i]:{position:`relative`,display:`flex`,flex:`auto`,flexWrap:`wrap`,maxWidth:`100%`,"&-item":{flex:`none`,alignSelf:`center`,maxWidth:`100%`,display:`inline-flex`}},[`${n}-selector`]:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,padding:`${s-nv}px ${nv*2}px`,borderRadius:e.borderRadius,[`${n}-show-search&`]:{cursor:`text`},[`${n}-disabled&`]:{background:e.colorBgContainerDisabled,cursor:`not-allowed`},"&:after":{display:`inline-block`,width:0,margin:`${nv}px 0`,lineHeight:`${a}px`,content:`"\\a0"`}},[` + &${n}-show-arrow ${n}-selector, + &${n}-allow-clear ${n}-selector + `]:{paddingInlineEnd:e.fontSizeIcon+e.controlPaddingHorizontal},[`${n}-selection-item`]:{position:`relative`,display:`flex`,flex:`none`,boxSizing:`border-box`,maxWidth:`100%`,height:a,marginTop:nv,marginBottom:nv,lineHeight:`${a-e.lineWidth*2}px`,background:e.colorFillSecondary,border:`${e.lineWidth}px solid ${e.colorSplit}`,borderRadius:e.borderRadiusSM,cursor:`default`,transition:`font-size ${e.motionDurationSlow}, line-height ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,userSelect:`none`,marginInlineEnd:nv*2,paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS/2,[`${n}-disabled&`]:{color:e.colorTextDisabled,borderColor:e.colorBorder,cursor:`not-allowed`},"&-content":{display:`inline-block`,marginInlineEnd:e.paddingXS/2,overflow:`hidden`,whiteSpace:`pre`,textOverflow:`ellipsis`},"&-remove":Z(Z({},o()),{display:`inline-block`,color:e.colorIcon,fontWeight:`bold`,fontSize:10,lineHeight:`inherit`,cursor:`pointer`,[`> ${r}`]:{verticalAlign:`-0.2em`},"&:hover":{color:e.colorIconHover}})},[`${i}-item + ${i}-item`]:{[`${n}-selection-search`]:{marginInlineStart:0}},[`${n}-selection-search`]:{display:`inline-flex`,position:`relative`,maxWidth:`100%`,marginInlineStart:e.inputPaddingHorizontalBase-s,"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:`${a}px`,transition:`all ${e.motionDurationSlow}`},"&-input":{width:`100%`,minWidth:4.1},"&-mirror":{position:`absolute`,top:0,insetInlineStart:0,insetInlineEnd:`auto`,zIndex:999,whiteSpace:`pre`,visibility:`hidden`}},[`${n}-selection-placeholder `]:{position:`absolute`,top:`50%`,insetInlineStart:e.inputPaddingHorizontalBase,insetInlineEnd:e.inputPaddingHorizontalBase,transform:`translateY(-50%)`,transition:`all ${e.motionDurationSlow}`}}}}function av(e){let{componentCls:t}=e,n=B(e,{controlHeight:e.controlHeightSM,controlHeightSM:e.controlHeightXS,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),[,r]=rv(e);return[iv(e),iv(n,`sm`),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInlineStart:e.controlPaddingHorizontalSM-e.lineWidth,insetInlineEnd:`auto`},[`${t}-selection-search`]:{marginInlineStart:r}}},iv(B(e,{fontSize:e.fontSizeLG,controlHeight:e.controlHeightLG,controlHeightSM:e.controlHeight,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius}),`lg`)]}function ov(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.controlHeight-e.lineWidth*2,o=Math.ceil(e.fontSize*1.25);return{[`${n}-single${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[`${n}-selector`]:Z(Z({},rn(e)),{display:`flex`,borderRadius:i,[`${n}-selection-search`]:{position:`absolute`,top:0,insetInlineStart:r,insetInlineEnd:r,bottom:0,"&-input":{width:`100%`}},[` + ${n}-selection-item, + ${n}-selection-placeholder + `]:{padding:0,lineHeight:`${a}px`,transition:`all ${e.motionDurationSlow}`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${a}px`}},[`${n}-selection-item`]:{position:`relative`,userSelect:`none`},[`${n}-selection-placeholder`]:{transition:`none`,pointerEvents:`none`},[[`&:after`,`${n}-selection-item:after`,`${n}-selection-placeholder:after`].join(`,`)]:{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`}}),[` + &${n}-show-arrow ${n}-selection-item, + &${n}-show-arrow ${n}-selection-placeholder + `]:{paddingInlineEnd:o},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:`100%`,height:e.controlHeight,padding:`0 ${r}px`,[`${n}-selection-search-input`]:{height:a},"&:after":{lineHeight:`${a}px`}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:`none`},[`${n}-selection-search`]:{position:`static`,width:`100%`},[`${n}-selection-placeholder`]:{position:`absolute`,insetInlineStart:0,insetInlineEnd:0,padding:`0 ${r}px`,"&:after":{display:`none`}}}}}}}function sv(e){let{componentCls:t}=e,n=e.controlPaddingHorizontalSM-e.lineWidth;return[ov(e),ov(B(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),`sm`),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selection-search`]:{insetInlineStart:n,insetInlineEnd:n},[`${t}-selector`]:{padding:`0 ${n}px`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:n+e.fontSize*1.5},[` + &${t}-show-arrow ${t}-selection-item, + &${t}-show-arrow ${t}-selection-placeholder + `]:{paddingInlineEnd:e.fontSize*1.5}}}},ov(B(e,{controlHeight:e.controlHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`lg`)]}function cv(e,t,n){let{focusElCls:r,focus:i,borderElCls:a}=n,o=a?`> *`:``,s=[`hover`,i?`focus`:null,`active`].filter(Boolean).map(e=>`&:${e} ${o}`).join(`,`);return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:-e.lineWidth},"&-item":Z(Z({[s]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${o}`]:{zIndex:0}})}}function lv(e,t,n){let{borderElCls:r}=n,i=r?`> ${r}`:``;return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function uv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0},{componentCls:n}=e,r=`${n}-compact`;return{[r]:Z(Z({},cv(e,r,t)),lv(n,r,t))}}var dv=e=>{let{componentCls:t}=e;return{position:`relative`,backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:`pointer`},[`${t}-show-search&`]:{cursor:`text`,input:{cursor:`auto`,color:`inherit`}},[`${t}-disabled&`]:{color:e.colorTextDisabled,background:e.colorBgContainerDisabled,cursor:`not-allowed`,[`${t}-multiple&`]:{background:e.colorBgContainerDisabled},input:{cursor:`not-allowed`}}}},fv=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{componentCls:r,borderHoverColor:i,outlineColor:a,antCls:o}=t,s=n?{[`${r}-selector`]:{borderColor:i}}:{};return{[e]:{[`&:not(${r}-disabled):not(${r}-customize-input):not(${o}-pagination-size-changer)`]:Z(Z({},s),{[`${r}-focused& ${r}-selector`]:{borderColor:i,boxShadow:`0 0 0 ${t.controlOutlineWidth}px ${a}`,borderInlineEndWidth:`${t.controlLineWidth}px !important`,outline:0},[`&:hover ${r}-selector`]:{borderColor:i,borderInlineEndWidth:`${t.controlLineWidth}px !important`}})}}},pv=e=>{let{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:`transparent`,border:`none`,outline:`none`,appearance:`none`,"&::-webkit-search-cancel-button":{display:`none`,"-webkit-appearance":`none`}}}},mv=e=>{let{componentCls:t,inputPaddingHorizontalBase:n,iconCls:r}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,cursor:`pointer`,[`&:not(${t}-customize-input) ${t}-selector`]:Z(Z({},dv(e)),pv(e)),[`${t}-selection-item`]:Z({flex:1,fontWeight:`normal`},xe),[`${t}-selection-placeholder`]:Z(Z({},xe),{flex:1,color:e.colorTextPlaceholder,pointerEvents:`none`}),[`${t}-arrow`]:Z(Z({},o()),{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:n,height:e.fontSizeIcon,marginTop:-e.fontSizeIcon/2,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:`center`,pointerEvents:`none`,display:`flex`,alignItems:`center`,[r]:{verticalAlign:`top`,transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:`top`},[`&:not(${t}-suffix)`]:{pointerEvents:`auto`}},[`${t}-disabled &`]:{cursor:`not-allowed`},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:n,zIndex:1,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:-e.fontSizeIcon/2,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:`normal`,lineHeight:1,textAlign:`center`,textTransform:`none`,background:e.colorBgContainer,cursor:`pointer`,opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:`auto`,"&:before":{display:`block`},"&:hover":{color:e.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:n+e.fontSize+e.paddingXXS}}}},hv=e=>{let{componentCls:t}=e;return[{[t]:{[`&-borderless ${t}-selector`]:{backgroundColor:`transparent !important`,borderColor:`transparent !important`,boxShadow:`none !important`},[`&${t}-in-form-item`]:{width:`100%`}}},mv(e),sv(e),av(e),tv(e),{[`${t}-rtl`]:{direction:`rtl`}},fv(t,B(e,{borderHoverColor:e.colorPrimaryHover,outlineColor:e.controlOutline})),fv(`${t}-status-error`,B(e,{borderHoverColor:e.colorErrorHover,outlineColor:e.colorErrorOutline}),!0),fv(`${t}-status-warning`,B(e,{borderHoverColor:e.colorWarningHover,outlineColor:e.colorWarningOutline}),!0),uv(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]},gv=v(`Select`,(e,t)=>{let{rootPrefixCls:n}=t;return[hv(B(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.paddingSM-1}))]},e=>({zIndexPopup:e.zIndexPopupBase+50})),_v=()=>Z(Z({},Br(mf(),[`inputIcon`,`mode`,`getInputElement`,`getRawInputElement`,`backfill`])),{value:W([Array,Object,String,Number]),defaultValue:W([Array,Object,String,Number]),notFoundContent:f.any,suffixIcon:f.any,itemIcon:f.any,size:_(),mode:_(),bordered:Q(!0),transitionName:String,choiceTransitionName:_(``),popupClassName:String,dropdownClassName:String,placement:_(),status:_(),"onUpdate:value":d()}),vv=`SECRET_COMBOBOX_MODE_DO_NOT_USE`,yv=u({compatConfig:{MODE:3},name:`ASelect`,Option:_f,OptGroup:vf,inheritAttrs:!1,props:Zn(_v(),{listHeight:256,listItemHeight:24}),SECRET_COMBOBOX_MODE_DO_NOT_USE:vv,slots:Object,setup(e,t){let{attrs:n,emit:r,slots:i,expose:a}=t,o=H(),s=zf(),c=Vf.useInject(),l=J(()=>Wf(c.status,e.status)),u=()=>{var e;(e=o.value)==null||e.focus()},d=()=>{var e;(e=o.value)==null||e.blur()},f=e=>{var t;(t=o.value)==null||t.scrollTo(e)},p=J(()=>{let{mode:t}=e;if(t!==`combobox`)return t===vv?`combobox`:t}),{prefixCls:m,direction:h,configProvider:g,renderEmpty:_,size:v,getPrefixCls:y,getPopupContainer:b,disabled:x,select:S}=X(`select`,e),{compactSize:C,compactItemClassnames:w}=u_(m,h),T=J(()=>C.value||v.value),E=at(),D=J(()=>x.value??E.value),[O,k]=gv(m),A=J(()=>y()),j=J(()=>e.placement===void 0?h.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement),M=J(()=>Xt(A.value,me(j.value),e.transitionName)),N=J(()=>K({[`${m.value}-lg`]:T.value===`large`,[`${m.value}-sm`]:T.value===`small`,[`${m.value}-rtl`]:h.value===`rtl`,[`${m.value}-borderless`]:!e.bordered,[`${m.value}-in-form-item`]:c.isFormItemInput},Uf(m.value,l.value,c.hasFeedback),w.value,k.value)),P=function(){var e=[...arguments];r(`update:value`,e[0]),r(`change`,...e),s.onFieldChange()},F=e=>{r(`blur`,e),s.onFieldBlur()};a({blur:d,focus:u,scrollTo:f});let I=J(()=>p.value===`multiple`||p.value===`tags`),L=J(()=>e.showArrow===void 0?e.loading||!(I.value||p.value===`combobox`):e.showArrow);return()=>{let{notFoundContent:t,listHeight:r=256,listItemHeight:a=24,popupClassName:l,dropdownClassName:u,virtual:d,dropdownMatchSelectWidth:f,id:v=s.id.value,placeholder:y=i.placeholder?.call(i),showArrow:x}=e,{hasFeedback:C,feedbackIcon:w}=c,{}=g,T;T=t===void 0?i.notFoundContent?i.notFoundContent():p.value===`combobox`?null:_?.(`Select`)||U(lt,{componentName:`Select`},null):t;let{suffixIcon:E,itemIcon:A,removeIcon:j,clearIcon:ee}=Mf(Z(Z({},e),{multiple:I.value,prefixCls:m.value,hasFeedback:C,feedbackIcon:w,showArrow:L.value}),i),te=Br(e,[`prefixCls`,`suffixIcon`,`itemIcon`,`removeIcon`,`clearIcon`,`size`,`bordered`,`status`]),ne=K(l||u,{[`${m.value}-dropdown-${h.value}`]:h.value===`rtl`},k.value);return O(U(yf,Y(Y(Y({ref:o,virtual:d,dropdownMatchSelectWidth:f},te),n),{},{showSearch:e.showSearch??S?.value?.showSearch,placeholder:y,listHeight:r,listItemHeight:a,mode:p.value,prefixCls:m.value,direction:h.value,inputIcon:E,menuItemSelectedIcon:A,removeIcon:j,clearIcon:ee,notFoundContent:T,class:[N.value,n.class],getPopupContainer:b?.value,dropdownClassName:ne,onChange:P,onBlur:F,id:v,dropdownRender:te.dropdownRender||i.dropdownRender,transitionName:M.value,children:i.default?.call(i),tagRender:e.tagRender||i.tagRender,optionLabelRender:i.optionLabel,maxTagPlaceholder:e.maxTagPlaceholder||i.maxTagPlaceholder,showArrow:C||x,disabled:D.value}),{option:i.option}))}}});yv.install=function(e){return e.component(yv.name,yv),e.component(yv.Option.displayName,yv.Option),e.component(yv.OptGroup.displayName,yv.OptGroup),e};var bv=yv.Option,xv=yv.OptGroup,Sv=()=>null;Sv.isSelectOption=!0,Sv.displayName=`AAutoCompleteOption`;var Cv=()=>null;Cv.isSelectOptGroup=!0,Cv.displayName=`AAutoCompleteOptGroup`;function wv(e){return e?.type?.isSelectOption||e?.type?.isSelectOptGroup}var Tv=()=>Z(Z({},Br(_v(),[`loading`,`mode`,`optionLabelProp`,`labelInValue`])),{dataSource:Array,dropdownMenuStyle:{type:Object,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},prefixCls:String,showSearch:{type:Boolean,default:void 0},transitionName:String,choiceTransitionName:{type:String,default:`zoom`},autofocus:{type:Boolean,default:void 0},backfill:{type:Boolean,default:void 0},filterOption:{type:[Boolean,Function],default:!1},defaultActiveFirstOption:{type:Boolean,default:!0},status:String}),Ev=Sv,Dv=Cv,Ov=u({compatConfig:{MODE:3},name:`AAutoComplete`,inheritAttrs:!1,props:Tv(),slots:Object,setup(t,n){let{slots:r,attrs:i,expose:a}=n;e(!(`dataSource`in r),`AutoComplete`,"`dataSource` slot is deprecated, please use props `options` instead."),e(!(`options`in r),`AutoComplete`,"`options` slot is deprecated, please use props `options` instead."),e(!t.dropdownClassName,`AutoComplete`,"`dropdownClassName` is deprecated, please use `popupClassName` instead.");let o=H(),s=()=>{let e=ce(r.default?.call(r));return e.length?e[0]:void 0};a({focus:()=>{var e;(e=o.value)==null||e.focus()},blur:()=>{var e;(e=o.value)==null||e.blur()}});let{prefixCls:c}=X(`select`,t);return()=>{let{size:e,dataSource:n,notFoundContent:a=r.notFoundContent?.call(r)}=t,l,{class:u}=i,d={[u]:!!u,[`${c.value}-lg`]:e===`large`,[`${c.value}-sm`]:e===`small`,[`${c.value}-show-search`]:!0,[`${c.value}-auto-complete`]:!0};if(t.options===void 0){let e=r.dataSource?.call(r)||r.options?.call(r)||[];l=e.length&&wv(e[0])?e:n?n.map(e=>{if(Nt(e))return e;switch(typeof e){case`string`:return U(Sv,{key:e,value:e},{default:()=>[e]});case`object`:return U(Sv,{key:e.value,value:e.value},{default:()=>[e.text]});default:throw Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}}):[]}return U(yv,Br(Z(Z(Z({},t),i),{mode:yv.SECRET_COMBOBOX_MODE_DO_NOT_USE,getInputElement:s,notFoundContent:a,class:d,popupClassName:t.popupClassName||t.dropdownClassName,ref:o}),[`dataSource`,`loading`]),Y({default:()=>[l]},Br(r,[`default`,`dataSource`,`options`])))}}}),kv=Z(Ov,{Option:Sv,OptGroup:Cv,install(e){return e.component(Ov.name,Ov),e.component(Sv.displayName,Sv),e.component(Cv.displayName,Cv),e}}),Av=(e,t,n,r,i)=>({backgroundColor:e,border:`${r.lineWidth}px ${r.lineType} ${t}`,[`${i}-icon`]:{color:n}}),jv=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:i,fontSize:a,fontSizeLG:o,lineHeight:s,borderRadiusLG:c,motionEaseInOutCirc:l,alertIconSizeLG:u,colorText:d,paddingContentVerticalSM:f,alertPaddingHorizontal:p,paddingMD:m,paddingContentHorizontalLG:h}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,display:`flex`,alignItems:`center`,padding:`${f}px ${p}px`,wordWrap:`break-word`,borderRadius:c,[`&${t}-rtl`]:{direction:`rtl`},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:`none`,fontSize:a,lineHeight:s},"&-message":{color:d},[`&${t}-motion-leave`]:{overflow:`hidden`,opacity:1,transition:`max-height ${n} ${l}, opacity ${n} ${l}, + padding-top ${n} ${l}, padding-bottom ${n} ${l}, + margin-bottom ${n} ${l}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:`0 !important`,paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:`flex-start`,paddingInline:h,paddingBlock:m,[`${t}-icon`]:{marginInlineEnd:i,fontSize:u,lineHeight:0},[`${t}-message`]:{display:`block`,marginBottom:r,color:d,fontSize:o},[`${t}-description`]:{display:`block`}},[`${t}-banner`]:{marginBottom:0,border:`0 !important`,borderRadius:0}}},Mv=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:i,colorWarning:a,colorWarningBorder:o,colorWarningBg:s,colorError:c,colorErrorBorder:l,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":Av(i,r,n,e,t),"&-info":Av(p,f,d,e,t),"&-warning":Av(s,o,a,e,t),"&-error":Z(Z({},Av(u,l,c,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},Nv=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:i,fontSizeIcon:a,colorIcon:o,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:`hidden`,fontSize:a,lineHeight:`${a}px`,backgroundColor:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,[`${n}-close`]:{color:o,transition:`color ${r}`,"&:hover":{color:s}}},"&-close-text":{color:o,transition:`color ${r}`,"&:hover":{color:s}}}}},Pv=e=>[jv(e),Mv(e),Nv(e)],Fv=v(`Alert`,e=>{let{fontSizeHeading3:t}=e;return[Pv(B(e,{alertIconSizeLG:t,alertPaddingHorizontal:12}))]}),Iv={success:qe,info:mt,error:tt,warning:Wt},Lv={success:rt,info:Ot,error:Qe,warning:_t},Rv=m(`success`,`info`,`warning`,`error`),zv=a(u({compatConfig:{MODE:3},name:`AAlert`,inheritAttrs:!1,props:{type:f.oneOf(Rv),closable:{type:Boolean,default:void 0},closeText:f.any,message:f.any,description:f.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:f.any,closeIcon:f.any,onClose:Function},setup(e,t){let{slots:n,emit:r,attrs:i,expose:a}=t,{prefixCls:o,direction:s}=X(`alert`,e),[c,l]=Fv(o),u=q(!1),d=q(!1),f=q(),p=e=>{e.preventDefault();let t=f.value;t.style.height=`${t.offsetHeight}px`,t.style.height=`${t.offsetHeight}px`,u.value=!0,r(`close`,e)},m=()=>{var t;u.value=!1,d.value=!0,(t=e.afterClose)==null||t.call(e)},h=J(()=>{let{type:t}=e;return t===void 0?e.banner?`warning`:`info`:t});a({animationEnd:m});let g=q({});return()=>{let{banner:t,closeIcon:r=n.closeIcon?.call(n)}=e,{closable:a,showIcon:_}=e,v=e.closeText??n.closeText?.call(n),y=e.description??n.description?.call(n),b=e.message??n.message?.call(n),x=e.icon??n.icon?.call(n),S=n.action?.call(n);_=t&&_===void 0?!0:_;let C=(y?Lv:Iv)[h.value]||null;v&&(a=!0);let w=o.value,T=K(w,{[`${w}-${h.value}`]:!0,[`${w}-closing`]:u.value,[`${w}-with-description`]:!!y,[`${w}-no-icon`]:!_,[`${w}-banner`]:!!t,[`${w}-closable`]:a,[`${w}-rtl`]:s.value===`rtl`,[l.value]:!0}),E=a?U(`button`,{type:`button`,onClick:p,class:`${w}-close-icon`,tabindex:0},[v?U(`span`,{class:`${w}-close-text`},[v]):r===void 0?U(Pe,null,null):r]):null,D=x&&(Nt(x)?ao(x,{class:`${w}-icon`}):U(`span`,{class:`${w}-icon`},[x]))||U(C,{class:`${w}-icon`},null),O=ge(`${w}-motion`,{appear:!1,css:!0,onAfterLeave:m,onBeforeLeave:e=>{e.style.maxHeight=`${e.offsetHeight}px`},onLeave:e=>{e.style.maxHeight=`0px`}});return c(d.value?null:U(Re,O,{default:()=>[Mt(U(`div`,Y(Y({role:`alert`},i),{},{style:[i.style,g.value],class:[i.class,T],"data-show":!u.value,ref:f}),[_?D:null,U(`div`,{class:`${w}-content`},[b?U(`div`,{class:`${w}-message`},[b]):null,y?U(`div`,{class:`${w}-description`},[y]):null]),S?U(`div`,{class:`${w}-action`},[S]):null,E]),[[ht,!u.value]])]}))}}})),Bv=[`xxxl`,`xxl`,`xl`,`lg`,`md`,`sm`,`xs`],Vv=e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`,xxxl:`{min-width: ${e.screenXXXL}px}`});function Hv(){let[,e]=re();return J(()=>{let t=Vv(e.value),n=new Map,r=-1,i={};return{matchHandlers:{},dispatch(e){return i=e,n.forEach(e=>e(i)),n.size>=1},subscribe(e){return n.size||this.register(),r+=1,n.set(r,e),e(i),r},unsubscribe(e){n.delete(e),n.size||this.unregister()},unregister(){Object.keys(t).forEach(e=>{let n=t[e],r=this.matchHandlers[n];r?.mql.removeListener(r?.listener)}),n.clear()},register(){Object.keys(t).forEach(e=>{let n=t[e],r=t=>{let{matches:n}=t;this.dispatch(Z(Z({},i),{[e]:n}))},a=window.matchMedia(n);a.addListener(r),this.matchHandlers[n]={mql:a,listener:r},r(a)})},responsiveMap:t}})}function Uv(){let e=q({}),t=null,n=Hv();return V(()=>{t=n.value.subscribe(t=>{e.value=t})}),y(()=>{n.value.unsubscribe(t)}),e}function Wv(e){let t=q();return S(()=>{t.value=e()},{flush:`sync`}),t}var Gv=e=>{let{antCls:t,componentCls:n,iconCls:r,avatarBg:i,avatarColor:a,containerSize:o,containerSizeLG:s,containerSizeSM:c,textFontSize:l,textFontSizeLG:u,textFontSizeSM:d,borderRadius:f,borderRadiusLG:p,borderRadiusSM:m,lineWidth:h,lineType:g}=e,_=(e,t,i)=>({width:e,height:e,lineHeight:`${e-h*2}px`,borderRadius:`50%`,[`&${n}-square`]:{borderRadius:i},[`${n}-string`]:{position:`absolute`,left:{_skip_check_:!0,value:`50%`},transformOrigin:`0 center`},[`&${n}-icon`]:{fontSize:t,[`> ${r}`]:{margin:0}}});return{[n]:Z(Z(Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,overflow:`hidden`,color:a,whiteSpace:`nowrap`,textAlign:`center`,verticalAlign:`middle`,background:i,border:`${h}px ${g} transparent`,"&-image":{background:`transparent`},[`${t}-image-img`]:{display:`block`}}),_(o,l,f)),{"&-lg":Z({},_(s,u,p)),"&-sm":Z({},_(c,d,m)),"> img":{display:`block`,width:`100%`,height:`100%`,objectFit:`cover`}})}},Kv=e=>{let{componentCls:t,groupBorderColor:n,groupOverlapping:r,groupSpace:i}=e;return{[`${t}-group`]:{display:`inline-flex`,[`${t}`]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:r}},[`${t}-group-popover`]:{[`${t} + ${t}`]:{marginInlineStart:i}}}},qv=v(`Avatar`,e=>{let{colorTextLightSolid:t,colorTextPlaceholder:n}=e,r=B(e,{avatarBg:n,avatarColor:t});return[Gv(r),Kv(r)]},e=>{let{controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:i,fontSizeLG:a,fontSizeXL:o,fontSizeHeading3:s,marginXS:c,marginXXS:l,colorBorderBg:u}=e;return{containerSize:t,containerSizeLG:n,containerSizeSM:r,textFontSize:Math.round((a+o)/2),textFontSizeLG:s,textFontSizeSM:i,groupSpace:l,groupOverlapping:-c,groupBorderColor:u}}),Jv=Symbol(`AvatarContextKey`),Yv=()=>g(Jv,{}),Xv=e=>fe(Jv,e),Zv=u({compatConfig:{MODE:3},name:`AAvatar`,inheritAttrs:!1,props:{prefixCls:String,shape:{type:String,default:`circle`},size:{type:[Number,String,Object],default:()=>`default`},src:String,srcset:String,icon:f.any,alt:String,gap:Number,draggable:{type:Boolean,default:void 0},crossOrigin:String,loadError:{type:Function}},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,i=q(!0),a=q(!1),o=q(1),s=q(null),c=q(null),{prefixCls:l}=X(`avatar`,e),[u,d]=qv(l),f=Yv(),p=J(()=>e.size==="default"?f.size:e.size),m=Uv(),h=Wv(()=>{if(typeof e.size!=`object`)return;let t=Bv.find(e=>m.value[e]);return e.size[t]}),g=e=>h.value?{width:`${h.value}px`,height:`${h.value}px`,lineHeight:`${h.value}px`,fontSize:`${e?h.value/2:18}px`}:{},_=()=>{if(!s.value||!c.value)return;let t=s.value.offsetWidth,n=c.value.offsetWidth;if(t!==0&&n!==0){let{gap:r=4}=e;r*2{let{loadError:t}=e;t?.()!==!1&&(i.value=!1)};return G(()=>e.src,()=>{z(()=>{i.value=!0,o.value=1})}),G(()=>e.gap,()=>{z(()=>{_()})}),V(()=>{z(()=>{_(),a.value=!0})}),()=>{let{shape:t,src:m,alt:h,srcset:y,draggable:b,crossOrigin:x}=e,S=f.shape??t,C=on(n,e,`icon`),w=l.value,T={[`${r.class}`]:!!r.class,[w]:!0,[`${w}-lg`]:p.value===`large`,[`${w}-sm`]:p.value===`small`,[`${w}-${S}`]:!0,[`${w}-image`]:m&&i.value,[`${w}-icon`]:C,[d.value]:!0},E=typeof p.value==`number`?{width:`${p.value}px`,height:`${p.value}px`,lineHeight:`${p.value}px`,fontSize:C?`${p.value/2}px`:`18px`}:{},D=n.default?.call(n),O;if(m&&i.value)O=U(`img`,{draggable:b,src:m,srcset:y,onError:v,alt:h,crossorigin:x},null);else if(C)O=C;else if(a.value||o.value!==1){let e=`scale(${o.value}) translateX(-50%)`,t={msTransform:e,WebkitTransform:e,transform:e},n=typeof p.value==`number`?{lineHeight:`${p.value}px`}:{};O=U(Qn,{onResize:_},{default:()=>[U(`span`,{class:`${w}-string`,ref:s,style:Z(Z({},n),t)},[D])]})}else O=U(`span`,{class:`${w}-string`,ref:s,style:{opacity:0}},[D]);return u(U(`span`,Y(Y({},r),{},{ref:c,class:T,style:[E,g(!!C),r.style]}),[O]))}}}),Qv={adjustX:1,adjustY:1},$v=[0,0],ey={left:{points:[`cr`,`cl`],overflow:Qv,offset:[-4,0],targetOffset:$v},right:{points:[`cl`,`cr`],overflow:Qv,offset:[4,0],targetOffset:$v},top:{points:[`bc`,`tc`],overflow:Qv,offset:[0,-4],targetOffset:$v},bottom:{points:[`tc`,`bc`],overflow:Qv,offset:[0,4],targetOffset:$v},topLeft:{points:[`bl`,`tl`],overflow:Qv,offset:[0,-4],targetOffset:$v},leftTop:{points:[`tr`,`tl`],overflow:Qv,offset:[-4,0],targetOffset:$v},topRight:{points:[`br`,`tr`],overflow:Qv,offset:[0,-4],targetOffset:$v},rightTop:{points:[`tl`,`tr`],overflow:Qv,offset:[4,0],targetOffset:$v},bottomRight:{points:[`tr`,`br`],overflow:Qv,offset:[0,4],targetOffset:$v},rightBottom:{points:[`bl`,`br`],overflow:Qv,offset:[4,0],targetOffset:$v},bottomLeft:{points:[`tl`,`bl`],overflow:Qv,offset:[0,4],targetOffset:$v},leftBottom:{points:[`br`,`bl`],overflow:Qv,offset:[-4,0],targetOffset:$v}},ty=u({compatConfig:{MODE:3},name:`TooltipContent`,props:{prefixCls:String,id:String,overlayInnerStyle:f.any},setup(e,t){let{slots:n}=t;return()=>U(`div`,{class:`${e.prefixCls}-inner`,id:e.id,role:`tooltip`,style:e.overlayInnerStyle},[n.overlay?.call(n)])}}),ny=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{}),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:f.string.def(`rc-tooltip`),mouseEnterDelay:f.number.def(.1),mouseLeaveDelay:f.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:f.object.def(()=>({})),arrowContent:f.any.def(null),tipId:String,builtinPlacements:f.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function,arrow:{type:Boolean,default:!0}},setup(e,t){let{slots:n,attrs:r,expose:i}=t,a=q(),o=()=>{let{prefixCls:t,tipId:r,overlayInnerStyle:i}=e;return[e.arrow?U(`div`,{class:`${t}-arrow`,key:`arrow`},[on(n,e,`arrowContent`)]):null,U(ty,{key:`content`,prefixCls:t,id:r,overlayInnerStyle:i},{overlay:n.overlay})]};i({getPopupDomNode:()=>a.value.getPopupDomNode(),triggerDOM:a,forcePopupAlign:()=>a.value?.forcePopupAlign()});let s=q(!1),c=q(!1);return S(()=>{let{destroyTooltipOnHide:t}=e;if(typeof t==`boolean`)s.value=t;else if(t&&typeof t==`object`){let{keepParent:e}=t;s.value=e===!0,c.value=e===!1}}),()=>{let{overlayClassName:t,trigger:i,mouseEnterDelay:l,mouseLeaveDelay:u,overlayStyle:d,prefixCls:f,afterVisibleChange:p,transitionName:m,animation:h,placement:g,align:_,destroyTooltipOnHide:v,defaultVisible:y}=e,b=Z({},ny(e,[`overlayClassName`,`trigger`,`mouseEnterDelay`,`mouseLeaveDelay`,`overlayStyle`,`prefixCls`,`afterVisibleChange`,`transitionName`,`animation`,`placement`,`align`,`destroyTooltipOnHide`,`defaultVisible`]));return e.visible!==void 0&&(b.popupVisible=e.visible),U(Su,Z(Z(Z({popupClassName:t,prefixCls:f,action:i,builtinPlacements:ey,popupPlacement:g,popupAlign:_,afterPopupVisibleChange:p,popupTransitionName:m,popupAnimation:h,defaultPopupVisible:y,destroyPopupOnHide:s.value,autoDestroy:c.value,mouseLeaveDelay:u,popupStyle:d,mouseEnterDelay:l},b),r),{onPopupVisibleChange:e.onVisibleChange||ry,onPopupAlign:e.onPopupAlign||ry,ref:a,arrow:!!e.arrow,popup:o()}),{default:n.default})}}}),ay=(()=>({trigger:[String,Array],open:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:String,color:String,transitionName:String,overlayStyle:Qt(),overlayInnerStyle:Qt(),overlayClassName:String,openClassName:String,prefixCls:String,mouseEnterDelay:Number,mouseLeaveDelay:Number,getPopupContainer:Function,arrowPointAtCenter:{type:Boolean,default:void 0},arrow:{type:[Boolean,Object],default:!0},autoAdjustOverflow:{type:[Boolean,Object],default:void 0},destroyTooltipOnHide:{type:Boolean,default:void 0},align:Qt(),builtinPlacements:Qt(),children:Array,onVisibleChange:Function,"onUpdate:visible":Function,onOpenChange:Function,"onUpdate:open":Function})),oy={adjustX:1,adjustY:1},sy={adjustX:0,adjustY:0},cy=[0,0];function ly(e){return typeof e==`boolean`?e?oy:sy:Z(Z({},sy),e)}function uy(e){let{arrowWidth:t=4,horizontalArrowShift:n=16,verticalArrowShift:r=8,autoAdjustOverflow:i,arrowPointAtCenter:a}=e,o={left:{points:[`cr`,`cl`],offset:[-4,0]},right:{points:[`cl`,`cr`],offset:[4,0]},top:{points:[`bc`,`tc`],offset:[0,-4]},bottom:{points:[`tc`,`bc`],offset:[0,4]},topLeft:{points:[`bl`,`tc`],offset:[-(n+t),-4]},leftTop:{points:[`tr`,`cl`],offset:[-4,-(r+t)]},topRight:{points:[`br`,`tc`],offset:[n+t,-4]},rightTop:{points:[`tl`,`cr`],offset:[4,-(r+t)]},bottomRight:{points:[`tr`,`bc`],offset:[n+t,4]},rightBottom:{points:[`bl`,`cr`],offset:[4,r+t]},bottomLeft:{points:[`tl`,`bc`],offset:[-(n+t),4]},leftBottom:{points:[`br`,`cl`],offset:[-4,r+t]}};return Object.keys(o).forEach(e=>{o[e]=a?Z(Z({},o[e]),{overflow:ly(i),targetOffset:cy}):Z(Z({},ey[e]),{overflow:ly(i)}),o[e].ignoreShake=!0}),o}function dy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(let t=0,n=e.length;t`${e}-inverse`),py=[`success`,`processing`,`error`,`default`,`warning`];function my(e){return!(arguments.length>1&&arguments[1]!==void 0)||arguments[1]?[...fy,...Ir].includes(e):Ir.includes(e)}function hy(e){return py.includes(e)}function gy(e,t){let n=my(t),r=K({[`${e}-${t}`]:t&&n}),i={},a={};return t&&!n&&(i.background=t,a[`--antd-arrow-background-color`]=t),{className:r,overlayStyle:i,arrowStyle:a}}function _y(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;return e.map(e=>`${t}${e}`).join(`,`)}function vy(e){let{sizePopupArrow:t,contentRadius:n,borderRadiusOuter:r,limitVerticalRadius:i}=e,a=t/2-Math.ceil(r*(Math.sqrt(2)-1)),o=(n>12?n+2:12)-a;return{dropdownArrowOffset:o,dropdownArrowOffsetVertical:i?8-a:o}}function yy(e,t){let{componentCls:n,sizePopupArrow:r,marginXXS:i,borderRadiusXS:a,borderRadiusOuter:o,boxShadowPopoverArrow:s}=e,{colorBg:c,showArrowCls:l,contentRadius:u=e.borderRadiusLG,limitVerticalRadius:d}=t,{dropdownArrowOffsetVertical:f,dropdownArrowOffset:p}=vy({sizePopupArrow:r,contentRadius:u,borderRadiusOuter:o,limitVerticalRadius:d}),m=r/2+i;return{[n]:{[`${n}-arrow`]:[Z(Z({position:`absolute`,zIndex:1,display:`block`},Rr(r,a,o,c,s)),{"&:before":{background:c}})],[[`&-placement-top ${n}-arrow`,`&-placement-topLeft ${n}-arrow`,`&-placement-topRight ${n}-arrow`].join(`,`)]:{bottom:0,transform:`translateY(100%) rotate(180deg)`},[`&-placement-top ${n}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(100%) rotate(180deg)`},[`&-placement-topLeft ${n}-arrow`]:{left:{_skip_check_:!0,value:p}},[`&-placement-topRight ${n}-arrow`]:{right:{_skip_check_:!0,value:p}},[[`&-placement-bottom ${n}-arrow`,`&-placement-bottomLeft ${n}-arrow`,`&-placement-bottomRight ${n}-arrow`].join(`,`)]:{top:0,transform:`translateY(-100%)`},[`&-placement-bottom ${n}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(-100%)`},[`&-placement-bottomLeft ${n}-arrow`]:{left:{_skip_check_:!0,value:p}},[`&-placement-bottomRight ${n}-arrow`]:{right:{_skip_check_:!0,value:p}},[[`&-placement-left ${n}-arrow`,`&-placement-leftTop ${n}-arrow`,`&-placement-leftBottom ${n}-arrow`].join(`,`)]:{right:{_skip_check_:!0,value:0},transform:`translateX(100%) rotate(90deg)`},[`&-placement-left ${n}-arrow`]:{top:{_skip_check_:!0,value:`50%`},transform:`translateY(-50%) translateX(100%) rotate(90deg)`},[`&-placement-leftTop ${n}-arrow`]:{top:f},[`&-placement-leftBottom ${n}-arrow`]:{bottom:f},[[`&-placement-right ${n}-arrow`,`&-placement-rightTop ${n}-arrow`,`&-placement-rightBottom ${n}-arrow`].join(`,`)]:{left:{_skip_check_:!0,value:0},transform:`translateX(-100%) rotate(-90deg)`},[`&-placement-right ${n}-arrow`]:{top:{_skip_check_:!0,value:`50%`},transform:`translateY(-50%) translateX(-100%) rotate(-90deg)`},[`&-placement-rightTop ${n}-arrow`]:{top:f},[`&-placement-rightBottom ${n}-arrow`]:{bottom:f},[_y([`&-placement-topLeft`,`&-placement-top`,`&-placement-topRight`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingBottom:m},[_y([`&-placement-bottomLeft`,`&-placement-bottom`,`&-placement-bottomRight`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingTop:m},[_y([`&-placement-leftTop`,`&-placement-left`,`&-placement-leftBottom`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingRight:{_skip_check_:!0,value:m}},[_y([`&-placement-rightTop`,`&-placement-right`,`&-placement-rightBottom`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingLeft:{_skip_check_:!0,value:m}}}}}var by=e=>{let{componentCls:t,tooltipMaxWidth:n,tooltipColor:r,tooltipBg:i,tooltipBorderRadius:a,zIndexPopup:o,controlHeight:s,boxShadowSecondary:c,paddingSM:l,paddingXS:u,tooltipRadiusOuter:d}=e;return[{[t]:Z(Z(Z(Z({},rn(e)),{position:`absolute`,zIndex:o,display:`block`,"&":[{width:`max-content`},{width:`intrinsic`}],maxWidth:n,visibility:`visible`,"&-hidden":{display:`none`},"--antd-arrow-background-color":i,[`${t}-inner`]:{minWidth:s,minHeight:s,padding:`${l/2}px ${u}px`,color:r,textAlign:`start`,textDecoration:`none`,wordWrap:`break-word`,backgroundColor:i,borderRadius:a,boxShadow:c},[[`&-placement-left`,`&-placement-leftTop`,`&-placement-leftBottom`,`&-placement-right`,`&-placement-rightTop`,`&-placement-rightBottom`].join(`,`)]:{[`${t}-inner`]:{borderRadius:Math.min(a,8)}},[`${t}-content`]:{position:`relative`}}),zr(e,(e,n)=>{let{darkColor:r}=n;return{[`&${t}-${e}`]:{[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{"--antd-arrow-background-color":r}}}})),{"&-rtl":{direction:`rtl`}})},yy(B(e,{borderRadiusOuter:d}),{colorBg:`var(--antd-arrow-background-color)`,showArrowCls:``,contentRadius:a,limitVerticalRadius:!0}),{[`${t}-pure`]:{position:`relative`,maxWidth:`none`}}]},xy=((e,t)=>v(`Tooltip`,e=>{if(t?.value===!1)return[];let{borderRadius:n,colorTextLightSolid:r,colorBgDefault:i,borderRadiusOuter:a}=e;return[by(B(e,{tooltipMaxWidth:250,tooltipColor:r,tooltipBorderRadius:n,tooltipBg:i,tooltipRadiusOuter:a>4?4:a})),Q_(e,`zoom-big-fast`)]},e=>{let{zIndexPopupBase:t,colorBgSpotlight:n}=e;return{zIndexPopup:t+70,colorBgDefault:n}})(e)),Sy=(e,t)=>{let n={},r=Z({},e);return t.forEach(t=>{e&&t in e&&(n[t]=e[t],delete r[t])}),{picked:n,omitted:r}},Cy=()=>Z(Z({},ay()),{title:f.any}),wy=()=>({trigger:`hover`,align:{},placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),Ty=a(u({compatConfig:{MODE:3},name:`ATooltip`,inheritAttrs:!1,props:Zn(Cy(),{trigger:`hover`,align:{},placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i,expose:a}=t,{prefixCls:o,getPopupContainer:s,direction:c,rootPrefixCls:l}=X(`tooltip`,e),u=J(()=>e.open??e.visible),d=H(dy([e.open,e.visible])),f=H(),p;G(u,e=>{ir.cancel(p),p=ir(()=>{d.value=!!e})});let m=()=>{let t=e.title??n.title;return!t&&t!==0},h=e=>{let t=m();u.value===void 0&&(d.value=!t&&e),t||(r(`update:visible`,e),r(`visibleChange`,e),r(`update:open`,e),r(`openChange`,e))};a({getPopupDomNode:()=>f.value.getPopupDomNode(),open:d,forcePopupAlign:()=>f.value?.forcePopupAlign()});let g=J(()=>{let{builtinPlacements:t,autoAdjustOverflow:n,arrow:r,arrowPointAtCenter:i}=e,a=i;return typeof r==`object`&&(a=r.pointAtCenter??i),t||uy({arrowPointAtCenter:a,autoAdjustOverflow:n})}),_=e=>e||e===``,v=e=>{let t=e.type;if(typeof t==`object`&&e.props&&((t.__ANT_BUTTON===!0||t===`button`)&&_(e.props.disabled)||t.__ANT_SWITCH===!0&&(_(e.props.disabled)||_(e.props.loading))||t.__ANT_RADIO===!0&&_(e.props.disabled))){let{picked:t,omitted:n}=Sy(Ce(e),[`position`,`left`,`right`,`top`,`bottom`,`float`,`display`,`zIndex`]),r=Z(Z({display:`inline-block`},t),{cursor:`not-allowed`,lineHeight:1,width:e.props&&e.props.block?`100%`:void 0}),i=ao(e,{style:Z(Z({},n),{pointerEvents:`none`})},!0);return U(`span`,{style:r,class:`${o.value}-disabled-compatible-wrapper`},[i])}return e},y=()=>e.title??n.title?.call(n),b=(e,t)=>{let n=g.value,r=Object.keys(n).find(e=>n[e].points[0]===t.points?.[0]&&n[e].points[1]===t.points?.[1]);if(r){let n=e.getBoundingClientRect(),i={top:`50%`,left:`50%`};r.indexOf(`top`)>=0||r.indexOf(`Bottom`)>=0?i.top=`${n.height-t.offset[1]}px`:(r.indexOf(`Top`)>=0||r.indexOf(`bottom`)>=0)&&(i.top=`${-t.offset[1]}px`),r.indexOf(`left`)>=0||r.indexOf(`Right`)>=0?i.left=`${n.width-t.offset[0]}px`:(r.indexOf(`right`)>=0||r.indexOf(`Left`)>=0)&&(i.left=`${-t.offset[0]}px`),e.style.transformOrigin=`${i.left} ${i.top}`}},x=J(()=>gy(o.value,e.color)),S=J(()=>i[`data-popover-inject`]),[w,T]=xy(o,J(()=>!S.value));return()=>{let{openClassName:t,overlayClassName:r,overlayStyle:a,overlayInnerStyle:p}=e,_=dt(n.default?.call(n))??null;_=_.length===1?_[0]:_;let S=d.value;if(u.value===void 0&&m()&&(S=!1),!_)return null;let E=v(Nt(_)&&!C(_)?_:U(`span`,null,[_])),D=K({[t||`${o.value}-open`]:!0,[E.props&&E.props.class]:E.props&&E.props.class}),O=K(r,{[`${o.value}-rtl`]:c.value===`rtl`},x.value.className,T.value),k=Z(Z({},x.value.overlayStyle),p),A=x.value.arrowStyle,j=Z(Z(Z({},i),e),{prefixCls:o.value,arrow:!!e.arrow,getPopupContainer:s?.value,builtinPlacements:g.value,visible:S,ref:f,overlayClassName:O,overlayStyle:Z(Z({},A),a),overlayInnerStyle:k,onVisibleChange:h,onPopupAlign:b,transitionName:Xt(l.value,`zoom-big-fast`,e.transitionName)});return w(U(iy,j,{default:()=>[d.value?ao(E,{class:D}):E],arrowContent:()=>U(`span`,{class:`${o.value}-arrow-content`},null),overlay:y}))}}})),Ey=e=>{let{componentCls:t,popoverBg:n,popoverColor:r,width:i,fontWeightStrong:a,popoverPadding:o,boxShadowSecondary:s,colorTextHeading:c,borderRadiusLG:l,zIndexPopup:u,marginXS:d,colorBgElevated:f}=e;return[{[t]:Z(Z({},rn(e)),{position:`absolute`,top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:`normal`,whiteSpace:`normal`,textAlign:`start`,cursor:`auto`,userSelect:`text`,"--antd-arrow-background-color":f,"&-rtl":{direction:`rtl`},"&-hidden":{display:`none`},[`${t}-content`]:{position:`relative`},[`${t}-inner`]:{backgroundColor:n,backgroundClip:`padding-box`,borderRadius:l,boxShadow:s,padding:o},[`${t}-title`]:{minWidth:i,marginBottom:d,color:c,fontWeight:a},[`${t}-inner-content`]:{color:r}})},yy(e,{colorBg:`var(--antd-arrow-background-color)`}),{[`${t}-pure`]:{position:`relative`,maxWidth:`none`,[`${t}-content`]:{display:`inline-block`}}}]},Dy=e=>{let{componentCls:t}=e;return{[t]:Ir.map(n=>{let r=e[`${n}-6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":r,[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{background:`transparent`}}}})}},Oy=e=>{let{componentCls:t,lineWidth:n,lineType:r,colorSplit:i,paddingSM:a,controlHeight:o,fontSize:s,lineHeight:c,padding:l}=e,u=o-Math.round(s*c),d=u/2,f=u/2-n,p=l;return{[t]:{[`${t}-inner`]:{padding:0},[`${t}-title`]:{margin:0,padding:`${d}px ${p}px ${f}px`,borderBottom:`${n}px ${r} ${i}`},[`${t}-inner-content`]:{padding:`${a}px ${p}px`}}}},ky=v(`Popover`,e=>{let{colorBgElevated:t,colorText:n,wireframe:r}=e,i=B(e,{popoverBg:t,popoverColor:n,popoverPadding:12});return[Ey(i),Dy(i),r&&Oy(i),Q_(i,`zoom-big`)]},e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+30,width:177}}),Ay=a(u({compatConfig:{MODE:3},name:`APopover`,inheritAttrs:!1,props:Zn(Z(Z({},ay()),{content:nn(),title:nn()}),Z(Z({},wy()),{trigger:`hover`,placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1})),setup(t,n){let{expose:r,slots:i,attrs:a}=n,o=H();e(t.visible===void 0,`popover`,"`visible` will be removed in next major version, please use `open` instead."),r({getPopupDomNode:()=>{var e;return((e=o.value)?.getPopupDomNode)?.call(e)}});let{prefixCls:s,configProvider:c}=X(`popover`,t),[l,u]=ky(s),d=J(()=>c.getPrefixCls()),f=()=>{let{title:e=dt(i.title?.call(i)),content:n=dt(i.content?.call(i))}=t,r=!!(Array.isArray(e)?e.length:e),a=!!(Array.isArray(n)?n.length:e);return!r&&!a?null:U($e,null,[r&&U(`div`,{class:`${s.value}-title`},[e]),U(`div`,{class:`${s.value}-inner-content`},[n])])};return()=>{let e=K(t.overlayClassName,u.value);return l(U(Ty,Y(Y(Y({},Br(t,[`title`,`content`])),a),{},{prefixCls:s.value,ref:o,overlayClassName:e,transitionName:Xt(d.value,`zoom-big`,t.transitionName),"data-popover-inject":!0}),{title:f,default:i.default}))}}})),jy=u({compatConfig:{MODE:3},name:`AAvatarGroup`,inheritAttrs:!1,props:{prefixCls:String,maxCount:Number,maxStyle:{type:Object,default:void 0},maxPopoverPlacement:{type:String,default:`top`},maxPopoverTrigger:String,size:{type:[Number,String,Object],default:`default`},shape:{type:String,default:`circle`}},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`avatar`,e),o=J(()=>`${i.value}-group`),[s,c]=qv(i);return S(()=>{Xv({size:e.size,shape:e.shape})}),()=>{let{maxPopoverPlacement:t=`top`,maxCount:i,maxStyle:l,maxPopoverTrigger:u=`hover`,shape:d}=e,f={[o.value]:!0,[`${o.value}-rtl`]:a.value===`rtl`,[`${r.class}`]:!!r.class,[c.value]:!0},p=ce(on(n,e)).map((e,t)=>ao(e,{key:`avatar-key-${t}`})),m=p.length;if(i&&i[U(Zv,{style:l,shape:d},{default:()=>[`+${m-i}`]})]})),s(U(`div`,Y(Y({},r),{},{class:f,style:r.style}),[e]))}return s(U(`div`,Y(Y({},r),{},{class:f,style:r.style}),[p]))}}});Zv.Group=jy,Zv.install=function(e){return e.component(Zv.name,Zv),e.component(jy.name,jy),e};var My=Zv;function Ny(e){let{prefixCls:t,value:n,current:r,offset:i=0}=e,a;return i&&(a={position:`absolute`,top:`${i}00%`,left:0}),U(`p`,{style:a,class:K(`${t}-only-unit`,{current:r})},[n])}function Py(e,t,n){let r=e,i=0;for(;(r+10)%10!==t;)r+=n,i+=n;return i}var Fy=u({compatConfig:{MODE:3},name:`SingleNumber`,props:{prefixCls:String,value:String,count:Number},setup(e){let t=J(()=>Number(e.value)),n=J(()=>Math.abs(e.count)),r=Ne({prevValue:t.value,prevCount:n.value}),i=()=>{r.prevValue=t.value,r.prevCount=n.value},a=H();return G(t,()=>{clearTimeout(a.value),a.value=setTimeout(()=>{i()},1e3)},{flush:`post`}),y(()=>{clearTimeout(a.value)}),()=>{let a,o={},s=t.value;if(r.prevValue===s||Number.isNaN(s)||Number.isNaN(r.prevValue))a=[Ny(Z(Z({},e),{current:!0}))],o={transition:`none`};else{a=[];let t=s+10,i=[];for(let e=s;e<=t;e+=1)i.push(e);let c=i.findIndex(e=>e%10===r.prevValue);a=i.map((t,n)=>{let r=t%10;return Ny(Z(Z({},e),{value:r,offset:n-c,current:n===c}))});let l=r.prevCounti()},[a])}}}),Iy=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=Z(Z({},e),n),{prefixCls:a,count:o,title:s,show:c,component:l=`sup`,class:u,style:d}=t,f=Z(Z({},Iy(t,[`prefixCls`,`count`,`title`,`show`,`component`,`class`,`style`])),{style:d,"data-show":e.show,class:K(i.value,u),title:s}),p=o;if(o&&Number(o)%1==0){let e=String(o).split(``);p=e.map((t,n)=>U(Fy,{prefixCls:i.value,count:Number(o),value:t,key:e.length-n},null))}d&&d.borderColor&&(f.style=Z(Z({},d),{boxShadow:`0 0 0 1px ${d.borderColor} inset`}));let m=dt(r.default?.call(r));return m&&m.length?ao(m,{class:K(`${i.value}-custom-component`)},!1):U(l,f,{default:()=>[p]})}}}),Ry=new N(`antStatusProcessing`,{"0%":{transform:`scale(0.8)`,opacity:.5},"100%":{transform:`scale(2.4)`,opacity:0}}),zy=new N(`antZoomBadgeIn`,{"0%":{transform:`scale(0) translate(50%, -50%)`,opacity:0},"100%":{transform:`scale(1) translate(50%, -50%)`}}),By=new N(`antZoomBadgeOut`,{"0%":{transform:`scale(1) translate(50%, -50%)`},"100%":{transform:`scale(0) translate(50%, -50%)`,opacity:0}}),Vy=new N(`antNoWrapperZoomBadgeIn`,{"0%":{transform:`scale(0)`,opacity:0},"100%":{transform:`scale(1)`}}),Hy=new N(`antNoWrapperZoomBadgeOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0)`,opacity:0}}),Uy=new N(`antBadgeLoadingCircle`,{"0%":{transformOrigin:`50%`},"100%":{transform:`translate(50%, -50%) rotate(360deg)`,transformOrigin:`50%`}}),Wy=e=>{let{componentCls:t,iconCls:n,antCls:r,badgeFontHeight:i,badgeShadowSize:a,badgeHeightSm:o,motionDurationSlow:s,badgeStatusSize:c,marginXS:l,badgeRibbonOffset:u}=e,d=`${r}-scroll-number`,f=`${r}-ribbon`,p=`${r}-ribbon-wrapper`,m=zr(e,(e,n)=>{let{darkColor:r}=n;return{[`&${t} ${t}-color-${e}`]:{background:r,[`&:not(${t}-count)`]:{color:r}}}}),h=zr(e,(e,t)=>{let{darkColor:n}=t;return{[`&${f}-color-${e}`]:{background:n,color:n}}});return{[t]:Z(Z(Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,width:`fit-content`,lineHeight:1,[`${t}-count`]:{zIndex:e.badgeZIndex,minWidth:e.badgeHeight,height:e.badgeHeight,color:e.badgeTextColor,fontWeight:e.badgeFontWeight,fontSize:e.badgeFontSize,lineHeight:`${e.badgeHeight}px`,whiteSpace:`nowrap`,textAlign:`center`,background:e.badgeColor,borderRadius:e.badgeHeight/2,boxShadow:`0 0 0 ${a}px ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:o,height:o,fontSize:e.badgeFontSizeSm,lineHeight:`${o}px`,borderRadius:o/2},[`${t}-multiple-words`]:{padding:`0 ${e.paddingXS}px`},[`${t}-dot`]:{zIndex:e.badgeZIndex,width:e.badgeDotSize,minWidth:e.badgeDotSize,height:e.badgeDotSize,background:e.badgeColor,borderRadius:`100%`,boxShadow:`0 0 0 ${a}px ${e.badgeShadowColor}`},[`${t}-dot${d}`]:{transition:`background ${s}`},[`${t}-count, ${t}-dot, ${d}-custom-component`]:{position:`absolute`,top:0,insetInlineEnd:0,transform:`translate(50%, -50%)`,transformOrigin:`100% 0%`,[`&${n}-spin`]:{animationName:Uy,animationDuration:`1s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`}},[`&${t}-status`]:{lineHeight:`inherit`,verticalAlign:`baseline`,[`${t}-status-dot`]:{position:`relative`,top:-1,display:`inline-block`,width:c,height:c,verticalAlign:`middle`,borderRadius:`50%`},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:`visible`,color:e.colorPrimary,backgroundColor:e.colorPrimary,"&::after":{position:`absolute`,top:0,insetInlineStart:0,width:`100%`,height:`100%`,borderWidth:a,borderStyle:`solid`,borderColor:`inherit`,borderRadius:`50%`,animationName:Ry,animationDuration:e.badgeProcessingDuration,animationIterationCount:`infinite`,animationTimingFunction:`ease-in-out`,content:`""`}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:l,color:e.colorText,fontSize:e.fontSize}}}),m),{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:zy,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:`both`},[`${t}-zoom-leave`]:{animationName:By,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:`both`},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:Vy,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:Hy,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:`middle`},[`${d}-custom-component, ${t}-count`]:{transform:`none`},[`${d}-custom-component, ${d}`]:{position:`relative`,top:`auto`,display:`block`,transformOrigin:`50% 50%`}},[`${d}`]:{overflow:`hidden`,[`${d}-only`]:{position:`relative`,display:`inline-block`,height:e.badgeHeight,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:`preserve-3d`,WebkitBackfaceVisibility:`hidden`,[`> p${d}-only-unit`]:{height:e.badgeHeight,margin:0,WebkitTransformStyle:`preserve-3d`,WebkitBackfaceVisibility:`hidden`}},[`${d}-symbol`]:{verticalAlign:`top`}},"&-rtl":{direction:`rtl`,[`${t}-count, ${t}-dot, ${d}-custom-component`]:{transform:`translate(-50%, -50%)`}}}),[`${p}`]:{position:`relative`},[`${f}`]:Z(Z(Z(Z({},rn(e)),{position:`absolute`,top:l,padding:`0 ${e.paddingXS}px`,color:e.colorPrimary,lineHeight:`${i}px`,whiteSpace:`nowrap`,backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${f}-text`]:{color:e.colorTextLightSolid},[`${f}-corner`]:{position:`absolute`,top:`100%`,width:u,height:u,color:`currentcolor`,border:`${u/2}px solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:`top`,filter:e.badgeRibbonCornerFilter}}),h),{[`&${f}-placement-end`]:{insetInlineEnd:-u,borderEndEndRadius:0,[`${f}-corner`]:{insetInlineEnd:0,borderInlineEndColor:`transparent`,borderBlockEndColor:`transparent`}},[`&${f}-placement-start`]:{insetInlineStart:-u,borderEndStartRadius:0,[`${f}-corner`]:{insetInlineStart:0,borderBlockEndColor:`transparent`,borderInlineStartColor:`transparent`}},"&-rtl":{direction:`rtl`}})}},Gy=v(`Badge`,e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:i,marginXS:a,colorBorderBg:o}=e,s=Math.round(t*n),c=i,l=s-2*c,u=e.colorBgContainer,d=r,f=e.colorError,p=e.colorErrorHover;return[Wy(B(e,{badgeFontHeight:s,badgeShadowSize:c,badgeZIndex:`auto`,badgeHeight:l,badgeTextColor:u,badgeFontWeight:`normal`,badgeFontSize:d,badgeColor:f,badgeColorHover:p,badgeShadowColor:o,badgeHeightSm:t,badgeDotSize:r/2,badgeFontSizeSm:r,badgeStatusSize:r/2,badgeProcessingDuration:`1.2s`,badgeRibbonOffset:a,badgeRibbonCornerTransform:`scaleY(0.75)`,badgeRibbonCornerFilter:`brightness(75%)`}))]}),Ky=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);imy(e.color,!1)),l=J(()=>[i.value,`${i.value}-placement-${e.placement}`,{[`${i.value}-rtl`]:a.value===`rtl`,[`${i.value}-color-${e.color}`]:c.value}]);return()=>{let{class:t,style:a}=n,u=Ky(n,[`class`,`style`]),d={},f={};return e.color&&!c.value&&(d.background=e.color,f.color=e.color),o(U(`div`,Y({class:`${i.value}-wrapper ${s.value}`},u),[r.default?.call(r),U(`div`,{class:[l.value,t,s.value],style:Z(Z({},d),a)},[U(`span`,{class:`${i.value}-text`},[e.text||r.text?.call(r)]),U(`div`,{class:`${i.value}-corner`,style:f},null)])]))}}}),Jy=e=>!isNaN(parseFloat(e))&&isFinite(e),Yy=u({compatConfig:{MODE:3},name:`ABadge`,Ribbon:qy,inheritAttrs:!1,props:{count:f.any.def(null),showZero:{type:Boolean,default:void 0},overflowCount:{type:Number,default:99},dot:{type:Boolean,default:void 0},prefixCls:String,scrollNumberPrefixCls:String,status:{type:String},size:{type:String,default:`default`},color:String,text:f.any,offset:Array,numberStyle:{type:Object,default:void 0},title:String},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`badge`,e),[o,s]=Gy(i),c=J(()=>e.count>e.overflowCount?`${e.overflowCount}+`:e.count),l=J(()=>c.value===`0`||c.value===0),u=J(()=>e.count===null||l.value&&!e.showZero),d=J(()=>(e.status!==null&&e.status!==void 0||e.color!==null&&e.color!==void 0)&&u.value),f=J(()=>e.dot&&!l.value),p=J(()=>f.value?``:c.value),m=J(()=>(p.value===null||p.value===void 0||p.value===``||l.value&&!e.showZero)&&!f.value),h=H(e.count),g=H(p.value),_=H(f.value);G([()=>e.count,p,f],()=>{m.value||(h.value=e.count,g.value=p.value,_.value=f.value)},{immediate:!0});let v=J(()=>my(e.color,!1)),y=J(()=>({[`${i.value}-status-dot`]:d.value,[`${i.value}-status-${e.status}`]:!!e.status,[`${i.value}-color-${e.color}`]:v.value})),b=J(()=>e.color&&!v.value?{background:e.color,color:e.color}:{}),x=J(()=>({[`${i.value}-dot`]:_.value,[`${i.value}-count`]:!_.value,[`${i.value}-count-sm`]:e.size===`small`,[`${i.value}-multiple-words`]:!_.value&&g.value&&g.value.toString().length>1,[`${i.value}-status-${e.status}`]:!!e.status,[`${i.value}-color-${e.color}`]:v.value}));return()=>{let{offset:t,title:c,color:l}=e,u=r.style,f=on(n,e,`text`),p=i.value,_=h.value,S=ce(n.default?.call(n));S=S.length?S:null;let C=!!(!m.value||n.count),w=(()=>{if(!t)return Z({},u);let e={marginTop:Jy(t[1])?`${t[1]}px`:t[1]};return a.value===`rtl`?e.left=`${parseInt(t[0],10)}px`:e.right=`${-parseInt(t[0],10)}px`,Z(Z({},e),u)})(),T=c??(typeof _==`string`||typeof _==`number`?_:void 0),E=C||!f?null:U(`span`,{class:`${p}-status-text`},[f]),D=typeof _==`object`||_===void 0&&n.count?ao(_??n.count?.call(n),{style:w},!1):null,O=K(p,{[`${p}-status`]:d.value,[`${p}-not-a-wrapper`]:!S,[`${p}-rtl`]:a.value===`rtl`},r.class,s.value);if(!S&&d.value){let e=w.color;return o(U(`span`,Y(Y({},r),{},{class:O,style:w}),[U(`span`,{class:y.value,style:b.value},null),U(`span`,{style:{color:e},class:`${p}-status-text`},[f])]))}let k=ge(S?`${p}-zoom`:``,{appear:!1}),A=Z(Z({},w),e.numberStyle);return l&&!v.value&&(A||={},A.background=l),o(U(`span`,Y(Y({},r),{},{class:O}),[S,U(Re,k,{default:()=>[Mt(U(Ly,{prefixCls:e.scrollNumberPrefixCls,show:C,class:x.value,count:g.value,title:T,style:A,key:`scrollNumber`},{default:()=>[D]}),[[ht,C]])]}),E]))}}});Yy.install=function(e){return e.component(Yy.name,Yy),e.component(qy.name,qy),e};var Xy=Yy,Zy={adjustX:1,adjustY:1},Qy=[0,0],$y={topLeft:{points:[`bl`,`tl`],overflow:Zy,offset:[0,-4],targetOffset:Qy},topCenter:{points:[`bc`,`tc`],overflow:Zy,offset:[0,-4],targetOffset:Qy},topRight:{points:[`br`,`tr`],overflow:Zy,offset:[0,-4],targetOffset:Qy},bottomLeft:{points:[`tl`,`bl`],overflow:Zy,offset:[0,4],targetOffset:Qy},bottomCenter:{points:[`tc`,`bc`],overflow:Zy,offset:[0,4],targetOffset:Qy},bottomRight:{points:[`tr`,`br`],overflow:Zy,offset:[0,4],targetOffset:Qy}},eb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.visible,e=>{e!==void 0&&(a.value=e)});let o=H();i({triggerRef:o});let s=t=>{e.visible===void 0&&(a.value=!1),r(`overlayClick`,t)},c=t=>{e.visible===void 0&&(a.value=t),r(`visibleChange`,t)},l=()=>{let t=n.overlay?.call(n),r={prefixCls:`${e.prefixCls}-menu`,onClick:s};return U($e,{key:M},[e.arrow&&U(`div`,{class:`${e.prefixCls}-arrow`},null),ao(t,r,!1)])},u=J(()=>{let{minOverlayWidthMatchTrigger:t=!e.alignPoint}=e;return t}),d=()=>{let t=n.default?.call(n);return a.value&&t?ao(t[0],{class:e.openClassName||`${e.prefixCls}-open`},!1):t},f=J(()=>!e.hideAction&&e.trigger.indexOf(`contextmenu`)!==-1?[`click`]:e.hideAction);return()=>{let{prefixCls:t,arrow:n,showAction:r,overlayStyle:i,trigger:s,placement:p,align:m,getPopupContainer:h,transitionName:g,animation:_,overlayClassName:v}=e;return U(Su,Y(Y({},eb(e,[`prefixCls`,`arrow`,`showAction`,`overlayStyle`,`trigger`,`placement`,`align`,`getPopupContainer`,`transitionName`,`animation`,`overlayClassName`])),{},{prefixCls:t,ref:o,popupClassName:K(v,{[`${t}-show-arrow`]:n}),popupStyle:i,builtinPlacements:$y,action:s,showAction:r,hideAction:f.value||[],popupPlacement:p,popupAlign:m,popupTransitionName:g,popupAnimation:_,popupVisible:a.value,stretch:u.value?`minWidth`:``,onPopupVisibleChange:c,getPopupContainer:h}),{popup:l,default:d})}}}),nb=e=>{let{componentCls:t,colorPrimary:n}=e;return{[t]:{position:`absolute`,background:`transparent`,pointerEvents:`none`,boxSizing:`border-box`,color:`var(--wave-color, ${n})`,boxShadow:`0 0 0 0 currentcolor`,opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(`,`),"&-active":{boxShadow:`0 0 0 6px currentcolor`,opacity:0}}}}},rb=v(`Wave`,e=>[nb(e)]);function ib(e){let t=(e||``).match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}function ab(e){return e&&e!==`#fff`&&e!==`#ffffff`&&e!==`rgb(255, 255, 255)`&&e!==`rgba(255, 255, 255, 1)`&&ib(e)&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&e!==`transparent`}function ob(e){let{borderTopColor:t,borderColor:n,backgroundColor:r}=getComputedStyle(e);return ab(t)?t:ab(n)?n:ab(r)?r:null}function sb(e){return Number.isNaN(e)?0:e}var cb=u({props:{target:Qt(),className:String},setup(e){let t=q(null),[n,r]=ff(null),[i,a]=ff([]),[o,s]=ff(0),[c,l]=ff(0),[u,d]=ff(0),[f,p]=ff(0),[m,h]=ff(!1);function g(){let{target:t}=e,n=getComputedStyle(t);r(ob(t));let i=n.position===`static`,{borderLeftWidth:o,borderTopWidth:c}=n;s(i?t.offsetLeft:sb(-parseFloat(o))),l(i?t.offsetTop:sb(-parseFloat(c))),d(t.offsetWidth),p(t.offsetHeight);let{borderTopLeftRadius:u,borderTopRightRadius:f,borderBottomLeftRadius:m,borderBottomRightRadius:h}=n;a([u,f,h,m].map(e=>sb(parseFloat(e))))}let _,v,y,b=()=>{clearTimeout(y),ir.cancel(v),_?.disconnect()},x=()=>{let e=t.value?.parentElement;e&&(Ge(null,e),e.parentElement&&e.parentElement.removeChild(e))};V(()=>{b(),y=setTimeout(()=>{x()},5e3);let{target:t}=e;t&&(v=ir(()=>{g(),h(!0)}),typeof ResizeObserver<`u`&&(_=new ResizeObserver(g),_.observe(t)))}),ut(()=>{b()});let S=e=>{e.propertyName===`opacity`&&x()};return()=>{if(!m.value)return null;let r={left:`${o.value}px`,top:`${c.value}px`,width:`${u.value}px`,height:`${f.value}px`,borderRadius:i.value.map(e=>`${e}px`).join(` `)};return n&&(r[`--wave-color`]=n.value),U(Re,{appear:!0,name:`wave-motion`,appearFromClass:`wave-motion-appear`,appearActiveClass:`wave-motion-appear`,appearToClass:`wave-motion-appear wave-motion-appear-active`},{default:()=>[U(`div`,{ref:t,class:e.className,style:r,onTransitionend:S},null)]})}}});function lb(e,t){let n=document.createElement(`div`);return n.style.position=`absolute`,n.style.left=`0px`,n.style.top=`0px`,e?.insertBefore(n,e?.firstChild),Ge(U(cb,{target:e,className:t},null),n),()=>{Ge(null,n),n.parentElement&&n.parentElement.removeChild(n)}}function ub(e,t){let n=Zt(),r;function i(){let i=ae(n);r?.(),!(t?.value?.disabled||!i)&&(r=lb(i,e.value))}return ut(()=>{r?.()}),i}var db=u({compatConfig:{MODE:3},name:`Wave`,props:{disabled:Boolean},setup(e,t){let{slots:n}=t,r=Zt(),{prefixCls:i,wave:a}=X(`wave`,e),[,o]=rb(i),s=ub(J(()=>K(i.value,o.value)),a),c,l=()=>{ae(r).removeEventListener(`click`,c,!0)};return V(()=>{G(()=>e.disabled,()=>{l(),z(()=>{let t=ae(r);t?.removeEventListener(`click`,c,!0),!(!t||t.nodeType!==1||e.disabled)&&(c=e=>{e.target.tagName===`INPUT`||!fo(e.target)||!t.getAttribute||t.getAttribute(`disabled`)||t.disabled||t.className.includes(`disabled`)||t.className.includes(`-leave`)||s()},t.addEventListener(`click`,c,!0))})},{immediate:!0,flush:`post`})}),ut(()=>{l()}),()=>n.default?.call(n)[0]}});function fb(e){return e===`danger`?{danger:!0}:{type:e}}var pb=()=>({prefixCls:String,type:String,htmlType:{type:String,default:`button`},shape:{type:String},size:{type:String},loading:{type:[Boolean,Object],default:()=>!1},disabled:{type:Boolean,default:void 0},ghost:{type:Boolean,default:void 0},block:{type:Boolean,default:void 0},danger:{type:Boolean,default:void 0},icon:f.any,href:String,target:String,title:String,onClick:he(),onMousedown:he()}),mb=e=>{e&&(e.style.width=`0px`,e.style.opacity=`0`,e.style.transform=`scale(0)`)},hb=e=>{z(()=>{e&&(e.style.width=`${e.scrollWidth}px`,e.style.opacity=`1`,e.style.transform=`scale(1)`)})},gb=e=>{e&&e.style&&(e.style.width=null,e.style.opacity=null,e.style.transform=null)},_b=u({compatConfig:{MODE:3},name:`LoadingIcon`,props:{prefixCls:String,loading:[Boolean,Object],existIcon:Boolean},setup(e){return()=>{let{existIcon:t,prefixCls:n,loading:r}=e;if(t)return U(`span`,{class:`${n}-loading-icon`},[U(qt,null,null)]);let i=!!r;return U(Re,{name:`${n}-loading-icon-motion`,onBeforeEnter:mb,onEnter:hb,onAfterEnter:gb,onBeforeLeave:hb,onLeave:e=>{setTimeout(()=>{mb(e)})},onAfterLeave:gb},{default:()=>[i?U(`span`,{class:`${n}-loading-icon`},[U(qt,null,null)]):null]})}}}),vb=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),yb=e=>{let{componentCls:t,fontSize:n,lineWidth:r,colorPrimaryHover:i,colorErrorHover:a}=e;return{[`${t}-group`]:[{position:`relative`,display:`inline-flex`,[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-r,[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:`relative`,zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},vb(`${t}-primary`,i),vb(`${t}-danger`,a)]}};function bb(e,t){return{[`&-item:not(${t}-last-item)`]:{marginBottom:-e.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function xb(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function Sb(e){let t=`${e.componentCls}-compact-vertical`;return{[t]:Z(Z({},bb(e,t)),xb(e.componentCls,t))}}var Cb=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{outline:`none`,position:`relative`,display:`inline-block`,fontWeight:400,whiteSpace:`nowrap`,textAlign:`center`,backgroundImage:`none`,backgroundColor:`transparent`,border:`${e.lineWidth}px ${e.lineType} transparent`,cursor:`pointer`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:`none`,touchAction:`manipulation`,lineHeight:e.lineHeight,color:e.colorText,"> span":{display:`inline-block`},[`> ${n} + span, > span + ${n}`]:{marginInlineStart:e.marginXS},"> a":{color:`currentColor`},"&:not(:disabled)":Z({},de(e)),[`&-icon-only${t}-compact-item`]:{flex:`none`},[`&-compact-item${t}-primary`]:{[`&:not([disabled]) + ${t}-compact-item${t}-primary:not([disabled])`]:{position:`relative`,"&:before":{position:`absolute`,top:-e.lineWidth,insetInlineStart:-e.lineWidth,display:`inline-block`,width:e.lineWidth,height:`calc(100% + ${e.lineWidth*2}px)`,backgroundColor:e.colorPrimaryHover,content:`""`}}},"&-compact-vertical-item":{[`&${t}-primary`]:{[`&:not([disabled]) + ${t}-compact-vertical-item${t}-primary:not([disabled])`]:{position:`relative`,"&:before":{position:`absolute`,top:-e.lineWidth,insetInlineStart:-e.lineWidth,display:`inline-block`,width:`calc(100% + ${e.lineWidth*2}px)`,height:e.lineWidth,backgroundColor:e.colorPrimaryHover,content:`""`}}}}}}},wb=(e,t)=>({"&:not(:disabled)":{"&:hover":e,"&:active":t}}),Tb=e=>({minWidth:e.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:`50%`}),Eb=e=>({borderRadius:e.controlHeight,paddingInlineStart:e.controlHeight/2,paddingInlineEnd:e.controlHeight/2}),Db=e=>({cursor:`not-allowed`,borderColor:e.colorBorder,color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,boxShadow:`none`}),Ob=(e,t,n,r,i,a,o)=>({[`&${e}-background-ghost`]:Z(Z({color:t||void 0,backgroundColor:`transparent`,borderColor:n||void 0,boxShadow:`none`},wb(Z({backgroundColor:`transparent`},a),Z({backgroundColor:`transparent`},o))),{"&:disabled":{cursor:`not-allowed`,color:r||void 0,borderColor:i||void 0}})}),kb=e=>({"&:disabled":Z({},Db(e))}),Ab=e=>Z({},kb(e)),jb=e=>({"&:disabled":{cursor:`not-allowed`,color:e.colorTextDisabled}}),Mb=e=>Z(Z(Z(Z(Z({},Ab(e)),{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,boxShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`}),wb({color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),Ob(e.componentCls,e.colorBgContainer,e.colorBgContainer,e.colorTextDisabled,e.colorBorder)),{[`&${e.componentCls}-dangerous`]:Z(Z(Z({color:e.colorError,borderColor:e.colorError},wb({color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),Ob(e.componentCls,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder)),kb(e))}),Nb=e=>Z(Z(Z(Z(Z({},Ab(e)),{color:e.colorTextLightSolid,backgroundColor:e.colorPrimary,boxShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`}),wb({color:e.colorTextLightSolid,backgroundColor:e.colorPrimaryHover},{color:e.colorTextLightSolid,backgroundColor:e.colorPrimaryActive})),Ob(e.componentCls,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),{[`&${e.componentCls}-dangerous`]:Z(Z(Z({backgroundColor:e.colorError,boxShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`},wb({backgroundColor:e.colorErrorHover},{backgroundColor:e.colorErrorActive})),Ob(e.componentCls,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),kb(e))}),Pb=e=>Z(Z({},Mb(e)),{borderStyle:`dashed`}),Fb=e=>Z(Z(Z({color:e.colorLink},wb({color:e.colorLinkHover},{color:e.colorLinkActive})),jb(e)),{[`&${e.componentCls}-dangerous`]:Z(Z({color:e.colorError},wb({color:e.colorErrorHover},{color:e.colorErrorActive})),jb(e))}),Ib=e=>Z(Z(Z({},wb({color:e.colorText,backgroundColor:e.colorBgTextHover},{color:e.colorText,backgroundColor:e.colorBgTextActive})),jb(e)),{[`&${e.componentCls}-dangerous`]:Z(Z({color:e.colorError},jb(e)),wb({color:e.colorErrorHover,backgroundColor:e.colorErrorBg},{color:e.colorErrorHover,backgroundColor:e.colorErrorBg}))}),Lb=e=>Z(Z({},Db(e)),{[`&${e.componentCls}:hover`]:Z({},Db(e))}),Rb=e=>{let{componentCls:t}=e;return{[`${t}-default`]:Mb(e),[`${t}-primary`]:Nb(e),[`${t}-dashed`]:Pb(e),[`${t}-link`]:Fb(e),[`${t}-text`]:Ib(e),[`${t}-disabled`]:Lb(e)}},zb=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,{componentCls:n,iconCls:r,controlHeight:i,fontSize:a,lineHeight:o,lineWidth:s,borderRadius:c,buttonPaddingHorizontal:l}=e,u=Math.max(0,(i-a*o)/2-s),d=l-s,f=`${n}-icon-only`;return[{[`${n}${t}`]:{fontSize:a,height:i,padding:`${u}px ${d}px`,borderRadius:c,[`&${f}`]:{width:i,paddingInlineStart:0,paddingInlineEnd:0,[`&${n}-round`]:{width:`auto`},"> span":{transform:`scale(1.143)`}},[`&${n}-loading`]:{opacity:e.opacityLoading,cursor:`default`},[`${n}-loading-icon`]:{transition:`width ${e.motionDurationSlow} ${e.motionEaseInOut}, opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`&:not(${f}) ${n}-loading-icon > ${r}`]:{marginInlineEnd:e.marginXS}}},{[`${n}${n}-circle${t}`]:Tb(e)},{[`${n}${n}-round${t}`]:Eb(e)}]},Bb=e=>zb(e),Vb=e=>zb(B(e,{controlHeight:e.controlHeightSM,padding:e.paddingXS,buttonPaddingHorizontal:8,borderRadius:e.borderRadiusSM}),`${e.componentCls}-sm`),Hb=e=>zb(B(e,{controlHeight:e.controlHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`${e.componentCls}-lg`),Ub=e=>{let{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:`100%`}}}},Wb=v(`Button`,e=>{let{controlTmpOutline:t,paddingContentHorizontal:n}=e,r=B(e,{colorOutlineDefault:t,buttonPaddingHorizontal:n});return[Cb(r),Vb(r),Bb(r),Hb(r),Ub(r),Rb(r),yb(r),uv(e,{focus:!1}),Sb(e)]}),Gb=()=>({prefixCls:String,size:{type:String}}),Kb=Nf(),qb=u({compatConfig:{MODE:3},name:`AButtonGroup`,props:Gb(),setup(e,t){let{slots:n}=t,{prefixCls:r,direction:i}=X(`btn-group`,e),[,,a]=re();Kb.useProvide(Ne({size:J(()=>e.size)}));let o=J(()=>{let{size:t}=e,n=``;switch(t){case`large`:n=`lg`;break;case`small`:n=`sm`;break;case`middle`:case void 0:break;default:pi(!t,`Button.Group`,"Invalid prop `size`.")}return{[`${r.value}`]:!0,[`${r.value}-${n}`]:n,[`${r.value}-rtl`]:i.value===`rtl`,[a.value]:!0}});return()=>U(`div`,{class:o.value},[ce(n.default?.call(n))])}}),Jb=/^[\u4e00-\u9fa5]{2}$/,Yb=Jb.test.bind(Jb);function Xb(e){return e===`text`||e===`link`}var Zb=u({compatConfig:{MODE:3},name:`AButton`,inheritAttrs:!1,__ANT_BUTTON:!0,props:Zn(pb(),{type:`default`}),slots:Object,setup(e,t){let{slots:n,attrs:r,emit:i,expose:a}=t,{prefixCls:o,autoInsertSpaceInButton:s,direction:c,size:l}=X(`btn`,e),[u,d]=Wb(o),f=Kb.useInject(),p=at(),m=J(()=>e.disabled??p.value),h=q(null),g=q(void 0),_=!1,v=q(!1),y=q(!1),b=J(()=>s.value!==!1),{compactSize:x,compactItemClassnames:C}=u_(o,c),w=J(()=>typeof e.loading==`object`&&e.loading.delay?e.loading.delay||!0:!!e.loading);G(w,e=>{clearTimeout(g.value),typeof w.value==`number`?g.value=setTimeout(()=>{v.value=e},w.value):v.value=e},{immediate:!0});let T=J(()=>{let{type:t,shape:n=`default`,ghost:r,block:i,danger:a}=e,s=o.value,u={large:`lg`,small:`sm`,middle:void 0},p=x.value||f?.size||l.value,m=p&&u[p]||``;return[C.value,{[d.value]:!0,[`${s}`]:!0,[`${s}-${n}`]:n!=="default"&&n,[`${s}-${t}`]:t,[`${s}-${m}`]:m,[`${s}-loading`]:v.value,[`${s}-background-ghost`]:r&&!Xb(t),[`${s}-two-chinese-chars`]:y.value&&b.value,[`${s}-block`]:i,[`${s}-dangerous`]:!!a,[`${s}-rtl`]:c.value===`rtl`}]}),E=()=>{let e=h.value;if(!e||s.value===!1)return;let t=e.textContent;_&&Yb(t)?y.value||=!0:y.value&&=!1},D=e=>{if(v.value||m.value){e.preventDefault();return}i(`click`,e)},k=e=>{i(`mousedown`,e)},A=(e,t)=>{let n=t?` `:``;if(e.type===vt){let t=e.children.trim();return Yb(t)&&(t=t.split(``).join(n)),U(`span`,null,[t])}return e};return S(()=>{pi(!(e.ghost&&Xb(e.type)),`Button`,"`link` or `text` button can't be a `ghost` button.")}),V(E),O(E),ut(()=>{g.value&&clearTimeout(g.value)}),a({focus:()=>{var e;(e=h.value)==null||e.focus()},blur:()=>{var e;(e=h.value)==null||e.blur()}}),()=>{let{icon:t=n.icon?.call(n)}=e,i=ce(n.default?.call(n));_=i.length===1&&!t&&!Xb(e.type);let{type:a,htmlType:s,href:c,title:l,target:d}=e,f=v.value?`loading`:t,p=Z(Z({},r),{title:l,disabled:m.value,class:[T.value,r.class,{[`${o.value}-icon-only`]:i.length===0&&!!f}],onClick:D,onMousedown:k});m.value||delete p.disabled;let g=t&&!v.value?t:U(_b,{existIcon:!!t,prefixCls:o.value,loading:!!v.value},null),y=i.map(e=>A(e,_&&b.value));if(c!==void 0)return u(U(`a`,Y(Y({},p),{},{href:c,target:d,ref:h}),[g,y]));let x=U(`button`,Y(Y({},p),{},{ref:h,type:s}),[g,y]);if(!Xb(a)){let e=function(){return x}();x=U(db,{ref:`wave`,disabled:!!v.value},{default:()=>[e]})}return u(x)}}});Zb.Group=qb,Zb.install=function(e){return e.component(Zb.name,Zb),e.component(qb.name,qb),e};var Qb=Zb,$b=()=>({arrow:W([Boolean,Object]),trigger:{type:[Array,String]},menu:Qt(),overlay:f.any,visible:Q(),open:Q(),disabled:Q(),danger:Q(),autofocus:Q(),align:Qt(),getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:Qt(),forceRender:Q(),mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:Q(),destroyPopupOnHide:Q(),onVisibleChange:{type:Function},"onUpdate:visible":{type:Function},onOpenChange:{type:Function},"onUpdate:open":{type:Function}}),ex=pb(),tx=()=>Z(Z({},$b()),{type:ex.type,size:String,htmlType:ex.htmlType,href:String,disabled:Q(),prefixCls:String,icon:f.any,title:String,loading:ex.loading,onClick:he()}),nx={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z`}}]},name:`ellipsis`,theme:`outlined`};function rx(e){for(var t=1;t{let{componentCls:t,antCls:n,paddingXS:r,opacityLoading:i}=e;return{[`${t}-button`]:{whiteSpace:`nowrap`,[`&${n}-btn-group > ${n}-btn`]:{[`&-loading, &-loading + ${n}-btn`]:{cursor:`default`,pointerEvents:`none`,opacity:i},[`&:last-child:not(:first-child):not(${n}-btn-icon-only)`]:{paddingInline:r}}}}},sx=e=>{let{componentCls:t,menuCls:n,colorError:r,colorTextLightSolid:i}=e,a=`${n}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${n} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:r,"&:hover":{color:i,backgroundColor:r}}}}}},cx=e=>{let{componentCls:t,menuCls:n,zIndexPopup:r,dropdownArrowDistance:i,dropdownArrowOffset:a,sizePopupArrow:o,antCls:s,iconCls:c,motionDurationMid:l,dropdownPaddingVertical:u,fontSize:d,dropdownEdgeChildPadding:f,colorTextDisabled:p,fontSizeIcon:m,controlPaddingHorizontal:h,colorBgElevated:g,boxShadowPopoverArrow:_}=e;return[{[t]:Z(Z({},rn(e)),{position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:r,display:`block`,"&::before":{position:`absolute`,insetBlock:-i+o/2,zIndex:-9999,opacity:1e-4,content:`""`},[`${t}-wrap`]:{position:`relative`,[`${s}-btn > ${c}-down`]:{fontSize:m},[`${c}-down::before`]:{transition:`transform ${l}`}},[`${t}-wrap-open`]:{[`${c}-down::before`]:{transform:`rotate(180deg)`}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:`none`},[` + &-show-arrow${t}-placement-topLeft, + &-show-arrow${t}-placement-top, + &-show-arrow${t}-placement-topRight + `]:{paddingBottom:i},[` + &-show-arrow${t}-placement-bottomLeft, + &-show-arrow${t}-placement-bottom, + &-show-arrow${t}-placement-bottomRight + `]:{paddingTop:i},[`${t}-arrow`]:Z({position:`absolute`,zIndex:1,display:`block`},Rr(o,e.borderRadiusXS,e.borderRadiusOuter,g,_)),[` + &-placement-top > ${t}-arrow, + &-placement-topLeft > ${t}-arrow, + &-placement-topRight > ${t}-arrow + `]:{bottom:i,transform:`translateY(100%) rotate(180deg)`},[`&-placement-top > ${t}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(100%) rotate(180deg)`},[`&-placement-topLeft > ${t}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-topRight > ${t}-arrow`]:{right:{_skip_check_:!0,value:a}},[` + &-placement-bottom > ${t}-arrow, + &-placement-bottomLeft > ${t}-arrow, + &-placement-bottomRight > ${t}-arrow + `]:{top:i,transform:`translateY(-100%)`},[`&-placement-bottom > ${t}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateY(-100%) translateX(-50%)`},[`&-placement-bottomLeft > ${t}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-bottomRight > ${t}-arrow`]:{right:{_skip_check_:!0,value:a}},[`&${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottomLeft, + &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottomLeft, + &${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottom, + &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottom, + &${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottomRight, + &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:k_},[`&${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-topLeft, + &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-topLeft, + &${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-top, + &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-top, + &${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-topRight, + &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-topRight`]:{animationName:j_},[`&${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottomLeft, + &${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottom, + &${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:A_},[`&${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-topLeft, + &${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-top, + &${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-topRight`]:{animationName:M_}})},{[`${t} ${n}`]:{position:`relative`,margin:0},[`${n}-submenu-popup`]:{position:`absolute`,zIndex:r,background:`transparent`,boxShadow:`none`,transformOrigin:`0 0`,"ul,li":{listStyle:`none`},ul:{marginInline:`0.3em`}},[`${t}, ${t}-menu-submenu`]:{[n]:Z(Z({padding:f,listStyleType:`none`,backgroundColor:g,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary},de(e)),{[`${n}-item-group-title`]:{padding:`${u}px ${h}px`,color:e.colorTextDescription,transition:`all ${l}`},[`${n}-item`]:{position:`relative`,display:`flex`,alignItems:`center`,borderRadius:e.borderRadiusSM},[`${n}-item-icon`]:{minWidth:d,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${n}-title-content`]:{flex:`auto`,"> a":{color:`inherit`,transition:`all ${l}`,"&:hover":{color:`inherit`},"&::after":{position:`absolute`,inset:0,content:`""`}}},[`${n}-item, ${n}-submenu-title`]:Z(Z({clear:`both`,margin:0,padding:`${u}px ${h}px`,color:e.colorText,fontWeight:`normal`,fontSize:d,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${l}`,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},de(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:p,cursor:`not-allowed`,"&:hover":{color:p,backgroundColor:g,cursor:`not-allowed`},a:{pointerEvents:`none`}},"&-divider":{height:1,margin:`${e.marginXXS}px 0`,overflow:`hidden`,lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:`absolute`,insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:`0 !important`,color:e.colorTextDescription,fontSize:m,fontStyle:`normal`}}}),[`${n}-item-group-list`]:{margin:`0 ${e.marginXS}px`,padding:0,listStyle:`none`},[`${n}-submenu-title`]:{paddingInlineEnd:h+e.fontSizeSM},[`${n}-submenu-vertical`]:{position:`relative`},[`${n}-submenu${n}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:p,backgroundColor:g,cursor:`not-allowed`}},[`${n}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}})}},[R_(e,`slide-up`),R_(e,`slide-down`),O_(e,`move-up`),O_(e,`move-down`),Q_(e,`zoom-big`)]]},lx=v(`Dropdown`,(e,t)=>{let{rootPrefixCls:n}=t,{marginXXS:r,sizePopupArrow:i,controlHeight:a,fontSize:o,lineHeight:s,paddingXXS:c,componentCls:l,borderRadiusOuter:u,borderRadiusLG:d}=e,f=(a-o*s)/2,{dropdownArrowOffset:p}=vy({sizePopupArrow:i,contentRadius:d,borderRadiusOuter:u}),m=B(e,{menuCls:`${l}-menu`,rootPrefixCls:n,dropdownArrowDistance:i/2+r,dropdownArrowOffset:p,dropdownPaddingVertical:f,dropdownEdgeChildPadding:c});return[cx(m),ox(m),sx(m)]},e=>({zIndexPopup:e.zIndexPopupBase+50})),ux=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{i(`update:visible`,e),i(`visibleChange`,e),i(`update:open`,e),i(`openChange`,e)},{prefixCls:o,direction:s,getPopupContainer:c}=X(`dropdown`,e),l=J(()=>`${o.value}-button`),[u,d]=lx(o);return()=>{let t=Z(Z({},e),r),{type:i=`default`,disabled:o,danger:f,loading:p,htmlType:m,class:h=``,overlay:g=n.overlay?.call(n),trigger:_,align:v,open:y,visible:b,onVisibleChange:x,placement:S=s.value===`rtl`?`bottomLeft`:`bottomRight`,href:C,title:w,icon:T=n.icon?.call(n)||U(ax,null,null),mouseEnterDelay:E,mouseLeaveDelay:D,overlayClassName:O,overlayStyle:k,destroyPopupOnHide:A,onClick:j,"onUpdate:open":M}=t,N=ux(t,[`type`,`disabled`,`danger`,`loading`,`htmlType`,`class`,`overlay`,`trigger`,`align`,`open`,`visible`,`onVisibleChange`,`placement`,`href`,`title`,`icon`,`mouseEnterDelay`,`mouseLeaveDelay`,`overlayClassName`,`overlayStyle`,`destroyPopupOnHide`,`onClick`,`onUpdate:open`]),P={align:v,disabled:o,trigger:o?[]:_,placement:S,getPopupContainer:c?.value,onOpenChange:a,mouseEnterDelay:E,mouseLeaveDelay:D,open:y??b,overlayClassName:O,overlayStyle:k,destroyPopupOnHide:A},F=U(Qb,{danger:f,type:i,disabled:o,loading:p,onClick:j,htmlType:m,href:C,title:w},{default:n.default}),I=U(Qb,{danger:f,type:i,icon:T},null);return u(U(dx,Y(Y({},N),{},{class:K(l.value,h,d.value)}),{default:()=>[n.leftButton?n.leftButton({button:F}):F,U(bx,P,{default:()=>[n.rightButton?n.rightButton({button:I}):I],overlay:()=>g})]}))}}}),px={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z`}}]},name:`right`,theme:`outlined`};function mx(e){for(var t=1;tg(_x,void 0),yx=e=>{let{prefixCls:t,mode:n,selectable:r,validator:i,onClick:a,expandIcon:o}=vx()||{};fe(_x,{prefixCls:J(()=>e.prefixCls?.value??t?.value),mode:J(()=>e.mode?.value??n?.value),selectable:J(()=>e.selectable?.value??r?.value),validator:e.validator??i,onClick:e.onClick??a,expandIcon:e.expandIcon??o?.value})},bx=u({compatConfig:{MODE:3},name:`ADropdown`,inheritAttrs:!1,props:Zn($b(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:`bottomLeft`,trigger:`hover`}),slots:Object,setup(t,n){let{slots:r,attrs:i,emit:a}=n,{prefixCls:o,rootPrefixCls:s,direction:c,getPopupContainer:l}=X(`dropdown`,t),[u,d]=lx(o),f=J(()=>{let{placement:e=``,transitionName:n}=t;return n===void 0?e.includes(`top`)?`${s.value}-slide-down`:`${s.value}-slide-up`:n});yx({prefixCls:J(()=>`${o.value}-menu`),expandIcon:J(()=>U(`span`,{class:`${o.value}-menu-submenu-arrow`},[U(gx,{class:`${o.value}-menu-submenu-arrow-icon`},null)])),mode:J(()=>`vertical`),selectable:J(()=>!1),onClick:()=>{},validator:t=>{let{mode:n}=t;e(!n||n===`vertical`,`Dropdown`,`mode="${n}" is not supported for Dropdown's Menu.`)}});let p=()=>{var e;let n=t.overlay||r.overlay?.call(r),i=Array.isArray(n)?n[0]:n;if(!i)return null;let a=i.props||{};pi(!a.mode||a.mode===`vertical`,`Dropdown`,`mode="${a.mode}" is not supported for Dropdown's Menu.`);let{selectable:s=!1,expandIcon:c=((e=i.children)?.expandIcon)?.call(e)}=a,l=c!==void 0&&Nt(c)?c:U(`span`,{class:`${o.value}-menu-submenu-arrow`},[U(gx,{class:`${o.value}-menu-submenu-arrow-icon`},null)]);return Nt(i)?ao(i,{mode:`vertical`,selectable:s,expandIcon:()=>l}):i},m=J(()=>{let e=t.placement;if(!e)return c.value===`rtl`?`bottomRight`:`bottomLeft`;if(e.includes(`Center`)){let t=e.slice(0,e.indexOf(`Center`));return pi(!e.includes(`Center`),`Dropdown`,`You are using '${e}' placement in Dropdown, which is deprecated. Try to use '${t}' instead.`),t}return e}),h=J(()=>typeof t.visible==`boolean`?t.visible:t.open),g=e=>{a(`update:visible`,e),a(`visibleChange`,e),a(`update:open`,e),a(`openChange`,e)};return()=>{let{arrow:e,trigger:n,disabled:a,overlayClassName:s}=t,_=r.default?.call(r)[0],v=ao(_,Z({class:K(_?.props?.class,{[`${o.value}-rtl`]:c.value===`rtl`},`${o.value}-trigger`)},a?{disabled:a}:{})),y=K(s,d.value,{[`${o.value}-rtl`]:c.value===`rtl`}),b=a?[]:n,x;b&&b.includes(`contextmenu`)&&(x=!0);let S=uy({arrowPointAtCenter:typeof e==`object`&&e.pointAtCenter,autoAdjustOverflow:!0}),C=Br(Z(Z(Z({},t),i),{visible:h.value,builtinPlacements:S,overlayClassName:y,arrow:!!e,alignPoint:x,prefixCls:o.value,getPopupContainer:l?.value,transitionName:f.value,trigger:b,onVisibleChange:g,placement:m.value}),[`overlay`,`onUpdate:visible`]);return u(U(tb,C,{default:()=>[v],overlay:p}))}}});bx.Button=fx;var xx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let i=on(n,e,`overlay`);return i?U(bx,Y(Y({},e.dropdownProps),{},{overlay:i,placement:`bottom`}),{default:()=>[U(`span`,{class:`${r}-overlay-link`},[t,U(Cf,null,null)])]}):t},s=e=>{i(`click`,e)};return()=>{let t=on(n,e,`separator`)??`/`,i=on(n,e),{class:c,style:l}=r,u=xx(r,[`class`,`style`]),d;return d=e.href===void 0?U(`span`,Y({class:`${a.value}-link`,onClick:s},u),[i]):U(`a`,Y({class:`${a.value}-link`,onClick:s},u),[i]),d=o(d,a.value),i==null?null:U(`li`,{class:c,style:l},[d,t&&U(`span`,{class:`${a.value}-separator`},[t])])}}});function Cx(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o{fe(Tx,e)},Dx=()=>g(Tx),Ox=Symbol(`ForceRenderKey`),kx=e=>{fe(Ox,e)},Ax=()=>g(Ox,!1),jx=Symbol(`menuFirstLevelContextKey`),Mx=e=>{fe(jx,e)},Nx=()=>g(jx,!0),Px=u({compatConfig:{MODE:3},name:`MenuContextProvider`,inheritAttrs:!1,props:{mode:{type:String,default:void 0},overflowDisabled:{type:Boolean,default:void 0}},setup(e,t){let{slots:n}=t,r=Z({},Dx());return e.mode!==void 0&&(r.mode=St(e,`mode`)),e.overflowDisabled!==void 0&&(r.overflowDisabled=St(e,`overflowDisabled`)),Ex(r),()=>n.default?.call(n)}}),Fx=Symbol(`siderCollapsed`),Ix=Symbol(`siderHookProvider`),Lx=`$$__vc-menu-more__key`,Rx=Symbol(`KeyPathContext`),zx=()=>g(Rx,{parentEventKeys:J(()=>[]),parentKeys:J(()=>[]),parentInfo:{}}),Bx=(e,t,n)=>{let{parentEventKeys:r,parentKeys:i}=zx(),a=J(()=>[...r.value,e]),o=J(()=>[...i.value,t]);return fe(Rx,{parentEventKeys:a,parentKeys:o,parentInfo:n}),o},Vx=Symbol(`measure`),Hx=u({compatConfig:{MODE:3},setup(e,t){let{slots:n}=t;return fe(Vx,!0),()=>n.default?.call(n)}}),Ux=()=>g(Vx,!1);function Wx(e){let{mode:t,rtl:n,inlineIndent:r}=Dx();return J(()=>t.value===`inline`?n.value?{paddingRight:`${e.value*r.value}px`}:{paddingLeft:`${e.value*r.value}px`}:null)}var Gx=0,Kx=u({compatConfig:{MODE:3},name:`AMenuItem`,inheritAttrs:!1,props:{id:String,role:String,disabled:Boolean,danger:Boolean,title:{type:[String,Boolean],default:void 0},icon:f.any,onMouseenter:Function,onMouseleave:Function,onClick:Function,onKeydown:Function,onFocus:Function,originItemValue:Qt()},slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t,a=Zt(),o=Ux(),s=typeof a.vnode.key==`symbol`?String(a.vnode.key):a.vnode.key;pi(typeof a.vnode.key!=`symbol`,`MenuItem`,`MenuItem \`:key="${String(s)}"\` not support Symbol type`);let c=`menu_item_${++Gx}_$$_${s}`,{parentEventKeys:l,parentKeys:u}=zx(),{prefixCls:d,activeKeys:f,disabled:p,changeActiveKeys:m,rtl:h,inlineCollapsed:g,siderCollapsed:_,onItemClick:v,selectedKeys:y,registerMenuInfo:b,unRegisterMenuInfo:x}=Dx(),S=Nx(),C=q(!1),w=J(()=>[...u.value,s]);b(c,{eventKey:c,key:s,parentEventKeys:l,parentKeys:u,isLeaf:!0}),ut(()=>{x(c)}),G(f,()=>{C.value=!!f.value.find(e=>e===s)},{immediate:!0});let T=J(()=>p.value||e.disabled),E=J(()=>y.value.includes(s)),D=J(()=>{let t=`${d.value}-item`;return{[`${t}`]:!0,[`${t}-danger`]:e.danger,[`${t}-active`]:C.value,[`${t}-selected`]:E.value,[`${t}-disabled`]:T.value}}),O=t=>({key:s,eventKey:c,keyPath:w.value,eventKeyPath:[...l.value,c],domEvent:t,item:Z(Z({},e),i)}),k=e=>{if(T.value)return;let t=O(e);r(`click`,e),v(t)},A=e=>{T.value||(m(w.value),r(`mouseenter`,e))},j=e=>{T.value||(m([]),r(`mouseleave`,e))},M=e=>{if(r(`keydown`,e),e.which===$.ENTER){let t=O(e);r(`click`,e),v(t)}},N=e=>{m(w.value),r(`focus`,e)},P=(e,t)=>{let n=U(`span`,{class:`${d.value}-title-content`},[t]);return(!e||Nt(t)&&t.type===`span`)&&t&&g.value&&S&&typeof t==`string`?U(`div`,{class:`${d.value}-inline-collapsed-noicon`},[t.charAt(0)]):n},F=Wx(J(()=>w.value.length));return()=>{if(o)return null;let t=e.title??n.title?.call(n),r=ce(n.default?.call(n)),a=r.length,c=t;t===void 0?c=S&&a?r:``:t===!1&&(c=``);let l={title:c};!_.value&&!g.value&&(l.title=null,l.open=!1);let u={};e.role===`option`&&(u[`aria-selected`]=E.value);let f=e.icon??n.icon?.call(n,e);return U(Ty,Y(Y({},l),{},{placement:h.value?`left`:`right`,overlayClassName:`${d.value}-inline-collapsed-tooltip`}),{default:()=>[U(ed.Item,Y(Y(Y({component:`li`},i),{},{id:e.id,style:Z(Z({},i.style||{}),F.value),class:[D.value,{[`${i.class}`]:!!i.class,[`${d.value}-item-only-child`]:(f?a+1:a)===1}],role:e.role||`menuitem`,tabindex:e.disabled?null:-1,"data-menu-id":s,"aria-disabled":e.disabled},u),{},{onMouseenter:A,onMouseleave:j,onClick:k,onKeydown:M,onFocus:N,title:typeof t==`string`?t:void 0}),{default:()=>[ao(typeof f==`function`?f(e.originItemValue):f,{class:`${d.value}-item-icon`},!1),P(f,r)]})]})}}}),qx={adjustX:1,adjustY:1},Jx={topLeft:{points:[`bl`,`tl`],overflow:qx,offset:[0,-7]},bottomLeft:{points:[`tl`,`bl`],overflow:qx,offset:[0,7]},leftTop:{points:[`tr`,`tl`],overflow:qx,offset:[-4,0]},rightTop:{points:[`tl`,`tr`],overflow:qx,offset:[4,0]}},Yx={topLeft:{points:[`bl`,`tl`],overflow:qx,offset:[0,-7]},bottomLeft:{points:[`tl`,`bl`],overflow:qx,offset:[0,7]},rightTop:{points:[`tr`,`tl`],overflow:qx,offset:[-4,0]},leftTop:{points:[`tl`,`tr`],overflow:qx,offset:[4,0]}},Xx={horizontal:`bottomLeft`,vertical:`rightTop`,"vertical-left":`rightTop`,"vertical-right":`leftTop`},Zx=u({compatConfig:{MODE:3},name:`PopupTrigger`,inheritAttrs:!1,props:{prefixCls:String,mode:String,visible:Boolean,popupClassName:String,popupOffset:Array,disabled:Boolean,onVisibleChange:Function},slots:Object,emits:[`visibleChange`],setup(e,t){let{slots:n,emit:r}=t,i=q(!1),{getPopupContainer:a,rtl:o,subMenuOpenDelay:s,subMenuCloseDelay:c,builtinPlacements:l,triggerSubMenuAction:u,forceSubMenuRender:d,motion:f,defaultMotions:p,rootClassName:m}=Dx(),h=Ax(),g=J(()=>o.value?Z(Z({},Yx),l.value):Z(Z({},Jx),l.value)),_=J(()=>Xx[e.mode]),v=q();G(()=>e.visible,e=>{ir.cancel(v.value),v.value=ir(()=>{i.value=e})},{immediate:!0}),ut(()=>{ir.cancel(v.value)});let y=e=>{r(`visibleChange`,e)},b=J(()=>{let t=f.value||p.value?.[e.mode]||p.value?.other,n=typeof t==`function`?t():t;return n?ge(n.name,{css:!0}):void 0});return()=>{let{prefixCls:t,popupClassName:r,mode:l,popupOffset:f,disabled:p}=e;return U(Su,{prefixCls:t,popupClassName:K(`${t}-popup`,{[`${t}-rtl`]:o.value},r,m.value),stretch:l===`horizontal`?`minWidth`:null,getPopupContainer:a.value,builtinPlacements:g.value,popupPlacement:_.value,popupVisible:i.value,popupAlign:f&&{offset:f},action:p?[]:[u.value],mouseEnterDelay:s.value,mouseLeaveDelay:c.value,onPopupVisibleChange:y,forceRender:h||d.value,popupAnimation:b.value},{popup:n.popup,default:n.default})}}}),Qx=(e,t)=>{let{slots:n,attrs:r}=t,{prefixCls:i,mode:a}=Dx();return U(`ul`,Y(Y({},r),{},{class:K(i.value,`${i.value}-sub`,`${i.value}-${a.value===`inline`?`inline`:`vertical`}`),"data-menu-list":!0}),[n.default?.call(n)])};Qx.displayName=`SubMenuList`;var $x=u({compatConfig:{MODE:3},name:`InlineSubMenuList`,inheritAttrs:!1,props:{id:String,open:Boolean,keyPath:Array},setup(e,t){let{slots:n}=t,r=J(()=>`inline`),{motion:i,mode:a,defaultMotions:o}=Dx(),s=J(()=>a.value===r.value),c=H(!s.value),l=J(()=>s.value?e.open:!1);G(a,()=>{s.value&&(c.value=!1)},{flush:`post`});let u=J(()=>{let t=i.value||o.value?.[r.value]||o.value?.other;return Z(Z({},typeof t==`function`?t():t),{appear:e.keyPath.length<=1})});return()=>c.value?null:U(Px,{mode:r.value},{default:()=>[U(Re,u.value,{default:()=>[Mt(U(Qx,{id:e.id},{default:()=>[n.default?.call(n)]}),[[ht,l.value]])]})]})}}),eS=0,tS=u({compatConfig:{MODE:3},name:`ASubMenu`,inheritAttrs:!1,props:{icon:f.any,title:f.any,disabled:Boolean,level:Number,popupClassName:String,popupOffset:Array,internalPopupClose:Boolean,eventKey:String,expandIcon:Function,theme:String,onMouseenter:Function,onMouseleave:Function,onTitleClick:Function,originItemValue:Qt()},slots:Object,setup(e,t){let{slots:n,attrs:r,emit:i}=t;var a;Mx(!1);let o=Ux(),s=Zt(),c=typeof s.vnode.key==`symbol`?String(s.vnode.key):s.vnode.key;pi(typeof s.vnode.key!=`symbol`,`SubMenu`,`SubMenu \`:key="${String(c)}"\` not support Symbol type`);let l=Oe(c)?c:`sub_menu_${++eS}_$$_not_set_key`,u=e.eventKey??(Oe(c)?`sub_menu_${++eS}_$$_${c}`:l),{parentEventKeys:d,parentInfo:f,parentKeys:p}=zx(),m=J(()=>[...p.value,l]),h={eventKey:u,key:l,parentEventKeys:d,childrenEventKeys:q([]),parentKeys:p};(a=f.childrenEventKeys)==null||a.value.push(u),ut(()=>{f.childrenEventKeys&&(f.childrenEventKeys.value=f.childrenEventKeys?.value.filter(e=>e!=u))}),Bx(u,l,h);let{prefixCls:g,activeKeys:_,disabled:v,changeActiveKeys:y,mode:b,inlineCollapsed:x,openKeys:S,overflowDisabled:C,onOpenChange:w,registerMenuInfo:T,unRegisterMenuInfo:E,selectedSubMenuKeys:D,expandIcon:O,theme:k}=Dx(),A=c!=null,j=!o&&(Ax()||!A);kx(j),(o&&A||!o&&!A||j)&&(T(u,h),ut(()=>{E(u)}));let M=J(()=>`${g.value}-submenu`),N=J(()=>v.value||e.disabled),P=q(),F=q(),I=J(()=>S.value.includes(l)),L=J(()=>!C.value&&I.value),ee=J(()=>D.value.includes(l)),te=q(!1);G(_,()=>{te.value=!!_.value.find(e=>e===l)},{immediate:!0});let ne=e=>{N.value||(i(`titleClick`,e,l),b.value===`inline`&&w(l,!I.value))},R=e=>{N.value||(y(m.value),i(`mouseenter`,e))},re=e=>{N.value||(y([]),i(`mouseleave`,e))},ie=Wx(J(()=>m.value.length)),ae=e=>{b.value!==`inline`&&w(l,e)},oe=()=>{y(m.value)},z=u&&`${u}-popup`,se=J(()=>K(g.value,`${g.value}-${e.theme||k.value}`,e.popupClassName)),B=(t,n)=>{if(!n)return x.value&&!p.value.length&&t&&typeof t==`string`?U(`div`,{class:`${g.value}-inline-collapsed-noicon`},[t.charAt(0)]):U(`span`,{class:`${g.value}-title-content`},[t]);let r=Nt(t)&&t.type===`span`;return U($e,null,[ao(typeof n==`function`?n(e.originItemValue):n,{class:`${g.value}-item-icon`},!1),r?t:U(`span`,{class:`${g.value}-title-content`},[t])])},V=J(()=>b.value!==`inline`&&m.value.length>1?`vertical`:b.value),ce=J(()=>b.value===`horizontal`?`vertical`:b.value),le=J(()=>V.value===`horizontal`?`vertical`:V.value),H=()=>{let t=M.value,r=e.icon??n.icon?.call(n,e),i=e.expandIcon||n.expandIcon||O.value,a=B(on(n,e,`title`),r);return U(`div`,{style:ie.value,class:`${t}-title`,tabindex:N.value?null:-1,ref:P,title:typeof a==`string`?a:null,"data-menu-id":l,"aria-expanded":L.value,"aria-haspopup":!0,"aria-controls":z,"aria-disabled":N.value,onClick:ne,onFocus:oe},[a,b.value!==`horizontal`&&i?i(Z(Z({},e),{isOpen:L.value})):U(`i`,{class:`${t}-arrow`},null)])};return()=>{if(o)return A?n.default?.call(n):null;let t=M.value,i=()=>null;if(!C.value&&b.value!==`inline`){let r=b.value===`horizontal`?[0,8]:[10,0];i=()=>U(Zx,{mode:V.value,prefixCls:t,visible:!e.internalPopupClose&&L.value,popupClassName:se.value,popupOffset:e.popupOffset||r,disabled:N.value,onVisibleChange:ae},{default:()=>[H()],popup:()=>U(Px,{mode:le.value},{default:()=>[U(Qx,{id:z,ref:F},{default:n.default})]})})}else i=()=>U(Zx,null,{default:H});return U(Px,{mode:ce.value},{default:()=>[U(ed.Item,Y(Y({component:`li`},r),{},{role:`none`,class:K(t,`${t}-${b.value}`,r.class,{[`${t}-open`]:L.value,[`${t}-active`]:te.value,[`${t}-selected`]:ee.value,[`${t}-disabled`]:N.value}),onMouseenter:R,onMouseleave:re,"data-submenu-id":l}),{default:()=>U($e,null,[i(),!C.value&&U($x,{id:z,open:L.value,keyPath:m.value},{default:n.default})])})]})}}});function nS(e,t){return e.classList?e.classList.contains(t):` ${e.className} `.indexOf(` ${t} `)>-1}function rS(e,t){e.classList?e.classList.add(t):nS(e,t)||(e.className=`${e.className} ${t}`)}function iS(e,t){e.classList?e.classList.remove(t):nS(e,t)&&(e.className=` ${e.className} `.replace(` ${t} `,` `))}var aS=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`ant-motion-collapse`;return{name:e,appear:arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,css:!0,onBeforeEnter:t=>{t.style.height=`0px`,t.style.opacity=`0`,rS(t,e)},onEnter:e=>{z(()=>{e.style.height=`${e.scrollHeight}px`,e.style.opacity=`1`})},onAfterEnter:t=>{t&&(iS(t,e),t.style.height=null,t.style.opacity=null)},onBeforeLeave:t=>{rS(t,e),t.style.height=`${t.offsetHeight}px`,t.style.opacity=null},onLeave:e=>{setTimeout(()=>{e.style.height=`0px`,e.style.opacity=`0`})},onAfterLeave:t=>{t&&(iS(t,e),t.style&&(t.style.height=null,t.style.opacity=null))}}},oS=u({compatConfig:{MODE:3},name:`AMenuItemGroup`,inheritAttrs:!1,props:{title:f.any,originItemValue:Qt()},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i}=Dx(),a=J(()=>`${i.value}-item-group`),o=Ux();return()=>o?n.default?.call(n):U(`li`,Y(Y({},r),{},{onClick:e=>e.stopPropagation(),class:a.value}),[U(`div`,{title:typeof e.title==`string`?e.title:void 0,class:`${a.value}-title`},[on(n,e,`title`)]),U(`ul`,{class:`${a.value}-list`},[n.default?.call(n)])])}}),sS=u({compatConfig:{MODE:3},name:`AMenuDivider`,props:{prefixCls:String,dashed:Boolean},setup(e){let{prefixCls:t}=Dx(),n=J(()=>({[`${t.value}-item-divider`]:!0,[`${t.value}-item-divider-dashed`]:!!e.dashed}));return()=>U(`li`,{class:n.value},null)}}),cS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{if(e&&typeof e==`object`){let i=e,{label:a,children:o,key:s,type:c}=i,l=cS(i,[`label`,`children`,`key`,`type`]),u=s??`tmp-${r}`,d=n?n.parentKeys.slice():[],f=[],p={eventKey:u,key:u,parentEventKeys:H(d),parentKeys:H(d),childrenEventKeys:H(f),isLeaf:!1};if(o||c===`group`){if(c===`group`){let r=lS(o,t,n);return U(oS,Y(Y({key:u},l),{},{title:a,originItemValue:e}),{default:()=>[r]})}t.set(u,p),n&&n.childrenEventKeys.push(u);let r=lS(o,t,{childrenEventKeys:f,parentKeys:[].concat(d,u)});return U(tS,Y(Y({key:u},l),{},{title:a,originItemValue:e}),{default:()=>[r]})}return c===`divider`?U(sS,Y({key:u},l),null):(p.isLeaf=!0,t.set(u,p),U(Kx,Y(Y({key:u},l),{},{originItemValue:e}),{default:()=>[a]}))}return null}).filter(e=>e)}function uS(e){let t=q([]),n=q(!1),r=q(new Map);return G(()=>e.items,()=>{let i=new Map;n.value=!1,e.items?(n.value=!0,t.value=lS(e.items,i)):t.value=void 0,r.value=i},{immediate:!0,deep:!0}),{itemsNodes:t,store:r,hasItmes:n}}var dS=e=>{let{componentCls:t,motionDurationSlow:n,menuHorizontalHeight:r,colorSplit:i,lineWidth:a,lineType:o,menuItemPaddingInline:s}=e;return{[`${t}-horizontal`]:{lineHeight:`${r}px`,border:0,borderBottom:`${a}px ${o} ${i}`,boxShadow:`none`,"&::after":{display:`block`,clear:`both`,height:0,content:`"\\20"`},[`${t}-item, ${t}-submenu`]:{position:`relative`,display:`inline-block`,verticalAlign:`bottom`,paddingInline:s},[`> ${t}-item:hover, + > ${t}-item-active, + > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:`transparent`},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${n}`,`background ${n}`].join(`,`)},[`${t}-submenu-arrow`]:{display:`none`}}}},fS=e=>{let{componentCls:t,menuArrowOffset:n}=e;return{[`${t}-rtl`]:{direction:`rtl`},[`${t}-submenu-rtl`]:{transformOrigin:`100% 0`},[`${t}-rtl${t}-vertical, + ${t}-submenu-rtl ${t}-vertical`]:{[`${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${n})`},"&::after":{transform:`rotate(45deg) translateY(${n})`}}}}},pS=e=>Z({},I(e)),mS=(e,t)=>{let{componentCls:n,colorItemText:r,colorItemTextSelected:i,colorGroupTitle:a,colorItemBg:o,colorSubItemBg:s,colorItemBgSelected:c,colorActiveBarHeight:l,colorActiveBarWidth:u,colorActiveBarBorderSize:d,motionDurationSlow:f,motionEaseInOut:p,motionEaseOut:m,menuItemPaddingInline:h,motionDurationMid:g,colorItemTextHover:_,lineType:v,colorSplit:y,colorItemTextDisabled:b,colorDangerItemText:x,colorDangerItemTextHover:S,colorDangerItemTextSelected:C,colorDangerItemBgActive:w,colorDangerItemBgSelected:T,colorItemBgHover:E,menuSubMenuBg:D,colorItemTextSelectedHorizontal:O,colorItemBgSelectedHorizontal:k}=e;return{[`${n}-${t}`]:{color:r,background:o,[`&${n}-root:focus-visible`]:Z({},pS(e)),[`${n}-item-group-title`]:{color:a},[`${n}-submenu-selected`]:{[`> ${n}-submenu-title`]:{color:i}},[`${n}-item-disabled, ${n}-submenu-disabled`]:{color:`${b} !important`},[`${n}-item:hover, ${n}-submenu-title:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:_}},[`&:not(${n}-horizontal)`]:{[`${n}-item:not(${n}-item-selected)`]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:c}},[`${n}-submenu-title`]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:c}}},[`${n}-item-danger`]:{color:x,[`&${n}-item:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:S}},[`&${n}-item:active`]:{background:w}},[`${n}-item a`]:{"&, &:hover":{color:`inherit`}},[`${n}-item-selected`]:{color:i,[`&${n}-item-danger`]:{color:C},"a, a:hover":{color:`inherit`}},[`& ${n}-item-selected`]:{backgroundColor:c,[`&${n}-item-danger`]:{backgroundColor:T}},[`${n}-item, ${n}-submenu-title`]:{[`&:not(${n}-item-disabled):focus-visible`]:Z({},pS(e))},[`&${n}-submenu > ${n}`]:{backgroundColor:D},[`&${n}-popup > ${n}`]:{backgroundColor:o},[`&${n}-horizontal`]:Z(Z({},t===`dark`?{borderBottom:0}:{}),{[`> ${n}-item, > ${n}-submenu`]:{top:d,marginTop:-d,marginBottom:0,borderRadius:0,"&::after":{position:`absolute`,insetInline:h,bottom:0,borderBottom:`${l}px solid transparent`,transition:`border-color ${f} ${p}`,content:`""`},"&:hover, &-active, &-open":{"&::after":{borderBottomWidth:l,borderBottomColor:O}},"&-selected":{color:O,backgroundColor:k,"&::after":{borderBottomWidth:l,borderBottomColor:O}}}}),[`&${n}-root`]:{[`&${n}-inline, &${n}-vertical`]:{borderInlineEnd:`${d}px ${v} ${y}`}},[`&${n}-inline`]:{[`${n}-sub${n}-inline`]:{background:s},[`${n}-item, ${n}-submenu-title`]:d&&u?{width:`calc(100% + ${d}px)`}:{},[`${n}-item`]:{position:`relative`,"&::after":{position:`absolute`,insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${u}px solid ${i}`,transform:`scaleY(0.0001)`,opacity:0,transition:[`transform ${g} ${m}`,`opacity ${g} ${m}`].join(`,`),content:`""`},[`&${n}-item-danger`]:{"&::after":{borderInlineEndColor:C}}},[`${n}-selected, ${n}-item-selected`]:{"&::after":{transform:`scaleY(1)`,opacity:1,transition:[`transform ${g} ${p}`,`opacity ${g} ${p}`].join(`,`)}}}}}},hS=e=>{let{componentCls:t,menuItemHeight:n,itemMarginInline:r,padding:i,menuArrowSize:a,marginXS:o,marginXXS:s}=e,c=i+a+o;return{[`${t}-item`]:{position:`relative`},[`${t}-item, ${t}-submenu-title`]:{height:n,lineHeight:`${n}px`,paddingInline:i,overflow:`hidden`,textOverflow:`ellipsis`,marginInline:r,marginBlock:s,width:`calc(100% - ${r*2}px)`},[`${t}-submenu`]:{paddingBottom:.02},[`> ${t}-item, + > ${t}-submenu > ${t}-submenu-title`]:{height:n,lineHeight:`${n}px`},[`${t}-item-group-list ${t}-submenu-title, + ${t}-submenu-title`]:{paddingInlineEnd:c}}},gS=e=>{let{componentCls:t,iconCls:n,menuItemHeight:r,colorTextLightSolid:i,dropdownWidth:a,controlHeightLG:o,motionDurationMid:s,motionEaseOut:c,paddingXL:l,fontSizeSM:u,fontSizeLG:d,motionDurationSlow:f,paddingXS:p,boxShadowSecondary:m}=e,h={height:r,lineHeight:`${r}px`,listStylePosition:`inside`,listStyleType:`disc`};return[{[t]:{"&-inline, &-vertical":Z({[`&${t}-root`]:{boxShadow:`none`}},hS(e))},[`${t}-submenu-popup`]:{[`${t}-vertical`]:Z(Z({},hS(e)),{boxShadow:m})}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:a,maxHeight:`calc(100vh - ${o*2.5}px)`,padding:`0`,overflow:`hidden`,borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:`hidden`,overflowY:`auto`}}},{[`${t}-inline`]:{width:`100%`,[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:`flex`,alignItems:`center`,transition:[`border-color ${f}`,`background ${f}`,`padding ${s} ${c}`].join(`,`),[`> ${t}-title-content`]:{flex:`auto`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`},"> *":{flex:`none`}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:`none`,[`& > ${t}-submenu > ${t}-submenu-title`]:h,[`& ${t}-item-group-title`]:{paddingInlineStart:l}},[`${t}-item`]:h}},{[`${t}-inline-collapsed`]:{width:r*2,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:d,textAlign:`center`}}},[`> ${t}-item, + > ${t}-item-group > ${t}-item-group-list > ${t}-item, + > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title, + > ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${u}px)`,textOverflow:`clip`,[` + ${t}-submenu-arrow, + ${t}-submenu-expand-icon + `]:{opacity:0},[`${t}-item-icon, ${n}`]:{margin:0,fontSize:d,lineHeight:`${r}px`,"+ span":{display:`inline-block`,opacity:0}}},[`${t}-item-icon, ${n}`]:{display:`inline-block`},"&-tooltip":{pointerEvents:`none`,[`${t}-item-icon, ${n}`]:{display:`none`},"a, a:hover":{color:i}},[`${t}-item-group-title`]:Z(Z({},xe),{paddingInline:p})}}]},_S=e=>{let{componentCls:t,fontSize:n,motionDurationSlow:r,motionDurationMid:i,motionEaseInOut:a,motionEaseOut:s,iconCls:c,controlHeightSM:l}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:`relative`,display:`block`,margin:0,whiteSpace:`nowrap`,cursor:`pointer`,transition:[`border-color ${r}`,`background ${r}`,`padding ${r} ${a}`].join(`,`),[`${t}-item-icon, ${c}`]:{minWidth:n,fontSize:n,transition:[`font-size ${i} ${s}`,`margin ${r} ${a}`,`color ${r}`].join(`,`),"+ span":{marginInlineStart:l-n,opacity:1,transition:[`opacity ${r} ${a}`,`margin ${r}`,`color ${r}`].join(`,`)}},[`${t}-item-icon`]:Z({},o()),[`&${t}-item-only-child`]:{[`> ${c}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:`none !important`,cursor:`not-allowed`,"&::after":{borderColor:`transparent !important`},a:{color:`inherit !important`},[`> ${t}-submenu-title`]:{color:`inherit !important`,cursor:`not-allowed`}}}},vS=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:r,borderRadius:i,menuArrowSize:a,menuArrowOffset:o}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:`absolute`,top:`50%`,insetInlineEnd:e.margin,width:a,color:`currentcolor`,transform:`translateY(-50%)`,transition:`transform ${n} ${r}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:`absolute`,width:a*.6,height:a*.15,backgroundColor:`currentcolor`,borderRadius:i,transition:[`background ${n} ${r}`,`transform ${n} ${r}`,`top ${n} ${r}`,`color ${n} ${r}`].join(`,`),content:`""`},"&::before":{transform:`rotate(45deg) translateY(-${o})`},"&::after":{transform:`rotate(-45deg) translateY(${o})`}}}}},yS=e=>{let{antCls:t,componentCls:n,fontSize:r,motionDurationSlow:i,motionDurationMid:a,motionEaseInOut:o,lineHeight:s,paddingXS:c,padding:l,colorSplit:u,lineWidth:d,zIndexPopup:f,borderRadiusLG:p,radiusSubMenuItem:m,menuArrowSize:h,menuArrowOffset:g,lineType:_,menuPanelMaskInset:v}=e;return[{"":{[`${n}`]:Z(Z({},D()),{"&-hidden":{display:`none`}})},[`${n}-submenu-hidden`]:{display:`none`}},{[n]:Z(Z(Z(Z(Z(Z(Z({},rn(e)),D()),{marginBottom:0,paddingInlineStart:0,fontSize:r,lineHeight:0,listStyle:`none`,outline:`none`,transition:`width ${i} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:`none`},"&-overflow":{display:`flex`,[`${n}-item`]:{flex:`none`}},[`${n}-item, ${n}-submenu, ${n}-submenu-title`]:{borderRadius:e.radiusItem},[`${n}-item-group-title`]:{padding:`${c}px ${l}px`,fontSize:r,lineHeight:s,transition:`all ${i}`},[`&-horizontal ${n}-submenu`]:{transition:[`border-color ${i} ${o}`,`background ${i} ${o}`].join(`,`)},[`${n}-submenu, ${n}-submenu-inline`]:{transition:[`border-color ${i} ${o}`,`background ${i} ${o}`,`padding ${a} ${o}`].join(`,`)},[`${n}-submenu ${n}-sub`]:{cursor:`initial`,transition:[`background ${i} ${o}`,`padding ${i} ${o}`].join(`,`)},[`${n}-title-content`]:{transition:`color ${i}`},[`${n}-item a`]:{"&::before":{position:`absolute`,inset:0,backgroundColor:`transparent`,content:`""`}},[`${n}-item-divider`]:{overflow:`hidden`,lineHeight:0,borderColor:u,borderStyle:_,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:`dashed`}}}),_S(e)),{[`${n}-item-group`]:{[`${n}-item-group-list`]:{margin:0,padding:0,[`${n}-item, ${n}-submenu-title`]:{paddingInline:`${r*2}px ${l}px`}}},"&-submenu":{"&-popup":{position:`absolute`,zIndex:f,background:`transparent`,borderRadius:p,boxShadow:`none`,transformOrigin:`0 0`,"&::before":{position:`absolute`,inset:`${v}px 0 0`,zIndex:-1,width:`100%`,height:`100%`,opacity:0,content:`""`}},"&-placement-rightTop::before":{top:0,insetInlineStart:v},[`> ${n}`]:Z(Z(Z({borderRadius:p},_S(e)),vS(e)),{[`${n}-item, ${n}-submenu > ${n}-submenu-title`]:{borderRadius:m},[`${n}-submenu-title::after`]:{transition:`transform ${i} ${o}`}})}}),vS(e)),{[`&-inline-collapsed ${n}-submenu-arrow, + &-inline ${n}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${g})`},"&::after":{transform:`rotate(45deg) translateX(-${g})`}},[`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]:{transform:`translateY(-${h*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${g})`},"&::before":{transform:`rotate(45deg) translateX(${g})`}}})},{[`${t}-layout-header`]:{[n]:{lineHeight:`inherit`}}}]},bS=((e,t)=>v(`Menu`,(e,n)=>{let{overrideComponentToken:r}=n;if(t?.value===!1)return[];let{colorBgElevated:i,colorPrimary:a,colorError:o,colorErrorHover:s,colorTextLightSolid:c}=e,{controlHeightLG:l,fontSize:u}=e,d=u/7*5,f=B(e,{menuItemHeight:l,menuItemPaddingInline:e.margin,menuArrowSize:d,menuHorizontalHeight:l*1.15,menuArrowOffset:`${d*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:i}),p=new we(c).setAlpha(.65).toRgbString(),m=B(f,{colorItemText:p,colorItemTextHover:c,colorGroupTitle:p,colorItemTextSelected:c,colorItemBg:`#001529`,colorSubItemBg:`#000c17`,colorItemBgActive:`transparent`,colorItemBgSelected:a,colorActiveBarWidth:0,colorActiveBarHeight:0,colorActiveBarBorderSize:0,colorItemTextDisabled:new we(c).setAlpha(.25).toRgbString(),colorDangerItemText:o,colorDangerItemTextHover:s,colorDangerItemTextSelected:c,colorDangerItemBgActive:o,colorDangerItemBgSelected:o,menuSubMenuBg:`#001529`,colorItemTextSelectedHorizontal:c,colorItemBgSelectedHorizontal:a},Z({},r));return[yS(f),dS(f),gS(f),mS(f,`light`),mS(m,`dark`),fS(f),$_(f),R_(f,`slide-up`),R_(f,`slide-down`),Q_(f,`zoom-big`)]},e=>{let{colorPrimary:t,colorError:n,colorTextDisabled:r,colorErrorBg:i,colorText:a,colorTextDescription:o,colorBgContainer:s,colorFillAlter:c,colorFillContent:l,lineWidth:u,lineWidthBold:d,controlItemBgActive:f,colorBgTextHover:p}=e;return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,colorItemText:a,colorItemTextHover:a,colorItemTextHoverHorizontal:t,colorGroupTitle:o,colorItemTextSelected:t,colorItemTextSelectedHorizontal:t,colorItemBg:s,colorItemBgHover:p,colorItemBgActive:l,colorSubItemBg:c,colorItemBgSelected:f,colorItemBgSelectedHorizontal:`transparent`,colorActiveBarWidth:0,colorActiveBarHeight:d,colorActiveBarBorderSize:u,colorItemTextDisabled:r,colorDangerItemText:n,colorDangerItemTextHover:n,colorDangerItemTextSelected:n,colorDangerItemBgActive:i,colorDangerItemBgSelected:i,itemMarginInline:e.marginXXS}})(e)),xS=()=>({id:String,prefixCls:String,items:Array,disabled:Boolean,inlineCollapsed:Boolean,disabledOverflow:Boolean,forceSubMenuRender:Boolean,openKeys:Array,selectedKeys:Array,activeKey:String,selectable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},tabindex:{type:[Number,String]},motion:Object,role:String,theme:{type:String,default:`light`},mode:{type:String,default:`vertical`},inlineIndent:{type:Number,default:24},subMenuOpenDelay:{type:Number,default:0},subMenuCloseDelay:{type:Number,default:.1},builtinPlacements:{type:Object},triggerSubMenuAction:{type:String,default:`hover`},getPopupContainer:Function,expandIcon:Function,onOpenChange:Function,onSelect:Function,onDeselect:Function,onClick:[Function,Array],onFocus:Function,onBlur:Function,onMousedown:Function,"onUpdate:openKeys":Function,"onUpdate:selectedKeys":Function,"onUpdate:activeKey":Function}),SS=[],CS=u({compatConfig:{MODE:3},name:`AMenu`,inheritAttrs:!1,props:xS(),slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t,{direction:a,getPrefixCls:o}=X(`menu`,e),s=vx(),c=J(()=>o(`menu`,e.prefixCls||s?.prefixCls?.value)),[l,u]=bS(c,J(()=>!s)),d=q(new Map),f=g(Fx,H(void 0)),p=J(()=>f.value===void 0?e.inlineCollapsed:f.value),{itemsNodes:m}=uS(e),h=q(!1);V(()=>{h.value=!0}),S(()=>{pi(!(e.inlineCollapsed===!0&&e.mode!==`inline`),`Menu`,"`inlineCollapsed` should only be used when `mode` is inline."),pi(!(f.value!==void 0&&e.inlineCollapsed===!0),`Menu`,"`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.")});let _=H([]),v=H([]),y=H({});G(d,()=>{let e={};for(let t of d.value.values())e[t.key]=t;y.value=e},{flush:`post`}),S(()=>{if(e.activeKey!==void 0){let t=[],n=e.activeKey?y.value[e.activeKey]:void 0;t=n&&e.activeKey!==void 0?s_([].concat(ze(n.parentKeys),e.activeKey)):[],wx(_.value,t)||(_.value=t)}}),G(()=>e.selectedKeys,e=>{e&&(v.value=e.slice())},{immediate:!0,deep:!0});let b=H([]);G([y,v],()=>{let e=[];v.value.forEach(t=>{let n=y.value[t];n&&(e=e.concat(ze(n.parentKeys)))}),e=s_(e),wx(b.value,e)||(b.value=e)},{immediate:!0});let x=t=>{if(e.selectable){let{key:n}=t,i=v.value.includes(n),a;a=e.multiple?i?v.value.filter(e=>e!==n):[...v.value,n]:[n];let o=Z(Z({},t),{selectedKeys:a});wx(a,v.value)||(e.selectedKeys===void 0&&(v.value=a),r(`update:selectedKeys`,a),i&&e.multiple?r(`deselect`,o):r(`select`,o))}O.value!==`inline`&&!e.multiple&&C.value.length&&j(SS)},C=H([]);G(()=>e.openKeys,function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C.value;wx(C.value,e)||(C.value=e.slice())},{immediate:!0,deep:!0});let w,T=t=>{clearTimeout(w),w=setTimeout(()=>{e.activeKey===void 0&&(_.value=t),r(`update:activeKey`,t[t.length-1])})},E=J(()=>!!e.disabled),D=J(()=>a.value===`rtl`),O=H(`vertical`),k=q(!1);S(()=>{(e.mode===`inline`||e.mode===`vertical`)&&p.value?(O.value=`vertical`,k.value=p.value):(O.value=e.mode,k.value=!1),s?.mode?.value&&(O.value=s.mode.value)});let A=J(()=>O.value===`inline`),j=e=>{C.value=e,r(`update:openKeys`,e),r(`openChange`,e)},M=H(C.value),N=q(!1);G(C,()=>{A.value&&(M.value=C.value)},{immediate:!0}),G(A,()=>{if(!N.value){N.value=!0;return}A.value?C.value=M.value:j(SS)},{immediate:!0});let P=J(()=>({[`${c.value}`]:!0,[`${c.value}-root`]:!0,[`${c.value}-${O.value}`]:!0,[`${c.value}-inline-collapsed`]:k.value,[`${c.value}-rtl`]:D.value,[`${c.value}-${e.theme}`]:!0})),F=J(()=>o()),I=J(()=>({horizontal:{name:`${F.value}-slide-up`},inline:aS(`${F.value}-motion-collapse`),other:{name:`${F.value}-zoom-big`}}));Mx(!0);let L=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[],n=d.value;return e.forEach(e=>{let{key:r,childrenEventKeys:i}=n.get(e);t.push(r,...L(ze(i)))}),t},ee=e=>{var t;r(`click`,e),x(e),(t=s?.onClick)==null||t.call(s)},te=(e,t)=>{let n=y.value[e]?.childrenEventKeys||[],r=C.value.filter(t=>t!==e);if(t)r.push(e);else if(O.value!==`inline`){let e=L(ze(n));r=s_(r.filter(t=>!e.includes(t)))}wx(C,r)||j(r)},ne=(e,t)=>{d.value.set(e,t),d.value=new Map(d.value)},R=e=>{d.value.delete(e),d.value=new Map(d.value)},re=H(0),ie=J(()=>e.expandIcon||n.expandIcon||s?.expandIcon?.value?t=>{let r=e.expandIcon||n.expandIcon;return r=typeof r==`function`?r(t):r,ao(r,{class:`${c.value}-submenu-expand-icon`},!1)}:null);Ex({prefixCls:c,activeKeys:_,openKeys:C,selectedKeys:v,changeActiveKeys:T,disabled:E,rtl:D,mode:O,inlineIndent:J(()=>e.inlineIndent),subMenuCloseDelay:J(()=>e.subMenuCloseDelay),subMenuOpenDelay:J(()=>e.subMenuOpenDelay),builtinPlacements:J(()=>e.builtinPlacements),triggerSubMenuAction:J(()=>e.triggerSubMenuAction),getPopupContainer:J(()=>e.getPopupContainer),inlineCollapsed:k,theme:J(()=>e.theme),siderCollapsed:f,defaultMotions:J(()=>h.value?I.value:null),motion:J(()=>h.value?e.motion:null),overflowDisabled:q(void 0),onOpenChange:te,onItemClick:ee,registerMenuInfo:ne,unRegisterMenuInfo:R,selectedSubMenuKeys:b,expandIcon:ie,forceSubMenuRender:J(()=>e.forceSubMenuRender),rootClassName:u});let ae=()=>m.value||ce(n.default?.call(n));return()=>{let t=ae(),r=re.value>=t.length-1||O.value!==`horizontal`||e.disabledOverflow,a=t=>O.value!==`horizontal`||e.disabledOverflow?t:t.map((e,t)=>U(Px,{key:e.key,overflowDisabled:t>re.value},{default:()=>e})),o=n.overflowedIndicator?.call(n)||U(ax,null,null);return l(U(ed,Y(Y({},i),{},{onMousedown:e.onMousedown,prefixCls:`${c.value}-overflow`,component:`ul`,itemComponent:Kx,class:[P.value,i.class,u.value],role:`menu`,id:e.id,data:a(t),renderRawItem:e=>e,renderRawRest:e=>{let n=e.length,i=n?t.slice(-n):null;return U($e,null,[U(tS,{eventKey:Lx,key:Lx,title:o,disabled:r,internalPopupClose:n===0},{default:()=>i}),U(Hx,null,{default:()=>[U(tS,{eventKey:Lx,key:Lx,title:o,disabled:r,internalPopupClose:n===0},{default:()=>i})]})])},maxCount:O.value!==`horizontal`||e.disabledOverflow?ed.INVALIDATE:ed.RESPONSIVE,ssr:`full`,"data-menu-list":!0,onVisibleChange:e=>{re.value=e}}),{default:()=>[U(kt,{to:`body`},{default:()=>[U(`div`,{style:{display:`none`},"aria-hidden":!0},[U(Hx,null,{default:()=>[a(ae())]})])]})]}))}}});CS.install=function(e){return e.component(CS.name,CS),e.component(Kx.name,Kx),e.component(tS.name,tS),e.component(sS.name,sS),e.component(oS.name,oS),e},CS.Item=Kx,CS.Divider=sS,CS.SubMenu=tS,CS.ItemGroup=oS;var wS=CS,TS=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:Z(Z({},rn(e)),{color:e.breadcrumbBaseColor,fontSize:e.breadcrumbFontSize,[n]:{fontSize:e.breadcrumbIconFontSize},ol:{display:`flex`,flexWrap:`wrap`,margin:0,padding:0,listStyle:`none`},a:Z({color:e.breadcrumbLinkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:`inline-block`,marginInline:-e.marginXXS,"&:hover":{color:e.breadcrumbLinkColorHover,backgroundColor:e.colorBgTextHover}},de(e)),"li:last-child":{color:e.breadcrumbLastItemColor,[`& > ${t}-separator`]:{display:`none`}},[`${t}-separator`]:{marginInline:e.breadcrumbSeparatorMargin,color:e.breadcrumbSeparatorColor},[`${t}-link`]:{[` + > ${n} + span, + > ${n} + a + `]:{marginInlineStart:e.marginXXS}},[`${t}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:`inline-block`,padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${n}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.breadcrumbLinkColorHover,backgroundColor:e.colorBgTextHover,a:{color:e.breadcrumbLinkColorHover}},a:{"&:hover":{backgroundColor:`transparent`}}},[`&${e.componentCls}-rtl`]:{direction:`rtl`}})}},ES=v(`Breadcrumb`,e=>[TS(B(e,{breadcrumbBaseColor:e.colorTextDescription,breadcrumbFontSize:e.fontSize,breadcrumbIconFontSize:e.fontSize,breadcrumbLinkColor:e.colorTextDescription,breadcrumbLinkColorHover:e.colorText,breadcrumbLastItemColor:e.colorText,breadcrumbSeparatorMargin:e.marginXS,breadcrumbSeparatorColor:e.colorTextDescription}))]),DS=()=>({prefixCls:String,routes:{type:Array},params:f.any,separator:f.any,itemRender:{type:Function}});function OS(e,t){if(!e.breadcrumbName)return null;let n=Object.keys(t).join(`|`);return e.breadcrumbName.replace(RegExp(`:(${n})`,`g`),(e,n)=>t[n]||e)}function kS(e){let{route:t,params:n,routes:r,paths:i}=e,a=r.indexOf(t)===r.length-1,o=OS(t,n);return a?U(`span`,null,[o]):U(`a`,{href:`#/${i.join(`/`)}`},[o])}var AS=u({compatConfig:{MODE:3},name:`ABreadcrumb`,inheritAttrs:!1,props:DS(),slots:Object,setup(t,n){let{slots:r,attrs:i}=n,{prefixCls:a,direction:o}=X(`breadcrumb`,t),[s,c]=ES(a),l=(e,t)=>(e=(e||``).replace(/^\//,``),Object.keys(t).forEach(n=>{e=e.replace(`:${n}`,t[n])}),e),u=(e,t,n)=>{let r=[...e],i=l(t||``,n);return i&&r.push(i),r},d=e=>{let{routes:t=[],params:n={},separator:r,itemRender:i=kS}=e,a=[];return t.map(e=>{let o=l(e.path,n);o&&a.push(o);let s=[...a],c=null;e.children&&e.children.length&&(c=U(wS,{items:e.children.map(e=>({key:e.path||e.breadcrumbName,label:i({route:e,params:n,routes:t,paths:u(s,e.path,n)})}))},null));let d={separator:r};return c&&(d.overlay=c),U(Sx,Y(Y({},d),{},{key:o||e.breadcrumbName}),{default:()=>[i({route:e,params:n,routes:t,paths:s})]})})};return()=>{let n,{routes:l,params:u={}}=t,f=ce(on(r,t)),p=on(r,t,`separator`)??`/`,m=t.itemRender||r.itemRender||kS;l&&l.length>0?n=d({routes:l,params:u,separator:p,itemRender:m}):f.length&&(n=f.map((t,n)=>(e(typeof t.type==`object`&&(t.type.__ANT_BREADCRUMB_ITEM||t.type.__ANT_BREADCRUMB_SEPARATOR),`Breadcrumb`,`Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children`),it(t,{separator:p,key:n}))));let h={[a.value]:!0,[`${a.value}-rtl`]:o.value===`rtl`,[`${i.class}`]:!!i.class,[c.value]:!0};return s(U(`nav`,Y(Y({},i),{},{class:h}),[U(`ol`,null,[n])]))}}}),jS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{separator:e,class:t}=r,a=jS(r,[`separator`,`class`]),o=ce(n.default?.call(n));return U(`span`,Y({class:[`${i.value}-separator`,t]},a),[o.length>0?o:`/`])}}});AS.Item=Sx,AS.Separator=MS,AS.install=function(e){return e.component(AS.name,AS),e.component(Sx.name,Sx),e.component(MS.name,MS),e};var NS=AS,PS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e){(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekday=r()})(e,(function(){return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,n=this.$W,r=(n{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localeData=r()})(e,(function(){return function(e,t,n){var r=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,t,n,r,a){var o=e.name?e:e.$locale(),s=i(o[t]),c=i(o[n]),l=s||c.map((function(e){return e.slice(0,r)}));if(!a)return l;var u=o.weekStart;return l.map((function(e,t){return l[(t+(u||0))%7]}))},o=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}(e.formats[t.toUpperCase()])},c=function(){var e=this;return{months:function(t){return t?t.format(`MMMM`):a(e,`months`)},monthsShort:function(t){return t?t.format(`MMM`):a(e,`monthsShort`,`months`,3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format(`dddd`):a(e,`weekdays`)},weekdaysMin:function(t){return t?t.format(`dd`):a(e,`weekdaysMin`,`weekdays`,2)},weekdaysShort:function(t){return t?t.format(`ddd`):a(e,`weekdaysShort`,`weekdays`,3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return a(o(),`months`)},n.monthsShort=function(){return a(o(),`monthsShort`,`months`,3)},n.weekdays=function(e){return a(o(),`weekdays`,null,null,e)},n.weekdaysShort=function(e){return a(o(),`weekdaysShort`,`weekdays`,3,e)},n.weekdaysMin=function(e){return a(o(),`weekdaysMin`,`weekdays`,2,e)}}}))})),LS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekOfYear=r()})(e,(function(){var e=`week`,t=`year`;return function(n,r,i){var a=r.prototype;a.week=function(n){if(n===void 0&&(n=null),n!==null)return this.add(7*(n-this.week()),`day`);var r=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var a=i(this).startOf(t).add(1,t).date(r),o=i(this).endOf(e);if(a.isBefore(o))return 1}var s=i(this).startOf(t).date(r).startOf(e).subtract(1,`millisecond`),c=this.diff(s,e,!0);return c<0?i(this).startOf(`week`).week():Math.ceil(c)},a.weeks=function(e){return e===void 0&&(e=null),this.week(e)}}}))})),RS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekYear=r()})(e,(function(){return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return t===1&&e===11?n+1:e===0&&t>=52?n-1:n}}}))})),zS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_quarterOfYear=r()})(e,(function(){var e=`month`,t=`quarter`;return function(n,r){var i=r.prototype;i.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var a=i.add;i.add=function(n,r){return n=Number(n),this.$utils().p(r)===t?this.add(3*n,e):a.bind(this)(n,r)};var o=i.startOf;i.startOf=function(n,r){var i=this.$utils(),a=!!i.u(r)||r;if(i.p(n)===t){var s=this.quarter()-1;return a?this.month(3*s).startOf(e).startOf(`day`):this.month(3*s+2).endOf(e).endOf(`day`)}return o.bind(this)(n,r)}}}))})),BS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),VS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),HS=xn(PS()),US=xn(FS()),WS=xn(IS()),GS=xn(LS()),KS=xn(RS()),qS=xn(zS()),JS=xn(BS()),YS=xn(VS());HS.default.extend(YS.default),HS.default.extend(JS.default),HS.default.extend(US.default),HS.default.extend(WS.default),HS.default.extend(GS.default),HS.default.extend(KS.default),HS.default.extend(qS.default),HS.default.extend((e,t)=>{let n=t.prototype,r=n.format;n.format=function(e){let t=(e||``).replace(`Wo`,`wo`);return r.bind(this)(t)}});var XS={bn_BD:`bn-bd`,by_BY:`be`,en_GB:`en-gb`,en_US:`en`,fr_BE:`fr`,fr_CA:`fr-ca`,hy_AM:`hy-am`,kmr_IQ:`ku`,nl_BE:`nl-be`,pt_BR:`pt-br`,zh_CN:`zh-cn`,zh_HK:`zh-hk`,zh_TW:`zh-tw`},ZS=e=>XS[e]||e.split(`_`)[0],QS=()=>{xr(!1,`Not match any format. Please help to fire a issue about this.`)},$S=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|k{1,2}|S/g;function eC(e,t,n){let r=[...new Set(e.split(n))],i=0;for(let e=0;et)return a;i+=n.length}}var tC=(e,t)=>{if(!e)return null;if(HS.default.isDayjs(e))return e;let n=t.matchAll($S),r=(0,HS.default)(e,t);if(n===null)return r;for(let t of n){let n=t[0],i=t.index;if(n===`Q`){let t=eC(e,i,e.slice(i-1,i)).match(/\d+/)[0];r=r.quarter(parseInt(t))}if(n.toLowerCase()===`wo`){let t=eC(e,i,e.slice(i-1,i)).match(/\d+/)[0];r=r.week(parseInt(t))}n.toLowerCase()===`ww`&&(r=r.week(parseInt(e.slice(i,i+n.length)))),n.toLowerCase()===`w`&&(r=r.week(parseInt(e.slice(i,i+n.length+1))))}return r},nC={getNow:()=>(0,HS.default)(),getFixedDate:e=>(0,HS.default)(e,[`YYYY-M-DD`,`YYYY-MM-DD`]),getEndDate:e=>e.endOf(`month`),getWeekDay:e=>{let t=e.locale(`en`);return t.weekday()+t.localeData().firstDayOfWeek()},getYear:e=>e.year(),getMonth:e=>e.month(),getDate:e=>e.date(),getHour:e=>e.hour(),getMinute:e=>e.minute(),getSecond:e=>e.second(),addYear:(e,t)=>e.add(t,`year`),addMonth:(e,t)=>e.add(t,`month`),addDate:(e,t)=>e.add(t,`day`),setYear:(e,t)=>e.year(t),setMonth:(e,t)=>e.month(t),setDate:(e,t)=>e.date(t),setHour:(e,t)=>e.hour(t),setMinute:(e,t)=>e.minute(t),setSecond:(e,t)=>e.second(t),isAfter:(e,t)=>e.isAfter(t),isValidate:e=>e.isValid(),locale:{getWeekFirstDay:e=>(0,HS.default)().locale(ZS(e)).localeData().firstDayOfWeek(),getWeekFirstDate:(e,t)=>t.locale(ZS(e)).weekday(0),getWeek:(e,t)=>t.locale(ZS(e)).week(),getShortWeekDays:e=>(0,HS.default)().locale(ZS(e)).localeData().weekdaysMin(),getShortMonths:e=>(0,HS.default)().locale(ZS(e)).localeData().monthsShort(),format:(e,t,n)=>t.locale(ZS(e)).format(n),parse:(e,t,n)=>{let r=ZS(e);for(let e=0;eArray.isArray(e)?e.map(e=>tC(e,t)):tC(e,t),toString:(e,t)=>Array.isArray(e)?e.map(e=>HS.default.isDayjs(e)?e.format(t):e):HS.default.isDayjs(e)?e.format(t):e};function rC(e){let t=ye();return Z(Z({},e),t)}var iC=Symbol(`PanelContextProps`),aC=e=>{fe(iC,e)},oC=()=>g(iC,{}),sC={visibility:`hidden`};function cC(e,t){let{slots:n}=t,{prefixCls:r,prevIcon:i=`‹`,nextIcon:a=`›`,superPrevIcon:o=`«`,superNextIcon:s=`»`,onSuperPrev:c,onSuperNext:l,onPrev:u,onNext:d}=rC(e),{hideNextBtn:f,hidePrevBtn:p}=oC();return U(`div`,{class:r},[c&&U(`button`,{type:`button`,onClick:c,tabindex:-1,class:`${r}-super-prev-btn`,style:p.value?sC:{}},[o]),u&&U(`button`,{type:`button`,onClick:u,tabindex:-1,class:`${r}-prev-btn`,style:p.value?sC:{}},[i]),U(`div`,{class:`${r}-view`},[n.default?.call(n)]),d&&U(`button`,{type:`button`,onClick:d,tabindex:-1,class:`${r}-next-btn`,style:f.value?sC:{}},[a]),l&&U(`button`,{type:`button`,onClick:l,tabindex:-1,class:`${r}-super-next-btn`,style:f.value?sC:{}},[s])])}cC.displayName=`Header`,cC.inheritAttrs=!1;function lC(e){let t=rC(e),{prefixCls:n,generateConfig:r,viewDate:i,onPrevDecades:a,onNextDecades:o}=t,{hideHeader:s}=oC();if(s)return null;let c=`${n}-header`,l=r.getYear(i),u=Math.floor(l/100)*100,d=u+100-1;return U(cC,Y(Y({},t),{},{prefixCls:c,onSuperPrev:a,onSuperNext:o}),{default:()=>[u,en(`-`),d]})}lC.displayName=`DecadeHeader`,lC.inheritAttrs=!1;function uC(e,t,n,r,i){let a=e.setHour(t,n);return a=e.setMinute(a,r),a=e.setSecond(a,i),a}function dC(e,t,n){if(!n)return t;let r=t;return r=e.setHour(r,e.getHour(n)),r=e.setMinute(r,e.getMinute(n)),r=e.setSecond(r,e.getSecond(n)),r}function fC(e,t,n,r,i,a){let o=Math.floor(e/r)*r;if(o{e.stopPropagation(),x||r(g)},onMouseenter:()=>{!x&&_&&_(g)},onMouseleave:()=>{!x&&v&&v(g)}},[f?f(g):U(`div`,{class:`${b}-inner`},[d(g)])]))}x.push(U(`tr`,{key:e,class:c&&c(a)},[t]))}return U(`div`,{class:`${t}-body`},[U(`table`,{class:`${t}-content`},[g&&U(`thead`,null,[U(`tr`,null,[g])]),U(`tbody`,null,[x])])])}mC.displayName=`PanelBody`,mC.inheritAttrs=!1;var hC=4;function gC(e){let t=rC(e),{prefixCls:n,viewDate:r,generateConfig:i}=t,a=`${n}-cell`,o=i.getYear(r),s=Math.floor(o/10)*10,c=Math.floor(o/100)*100,l=c+100-1,u=i.setYear(r,c-Math.ceil((3*hC*10-100)/2));return U(mC,Y(Y({},t),{},{rowNum:hC,colNum:3,baseDate:u,getCellText:e=>{let t=i.getYear(e);return`${t}-${t+9}`},getCellClassName:e=>{let t=i.getYear(e),n=t+9;return{[`${a}-in-view`]:c<=t&&n<=l,[`${a}-selected`]:t===s}},getCellDate:(e,t)=>i.addYear(e,t*10)}),null)}gC.displayName=`DecadeBody`,gC.inheritAttrs=!1;var _C=new Map;function vC(e,t){let n;function r(){fo(e)?t():n=ir(()=>{r()})}return r(),()=>{ir.cancel(n)}}function yC(e,t,n){if(_C.get(e)&&ir.cancel(_C.get(e)),n<=0){_C.set(e,ir(()=>{e.scrollTop=t}));return}let r=(t-e.scrollTop)/n*10;_C.set(e,ir(()=>{e.scrollTop+=r,e.scrollTop!==t&&yC(e,t,n-10)}))}function bC(e,t){let{onLeftRight:n,onCtrlLeftRight:r,onUpDown:i,onPageUpDown:a,onEnter:o}=t,{which:s,ctrlKey:c,metaKey:l}=e;switch(s){case $.LEFT:if(c||l){if(r)return r(-1),!0}else if(n)return n(-1),!0;break;case $.RIGHT:if(c||l){if(r)return r(1),!0}else if(n)return n(1),!0;break;case $.UP:if(i)return i(-1),!0;break;case $.DOWN:if(i)return i(1),!0;break;case $.PAGE_UP:if(a)return a(-1),!0;break;case $.PAGE_DOWN:if(a)return a(1),!0;break;case $.ENTER:if(o)return o(),!0;break}return!1}function xC(e,t,n,r){let i=e;if(!i)switch(t){case`time`:i=r?`hh:mm:ss a`:`HH:mm:ss`;break;case`week`:i=`gggg-wo`;break;case`month`:i=`YYYY-MM`;break;case`quarter`:i=`YYYY-[Q]Q`;break;case`year`:i=`YYYY`;break;default:i=n?`YYYY-MM-DD HH:mm:ss`:`YYYY-MM-DD`}return i}function SC(e,t,n){let r=e===`time`?8:10,i=typeof t==`function`?t(n.getNow()).length:t.length;return Math.max(r,i)+2}var CC=null,wC=new Set;function TC(e){return!CC&&typeof window<`u`&&window.addEventListener&&(CC=e=>{[...wC].forEach(t=>{t(e)})},window.addEventListener(`mousedown`,CC)),wC.add(e),()=>{wC.delete(e),wC.size===0&&(window.removeEventListener(`mousedown`,CC),CC=null)}}function EC(e){let t=e.target;return e.composed&&t.shadowRoot&&e.composedPath?.call(e)[0]||t}var DC={year:e=>e===`month`||e===`date`?`year`:e,month:e=>e===`date`?`month`:e,quarter:e=>e===`month`||e===`date`?`quarter`:e,week:e=>e===`date`?`week`:e,time:null,date:null};function OC(e,t){return e.some(e=>e&&e.contains(t))}function kC(e){let t=rC(e),{prefixCls:n,onViewDateChange:r,generateConfig:i,viewDate:a,operationRef:o,onSelect:s,onPanelChange:c}=t,l=`${n}-decade-panel`;o.value={onKeydown:e=>bC(e,{onLeftRight:e=>{s(i.addYear(a,e*10),`key`)},onCtrlLeftRight:e=>{s(i.addYear(a,e*100),`key`)},onUpDown:e=>{s(i.addYear(a,e*10*3),`key`)},onEnter:()=>{c(`year`,a)}})};let u=e=>{let t=i.addYear(a,e*100);r(t),c(null,t)};return U(`div`,{class:l},[U(lC,Y(Y({},t),{},{prefixCls:n,onPrevDecades:()=>{u(-1)},onNextDecades:()=>{u(1)}}),null),U(gC,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{s(e,`mouse`),c(`year`,e)}}),null)])}kC.displayName=`DecadePanel`,kC.inheritAttrs=!1;function AC(e,t){if(!e&&!t)return!0;if(!e||!t)return!1}function jC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:Math.floor(e.getYear(t)/10)===Math.floor(e.getYear(n)/10)}function MC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:e.getYear(t)===e.getYear(n)}function NC(e,t){return Math.floor(e.getMonth(t)/3)+1}function PC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:MC(e,t,n)&&NC(e,t)===NC(e,n)}function FC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:MC(e,t,n)&&e.getMonth(t)===e.getMonth(n)}function IC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:e.getYear(t)===e.getYear(n)&&e.getMonth(t)===e.getMonth(n)&&e.getDate(t)===e.getDate(n)}function LC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:e.getHour(t)===e.getHour(n)&&e.getMinute(t)===e.getMinute(n)&&e.getSecond(t)===e.getSecond(n)}function RC(e,t,n,r){let i=AC(n,r);return typeof i==`boolean`?i:e.locale.getWeek(t,n)===e.locale.getWeek(t,r)}function zC(e,t,n){return IC(e,t,n)&&LC(e,t,n)}function BC(e,t,n,r){return!t||!n||!r?!1:!IC(e,t,r)&&!IC(e,n,r)&&e.isAfter(r,t)&&e.isAfter(n,r)}function VC(e,t,n){let r=t.locale.getWeekFirstDay(e),i=t.setDate(n,1),a=t.getWeekDay(i),o=t.addDate(i,r-a);return t.getMonth(o)===t.getMonth(n)&&t.getDate(o)>1&&(o=t.addDate(o,-7)),o}function HC(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(t){case`year`:return n.addYear(e,r*10);case`quarter`:case`month`:return n.addYear(e,r);default:return n.addMonth(e,r)}}function UC(e,t){let{generateConfig:n,locale:r,format:i}=t;return typeof i==`function`?i(e):n.locale.format(r.locale,e,i)}function WC(e,t){let{generateConfig:n,locale:r,formatList:i}=t;return!e||typeof i[0]==`function`?null:n.locale.parse(r.locale,e,i)}function GC(e){let{cellDate:t,mode:n,disabledDate:r,generateConfig:i}=e;if(!r)return!1;let a=(e,n,a)=>{let o=n;for(;o<=a;){let n;switch(e){case`date`:if(n=i.setDate(t,o),!r(n))return!1;break;case`month`:if(n=i.setMonth(t,o),!GC({cellDate:n,mode:`month`,generateConfig:i,disabledDate:r}))return!1;break;case`year`:if(n=i.setYear(t,o),!GC({cellDate:n,mode:`year`,generateConfig:i,disabledDate:r}))return!1;break}o+=1}return!0};switch(n){case`date`:case`week`:return r(t);case`month`:return a(`date`,1,i.getDate(i.getEndDate(t)));case`quarter`:{let e=Math.floor(i.getMonth(t)/3)*3;return a(`month`,e,e+2)}case`year`:return a(`month`,0,11);case`decade`:{let e=i.getYear(t),n=Math.floor(e/10)*10;return a(`year`,n,n+10-1)}}}function KC(e){let t=rC(e),{hideHeader:n}=oC();if(n.value)return null;let{prefixCls:r,generateConfig:i,locale:a,value:o,format:s}=t;return U(cC,{prefixCls:`${r}-header`},{default:()=>[o?UC(o,{locale:a,format:s,generateConfig:i}):`\xA0`]})}KC.displayName=`TimeHeader`,KC.inheritAttrs=!1;var qC=u({name:`TimeUnitColumn`,props:[`prefixCls`,`units`,`onSelect`,`value`,`active`,`hideDisabledOptions`],setup(e){let{open:t}=oC(),n=q(null),r=H(new Map),i=H();return G(()=>e.value,()=>{let i=r.value.get(e.value);i&&t.value!==!1&&yC(n.value,i.offsetTop,120)}),ut(()=>{var e;(e=i.value)==null||e.call(i)}),G(t,()=>{var a;(a=i.value)==null||a.call(i),z(()=>{if(t.value){let t=r.value.get(e.value);t&&(i.value=vC(t,()=>{yC(n.value,t.offsetTop,0)}))}})},{immediate:!0,flush:`post`}),()=>{let{prefixCls:t,units:i,onSelect:a,value:o,active:s,hideDisabledOptions:c}=e,l=`${t}-cell`;return U(`ul`,{class:K(`${t}-column`,{[`${t}-column-active`]:s}),ref:n,style:{position:`relative`}},[i.map(e=>c&&e.disabled?null:U(`li`,{key:e.value,ref:t=>{r.value.set(e.value,t)},class:K(l,{[`${l}-disabled`]:e.disabled,[`${l}-selected`]:o===e.value}),onClick:()=>{e.disabled||a(e.value)}},[U(`div`,{class:`${l}-inner`},[e.label])]))])}}});function JC(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`0`,r=String(e);for(;r.length{(n.startsWith(`data-`)||n.startsWith(`aria-`)||n===`role`||n===`name`)&&!n.startsWith(`data-__`)&&(t[n]=e[n])}),t}function QC(e,t){return e?e[t]:null}function $C(e,t,n){let r=[QC(e,0),QC(e,1)];return r[n]=typeof t==`function`?t(r[n]):t,!r[0]&&!r[1]?null:r}function ew(e,t,n,r){let i=[];for(let a=e;a<=t;a+=n)i.push({label:JC(a,2),value:a,disabled:(r||[]).includes(a)});return i}var tw=u({compatConfig:{MODE:3},name:`TimeBody`,inheritAttrs:!1,props:[`generateConfig`,`prefixCls`,`operationRef`,`activeColumnIndex`,`value`,`showHour`,`showMinute`,`showSecond`,`use12Hours`,`hourStep`,`minuteStep`,`secondStep`,`disabledHours`,`disabledMinutes`,`disabledSeconds`,`disabledTime`,`hideDisabledOptions`,`onSelect`],setup(e){let t=J(()=>e.value?e.generateConfig.getHour(e.value):-1),n=J(()=>e.use12Hours?t.value>=12:!1),r=J(()=>e.use12Hours?t.value%12:t.value),i=J(()=>e.value?e.generateConfig.getMinute(e.value):-1),a=J(()=>e.value?e.generateConfig.getSecond(e.value):-1),o=H(e.generateConfig.getNow()),s=H(),c=H(),l=H();ne(()=>{o.value=e.generateConfig.getNow()}),S(()=>{if(e.disabledTime){let t=e.disabledTime(o);[s.value,c.value,l.value]=[t.disabledHours,t.disabledMinutes,t.disabledSeconds]}else[s.value,c.value,l.value]=[e.disabledHours,e.disabledMinutes,e.disabledSeconds]});let u=(t,n,r,i)=>{let a=e.value||e.generateConfig.getNow(),o=Math.max(0,n),s=Math.max(0,r),c=Math.max(0,i);return a=uC(e.generateConfig,a,!e.use12Hours||!t?o:o+12,s,c),a},d=J(()=>ew(0,23,e.hourStep??1,s.value&&s.value())),f=J(()=>{if(!e.use12Hours)return[!1,!1];let t=[!0,!0];return d.value.forEach(e=>{let{disabled:n,value:r}=e;n||(r>=12?t[1]=!1:t[0]=!1)}),t}),p=J(()=>e.use12Hours?d.value.filter(n.value?e=>e.value>=12:e=>e.value<12).map(e=>{let t=e.value%12,n=t===0?`12`:JC(t,2);return Z(Z({},e),{label:n,value:t})}):d.value),m=J(()=>ew(0,59,e.minuteStep??1,c.value&&c.value(t.value))),h=J(()=>ew(0,59,e.secondStep??1,l.value&&l.value(t.value,i.value)));return()=>{let{prefixCls:t,operationRef:o,activeColumnIndex:s,showHour:c,showMinute:l,showSecond:d,use12Hours:g,hideDisabledOptions:_,onSelect:v}=e,y=[],b=`${t}-content`,x=`${t}-time-panel`;o.value={onUpDown:e=>{let t=y[s];if(t){let n=t.units.findIndex(e=>e.value===t.value),r=t.units.length;for(let i=1;i{v(u(n.value,e,i.value,a.value),`mouse`)}),S(l,U(qC,{key:`minute`},null),i.value,m.value,e=>{v(u(n.value,r.value,e,a.value),`mouse`)}),S(d,U(qC,{key:`second`},null),a.value,h.value,e=>{v(u(n.value,r.value,i.value,e),`mouse`)});let C=-1;return typeof n.value==`boolean`&&(C=+!!n.value),S(g===!0,U(qC,{key:`12hours`},null),C,[{label:`AM`,value:0,disabled:f.value[0]},{label:`PM`,value:1,disabled:f.value[1]}],e=>{v(u(!!e,r.value,i.value,a.value),`mouse`)}),U(`div`,{class:b},[y.map(e=>{let{node:t}=e;return t})])}}}),nw=e=>e.filter(e=>e!==!1).length;function rw(e){let t=rC(e),{generateConfig:n,format:r=`HH:mm:ss`,prefixCls:i,active:a,operationRef:o,showHour:s,showMinute:c,showSecond:l,use12Hours:u=!1,onSelect:d,value:f}=t,p=`${i}-time-panel`,m=H(),h=H(-1),g=nw([s,c,l,u]);return o.value={onKeydown:e=>bC(e,{onLeftRight:e=>{h.value=(h.value+e+g)%g},onUpDown:e=>{h.value===-1?h.value=0:m.value&&m.value.onUpDown(e)},onEnter:()=>{d(f||n.getNow(),`key`),h.value=-1}}),onBlur:()=>{h.value=-1}},U(`div`,{class:K(p,{[`${p}-active`]:a})},[U(KC,Y(Y({},t),{},{format:r,prefixCls:i}),null),U(tw,Y(Y({},t),{},{prefixCls:i,activeColumnIndex:h.value,operationRef:m}),null)])}rw.displayName=`TimePanel`,rw.inheritAttrs=!1;function iw(e){let{cellPrefixCls:t,generateConfig:n,rangedValue:r,hoverRangedValue:i,isInView:a,isSameCell:o,offsetCell:s,today:c,value:l}=e;function u(e){let u=s(e,-1),d=s(e,1),f=QC(r,0),p=QC(r,1),m=QC(i,0),h=QC(i,1),g=BC(n,m,h,e);function _(e){return o(f,e)}function v(e){return o(p,e)}let y=o(m,e),b=o(h,e),x=(g||b)&&(!a(u)||v(u)),S=(g||y)&&(!a(d)||_(d));return{[`${t}-in-view`]:a(e),[`${t}-in-range`]:BC(n,f,p,e),[`${t}-range-start`]:_(e),[`${t}-range-end`]:v(e),[`${t}-range-start-single`]:_(e)&&!p,[`${t}-range-end-single`]:v(e)&&!f,[`${t}-range-start-near-hover`]:_(e)&&(o(u,m)||BC(n,m,h,u)),[`${t}-range-end-near-hover`]:v(e)&&(o(d,h)||BC(n,m,h,d)),[`${t}-range-hover`]:g,[`${t}-range-hover-start`]:y,[`${t}-range-hover-end`]:b,[`${t}-range-hover-edge-start`]:x,[`${t}-range-hover-edge-end`]:S,[`${t}-range-hover-edge-start-near-range`]:x&&o(u,p),[`${t}-range-hover-edge-end-near-range`]:S&&o(d,f),[`${t}-today`]:o(c,e),[`${t}-selected`]:o(l,e)}}return u}var aw=Symbol(`RangeContextProps`),ow=e=>{fe(aw,e)},sw=()=>g(aw,{rangedValue:H(),hoverRangedValue:H(),inRange:H(),panelPosition:H()}),cw=u({compatConfig:{MODE:3},name:`PanelContextProvider`,inheritAttrs:!1,props:{value:{type:Object,default:()=>({})}},setup(e,t){let{slots:n}=t,r={rangedValue:H(e.value.rangedValue),hoverRangedValue:H(e.value.hoverRangedValue),inRange:H(e.value.inRange),panelPosition:H(e.value.panelPosition)};return ow(r),G(()=>e.value,()=>{Object.keys(e.value).forEach(t=>{r[t]&&(r[t].value=e.value[t])})}),()=>n.default?.call(n)}});function lw(e){let t=rC(e),{prefixCls:n,generateConfig:r,prefixColumn:i,locale:a,rowCount:o,viewDate:s,value:c,dateRender:l}=t,{rangedValue:u,hoverRangedValue:d}=sw(),f=VC(a.locale,r,s),p=`${n}-cell`,m=r.locale.getWeekFirstDay(a.locale),h=r.getNow(),g=[],_=a.shortWeekDays||(r.locale.getShortWeekDays?r.locale.getShortWeekDays(a.locale):[]);i&&g.push(U(`th`,{key:`empty`,"aria-label":`empty cell`},null));for(let e=0;e<7;e+=1)g.push(U(`th`,{key:e},[_[(e+m)%7]]));let v=iw({cellPrefixCls:p,today:h,value:c,generateConfig:r,rangedValue:i?null:u.value,hoverRangedValue:i?null:d.value,isSameCell:(e,t)=>IC(r,e,t),isInView:e=>FC(r,e,s),offsetCell:(e,t)=>r.addDate(e,t)}),y=l?e=>l({current:e,today:h}):void 0;return U(mC,Y(Y({},t),{},{rowNum:o,colNum:7,baseDate:f,getCellNode:y,getCellText:r.getDate,getCellClassName:v,getCellDate:r.addDate,titleCell:e=>UC(e,{locale:a,format:`YYYY-MM-DD`,generateConfig:r}),headerCells:g}),null)}lw.displayName=`DateBody`,lw.inheritAttrs=!1,lw.props=[`prefixCls`,`generateConfig`,`value?`,`viewDate`,`locale`,`rowCount`,`onSelect`,`dateRender?`,`disabledDate?`,`prefixColumn?`,`rowClassName?`];function uw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,viewDate:a,onNextMonth:o,onPrevMonth:s,onNextYear:c,onPrevYear:l,onYearClick:u,onMonthClick:d}=t,{hideHeader:f}=oC();if(f.value)return null;let p=`${n}-header`,m=i.shortMonths||(r.locale.getShortMonths?r.locale.getShortMonths(i.locale):[]),h=r.getMonth(a),g=U(`button`,{type:`button`,key:`year`,onClick:u,tabindex:-1,class:`${n}-year-btn`},[UC(a,{locale:i,format:i.yearFormat,generateConfig:r})]),_=U(`button`,{type:`button`,key:`month`,onClick:d,tabindex:-1,class:`${n}-month-btn`},[i.monthFormat?UC(a,{locale:i,format:i.monthFormat,generateConfig:r}):m[h]]),v=i.monthBeforeYear?[_,g]:[g,_];return U(cC,Y(Y({},t),{},{prefixCls:p,onSuperPrev:l,onPrev:s,onNext:o,onSuperNext:c}),{default:()=>[v]})}uw.displayName=`DateHeader`,uw.inheritAttrs=!1;var dw=6;function fw(e){let t=rC(e),{prefixCls:n,panelName:r=`date`,keyboardConfig:i,active:a,operationRef:o,generateConfig:s,value:c,viewDate:l,onViewDateChange:u,onPanelChange:d,onSelect:f}=t,p=`${n}-${r}-panel`;o.value={onKeydown:e=>bC(e,Z({onLeftRight:e=>{f(s.addDate(c||l,e),`key`)},onCtrlLeftRight:e=>{f(s.addYear(c||l,e),`key`)},onUpDown:e=>{f(s.addDate(c||l,e*7),`key`)},onPageUpDown:e=>{f(s.addMonth(c||l,e),`key`)}},i))};let m=e=>{let t=s.addYear(l,e);u(t),d(null,t)},h=e=>{let t=s.addMonth(l,e);u(t),d(null,t)};return U(`div`,{class:K(p,{[`${p}-active`]:a})},[U(uw,Y(Y({},t),{},{prefixCls:n,value:c,viewDate:l,onPrevYear:()=>{m(-1)},onNextYear:()=>{m(1)},onPrevMonth:()=>{h(-1)},onNextMonth:()=>{h(1)},onMonthClick:()=>{d(`month`,l)},onYearClick:()=>{d(`year`,l)}}),null),U(lw,Y(Y({},t),{},{onSelect:e=>f(e,`mouse`),prefixCls:n,value:c,viewDate:l,rowCount:dw}),null)])}fw.displayName=`DatePanel`,fw.inheritAttrs=!1;var pw=YC(`date`,`time`);function mw(e){let t=rC(e),{prefixCls:n,operationRef:r,generateConfig:i,value:a,defaultValue:o,disabledTime:s,showTime:c,onSelect:l}=t,u=`${n}-datetime-panel`,d=H(null),f=H({}),p=H({}),m=typeof c==`object`?Z({},c):{};function h(e){return pw[pw.indexOf(d.value)+e]||null}let g=e=>{p.value.onBlur&&p.value.onBlur(e),d.value=null};r.value={onKeydown:e=>{if(e.which===$.TAB){let t=h(e.shiftKey?-1:1);return d.value=t,t&&e.preventDefault(),!0}if(d.value){let t=d.value===`date`?f:p;return t.value&&t.value.onKeydown&&t.value.onKeydown(e),!0}return[$.LEFT,$.RIGHT,$.UP,$.DOWN].includes(e.which)?(d.value=`date`,!0):!1},onBlur:g,onClose:g};let _=(e,t)=>{let n=e;t===`date`&&!a&&m.defaultValue?(n=i.setHour(n,i.getHour(m.defaultValue)),n=i.setMinute(n,i.getMinute(m.defaultValue)),n=i.setSecond(n,i.getSecond(m.defaultValue))):t===`time`&&!a&&o&&(n=i.setYear(n,i.getYear(o)),n=i.setMonth(n,i.getMonth(o)),n=i.setDate(n,i.getDate(o))),l&&l(n,`mouse`)},v=s?s(a||null):{};return U(`div`,{class:K(u,{[`${u}-active`]:d.value})},[U(fw,Y(Y({},t),{},{operationRef:f,active:d.value===`date`,onSelect:e=>{_(dC(i,e,!a&&typeof c==`object`?c.defaultValue:null),`date`)}}),null),U(rw,Y(Y(Y(Y({},t),{},{format:void 0},m),v),{},{disabledTime:null,defaultValue:void 0,operationRef:p,active:d.value===`time`,onSelect:e=>{_(e,`time`)}}),null)])}mw.displayName=`DatetimePanel`,mw.inheritAttrs=!1;function hw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,value:a}=t,o=`${n}-cell`,s=e=>U(`td`,{key:`week`,class:K(o,`${o}-week`)},[r.locale.getWeek(i.locale,e)]),c=`${n}-week-panel-row`;return U(fw,Y(Y({},t),{},{panelName:`week`,prefixColumn:s,rowClassName:e=>K(c,{[`${c}-selected`]:RC(r,i.locale,a,e)}),keyboardConfig:{onLeftRight:null}}),null)}hw.displayName=`WeekPanel`,hw.inheritAttrs=!1;function gw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,viewDate:a,onNextYear:o,onPrevYear:s,onYearClick:c}=t,{hideHeader:l}=oC();if(l.value)return null;let u=`${n}-header`;return U(cC,Y(Y({},t),{},{prefixCls:u,onSuperPrev:s,onSuperNext:o}),{default:()=>[U(`button`,{type:`button`,onClick:c,class:`${n}-year-btn`},[UC(a,{locale:i,format:i.yearFormat,generateConfig:r})])]})}gw.displayName=`MonthHeader`,gw.inheritAttrs=!1;var _w=4;function vw(e){let t=rC(e),{prefixCls:n,locale:r,value:i,viewDate:a,generateConfig:o,monthCellRender:s}=t,{rangedValue:c,hoverRangedValue:l}=sw(),u=iw({cellPrefixCls:`${n}-cell`,value:i,generateConfig:o,rangedValue:c.value,hoverRangedValue:l.value,isSameCell:(e,t)=>FC(o,e,t),isInView:()=>!0,offsetCell:(e,t)=>o.addMonth(e,t)}),d=r.shortMonths||(o.locale.getShortMonths?o.locale.getShortMonths(r.locale):[]),f=o.setMonth(a,0),p=s?e=>s({current:e,locale:r}):void 0;return U(mC,Y(Y({},t),{},{rowNum:_w,colNum:3,baseDate:f,getCellNode:p,getCellText:e=>r.monthFormat?UC(e,{locale:r,format:r.monthFormat,generateConfig:o}):d[o.getMonth(e)],getCellClassName:u,getCellDate:o.addMonth,titleCell:e=>UC(e,{locale:r,format:`YYYY-MM`,generateConfig:o})}),null)}vw.displayName=`MonthBody`,vw.inheritAttrs=!1;function yw(e){let t=rC(e),{prefixCls:n,operationRef:r,onViewDateChange:i,generateConfig:a,value:o,viewDate:s,onPanelChange:c,onSelect:l}=t,u=`${n}-month-panel`;r.value={onKeydown:e=>bC(e,{onLeftRight:e=>{l(a.addMonth(o||s,e),`key`)},onCtrlLeftRight:e=>{l(a.addYear(o||s,e),`key`)},onUpDown:e=>{l(a.addMonth(o||s,e*3),`key`)},onEnter:()=>{c(`date`,o||s)}})};let d=e=>{let t=a.addYear(s,e);i(t),c(null,t)};return U(`div`,{class:u},[U(gw,Y(Y({},t),{},{prefixCls:n,onPrevYear:()=>{d(-1)},onNextYear:()=>{d(1)},onYearClick:()=>{c(`year`,s)}}),null),U(vw,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{l(e,`mouse`),c(`date`,e)}}),null)])}yw.displayName=`MonthPanel`,yw.inheritAttrs=!1;function bw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,viewDate:a,onNextYear:o,onPrevYear:s,onYearClick:c}=t,{hideHeader:l}=oC();if(l.value)return null;let u=`${n}-header`;return U(cC,Y(Y({},t),{},{prefixCls:u,onSuperPrev:s,onSuperNext:o}),{default:()=>[U(`button`,{type:`button`,onClick:c,class:`${n}-year-btn`},[UC(a,{locale:i,format:i.yearFormat,generateConfig:r})])]})}bw.displayName=`QuarterHeader`,bw.inheritAttrs=!1;var xw=1;function Sw(e){let t=rC(e),{prefixCls:n,locale:r,value:i,viewDate:a,generateConfig:o}=t,{rangedValue:s,hoverRangedValue:c}=sw(),l=iw({cellPrefixCls:`${n}-cell`,value:i,generateConfig:o,rangedValue:s.value,hoverRangedValue:c.value,isSameCell:(e,t)=>PC(o,e,t),isInView:()=>!0,offsetCell:(e,t)=>o.addMonth(e,t*3)}),u=o.setDate(o.setMonth(a,0),1);return U(mC,Y(Y({},t),{},{rowNum:xw,colNum:4,baseDate:u,getCellText:e=>UC(e,{locale:r,format:r.quarterFormat||`[Q]Q`,generateConfig:o}),getCellClassName:l,getCellDate:(e,t)=>o.addMonth(e,t*3),titleCell:e=>UC(e,{locale:r,format:`YYYY-[Q]Q`,generateConfig:o})}),null)}Sw.displayName=`QuarterBody`,Sw.inheritAttrs=!1;function Cw(e){let t=rC(e),{prefixCls:n,operationRef:r,onViewDateChange:i,generateConfig:a,value:o,viewDate:s,onPanelChange:c,onSelect:l}=t,u=`${n}-quarter-panel`;r.value={onKeydown:e=>bC(e,{onLeftRight:e=>{l(a.addMonth(o||s,e*3),`key`)},onCtrlLeftRight:e=>{l(a.addYear(o||s,e),`key`)},onUpDown:e=>{l(a.addYear(o||s,e),`key`)}})};let d=e=>{let t=a.addYear(s,e);i(t),c(null,t)};return U(`div`,{class:u},[U(bw,Y(Y({},t),{},{prefixCls:n,onPrevYear:()=>{d(-1)},onNextYear:()=>{d(1)},onYearClick:()=>{c(`year`,s)}}),null),U(Sw,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{l(e,`mouse`)}}),null)])}Cw.displayName=`QuarterPanel`,Cw.inheritAttrs=!1;function ww(e){let t=rC(e),{prefixCls:n,generateConfig:r,viewDate:i,onPrevDecade:a,onNextDecade:o,onDecadeClick:s}=t,{hideHeader:c}=oC();if(c.value)return null;let l=`${n}-header`,u=r.getYear(i),d=Math.floor(u/10)*10,f=d+10-1;return U(cC,Y(Y({},t),{},{prefixCls:l,onSuperPrev:a,onSuperNext:o}),{default:()=>[U(`button`,{type:`button`,onClick:s,class:`${n}-decade-btn`},[d,en(`-`),f])]})}ww.displayName=`YearHeader`,ww.inheritAttrs=!1;var Tw=4;function Ew(e){let t=rC(e),{prefixCls:n,value:r,viewDate:i,locale:a,generateConfig:o}=t,{rangedValue:s,hoverRangedValue:c}=sw(),l=`${n}-cell`,u=o.getYear(i),d=Math.floor(u/10)*10,f=d+10-1,p=o.setYear(i,d-Math.ceil((3*Tw-10)/2)),m=iw({cellPrefixCls:l,value:r,generateConfig:o,rangedValue:s.value,hoverRangedValue:c.value,isSameCell:(e,t)=>MC(o,e,t),isInView:e=>{let t=o.getYear(e);return d<=t&&t<=f},offsetCell:(e,t)=>o.addYear(e,t)});return U(mC,Y(Y({},t),{},{rowNum:Tw,colNum:3,baseDate:p,getCellText:o.getYear,getCellClassName:m,getCellDate:o.addYear,titleCell:e=>UC(e,{locale:a,format:`YYYY`,generateConfig:o})}),null)}Ew.displayName=`YearBody`,Ew.inheritAttrs=!1;function Dw(e){let t=rC(e),{prefixCls:n,operationRef:r,onViewDateChange:i,generateConfig:a,value:o,viewDate:s,sourceMode:c,onSelect:l,onPanelChange:u}=t,d=`${n}-year-panel`;r.value={onKeydown:e=>bC(e,{onLeftRight:e=>{l(a.addYear(o||s,e),`key`)},onCtrlLeftRight:e=>{l(a.addYear(o||s,e*10),`key`)},onUpDown:e=>{l(a.addYear(o||s,e*3),`key`)},onEnter:()=>{u(c===`date`?`date`:`month`,o||s)}})};let f=e=>{let t=a.addYear(s,e*10);i(t),u(null,t)};return U(`div`,{class:d},[U(ww,Y(Y({},t),{},{prefixCls:n,onPrevDecade:()=>{f(-1)},onNextDecade:()=>{f(1)},onDecadeClick:()=>{u(`decade`,s)}}),null),U(Ew,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{u(c===`date`?`date`:`month`,e),l(e,`mouse`)}}),null)])}Dw.displayName=`YearPanel`,Dw.inheritAttrs=!1;function Ow(e,t,n){return n?U(`div`,{class:`${e}-footer-extra`},[n(t)]):null}function kw(e){let{prefixCls:t,components:n={},needConfirmButton:r,onNow:i,onOk:a,okDisabled:o,showNow:s,locale:c}=e,l,u;if(r){let e=n.button||`button`;i&&s!==!1&&(l=U(`li`,{class:`${t}-now`},[U(`a`,{class:`${t}-now-btn`,onClick:i},[c.now])])),u=r&&U(`li`,{class:`${t}-ok`},[U(e,{disabled:o,onClick:e=>{e.stopPropagation(),a&&a()}},{default:()=>[c.ok]})])}return!l&&!u?null:U(`ul`,{class:`${t}-ranges`},[l,u])}function Aw(){return u({name:`PickerPanel`,inheritAttrs:!1,props:{prefixCls:String,locale:Object,generateConfig:Object,value:Object,defaultValue:Object,pickerValue:Object,defaultPickerValue:Object,disabledDate:Function,mode:String,picker:{type:String,default:`date`},tabindex:{type:[Number,String],default:0},showNow:{type:Boolean,default:void 0},showTime:[Boolean,Object],showToday:Boolean,renderExtraFooter:Function,dateRender:Function,hideHeader:{type:Boolean,default:void 0},onSelect:Function,onChange:Function,onPanelChange:Function,onMousedown:Function,onPickerValueChange:Function,onOk:Function,components:Object,direction:String,hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1}},setup(e,t){let{attrs:n}=t,r=J(()=>e.picker===`date`&&!!e.showTime||e.picker===`time`),i=J(()=>24%e.hourStep==0),a=J(()=>60%e.minuteStep==0),o=J(()=>60%e.secondStep==0),s=oC(),{operationRef:c,onSelect:l,hideRanges:u,defaultOpenValue:d}=s,{inRange:f,panelPosition:p,rangedValue:m,hoverRangedValue:h}=sw(),g=H({}),[_,v]=df(null,{value:St(e,`value`),defaultValue:e.defaultValue,postState:t=>!t&&d?.value&&e.picker===`time`?d.value:t}),[y,b]=df(null,{value:St(e,`pickerValue`),defaultValue:e.defaultPickerValue||_.value,postState:t=>{let{generateConfig:n,showTime:r,defaultValue:i}=e,a=n.getNow();return t?!_.value&&e.showTime?typeof r==`object`?dC(n,Array.isArray(t)?t[0]:t,r.defaultValue||a):i?dC(n,Array.isArray(t)?t[0]:t,i):dC(n,Array.isArray(t)?t[0]:t,a):t:a}}),x=t=>{b(t),e.onPickerValueChange&&e.onPickerValueChange(t)},S=t=>{let n=DC[e.picker];return n?n(t):t},[C,w]=df(()=>e.picker===`time`?`time`:S(`date`),{value:St(e,`mode`)});G(()=>e.picker,()=>{w(e.picker)});let T=H(C.value),E=e=>{T.value=e},D=(t,n)=>{let{onPanelChange:r,generateConfig:i}=e,a=S(t||C.value);E(C.value),w(a),r&&(C.value!==a||zC(i,y.value,y.value))&&r(n,a)},O=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{picker:i,generateConfig:a,onSelect:o,onChange:s,disabledDate:c}=e;(C.value===i||r)&&(v(t),o&&o(t),l&&l(t,n),s&&!zC(a,t,_.value)&&!c?.(t)&&s(t))},k=e=>g.value&&g.value.onKeydown?([$.LEFT,$.RIGHT,$.UP,$.DOWN,$.PAGE_UP,$.PAGE_DOWN,$.ENTER].includes(e.which)&&e.preventDefault(),g.value.onKeydown(e)):!1,A=e=>{g.value&&g.value.onBlur&&g.value.onBlur(e)},j=()=>{let{generateConfig:t,hourStep:n,minuteStep:r,secondStep:s}=e,c=t.getNow(),l=fC(t.getHour(c),t.getMinute(c),t.getSecond(c),i.value?n:1,a.value?r:1,o.value?s:1),u=uC(t,c,l[0],l[1],l[2]);O(u,`submit`)},M=J(()=>{let{prefixCls:t,direction:n}=e;return K(`${t}-panel`,{[`${t}-panel-has-range`]:m&&m.value&&m.value[0]&&m.value[1],[`${t}-panel-has-range-hover`]:h&&h.value&&h.value[0]&&h.value[1],[`${t}-panel-rtl`]:n===`rtl`})});return aC(Z(Z({},s),{mode:C,hideHeader:J(()=>e.hideHeader===void 0?s.hideHeader?.value:e.hideHeader),hidePrevBtn:J(()=>f.value&&p.value===`right`),hideNextBtn:J(()=>f.value&&p.value===`left`)})),G(()=>e.value,()=>{e.value&&b(e.value)}),()=>{let{prefixCls:t=`ant-picker`,locale:i,generateConfig:a,disabledDate:o,picker:s=`date`,tabindex:l=0,showNow:d,showTime:f,showToday:m,renderExtraFooter:h,onMousedown:v,onOk:b,components:S}=e;c&&p.value!==`right`&&(c.value={onKeydown:k,onClose:()=>{g.value&&g.value.onClose&&g.value.onClose()}});let w,E=Z(Z(Z({},n),e),{operationRef:g,prefixCls:t,viewDate:y.value,value:_.value,onViewDateChange:x,sourceMode:T.value,onPanelChange:D,disabledDate:o});switch(delete E.onChange,delete E.onSelect,C.value){case`decade`:w=U(kC,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`year`:w=U(Dw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`month`:w=U(yw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`quarter`:w=U(Cw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`week`:w=U(hw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`time`:delete E.showTime,w=U(rw,Y(Y(Y({},E),typeof f==`object`?f:null),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;default:w=U(f?mw:fw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null)}let N,P;u?.value||(N=Ow(t,C.value,h),P=kw({prefixCls:t,components:S,needConfirmButton:r.value,okDisabled:!_.value||o&&o(_.value),locale:i,showNow:d,onNow:r.value&&j,onOk:()=>{_.value&&(O(_.value,`submit`,!0),b&&b(_.value))}}));let F;if(m&&C.value===`date`&&s===`date`&&!f){let e=a.getNow(),n=`${t}-today-btn`,r=o&&o(e);F=U(`a`,{class:K(n,r&&`${n}-disabled`),"aria-disabled":r,onClick:()=>{r||O(e,`mouse`,!0)}},[i.today])}return U(`div`,{tabindex:l,class:K(M.value,n.class),style:n.style,onKeydown:k,onBlur:A,onMousedown:v},[w,N||P||F?U(`div`,{class:`${t}-footer`},[N,P,F]):null])}}})}var jw=Aw(),Mw=(e=>U(jw,e)),Nw={bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function Pw(e,t){let{slots:n}=t,{prefixCls:r,popupStyle:i,visible:a,dropdownClassName:o,dropdownAlign:s,transitionName:c,getPopupContainer:l,range:u,popupPlacement:d,direction:f}=rC(e),p=`${r}-dropdown`;return U(Su,{showAction:[],hideAction:[],popupPlacement:d===void 0?f===`rtl`?`bottomRight`:`bottomLeft`:d,builtinPlacements:Nw,prefixCls:p,popupTransitionName:c,popupAlign:s,popupVisible:a,popupClassName:K(o,{[`${p}-range`]:u,[`${p}-rtl`]:f===`rtl`}),popupStyle:i,getPopupContainer:l},{default:n.default,popup:n.popupElement})}var Fw=u({name:`PresetPanel`,props:{prefixCls:String,presets:{type:Array,default:()=>[]},onClick:Function,onHover:Function},setup(e){return()=>e.presets.length?U(`div`,{class:`${e.prefixCls}-presets`},[U(`ul`,null,[e.presets.map((t,n)=>{let{label:r,value:i}=t;return U(`li`,{key:n,onClick:t=>{t.stopPropagation(),e.onClick(i)},onMouseenter:()=>{var t;(t=e.onHover)==null||t.call(e,i)},onMouseleave:()=>{var t;(t=e.onHover)==null||t.call(e,null)}},[r])})])]):null}});function Iw(e){let{open:t,value:n,isClickOutside:r,triggerOpen:i,forwardKeydown:a,onKeydown:o,blurToCancel:s,onSubmit:c,onCancel:l,onFocus:u,onBlur:d}=e,f=q(!1),p=q(!1),m=q(!1),h=q(!1),g=q(!1),_=J(()=>({onMousedown:()=>{f.value=!0,i(!0)},onKeydown:e=>{if(o(e,()=>{g.value=!0}),!g.value){switch(e.which){case $.ENTER:t.value?c()!==!1&&(f.value=!0):i(!0),e.preventDefault();return;case $.TAB:f.value&&t.value&&!e.shiftKey?(f.value=!1,e.preventDefault()):!f.value&&t.value&&!a(e)&&e.shiftKey&&(f.value=!0,e.preventDefault());return;case $.ESC:f.value=!0,l();return}!t.value&&![$.SHIFT].includes(e.which)?i(!0):f.value||a(e)}},onFocus:e=>{f.value=!0,p.value=!0,u&&u(e)},onBlur:e=>{if(m.value||!r(document.activeElement)){m.value=!1;return}s.value?setTimeout(()=>{let{activeElement:e}=document;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;r(e)&&l()},0):t.value&&(i(!1),h.value&&c()),p.value=!1,d&&d(e)}}));G(t,()=>{h.value=!1}),G(n,()=>{h.value=!0});let v=q();return V(()=>{v.value=TC(e=>{let n=EC(e);if(t.value){let e=r(n);e?(!p.value||e)&&i(!1):(m.value=!0,ir(()=>{m.value=!1}))}})}),ut(()=>{v.value&&v.value()}),[_,{focused:p,typing:f}]}function Lw(e){let{valueTexts:t,onTextChange:n}=e,r=H(``);function i(e){r.value=e,n(e)}function a(){r.value=t.value[0]}return G(()=>[...t.value],function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];e.join(`||`)!==n.join(`||`)&&t.value.every(e=>e!==r.value)&&a()},{immediate:!0}),[r,i,a]}function Rw(e,t){let{formatList:n,generateConfig:r,locale:i}=t,a=Wd(()=>{if(!e.value)return[[``],``];let t=``,a=[];for(let o=0;ot[0]!==e[0]||!wx(t[1],e[1]));return[J(()=>a.value[0]),J(()=>a.value[1])]}function zw(e,t){let{formatList:n,generateConfig:r,locale:i}=t,a=H(null),o;function s(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(ir.cancel(o),t){a.value=e;return}o=ir(()=>{a.value=e})}let[,c]=Rw(a,{formatList:n,generateConfig:r,locale:i});function l(e){s(e)}function u(){s(null,arguments.length>0&&arguments[0]!==void 0&&arguments[0])}return G(e,()=>{u(!0)}),ut(()=>{ir.cancel(o)}),[c,l,u]}function Bw(e,t){return J(()=>e?.value?e.value:t?.value?(br(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.keys(t.value).map(e=>{let n=t.value[e];return{label:e,value:typeof n==`function`?n():n}})):[])}function Vw(){return u({name:`Picker`,inheritAttrs:!1,props:`prefixCls.id.tabindex.dropdownClassName.dropdownAlign.popupStyle.transitionName.generateConfig.locale.inputReadOnly.allowClear.autofocus.showTime.showNow.showHour.showMinute.showSecond.picker.format.use12Hours.value.defaultValue.open.defaultOpen.defaultOpenValue.suffixIcon.presets.clearIcon.disabled.disabledDate.placeholder.getPopupContainer.panelRender.inputRender.onChange.onOpenChange.onPanelChange.onFocus.onBlur.onMousedown.onMouseup.onMouseenter.onMouseleave.onContextmenu.onClick.onKeydown.onSelect.direction.autocomplete.showToday.renderExtraFooter.dateRender.minuteStep.hourStep.secondStep.hideDisabledOptions`.split(`.`),setup(e,t){let{attrs:n,expose:r}=t,i=H(null),a=Bw(J(()=>e.presets)),o=J(()=>e.picker??`date`),s=J(()=>o.value===`date`&&!!e.showTime||o.value===`time`),c=J(()=>XC(xC(e.format,o.value,e.showTime,e.use12Hours))),l=H(null),u=H(null),d=H(null),[f,p]=df(null,{value:St(e,`value`),defaultValue:e.defaultValue}),m=H(f.value),h=e=>{m.value=e},g=H(null),[_,v]=df(!1,{value:St(e,`open`),defaultValue:e.defaultOpen,postState:t=>!e.disabled&&t,onChange:t=>{e.onOpenChange&&e.onOpenChange(t),!t&&g.value&&g.value.onClose&&g.value.onClose()}}),[y,b]=Rw(m,{formatList:c,generateConfig:St(e,`generateConfig`),locale:St(e,`locale`)}),[x,S,C]=Lw({valueTexts:y,onTextChange:t=>{let n=WC(t,{locale:e.locale,formatList:c.value,generateConfig:e.generateConfig});n&&(!e.disabledDate||!e.disabledDate(n))&&h(n)}}),w=t=>{let{onChange:n,generateConfig:r,locale:i}=e;h(t),p(t),n&&!zC(r,f.value,t)&&n(t,t?UC(t,{generateConfig:r,locale:i,format:c.value[0]}):``)},T=t=>{e.disabled&&t||v(t)},E=e=>_.value&&g.value&&g.value.onKeydown?g.value.onKeydown(e):!1,D=function(){e.onMouseup&&e.onMouseup(...arguments),i.value&&(i.value.focus(),T(!0))},[O,{focused:k,typing:A}]=Iw({blurToCancel:s,open:_,value:x,triggerOpen:T,forwardKeydown:E,isClickOutside:e=>!OC([l.value,u.value,d.value],e),onSubmit:()=>!m.value||e.disabledDate&&e.disabledDate(m.value)?!1:(w(m.value),T(!1),C(),!0),onCancel:()=>{T(!1),h(f.value),C()},onKeydown:(t,n)=>{var r;(r=e.onKeydown)==null||r.call(e,t,n)},onFocus:t=>{var n;(n=e.onFocus)==null||n.call(e,t)},onBlur:t=>{var n;(n=e.onBlur)==null||n.call(e,t)}});G([_,y],()=>{_.value||(h(f.value),!y.value.length||y.value[0]===``?S(``):b.value!==x.value&&C())}),G(o,()=>{_.value||C()}),G(f,()=>{h(f.value)});let[j,M,N]=zw(x,{formatList:c,generateConfig:St(e,`generateConfig`),locale:St(e,`locale`)});return aC({operationRef:g,hideHeader:J(()=>o.value===`time`),onSelect:(e,t)=>{(t===`submit`||t!==`key`&&!s.value)&&(w(e),T(!1))},open:_,defaultOpenValue:St(e,`defaultOpenValue`),onDateMouseenter:M,onDateMouseleave:N}),r({focus:()=>{i.value&&i.value.focus()},blur:()=>{i.value&&i.value.blur()}}),()=>{let{prefixCls:t=`rc-picker`,id:r,tabindex:o,dropdownClassName:s,dropdownAlign:p,popupStyle:g,transitionName:v,generateConfig:y,locale:b,inputReadOnly:C,allowClear:E,autofocus:M,picker:P=`date`,defaultOpenValue:F,suffixIcon:I,clearIcon:L,disabled:ee,placeholder:te,getPopupContainer:ne,panelRender:R,onMousedown:re,onMouseenter:ie,onMouseleave:ae,onContextmenu:oe,onClick:z,onSelect:se,direction:B,autocomplete:V=`off`}=e,ce=Z(Z(Z({},e),n),{class:K({[`${t}-panel-focused`]:!A.value}),style:void 0,pickerValue:void 0,onPickerValueChange:void 0,onChange:null}),le=U(`div`,{class:`${t}-panel-layout`},[U(Fw,{prefixCls:t,presets:a.value,onClick:e=>{w(e),T(!1)}},null),U(Mw,Y(Y({},ce),{},{generateConfig:y,value:m.value,locale:b,tabindex:-1,onSelect:e=>{se?.(e),h(e)},direction:B,onPanelChange:(t,n)=>{let{onPanelChange:r}=e;N(!0),r?.(t,n)}}),null)]);R&&(le=R(le));let H=U(`div`,{class:`${t}-panel-container`,ref:l,onMousedown:e=>{e.preventDefault()}},[le]),ue;I&&(ue=U(`span`,{class:`${t}-suffix`},[I]));let de;E&&f.value&&!ee&&(de=U(`span`,{onMousedown:e=>{e.preventDefault(),e.stopPropagation()},onMouseup:e=>{e.preventDefault(),e.stopPropagation(),w(null),T(!1)},class:`${t}-clear`,role:`button`},[L||U(`span`,{class:`${t}-clear-btn`},null)]));let fe=Z(Z(Z(Z({id:r,tabindex:o,disabled:ee,readonly:C||typeof c.value[0]==`function`||!A.value,value:j.value||x.value,onInput:e=>{S(e.target.value)},autofocus:M,placeholder:te,ref:i,title:x.value},O.value),{size:SC(P,c.value[0],y)}),ZC(e)),{autocomplete:V}),pe=e.inputRender?e.inputRender(fe):U(`input`,fe,null),me=B===`rtl`?`bottomRight`:`bottomLeft`;return U(`div`,{ref:d,class:K(t,n.class,{[`${t}-disabled`]:ee,[`${t}-focused`]:k.value,[`${t}-rtl`]:B===`rtl`}),style:n.style,onMousedown:re,onMouseup:D,onMouseenter:ie,onMouseleave:ae,onContextmenu:oe,onClick:z},[U(`div`,{class:K(`${t}-input`,{[`${t}-input-placeholder`]:!!j.value}),ref:u},[pe,ue,de]),U(Pw,{visible:_.value,popupStyle:g,prefixCls:t,dropdownClassName:s,dropdownAlign:p,getPopupContainer:ne,transitionName:v,popupPlacement:me,direction:B},{default:()=>[U(`div`,{style:{pointerEvents:`none`,position:`absolute`,top:0,bottom:0,left:0,right:0}},null)],popupElement:()=>H})])}}})}var Hw=Vw();function Uw(e,t){let{picker:n,locale:r,selectedValue:i,disabledDate:a,disabled:o,generateConfig:s}=e,c=J(()=>QC(i.value,0)),l=J(()=>QC(i.value,1));function u(e){return s.value.locale.getWeekFirstDate(r.value.locale,e)}function d(e){let t=s.value.getYear(e),n=s.value.getMonth(e);return t*100+n}function f(e){let t=s.value.getYear(e),n=NC(s.value,e);return t*10+n}return[e=>{if(a&&(a?.value)?.call(a,e))return!0;if(o[1]&&l)return!IC(s.value,e,l.value)&&s.value.isAfter(e,l.value);if(t.value[1]&&l.value)switch(n.value){case`quarter`:return f(e)>f(l.value);case`month`:return d(e)>d(l.value);case`week`:return u(e)>u(l.value);default:return!IC(s.value,e,l.value)&&s.value.isAfter(e,l.value)}return!1},e=>{if(a.value?.call(a,e))return!0;if(o[0]&&c)return!IC(s.value,e,l.value)&&s.value.isAfter(c.value,e);if(t.value[0]&&c.value)switch(n.value){case`quarter`:return f(e)jC(r,e,t));case`quarter`:case`month`:return a((e,t)=>MC(r,e,t));default:return a((e,t)=>FC(r,e,t))}}function Gw(e,t,n,r){let i=QC(e,0),a=QC(e,1);if(t===0)return i;if(i&&a)switch(Ww(i,a,n,r)){case`same`:return i;case`closing`:return i;default:return HC(a,n,r,-1)}return i}function Kw(e){let{values:t,picker:n,defaultDates:r,generateConfig:i}=e,a=H([QC(r,0),QC(r,1)]),o=H(null),s=J(()=>QC(t.value,0)),c=J(()=>QC(t.value,1)),l=e=>a.value[e]?a.value[e]:QC(o.value,e)||Gw(t.value,e,n.value,i.value)||s.value||c.value||i.value.getNow(),u=H(null),d=H(null);S(()=>{u.value=l(0),d.value=l(1)});function f(e,n){if(e){let r=$C(o.value,e,n);a.value=$C(a.value,null,n)||[null,null];let i=(n+1)%2;QC(t.value,i)||(r=$C(r,e,i)),o.value=r}else(s.value||c.value)&&(o.value=null)}return[u,d,f]}function qw(e){return j()?(De(e),!0):!1}function Jw(e){return typeof e==`function`?e():ze(e)}function Yw(e){let t=Jw(e);return t?.$el??t}function Xw(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Zt()?V(e):t?e():z(e)}function Zw(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=q(),r=()=>n.value=!!e();return r(),Xw(r,t),n}var Qw=typeof window<`u`;Qw&&(window==null?void 0:window.navigator)?.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);var $w=Qw?window:void 0;Qw&&window.document,Qw&&window.navigator,Qw&&window.location;var eT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i2&&arguments[2]!==void 0?arguments[2]:{},{window:r=$w}=n,i=eT(n,[`window`]),a,o=Zw(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=G(()=>Yw(e),e=>{s(),o.value&&r&&e&&(a=new ResizeObserver(t),a.observe(e,i))},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return qw(l),{isSupported:o,stop:l}}function nT(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{width:0,height:0},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{box:r=`content-box`}=n,i=q(t.width),a=q(t.height);return tT(e,e=>{let[t]=e,n=r===`border-box`?t.borderBoxSize:r===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;n?(i.value=n.reduce((e,t)=>{let{inlineSize:n}=t;return e+n},0),a.value=n.reduce((e,t)=>{let{blockSize:n}=t;return e+n},0)):(i.value=t.contentRect.width,a.value=t.contentRect.height)},n),G(()=>Yw(e),e=>{i.value=e?t.width:0,a.value=e?t.height:0}),{width:i,height:a}}function rT(e,t){return e&&e[0]&&e[1]&&t.isAfter(e[0],e[1])?[e[1],e[0]]:e}function iT(e,t,n,r){return!!(e||r&&r[t]||n[(t+1)%2])}function aT(){return u({name:`RangerPicker`,inheritAttrs:!1,props:`prefixCls.id.popupStyle.dropdownClassName.transitionName.dropdownAlign.getPopupContainer.generateConfig.locale.placeholder.autofocus.disabled.format.picker.showTime.showNow.showHour.showMinute.showSecond.use12Hours.separator.value.defaultValue.defaultPickerValue.open.defaultOpen.disabledDate.disabledTime.dateRender.panelRender.ranges.allowEmpty.allowClear.suffixIcon.clearIcon.pickerRef.inputReadOnly.mode.renderExtraFooter.onChange.onOpenChange.onPanelChange.onCalendarChange.onFocus.onBlur.onMousedown.onMouseup.onMouseenter.onMouseleave.onClick.onOk.onKeydown.components.order.direction.activePickerIndex.autocomplete.minuteStep.hourStep.secondStep.hideDisabledOptions.disabledMinutes.presets.prevIcon.nextIcon.superPrevIcon.superNextIcon`.split(`.`),setup(e,t){let{attrs:n,expose:r}=t,i=J(()=>e.picker===`date`&&!!e.showTime||e.picker===`time`),a=Bw(J(()=>e.presets),J(()=>e.ranges)),o=H({}),s=H(null),c=H(null),l=H(null),u=H(null),d=H(null),f=H(null),p=H(null),m=H(null),h=J(()=>XC(xC(e.format,e.picker,e.showTime,e.use12Hours))),[g,_]=df(0,{value:St(e,`activePickerIndex`)}),v=H(null),y=J(()=>{let{disabled:t}=e;return Array.isArray(t)?t:[t||!1,t||!1]}),[b,x]=df(null,{value:St(e,`value`),defaultValue:e.defaultValue,postState:t=>e.picker===`time`&&!e.order?t:rT(t,e.generateConfig)}),[S,C,w]=Kw({values:b,picker:St(e,`picker`),defaultDates:e.defaultPickerValue,generateConfig:St(e,`generateConfig`)}),[T,E]=df(b.value,{postState:t=>{let n=t;if(y.value[0]&&y.value[1])return n;for(let t=0;t<2;t+=1)y.value[t]&&!QC(n,t)&&!QC(e.allowEmpty,t)&&(n=$C(n,e.generateConfig.getNow(),t));return n}}),[D,O]=df([e.picker,e.picker],{value:St(e,`mode`)});G(()=>e.picker,()=>{O([e.picker,e.picker])});let k=(t,n)=>{var r;O(t),(r=e.onPanelChange)==null||r.call(e,n,t)},[A,j]=Uw({picker:St(e,`picker`),selectedValue:T,locale:St(e,`locale`),disabled:y,disabledDate:St(e,`disabledDate`),generateConfig:St(e,`generateConfig`)},o),[M,N]=df(!1,{value:St(e,`open`),defaultValue:e.defaultOpen,postState:e=>!y.value[g.value]&&e,onChange:t=>{var n;(n=e.onOpenChange)==null||n.call(e,t),!t&&v.value&&v.value.onClose&&v.value.onClose()}}),P=J(()=>M.value&&g.value===0),F=J(()=>M.value&&g.value===1),I=H(0),L=H(0),ee=H(0),{width:te}=nT(s);G([M,te],()=>{!M.value&&s.value&&(ee.value=te.value)});let{width:ne}=nT(c),{width:R}=nT(m),{width:re}=nT(l),{width:ie}=nT(d);G([g,M,ne,R,re,ie,()=>e.direction],()=>{L.value=0,g.value?l.value&&d.value&&(L.value=re.value+ie.value,ne.value&&R.value&&L.value>ne.value-R.value-(e.direction===`rtl`||m.value.offsetLeft>L.value?0:m.value.offsetLeft)&&(I.value=L.value)):g.value===0&&(I.value=0)},{immediate:!0});let ae=H();function oe(e,t){if(e)clearTimeout(ae.value),o.value[t]=!0,_(t),N(e),M.value||w(null,t);else if(g.value===t){N(e);let t=o.value;ae.value=setTimeout(()=>{t===o.value&&(o.value={})})}}function z(e){oe(!0,e),setTimeout(()=>{let t=[f,p][e];t.value&&t.value.focus()},0)}function se(t,n){let r=t,i=QC(r,0),a=QC(r,1),{generateConfig:s,locale:c,picker:l,order:u,onCalendarChange:d,allowEmpty:f,onChange:p,showTime:m}=e;i&&a&&s.isAfter(i,a)&&(l===`week`&&!RC(s,c.locale,i,a)||l===`quarter`&&!PC(s,i,a)||l!==`week`&&l!==`quarter`&&l!==`time`&&!(m?zC(s,i,a):IC(s,i,a))?(n===0?(r=[i,null],a=null):(i=null,r=[null,a]),o.value={[n]:!0}):(l!==`time`||u!==!1)&&(r=rT(r,s))),E(r);let _=r&&r[0]?UC(r[0],{generateConfig:s,locale:c,format:h.value[0]}):``,v=r&&r[1]?UC(r[1],{generateConfig:s,locale:c,format:h.value[0]}):``;d&&d(r,[_,v],{range:n===0?`start`:`end`});let S=iT(i,0,y.value,f),C=iT(a,1,y.value,f);(r===null||S&&C)&&(x(r),p&&(!zC(s,QC(b.value,0),i)||!zC(s,QC(b.value,1),a))&&p(r,[_,v]));let w=null;n===0&&!y.value[1]?w=1:n===1&&!y.value[0]&&(w=0),w!==null&&w!==g.value&&(!o.value[w]||!QC(r,w))&&QC(r,n)?z(w):oe(!1,n)}let B=e=>M&&v.value&&v.value.onKeydown?v.value.onKeydown(e):!1,V={formatList:h,generateConfig:St(e,`generateConfig`),locale:St(e,`locale`)},[ce,le]=Rw(J(()=>QC(T.value,0)),V),[ue,de]=Rw(J(()=>QC(T.value,1)),V),fe=(t,n)=>{let r=WC(t,{locale:e.locale,formatList:h.value,generateConfig:e.generateConfig});r&&!(n===0?A:j)(r)&&(E($C(T.value,r,n)),w(r,n))},[pe,me,he]=Lw({valueTexts:ce,onTextChange:e=>fe(e,0)}),[ge,_e,W]=Lw({valueTexts:ue,onTextChange:e=>fe(e,1)}),[ve,ye]=ff(null),[be,xe]=ff(null),[Se,Ce,we]=zw(pe,V),[Te,Ee,De]=zw(ge,V),Oe=e=>{xe($C(T.value,e,g.value)),g.value===0?Ce(e):Ee(e)},ke=()=>{xe($C(T.value,null,g.value)),g.value===0?we():De()},Ae=(t,n)=>({forwardKeydown:B,onBlur:t=>{var n;(n=e.onBlur)==null||n.call(e,t)},isClickOutside:e=>!OC([c.value,l.value,u.value,s.value],e),onFocus:n=>{var r;_(t),(r=e.onFocus)==null||r.call(e,n)},triggerOpen:e=>{oe(e,t)},onSubmit:()=>{if(!T.value||e.disabledDate&&e.disabledDate(T.value[t]))return!1;se(T.value,t),n()},onCancel:()=>{oe(!1,t),E(b.value),n()}}),[je,{focused:Me,typing:Ne}]=Iw(Z(Z({},Ae(0,he)),{blurToCancel:i,open:P,value:pe,onKeydown:(t,n)=>{var r;(r=e.onKeydown)==null||r.call(e,t,n)}})),[Pe,{focused:Fe,typing:Ie}]=Iw(Z(Z({},Ae(1,W)),{blurToCancel:i,open:F,value:ge,onKeydown:(t,n)=>{var r;(r=e.onKeydown)==null||r.call(e,t,n)}})),Le=t=>{var n;(n=e.onClick)==null||n.call(e,t),!M.value&&!f.value.contains(t.target)&&!p.value.contains(t.target)&&(y.value[0]?y.value[1]||z(1):z(0))},Re=t=>{var n;(n=e.onMousedown)==null||n.call(e,t),M.value&&(Me.value||Fe.value)&&!f.value.contains(t.target)&&!p.value.contains(t.target)&&t.preventDefault()},ze=J(()=>b.value?.[0]?UC(b.value[0],{locale:e.locale,format:`YYYYMMDDHHmmss`,generateConfig:e.generateConfig}):``),Be=J(()=>b.value?.[1]?UC(b.value[1],{locale:e.locale,format:`YYYYMMDDHHmmss`,generateConfig:e.generateConfig}):``);G([M,ce,ue],()=>{M.value||(E(b.value),!ce.value.length||ce.value[0]===``?me(``):le.value!==pe.value&&he(),!ue.value.length||ue.value[0]===``?_e(``):de.value!==ge.value&&W())}),G([ze,Be],()=>{E(b.value)}),r({focus:()=>{f.value&&f.value.focus()},blur:()=>{f.value&&f.value.blur(),p.value&&p.value.blur()}});let Ve=J(()=>M.value&&be.value&&be.value[0]&&be.value[1]&&e.generateConfig.isAfter(be.value[1],be.value[0])?be.value:null);function He(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{generateConfig:r,showTime:i,dateRender:a,direction:o,disabledTime:s,prefixCls:c,locale:l}=e,u=i;if(i&&typeof i==`object`&&i.defaultValue){let e=i.defaultValue;u=Z(Z({},i),{defaultValue:QC(e,g.value)||void 0})}let d=null;return a&&(d=e=>{let{current:t,today:n}=e;return a({current:t,today:n,info:{range:g.value?`end`:`start`}})}),U(cw,{value:{inRange:!0,panelPosition:t,rangedValue:ve.value||T.value,hoverRangedValue:Ve.value}},{default:()=>[U(Mw,Y(Y(Y({},e),n),{},{dateRender:d,showTime:u,mode:D.value[g.value],generateConfig:r,style:void 0,direction:o,disabledDate:g.value===0?A:j,disabledTime:e=>s?s(e,g.value===0?`start`:`end`):!1,class:K({[`${c}-panel-focused`]:g.value===0?!Ne.value:!Ie.value}),value:QC(T.value,g.value),locale:l,tabIndex:-1,onPanelChange:(e,n)=>{g.value===0&&we(!0),g.value===1&&De(!0),k($C(D.value,n,g.value),$C(T.value,e,g.value));let i=e;t===`right`&&D.value[g.value]===n&&(i=HC(i,n,r,-1)),w(i,g.value)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:g.value===0?QC(T.value,1):QC(T.value,0)}),null)]})}return aC({operationRef:v,hideHeader:J(()=>e.picker===`time`),onDateMouseenter:Oe,onDateMouseleave:ke,hideRanges:J(()=>!0),onSelect:(e,t)=>{let n=$C(T.value,e,g.value);t===`submit`||t!==`key`&&!i.value?(se(n,g.value),g.value===0?we():De()):E(n)},open:M}),()=>{let{prefixCls:t=`rc-picker`,id:r,popupStyle:o,dropdownClassName:_,transitionName:v,dropdownAlign:x,getPopupContainer:E,generateConfig:O,locale:k,placeholder:A,autofocus:j,picker:N=`date`,showTime:P,separator:F=`~`,disabledDate:te,panelRender:ne,allowClear:R,suffixIcon:re,clearIcon:ie,inputReadOnly:ae,renderExtraFooter:z,onMouseenter:B,onMouseleave:V,onMouseup:ce,onOk:le,components:H,direction:ue,autocomplete:de=`off`}=e,fe=ue===`rtl`?{right:`${L.value}px`}:{left:`${L.value}px`};function he(){let e,n=Ow(t,D.value[g.value],z),r=kw({prefixCls:t,components:H,needConfirmButton:i.value,okDisabled:!QC(T.value,g.value)||te&&te(T.value[g.value]),locale:k,onOk:()=>{QC(T.value,g.value)&&(se(T.value,g.value),le&&le(T.value))}});if(N!==`time`&&!P){let t=g.value===0?S.value:C.value,n=HC(t,N,O),r=D.value[g.value]===N,i=He(r?`left`:!1,{pickerValue:t,onPickerValueChange:e=>{w(e,g.value)}}),a=He(`right`,{pickerValue:n,onPickerValueChange:e=>{w(HC(e,N,O,-1),g.value)}});e=ue===`rtl`?U($e,null,[a,r&&i]):U($e,null,[i,r&&a])}else e=He();let o=U(`div`,{class:`${t}-panel-layout`},[U(Fw,{prefixCls:t,presets:a.value,onClick:e=>{se(e,null),oe(!1,g.value)},onHover:e=>{ye(e)}},null),U(`div`,null,[U(`div`,{class:`${t}-panels`},[e]),(n||r)&&U(`div`,{class:`${t}-footer`},[n,r])])]);return ne&&(o=ne(o)),U(`div`,{class:`${t}-panel-container`,style:{marginLeft:`${I.value}px`},ref:c,onMousedown:e=>{e.preventDefault()}},[o])}let W=U(`div`,{class:K(`${t}-range-wrapper`,`${t}-${N}-range-wrapper`),style:{minWidth:`${ee.value}px`}},[U(`div`,{ref:m,class:`${t}-range-arrow`,style:fe},null),he()]),ve;re&&(ve=U(`span`,{class:`${t}-suffix`},[re]));let be;R&&(QC(b.value,0)&&!y.value[0]||QC(b.value,1)&&!y.value[1])&&(be=U(`span`,{onMousedown:e=>{e.preventDefault(),e.stopPropagation()},onMouseup:e=>{e.preventDefault(),e.stopPropagation();let t=b.value;y.value[0]||(t=$C(t,null,0)),y.value[1]||(t=$C(t,null,1)),se(t,null),oe(!1,g.value)},class:`${t}-clear`},[ie||U(`span`,{class:`${t}-clear-btn`},null)]));let xe={size:SC(N,h.value[0],O)},Ce=0,we=0;l.value&&u.value&&d.value&&(g.value===0?we=l.value.offsetWidth:(Ce=L.value,we=u.value.offsetWidth));let G=ue===`rtl`?{right:`${Ce}px`}:{left:`${Ce}px`};return U(`div`,Y({ref:s,class:K(t,`${t}-range`,n.class,{[`${t}-disabled`]:y.value[0]&&y.value[1],[`${t}-focused`]:g.value===0?Me.value:Fe.value,[`${t}-rtl`]:ue===`rtl`}),style:n.style,onClick:Le,onMouseenter:B,onMouseleave:V,onMousedown:Re,onMouseup:ce},ZC(e)),[U(`div`,{class:K(`${t}-input`,{[`${t}-input-active`]:g.value===0,[`${t}-input-placeholder`]:!!Se.value}),ref:l},[U(`input`,Y(Y(Y({id:r,disabled:y.value[0],readonly:ae||typeof h.value[0]==`function`||!Ne.value,value:Se.value||pe.value,onInput:e=>{me(e.target.value)},autofocus:j,placeholder:QC(A,0)||``,ref:f},je.value),xe),{},{autocomplete:de}),null)]),U(`div`,{class:`${t}-range-separator`,ref:d},[F]),U(`div`,{class:K(`${t}-input`,{[`${t}-input-active`]:g.value===1,[`${t}-input-placeholder`]:!!Te.value}),ref:u},[U(`input`,Y(Y(Y({disabled:y.value[1],readonly:ae||typeof h.value[0]==`function`||!Ie.value,value:Te.value||ge.value,onInput:e=>{_e(e.target.value)},placeholder:QC(A,1)||``,ref:p},Pe.value),xe),{},{autocomplete:de}),null)]),U(`div`,{class:`${t}-active-bar`,style:Z(Z({},G),{width:`${we}px`,position:`absolute`})},null),ve,be,U(Pw,{visible:M.value,popupStyle:o,prefixCls:t,dropdownClassName:_,dropdownAlign:x,getPopupContainer:E,transitionName:v,range:!0,direction:ue},{default:()=>[U(`div`,{style:{pointerEvents:`none`,position:`absolute`,top:0,bottom:0,left:0,right:0}},null)],popupElement:()=>W})])}}})}var oT=aT(),sT=Hw,cT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.checked,()=>{a.value=e.checked}),i({focus(){var e;(e=o.value)==null||e.focus()},blur(){var e;(e=o.value)==null||e.blur()}});let s=H(),c=t=>{if(e.disabled)return;e.checked===void 0&&(a.value=t.target.checked),t.shiftKey=s.value;let n={target:Z(Z({},e),{checked:t.target.checked}),stopPropagation(){t.stopPropagation()},preventDefault(){t.preventDefault()},nativeEvent:t};e.checked!==void 0&&(o.value.checked=!!e.checked),r(`change`,n),s.value=!1},l=e=>{r(`click`,e),s.value=e.shiftKey};return()=>{let{prefixCls:t,name:r,id:i,type:s,disabled:u,readonly:d,tabindex:f,autofocus:p,value:m,required:h}=e,g=cT(e,[`prefixCls`,`name`,`id`,`type`,`disabled`,`readonly`,`tabindex`,`autofocus`,`value`,`required`]),{class:_,onFocus:v,onBlur:y,onKeydown:b,onKeypress:x,onKeyup:S}=n,C=Z(Z({},g),n),w=Object.keys(C).reduce((e,t)=>((t.startsWith(`data-`)||t.startsWith(`aria-`)||t===`role`)&&(e[t]=C[t]),e),{}),T=K(t,_,{[`${t}-checked`]:a.value,[`${t}-disabled`]:u}),E=Z(Z({name:r,id:i,type:s,readonly:d,disabled:u,tabindex:f,class:`${t}-input`,checked:!!a.value,autofocus:p,value:m},w),{onChange:c,onClick:l,onFocus:v,onBlur:y,onKeydown:b,onKeypress:x,onKeyup:S,required:h});return U(`span`,{class:T},[U(`input`,Y({ref:o},E),null),U(`span`,{class:`${t}-inner`},null)])}}}),uT=Symbol(`radioGroupContextKey`),dT=e=>{fe(uT,e)},fT=()=>g(uT,void 0),pT=Symbol(`radioOptionTypeContextKey`),mT=e=>{fe(pT,e)},hT=()=>g(pT,void 0),gT=new N(`antRadioEffect`,{"0%":{transform:`scale(1)`,opacity:.5},"100%":{transform:`scale(1.6)`,opacity:0}}),_T=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-group`;return{[r]:Z(Z({},rn(e)),{display:`inline-block`,fontSize:0,[`&${r}-rtl`]:{direction:`rtl`},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:`none`}})}},vT=e=>{let{componentCls:t,radioWrapperMarginRight:n,radioCheckedColor:r,radioSize:i,motionDurationSlow:a,motionDurationMid:o,motionEaseInOut:s,motionEaseInOutCirc:c,radioButtonBg:l,colorBorder:u,lineWidth:d,radioDotSize:f,colorBgContainerDisabled:p,colorTextDisabled:m,paddingXS:h,radioDotDisabledColor:g,lineType:_,radioDotDisabledSize:v,wireframe:y,colorWhite:b}=e,x=`${t}-inner`;return{[`${t}-wrapper`]:Z(Z({},rn(e)),{position:`relative`,display:`inline-flex`,alignItems:`baseline`,marginInlineStart:0,marginInlineEnd:n,cursor:`pointer`,[`&${t}-wrapper-rtl`]:{direction:`rtl`},"&-disabled":{cursor:`not-allowed`,color:e.colorTextDisabled},"&::after":{display:`inline-block`,width:0,overflow:`hidden`,content:`"\\a0"`},[`${t}-checked::after`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:`100%`,height:`100%`,border:`${d}px ${_} ${r}`,borderRadius:`50%`,visibility:`hidden`,animationName:gT,animationDuration:a,animationTimingFunction:s,animationFillMode:`both`,content:`""`},[t]:Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,outline:`none`,cursor:`pointer`,alignSelf:`center`}),[`${t}-wrapper:hover &, + &:hover ${x}`]:{borderColor:r},[`${t}-input:focus-visible + ${x}`]:Z({},I(e)),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:`visible`},[`${t}-inner`]:{"&::after":{boxSizing:`border-box`,position:`absolute`,insetBlockStart:`50%`,insetInlineStart:`50%`,display:`block`,width:i,height:i,marginBlockStart:i/-2,marginInlineStart:i/-2,backgroundColor:y?r:b,borderBlockStart:0,borderInlineStart:0,borderRadius:i,transform:`scale(0)`,opacity:0,transition:`all ${a} ${c}`,content:`""`},boxSizing:`border-box`,position:`relative`,insetBlockStart:0,insetInlineStart:0,display:`block`,width:i,height:i,backgroundColor:l,borderColor:u,borderStyle:`solid`,borderWidth:d,borderRadius:`50%`,transition:`all ${o}`},[`${t}-input`]:{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:`pointer`,opacity:0},[`${t}-checked`]:{[x]:{borderColor:r,backgroundColor:y?l:r,"&::after":{transform:`scale(${f/i})`,opacity:1,transition:`all ${a} ${c}`}}},[`${t}-disabled`]:{cursor:`not-allowed`,[x]:{backgroundColor:p,borderColor:u,cursor:`not-allowed`,"&::after":{backgroundColor:g}},[`${t}-input`]:{cursor:`not-allowed`},[`${t}-disabled + span`]:{color:m,cursor:`not-allowed`},[`&${t}-checked`]:{[x]:{"&::after":{transform:`scale(${v/i})`}}}},[`span${t} + *`]:{paddingInlineStart:h,paddingInlineEnd:h}})}},yT=e=>{let{radioButtonColor:t,controlHeight:n,componentCls:r,lineWidth:i,lineType:a,colorBorder:o,motionDurationSlow:s,motionDurationMid:c,radioButtonPaddingHorizontal:l,fontSize:u,radioButtonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:m,paddingXS:h,borderRadius:g,borderRadiusSM:_,borderRadiusLG:v,radioCheckedColor:y,radioButtonCheckedBg:b,radioButtonHoverColor:x,radioButtonActiveColor:S,radioSolidCheckedColor:C,colorTextDisabled:w,colorBgContainerDisabled:T,radioDisabledButtonCheckedColor:E,radioDisabledButtonCheckedBg:D}=e;return{[`${r}-button-wrapper`]:{position:`relative`,display:`inline-block`,height:n,margin:0,paddingInline:l,paddingBlock:0,color:t,fontSize:u,lineHeight:`${n-i*2}px`,background:d,border:`${i}px ${a} ${o}`,borderBlockStartWidth:i+.02,borderInlineStartWidth:0,borderInlineEndWidth:i,cursor:`pointer`,transition:[`color ${c}`,`background ${c}`,`border-color ${c}`,`box-shadow ${c}`].join(`,`),a:{color:t},[`> ${r}-button`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:`100%`,height:`100%`},"&:not(:first-child)":{"&::before":{position:`absolute`,insetBlockStart:-i,insetInlineStart:-i,display:`block`,boxSizing:`content-box`,width:1,height:`100%`,paddingBlock:i,paddingInline:0,backgroundColor:o,transition:`background-color ${s}`,content:`""`}},"&:first-child":{borderInlineStart:`${i}px ${a} ${o}`,borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},[`${r}-group-large &`]:{height:p,fontSize:f,lineHeight:`${p-i*2}px`,"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},[`${r}-group-small &`]:{height:m,paddingInline:h-i,paddingBlock:0,lineHeight:`${m-i*2}px`,"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},"&:hover":{position:`relative`,color:y},"&:has(:focus-visible)":Z({},I(e)),[`${r}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:`none`},[`&-checked:not(${r}-button-wrapper-disabled)`]:{zIndex:1,color:y,background:b,borderColor:y,"&::before":{backgroundColor:y},"&:first-child":{borderColor:y},"&:hover":{color:x,borderColor:x,"&::before":{backgroundColor:x}},"&:active":{color:S,borderColor:S,"&::before":{backgroundColor:S}}},[`${r}-group-solid &-checked:not(${r}-button-wrapper-disabled)`]:{color:C,background:y,borderColor:y,"&:hover":{color:C,background:x,borderColor:x},"&:active":{color:C,background:S,borderColor:S}},"&-disabled":{color:w,backgroundColor:T,borderColor:o,cursor:`not-allowed`,"&:first-child, &:hover":{color:w,backgroundColor:T,borderColor:o}},[`&-disabled${r}-button-wrapper-checked`]:{color:E,backgroundColor:D,borderColor:o,boxShadow:`none`}}}},bT=v(`Radio`,e=>{let{padding:t,lineWidth:n,controlItemBgActiveDisabled:r,colorTextDisabled:i,colorBgContainer:a,fontSizeLG:o,controlOutline:s,colorPrimaryHover:c,colorPrimaryActive:l,colorText:u,colorPrimary:d,marginXS:f,controlOutlineWidth:p,colorTextLightSolid:m,wireframe:h}=e,g=`0 0 0 ${p}px ${s}`,_=g,v=o,y=v-8,b=B(e,{radioFocusShadow:g,radioButtonFocusShadow:_,radioSize:v,radioDotSize:h?y:v-(4+n)*2,radioDotDisabledSize:y,radioCheckedColor:d,radioDotDisabledColor:i,radioSolidCheckedColor:m,radioButtonBg:a,radioButtonCheckedBg:a,radioButtonColor:u,radioButtonHoverColor:c,radioButtonActiveColor:l,radioButtonPaddingHorizontal:t-n,radioDisabledButtonCheckedBg:r,radioDisabledButtonCheckedColor:i,radioWrapperMarginRight:f});return[_T(b),vT(b),yT(b)]}),xT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({prefixCls:String,checked:Q(),disabled:Q(),isGroup:Q(),value:f.any,name:String,id:String,autofocus:Q(),onChange:d(),onFocus:d(),onBlur:d(),onClick:d(),"onUpdate:checked":d(),"onUpdate:value":d()}),CT=u({compatConfig:{MODE:3},name:`ARadio`,inheritAttrs:!1,props:ST(),setup(e,t){let{emit:n,expose:r,slots:i,attrs:a}=t,o=zf(),s=Vf.useInject(),c=hT(),l=fT(),u=at(),d=J(()=>h.value??u.value),f=H(),{prefixCls:p,direction:m,disabled:h}=X(`radio`,e),g=J(()=>l?.optionType.value===`button`||c===`button`?`${p.value}-button`:p.value),_=at(),[v,y]=bT(p);r({focus:()=>{f.value.focus()},blur:()=>{f.value.blur()}});let b=e=>{let t=e.target.checked;n(`update:checked`,t),n(`update:value`,t),n(`change`,e),o.onFieldChange()},x=e=>{n(`change`,e),l&&l.onChange&&l.onChange(e)};return()=>{let t=l,{prefixCls:n,id:r=o.id.value}=e,c=xT(e,[`prefixCls`,`id`]),u=Z(Z({prefixCls:g.value,id:r},Br(c,[`onUpdate:checked`,`onUpdate:value`])),{disabled:h.value??_.value});t?(u.name=t.name.value,u.onChange=x,u.checked=e.value===t.value.value,u.disabled=d.value||t.disabled.value):u.onChange=b;let p=K({[`${g.value}-wrapper`]:!0,[`${g.value}-wrapper-checked`]:u.checked,[`${g.value}-wrapper-disabled`]:u.disabled,[`${g.value}-wrapper-rtl`]:m.value===`rtl`,[`${g.value}-wrapper-in-form-item`]:s.isFormItemInput},a.class,y.value);return v(U(`label`,Y(Y({},a),{},{class:p}),[U(lT,Y(Y({},u),{},{type:`radio`,ref:f}),null),i.default&&U(`span`,null,[i.default()])]))}}}),wT=u({compatConfig:{MODE:3},name:`ARadioGroup`,inheritAttrs:!1,props:{prefixCls:String,value:f.any,size:_(),options:Ue(),disabled:Q(),name:String,buttonStyle:_(`outline`),id:String,optionType:_(`default`),onChange:d(),"onUpdate:value":d()},setup(e,t){let{slots:n,emit:r,attrs:i}=t,a=zf(),{prefixCls:o,direction:s,size:c}=X(`radio`,e),[l,u]=bT(o),d=H(e.value),f=H(!1);return G(()=>e.value,e=>{d.value=e,f.value=!1}),dT({onChange:t=>{let n=d.value,{value:i}=t.target;`value`in e||(d.value=i),!f.value&&i!==n&&(f.value=!0,r(`update:value`,i),r(`change`,t),a.onFieldChange()),z(()=>{f.value=!1})},value:d,disabled:J(()=>e.disabled),name:J(()=>e.name),optionType:J(()=>e.optionType)}),()=>{let{options:t,buttonStyle:r,id:f=a.id.value}=e,p=`${o.value}-group`,m=K(p,`${p}-${r}`,{[`${p}-${c.value}`]:c.value,[`${p}-rtl`]:s.value===`rtl`},i.class,u.value),h=null;return h=t&&t.length>0?t.map(t=>{if(typeof t==`string`||typeof t==`number`)return U(CT,{key:t,prefixCls:o.value,disabled:e.disabled,value:t,checked:d.value===t},{default:()=>[t]});let{value:n,disabled:r,label:i}=t;return U(CT,{key:`radio-group-value-options-${n}`,prefixCls:o.value,disabled:r||e.disabled,value:n,checked:d.value===n},{default:()=>[i]})}):n.default?.call(n),l(U(`div`,Y(Y({},i),{},{class:m,id:f}),[h]))}}}),TT=u({compatConfig:{MODE:3},name:`ARadioButton`,inheritAttrs:!1,props:ST(),setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i}=X(`radio`,e);return mT(`button`),()=>U(CT,Y(Y(Y({},r),e),{},{prefixCls:i.value}),{default:()=>[n.default?.call(n)]})}});CT.Group=wT,CT.Button=TT,CT.install=function(e){return e.component(CT.name,CT),e.component(CT.Group.name,CT.Group),e.component(CT.Button.name,CT.Button),e};var ET=CT,DT=10,OT=20;function kT(e){let{fullscreen:t,validRange:n,generateConfig:r,locale:i,prefixCls:a,value:o,onChange:s,divRef:c}=e,l=r.getYear(o||r.getNow()),u=l-DT,d=u+OT;n&&(u=r.getYear(n[0]),d=r.getYear(n[1])+1);let f=i&&i.year===`年`?`年`:``,p=[];for(let e=u;e{let t=r.setYear(o,e);if(n){let[e,i]=n,a=r.getYear(t),o=r.getMonth(t);a===r.getYear(i)&&o>r.getMonth(i)&&(t=r.setMonth(t,r.getMonth(i))),a===r.getYear(e)&&oc.value},null)}kT.inheritAttrs=!1;function AT(e){let{prefixCls:t,fullscreen:n,validRange:r,value:i,generateConfig:a,locale:o,onChange:s,divRef:c}=e,l=a.getMonth(i||a.getNow()),u=0,d=11;if(r){let[e,t]=r,n=a.getYear(i);a.getYear(t)===n&&(d=a.getMonth(t)),a.getYear(e)===n&&(u=a.getMonth(e))}let f=o.shortMonths||a.locale.getShortMonths(o.locale),p=[];for(let e=u;e<=d;e+=1)p.push({label:f[e],value:e});return U(yv,{size:n?void 0:`small`,class:`${t}-month-select`,value:l,options:p,onChange:e=>{s(a.setMonth(i,e))},getPopupContainer:()=>c.value},null)}AT.inheritAttrs=!1;function jT(e){let{prefixCls:t,locale:n,mode:r,fullscreen:i,onModeChange:a}=e;return U(wT,{onChange:e=>{let{target:{value:t}}=e;a(t)},value:r,size:i?void 0:`small`,class:`${t}-mode-switch`},{default:()=>[U(TT,{value:`month`},{default:()=>[n.month]}),U(TT,{value:`year`},{default:()=>[n.year]})]})}jT.inheritAttrs=!1;var MT=u({name:`CalendarHeader`,inheritAttrs:!1,props:[`mode`,`prefixCls`,`value`,`validRange`,`generateConfig`,`locale`,`mode`,`fullscreen`],setup(e,t){let{attrs:n}=t,r=H(null),i=Vf.useInject();return Vf.useProvide(i,{isFormItemInput:!1}),()=>{let t=Z(Z({},e),n),{prefixCls:i,fullscreen:a,mode:o,onChange:s,onModeChange:c}=t,l=Z(Z({},t),{fullscreen:a,divRef:r});return U(`div`,{class:`${i}-header`,ref:r},[U(kT,Y(Y({},l),{},{onChange:e=>{s(e,`year`)}}),null),o===`month`&&U(AT,Y(Y({},l),{},{onChange:e=>{s(e,`month`)}}),null),U(jT,Y(Y({},l),{},{onModeChange:c}),null)])}}}),NT=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:`none`},"&:placeholder-shown":{textOverflow:`ellipsis`}}),PT=e=>({borderColor:e.inputBorderHoverColor,borderInlineEndWidth:e.lineWidth}),FT=e=>({borderColor:e.inputBorderHoverColor,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`,borderInlineEndWidth:e.lineWidth,outline:0}),IT=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:`none`,cursor:`not-allowed`,opacity:1,"&:hover":Z({},PT(B(e,{inputBorderHoverColor:e.colorBorder})))}),LT=e=>{let{inputPaddingVerticalLG:t,fontSizeLG:n,lineHeightLG:r,borderRadiusLG:i,inputPaddingHorizontalLG:a}=e;return{padding:`${t}px ${a}px`,fontSize:n,lineHeight:r,borderRadius:i}},RT=e=>({padding:`${e.inputPaddingVerticalSM}px ${e.controlPaddingHorizontalSM-1}px`,borderRadius:e.borderRadiusSM}),zT=(e,t)=>{let{componentCls:n,colorError:r,colorWarning:i,colorErrorOutline:a,colorWarningOutline:o,colorErrorBorderHover:s,colorWarningBorderHover:c}=e;return{[`&-status-error:not(${t}-disabled):not(${t}-borderless)${t}`]:{borderColor:r,"&:hover":{borderColor:s},"&:focus, &-focused":Z({},FT(B(e,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:a}))),[`${n}-prefix`]:{color:r}},[`&-status-warning:not(${t}-disabled):not(${t}-borderless)${t}`]:{borderColor:i,"&:hover":{borderColor:c},"&:focus, &-focused":Z({},FT(B(e,{inputBorderActiveColor:i,inputBorderHoverColor:i,controlOutline:o}))),[`${n}-prefix`]:{color:i}}}},BT=e=>Z(Z({position:`relative`,display:`inline-block`,width:`100%`,minWidth:0,padding:`${e.inputPaddingVertical}px ${e.inputPaddingHorizontal}px`,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,backgroundColor:e.colorBgContainer,backgroundImage:`none`,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:e.colorBorder,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},NT(e.colorTextPlaceholder)),{"&:hover":Z({},PT(e)),"&:focus, &-focused":Z({},FT(e)),"&-disabled, &[disabled]":Z({},IT(e)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:`transparent`,border:`none`,boxShadow:`none`}},"textarea&":{maxWidth:`100%`,height:`auto`,minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:`bottom`,transition:`all ${e.motionDurationSlow}, height 0s`,resize:`vertical`},"&-lg":Z({},LT(e)),"&-sm":Z({},RT(e)),"&-rtl":{direction:`rtl`},"&-textarea-rtl":{direction:`rtl`}}),VT=e=>{let{componentCls:t,antCls:n}=e;return{position:`relative`,display:`table`,width:`100%`,borderCollapse:`separate`,borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Z({},LT(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Z({},RT(e)),[`> ${t}`]:{display:`table-cell`,"&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:`table-cell`,width:1,whiteSpace:`nowrap`,verticalAlign:`middle`,"&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:`block !important`},"&-addon":{position:`relative`,padding:`0 ${e.inputPaddingHorizontal}px`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,textAlign:`center`,backgroundColor:e.colorFillAlter,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`-${e.inputPaddingVertical+1}px -${e.inputPaddingHorizontal}px`,[`&${n}-select-single:not(${n}-select-customize-input)`]:{[`${n}-select-selector`]:{backgroundColor:`inherit`,border:`${e.lineWidth}px ${e.lineType} transparent`,boxShadow:`none`}},"&-open, &-focused":{[`${n}-select-selector`]:{color:e.colorPrimary}}},[`${n}-cascader-picker`]:{margin:`-9px -${e.inputPaddingHorizontal}px`,backgroundColor:`transparent`,[`${n}-cascader-input`]:{textAlign:`start`,border:0,boxShadow:`none`}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${t}`]:{float:`inline-start`,width:`100%`,marginBottom:0,textAlign:`inherit`,"&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Z(Z({display:`block`},D()),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:`inline-block`,float:`none`,verticalAlign:`top`,borderRadius:0},[`& > ${t}-affix-wrapper`]:{display:`inline-flex`},[`& > ${n}-picker-range`]:{display:`inline-flex`},"& > *:not(:last-child)":{marginInlineEnd:-e.lineWidth,borderInlineEndWidth:e.lineWidth},[`${t}`]:{float:`none`},[`& > ${n}-select > ${n}-select-selector, + & > ${n}-select-auto-complete ${t}, + & > ${n}-cascader-picker ${t}, + & > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child, + & > ${n}-select:first-child > ${n}-select-selector, + & > ${n}-select-auto-complete:first-child ${t}, + & > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child, + & > ${n}-select:last-child > ${n}-select-selector, + & > ${n}-cascader-picker:last-child ${t}, + & > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:`top`},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:-e.lineWidth,[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}}),[`&&-sm ${n}-btn`]:{fontSize:e.fontSizeSM,height:e.controlHeightSM,lineHeight:`normal`},[`&&-lg ${n}-btn`]:{fontSize:e.fontSizeLG,height:e.controlHeightLG,lineHeight:`normal`},[`&&-lg ${n}-select-single ${n}-select-selector`]:{height:`${e.controlHeightLG}px`,[`${n}-select-selection-item, ${n}-select-selection-placeholder`]:{lineHeight:`${e.controlHeightLG-2}px`},[`${n}-select-selection-search-input`]:{height:`${e.controlHeightLG}px`}},[`&&-sm ${n}-select-single ${n}-select-selector`]:{height:`${e.controlHeightSM}px`,[`${n}-select-selection-item, ${n}-select-selection-placeholder`]:{lineHeight:`${e.controlHeightSM-2}px`},[`${n}-select-selection-search-input`]:{height:`${e.controlHeightSM}px`}}}},HT=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r}=e,i=(n-r*2-16)/2;return{[t]:Z(Z(Z(Z({},rn(e)),BT(e)),zT(e,t)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:i,paddingBottom:i}}})}},UT=e=>{let{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:`hidden`},"&-has-suffix":{margin:`0 ${e.inputAffixPadding}px`}},"&-textarea-with-clear-btn":{padding:`0 !important`,border:`0 !important`,[`${t}-clear-icon`]:{position:`absolute`,insetBlockStart:e.paddingXS,insetInlineEnd:e.paddingXS,zIndex:1}}}},WT=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e;return{[`${t}-affix-wrapper`]:Z(Z(Z(Z(Z({},BT(e)),{display:`inline-flex`,[`&:not(${t}-affix-wrapper-disabled):hover`]:Z(Z({},PT(e)),{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${t}[disabled]`]:{background:`transparent`}},[`> input${t}`]:{padding:0,fontSize:`inherit`,border:`none`,borderRadius:0,outline:`none`,"&:focus":{boxShadow:`none !important`}},"&::before":{width:0,visibility:`hidden`,content:`"\\a0"`},[`${t}`]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,"> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),UT(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:`pointer`,transition:`all ${i}`,"&:hover":{color:o}}}),zT(e,`${t}-affix-wrapper`))}},GT=e=>{let{componentCls:t,colorError:n,colorSuccess:r,borderRadiusLG:i,borderRadiusSM:a}=e;return{[`${t}-group`]:Z(Z(Z({},rn(e)),VT(e)),{"&-rtl":{direction:`rtl`},"&-wrapper":{display:`inline-block`,width:`100%`,textAlign:`start`,verticalAlign:`top`,"&-rtl":{direction:`rtl`},"&-lg":{[`${t}-group-addon`]:{borderRadius:i}},"&-sm":{[`${t}-group-addon`]:{borderRadius:a}},"&-status-error":{[`${t}-group-addon`]:{color:n,borderColor:n}},"&-status-warning":{[`${t}-group-addon:last-child`]:{color:r,borderColor:r}}}})}},KT=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[`${t}`]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,[`+ ${t}-group-addon ${r}-button:not(${n}-btn-primary)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{borderRadius:0},[`${t}-lg`]:{lineHeight:e.lineHeightLG-2e-4},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0},[`${r}-button:not(${n}-btn-primary)`]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${r}-button`]:{height:e.controlHeightLG},[`&-small ${r}-button`]:{height:e.controlHeightSM},"&-rtl":{direction:`rtl`},[`&${t}-compact-item`]:{[`&:not(${t}-compact-last-item)`]:{[`${t}-group-addon`]:{[`${t}-search-button`]:{marginInlineEnd:-e.lineWidth,borderRadius:0}}},[`&:not(${t}-compact-first-item)`]:{[`${t},${t}-affix-wrapper`]:{borderRadius:0}},[`> ${t}-group-addon ${t}-search-button, + > ${t}, + ${t}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}};function qT(e){return B(e,{inputAffixPadding:e.paddingXXS,inputPaddingVertical:Math.max(Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2*10)/10-e.lineWidth,3),inputPaddingVerticalLG:Math.ceil((e.controlHeightLG-e.fontSizeLG*e.lineHeightLG)/2*10)/10-e.lineWidth,inputPaddingVerticalSM:Math.max(Math.round((e.controlHeightSM-e.fontSize*e.lineHeight)/2*10)/10-e.lineWidth,0),inputPaddingHorizontal:e.paddingSM-e.lineWidth,inputPaddingHorizontalSM:e.paddingXS-e.lineWidth,inputPaddingHorizontalLG:e.controlPaddingHorizontal-e.lineWidth,inputBorderHoverColor:e.colorPrimaryHover,inputBorderActiveColor:e.colorPrimaryHover})}var JT=e=>{let{componentCls:t,inputPaddingHorizontal:n,paddingLG:r}=e,i=`${t}-textarea`;return{[i]:{position:`relative`,[`${i}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:n,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`},"&-status-error,\n &-status-warning,\n &-status-success,\n &-status-validating":{[`&${i}-has-feedback`]:{[`${t}`]:{paddingInlineEnd:r}}},"&-show-count":{[`> ${t}`]:{height:`100%`},"&::after":{color:e.colorTextDescription,whiteSpace:`nowrap`,content:`attr(data-count)`,pointerEvents:`none`,float:`right`}},"&-rtl":{"&::after":{float:`left`}}}}},YT=v(`Input`,e=>{let t=qT(e);return[HT(t),JT(t),WT(t),GT(t),KT(t),uv(t)]}),XT=(e,t,n,r)=>{let{lineHeight:i}=e,a=Math.floor(n*i)+2,o=Math.max((t-a)/2,0);return{padding:`${o}px ${r}px ${Math.max(t-a-o,0)}px`}},ZT=e=>{let{componentCls:t,pickerCellCls:n,pickerCellInnerCls:r,pickerPanelCellHeight:i,motionDurationSlow:a,borderRadiusSM:o,motionDurationMid:s,controlItemBgHover:c,lineWidth:l,lineType:u,colorPrimary:d,controlItemBgActive:f,colorTextLightSolid:p,controlHeightSM:m,pickerDateHoverRangeBorderColor:h,pickerCellBorderGap:g,pickerBasicCellHoverWithRangeColor:_,pickerPanelCellWidth:v,colorTextDisabled:y,colorBgContainerDisabled:b}=e;return{"&::before":{position:`absolute`,top:`50%`,insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:i,transform:`translateY(-50%)`,transition:`all ${a}`,content:`""`},[r]:{position:`relative`,zIndex:2,display:`inline-block`,minWidth:i,height:i,lineHeight:`${i}px`,borderRadius:o,transition:`background ${s}, border ${s}`},[`&:hover:not(${n}-in-view), + &:hover:not(${n}-selected):not(${n}-range-start):not(${n}-range-end):not(${n}-range-hover-start):not(${n}-range-hover-end)`]:{[r]:{background:c}},[`&-in-view${n}-today ${r}`]:{"&::before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${l}px ${u} ${d}`,borderRadius:o,content:`""`}},[`&-in-view${n}-in-range`]:{position:`relative`,"&::before":{background:f}},[`&-in-view${n}-selected ${r}, + &-in-view${n}-range-start ${r}, + &-in-view${n}-range-end ${r}`]:{color:p,background:d},[`&-in-view${n}-range-start:not(${n}-range-start-single), + &-in-view${n}-range-end:not(${n}-range-end-single)`]:{"&::before":{background:f}},[`&-in-view${n}-range-start::before`]:{insetInlineStart:`50%`},[`&-in-view${n}-range-end::before`]:{insetInlineEnd:`50%`},[`&-in-view${n}-range-hover-start:not(${n}-in-range):not(${n}-range-start):not(${n}-range-end), + &-in-view${n}-range-hover-end:not(${n}-in-range):not(${n}-range-start):not(${n}-range-end), + &-in-view${n}-range-hover-start${n}-range-start-single, + &-in-view${n}-range-hover-start${n}-range-start${n}-range-end${n}-range-end-near-hover, + &-in-view${n}-range-hover-end${n}-range-start${n}-range-end${n}-range-start-near-hover, + &-in-view${n}-range-hover-end${n}-range-end-single, + &-in-view${n}-range-hover:not(${n}-in-range)`]:{"&::after":{position:`absolute`,top:`50%`,zIndex:0,height:m,borderTop:`${l}px dashed ${h}`,borderBottom:`${l}px dashed ${h}`,transform:`translateY(-50%)`,transition:`all ${a}`,content:`""`}},"&-range-hover-start::after,\n &-range-hover-end::after,\n &-range-hover::after":{insetInlineEnd:0,insetInlineStart:g},[`&-in-view${n}-in-range${n}-range-hover::before, + &-in-view${n}-range-start${n}-range-hover::before, + &-in-view${n}-range-end${n}-range-hover::before, + &-in-view${n}-range-start:not(${n}-range-start-single)${n}-range-hover-start::before, + &-in-view${n}-range-end:not(${n}-range-end-single)${n}-range-hover-end::before, + ${t}-panel + > :not(${t}-date-panel) + &-in-view${n}-in-range${n}-range-hover-start::before, + ${t}-panel + > :not(${t}-date-panel) + &-in-view${n}-in-range${n}-range-hover-end::before`]:{background:_},[`&-in-view${n}-range-start:not(${n}-range-start-single):not(${n}-range-end) ${r}`]:{borderStartStartRadius:o,borderEndStartRadius:o,borderStartEndRadius:0,borderEndEndRadius:0},[`&-in-view${n}-range-end:not(${n}-range-end-single):not(${n}-range-start) ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o},[`&-range-hover${n}-range-end::after`]:{insetInlineStart:`50%`},[`tr > &-in-view${n}-range-hover:first-child::after, + tr > &-in-view${n}-range-hover-end:first-child::after, + &-in-view${n}-start${n}-range-hover-edge-start${n}-range-hover-edge-start-near-range::after, + &-in-view${n}-range-hover-edge-start:not(${n}-range-hover-edge-start-near-range)::after, + &-in-view${n}-range-hover-start::after`]:{insetInlineStart:(v-i)/2,borderInlineStart:`${l}px dashed ${h}`,borderStartStartRadius:l,borderEndStartRadius:l},[`tr > &-in-view${n}-range-hover:last-child::after, + tr > &-in-view${n}-range-hover-start:last-child::after, + &-in-view${n}-end${n}-range-hover-edge-end${n}-range-hover-edge-end-near-range::after, + &-in-view${n}-range-hover-edge-end:not(${n}-range-hover-edge-end-near-range)::after, + &-in-view${n}-range-hover-end::after`]:{insetInlineEnd:(v-i)/2,borderInlineEnd:`${l}px dashed ${h}`,borderStartEndRadius:l,borderEndEndRadius:l},"&-disabled":{color:y,pointerEvents:`none`,[r]:{background:`transparent`},"&::before":{background:b}},[`&-disabled${n}-today ${r}::before`]:{borderColor:y}}},QT=e=>{let{componentCls:t,pickerCellInnerCls:n,pickerYearMonthCellWidth:r,pickerControlIconSize:i,pickerPanelCellWidth:a,paddingSM:o,paddingXS:s,paddingXXS:c,colorBgContainer:l,lineWidth:u,lineType:d,borderRadiusLG:f,colorPrimary:p,colorTextHeading:m,colorSplit:h,pickerControlIconBorderWidth:g,colorIcon:_,pickerTextHeight:v,motionDurationMid:y,colorIconHover:b,fontWeightStrong:x,pickerPanelCellHeight:S,pickerCellPaddingVertical:C,colorTextDisabled:w,colorText:T,fontSize:E,pickerBasicCellHoverWithRangeColor:D,motionDurationSlow:O,pickerPanelWithoutTimeCellHeight:k,pickerQuarterPanelContentHeight:A,colorLink:j,colorLinkActive:M,colorLinkHover:N,pickerDateHoverRangeBorderColor:P,borderRadiusSM:F,colorTextLightSolid:I,borderRadius:L,controlItemBgHover:ee,pickerTimePanelColumnHeight:te,pickerTimePanelColumnWidth:ne,pickerTimePanelCellHeight:R,controlItemBgActive:re,marginXXS:ie}=e,ae=a*7+o*2+4,oe=(ae-s*2)/3-r-o;return{[t]:{"&-panel":{display:`inline-flex`,flexDirection:`column`,textAlign:`center`,background:l,border:`${u}px ${d} ${h}`,borderRadius:f,outline:`none`,"&-focused":{borderColor:p},"&-rtl":{direction:`rtl`,[`${t}-prev-icon, + ${t}-super-prev-icon`]:{transform:`rotate(45deg)`},[`${t}-next-icon, + ${t}-super-next-icon`]:{transform:`rotate(-135deg)`}}},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel,\n &-week-panel,\n &-date-panel,\n &-time-panel":{display:`flex`,flexDirection:`column`,width:ae},"&-header":{display:`flex`,padding:`0 ${s}px`,color:m,borderBottom:`${u}px ${d} ${h}`,"> *":{flex:`none`},button:{padding:0,color:_,lineHeight:`${v}px`,background:`transparent`,border:0,cursor:`pointer`,transition:`color ${y}`},"> button":{minWidth:`1.6em`,fontSize:E,"&:hover":{color:b}},"&-view":{flex:`auto`,fontWeight:x,lineHeight:`${v}px`,button:{color:`inherit`,fontWeight:`inherit`,verticalAlign:`top`,"&:not(:first-child)":{marginInlineStart:s},"&:hover":{color:p}}}},"&-prev-icon,\n &-next-icon,\n &-super-prev-icon,\n &-super-next-icon":{position:`relative`,display:`inline-block`,width:i,height:i,"&::before":{position:`absolute`,top:0,insetInlineStart:0,display:`inline-block`,width:i,height:i,border:`0 solid currentcolor`,borderBlockStartWidth:g,borderBlockEndWidth:0,borderInlineStartWidth:g,borderInlineEndWidth:0,content:`""`}},"&-super-prev-icon,\n &-super-next-icon":{"&::after":{position:`absolute`,top:Math.ceil(i/2),insetInlineStart:Math.ceil(i/2),display:`inline-block`,width:i,height:i,border:`0 solid currentcolor`,borderBlockStartWidth:g,borderBlockEndWidth:0,borderInlineStartWidth:g,borderInlineEndWidth:0,content:`""`}},"&-prev-icon,\n &-super-prev-icon":{transform:`rotate(-45deg)`},"&-next-icon,\n &-super-next-icon":{transform:`rotate(135deg)`},"&-content":{width:`100%`,tableLayout:`fixed`,borderCollapse:`collapse`,"th, td":{position:`relative`,minWidth:S,fontWeight:`normal`},th:{height:S+C*2,color:T,verticalAlign:`middle`}},"&-cell":Z({padding:`${C}px 0`,color:w,cursor:`pointer`,"&-in-view":{color:T}},ZT(e)),[`&-date-panel ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-start ${n}, + &-date-panel ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-end ${n}`]:{"&::after":{position:`absolute`,top:0,bottom:0,zIndex:-1,background:D,transition:`all ${O}`,content:`""`}},[`&-date-panel + ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-start + ${n}::after`]:{insetInlineEnd:-(a-S)/2,insetInlineStart:0},[`&-date-panel ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-end ${n}::after`]:{insetInlineEnd:0,insetInlineStart:-(a-S)/2},[`&-range-hover${t}-range-start::after`]:{insetInlineEnd:`50%`},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${t}-content`]:{height:k*4},[n]:{padding:`0 ${s}px`}},"&-quarter-panel":{[`${t}-content`]:{height:A}},[`&-panel ${t}-footer`]:{borderTop:`${u}px ${d} ${h}`},"&-footer":{width:`min-content`,minWidth:`100%`,lineHeight:`${v-2*u}px`,textAlign:`center`,"&-extra":{padding:`0 ${o}`,lineHeight:`${v-2*u}px`,textAlign:`start`,"&:not(:last-child)":{borderBottom:`${u}px ${d} ${h}`}}},"&-now":{textAlign:`start`},"&-today-btn":{color:j,"&:hover":{color:N},"&:active":{color:M},[`&${t}-today-btn-disabled`]:{color:w,cursor:`not-allowed`}},"&-decade-panel":{[n]:{padding:`0 ${s/2}px`},[`${t}-cell::before`]:{display:`none`}},"&-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${t}-body`]:{padding:`0 ${s}px`},[n]:{width:r},[`${t}-cell-range-hover-start::after`]:{insetInlineStart:oe,borderInlineStart:`${u}px dashed ${P}`,borderStartStartRadius:F,borderBottomStartRadius:F,borderStartEndRadius:0,borderBottomEndRadius:0,[`${t}-panel-rtl &`]:{insetInlineEnd:oe,borderInlineEnd:`${u}px dashed ${P}`,borderStartStartRadius:0,borderBottomStartRadius:0,borderStartEndRadius:F,borderBottomEndRadius:F}},[`${t}-cell-range-hover-end::after`]:{insetInlineEnd:oe,borderInlineEnd:`${u}px dashed ${P}`,borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:L,borderEndEndRadius:L,[`${t}-panel-rtl &`]:{insetInlineStart:oe,borderInlineStart:`${u}px dashed ${P}`,borderStartStartRadius:L,borderEndStartRadius:L,borderStartEndRadius:0,borderEndEndRadius:0}}},"&-week-panel":{[`${t}-body`]:{padding:`${s}px ${o}px`},[`${t}-cell`]:{[`&:hover ${n}, + &-selected ${n}, + ${n}`]:{background:`transparent !important`}},"&-row":{td:{transition:`background ${y}`,"&:first-child":{borderStartStartRadius:F,borderEndStartRadius:F},"&:last-child":{borderStartEndRadius:F,borderEndEndRadius:F}},"&:hover td":{background:ee},"&-selected td,\n &-selected:hover td":{background:p,[`&${t}-cell-week`]:{color:new we(I).setAlpha(.5).toHexString()},[`&${t}-cell-today ${n}::before`]:{borderColor:I},[n]:{color:I}}}},"&-date-panel":{[`${t}-body`]:{padding:`${s}px ${o}px`},[`${t}-content`]:{width:a*7,th:{width:a}}},"&-datetime-panel":{display:`flex`,[`${t}-time-panel`]:{borderInlineStart:`${u}px ${d} ${h}`},[`${t}-date-panel, + ${t}-time-panel`]:{transition:`opacity ${O}`},"&-active":{[`${t}-date-panel, + ${t}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:`auto`,minWidth:`auto`,direction:`ltr`,[`${t}-content`]:{display:`flex`,flex:`auto`,height:te},"&-column":{flex:`1 0 auto`,width:ne,margin:`${c}px 0`,padding:0,overflowY:`hidden`,textAlign:`start`,listStyle:`none`,transition:`background ${y}`,overflowX:`hidden`,"&::after":{display:`block`,height:te-R,content:`""`},"&:not(:first-child)":{borderInlineStart:`${u}px ${d} ${h}`},"&-active":{background:new we(re).setAlpha(.2).toHexString()},"&:hover":{overflowY:`auto`},"> li":{margin:0,padding:0,[`&${t}-time-panel-cell`]:{marginInline:ie,[`${t}-time-panel-cell-inner`]:{display:`block`,width:ne-2*ie,height:R,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:(ne-R)/2,color:T,lineHeight:`${R}px`,borderRadius:F,cursor:`pointer`,transition:`background ${y}`,"&:hover":{background:ee}},"&-selected":{[`${t}-time-panel-cell-inner`]:{background:re}},"&-disabled":{[`${t}-time-panel-cell-inner`]:{color:w,background:`transparent`,cursor:`not-allowed`}}}}}},[`&-datetime-panel ${t}-time-panel-column:after`]:{height:te-R+c*2}}}},$T=e=>{let{componentCls:t,colorBgContainer:n,colorError:r,colorErrorOutline:i,colorWarning:a,colorWarningOutline:o}=e;return{[t]:{[`&-status-error${t}`]:{"&, &:not([disabled]):hover":{backgroundColor:n,borderColor:r},"&-focused, &:focus":Z({},FT(B(e,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:i}))),[`${t}-active-bar`]:{background:r}},[`&-status-warning${t}`]:{"&, &:not([disabled]):hover":{backgroundColor:n,borderColor:a},"&-focused, &:focus":Z({},FT(B(e,{inputBorderActiveColor:a,inputBorderHoverColor:a,controlOutline:o}))),[`${t}-active-bar`]:{background:a}}}}},eE=e=>{let{componentCls:t,antCls:n,boxShadowPopoverArrow:r,controlHeight:i,fontSize:a,inputPaddingHorizontal:o,colorBgContainer:s,lineWidth:c,lineType:l,colorBorder:u,borderRadius:d,motionDurationMid:f,colorBgContainerDisabled:p,colorTextDisabled:m,colorTextPlaceholder:h,controlHeightLG:g,fontSizeLG:_,controlHeightSM:v,inputPaddingHorizontalSM:y,paddingXS:b,marginXS:x,colorTextDescription:S,lineWidthBold:C,lineHeight:w,colorPrimary:T,motionDurationSlow:E,zIndexPopup:D,paddingXXS:O,paddingSM:k,pickerTextHeight:A,controlItemBgActive:j,colorPrimaryBorder:M,sizePopupArrow:N,borderRadiusXS:P,borderRadiusOuter:F,colorBgElevated:I,borderRadiusLG:L,boxShadowSecondary:ee,borderRadiusSM:te,colorSplit:ne,controlItemBgHover:R,presetsWidth:re,presetsMaxWidth:ie}=e;return[{[t]:Z(Z(Z({},rn(e)),XT(e,i,a,o)),{position:`relative`,display:`inline-flex`,alignItems:`center`,background:s,lineHeight:1,border:`${c}px ${l} ${u}`,borderRadius:d,transition:`border ${f}, box-shadow ${f}`,"&:hover, &-focused":Z({},PT(e)),"&-focused":Z({},FT(e)),[`&${t}-disabled`]:{background:p,borderColor:u,cursor:`not-allowed`,[`${t}-suffix`]:{color:m}},[`&${t}-borderless`]:{backgroundColor:`transparent !important`,borderColor:`transparent !important`,boxShadow:`none !important`},[`${t}-input`]:{position:`relative`,display:`inline-flex`,alignItems:`center`,width:`100%`,"> input":Z(Z({},BT(e)),{flex:`auto`,minWidth:1,height:`auto`,padding:0,background:`transparent`,border:0,"&:focus":{boxShadow:`none`},"&[disabled]":{background:`transparent`}}),"&:hover":{[`${t}-clear`]:{opacity:1}},"&-placeholder":{"> input":{color:h}}},"&-large":Z(Z({},XT(e,g,_,o)),{[`${t}-input > input`]:{fontSize:_}}),"&-small":Z({},XT(e,v,a,y)),[`${t}-suffix`]:{display:`flex`,flex:`none`,alignSelf:`center`,marginInlineStart:b/2,color:m,lineHeight:1,pointerEvents:`none`,"> *":{verticalAlign:`top`,"&:not(:last-child)":{marginInlineEnd:x}}},[`${t}-clear`]:{position:`absolute`,top:`50%`,insetInlineEnd:0,color:m,lineHeight:1,background:s,transform:`translateY(-50%)`,cursor:`pointer`,opacity:0,transition:`opacity ${f}, color ${f}`,"> *":{verticalAlign:`top`},"&:hover":{color:S}},[`${t}-separator`]:{position:`relative`,display:`inline-block`,width:`1em`,height:_,color:m,fontSize:_,verticalAlign:`top`,cursor:`default`,[`${t}-focused &`]:{color:S},[`${t}-range-separator &`]:{[`${t}-disabled &`]:{cursor:`not-allowed`}}},"&-range":{position:`relative`,display:`inline-flex`,[`${t}-clear`]:{insetInlineEnd:o},"&:hover":{[`${t}-clear`]:{opacity:1}},[`${t}-active-bar`]:{bottom:-c,height:C,marginInlineStart:o,background:T,opacity:0,transition:`all ${E} ease-out`,pointerEvents:`none`},[`&${t}-focused`]:{[`${t}-active-bar`]:{opacity:1}},[`${t}-range-separator`]:{alignItems:`center`,padding:`0 ${b}px`,lineHeight:1},[`&${t}-small`]:{[`${t}-clear`]:{insetInlineEnd:y},[`${t}-active-bar`]:{marginInlineStart:y}}},"&-dropdown":Z(Z(Z({},rn(e)),QT(e)),{position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:D,[`&${t}-dropdown-hidden`]:{display:`none`},[`&${t}-dropdown-placement-bottomLeft`]:{[`${t}-range-arrow`]:{top:0,display:`block`,transform:`translateY(-100%)`}},[`&${t}-dropdown-placement-topLeft`]:{[`${t}-range-arrow`]:{bottom:0,display:`block`,transform:`translateY(100%) rotate(180deg)`}},[`&${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-topLeft, + &${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-topRight, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-topLeft, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-topRight`]:{animationName:j_},[`&${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-bottomLeft, + &${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-bottomRight, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-bottomLeft, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-bottomRight`]:{animationName:k_},[`&${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-topLeft, + &${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-topRight`]:{animationName:M_},[`&${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-bottomLeft, + &${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-bottomRight`]:{animationName:A_},[`${t}-panel > ${t}-time-panel`]:{paddingTop:O},[`${t}-ranges`]:{marginBottom:0,padding:`${O}px ${k}px`,overflow:`hidden`,lineHeight:`${A-2*c-b/2}px`,textAlign:`start`,listStyle:`none`,display:`flex`,justifyContent:`space-between`,"> li":{display:`inline-block`},[`${t}-preset > ${n}-tag-blue`]:{color:T,background:j,borderColor:M,cursor:`pointer`},[`${t}-ok`]:{marginInlineStart:`auto`}},[`${t}-range-wrapper`]:{display:`flex`,position:`relative`},[`${t}-range-arrow`]:Z({position:`absolute`,zIndex:1,display:`none`,marginInlineStart:o*1.5,transition:`left ${E} ease-out`},Rr(N,P,F,I,r)),[`${t}-panel-container`]:{overflow:`hidden`,verticalAlign:`top`,background:I,borderRadius:L,boxShadow:ee,transition:`margin ${E}`,[`${t}-panel-layout`]:{display:`flex`,flexWrap:`nowrap`,alignItems:`stretch`},[`${t}-presets`]:{display:`flex`,flexDirection:`column`,minWidth:re,maxWidth:ie,ul:{height:0,flex:`auto`,listStyle:`none`,overflow:`auto`,margin:0,padding:b,borderInlineEnd:`${c}px ${l} ${ne}`,li:Z(Z({},xe),{borderRadius:te,paddingInline:b,paddingBlock:(v-Math.round(a*w))/2,cursor:`pointer`,transition:`all ${E}`,"+ li":{marginTop:x},"&:hover":{background:R}})}},[`${t}-panels`]:{display:`inline-flex`,flexWrap:`nowrap`,direction:`ltr`,[`${t}-panel`]:{borderWidth:`0 0 ${c}px`},"&:last-child":{[`${t}-panel`]:{borderWidth:0}}},[`${t}-panel`]:{verticalAlign:`top`,background:`transparent`,borderRadius:0,borderWidth:0,[`${t}-content, + table`]:{textAlign:`center`},"&-focused":{borderColor:u}}}}),"&-dropdown-range":{padding:`${N*2/3}px 0`,"&-hidden":{display:`none`}},"&-rtl":{direction:`rtl`,[`${t}-separator`]:{transform:`rotate(180deg)`},[`${t}-footer`]:{"&-extra":{direction:`rtl`}}}})},R_(e,`slide-up`),R_(e,`slide-down`),O_(e,`move-up`),O_(e,`move-down`)]},tE=e=>{let{componentCls:t,controlHeightLG:n,controlHeightSM:r,colorPrimary:i,paddingXXS:a}=e;return{pickerCellCls:`${t}-cell`,pickerCellInnerCls:`${t}-cell-inner`,pickerTextHeight:n,pickerPanelCellWidth:r*1.5,pickerPanelCellHeight:r,pickerDateHoverRangeBorderColor:new we(i).lighten(20).toHexString(),pickerBasicCellHoverWithRangeColor:new we(i).lighten(35).toHexString(),pickerPanelWithoutTimeCellHeight:n*1.65,pickerYearMonthCellWidth:n*1.5,pickerTimePanelColumnHeight:224,pickerTimePanelColumnWidth:n*1.4,pickerTimePanelCellHeight:28,pickerQuarterPanelContentHeight:n*1.4,pickerCellPaddingVertical:a,pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconBorderWidth:1.5}},nE=v(`DatePicker`,e=>{let t=B(qT(e),tE(e));return[eE(t),$T(t),uv(e,{focusElCls:`${e.componentCls}-focused`})]},e=>({presetsWidth:120,presetsMaxWidth:200,zIndexPopup:e.zIndexPopupBase+50})),rE=e=>{let{calendarCls:t,componentCls:n,calendarFullBg:r,calendarFullPanelBg:i,calendarItemActiveBg:a}=e;return{[t]:Z(Z(Z({},QT(e)),rn(e)),{background:r,"&-rtl":{direction:`rtl`},[`${t}-header`]:{display:`flex`,justifyContent:`flex-end`,padding:`${e.paddingSM}px 0`,[`${t}-year-select`]:{minWidth:e.yearControlWidth},[`${t}-month-select`]:{minWidth:e.monthControlWidth,marginInlineStart:e.marginXS},[`${t}-mode-switch`]:{marginInlineStart:e.marginXS}}}),[`${t} ${n}-panel`]:{background:i,border:0,borderTop:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,borderRadius:0,[`${n}-month-panel, ${n}-date-panel`]:{width:`auto`},[`${n}-body`]:{padding:`${e.paddingXS}px 0`},[`${n}-content`]:{width:`100%`}},[`${t}-mini`]:{borderRadius:e.borderRadiusLG,[`${t}-header`]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS},[`${n}-panel`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${n}-content`]:{height:e.miniContentHeight,th:{height:`auto`,padding:0,lineHeight:`${e.weekHeight}px`}},[`${n}-cell::before`]:{pointerEvents:`none`}},[`${t}${t}-full`]:{[`${n}-panel`]:{display:`block`,width:`100%`,textAlign:`end`,background:r,border:0,[`${n}-body`]:{"th, td":{padding:0},th:{height:`auto`,paddingInlineEnd:e.paddingSM,paddingBottom:e.paddingXXS,lineHeight:`${e.weekHeight}px`}}},[`${n}-cell`]:{"&::before":{display:`none`},"&:hover":{[`${t}-date`]:{background:e.controlItemBgHover}},[`${t}-date-today::before`]:{display:`none`},[`&-in-view${n}-cell-selected`]:{[`${t}-date, ${t}-date-today`]:{background:a}},"&-selected, &-selected:hover":{[`${t}-date, ${t}-date-today`]:{[`${t}-date-value`]:{color:e.colorPrimary}}}},[`${t}-date`]:{display:`block`,width:`auto`,height:`auto`,margin:`0 ${e.marginXS/2}px`,padding:`${e.paddingXS/2}px ${e.paddingXS}px 0`,border:0,borderTop:`${e.lineWidthBold}px ${e.lineType} ${e.colorSplit}`,borderRadius:0,transition:`background ${e.motionDurationSlow}`,"&-value":{lineHeight:`${e.dateValueHeight}px`,transition:`color ${e.motionDurationSlow}`},"&-content":{position:`static`,width:`auto`,height:e.dateContentHeight,overflowY:`auto`,color:e.colorText,lineHeight:e.lineHeight,textAlign:`start`},"&-today":{borderColor:e.colorPrimary,[`${t}-date-value`]:{color:e.colorText}}}},[`@media only screen and (max-width: ${e.screenXS}px) `]:{[`${t}`]:{[`${t}-header`]:{display:`block`,[`${t}-year-select`]:{width:`50%`},[`${t}-month-select`]:{width:`calc(50% - ${e.paddingXS}px)`},[`${t}-mode-switch`]:{width:`100%`,marginTop:e.marginXS,marginInlineStart:0,"> label":{width:`50%`,textAlign:`center`}}}}}}},iE=v(`Calendar`,e=>{let t=`${e.componentCls}-calendar`;return[rE(B(qT(e),tE(e),{calendarCls:t,pickerCellInnerCls:`${e.componentCls}-cell-inner`,calendarFullBg:e.colorBgContainer,calendarFullPanelBg:e.colorBgContainer,calendarItemActiveBg:e.controlItemBgActive,dateValueHeight:e.controlHeightSM,weekHeight:e.controlHeightSM*.75,dateContentHeight:(e.fontSizeSM*e.lineHeightSM+e.marginXS)*3+e.lineWidth*2}))]},{yearControlWidth:80,monthControlWidth:70,miniContentHeight:256});function aE(e){function t(t,n){return t&&n&&e.getYear(t)===e.getYear(n)}function n(n,r){return t(n,r)&&e.getMonth(n)===e.getMonth(r)}function r(t,r){return n(t,r)&&e.getDate(t)===e.getDate(r)}let i=u({name:`ACalendar`,inheritAttrs:!1,props:{prefixCls:String,locale:{type:Object,default:void 0},validRange:{type:Array,default:void 0},disabledDate:{type:Function,default:void 0},dateFullCellRender:{type:Function,default:void 0},dateCellRender:{type:Function,default:void 0},monthFullCellRender:{type:Function,default:void 0},monthCellRender:{type:Function,default:void 0},headerRender:{type:Function,default:void 0},value:{type:[Object,String],default:void 0},defaultValue:{type:[Object,String],default:void 0},mode:{type:String,default:void 0},fullscreen:{type:Boolean,default:void 0},onChange:{type:Function,default:void 0},"onUpdate:value":{type:Function,default:void 0},onPanelChange:{type:Function,default:void 0},onSelect:{type:Function,default:void 0},valueFormat:{type:String,default:void 0}},slots:Object,setup(i,a){let{emit:o,slots:s,attrs:c}=a,l=i,{prefixCls:u,direction:d}=X(`picker`,l),[f,p]=iE(u),m=J(()=>`${u.value}-calendar`),h=t=>l.valueFormat?e.toString(t,l.valueFormat):t,g=J(()=>l.value?l.valueFormat?e.toDate(l.value,l.valueFormat):l.value:l.value===``?void 0:l.value),[_,v]=df(()=>g.value||e.getNow(),{defaultValue:J(()=>l.defaultValue?l.valueFormat?e.toDate(l.defaultValue,l.valueFormat):l.defaultValue:l.defaultValue===``?void 0:l.defaultValue).value,value:g}),[y,b]=df(`month`,{value:St(l,`mode`)}),x=J(()=>y.value===`year`?`month`:`date`),S=J(()=>t=>(l.validRange?e.isAfter(l.validRange[0],t)||e.isAfter(t,l.validRange[1]):!1)||!!l.disabledDate?.call(l,t)),C=(e,t)=>{o(`panelChange`,h(e),t)},w=e=>{if(v(e),!r(e,_.value)){(x.value===`date`&&!n(e,_.value)||x.value===`month`&&!t(e,_.value))&&C(e,y.value);let r=h(e);o(`update:value`,r),o(`change`,r)}},T=e=>{b(e),C(_.value,e)},E=(e,t)=>{w(e),o(`select`,h(e),{source:t})},[D]=Kt(`Calendar`,J(()=>{let{locale:e}=l,t=Z(Z({},et),e);return t.lang=Z(Z({},t.lang),(e||{}).lang),t}));return()=>{let t=e.getNow(),{dateFullCellRender:i=s?.dateFullCellRender,dateCellRender:a=s?.dateCellRender,monthFullCellRender:o=s?.monthFullCellRender,monthCellRender:h=s?.monthCellRender,headerRender:g=s?.headerRender,fullscreen:v=!0,validRange:b}=l,C=n=>{let{current:o}=n;return i?i({current:o}):U(`div`,{class:K(`${u.value}-cell-inner`,`${m.value}-date`,{[`${m.value}-date-today`]:r(t,o)})},[U(`div`,{class:`${m.value}-date-value`},[String(e.getDate(o)).padStart(2,`0`)]),U(`div`,{class:`${m.value}-date-content`},[a&&a({current:o})])])},w=(r,i)=>{let{current:a}=r;if(o)return o({current:a});let s=i.shortMonths||e.locale.getShortMonths(i.locale);return U(`div`,{class:K(`${u.value}-cell-inner`,`${m.value}-date`,{[`${m.value}-date-today`]:n(t,a)})},[U(`div`,{class:`${m.value}-date-value`},[s[e.getMonth(a)]]),U(`div`,{class:`${m.value}-date-content`},[h&&h({current:a})])])};return f(U(`div`,Y(Y({},c),{},{class:K(m.value,{[`${m.value}-full`]:v,[`${m.value}-mini`]:!v,[`${m.value}-rtl`]:d.value===`rtl`},c.class,p.value)}),[g?g({value:_.value,type:y.value,onChange:e=>{E(e,`customize`)},onTypeChange:T}):U(MT,{prefixCls:m.value,value:_.value,generateConfig:e,mode:y.value,fullscreen:v,locale:D.value.lang,validRange:b,onChange:E,onModeChange:T},null),U(Mw,{value:_.value,prefixCls:u.value,locale:D.value.lang,generateConfig:e,dateRender:C,monthCellRender:e=>w(e,D.value.lang),onSelect:e=>{E(e,x.value)},mode:x.value,picker:x.value,disabledDate:S.value,hideHeader:!0},null)]))}}});return i.install=function(e){return e.component(i.name,i),e},i}var oE=a(aE(nC));function sE(e){let t=q(),n=q(!1);function r(){var r=[...arguments];n.value||(ir.cancel(t.value),t.value=ir(()=>{e(...r)}))}return ut(()=>{n.value=!0,ir.cancel(t.value)}),r}function cE(e){let t=q([]),n=q(typeof e==`function`?e():e),r=sE(()=>{let e=n.value;t.value.forEach(t=>{e=t(e)}),t.value=[],n.value=e});function i(e){t.value.push(e),r()}return[n,i]}var lE=u({compatConfig:{MODE:3},name:`TabNode`,props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:[`click`,`resize`,`remove`,`focus`],setup(e,t){let{expose:n,attrs:r}=t,i=H();function a(t){e.tab?.disabled||e.onClick(t)}n({domRef:i});function o(t){t.preventDefault(),t.stopPropagation(),e.editable.onEdit(`remove`,{key:e.tab?.key,event:t})}let s=J(()=>e.editable&&e.closable!==!1&&!e.tab?.disabled);return()=>{let{prefixCls:t,id:n,active:c,tab:{key:l,tab:u,disabled:d,closeIcon:f},renderWrapper:p,removeAriaLabel:m,editable:h,onFocus:g}=e,_=`${t}-tab`,v=U(`div`,{key:l,ref:i,class:K(_,{[`${_}-with-remove`]:s.value,[`${_}-active`]:c,[`${_}-disabled`]:d}),style:r.style,onClick:a},[U(`div`,{role:`tab`,"aria-selected":c,id:n&&`${n}-tab-${l}`,class:`${_}-btn`,"aria-controls":n&&`${n}-panel-${l}`,"aria-disabled":d,tabindex:d?null:0,onClick:e=>{e.stopPropagation(),a(e)},onKeydown:e=>{[$.SPACE,$.ENTER].includes(e.which)&&(e.preventDefault(),a(e))},onFocus:g},[typeof u==`function`?u():u]),s.value&&U(`button`,{type:`button`,"aria-label":m||`remove`,tabindex:0,class:`${_}-remove`,onClick:e=>{e.stopPropagation(),o(e)}},[f?.()||h.removeIcon?.call(h)||`×`])]);return p?p(v):v}}}),uE={width:0,height:0,left:0,top:0};function dE(e,t){let n=H(new Map);return S(()=>{let r=new Map,i=e.value,a=t.value.get(i[0]?.key)||uE,o=a.left+a.width;for(let e=0;e{let{prefixCls:t,editable:n,locale:a}=e;return!n||n.showAdd===!1?null:U(`button`,{ref:i,type:`button`,class:`${t}-nav-add`,style:r.style,"aria-label":a?.addAriaLabel||`Add tab`,onClick:e=>{n.onEdit(`add`,{event:e})}},[n.addIcon?n.addIcon():`+`])}}}),pE=u({compatConfig:{MODE:3},name:`OperationNode`,inheritAttrs:!1,props:{prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:f.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function},popupClassName:String,getPopupContainer:d()},emits:[`tabClick`],slots:Object,setup(e,t){let{attrs:n,slots:r}=t,[i,a]=ff(!1),[o,s]=ff(null),c=t=>{let n=e.tabs.filter(e=>!e.disabled),r=n.findIndex(e=>e.key===o.value)||0,i=n.length;for(let e=0;e{let{which:n}=t;if(!i.value){[$.DOWN,$.SPACE,$.ENTER].includes(n)&&(a(!0),t.preventDefault());return}switch(n){case $.UP:c(-1),t.preventDefault();break;case $.DOWN:c(1),t.preventDefault();break;case $.ESC:a(!1);break;case $.SPACE:case $.ENTER:o.value!==null&&e.onTabClick(o.value,t);break}},u=J(()=>`${e.id}-more-popup`),d=J(()=>o.value===null?null:`${u.value}-${o.value}`),f=(t,n)=>{t.preventDefault(),t.stopPropagation(),e.editable.onEdit(`remove`,{key:n,event:t})};return V(()=>{G(o,()=>{let e=document.getElementById(d.value);e&&e.scrollIntoView&&e.scrollIntoView(!1)},{flush:`post`,immediate:!0})}),G(i,()=>{i.value||s(null)}),yx({}),()=>{let{prefixCls:t,id:s,tabs:c,locale:p,mobile:m,moreIcon:h=r.moreIcon?.call(r)||U(ax,null,null),moreTransitionName:g,editable:_,tabBarGutter:v,rtl:y,onTabClick:b,popupClassName:x}=e;if(!c.length)return null;let S=`${t}-dropdown`,C=p?.dropdownAriaLabel,w={[y?`marginRight`:`marginLeft`]:v};c.length||(w.visibility=`hidden`,w.order=1);let T=K({[`${S}-rtl`]:y,[`${x}`]:!0}),E=m?null:U(tb,{prefixCls:S,trigger:[`hover`],visible:i.value,transitionName:g,onVisibleChange:a,overlayClassName:T,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:e.getPopupContainer},{overlay:()=>U(wS,{onClick:e=>{let{key:t,domEvent:n}=e;b(t,n),a(!1)},id:u.value,tabindex:-1,role:`listbox`,"aria-activedescendant":d.value,selectedKeys:[o.value],"aria-label":C===void 0?`expanded dropdown`:C},{default:()=>[c.map(t=>{let n=_&&t.closable!==!1&&!t.disabled;return U(Kx,{key:t.key,id:`${u.value}-${t.key}`,role:`option`,"aria-controls":s&&`${s}-panel-${t.key}`,disabled:t.disabled},{default:()=>[U(`span`,null,[typeof t.tab==`function`?t.tab():t.tab]),n&&U(`button`,{type:`button`,"aria-label":e.removeAriaLabel||`remove`,tabindex:0,class:`${S}-menu-item-remove`,onClick:e=>{e.stopPropagation(),f(e,t.key)}},[t.closeIcon?.call(t)||_.removeIcon?.call(_)||`×`])]})})]}),default:()=>U(`button`,{type:`button`,class:`${t}-nav-more`,style:w,tabindex:-1,"aria-hidden":`true`,"aria-haspopup":`listbox`,"aria-controls":u.value,id:`${s}-more`,"aria-expanded":i.value,onKeydown:l},[h])});return U(`div`,{class:K(`${t}-nav-operations`,n.class),style:n.style},[E,U(fE,{prefixCls:t,locale:p,editable:_},null)])}}}),mE=Symbol(`tabsContextKey`),hE=e=>{fe(mE,e)},gE=()=>g(mE,{tabs:H([]),prefixCls:H()});u({compatConfig:{MODE:3},name:`TabsContextProvider`,inheritAttrs:!1,props:{tabs:{type:Object,default:void 0},prefixCls:{type:String,default:void 0}},setup(e,t){let{slots:n}=t;return hE(Ft(e)),()=>n.default?.call(n)}});var _E=.1,vE=.01,yE=20,bE=.995**yE;function xE(e,t){let[n,r]=ff(),[i,a]=ff(0),[o,s]=ff(0),[c,l]=ff(),u=H();function d(e){let{screenX:t,screenY:n}=e.touches[0];r({x:t,y:n}),clearInterval(u.value)}function f(e){if(!n.value)return;e.preventDefault();let{screenX:o,screenY:c}=e.touches[0],u=o-n.value.x,d=c-n.value.y;t(u,d),r({x:o,y:c});let f=Date.now();s(f-i.value),a(f),l({x:u,y:d})}function p(){if(!n.value)return;let e=c.value;if(r(null),l(null),e){let n=e.x/o.value,r=e.y/o.value;if(Math.max(Math.abs(n),Math.abs(r))<_E)return;let i=n,a=r;u.value=setInterval(()=>{if(Math.abs(i)o?(i=n,m.value=`x`):(i=r,m.value=`y`),t(-i,-i)&&e.preventDefault()}let g=H({onTouchStart:d,onTouchMove:f,onTouchEnd:p,onWheel:h});function _(e){g.value.onTouchStart(e)}function v(e){g.value.onTouchMove(e)}function y(e){g.value.onTouchEnd(e)}function b(e){g.value.onWheel(e)}V(()=>{var t,n;document.addEventListener(`touchmove`,v,{passive:!1}),document.addEventListener(`touchend`,y,{passive:!1}),(t=e.value)==null||t.addEventListener(`touchstart`,_,{passive:!1}),(n=e.value)==null||n.addEventListener(`wheel`,b,{passive:!1})}),ut(()=>{document.removeEventListener(`touchmove`,v),document.removeEventListener(`touchend`,y)})}function SE(e,t){let n=H(e);function r(e){let r=typeof e==`function`?e(n.value):e;r!==n.value&&t(r,n.value),n.value=r}return[n,r]}var CE=()=>{let e=H(new Map);return ne(()=>{e.value=new Map}),[t=>n=>{e.value.set(t,n)},e]},wE={width:0,height:0,left:0,top:0,right:0},TE=()=>({id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:Qt(),editable:Qt(),moreIcon:f.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:Qt(),popupClassName:String,getPopupContainer:d(),onTabClick:{type:Function},onTabScroll:{type:Function}}),EE=(e,t)=>{let{offsetWidth:n,offsetHeight:r,offsetTop:i,offsetLeft:a}=e,{width:o,height:s,x:c,y:l}=e.getBoundingClientRect();return Math.abs(o-n)<1?[o,s,c-t.x,l-t.y]:[n,r,a,i]},DE=u({compatConfig:{MODE:3},name:`TabNavList`,inheritAttrs:!1,props:TE(),slots:Object,emits:[`tabClick`,`tabScroll`],setup(e,t){let{attrs:n,slots:r}=t,{tabs:i,prefixCls:a}=gE(),o=q(),s=q(),c=q(),l=q(),[u,d]=CE(),f=J(()=>e.tabPosition===`top`||e.tabPosition===`bottom`),[p,m]=SE(0,(t,n)=>{f.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?`left`:`right`})}),[h,g]=SE(0,(t,n)=>{!f.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?`top`:`bottom`})}),[_,v]=ff(0),[y,b]=ff(0),[x,C]=ff(null),[w,T]=ff(null),[E,D]=ff(0),[O,k]=ff(0),[A,j]=cE(new Map),M=dE(i,A),N=J(()=>`${a.value}-nav-operations-hidden`),P=q(0),F=q(0);S(()=>{f.value?e.rtl?(P.value=0,F.value=Math.max(0,_.value-x.value)):(P.value=Math.min(0,x.value-_.value),F.value=0):(P.value=Math.min(0,w.value-y.value),F.value=0)});let I=e=>eF.value?F.value:e,L=q(),[ee,te]=ff(),ne=()=>{te(Date.now())},R=()=>{clearTimeout(L.value)},re=(e,t)=>{e(e=>I(e+t))};xE(o,(e,t)=>{if(f.value){if(x.value>=_.value)return!1;re(m,e)}else{if(w.value>=y.value)return!1;re(g,t)}return R(),ne(),!0}),G(ee,()=>{R(),ee.value&&(L.value=setTimeout(()=>{te(0)},100))});let ie=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey,n=M.value.get(t)||{width:0,height:0,left:0,right:0,top:0};if(f.value){let t=p.value;e.rtl?n.rightp.value+x.value&&(t=n.right+n.width-x.value):n.left<-p.value?t=-n.left:n.left+n.width>-p.value+x.value&&(t=-(n.left+n.width-x.value)),g(0),m(I(t))}else{let e=h.value;n.top<-h.value?e=-n.top:n.top+n.height>-h.value+w.value&&(e=-(n.top+n.height-w.value)),m(0),g(I(e))}},ae=q(0),oe=q(0);S(()=>{let t,n,r,a,o,s,c=M.value;[`top`,`bottom`].includes(e.tabPosition)?(t=`width`,a=x.value,o=_.value,s=E.value,n=e.rtl?`right`:`left`,r=Math.abs(p.value)):(t=`height`,a=w.value,o=_.value,s=O.value,n=`top`,r=-h.value);let l=a;o+s>a&&or+l){f=e-1;break}}let m=0;for(let e=d-1;e>=0;--e)if((c.get(u[e].key)||wE)[n]{j(()=>{let e=new Map,t=s.value?.getBoundingClientRect();return i.value.forEach(n=>{let{key:r}=n,i=d.value.get(r),a=i?.$el||i;if(a){let[n,i,o,s]=EE(a,t);e.set(r,{width:n,height:i,left:o,top:s})}}),e})};G(()=>i.value.map(e=>e.key).join(`%%`),()=>{z()},{flush:`post`});let se=()=>{let e=o.value?.offsetWidth||0,t=o.value?.offsetHeight||0,n=l.value?.$el||{},r=n.offsetWidth||0,i=n.offsetHeight||0;C(e),T(t),D(r),k(i);let a=(s.value?.offsetWidth||0)-r,c=(s.value?.offsetHeight||0)-i;v(a),b(c),z()},B=J(()=>[...i.value.slice(0,ae.value),...i.value.slice(oe.value+1)]),[V,ce]=ff(),le=J(()=>M.value.get(e.activeKey)),H=q(),ue=()=>{ir.cancel(H.value)};G([le,f,()=>e.rtl],()=>{let t={};le.value&&(f.value?(e.rtl?t.right=xt(le.value.right):t.left=xt(le.value.left),t.width=xt(le.value.width)):(t.top=xt(le.value.top),t.height=xt(le.value.height))),ue(),H.value=ir(()=>{ce(t)})}),G([()=>e.activeKey,le,M,f],()=>{ie()},{flush:`post`}),G([()=>e.rtl,()=>e.tabBarGutter,()=>e.activeKey,()=>i.value],()=>{se()},{flush:`post`});let de=e=>{let{position:t,prefixCls:n,extra:r}=e;if(!r)return null;let i=r?.({position:t});return i?U(`div`,{class:`${n}-extra-content`},[i]):null};return ut(()=>{R(),ue()}),()=>{let{id:t,animated:d,activeKey:m,rtl:g,editable:v,locale:b,tabPosition:S,tabBarGutter:C,onTabClick:T}=e,{class:E,style:D}=n,O=a.value,k=!!B.value.length,A=`${O}-nav-wrap`,j,M,P,F;f.value?g?(M=p.value>0,j=p.value+x.value<_.value):(j=p.value<0,M=-p.value+x.value<_.value):(P=h.value<0,F=-h.value+w.value{let{key:i}=e;return U(lE,{id:t,prefixCls:O,key:i,tab:e,style:n===0?void 0:I,closable:e.closable,editable:v,active:i===m,removeAriaLabel:b?.removeAriaLabel,ref:u(i),onClick:e=>{T(i,e)},onFocus:()=>{ie(i),ne(),o.value&&(g||(o.value.scrollLeft=0),o.value.scrollTop=0)}},r)});return U(`div`,{role:`tablist`,class:K(`${O}-nav`,E),style:D,onKeydown:()=>{ne()}},[U(de,{position:`left`,prefixCls:O,extra:r.leftExtra},null),U(Qn,{onResize:se},{default:()=>[U(`div`,{class:K(A,{[`${A}-ping-left`]:j,[`${A}-ping-right`]:M,[`${A}-ping-top`]:P,[`${A}-ping-bottom`]:F}),ref:o},[U(Qn,{onResize:se},{default:()=>[U(`div`,{ref:s,class:`${O}-nav-list`,style:{transform:`translate(${p.value}px, ${h.value}px)`,transition:ee.value?`none`:void 0}},[L,U(fE,{ref:l,prefixCls:O,locale:b,editable:v,style:Z(Z({},L.length===0?void 0:I),{visibility:k?`hidden`:null})},null),U(`div`,{class:K(`${O}-ink-bar`,{[`${O}-ink-bar-animated`]:d.inkBar}),style:V.value},null)])]})])]}),U(pE,Y(Y({},e),{},{removeAriaLabel:b?.removeAriaLabel,ref:c,prefixCls:O,tabs:B.value,class:!k&&N.value}),r_(r,[`moreIcon`])),U(de,{position:`right`,prefixCls:O,extra:r.rightExtra},null),U(de,{position:`right`,prefixCls:O,extra:r.tabBarExtraContent},null)])}}}),OE=u({compatConfig:{MODE:3},name:`TabPanelList`,inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup(e){let{tabs:t,prefixCls:n}=gE();return()=>{let{id:r,activeKey:i,animated:a,tabPosition:o,rtl:s,destroyInactiveTabPane:c}=e,l=a.tabPane,u=n.value,d=t.value.findIndex(e=>e.key===i);return U(`div`,{class:`${u}-content-holder`},[U(`div`,{class:[`${u}-content`,`${u}-content-${o}`,{[`${u}-content-animated`]:l}],style:d&&l?{[s?`marginRight`:`marginLeft`]:`-${d}00%`}:null},[t.value.map(e=>ao(e.node,{key:e.key,prefixCls:u,tabKey:e.key,id:r,animated:l,active:e.key===i,destroyInactiveTabPane:c}))])])}}}),kE=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:`none`,"&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:`absolute`,transition:`none`,inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[R_(e,`slide-up`),R_(e,`slide-down`)]]},AE=e=>{let{componentCls:t,tabsCardHorizontalPadding:n,tabsCardHeadBackground:r,tabsCardGutter:i,colorSplit:a}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:r,border:`${e.lineWidth}px ${e.lineType} ${a}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:e.colorPrimary,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:`hidden`}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${i}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${i}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},jE=e=>{let{componentCls:t,tabsHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{[`${t}-dropdown`]:Z(Z({},rn(e)),{position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:`block`,"&-hidden":{display:`none`},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${r}px 0`,overflowX:`hidden`,overflowY:`auto`,textAlign:{_skip_check_:!0,value:`left`},listStyleType:`none`,backgroundColor:e.colorBgContainer,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,"&-item":Z(Z({},xe),{display:`flex`,alignItems:`center`,minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:`nowrap`},"&-remove":{flex:`none`,marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:`transparent`,border:0,cursor:`pointer`,"&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:`transparent`,cursor:`not-allowed`}}})}})}},ME=e=>{let{componentCls:t,margin:n,colorSplit:r}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:`column`,[`> ${t}-nav, > div > ${t}-nav`]:{margin:`0 0 ${n}px 0`,"&::before":{position:`absolute`,right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${r}`,content:`''`},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow}, + right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav, + > div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:`${n}px`,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:`column`,minWidth:e.controlHeight*1.25,[`${t}-tab`]:{padding:`${e.paddingXS}px ${e.paddingLG}px`,textAlign:`center`},[`${t}-tab + ${t}-tab`]:{margin:`${e.margin}px 0 0 0`},[`${t}-nav-wrap`]:{flexDirection:`column`,"&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:`1 0 auto`,flexDirection:`column`}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-e.lineWidth},borderRight:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},NE=e=>{let{componentCls:t,padding:n}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px 0`,fontSize:e.fontSize}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${n}px 0`,fontSize:e.fontSizeLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXXS*1.5}px ${n}px`}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${e.borderRadius}px ${e.borderRadius}px`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadius}px ${e.borderRadius}px 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadius}px 0 0 ${e.borderRadius}px`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px ${n}px ${e.paddingXXS*1.5}px`}}}}}},PE=e=>{let{componentCls:t,tabsActiveColor:n,tabsHoverColor:r,iconCls:i,tabsHorizontalGutter:a}=e,o=`${t}-tab`;return{[o]:{position:`relative`,display:`inline-flex`,alignItems:`center`,padding:`${e.paddingSM}px 0`,fontSize:`${e.fontSize}px`,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,"&-btn, &-remove":Z({"&:focus:not(:focus-visible), &:active":{color:n}},de(e)),"&-btn":{outline:`none`,transition:`all 0.3s`},"&-remove":{flex:`none`,marginRight:{_skip_check_:!0,value:-e.marginXXS},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},"&:hover":{color:r},[`&${o}-active ${o}-btn`]:{color:e.colorPrimary,textShadow:e.tabsActiveTextShadow},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[`&${o}-disabled ${o}-btn, &${o}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${o}-remove ${i}`]:{margin:0},[i]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${o} + ${o}`]:{margin:{_skip_check_:!0,value:`0 0 0 ${a}px`}}}},FE=e=>{let{componentCls:t,tabsHorizontalGutter:n,iconCls:r,tabsCardGutter:i}=e;return{[`${t}-rtl`]:{direction:`rtl`,[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:`0 0 0 ${n}px`},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${e.marginSM}px`}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${e.marginXXS}px`},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:`${i}px`},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:`rtl`},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:`right`}}}}},IE=e=>{let{componentCls:t,tabsCardHorizontalPadding:n,tabsCardHeight:r,tabsCardGutter:i,tabsHoverColor:a,tabsActiveColor:o,colorSplit:s}=e;return{[t]:Z(Z(Z(Z({},rn(e)),{display:`flex`,[`> ${t}-nav, > div > ${t}-nav`]:{position:`relative`,display:`flex`,flex:`none`,alignItems:`center`,[`${t}-nav-wrap`]:{position:`relative`,display:`flex`,flex:`auto`,alignSelf:`stretch`,overflow:`hidden`,whiteSpace:`nowrap`,transform:`translate(0)`,"&::before, &::after":{position:`absolute`,zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:`''`,pointerEvents:`none`}},[`${t}-nav-list`]:{position:`relative`,display:`flex`,transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:`flex`,alignSelf:`stretch`},[`${t}-nav-operations-hidden`]:{position:`absolute`,visibility:`hidden`,pointerEvents:`none`},[`${t}-nav-more`]:{position:`relative`,padding:n,background:`transparent`,border:0,"&::after":{position:`absolute`,right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.controlHeightLG/8,transform:`translateY(100%)`,content:`''`}},[`${t}-nav-add`]:Z({minWidth:`${r}px`,marginLeft:{_skip_check_:!0,value:`${i}px`},padding:`0 ${e.paddingXS}px`,background:`transparent`,border:`${e.lineWidth}px ${e.lineType} ${s}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,outline:`none`,cursor:`pointer`,color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:o}},de(e))},[`${t}-extra-content`]:{flex:`none`},[`${t}-ink-bar`]:{position:`absolute`,background:e.colorPrimary,pointerEvents:`none`}}),PE(e)),{[`${t}-content`]:{position:`relative`,display:`flex`,width:`100%`,"&-animated":{transition:`margin 0.3s`}},[`${t}-content-holder`]:{flex:`auto`,minWidth:0,minHeight:0},[`${t}-tabpane`]:{outline:`none`,flex:`none`,width:`100%`}}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping'])`]:{justifyContent:`center`}}}}}},LE=v(`Tabs`,e=>{let t=e.controlHeightLG,n=B(e,{tabsHoverColor:e.colorPrimaryHover,tabsActiveColor:e.colorPrimaryActive,tabsCardHorizontalPadding:`${(t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth}px ${e.padding}px`,tabsCardHeight:t,tabsCardGutter:e.marginXXS/2,tabsHorizontalGutter:32,tabsCardHeadBackground:e.colorFillAlter,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:`0 0 0.25px currentcolor`,tabsDropdownHeight:200,tabsDropdownWidth:120});return[NE(n),FE(n),ME(n),jE(n),AE(n),IE(n),kE(n)]},e=>({zIndexPopup:e.zIndexPopupBase+50})),RE=0,zE=()=>({prefixCls:{type:String},id:{type:String},popupClassName:String,getPopupContainer:d(),activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:_(),animated:W([Boolean,Object]),renderTabBar:d(),tabBarGutter:{type:Number},tabBarStyle:Qt(),tabPosition:_(),destroyInactiveTabPane:Q(),hideAdd:Boolean,type:_(),size:_(),centered:Boolean,onEdit:d(),onChange:d(),onTabClick:d(),onTabScroll:d(),"onUpdate:activeKey":d(),locale:Qt(),onPrevClick:d(),onNextClick:d(),tabBarExtraContent:f.any});function BE(e){return e.map(e=>{if(Nt(e)){let t=Z({},e.props||{});for(let[e,n]of Object.entries(t))delete t[e],t[ue(e)]=n;let n=e.children||{},r=e.key===void 0?void 0:e.key,{tab:i=n.tab,disabled:a,forceRender:o,closable:s,animated:c,active:l,destroyInactiveTabPane:u}=t;return Z(Z({key:r},t),{node:e,closeIcon:n.closeIcon,tab:i,disabled:a===``||a,forceRender:o===``||o,closable:s===``||s,animated:c===``||c,active:l===``||l,destroyInactiveTabPane:u===``||u})}return null}).filter(e=>e)}var VE=u({compatConfig:{MODE:3},name:`InternalTabs`,inheritAttrs:!1,props:Z(Z({},Zn(zE(),{tabPosition:`top`,animated:{inkBar:!0,tabPane:!1}})),{tabs:Ue()}),slots:Object,setup(e,t){let{attrs:n,slots:r}=t;pi(e.onPrevClick===void 0&&e.onNextClick===void 0,`Tabs`,"`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),pi(e.tabBarExtraContent===void 0,`Tabs`,"`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),pi(r.tabBarExtraContent===void 0,`Tabs`,"`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");let{prefixCls:i,direction:a,size:o,rootPrefixCls:s,getPopupContainer:c}=X(`tabs`,e),[l,u]=LE(i),d=J(()=>a.value===`rtl`),f=J(()=>{let{animated:t,tabPosition:n}=e;return t===!1||[`left`,`right`].includes(n)?{inkBar:!1,tabPane:!1}:t===!0?{inkBar:!0,tabPane:!0}:Z({inkBar:!0,tabPane:!1},typeof t==`object`?t:{})}),[p,m]=ff(!1);V(()=>{m(vd())});let[h,g]=df(()=>e.tabs[0]?.key,{value:J(()=>e.activeKey),defaultValue:e.defaultActiveKey}),[_,v]=ff(()=>e.tabs.findIndex(e=>e.key===h.value));S(()=>{let t=e.tabs.findIndex(e=>e.key===h.value);t===-1&&(t=Math.max(0,Math.min(_.value,e.tabs.length-1)),g(e.tabs[t]?.key)),v(t)});let[y,b]=df(null,{value:J(()=>e.id)}),x=J(()=>p.value&&![`left`,`right`].includes(e.tabPosition)?`top`:e.tabPosition);V(()=>{e.id||(b(`rc-tabs-${RE}`),RE+=1)});let C=(t,n)=>{var r,i;(r=e.onTabClick)==null||r.call(e,t,n);let a=t!==h.value;g(t),a&&((i=e.onChange)==null||i.call(e,t))};return hE({tabs:J(()=>e.tabs),prefixCls:i}),()=>{let{id:t,type:a,tabBarGutter:m,tabBarStyle:g,locale:_,destroyInactiveTabPane:v,renderTabBar:b=r.renderTabBar,onTabScroll:S,hideAdd:w,centered:T}=e,E={id:y.value,activeKey:h.value,animated:f.value,tabPosition:x.value,rtl:d.value,mobile:p.value},D;a===`editable-card`&&(D={onEdit:(t,n)=>{let{key:r,event:i}=n;var a;(a=e.onEdit)==null||a.call(e,t===`add`?i:r,t)},removeIcon:()=>U(Pe,null,null),addIcon:r.addIcon?r.addIcon:()=>U(cn,null,null),showAdd:w!==!0});let O,k=Z(Z({},E),{moreTransitionName:`${s.value}-slide-up`,editable:D,locale:_,tabBarGutter:m,onTabClick:C,onTabScroll:S,style:g,getPopupContainer:c.value,popupClassName:K(e.popupClassName,u.value)});O=b?b(Z(Z({},k),{DefaultTabBar:DE})):U(DE,k,r_(r,[`moreIcon`,`leftExtra`,`rightExtra`,`tabBarExtraContent`]));let A=i.value;return l(U(`div`,Y(Y({},n),{},{id:t,class:K(A,`${A}-${x.value}`,{[u.value]:!0,[`${A}-${o.value}`]:o.value,[`${A}-card`]:[`card`,`editable-card`].includes(a),[`${A}-editable-card`]:a===`editable-card`,[`${A}-centered`]:T,[`${A}-mobile`]:p.value,[`${A}-editable`]:a===`editable-card`,[`${A}-rtl`]:d.value},n.class)}),[O,U(OE,Y(Y({destroyInactiveTabPane:v},E),{},{animated:f.value}),null)]))}}}),HE=u({compatConfig:{MODE:3},name:`ATabs`,inheritAttrs:!1,props:Zn(zE(),{tabPosition:`top`,animated:{inkBar:!0,tabPane:!1}}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=e=>{i(`update:activeKey`,e),i(`change`,e)};return()=>{let t=BE(ce(r.default?.call(r)));return U(VE,Y(Y(Y({},Br(e,[`onUpdate:activeKey`])),n),{},{onChange:a,tabs:t}),r)}}}),UE=u({compatConfig:{MODE:3},name:`ATabPane`,inheritAttrs:!1,__ANT_TAB_PANE:!0,props:{tab:f.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}},slots:Object,setup(e,t){let{attrs:n,slots:r}=t,i=H(e.forceRender);G([()=>e.active,()=>e.destroyInactiveTabPane],()=>{e.active?i.value=!0:e.destroyInactiveTabPane&&(i.value=!1)},{immediate:!0});let a=J(()=>e.active?{}:e.animated?{visibility:`hidden`,height:0,overflowY:`hidden`}:{display:`none`});return()=>{let{prefixCls:t,forceRender:o,id:s,active:c,tabKey:l}=e;return U(`div`,{id:s&&`${s}-panel-${l}`,role:`tabpanel`,tabindex:c?0:-1,"aria-labelledby":s&&`${s}-tab-${l}`,"aria-hidden":!c,style:[a.value,n.style],class:[`${t}-tabpane`,c&&`${t}-tabpane-active`,n.class]},[(c||i.value||o)&&r.default?.call(r)])}}}),WE=HE;WE.TabPane=UE,WE.install=function(e){return e.component(WE.name,WE),e.component(UE.name,UE),e};var GE=WE,KE=e=>{let{antCls:t,componentCls:n,cardHeadHeight:r,cardPaddingBase:i,cardHeadTabsMarginBottom:a}=e;return Z(Z({display:`flex`,justifyContent:`center`,flexDirection:`column`,minHeight:r,marginBottom:-1,padding:`0 ${i}px`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,background:`transparent`,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},D()),{"&-wrapper":{width:`100%`,display:`flex`,alignItems:`center`},"&-title":Z(Z({display:`inline-block`,flex:1},xe),{[` + > ${n}-typography, + > ${n}-typography-edit-content + `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:`both`,marginBottom:a,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,"&-bar":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`}}})},qE=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:` + ${i}px 0 0 0 ${n}, + 0 ${i}px 0 0 ${n}, + ${i}px ${i}px 0 0 ${n}, + ${i}px 0 0 0 ${n} inset, + 0 ${i}px 0 0 ${n} inset; + `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},JE=e=>{let{componentCls:t,iconCls:n,cardActionsLiMargin:r,cardActionsIconSize:i,colorBorderSecondary:a}=e;return Z(Z({margin:0,padding:0,listStyle:`none`,background:e.colorBgContainer,borderTop:`${e.lineWidth}px ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `},D()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:`center`,"> span":{position:`relative`,display:`block`,minWidth:e.cardActionsIconSize*2,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,"&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:`inline-block`,width:`100%`,color:e.colorTextDescription,lineHeight:`${e.fontSize*e.lineHeight}px`,transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:`${i*e.lineHeight}px`}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${a}`}}})},YE=e=>Z(Z({margin:`-${e.marginXXS}px 0`,display:`flex`},D()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:`hidden`,flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Z({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},xe),"&-description":{color:e.colorTextDescription}}),XE=e=>{let{componentCls:t,cardPaddingBase:n,colorFillAlter:r}=e;return{[`${t}-head`]:{padding:`0 ${n}px`,background:r,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${e.padding}px ${n}px`}}},ZE=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},QE=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadow:a,cardPaddingBase:o}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:KE(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:``,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:Z({padding:o,borderRadius:` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},D()),[`${t}-grid`]:qE(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`},img:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`}},[`${t}-actions`]:JE(e),[`${t}-meta`]:YE(e)}),[`${t}-bordered`]:{border:`${e.lineWidth}px ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:`pointer`,transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:`transparent`,boxShadow:n}},[`${t}-contain-grid`]:{[`${t}-body`]:{display:`flex`,flexWrap:`wrap`},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:-e.lineWidth,marginInlineStart:-e.lineWidth,padding:0}},[`${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:r}}},[`${t}-type-inner`]:XE(e),[`${t}-loading`]:ZE(e),[`${t}-rtl`]:{direction:`rtl`}}},$E=e=>{let{componentCls:t,cardPaddingSM:n,cardHeadHeightSM:r}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:r,padding:`0 ${n}px`,fontSize:e.fontSize,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{minHeight:r,paddingTop:0,display:`flex`,alignItems:`center`}}}}},eD=v(`Card`,e=>{let t=B(e,{cardShadow:e.boxShadowCard,cardHeadHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,cardHeadHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardHeadTabsMarginBottom:-e.padding-e.lineWidth,cardActionsLiMargin:`${e.paddingSM}px 0`,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[QE(t),$E(t)]}),tD=u({compatConfig:{MODE:3},name:`SkeletonTitle`,props:{prefixCls:String,width:{type:[Number,String]}},setup(e){return()=>{let{prefixCls:t,width:n}=e;return U(`h3`,{class:t,style:{width:typeof n==`number`?`${n}px`:n}},null)}}}),nD=u({compatConfig:{MODE:3},name:`SkeletonParagraph`,props:{prefixCls:String,width:{type:[Number,String,Array]},rows:Number},setup(e){let t=t=>{let{width:n,rows:r=2}=e;if(Array.isArray(n))return n[t];if(r-1===t)return n};return()=>{let{prefixCls:n,rows:r}=e,i=[...Array(r)].map((e,n)=>{let r=t(n);return U(`li`,{key:n,style:{width:typeof r==`number`?`${r}px`:r}},null)});return U(`ul`,{class:n},[i])}}}),rD=()=>({prefixCls:String,size:[String,Number],shape:String,active:{type:Boolean,default:void 0}}),iD=e=>{let{prefixCls:t,size:n,shape:r}=e,i=K({[`${t}-lg`]:n===`large`,[`${t}-sm`]:n===`small`}),a=K({[`${t}-circle`]:r===`circle`,[`${t}-square`]:r===`square`,[`${t}-round`]:r===`round`}),o=typeof n==`number`?{width:`${n}px`,height:`${n}px`,lineHeight:`${n}px`}:{};return U(`span`,{class:K(t,i,a),style:o},null)};iD.displayName=`SkeletonElement`;var aD=new N(`ant-skeleton-loading`,{"0%":{transform:`translateX(-37.5%)`},"100%":{transform:`translateX(37.5%)`}}),oD=e=>({height:e,lineHeight:`${e}px`}),sD=e=>Z({width:e},oD(e)),cD=e=>({position:`relative`,zIndex:0,overflow:`hidden`,background:`transparent`,"&::after":{position:`absolute`,top:0,insetInlineEnd:`-150%`,bottom:0,insetInlineStart:`-150%`,background:e.skeletonLoadingBackground,animationName:aD,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:`ease`,animationIterationCount:`infinite`,content:`""`}}),lD=e=>Z({width:e*5,minWidth:e*5},oD(e)),uD=e=>{let{skeletonAvatarCls:t,color:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a}=e;return{[`${t}`]:Z({display:`inline-block`,verticalAlign:`top`,background:n},sD(r)),[`${t}${t}-circle`]:{borderRadius:`50%`},[`${t}${t}-lg`]:Z({},sD(i)),[`${t}${t}-sm`]:Z({},sD(a))}},dD=e=>{let{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:i,controlHeightSM:a,color:o}=e;return{[`${r}`]:Z({display:`inline-block`,verticalAlign:`top`,background:o,borderRadius:n},lD(t)),[`${r}-lg`]:Z({},lD(i)),[`${r}-sm`]:Z({},lD(a))}},fD=e=>Z({width:e},oD(e)),pD=e=>{let{skeletonImageCls:t,imageSizeBase:n,color:r,borderRadiusSM:i}=e;return{[`${t}`]:Z(Z({display:`flex`,alignItems:`center`,justifyContent:`center`,verticalAlign:`top`,background:r,borderRadius:i},fD(n*2)),{[`${t}-path`]:{fill:`#bfbfbf`},[`${t}-svg`]:Z(Z({},fD(n)),{maxWidth:n*4,maxHeight:n*4}),[`${t}-svg${t}-svg-circle`]:{borderRadius:`50%`}}),[`${t}${t}-circle`]:{borderRadius:`50%`}}},mD=(e,t,n)=>{let{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:`50%`},[`${n}${r}-round`]:{borderRadius:t}}},hD=e=>Z({width:e*2,minWidth:e*2},oD(e)),gD=e=>{let{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a,color:o}=e;return Z(Z(Z(Z(Z({[`${n}`]:Z({display:`inline-block`,verticalAlign:`top`,background:o,borderRadius:t,width:r*2,minWidth:r*2},hD(r))},mD(e,r,n)),{[`${n}-lg`]:Z({},hD(i))}),mD(e,i,`${n}-lg`)),{[`${n}-sm`]:Z({},hD(a))}),mD(e,a,`${n}-sm`))},_D=e=>{let{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:i,skeletonButtonCls:a,skeletonInputCls:o,skeletonImageCls:s,controlHeight:c,controlHeightLG:l,controlHeightSM:u,color:d,padding:f,marginSM:p,borderRadius:m,skeletonTitleHeight:h,skeletonBlockRadius:g,skeletonParagraphLineHeight:_,controlHeightXS:v,skeletonParagraphMarginTop:y}=e;return{[`${t}`]:{display:`table`,width:`100%`,[`${t}-header`]:{display:`table-cell`,paddingInlineEnd:f,verticalAlign:`top`,[`${n}`]:Z({display:`inline-block`,verticalAlign:`top`,background:d},sD(c)),[`${n}-circle`]:{borderRadius:`50%`},[`${n}-lg`]:Z({},sD(l)),[`${n}-sm`]:Z({},sD(u))},[`${t}-content`]:{display:`table-cell`,width:`100%`,verticalAlign:`top`,[`${r}`]:{width:`100%`,height:h,background:d,borderRadius:g,[`+ ${i}`]:{marginBlockStart:u}},[`${i}`]:{padding:0,"> li":{width:`100%`,height:_,listStyle:`none`,background:d,borderRadius:g,"+ li":{marginBlockStart:v}}},[`${i}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:`61%`}},[`&-round ${t}-content`]:{[`${r}, ${i} > li`]:{borderRadius:m}}},[`${t}-with-avatar ${t}-content`]:{[`${r}`]:{marginBlockStart:p,[`+ ${i}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Z(Z(Z(Z({display:`inline-block`,width:`auto`},gD(e)),uD(e)),dD(e)),pD(e)),[`${t}${t}-block`]:{width:`100%`,[`${a}`]:{width:`100%`},[`${o}`]:{width:`100%`}},[`${t}${t}-active`]:{[` + ${r}, + ${i} > li, + ${n}, + ${a}, + ${o}, + ${s} + `]:Z({},cD(e))}}},vD=v(`Skeleton`,e=>{let{componentCls:t}=e;return[_D(B(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:e.controlHeight*1.5,skeletonTitleHeight:e.controlHeight/2,skeletonBlockRadius:e.borderRadiusSM,skeletonParagraphLineHeight:e.controlHeight/2,skeletonParagraphMarginTop:e.marginLG+e.marginXXS,borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.color} 25%, ${e.colorGradientEnd} 37%, ${e.color} 63%)`,skeletonLoadingMotionDuration:`1.4s`}))]},e=>{let{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n}}),yD=()=>({active:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},prefixCls:String,avatar:{type:[Boolean,Object],default:void 0},title:{type:[Boolean,Object],default:void 0},paragraph:{type:[Boolean,Object],default:void 0},round:{type:Boolean,default:void 0}});function bD(e){return e&&typeof e==`object`?e:{}}function xD(e,t){return e&&!t?{size:`large`,shape:`square`}:{size:`large`,shape:`circle`}}function SD(e,t){return!e&&t?{width:`38%`}:e&&t?{width:`50%`}:{}}function CD(e,t){let n={};return(!e||!t)&&(n.width=`61%`),!e&&t?n.rows=3:n.rows=2,n}var wD=u({compatConfig:{MODE:3},name:`ASkeleton`,props:Zn(yD(),{avatar:!1,title:!0,paragraph:!0}),setup(e,t){let{slots:n}=t,{prefixCls:r,direction:i}=X(`skeleton`,e),[a,o]=vD(r);return()=>{let{loading:t,avatar:s,title:c,paragraph:l,active:u,round:d}=e,f=r.value;if(t||e.loading===void 0){let e=!!s||s===``,t=!!c||c===``,n=!!l||l===``,r;if(e){let e=Z(Z({prefixCls:`${f}-avatar`},xD(t,n)),bD(s));r=U(`div`,{class:`${f}-header`},[U(iD,e,null)])}let p;if(t||n){let r;t&&(r=U(tD,Z(Z({prefixCls:`${f}-title`},SD(e,n)),bD(c)),null));let i;n&&(i=U(nD,Z(Z({prefixCls:`${f}-paragraph`},CD(e,t)),bD(l)),null)),p=U(`div`,{class:`${f}-content`},[r,i])}let m=K(f,{[`${f}-with-avatar`]:e,[`${f}-active`]:u,[`${f}-rtl`]:i.value===`rtl`,[`${f}-round`]:d,[o.value]:!0});return a(U(`div`,{class:m},[r,p]))}return n.default?.call(n)}}}),TD=u({compatConfig:{MODE:3},name:`ASkeletonButton`,props:Zn(Z(Z({},rD()),{size:String,block:Boolean}),{size:`default`}),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active,[`${t.value}-block`]:e.block},r.value));return()=>n(U(`div`,{class:i.value},[U(iD,Y(Y({},e),{},{prefixCls:`${t.value}-button`}),null)]))}}),ED=u({compatConfig:{MODE:3},name:`ASkeletonInput`,props:Z(Z({},Br(rD(),[`shape`])),{size:String,block:Boolean}),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active,[`${t.value}-block`]:e.block},r.value));return()=>n(U(`div`,{class:i.value},[U(iD,Y(Y({},e),{},{prefixCls:`${t.value}-input`}),null)]))}}),DD=`M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z`,OD=u({compatConfig:{MODE:3},name:`ASkeletonImage`,props:Br(rD(),[`size`,`shape`,`active`]),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,r.value));return()=>n(U(`div`,{class:i.value},[U(`div`,{class:`${t.value}-image`},[U(`svg`,{viewBox:`0 0 1098 1024`,xmlns:`http://www.w3.org/2000/svg`,class:`${t.value}-image-svg`},[U(`path`,{d:DD,class:`${t.value}-image-path`},null)])])]))}}),kD=u({compatConfig:{MODE:3},name:`ASkeletonAvatar`,props:Zn(Z(Z({},rD()),{shape:String}),{size:`default`,shape:`circle`}),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active},r.value));return()=>n(U(`div`,{class:i.value},[U(iD,Y(Y({},e),{},{prefixCls:`${t.value}-avatar`}),null)]))}});wD.Button=TD,wD.Avatar=kD,wD.Input=ED,wD.Image=OD,wD.Title=tD,wD.install=function(e){return e.component(wD.name,wD),e.component(wD.Button.name,TD),e.component(wD.Avatar.name,kD),e.component(wD.Input.name,ED),e.component(wD.Image.name,OD),e.component(wD.Title.name,tD),e};var AD=wD,{TabPane:jD}=GE,MD=u({compatConfig:{MODE:3},name:`ACard`,inheritAttrs:!1,props:{prefixCls:String,title:f.any,extra:f.any,bordered:{type:Boolean,default:!0},bodyStyle:{type:Object,default:void 0},headStyle:{type:Object,default:void 0},loading:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},type:{type:String},size:{type:String},actions:f.any,tabList:{type:Array},tabBarExtraContent:f.any,activeTabKey:String,defaultActiveTabKey:String,cover:f.any,onTabChange:{type:Function}},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a,size:o}=X(`card`,e),[s,c]=eD(i),l=e=>e.map((t,n)=>p(t)&&!Te(t)||!p(t)?U(`li`,{style:{width:`${100/e.length}%`},key:`action-${n}`},[U(`span`,null,[t])]):null),u=t=>{var n;(n=e.onTabChange)==null||n.call(e,t)},d=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t;return e.forEach(e=>{e&&ym(e.type)&&e.type.__ANT_CARD_GRID&&(t=!0)}),t};return()=>{let{headStyle:t={},bodyStyle:f={},loading:p,bordered:m=!0,type:h,tabList:g,hoverable:_,activeTabKey:v,defaultActiveTabKey:y,tabBarExtraContent:b=R(n.tabBarExtraContent?.call(n)),title:x=R(n.title?.call(n)),extra:S=R(n.extra?.call(n)),actions:C=R(n.actions?.call(n)),cover:w=R(n.cover?.call(n))}=e,T=ce(n.default?.call(n)),E=i.value,D={[`${E}`]:!0,[c.value]:!0,[`${E}-loading`]:p,[`${E}-bordered`]:m,[`${E}-hoverable`]:!!_,[`${E}-contain-grid`]:d(T),[`${E}-contain-tabs`]:g&&g.length,[`${E}-${o.value}`]:o.value,[`${E}-type-${h}`]:!!h,[`${E}-rtl`]:a.value===`rtl`},O=U(AD,{loading:!0,active:!0,paragraph:{rows:4},title:!1},{default:()=>[T]}),k=v!==void 0,A={size:`large`,[k?`activeKey`:`defaultActiveKey`]:k?v:y,onChange:u,class:`${E}-head-tabs`},j,M=g&&g.length?U(GE,A,{default:()=>[g.map(e=>{let{tab:t,slots:r}=e,i=r?.tab;pi(!r,`Card`,"tabList slots is deprecated, Please use `customTab` instead.");let a=t===void 0?n[i]?n[i](e):null:t;return a=uo(n,`customTab`,e,()=>[a]),U(jD,{tab:a,key:e.key,disabled:e.disabled},null)})],rightExtra:b?()=>b:null}):null;(x||S||M)&&(j=U(`div`,{class:`${E}-head`,style:t},[U(`div`,{class:`${E}-head-wrapper`},[x&&U(`div`,{class:`${E}-head-title`},[x]),S&&U(`div`,{class:`${E}-extra`},[S])]),M]));let N=w?U(`div`,{class:`${E}-cover`},[w]):null,P=U(`div`,{class:`${E}-body`,style:f},[p?O:T]),F=C&&C.length?U(`ul`,{class:`${E}-actions`},[l(C)]):null;return s(U(`div`,Y(Y({ref:`cardContainerRef`},r),{},{class:[D,r.class]}),[j,N,T&&T.length?P:null,F]))}}}),ND=u({compatConfig:{MODE:3},name:`ACardMeta`,props:{prefixCls:String,title:pt(),description:pt(),avatar:pt()},slots:Object,setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`card`,e);return()=>{let t={[`${r.value}-meta`]:!0},i=on(n,e,`avatar`),a=on(n,e,`title`),o=on(n,e,`description`),s=i?U(`div`,{class:`${r.value}-meta-avatar`},[i]):null,c=a?U(`div`,{class:`${r.value}-meta-title`},[a]):null,l=o?U(`div`,{class:`${r.value}-meta-description`},[o]):null,u=c||l?U(`div`,{class:`${r.value}-meta-detail`},[c,l]):null;return U(`div`,{class:t},[s,u])}}}),PD=u({compatConfig:{MODE:3},name:`ACardGrid`,__ANT_CARD_GRID:!0,props:{prefixCls:String,hoverable:{type:Boolean,default:!0}},setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`card`,e),i=J(()=>({[`${r.value}-grid`]:!0,[`${r.value}-grid-hoverable`]:e.hoverable}));return()=>U(`div`,{class:i.value},[n.default?.call(n)])}});MD.Meta=ND,MD.Grid=PD,MD.install=function(e){return e.component(MD.name,MD),e.component(ND.name,ND),e.component(PD.name,PD),e};var FD=MD,ID=()=>({prefixCls:String,activeKey:W([Array,Number,String]),defaultActiveKey:W([Array,Number,String]),accordion:Q(),destroyInactivePanel:Q(),bordered:Q(),expandIcon:d(),openAnimation:f.object,expandIconPosition:_(),collapsible:_(),ghost:Q(),onChange:d(),"onUpdate:activeKey":d()}),LD=()=>({openAnimation:f.object,prefixCls:String,header:f.any,headerClass:String,showArrow:Q(),isActive:Q(),destroyInactivePanel:Q(),disabled:Q(),accordion:Q(),forceRender:Q(),expandIcon:d(),extra:f.any,panelKey:W(),collapsible:_(),role:String,onItemClick:d()}),RD=e=>{let{componentCls:t,collapseContentBg:n,padding:r,collapseContentPaddingHorizontal:i,collapseHeaderBg:a,collapseHeaderPadding:s,collapsePanelBorderRadius:c,lineWidth:l,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:m,fontSize:h,lineHeight:g,marginSM:_,paddingSM:v,motionDurationSlow:y,fontSizeIcon:b}=e,x=`${l}px ${u} ${d}`;return{[t]:Z(Z({},rn(e)),{backgroundColor:a,border:x,borderBottom:0,borderRadius:`${c}px`,"&-rtl":{direction:`rtl`},[`& > ${t}-item`]:{borderBottom:x,"&:last-child":{[` + &, + & > ${t}-header`]:{borderRadius:`0 0 ${c}px ${c}px`}},[`> ${t}-header`]:{position:`relative`,display:`flex`,flexWrap:`nowrap`,alignItems:`flex-start`,padding:s,color:p,lineHeight:g,cursor:`pointer`,transition:`all ${y}, visibility 0s`,[`> ${t}-header-text`]:{flex:`auto`},"&:focus":{outline:`none`},[`${t}-expand-icon`]:{height:h*g,display:`flex`,alignItems:`center`,paddingInlineEnd:_},[`${t}-arrow`]:Z(Z({},o()),{fontSize:b,svg:{transition:`transform ${y}`}}),[`${t}-header-text`]:{marginInlineEnd:`auto`}},[`${t}-header-collapsible-only`]:{cursor:`default`,[`${t}-header-text`]:{flex:`none`,cursor:`pointer`},[`${t}-expand-icon`]:{cursor:`pointer`}},[`${t}-icon-collapsible-only`]:{cursor:`default`,[`${t}-expand-icon`]:{cursor:`pointer`}},[`&${t}-no-arrow`]:{[`> ${t}-header`]:{paddingInlineStart:v}}},[`${t}-content`]:{color:f,backgroundColor:n,borderTop:x,[`& > ${t}-content-box`]:{padding:`${r}px ${i}px`},"&-hidden":{display:`none`}},[`${t}-item:last-child`]:{[`> ${t}-content`]:{borderRadius:`0 0 ${c}px ${c}px`}},[`& ${t}-item-disabled > ${t}-header`]:{"\n &,\n & > .arrow\n ":{color:m,cursor:`not-allowed`}},[`&${t}-icon-position-end`]:{[`& > ${t}-item`]:{[`> ${t}-header`]:{[`${t}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:_}}}}})}},zD=e=>{let{componentCls:t}=e,n=`> ${t}-item > ${t}-header ${t}-arrow svg`;return{[`${t}-rtl`]:{[n]:{transform:`rotate(180deg)`}}}},BD=e=>{let{componentCls:t,collapseHeaderBg:n,paddingXXS:r,colorBorder:i}=e;return{[`${t}-borderless`]:{backgroundColor:n,border:0,[`> ${t}-item`]:{borderBottom:`1px solid ${i}`},[` + > ${t}-item:last-child, + > ${t}-item:last-child ${t}-header + `]:{borderRadius:0},[`> ${t}-item:last-child`]:{borderBottom:0},[`> ${t}-item > ${t}-content`]:{backgroundColor:`transparent`,borderTop:0},[`> ${t}-item > ${t}-content > ${t}-content-box`]:{paddingTop:r}}}},VD=e=>{let{componentCls:t,paddingSM:n}=e;return{[`${t}-ghost`]:{backgroundColor:`transparent`,border:0,[`> ${t}-item`]:{borderBottom:0,[`> ${t}-content`]:{backgroundColor:`transparent`,border:0,[`> ${t}-content-box`]:{paddingBlock:n}}}}}},HD=v(`Collapse`,e=>{let t=B(e,{collapseContentBg:e.colorBgContainer,collapseHeaderBg:e.colorFillAlter,collapseHeaderPadding:`${e.paddingSM}px ${e.padding}px`,collapsePanelBorderRadius:e.borderRadiusLG,collapseContentPaddingHorizontal:16});return[RD(t),BD(t),VD(t),zD(t),$_(t)]});function UD(e){let t=e;if(!Array.isArray(t)){let e=typeof t;t=e===`number`||e===`string`?[t]:[]}return t.map(e=>String(e))}var WD=u({compatConfig:{MODE:3},name:`ACollapse`,inheritAttrs:!1,props:Zn(ID(),{accordion:!1,destroyInactivePanel:!1,bordered:!0,expandIconPosition:`start`}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=H(UD(dy([e.activeKey,e.defaultActiveKey])));G(()=>e.activeKey,()=>{a.value=UD(e.activeKey)},{deep:!0});let{prefixCls:o,direction:s,rootPrefixCls:c}=X(`collapse`,e),[l,u]=HD(o),d=J(()=>{let{expandIconPosition:t}=e;return t===void 0?s.value===`rtl`?`end`:`start`:t}),f=t=>{let{expandIcon:n=r.expandIcon}=e,i=n?n(t):U(gx,{rotate:t.isActive?90:void 0},null);return U(`div`,{class:[`${o.value}-expand-icon`,u.value],onClick:()=>[`header`,`icon`].includes(e.collapsible)&&m(t.panelKey)},[Nt(Array.isArray(n)?i[0]:i)?ao(i,{class:`${o.value}-arrow`},!1):i])},p=t=>{e.activeKey===void 0&&(a.value=t);let n=e.accordion?t[0]:t;i(`update:activeKey`,n),i(`change`,n)},m=t=>{let n=a.value;if(e.accordion)n=n[0]===t?[]:[t];else{n=[...n];let e=n.indexOf(t);e>-1?n.splice(e,1):n.push(t)}p(n)},h=(t,n)=>{var r;if(Te(t))return;let i=a.value,{accordion:s,destroyInactivePanel:l,collapsible:u,openAnimation:d}=e,p=d||aS(`${c.value}-motion-collapse`),h=String(t.key??n),{header:g=((r=t.children)?.header)?.call(r),headerClass:_,collapsible:v,disabled:y}=t.props||{},b=!1;b=s?i[0]===h:i.indexOf(h)>-1;let x=v??u;return(y||y===``)&&(x=`disabled`),ao(t,{key:h,panelKey:h,header:g,headerClass:_,isActive:b,prefixCls:o.value,destroyInactivePanel:l,openAnimation:p,accordion:s,onItemClick:x===`disabled`?null:m,expandIcon:f,collapsible:x})},g=()=>ce(r.default?.call(r)).map(h);return()=>{let{accordion:t,bordered:r,ghost:i}=e,a=K(o.value,{[`${o.value}-borderless`]:!r,[`${o.value}-icon-position-${d.value}`]:!0,[`${o.value}-rtl`]:s.value===`rtl`,[`${o.value}-ghost`]:!!i,[n.class]:!!n.class},u.value);return l(U(`div`,Y(Y({class:a},Xe(n)),{},{style:n.style,role:t?`tablist`:null}),[g()]))}}}),GD=u({compatConfig:{MODE:3},name:`PanelContent`,props:LD(),setup(e,t){let{slots:n}=t,r=q(!1);return S(()=>{(e.isActive||e.forceRender)&&(r.value=!0)}),()=>{if(!r.value)return null;let{prefixCls:t,isActive:i,role:a}=e;return U(`div`,{class:K(`${t}-content`,{[`${t}-content-active`]:i,[`${t}-content-inactive`]:!i}),role:a},[U(`div`,{class:`${t}-content-box`},[n.default?.call(n)])])}}}),KD=u({compatConfig:{MODE:3},name:`ACollapsePanel`,inheritAttrs:!1,props:Zn(LD(),{showArrow:!0,isActive:!1,onItemClick(){},headerClass:``,forceRender:!1}),slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t;pi(e.disabled===void 0,`Collapse.Panel`,'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');let{prefixCls:a}=X(`collapse`,e),o=()=>{r(`itemClick`,e.panelKey)},s=e=>{(e.key===`Enter`||e.keyCode===13||e.which===13)&&o()};return()=>{let{header:t=n.header?.call(n),headerClass:r,isActive:c,showArrow:l,destroyInactivePanel:u,accordion:d,forceRender:f,openAnimation:p,expandIcon:m=n.expandIcon,extra:h=n.extra?.call(n),collapsible:g}=e,_=g===`disabled`,v=a.value,y=K(`${v}-header`,{[r]:r,[`${v}-header-collapsible-only`]:g===`header`,[`${v}-icon-collapsible-only`]:g===`icon`}),b=K({[`${v}-item`]:!0,[`${v}-item-active`]:c,[`${v}-item-disabled`]:_,[`${v}-no-arrow`]:!l,[`${i.class}`]:!!i.class}),x=U(`i`,{class:`arrow`},null);l&&typeof m==`function`&&(x=m(e));let S=Mt(U(GD,{prefixCls:v,isActive:c,forceRender:f,role:d?`tabpanel`:null},{default:n.default}),[[ht,c]]),C=Z({appear:!1,css:!1},p);return U(`div`,Y(Y({},i),{},{class:b}),[U(`div`,{class:y,onClick:()=>![`header`,`icon`].includes(g)&&o(),role:d?`tab`:`button`,tabindex:_?-1:0,"aria-expanded":c,onKeypress:s},[l&&x,U(`span`,{onClick:()=>g===`header`&&o(),class:`${v}-header-text`},[t]),h&&U(`div`,{class:`${v}-extra`},[h])]),U(Re,C,{default:()=>[!u||c?S:null]})])}}});WD.Panel=KD,WD.install=function(e){return e.component(WD.name,WD),e.component(KD.name,KD),e};var qD=WD,JD=function(e){return e.replace(/[A-Z]/g,function(e){return`-`+e.toLowerCase()}).toLowerCase()},YD=function(e){return/[height|width]$/.test(e)},XD=function(e){let t=``,n=Object.keys(e);return n.forEach(function(r,i){let a=e[r];r=JD(r),YD(r)&&typeof a==`number`&&(a+=`px`),a===!0?t+=r:a===!1?t+=`not `+r:t+=`(`+r+`: `+a+`)`,i{[`touchstart`,`touchmove`,`wheel`].includes(e.type)||e.preventDefault()},nO=e=>{let t=[],n=rO(e),r=iO(e);for(let i=n;ie.currentSlide-aO(e),iO=e=>e.currentSlide+oO(e),aO=e=>e.centerMode?Math.floor(e.slidesToShow/2)+ +(parseInt(e.centerPadding)>0):0,oO=e=>e.centerMode?Math.floor((e.slidesToShow-1)/2)+1+ +(parseInt(e.centerPadding)>0):e.slidesToShow,sO=e=>e&&e.offsetWidth||0,cO=e=>e&&e.offsetHeight||0,lO=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r=e.startX-e.curX,i=e.startY-e.curY;return n=Math.round(Math.atan2(i,r)*180/Math.PI),n<0&&(n=360-Math.abs(n)),n<=45&&n>=0||n<=360&&n>=315?`left`:n>=135&&n<=225?`right`:t===!0?n>=35&&n<=135?`up`:`down`:`vertical`},uO=e=>{let t=!0;return e.infinite||(e.centerMode&&e.currentSlide>=e.slideCount-1||e.slideCount<=e.slidesToShow||e.currentSlide>=e.slideCount-e.slidesToShow)&&(t=!1),t},dO=(e,t)=>{let n={};return t.forEach(t=>n[t]=e[t]),n},fO=e=>{let t=e.children.length,n=e.listRef,r=Math.ceil(sO(n)),i=e.trackRef,a=Math.ceil(sO(i)),o;if(e.vertical)o=r;else{let t=e.centerMode&&parseInt(e.centerPadding)*2;typeof e.centerPadding==`string`&&e.centerPadding.slice(-1)===`%`&&(t*=r/100),o=Math.ceil((r-t)/e.slidesToShow)}let s=n&&cO(n.querySelector(`[data-index="0"]`)),c=s*e.slidesToShow,l=e.currentSlide===void 0?e.initialSlide:e.currentSlide;e.rtl&&e.currentSlide===void 0&&(l=t-1-e.initialSlide);let u=e.lazyLoadedList||[],d=nO(Z(Z({},e),{currentSlide:l,lazyLoadedList:u}),e);u=u.concat(d);let f={slideCount:t,slideWidth:o,listWidth:r,trackWidth:a,currentSlide:l,slideHeight:s,listHeight:c,lazyLoadedList:u};return e.autoplaying===null&&e.autoplay&&(f.autoplaying=`playing`),f},pO=e=>{let{waitForAnimate:t,animating:n,fade:r,infinite:i,index:a,slideCount:o,lazyLoad:s,currentSlide:c,centerMode:l,slidesToScroll:u,slidesToShow:d,useCSS:f}=e,{lazyLoadedList:p}=e;if(t&&n)return{};let m=a,h,g,_,v={},y={},b=i?a:eO(a,0,o-1);if(r){if(!i&&(a<0||a>=o))return{};a<0?m=a+o:a>=o&&(m=a-o),s&&p.indexOf(m)<0&&(p=p.concat(m)),v={animating:!0,currentSlide:m,lazyLoadedList:p,targetSlide:m},y={animating:!1,targetSlide:m}}else h=m,m<0?(h=m+o,i?o%u!==0&&(h=o-o%u):h=0):!uO(e)&&m>c?m=h=c:l&&m>=o?(m=i?o:o-1,h=i?0:o-1):m>=o&&(h=m-o,i?o%u!==0&&(h=0):h=o-d),!i&&m+d>=o&&(h=o-d),g=TO(Z(Z({},e),{slideIndex:m})),_=TO(Z(Z({},e),{slideIndex:h})),i||(g===_&&(m=h),g=_),s&&(p=p.concat(nO(Z(Z({},e),{currentSlide:m})))),f?(v={animating:!0,currentSlide:h,trackStyle:wO(Z(Z({},e),{left:g})),lazyLoadedList:p,targetSlide:b},y={animating:!1,currentSlide:h,trackStyle:CO(Z(Z({},e),{left:_})),swipeLeft:null,targetSlide:b}):v={currentSlide:h,trackStyle:CO(Z(Z({},e),{left:_})),lazyLoadedList:p,targetSlide:b};return{state:v,nextState:y}},mO=(e,t)=>{let n,r,i,{slidesToScroll:a,slidesToShow:o,slideCount:s,currentSlide:c,targetSlide:l,lazyLoad:u,infinite:d}=e,f=s%a===0?(s-c)%a:0;if(t.message===`previous`)r=f===0?a:o-f,i=c-r,u&&!d&&(n=c-r,i=n===-1?s-1:n),d||(i=l-a);else if(t.message===`next`)r=f===0?a:f,i=c+r,u&&!d&&(i=(c+a)%s+f),d||(i=l+a);else if(t.message===`dots`)i=t.index*t.slidesToScroll;else if(t.message===`children`){if(i=t.index,d){let n=kO(Z(Z({},e),{targetSlide:i}));i>t.currentSlide&&n===`left`?i-=s:ie.target.tagName.match(`TEXTAREA|INPUT|SELECT`)||!t?``:e.keyCode===37?n?`next`:`previous`:e.keyCode===39?n?`previous`:`next`:``,gO=(e,t,n)=>(e.target.tagName===`IMG`&&tO(e),!t||!n&&e.type.indexOf(`mouse`)!==-1?``:{dragging:!0,touchObject:{startX:e.touches?e.touches[0].pageX:e.clientX,startY:e.touches?e.touches[0].pageY:e.clientY,curX:e.touches?e.touches[0].pageX:e.clientX,curY:e.touches?e.touches[0].pageY:e.clientY}}),_O=(e,t)=>{let{scrolling:n,animating:r,vertical:i,swipeToSlide:a,verticalSwiping:o,rtl:s,currentSlide:c,edgeFriction:l,edgeDragged:u,onEdge:d,swiped:f,swiping:p,slideCount:m,slidesToScroll:h,infinite:g,touchObject:_,swipeEvent:v,listHeight:y,listWidth:b}=t;if(n)return;if(r)return tO(e);i&&a&&o&&tO(e);let x,S={},C=TO(t);_.curX=e.touches?e.touches[0].pageX:e.clientX,_.curY=e.touches?e.touches[0].pageY:e.clientY,_.swipeLength=Math.round(Math.sqrt((_.curX-_.startX)**2));let w=Math.round(Math.sqrt((_.curY-_.startY)**2));if(!o&&!p&&w>10)return{scrolling:!0};o&&(_.swipeLength=w);let T=(s?-1:1)*(_.curX>_.startX?1:-1);o&&(T=_.curY>_.startY?1:-1);let E=Math.ceil(m/h),D=lO(t.touchObject,o),O=_.swipeLength;return g||(c===0&&(D===`right`||D===`down`)||c+1>=E&&(D===`left`||D===`up`)||!uO(t)&&(D===`left`||D===`up`))&&(O=_.swipeLength*l,u===!1&&d&&(d(D),S.edgeDragged=!0)),!f&&v&&(v(D),S.swiped=!0),x=i?C+y/b*O*T:s?C-O*T:C+O*T,o&&(x=C+O*T),S=Z(Z({},S),{touchObject:_,swipeLeft:x,trackStyle:CO(Z(Z({},t),{left:x}))}),Math.abs(_.curX-_.startX)10&&(S.swiping=!0,tO(e)),S},vO=(e,t)=>{let{dragging:n,swipe:r,touchObject:i,listWidth:a,touchThreshold:o,verticalSwiping:s,listHeight:c,swipeToSlide:l,scrolling:u,onSwipe:d,targetSlide:f,currentSlide:p,infinite:m}=t;if(!n)return r&&tO(e),{};let h=s?c/o:a/o,g=lO(i,s),_={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(u||!i.swipeLength)return _;if(i.swipeLength>h){tO(e),d&&d(g);let n,r,i=m?p:f;switch(g){case`left`:case`up`:r=i+xO(t),n=l?bO(t,r):r,_.currentDirection=0;break;case`right`:case`down`:r=i-xO(t),n=l?bO(t,r):r,_.currentDirection=1;break;default:n=i}_.triggerSlideHandler=n}else{let e=TO(t);_.trackStyle=wO(Z(Z({},t),{left:e}))}return _},yO=e=>{let t=e.infinite?e.slideCount*2:e.slideCount,n=e.infinite?e.slidesToShow*-1:0,r=e.infinite?e.slidesToShow*-1:0,i=[];for(;n{let n=yO(e),r=0;if(t>n[n.length-1])t=n[n.length-1];else for(let e in n){if(t{let t=e.centerMode?e.slideWidth*Math.floor(e.slidesToShow/2):0;if(e.swipeToSlide){let n,r=e.listRef,i=r.querySelectorAll&&r.querySelectorAll(`.slick-slide`)||[];if(Array.from(i).every(r=>{if(!e.vertical){if(r.offsetLeft-t+sO(r)/2>e.swipeLeft*-1)return n=r,!1}else if(r.offsetTop+cO(r)/2>e.swipeLeft*-1)return n=r,!1;return!0}),!n)return 0;let a=e.rtl===!0?e.slideCount-e.currentSlide:e.currentSlide;return Math.abs(n.dataset.index-a)||1}else return e.slidesToScroll},SO=(e,t)=>t.reduce((t,n)=>t&&e.hasOwnProperty(n),!0)?null:console.error(`Keys Missing:`,e),CO=e=>{SO(e,[`left`,`variableWidth`,`slideCount`,`slidesToShow`,`slideWidth`]);let t,n,r=e.slideCount+2*e.slidesToShow;e.vertical?n=r*e.slideHeight:t=OO(e)*e.slideWidth;let i={opacity:1,transition:``,WebkitTransition:``};if(e.useTransform){let t=e.vertical?`translate3d(0px, `+e.left+`px, 0px)`:`translate3d(`+e.left+`px, 0px, 0px)`,n=e.vertical?`translate3d(0px, `+e.left+`px, 0px)`:`translate3d(`+e.left+`px, 0px, 0px)`,r=e.vertical?`translateY(`+e.left+`px)`:`translateX(`+e.left+`px)`;i=Z(Z({},i),{WebkitTransform:t,transform:n,msTransform:r})}else e.vertical?i.top=e.left:i.left=e.left;return e.fade&&(i={opacity:1}),t&&(i.width=t+`px`),n&&(i.height=n+`px`),window&&!window.addEventListener&&window.attachEvent&&(e.vertical?i.marginTop=e.left+`px`:i.marginLeft=e.left+`px`),i},wO=e=>{SO(e,[`left`,`variableWidth`,`slideCount`,`slidesToShow`,`slideWidth`,`speed`,`cssEase`]);let t=CO(e);return e.useTransform?(t.WebkitTransition=`-webkit-transform `+e.speed+`ms `+e.cssEase,t.transition=`transform `+e.speed+`ms `+e.cssEase):e.vertical?t.transition=`top `+e.speed+`ms `+e.cssEase:t.transition=`left `+e.speed+`ms `+e.cssEase,t},TO=e=>{if(e.unslick)return 0;SO(e,[`slideIndex`,`trackRef`,`infinite`,`centerMode`,`slideCount`,`slidesToShow`,`slidesToScroll`,`slideWidth`,`listWidth`,`variableWidth`,`slideHeight`]);let{slideIndex:t,trackRef:n,infinite:r,centerMode:i,slideCount:a,slidesToShow:o,slidesToScroll:s,slideWidth:c,listWidth:l,variableWidth:u,slideHeight:d,fade:f,vertical:p}=e,m=0,h,g,_=0;if(f||e.slideCount===1)return 0;let v=0;if(r?(v=-EO(e),a%s!==0&&t+s>a&&(v=-(t>a?o-(t-a):a%s)),i&&(v+=parseInt(o/2))):(a%s!==0&&t+s>a&&(v=o-a%s),i&&(v=parseInt(o/2))),m=v*c,_=v*d,h=p?t*d*-1+_:t*c*-1+m,u===!0){let a,o=n;if(a=t+EO(e),g=o&&o.childNodes[a],h=g?g.offsetLeft*-1:0,i===!0){a=r?t+EO(e):t,g=o&&o.children[a],h=0;for(let e=0;ee.unslick||!e.infinite?0:e.variableWidth?e.slideCount:e.slidesToShow+ +!!e.centerMode,DO=e=>e.unslick||!e.infinite?0:e.slideCount,OO=e=>e.slideCount===1?1:EO(e)+e.slideCount+DO(e),kO=e=>e.targetSlide>e.currentSlide?e.targetSlide>e.currentSlide+AO(e)?`left`:`right`:e.targetSlide{let{slidesToShow:t,centerMode:n,rtl:r,centerPadding:i}=e;if(n){let e=(t-1)/2+1;return parseInt(i)>0&&(e+=1),r&&t%2==0&&(e+=1),e}return r?0:t-1},jO=e=>{let{slidesToShow:t,centerMode:n,rtl:r,centerPadding:i}=e;if(n){let e=(t-1)/2+1;return parseInt(i)>0&&(e+=1),!r&&t%2==0&&(e+=1),e}return r?t-1:0},MO=()=>!!(typeof window<`u`&&window.document&&window.document.createElement),NO=e=>{let t,n,r,i;i=e.rtl?e.slideCount-1-e.index:e.index;let a=i<0||i>=e.slideCount;e.centerMode?(r=Math.floor(e.slidesToShow/2),n=(i-e.currentSlide)%e.slideCount===0,i>e.currentSlide-r-1&&i<=e.currentSlide+r&&(t=!0)):t=e.currentSlide<=i&&i=e.slideCount?e.targetSlide-e.slideCount:e.targetSlide,{"slick-slide":!0,"slick-active":t,"slick-center":n,"slick-cloned":a,"slick-current":i===o}},PO=function(e){let t={};return(e.variableWidth===void 0||e.variableWidth===!1)&&(t.width=e.slideWidth+(typeof e.slideWidth==`number`?`px`:``)),e.fade&&(t.position=`relative`,e.vertical?t.top=-e.index*parseInt(e.slideHeight)+`px`:t.left=-e.index*parseInt(e.slideWidth)+`px`,t.opacity=+(e.currentSlide===e.index),e.useCSS&&(t.transition=`opacity `+e.speed+`ms `+e.cssEase+`, visibility `+e.speed+`ms `+e.cssEase)),t},FO=(e,t)=>e.key+`-`+t,IO=function(e,t){let n,r=[],i=[],a=[],o=t.length,s=rO(e),c=iO(e);return t.forEach((t,l)=>{let u,d={message:`children`,index:l,slidesToScroll:e.slidesToScroll,currentSlide:e.currentSlide};u=!e.lazyLoad||e.lazyLoad&&e.lazyLoadedList.indexOf(l)>=0?t:U(`div`);let f=PO(Z(Z({},e),{index:l})),p=u.props.class||``,m=NO(Z(Z({},e),{index:l}));if(r.push(so(u,{key:`original`+FO(u,l),tabindex:`-1`,"data-index":l,"aria-hidden":!m[`slick-active`],class:K(m,p),style:Z(Z({outline:`none`},u.props.style||{}),f),onClick:()=>{e.focusOnSelect&&e.focusOnSelect(d)}})),e.infinite&&e.fade===!1){let r=o-l;r<=EO(e)&&o!==e.slidesToShow&&(n=-r,n>=s&&(u=t),m=NO(Z(Z({},e),{index:n})),i.push(so(u,{key:`precloned`+FO(u,n),class:K(m,p),tabindex:`-1`,"data-index":n,"aria-hidden":!m[`slick-active`],style:Z(Z({},u.props.style||{}),f),onClick:()=>{e.focusOnSelect&&e.focusOnSelect(d)}}))),o!==e.slidesToShow&&(n=o+l,n{e.focusOnSelect&&e.focusOnSelect(d)}})))}}),e.rtl?i.concat(r,a).reverse():i.concat(r,a)},LO=(e,t)=>{let{attrs:n,slots:r}=t,i=IO(n,ce(r?.default())),{onMouseenter:a,onMouseover:o,onMouseleave:s}=n,c={onMouseenter:a,onMouseover:o,onMouseleave:s};return U(`div`,Z({class:`slick-track`,style:n.trackStyle},c),[i])};LO.inheritAttrs=!1;var RO=function(e){let t;return t=e.infinite?Math.ceil(e.slideCount/e.slidesToScroll):Math.ceil((e.slideCount-e.slidesToShow)/e.slidesToScroll)+1,t},zO=(e,t)=>{let{attrs:n}=t,{slideCount:r,slidesToScroll:i,slidesToShow:a,infinite:o,currentSlide:s,appendDots:c,customPaging:l,clickHandler:u,dotsClass:d,onMouseenter:f,onMouseover:p,onMouseleave:m}=n,h=RO({slideCount:r,slidesToScroll:i,slidesToShow:a,infinite:o}),g={onMouseenter:f,onMouseover:p,onMouseleave:m},_=[];for(let e=0;e=c&&s<=n:s===c}),f={message:`dots`,index:e,slidesToScroll:i,currentSlide:s};function p(e){e&&e.preventDefault(),u(f)}_=_.concat(U(`li`,{key:e,class:d},[ao(l({i:e}),{onClick:p})]))}return ao(c({dots:_}),Z({class:d},g))};zO.inheritAttrs=!1;function BO(){}function VO(e,t,n){n&&n.preventDefault(),t(e,n)}var HO=(e,t)=>{let{attrs:n}=t,{clickHandler:r,infinite:i,currentSlide:a,slideCount:o,slidesToShow:s}=n,c={"slick-arrow":!0,"slick-prev":!0},l=function(e){VO({message:`previous`},r,e)};!i&&(a===0||o<=s)&&(c[`slick-disabled`]=!0,l=BO);let u={key:`0`,"data-role":`none`,class:c,style:{display:`block`},onClick:l},d={currentSlide:a,slideCount:o},f;return f=n.prevArrow?ao(n.prevArrow(Z(Z({},u),d)),{key:`0`,class:c,style:{display:`block`},onClick:l},!1):U(`button`,Y({key:`0`,type:`button`},u),[` `,en(`Previous`)]),f};HO.inheritAttrs=!1;var UO=(e,t)=>{let{attrs:n}=t,{clickHandler:r,currentSlide:i,slideCount:a}=n,o={"slick-arrow":!0,"slick-next":!0},s=function(e){VO({message:`next`},r,e)};uO(n)||(o[`slick-disabled`]=!0,s=BO);let c={key:`1`,"data-role":`none`,class:K(o),style:{display:`block`},onClick:s},l={currentSlide:i,slideCount:a},u;return u=n.nextArrow?ao(n.nextArrow(Z(Z({},c),l)),{key:`1`,class:K(o),style:{display:`block`},onClick:s},!1):U(`button`,Y({key:`1`,type:`button`},c),[` `,en(`Next`)]),u};UO.inheritAttrs=!1;var WO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{this.currentSlide>=e.children.length&&this.changeSlide({message:`index`,index:e.children.length-e.slidesToShow,currentSlide:this.currentSlide}),!this.preProps.autoplay&&e.autoplay?this.handleAutoPlay(`playing`):e.autoplay?this.handleAutoPlay(`update`):this.pause(`paused`)}),this.preProps=Z({},e)}},mounted(){if(this.__emit(`init`),this.lazyLoad){let e=nO(Z(Z({},this.$props),this.$data));e.length>0&&(this.setState(t=>({lazyLoadedList:t.lazyLoadedList.concat(e)})),this.__emit(`lazyLoad`,e))}this.$nextTick(()=>{let e=Z({listRef:this.list,trackRef:this.track,children:this.children},this.$props);this.updateState(e,!0,()=>{this.adaptHeight(),this.autoplay&&this.handleAutoPlay(`playing`)}),this.lazyLoad===`progressive`&&(this.lazyLoadTimer=setInterval(this.progressiveLazyLoad,1e3)),this.ro=new Xn(()=>{this.animating?(this.onWindowResized(!1),this.callbackTimers.push(setTimeout(()=>this.onWindowResized(),this.speed))):this.onWindowResized()}),this.ro.observe(this.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(`.slick-slide`),e=>{e.onfocus=this.$props.pauseOnFocus?this.onSlideFocus:null,e.onblur=this.$props.pauseOnFocus?this.onSlideBlur:null}),window.addEventListener?window.addEventListener(`resize`,this.onWindowResized):window.attachEvent(`onresize`,this.onWindowResized)})},beforeUnmount(){var e;this.animationEndCallback&&clearTimeout(this.animationEndCallback),this.lazyLoadTimer&&clearInterval(this.lazyLoadTimer),this.callbackTimers.length&&(this.callbackTimers.forEach(e=>clearTimeout(e)),this.callbackTimers=[]),window.addEventListener?window.removeEventListener(`resize`,this.onWindowResized):window.detachEvent(`onresize`,this.onWindowResized),this.autoplayTimer&&clearInterval(this.autoplayTimer),(e=this.ro)==null||e.disconnect()},updated(){if(this.checkImagesLoad(),this.__emit(`reInit`),this.lazyLoad){let e=nO(Z(Z({},this.$props),this.$data));e.length>0&&(this.setState(t=>({lazyLoadedList:t.lazyLoadedList.concat(e)})),this.__emit(`lazyLoad`))}this.adaptHeight()},methods:{listRefHandler(e){this.list=e},trackRefHandler(e){this.track=e},adaptHeight(){if(this.adaptiveHeight&&this.list){let e=this.list.querySelector(`[data-index="${this.currentSlide}"]`);this.list.style.height=cO(e)+`px`}},onWindowResized(e){this.debouncedResize&&this.debouncedResize.cancel(),this.debouncedResize=Eg(()=>this.resizeWindow(e),50),this.debouncedResize()},resizeWindow(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.track)return;let t=Z(Z({listRef:this.list,trackRef:this.track,children:this.children},this.$props),this.$data);this.updateState(t,e,()=>{this.autoplay?this.handleAutoPlay(`update`):this.pause(`paused`)}),this.setState({animating:!1}),clearTimeout(this.animationEndCallback),delete this.animationEndCallback},updateState(e,t,n){let r=fO(e);e=Z(Z(Z({},e),r),{slideIndex:r.currentSlide});let i=TO(e);e=Z(Z({},e),{left:i});let a=CO(e);(t||this.children.length!==e.children.length)&&(r.trackStyle=a),this.setState(r,n)},ssrInit(){let e=this.children;if(this.variableWidth){let t=0,n=0,r=[],i=EO(Z(Z(Z({},this.$props),this.$data),{slideCount:e.length})),a=DO(Z(Z(Z({},this.$props),this.$data),{slideCount:e.length}));e.forEach(e=>{let n=(e.props.style?.width)?.split(`px`)[0]||0;r.push(n),t+=n});for(let e=0;e{let r=()=>++n&&n>=t&&this.onWindowResized();if(!e.onclick)e.onclick=()=>e.parentNode.focus();else{let t=e.onclick;e.onclick=()=>{t(),e.parentNode.focus()}}e.onload||(this.$props.lazyLoad?e.onload=()=>{this.adaptHeight(),this.callbackTimers.push(setTimeout(this.onWindowResized,this.speed))}:(e.onload=r,e.onerror=()=>{r(),this.__emit(`lazyLoadError`)}))})},progressiveLazyLoad(){let e=[],t=Z(Z({},this.$props),this.$data);for(let n=this.currentSlide;n=-EO(t);n--)if(this.lazyLoadedList.indexOf(n)<0){e.push(n);break}e.length>0?(this.setState(t=>({lazyLoadedList:t.lazyLoadedList.concat(e)})),this.__emit(`lazyLoad`,e)):this.lazyLoadTimer&&(clearInterval(this.lazyLoadTimer),delete this.lazyLoadTimer)},slideHandler(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],{asNavFor:n,beforeChange:r,speed:i,afterChange:a}=this.$props,{state:o,nextState:s}=pO(Z(Z(Z({index:e},this.$props),this.$data),{trackRef:this.track,useCSS:this.useCSS&&!t}));if(!o)return;r&&r(this.currentSlide,o.currentSlide);let c=o.lazyLoadedList.filter(e=>this.lazyLoadedList.indexOf(e)<0);this.$attrs.onLazyLoad&&c.length>0&&this.__emit(`lazyLoad`,c),!this.$props.waitForAnimate&&this.animationEndCallback&&(clearTimeout(this.animationEndCallback),a&&a(this.currentSlide),delete this.animationEndCallback),this.setState(o,()=>{n&&this.asNavForIndex!==e&&(this.asNavForIndex=e,n.innerSlider.slideHandler(e)),s&&(this.animationEndCallback=setTimeout(()=>{let{animating:e}=s,t=WO(s,[`animating`]);this.setState(t,()=>{this.callbackTimers.push(setTimeout(()=>this.setState({animating:e}),10)),a&&a(o.currentSlide),delete this.animationEndCallback})},i))})},changeSlide(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=mO(Z(Z({},this.$props),this.$data),e);if(!(n!==0&&!n)&&(t===!0?this.slideHandler(n,t):this.slideHandler(n),this.$props.autoplay&&this.handleAutoPlay(`update`),this.$props.focusOnSelect)){let e=this.list.querySelectorAll(`.slick-current`);e[0]&&e[0].focus()}},clickHandler(e){this.clickable===!1&&(e.stopPropagation(),e.preventDefault()),this.clickable=!0},keyHandler(e){let t=hO(e,this.accessibility,this.rtl);t!==``&&this.changeSlide({message:t})},selectHandler(e){this.changeSlide(e)},disableBodyScroll(){window.ontouchmove=e=>{e||=window.event,e.preventDefault&&e.preventDefault(),e.returnValue=!1}},enableBodyScroll(){window.ontouchmove=null},swipeStart(e){this.verticalSwiping&&this.disableBodyScroll();let t=gO(e,this.swipe,this.draggable);t!==``&&this.setState(t)},swipeMove(e){let t=_O(e,Z(Z(Z({},this.$props),this.$data),{trackRef:this.track,listRef:this.list,slideIndex:this.currentSlide}));t&&(t.swiping&&(this.clickable=!1),this.setState(t))},swipeEnd(e){let t=vO(e,Z(Z(Z({},this.$props),this.$data),{trackRef:this.track,listRef:this.list,slideIndex:this.currentSlide}));if(!t)return;let n=t.triggerSlideHandler;delete t.triggerSlideHandler,this.setState(t),n!==void 0&&(this.slideHandler(n),this.$props.verticalSwiping&&this.enableBodyScroll())},touchEnd(e){this.swipeEnd(e),this.clickable=!0},slickPrev(){this.callbackTimers.push(setTimeout(()=>this.changeSlide({message:`previous`}),0))},slickNext(){this.callbackTimers.push(setTimeout(()=>this.changeSlide({message:`next`}),0))},slickGoTo(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(e=Number(e),isNaN(e))return``;this.callbackTimers.push(setTimeout(()=>this.changeSlide({message:`index`,index:e,currentSlide:this.currentSlide},t),0))},play(){let e;if(this.rtl)e=this.currentSlide-this.slidesToScroll;else if(uO(Z(Z({},this.$props),this.$data)))e=this.currentSlide+this.slidesToScroll;else return!1;this.slideHandler(e)},handleAutoPlay(e){this.autoplayTimer&&clearInterval(this.autoplayTimer);let t=this.autoplaying;if(e===`update`){if(t===`hovered`||t===`focused`||t===`paused`)return}else if(e===`leave`){if(t===`paused`||t===`focused`)return}else if(e===`blur`&&(t===`paused`||t===`hovered`))return;this.autoplayTimer=setInterval(this.play,this.autoplaySpeed+50),this.setState({autoplaying:`playing`})},pause(e){this.autoplayTimer&&=(clearInterval(this.autoplayTimer),null);let t=this.autoplaying;e===`paused`?this.setState({autoplaying:`paused`}):e===`focused`?(t===`hovered`||t===`playing`)&&this.setState({autoplaying:`focused`}):t===`playing`&&this.setState({autoplaying:`hovered`})},onDotsOver(){this.autoplay&&this.pause(`hovered`)},onDotsLeave(){this.autoplay&&this.autoplaying===`hovered`&&this.handleAutoPlay(`leave`)},onTrackOver(){this.autoplay&&this.pause(`hovered`)},onTrackLeave(){this.autoplay&&this.autoplaying===`hovered`&&this.handleAutoPlay(`leave`)},onSlideFocus(){this.autoplay&&this.pause(`focused`)},onSlideBlur(){this.autoplay&&this.autoplaying===`focused`&&this.handleAutoPlay(`blur`)},customPaging(e){let{i:t}=e;return U(`button`,null,[t+1])},appendDots(e){let{dots:t}=e;return U(`ul`,{style:{display:`block`}},[t])}},render(){let e=K(`slick-slider`,this.$attrs.class,{"slick-vertical":this.vertical,"slick-initialized":!0}),t=Z(Z({},this.$props),this.$data),n=dO(t,[`fade`,`cssEase`,`speed`,`infinite`,`centerMode`,`focusOnSelect`,`currentSlide`,`lazyLoad`,`lazyLoadedList`,`rtl`,`slideWidth`,`slideHeight`,`listHeight`,`vertical`,`slidesToShow`,`slidesToScroll`,`slideCount`,`trackStyle`,`variableWidth`,`unslick`,`centerPadding`,`targetSlide`,`useCSS`]),{pauseOnHover:r}=this.$props;n=Z(Z({},n),{focusOnSelect:this.focusOnSelect&&this.clickable?this.selectHandler:null,ref:this.trackRefHandler,onMouseleave:r?this.onTrackLeave:GO,onMouseover:r?this.onTrackOver:GO});let i;if(this.dots===!0&&this.slideCount>=this.slidesToShow){let e=dO(t,[`dotsClass`,`slideCount`,`slidesToShow`,`currentSlide`,`slidesToScroll`,`clickHandler`,`children`,`infinite`,`appendDots`]);e.customPaging=this.customPaging,e.appendDots=this.appendDots;let{customPaging:n,appendDots:r}=this.$slots;n&&(e.customPaging=n),r&&(e.appendDots=r);let{pauseOnDotsHover:a}=this.$props;e=Z(Z({},e),{clickHandler:this.changeSlide,onMouseover:a?this.onDotsOver:GO,onMouseleave:a?this.onDotsLeave:GO}),i=U(zO,e,null)}let a,o,s=dO(t,[`infinite`,`centerMode`,`currentSlide`,`slideCount`,`slidesToShow`]);s.clickHandler=this.changeSlide;let{prevArrow:c,nextArrow:l}=this.$slots;c&&(s.prevArrow=c),l&&(s.nextArrow=l),this.arrows&&(a=U(HO,s,null),o=U(UO,s,null));let u=null;this.vertical&&(u={height:typeof this.listHeight==`number`?`${this.listHeight}px`:this.listHeight});let d=null;this.vertical===!1?this.centerMode===!0&&(d={padding:`0px `+this.centerPadding}):this.centerMode===!0&&(d={padding:this.centerPadding+` 0px`});let f=Z(Z({},u),d),p=this.touchMove,m={ref:this.listRefHandler,class:`slick-list`,style:f,onClick:this.clickHandler,onMousedown:p?this.swipeStart:GO,onMousemove:this.dragging&&p?this.swipeMove:GO,onMouseup:p?this.swipeEnd:GO,onMouseleave:this.dragging&&p?this.swipeEnd:GO,[sr?`onTouchstartPassive`:`onTouchstart`]:p?this.swipeStart:GO,[sr?`onTouchmovePassive`:`onTouchmove`]:this.dragging&&p?this.swipeMove:GO,onTouchend:p?this.touchEnd:GO,onTouchcancel:this.dragging&&p?this.swipeEnd:GO,onKeydown:this.accessibility?this.keyHandler:GO},h={class:e,dir:`ltr`,style:this.$attrs.style};return this.unslick&&(m={class:`slick-list`,ref:this.listRefHandler},h={class:e}),U(`div`,h,[this.unslick?``:a,U(`div`,m,[U(LO,n,{default:()=>[this.children]})]),this.unslick?``:o,this.unslick?``:i])}},qO=u({name:`Slider`,mixins:[cu],inheritAttrs:!1,props:Z({},QD),data(){return this._responsiveMediaHandlers=[],{breakpoint:null}},mounted(){if(this.responsive){let e=this.responsive.map(e=>e.breakpoint);e.sort((e,t)=>e-t),e.forEach((t,n)=>{let r;r=ZD(n===0?{minWidth:0,maxWidth:t}:{minWidth:e[n-1]+1,maxWidth:t}),MO()&&this.media(r,()=>{this.setState({breakpoint:t})})});let t=ZD({minWidth:e.slice(-1)[0]});MO()&&this.media(t,()=>{this.setState({breakpoint:null})})}},beforeUnmount(){this._responsiveMediaHandlers.forEach(function(e){e.mql.removeListener(e.listener)})},methods:{innerSliderRefHandler(e){this.innerSlider=e},media(e,t){let n=window.matchMedia(e),r=e=>{let{matches:n}=e;n&&t()};n.addListener(r),r(n),this._responsiveMediaHandlers.push({mql:n,query:e,listener:r})},slickPrev(){var e;(e=this.innerSlider)==null||e.slickPrev()},slickNext(){var e;(e=this.innerSlider)==null||e.slickNext()},slickGoTo(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];var n;(n=this.innerSlider)==null||n.slickGoTo(e,t)},slickPause(){var e;(e=this.innerSlider)==null||e.pause(`paused`)},slickPlay(){var e;(e=this.innerSlider)==null||e.handleAutoPlay(`play`)}},render(){let e,t;this.breakpoint?(t=this.responsive.filter(e=>e.breakpoint===this.breakpoint),e=t[0].settings===`unslick`?`unslick`:Z(Z({},this.$props),t[0].settings)):e=Z({},this.$props),e.centerMode&&(e.slidesToScroll,e.slidesToScroll=1),e.fade&&(e.slidesToShow,e.slidesToScroll,e.slidesToShow=1,e.slidesToScroll=1);let n=c(this)||[];n=n.filter(e=>typeof e==`string`?!!e.trim():!!e),e.variableWidth&&(e.rows>1||e.slidesPerRow>1)&&(console.warn(`variableWidth is not supported in case of rows > 1 or slidesPerRow > 1`),e.variableWidth=!1);let r=[],i=null;for(let t=0;t=n.length));a+=1)o.push(ao(n[a],{key:100*t+10*r+a,tabindex:-1,style:{width:`${100/e.slidesPerRow}%`,display:`inline-block`}}));a.push(U(`div`,{key:10*t+r},[o]))}e.variableWidth?r.push(U(`div`,{key:t,style:{width:i}},[a])):r.push(U(`div`,{key:t},[a]))}return e===`unslick`?U(`div`,{class:`regular slider `+(this.className||``)},[n]):(r.length<=e.slidesToShow&&(e.unslick=!0),U(KO,Y(Y({},Z(Z(Z({},this.$attrs),e),{children:r,ref:this.innerSliderRefHandler})),{},{__propsSymbol__:[]}),this.$slots))}}),JO=e=>{let{componentCls:t,antCls:n,carouselArrowSize:r,carouselDotOffset:i,marginXXS:a}=e,o=-r*1.25,s=a;return{[t]:Z(Z({},rn(e)),{".slick-slider":{position:`relative`,display:`block`,boxSizing:`border-box`,touchAction:`pan-y`,WebkitTouchCallout:`none`,WebkitTapHighlightColor:`transparent`,".slick-track, .slick-list":{transform:`translate3d(0, 0, 0)`,touchAction:`pan-y`}},".slick-list":{position:`relative`,display:`block`,margin:0,padding:0,overflow:`hidden`,"&:focus":{outline:`none`},"&.dragging":{cursor:`pointer`},".slick-slide":{pointerEvents:`none`,[`input${n}-radio-input, input${n}-checkbox-input`]:{visibility:`hidden`},"&.slick-active":{pointerEvents:`auto`,[`input${n}-radio-input, input${n}-checkbox-input`]:{visibility:`visible`}},"> div > div":{verticalAlign:`bottom`}}},".slick-track":{position:`relative`,top:0,insetInlineStart:0,display:`block`,"&::before, &::after":{display:`table`,content:`""`},"&::after":{clear:`both`}},".slick-slide":{display:`none`,float:`left`,height:`100%`,minHeight:1,img:{display:`block`},"&.dragging img":{pointerEvents:`none`}},".slick-initialized .slick-slide":{display:`block`},".slick-vertical .slick-slide":{display:`block`,height:`auto`},".slick-arrow.slick-hidden":{display:`none`},".slick-prev, .slick-next":{position:`absolute`,top:`50%`,display:`block`,width:r,height:r,marginTop:-r/2,padding:0,color:`transparent`,fontSize:0,lineHeight:0,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,"&:hover, &:focus":{color:`transparent`,background:`transparent`,outline:`none`,"&::before":{opacity:1}},"&.slick-disabled::before":{opacity:.25}},".slick-prev":{insetInlineStart:o,"&::before":{content:`"←"`}},".slick-next":{insetInlineEnd:o,"&::before":{content:`"→"`}},".slick-dots":{position:`absolute`,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:15,display:`flex !important`,justifyContent:`center`,paddingInlineStart:0,listStyle:`none`,"&-bottom":{bottom:i},"&-top":{top:i,bottom:`auto`},li:{position:`relative`,display:`inline-block`,flex:`0 1 auto`,boxSizing:`content-box`,width:e.dotWidth,height:e.dotHeight,marginInline:s,padding:0,textAlign:`center`,textIndent:-999,verticalAlign:`top`,transition:`all ${e.motionDurationSlow}`,button:{position:`relative`,display:`block`,width:`100%`,height:e.dotHeight,padding:0,color:`transparent`,fontSize:0,background:e.colorBgContainer,border:0,borderRadius:1,outline:`none`,cursor:`pointer`,opacity:.3,transition:`all ${e.motionDurationSlow}`,"&: hover, &:focus":{opacity:.75},"&::after":{position:`absolute`,inset:-s,content:`""`}},"&.slick-active":{width:e.dotWidthActive,"& button":{background:e.colorBgContainer,opacity:1},"&: hover, &:focus":{opacity:1}}}}})}},YO=e=>{let{componentCls:t,carouselDotOffset:n,marginXXS:r}=e,i={width:e.dotHeight,height:e.dotWidth};return{[`${t}-vertical`]:{".slick-dots":{top:`50%`,bottom:`auto`,flexDirection:`column`,width:e.dotHeight,height:`auto`,margin:0,transform:`translateY(-50%)`,"&-left":{insetInlineEnd:`auto`,insetInlineStart:n},"&-right":{insetInlineEnd:n,insetInlineStart:`auto`},li:Z(Z({},i),{margin:`${r}px 0`,verticalAlign:`baseline`,button:i,"&.slick-active":Z(Z({},i),{button:i})})}}}},XO=e=>{let{componentCls:t}=e;return[{[`${t}-rtl`]:{direction:`rtl`,".slick-dots":{[`${t}-rtl&`]:{flexDirection:`row-reverse`}}}},{[`${t}-vertical`]:{".slick-dots":{[`${t}-rtl&`]:{flexDirection:`column`}}}}]},ZO=v(`Carousel`,e=>{let{controlHeightLG:t,controlHeightSM:n}=e,r=B(e,{carouselArrowSize:t/2,carouselDotOffset:n/2});return[JO(r),YO(r),XO(r)]},{dotWidth:16,dotHeight:3,dotWidthActive:24}),QO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0&&arguments[1];var n;(n=o.value)==null||n.slickGoTo(e,t)},autoplay:e=>{var t;(t=o.value?.innerSlider)==null||t.handleAutoPlay(e)},prev:()=>{var e;(e=o.value)==null||e.slickPrev()},next:()=>{var e;(e=o.value)==null||e.slickNext()},innerSlider:J(()=>o.value?.innerSlider)}),S(()=>{e(t.vertical===void 0,`Carousel`,"`vertical` is deprecated, please use `dotPosition` instead.")});let{prefixCls:s,direction:c}=X(`carousel`,t),[l,u]=ZO(s),d=J(()=>t.dotPosition?t.dotPosition:t.vertical===void 0?`bottom`:t.vertical?`right`:`bottom`),f=J(()=>d.value===`left`||d.value===`right`),p=J(()=>{let e=`slick-dots`;return K({[e]:!0,[`${e}-${d.value}`]:!0,[`${t.dotsClass}`]:!!t.dotsClass})});return()=>{let{dots:e,arrows:n,draggable:a,effect:d}=t,{class:m,style:h}=i,g=QO(i,[`class`,`style`]),_=d===`fade`||t.fade,v=K(s.value,{[`${s.value}-rtl`]:c.value===`rtl`,[`${s.value}-vertical`]:f.value,[`${m}`]:!!m},u.value);return l(U(`div`,{class:v,style:h},[U(qO,Y(Y(Y({ref:o},t),g),{},{dots:!!e,dotsClass:p.value,arrows:n,draggable:a,fade:_,vertical:f.value}),r)]))}}})),ek=`__RC_CASCADER_SPLIT__`,tk=`SHOW_PARENT`,nk=`SHOW_CHILD`;function rk(e){return e.join(ek)}function ik(e){return e.map(rk)}function ak(e){return e.split(ek)}function ok(e){let{label:t,value:n,children:r}=e||{},i=n||`value`;return{label:t||`label`,value:i,key:i,children:r||`children`}}function sk(e,t){return e.isLeaf??!e[t.children]?.length}function ck(e){let t=e.parentElement;if(!t)return;let n=e.offsetTop-t.offsetTop;n-t.scrollTop<0?t.scrollTo({top:n}):n+e.offsetHeight-t.scrollTop>t.offsetHeight&&t.scrollTo({top:n+e.offsetHeight-t.offsetHeight})}var lk=Symbol(`TreeContextKey`),uk=u({compatConfig:{MODE:3},name:`TreeContext`,props:{value:{type:Object}},setup(e,t){let{slots:n}=t;return fe(lk,J(()=>e.value)),()=>n.default?.call(n)}}),dk=()=>g(lk,J(()=>({}))),fk=Symbol(`KeysStateKey`),pk=e=>{fe(fk,e)},mk=()=>g(fk,{expandedKeys:q([]),selectedKeys:q([]),loadedKeys:q([]),loadingKeys:q([]),checkedKeys:q([]),halfCheckedKeys:q([]),expandedKeysSet:J(()=>new Set),selectedKeysSet:J(()=>new Set),loadedKeysSet:J(()=>new Set),loadingKeysSet:J(()=>new Set),checkedKeysSet:J(()=>new Set),halfCheckedKeysSet:J(()=>new Set),flattenNodes:q([])}),hk=e=>{let{prefixCls:t,level:n,isStart:r,isEnd:i}=e,a=`${t}-indent-unit`,o=[];for(let e=0;e({prefixCls:String,focusable:{type:Boolean,default:void 0},activeKey:[Number,String],tabindex:Number,children:f.any,treeData:{type:Array},fieldNames:{type:Object},showLine:{type:[Boolean,Object],default:void 0},showIcon:{type:Boolean,default:void 0},icon:f.any,selectable:{type:Boolean,default:void 0},expandAction:[String,Boolean],disabled:{type:Boolean,default:void 0},multiple:{type:Boolean,default:void 0},checkable:{type:Boolean,default:void 0},checkStrictly:{type:Boolean,default:void 0},draggable:{type:[Function,Boolean]},defaultExpandParent:{type:Boolean,default:void 0},autoExpandParent:{type:Boolean,default:void 0},defaultExpandAll:{type:Boolean,default:void 0},defaultExpandedKeys:{type:Array},expandedKeys:{type:Array},defaultCheckedKeys:{type:Array},checkedKeys:{type:[Object,Array]},defaultSelectedKeys:{type:Array},selectedKeys:{type:Array},allowDrop:{type:Function},dropIndicatorRender:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onKeydown:{type:Function},onContextmenu:{type:Function},onClick:{type:Function},onDblclick:{type:Function},onScroll:{type:Function},onExpand:{type:Function},onCheck:{type:Function},onSelect:{type:Function},onLoad:{type:Function},loadData:{type:Function},loadedKeys:{type:Array},onMouseenter:{type:Function},onMouseleave:{type:Function},onRightClick:{type:Function},onDragstart:{type:Function},onDragenter:{type:Function},onDragover:{type:Function},onDragleave:{type:Function},onDragend:{type:Function},onDrop:{type:Function},onActiveChange:{type:Function},filterTreeNode:{type:Function},motion:f.any,switcherIcon:f.any,height:Number,itemHeight:Number,virtual:{type:Boolean,default:void 0},direction:{type:String},rootClassName:String,rootStyle:Object}),yk=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i"`v-slot:"+e+"` ")}`;let a=q(!1),o=dk(),{expandedKeysSet:s,selectedKeysSet:c,loadedKeysSet:l,loadingKeysSet:u,checkedKeysSet:d,halfCheckedKeysSet:f}=mk(),{dragOverNodeKey:p,dropPosition:m,keyEntities:h}=o.value,g=J(()=>Uk(e.eventKey,{expandedKeysSet:s.value,selectedKeysSet:c.value,loadedKeysSet:l.value,loadingKeysSet:u.value,checkedKeysSet:d.value,halfCheckedKeysSet:f.value,dragOverNodeKey:p,dropPosition:m,keyEntities:h})),_=Wv(()=>g.value.expanded),v=Wv(()=>g.value.selected),y=Wv(()=>g.value.checked),b=Wv(()=>g.value.loaded),x=Wv(()=>g.value.loading),S=Wv(()=>g.value.halfChecked),C=Wv(()=>g.value.dragOver),w=Wv(()=>g.value.dragOverGapTop),T=Wv(()=>g.value.dragOverGapBottom),E=Wv(()=>g.value.pos),D=q(),k=J(()=>{let{eventKey:t}=e,{keyEntities:n}=o.value,{children:r}=n[t]||{};return!!(r||[]).length}),A=J(()=>{let{isLeaf:t}=e,{loadData:n}=o.value,r=k.value;return t===!1?!1:t||!n&&!r||n&&b.value&&!r}),j=J(()=>A.value?null:_.value?bk:xk),M=J(()=>{let{disabled:t}=e,{disabled:n}=o.value;return!!(n||t)}),N=J(()=>{let{checkable:t}=e,{checkable:n}=o.value;return!n||t===!1?!1:n}),P=J(()=>{let{selectable:t}=e,{selectable:n}=o.value;return typeof t==`boolean`?t:n}),F=J(()=>{let{data:t,active:n,checkable:r,disableCheckbox:i,disabled:a,selectable:o}=e;return Z(Z({active:n,checkable:r,disableCheckbox:i,disabled:a,selectable:o},t),{dataRef:t,data:t,isLeaf:A.value,checked:y.value,expanded:_.value,loading:x.value,selected:v.value,halfChecked:S.value})}),I=Zt(),L=J(()=>{let{eventKey:t}=e,{keyEntities:n}=o.value,{parent:r}=n[t]||{};return Z(Z({},Wk(Z({},e,g.value))),{parent:r})}),ee=Ne({eventData:L,eventKey:J(()=>e.eventKey),selectHandle:D,pos:E,key:I.vnode.key});i(ee);let te=e=>{let{onNodeDoubleClick:t}=o.value;t(e,L.value)},ne=e=>{if(M.value)return;let{onNodeSelect:t}=o.value;e.preventDefault(),t(e,L.value)},R=t=>{if(M.value)return;let{disableCheckbox:n}=e,{onNodeCheck:r}=o.value;if(!N.value||n)return;t.preventDefault();let i=!y.value;r(t,L.value,i)},re=e=>{let{onNodeClick:t}=o.value;t(e,L.value),P.value?ne(e):R(e)},ie=e=>{let{onNodeMouseEnter:t}=o.value;t(e,L.value)},ae=e=>{let{onNodeMouseLeave:t}=o.value;t(e,L.value)},oe=e=>{let{onNodeContextMenu:t}=o.value;t(e,L.value)},z=e=>{let{onNodeDragStart:t}=o.value;e.stopPropagation(),a.value=!0,t(e,ee);try{e.dataTransfer.setData(`text/plain`,``)}catch{}},se=e=>{let{onNodeDragEnter:t}=o.value;e.preventDefault(),e.stopPropagation(),t(e,ee)},B=e=>{let{onNodeDragOver:t}=o.value;e.preventDefault(),e.stopPropagation(),t(e,ee)},ce=e=>{let{onNodeDragLeave:t}=o.value;e.stopPropagation(),t(e,ee)},le=e=>{let{onNodeDragEnd:t}=o.value;e.stopPropagation(),a.value=!1,t(e,ee)},H=e=>{let{onNodeDrop:t}=o.value;e.preventDefault(),e.stopPropagation(),a.value=!1,t(e,ee)},ue=e=>{let{onNodeExpand:t}=o.value;x.value||t(e,L.value)},de=()=>{let{data:t}=e,{draggable:n}=o.value;return!!(n&&(!n.nodeDraggable||n.nodeDraggable(t)))},fe=()=>{let{draggable:e,prefixCls:t}=o.value;return e&&e?.icon?U(`span`,{class:`${t}-draggable-icon`},[e.icon]):null},pe=()=>{let{switcherIcon:t=r.switcherIcon||o.value.slots?.[e.data?.slots?.switcherIcon]}=e,{switcherIcon:n}=o.value,i=t||n;return typeof i==`function`?i(F.value):i},me=()=>{let{loadData:e,onNodeLoad:t}=o.value;x.value||e&&_.value&&!A.value&&!k.value&&!b.value&&t(L.value)};V(()=>{me()}),O(()=>{me()});let he=()=>{let{prefixCls:e}=o.value,t=pe();if(A.value)return t===!1?null:U(`span`,{class:K(`${e}-switcher`,`${e}-switcher-noop`)},[t]);let n=K(`${e}-switcher`,`${e}-switcher_${_.value?bk:xk}`);return t===!1?null:U(`span`,{onClick:ue,class:n},[t])},ge=()=>{var t;let{disableCheckbox:n}=e,{prefixCls:r}=o.value,i=M.value;return N.value?U(`span`,{class:K(`${r}-checkbox`,y.value&&`${r}-checkbox-checked`,!y.value&&S.value&&`${r}-checkbox-indeterminate`,(i||n)&&`${r}-checkbox-disabled`),onClick:R},[(t=o.value).customCheckable?.call(t)]):null},_e=()=>{let{prefixCls:e}=o.value;return U(`span`,{class:K(`${e}-iconEle`,`${e}-icon__${j.value||`docu`}`,x.value&&`${e}-icon_loading`)},null)},W=()=>{let{disabled:t,eventKey:n}=e,{draggable:r,dropLevelOffset:i,dropPosition:a,prefixCls:s,indent:c,dropIndicatorRender:l,dragOverNodeKey:u,direction:d}=o.value;return!t&&r!==!1&&u===n?l({dropPosition:a,dropLevelOffset:i,indent:c,prefixCls:s,direction:d}):null},ve=()=>{let{icon:t=r.icon,data:n}=e,i=r.title||o.value.slots?.[e.data?.slots?.title]||o.value.slots?.title||e.title,{prefixCls:s,showIcon:c,icon:l,loadData:u}=o.value,d=M.value,f=`${s}-node-content-wrapper`,p;if(c){let e=t||o.value.slots?.[n?.slots?.icon]||l;p=e?U(`span`,{class:K(`${s}-iconEle`,`${s}-icon__customize`)},[typeof e==`function`?e(F.value):e]):_e()}else u&&x.value&&(p=_e());let m;m=typeof i==`function`?i(F.value):i,m=m===void 0?Sk:m;let h=U(`span`,{class:`${s}-title`},[m]);return U(`span`,{ref:D,title:typeof i==`string`?i:``,class:K(`${f}`,`${f}-${j.value||`normal`}`,!d&&(v.value||a.value)&&`${s}-node-selected`),onMouseenter:ie,onMouseleave:ae,onContextmenu:oe,onClick:re,onDblclick:te},[p,h,W()])};return()=>{let t=Z(Z({},e),n),{eventKey:r,isLeaf:i,isStart:a,isEnd:s,domRef:c,active:l,data:u,onMousemove:d,selectable:f}=t,p=yk(t,[`eventKey`,`isLeaf`,`isStart`,`isEnd`,`domRef`,`active`,`data`,`onMousemove`,`selectable`]),{prefixCls:m,filterTreeNode:h,keyEntities:g,dropContainerKey:b,dropTargetKey:E,draggingNodeKey:D}=o.value,O=M.value,k=Bu(p,{aria:!0,data:!0}),{level:A}=g[r]||{},j=s[s.length-1],N=de(),P=!O&&N,F=D===r,I=f===void 0?void 0:{"aria-selected":!!f};return U(`div`,Y(Y({ref:c,class:K(n.class,`${m}-treenode`,{[`${m}-treenode-disabled`]:O,[`${m}-treenode-switcher-${_.value?`open`:`close`}`]:!i,[`${m}-treenode-checkbox-checked`]:y.value,[`${m}-treenode-checkbox-indeterminate`]:S.value,[`${m}-treenode-selected`]:v.value,[`${m}-treenode-loading`]:x.value,[`${m}-treenode-active`]:l,[`${m}-treenode-leaf-last`]:j,[`${m}-treenode-draggable`]:P,dragging:F,"drop-target":E===r,"drop-container":b===r,"drag-over":!O&&C.value,"drag-over-gap-top":!O&&w.value,"drag-over-gap-bottom":!O&&T.value,"filter-node":h&&h(L.value)}),style:n.style,draggable:P,"aria-grabbed":F,onDragstart:P?z:void 0,onDragenter:N?se:void 0,onDragover:N?B:void 0,onDragleave:N?ce:void 0,onDrop:N?H:void 0,onDragend:N?le:void 0,onMousemove:d},I),k),[U(hk,{prefixCls:m,level:A,isStart:a,isEnd:s},null),fe(),he(),ge(),ve()])}}});function wk(e,t){if(!e)return[];let n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function Tk(e,t){let n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function Ek(e){return e.split(`-`)}function Dk(e,t){return`${e}-${t}`}function Ok(e){return e&&e.type&&e.type.isTreeNode}function kk(e,t){let n=[],r=t[e];function i(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>{let{key:t,children:r}=e;n.push(t),i(r)})}return i(r.children),n}function Ak(e){if(e.parent){let t=Ek(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function jk(e){let t=Ek(e.pos);return Number(t[t.length-1])===0}function Mk(e,t,n,r,i,a,o,s,c,l){let{clientX:u,clientY:d}=e,{top:f,height:p}=e.target.getBoundingClientRect(),m=((l===`rtl`?-1:1)*((i?.x||0)-u)-12)/r,h=s[n.eventKey];if(de.key===h.key);h=s[o[e<=0?0:e-1].key]}let g=h.key,_=h,v=h.key,y=0,b=0;if(!c.has(g))for(let e=0;e-1.5?a({dragNode:x,dropNode:S,dropPosition:1})?y=1:C=!1:a({dragNode:x,dropNode:S,dropPosition:0})?y=0:a({dragNode:x,dropNode:S,dropPosition:1})?y=1:C=!1:a({dragNode:x,dropNode:S,dropPosition:1})?y=1:C=!1,{dropPosition:y,dropLevelOffset:b,dropTargetKey:h.key,dropTargetPos:h.pos,dragOverNodeKey:v,dropContainerKey:y===0?null:h.parent?.key||null,dropAllowed:C}}function Nk(e,t){if(!e)return;let{multiple:n}=t;return n?e.slice():e.length?[e[0]]:e}function Pk(e){if(!e)return null;let t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(typeof e==`object`)t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return null;return t}function Fk(e,t){let n=new Set;function r(e){if(n.has(e))return;let i=t[e];if(!i)return;n.add(e);let{parent:a,node:o}=i;o.disabled||a&&r(a.key)}return(e||[]).forEach(e=>{r(e)}),[...n]}var Ik=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:[]).map(e=>{if(!Ok(e))return null;let n=e.children||{},r=e.key,i={};for(let[t,n]of Object.entries(e.props))i[ue(t)]=n;let{isLeaf:a,checkable:o,selectable:s,disabled:c,disableCheckbox:l}=i,u={isLeaf:a||a===``||void 0,checkable:o||o===``||void 0,selectable:s||s===``||void 0,disabled:c||c===``||void 0,disableCheckbox:l||l===``||void 0},d=Z(Z({},i),u),{title:f=n.title?.call(n,d),icon:p=n.icon?.call(n,d),switcherIcon:m=n.switcherIcon?.call(n,d)}=i,h=Ik(i,[`title`,`icon`,`switcherIcon`]),g=n.default?.call(n),_=Z(Z(Z({},h),{title:f,icon:p,switcherIcon:m,key:r,isLeaf:a}),u),v=t(g);return v.length&&(_.children=v),_})}return t(e)}function Bk(e,t,n){let{_title:r,key:i,children:a}=Rk(n),o=new Set(t===!0?[]:t),s=[];function c(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e.map((l,u)=>{let d=Dk(n?n.pos:`0`,u),f=Lk(l[i],d),p;for(let e=0;ee[a]:typeof a==`function`&&(u=e=>a(e)):u=(e,t)=>Lk(e[s],t);function d(n,r,i,a){let o=n?n[l]:e,s=n?Dk(i.pos,r):`0`,c=n?[...a,n]:[];n&&t({node:n,index:r,pos:s,key:u(n,s),parentPos:i.node?i.pos:null,level:i.level+1,nodes:c}),o&&o.forEach((e,t)=>{d(e,t,{node:n,pos:s,level:i?i.level+1:-1},c)})}d(null)}function Hk(e){let{initWrapper:t,processEntity:n,onProcessFinished:r,externalGetKey:i,childrenPropName:a,fieldNames:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,c=i||s,l={},u={},d={posEntities:l,keyEntities:u};return t&&(d=t(d)||d),Vk(e,e=>{let{node:t,index:r,pos:i,key:a,parentPos:o,level:s,nodes:c}=e,f={node:t,nodes:c,index:r,key:a,pos:i,level:s},p=Lk(a,i);l[i]=f,u[p]=f,f.parent=l[o],f.parent&&(f.parent.children=f.parent.children||[],f.parent.children.push(f)),n&&n(f,d)},{externalGetKey:c,childrenPropName:a,fieldNames:o}),r&&r(d),d}function Uk(e,t){let{expandedKeysSet:n,selectedKeysSet:r,loadedKeysSet:i,loadingKeysSet:a,checkedKeysSet:o,halfCheckedKeysSet:s,dragOverNodeKey:c,dropPosition:l,keyEntities:u}=t,d=u[e];return{eventKey:e,expanded:n.has(e),selected:r.has(e),loaded:i.has(e),loading:a.has(e),checked:o.has(e),halfChecked:s.has(e),pos:String(d?d.pos:``),parent:d.parent,dragOver:c===e&&l===0,dragOverGapTop:c===e&&l===-1,dragOverGapBottom:c===e&&l===1}}function Wk(e){let{data:t,expanded:n,selected:r,checked:i,loaded:a,loading:o,halfChecked:s,dragOver:c,dragOverGapTop:l,dragOverGapBottom:u,pos:d,active:f,eventKey:p}=e,m=Z(Z({dataRef:t},t),{expanded:n,selected:r,checked:i,loaded:a,loading:o,halfChecked:s,dragOver:c,dragOverGapTop:l,dragOverGapBottom:u,pos:d,active:f,eventKey:p,key:p});return`props`in m||Object.defineProperty(m,"props",{get(){return e}}),m}var Gk=((e,t)=>J(()=>Hk(e.value,{fieldNames:t.value,initWrapper:e=>Z(Z({},e),{pathKeyEntities:{}}),processEntity:(e,n)=>{let r=e.nodes.map(e=>e[t.value.value]).join(ek);n.pathKeyEntities[r]=e,e.key=r}}).pathKeyEntities));function Kk(e){let t=q(!1),n=H({});return S(()=>{if(!e.value){t.value=!1,n.value={};return}let r={matchInputWidth:!0,limit:50};e.value&&typeof e.value==`object`&&(r=Z(Z({},r),e.value)),r.limit<=0&&delete r.limit,t.value=!0,n.value=r}),{showSearch:t,searchConfig:n}}var qk=`__rc_cascader_search_mark__`,Jk=(e,t,n)=>{let{label:r}=n;return t.some(t=>String(t[r]).toLowerCase().includes(e.toLowerCase()))},Yk=e=>{let{path:t,fieldNames:n}=e;return t.map(e=>e[n.label]).join(` / `)},Xk=((e,t,n,r,i,a)=>J(()=>{let{filter:o=Jk,render:s=Yk,limit:c=50,sort:l}=i.value,u=[];if(!e.value)return[];function d(t,i){t.forEach(t=>{if(!l&&c>0&&u.length>=c)return;let f=[...i,t],p=t[n.value.children];(!p||p.length===0||a.value)&&o(e.value,f,{label:n.value.label})&&u.push(Z(Z({},t),{[n.value.label]:s({inputValue:e.value,path:f,prefixCls:r.value,fieldNames:n.value}),[qk]:f})),p&&d(t[n.value.children],f)})}return d(t.value,[]),l&&u.sort((t,r)=>l(t[qk],r[qk],e.value,n.value)),c>0?u.slice(0,c):u}));function Zk(e,t,n){let r=new Set(e);return e.filter(e=>{let i=t[e],a=i?i.parent:null,o=i?i.children:null;return n===`SHOW_CHILD`?!(o&&o.some(e=>e.key&&r.has(e.key))):!(a&&!a.node.disabled&&r.has(a.key))})}function Qk(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=t,a=[];for(let t=0;t{let t=e[n.value];return r?String(t)===String(o):t===o}),c=s===-1?null:i?.[s];a.push({value:c?.[n.value]??o,index:s,option:c}),i=c?.[n.children]}return a}var $k=((e,t,n)=>J(()=>{let r=[],i=[];return n.value.forEach(n=>{Qk(n,e.value,t.value).every(e=>e.option)?i.push(n):r.push(n)}),[i,r]}));function eA(e,t){let n=new Set;return e.forEach(e=>{t.has(e)||n.add(e)}),n}function tA(e){let{disabled:t,disableCheckbox:n,checkable:r}=e||{};return!!(t||n)||r===!1}function nA(e,t,n,r){let i=new Set(e),a=new Set;for(let e=0;e<=n;e+=1)(t.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:a=[]}=e;i.has(t)&&!r(n)&&a.filter(e=>!r(e.node)).forEach(e=>{i.add(e.key)})});let o=new Set;for(let e=n;e>=0;--e)(t.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(r(n)||!e.parent||o.has(e.parent.key))return;if(r(e.parent.node)){o.add(t.key);return}let s=!0,c=!1;(t.children||[]).filter(e=>!r(e.node)).forEach(e=>{let{key:t}=e,n=i.has(t);s&&!n&&(s=!1),!c&&(n||a.has(t))&&(c=!0)}),s&&i.add(t.key),c&&a.add(t.key),o.add(t.key)});return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(eA(a,i))}}function rA(e,t,n,r,i){let a=new Set(e),o=new Set(t);for(let e=0;e<=r;e+=1)(n.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:r=[]}=e;!a.has(t)&&!o.has(t)&&!i(n)&&r.filter(e=>!i(e.node)).forEach(e=>{a.delete(e.key)})});o=new Set;let s=new Set;for(let e=r;e>=0;--e)(n.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(i(n)||!e.parent||s.has(e.parent.key))return;if(i(e.parent.node)){s.add(t.key);return}let r=!0,c=!1;(t.children||[]).filter(e=>!i(e.node)).forEach(e=>{let{key:t}=e,n=a.has(t);r&&!n&&(r=!1),!c&&(n||o.has(t))&&(c=!0)}),r||a.delete(t.key),c&&o.add(t.key),s.add(t.key)});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(eA(o,a))}}function iA(e,t,n,r,i,a){let o=[],s;s=a||tA;let c=new Set(e.filter(e=>{let t=!!n[e];return t||o.push(e),t}));o.length,`${o.slice(0,100).map(e=>`'${e}'`).join(`, `)}`;let l;return l=t===!0?nA(c,i,r,s):rA(c,t.halfCheckedKeys,i,r,s),l}var aA=((e,t,n,r,i)=>J(()=>{let a=i.value||(e=>{let{labels:t}=e,n=r.value?t.slice(-1):t;return n.every(e=>[`string`,`number`].includes(typeof e))?n.join(` / `):n.reduce((e,t,n)=>{let r=Nt(t)?ao(t,{key:n}):t;return n===0?[r]:[...e,` / `,r]},[])});return e.value.map(e=>{let r=Qk(e,t.value,n.value),i=a({labels:r.map(e=>{let{option:t,value:r}=e;return t?.[n.value.label]??r}),selectedOptions:r.map(e=>{let{option:t}=e;return t})}),o=rk(e);return{label:i,value:o,key:o,valueCells:e}})})),oA=Symbol(`CascaderContextKey`),sA=e=>{fe(oA,e)},cA=()=>g(oA),lA=(()=>{let e=_d(),{values:t}=cA(),[n,r]=ff([]);return G(()=>e.open,()=>{if(e.open&&!e.multiple){let e=t.value[0];r(e||[])}},{immediate:!0}),[n,r]}),uA=((e,t,n,r,i,a)=>{let o=_d(),s=J(()=>o.direction===`rtl`),[c,l,u]=[H([]),H(),H([])];S(()=>{let e=-1,i=t.value,a=[],o=[],s=r.value.length;for(let t=0;te[n.value.value]===r.value[t]);if(s===-1)break;e=s,a.push(e),o.push(r.value[t]),i=i[e][n.value.children]}let d=t.value;for(let e=0;e{i(e)},f=e=>{let t=u.value.length,r=l.value;r===-1&&e<0&&(r=t);for(let i=0;i{if(c.value.length>1){let e=c.value.slice(0,-1);d(e)}else o.toggleOpen(!1)},m=()=>{let e=(u.value[l.value]?.[n.value.children]||[]).find(e=>!e.disabled);if(e){let t=[...c.value,e[n.value.value]];d(t)}};e.expose({onKeydown:e=>{let{which:t}=e;switch(t){case $.UP:case $.DOWN:{let e=0;t===$.UP?e=-1:t===$.DOWN&&(e=1),e!==0&&f(e);break}case $.LEFT:s.value?m():p();break;case $.RIGHT:s.value?p():m();break;case $.BACKSPACE:o.searchValue||p();break;case $.ENTER:if(c.value.length){let e=u.value[l.value],t=e?.__rc_cascader_search_mark__||[];t.length?a(t.map(e=>e[n.value.value]),t[t.length-1]):a(c.value,e)}break;case $.ESC:o.toggleOpen(!1),open&&e.stopPropagation()}},onKeyup:()=>{}})});function dA(e){let{prefixCls:t,checked:n,halfChecked:r,disabled:i,onClick:a}=e,{customSlots:o,checkable:s}=cA(),c=s.value===!1?s.value:o.value.checkable,l=typeof c==`function`?c():typeof c==`boolean`?null:c;return U(`span`,{class:{[t]:!0,[`${t}-checked`]:n,[`${t}-indeterminate`]:!n&&r,[`${t}-disabled`]:i},onClick:a},[l])}dA.props=[`prefixCls`,`checked`,`halfChecked`,`disabled`,`onClick`],dA.displayName=`Checkbox`,dA.inheritAttrs=!1;var fA=`__cascader_fix_label__`;function pA(e){let{prefixCls:t,multiple:n,options:r,activeValue:i,prevValuePath:a,onToggleOpen:o,onSelect:s,onActive:c,checkedSet:l,halfCheckedSet:u,loadingKeys:d,isSelectable:f}=e;var p,m;let h=`${t}-menu`,g=`${t}-menu-item`,{fieldNames:_,changeOnSelect:v,expandTrigger:y,expandIcon:b,loadingIcon:x,dropdownMenuColumnStyle:S,customSlots:C}=cA(),w=b.value??(p=C.value).expandIcon?.call(p),T=x.value??(m=C.value).loadingIcon?.call(m),E=y.value===`hover`;return U(`ul`,{class:h,role:`menu`},[r.map(e=>{let{disabled:r}=e,p=e[qk],m=e.__cascader_fix_label__??e[_.value.label],h=e[_.value.value],y=sk(e,_.value),b=p?p.map(e=>e[_.value.value]):[...a,h],x=rk(b),C=d.includes(x),D=l.has(x),O=u.has(x),k=()=>{!r&&(!E||!y)&&c(b)},A=()=>{f(e)&&s(b,y)},j;return typeof e.title==`string`?j=e.title:typeof m==`string`&&(j=m),U(`li`,{key:x,class:[g,{[`${g}-expand`]:!y,[`${g}-active`]:i===h,[`${g}-disabled`]:r,[`${g}-loading`]:C}],style:S.value,role:`menuitemcheckbox`,title:j,"aria-checked":D,"data-path-key":x,onClick:()=>{k(),(!n||y)&&A()},onDblclick:()=>{v.value&&o(!1)},onMouseenter:()=>{E&&k()},onMousedown:e=>{e.preventDefault()}},[n&&U(dA,{prefixCls:`${t}-checkbox`,checked:D,halfChecked:O,disabled:r,onClick:e=>{e.stopPropagation(),A()}},null),U(`div`,{class:`${g}-content`},[m]),!C&&w&&!y&&U(`div`,{class:`${g}-expand-icon`},[ao(w)]),C&&T&&U(`div`,{class:`${g}-loading-icon`},[ao(T)])])})])}pA.props=[`prefixCls`,`multiple`,`options`,`activeValue`,`prevValuePath`,`onToggleOpen`,`onSelect`,`onActive`,`checkedSet`,`halfCheckedSet`,`loadingKeys`,`isSelectable`],pA.displayName=`Column`,pA.inheritAttrs=!1;var mA=u({compatConfig:{MODE:3},name:`OptionList`,inheritAttrs:!1,setup(e,t){let{attrs:n,slots:r}=t,i=_d(),a=H(),o=J(()=>i.direction===`rtl`),{options:s,values:c,halfValues:l,fieldNames:u,changeOnSelect:d,onSelect:f,searchOptions:p,dropdownPrefixCls:m,loadData:h,expandTrigger:g,customSlots:_}=cA(),v=J(()=>m.value||i.prefixCls),y=q([]),b=e=>{if(!h.value||i.searchValue)return;let t=Qk(e,s.value,u.value).map(e=>{let{option:t}=e;return t}),n=t[t.length-1];if(n&&!sk(n,u.value)){let n=rk(e);y.value=[...y.value,n],h.value(t)}};S(()=>{y.value.length&&y.value.forEach(e=>{let t=Qk(ak(e),s.value,u.value,!0).map(e=>{let{option:t}=e;return t}),n=t[t.length-1];(!n||n[u.value.children]||sk(n,u.value))&&(y.value=y.value.filter(t=>t!==e))})});let x=J(()=>new Set(ik(c.value))),C=J(()=>new Set(ik(l.value))),[w,T]=lA(),E=e=>{T(e),b(e)},D=e=>{let{disabled:t}=e,n=sk(e,u.value);return!t&&(n||d.value||i.multiple)},O=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];f(e),!i.multiple&&(t||d.value&&(g.value===`hover`||n))&&i.toggleOpen(!1)},k=J(()=>i.searchValue?p.value:s.value),A=J(()=>{let e=[{options:k.value}],t=k.value;for(let n=0;ne[u.value.value]===r)?.[u.value.children];if(!i?.length)break;t=i,e.push({options:i})}return e});uA(t,k,u,w,E,(e,t)=>{D(t)&&O(e,sk(t,u.value),!0)});let j=e=>{e.preventDefault()};return V(()=>{G(w,e=>{for(let t=0;t{var e;let{notFoundContent:t=r.notFoundContent?.call(r)||(e=_.value).notFoundContent?.call(e),multiple:s,toggleOpen:c}=i,l=!A.value[0]?.options?.length,d=[{[u.value.value]:`__EMPTY__`,[fA]:t,disabled:!0}],f=Z(Z({},n),{multiple:!l&&s,onSelect:O,onActive:E,onToggleOpen:c,checkedSet:x.value,halfCheckedSet:C.value,loadingKeys:y.value,isSelectable:D}),p=(l?[{options:d}]:A.value).map((e,t)=>{let n=w.value.slice(0,t),r=w.value[t];return U(pA,Y(Y({key:t},f),{},{prefixCls:v.value,options:e.options,prevValuePath:n,activeValue:r}),null)});return U(`div`,{class:[`${v.value}-menus`,{[`${v.value}-menu-empty`]:l,[`${v.value}-rtl`]:o.value}],onMousedown:j,ref:a},[p])}}});function hA(e){let t=H(0),n=q();return S(()=>{let r=new Map,i=0,a=e.value||{};for(let e in a)if(Object.prototype.hasOwnProperty.call(a,e)){let t=a[e],{level:n}=t,o=r.get(n);o||(o=new Set,r.set(n,o)),o.add(t),i=Math.max(i,n)}t.value=i,n.value=r}),{maxLevel:t,levelEntities:n}}function gA(){return Z(Z({},Br(Cd(),[`tokenSeparators`,`mode`,`showSearch`])),{id:String,prefixCls:String,fieldNames:Qt(),children:Array,value:{type:[String,Number,Array]},defaultValue:{type:[String,Number,Array]},changeOnSelect:{type:Boolean,default:void 0},displayRender:Function,checkable:{type:Boolean,default:void 0},showCheckedStrategy:{type:String,default:tk},showSearch:{type:[Boolean,Object],default:void 0},searchValue:String,onSearch:Function,expandTrigger:String,options:Array,dropdownPrefixCls:String,loadData:Function,popupVisible:{type:Boolean,default:void 0},dropdownClassName:String,dropdownMenuColumnStyle:{type:Object,default:void 0},popupStyle:{type:Object,default:void 0},dropdownStyle:{type:Object,default:void 0},popupPlacement:String,placement:String,onPopupVisibleChange:Function,onDropdownVisibleChange:Function,expandIcon:f.any,loadingIcon:f.any})}function _A(){return Z(Z({},gA()),{onChange:Function,customSlots:Object})}function vA(e){return Array.isArray(e)&&Array.isArray(e[0])}function yA(e){return e?vA(e)?e:(e.length===0?[]:[e]).map(e=>Array.isArray(e)?e:[e]):[]}var bA=u({compatConfig:{MODE:3},name:`Cascader`,inheritAttrs:!1,props:Zn(_A(),{}),setup(e,t){let{attrs:n,expose:r,slots:i}=t,a=of(St(e,`id`)),o=J(()=>!!e.checkable),[s,c]=df(e.defaultValue,{value:J(()=>e.value),postState:yA}),l=J(()=>ok(e.fieldNames)),u=J(()=>e.options||[]),d=Gk(u,l),f=e=>{let t=d.value;return e.map(e=>{let{nodes:n}=t[e];return n.map(e=>e[l.value.value])})},[p,m]=df(``,{value:J(()=>e.searchValue),postState:e=>e||``}),h=(t,n)=>{m(t),n.source!==`blur`&&e.onSearch&&e.onSearch(t)},{showSearch:g,searchConfig:_}=Kk(St(e,`showSearch`)),v=Xk(p,u,l,J(()=>e.dropdownPrefixCls||e.prefixCls),_,St(e,`changeOnSelect`)),y=$k(u,l,s),[b,x,C]=[H([]),H([]),H([])],{maxLevel:w,levelEntities:T}=hA(d);S(()=>{let[e,t]=y.value;if(!o.value||!s.value.length){[b.value,x.value,C.value]=[e,[],t];return}let n=ik(e),r=d.value,{checkedKeys:i,halfCheckedKeys:a}=iA(n,!0,r,w.value,T.value);[b.value,x.value,C.value]=[f(i),f(a),t]});let E=aA(J(()=>{let t=Zk(ik(b.value),d.value,e.showCheckedStrategy);return[...C.value,...f(t)]}),u,l,o,St(e,`displayRender`)),D=t=>{if(c(t),e.onChange){let n=yA(t),r=n.map(e=>Qk(e,u.value,l.value).map(e=>e.option)),i=o.value?n:n[0],a=o.value?r:r[0];e.onChange(i,a)}},O=t=>{if(m(``),!o.value)D(t);else{let n=rk(t),r=ik(b.value),i=ik(x.value),a=r.includes(n),o=C.value.some(e=>rk(e)===n),s=b.value,c=C.value;if(o&&!a)c=C.value.filter(e=>rk(e)!==n);else{let t=a?r.filter(e=>e!==n):[...r,n],o;a?{checkedKeys:o}=iA(t,{checked:!1,halfCheckedKeys:i},d.value,w.value,T.value):{checkedKeys:o}=iA(t,!0,d.value,w.value,T.value);let c=Zk(o,d.value,e.showCheckedStrategy);s=f(c)}D([...c,...s])}},k=(e,t)=>{if(t.type===`clear`){D([]);return}let{valueCells:n}=t.values[0];O(n)},A=J(()=>e.open===void 0?e.popupVisible:e.open),j=J(()=>e.dropdownStyle||e.popupStyle||{}),M=J(()=>e.placement||e.popupPlacement),N=t=>{var n,r;(n=e.onDropdownVisibleChange)==null||n.call(e,t),(r=e.onPopupVisibleChange)==null||r.call(e,t)},{changeOnSelect:P,checkable:F,dropdownPrefixCls:I,loadData:L,expandTrigger:ee,expandIcon:te,loadingIcon:ne,dropdownMenuColumnStyle:R,customSlots:re,dropdownClassName:ie}=Ft(e);sA({options:u,fieldNames:l,values:b,halfValues:x,changeOnSelect:P,onSelect:O,checkable:F,searchOptions:v,dropdownPrefixCls:I,loadData:L,expandTrigger:ee,expandIcon:te,loadingIcon:ne,dropdownMenuColumnStyle:R,customSlots:re});let ae=H();r({focus(){var e;(e=ae.value)==null||e.focus()},blur(){var e;(e=ae.value)==null||e.blur()},scrollTo(e){var t;(t=ae.value)==null||t.scrollTo(e)}});let oe=J(()=>Br(e,`id.prefixCls.fieldNames.defaultValue.value.changeOnSelect.onChange.displayRender.checkable.searchValue.onSearch.showSearch.expandTrigger.options.dropdownPrefixCls.loadData.popupVisible.open.dropdownClassName.dropdownMenuColumnStyle.popupPlacement.placement.onDropdownVisibleChange.onPopupVisibleChange.expandIcon.loadingIcon.customSlots.showCheckedStrategy.children`.split(`.`)));return()=>{let t=!(p.value?v.value:u.value).length,{dropdownMatchSelectWidth:r=!1}=e,s=p.value&&_.value.matchInputWidth||t?{}:{minWidth:`auto`};return U(Ed,Y(Y(Y({},oe.value),n),{},{ref:ae,id:a,prefixCls:e.prefixCls,dropdownMatchSelectWidth:r,dropdownStyle:Z(Z({},j.value),s),displayValues:E.value,onDisplayValuesChange:k,mode:o.value?`multiple`:void 0,searchValue:p.value,onSearch:h,showSearch:g.value,OptionList:mA,emptyOptions:t,open:A.value,dropdownClassName:ie.value,placement:M.value,onDropdownVisibleChange:N,getRawInputElement:()=>i.default?.call(i)}),i)}}}),xA={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z`}}]},name:`left`,theme:`outlined`};function SA(e){for(var t=1;tIt()&&window.document.documentElement,EA=e=>{if(It()&&window.document.documentElement){let t=Array.isArray(e)?e:[e],{documentElement:n}=window.document;return t.some(e=>e in n.style)}return!1},DA=(e,t)=>{if(!EA(e))return!1;let n=document.createElement(`div`),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function OA(e,t){return!Array.isArray(e)&&t!==void 0?DA(e,t):EA(e)}var kA,AA=()=>{if(!TA())return!1;if(kA!==void 0)return kA;let e=document.createElement(`div`);return e.style.display=`flex`,e.style.flexDirection=`column`,e.style.rowGap=`1px`,e.appendChild(document.createElement(`div`)),e.appendChild(document.createElement(`div`)),document.body.appendChild(e),kA=e.scrollHeight===1,document.body.removeChild(e),kA},jA=(()=>{let e=q(!1);return V(()=>{e.value=AA()}),e}),MA=Symbol(`rowContextKey`),NA=e=>{fe(MA,e)},PA=()=>g(MA,{gutter:J(()=>void 0),wrap:J(()=>void 0),supportFlexGap:J(()=>void 0)}),FA=e=>{let{componentCls:t}=e;return{[t]:{display:`flex`,flexFlow:`row wrap`,minWidth:0,"&::before, &::after":{display:`flex`},"&-no-wrap":{flexWrap:`nowrap`},"&-start":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-end":{justifyContent:`flex-end`},"&-space-between":{justifyContent:`space-between`},"&-space-around ":{justifyContent:`space-around`},"&-space-evenly ":{justifyContent:`space-evenly`},"&-top":{alignItems:`flex-start`},"&-middle":{alignItems:`center`},"&-bottom":{alignItems:`flex-end`}}}},IA=e=>{let{componentCls:t}=e;return{[t]:{position:`relative`,maxWidth:`100%`,minHeight:1}}},LA=(e,t)=>{let{componentCls:n,gridColumns:r}=e,i={};for(let e=r;e>=0;e--)e===0?(i[`${n}${t}-${e}`]={display:`none`},i[`${n}-push-${e}`]={insetInlineStart:`auto`},i[`${n}-pull-${e}`]={insetInlineEnd:`auto`},i[`${n}${t}-push-${e}`]={insetInlineStart:`auto`},i[`${n}${t}-pull-${e}`]={insetInlineEnd:`auto`},i[`${n}${t}-offset-${e}`]={marginInlineEnd:0},i[`${n}${t}-order-${e}`]={order:0}):(i[`${n}${t}-${e}`]={display:`block`,flex:`0 0 ${e/r*100}%`,maxWidth:`${e/r*100}%`},i[`${n}${t}-push-${e}`]={insetInlineStart:`${e/r*100}%`},i[`${n}${t}-pull-${e}`]={insetInlineEnd:`${e/r*100}%`},i[`${n}${t}-offset-${e}`]={marginInlineStart:`${e/r*100}%`},i[`${n}${t}-order-${e}`]={order:e});return i},RA=(e,t)=>LA(e,t),zA=(e,t,n)=>({[`@media (min-width: ${t}px)`]:Z({},RA(e,n))}),BA=v(`Grid`,e=>[FA(e)]),VA=v(`Grid`,e=>{let t=B(e,{gridColumns:24}),n={"-sm":t.screenSMMin,"-md":t.screenMDMin,"-lg":t.screenLGMin,"-xl":t.screenXLMin,"-xxl":t.screenXXLMin};return[IA(t),RA(t,``),RA(t,`-xs`),Object.keys(n).map(e=>zA(t,n[e],e)).reduce((e,t)=>Z(Z({},e),t),{})]}),HA=u({compatConfig:{MODE:3},name:`ARow`,inheritAttrs:!1,props:{align:W([String,Object]),justify:W([String,Object]),prefixCls:String,gutter:W([Number,Array,Object],0),wrap:{type:Boolean,default:void 0}},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`row`,e),[o,s]=BA(i),c,l=Hv(),u=H({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),d=H({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),f=t=>J(()=>{if(typeof e[t]==`string`)return e[t];if(typeof e[t]!=`object`)return``;for(let n=0;n{c=l.value.subscribe(t=>{d.value=t;let n=e.gutter||0;(!Array.isArray(n)&&typeof n==`object`||Array.isArray(n)&&(typeof n[0]==`object`||typeof n[1]==`object`))&&(u.value=t)})}),ut(()=>{l.value.unsubscribe(c)});let g=J(()=>{let t=[void 0,void 0],{gutter:n=0}=e;return(Array.isArray(n)?n:[n,void 0]).forEach((e,n)=>{if(typeof e==`object`)for(let r=0;re.wrap)});let _=J(()=>K(i.value,{[`${i.value}-no-wrap`]:e.wrap===!1,[`${i.value}-${m.value}`]:m.value,[`${i.value}-${p.value}`]:p.value,[`${i.value}-rtl`]:a.value===`rtl`},r.class,s.value)),v=J(()=>{let e=g.value,t={},n=e[0]!=null&&e[0]>0?`${e[0]/-2}px`:void 0,r=e[1]!=null&&e[1]>0?`${e[1]/-2}px`:void 0;return n&&(t.marginLeft=n,t.marginRight=n),h.value?t.rowGap=`${e[1]}px`:r&&(t.marginTop=r,t.marginBottom=r),t});return()=>o(U(`div`,Y(Y({},r),{},{class:_.value,style:Z(Z({},v.value),r.style)}),[n.default?.call(n)]))}});function UA(){return UA=Object.assign?Object.assign.bind():function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function JA(e,t,n){return JA=qA()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&KA(i,n.prototype),i},JA.apply(null,arguments)}function YA(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function XA(e){var t=typeof Map==`function`?new Map:void 0;return XA=function(e){if(e===null||!YA(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return JA(e,arguments,GA(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),KA(n,e)},XA(e)}var ZA=/%[sdj%]/g,QA=function(){};function $A(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function ej(e){var t=[...arguments].slice(1),n=0,r=t.length;return typeof e==`function`?e.apply(null,t):typeof e==`string`?e.replace(ZA,function(e){if(e===`%%`)return`%`;if(n>=r)return e;switch(e){case`%s`:return String(t[n++]);case`%d`:return Number(t[n++]);case`%j`:try{return JSON.stringify(t[n++])}catch{return`[Circular]`}break;default:return e}}):e}function tj(e){return e===`string`||e===`url`||e===`hex`||e===`email`||e===`date`||e===`pattern`}function nj(e,t){return!!(e==null||t===`array`&&Array.isArray(e)&&!e.length||tj(t)&&typeof e==`string`&&!e)}function rj(e,t,n){var r=[],i=0,a=e.length;function o(e){r.push.apply(r,e||[]),i++,i===a&&n(r)}e.forEach(function(e){t(e,o)})}function ij(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var s=r;r+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},_j={integer:function(e){return _j.number(e)&&parseInt(e,10)===e},float:function(e){return _j.number(e)&&!_j.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime==`function`&&typeof e.getMonth==`function`&&typeof e.getYear==`function`&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&typeof e==`number`},object:function(e){return typeof e==`object`&&!_j.array(e)},method:function(e){return typeof e==`function`},email:function(e){return typeof e==`string`&&e.length<=320&&!!e.match(gj.email)},url:function(e){return typeof e==`string`&&e.length<=2048&&!!e.match(hj())},hex:function(e){return typeof e==`string`&&!!e.match(gj.hex)}},vj=function(e,t,n,r,i){if(e.required&&t===void 0){fj(e,t,n,r,i);return}var a=[`integer`,`float`,`array`,`regexp`,`object`,`method`,`email`,`number`,`date`,`url`,`hex`],o=e.type;a.indexOf(o)>-1?_j[o](t)||r.push(ej(i.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(ej(i.messages.types[o],e.fullField,e.type))},yj=function(e,t,n,r,i){var a=typeof e.len==`number`,o=typeof e.min==`number`,s=typeof e.max==`number`,c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=t,u=null,d=typeof t==`number`,f=typeof t==`string`,p=Array.isArray(t);if(d?u=`number`:f?u=`string`:p&&(u=`array`),!u)return!1;p&&(l=t.length),f&&(l=t.replace(c,`_`).length),a?l!==e.len&&r.push(ej(i.messages[u].len,e.fullField,e.len)):o&&!s&&le.max?r.push(ej(i.messages[u].max,e.fullField,e.max)):o&&s&&(le.max)&&r.push(ej(i.messages[u].range,e.fullField,e.min,e.max))},bj=`enum`,xj={required:fj,whitespace:pj,type:vj,range:yj,enum:function(e,t,n,r,i){e[bj]=Array.isArray(e[bj])?e[bj]:[],e[bj].indexOf(t)===-1&&r.push(ej(i.messages[bj],e.fullField,e[bj].join(`, `)))},pattern:function(e,t,n,r,i){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(ej(i.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern==`string`&&(new RegExp(e.pattern).test(t)||r.push(ej(i.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},Sj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,`string`)&&!e.required)return n();xj.required(e,t,r,a,i,`string`),nj(t,`string`)||(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i),xj.pattern(e,t,r,a,i),e.whitespace===!0&&xj.whitespace(e,t,r,a,i))}n(a)},Cj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj.type(e,t,r,a,i)}n(a)},wj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===``&&(t=void 0),nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},Tj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj.type(e,t,r,a,i)}n(a)},Ej=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),nj(t)||xj.type(e,t,r,a,i)}n(a)},Dj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},Oj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},kj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();xj.required(e,t,r,a,i,`array`),t!=null&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},Aj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj.type(e,t,r,a,i)}n(a)},jj=`enum`,Mj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj[jj](e,t,r,a,i)}n(a)},Nj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,`string`)&&!e.required)return n();xj.required(e,t,r,a,i),nj(t,`string`)||xj.pattern(e,t,r,a,i)}n(a)},Pj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,`date`)&&!e.required)return n();if(xj.required(e,t,r,a,i),!nj(t,`date`)){var o=t instanceof Date?t:new Date(t);xj.type(e,o,r,a,i),o&&xj.range(e,o.getTime(),r,a,i)}}n(a)},Fj=function(e,t,n,r,i){var a=[],o=Array.isArray(t)?`array`:typeof t;xj.required(e,t,r,a,i,o),n(a)},Ij=function(e,t,n,r,i){var a=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,a)&&!e.required)return n();xj.required(e,t,r,o,i,a),nj(t,a)||xj.type(e,t,r,o,i)}n(o)},Lj={string:Sj,method:Cj,number:wj,boolean:Tj,regexp:Ej,integer:Dj,float:Oj,array:kj,object:Aj,enum:Mj,pattern:Nj,date:Pj,url:Ij,hex:Ij,email:Ij,required:Fj,any:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i)}n(a)}};function Rj(){return{default:`Validation error on field %s`,required:`%s is required`,enum:`%s must be one of %s`,whitespace:`%s cannot be empty`,date:{format:`%s date %s is invalid for format %s`,parse:`%s date could not be parsed, %s is invalid `,invalid:`%s date %s is invalid`},types:{string:`%s is not a %s`,method:`%s is not a %s (function)`,array:`%s is not an %s`,object:`%s is not an %s`,number:`%s is not a %s`,date:`%s is not a %s`,boolean:`%s is not a %s`,integer:`%s is not an %s`,float:`%s is not a %s`,regexp:`%s is not a valid %s`,email:`%s is not a valid %s`,url:`%s is not a valid %s`,hex:`%s is not a valid %s`},string:{len:`%s must be exactly %s characters`,min:`%s must be at least %s characters`,max:`%s cannot be longer than %s characters`,range:`%s must be between %s and %s characters`},number:{len:`%s must equal %s`,min:`%s cannot be less than %s`,max:`%s cannot be greater than %s`,range:`%s must be between %s and %s`},array:{len:`%s must be exactly %s in length`,min:`%s cannot be less than %s in length`,max:`%s cannot be greater than %s in length`,range:`%s must be between %s and %s in length`},pattern:{mismatch:`%s value %s does not match pattern %s`},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var zj=Rj(),Bj=function(){function e(e){this.rules=null,this._messages=zj,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw Error(`Cannot configure a schema with no rules`);if(typeof e!=`object`||Array.isArray(e))throw Error(`Rules must be an object`);this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})},t.messages=function(e){return e&&(this._messages=dj(Rj(),e)),this._messages},t.validate=function(t,n,r){var i=this;n===void 0&&(n={}),r===void 0&&(r=function(){});var a=t,o=n,s=r;if(typeof o==`function`&&(s=o,o={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(null,a),Promise.resolve(a);function c(e){var t=[],n={};function r(e){if(Array.isArray(e)){var n;t=(n=t).concat.apply(n,e)}else t.push(e)}for(var i=0;i3&&arguments[3]!==void 0&&arguments[3];return t.length&&r&&n===void 0&&!Hj(e,t.slice(0,-1))?e:Uj(e,t,n,r)}function Gj(e){return Vj(e)}function Kj(e,t){return Hj(e,t)}function qj(e,t,n){return Wj(e,t,n,arguments.length>3&&arguments[3]!==void 0&&arguments[3])}function Jj(e,t){return e&&e.some(e=>$j(e,t))}function Yj(e){return typeof e==`object`&&!!e&&Object.getPrototypeOf(e)===Object.prototype}function Xj(e,t){let n=Array.isArray(e)?[...e]:Z({},e);return t&&Object.keys(t).forEach(e=>{let r=n[e],i=t[e],a=Yj(r)&&Yj(i);n[e]=a?Xj(r,i||{}):i}),n}function Zj(e){return[...arguments].slice(1).reduce((e,t)=>Xj(e,t),e)}function Qj(e,t){let n={};return t.forEach(t=>{let r=Kj(e,t);n=qj(n,t,r)}),n}function $j(e,t){return!e||!t||e.length!==t.length?!1:e.every((e,n)=>t[n]===e)}var eM="'${name}' is not a valid ${type}",tM={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:eM,method:eM,array:eM,object:eM,number:eM,date:eM,boolean:eM,integer:eM,float:eM,regexp:eM,email:eM,url:eM,hex:eM},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},nM=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},rM=Bj;function iM(e,t){return e.replace(/\$\{\w+\}/g,e=>t[e.slice(2,-1)])}function aM(e,t,n,r,i){return nM(this,void 0,void 0,function*(){let a=Z({},n);delete a.ruleIndex,delete a.trigger;let o=null;a&&a.type===`array`&&a.defaultField&&(o=a.defaultField,delete a.defaultField);let s=new rM({[e]:[a]}),c=Zj({},tM,r.validateMessages);s.messages(c);let l=[];try{yield Promise.resolve(s.validate({[e]:t},Z({},r)))}catch(e){e.errors?l=e.errors.map((e,t)=>{let{message:n}=e;return Nt(n)?it(n,{key:`error_${t}`}):n}):(console.error(e),l=[c.default()])}if(!l.length&&o)return(yield Promise.all(t.map((t,n)=>aM(`${e}.${n}`,t,o,r,i)))).reduce((e,t)=>[...e,...t],[]);let u=Z(Z(Z({},n),{name:e,enum:(n.enum||[]).join(`, `)}),i);return l.map(e=>typeof e==`string`?iM(e,u):e)})}function oM(e,t,n,r,i,a){let o=e.join(`.`),s=n.map((e,t)=>{let n=e.validator,r=Z(Z({},e),{ruleIndex:t});return n&&(r.validator=(e,t,r)=>{let i=!1,a=n(e,t,function(){var e=[...arguments];Promise.resolve().then(()=>{i||r(...e)})});i=a&&typeof a.then==`function`&&typeof a.catch==`function`,i&&a.then(()=>{r()}).catch(e=>{r(e||` `)})}),r}).sort((e,t)=>{let{warningOnly:n,ruleIndex:r}=e,{warningOnly:i,ruleIndex:a}=t;return!!n==!!i?r-a:n?1:-1}),c;if(i===!0)c=new Promise((e,n)=>nM(this,void 0,void 0,function*(){for(let e=0;eaM(o,t,e,r,a).then(t=>({errors:t,rule:e})));c=(i?cM(e):sM(e)).then(e=>Promise.reject(e))}return c.catch(e=>e),c}function sM(e){return nM(this,void 0,void 0,function*(){return Promise.all(e).then(e=>[].concat(...e))})}function cM(e){return nM(this,void 0,void 0,function*(){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(r=>{r.errors.length&&n([r]),t+=1,t===e.length&&n([])})})})})}var lM=Symbol(`formContextKey`),uM=e=>{fe(lM,e)},dM=()=>g(lM,{name:J(()=>void 0),labelAlign:J(()=>`right`),vertical:J(()=>!1),addField:(e,t)=>{},removeField:e=>{},model:J(()=>void 0),rules:J(()=>void 0),colon:J(()=>void 0),labelWrap:J(()=>void 0),labelCol:J(()=>void 0),requiredMark:J(()=>!1),validateTrigger:J(()=>void 0),onValidate:()=>{},validateMessages:J(()=>tM)}),fM=Symbol(`formItemPrefixContextKey`),pM=e=>{fe(fM,e)},mM=()=>g(fM,{prefixCls:J(()=>``)});function hM(e){return typeof e==`number`?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}var gM=()=>({span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}),_M=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`],vM=u({compatConfig:{MODE:3},name:`ACol`,inheritAttrs:!1,props:gM(),setup(e,t){let{slots:n,attrs:r}=t,{gutter:i,supportFlexGap:a,wrap:o}=PA(),{prefixCls:s,direction:c}=X(`col`,e),[l,u]=VA(s),d=J(()=>{let{span:t,order:n,offset:i,push:a,pull:o}=e,l=s.value,d={};return _M.forEach(t=>{let n={},r=e[t];typeof r==`number`?n.span=r:typeof r==`object`&&(n=r||{}),d=Z(Z({},d),{[`${l}-${t}-${n.span}`]:n.span!==void 0,[`${l}-${t}-order-${n.order}`]:n.order||n.order===0,[`${l}-${t}-offset-${n.offset}`]:n.offset||n.offset===0,[`${l}-${t}-push-${n.push}`]:n.push||n.push===0,[`${l}-${t}-pull-${n.pull}`]:n.pull||n.pull===0,[`${l}-rtl`]:c.value===`rtl`})}),K(l,{[`${l}-${t}`]:t!==void 0,[`${l}-order-${n}`]:n,[`${l}-offset-${i}`]:i,[`${l}-push-${a}`]:a,[`${l}-pull-${o}`]:o},d,r.class,u.value)}),f=J(()=>{let{flex:t}=e,n=i.value,r={};if(n&&n[0]>0){let e=`${n[0]/2}px`;r.paddingLeft=e,r.paddingRight=e}if(n&&n[1]>0&&!a.value){let e=`${n[1]/2}px`;r.paddingTop=e,r.paddingBottom=e}return t&&(r.flex=hM(t),o.value===!1&&!r.minWidth&&(r.minWidth=0)),r});return()=>l(U(`div`,Y(Y({},r),{},{class:d.value,style:[f.value,r.style]}),[n.default?.call(n)]))}}),yM={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}},{tag:`path`,attrs:{d:`M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`question-circle`,theme:`outlined`};function bM(e){for(var t=1;t{let{slots:n,emit:r,attrs:i}=t,{prefixCls:a,htmlFor:o,labelCol:s,labelAlign:c,colon:l,required:u,requiredMark:d}=Z(Z({},e),i),[f]=Kt(`Form`),p=e.label??n.label?.call(n);if(!p)return null;let{vertical:m,labelAlign:h,labelCol:g,labelWrap:_,colon:v}=dM(),y=s||g?.value||{},b=c||h?.value,x=`${a}-item-label`,S=K(x,b===`left`&&`${x}-left`,y.class,{[`${x}-wrap`]:!!_.value}),C=p,w=l===!0||v?.value!==!1&&l!==!1;if(w&&!m.value&&typeof p==`string`&&p.trim()!==``&&(C=p.replace(/[:|:]\s*$/,``)),e.tooltip||n.tooltip){let t=U(`span`,{class:`${a}-item-tooltip`},[U(Ty,{title:e.tooltip},{default:()=>[U(SM,null,null)]})]);C=U($e,null,[C,n.tooltip?n.tooltip?.call(n,{class:`${a}-item-tooltip`}):t])}d===`optional`&&!u&&(C=U($e,null,[C,U(`span`,{class:`${a}-item-optional`},[f.value?.optional||Ye.Form?.optional])]));let T=K({[`${a}-item-required`]:u,[`${a}-item-required-mark-optional`]:d===`optional`,[`${a}-item-no-colon`]:!w});return U(vM,Y(Y({},y),{},{class:S}),{default:()=>[U(`label`,{for:o,class:T,title:typeof p==`string`?p:``,onClick:e=>r(`click`,e)},[C])]})};CM.displayName=`FormItemLabel`,CM.inheritAttrs=!1;var wM=e=>{let{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:`hidden`,transition:`height ${e.motionDurationSlow} ${e.motionEaseInOut}, + opacity ${e.motionDurationSlow} ${e.motionEaseInOut}, + transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:`translateY(-5px)`,opacity:0,"&-active":{transform:`translateY(0)`,opacity:1}},[`&${r}-leave-active`]:{transform:`translateY(-5px)`}}}}},TM=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},label:{fontSize:e.fontSize},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),EM=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},DM=e=>{let{componentCls:t}=e;return{[e.componentCls]:Z(Z(Z({},rn(e)),TM(e)),{[`${t}-text`]:{display:`inline-block`,paddingInlineEnd:e.paddingSM},"&-small":Z({},EM(e,e.controlHeightSM)),"&-large":Z({},EM(e,e.controlHeightLG))})}},OM=e=>{let{formItemCls:t,iconCls:n,componentCls:r,rootPrefixCls:i}=e;return{[t]:Z(Z({},rn(e)),{marginBottom:e.marginLG,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden, + &-hidden.${i}-row`]:{display:`none`},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{display:`inline-block`,flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:`${e.lineHeight} - 0.25em`,whiteSpace:`unset`},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:e.controlHeight,color:e.colorTextHeading,fontSize:e.fontSize,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:`top`},[`&${t}-required:not(${t}-required-mark-optional)::before`]:{display:`inline-block`,marginInlineEnd:e.marginXXS,color:e.colorError,fontSize:e.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`,[`${r}-hide-required-mark &`]:{display:`none`}},[`${t}-optional`]:{display:`inline-block`,marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`${r}-hide-required-mark &`]:{display:`none`}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:e.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:e.marginXXS/2,marginInlineEnd:e.marginXS},[`&${t}-no-colon::after`]:{content:`" "`}}},[`${t}-control`]:{display:`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${i}-col-'"]):not([class*="' ${i}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:e.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`}}},[t]:{"&-explain, &-extra":{clear:`both`,color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:`auto`,opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:`center`,visibility:`visible`,animationName:z_,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},kM=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label.${r}-col-24 + ${n}-control`]:{minWidth:`unset`}}}},AM=e=>{let{componentCls:t,formItemCls:n}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[n]:{flex:`none`,flexWrap:`nowrap`,marginInlineEnd:e.margin,marginBottom:0,"&-with-help":{marginBottom:e.marginLG},[`> ${n}-label, + > ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},jM=e=>({margin:0,padding:`0 0 ${e.paddingXS}px`,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{display:`none`}}}),MM=e=>{let{componentCls:t,formItemCls:n}=e;return{[`${n} ${n}-label`]:jM(e),[t]:{[n]:{flexWrap:`wrap`,[`${n}-label, + ${n}-control`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}},NM=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-vertical`]:{[n]:{"&-row":{flexDirection:`column`},"&-label > label":{height:`auto`},[`${t}-item-control`]:{width:`100%`}}},[`${t}-vertical ${n}-label, + .${r}-col-24${n}-label, + .${r}-col-xl-24${n}-label`]:jM(e),[`@media (max-width: ${e.screenXSMax}px)`]:[MM(e),{[t]:{[`.${r}-col-xs-24${n}-label`]:jM(e)}}],[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{[`.${r}-col-sm-24${n}-label`]:jM(e)}},[`@media (max-width: ${e.screenMDMax}px)`]:{[t]:{[`.${r}-col-md-24${n}-label`]:jM(e)}},[`@media (max-width: ${e.screenLGMax}px)`]:{[t]:{[`.${r}-col-lg-24${n}-label`]:jM(e)}}}},PM=v(`Form`,(e,t)=>{let{rootPrefixCls:n}=t,r=B(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:n});return[DM(r),OM(r),wM(r),kM(r),AM(r),NM(r),$_(r),z_]}),FM=u({compatConfig:{MODE:3},name:`ErrorList`,inheritAttrs:!1,props:[`errors`,`help`,`onErrorVisibleChanged`,`helpStatus`,`warnings`],setup(e,t){let{attrs:n}=t,{prefixCls:r,status:i}=mM(),a=J(()=>`${r.value}-item-explain`),o=J(()=>!!(e.errors&&e.errors.length)),s=H(i.value),[,c]=PM(r);return G([o,i],()=>{o.value&&(s.value=i.value)}),()=>{let t=aS(`${r.value}-show-help-item`),i=l(`${r.value}-show-help-item`,t);return i.role=`alert`,i.class=[c.value,a.value,n.class,`${r.value}-show-help`],U(Re,Y(Y({},ge(`${r.value}-show-help`)),{},{onAfterEnter:()=>e.onErrorVisibleChanged(!0),onAfterLeave:()=>e.onErrorVisibleChanged(!1)}),{default:()=>[Mt(U(Tt,Y(Y({},i),{},{tag:`div`}),{default:()=>[e.errors?.map((e,t)=>U(`div`,{key:t,class:s.value?`${a.value}-${s.value}`:``},[e]))]}),[[ht,!!e.errors?.length]])]})}}}),IM=u({compatConfig:{MODE:3},slots:Object,inheritAttrs:!1,props:[`prefixCls`,`errors`,`hasFeedback`,`onDomErrorVisibleChange`,`wrapperCol`,`help`,`extra`,`status`,`marginBottom`,`onErrorVisibleChanged`],setup(e,t){let{slots:n}=t,r=dM(),{wrapperCol:i}=r,a=Z({},r);return delete a.labelCol,delete a.wrapperCol,uM(a),pM({prefixCls:J(()=>e.prefixCls),status:J(()=>e.status)}),()=>{let{prefixCls:t,wrapperCol:r,marginBottom:a,onErrorVisibleChanged:o,help:s=n.help?.call(n),errors:c=dt(n.errors?.call(n)),extra:l=n.extra?.call(n)}=e,u=`${t}-item`,d=r||i?.value||{},f=K(`${u}-control`,d.class);return U(vM,Y(Y({},d),{},{class:f}),{default:()=>U($e,null,[U(`div`,{class:`${u}-control-input`},[U(`div`,{class:`${u}-control-input-content`},[n.default?.call(n)])]),a!==null||c.length?U(`div`,{style:{display:`flex`,flexWrap:`nowrap`}},[U(FM,{errors:c,help:s,class:`${u}-explain-connected`,onErrorVisibleChanged:o},null),!!a&&U(`div`,{style:{width:0,height:`${a}px`}},null)]):null,l?U(`div`,{class:`${u}-extra`},[l]):null])})}}});function LM(e){let t=q(e.value.slice()),n=null;return S(()=>{clearTimeout(n),n=setTimeout(()=>{t.value=e.value},e.value.length?0:10)}),t}m(`success`,`warning`,`error`,`validating`,``);var RM={success:qe,warning:Wt,error:tt,validating:qt};function zM(e,t,n){let r=e,i=t,a=0;try{for(let e=i.length;a({htmlFor:String,prefixCls:String,label:f.any,help:f.any,extra:f.any,labelCol:{type:Object},wrapperCol:{type:Object},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:String,prop:{type:[String,Number,Array]},name:{type:[String,Number,Array]},rules:[Array,Object],autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:f.oneOf(m(``,`success`,`warning`,`error`,`validating`)),validateTrigger:{type:[String,Array]},messageVariables:{type:Object},hidden:Boolean,noStyle:Boolean,tooltip:String}),VM=0,HM=`form_item`,UM=u({compatConfig:{MODE:3},name:`AFormItem`,inheritAttrs:!1,__ANT_NEW_FORM_ITEM:!0,props:BM(),slots:Object,setup(e,t){let{slots:n,attrs:r,expose:i}=t;e.prop;let a=`form-item-${++VM}`,{prefixCls:o}=X(`form`,e),[s,c]=PM(o),l=q(),u=dM(),d=J(()=>e.name||e.prop),f=q([]),p=q(!1),m=q(),h=J(()=>{let e=d.value;return Gj(e)}),g=J(()=>{if(h.value.length){let e=u.name.value,t=h.value.join(`_`);return e?`${e}_${t}`:`${HM}_${t}`}else return}),_=()=>{let e=u.model.value;if(!(!e||!d.value))return zM(e,h.value,!0).v},v=J(()=>_()),y=q(Xh(v.value)),b=J(()=>{let t=e.validateTrigger===void 0?u.validateTrigger.value:e.validateTrigger;return t=t===void 0?`change`:t,Vj(t)}),x=J(()=>{let t=u.rules.value,n=e.rules,r=e.required===void 0?[]:{required:!!e.required,trigger:b.value},i=zM(t,h.value);t=t?i.o[i.k]||i.v:[];let a=[].concat(n||t||[]);return Ng(a,e=>e.required)?a:a.concat(r)}),C=J(()=>{let t=x.value,n=!1;return t&&t.length&&t.every(e=>e.required?(n=!0,!1):!0),n||e.required}),w=q();S(()=>{w.value=e.validateStatus});let T=J(()=>{let t={};return typeof e.label==`string`?t.label=e.label:e.name&&(t.label=String(e.name)),e.messageVariables&&(t=Z(Z({},t),e.messageVariables)),t}),E=t=>{if(h.value.length===0)return;let{validateFirst:n=!1}=e,{triggerName:r}=t||{},i=x.value;if(r&&(i=i.filter(e=>{let{trigger:t}=e;return!t&&!b.value.length||Vj(t||b.value).includes(r)})),!i.length)return Promise.resolve();let a=oM(h.value,v.value,i,Z({validateMessages:u.validateMessages.value},t),n,T.value);return w.value=`validating`,f.value=[],a.catch(e=>e).then(function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(w.value===`validating`){let t=e.filter(e=>e&&e.errors.length);w.value=t.length?`error`:`success`,f.value=t.map(e=>e.errors),u.onValidate(d.value,!f.value.length,f.value.length?Ht(f.value[0]):null)}}),a},D=()=>{E({triggerName:`blur`})},O=()=>{if(p.value){p.value=!1;return}E({triggerName:`change`})},k=()=>{w.value=e.validateStatus,p.value=!1,f.value=[]},A=()=>{w.value=e.validateStatus,p.value=!0,f.value=[];let t=u.model.value||{},n=v.value,r=zM(t,h.value,!0);Array.isArray(n)?r.o[r.k]=[].concat(y.value??[]):r.o[r.k]=y.value,z(()=>{p.value=!1})},j=J(()=>e.htmlFor===void 0?g.value:e.htmlFor),M=()=>{let e=j.value;if(!e||!m.value)return;let t=m.value.$el.querySelector(`[id="${e}"]`);t&&t.focus&&t.focus()};i({onFieldBlur:D,onFieldChange:O,clearValidate:k,resetField:A}),If({id:g,onFieldBlur:()=>{e.autoLink&&D()},onFieldChange:()=>{e.autoLink&&O()},clearValidate:k},J(()=>!!(e.autoLink&&u.model.value&&d.value)));let N=!1;G(d,e=>{e?N||(N=!0,u.addField(a,{fieldValue:v,fieldId:g,fieldName:d,resetField:A,clearValidate:k,namePath:h,validateRules:E,rules:x})):(N=!1,u.removeField(a))},{immediate:!0}),ut(()=>{u.removeField(a)});let P=LM(f),F=J(()=>e.validateStatus===void 0?P.value.length?`error`:w.value:e.validateStatus),I=J(()=>({[`${o.value}-item`]:!0,[c.value]:!0,[`${o.value}-item-has-feedback`]:F.value&&e.hasFeedback,[`${o.value}-item-has-success`]:F.value===`success`,[`${o.value}-item-has-warning`]:F.value===`warning`,[`${o.value}-item-has-error`]:F.value===`error`,[`${o.value}-item-is-validating`]:F.value===`validating`,[`${o.value}-item-hidden`]:e.hidden})),L=Ne({});Vf.useProvide(L),S(()=>{let t;if(e.hasFeedback){let e=F.value&&RM[F.value];t=e?U(`span`,{class:K(`${o.value}-item-feedback-icon`,`${o.value}-item-feedback-icon-${F.value}`)},[U(e,null,null)]):null}Z(L,{status:F.value,hasFeedback:e.hasFeedback,feedbackIcon:t,isFormItemInput:!0})});let ee=q(null),te=q(!1),ne=()=>{if(l.value){let e=getComputedStyle(l.value);ee.value=parseInt(e.marginBottom,10)}};V(()=>{G(te,()=>{te.value&&ne()},{flush:`post`,immediate:!0})});let R=e=>{e||(ee.value=null)};return()=>{if(e.noStyle)return n.default?.call(n);let t=e.help??(n.help?dt(n.help()):null),i=!!(t!=null&&Array.isArray(t)&&t.length||P.value.length);return te.value=i,s(U(`div`,{class:[I.value,i?`${o.value}-item-with-help`:``,r.class],ref:l},[U(HA,Y(Y({},r),{},{class:`${o.value}-item-row`,key:`row`}),{default:()=>U($e,null,[U(CM,Y(Y({},e),{},{htmlFor:j.value,required:C.value,requiredMark:u.requiredMark.value,prefixCls:o.value,onClick:M,label:e.label}),{label:n.label,tooltip:n.tooltip}),U(IM,Y(Y({},e),{},{errors:t==null?P.value:Vj(t),marginBottom:ee.value,prefixCls:o.value,status:F.value,ref:m,help:t,extra:e.extra??n.extra?.call(n),onErrorVisibleChanged:R}),{default:n.default})])}),!!ee.value&&U(`div`,{class:`${o.value}-margin-offset`,style:{marginBottom:`-${ee.value}px`}},null)]))}}});function WM(e){let t=!1,n=e.length,r=[];return e.length?new Promise((i,a)=>{e.forEach((e,o)=>{e.catch(e=>(t=!0,e)).then(e=>{--n,r[o]=e,!(n>0)&&(t&&a(r),i(r))})})}):Promise.resolve([])}function GM(e){let t=!1;return e&&e.length&&e.every(e=>e.required?(t=!0,!1):!0),t}function KM(e){return e==null?[]:Array.isArray(e)?e:[e]}function qM(e,t,n){let r=e;t=t.replace(/\[(\w+)\]/g,`.$1`),t=t.replace(/^\./,``);let i=t.split(`.`),a=0;for(let e=i.length;a1&&arguments[1]!==void 0?arguments[1]:H({}),n=arguments.length>2?arguments[2]:void 0,r=Xh(ze(e)),i=Ne({}),a=q([]),o=n=>{Z(ze(e),Z(Z({},Xh(r)),n)),z(()=>{Object.keys(i).forEach(e=>{i[e]={autoLink:!1,required:GM(ze(t)[e])}})})},s=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t.length?e.filter(e=>Rg(KM(e.trigger||`change`),t).length):e},c=null,l=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a=[],o={};for(let c=0;c({name:l,errors:[],warnings:[]})).catch(e=>{let t=[],n=[];return e.forEach(e=>{let{rule:{warningOnly:r},errors:i}=e;r?n.push(...i):t.push(...i)}),t.length?Promise.reject({name:l,errors:t,warnings:n}):{name:l,errors:t,warnings:n}}))}let l=WM(a);c=l;let d=l.then(()=>c===l?Promise.resolve(o):Promise.reject([])).catch(e=>{let t=e.filter(e=>e&&e.errors.length);return t.length?Promise.reject({values:o,errorFields:t,outOfDate:c!==l}):Promise.resolve(o)});return d.catch(e=>e),d},u=function(e,t,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=oM([e],t,r,Z({validateMessages:tM},a),!!a.validateFirst);return i[e]?(i[e].validateStatus=`validating`,o.catch(e=>e).then(function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];var r;if(i[e].validateStatus===`validating`){let a=t.filter(e=>e&&e.errors.length);i[e].validateStatus=a.length?`error`:`success`,i[e].help=a.length?a.map(e=>e.errors):null,(r=n?.onValidate)==null||r.call(n,e,!a.length,a.length?Ht(i[e].help[0]):null)}}),o):o.catch(e=>e)},d=(e,t)=>{let n=[],r=!0;e?n=Array.isArray(e)?e:[e]:(r=!1,n=a.value);let i=l(n,t||{},r);return i.catch(e=>e),i},f=e=>{let t=[];t=e?Array.isArray(e)?e:[e]:a.value,t.forEach(e=>{i[e]&&Z(i[e],{validateStatus:``,help:null})})},p=e=>{let t={autoLink:!1},n=[],r=Array.isArray(e)?e:[e];for(let e=0;e{let t=[];a.value.forEach(r=>{let i=qM(e,r,!1),a=qM(m,r,!1);(h&&n?.immediate&&i.isValid||!Ql(i.v,a.v))&&t.push(r)}),d(t,{trigger:`change`}),h=!1,m=Xh(Ht(e))},_=n?.debounce,v=!0;return G(t,()=>{a.value=t?Object.keys(ze(t)):[],!v&&n&&n.validateOnRuleChange&&d(),v=!1},{deep:!0,immediate:!0}),G(a,()=>{let e={};a.value.forEach(n=>{e[n]=Z({},i[n],{autoLink:!1,required:GM(ze(t)[n])}),delete i[n]});for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&delete i[e];Z(i,e)},{immediate:!0}),G(e,_&&_.wait?Eg(g,_.wait,Qg(_,[`wait`])):g,{immediate:n&&!!n.immediate,deep:!0}),{modelRef:e,rulesRef:t,initialModel:r,validateInfos:i,resetFields:o,validate:d,validateField:u,mergeValidateInfo:p,clearValidate:f}}var YM=()=>({layout:f.oneOf(m(`horizontal`,`inline`,`vertical`)),labelCol:Qt(),wrapperCol:Qt(),colon:Q(),labelAlign:_(),labelWrap:Q(),prefixCls:String,requiredMark:W([String,Boolean]),hideRequiredMark:Q(),model:f.object,rules:Qt(),validateMessages:Qt(),validateOnRuleChange:Q(),scrollToFirstError:nn(),onSubmit:d(),name:String,validateTrigger:W([String,Array]),size:_(),disabled:Q(),onValuesChange:d(),onFieldsChange:d(),onFinish:d(),onFinishFailed:d(),onValidate:d()});function XM(e,t){return Ql(Vj(e),Vj(t))}var ZM=u({compatConfig:{MODE:3},name:`AForm`,inheritAttrs:!1,props:Zn(YM(),{layout:`horizontal`,hideRequiredMark:!1,colon:!0}),Item:UM,useForm:JM,setup(t,n){let{emit:i,slots:a,expose:o,attrs:s}=n,{prefixCls:c,direction:l,form:u,size:d,disabled:f}=X(`form`,t),p=J(()=>t.requiredMark===``||t.requiredMark),m=J(()=>p.value===void 0?u&&u.value?.requiredMark!==void 0?u.value.requiredMark:!t.hideRequiredMark:p.value);r(d),nt(f);let h=J(()=>t.colon??u.value?.colon),{validateMessages:g}=Yt(),_=J(()=>Z(Z(Z({},tM),g.value),t.validateMessages)),[v,y]=PM(c),b=J(()=>K(c.value,{[`${c.value}-${t.layout}`]:!0,[`${c.value}-hide-required-mark`]:m.value===!1,[`${c.value}-rtl`]:l.value===`rtl`,[`${c.value}-${d.value}`]:d.value},y.value)),x=H(),S={},C=(e,t)=>{S[e]=t},w=e=>{delete S[e]},T=e=>{let t=!!e,n=t?Vj(e).map(Gj):[];return t?Object.values(S).filter(e=>n.findIndex(t=>XM(t,e.fieldName.value))>-1):Object.values(S)},E=n=>{if(!t.model){e(!1,`Form`,`model is required for resetFields to work.`);return}T(n).forEach(e=>{e.resetField()})},D=e=>{T(e).forEach(e=>{e.clearValidate()})},O=e=>{let{scrollToFirstError:n}=t;if(i(`finishFailed`,e),n&&e.errorFields.length){let t={};typeof n==`object`&&(t=n),A(e.errorFields[0].name,t)}},k=function(){return N(...arguments)},A=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=T(e?[e]:void 0);if(n.length){let e=n[0].fieldId.value,r=e?document.getElementById(e):null;r&&ei(r,Z({scrollMode:`if-needed`,block:`nearest`},t))}},j=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(e===!0){let e=[];return Object.values(S).forEach(t=>{let{namePath:n}=t;e.push(n.value)}),Qj(t.model,e)}else return Qj(t.model,e)},M=(n,r)=>{if(e(!(n instanceof Function),`Form`,`validateFields/validateField/validate not support callback, please use promise instead`),!t.model)return e(!1,`Form`,`model is required for validateFields to work.`),Promise.reject("Form `model` is required for validateFields to work.");let i=!!n,a=i?Vj(n).map(Gj):[],o=[];Object.values(S).forEach(e=>{if(i||a.push(e.namePath.value),!e.rules?.value.length)return;let t=e.namePath.value;if(!i||Jj(a,t)){let n=e.validateRules(Z({validateMessages:_.value},r));o.push(n.then(()=>({name:t,errors:[],warnings:[]})).catch(e=>{let n=[],r=[];return e.forEach(e=>{let{rule:{warningOnly:t},errors:i}=e;t?r.push(...i):n.push(...i)}),n.length?Promise.reject({name:t,errors:n,warnings:r}):{name:t,errors:n,warnings:r}}))}});let s=WM(o);x.value=s;let c=s.then(()=>x.value===s?Promise.resolve(j(a)):Promise.reject([])).catch(e=>{let t=e.filter(e=>e&&e.errors.length);return Promise.reject({values:j(a),errorFields:t,outOfDate:x.value!==s})});return c.catch(e=>e),c},N=function(){return M(...arguments)},P=e=>{e.preventDefault(),e.stopPropagation(),i(`submit`,e),t.model&&M().then(e=>{i(`finish`,e)}).catch(e=>{O(e)})};return o({resetFields:E,clearValidate:D,validateFields:M,getFieldsValue:j,validate:k,scrollToField:A}),uM({model:J(()=>t.model),name:J(()=>t.name),labelAlign:J(()=>t.labelAlign),labelCol:J(()=>t.labelCol),labelWrap:J(()=>t.labelWrap),wrapperCol:J(()=>t.wrapperCol),vertical:J(()=>t.layout===`vertical`),colon:h,requiredMark:m,validateTrigger:J(()=>t.validateTrigger),rules:J(()=>t.rules),addField:C,removeField:w,onValidate:(e,t,n)=>{i(`validate`,e,t,n)},validateMessages:_}),G(()=>t.rules,()=>{t.validateOnRuleChange&&M()}),()=>v(U(`form`,Y(Y({},s),{},{onSubmit:P,class:[b.value,s.class]}),[a.default?.call(a)]))}});ZM.useInjectFormItemContext=zf,ZM.ItemRest=Bf,ZM.install=function(e){return e.component(ZM.name,ZM),e.component(ZM.Item.name,ZM.Item),e.component(Bf.name,Bf),e};var QM=ZM,$M=new N(`antCheckboxEffect`,{"0%":{transform:`scale(1)`,opacity:.5},"100%":{transform:`scale(1.6)`,opacity:0}}),eN=e=>{let{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Z(Z({},rn(e)),{display:`inline-flex`,flexWrap:`wrap`,columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Z(Z({},rn(e)),{display:`inline-flex`,alignItems:`baseline`,cursor:`pointer`,"&:after":{display:`inline-block`,width:0,overflow:`hidden`,content:`'\\a0'`},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Z(Z({},rn(e)),{position:`relative`,whiteSpace:`nowrap`,lineHeight:1,cursor:`pointer`,alignSelf:`center`,[`${t}-input`]:{position:`absolute`,inset:0,zIndex:1,cursor:`pointer`,opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:Z({},I(e))},[`${t}-inner`]:{boxSizing:`border-box`,position:`relative`,top:0,insetInlineStart:0,display:`block`,width:e.checkboxSize,height:e.checkboxSize,direction:`ltr`,backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:`separate`,transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:`border-box`,position:`absolute`,top:`50%`,insetInlineStart:`21.5%`,display:`table`,width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:`rotate(45deg) scale(0) translate(-50%,-50%)`,opacity:0,content:`""`,transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[t]:{"&-indeterminate":{[`${t}-inner`]:{"&:after":{top:`50%`,insetInlineStart:`50%`,width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:`translate(-50%, -50%) scale(1)`,opacity:1,content:`""`}}}}},{[`${n}:hover ${t}:after`]:{visibility:`visible`},[` + ${n}:not(${n}-disabled), + ${t}:not(${t}-disabled) + `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:`rotate(45deg) scale(1) translate(-50%,-50%)`,transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}},"&:after":{position:`absolute`,top:0,insetInlineStart:0,width:`100%`,height:`100%`,borderRadius:e.borderRadiusSM,visibility:`hidden`,border:`${e.lineWidthBold}px solid ${e.colorPrimary}`,animationName:$M,animationDuration:e.motionDurationSlow,animationTimingFunction:`ease-in-out`,animationFillMode:`backwards`,content:`""`,transition:`all ${e.motionDurationSlow}`}},[` + ${n}-checked:not(${n}-disabled), + ${t}-checked:not(${t}-disabled) + `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`},[`&:hover ${t}:after`]:{borderColor:e.colorPrimaryHover}}},{[`${n}-disabled`]:{cursor:`not-allowed`},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:`not-allowed`,pointerEvents:`none`},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:`none`},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function tN(e,t){return[eN(B(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))]}var nN=v(`Checkbox`,(e,t)=>{let{prefixCls:n}=t;return[tN(n,e)]}),rN=e=>{let{prefixCls:t,componentCls:n,antCls:r}=e,i=`${n}-menu-item`,a=` + &${i}-expand ${i}-expand-icon, + ${i}-loading-icon + `,o=Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2);return[{[n]:{width:e.controlWidth}},{[`${n}-dropdown`]:[tN(`${t}-checkbox`,e),{[`&${r}-select-dropdown`]:{padding:0}},{[n]:{"&-checkbox":{top:0,marginInlineEnd:e.paddingXS},"&-menus":{display:`flex`,flexWrap:`nowrap`,alignItems:`flex-start`,[`&${n}-menu-empty`]:{[`${n}-menu`]:{width:`100%`,height:`auto`,[i]:{color:e.colorTextDisabled}}}},"&-menu":{flexGrow:1,minWidth:e.controlItemWidth,height:e.dropdownHeight,margin:0,padding:e.paddingXXS,overflow:`auto`,verticalAlign:`top`,listStyle:`none`,"-ms-overflow-style":`-ms-autohiding-scrollbar`,"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-item":Z(Z({},xe),{display:`flex`,flexWrap:`nowrap`,alignItems:`center`,padding:`${o}px ${e.paddingSM}px`,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,"&:hover":{background:e.controlItemBgHover},"&-disabled":{color:e.colorTextDisabled,cursor:`not-allowed`,"&:hover":{background:`transparent`},[a]:{color:e.colorTextDisabled}},[`&-active:not(${i}-disabled)`]:{"&, &:hover":{fontWeight:e.fontWeightStrong,backgroundColor:e.controlItemBgActive}},"&-content":{flex:`auto`},[a]:{marginInlineStart:e.paddingXXS,color:e.colorTextDescription,fontSize:e.fontSizeIcon},"&-keyword":{color:e.colorHighlight}})}}}]},{[`${n}-dropdown-rtl`]:{direction:`rtl`}},uv(e)]},iN=v(`Cascader`,e=>[rN(e)],{controlWidth:184,controlItemWidth:111,dropdownHeight:180}),aN=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ir===0?[n]:[...e,t,n],[]),i=[],a=0;return r.forEach((t,r)=>{let o=a+t.length,s=e.slice(a,o);a=o,r%2==1&&(s=U(`span`,{class:`${n}-menu-item-keyword`,key:`seperator`},[s])),i.push(s)}),i}var sN=e=>{let{inputValue:t,path:n,prefixCls:r,fieldNames:i}=e,a=[],o=t.toLowerCase();return n.forEach((e,t)=>{t!==0&&a.push(` / `);let n=e[i.label],s=typeof n;(s===`string`||s===`number`)&&(n=oN(String(n),o,r)),a.push(n)}),a};function cN(){return Z(Z({},Br(_A(),[`customSlots`,`checkable`,`options`])),{multiple:{type:Boolean,default:void 0},size:String,bordered:{type:Boolean,default:void 0},placement:{type:String},suffixIcon:f.any,status:String,options:Array,popupClassName:String,dropdownClassName:String,"onUpdate:value":Function})}var lN=a(Z(u({compatConfig:{MODE:3},name:`ACascader`,inheritAttrs:!1,props:Zn(cN(),{bordered:!0,choiceTransitionName:``,allowClear:!0}),setup(e,t){let{attrs:n,expose:r,slots:i,emit:a}=t,o=zf(),s=Vf.useInject(),c=J(()=>Wf(s.status,e.status)),{prefixCls:l,rootPrefixCls:u,getPrefixCls:d,direction:f,getPopupContainer:p,renderEmpty:m,size:h,disabled:g}=X(`cascader`,e),_=J(()=>d(`select`,e.prefixCls)),{compactSize:v,compactItemClassnames:y}=u_(_,f),b=J(()=>v.value||h.value),x=at(),S=J(()=>g.value??x.value),[C,w]=gv(_),[T]=iN(l),E=J(()=>f.value===`rtl`),D=J(()=>{if(!e.showSearch)return e.showSearch;let t={render:sN};return typeof e.showSearch==`object`&&(t=Z(Z({},t),e.showSearch)),t}),O=J(()=>K(e.popupClassName||e.dropdownClassName,`${l.value}-dropdown`,{[`${l.value}-dropdown-rtl`]:E.value},w.value)),k=H();r({focus(){var e;(e=k.value)==null||e.focus()},blur(){var e;(e=k.value)==null||e.blur()}});let A=function(){var e=[...arguments];a(`update:value`,e[0]),a(`change`,...e),o.onFieldChange()},j=function(){a(`blur`,...arguments),o.onFieldBlur()},M=J(()=>e.showArrow===void 0?e.loading||!e.multiple:e.showArrow),N=J(()=>e.placement===void 0?f.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement);return()=>{let{notFoundContent:t=i.notFoundContent?.call(i),expandIcon:r=i.expandIcon?.call(i),multiple:a,bordered:d,allowClear:h,choiceTransitionName:g,transitionName:v,id:x=o.id.value}=e,P=aN(e,[`notFoundContent`,`expandIcon`,`multiple`,`bordered`,`allowClear`,`choiceTransitionName`,`transitionName`,`id`]),F=t||m(`Cascader`),I=r;r||(I=E.value?U(wA,null,null):U(gx,null,null));let L=U(`span`,{class:`${_.value}-menu-item-loading-icon`},[U(qt,{spin:!0},null)]),{suffixIcon:ee,removeIcon:te,clearIcon:ne}=Mf(Z(Z({},e),{hasFeedback:s.hasFeedback,feedbackIcon:s.feedbackIcon,multiple:a,prefixCls:_.value,showArrow:M.value}),i);return T(C(U(bA,Y(Y(Y({},P),n),{},{id:x,prefixCls:_.value,class:[l.value,{[`${_.value}-lg`]:b.value===`large`,[`${_.value}-sm`]:b.value===`small`,[`${_.value}-rtl`]:E.value,[`${_.value}-borderless`]:!d,[`${_.value}-in-form-item`]:s.isFormItemInput},Uf(_.value,c.value,s.hasFeedback),y.value,n.class,w.value],disabled:S.value,direction:f.value,placement:N.value,notFoundContent:F,allowClear:h,showSearch:D.value,expandIcon:I,inputIcon:ee,removeIcon:te,clearIcon:ne,loadingIcon:L,checkable:!!a,dropdownClassName:O.value,dropdownPrefixCls:l.value,choiceTransitionName:Xt(u.value,``,g),transitionName:Xt(u.value,me(N.value),v),getPopupContainer:p?.value,customSlots:Z(Z({},i),{checkable:()=>U(`span`,{class:`${l.value}-checkbox-inner`},null)}),tagRender:e.tagRender||i.tagRender,displayRender:e.displayRender||i.displayRender,maxTagPlaceholder:e.maxTagPlaceholder||i.maxTagPlaceholder,showArrow:s.hasFeedback||e.showArrow,onChange:A,onBlur:j,ref:k}),i)))}}}),{SHOW_CHILD:nk,SHOW_PARENT:tk})),uN=()=>({name:String,prefixCls:String,options:Ue([]),disabled:Boolean,id:String}),dN=()=>Z(Z({},uN()),{defaultValue:Ue(),value:Ue(),onChange:d(),"onUpdate:value":d()}),fN=()=>({prefixCls:String,defaultChecked:Q(),checked:Q(),disabled:Q(),isGroup:Q(),value:f.any,name:String,id:String,indeterminate:Q(),type:_(`checkbox`),autofocus:Q(),onChange:d(),"onUpdate:checked":d(),onClick:d(),skipGroup:Q(!1)}),pN=()=>Z(Z({},fN()),{indeterminate:Q(!1)}),mN=Symbol(`CheckboxGroupContext`),hN=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ih?.disabled.value||d.value);S(()=>{!t.skipGroup&&h&&h.registerValue(_,t.value)}),ut(()=>{h&&h.cancelValue(_)}),V(()=>{e(!!(t.checked!==void 0||h||t.value===void 0),`Checkbox`,"`value` is not validate prop, do you mean `checked`?")});let y=e=>{let t=e.target.checked;r(`update:checked`,t),r(`change`,e),s.onFieldChange()},b=H();return o({focus:()=>{var e;(e=b.value)==null||e.focus()},blur:()=>{var e;(e=b.value)==null||e.blur()}}),()=>{let e=ce(a.default?.call(a)),{indeterminate:n,skipGroup:o,id:d=s.id.value}=t,g=hN(t,[`indeterminate`,`skipGroup`,`id`]),{onMouseenter:_,onMouseleave:x,onInput:S,class:C,style:w}=i,T=hN(i,[`onMouseenter`,`onMouseleave`,`onInput`,`class`,`style`]),E=Z(Z(Z(Z({},g),{id:d,prefixCls:l.value}),T),{disabled:v.value});h&&!o?(E.onChange=function(){r(`change`,...arguments),h.toggleOption({label:e,value:t.value})},E.name=h.name.value,E.checked=h.mergedValue.value.includes(t.value),E.disabled=v.value||f.value,E.indeterminate=n):E.onChange=y;let D=K({[`${l.value}-wrapper`]:!0,[`${l.value}-rtl`]:u.value===`rtl`,[`${l.value}-wrapper-checked`]:E.checked,[`${l.value}-wrapper-disabled`]:E.disabled,[`${l.value}-wrapper-in-form-item`]:c.isFormItemInput},C,m.value),O=K({[`${l.value}-indeterminate`]:n},m.value);return p(U(`label`,{class:D,style:w,onMouseenter:_,onMouseleave:x},[U(lT,Y(Y({"aria-checked":n?`mixed`:void 0},E),{},{class:O,ref:b}),null),e.length?U(`span`,null,[e]):null]))}}}),_N=u({compatConfig:{MODE:3},name:`ACheckboxGroup`,inheritAttrs:!1,props:dN(),setup(e,t){let{slots:n,attrs:r,emit:i,expose:a}=t,o=zf(),{prefixCls:s,direction:c}=X(`checkbox`,e),l=J(()=>`${s.value}-group`),[u,d]=nN(l),f=H((e.value===void 0?e.defaultValue:e.value)||[]);G(()=>e.value,()=>{f.value=e.value||[]});let p=J(()=>e.options.map(e=>typeof e==`string`||typeof e==`number`?{label:e,value:e}:e)),m=H(Symbol()),h=H(new Map),g=e=>{h.value.delete(e),m.value=Symbol()},_=(e,t)=>{h.value.set(e,t),m.value=Symbol()},v=H(new Map);return G(m,()=>{let e=new Map;for(let t of h.value.values())e.set(t,!0);v.value=e}),fe(mN,{cancelValue:g,registerValue:_,toggleOption:t=>{let n=f.value.indexOf(t.value),r=[...f.value];n===-1?r.push(t.value):r.splice(n,1),e.value===void 0&&(f.value=r);let a=r.filter(e=>v.value.has(e)).sort((e,t)=>p.value.findIndex(t=>t.value===e)-p.value.findIndex(e=>e.value===t));i(`update:value`,a),i(`change`,a),o.onFieldChange()},mergedValue:f,name:J(()=>e.name),disabled:J(()=>e.disabled)}),a({mergedValue:f}),()=>{let{id:t=o.id.value}=e,i=null;return p.value&&p.value.length>0&&(i=p.value.map(t=>U(gN,{prefixCls:s.value,key:t.value.toString(),disabled:`disabled`in t?t.disabled:e.disabled,indeterminate:t.indeterminate,value:t.value,checked:f.value.indexOf(t.value)!==-1,onChange:t.onChange,class:`${l.value}-item`},{default:()=>[n.label===void 0?t.label:n.label?.call(n,t)]}))),u(U(`div`,Y(Y({},r),{},{class:[l.value,{[`${l.value}-rtl`]:c.value===`rtl`},r.class,d.value],id:t}),[i||n.default?.call(n)]))}}});gN.Group=_N,gN.install=function(e){return e.component(gN.name,gN),e.component(_N.name,_N),e};var vN=gN,yN={useBreakpoint:Uv},bN=a(vM),xN=e=>{let{componentCls:t,commentBg:n,commentPaddingBase:r,commentNestIndent:i,commentFontSizeBase:a,commentFontSizeSm:o,commentAuthorNameColor:s,commentAuthorTimeColor:c,commentActionColor:l,commentActionHoverColor:u,commentActionsMarginBottom:d,commentActionsMarginTop:f,commentContentDetailPMarginBottom:p}=e;return{[t]:{position:`relative`,backgroundColor:n,[`${t}-inner`]:{display:`flex`,padding:r},[`${t}-avatar`]:{position:`relative`,flexShrink:0,marginRight:e.marginSM,cursor:`pointer`,img:{width:`32px`,height:`32px`,borderRadius:`50%`}},[`${t}-content`]:{position:`relative`,flex:`1 1 auto`,minWidth:`1px`,fontSize:a,wordWrap:`break-word`,"&-author":{display:`flex`,flexWrap:`wrap`,justifyContent:`flex-start`,marginBottom:e.marginXXS,fontSize:a,"& > a,& > span":{paddingRight:e.paddingXS,fontSize:o,lineHeight:`18px`},"&-name":{color:s,fontSize:a,transition:`color ${e.motionDurationSlow}`,"> *":{color:s,"&:hover":{color:s}}},"&-time":{color:c,whiteSpace:`nowrap`,cursor:`auto`}},"&-detail p":{marginBottom:p,whiteSpace:`pre-wrap`}},[`${t}-actions`]:{marginTop:f,marginBottom:d,paddingLeft:0,"> li":{display:`inline-block`,color:l,"> span":{marginRight:`10px`,color:l,fontSize:o,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,userSelect:`none`,"&:hover":{color:u}}}},[`${t}-nested`]:{marginLeft:i},"&-rtl":{direction:`rtl`}}}},SN=v(`Comment`,e=>[xN(B(e,{commentBg:`inherit`,commentPaddingBase:`${e.paddingMD}px 0`,commentNestIndent:`44px`,commentFontSizeBase:e.fontSize,commentFontSizeSm:e.fontSizeSM,commentAuthorNameColor:e.colorTextTertiary,commentAuthorTimeColor:e.colorTextPlaceholder,commentActionColor:e.colorTextTertiary,commentActionHoverColor:e.colorTextSecondary,commentActionsMarginBottom:`inherit`,commentActionsMarginTop:e.marginSM,commentContentDetailPMarginBottom:`inherit`}))]),CN=a(u({compatConfig:{MODE:3},name:`AComment`,inheritAttrs:!1,props:{actions:Array,author:f.any,avatar:f.any,content:f.any,prefixCls:String,datetime:f.any},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`comment`,e),[o,s]=SN(i),c=(e,t)=>U(`div`,{class:`${e}-nested`},[t]),l=e=>!e||!e.length?null:e.map((e,t)=>U(`li`,{key:`action-${t}`},[e]));return()=>{let t=i.value,u=e.actions??n.actions?.call(n),d=e.author??n.author?.call(n),f=e.avatar??n.avatar?.call(n),p=e.content??n.content?.call(n),m=e.datetime??n.datetime?.call(n),h=U(`div`,{class:`${t}-avatar`},[typeof f==`string`?U(`img`,{src:f,alt:`comment-avatar`},null):f]),g=u?U(`ul`,{class:`${t}-actions`},[l(Array.isArray(u)?u:[u])]):null,_=U(`div`,{class:`${t}-content-author`},[d&&U(`span`,{class:`${t}-content-author-name`},[d]),m&&U(`span`,{class:`${t}-content-author-time`},[m])]),v=U(`div`,{class:`${t}-content`},[_,U(`div`,{class:`${t}-content-detail`},[p]),g]),y=U(`div`,{class:`${t}-inner`},[h,v]),b=ce(n.default?.call(n));return o(U(`div`,Y(Y({},r),{},{class:[t,{[`${t}-rtl`]:a.value===`rtl`},r.class,s.value]}),[y,b&&b.length?c(t,b):null]))}}})),wN=(e,t)=>{let{attrs:n,slots:r}=t;return U(Qb,Y(Y({size:`small`,type:`primary`},e),n),r)},TN=(e,t,r)=>{let i=n(r);return{[`${e.componentCls}-${t}`]:{color:e[`color${r}`],background:e[`color${i}Bg`],borderColor:e[`color${i}Border`],[`&${e.componentCls}-borderless`]:{borderColor:`transparent`}}}},EN=e=>zr(e,(t,n)=>{let{textColor:r,lightBorderColor:i,lightColor:a,darkColor:o}=n;return{[`${e.componentCls}-${t}`]:{color:r,background:a,borderColor:i,"&-inverse":{color:e.colorTextLightSolid,background:o,borderColor:o},[`&${e.componentCls}-borderless`]:{borderColor:`transparent`}}}}),DN=e=>{let{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:i}=e,a=r-n,o=t-n;return{[i]:Z(Z({},rn(e)),{display:`inline-block`,height:`auto`,marginInlineEnd:e.marginXS,paddingInline:a,fontSize:e.tagFontSize,lineHeight:`${e.tagLineHeight}px`,whiteSpace:`nowrap`,background:e.tagDefaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:`start`,[`&${i}-rtl`]:{direction:`rtl`},"&, a, a:hover":{color:e.tagDefaultColor},[`${i}-close-icon`]:{marginInlineStart:o,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-has-color`]:{borderColor:`transparent`,[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:`transparent`,borderColor:`transparent`,cursor:`pointer`,[`&:not(${i}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:`none`},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:a}}),[`${i}-borderless`]:{borderColor:`transparent`,background:e.tagBorderlessBg}}},ON=v(`Tag`,e=>{let{fontSize:t,lineHeight:n,lineWidth:r,fontSizeIcon:i}=e,a=Math.round(t*n),o=e.fontSizeSM,s=a-r*2,c=e.colorFillAlter,l=e.colorText,u=B(e,{tagFontSize:o,tagLineHeight:s,tagDefaultBg:c,tagDefaultColor:l,tagIconSize:i-2*r,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[DN(u),EN(u),TN(u,`success`,`Success`),TN(u,`processing`,`Info`),TN(u,`error`,`Error`),TN(u,`warning`,`Warning`)]}),kN=u({compatConfig:{MODE:3},name:`ACheckableTag`,inheritAttrs:!1,props:{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function},setup(e,t){let{slots:n,emit:r,attrs:i}=t,{prefixCls:a}=X(`tag`,e),[o,s]=ON(a),c=t=>{let{checked:n}=e;r(`update:checked`,!n),r(`change`,!n),r(`click`,t)},l=J(()=>K(a.value,s.value,{[`${a.value}-checkable`]:!0,[`${a.value}-checkable-checked`]:e.checked}));return()=>o(U(`span`,Y(Y({},i),{},{class:[l.value,i.class],onClick:c}),[n.default?.call(n)]))}}),AN=u({compatConfig:{MODE:3},name:`ATag`,inheritAttrs:!1,props:{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:f.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},onClick:he(),"onUpdate:visible":Function,icon:f.any,bordered:{type:Boolean,default:!0}},slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t,{prefixCls:a,direction:o}=X(`tag`,e),[s,c]=ON(a),l=q(!0);S(()=>{e.visible!==void 0&&(l.value=e.visible)});let u=t=>{t.stopPropagation(),r(`update:visible`,!1),r(`close`,t),!t.defaultPrevented&&e.visible===void 0&&(l.value=!1)},d=J(()=>my(e.color)||hy(e.color)),f=J(()=>K(a.value,c.value,{[`${a.value}-${e.color}`]:d.value,[`${a.value}-has-color`]:e.color&&!d.value,[`${a.value}-hidden`]:!l.value,[`${a.value}-rtl`]:o.value===`rtl`,[`${a.value}-borderless`]:!e.bordered})),p=e=>{r(`click`,e)};return()=>{let{icon:t=n.icon?.call(n),color:r,closeIcon:o=n.closeIcon?.call(n),closable:c=!1}=e,l=()=>c?o?U(`span`,{class:`${a.value}-close-icon`,onClick:u},[o]):U(Pe,{class:`${a.value}-close-icon`,onClick:u},null):null,m={backgroundColor:r&&!d.value?r:void 0},h=t||null,g=n.default?.call(n),_=h?U($e,null,[h,U(`span`,null,[g])]):g,v=e.onClick!==void 0,y=U(`span`,Y(Y({},i),{},{onClick:p,class:[f.value,i.class],style:[m,i.style]}),[_,l()]);return s(v?U(db,null,{default:()=>[y]}):y)}}});AN.CheckableTag=kN,AN.install=function(e){return e.component(AN.name,AN),e.component(kN.name,kN),e};function jN(e,t){let{slots:n,attrs:r}=t;return U(AN,Y(Y({color:`blue`},e),r),n)}var MN={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z`}}]},name:`calendar`,theme:`outlined`};function NN(e){for(var t=1;t_.value||m.value),[b,x]=nE(d),S=H();a({focus:()=>{var e;(e=S.value)==null||e.focus()},blur:()=>{var e;(e=S.value)==null||e.blur()}});let C=t=>c.valueFormat?e.toString(t,c.valueFormat):t,w=(e,t)=>{let n=C(e);s(`update:value`,n),s(`change`,n,t),l.onFieldChange()},T=e=>{s(`update:open`,e),s(`openChange`,e)},E=e=>{s(`focus`,e)},D=e=>{s(`blur`,e),l.onFieldBlur()},O=(e,t)=>{let n=C(e);s(`panelChange`,n,t)},k=e=>{let t=C(e);s(`ok`,t)},[A]=Kt(`DatePicker`,At),j=J(()=>c.value?c.valueFormat?e.toDate(c.value,c.valueFormat):c.value:c.value===``?void 0:c.value),M=J(()=>c.defaultValue?c.valueFormat?e.toDate(c.defaultValue,c.valueFormat):c.defaultValue:c.defaultValue===``?void 0:c.defaultValue),N=J(()=>c.defaultPickerValue?c.valueFormat?e.toDate(c.defaultPickerValue,c.valueFormat):c.defaultPickerValue:c.defaultPickerValue===``?void 0:c.defaultPickerValue);return()=>{let t=Z(Z({},A.value),c.locale),r=Z(Z({},c),o),{bordered:a=!0,placeholder:s,suffixIcon:m=i.suffixIcon?.call(i),showToday:_=!0,transitionName:C,allowClear:P=!0,dateRender:F=i.dateRender,renderExtraFooter:I=i.renderExtraFooter,monthCellRender:L=i.monthCellRender||c.monthCellContentRender||i.monthCellContentRender,clearIcon:ee=i.clearIcon?.call(i),id:te=l.id.value}=r,ne=KN(r,[`bordered`,`placeholder`,`suffixIcon`,`showToday`,`transitionName`,`allowClear`,`dateRender`,`renderExtraFooter`,`monthCellRender`,`clearIcon`,`id`]),R=r.showTime===``||r.showTime,{format:re}=r,ie={};n&&(ie.picker=n);let ae=n||r.picker||`date`;ie=Z(Z(Z({},ie),R?nP(Z({format:re,picker:ae},typeof R==`object`?R:{})):{}),ae===`time`?nP(Z(Z({format:re},ne),{picker:ae})):{});let oe=d.value,z=U($e,null,[m||U(n===`time`?zN:FN,null,null),u.hasFeedback&&u.feedbackIcon]);return b(U(sT,Y(Y(Y({monthCellRender:L,dateRender:F,renderExtraFooter:I,ref:S,placeholder:BN(t,ae,s),suffixIcon:z,dropdownAlign:HN(f.value,c.placement),clearIcon:ee||U(tt,null,null),allowClear:P,transitionName:C||`${h.value}-slide-up`},ne),ie),{},{id:te,picker:ae,value:j.value,defaultValue:M.value,defaultPickerValue:N.value,showToday:_,locale:t.lang,class:K({[`${oe}-${y.value}`]:y.value,[`${oe}-borderless`]:!a},Uf(oe,Wf(u.status,c.status),u.hasFeedback),o.class,x.value,v.value),disabled:g.value,prefixCls:oe,getPopupContainer:o.getCalendarContainer||p.value,generateConfig:e,prevIcon:i.prevIcon?.call(i)||U(`span`,{class:`${oe}-prev-icon`},null),nextIcon:i.nextIcon?.call(i)||U(`span`,{class:`${oe}-next-icon`},null),superPrevIcon:i.superPrevIcon?.call(i)||U(`span`,{class:`${oe}-super-prev-icon`},null),superNextIcon:i.superNextIcon?.call(i)||U(`span`,{class:`${oe}-super-next-icon`},null),components:eP,direction:f.value,dropdownClassName:K(x.value,c.popupClassName,c.dropdownClassName),onChange:w,onOpenChange:T,onFocus:E,onBlur:D,onPanelChange:O,onOk:k}),null))}}})}return{DatePicker:n(void 0,`ADatePicker`),WeekPicker:n(`week`,`AWeekPicker`),MonthPicker:n(`month`,`AMonthPicker`),YearPicker:n(`year`,`AYearPicker`),TimePicker:n(`time`,`TimePicker`),QuarterPicker:n(`quarter`,`AQuarterPicker`)}}var JN={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z`}}]},name:`swap-right`,theme:`outlined`};function YN(e){for(var t=1;tg.value||p.value),[y,b]=nE(u),x=H();r({focus:()=>{var e;(e=x.value)==null||e.focus()},blur:()=>{var e;(e=x.value)==null||e.blur()}});let S=t=>s.valueFormat?e.toString(t,s.valueFormat):t,C=(e,t)=>{let n=S(e);o(`update:value`,n),o(`change`,n,t),c.onFieldChange()},w=e=>{o(`update:open`,e),o(`openChange`,e)},T=e=>{o(`focus`,e)},E=e=>{o(`blur`,e),c.onFieldBlur()},D=(e,t)=>{let n=S(e);o(`panelChange`,n,t)},O=e=>{let t=S(e);o(`ok`,t)},k=(e,t,n)=>{let r=S(e);o(`calendarChange`,r,t,n)},[A]=Kt(`DatePicker`,At),j=J(()=>s.value&&s.valueFormat?e.toDate(s.value,s.valueFormat):s.value),M=J(()=>s.defaultValue&&s.valueFormat?e.toDate(s.defaultValue,s.valueFormat):s.defaultValue),N=J(()=>s.defaultPickerValue&&s.valueFormat?e.toDate(s.defaultPickerValue,s.valueFormat):s.defaultPickerValue);return()=>{let t=Z(Z({},A.value),s.locale),n=Z(Z({},s),a),{prefixCls:r,bordered:o=!0,placeholder:p,suffixIcon:g=i.suffixIcon?.call(i),picker:S=`date`,transitionName:P,allowClear:F=!0,dateRender:I=i.dateRender,renderExtraFooter:L=i.renderExtraFooter,separator:ee=i.separator?.call(i),clearIcon:te=i.clearIcon?.call(i),id:ne=c.id.value}=n,R=QN(n,[`prefixCls`,`bordered`,`placeholder`,`suffixIcon`,`picker`,`transitionName`,`allowClear`,`dateRender`,`renderExtraFooter`,`separator`,`clearIcon`,`id`]);delete R[`onUpdate:value`],delete R[`onUpdate:open`];let{format:re,showTime:ie}=n,ae={};ae=Z(Z(Z({},ae),ie?nP(Z({format:re,picker:S},ie)):{}),S===`time`?nP(Z(Z({format:re},Br(R,[`disabledTime`])),{picker:S})):{});let oe=u.value,z=U($e,null,[g||U(S===`time`?zN:FN,null,null),l.hasFeedback&&l.feedbackIcon]);return y(U(oT,Y(Y(Y({dateRender:I,renderExtraFooter:L,separator:ee||U(`span`,{"aria-label":`to`,class:`${oe}-separator`},[U(ZN,null,null)]),ref:x,dropdownAlign:HN(d.value,s.placement),placeholder:VN(t,S,p),suffixIcon:z,clearIcon:te||U(tt,null,null),allowClear:F,transitionName:P||`${m.value}-slide-up`},R),ae),{},{disabled:h.value,id:ne,value:j.value,defaultValue:M.value,defaultPickerValue:N.value,picker:S,class:K({[`${oe}-${v.value}`]:v.value,[`${oe}-borderless`]:!o},Uf(oe,Wf(l.status,s.status),l.hasFeedback),a.class,b.value,_.value),locale:t.lang,prefixCls:oe,getPopupContainer:a.getCalendarContainer||f.value,generateConfig:e,prevIcon:i.prevIcon?.call(i)||U(`span`,{class:`${oe}-prev-icon`},null),nextIcon:i.nextIcon?.call(i)||U(`span`,{class:`${oe}-next-icon`},null),superPrevIcon:i.superPrevIcon?.call(i)||U(`span`,{class:`${oe}-super-prev-icon`},null),superNextIcon:i.superNextIcon?.call(i)||U(`span`,{class:`${oe}-super-next-icon`},null),components:eP,direction:d.value,dropdownClassName:K(b.value,s.popupClassName,s.dropdownClassName),onChange:C,onOpenChange:w,onFocus:T,onBlur:E,onPanelChange:D,onOk:O,onCalendarChange:k}),null))}}})}var eP={button:wN,rangeItem:jN};function tP(e){return e?Array.isArray(e)?e:[e]:[]}function nP(e){let{format:t,picker:n,showHour:r,showMinute:i,showSecond:a,use12Hours:o}=e,s=tP(t)[0],c=Z({},e);return s&&typeof s==`string`&&(!s.includes(`s`)&&a===void 0&&(c.showSecond=!1),!s.includes(`m`)&&i===void 0&&(c.showMinute=!1),!s.includes(`H`)&&!s.includes(`h`)&&r===void 0&&(c.showHour=!1),(s.includes(`a`)||s.includes(`A`))&&o===void 0&&(c.use12Hours=!0)),n===`time`?c:(typeof s==`function`&&delete c.format,{showTime:c})}function rP(e,t){let{DatePicker:n,WeekPicker:r,MonthPicker:i,YearPicker:a,TimePicker:o,QuarterPicker:s}=qN(e,t);return{DatePicker:n,WeekPicker:r,MonthPicker:i,YearPicker:a,TimePicker:o,QuarterPicker:s,RangePicker:$N(e,t)}}var{DatePicker:iP,WeekPicker:aP,MonthPicker:oP,YearPicker:sP,TimePicker:cP,QuarterPicker:lP,RangePicker:uP}=rP(nC),dP=Z(iP,{WeekPicker:aP,MonthPicker:oP,YearPicker:sP,RangePicker:uP,TimePicker:cP,QuarterPicker:lP,install:e=>(e.component(iP.name,iP),e.component(uP.name,uP),e.component(oP.name,oP),e.component(aP.name,aP),e.component(lP.name,lP),e)});function fP(e){return e!=null}var pP=e=>{let{itemPrefixCls:t,component:n,span:r,labelStyle:i,contentStyle:a,bordered:o,label:s,content:c,colon:l}=e,u=n;return o?U(u,{class:[{[`${t}-item-label`]:fP(s),[`${t}-item-content`]:fP(c)}],colSpan:r},{default:()=>[fP(s)&&U(`span`,{style:i},[s]),fP(c)&&U(`span`,{style:a},[c])]}):U(u,{class:[`${t}-item`],colSpan:r},{default:()=>[U(`div`,{class:`${t}-item-container`},[(s||s===0)&&U(`span`,{class:[`${t}-item-label`,{[`${t}-item-no-colon`]:!l}],style:i},[s]),(c||c===0)&&U(`span`,{class:`${t}-item-content`,style:a},[c])])]})},mP=e=>{let t=(e,t,n)=>{let{colon:r,prefixCls:i,bordered:a}=t,{component:o,type:s,showLabel:l,showContent:u,labelStyle:d,contentStyle:f}=n;return e.map((e,t)=>{var n;let p=e.props||{},{prefixCls:m=i,span:h=1,labelStyle:g=p[`label-style`],contentStyle:_=p[`content-style`],label:v=((n=e.children)?.label)?.call(n)}=p,y=c(e),x=b(e),S=Ce(e),{key:C}=e;return typeof o==`string`?U(pP,{key:`${s}-${String(C)||t}`,class:x,style:S,labelStyle:Z(Z({},d),g),contentStyle:Z(Z({},f),_),span:h,colon:r,component:o,itemPrefixCls:m,bordered:a,label:l?v:null,content:u?y:null},null):[U(pP,{key:`label-${String(C)||t}`,class:x,style:Z(Z(Z({},d),S),g),span:1,colon:r,component:o[0],itemPrefixCls:m,bordered:a,label:v},null),U(pP,{key:`content-${String(C)||t}`,class:x,style:Z(Z(Z({},f),S),_),span:h*2-1,component:o[1],itemPrefixCls:m,bordered:a,content:y},null)]})},{prefixCls:n,vertical:r,row:i,index:a,bordered:o}=e,{labelStyle:s,contentStyle:l}=g(wP,{labelStyle:H({}),contentStyle:H({})});return r?U($e,null,[U(`tr`,{key:`label-${a}`,class:`${n}-row`},[t(i,e,{component:`th`,type:`label`,showLabel:!0,labelStyle:s.value,contentStyle:l.value})]),U(`tr`,{key:`content-${a}`,class:`${n}-row`},[t(i,e,{component:`td`,type:`content`,showContent:!0,labelStyle:s.value,contentStyle:l.value})])]):U(`tr`,{key:a,class:`${n}-row`},[t(i,e,{component:o?[`th`,`td`]:`td`,type:`item`,showLabel:!0,showContent:!0,labelStyle:s.value,contentStyle:l.value})])},hP=e=>{let{componentCls:t,descriptionsSmallPadding:n,descriptionsDefaultPadding:r,descriptionsMiddlePadding:i,descriptionsBg:a}=e;return{[`&${t}-bordered`]:{[`${t}-view`]:{border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:`auto`,borderCollapse:`collapse`}},[`${t}-item-label, ${t}-item-content`]:{padding:r,borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:`none`}},[`${t}-item-label`]:{backgroundColor:a,"&::after":{display:`none`}},[`${t}-row`]:{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBottom:`none`}},[`&${t}-middle`]:{[`${t}-item-label, ${t}-item-content`]:{padding:i}},[`&${t}-small`]:{[`${t}-item-label, ${t}-item-content`]:{padding:n}}}}},gP=e=>{let{componentCls:t,descriptionsExtraColor:n,descriptionItemPaddingBottom:r,descriptionsItemLabelColonMarginRight:i,descriptionsItemLabelColonMarginLeft:a,descriptionsTitleMarginBottom:o}=e;return{[t]:Z(Z(Z({},rn(e)),hP(e)),{"&-rtl":{direction:`rtl`},[`${t}-header`]:{display:`flex`,alignItems:`center`,marginBottom:o},[`${t}-title`]:Z(Z({},xe),{flex:`auto`,color:e.colorText,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:`auto`,color:n,fontSize:e.fontSize},[`${t}-view`]:{width:`100%`,borderRadius:e.borderRadiusLG,table:{width:`100%`,tableLayout:`fixed`}},[`${t}-row`]:{"> th, > td":{paddingBottom:r},"&:last-child":{borderBottom:`none`}},[`${t}-item-label`]:{color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:`start`,"&::after":{content:`":"`,position:`relative`,top:-.5,marginInline:`${a}px ${i}px`},[`&${t}-item-no-colon::after`]:{content:`""`}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:`""`}},[`${t}-item-content`]:{display:`table-cell`,flex:1,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:`break-word`,overflowWrap:`break-word`},[`${t}-item`]:{paddingBottom:0,verticalAlign:`top`,"&-container":{display:`flex`,[`${t}-item-label`]:{display:`inline-flex`,alignItems:`baseline`},[`${t}-item-content`]:{display:`inline-flex`,alignItems:`baseline`}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}},_P=v(`Descriptions`,e=>{let t=e.colorFillAlter,n=e.fontSizeSM*e.lineHeightSM,r=e.colorText,i=`${e.paddingXS}px ${e.padding}px`,a=`${e.padding}px ${e.paddingLG}px`,o=`${e.paddingSM}px ${e.paddingLG}px`,s=e.padding,c=e.marginXS;return[gP(B(e,{descriptionsBg:t,descriptionsTitleMarginBottom:n,descriptionsExtraColor:r,descriptionItemPaddingBottom:s,descriptionsSmallPadding:i,descriptionsDefaultPadding:a,descriptionsMiddlePadding:o,descriptionsItemLabelColonMarginRight:c,descriptionsItemLabelColonMarginLeft:e.marginXXS/2}))]});f.any;var vP=u({compatConfig:{MODE:3},name:`ADescriptionsItem`,props:{prefixCls:String,label:f.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}},setup(e,t){let{slots:n}=t;return()=>n.default?.call(n)}}),yP={xxxl:3,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function bP(e,t){if(typeof e==`number`)return e;if(typeof e==`object`)for(let n=0;nn)&&(i=ao(t,{span:n}),e(r===void 0,`Descriptions`,"Sum of column `span` in a line not match `column` of Descriptions.")),i}function SP(e,t){let n=ce(e),r=[],i=[],a=t;return n.forEach((e,o)=>{let s=e.props?.span,c=s||1;if(o===n.length-1){i.push(xP(e,a,s)),r.push(i);return}c({prefixCls:String,bordered:{type:Boolean,default:void 0},size:{type:String,default:`default`},title:f.any,extra:f.any,column:{type:[Number,Object],default:()=>yP},layout:String,colon:{type:Boolean,default:void 0},labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0}}),wP=Symbol(`descriptionsContext`),TP=u({compatConfig:{MODE:3},name:`ADescriptions`,inheritAttrs:!1,props:CP(),slots:Object,Item:vP,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:a,direction:o}=X(`descriptions`,e),s,c=H({}),[l,u]=_P(a),d=Hv();i(()=>{s=d.value.subscribe(t=>{typeof e.column==`object`&&(c.value=t)})}),ut(()=>{d.value.unsubscribe(s)}),fe(wP,{labelStyle:St(e,`labelStyle`),contentStyle:St(e,`contentStyle`)});let f=J(()=>bP(e.column,c.value));return()=>{let{size:t,bordered:i=!1,layout:s=`horizontal`,colon:c=!0,title:d=n.title?.call(n),extra:p=n.extra?.call(n)}=e,m=SP(n.default?.call(n),f.value);return l(U(`div`,Y(Y({},r),{},{class:[a.value,{[`${a.value}-${t}`]:t!=="default",[`${a.value}-bordered`]:!!i,[`${a.value}-rtl`]:o.value===`rtl`},r.class,u.value]}),[(d||p)&&U(`div`,{class:`${a.value}-header`},[d&&U(`div`,{class:`${a.value}-title`},[d]),p&&U(`div`,{class:`${a.value}-extra`},[p])]),U(`div`,{class:`${a.value}-view`},[U(`table`,null,[U(`tbody`,null,[m.map((e,t)=>U(mP,{key:t,index:t,colon:c,prefixCls:a.value,vertical:s===`vertical`,bordered:i,row:e},null))])])])]))}}});TP.install=function(e){return e.component(TP.name,TP),e.component(TP.Item.name,TP.Item),e};var EP=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:i}=e;return{[t]:Z(Z({},rn(e)),{borderBlockStart:`${i}px solid ${r}`,"&-vertical":{position:`relative`,top:`-0.06em`,display:`inline-block`,height:`0.9em`,margin:`0 ${e.dividerVerticalGutterMargin}px`,verticalAlign:`middle`,borderTop:0,borderInlineStart:`${i}px solid ${r}`},"&-horizontal":{display:`flex`,clear:`both`,width:`100%`,minWidth:`100%`,margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:`flex`,alignItems:`center`,margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:`nowrap`,textAlign:`center`,borderBlockStart:`0 ${r}`,"&::before, &::after":{position:`relative`,width:`50%`,borderBlockStart:`${i}px solid transparent`,borderBlockStartColor:`inherit`,borderBlockEnd:0,transform:`translateY(50%)`,content:`''`}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:`5%`},"&::after":{width:`95%`}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:`95%`},"&::after":{width:`5%`}},[`${t}-inner-text`]:{display:`inline-block`,padding:`0 1em`},"&-dashed":{background:`none`,borderColor:r,borderStyle:`dashed`,borderWidth:`${i}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:`dashed none none`}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:i,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:`100%`},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:`100%`},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}},DP=v(`Divider`,e=>[EP(B(e,{dividerVerticalGutterMargin:e.marginXS,dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG}))],{sizePaddingEdgeHorizontal:0}),OP=a(u({name:`ADivider`,inheritAttrs:!1,compatConfig:{MODE:3},props:{prefixCls:String,type:{type:String,default:`horizontal`},dashed:{type:Boolean,default:!1},orientation:{type:String,default:`center`},plain:{type:Boolean,default:!1},orientationMargin:[String,Number]},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`divider`,e),[o,s]=DP(i),c=J(()=>e.orientation===`left`&&e.orientationMargin!=null),l=J(()=>e.orientation===`right`&&e.orientationMargin!=null),u=J(()=>{let{type:t,dashed:n,plain:r}=e,o=i.value;return{[o]:!0,[s.value]:!!s.value,[`${o}-${t}`]:!0,[`${o}-dashed`]:!!n,[`${o}-plain`]:!!r,[`${o}-rtl`]:a.value===`rtl`,[`${o}-no-default-orientation-margin-left`]:c.value,[`${o}-no-default-orientation-margin-right`]:l.value}}),d=J(()=>{let t=typeof e.orientationMargin==`number`?`${e.orientationMargin}px`:e.orientationMargin;return Z(Z({},c.value&&{marginLeft:t}),l.value&&{marginRight:t})}),f=J(()=>e.orientation.length>0?`-`+e.orientation:e.orientation);return()=>{let e=ce(n.default?.call(n));return o(U(`div`,Y(Y({},r),{},{class:[u.value,e.length?`${i.value}-with-text ${i.value}-with-text${f.value}`:``,r.class],role:`separator`}),[e.length?U(`span`,{class:`${i.value}-inner-text`,style:d.value},[e]):null]))}}}));bx.Button=fx,bx.install=function(e){return e.component(bx.name,bx),e.component(fx.name,fx),e};var kP=bx,AP=()=>({prefixCls:String,width:f.oneOfType([f.string,f.number]),height:f.oneOfType([f.string,f.number]),style:{type:Object,default:void 0},class:String,rootClassName:String,rootStyle:Qt(),placement:{type:String},wrapperClassName:String,level:{type:[String,Array]},levelMove:{type:[Number,Function,Array]},duration:String,ease:String,showMask:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},afterVisibleChange:Function,keyboard:{type:Boolean,default:void 0},contentWrapperStyle:Ue(),autofocus:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},motion:d(),maskMotion:Qt()}),jP=()=>Z(Z({},AP()),{forceRender:{type:Boolean,default:void 0},getContainer:f.oneOfType([f.string,f.func,f.object,f.looseBool])}),MP=()=>Z(Z({},AP()),{getContainer:Function,getOpenCount:Function,scrollLocker:f.any,inline:Boolean});function NP(e){return Array.isArray(e)?e:[e]}var PP={transition:`transitionend`,WebkitTransition:`webkitTransitionEnd`,MozTransition:`transitionend`,OTransition:`oTransitionEnd otransitionend`};PP[Object.keys(PP).filter(e=>{if(typeof document>`u`)return!1;let t=document.getElementsByTagName(`html`)[0];return e in(t?t.style:{})})[0]];var FP=!(typeof window<`u`&&window.document&&window.document.createElement),IP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{z(()=>{var t;let{open:n,getContainer:r,showMask:i,autofocus:a}=e,o=r?.();h(e),n&&(o&&o.parentNode===document.body&&(LP[u]=n),z(()=>{a&&d()}),i&&((t=e.scrollLocker)==null||t.lock()))})}),G(()=>e.level,()=>{h(e)},{flush:`post`}),G(()=>e.open,()=>{let{open:t,getContainer:n,scrollLocker:r,showMask:i,autofocus:a}=e,o=n?.();o&&o.parentNode===document.body&&(LP[u]=!!t),t?(a&&d(),i&&r?.lock()):r?.unLock()},{flush:`post`}),y(()=>{var t;let{open:n}=e;delete LP[u],n&&(document.body.style.touchAction=``),(t=e.scrollLocker)==null||t.unLock()}),G(()=>e.placement,e=>{e&&(c.value=null)});let d=()=>{var e,t;(t=(e=a.value)?.focus)==null||t.call(e)},f=e=>{n(`close`,e)},p=e=>{e.keyCode===$.ESC&&(e.stopPropagation(),f(e))},m=()=>{let{open:t,afterVisibleChange:n}=e;n&&n(!!t)},h=e=>{let{level:t,getContainer:n}=e;if(FP)return;let r=n?.(),i=r?r.parentNode:null;l=[],t===`all`?(i?Array.prototype.slice.call(i.children):[]).forEach(e=>{e.nodeName!==`SCRIPT`&&e.nodeName!==`STYLE`&&e.nodeName!==`LINK`&&e!==r&&l.push(e)}):t&&NP(t).forEach(e=>{document.querySelectorAll(e).forEach(e=>{l.push(e)})})},g=e=>{n(`handleClick`,e)},_=q(!1);return G(a,()=>{z(()=>{_.value=!0})}),()=>{let{width:t,height:n,open:l,prefixCls:u,placement:d,level:h,levelMove:v,ease:y,duration:b,getContainer:x,onChange:S,afterVisibleChange:C,showMask:w,maskClosable:T,maskStyle:E,keyboard:D,getOpenCount:O,scrollLocker:k,contentWrapperStyle:A,style:j,class:M,rootClassName:N,rootStyle:P,maskMotion:F,motion:I,inline:L}=e,ee=IP(e,`width.height.open.prefixCls.placement.level.levelMove.ease.duration.getContainer.onChange.afterVisibleChange.showMask.maskClosable.maskStyle.keyboard.getOpenCount.scrollLocker.contentWrapperStyle.style.class.rootClassName.rootStyle.maskMotion.motion.inline`.split(`.`)),te=l&&_.value,ne=K(u,{[`${u}-${d}`]:!0,[`${u}-open`]:te,[`${u}-inline`]:L,"no-mask":!w,[N]:!0}),R=typeof I==`function`?I(d):I;return U(`div`,Y(Y({},Br(ee,[`autofocus`])),{},{tabindex:-1,class:ne,style:P,ref:a,onKeydown:te&&D?p:void 0}),[U(Re,F,{default:()=>[w&&Mt(U(`div`,{class:`${u}-mask`,onClick:T?f:void 0,style:E,ref:o},null),[[ht,te]])]}),U(Re,Y(Y({},R),{},{onAfterEnter:m,onAfterLeave:m}),{default:()=>[Mt(U(`div`,{class:`${u}-content-wrapper`,style:[A],ref:i},[U(`div`,{class:[`${u}-content`,M],style:j,ref:c},[r.default?.call(r)]),r.handler?U(`div`,{onClick:g,ref:s},[r.handler?.call(r)]):null]),[[ht,te]])]})])}}}),zP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{},showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:``,keyboard:!0,forceRender:!1,autofocus:!0}),emits:[`handleClick`,`close`],setup(e,t){let{emit:n,slots:r}=t,i=H(null),a=e=>{n(`handleClick`,e)},o=e=>{n(`close`,e)};return()=>{let{getContainer:t,wrapperClassName:n,rootClassName:s,rootStyle:c,forceRender:l}=e,u=zP(e,[`getContainer`,`wrapperClassName`,`rootClassName`,`rootStyle`,`forceRender`]),d=null;if(!t)return U(RP,Y(Y({},u),{},{rootClassName:s,rootStyle:c,open:e.open,onClose:o,onHandleClick:a,inline:!0}),r);let f=!!r.handler||l;return(f||e.open||i.value)&&(d=U(bu,{autoLock:!0,visible:e.open,forceRender:f,getContainer:t,wrapperClassName:n},{default:t=>{var{visible:n,afterClose:l}=t,d=zP(t,[`visible`,`afterClose`]);return U(RP,Y(Y(Y({ref:i},u),d),{},{rootClassName:s,rootStyle:c,open:n===void 0?e.open:n,afterVisibleChange:l===void 0?e.afterVisibleChange:l,onClose:o,onHandleClick:a}),r)}})),d}}}),VP=e=>{let{componentCls:t,motionDurationSlow:n}=e,r={"&-enter, &-appear, &-leave":{"&-start":{transition:`none`},"&-active":{transition:`all ${n}`}}};return{[t]:{[`${t}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${n}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${t}-panel-motion`]:{"&-left":[r,{"&-enter, &-appear":{"&-start":{transform:`translateX(-100%) !important`},"&-active":{transform:`translateX(0)`}},"&-leave":{transform:`translateX(0)`,"&-active":{transform:`translateX(-100%)`}}}],"&-right":[r,{"&-enter, &-appear":{"&-start":{transform:`translateX(100%) !important`},"&-active":{transform:`translateX(0)`}},"&-leave":{transform:`translateX(0)`,"&-active":{transform:`translateX(100%)`}}}],"&-top":[r,{"&-enter, &-appear":{"&-start":{transform:`translateY(-100%) !important`},"&-active":{transform:`translateY(0)`}},"&-leave":{transform:`translateY(0)`,"&-active":{transform:`translateY(-100%)`}}}],"&-bottom":[r,{"&-enter, &-appear":{"&-start":{transform:`translateY(100%) !important`},"&-active":{transform:`translateY(0)`}},"&-leave":{transform:`translateY(0)`,"&-active":{transform:`translateY(100%)`}}}]}}}},HP=e=>{let{componentCls:t,zIndexPopup:n,colorBgMask:r,colorBgElevated:i,motionDurationSlow:a,motionDurationMid:o,padding:s,paddingLG:c,fontSizeLG:l,lineHeightLG:u,lineWidth:d,lineType:f,colorSplit:p,marginSM:m,colorIcon:h,colorIconHover:g,colorText:_,fontWeightStrong:v,drawerFooterPaddingVertical:y,drawerFooterPaddingHorizontal:b}=e,x=`${t}-content-wrapper`;return{[t]:{position:`fixed`,inset:0,zIndex:n,pointerEvents:`none`,"&-pure":{position:`relative`,background:i,[`&${t}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:`absolute`},[`${t}-mask`]:{position:`absolute`,inset:0,zIndex:n,background:r,pointerEvents:`auto`},[x]:{position:`absolute`,zIndex:n,transition:`all ${a}`,"&-hidden":{display:`none`}},[`&-left > ${x}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${x}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${x}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${x}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${t}-content`]:{width:`100%`,height:`100%`,overflow:`auto`,background:i,pointerEvents:`auto`},[`${t}-wrapper-body`]:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`},[`${t}-header`]:{display:`flex`,flex:0,alignItems:`center`,padding:`${s}px ${c}px`,fontSize:l,lineHeight:u,borderBottom:`${d}px ${f} ${p}`,"&-title":{display:`flex`,flex:1,alignItems:`center`,minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:`none`},[`${t}-close`]:{display:`inline-block`,marginInlineEnd:m,color:h,fontWeight:v,fontSize:l,fontStyle:`normal`,lineHeight:1,textAlign:`center`,textTransform:`none`,textDecoration:`none`,background:`transparent`,border:0,outline:0,cursor:`pointer`,transition:`color ${o}`,textRendering:`auto`,"&:focus, &:hover":{color:g,textDecoration:`none`}},[`${t}-title`]:{flex:1,margin:0,color:_,fontWeight:e.fontWeightStrong,fontSize:l,lineHeight:u},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:c,overflow:`auto`},[`${t}-footer`]:{flexShrink:0,padding:`${y}px ${b}px`,borderTop:`${d}px ${f} ${p}`},"&-rtl":{direction:`rtl`}}}},UP=v(`Drawer`,e=>{let t=B(e,{drawerFooterPaddingVertical:e.paddingXS,drawerFooterPaddingHorizontal:e.padding});return[HP(t),VP(t)]},e=>({zIndexPopup:e.zIndexPopupBase})),WP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.open??e.visible);G(u,()=>{u.value?c.value=!0:l.value=!1},{immediate:!0}),G([u,c],()=>{u.value&&c.value&&(l.value=!0)},{immediate:!0});let d=g(`parentDrawerOpts`,null),{prefixCls:f,getPopupContainer:p,direction:m}=X(`drawer`,e),[h,_]=UP(f),v=J(()=>e.getContainer===void 0&&p?.value?()=>p.value(document.body):e.getContainer);pi(!e.afterVisibleChange,`Drawer`,"`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"),fe(`parentDrawerOpts`,{setPush:()=>{a.value=!0},setPull:()=>{a.value=!1,z(()=>{b()})}}),V(()=>{u.value&&d&&d.setPush()}),y(()=>{d&&d.setPull()}),G(l,()=>{d&&(l.value?d.setPush():d.setPull())},{flush:`post`});let b=()=>{var e,t;(t=(e=s.value)?.domFocus)==null||t.call(e)},x=e=>{n(`update:visible`,!1),n(`update:open`,!1),n(`close`,e)},S=t=>{var r;t||(o.value===!1&&(o.value=!0),e.destroyOnClose&&(c.value=!1)),(r=e.afterVisibleChange)==null||r.call(e,t),n(`afterVisibleChange`,t),n(`afterOpenChange`,t)},C=J(()=>{let{push:t,placement:n}=e,r;return r=typeof t==`boolean`?t?KP.distance:0:t.distance,r=parseFloat(String(r||0)),n===`left`||n===`right`?`translateX(${n===`left`?r:-r}px)`:n===`top`||n===`bottom`?`translateY(${n===`top`?r:-r}px)`:null}),w=J(()=>e.width??(e.size===`large`?736:378)),T=J(()=>e.height??(e.size===`large`?736:378)),E=J(()=>{let{mask:t,placement:n}=e;if(!l.value&&!t)return{};let r={};return n===`left`||n===`right`?r.width=Jy(w.value)?`${w.value}px`:w.value:r.height=Jy(T.value)?`${T.value}px`:T.value,r}),D=J(()=>{let{zIndex:t,contentWrapperStyle:n}=e,r=E.value;return[{zIndex:t,transform:a.value?C.value:void 0},Z({},n),r]}),O=t=>{let{closable:n,headerStyle:i}=e,a=on(r,e,`extra`),o=on(r,e,`title`);return!o&&!n?null:U(`div`,{class:K(`${t}-header`,{[`${t}-header-close-only`]:n&&!o&&!a}),style:i},[U(`div`,{class:`${t}-header-title`},[k(t),o&&U(`div`,{class:`${t}-title`},[o])]),a&&U(`div`,{class:`${t}-extra`},[a])])},k=t=>{let{closable:n}=e,i=r.closeIcon?r.closeIcon?.call(r):e.closeIcon;return n&&U(`button`,{key:`closer`,onClick:x,"aria-label":`Close`,class:`${t}-close`},[i===void 0?U(Pe,null,null):i])},A=t=>{if(o.value&&!e.forceRender&&!c.value)return null;let{bodyStyle:n,drawerStyle:i}=e;return U(`div`,{class:`${t}-wrapper-body`,style:i},[O(t),U(`div`,{key:`body`,class:`${t}-body`,style:n},[r.default?.call(r)]),j(t)])},j=t=>{let n=on(r,e,`footer`);return n?U(`div`,{class:`${t}-footer`,style:e.footerStyle},[n]):null},M=J(()=>K({"no-mask":!e.mask,[`${f.value}-rtl`]:m.value===`rtl`},e.rootClassName,_.value)),N=J(()=>ge(Xt(f.value,`mask-motion`))),P=e=>ge(Xt(f.value,`panel-motion-${e}`));return()=>{let{width:t,height:n,placement:a,mask:o,forceRender:c}=e,u=WP(e,[`width`,`height`,`placement`,`mask`,`forceRender`]),d=Z(Z(Z({},i),Br(u,[`size`,`closeIcon`,`closable`,`destroyOnClose`,`drawerStyle`,`headerStyle`,`bodyStyle`,`title`,`push`,`onAfterVisibleChange`,`onClose`,`onUpdate:visible`,`onUpdate:open`,`visible`])),{forceRender:c,onClose:x,afterVisibleChange:S,handler:!1,prefixCls:f.value,open:l.value,showMask:o,placement:a,ref:s});return h(U(d_,null,{default:()=>[U(BP,Y(Y({},d),{},{maskMotion:N.value,motion:P,width:w.value,height:T.value,getContainer:v.value,rootClassName:M.value,rootStyle:e.rootStyle,contentWrapperStyle:D.value}),{handler:e.handle?()=>e.handle:r.handle,default:()=>A(f.value)})]}))}}})),JP={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z`}}]},name:`file-text`,theme:`outlined`};function YP(e){for(var t=1;t({prefixCls:String,description:f.any,type:_(`default`),shape:_(`circle`),tooltip:f.any,href:String,target:String,badge:Qt(),onClick:d()}),$P=()=>({prefixCls:_()}),eF=()=>Z(Z({},QP()),{trigger:_(),open:Q(),onOpenChange:d(),"onUpdate:open":d()}),tF=()=>Z(Z({},QP()),{prefixCls:String,duration:Number,target:d(),visibilityHeight:Number,onClick:d()}),nF=u({compatConfig:{MODE:3},name:`AFloatButtonContent`,inheritAttrs:!1,props:$P(),setup(e,t){let{attrs:n,slots:r}=t;return()=>{let{prefixCls:t}=e,i=dt(r.description?.call(r));return U(`div`,Y(Y({},n),{},{class:[n.class,`${t}-content`]}),[r.icon||i.length?U($e,null,[r.icon&&U(`div`,{class:`${t}-icon`},[r.icon()]),i.length?U(`div`,{class:`${t}-description`},[i]):null]):U(`div`,{class:`${t}-icon`},[U(ZP,null,null)])])}}}),rF=Symbol(`floatButtonGroupContext`),iF=e=>(fe(rF,e),e),aF=()=>g(rF,{shape:H()}),oF=e=>e===0?0:e-Math.sqrt(e**2/2),sF=e=>{let{componentCls:t,floatButtonSize:n,motionDurationSlow:r,motionEaseInOutCirc:i}=e,a=`${t}-group`,o=new N(`antFloatButtonMoveDownIn`,{"0%":{transform:`translate3d(0, ${n}px, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),s=new N(`antFloatButtonMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, ${n}px, 0)`,transformOrigin:`0 0`,opacity:0}});return[{[`${a}-wrap`]:Z({},__(`${a}-wrap`,o,s,r,!0))},{[`${a}-wrap`]:{[` + &${a}-wrap-enter, + &${a}-wrap-appear + `]:{opacity:0,animationTimingFunction:i},[`&${a}-wrap-leave`]:{animationTimingFunction:i}}}]},cF=e=>{let{antCls:t,componentCls:n,floatButtonSize:r,margin:i,borderRadiusLG:a,borderRadiusSM:o,badgeOffset:s,floatButtonBodyPadding:c}=e,l=`${n}-group`;return{[l]:Z(Z({},rn(e)),{zIndex:99,display:`block`,border:`none`,position:`fixed`,width:r,height:`auto`,boxShadow:`none`,minHeight:r,insetInlineEnd:e.floatButtonInsetInlineEnd,insetBlockEnd:e.floatButtonInsetBlockEnd,borderRadius:a,[`${l}-wrap`]:{zIndex:-1,display:`block`,position:`relative`,marginBottom:i},[`&${l}-rtl`]:{direction:`rtl`},[n]:{position:`static`}}),[`${l}-circle`]:{[`${n}-circle:not(:last-child)`]:{marginBottom:e.margin,[`${n}-body`]:{width:r,height:r,borderRadius:`50%`}}},[`${l}-square`]:{[`${n}-square`]:{borderRadius:0,padding:0,"&:first-child":{borderStartStartRadius:a,borderStartEndRadius:a},"&:last-child":{borderEndStartRadius:a,borderEndEndRadius:a},"&:not(:last-child)":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-badge`]:{[`${t}-badge-count`]:{top:-(c+s),insetInlineEnd:-(c+s)}}},[`${l}-wrap`]:{display:`block`,borderRadius:a,boxShadow:e.boxShadowSecondary,[`${n}-square`]:{boxShadow:`none`,marginTop:0,borderRadius:0,padding:c,"&:first-child":{borderStartStartRadius:a,borderStartEndRadius:a},"&:last-child":{borderEndStartRadius:a,borderEndEndRadius:a},"&:not(:last-child)":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${n}-body`]:{width:e.floatButtonBodySize,height:e.floatButtonBodySize}}}},[`${l}-circle-shadow`]:{boxShadow:`none`},[`${l}-square-shadow`]:{boxShadow:e.boxShadowSecondary,[`${n}-square`]:{boxShadow:`none`,padding:c,[`${n}-body`]:{width:e.floatButtonBodySize,height:e.floatButtonBodySize,borderRadius:o}}}}},lF=e=>{let{antCls:t,componentCls:n,floatButtonBodyPadding:r,floatButtonIconSize:i,floatButtonSize:a,borderRadiusLG:o,badgeOffset:s,dotOffsetInSquare:c,dotOffsetInCircle:l}=e;return{[n]:Z(Z({},rn(e)),{border:`none`,position:`fixed`,cursor:`pointer`,zIndex:99,display:`block`,justifyContent:`center`,alignItems:`center`,width:a,height:a,insetInlineEnd:e.floatButtonInsetInlineEnd,insetBlockEnd:e.floatButtonInsetBlockEnd,boxShadow:e.boxShadowSecondary,"&-pure":{position:`relative`,inset:`auto`},"&:empty":{display:`none`},[`${t}-badge`]:{width:`100%`,height:`100%`,[`${t}-badge-count`]:{transform:`translate(0, 0)`,transformOrigin:`center`,top:-s,insetInlineEnd:-s}},[`${n}-body`]:{width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all ${e.motionDurationMid}`,[`${n}-content`]:{overflow:`hidden`,textAlign:`center`,minHeight:a,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,padding:`${r/2}px ${r}px`,[`${n}-icon`]:{textAlign:`center`,margin:`auto`,width:i,fontSize:i,lineHeight:1}}}}),[`${n}-rtl`]:{direction:`rtl`},[`${n}-circle`]:{height:a,borderRadius:`50%`,[`${t}-badge`]:{[`${t}-badge-dot`]:{top:l,insetInlineEnd:l}},[`${n}-body`]:{borderRadius:`50%`}},[`${n}-square`]:{height:`auto`,minHeight:a,borderRadius:o,[`${t}-badge`]:{[`${t}-badge-dot`]:{top:c,insetInlineEnd:c}},[`${n}-body`]:{height:`auto`,borderRadius:o}},[`${n}-default`]:{backgroundColor:e.floatButtonBackgroundColor,transition:`background-color ${e.motionDurationMid}`,[`${n}-body`]:{backgroundColor:e.floatButtonBackgroundColor,transition:`background-color ${e.motionDurationMid}`,"&:hover":{backgroundColor:e.colorFillContent},[`${n}-content`]:{[`${n}-icon`]:{color:e.colorText},[`${n}-description`]:{display:`flex`,alignItems:`center`,lineHeight:`${e.fontSizeLG}px`,color:e.colorText,fontSize:e.fontSizeSM}}}},[`${n}-primary`]:{backgroundColor:e.colorPrimary,[`${n}-body`]:{backgroundColor:e.colorPrimary,transition:`background-color ${e.motionDurationMid}`,"&:hover":{backgroundColor:e.colorPrimaryHover},[`${n}-content`]:{[`${n}-icon`]:{color:e.colorTextLightSolid},[`${n}-description`]:{display:`flex`,alignItems:`center`,lineHeight:`${e.fontSizeLG}px`,color:e.colorTextLightSolid,fontSize:e.fontSizeSM}}}}}},uF=v(`FloatButton`,e=>{let{colorTextLightSolid:t,colorBgElevated:n,controlHeightLG:r,marginXXL:i,marginLG:a,fontSize:o,fontSizeIcon:s,controlItemBgHover:c,paddingXXS:l,borderRadiusLG:u}=e,d=B(e,{floatButtonBackgroundColor:n,floatButtonColor:t,floatButtonHoverBackgroundColor:c,floatButtonFontSize:o,floatButtonIconSize:s*1.5,floatButtonSize:r,floatButtonInsetBlockEnd:i,floatButtonInsetInlineEnd:a,floatButtonBodySize:r-l*2,floatButtonBodyPadding:l,badgeOffset:l*1.5,dotOffsetInCircle:oF(r/2),dotOffsetInSquare:oF(u)});return[cF(d),lF(d),b_(e),sF(d)]}),dF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ic?.value||e.shape);return()=>{let{prefixCls:t,type:c=`default`,shape:d=`circle`,description:f=r.description?.call(r),tooltip:p,badge:m={}}=e,h=dF(e,[`prefixCls`,`type`,`shape`,`description`,`tooltip`,`badge`]),g=K(i.value,`${i.value}-${c}`,`${i.value}-${u.value}`,{[`${i.value}-rtl`]:a.value===`rtl`},n.class,s.value),_=U(Ty,{placement:`left`},{title:r.tooltip||p?()=>r.tooltip&&r.tooltip()||p:void 0,default:()=>U(Xy,m,{default:()=>[U(`div`,{class:`${i.value}-body`},[U(nF,{prefixCls:i.value},{icon:r.icon,description:()=>f})])]})});return o(e.href?U(`a`,Y(Y(Y({ref:l},n),h),{},{class:g}),[_]):U(`button`,Y(Y(Y({ref:l},n),h),{},{class:g,type:`button`}),[_]))}}}),mF=u({compatConfig:{MODE:3},name:`AFloatButtonGroup`,inheritAttrs:!1,props:Zn(eF(),{type:`default`,shape:`circle`}),setup(e,t){let{attrs:n,slots:r,emit:i}=t,{prefixCls:a,direction:o}=X(fF,e),[s,c]=uF(a),[l,u]=df(!1,{value:J(()=>e.open)}),d=H(null),f=H(null);iF({shape:J(()=>e.shape)});let p={onMouseenter(){var t;u(!0),i(`update:open`,!0),(t=e.onOpenChange)==null||t.call(e,!0)},onMouseleave(){var t;u(!1),i(`update:open`,!1),(t=e.onOpenChange)==null||t.call(e,!1)}},m=J(()=>e.trigger===`hover`?p:{}),h=()=>{var t;let n=!l.value;i(`update:open`,n),(t=e.onOpenChange)==null||t.call(e,n),u(n)},g=t=>{var n;if(d.value?.contains(t.target)){ae(f.value)?.contains(t.target)&&h();return}u(!1),i(`update:open`,!1),(n=e.onOpenChange)==null||n.call(e,!1)};return G(J(()=>e.trigger),e=>{It()&&(document.removeEventListener(`click`,g),e===`click`&&document.addEventListener(`click`,g))},{immediate:!0}),ut(()=>{document.removeEventListener(`click`,g)}),()=>{let{shape:t=`circle`,type:i=`default`,tooltip:u,description:p,trigger:h}=e,g=`${a.value}-group`,_=K(g,c.value,n.class,{[`${g}-rtl`]:o.value===`rtl`,[`${g}-${t}`]:t,[`${g}-${t}-shadow`]:!h}),v=K(c.value,`${g}-wrap`),y=ge(`${g}-wrap`);return s(U(`div`,Y(Y({ref:d},n),{},{class:_},m.value),[h&&[`click`,`hover`].includes(h)?U($e,null,[U(Re,y,{default:()=>[Mt(U(`div`,{class:v},[r.default&&r.default()]),[[ht,l.value]])]}),U(pF,{ref:f,type:i,shape:t,tooltip:u,description:p},{icon:()=>l.value?r.closeIcon?.call(r)||U(Pe,null,null):r.icon?.call(r)||U(ZP,null,null),tooltip:r.tooltip,description:r.description})]):r.default?.call(r)]))}}}),hF={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z`}}]},name:`vertical-align-top`,theme:`outlined`};function gF(e){for(var t=1;twindow,duration:450,type:`default`,shape:`circle`}),setup(e,t){let{slots:n,attrs:r,emit:i}=t,{prefixCls:a,direction:o}=X(fF,e),[s]=uF(a),c=H(),l=Ne({visible:e.visibilityHeight===0,scrollEvent:null}),u=()=>c.value&&c.value.ownerDocument?c.value.ownerDocument:window,d=t=>{let{target:n=u,duration:r}=e;ii(0,{getContainer:n,duration:r}),i(`click`,t)},f=ar(t=>{let{visibilityHeight:n}=e,r=ri(t.target,!0);l.visible=r>=n}),p=()=>{let{target:t}=e,n=(t||u)();f({target:n}),n?.addEventListener(`scroll`,f)},m=()=>{let{target:t}=e,n=(t||u)();f.cancel(),n?.removeEventListener(`scroll`,f)};G(()=>e.target,()=>{m(),z(()=>{p()})}),V(()=>{z(()=>{p()})}),ft(()=>{z(()=>{p()})}),ie(()=>{m()}),ut(()=>{m()});let h=aF();return()=>{let{description:t,type:i,shape:u,tooltip:f,badge:p}=e,m=Z(Z({},r),{shape:h?.shape.value||u,onClick:d,class:{[`${a.value}`]:!0,[`${r.class}`]:r.class,[`${a.value}-rtl`]:o.value===`rtl`},description:t,type:i,tooltip:f,badge:p}),g=ge(`fade`);return s(U(Re,g,{default:()=>[Mt(U(pF,Y(Y({},m),{},{ref:c}),{icon:()=>n.icon?.call(n)||U(vF,null,null)}),[[ht,l.visible]])]}))}}});pF.Group=mF,pF.BackTop=yF,pF.install=function(e){return e.component(pF.name,pF),e.component(mF.name,mF),e.component(yF.name,yF),e};var bF=pF,xF=e=>e!=null&&(!Array.isArray(e)||dt(e).length);function SF(e){return xF(e.prefix)||xF(e.suffix)||xF(e.allowClear)}function CF(e){return xF(e.addonBefore)||xF(e.addonAfter)}function wF(e){return e==null?``:String(e)}function TF(e,t,n,r){if(!n)return;let i=t;if(t.type===`click`){Object.defineProperty(i,"target",{writable:!0}),Object.defineProperty(i,"currentTarget",{writable:!0});let t=e.cloneNode(!0);i.target=t,i.currentTarget=t,t.value=``,n(i);return}if(r!==void 0){Object.defineProperty(i,"target",{writable:!0}),Object.defineProperty(i,"currentTarget",{writable:!0}),i.target=e,i.currentTarget=e,e.value=r,n(i);return}n(i)}function EF(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case`start`:e.setSelectionRange(0,0);break;case`end`:e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var DF=()=>({addonBefore:f.any,addonAfter:f.any,prefix:f.any,suffix:f.any,clearIcon:f.any,affixWrapperClassName:String,groupClassName:String,wrapperClassName:String,inputClassName:String,allowClear:{type:Boolean,default:void 0}}),OF=()=>Z(Z({},DF()),{value:{type:[String,Number,Symbol],default:void 0},defaultValue:{type:[String,Number,Symbol],default:void 0},inputElement:f.any,prefixCls:String,disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:void 0},triggerFocus:Function,readonly:{type:Boolean,default:void 0},handleReset:Function,hidden:{type:Boolean,default:void 0}}),kF=()=>Z(Z({},OF()),{id:String,placeholder:{type:[String,Number]},autocomplete:String,type:_(`text`),name:String,size:{type:String},autofocus:{type:Boolean,default:void 0},lazy:{type:Boolean,default:!0},maxlength:Number,loading:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},showCount:{type:[Boolean,Object]},htmlSize:Number,onPressEnter:Function,onKeydown:Function,onKeyup:Function,onFocus:Function,onBlur:Function,onChange:Function,onInput:Function,"onUpdate:value":Function,onCompositionstart:Function,onCompositionend:Function,valueModifiers:Object,hidden:{type:Boolean,default:void 0},status:String}),AF=u({name:`BaseInput`,inheritAttrs:!1,props:OF(),setup(e,t){let{slots:n,attrs:r}=t,i=H(),a=t=>{if(i.value?.contains(t.target)){let{triggerFocus:t}=e;t?.()}},o=()=>{let{allowClear:t,value:r,disabled:i,readonly:a,handleReset:o,suffix:s=n.suffix,prefixCls:c}=e;if(!t)return null;let l=!i&&!a&&r,u=`${c}-clear-icon`,d=n.clearIcon?.call(n)||`*`;return U(`span`,{onClick:o,onMousedown:e=>e.preventDefault(),class:K({[`${u}-hidden`]:!l,[`${u}-has-suffix`]:!!s},u),role:`button`,tabindex:-1},[d])};return()=>{let{focused:t,value:s,disabled:c,allowClear:l,readonly:u,hidden:d,prefixCls:f,prefix:p=n.prefix?.call(n),suffix:m=n.suffix?.call(n),addonAfter:h=n.addonAfter,addonBefore:g=n.addonBefore,inputElement:_,affixWrapperClassName:v,wrapperClassName:y,groupClassName:b}=e,x=ao(_,{value:s,hidden:d});if(SF({prefix:p,suffix:m,allowClear:l})){let e=`${f}-affix-wrapper`,n=K(e,{[`${e}-disabled`]:c,[`${e}-focused`]:t,[`${e}-readonly`]:u,[`${e}-input-with-clear-btn`]:m&&l&&s},!CF({addonAfter:h,addonBefore:g})&&r.class,v),y=(m||l)&&U(`span`,{class:`${f}-suffix`},[o(),m]);x=U(`span`,{class:n,style:r.style,hidden:!CF({addonAfter:h,addonBefore:g})&&d,onMousedown:a,ref:i},[p&&U(`span`,{class:`${f}-prefix`},[p]),ao(_,{style:null,value:s,hidden:null}),y])}if(CF({addonAfter:h,addonBefore:g})){let e=`${f}-group`,t=`${e}-addon`,n=K(`${f}-wrapper`,e,y);return U(`span`,{class:K(`${f}-group-wrapper`,r.class,b),style:r.style,hidden:d},[U(`span`,{class:n},[g&&U(`span`,{class:t},[g]),ao(x,{style:null,hidden:null}),h&&U(`span`,{class:t},[h])])])}return x}}}),jF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.value,()=>{o.value=e.value}),G(()=>e.disabled,()=>{e.disabled&&(s.value=!1)});let u=e=>{c.value&&EF(c.value.input,e)};i({focus:u,blur:()=>{var e;(e=c.value.input)==null||e.blur()},input:J(()=>c.value.input?.input),stateValue:o,setSelectionRange:(e,t,n)=>{var r;(r=c.value.input)==null||r.setSelectionRange(e,t,n)},select:()=>{var e;(e=c.value.input)==null||e.select()}});let d=e=>{a(`change`,e)},f=(t,n)=>{o.value!==t&&(e.value===void 0?o.value=t:z(()=>{var e;c.value.input.value!==o.value&&((e=l.value)==null||e.$forceUpdate())}),z(()=>{n&&n()}))},p=e=>{let{value:t}=e.target;if(o.value===t)return;let n=e.target.value;TF(c.value.input,e,d),f(n)},m=e=>{e.keyCode===13&&a(`pressEnter`,e),a(`keydown`,e)},h=e=>{s.value=!0,a(`focus`,e)},g=e=>{s.value=!1,a(`blur`,e)},_=e=>{TF(c.value.input,e,d),f(``,()=>{u()})},v=()=>{let{addonBefore:t=n.addonBefore,addonAfter:i=n.addonAfter,disabled:a,valueModifiers:o={},htmlSize:s,autocomplete:l,prefixCls:u,inputClassName:d,prefix:f=n.prefix?.call(n),suffix:_=n.suffix?.call(n),allowClear:v,type:y=`text`}=e,b=Z(Z(Z({},Br(e,[`prefixCls`,`onPressEnter`,`addonBefore`,`addonAfter`,`prefix`,`suffix`,`allowClear`,`defaultValue`,`size`,`bordered`,`htmlSize`,`lazy`,`showCount`,`valueModifiers`,`showCount`,`affixWrapperClassName`,`groupClassName`,`inputClassName`,`wrapperClassName`])),r),{autocomplete:l,onChange:p,onInput:p,onFocus:h,onBlur:g,onKeydown:m,class:K(u,{[`${u}-disabled`]:a},d,!CF({addonAfter:i,addonBefore:t})&&!SF({prefix:f,suffix:_,allowClear:v})&&r.class),ref:c,key:`ant-input`,size:s,type:y,lazy:e.lazy});return o.lazy&&delete b.onInput,b.autofocus||delete b.autofocus,U(Pu,Br(b,[`size`]),null)},y=()=>{let{maxlength:t,suffix:r=n.suffix?.call(n),showCount:i,prefixCls:a}=e,s=Number(t)>0;if(r||i){let e=[...wF(o.value)].length,n=typeof i==`object`?i.formatter({count:e,maxlength:t}):`${e}${s?` / ${t}`:``}`;return U($e,null,[!!i&&U(`span`,{class:K(`${a}-show-count-suffix`,{[`${a}-show-count-has-suffix`]:!!r})},[n]),r])}return null};return V(()=>{}),()=>{let{prefixCls:t,disabled:i}=e;return U(AF,Y(Y(Y({},jF(e,[`prefixCls`,`disabled`])),r),{},{ref:l,prefixCls:t,inputElement:v(),handleReset:_,value:wF(o.value),focused:s.value,triggerFocus:u,suffix:y(),disabled:i}),n)}}}),NF=()=>Br(kF(),[`wrapperClassName`,`groupClassName`,`inputClassName`,`affixWrapperClassName`]),PF=()=>Z(Z({},Br(NF(),[`prefix`,`addonBefore`,`addonAfter`,`suffix`])),{rows:Number,autosize:{type:[Boolean,Object],default:void 0},autoSize:{type:[Boolean,Object],default:void 0},onResize:{type:Function},onCompositionstart:he(),onCompositionend:he(),valueModifiers:Object}),FF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iWf(c.status,e.status)),{direction:u,prefixCls:d,size:f,autocomplete:p}=X(`input`,e),{compactSize:m,compactItemClassnames:h}=u_(d,u),g=J(()=>m.value||f.value),[_,v]=YT(d),y=at();i({focus:e=>{var t;(t=o.value)==null||t.focus(e)},blur:()=>{var e;(e=o.value)==null||e.blur()},input:o,setSelectionRange:(e,t,n)=>{var r;(r=o.value)==null||r.setSelectionRange(e,t,n)},select:()=>{var e;(e=o.value)==null||e.select()}});let b=H([]),x=()=>{b.value.push(setTimeout(()=>{var e;o.value?.input&&o.value?.input.getAttribute(`type`)===`password`&&o.value?.input.hasAttribute(`value`)&&((e=o.value)==null||e.input.removeAttribute(`value`))}))};V(()=>{x()}),ne(()=>{b.value.forEach(e=>clearTimeout(e))}),ut(()=>{b.value.forEach(e=>clearTimeout(e))});let S=e=>{x(),a(`blur`,e),s.onFieldBlur()},C=e=>{x(),a(`focus`,e)},w=e=>{a(`update:value`,e.target.value),a(`change`,e),a(`input`,e),s.onFieldChange()};return()=>{let{hasFeedback:t,feedbackIcon:i}=c,{allowClear:a,bordered:f=!0,prefix:m=n.prefix?.call(n),suffix:b=n.suffix?.call(n),addonAfter:x=n.addonAfter?.call(n),addonBefore:T=n.addonBefore?.call(n),id:E=s.id?.value}=e,D=FF(e,[`allowClear`,`bordered`,`prefix`,`suffix`,`addonAfter`,`addonBefore`,`id`]),O=(t||b)&&U($e,null,[b,t&&i]),k=d.value,A=SF({prefix:m,suffix:b})||!!t,j=n.clearIcon||(()=>U(tt,null,null));return _(U(MF,Y(Y(Y({},r),Br(D,[`onUpdate:value`,`onChange`,`onInput`])),{},{onChange:w,id:E,disabled:e.disabled??y.value,ref:o,prefixCls:k,autocomplete:p.value,onBlur:S,onFocus:C,prefix:m,suffix:O,allowClear:a,addonAfter:x&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[x]})]}),addonBefore:T&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[T]})]}),class:[r.class,h.value],inputClassName:K({[`${k}-sm`]:g.value===`small`,[`${k}-lg`]:g.value===`large`,[`${k}-rtl`]:u.value===`rtl`,[`${k}-borderless`]:!f},!A&&Uf(k,l.value),v.value),affixWrapperClassName:K({[`${k}-affix-wrapper-sm`]:g.value===`small`,[`${k}-affix-wrapper-lg`]:g.value===`large`,[`${k}-affix-wrapper-rtl`]:u.value===`rtl`,[`${k}-affix-wrapper-borderless`]:!f},Uf(`${k}-affix-wrapper`,l.value,t),v.value),wrapperClassName:K({[`${k}-group-rtl`]:u.value===`rtl`},v.value),groupClassName:K({[`${k}-group-wrapper-sm`]:g.value===`small`,[`${k}-group-wrapper-lg`]:g.value===`large`,[`${k}-group-wrapper-rtl`]:u.value===`rtl`},Uf(`${k}-group-wrapper`,l.value,t),v.value)}),Z(Z({},n),{clearIcon:j})))}}}),LF=u({compatConfig:{MODE:3},name:`AInputGroup`,inheritAttrs:!1,props:{prefixCls:String,size:{type:String},compact:{type:Boolean,default:void 0}},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a,getPrefixCls:o}=X(`input-group`,e),s=Vf.useInject();Vf.useProvide(s,{isFormItemInput:!1});let[c,l]=YT(J(()=>o(`input`))),u=J(()=>{let t=i.value;return{[`${t}`]:!0,[l.value]:!0,[`${t}-lg`]:e.size===`large`,[`${t}-sm`]:e.size===`small`,[`${t}-compact`]:e.compact,[`${t}-rtl`]:a.value===`rtl`}});return()=>c(U(`span`,Y(Y({},r),{},{class:K(u.value,r.class)}),[n.default?.call(n)]))}}),RF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{var e;(e=o.value)==null||e.focus()},blur:()=>{var e;(e=o.value)==null||e.blur()}});let c=e=>{a(`update:value`,e.target.value),e&&e.target&&e.type===`click`&&a(`search`,e.target.value,e),a(`change`,e)},l=e=>{document.activeElement===o.value?.input&&e.preventDefault()},u=e=>{a(`search`,o.value?.input?.stateValue,e)},d=t=>{s.value||e.loading||u(t)},f=e=>{s.value=!0,a(`compositionstart`,e)},p=e=>{s.value=!1,a(`compositionend`,e)},{prefixCls:m,getPrefixCls:h,direction:g,size:_}=X(`input-search`,e),v=J(()=>h(`input`,e.inputPrefixCls));return()=>{let{disabled:t,loading:i,addonAfter:a=n.addonAfter?.call(n),suffix:s=n.suffix?.call(n)}=e,h=RF(e,[`disabled`,`loading`,`addonAfter`,`suffix`]),{enterButton:y=n.enterButton?.call(n)??!1}=e;y||=y===``;let b=typeof y==`boolean`?U(jf,null,null):null,x=`${m.value}-button`,S=Array.isArray(y)?y[0]:y,C,w=S.type&&ym(S.type)&&S.type.__ANT_BUTTON;if(w||S.tagName===`button`)C=ao(S,Z({onMousedown:l,onClick:u,key:`enterButton`},w?{class:x,size:_.value}:{}),!1);else{let e=b&&!y;C=U(Qb,{class:x,type:y?`primary`:void 0,size:_.value,disabled:t,key:`enterButton`,onMousedown:l,onClick:u,loading:i,icon:e?b:null},{default:()=>[e?null:b||y]})}a&&(C=[C,a]);let T=K(m.value,{[`${m.value}-rtl`]:g.value===`rtl`,[`${m.value}-${_.value}`]:!!_.value,[`${m.value}-with-button`]:!!y},r.class);return U(IF,Y(Y(Y({ref:o},Br(h,[`onUpdate:value`,`onSearch`,`enterButton`])),r),{},{onPressEnter:d,onCompositionstart:f,onCompositionend:p,size:_.value,prefixCls:v.value,addonAfter:C,suffix:s,onChange:c,class:T,disabled:t}),n)}}}),BF=e=>e!=null&&(!Array.isArray(e)||dt(e).length);function VF(e){return BF(e.addonBefore)||BF(e.addonAfter)}var HF=[`text`,`input`],UF=u({compatConfig:{MODE:3},name:`ClearableLabeledInput`,inheritAttrs:!1,props:{prefixCls:String,inputType:f.oneOf(m(`text`,`input`)),value:nn(),defaultValue:nn(),allowClear:{type:Boolean,default:void 0},element:nn(),handleReset:Function,disabled:{type:Boolean,default:void 0},direction:{type:String},size:{type:String},suffix:nn(),prefix:nn(),addonBefore:nn(),addonAfter:nn(),readonly:{type:Boolean,default:void 0},focused:{type:Boolean,default:void 0},bordered:{type:Boolean,default:!0},triggerFocus:{type:Function},hidden:Boolean,status:String,hashId:String},setup(e,t){let{slots:n,attrs:r}=t,i=Vf.useInject(),a=t=>{let{value:r,disabled:i,readonly:a,handleReset:o,suffix:s=n.suffix}=e,c=!i&&!a&&r,l=`${t}-clear-icon`;return U(tt,{onClick:o,onMousedown:e=>e.preventDefault(),class:K({[`${l}-hidden`]:!c,[`${l}-has-suffix`]:!!s},l),role:`button`},null)},o=(t,o)=>{let{value:s,allowClear:c,direction:l,bordered:u,hidden:d,status:f,addonAfter:p=n.addonAfter,addonBefore:m=n.addonBefore,hashId:h}=e,{status:g,hasFeedback:_}=i;return c?U(`span`,{class:K(`${t}-affix-wrapper`,`${t}-affix-wrapper-textarea-with-clear-btn`,Uf(`${t}-affix-wrapper`,Wf(g,f),_),{[`${t}-affix-wrapper-rtl`]:l===`rtl`,[`${t}-affix-wrapper-borderless`]:!u,[`${r.class}`]:!VF({addonAfter:p,addonBefore:m})&&r.class},h),style:r.style,hidden:d},[ao(o,{style:null,value:s,disabled:e.disabled}),a(t)]):ao(o,{value:s,disabled:e.disabled})};return()=>{let{prefixCls:t,inputType:r,element:i=n.element?.call(n)}=e;return r===HF[0]?o(t,i):null}}}),WF=` + min-height:0 !important; + max-height:none !important; + height:0 !important; + visibility:hidden !important; + overflow:hidden !important; + position:absolute !important; + z-index:-1000 !important; + top:0 !important; + right:0 !important; + pointer-events: none !important; +`,GF=[`letter-spacing`,`line-height`,`padding-top`,`padding-bottom`,`font-family`,`font-weight`,`font-size`,`font-variant`,`text-rendering`,`text-transform`,`width`,`text-indent`,`padding-left`,`padding-right`,`border-width`,`box-sizing`,`word-break`,`white-space`],KF={},qF;function JF(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.getAttribute(`id`)||e.getAttribute(`data-reactid`)||e.getAttribute(`name`);if(t&&KF[n])return KF[n];let r=window.getComputedStyle(e),i=r.getPropertyValue(`box-sizing`)||r.getPropertyValue(`-moz-box-sizing`)||r.getPropertyValue(`-webkit-box-sizing`),a=parseFloat(r.getPropertyValue(`padding-bottom`))+parseFloat(r.getPropertyValue(`padding-top`)),o=parseFloat(r.getPropertyValue(`border-bottom-width`))+parseFloat(r.getPropertyValue(`border-top-width`)),s={sizingStyle:GF.map(e=>`${e}:${r.getPropertyValue(e)}`).join(`;`),paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(KF[n]=s),s}function YF(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;qF||(qF=document.createElement(`textarea`),qF.setAttribute(`tab-index`,`-1`),qF.setAttribute(`aria-hidden`,`true`),document.body.appendChild(qF)),e.getAttribute(`wrap`)?qF.setAttribute(`wrap`,e.getAttribute(`wrap`)):qF.removeAttribute(`wrap`);let{paddingSize:i,borderSize:a,boxSizing:o,sizingStyle:s}=JF(e,t);qF.setAttribute(`style`,`${s};${WF}`),qF.value=e.value||e.placeholder||``;let c,l,u,d=qF.scrollHeight;if(o===`border-box`?d+=a:o===`content-box`&&(d-=i),n!==null||r!==null){qF.value=` `;let e=qF.scrollHeight-i;n!==null&&(c=e*n,o===`border-box`&&(c=c+i+a),d=Math.max(c,d)),r!==null&&(l=e*r,o===`border-box`&&(l=l+i+a),u=d>l?``:`hidden`,d=Math.min(l,d))}let f={height:`${d}px`,overflowY:u,resize:`none`};return c&&(f.minHeight=`${c}px`),l&&(f.maxHeight=`${l}px`),f}var XF=0,ZF=1,QF=2,$F=u({compatConfig:{MODE:3},name:`ResizableTextArea`,inheritAttrs:!1,props:PF(),setup(t,n){let{attrs:r,emit:i,expose:a}=n,o=H(),s=H({}),c=H(QF);ut(()=>{ir.cancel(void 0),ir.cancel(void 0)});let l=()=>{try{if(o.value&&document.activeElement===o.value.input){let e=o.value.getSelectionStart(),t=o.value.getSelectionEnd(),n=o.value.getScrollTop();o.value.setSelectionRange(e,t),o.value.setScrollTop(n)}}catch{}},u=H(),d=H();S(()=>{let e=t.autoSize||t.autosize;e?(u.value=e.minRows,d.value=e.maxRows):(u.value=void 0,d.value=void 0)});let f=J(()=>!!(t.autoSize||t.autosize)),p=()=>{c.value=XF};G([()=>t.value,u,d,f],()=>{f.value&&p()},{immediate:!0});let m=H();G([c,o],()=>{if(o.value)if(c.value===XF)c.value=ZF;else if(c.value===ZF){let e=YF(o.value.input,!1,u.value,d.value);c.value=QF,m.value=e}else l()},{immediate:!0,flush:`post`});let h=Zt(),g=H(),_=()=>{ir.cancel(g.value)},v=e=>{c.value===QF&&(i(`resize`,e),f.value&&(_(),g.value=ir(()=>{p()})))};ut(()=>{_()}),a({resizeTextarea:()=>{p()},textArea:J(()=>o.value?.input),instance:h}),e(t.autosize===void 0,`Input.TextArea`,`autosize is deprecated, please use autoSize instead.`);let y=()=>{let{prefixCls:e,disabled:n}=t,i=Br(t,[`prefixCls`,`onPressEnter`,`autoSize`,`autosize`,`defaultValue`,`allowClear`,`type`,`maxlength`,`valueModifiers`]),a=K(e,r.class,{[`${e}-disabled`]:n}),l=f.value?m.value:null,u=[r.style,s.value,l],d=Z(Z(Z({},i),r),{style:u,class:a});return(c.value===XF||c.value===ZF)&&u.push({overflowX:`hidden`,overflowY:`hidden`}),d.autofocus||delete d.autofocus,d.rows===0&&delete d.rows,U(Qn,{onResize:v,disabled:!f.value},{default:()=>[U(Pu,Y(Y({},d),{},{ref:o,tag:`textarea`}),null)]})};return()=>y()}});function eI(e,t){return[...e||``].slice(0,t).join(``)}function tI(e,t,n,r){let i=n;return e?i=eI(n,r):[...t||``].lengthr&&(i=t),i}var nI=u({compatConfig:{MODE:3},name:`ATextarea`,inheritAttrs:!1,props:PF(),setup(e,t){let{attrs:n,expose:r,emit:i}=t,a=zf(),o=Vf.useInject(),s=J(()=>Wf(o.status,e.status)),c=q(e.value??e.defaultValue),l=q(),u=q(``),{prefixCls:d,size:f,direction:p}=X(`input`,e),[m,h]=YT(d),g=at(),_=J(()=>e.showCount===``||e.showCount||!1),v=J(()=>Number(e.maxlength)>0),y=q(!1),b=q(),x=q(0),C=e=>{y.value=!0,b.value=u.value,x.value=e.currentTarget.selectionStart,i(`compositionstart`,e)},w=t=>{y.value=!1;let n=t.currentTarget.value;v.value&&(n=tI(x.value>=e.maxlength+1||x.value===b.value?.length,b.value,n,e.maxlength)),n!==u.value&&(O(n),TF(t.currentTarget,t,j,n)),i(`compositionend`,t)},T=Zt();G(()=>e.value,()=>{`value`in T.vnode.props,c.value=e.value??``});let E=e=>{EF(l.value?.textArea,e)},D=()=>{var e;(e=l.value?.textArea)==null||e.blur()},O=(t,n)=>{c.value!==t&&(e.value===void 0?c.value=t:z(()=>{var e,t,n;l.value.textArea.value!==u.value&&((n=(e=l.value)==null?void 0:(t=e.instance).update)==null||n.call(t))}),z(()=>{n&&n()}))},k=e=>{e.keyCode===13&&i(`pressEnter`,e),i(`keydown`,e)},A=t=>{let{onBlur:n}=e;n?.(t),a.onFieldBlur()},j=e=>{i(`update:value`,e.target.value),i(`change`,e),i(`input`,e),a.onFieldChange()},M=e=>{TF(l.value.textArea,e,j),O(``,()=>{E()})},N=t=>{let n=t.target.value;if(c.value!==n){if(v.value){let r=t.target;n=tI(r.selectionStart>=e.maxlength+1||r.selectionStart===n.length||!r.selectionStart,u.value,n,e.maxlength)}TF(t.currentTarget,t,j,n),O(n)}},P=()=>{let{class:t}=n,{bordered:r=!0}=e,i=Z(Z(Z({},Br(e,[`allowClear`])),n),{class:[{[`${d.value}-borderless`]:!r,[`${t}`]:t&&!_.value,[`${d.value}-sm`]:f.value===`small`,[`${d.value}-lg`]:f.value===`large`},Uf(d.value,s.value),h.value],disabled:g.value,showCount:null,prefixCls:d.value,onInput:N,onChange:N,onBlur:A,onKeydown:k,onCompositionstart:C,onCompositionend:w});return e.valueModifiers?.lazy&&delete i.onInput,U($F,Y(Y({},i),{},{id:i?.id??a.id.value,ref:l,maxlength:e.maxlength,lazy:e.lazy}),null)};return r({focus:E,blur:D,resizableTextArea:l}),S(()=>{let t=wF(c.value);!y.value&&v.value&&(e.value===null||e.value===void 0)&&(t=eI(t,e.maxlength)),u.value=t}),()=>{let{maxlength:t,bordered:r=!0,hidden:i}=e,{style:a,class:s}=n,c=U(UF,Y(Y({},Z(Z(Z({},e),n),{prefixCls:d.value,inputType:`text`,handleReset:M,direction:p.value,bordered:r,style:_.value?void 0:a,hashId:h.value,disabled:e.disabled??g.value})),{},{value:u.value,status:e.status}),{element:P});if(_.value||o.hasFeedback){let e=[...u.value].length,n=``;n=typeof _.value==`object`?_.value.formatter({value:u.value,count:e,maxlength:t}):`${e}${v.value?` / ${t}`:``}`,c=U(`div`,{hidden:i,class:K(`${d.value}-textarea`,{[`${d.value}-textarea-rtl`]:p.value===`rtl`,[`${d.value}-textarea-show-count`]:_.value,[`${d.value}-textarea-in-form-item`]:o.isFormItemInput},`${d.value}-textarea-show-count`,s,h.value),style:a,"data-count":typeof n==`object`?void 0:n},[c,o.hasFeedback&&U(`span`,{class:`${d.value}-textarea-suffix`},[o.feedbackIcon])])}return m(c)}}}),rI={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z`}}]},name:`eye`,theme:`outlined`};function iI(e){for(var t=1;tU(e?oI:uI,null,null),mI=u({compatConfig:{MODE:3},name:`AInputPassword`,inheritAttrs:!1,props:Z(Z({},NF()),{prefixCls:String,inputPrefixCls:String,action:{type:String,default:`click`},visibilityToggle:{type:Boolean,default:!0},visible:{type:Boolean,default:void 0},"onUpdate:visible":Function,iconRender:Function}),setup(e,t){let{slots:n,attrs:r,expose:i,emit:a}=t,o=q(!1),s=()=>{let{disabled:t}=e;t||(o.value=!o.value,a(`update:visible`,o.value))};S(()=>{e.visible!==void 0&&(o.value=!!e.visible)});let c=q();i({focus:()=>{var e;(e=c.value)==null||e.focus()},blur:()=>{var e;(e=c.value)==null||e.blur()}});let l=t=>{let{action:r,iconRender:i=n.iconRender||pI}=e,a=fI[r]||``,c=i(o.value),l={[a]:s,class:`${t}-icon`,key:`passwordIcon`,onMousedown:e=>{e.preventDefault()},onMouseup:e=>{e.preventDefault()}};return ao(Nt(c)?c:U(`span`,null,[c]),l)},{prefixCls:u,getPrefixCls:d}=X(`input-password`,e),f=J(()=>d(`input`,e.inputPrefixCls)),p=()=>{let{size:t,visibilityToggle:i}=e,a=dI(e,[`size`,`visibilityToggle`]),s=i&&l(u.value),d=K(u.value,r.class,{[`${u.value}-${t}`]:!!t}),p=Z(Z(Z({},Br(a,[`suffix`,`iconRender`,`action`])),r),{type:o.value?`text`:`password`,class:d,prefixCls:f.value,suffix:s});return t&&(p.size=t),U(IF,Y({ref:c},p),n)};return()=>p()}});IF.Group=LF,IF.Search=zF,IF.TextArea=nI,IF.Password=mI,IF.install=function(e){return e.component(IF.name,IF),e.component(IF.Group.name,IF.Group),e.component(IF.Search.name,IF.Search),e.component(IF.TextArea.name,IF.TextArea),e.component(IF.Password.name,IF.Password),e};var hI=IF;function gI(){return{keyboard:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},afterClose:Function,closable:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},destroyOnClose:{type:Boolean,default:void 0},mousePosition:f.shape({x:Number,y:Number}).loose,title:f.any,footer:f.any,transitionName:String,maskTransitionName:String,animation:f.any,maskAnimation:f.any,wrapStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},maskStyle:{type:Object,default:void 0},prefixCls:String,wrapClassName:String,rootClassName:String,width:[String,Number],height:[String,Number],zIndex:Number,bodyProps:f.any,maskProps:f.any,wrapProps:f.any,getContainer:f.any,dialogStyle:{type:Object,default:void 0},dialogClass:String,closeIcon:f.any,forceRender:{type:Boolean,default:void 0},getOpenCount:Function,focusTriggerAfterClose:{type:Boolean,default:void 0},onClose:Function,modalRender:Function}}function _I(e,t,n){let r=t;return!r&&n&&(r=`${e}-${n}`),r}var vI=-1;function yI(){return vI+=1,vI}function bI(e,t){let n=e[`page${t?`Y`:`X`}Offset`],r=`scroll${t?`Top`:`Left`}`;if(typeof n!=`number`){let t=e.document;n=t.documentElement[r],typeof n!=`number`&&(n=t.body[r])}return n}function xI(e){let t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=bI(i),n.top+=bI(i,!0),n}var SI={width:0,height:0,overflow:`hidden`,outline:`none`},CI={outline:`none`},wI=u({compatConfig:{MODE:3},name:`DialogContent`,inheritAttrs:!1,props:Z(Z({},gI()),{motionName:String,ariaId:String,onVisibleChanged:Function,onMousedown:Function,onMouseup:Function}),setup(e,t){let{expose:n,slots:r,attrs:i}=t,a=H(),o=H(),s=H();n({focus:()=>{var e;(e=a.value)==null||e.focus({preventScroll:!0})},changeActive:e=>{let{activeElement:t}=document;e&&t===o.value?a.value.focus({preventScroll:!0}):!e&&t===a.value&&o.value.focus({preventScroll:!0})}});let c=H(),l=J(()=>{let{width:t,height:n}=e,r={};return t!==void 0&&(r.width=typeof t==`number`?`${t}px`:t),n!==void 0&&(r.height=typeof n==`number`?`${n}px`:n),c.value&&(r.transformOrigin=c.value),r}),u=()=>{z(()=>{if(s.value){let t=xI(s.value);c.value=e.mousePosition?`${e.mousePosition.x-t.left}px ${e.mousePosition.y-t.top}px`:``}})},d=t=>{e.onVisibleChanged(t)};return()=>{let{prefixCls:t,footer:n=r.footer?.call(r),title:c=r.title?.call(r),ariaId:f,closable:p,closeIcon:m=r.closeIcon?.call(r),onClose:h,bodyStyle:g,bodyProps:_,onMousedown:v,onMouseup:y,visible:b,modalRender:x=r.modalRender,destroyOnClose:S,motionName:C}=e,w;n&&(w=U(`div`,{class:`${t}-footer`},[n]));let T;c&&(T=U(`div`,{class:`${t}-header`},[U(`div`,{class:`${t}-title`,id:f},[c])]));let E;p&&(E=U(`button`,{type:`button`,onClick:h,"aria-label":`Close`,class:`${t}-close`},[m||U(`span`,{class:`${t}-close-x`},null)]));let D=U(`div`,{class:`${t}-content`},[E,T,U(`div`,Y({class:`${t}-body`,style:g},_),[r.default?.call(r)]),w]);return U(Re,Y(Y({},ge(C)),{},{onBeforeEnter:u,onAfterEnter:()=>d(!0),onAfterLeave:()=>d(!1)}),{default:()=>[b||!S?Mt(U(`div`,Y(Y({},i),{},{ref:s,key:`dialog-element`,role:`document`,style:[l.value,i.style],class:[t,i.class],onMousedown:v,onMouseup:y}),[U(`div`,{tabindex:0,ref:a,style:CI},[x?x({originVNode:D}):D]),U(`div`,{tabindex:0,ref:o,style:SI},null)]),[[ht,b]]):null]})}}}),TI=u({compatConfig:{MODE:3},name:`DialogMask`,props:{prefixCls:String,visible:Boolean,motionName:String,maskProps:Object},setup(e,t){let{}=t;return()=>{let{prefixCls:t,visible:n,maskProps:r,motionName:i}=e;return U(Re,ge(i),{default:()=>[Mt(U(`div`,Y({class:`${t}-mask`},r),null),[[ht,n]])]})}}}),EI=u({compatConfig:{MODE:3},name:`VcDialog`,inheritAttrs:!1,props:Zn(Z(Z({},gI()),{getOpenCount:Function,scrollLocker:Object}),{mask:!0,visible:!1,keyboard:!0,closable:!0,maskClosable:!0,destroyOnClose:!1,prefixCls:`rc-dialog`,getOpenCount:()=>null,focusTriggerAfterClose:!0}),setup(e,t){let{attrs:n,slots:r}=t,i=q(),a=q(),o=q(),s=q(e.visible),c=q(`vcDialogTitle${yI()}`),l=t=>{var n,r;if(t)Ct(a.value,document.activeElement)||(i.value=document.activeElement,(n=o.value)==null||n.focus());else{let t=s.value;if(s.value=!1,e.mask&&i.value&&e.focusTriggerAfterClose){try{i.value.focus({preventScroll:!0})}catch{}i.value=null}t&&((r=e.afterClose)==null||r.call(e))}},u=t=>{var n;(n=e.onClose)==null||n.call(e,t)},d=q(!1),f=q(),p=()=>{clearTimeout(f.value),d.value=!0},m=()=>{f.value=setTimeout(()=>{d.value=!1})},h=t=>{if(!e.maskClosable)return null;d.value?d.value=!1:a.value===t.target&&u(t)},g=t=>{if(e.keyboard&&t.keyCode===$.ESC){t.stopPropagation(),u(t);return}e.visible&&t.keyCode===$.TAB&&o.value.changeActive(!t.shiftKey)};return G(()=>e.visible,()=>{e.visible&&(s.value=!0)},{flush:`post`}),ut(()=>{var t;clearTimeout(f.value),(t=e.scrollLocker)==null||t.unLock()}),S(()=>{var t,n;(t=e.scrollLocker)==null||t.unLock(),s.value&&((n=e.scrollLocker)==null||n.lock())}),()=>{let{prefixCls:t,mask:i,visible:d,maskTransitionName:f,maskAnimation:_,zIndex:v,wrapClassName:y,rootClassName:b,wrapStyle:x,closable:S,maskProps:C,maskStyle:w,transitionName:T,animation:E,wrapProps:D,title:O=r.title}=e,{style:k,class:A}=n;return U(`div`,Y({class:[`${t}-root`,b]},Bu(e,{data:!0})),[U(TI,{prefixCls:t,visible:i&&d,motionName:_I(t,f,_),style:Z({zIndex:v},w),maskProps:C},null),U(`div`,Y({tabIndex:-1,onKeydown:g,class:K(`${t}-wrap`,y),ref:a,onClick:h,role:`dialog`,"aria-labelledby":O?c.value:null,style:Z(Z({zIndex:v},x),{display:s.value?null:`none`})},D),[U(wI,Y(Y({},Br(e,[`scrollLocker`])),{},{style:k,class:A,onMousedown:p,onMouseup:m,ref:o,closable:S,ariaId:c.value,prefixCls:t,visible:d,onClose:u,onVisibleChanged:l,motionName:_I(t,T,E)}),r)])])}}}),DI=u({compatConfig:{MODE:3},name:`DialogWrap`,inheritAttrs:!1,props:Zn(gI(),{visible:!1}),setup(e,t){let{attrs:n,slots:r}=t,i=H(e.visible);return $t({},{inTriggerContext:!1}),G(()=>e.visible,()=>{e.visible&&(i.value=!0)},{flush:`post`}),()=>{let{visible:t,getContainer:a,forceRender:o,destroyOnClose:s=!1,afterClose:c}=e,l=Z(Z(Z({},e),n),{ref:`_component`,key:`dialog`});return a===!1?U(EI,Y(Y({},l),{},{getOpenCount:()=>2}),r):!o&&s&&!i.value?null:U(bu,{autoLock:!0,visible:t,forceRender:o,getContainer:a},{default:e=>(l=Z(Z(Z({},l),e),{afterClose:()=>{c?.(),i.value=!1}}),U(EI,l,r))})}}});function OI(e){let t=H(null),n=Ne(Z({},e)),r=H([]);return V(()=>{t.value&&ir.cancel(t.value)}),[n,e=>{t.value===null&&(r.value=[],t.value=ir(()=>{let e;r.value.forEach(t=>{e=Z(Z({},e),t)}),Z(n,e),t.value=null})),r.value.push(e)}]}function kI(e,t,n,r){let i=t+n,a=(n-r)/2;if(n>r){if(t>0)return{[e]:a};if(t<0&&ir)return{[e]:t<0?a:-a};return{}}function AI(e,t,n,r){let{width:i,height:a}=ku(),o=null;return e<=i&&t<=a?o={x:0,y:0}:(e>i||t>a)&&(o=Z(Z({},kI(`x`,n,e,i)),kI(`y`,r,t,a))),o}var jI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{fe(MI,e)},inject:()=>g(MI,{isPreviewGroup:q(!1),previewUrls:J(()=>new Map),setPreviewUrls:()=>{},current:H(null),setCurrent:()=>{},setShowPreview:()=>{},setMousePosition:()=>{},registerImage:null,rootClassName:``})},PI=u({compatConfig:{MODE:3},name:`PreviewGroup`,inheritAttrs:!1,props:{previewPrefixCls:String,preview:{type:[Boolean,Object],default:!0},icons:{type:Object,default:()=>({})}},setup(e,t){let{slots:n}=t,r=J(()=>{let t={visible:void 0,onVisibleChange:()=>{},getContainer:void 0,current:0};return typeof e.preview==`object`?zI(e.preview,t):t}),i=Ne(new Map),a=H(),o=J(()=>r.value.visible),s=J(()=>r.value.getContainer),[c,l]=df(!!o.value,{value:o,onChange:(e,t)=>{var n,i;(i=(n=r.value).onVisibleChange)==null||i.call(n,e,t)}}),u=H(null),d=J(()=>o.value!==void 0),f=J(()=>Array.from(i.keys())),p=J(()=>f.value[r.value.current]),m=J(()=>new Map(Array.from(i).filter(e=>{let[,{canPreview:t}]=e;return!!t}).map(e=>{let[t,{url:n}]=e;return[t,n]}))),h=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;i.set(e,{url:t,canPreview:n})},g=e=>{a.value=e},_=e=>{u.value=e},v=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return i.set(e,{url:t,canPreview:n}),()=>{i.delete(e)}},y=e=>{e?.stopPropagation(),l(!1),_(null)};return G(p,e=>{g(e)},{immediate:!0,flush:`post`}),S(()=>{c.value&&d.value&&g(p.value)},{flush:`post`}),NI.provide({isPreviewGroup:q(!0),previewUrls:m,setPreviewUrls:h,current:a,setCurrent:g,setShowPreview:l,setMousePosition:_,registerImage:v}),()=>{let t=jI(r.value,[]);return U($e,null,[n.default&&n.default(),U(II,Y(Y({},t),{},{"ria-hidden":!c.value,visible:c.value,prefixCls:e.previewPrefixCls,onClose:y,mousePosition:u.value,src:m.value.get(a.value),icons:e.icons,getContainer:s.value}),null)])}}}),FI={x:0,y:0},II=u({compatConfig:{MODE:3},name:`Preview`,inheritAttrs:!1,props:Z(Z({},gI()),{src:String,alt:String,rootClassName:String,icons:{type:Object,default:()=>({})}}),emits:[`close`,`afterClose`],setup(e,t){let{emit:n,attrs:r}=t,{rotateLeft:i,rotateRight:a,zoomIn:o,zoomOut:s,close:c,left:l,right:u,flipX:d,flipY:f}=Ne(e.icons),p=q(1),m=q(0),h=Ne({x:1,y:1}),[g,_]=OI(FI),v=()=>n(`close`),b=q(),x=Ne({originX:0,originY:0,deltaX:0,deltaY:0}),S=q(!1),{previewUrls:C,current:w,isPreviewGroup:T,setCurrent:E}=NI.inject(),D=J(()=>C.value.size),O=J(()=>Array.from(C.value.keys())),k=J(()=>O.value.indexOf(w.value)),A=J(()=>T.value?C.value.get(w.value):e.src),j=J(()=>T.value&&D.value>1),M=q({wheelDirection:0}),N=()=>{p.value=1,m.value=0,h.x=1,h.y=1,_(FI),n(`afterClose`)},P=e=>{e?p.value+=.5:p.value++,_(FI)},F=e=>{p.value>1&&(e?p.value-=.5:p.value--),_(FI)},I=()=>{m.value+=90},L=()=>{m.value-=90},ee=()=>{h.x=-h.x},te=()=>{h.y=-h.y},ne=e=>{e.preventDefault(),e.stopPropagation(),k.value>0&&E(O.value[k.value-1])},R=e=>{e.preventDefault(),e.stopPropagation(),k.valueP(),type:`zoomIn`},{icon:s,onClick:()=>F(),type:`zoomOut`,disabled:J(()=>p.value===1)},{icon:a,onClick:I,type:`rotateRight`},{icon:i,onClick:L,type:`rotateLeft`},{icon:d,onClick:ee,type:`flipX`},{icon:f,onClick:te,type:`flipY`}],z=()=>{if(e.visible&&S.value){let e=b.value.offsetWidth*p.value,t=b.value.offsetHeight*p.value,{left:n,top:r}=Au(b.value),i=m.value%180!=0;S.value=!1;let a=AI(i?t:e,i?e:t,n,r);a&&_(Z({},a))}},se=e=>{e.button===0&&(e.preventDefault(),e.stopPropagation(),x.deltaX=e.pageX-g.x,x.deltaY=e.pageY-g.y,x.originX=g.x,x.originY=g.y,S.value=!0)},B=t=>{e.visible&&S.value&&_({x:t.pageX-x.deltaX,y:t.pageY-x.deltaY})},ce=t=>{if(!e.visible)return;t.preventDefault();let n=t.deltaY;M.value={wheelDirection:n}},le=t=>{!e.visible||!j.value||(t.preventDefault(),t.keyCode===$.LEFT?k.value>0&&E(O.value[k.value-1]):t.keyCode===$.RIGHT&&k.value{e.visible&&(p.value!==1&&(p.value=1),(g.x!==FI.x||g.y!==FI.y)&&_(FI))},ue=()=>{};return V(()=>{G([()=>e.visible,S],()=>{ue();let e,t,n=cr(window,`mouseup`,z,!1),r=cr(window,`mousemove`,B,!1),i=cr(window,`wheel`,ce,{passive:!1}),a=cr(window,`keydown`,le,!1);try{window.top!==window.self&&(e=cr(window.top,`mouseup`,z,!1),t=cr(window.top,`mousemove`,B,!1))}catch(e){`${e}`}ue=()=>{n.remove(),r.remove(),i.remove(),a.remove(),e&&e.remove(),t&&t.remove()}},{flush:`post`,immediate:!0}),G([M],()=>{let{wheelDirection:e}=M.value;e>0?F(!0):e<0&&P(!0)})}),y(()=>{ue()}),()=>{let{visible:t,prefixCls:n,rootClassName:i}=e;return U(DI,Y(Y({},r),{},{transitionName:e.transitionName,maskTransitionName:e.maskTransitionName,closable:!1,keyboard:!0,prefixCls:n,onClose:v,afterClose:N,visible:t,wrapClassName:re,rootClassName:i,getContainer:e.getContainer}),{default:()=>[U(`div`,{class:[`${e.prefixCls}-operations-wrapper`,i]},[U(`ul`,{class:`${e.prefixCls}-operations`},[oe.map(t=>{let{icon:n,onClick:r,type:i,disabled:a}=t;return U(`li`,{class:K(ie,{[`${e.prefixCls}-operations-operation-disabled`]:a&&a?.value}),onClick:r,key:i},[it(n,{class:ae})])})])]),U(`div`,{class:`${e.prefixCls}-img-wrapper`,style:{transform:`translate3d(${g.x}px, ${g.y}px, 0)`}},[U(`img`,{onMousedown:se,onDblclick:H,ref:b,class:`${e.prefixCls}-img`,src:A.value,alt:e.alt,style:{transform:`scale3d(${h.x*p.value}, ${h.y*p.value}, 1) rotate(${m.value}deg)`}},null)]),j.value&&U(`div`,{class:K(`${e.prefixCls}-switch-left`,{[`${e.prefixCls}-switch-left-disabled`]:k.value<=0}),onClick:ne},[l]),j.value&&U(`div`,{class:K(`${e.prefixCls}-switch-right`,{[`${e.prefixCls}-switch-right-disabled`]:k.value>=D.value-1}),onClick:R},[u])]})}}}),LI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({src:String,wrapperClassName:String,wrapperStyle:{type:Object,default:void 0},rootClassName:String,prefixCls:String,previewPrefixCls:String,width:[Number,String],height:[Number,String],previewMask:{type:[Boolean,Function],default:void 0},placeholder:f.any,fallback:String,preview:{type:[Boolean,Object],default:!0},onClick:{type:Function},onError:{type:Function}}),zI=(e,t)=>{let n=Z({},e);return Object.keys(t).forEach(r=>{e[r]===void 0&&(n[r]=t[r])}),n},BI=0,VI=u({compatConfig:{MODE:3},name:`VcImage`,inheritAttrs:!1,props:RI(),emits:[`click`,`error`],setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=J(()=>e.prefixCls),o=J(()=>`${a.value}-preview`),s=J(()=>{let t={visible:void 0,onVisibleChange:()=>{},getContainer:void 0};return typeof e.preview==`object`?zI(e.preview,t):t}),c=J(()=>s.value.src??e.src),l=J(()=>e.placeholder&&e.placeholder!==!0||r.placeholder),u=J(()=>s.value.visible),d=J(()=>s.value.getContainer),f=J(()=>u.value!==void 0),[p,m]=df(!!u.value,{value:u,onChange:(e,t)=>{var n,r;(r=(n=s.value).onVisibleChange)==null||r.call(n,e,t)}}),h=H(l.value?`loading`:`normal`);G(()=>e.src,()=>{h.value=l.value?`loading`:`normal`});let g=H(null),_=J(()=>h.value===`error`),{isPreviewGroup:v,setCurrent:b,setShowPreview:x,setMousePosition:S,registerImage:C}=NI.inject(),w=H(BI++),T=J(()=>e.preview&&!_.value),E=()=>{h.value=`normal`},D=e=>{h.value=`error`,i(`error`,e)},O=e=>{if(!f.value){let{left:t,top:n}=Au(e.target);v.value?(b(w.value),S({x:t,y:n})):g.value={x:t,y:n}}v.value?x(!0):m(!0),i(`click`,e)},k=()=>{m(!1),f.value||(g.value=null)},A=H(null);G(()=>A,()=>{h.value===`loading`&&A.value.complete&&(A.value.naturalWidth||A.value.naturalHeight)&&E()});let j=()=>{};V(()=>{G([c,T],()=>{if(j(),!v.value)return()=>{};j=C(w.value,c.value,T.value),T.value||j()},{flush:`post`,immediate:!0})}),y(()=>{j()});let M=e=>Gg(e)?e+`px`:e;return()=>{let{prefixCls:t,wrapperClassName:a,fallback:l,src:u,placeholder:f,wrapperStyle:m,rootClassName:y,width:b,height:x,crossorigin:S,decoding:C,alt:w,sizes:j,srcset:N,usemap:P,class:F,style:I}=Z(Z({},e),n),L=s.value,{icons:ee,maskClassName:te}=L,ne=LI(L,[`icons`,`maskClassName`]),R=K(t,a,y,{[`${t}-error`]:_.value}),re=_.value&&l?l:c.value,ie={crossorigin:S,decoding:C,alt:w,sizes:j,srcset:N,usemap:P,width:b,height:x,class:K(`${t}-img`,{[`${t}-img-placeholder`]:f===!0},F),style:Z({height:M(x)},I)};return U($e,null,[U(`div`,{class:R,onClick:T.value?O:e=>{i(`click`,e)},style:Z({width:M(b),height:M(x)},m)},[U(`img`,Y(Y(Y({},ie),_.value&&l?{src:l}:{onLoad:E,onError:D,src:u}),{},{ref:A}),null),h.value===`loading`&&U(`div`,{"aria-hidden":`true`,class:`${t}-placeholder`},[f||r.placeholder&&r.placeholder()]),r.previewMask&&T.value&&U(`div`,{class:[`${t}-mask`,te]},[r.previewMask()])]),!v.value&&T.value&&U(II,Y(Y({},ne),{},{"aria-hidden":!p.value,visible:p.value,prefixCls:o.value,onClose:k,mousePosition:g.value,src:re,alt:w,getContainer:d.value,icons:ee,rootClassName:y}),null)])}}});VI.PreviewGroup=PI;var HI=VI,UI={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z`}},{tag:`path`,attrs:{d:`M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z`}}]},name:`rotate-left`,theme:`outlined`};function WI(e){for(var t=1;t{let{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}${e.antCls}-zoom-enter, ${t}${e.antCls}-zoom-appear`]:{transform:`none`,opacity:0,animationDuration:e.motionDurationSlow,userSelect:`none`},[`${t}${e.antCls}-zoom-leave ${t}-content`]:{pointerEvents:`none`},[`${t}-mask`]:Z(Z({},lL(`fixed`)),{zIndex:e.zIndexPopupBase,height:`100%`,backgroundColor:e.colorBgMask,[`${t}-hidden`]:{display:`none`}}),[`${t}-wrap`]:Z(Z({},lL(`fixed`)),{overflow:`auto`,outline:0,WebkitOverflowScrolling:`touch`})}},{[`${t}-root`]:b_(e)}]},dL=e=>{let{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap`]:{zIndex:e.zIndexPopupBase,position:`fixed`,inset:0,overflow:`auto`,outline:0,WebkitOverflowScrolling:`touch`},[`${t}-wrap-rtl`]:{direction:`rtl`},[`${t}-centered`]:{textAlign:`center`,"&::before":{display:`inline-block`,width:0,height:`100%`,verticalAlign:`middle`,content:`""`},[t]:{top:0,display:`inline-block`,paddingBottom:0,textAlign:`start`,verticalAlign:`middle`}},[`@media (max-width: ${e.screenSMMax})`]:{[t]:{maxWidth:`calc(100vw - 16px)`,margin:`${e.marginXS} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Z(Z({},rn(e)),{pointerEvents:`none`,position:`relative`,top:100,width:`auto`,maxWidth:`calc(100vw - ${e.margin*2}px)`,margin:`0 auto`,paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.modalHeadingColor,fontWeight:e.fontWeightStrong,fontSize:e.modalHeaderTitleFontSize,lineHeight:e.modalHeaderTitleLineHeight,wordWrap:`break-word`},[`${t}-content`]:{position:`relative`,backgroundColor:e.modalContentBg,backgroundClip:`padding-box`,border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadowSecondary,pointerEvents:`auto`,padding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`},[`${t}-close`]:Z({position:`absolute`,top:(e.modalHeaderCloseSize-e.modalCloseBtnSize)/2,insetInlineEnd:(e.modalHeaderCloseSize-e.modalCloseBtnSize)/2,zIndex:e.zIndexPopupBase+10,padding:0,color:e.modalCloseColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:`none`,background:`transparent`,borderRadius:e.borderRadiusSM,width:e.modalConfirmIconSize,height:e.modalConfirmIconSize,border:0,outline:0,cursor:`pointer`,transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:`block`,fontSize:e.fontSizeLG,fontStyle:`normal`,lineHeight:`${e.modalCloseBtnSize}px`,textAlign:`center`,textTransform:`none`,textRendering:`auto`},"&:hover":{color:e.modalIconHoverColor,backgroundColor:e.wireframe?`transparent`:e.colorFillContent,textDecoration:`none`},"&:active":{backgroundColor:e.wireframe?`transparent`:e.colorFillContentHover}},de(e)),[`${t}-header`]:{color:e.colorText,background:e.modalHeaderBg,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,marginBottom:e.marginXS},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:`break-word`},[`${t}-footer`]:{textAlign:`end`,background:e.modalFooterBg,marginTop:e.marginSM,[`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]:{marginBottom:0,marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:`hidden`}})},{[`${t}-pure-panel`]:{top:`auto`,padding:0,display:`flex`,flexDirection:`column`,[`${t}-content, + ${t}-body, + ${t}-confirm-body-wrapper`]:{display:`flex`,flexDirection:`column`,flex:`auto`},[`${t}-confirm-body`]:{marginBottom:`auto`}}}]},fL=e=>{let{componentCls:t}=e,n=`${t}-confirm`;return{[n]:{"&-rtl":{direction:`rtl`},[`${e.antCls}-modal-header`]:{display:`none`},[`${n}-body-wrapper`]:Z({},D()),[`${n}-body`]:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,[`${n}-title`]:{flex:`0 0 100%`,display:`block`,overflow:`hidden`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.modalHeaderTitleFontSize,lineHeight:e.modalHeaderTitleLineHeight,[`+ ${n}-content`]:{marginBlockStart:e.marginXS,flexBasis:`100%`,maxWidth:`calc(100% - ${e.modalConfirmIconSize+e.marginSM}px)`}},[`${n}-content`]:{color:e.colorText,fontSize:e.fontSize},[`> ${e.iconCls}`]:{flex:`none`,marginInlineEnd:e.marginSM,fontSize:e.modalConfirmIconSize,[`+ ${n}-title`]:{flex:1},[`+ ${n}-title + ${n}-content`]:{marginInlineStart:e.modalConfirmIconSize+e.marginSM}}},[`${n}-btns`]:{textAlign:`end`,marginTop:e.marginSM,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${n}-error ${n}-body > ${e.iconCls}`]:{color:e.colorError},[`${n}-warning ${n}-body > ${e.iconCls}, + ${n}-confirm ${n}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${n}-info ${n}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${n}-success ${n}-body > ${e.iconCls}`]:{color:e.colorSuccess},[`${t}-zoom-leave ${t}-btns`]:{pointerEvents:`none`}}},pL=e=>{let{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:`rtl`,[`${t}-confirm-body`]:{direction:`rtl`}}}}},mL=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-confirm`;return{[t]:{[`${t}-content`]:{padding:0},[`${t}-header`]:{padding:e.modalHeaderPadding,borderBottom:`${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`,marginBottom:0},[`${t}-body`]:{padding:e.modalBodyPadding},[`${t}-footer`]:{padding:`${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`,borderTop:`${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`,marginTop:0}},[r]:{[`${n}-modal-body`]:{padding:`${e.padding*2}px ${e.padding*2}px ${e.paddingLG}px`},[`${r}-body`]:{[`> ${e.iconCls}`]:{marginInlineEnd:e.margin,[`+ ${r}-title + ${r}-content`]:{marginInlineStart:e.modalConfirmIconSize+e.margin}}},[`${r}-btns`]:{marginTop:e.marginLG}}}},hL=v(`Modal`,e=>{let t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5,i=B(e,{modalBodyPadding:e.paddingLG,modalHeaderBg:e.colorBgElevated,modalHeaderPadding:`${t}px ${e.paddingLG}px`,modalHeaderBorderWidth:e.lineWidth,modalHeaderBorderStyle:e.lineType,modalHeaderTitleLineHeight:r,modalHeaderTitleFontSize:n,modalHeaderBorderColorSplit:e.colorSplit,modalHeaderCloseSize:r*n+t*2,modalContentBg:e.colorBgElevated,modalHeadingColor:e.colorTextHeading,modalCloseColor:e.colorTextDescription,modalFooterBg:`transparent`,modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterPaddingVertical:e.paddingXS,modalFooterPaddingHorizontal:e.padding,modalFooterBorderWidth:e.lineWidth,modalConfirmTitleFontSize:e.fontSizeLG,modalIconHoverColor:e.colorIconHover,modalConfirmIconSize:e.fontSize*e.lineHeight,modalCloseBtnSize:e.controlHeightLG*.55});return[dL(i),fL(i),pL(i),uL(i),e.wireframe&&mL(i),Q_(i,`zoom`)]}),gL=e=>({position:e||`absolute`,inset:0}),_L=e=>{let{iconCls:t,motionDurationSlow:n,paddingXXS:r,marginXXS:i,prefixCls:a}=e;return{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fff`,background:new we(`#000`).setAlpha(.5).toRgbString(),cursor:`pointer`,opacity:0,transition:`opacity ${n}`,[`.${a}-mask-info`]:Z(Z({},xe),{padding:`0 ${r}px`,[t]:{marginInlineEnd:i,svg:{verticalAlign:`baseline`}}})}},vL=e=>{let{previewCls:t,modalMaskBg:n,paddingSM:r,previewOperationColorDisabled:i,motionDurationSlow:a}=e,o=new we(n).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${t}-operations`]:Z(Z({},rn(e)),{display:`flex`,flexDirection:`row-reverse`,alignItems:`center`,color:e.previewOperationColor,listStyle:`none`,background:o.toRgbString(),pointerEvents:`auto`,"&-operation":{marginInlineStart:r,padding:r,cursor:`pointer`,transition:`all ${a}`,userSelect:`none`,"&:hover":{background:s.toRgbString()},"&-disabled":{color:i,pointerEvents:`none`},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:`absolute`,left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%)`},"&-icon":{fontSize:e.previewOperationSize}})}},yL=e=>{let{modalMaskBg:t,iconCls:n,previewOperationColorDisabled:r,previewCls:i,zIndexPopup:a,motionDurationSlow:o}=e,s=new we(t).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${i}-switch-left, ${i}-switch-right`]:{position:`fixed`,insetBlockStart:`50%`,zIndex:a+1,display:`flex`,alignItems:`center`,justifyContent:`center`,width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:s.toRgbString(),borderRadius:`50%`,transform:`translateY(-50%)`,cursor:`pointer`,transition:`all ${o}`,pointerEvents:`auto`,userSelect:`none`,"&:hover":{background:c.toRgbString()},"&-disabled":{"&, &:hover":{color:r,background:`transparent`,cursor:`not-allowed`,[`> ${n}`]:{cursor:`not-allowed`}}},[`> ${n}`]:{fontSize:e.previewOperationSize}},[`${i}-switch-left`]:{insetInlineStart:e.marginSM},[`${i}-switch-right`]:{insetInlineEnd:e.marginSM}}},bL=e=>{let{motionEaseOut:t,previewCls:n,motionDurationSlow:r,componentCls:i}=e;return[{[`${i}-preview-root`]:{[n]:{height:`100%`,textAlign:`center`,pointerEvents:`none`},[`${n}-body`]:Z(Z({},gL()),{overflow:`hidden`}),[`${n}-img`]:{maxWidth:`100%`,maxHeight:`100%`,verticalAlign:`middle`,transform:`scale3d(1, 1, 1)`,cursor:`grab`,transition:`transform ${r} ${t} 0s`,userSelect:`none`,pointerEvents:`auto`,"&-wrapper":Z(Z({},gL()),{transition:`transform ${r} ${t} 0s`,display:`flex`,justifyContent:`center`,alignItems:`center`,"&::before":{display:`inline-block`,width:1,height:`50%`,marginInlineEnd:-1,content:`""`}})},[`${n}-moving`]:{[`${n}-preview-img`]:{cursor:`grabbing`,"&-wrapper":{transitionDuration:`0s`}}}}},{[`${i}-preview-root`]:{[`${n}-wrap`]:{zIndex:e.zIndexPopup}}},{[`${i}-preview-operations-wrapper`]:{position:`fixed`,insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:`100%`},"&":[vL(e),yL(e)]}]},xL=e=>{let{componentCls:t}=e;return{[t]:{position:`relative`,display:`inline-block`,[`${t}-img`]:{width:`100%`,height:`auto`,verticalAlign:`middle`},[`${t}-img-placeholder`]:{backgroundColor:e.colorBgContainerDisabled,backgroundImage:`url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')`,backgroundRepeat:`no-repeat`,backgroundPosition:`center center`,backgroundSize:`30%`},[`${t}-mask`]:Z({},_L(e)),[`${t}-mask:hover`]:{opacity:1},[`${t}-placeholder`]:Z({},gL())}}},SL=e=>{let{previewCls:t}=e;return{[`${t}-root`]:Q_(e,`zoom`),"&":b_(e,!0)}},CL=v(`Image`,e=>{let t=`${e.componentCls}-preview`,n=B(e,{previewCls:t,modalMaskBg:new we(`#000`).setAlpha(.45).toRgbString(),imagePreviewSwitchSize:e.controlHeightLG});return[xL(n),bL(n),uL(B(n,{componentCls:t})),SL(n)]},e=>({zIndexPopup:e.zIndexPopupBase+80,previewOperationColor:new we(e.colorTextLightSolid).toRgbString(),previewOperationColorDisabled:new we(e.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5})),wL={rotateLeft:U(KI,null,null),rotateRight:U(XI,null,null),zoomIn:U(eL,null,null),zoomOut:U(iL,null,null),close:U(Pe,null,null),left:U(wA,null,null),right:U(gx,null,null),flipX:U(cL,null,null),flipY:U(cL,{rotate:90},null)},TL=u({compatConfig:{MODE:3},name:`AImagePreviewGroup`,inheritAttrs:!1,props:{previewPrefixCls:String,preview:nn()},setup(e,t){let{attrs:n,slots:r}=t,{prefixCls:i,rootPrefixCls:a}=X(`image`,e),o=J(()=>`${i.value}-preview`),[s,c]=CL(i),l=J(()=>{let{preview:t}=e;if(t===!1)return t;let n=typeof t==`object`?t:{};return Z(Z({},n),{rootClassName:c.value,transitionName:Xt(a.value,`zoom`,n.transitionName),maskTransitionName:Xt(a.value,`fade`,n.maskTransitionName)})});return()=>s(U(PI,Y(Y({},Z(Z({},n),e)),{},{preview:l.value,icons:wL,previewPrefixCls:o.value}),r))}}),EL=u({name:`AImage`,inheritAttrs:!1,props:RI(),setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,rootPrefixCls:a,configProvider:o}=X(`image`,e),[s,c]=CL(i),l=J(()=>{let{preview:t}=e;if(t===!1)return t;let n=typeof t==`object`?t:{};return Z(Z({icons:wL},n),{transitionName:Xt(a.value,`zoom`,n.transitionName),maskTransitionName:Xt(a.value,`fade`,n.maskTransitionName)})});return()=>{let t=o.locale?.value?.Image||Ye.Image,a=()=>U(`div`,{class:`${i.value}-mask-info`},[U(oI,null,null),t?.preview]),{previewMask:u=n.previewMask||a}=e;return s(U(HI,Y(Y({},Z(Z(Z({},r),e),{prefixCls:i.value})),{},{preview:l.value,rootClassName:K(e.rootClassName,c.value)}),Z(Z({},n),{previewMask:typeof u==`function`?u:null})))}}});EL.PreviewGroup=TL,EL.install=function(e){return e.component(EL.name,EL),e.component(EL.PreviewGroup.name,EL.PreviewGroup),e};var DL={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z`}}]},name:`up`,theme:`outlined`};function OL(e){for(var t=1;t2**53-1)return String(jL()?BigInt(e).toString():2**53-1);if(e<-(2**53-1))return String(jL()?BigInt(e).toString():-(2**53-1));t=e.toFixed(PL(t))}return ML(t).fullStr}function IL(e){return typeof e==`number`?!Number.isNaN(e):e?/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e):!1}function LL(e){return!e&&e!==0&&!Number.isNaN(e)||!String(e).trim()}var RL=class e{constructor(e){if(this.origin=``,LL(e)){this.empty=!0;return}this.origin=String(e),this.number=Number(e)}negate(){return new e(-this.toNumber())}add(t){if(this.isInvalidate())return new e(t);let n=Number(t);if(Number.isNaN(n))return this;let r=this.number+n;if(r>2**53-1)return new e(2**53-1);if(r<-(2**53-1))return new e(-(2**53-1));let i=Math.max(PL(this.number),PL(n));return new e(r.toFixed(i))}isEmpty(){return this.empty}isNaN(){return Number.isNaN(this.number)}isInvalidate(){return this.isEmpty()||this.isNaN()}equals(e){return this.toNumber()===e?.toNumber()}lessEquals(e){return this.add(e.negate().toString()).toNumber()<=0}toNumber(){return this.number}toString(){return!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]?this.isInvalidate()?``:FL(this.number):this.origin}},zL=class e{constructor(e){if(this.origin=``,LL(e)){this.empty=!0;return}if(this.origin=String(e),e===`-`||Number.isNaN(e)){this.nan=!0;return}let t=e;if(NL(t)&&(t=Number(t)),t=typeof t==`string`?t:FL(t),IL(t)){let e=ML(t);this.negative=e.negative;let n=e.trimStr.split(`.`);this.integer=BigInt(n[0]);let r=n[1]||`0`;this.decimal=BigInt(r),this.decimalLen=r.length}else this.nan=!0}getMark(){return this.negative?`-`:``}getIntegerStr(){return this.integer.toString()}getDecimalStr(){return this.decimal.toString().padStart(this.decimalLen,`0`)}alignDecimal(e){let t=`${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(e,`0`)}`;return BigInt(t)}negate(){let t=new e(this.toString());return t.negative=!t.negative,t}add(t){if(this.isInvalidate())return new e(t);let n=new e(t);if(n.isInvalidate())return this;let r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),{negativeStr:i,trimStr:a}=ML((this.alignDecimal(r)+n.alignDecimal(r)).toString()),o=`${i}${a.padStart(r+1,`0`)}`;return new e(`${o.slice(0,-r)}.${o.slice(-r)}`)}isEmpty(){return this.empty}isNaN(){return this.nan}isInvalidate(){return this.isEmpty()||this.isNaN()}equals(e){return this.toString()===e?.toString()}lessEquals(e){return this.add(e.negate().toString()).toNumber()<=0}toNumber(){return this.isNaN()?NaN:Number(this.toString())}toString(){return!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]?this.isInvalidate()?``:ML(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr:this.origin}};function BL(e){return jL()?new zL(e):new RL(e)}function VL(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(e===``)return``;let{negativeStr:i,integerStr:a,decimalStr:o}=ML(e),s=`${t}${o}`,c=`${i}${a}`;if(n>=0){let a=Number(o[n]);return a>=5&&!r?VL(BL(e).add(`${i}0.${`0`.repeat(n)}${10-a}`).toString(),t,n,r):n===0?c:`${c}${t}${o.padEnd(n,`0`).slice(0,n)}`}return s===`.0`?c:`${c}${s}`}var HL=200,UL=600,WL=u({compatConfig:{MODE:3},name:`StepHandler`,inheritAttrs:!1,props:{prefixCls:String,upDisabled:Boolean,downDisabled:Boolean,onStep:d()},slots:Object,setup(e,t){let{slots:n,emit:r}=t,i=H(),a=(e,t)=>{e.preventDefault(),r(`step`,t);function n(){r(`step`,t),i.value=setTimeout(n,HL)}i.value=setTimeout(n,UL)},o=()=>{clearTimeout(i.value)};return ut(()=>{o()}),()=>{if(vd())return null;let{prefixCls:t,upDisabled:r,downDisabled:i}=e,s=`${t}-handler`,c=K(s,`${s}-up`,{[`${s}-up-disabled`]:r}),l=K(s,`${s}-down`,{[`${s}-down-disabled`]:i}),u={unselectable:`on`,role:`button`,onMouseup:o,onMouseleave:o},{upNode:d,downNode:f}=n;return U(`div`,{class:`${s}-wrap`},[U(`span`,Y(Y({},u),{},{onMousedown:e=>{a(e,!0)},"aria-label":`Increase Value`,"aria-disabled":r,class:c}),[d?.()||U(`span`,{unselectable:`on`,class:`${t}-handler-up-inner`},null)]),U(`span`,Y(Y({},u),{},{onMousedown:e=>{a(e,!1)},"aria-label":`Decrease Value`,"aria-disabled":i,class:l}),[f?.()||U(`span`,{unselectable:`on`,class:`${t}-handler-down-inner`},null)])])}}});function GL(e,t){let n=H(null);function r(){try{let{selectionStart:t,selectionEnd:r,value:i}=e.value,a=i.substring(0,t),o=i.substring(r);n.value={start:t,end:r,value:i,beforeTxt:a,afterTxt:o}}catch{}}function i(){if(e.value&&n.value&&t.value)try{let{value:t}=e.value,{beforeTxt:r,afterTxt:i,start:a}=n.value,o=t.length;if(t.endsWith(i))o=t.length-n.value.afterTxt.length;else if(t.startsWith(r))o=r.length;else{let e=r[a-1],n=t.indexOf(e,a-1);n!==-1&&(o=n+1)}e.value.setSelectionRange(o,o)}catch(e){`${e.message}`}}return[r,i]}var KL=(()=>{let e=q(0),t=()=>{ir.cancel(e.value)};return ut(()=>{t()}),n=>{t(),e.value=ir(()=>{n()})}}),qL=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie||t.isEmpty()?t.toString():t.toNumber(),YL=e=>{let t=BL(e);return t.isInvalidate()?null:t},XL=()=>({stringMode:Q(),defaultValue:W([String,Number]),value:W([String,Number]),prefixCls:_(),min:W([String,Number]),max:W([String,Number]),step:W([String,Number],1),tabindex:Number,controls:Q(!0),readonly:Q(),disabled:Q(),autofocus:Q(),keyboard:Q(!0),parser:d(),formatter:d(),precision:Number,decimalSeparator:String,onInput:d(),onChange:d(),onPressEnter:d(),onStep:d(),onBlur:d(),onFocus:d()}),ZL=u({compatConfig:{MODE:3},name:`InnerInputNumber`,inheritAttrs:!1,props:Z(Z({},XL()),{lazy:Boolean}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i,expose:a}=t,o=q(),s=q(!1),c=q(!1),l=q(!1),u=q(BL(e.value));function d(t){e.value===void 0&&(u.value=t)}let f=(t,n)=>{if(!n)return e.precision>=0?e.precision:Math.max(PL(t),PL(e.step))},p=t=>{let n=String(t);if(e.parser)return e.parser(n);let r=n;return e.decimalSeparator&&(r=r.replace(e.decimalSeparator,`.`)),r.replace(/[^\w.-]+/g,``)},m=q(``),h=(t,n)=>{if(e.formatter)return e.formatter(t,{userTyping:n,input:String(m.value)});let r=typeof t==`number`?FL(t):t;if(!n){let t=f(r,n);if(IL(r)&&(e.decimalSeparator||t>=0)){let n=e.decimalSeparator||`.`;r=VL(r,n,t)}}return r};m.value=(()=>{let t=e.value;return u.value.isInvalidate()&&[`string`,`number`].includes(typeof t)?Number.isNaN(t)?``:t:h(u.value.toString(),!1)})();function g(e,t){m.value=h(e.isInvalidate()?e.toString(!1):e.toString(!t),t)}let _=J(()=>YL(e.max)),v=J(()=>YL(e.min)),y=J(()=>!_.value||!u.value||u.value.isInvalidate()?!1:_.value.lessEquals(u.value)),b=J(()=>!v.value||!u.value||u.value.isInvalidate()?!1:u.value.lessEquals(v.value)),[x,S]=GL(o,s),C=e=>_.value&&!e.lessEquals(_.value)?_.value:v.value&&!v.value.lessEquals(e)?v.value:null,w=e=>!C(e),T=(t,n)=>{var r;let i=t,a=w(i)||i.isEmpty();if(!i.isEmpty()&&!n&&(i=C(i)||i,a=!0),!e.readonly&&!e.disabled&&a){let t=i.toString(),a=f(t,n);return a>=0&&(i=BL(VL(t,`.`,a))),i.equals(u.value)||(d(i),(r=e.onChange)==null||r.call(e,i.isEmpty()?null:JL(e.stringMode,i)),e.value===void 0&&g(i,n)),i}return u.value},E=KL(),D=t=>{var n;if(x(),m.value=t,!l.value){let e=BL(p(t));e.isNaN()||T(e,!0)}(n=e.onInput)==null||n.call(e,t),E(()=>{let n=t;e.parser||(n=t.replace(/。/g,`.`)),n!==t&&D(n)})},O=()=>{l.value=!0},k=()=>{l.value=!1,D(o.value.value)},A=e=>{D(e.target.value)},j=t=>{var n,r;if(t&&y.value||!t&&b.value)return;c.value=!1;let i=BL(e.step);t||(i=i.negate());let a=(u.value||BL(0)).add(i.toString()),s=T(a,!1);(n=e.onStep)==null||n.call(e,JL(e.stringMode,s),{offset:e.step,type:t?`up`:`down`}),(r=o.value)==null||r.focus()},M=t=>{let n=BL(p(m.value)),r=n;r=n.isNaN()?u.value:T(n,t),e.value===void 0?r.isNaN()||g(r,!1):g(u.value,!1)},N=()=>{c.value=!0},P=t=>{var n;let{which:r}=t;c.value=!0,r===$.ENTER&&(l.value||(c.value=!1),M(!1),(n=e.onPressEnter)==null||n.call(e,t)),e.keyboard!==!1&&!l.value&&[$.UP,$.DOWN].includes(r)&&(j($.UP===r),t.preventDefault())},F=()=>{c.value=!1},I=e=>{M(!1),s.value=!1,c.value=!1,i(`blur`,e)};return G(()=>e.precision,()=>{u.value.isInvalidate()||g(u.value,!1)},{flush:`post`}),G(()=>e.value,()=>{let t=BL(e.value);u.value=t;let n=BL(p(m.value));(!t.equals(n)||!c.value||e.formatter)&&g(t,c.value)},{flush:`post`}),G(m,()=>{e.formatter&&S()},{flush:`post`}),G(()=>e.disabled,e=>{e&&(s.value=!1)}),a({focus:()=>{var e;(e=o.value)==null||e.focus()},blur:()=>{var e;(e=o.value)==null||e.blur()}}),()=>{let t=Z(Z({},n),e),{prefixCls:a=`rc-input-number`,min:c,max:l,step:d=1,defaultValue:f,value:p,disabled:h,readonly:g,keyboard:_,controls:v=!0,autofocus:x,stringMode:S,parser:C,formatter:T,precision:E,decimalSeparator:D,onChange:M,onInput:L,onPressEnter:ee,onStep:te,lazy:ne,class:R,style:re}=t,ie=qL(t,[`prefixCls`,`min`,`max`,`step`,`defaultValue`,`value`,`disabled`,`readonly`,`keyboard`,`controls`,`autofocus`,`stringMode`,`parser`,`formatter`,`precision`,`decimalSeparator`,`onChange`,`onInput`,`onPressEnter`,`onStep`,`lazy`,`class`,`style`]),{upHandler:ae,downHandler:oe}=r,z=`${a}-input`,se={};return ne?se.onChange=A:se.onInput=A,U(`div`,{class:K(a,R,{[`${a}-focused`]:s.value,[`${a}-disabled`]:h,[`${a}-readonly`]:g,[`${a}-not-a-number`]:u.value.isNaN(),[`${a}-out-of-range`]:!u.value.isInvalidate()&&!w(u.value)}),style:re,onKeydown:P,onKeyup:F},[v&&U(WL,{prefixCls:a,upDisabled:y.value,downDisabled:b.value,onStep:j},{upNode:ae,downNode:oe}),U(`div`,{class:`${z}-wrap`},[U(`input`,Y(Y(Y({autofocus:x,autocomplete:`off`,role:`spinbutton`,"aria-valuemin":c,"aria-valuemax":l,"aria-valuenow":u.value.isInvalidate()?null:u.value.toString(),step:d},ie),{},{ref:o,class:z,value:m.value,disabled:h,readonly:g,onFocus:e=>{s.value=!0,i(`focus`,e)}},se),{},{onBlur:I,onCompositionstart:O,onCompositionend:k,onBeforeinput:N}),null)])])}}});function QL(e){return e!=null}var $L=e=>{let{componentCls:t,lineWidth:n,lineType:r,colorBorder:i,borderRadius:a,fontSizeLG:s,controlHeightLG:c,controlHeightSM:l,colorError:u,inputPaddingHorizontalSM:d,colorTextDescription:f,motionDurationMid:p,colorPrimary:m,controlHeight:h,inputPaddingHorizontal:g,colorBgContainer:_,colorTextDisabled:v,borderRadiusSM:y,borderRadiusLG:b,controlWidth:x,handleVisible:S}=e;return[{[t]:Z(Z(Z(Z({},rn(e)),BT(e)),zT(e,t)),{display:`inline-block`,width:x,margin:0,padding:0,border:`${n}px ${r} ${i}`,borderRadius:a,"&-rtl":{direction:`rtl`,[`${t}-input`]:{direction:`rtl`}},"&-lg":{padding:0,fontSize:s,borderRadius:b,[`input${t}-input`]:{height:c-2*n}},"&-sm":{padding:0,borderRadius:y,[`input${t}-input`]:{height:l-2*n,padding:`0 ${d}px`}},"&:hover":Z({},PT(e)),"&-focused":Z({},FT(e)),"&-disabled":Z(Z({},IT(e)),{[`${t}-input`]:{cursor:`not-allowed`}}),"&-out-of-range":{input:{color:u}},"&-group":Z(Z(Z({},rn(e)),VT(e)),{"&-wrapper":{display:`inline-block`,textAlign:`start`,verticalAlign:`top`,[`${t}-affix-wrapper`]:{width:`100%`},"&-lg":{[`${t}-group-addon`]:{borderRadius:b}},"&-sm":{[`${t}-group-addon`]:{borderRadius:y}}}}),[t]:{"&-input":Z(Z({width:`100%`,height:h-2*n,padding:`0 ${g}px`,textAlign:`start`,backgroundColor:`transparent`,border:0,borderRadius:a,outline:0,transition:`all ${p} linear`,appearance:`textfield`,color:e.colorText,fontSize:`inherit`,verticalAlign:`top`},NT(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:`none`,appearance:`none`}})}})},{[t]:{[`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]:{opacity:1},[`${t}-handler-wrap`]:{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:`100%`,background:_,borderStartStartRadius:0,borderStartEndRadius:a,borderEndEndRadius:a,borderEndStartRadius:0,opacity:+(S===!0),display:`flex`,flexDirection:`column`,alignItems:`stretch`,transition:`opacity ${p} linear ${p}`,[`${t}-handler`]:{display:`flex`,alignItems:`center`,justifyContent:`center`,flex:`auto`,height:`40%`,[` + ${t}-handler-up-inner, + ${t}-handler-down-inner + `]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},[`${t}-handler`]:{height:`50%`,overflow:`hidden`,color:f,fontWeight:`bold`,lineHeight:0,textAlign:`center`,cursor:`pointer`,borderInlineStart:`${n}px ${r} ${i}`,transition:`all ${p} linear`,"&:active":{background:e.colorFillAlter},"&:hover":{height:`60%`,[` + ${t}-handler-up-inner, + ${t}-handler-down-inner + `]:{color:m}},"&-up-inner, &-down-inner":Z(Z({},o()),{color:f,transition:`all ${p} linear`,userSelect:`none`})},[`${t}-handler-up`]:{borderStartEndRadius:a},[`${t}-handler-down`]:{borderBlockStart:`${n}px ${r} ${i}`,borderEndEndRadius:a},"&-disabled, &-readonly":{[`${t}-handler-wrap`]:{display:`none`},[`${t}-input`]:{color:`inherit`}},[` + ${t}-handler-up-disabled, + ${t}-handler-down-disabled + `]:{cursor:`not-allowed`},[` + ${t}-handler-up-disabled:hover &-handler-up-inner, + ${t}-handler-down-disabled:hover &-handler-down-inner + `]:{color:v}}},{[`${t}-borderless`]:{borderColor:`transparent`,boxShadow:`none`,[`${t}-handler-down`]:{borderBlockStartWidth:0}}}]},eR=e=>{let{componentCls:t,inputPaddingHorizontal:n,inputAffixPadding:r,controlWidth:i,borderRadiusLG:a,borderRadiusSM:o}=e;return{[`${t}-affix-wrapper`]:Z(Z(Z({},BT(e)),zT(e,`${t}-affix-wrapper`)),{position:`relative`,display:`inline-flex`,width:i,padding:0,paddingInlineStart:n,"&-lg":{borderRadius:a},"&-sm":{borderRadius:o},[`&:not(${t}-affix-wrapper-disabled):hover`]:Z(Z({},PT(e)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${t}[disabled]`]:{background:`transparent`}},[`> div${t}`]:{width:`100%`,border:`none`,outline:`none`,[`&${t}-focused`]:{boxShadow:`none !important`}},[`input${t}-input`]:{padding:0},"&::before":{width:0,visibility:`hidden`,content:`"\\a0"`},[`${t}-handler-wrap`]:{zIndex:2},[t]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,pointerEvents:`none`},"&-prefix":{marginInlineEnd:r},"&-suffix":{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:`100%`,marginInlineEnd:n,marginInlineStart:r}}})}},tR=v(`InputNumber`,e=>{let t=qT(e);return[$L(t),eR(t),uv(t)]},e=>({controlWidth:90,handleWidth:e.controlHeightSM-e.lineWidth*2,handleFontSize:e.fontSize/2,handleVisible:`auto`})),nR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iWf(s.status,e.status)),{prefixCls:l,size:u,direction:d,disabled:f}=X(`input-number`,e),{compactSize:p,compactItemClassnames:m}=u_(l,d),h=at(),g=J(()=>f.value??h.value),[_,v]=tR(l),y=J(()=>p.value||u.value),b=q(e.value??e.defaultValue),x=q(!1);G(()=>e.value,()=>{b.value=e.value});let S=q(null),C=()=>{var e;(e=S.value)==null||e.focus()};r({focus:C,blur:()=>{var e;(e=S.value)==null||e.blur()}});let w=t=>{e.value===void 0&&(b.value=t),n(`update:value`,t),n(`change`,t),o.onFieldChange()},T=e=>{x.value=!1,n(`blur`,e),o.onFieldBlur()},E=e=>{x.value=!0,n(`focus`,e)};return()=>{let{hasFeedback:t,isFormItemInput:n,feedbackIcon:r}=s,u=e.id??o.id.value,f=Z(Z(Z({},i),e),{id:u,disabled:g.value}),{class:p,bordered:h,readonly:D,style:O,addonBefore:k=a.addonBefore?.call(a),addonAfter:A=a.addonAfter?.call(a),prefix:j=a.prefix?.call(a),valueModifiers:M={}}=f,N=nR(f,[`class`,`bordered`,`readonly`,`style`,`addonBefore`,`addonAfter`,`prefix`,`valueModifiers`]),P=l.value,F=K({[`${P}-lg`]:y.value===`large`,[`${P}-sm`]:y.value===`small`,[`${P}-rtl`]:d.value===`rtl`,[`${P}-readonly`]:D,[`${P}-borderless`]:!h,[`${P}-in-form-item`]:n},Uf(P,c.value),p,m.value,v.value),I=U(ZL,Y(Y({},Br(N,[`size`,`defaultValue`])),{},{ref:S,lazy:!!M.lazy,value:b.value,class:F,prefixCls:P,readonly:D,onChange:w,onBlur:T,onFocus:E}),{upHandler:a.upIcon?()=>U(`span`,{class:`${P}-handler-up-inner`},[a.upIcon()]):()=>U(AL,{class:`${P}-handler-up-inner`},null),downHandler:a.downIcon?()=>U(`span`,{class:`${P}-handler-down-inner`},[a.downIcon()]):()=>U(Cf,{class:`${P}-handler-down-inner`},null)}),L=QL(k)||QL(A),ee=QL(j);if((ee||t)&&(I=U(`div`,{class:K(`${P}-affix-wrapper`,Uf(`${P}-affix-wrapper`,c.value,t),{[`${P}-affix-wrapper-focused`]:x.value,[`${P}-affix-wrapper-disabled`]:g.value,[`${P}-affix-wrapper-sm`]:y.value===`small`,[`${P}-affix-wrapper-lg`]:y.value===`large`,[`${P}-affix-wrapper-rtl`]:d.value===`rtl`,[`${P}-affix-wrapper-readonly`]:D,[`${P}-affix-wrapper-borderless`]:!h,[`${p}`]:!L&&p},v.value),style:O,onClick:C},[ee&&U(`span`,{class:`${P}-prefix`},[j]),I,t&&U(`span`,{class:`${P}-suffix`},[r])])),L){let e=`${P}-group`,n=`${e}-addon`,r=k?U(`div`,{class:n},[k]):null,i=A?U(`div`,{class:n},[A]):null,a=K(`${P}-wrapper`,e,{[`${e}-rtl`]:d.value===`rtl`},v.value);I=U(`div`,{class:K(`${P}-group-wrapper`,{[`${P}-group-wrapper-sm`]:y.value===`small`,[`${P}-group-wrapper-lg`]:y.value===`large`,[`${P}-group-wrapper-rtl`]:d.value===`rtl`},Uf(`${l}-group-wrapper`,c.value,t),p,v.value),style:O},[U(`div`,{class:a},[r&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[r]})]}),I,i&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[i]})]})])])}return _(ao(I,{style:O}))}}}),aR=Z(iR,{install:e=>(e.component(iR.name,iR),e)}),oR=e=>{let{componentCls:t,colorBgContainer:n,colorBgBody:r,colorText:i}=e;return{[`${t}-sider-light`]:{background:n,[`${t}-sider-trigger`]:{color:i,background:n},[`${t}-sider-zero-width-trigger`]:{color:i,background:n,border:`1px solid ${r}`,borderInlineStart:0}}}},sR=e=>{let{antCls:t,componentCls:n,colorText:r,colorTextLightSolid:i,colorBgHeader:a,colorBgBody:o,colorBgTrigger:s,layoutHeaderHeight:c,layoutHeaderPaddingInline:l,layoutHeaderColor:u,layoutFooterPadding:d,layoutTriggerHeight:f,layoutZeroTriggerSize:p,motionDurationMid:m,motionDurationSlow:h,fontSize:g,borderRadius:_}=e;return{[n]:Z(Z({display:`flex`,flex:`auto`,flexDirection:`column`,color:r,minHeight:0,background:o,"&, *":{boxSizing:`border-box`},[`&${n}-has-sider`]:{flexDirection:`row`,[`> ${n}, > ${n}-content`]:{width:0}},[`${n}-header, &${n}-footer`]:{flex:`0 0 auto`},[`${n}-header`]:{height:c,paddingInline:l,color:u,lineHeight:`${c}px`,background:a,[`${t}-menu`]:{lineHeight:`inherit`}},[`${n}-footer`]:{padding:d,color:r,fontSize:g,background:o},[`${n}-content`]:{flex:`auto`,minHeight:0},[`${n}-sider`]:{position:`relative`,minWidth:0,background:a,transition:`all ${m}, background 0s`,"&-children":{height:`100%`,marginTop:-.1,paddingTop:.1,[`${t}-menu${t}-menu-inline-collapsed`]:{width:`auto`}},"&-has-trigger":{paddingBottom:f},"&-right":{order:1},"&-trigger":{position:`fixed`,bottom:0,zIndex:1,height:f,color:i,lineHeight:`${f}px`,textAlign:`center`,background:s,cursor:`pointer`,transition:`all ${m}`},"&-zero-width":{"> *":{overflow:`hidden`},"&-trigger":{position:`absolute`,top:c,insetInlineEnd:-p,zIndex:1,width:p,height:p,color:i,fontSize:e.fontSizeXL,display:`flex`,alignItems:`center`,justifyContent:`center`,background:a,borderStartStartRadius:0,borderStartEndRadius:_,borderEndEndRadius:_,borderEndStartRadius:0,cursor:`pointer`,transition:`background ${h} ease`,"&::after":{position:`absolute`,inset:0,background:`transparent`,transition:`all ${h}`,content:`""`},"&:hover::after":{background:`rgba(255, 255, 255, 0.2)`},"&-right":{insetInlineStart:-p,borderStartStartRadius:_,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:_}}}}},oR(e)),{"&-rtl":{direction:`rtl`}})}},cR=v(`Layout`,e=>{let{colorText:t,controlHeightSM:n,controlHeight:r,controlHeightLG:i,marginXXS:a}=e,o=i*1.25;return[sR(B(e,{layoutHeaderHeight:r*2,layoutHeaderPaddingInline:o,layoutHeaderColor:t,layoutFooterPadding:`${n}px ${o}px`,layoutTriggerHeight:i+a*2,layoutZeroTriggerSize:i}))]},e=>{let{colorBgLayout:t}=e;return{colorBgHeader:`#001529`,colorBgBody:t,colorBgTrigger:`#002140`}}),lR=()=>({prefixCls:String,hasSider:{type:Boolean,default:void 0},tagName:String});function uR(e){let{suffixCls:t,tagName:n,name:r}=e;return e=>u({compatConfig:{MODE:3},name:r,props:lR(),setup(r,i){let{slots:a}=i,{prefixCls:o}=X(t,r);return()=>U(e,Z(Z({},r),{prefixCls:o.value,tagName:n}),a)}})}var dR=u({compatConfig:{MODE:3},props:lR(),setup(e,t){let{slots:n}=t;return()=>U(e.tagName,{class:e.prefixCls},n)}}),fR=u({compatConfig:{MODE:3},inheritAttrs:!1,props:lR(),setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(``,e),[o,s]=cR(i),c=H([]);fe(Ix,{addSider:e=>{c.value=[...c.value,e]},removeSider:e=>{c.value=c.value.filter(t=>t!==e)}});let l=J(()=>{let{prefixCls:t,hasSider:n}=e;return{[s.value]:!0,[`${t}`]:!0,[`${t}-has-sider`]:typeof n==`boolean`?n:c.value.length>0,[`${t}-rtl`]:a.value===`rtl`}});return()=>{let{tagName:t}=e;return o(U(t,Z(Z({},r),{class:[l.value,r.class]}),n))}}}),pR=uR({suffixCls:`layout`,tagName:`section`,name:`ALayout`})(fR),mR=uR({suffixCls:`layout-header`,tagName:`header`,name:`ALayoutHeader`})(dR),hR=uR({suffixCls:`layout-footer`,tagName:`footer`,name:`ALayoutFooter`})(dR),gR=uR({suffixCls:`layout-content`,tagName:`main`,name:`ALayoutContent`})(dR),_R={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z`}}]},name:`bars`,theme:`outlined`};function vR(e){for(var t=1;t({prefixCls:String,collapsible:{type:Boolean,default:void 0},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean,default:void 0},reverseArrow:{type:Boolean,default:void 0},zeroWidthTriggerStyle:{type:Object,default:void 0},trigger:f.any,width:f.oneOfType([f.number,f.string]),collapsedWidth:f.oneOfType([f.number,f.string]),breakpoint:f.oneOf(m(`xs`,`sm`,`md`,`lg`,`xl`,`xxl`,`xxxl`)),theme:f.oneOf(m(`light`,`dark`)).def(`dark`),onBreakpoint:Function,onCollapse:Function}),CR=(()=>{let e=0;return function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return e+=1,`${t}${e}`}})(),wR=u({compatConfig:{MODE:3},name:`ALayoutSider`,inheritAttrs:!1,props:Zn(SR(),{collapsible:!1,defaultCollapsed:!1,reverseArrow:!1,width:200,collapsedWidth:80}),emits:[`breakpoint`,`update:collapsed`,`collapse`],setup(e,t){let{emit:n,attrs:r,slots:i}=t,{prefixCls:a}=X(`layout-sider`,e),o=g(Ix,void 0),s=q(!!(e.collapsed===void 0?e.defaultCollapsed:e.collapsed)),c=q(!1);G(()=>e.collapsed,()=>{s.value=!!e.collapsed}),fe(Fx,s);let l=(t,r)=>{e.collapsed===void 0&&(s.value=t),n(`update:collapsed`,t),n(`collapse`,t,r)},u=q(e=>{c.value=e.matches,n(`breakpoint`,e.matches),s.value!==e.matches&&l(e.matches,`responsive`)}),d;function f(e){return u.value(e)}let p=CR(`ant-sider-`);o&&o.addSider(p),V(()=>{G(()=>e.breakpoint,()=>{try{d?.removeEventListener(`change`,f)}catch{d?.removeListener(f)}if(typeof window<`u`){let{matchMedia:t}=window;if(t&&e.breakpoint&&e.breakpoint in xR){d=t(`(max-width: ${xR[e.breakpoint]})`);try{d.addEventListener(`change`,f)}catch{d.addListener(f)}f(d)}}},{immediate:!0})}),ut(()=>{try{d?.removeEventListener(`change`,f)}catch{d?.removeListener(f)}o&&o.removeSider(p)});let m=()=>{l(!s.value,`clickTrigger`)};return()=>{let t=a.value,{collapsedWidth:n,width:o,reverseArrow:l,zeroWidthTriggerStyle:u,trigger:d=i.trigger?.call(i),collapsible:f,theme:p}=e,h=s.value?n:o,g=Jy(h)?`${h}px`:String(h),_=parseFloat(String(n||0))===0?U(`span`,{onClick:m,class:K(`${t}-zero-width-trigger`,`${t}-zero-width-trigger-${l?`right`:`left`}`),style:u},[d||U(bR,null,null)]):null,v={expanded:U(l?gx:wA,null,null),collapsed:U(l?wA:gx,null,null)}[s.value?`collapsed`:`expanded`],y=d===null?null:_||U(`div`,{class:`${t}-trigger`,onClick:m,style:{width:g}},[d||v]),b=[r.style,{flex:`0 0 ${g}`,maxWidth:g,minWidth:g,width:g}],x=K(t,`${t}-${p}`,{[`${t}-collapsed`]:!!s.value,[`${t}-has-trigger`]:f&&d!==null&&!_,[`${t}-below`]:!!c.value,[`${t}-zero-width`]:parseFloat(g)===0},r.class);return U(`aside`,Y(Y({},r),{},{class:x,style:b}),[U(`div`,{class:`${t}-children`},[i.default?.call(i)]),f||c.value&&_?y:null])}}}),TR=mR,ER=hR,DR=wR,OR=gR,kR=Z(pR,{Header:mR,Footer:hR,Content:gR,Sider:wR,install:e=>(e.component(pR.name,pR),e.component(mR.name,mR),e.component(hR.name,hR),e.component(wR.name,wR),e.component(gR.name,gR),e)});function AR(e,t,n){var r=n||{},i=r.noTrailing,a=i!==void 0&&i,o=r.noLeading,s=o!==void 0&&o,c=r.debounceMode,l=c===void 0?void 0:c,u,d=!1,f=0;function p(){u&&clearTimeout(u)}function m(e){var t=(e||{}).upcomingOnly,n=t!==void 0&&t;p(),d=!n}function h(){var n=[...arguments],r=this,i=Date.now()-f;if(d)return;function o(){f=Date.now(),t.apply(r,n)}function c(){u=void 0}!s&&l&&!u&&o(),p(),l===void 0&&i>e?s?(f=Date.now(),a||(u=setTimeout(l?c:o,e))):o():a!==!0&&(u=setTimeout(l?c:o,l===void 0?e-i:e))}return h.cancel=m,h}function jR(e,t,n){var r=(n||{}).atBegin;return AR(e,t,{debounceMode:(r!==void 0&&r)!==!1})}var MR=new N(`antSpinMove`,{to:{opacity:1}}),NR=new N(`antRotate`,{to:{transform:`rotate(405deg)`}}),PR=e=>({[`${e.componentCls}`]:Z(Z({},rn(e)),{position:`absolute`,display:`none`,color:e.colorPrimary,textAlign:`center`,verticalAlign:`middle`,opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:`static`,display:`inline-block`,opacity:1},"&-nested-loading":{position:`relative`,[`> div > ${e.componentCls}`]:{position:`absolute`,top:0,insetInlineStart:0,zIndex:4,display:`block`,width:`100%`,height:`100%`,maxHeight:e.contentHeight,[`${e.componentCls}-dot`]:{position:`absolute`,top:`50%`,insetInlineStart:`50%`,margin:-e.spinDotSize/2},[`${e.componentCls}-text`]:{position:`absolute`,top:`50%`,width:`100%`,paddingTop:(e.spinDotSize-e.fontSize)/2+2,textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSize/2)-10},"&-sm":{[`${e.componentCls}-dot`]:{margin:-e.spinDotSizeSM/2},[`${e.componentCls}-text`]:{paddingTop:(e.spinDotSizeSM-e.fontSize)/2+2},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSizeSM/2)-10}},"&-lg":{[`${e.componentCls}-dot`]:{margin:-(e.spinDotSizeLG/2)},[`${e.componentCls}-text`]:{paddingTop:(e.spinDotSizeLG-e.fontSize)/2+2},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSizeLG/2)-10}}},[`${e.componentCls}-container`]:{position:`relative`,transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:`100%`,height:`100%`,background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:`""`,pointerEvents:`none`}},[`${e.componentCls}-blur`]:{clear:`both`,opacity:.5,userSelect:`none`,pointerEvents:`none`,"&::after":{opacity:.4,pointerEvents:`auto`}}},"&-tip":{color:e.spinDotDefault},[`${e.componentCls}-dot`]:{position:`relative`,display:`inline-block`,fontSize:e.spinDotSize,width:`1em`,height:`1em`,"&-item":{position:`absolute`,display:`block`,width:(e.spinDotSize-e.marginXXS/2)/2,height:(e.spinDotSize-e.marginXXS/2)/2,backgroundColor:e.colorPrimary,borderRadius:`100%`,transform:`scale(0.75)`,transformOrigin:`50% 50%`,opacity:.3,animationName:MR,animationDuration:`1s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`,animationDirection:`alternate`,"&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:`0.4s`},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:`0.8s`},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:`1.2s`}},"&-spin":{transform:`rotate(45deg)`,animationName:NR,animationDuration:`1.2s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`}},[`&-sm ${e.componentCls}-dot`]:{fontSize:e.spinDotSizeSM,i:{width:(e.spinDotSizeSM-e.marginXXS/2)/2,height:(e.spinDotSizeSM-e.marginXXS/2)/2}},[`&-lg ${e.componentCls}-dot`]:{fontSize:e.spinDotSizeLG,i:{width:(e.spinDotSizeLG-e.marginXXS)/2,height:(e.spinDotSizeLG-e.marginXXS)/2}},[`&${e.componentCls}-show-text ${e.componentCls}-text`]:{display:`block`}})}),FR=v(`Spin`,e=>[PR(B(e,{spinDotDefault:e.colorTextDescription,spinDotSize:e.controlHeightLG/2,spinDotSizeSM:e.controlHeightLG*.35,spinDotSizeLG:e.controlHeight}))],{contentHeight:400}),IR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:f.any,delay:Number,indicator:f.any}),RR=null;function zR(e,t){return!!e&&!!t&&!isNaN(Number(t))}function BR(e){let t=e.indicator;RR=typeof t==`function`?t:()=>U(t,null,null)}var VR=u({compatConfig:{MODE:3},name:`ASpin`,inheritAttrs:!1,props:Zn(LR(),{size:`default`,spinning:!0,wrapperClassName:``}),setup(e,t){let{attrs:n,slots:r}=t,{prefixCls:i,size:a,direction:o}=X(`spin`,e),[s,c]=FR(i),l=q(e.spinning&&!zR(e.spinning,e.delay)),u;return G([()=>e.spinning,()=>e.delay],()=>{u?.cancel(),u=jR(e.delay,()=>{l.value=e.spinning}),u?.()},{immediate:!0,flush:`post`}),ut(()=>{u?.cancel()}),()=>{let{class:t}=n,u=IR(n,[`class`]),{tip:d=r.tip?.call(r)}=e,f=r.default?.call(r),m={[c.value]:!0,[i.value]:!0,[`${i.value}-sm`]:a.value===`small`,[`${i.value}-lg`]:a.value===`large`,[`${i.value}-spinning`]:l.value,[`${i.value}-show-text`]:!!d,[`${i.value}-rtl`]:o.value===`rtl`,[t]:!!t};function h(t){let n=`${t}-dot`,i=on(r,e,`indicator`);return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),p(i)?it(i,{class:n}):RR&&p(RR())?it(RR(),{class:n}):U(`span`,{class:`${n} ${t}-dot-spin`},[U(`i`,{class:`${t}-dot-item`},null),U(`i`,{class:`${t}-dot-item`},null),U(`i`,{class:`${t}-dot-item`},null),U(`i`,{class:`${t}-dot-item`},null)]))}let g=U(`div`,Y(Y({},u),{},{class:m,"aria-live":`polite`,"aria-busy":l.value}),[h(i.value),d?U(`div`,{class:`${i.value}-text`},[d]):null]);if(f&&dt(f).length){let t={[`${i.value}-container`]:!0,[`${i.value}-blur`]:l.value};return s(U(`div`,{class:[`${i.value}-nested-loading`,e.wrapperClassName,c.value]},[l.value&&U(`div`,{key:`loading`},[g]),U(`div`,{class:t,key:`container`},[f])]))}return s(g)}}});VR.setDefaultIndicator=BR,VR.install=function(e){return e.component(VR.name,VR),e};var HR=VR,UR={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z`}}]},name:`double-left`,theme:`outlined`};function WR(e){for(var t=1;tU(yv,Z(Z(Z({},e),{size:`small`}),n),r)}}),QR=u({name:`MiddleSelect`,inheritAttrs:!1,props:_v(),Option:yv.Option,setup(e,t){let{attrs:n,slots:r}=t;return()=>U(yv,Z(Z(Z({},e),{size:`middle`}),n),r)}}),$R=u({compatConfig:{MODE:3},name:`Pager`,inheritAttrs:!1,props:{rootPrefixCls:String,page:Number,active:{type:Boolean,default:void 0},last:{type:Boolean,default:void 0},locale:f.object,showTitle:{type:Boolean,default:void 0},itemRender:{type:Function,default:()=>{}},onClick:{type:Function},onKeypress:{type:Function}},eimt:[`click`,`keypress`],setup(e,t){let{emit:n,attrs:r}=t,i=()=>{n(`click`,e.page)},a=t=>{n(`keypress`,t,i,e.page)};return()=>{let{showTitle:t,page:n,itemRender:o}=e,{class:s,style:c}=r,l=`${e.rootPrefixCls}-item`,u=K(l,`${l}-${e.page}`,{[`${l}-active`]:e.active,[`${l}-disabled`]:!e.page},s);return U(`li`,{onClick:i,onKeypress:a,title:t?String(n):null,tabindex:`0`,class:u,style:c},[o({page:n,type:`page`,originalElement:U(`a`,{rel:`nofollow`},[n])})])}}}),ez={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},tz=u({compatConfig:{MODE:3},props:{disabled:{type:Boolean,default:void 0},changeSize:Function,quickGo:Function,selectComponentClass:f.any,current:Number,pageSizeOptions:f.array.def([`10`,`20`,`50`,`100`]),pageSize:Number,buildOptionText:Function,locale:f.object,rootPrefixCls:String,selectPrefixCls:String,goButton:f.any},setup(e){let t=H(``),n=J(()=>!t.value||isNaN(t.value)?void 0:Number(t.value)),r=t=>`${t.value} ${e.locale.items_per_page}`,i=e=>{let{value:n}=e.target;t.value!==n&&(t.value=n)},a=r=>{let{goButton:i,quickGo:a,rootPrefixCls:o}=e;if(!(i||t.value===``))if(r.relatedTarget&&(r.relatedTarget.className.indexOf(`${o}-item-link`)>=0||r.relatedTarget.className.indexOf(`${o}-item`)>=0)){t.value=``;return}else a(n.value),t.value=``},o=r=>{t.value!==``&&(r.keyCode===ez.ENTER||r.type===`click`)&&(e.quickGo(n.value),t.value=``)},s=J(()=>{let{pageSize:t,pageSizeOptions:n}=e;return n.some(e=>e.toString()===t.toString())?n:n.concat([t.toString()]).sort((e,t)=>(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t)))});return()=>{let{rootPrefixCls:n,locale:c,changeSize:l,quickGo:u,goButton:d,selectComponentClass:f,selectPrefixCls:p,pageSize:m,disabled:h}=e,g=`${n}-options`,_=null,v=null,y=null;if(!l&&!u)return null;if(l&&f){let t=e.buildOptionText||r,n=s.value.map((e,n)=>U(f.Option,{key:n,value:e},{default:()=>[t({value:e})]}));_=U(f,{disabled:h,prefixCls:p,showSearch:!1,class:`${g}-size-changer`,optionLabelProp:`children`,value:(m||s.value[0]).toString(),onChange:e=>l(Number(e)),getPopupContainer:e=>e.parentNode},{default:()=>[n]})}return u&&(d&&(y=typeof d==`boolean`?U(`button`,{type:`button`,onClick:o,onKeyup:o,disabled:h,class:`${g}-quick-jumper-button`},[c.jump_to_confirm]):U(`span`,{onClick:o,onKeyup:o},[d])),v=U(`div`,{class:`${g}-quick-jumper`},[c.jump_to,U(Pu,{disabled:h,type:`text`,value:t.value,onInput:i,onChange:i,onKeyup:o,onBlur:a},null),c.page,y])),U(`li`,{class:`${g}`},[_,v])}}}),nz={items_per_page:`条/页`,jump_to:`跳至`,jump_to_confirm:`确定`,page:`页`,prev_page:`上一页`,next_page:`下一页`,prev_5:`向前 5 页`,next_5:`向后 5 页`,prev_3:`向前 3 页`,next_3:`向后 3 页`},rz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ir?r:n,E(this,`current`)||(t.stateCurrent=n,t.stateCurrentInputValue=n),t.statePageSize=e,this.setState(t)},stateCurrent(e,t){this.$nextTick(()=>{if(this.$refs.paginationNode){let e=this.$refs.paginationNode.querySelector(`.${this.prefixCls}-item-${t}`);e&&document.activeElement===e&&e.blur()}})},total(){let e={},t=oz(this.pageSize,this.$data,this.$props);if(E(this,`current`)){let n=Math.min(this.current,t);e.stateCurrent=n,e.stateCurrentInputValue=n}else{let n=this.stateCurrent;n=n===0&&t>0?1:Math.min(this.stateCurrent,t),e.stateCurrent=n}this.setState(e)}},methods:{getJumpPrevPage(){return Math.max(1,this.stateCurrent-(this.showLessItems?3:5))},getJumpNextPage(){return Math.min(oz(void 0,this.$data,this.$props),this.stateCurrent+(this.showLessItems?3:5))},getItemIcon(e,t){let{prefixCls:n}=this.$props;return k(this,e,this.$props)||U(`button`,{type:`button`,"aria-label":t,class:`${n}-item-link`},null)},getValidValue(e){let t=e.target.value,n=oz(void 0,this.$data,this.$props),{stateCurrentInputValue:r}=this.$data,i;return i=t===``?t:isNaN(Number(t))?r:t>=n?n:Number(t),i},isValid(e){return iz(e)&&e!==this.stateCurrent},shouldDisplayQuickJumper(){let{showQuickJumper:e,pageSize:t,total:n}=this.$props;return n<=t?!1:e},handleKeyDown(e){(e.keyCode===ez.ARROW_UP||e.keyCode===ez.ARROW_DOWN)&&e.preventDefault()},handleKeyUp(e){let t=this.getValidValue(e);t!==this.stateCurrentInputValue&&this.setState({stateCurrentInputValue:t}),e.keyCode===ez.ENTER?this.handleChange(t):e.keyCode===ez.ARROW_UP?this.handleChange(t-1):e.keyCode===ez.ARROW_DOWN&&this.handleChange(t+1)},changePageSize(e){let t=this.stateCurrent,n=t,r=oz(e,this.$data,this.$props);t=t>r?r:t,r===0&&(t=this.stateCurrent),typeof e==`number`&&(E(this,`pageSize`)||this.setState({statePageSize:e}),E(this,`current`)||this.setState({stateCurrent:t,stateCurrentInputValue:t})),this.__emit(`update:pageSize`,e),t!==n&&this.__emit(`update:current`,t),this.__emit(`showSizeChange`,t,e),this.__emit(`change`,t,e)},handleChange(e){let{disabled:t}=this.$props,n=e;if(this.isValid(n)&&!t){let e=oz(void 0,this.$data,this.$props);return n>e?n=e:n<1&&(n=1),E(this,`current`)||this.setState({stateCurrent:n,stateCurrentInputValue:n}),this.__emit(`update:current`,n),this.__emit(`change`,n,this.statePageSize),n}return this.stateCurrent},prev(){this.hasPrev()&&this.handleChange(this.stateCurrent-1)},next(){this.hasNext()&&this.handleChange(this.stateCurrent+1)},jumpPrev(){this.handleChange(this.getJumpPrevPage())},jumpNext(){this.handleChange(this.getJumpNextPage())},hasPrev(){return this.stateCurrent>1},hasNext(){return this.stateCurrentn:e},runIfEnter(e,t){(e.key===`Enter`||e.charCode===13)&&(e.preventDefault(),t(...[...arguments].slice(2)))},runIfEnterPrev(e){this.runIfEnter(e,this.prev)},runIfEnterNext(e){this.runIfEnter(e,this.next)},runIfEnterJumpPrev(e){this.runIfEnter(e,this.jumpPrev)},runIfEnterJumpNext(e){this.runIfEnter(e,this.jumpNext)},handleGoTO(e){(e.keyCode===ez.ENTER||e.type===`click`)&&this.handleChange(this.stateCurrentInputValue)},renderPrev(e){let{itemRender:t}=this.$props,n=t({page:e,type:`prev`,originalElement:this.getItemIcon(`prevIcon`,`prev page`)}),r=!this.hasPrev();return Nt(n)?ao(n,r?{disabled:r}:{}):n},renderNext(e){let{itemRender:t}=this.$props,n=t({page:e,type:`next`,originalElement:this.getItemIcon(`nextIcon`,`next page`)}),r=!this.hasNext();return Nt(n)?ao(n,r?{disabled:r}:{}):n}},render(){let{prefixCls:e,disabled:t,hideOnSinglePage:n,total:r,locale:i,showQuickJumper:a,showLessItems:o,showTitle:s,showTotal:c,simple:l,itemRender:u,showPrevNextJumpers:d,jumpPrevIcon:f,jumpNextIcon:p,selectComponentClass:m,selectPrefixCls:h,pageSizeOptions:g}=this.$props,{stateCurrent:_,statePageSize:v}=this,y=je(this.$attrs).extraAttrs,{class:b}=y,x=rz(y,[`class`]);if(n===!0&&this.total<=v)return null;let S=oz(void 0,this.$data,this.$props),C=[],w=null,T=null,E=null,D=null,O=null,k=a&&a.goButton,A=o?1:2,j=_-1>0?_-1:0,M=_+1=A*2&&_!==3&&(C[0]=U($R,{locale:i,rootPrefixCls:e,onClick:this.handleChange,onKeypress:this.runIfEnter,key:r,page:r,class:`${e}-item-after-jump-prev`,active:!1,showTitle:this.showTitle,itemRender:u},null),C.unshift(w)),S-_>=A*2&&_!==S-2&&(C[C.length-1]=U($R,{locale:i,rootPrefixCls:e,onClick:this.handleChange,onKeypress:this.runIfEnter,key:a,page:a,class:`${e}-item-before-jump-next`,active:!1,showTitle:this.showTitle,itemRender:u},null),C.push(T)),r!==1&&C.unshift(E),a!==S&&C.push(D)}let F=null;c&&(F=U(`li`,{class:`${e}-total-text`},[c(r,[r===0?0:(_-1)*v+1,_*v>r?r:_*v])]));let I=!N||!S,L=!P||!S,ee=this.buildOptionText||this.$slots.buildOptionText;return U(`ul`,Y(Y({unselectable:`on`,ref:`paginationNode`},x),{},{class:K({[`${e}`]:!0,[`${e}-disabled`]:t},b)}),[F,U(`li`,{title:s?i.prev_page:null,onClick:this.prev,tabindex:I?null:0,onKeypress:this.runIfEnterPrev,class:K(`${e}-prev`,{[`${e}-disabled`]:I}),"aria-disabled":I},[this.renderPrev(j)]),C,U(`li`,{title:s?i.next_page:null,onClick:this.next,tabindex:L?null:0,onKeypress:this.runIfEnterNext,class:K(`${e}-next`,{[`${e}-disabled`]:L}),"aria-disabled":L},[this.renderNext(M)]),U(tz,{disabled:t,locale:i,rootPrefixCls:e,selectComponentClass:m,selectPrefixCls:h,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:_,pageSize:v,pageSizeOptions:g,buildOptionText:ee||null,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:k},null)])}}),cz=e=>{let{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:`not-allowed`,[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:`not-allowed`}},"&:focus-visible":{cursor:`not-allowed`,[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:`not-allowed`}}},[`&${t}-disabled`]:{cursor:`not-allowed`,[`&${t}-mini`]:{[` + &:hover ${t}-item:not(${t}-item-active), + &:active ${t}-item:not(${t}-item-active), + &:hover ${t}-item-link, + &:active ${t}-item-link + `]:{backgroundColor:`transparent`}},[`${t}-item`]:{cursor:`not-allowed`,"&:hover, &:active":{backgroundColor:`transparent`},a:{color:e.colorTextDisabled,backgroundColor:`transparent`,border:`none`,cursor:`not-allowed`},"&-active":{borderColor:e.colorBorder,backgroundColor:e.paginationItemDisabledBgActive,"&:hover, &:active":{backgroundColor:e.paginationItemDisabledBgActive},a:{color:e.paginationItemDisabledColorActive}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:`not-allowed`,"&:hover, &:active":{backgroundColor:`transparent`},[`${t}-simple&`]:{backgroundColor:`transparent`,"&:hover, &:active":{backgroundColor:`transparent`}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}},[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{[`&${t}-disabled ${t}-item-link`]:{"&:hover, &:active":{backgroundColor:`transparent`}}}}}},lz=e=>{let{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`},[`&${t}-mini ${t}-item`]:{minWidth:e.paginationItemSizeSM,height:e.paginationItemSizeSM,margin:0,lineHeight:`${e.paginationItemSizeSM-2}px`},[`&${t}-mini ${t}-item:not(${t}-item-active)`]:{backgroundColor:`transparent`,borderColor:`transparent`,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.paginationItemSizeSM,height:e.paginationItemSizeSM,margin:0,lineHeight:`${e.paginationItemSizeSM}px`,[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:`transparent`}},[` + &${t}-mini ${t}-prev ${t}-item-link, + &${t}-mini ${t}-next ${t}-item-link + `]:{backgroundColor:`transparent`,borderColor:`transparent`,"&::after":{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.paginationItemSizeSM,marginInlineEnd:0,lineHeight:`${e.paginationItemSizeSM}px`},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.paginationMiniOptionsSizeChangerTop},"&-quick-jumper":{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`,input:Z(Z({},RT(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},uz=e=>{let{componentCls:t}=e;return{[` + &${t}-simple ${t}-prev, + &${t}-simple ${t}-next + `]:{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`,verticalAlign:`top`,[`${t}-item-link`]:{height:e.paginationItemSizeSM,backgroundColor:`transparent`,border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`}}},[`&${t}-simple ${t}-simple-pager`]:{display:`inline-block`,height:e.paginationItemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:`border-box`,height:`100%`,marginInlineEnd:e.marginXS,padding:`0 ${e.paginationItemPaddingInline}px`,textAlign:`center`,backgroundColor:e.paginationItemInputBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:`none`,transition:`border-color ${e.motionDurationMid}`,color:`inherit`,"&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${e.inputOutlineOffset}px 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:`not-allowed`}}}}},dz=e=>{let{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:`relative`,[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:`auto`}},[`${t}-item-ellipsis`]:{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:`block`,margin:`auto`,color:e.colorTextDisabled,fontFamily:`Arial, Helvetica, sans-serif`,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:`center`,textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},"&:focus-visible":Z({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},I(e))},[` + ${t}-prev, + ${t}-jump-prev, + ${t}-jump-next + `]:{marginInlineEnd:e.marginXS},[` + ${t}-prev, + ${t}-next, + ${t}-jump-prev, + ${t}-jump-next + `]:{display:`inline-block`,minWidth:e.paginationItemSize,height:e.paginationItemSize,color:e.colorText,fontFamily:e.paginationFontFamily,lineHeight:`${e.paginationItemSize}px`,textAlign:`center`,verticalAlign:`middle`,listStyle:`none`,borderRadius:e.borderRadius,cursor:`pointer`,transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{fontFamily:`Arial, Helvetica, sans-serif`,outline:0,button:{color:e.colorText,cursor:`pointer`,userSelect:`none`},[`${t}-item-link`]:{display:`block`,width:`100%`,height:`100%`,padding:0,fontSize:e.fontSizeSM,textAlign:`center`,backgroundColor:`transparent`,border:`${e.lineWidth}px ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:`none`,transition:`all ${e.motionDurationMid}`},[`&:focus-visible ${t}-item-link`]:Z({},I(e)),[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:`transparent`}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:`inline-block`,marginInlineStart:e.margin,verticalAlign:`middle`,"&-size-changer.-select":{display:`inline-block`,width:`auto`},"&-quick-jumper":{display:`inline-block`,height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:`${e.controlHeight}px`,verticalAlign:`top`,input:Z(Z({},BT(e)),{width:e.controlHeightLG*1.25,height:e.controlHeight,boxSizing:`border-box`,margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},fz=e=>{let{componentCls:t}=e;return{[`${t}-item`]:Z(Z({display:`inline-block`,minWidth:e.paginationItemSize,height:e.paginationItemSize,marginInlineEnd:e.marginXS,fontFamily:e.paginationFontFamily,lineHeight:`${e.paginationItemSize-2}px`,textAlign:`center`,verticalAlign:`middle`,listStyle:`none`,backgroundColor:`transparent`,border:`${e.lineWidth}px ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:`pointer`,userSelect:`none`,a:{display:`block`,padding:`0 ${e.paginationItemPaddingInline}px`,color:e.colorText,transition:`none`,"&:hover":{textDecoration:`none`}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}}},de(e)),{"&-active":{fontWeight:e.paginationFontWeightActive,backgroundColor:e.paginationItemBgActive,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}})}},pz=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z(Z(Z(Z({},rn(e)),{"ul, ol":{margin:0,padding:0,listStyle:`none`},"&::after":{display:`block`,clear:`both`,height:0,overflow:`hidden`,visibility:`hidden`,content:`""`},[`${t}-total-text`]:{display:`inline-block`,height:e.paginationItemSize,marginInlineEnd:e.marginXS,lineHeight:`${e.paginationItemSize-2}px`,verticalAlign:`middle`}}),fz(e)),dz(e)),uz(e)),lz(e)),cz(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:`none`}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:`none`}}}),[`&${e.componentCls}-rtl`]:{direction:`rtl`}}},mz=e=>{let{componentCls:t}=e;return{[`${t}${t}-disabled`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.paginationItemDisabledBgActive}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[t]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.paginationItemBg},[`${t}-item-link`]:{backgroundColor:e.paginationItemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.paginationItemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.paginationItemBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.paginationItemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}},hz=v(`Pagination`,e=>{let t=B(e,{paginationItemSize:e.controlHeight,paginationFontFamily:e.fontFamily,paginationItemBg:e.colorBgContainer,paginationItemBgActive:e.colorBgContainer,paginationFontWeightActive:e.fontWeightStrong,paginationItemSizeSM:e.controlHeightSM,paginationItemInputBg:e.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:e.controlItemBgActiveDisabled,paginationItemDisabledColorActive:e.colorTextDisabled,paginationItemLinkBg:e.colorBgContainer,inputOutlineOffset:`0 0`,paginationMiniOptionsMarginInlineStart:e.marginXXS/2,paginationMiniQuickJumperInputWidth:e.controlHeightLG*1.1,paginationItemPaddingInline:e.marginXXS*1.5,paginationEllipsisLetterSpacing:e.marginXXS/2,paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:`0.13em`},qT(e));return[pz(t),e.wireframe&&mz(t)]}),gz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ia.getPrefixCls(`select`,e.selectPrefixCls)),d=Uv(),[f]=Kt(`Pagination`,yt,St(e,`locale`)),p=e=>{let t=U(`span`,{class:`${e}-item-ellipsis`},[en(`•••`)]);return{prevIcon:U(`button`,{class:`${e}-item-link`,type:`button`,tabindex:-1},[o.value===`rtl`?U(gx,null,null):U(wA,null,null)]),nextIcon:U(`button`,{class:`${e}-item-link`,type:`button`,tabindex:-1},[o.value===`rtl`?U(wA,null,null):U(gx,null,null)]),jumpPrevIcon:U(`a`,{rel:`nofollow`,class:`${e}-item-link`},[U(`div`,{class:`${e}-item-container`},[o.value===`rtl`?U(XR,{class:`${e}-item-link-icon`},null):U(KR,{class:`${e}-item-link-icon`},null),t])]),jumpNextIcon:U(`a`,{rel:`nofollow`,class:`${e}-item-link`},[U(`div`,{class:`${e}-item-container`},[o.value===`rtl`?U(KR,{class:`${e}-item-link-icon`},null):U(XR,{class:`${e}-item-link-icon`},null),t])])}};return()=>{let{itemRender:t=n.itemRender,buildOptionText:a=n.buildOptionText,selectComponentClass:m,responsive:h}=e,g=gz(e,[`itemRender`,`buildOptionText`,`selectComponentClass`,`responsive`]),_=s.value===`small`||!!(d.value?.xs&&!s.value&&h),v=Z(Z(Z(Z(Z({},g),p(i.value)),{prefixCls:i.value,selectPrefixCls:u.value,selectComponentClass:m||(_?ZR:QR),locale:f.value,buildOptionText:a}),r),{class:K({[`${i.value}-mini`]:_,[`${i.value}-rtl`]:o.value===`rtl`},r.class,l.value),itemRender:t});return c(U(sz,v,null))}}})),vz=u({compatConfig:{MODE:3},name:`AListItemMeta`,props:{avatar:f.any,description:f.any,prefixCls:String,title:f.any},displayName:`AListItemMeta`,__ANT_LIST_ITEM_META:!0,slots:Object,setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`list`,e);return()=>{let t=`${r.value}-item-meta`,i=e.title??n.title?.call(n),a=e.description??n.description?.call(n),o=e.avatar??n.avatar?.call(n),s=U(`div`,{class:`${r.value}-item-meta-content`},[i&&U(`h4`,{class:`${r.value}-item-meta-title`},[i]),a&&U(`div`,{class:`${r.value}-item-meta-description`},[a])]);return U(`div`,{class:t},[o&&U(`div`,{class:`${r.value}-item-meta-avatar`},[o]),(i||a)&&s])}}}),yz=Symbol(`ListContextKey`),bz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let e=n.default?.call(n)||[],t;return e.forEach(e=>{F(e)&&!Te(e)&&(t=!0)}),t&&e.length>1},c=()=>{let t=e.extra??n.extra?.call(n);return i.value===`vertical`?!!t:!s()};return()=>{let{class:t}=r,s=bz(r,[`class`]),l=o.value,u=e.extra??n.extra?.call(n),d=n.default?.call(n),f=e.actions??ce(n.actions?.call(n));f=f&&!Array.isArray(f)?[f]:f;let p=f&&f.length>0&&U(`ul`,{class:`${l}-item-action`,key:`actions`},[f.map((e,t)=>U(`li`,{key:`${l}-item-action-${t}`},[e,t!==f.length-1&&U(`em`,{class:`${l}-item-action-split`},null)]))]),m=U(a.value?`div`:`li`,Y(Y({},s),{},{class:K(`${l}-item`,{[`${l}-item-no-flex`]:!c()},t)}),{default:()=>[i.value===`vertical`&&u?[U(`div`,{class:`${l}-item-main`,key:`content`},[d,p]),U(`div`,{class:`${l}-item-extra`,key:`extra`},[u])]:[d,p,ao(u,{key:`extra`})]]});return a.value?U(vM,{flex:1,style:e.colStyle},{default:()=>[m]}):m}}}),Sz=e=>{let{listBorderedCls:t,componentCls:n,paddingLG:r,margin:i,padding:a,listItemPaddingSM:o,marginLG:s,borderRadiusLG:c}=e;return{[`${t}`]:{border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:c,[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:r},[`${n}-pagination`]:{margin:`${i}px ${s}px`}},[`${t}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:o}},[`${t}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:`${a}px ${r}px`}}}},Cz=e=>{let{componentCls:t,screenSM:n,screenMD:r,marginLG:i,marginSM:a,margin:o}=e;return{[`@media screen and (max-width:${r})`]:{[`${t}`]:{[`${t}-item`]:{[`${t}-item-action`]:{marginInlineStart:i}}},[`${t}-vertical`]:{[`${t}-item`]:{[`${t}-item-extra`]:{marginInlineStart:i}}}},[`@media screen and (max-width: ${n})`]:{[`${t}`]:{[`${t}-item`]:{flexWrap:`wrap`,[`${t}-action`]:{marginInlineStart:a}}},[`${t}-vertical`]:{[`${t}-item`]:{flexWrap:`wrap-reverse`,[`${t}-item-main`]:{minWidth:e.contentWidth},[`${t}-item-extra`]:{margin:`auto auto ${o}px`}}}}}},wz=e=>{let{componentCls:t,antCls:n,controlHeight:r,minHeight:i,paddingSM:a,marginLG:o,padding:s,listItemPadding:c,colorPrimary:l,listItemPaddingSM:u,listItemPaddingLG:d,paddingXS:f,margin:p,colorText:m,colorTextDescription:h,motionDurationSlow:g,lineWidth:_}=e;return{[`${t}`]:Z(Z({},rn(e)),{position:`relative`,"*":{outline:`none`},[`${t}-header, ${t}-footer`]:{background:`transparent`,paddingBlock:a},[`${t}-pagination`]:{marginBlockStart:o,textAlign:`end`,[`${n}-pagination-options`]:{textAlign:`start`}},[`${t}-spin`]:{minHeight:i,textAlign:`center`},[`${t}-items`]:{margin:0,padding:0,listStyle:`none`},[`${t}-item`]:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:c,color:m,[`${t}-item-meta`]:{display:`flex`,flex:1,alignItems:`flex-start`,maxWidth:`100%`,[`${t}-item-meta-avatar`]:{marginInlineEnd:s},[`${t}-item-meta-content`]:{flex:`1 0`,width:0,color:m},[`${t}-item-meta-title`]:{marginBottom:e.marginXXS,color:m,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:m,transition:`all ${g}`,"&:hover":{color:l}}},[`${t}-item-meta-description`]:{color:h,fontSize:e.fontSize,lineHeight:e.lineHeight}},[`${t}-item-action`]:{flex:`0 0 auto`,marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:`none`,"& > li":{position:`relative`,display:`inline-block`,padding:`0 ${f}px`,color:h,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:`center`,"&:first-child":{paddingInlineStart:0}},[`${t}-item-action-split`]:{position:`absolute`,insetBlockStart:`50%`,insetInlineEnd:0,width:_,height:Math.ceil(e.fontSize*e.lineHeight)-e.marginXXS*2,transform:`translateY(-50%)`,backgroundColor:e.colorSplit}}},[`${t}-empty`]:{padding:`${s}px 0`,color:h,fontSize:e.fontSizeSM,textAlign:`center`},[`${t}-empty-text`]:{padding:s,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:`center`},[`${t}-item-no-flex`]:{display:`block`}}),[`${t}-grid ${n}-col > ${t}-item`]:{display:`block`,maxWidth:`100%`,marginBlockEnd:p,paddingBlock:0,borderBlockEnd:`none`},[`${t}-vertical ${t}-item`]:{alignItems:`initial`,[`${t}-item-main`]:{display:`block`,flex:1},[`${t}-item-extra`]:{marginInlineStart:o},[`${t}-item-meta`]:{marginBlockEnd:s,[`${t}-item-meta-title`]:{marginBlockEnd:a,color:m,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${t}-item-action`]:{marginBlockStart:s,marginInlineStart:`auto`,"> li":{padding:`0 ${s}px`,"&:first-child":{paddingInlineStart:0}}}},[`${t}-split ${t}-item`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:`none`}},[`${t}-split ${t}-header`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-split${t}-empty ${t}-footer`]:{borderTop:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-loading ${t}-spin-nested-loading`]:{minHeight:r},[`${t}-split${t}-something-after-last-item ${n}-spin-container > ${t}-items > ${t}-item:last-child`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-lg ${t}-item`]:{padding:d},[`${t}-sm ${t}-item`]:{padding:u},[`${t}:not(${t}-vertical)`]:{[`${t}-item-no-flex`]:{[`${t}-item-action`]:{float:`right`}}}}},Tz=v(`List`,e=>{let t=B(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG,listItemPadding:`${e.paddingContentVertical}px ${e.paddingContentHorizontalLG}px`,listItemPaddingSM:`${e.paddingContentVerticalSM}px ${e.paddingContentHorizontal}px`,listItemPaddingLG:`${e.paddingContentVerticalLG}px ${e.paddingContentHorizontalLG}px`});return[wz(t),Sz(t),Cz(t)]},{contentWidth:220}),Ez=u({compatConfig:{MODE:3},name:`AList`,inheritAttrs:!1,Item:xz,props:Zn({bordered:Q(),dataSource:Ue(),extra:pt(),grid:Qt(),itemLayout:String,loading:W([Boolean,Object]),loadMore:pt(),pagination:W([Boolean,Object]),prefixCls:String,rowKey:W([String,Number,Function]),renderItem:d(),size:String,split:Q(),header:pt(),footer:pt(),locale:Qt()},{dataSource:[],bordered:!1,split:!0,loading:!1,pagination:!1}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t;fe(yz,{grid:St(e,`grid`),itemLayout:St(e,`itemLayout`)});let i={current:1,total:0},{prefixCls:a,direction:o,renderEmpty:s}=X(`list`,e),[c,l]=Tz(a),u=J(()=>e.pagination&&typeof e.pagination==`object`?e.pagination:{}),d=H(u.value.defaultCurrent??1),f=H(u.value.defaultPageSize??10);G(u,()=>{`current`in u.value&&(d.value=u.value.current),`pageSize`in u.value&&(f.value=u.value.pageSize)});let p=[],m=e=>(t,n)=>{d.value=t,f.value=n,u.value[e]&&u.value[e](t,n)},h=m(`onChange`),g=m(`onShowSizeChange`),_=J(()=>typeof e.loading==`boolean`?{spinning:e.loading}:e.loading),v=J(()=>_.value&&_.value.spinning),y=J(()=>{let t=``;switch(e.size){case`large`:t=`lg`;break;case`small`:t=`sm`;break;default:break}return t}),b=J(()=>({[`${a.value}`]:!0,[`${a.value}-vertical`]:e.itemLayout===`vertical`,[`${a.value}-${y.value}`]:y.value,[`${a.value}-split`]:e.split,[`${a.value}-bordered`]:e.bordered,[`${a.value}-loading`]:v.value,[`${a.value}-grid`]:!!e.grid,[`${a.value}-rtl`]:o.value===`rtl`})),x=J(()=>{let t=Z(Z(Z({},i),{total:e.dataSource.length,current:d.value,pageSize:f.value}),e.pagination||{}),n=Math.ceil(t.total/t.pageSize);return t.current>n&&(t.current=n),t}),S=J(()=>{let t=[...e.dataSource];return e.pagination&&e.dataSource.length>(x.value.current-1)*x.value.pageSize&&(t=[...e.dataSource].splice((x.value.current-1)*x.value.pageSize,x.value.pageSize)),t}),C=Uv(),w=Wv(()=>{for(let e=0;e{if(!e.grid)return;let t=w.value&&e.grid[w.value]?e.grid[w.value]:e.grid.column;if(t)return{width:`${100/t}%`,maxWidth:`${100/t}%`}}),E=(t,r)=>{let i=e.renderItem??n.renderItem;if(!i)return null;let a,o=typeof e.rowKey;return a=o===`function`?e.rowKey(t):o===`string`||o===`number`?t[e.rowKey]:t.key,a||=`list-item-${r}`,p[r]=a,i({item:t,index:r})};return()=>{let t=e.loadMore??n.loadMore?.call(n),i=e.footer??n.footer?.call(n),o=e.header??n.header?.call(n),u=ce(n.default?.call(n)),d=!!(t||e.pagination||i),f=K(Z(Z({},b.value),{[`${a.value}-something-after-last-item`]:d}),r.class,l.value),m=e.pagination?U(`div`,{class:`${a.value}-pagination`},[U(_z,Y(Y({},x.value),{},{onChange:h,onShowSizeChange:g}),null)]):null,y=v.value&&U(`div`,{style:{minHeight:`53px`}},null);if(S.value.length>0){p.length=0;let t=S.value.map((e,t)=>E(e,t)),n=t.map((e,t)=>U(`div`,{key:p[t],style:T.value},[e]));y=e.grid?U(HA,{gutter:e.grid.gutter},{default:()=>[n]}):U(`ul`,{class:`${a.value}-items`},[t])}else!u.length&&!v.value&&(y=U(`div`,{class:`${a.value}-empty-text`},[e.locale?.emptyText||s(`List`)]));let C=x.value.position||`bottom`;return c(U(`div`,Y(Y({},r),{},{class:f}),[(C===`top`||C===`both`)&&m,o&&U(`div`,{class:`${a.value}-header`},[o]),U(HR,_.value,{default:()=>[y,u]}),i&&U(`div`,{class:`${a.value}-footer`},[i]),t||(C===`bottom`||C===`both`)&&m]))}}});Ez.install=function(e){return e.component(Ez.name,Ez),e.component(Ez.Item.name,Ez.Item),e.component(Ez.Item.Meta.name,Ez.Item.Meta),e};function Dz(e){let{selectionStart:t}=e;return e.value.slice(0,t)}function Oz(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;return(Array.isArray(t)?t:[t]).reduce((t,n)=>{let r=e.lastIndexOf(n);return r>t.location?{location:r,prefix:n}:t},{location:-1,prefix:``})}function kz(e){return(e||``).toLowerCase()}function Az(e,t,n){let r=e[0];if(!r||r===n)return e;let i=e,a=t.length;for(let e=0;e[]}},setup(e,t){let{slots:n}=t,{activeIndex:r,setActiveIndex:i,selectOption:a,onFocus:o=Iz,loading:s}=g(Fz,{activeIndex:q(),loading:q(!1)}),c,l=e=>{clearTimeout(c),c=setTimeout(()=>{o(e)})};return ut(()=>{clearTimeout(c)}),()=>{let{prefixCls:t,options:o}=e,c=o[r.value]||{};return U(wS,{prefixCls:`${t}-menu`,activeKey:c.value,onSelect:e=>{let{key:t}=e,n=o.find(e=>{let{value:n}=e;return n===t});a(n)},onMousedown:l},{default:()=>[!s.value&&o.map((e,t)=>{let{value:r,disabled:a,label:o=e.value,class:s,style:c}=e;return U(Kx,{key:r,disabled:a,onMouseenter:()=>{i(t)},class:s,style:c},{default:()=>[n.option?.call(n,e)??(typeof o==`function`?o(e):o)]})}),!s.value&&o.length===0?U(Kx,{key:`notFoundContent`,disabled:!0},{default:()=>[n.notFoundContent?.call(n)]}):null,s.value&&U(Kx,{key:`loading`,disabled:!0},{default:()=>[U(HR,{size:`small`},null)]})]})}}}),Rz={bottomRight:{points:[`tl`,`br`],offset:[0,4],overflow:{adjustX:0,adjustY:1}},bottomLeft:{points:[`tr`,`bl`],offset:[0,4],overflow:{adjustX:0,adjustY:1}},topRight:{points:[`bl`,`tr`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topLeft:{points:[`br`,`tl`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}},zz=u({compatConfig:{MODE:3},name:`KeywordTrigger`,props:{loading:{type:Boolean,default:void 0},options:{type:Array,default:()=>[]},prefixCls:String,placement:String,visible:{type:Boolean,default:void 0},transitionName:String,getPopupContainer:Function,direction:String,dropdownClassName:String},setup(e,t){let{slots:n}=t,r=()=>`${e.prefixCls}-dropdown`,i=()=>{let{options:t}=e;return U(Lz,{prefixCls:r(),options:t},{notFoundContent:n.notFoundContent,option:n.option})},a=J(()=>{let{placement:t,direction:n}=e,r=`topRight`;return r=n===`rtl`?t===`top`?`topLeft`:`bottomLeft`:t===`top`?`topRight`:`bottomRight`,r});return()=>{let{visible:t,transitionName:o,getPopupContainer:s}=e;return U(Su,{prefixCls:r(),popupVisible:t,popup:i(),popupClassName:e.dropdownClassName,popupPlacement:a.value,popupTransitionName:o,builtinPlacements:Rz,getPopupContainer:s},{default:n.default})}}}),Bz=m(`top`,`bottom`),Vz={autofocus:{type:Boolean,default:void 0},prefix:f.oneOfType([f.string,f.arrayOf(f.string)]),prefixCls:String,value:String,disabled:{type:Boolean,default:void 0},split:String,transitionName:String,placement:f.oneOf(Bz),character:f.any,characterRender:Function,filterOption:{type:[Boolean,Function]},validateSearch:Function,getPopupContainer:{type:Function},options:Ue(),loading:{type:Boolean,default:void 0},rows:[Number,String],direction:{type:String}},Hz=Z(Z({},Vz),{dropdownClassName:String}),Uz={prefix:`@`,split:` `,rows:1,validateSearch:Nz,filterOption:()=>Pz};Zn(Hz,Uz);var Wz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{l.value=e.value});let u=e=>{n(`change`,e)},d=e=>{let{target:{value:t}}=e;u(t)},f=(e,t,n)=>{Z(l,{measuring:!0,measureText:e,measurePrefix:t,measureLocation:n,activeIndex:0})},p=e=>{Z(l,{measuring:!1,measureLocation:0,measureText:null}),e?.()},m=e=>{let{which:t}=e;if(l.measuring){if(t===$.UP||t===$.DOWN){let n=T.value.length,r=t===$.UP?-1:1,i=(l.activeIndex+r+n)%n;l.activeIndex=i,e.preventDefault()}else if(t===$.ESC)p();else if(t===$.ENTER){if(e.preventDefault(),!T.value.length){p();return}let t=T.value[l.activeIndex];x(t)}}},h=t=>{let{key:r,which:i}=t,{measureText:a,measuring:o}=l,{prefix:s,validateSearch:c}=e,u=t.target;if(u.composing)return;let d=Dz(u),{location:m,prefix:h}=Oz(d,s);if([$.ESC,$.UP,$.DOWN,$.ENTER].indexOf(i)===-1)if(m!==-1){let t=d.slice(m+h.length),i=c(t,e),s=!!w(t).length;i?(r===h||r===`Shift`||o||t!==a&&s)&&f(t,h,m):o&&p(),i&&n(`search`,t,h)}else o&&p()},g=e=>{l.measuring||n(`pressenter`,e)},_=e=>{y(e)},v=e=>{b(e)},y=e=>{clearTimeout(c.value);let{isFocus:t}=l;!t&&e&&n(`focus`,e),l.isFocus=!0},b=e=>{c.value=setTimeout(()=>{l.isFocus=!1,p(),n(`blur`,e)},100)},x=t=>{let{split:r}=e,{value:i=``}=t,{text:a,selectionLocation:o}=jz(l.value,{measureLocation:l.measureLocation,targetText:i,prefix:l.measurePrefix,selectionStart:s.value.getSelectionStart(),split:r});u(a),p(()=>{Mz(s.value.input,o)}),n(`select`,t,l.measurePrefix)},C=e=>{l.activeIndex=e},w=t=>{let n=t||l.measureText||``,{filterOption:r}=e;return e.options.filter(e=>!r||r(n,e))},T=J(()=>w());return i({blur:()=>{s.value.blur()},focus:()=>{s.value.focus()}}),fe(Fz,{activeIndex:St(l,`activeIndex`),setActiveIndex:C,selectOption:x,onFocus:y,onBlur:b,loading:St(e,`loading`)}),O(()=>{z(()=>{l.measuring&&(o.value.scrollTop=s.value.getScrollTop())})}),()=>{let{measureLocation:t,measurePrefix:n,measuring:i}=l,{prefixCls:c,placement:u,transitionName:f,getPopupContainer:p,direction:y}=e,b=Wz(e,[`prefixCls`,`placement`,`transitionName`,`getPopupContainer`,`direction`]),{class:x,style:S}=r,C=Wz(r,[`class`,`style`]),w=Z(Z(Z({},Br(b,[`value`,`prefix`,`split`,`validateSearch`,`filterOption`,`options`,`loading`])),C),{onChange:Gz,onSelect:Gz,value:l.value,onInput:d,onBlur:v,onKeydown:m,onKeyup:h,onFocus:_,onPressenter:g});return U(`div`,{class:K(c,x),style:S},[U(Pu,Y(Y({},w),{},{ref:s,tag:`textarea`}),null),i&&U(`div`,{ref:o,class:`${c}-measure`},[l.value.slice(0,t),U(zz,{prefixCls:c,transitionName:f,dropdownClassName:e.dropdownClassName,placement:u,options:i?T.value:[],visible:!0,direction:y,getPopupContainer:p},{default:()=>[U(`span`,null,[n])],notFoundContent:a.notFoundContent,option:a.option}),l.value.slice(t+n.length)])])}}}),qz=Z(Z({},{value:String,disabled:Boolean,payload:Qt()}),{label:nn([])}),Jz={name:`Option`,props:qz,render(e,t){let{slots:n}=t;return n.default?.call(n)}};u(Z({compatConfig:{MODE:3}},Jz));var Yz=Kz,Xz=e=>{let{componentCls:t,colorTextDisabled:n,controlItemBgHover:r,controlPaddingHorizontal:i,colorText:a,motionDurationSlow:o,lineHeight:s,controlHeight:c,inputPaddingHorizontal:l,inputPaddingVertical:u,fontSize:d,colorBgElevated:f,borderRadiusLG:p,boxShadowSecondary:m}=e,h=Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2);return{[t]:Z(Z(Z(Z(Z({},rn(e)),BT(e)),{position:`relative`,display:`inline-block`,height:`auto`,padding:0,overflow:`hidden`,lineHeight:s,whiteSpace:`pre-wrap`,verticalAlign:`bottom`}),zT(e,t)),{"&-disabled":{"> textarea":Z({},IT(e))},"&-focused":Z({},FT(e)),[`&-affix-wrapper ${t}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:l,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`},[`> textarea, ${t}-measure`]:{color:a,boxSizing:`border-box`,minHeight:c-2,margin:0,padding:`${u}px ${l}px`,overflow:`inherit`,overflowX:`hidden`,overflowY:`auto`,fontWeight:`inherit`,fontSize:`inherit`,fontFamily:`inherit`,fontStyle:`inherit`,fontVariant:`inherit`,fontSizeAdjust:`inherit`,fontStretch:`inherit`,lineHeight:`inherit`,direction:`inherit`,letterSpacing:`inherit`,whiteSpace:`inherit`,textAlign:`inherit`,verticalAlign:`top`,wordWrap:`break-word`,wordBreak:`inherit`,tabSize:`inherit`},"> textarea":Z({width:`100%`,border:`none`,outline:`none`,resize:`none`,backgroundColor:`inherit`},NT(e.colorTextPlaceholder)),[`${t}-measure`]:{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:-1,color:`transparent`,pointerEvents:`none`,"> span":{display:`inline-block`,minHeight:`1em`}},"&-dropdown":Z(Z({},rn(e)),{position:`absolute`,top:-9999,insetInlineStart:-9999,zIndex:e.zIndexPopup,boxSizing:`border-box`,fontSize:d,fontVariant:`initial`,backgroundColor:f,borderRadius:p,outline:`none`,boxShadow:m,"&-hidden":{display:`none`},[`${t}-dropdown-menu`]:{maxHeight:e.dropdownHeight,marginBottom:0,paddingInlineStart:0,overflow:`auto`,listStyle:`none`,outline:`none`,"&-item":Z(Z({},xe),{position:`relative`,display:`block`,minWidth:e.controlItemWidth,padding:`${h}px ${i}px`,color:a,fontWeight:`normal`,lineHeight:s,cursor:`pointer`,transition:`background ${o} ease`,"&:hover":{backgroundColor:r},"&:first-child":{borderStartStartRadius:p,borderStartEndRadius:p,borderEndStartRadius:0,borderEndEndRadius:0},"&:last-child":{borderStartStartRadius:0,borderStartEndRadius:0,borderEndStartRadius:p,borderEndEndRadius:p},"&-disabled":{color:n,cursor:`not-allowed`,"&:hover":{color:n,backgroundColor:r,cursor:`not-allowed`}},"&-selected":{color:a,fontWeight:e.fontWeightStrong,backgroundColor:r},"&-active":{backgroundColor:r}})}})})}},Zz=v(`Mentions`,e=>[Xz(qT(e))],e=>({dropdownHeight:250,controlItemWidth:100,zIndexPopup:e.zIndexPopupBase+50})),Qz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:``,{prefix:t=`@`,split:n=` `}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Array.isArray(t)?t:[t];return e.split(n).map(function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=null;return r.some(n=>e.slice(0,n.length)===n?(t=n,!0):!1),t===null?null:{prefix:t,value:e.slice(t.length)}}).filter(e=>!!e&&!!e.value)},tB=u({compatConfig:{MODE:3},name:`AMentions`,inheritAttrs:!1,props:Z(Z({},Vz),{loading:{type:Boolean,default:void 0},onFocus:{type:Function},onBlur:{type:Function},onSelect:{type:Function},onChange:{type:Function},onPressenter:{type:Function},"onUpdate:value":{type:Function},notFoundContent:f.any,defaultValue:String,id:String,status:String}),slots:Object,setup(t,n){let{slots:r,emit:i,attrs:a,expose:o}=n,{prefixCls:s,renderEmpty:c,direction:l}=X(`mentions`,t),[u,d]=Zz(s),f=q(!1),p=q(null),m=q(t.value??t.defaultValue??``),h=zf(),g=Vf.useInject(),_=J(()=>Wf(g.status,t.status));yx({prefixCls:J(()=>`${s.value}-menu`),mode:J(()=>`vertical`),selectable:J(()=>!1),onClick:()=>{},validator:t=>{let{mode:n}=t;e(!n||n===`vertical`,`Mentions`,`mode="${n}" is not supported for Mentions's Menu.`)}}),G(()=>t.value,e=>{m.value=e});let v=e=>{f.value=!0,i(`focus`,e)},y=e=>{f.value=!1,i(`blur`,e),h.onFieldBlur()},b=function(){i(`select`,...arguments),f.value=!0},x=e=>{t.value===void 0&&(m.value=e),i(`update:value`,e),i(`change`,e),h.onFieldChange()},S=()=>{let e=t.notFoundContent;return e===void 0?r.notFoundContent?r.notFoundContent():c(`Select`):e},C=()=>ce(r.default?.call(r)||[]).map(e=>{var t;return Z(Z({},pe(e)),{label:((t=e.children)?.default)?.call(t)})});o({focus:()=>{p.value.focus()},blur:()=>{p.value.blur()}});let w=J(()=>t.loading?$z:t.filterOption);return()=>{let{disabled:e,getPopupContainer:n,rows:i=1,id:o=h.id.value}=t,c=Qz(t,[`disabled`,`getPopupContainer`,`rows`,`id`]),{hasFeedback:T,feedbackIcon:E}=g,{class:D}=a,O=Qz(a,[`class`]),k=Br(c,[`defaultValue`,`onUpdate:value`,`prefixCls`]),A=K({[`${s.value}-disabled`]:e,[`${s.value}-focused`]:f.value,[`${s.value}-rtl`]:l.value===`rtl`},Uf(s.value,_.value),!T&&D,d.value),j=U(Yz,Y(Y({},Z(Z(Z(Z({prefixCls:s.value},k),{disabled:e,direction:l.value,filterOption:w.value,getPopupContainer:n,options:t.loading?[{value:`ANTDV_SEARCHING`,disabled:!0,label:U(HR,{size:`small`},null)}]:t.options||C(),class:A}),O),{rows:i,onChange:x,onSelect:b,onFocus:v,onBlur:y,ref:p,value:m.value,id:o})),{},{dropdownClassName:d.value}),{notFoundContent:S,option:r.option});return u(T?U(`div`,{class:K(`${s.value}-affix-wrapper`,Uf(`${s.value}-affix-wrapper`,_.value,T),D,d.value)},[j,U(`span`,{class:`${s.value}-suffix`},[E])]):j)}}}),nB=u(Z(Z({compatConfig:{MODE:3}},Jz),{name:`AMentionsOption`,props:qz})),rB=Z(tB,{Option:nB,getMentions:eB,install:e=>(e.component(tB.name,tB),e.component(nB.name,nB),e)}),iB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{aB={x:e.pageX,y:e.pageY},setTimeout(()=>aB=null,100)},!0);var oB=u({compatConfig:{MODE:3},name:`AModal`,inheritAttrs:!1,props:Zn({prefixCls:String,visible:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},confirmLoading:{type:Boolean,default:void 0},title:f.any,closable:{type:Boolean,default:void 0},closeIcon:f.any,onOk:Function,onCancel:Function,"onUpdate:visible":Function,"onUpdate:open":Function,onChange:Function,afterClose:Function,centered:{type:Boolean,default:void 0},width:[String,Number],footer:f.any,okText:f.any,okType:String,cancelText:f.any,icon:f.any,maskClosable:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},okButtonProps:Qt(),cancelButtonProps:Qt(),destroyOnClose:{type:Boolean,default:void 0},wrapClassName:String,maskTransitionName:String,transitionName:String,getContainer:{type:[String,Function,Boolean,Object],default:void 0},zIndex:Number,bodyStyle:Qt(),maskStyle:Qt(),mask:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},wrapProps:Object,focusTriggerAfterClose:{type:Boolean,default:void 0},modalRender:Function,mousePosition:Qt()},{width:520,confirmLoading:!1,okType:`primary`}),setup(t,n){let{emit:r,slots:i,attrs:a}=n,[o]=Kt(`Modal`),{prefixCls:s,rootPrefixCls:c,direction:l,getPopupContainer:u}=X(`modal`,t),[d,f]=hL(s);e(t.visible===void 0,`Modal`,"`visible` will be removed in next major version, please use `open` instead.");let p=e=>{r(`update:visible`,!1),r(`update:open`,!1),r(`cancel`,e),r(`change`,!1)},m=e=>{r(`ok`,e)},h=()=>{let{okText:e=i.okText?.call(i),okType:n,cancelText:r=i.cancelText?.call(i),confirmLoading:a}=t;return U($e,null,[U(Qb,Y({onClick:p},t.cancelButtonProps),{default:()=>[r||o.value.cancelText]}),U(Qb,Y(Y({},fb(n)),{},{loading:a,onClick:m},t.okButtonProps),{default:()=>[e||o.value.okText]})])};return()=>{let{prefixCls:e,visible:n,open:r,wrapClassName:o,centered:m,getContainer:g,closeIcon:_=i.closeIcon?.call(i),focusTriggerAfterClose:v=!0}=t,y=iB(t,[`prefixCls`,`visible`,`open`,`wrapClassName`,`centered`,`getContainer`,`closeIcon`,`focusTriggerAfterClose`]),b=K(o,{[`${s.value}-centered`]:!!m,[`${s.value}-wrap-rtl`]:l.value===`rtl`});return d(U(DI,Y(Y(Y({},y),a),{},{rootClassName:f.value,class:K(f.value,a.class),getContainer:g||u?.value,prefixCls:s.value,wrapClassName:b,visible:r??n,onClose:p,focusTriggerAfterClose:v,transitionName:Xt(c.value,`zoom`,t.transitionName),maskTransitionName:Xt(c.value,`fade`,t.maskTransitionName),mousePosition:y.mousePosition??aB}),Z(Z({},i),{footer:i.footer||h,closeIcon:()=>U(`span`,{class:`${s.value}-close-x`},[_||U(Pe,{class:`${s.value}-close-icon`},null)])})))}}}),sB=()=>{let e=q(!1);return ut(()=>{e.value=!0}),e},cB={type:{type:String},actionFn:Function,close:Function,autofocus:Boolean,prefixCls:String,buttonProps:Qt(),emitEvent:Boolean,quitOnNullishReturnValue:Boolean};function lB(e){return!!(e&&e.then)}var uB=u({compatConfig:{MODE:3},name:`ActionButton`,props:cB,setup(e,t){let{slots:n}=t,r=q(!1),i=q(),a=q(!1),o,s=sB();V(()=>{e.autofocus&&(o=setTimeout(()=>{var e;return((e=ae(i.value))?.focus)?.call(e)}))}),ut(()=>{clearTimeout(o)});let c=function(){var t,n=[...arguments];(t=e.close)==null||t.call(e,...n)},l=e=>{lB(e)&&(a.value=!0,e.then(function(){s.value||(a.value=!1),c(...arguments),r.value=!1},e=>(s.value||(a.value=!1),r.value=!1,Promise.reject(e))))},u=t=>{let{actionFn:n}=e;if(r.value)return;if(r.value=!0,!n){c();return}let i;if(e.emitEvent){if(i=n(t),e.quitOnNullishReturnValue&&!lB(i)){r.value=!1,c(t);return}}else if(n.length)i=n(e.close),r.value=!1;else if(i=n(),!i){c();return}l(i)};return()=>{let{type:t,prefixCls:r,buttonProps:o}=e;return U(Qb,Y(Y(Y({},fb(t)),{},{onClick:u,loading:a.value,prefixCls:r},o),{},{ref:i}),n)}}});function dB(e){return typeof e==`function`?e():e}var fB=u({name:`ConfirmDialog`,inheritAttrs:!1,props:`icon.onCancel.onOk.close.closable.zIndex.afterClose.visible.open.keyboard.centered.getContainer.maskStyle.okButtonProps.cancelButtonProps.okType.prefixCls.okCancel.width.mask.maskClosable.okText.cancelText.autoFocusButton.transitionName.maskTransitionName.type.title.content.direction.rootPrefixCls.bodyStyle.closeIcon.modalRender.focusTriggerAfterClose.wrapClassName.confirmPrefixCls.footer`.split(`.`),setup(e,t){let{attrs:n}=t,[r]=Kt(`Modal`);return()=>{let{icon:t,onCancel:i,onOk:a,close:o,okText:s,closable:c=!1,zIndex:l,afterClose:u,keyboard:d,centered:f,getContainer:p,maskStyle:m,okButtonProps:h,cancelButtonProps:g,okCancel:_,width:v=416,mask:y=!0,maskClosable:b=!1,type:x,open:S,title:C,content:w,direction:T,closeIcon:E,modalRender:D,focusTriggerAfterClose:O,rootPrefixCls:k,bodyStyle:A,wrapClassName:j,footer:M}=e,N=t;if(!t&&t!==null)switch(x){case`info`:N=U(mt,null,null);break;case`success`:N=U(qe,null,null);break;case`error`:N=U(tt,null,null);break;default:N=U(Wt,null,null)}let P=e.okType||`primary`,F=e.prefixCls||`ant-modal`,I=`${F}-confirm`,L=n.style||{},ee=_??x===`confirm`,te=e.autoFocusButton===null?!1:e.autoFocusButton||`ok`,ne=`${F}-confirm`,R=K(ne,`${ne}-${e.type}`,{[`${ne}-rtl`]:T===`rtl`},n.class),re=r.value,ie=ee&&U(uB,{actionFn:i,close:o,autofocus:te===`cancel`,buttonProps:g,prefixCls:`${k}-btn`},{default:()=>[dB(e.cancelText)||re.cancelText]});return U(oB,{prefixCls:F,class:R,wrapClassName:K({[`${ne}-centered`]:!!f},j),onCancel:e=>o?.({triggerCancel:!0},e),open:S,title:``,footer:``,transitionName:Xt(k,`zoom`,e.transitionName),maskTransitionName:Xt(k,`fade`,e.maskTransitionName),mask:y,maskClosable:b,maskStyle:m,style:L,bodyStyle:A,width:v,zIndex:l,afterClose:u,keyboard:d,centered:f,getContainer:p,closable:c,closeIcon:E,modalRender:D,focusTriggerAfterClose:O},{default:()=>[U(`div`,{class:`${I}-body-wrapper`},[U(`div`,{class:`${I}-body`},[dB(N),C===void 0?null:U(`span`,{class:`${I}-title`},[dB(C)]),U(`div`,{class:`${I}-content`},[dB(w)])]),M===void 0?U(`div`,{class:`${I}-btns`},[ie,U(uB,{type:P,actionFn:a,close:o,autofocus:te===`ok`,buttonProps:h,prefixCls:`${k}-btn`},{default:()=>[dB(s)||(ee?re.okText:re.justOkText)]})]):dB(M)])]})}}}),pB=[],mB=e=>{let t=document.createDocumentFragment(),n=Z(Z({},Br(e,[`parentContext`,`appContext`])),{close:a,open:!0}),r=null;function i(){r&&=(Ge(null,t),null);var n=[...arguments];let i=n.some(e=>e&&e.triggerCancel);e.onCancel&&i&&e.onCancel(()=>{},...n.slice(1));for(let e=0;e{typeof e.afterClose==`function`&&e.afterClose(),i.apply(this,t)}}),n.visible&&delete n.visible,o(n)}function o(e){n=typeof e==`function`?e(n):Z(Z({},n),e),r&&co(r,n,t)}let s=e=>{let t=bt,n=t.prefixCls,r=e.prefixCls||`${n}-modal`,i=t.iconPrefixCls,a=We();return U(Bt,Y(Y({},t),{},{prefixCls:n}),{default:()=>[U(fB,Y(Y({},e),{},{rootPrefixCls:n,prefixCls:r,iconPrefixCls:i,locale:a,cancelText:e.cancelText||a.cancelText}),null)]})};function c(n){let r=U(s,Z({},n));return r.appContext=e.parentContext||e.appContext||r.appContext,Ge(r,t),r}return r=c(n),pB.push(a),{destroy:a,update:o}};function hB(e){return Z(Z({},e),{type:`warning`})}function gB(e){return Z(Z({},e),{type:`info`})}function _B(e){return Z(Z({},e),{type:`success`})}function vB(e){return Z(Z({},e),{type:`error`})}function yB(e){return Z(Z({},e),{type:`confirm`})}var bB=u({name:`HookModal`,inheritAttrs:!1,props:Zn({config:Object,afterClose:Function,destroyAction:Function,open:Boolean},{config:{width:520,okType:`primary`}}),setup(e,t){let{expose:n}=t,r=J(()=>e.open),i=J(()=>e.config),{direction:a,getPrefixCls:o}=Ie(),s=o(`modal`),c=o(),l=()=>{var t,n;e?.afterClose(),(n=(t=i.value).afterClose)==null||n.call(t)},u=function(){e.destroyAction(...arguments)};n({destroy:u});let d=i.value.okCancel??i.value.type===`confirm`,[f]=Kt(`Modal`,Ye.Modal);return()=>U(fB,Y(Y({prefixCls:s,rootPrefixCls:c},i.value),{},{close:u,open:r.value,afterClose:l,okText:i.value.okText||(d?f?.value.okText:f?.value.justOkText),direction:i.value.direction||a.value,cancelText:i.value.cancelText||f?.value.cancelText}),null)}}),xB=0,SB=u({name:`ElementsHolder`,inheritAttrs:!1,setup(e,t){let{expose:n}=t,r=q([]);return n({addModal:e=>(r.value.push(e),r.value=r.value.slice(),()=>{r.value=r.value.filter(t=>t!==e)})}),()=>r.value.map(e=>e())}});function CB(){let e=q(null),t=q([]);G(t,()=>{t.value.length&&([...t.value].forEach(e=>{e()}),t.value=[])},{immediate:!0});let n=n=>function(r){xB+=1;let i=q(!0),a=q(null),o=q(ze(r)),s=q({});G(()=>r,e=>{u(Z(Z({},Ae(e)?e.value:e),s.value))});let c=function(){i.value=!1;var e=[...arguments];let t=e.some(e=>e&&e.triggerCancel);o.value.onCancel&&t&&o.value.onCancel(()=>{},...e.slice(1))},l;l=e.value?.addModal(()=>U(bB,{key:`modal-${xB}`,config:n(o.value),ref:a,open:i.value,destroyAction:c,afterClose:()=>{l?.()}},null)),l&&pB.push(l);let u=e=>{o.value=Z(Z({},o.value),e)};return{destroy:()=>{a.value?c():t.value=[...t.value,c]},update:e=>{s.value=e,a.value?u(e):t.value=[...t.value,()=>u(e)]}}},r=J(()=>({info:n(gB),success:n(_B),error:n(vB),warning:n(hB),confirm:n(yB)})),i=Symbol(`modalHolderKey`);return[r.value,()=>U(SB,{key:i,ref:e},null)]}function wB(e){return mB(hB(e))}oB.useModal=CB,oB.info=function(e){return mB(gB(e))},oB.success=function(e){return mB(_B(e))},oB.error=function(e){return mB(vB(e))},oB.warning=wB,oB.warn=wB,oB.confirm=function(e){return mB(yB(e))},oB.destroyAll=function(){for(;pB.length;){let e=pB.pop();e&&e()}},oB.install=function(e){return e.component(oB.name,oB),e};var TB=oB,EB=e=>{let{value:t,formatter:n,precision:r,decimalSeparator:i,groupSeparator:a=``,prefixCls:o}=e,s;if(typeof n==`function`)s=n({value:t});else{let e=String(t),n=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(!n)s=e;else{let e=n[1],t=n[2]||`0`,c=n[4]||``;t=t.replace(/\B(?=(\d{3})+(?!\d))/g,a),typeof r==`number`&&(c=c.padEnd(r,`0`).slice(0,r>0?r:0)),c&&=`${i}${c}`,s=[U(`span`,{key:`int`,class:`${o}-content-value-int`},[e,t]),c&&U(`span`,{key:`decimal`,class:`${o}-content-value-decimal`},[c])]}}return U(`span`,{class:`${o}-content-value`},[s])};EB.displayName=`StatisticNumber`;var DB=e=>{let{componentCls:t,marginXXS:n,padding:r,colorTextDescription:i,statisticTitleFontSize:a,colorTextHeading:o,statisticContentFontSize:s,statisticFontFamily:c}=e;return{[`${t}`]:Z(Z({},rn(e)),{[`${t}-title`]:{marginBottom:n,color:i,fontSize:a},[`${t}-skeleton`]:{paddingTop:r},[`${t}-content`]:{color:o,fontSize:s,fontFamily:c,[`${t}-content-value`]:{display:`inline-block`,direction:`ltr`},[`${t}-content-prefix, ${t}-content-suffix`]:{display:`inline-block`},[`${t}-content-prefix`]:{marginInlineEnd:n},[`${t}-content-suffix`]:{marginInlineStart:n}}})}},OB=v(`Statistic`,e=>{let{fontSizeHeading3:t,fontSize:n,fontFamily:r}=e;return[DB(B(e,{statisticTitleFontSize:n,statisticContentFontSize:t,statisticFontFamily:r}))]}),kB=()=>({prefixCls:String,decimalSeparator:String,groupSeparator:String,format:String,value:W([Number,String,Object]),valueStyle:{type:Object,default:void 0},valueRender:d(),formatter:nn(),precision:Number,prefix:pt(),suffix:pt(),title:pt(),loading:Q()}),AB=u({compatConfig:{MODE:3},name:`AStatistic`,inheritAttrs:!1,props:Zn(kB(),{decimalSeparator:`.`,groupSeparator:`,`,loading:!1}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`statistic`,e),[o,s]=OB(i);return()=>{let{value:t=0,valueStyle:c,valueRender:l}=e,u=i.value,d=e.title??n.title?.call(n),f=e.prefix??n.prefix?.call(n),p=e.suffix??n.suffix?.call(n),m=e.formatter??n.formatter,h=U(EB,Y({"data-for-update":Date.now()},Z(Z({},e),{prefixCls:u,value:t,formatter:m})),null);return l&&(h=l(h)),o(U(`div`,Y(Y({},r),{},{class:[u,{[`${u}-rtl`]:a.value===`rtl`},r.class,s.value]}),[d&&U(`div`,{class:`${u}-title`},[d]),U(wD,{paragraph:!1,loading:e.loading},{default:()=>[U(`div`,{style:c,class:`${u}-content`},[f&&U(`span`,{class:`${u}-content-prefix`},[f]),h,p&&U(`span`,{class:`${u}-content-suffix`},[p])])]})]))}}}),jB=[[`Y`,1e3*60*60*24*365],[`M`,1e3*60*60*24*30],[`D`,1e3*60*60*24],[`H`,1e3*60*60],[`m`,1e3*60],[`s`,1e3],[`S`,1]];function MB(e,t){let n=e,r=/\[[^\]]*]/g,i=(t.match(r)||[]).map(e=>e.slice(1,-1)),a=t.replace(r,`[]`),o=jB.reduce((e,t)=>{let[r,i]=t;if(e.includes(r)){let t=Math.floor(n/i);return n-=t*i,e.replace(RegExp(`${r}+`,`g`),e=>{let n=e.length;return t.toString().padStart(n,`0`)})}return e},a),s=0;return o.replace(r,()=>{let e=i[s];return s+=1,e})}function NB(e,t){let{format:n=``}=t,r=new Date(e).getTime();return MB(Math.max(r-Date.now(),0),n)}var PB=1e3/30;function FB(e){return new Date(e).getTime()}AB.Countdown=u({compatConfig:{MODE:3},name:`AStatisticCountdown`,props:Zn(Z(Z({},kB()),{value:W([Number,String,Object]),format:String,onFinish:Function,onChange:Function}),{format:`HH:mm:ss`}),setup(e,t){let{emit:n,slots:r}=t,i=H(),a=H(),o=()=>{let{value:t}=e;FB(t)>=Date.now()?s():c()},s=()=>{if(i.value)return;let t=FB(e.value);i.value=setInterval(()=>{a.value.$forceUpdate(),t>Date.now()&&n(`change`,t-Date.now()),o()},PB)},c=()=>{let{value:t}=e;i.value&&(clearInterval(i.value),i.value=void 0,FB(t){let{value:n,config:r}=t,{format:i}=e;return NB(n,Z(Z({},r),{format:i}))},u=e=>e;return V(()=>{o()}),O(()=>{o()}),ut(()=>{c()}),()=>{let t=e.value;return U(AB,Y({ref:a},Z(Z({},Br(e,[`onFinish`,`onChange`])),{value:t,valueRender:u,formatter:l})),r)}}}),AB.install=function(e){return e.component(AB.name,AB),e.component(AB.Countdown.name,AB.Countdown),e};var IB=AB.Countdown,LB=AB,RB={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`};function zB(e){for(var t=1;t{let{keyCode:t}=e;t===$.ENTER&&e.preventDefault()},c=e=>{let{keyCode:t}=e;t===$.ENTER&&r(`click`,e)},l=e=>{r(`click`,e)},u=()=>{o.value&&o.value.focus()};return V(()=>{e.autofocus&&u()}),a({focus:u,blur:()=>{o.value&&o.value.blur()}}),()=>{let{noStyle:t,disabled:r}=e,a=KB(e,[`noStyle`,`disabled`]),u={};return t||(u=Z({},qB)),r&&(u.pointerEvents=`none`),U(`div`,Y(Y(Y({role:`button`,tabindex:0,ref:o},a),i),{},{onClick:l,onKeydown:s,onKeyup:c,style:Z(Z({},u),i.style||{})}),[n.default?.call(n)])}}}),YB={small:8,middle:16,large:24},XB=()=>({prefixCls:String,size:{type:[String,Number,Array]},direction:f.oneOf(m(`horizontal`,`vertical`)).def(`horizontal`),align:f.oneOf(m(`start`,`end`,`center`,`baseline`)),wrap:Q()});function ZB(e){return typeof e==`string`?YB[e]:e||0}var QB=u({compatConfig:{MODE:3},name:`ASpace`,inheritAttrs:!1,props:XB(),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,space:a,direction:o}=X(`space`,e),[s,c]=qf(i),l=jA(),u=J(()=>e.size??a?.value?.size??`small`),d=H(),f=H();G(u,()=>{[d.value,f.value]=(Array.isArray(u.value)?u.value:[u.value,u.value]).map(e=>ZB(e))},{immediate:!0});let p=J(()=>e.align===void 0&&e.direction===`horizontal`?`center`:e.align),m=J(()=>K(i.value,c.value,`${i.value}-${e.direction}`,{[`${i.value}-rtl`]:o.value===`rtl`,[`${i.value}-align-${p.value}`]:p.value})),h=J(()=>o.value===`rtl`?`marginLeft`:`marginRight`),g=J(()=>{let t={};return l.value&&(t.columnGap=`${d.value}px`,t.rowGap=`${f.value}px`),Z(Z({},t),e.wrap&&{flexWrap:`wrap`,marginBottom:`${-f.value}px`})});return()=>{let{wrap:t,direction:a=`horizontal`}=e,o=n.default?.call(n),c=dt(o),u=c.length;if(u===0)return null;let p=n.split?.call(n),_=`${i.value}-item`,v=d.value,y=u-1;return U(`div`,Y(Y({},r),{},{class:[m.value,r.class],style:[g.value,r.style]}),[c.map((e,n)=>{let r=o.indexOf(e);r===-1&&(r=`$$space-${n}`);let i={};return l.value||(a===`vertical`?n{let{componentCls:t,antCls:n}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,padding:`${e.pageHeaderPaddingVertical}px ${e.pageHeaderPadding}px`,backgroundColor:e.colorBgContainer,[`&${t}-ghost`]:{backgroundColor:e.pageHeaderGhostBg},"&.has-footer":{paddingBottom:0},[`${t}-back`]:{marginRight:e.marginMD,fontSize:e.fontSizeLG,lineHeight:1,"&-button":Z(Z({},Lr(e)),{color:e.pageHeaderBackColor,cursor:`pointer`})},[`${n}-divider-vertical`]:{height:`14px`,margin:`0 ${e.marginSM}`,verticalAlign:`middle`},[`${n}-breadcrumb + &-heading`]:{marginTop:e.marginXS},[`${t}-heading`]:{display:`flex`,justifyContent:`space-between`,"&-left":{display:`flex`,alignItems:`center`,margin:`${e.marginXS/2}px 0`,overflow:`hidden`},"&-title":Z({marginRight:e.marginSM,marginBottom:0,color:e.colorTextHeading,fontWeight:600,fontSize:e.pageHeaderHeadingTitle,lineHeight:`${e.controlHeight}px`},xe),[`${n}-avatar`]:{marginRight:e.marginSM},"&-sub-title":Z({marginRight:e.marginSM,color:e.colorTextDescription,fontSize:e.pageHeaderHeadingSubTitle,lineHeight:e.lineHeight},xe),"&-extra":{margin:`${e.marginXS/2}px 0`,whiteSpace:`nowrap`,"> *":{marginLeft:e.marginSM,whiteSpace:`unset`},"> *:first-child":{marginLeft:0}}},[`${t}-content`]:{paddingTop:e.pageHeaderContentPaddingVertical},[`${t}-footer`]:{marginTop:e.marginMD,[`${n}-tabs`]:{[`> ${n}-tabs-nav`]:{margin:0,"&::before":{border:`none`}},[`${n}-tabs-tab`]:{paddingTop:e.paddingXS,paddingBottom:e.paddingXS,fontSize:e.pageHeaderTabFontSize}}},[`${t}-compact ${t}-heading`]:{flexWrap:`wrap`},[`&${e.componentCls}-rtl`]:{direction:`rtl`}})}},eV=v(`PageHeader`,e=>[$B(B(e,{pageHeaderPadding:e.paddingLG,pageHeaderPaddingVertical:e.paddingMD,pageHeaderPaddingBreadcrumb:e.paddingSM,pageHeaderContentPaddingVertical:e.paddingSM,pageHeaderBackColor:e.colorTextBase,pageHeaderGhostBg:`transparent`,pageHeaderHeadingTitle:e.fontSizeHeading4,pageHeaderHeadingSubTitle:e.fontSize,pageHeaderTabFontSize:e.fontSizeLG}))]),tV=a(u({compatConfig:{MODE:3},name:`APageHeader`,inheritAttrs:!1,props:{backIcon:pt(),prefixCls:String,title:pt(),subTitle:pt(),breadcrumb:f.object,tags:pt(),footer:pt(),extra:pt(),avatar:Qt(),ghost:{type:Boolean,default:void 0},onBack:Function},slots:Object,setup(e,t){let{emit:n,slots:r,attrs:i}=t,{prefixCls:a,direction:o,pageHeader:s}=X(`page-header`,e),[c,l]=eV(a),u=q(!1),d=sB(),f=e=>{let{width:t}=e;d.value||(u.value=t<768)},p=J(()=>e.ghost??s?.value?.ghost??!0),m=()=>e.backIcon??r.backIcon?.call(r)??(o.value===`rtl`?U(GB,null,null):U(VB,null,null)),h=t=>!t||!e.onBack?null:U(Ke,{componentName:`PageHeader`,children:e=>{let{back:r}=e;return U(`div`,{class:`${a.value}-back`},[U(JB,{onClick:e=>{n(`back`,e)},class:`${a.value}-back-button`,"aria-label":r},{default:()=>[t]})])}},null),g=()=>e.breadcrumb?U(NS,e.breadcrumb,null):r.breadcrumb?.call(r),_=()=>{let{avatar:t}=e,n=e.title??r.title?.call(r),i=e.subTitle??r.subTitle?.call(r),o=e.tags??r.tags?.call(r),s=e.extra??r.extra?.call(r),c=`${a.value}-heading`,l=n||i||o||s;if(!l)return null;let u=m(),d=h(u);return U(`div`,{class:c},[(d||t||l)&&U(`div`,{class:`${c}-left`},[d,t?U(My,t,null):r.avatar?.call(r),n&&U(`span`,{class:`${c}-title`,title:typeof n==`string`?n:void 0},[n]),i&&U(`span`,{class:`${c}-sub-title`,title:typeof i==`string`?i:void 0},[i]),o&&U(`span`,{class:`${c}-tags`},[o])]),s&&U(`span`,{class:`${c}-extra`},[U(QB,null,{default:()=>[s]})])])},v=()=>{let t=e.footer??dt(r.footer?.call(r));return be(t)?null:U(`div`,{class:`${a.value}-footer`},[t])},y=e=>U(`div`,{class:`${a.value}-content`},[e]);return()=>{let t=e.breadcrumb?.routes||r.breadcrumb,n=e.footer||r.footer,s=ce(r.default?.call(r)),d=K(a.value,{"has-breadcrumb":t,"has-footer":n,[`${a.value}-ghost`]:p.value,[`${a.value}-rtl`]:o.value===`rtl`,[`${a.value}-compact`]:u.value},i.class,l.value);return c(U(Qn,{onResize:f},{default:()=>[U(`div`,Y(Y({},i),{},{class:d}),[g(),_(),s.length?y(s):null,v()])]}))}}})),nV=e=>{let{componentCls:t,iconCls:n,zIndexPopup:r,colorText:i,colorWarning:a,marginXS:o,fontSize:s,fontWeightStrong:c,lineHeight:l}=e;return{[t]:{zIndex:r,[`${t}-inner-content`]:{color:i},[`${t}-message`]:{position:`relative`,marginBottom:o,color:i,fontSize:s,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon ${n}`]:{color:a,fontSize:s,flex:`none`,lineHeight:1,paddingTop:(Math.round(s*l)-s)/2},"&-title":{flex:`auto`,marginInlineStart:o},"&-title-only":{fontWeight:c}},[`${t}-description`]:{position:`relative`,marginInlineStart:s+o,marginBottom:o,color:i,fontSize:s},[`${t}-buttons`]:{textAlign:`end`,button:{marginInlineStart:o}}}}},rV=v(`Popconfirm`,e=>nV(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}}),iV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{var e;return((e=s.value)?.getPopupDomNode)?.call(e)}});let[c,l]=df(!1,{value:St(t,`open`)}),u=(e,n)=>{t.open===void 0&&l(e),i(`update:open`,e),i(`openChange`,e,n)},d=e=>{u(!1,e)},f=e=>t.onConfirm?.call(t,e),p=e=>{var n;u(!1,e),(n=t.onCancel)==null||n.call(t,e)},m=e=>{e.keyCode===$.ESC&&c&&u(!1,e)},h=e=>{let{disabled:n}=t;n||u(e)},{prefixCls:g,getPrefixCls:_}=X(`popconfirm`,t),v=J(()=>_()),y=J(()=>_(`btn`)),[b]=rV(g),[x]=Kt(`Popconfirm`,Ye.Popconfirm),S=()=>{let{okButtonProps:e,cancelButtonProps:n,title:i=r.title?.call(r),description:a=r.description?.call(r),cancelText:o=r.cancel?.call(r),okText:s=r.okText?.call(r),okType:c,icon:l=r.icon?.call(r)||U(Wt,null,null),showCancel:u=!0}=t,{cancelButton:m,okButton:h}=r,_=Z({onClick:p,size:`small`},n),v=Z(Z(Z({onClick:f},fb(c)),{size:`small`}),e);return U(`div`,{class:`${g.value}-inner-content`},[U(`div`,{class:`${g.value}-message`},[l&&U(`span`,{class:`${g.value}-message-icon`},[l]),U(`div`,{class:[`${g.value}-message-title`,{[`${g.value}-message-title-only`]:!!a}]},[i])]),a&&U(`div`,{class:`${g.value}-description`},[a]),U(`div`,{class:`${g.value}-buttons`},[u?m?m(_):U(Qb,_,{default:()=>[o||x.value.cancelText]}):null,h?h(v):U(uB,{buttonProps:Z(Z({size:`small`},fb(c)),e),actionFn:f,close:d,prefixCls:y.value,quitOnNullishReturnValue:!0,emitEvent:!0},{default:()=>[s||x.value.okText]})])])};return()=>{let{placement:e,overlayClassName:n,trigger:i=`click`}=t,a=Br(iV(t,[`placement`,`overlayClassName`,`trigger`]),[`title`,`content`,`cancelText`,`okText`,`onUpdate:open`,`onConfirm`,`onCancel`,`prefixCls`]),l=K(g.value,n);return b(U(Ay,Y(Y(Y({},a),o),{},{trigger:i,placement:e,onOpenChange:h,open:c.value,overlayClassName:l,transitionName:Xt(v.value,`zoom-big`,t.transitionName),ref:s,"data-popover-inject":!0}),{default:()=>[oo(r.default?.call(r)||[],{onKeydown:e=>{m(e)}},!1)],content:S}))}}})),oV=[`normal`,`exception`,`active`,`success`],sV=()=>({prefixCls:String,type:_(),percent:Number,format:d(),status:_(),showInfo:Q(),strokeWidth:Number,strokeLinecap:_(),strokeColor:nn(),trailColor:String,width:Number,success:Qt(),gapDegree:Number,gapPosition:_(),size:W([String,Number,Array]),steps:Number,successPercent:Number,title:String,progressStatus:_()});function cV(e){return!e||e<0?0:e>100?100:e}function lV(e){let{success:t,successPercent:n}=e,r=n;return t&&`progress`in t&&(pi(!1,`Progress`,"`success.progress` is deprecated. Please use `success.percent` instead."),r=t.progress),t&&`percent`in t&&(r=t.percent),r}function uV(e){let{percent:t,success:n,successPercent:r}=e,i=cV(lV({success:n,successPercent:r}));return[i,cV(cV(t)-i)]}function dV(e){let{success:t={},strokeColor:n}=e,{strokeColor:r}=t;return[r||ve.green,n||null]}var fV=(e,t,n)=>{let r=-1,i=-1;if(t===`step`){let t=n.steps,a=n.strokeWidth;typeof e==`string`||e===void 0?(r=e===`small`?2:14,i=a??8):typeof e==`number`?[r,i]=[e,e]:[r=14,i=8]=e,r*=t}else if(t===`line`){let t=n?.strokeWidth;typeof e==`string`||e===void 0?i=t||(e===`small`?6:8):typeof e==`number`?[r,i]=[e,e]:[r=-1,i=8]=e}else(t===`circle`||t===`dashboard`)&&(typeof e==`string`||e===void 0?[r,i]=e===`small`?[60,60]:[120,120]:typeof e==`number`?[r,i]=[e,e]:(r=e[0]??e[1]??120,i=e[0]??e[1]??120));return{width:r,height:i}},pV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iZ(Z({},sV()),{strokeColor:nn(),direction:_()}),hV=e=>{let t=[];return Object.keys(e).forEach(n=>{let r=parseFloat(n.replace(/%/g,``));isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((e,t)=>e.key-t.key),t.map(e=>{let{key:t,value:n}=e;return`${n} ${t}%`}).join(`, `)},gV=(e,t)=>{let{from:n=ve.blue,to:r=ve.blue,direction:i=t===`rtl`?`to left`:`to right`}=e,a=pV(e,[`from`,`to`,`direction`]);return Object.keys(a).length===0?{backgroundImage:`linear-gradient(${i}, ${n}, ${r})`}:{backgroundImage:`linear-gradient(${i}, ${hV(a)})`}},_V=u({compatConfig:{MODE:3},name:`ProgressLine`,inheritAttrs:!1,props:mV(),setup(e,t){let{slots:n,attrs:r}=t,i=J(()=>{let{strokeColor:t,direction:n}=e;return t&&typeof t!=`string`?gV(t,n):{backgroundColor:t}}),a=J(()=>e.strokeLinecap===`square`||e.strokeLinecap===`butt`?0:void 0),o=J(()=>e.trailColor?{backgroundColor:e.trailColor}:void 0),s=J(()=>e.size??[-1,e.strokeWidth||(e.size===`small`?6:8)]),c=J(()=>fV(s.value,`line`,{strokeWidth:e.strokeWidth})),l=J(()=>{let{percent:t}=e;return Z({width:`${cV(t)}%`,height:`${c.value.height}px`,borderRadius:a.value},i.value)}),u=J(()=>lV(e)),d=J(()=>{let{success:t}=e;return{width:`${cV(u.value)}%`,height:`${c.value.height}px`,borderRadius:a.value,backgroundColor:t?.strokeColor}}),f={width:c.value.width<0?`100%`:c.value.width,height:`${c.value.height}px`};return()=>U($e,null,[U(`div`,Y(Y({},r),{},{class:[`${e.prefixCls}-outer`,r.class],style:[r.style,f]}),[U(`div`,{class:`${e.prefixCls}-inner`,style:o.value},[U(`div`,{class:`${e.prefixCls}-bg`,style:l.value},null),u.value===void 0?null:U(`div`,{class:`${e.prefixCls}-success-bg`,style:d.value},null)])]),n.default?.call(n)])}}),vV={percent:0,prefixCls:`vc-progress`,strokeColor:`#2db7f5`,strokeLinecap:`round`,strokeWidth:1,trailColor:`#D9D9D9`,trailWidth:1},yV=e=>{let t=H(null);return O(()=>{let n=Date.now(),r=!1;e.value.forEach(e=>{let i=e?.$el||e;if(!i)return;r=!0;let a=i.style;a.transitionDuration=`.3s, .3s, .3s, .06s`,t.value&&n-t.value<100&&(a.transitionDuration=`0s, 0s`)}),r&&(t.value=Date.now())}),e},bV={gapDegree:Number,gapPosition:{type:String},percent:{type:[Array,Number]},prefixCls:String,strokeColor:{type:[Object,String,Array]},strokeLinecap:{type:String},strokeWidth:Number,trailColor:String,trailWidth:Number,transition:String},xV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=50-r/2,s=0,c=-o,l=0,u=-2*o;switch(a){case`left`:s=-o,c=0,l=2*o,u=0;break;case`right`:s=o,c=0,l=-2*o,u=0;break;case`bottom`:c=o,u=2*o;break;default:}let d=`M 50,50 m ${s},${c} + a ${o},${o} 0 1 1 ${l},${-u} + a ${o},${o} 0 1 1 ${-l},${u}`,f=Math.PI*2*o;return{pathString:d,pathStyle:{stroke:n,strokeDasharray:`${t/100*(f-i)}px ${f}px`,strokeDashoffset:`-${i/2+e/100*(f-i)}px`,transition:`stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s`}}}var EV=u({compatConfig:{MODE:3},name:`VCCircle`,props:Zn(bV,vV),setup(e){SV+=1;let t=H(SV),n=J(()=>wV(e.percent)),r=J(()=>wV(e.strokeColor)),[i,a]=CE();yV(a);let o=()=>{let{prefixCls:a,strokeWidth:o,strokeLinecap:s,gapDegree:c,gapPosition:l}=e,u=0;return n.value.map((e,n)=>{let d=r.value[n]||r.value[r.value.length-1],f=Object.prototype.toString.call(d)===`[object Object]`?`url(#${a}-gradient-${t.value})`:``,{pathString:p,pathStyle:m}=TV(u,e,d,o,c,l);u+=e;let h={key:n,d:p,stroke:f,"stroke-linecap":s,"stroke-width":o,opacity:e===0?0:1,"fill-opacity":`0`,class:`${a}-circle-path`,style:m};return U(`path`,Y({ref:i(n)},h),null)})};return()=>{let{prefixCls:n,strokeWidth:i,trailWidth:a,gapDegree:s,gapPosition:c,trailColor:l,strokeLinecap:u,strokeColor:d}=e,f=xV(e,[`prefixCls`,`strokeWidth`,`trailWidth`,`gapDegree`,`gapPosition`,`trailColor`,`strokeLinecap`,`strokeColor`]),{pathString:p,pathStyle:m}=TV(0,100,l,i,s,c);delete f.percent;let h=r.value.find(e=>Object.prototype.toString.call(e)===`[object Object]`),g={d:p,stroke:l,"stroke-linecap":u,"stroke-width":a||i,"fill-opacity":`0`,class:`${n}-circle-trail`,style:m};return U(`svg`,Y({class:`${n}-circle`,viewBox:`0 0 100 100`},f),[h&&U(`defs`,null,[U(`linearGradient`,{id:`${n}-gradient-${t.value}`,x1:`100%`,y1:`0%`,x2:`0%`,y2:`0%`},[Object.keys(h).sort((e,t)=>CV(e)-CV(t)).map((e,t)=>U(`stop`,{key:t,offset:e,"stop-color":h[e]},null))])]),U(`path`,g,null),o().reverse()])}}}),DV=()=>Z(Z({},sV()),{strokeColor:nn()}),OV=3,kV=e=>OV/e*100,AV=u({compatConfig:{MODE:3},name:`ProgressCircle`,inheritAttrs:!1,props:Zn(DV(),{trailColor:null}),setup(e,t){let{slots:n,attrs:r}=t,i=J(()=>e.width??120),a=J(()=>e.size??[i.value,i.value]),o=J(()=>fV(a.value,`circle`)),s=J(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type===`dashboard`)return 75}),c=J(()=>({width:`${o.value.width}px`,height:`${o.value.height}px`,fontSize:`${o.value.width*.15+6}px`})),l=J(()=>e.strokeWidth??Math.max(kV(o.value.width),6)),u=J(()=>e.gapPosition||e.type===`dashboard`&&`bottom`||void 0),d=J(()=>uV(e)),f=J(()=>Object.prototype.toString.call(e.strokeColor)===`[object Object]`),p=J(()=>dV({success:e.success,strokeColor:e.strokeColor})),m=J(()=>({[`${e.prefixCls}-inner`]:!0,[`${e.prefixCls}-circle-gradient`]:f.value}));return()=>{let t=U(EV,{percent:d.value,strokeWidth:l.value,trailWidth:l.value,strokeColor:p.value,strokeLinecap:e.strokeLinecap,trailColor:e.trailColor,prefixCls:e.prefixCls,gapDegree:s.value,gapPosition:u.value},null);return U(`div`,Y(Y({},r),{},{class:[m.value,r.class],style:[r.style,c.value]}),[o.value.width<=20?U(Ty,null,{default:()=>[U(`span`,null,[t])],title:n.default}):U($e,null,[t,n.default?.call(n)])])}}}),jV=u({compatConfig:{MODE:3},name:`Steps`,props:Z(Z({},sV()),{steps:Number,strokeColor:W(),trailColor:String}),setup(e,t){let{slots:n}=t,r=J(()=>Math.round(e.steps*((e.percent||0)/100))),i=J(()=>e.size??[e.size===`small`?2:14,e.strokeWidth||8]),a=J(()=>fV(i.value,`step`,{steps:e.steps,strokeWidth:e.strokeWidth||8})),o=J(()=>{let{steps:t,strokeColor:n,trailColor:i,prefixCls:o}=e,s=[];for(let e=0;eU(`div`,{class:`${e.prefixCls}-steps-outer`},[o.value,n.default?.call(n)])}}),MV=new N(`antProgressActive`,{"0%":{transform:`translateX(-100%) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(-100%) scaleX(0)`,opacity:.5},to:{transform:`translateX(0) scaleX(1)`,opacity:0}}),NV=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:Z(Z({},rn(e)),{display:`inline-block`,"&-rtl":{direction:`rtl`},"&-line":{position:`relative`,width:`100%`,fontSize:e.fontSize,marginInlineEnd:e.marginXS,marginBottom:e.marginXS},[`${t}-outer`]:{display:`inline-block`,width:`100%`},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${e.marginXS}px)`,paddingInlineEnd:`calc(2em + ${e.paddingXS}px)`}},[`${t}-inner`]:{position:`relative`,display:`inline-block`,width:`100%`,overflow:`hidden`,verticalAlign:`middle`,backgroundColor:e.progressRemainingColor,borderRadius:e.progressLineRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorInfo}},[`${t}-success-bg, ${t}-bg`]:{position:`relative`,backgroundColor:e.colorInfo,borderRadius:e.progressLineRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-success-bg`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:`inline-block`,width:`2em`,marginInlineStart:e.marginXS,color:e.progressInfoTextColor,lineHeight:1,whiteSpace:`nowrap`,textAlign:`start`,verticalAlign:`middle`,wordBreak:`normal`,[n]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:`absolute`,inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.progressLineRadius,opacity:0,animationName:MV,animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:`infinite`,content:`""`}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},PV=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.progressRemainingColor},[`&${t}-circle ${t}-inner`]:{position:`relative`,lineHeight:1,backgroundColor:`transparent`},[`&${t}-circle ${t}-text`]:{position:`absolute`,insetBlockStart:`50%`,insetInlineStart:0,width:`100%`,margin:0,padding:0,color:e.colorText,lineHeight:1,whiteSpace:`normal`,textAlign:`center`,transform:`translateY(-50%)`,[n]:{fontSize:`${e.fontSize/e.fontSizeSM}em`}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:`bottom`}}}},FV=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:`inline-block`,"&-outer":{display:`flex`,flexDirection:`row`,alignItems:`center`},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.progressRemainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.colorInfo}}}}}},IV=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},LV=v(`Progress`,e=>{let t=e.marginXXS/2,n=B(e,{progressLineRadius:100,progressInfoTextColor:e.colorText,progressDefaultColor:e.colorInfo,progressRemainingColor:e.colorFillSecondary,progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:`2.4s`});return[NV(n),PV(n),FV(n),IV(n)]}),RV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iArray.isArray(e.strokeColor)?e.strokeColor[0]:e.strokeColor),l=J(()=>{let{percent:t=0}=e,n=lV(e);return parseInt(n===void 0?t.toString():n.toString(),10)}),u=J(()=>{let{status:t}=e;return!oV.includes(t)&&l.value>=100?`success`:t||`normal`}),d=J(()=>{let{type:t,showInfo:n,size:r}=e,o=i.value;return{[o]:!0,[`${o}-inline-circle`]:t===`circle`&&fV(r,`circle`).width<=20,[`${o}-${t===`dashboard`&&`circle`||t}`]:!0,[`${o}-status-${u.value}`]:!0,[`${o}-show-info`]:n,[`${o}-${r}`]:r,[`${o}-rtl`]:a.value===`rtl`,[s.value]:!0}}),f=J(()=>typeof e.strokeColor==`string`||Array.isArray(e.strokeColor)?e.strokeColor:void 0),p=()=>{let{showInfo:t,format:r,type:a,percent:o,title:s}=e,c=lV(e);if(!t)return null;let l,d=r||n?.format||(e=>`${e}%`),f=a===`line`;return r||n?.format||u.value!==`exception`&&u.value!==`success`?l=d(cV(o),cV(c)):u.value===`exception`?l=U(f?tt:Pe,null,null):u.value===`success`&&(l=U(f?qe:Df,null,null)),U(`span`,{class:`${i.value}-text`,title:s===void 0&&typeof l==`string`?l:void 0},[l])};return()=>{let{type:t,steps:n,title:s}=e,{class:l}=r,m=RV(r,[`class`]),h=p(),g;return t===`line`?g=n?U(jV,Y(Y({},e),{},{strokeColor:f.value,prefixCls:i.value,steps:n}),{default:()=>[h]}):U(_V,Y(Y({},e),{},{strokeColor:c.value,prefixCls:i.value,direction:a.value}),{default:()=>[h]}):(t===`circle`||t===`dashboard`)&&(g=U(AV,Y(Y({},e),{},{prefixCls:i.value,strokeColor:c.value,progressStatus:u.value}),{default:()=>[h]})),o(U(`div`,Y(Y({role:`progressbar`},m),{},{class:[d.value,l],title:s}),[g]))}}}));function BV(e){let t=e.scrollX,n=`scrollLeft`;if(typeof t!=`number`){let r=e.document;t=r.documentElement[n],typeof t!=`number`&&(t=r.body[n])}return t}function VV(e){let t,n,r=e.ownerDocument,{body:i}=r,a=r&&r.documentElement,o=e.getBoundingClientRect();return t=o.left,n=o.top,t-=a.clientLeft||i.clientLeft||0,n-=a.clientTop||i.clientTop||0,{left:t,top:n}}function HV(e){let t=VV(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=BV(r),t.left}var UV={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z`}}]},name:`star`,theme:`filled`};function WV(e){for(var t=1;t{let{index:r}=e;n(`hover`,t,r)},i=t=>{let{index:r}=e;n(`click`,t,r)},a=t=>{let{index:r}=e;t.keyCode===13&&n(`click`,t,r)},o=J(()=>{let{prefixCls:t,index:n,value:r,allowHalf:i,focused:a}=e,o=n+1,s=t;return r===0&&n===0&&a?s+=` ${t}-focused`:i&&r+.5>=o&&r{let{disabled:t,prefixCls:n,characterRender:s,character:c,index:l,count:u,value:d}=e,f=typeof c==`function`?c({disabled:t,prefixCls:n,index:l,count:u,value:d}):c,p=U(`li`,{class:o.value},[U(`div`,{onClick:t?null:i,onKeydown:t?null:a,onMousemove:t?null:r,role:`radio`,"aria-checked":d>l?`true`:`false`,"aria-posinset":l+1,"aria-setsize":u,tabindex:t?-1:0},[U(`div`,{class:`${n}-first`},[f]),U(`div`,{class:`${n}-second`},[f])])]);return s&&(p=s(p,e)),p}}}),JV=e=>{let{componentCls:t}=e;return{[`${t}-star`]:{position:`relative`,display:`inline-block`,color:`inherit`,cursor:`pointer`,"&:not(:last-child)":{marginInlineEnd:e.marginXS},"> div":{transition:`all ${e.motionDurationMid}, outline 0s`,"&:hover":{transform:e.rateStarHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${e.lineWidth}px dashed ${e.rateStarColor}`,transform:e.rateStarHoverScale}},"&-first, &-second":{color:e.defaultColor,transition:`all ${e.motionDurationMid}`,userSelect:`none`,[e.iconCls]:{verticalAlign:`middle`}},"&-first":{position:`absolute`,top:0,insetInlineStart:0,width:`50%`,height:`100%`,overflow:`hidden`,opacity:0},[`&-half ${t}-star-first, &-half ${t}-star-second`]:{opacity:1},[`&-half ${t}-star-first, &-full ${t}-star-second`]:{color:`inherit`}}}},YV=e=>({[`&-rtl${e.componentCls}`]:{direction:`rtl`}}),XV=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z({},rn(e)),{display:`inline-block`,margin:0,padding:0,color:e.rateStarColor,fontSize:e.rateStarSize,lineHeight:`unset`,listStyle:`none`,outline:`none`,[`&-disabled${t} ${t}-star`]:{cursor:`default`,"&:hover":{transform:`scale(1)`}}}),JV(e)),{[`+ ${t}-text`]:{display:`inline-block`,marginInlineStart:e.marginXS,fontSize:e.fontSize}}),YV(e))}},ZV=v(`Rate`,e=>{let{colorFillContent:t}=e;return[XV(B(e,{rateStarColor:e[`yellow-6`],rateStarSize:e.controlHeightLG*.5,rateStarHoverScale:`scale(1.1)`,defaultColor:t}))]}),QV=a(u({compatConfig:{MODE:3},name:`ARate`,inheritAttrs:!1,props:Zn({prefixCls:String,count:Number,value:Number,allowHalf:{type:Boolean,default:void 0},allowClear:{type:Boolean,default:void 0},tooltips:Array,disabled:{type:Boolean,default:void 0},character:f.any,autofocus:{type:Boolean,default:void 0},tabindex:f.oneOfType([f.number,f.string]),direction:String,id:String,onChange:Function,onHoverChange:Function,"onUpdate:value":Function,onFocus:Function,onBlur:Function,onKeydown:Function},{value:0,count:5,allowHalf:!1,allowClear:!0,tabindex:0,direction:`ltr`}),setup(e,t){let{slots:n,attrs:r,emit:i,expose:a}=t,{prefixCls:o,direction:s}=X(`rate`,e),[c,l]=ZV(o),u=zf(),d=H(),[f,p]=CE(),m=Ne({value:e.value,focused:!1,cleanedValue:null,hoverValue:void 0});G(()=>e.value,()=>{m.value=e.value});let h=e=>ae(p.value.get(e)),g=(t,n)=>{let r=s.value===`rtl`,i=t+1;if(e.allowHalf){let e=h(t),a=HV(e),o=e.clientWidth;(r&&n-a>o/2||!r&&n-a{e.value===void 0&&(m.value=t),i(`update:value`,t),i(`change`,t),u.onFieldChange()},v=(e,t)=>{let n=g(t,e.pageX);n!==m.cleanedValue&&(m.hoverValue=n,m.cleanedValue=null),i(`hoverChange`,n)},y=()=>{m.hoverValue=void 0,m.cleanedValue=null,i(`hoverChange`,void 0)},b=(t,n)=>{let{allowClear:r}=e,i=g(n,t.pageX),a=!1;r&&(a=i===m.value),y(),_(a?0:i),m.cleanedValue=a?i:null},x=e=>{m.focused=!0,i(`focus`,e)},S=e=>{m.focused=!1,i(`blur`,e),u.onFieldBlur()},C=t=>{let{keyCode:n}=t,{count:r,allowHalf:a}=e,o=s.value===`rtl`;n===$.RIGHT&&m.value0&&!o||n===$.RIGHT&&m.value>0&&o?(a?m.value-=.5:--m.value,_(m.value),t.preventDefault()):n===$.LEFT&&m.value{e.disabled||d.value.focus()};a({focus:w,blur:()=>{e.disabled||d.value.blur()}}),V(()=>{let{autofocus:t,disabled:n}=e;t&&!n&&w()});let T=(t,n)=>{let{index:r}=n,{tooltips:i}=e;return i?U(Ty,{title:i[r]},{default:()=>[t]}):t};return()=>{let{count:t,allowHalf:i,disabled:a,tabindex:p,id:h=u.id.value}=e,{class:g,style:_}=r,w=[],E=a?`${o.value}-disabled`:``,D=e.character||n.character||(()=>U(KV,null,null));for(let e=0;eU(`svg`,{width:`252`,height:`294`},[U(`defs`,null,[U(`path`,{d:`M0 .387h251.772v251.772H0z`},null)]),U(`g`,{fill:`none`,"fill-rule":`evenodd`},[U(`g`,{transform:`translate(0 .012)`},[U(`mask`,{fill:`#fff`},null),U(`path`,{d:`M0 127.32v-2.095C0 56.279 55.892.387 124.838.387h2.096c68.946 0 124.838 55.892 124.838 124.838v2.096c0 68.946-55.892 124.838-124.838 124.838h-2.096C55.892 252.16 0 196.267 0 127.321`,fill:`#E4EBF7`,mask:`url(#b)`},null)]),U(`path`,{d:`M39.755 130.84a8.276 8.276 0 1 1-16.468-1.66 8.276 8.276 0 0 1 16.468 1.66`,fill:`#FFF`},null),U(`path`,{d:`M36.975 134.297l10.482 5.943M48.373 146.508l-12.648 10.788`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M39.875 159.352a5.667 5.667 0 1 1-11.277-1.136 5.667 5.667 0 0 1 11.277 1.136M57.588 143.247a5.708 5.708 0 1 1-11.358-1.145 5.708 5.708 0 0 1 11.358 1.145M99.018 26.875l29.82-.014a4.587 4.587 0 1 0-.003-9.175l-29.82.013a4.587 4.587 0 1 0 .003 9.176M110.424 45.211l29.82-.013a4.588 4.588 0 0 0-.004-9.175l-29.82.013a4.587 4.587 0 1 0 .004 9.175`,fill:`#FFF`},null),U(`path`,{d:`M112.798 26.861v-.002l15.784-.006a4.588 4.588 0 1 0 .003 9.175l-15.783.007v-.002a4.586 4.586 0 0 0-.004-9.172M184.523 135.668c-.553 5.485-5.447 9.483-10.931 8.93-5.485-.553-9.483-5.448-8.93-10.932.552-5.485 5.447-9.483 10.932-8.93 5.485.553 9.483 5.447 8.93 10.932`,fill:`#FFF`},null),U(`path`,{d:`M179.26 141.75l12.64 7.167M193.006 156.477l-15.255 13.011`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M184.668 170.057a6.835 6.835 0 1 1-13.6-1.372 6.835 6.835 0 0 1 13.6 1.372M203.34 153.325a6.885 6.885 0 1 1-13.7-1.382 6.885 6.885 0 0 1 13.7 1.382`,fill:`#FFF`},null),U(`path`,{d:`M151.931 192.324a2.222 2.222 0 1 1-4.444 0 2.222 2.222 0 0 1 4.444 0zM225.27 116.056a2.222 2.222 0 1 1-4.445 0 2.222 2.222 0 0 1 4.444 0zM216.38 151.08a2.223 2.223 0 1 1-4.446-.001 2.223 2.223 0 0 1 4.446 0zM176.917 107.636a2.223 2.223 0 1 1-4.445 0 2.223 2.223 0 0 1 4.445 0zM195.291 92.165a2.223 2.223 0 1 1-4.445 0 2.223 2.223 0 0 1 4.445 0zM202.058 180.711a2.223 2.223 0 1 1-4.446 0 2.223 2.223 0 0 1 4.446 0z`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{stroke:`#FFF`,"stroke-width":`2`,d:`M214.404 153.302l-1.912 20.184-10.928 5.99M173.661 174.792l-6.356 9.814h-11.36l-4.508 6.484M174.941 125.168v-15.804M220.824 117.25l-12.84 7.901-15.31-7.902V94.39`},null),U(`path`,{d:`M166.588 65.936h-3.951a4.756 4.756 0 0 1-4.743-4.742 4.756 4.756 0 0 1 4.743-4.743h3.951a4.756 4.756 0 0 1 4.743 4.743 4.756 4.756 0 0 1-4.743 4.742`,fill:`#FFF`},null),U(`path`,{d:`M174.823 30.03c0-16.281 13.198-29.48 29.48-29.48 16.28 0 29.48 13.199 29.48 29.48 0 16.28-13.2 29.48-29.48 29.48-16.282 0-29.48-13.2-29.48-29.48`,fill:`#1890FF`},null),U(`path`,{d:`M205.952 38.387c.5.5.785 1.142.785 1.928s-.286 1.465-.785 1.964c-.572.5-1.214.75-2 .75-.785 0-1.429-.285-1.929-.785-.572-.5-.82-1.143-.82-1.929s.248-1.428.82-1.928c.5-.5 1.144-.75 1.93-.75.785 0 1.462.25 1.999.75m4.285-19.463c1.428 1.249 2.143 2.963 2.143 5.142 0 1.712-.427 3.13-1.219 4.25-.067.096-.137.18-.218.265-.416.429-1.41 1.346-2.956 2.699a5.07 5.07 0 0 0-1.428 1.75 5.207 5.207 0 0 0-.536 2.357v.5h-4.107v-.5c0-1.357.215-2.536.714-3.5.464-.964 1.857-2.464 4.178-4.536l.43-.5c.643-.785.964-1.643.964-2.535 0-1.18-.358-2.108-1-2.785-.678-.68-1.643-1.001-2.858-1.001-1.536 0-2.642.464-3.357 1.43-.37.5-.621 1.135-.76 1.904a1.999 1.999 0 0 1-1.971 1.63h-.004c-1.277 0-2.257-1.183-1.98-2.43.337-1.518 1.02-2.78 2.073-3.784 1.536-1.5 3.607-2.25 6.25-2.25 2.32 0 4.214.607 5.642 1.894`,fill:`#FFF`},null),U(`path`,{d:`M52.04 76.131s21.81 5.36 27.307 15.945c5.575 10.74-6.352 9.26-15.73 4.935-10.86-5.008-24.7-11.822-11.577-20.88`,fill:`#FFB594`},null),U(`path`,{d:`M90.483 67.504l-.449 2.893c-.753.49-4.748-2.663-4.748-2.663l-1.645.748-1.346-5.684s6.815-4.589 8.917-5.018c2.452-.501 9.884.94 10.7 2.278 0 0 1.32.486-2.227.69-3.548.203-5.043.447-6.79 3.132-1.747 2.686-2.412 3.624-2.412 3.624`,fill:`#FFC6A0`},null),U(`path`,{d:`M128.055 111.367c-2.627-7.724-6.15-13.18-8.917-15.478-3.5-2.906-9.34-2.225-11.366-4.187-1.27-1.231-3.215-1.197-3.215-1.197s-14.98-3.158-16.828-3.479c-2.37-.41-2.124-.714-6.054-1.405-1.57-1.907-2.917-1.122-2.917-1.122l-7.11-1.383c-.853-1.472-2.423-1.023-2.423-1.023l-2.468-.897c-1.645 9.976-7.74 13.796-7.74 13.796 1.795 1.122 15.703 8.3 15.703 8.3l5.107 37.11s-3.321 5.694 1.346 9.109c0 0 19.883-3.743 34.921-.329 0 0 3.047-2.546.972-8.806.523-3.01 1.394-8.263 1.736-11.622.385.772 2.019 1.918 3.14 3.477 0 0 9.407-7.365 11.052-14.012-.832-.723-1.598-1.585-2.267-2.453-.567-.736-.358-2.056-.765-2.717-.669-1.084-1.804-1.378-1.907-1.682`,fill:`#FFF`},null),U(`path`,{d:`M101.09 289.998s4.295 2.041 7.354 1.021c2.821-.94 4.53.668 7.08 1.178 2.55.51 6.874 1.1 11.686-1.26-.103-5.51-6.889-3.98-11.96-6.713-2.563-1.38-3.784-4.722-3.598-8.799h-9.402s-1.392 10.52-1.16 14.573`,fill:`#CBD1D1`},null),U(`path`,{d:`M101.067 289.826s2.428 1.271 6.759.653c3.058-.437 3.712.481 7.423 1.031 3.712.55 10.724-.069 11.823-.894.413 1.1-.343 2.063-.343 2.063s-1.512.603-4.812.824c-2.03.136-5.8.291-7.607-.503-1.787-1.375-5.247-1.903-5.728-.241-3.918.95-7.355-.286-7.355-.286l-.16-2.647z`,fill:`#2B0849`},null),U(`path`,{d:`M108.341 276.044h3.094s-.103 6.702 4.536 8.558c-4.64.618-8.558-2.303-7.63-8.558`,fill:`#A4AABA`},null),U(`path`,{d:`M57.542 272.401s-2.107 7.416-4.485 12.306c-1.798 3.695-4.225 7.492 5.465 7.492 6.648 0 8.953-.48 7.423-6.599-1.53-6.12.266-13.199.266-13.199h-8.669z`,fill:`#CBD1D1`},null),U(`path`,{d:`M51.476 289.793s2.097 1.169 6.633 1.169c6.083 0 8.249-1.65 8.249-1.65s.602 1.114-.619 2.165c-.993.855-3.597 1.591-7.39 1.546-4.145-.048-5.832-.566-6.736-1.168-.825-.55-.687-1.58-.137-2.062`,fill:`#2B0849`},null),U(`path`,{d:`M58.419 274.304s.033 1.519-.314 2.93c-.349 1.42-1.078 3.104-1.13 4.139-.058 1.151 4.537 1.58 5.155.034.62-1.547 1.294-6.427 1.913-7.252.619-.825-4.903-2.119-5.624.15`,fill:`#A4AABA`},null),U(`path`,{d:`M99.66 278.514l13.378.092s1.298-54.52 1.853-64.403c.554-9.882 3.776-43.364 1.002-63.128l-12.547-.644-22.849.78s-.434 3.966-1.195 9.976c-.063.496-.682.843-.749 1.365-.075.585.423 1.354.32 1.966-2.364 14.08-6.377 33.104-8.744 46.677-.116.666-1.234 1.009-1.458 2.691-.04.302.211 1.525.112 1.795-6.873 18.744-10.949 47.842-14.277 61.885l14.607-.014s2.197-8.57 4.03-16.97c2.811-12.886 23.111-85.01 23.111-85.01l3.016-.521 1.043 46.35s-.224 1.234.337 2.02c.56.785-.56 1.123-.392 2.244l.392 1.794s-.449 7.178-.898 11.89c-.448 4.71-.092 39.165-.092 39.165`,fill:`#7BB2F9`},null),U(`path`,{d:`M76.085 221.626c1.153.094 4.038-2.019 6.955-4.935M106.36 225.142s2.774-1.11 6.103-3.883`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M107.275 222.1s2.773-1.11 6.102-3.884`,stroke:`#648BD8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M74.74 224.767s2.622-.591 6.505-3.365M86.03 151.634c-.27 3.106.3 8.525-4.336 9.123M103.625 149.88s.11 14.012-1.293 15.065c-2.219 1.664-2.99 1.944-2.99 1.944M99.79 150.438s.035 12.88-1.196 24.377M93.673 175.911s7.212-1.664 9.431-1.664M74.31 205.861a212.013 212.013 0 0 1-.979 4.56s-1.458 1.832-1.009 3.776c.449 1.944-.947 2.045-4.985 15.355-1.696 5.59-4.49 18.591-6.348 27.597l-.231 1.12M75.689 197.807a320.934 320.934 0 0 1-.882 4.754M82.591 152.233L81.395 162.7s-1.097.15-.5 2.244c.113 1.346-2.674 15.775-5.18 30.43M56.12 274.418h13.31`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M116.241 148.22s-17.047-3.104-35.893.2c.158 2.514-.003 4.15-.003 4.15s14.687-2.818 35.67-.312c.252-2.355.226-4.038.226-4.038`,fill:`#192064`},null),U(`path`,{d:`M106.322 151.165l.003-4.911a.81.81 0 0 0-.778-.815c-2.44-.091-5.066-.108-7.836-.014a.818.818 0 0 0-.789.815l-.003 4.906a.81.81 0 0 0 .831.813c2.385-.06 4.973-.064 7.73.017a.815.815 0 0 0 .842-.81`,fill:`#FFF`},null),U(`path`,{d:`M105.207 150.233l.002-3.076a.642.642 0 0 0-.619-.646 94.321 94.321 0 0 0-5.866-.01.65.65 0 0 0-.63.647v3.072a.64.64 0 0 0 .654.644 121.12 121.12 0 0 1 5.794.011c.362.01.665-.28.665-.642`,fill:`#192064`},null),U(`path`,{d:`M100.263 275.415h12.338M101.436 270.53c.006 3.387.042 5.79.111 6.506M101.451 264.548a915.75 915.75 0 0 0-.015 4.337M100.986 174.965l.898 44.642s.673 1.57-.225 2.692c-.897 1.122 2.468.673.898 2.243-1.57 1.57.897 1.122 0 3.365-.596 1.489-.994 21.1-1.096 35.146`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M46.876 83.427s-.516 6.045 7.223 5.552c11.2-.712 9.218-9.345 31.54-21.655-.786-2.708-2.447-4.744-2.447-4.744s-11.068 3.11-22.584 8.046c-6.766 2.9-13.395 6.352-13.732 12.801M104.46 91.057l.941-5.372-8.884-11.43-5.037 5.372-1.74 7.834a.321.321 0 0 0 .108.32c.965.8 6.5 5.013 14.347 3.544a.332.332 0 0 0 .264-.268`,fill:`#FFC6A0`},null),U(`path`,{d:`M93.942 79.387s-4.533-2.853-2.432-6.855c1.623-3.09 4.513 1.133 4.513 1.133s.52-3.642 3.121-3.642c.52-1.04 1.561-4.162 1.561-4.162s11.445 2.601 13.526 3.121c0 5.203-2.304 19.424-7.84 19.861-8.892.703-12.449-9.456-12.449-9.456`,fill:`#FFC6A0`},null),U(`path`,{d:`M113.874 73.446c2.601-2.081 3.47-9.722 3.47-9.722s-2.479-.49-6.64-2.05c-4.683-2.081-12.798-4.747-17.48.976-9.668 3.223-2.05 19.823-2.05 19.823l2.713-3.021s-3.935-3.287-2.08-6.243c2.17-3.462 3.92 1.073 3.92 1.073s.637-2.387 3.581-3.342c.355-.71 1.036-2.674 1.432-3.85a1.073 1.073 0 0 1 1.263-.704c2.4.558 8.677 2.019 11.356 2.662.522.125.871.615.82 1.15l-.305 3.248z`,fill:`#520038`},null),U(`path`,{d:`M104.977 76.064c-.103.61-.582 1.038-1.07.956-.489-.083-.801-.644-.698-1.254.103-.61.582-1.038 1.07-.956.488.082.8.644.698 1.254M112.132 77.694c-.103.61-.582 1.038-1.07.956-.488-.083-.8-.644-.698-1.254.103-.61.582-1.038 1.07-.956.488.082.8.643.698 1.254`,fill:`#552950`},null),U(`path`,{stroke:`#DB836E`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M110.13 74.84l-.896 1.61-.298 4.357h-2.228`},null),U(`path`,{d:`M110.846 74.481s1.79-.716 2.506.537`,stroke:`#5C2552`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M92.386 74.282s.477-1.114 1.113-.716c.637.398 1.274 1.433.558 1.99-.717.556.159 1.67.159 1.67`,stroke:`#DB836E`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M103.287 72.93s1.83 1.113 4.137.954`,stroke:`#5C2552`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M103.685 81.762s2.227 1.193 4.376 1.193M104.64 84.308s.954.398 1.511.318M94.693 81.205s2.308 7.4 10.424 7.639`,stroke:`#DB836E`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M81.45 89.384s.45 5.647-4.935 12.787M69 82.654s-.726 9.282-8.204 14.206`,stroke:`#E4EBF7`,"stroke-width":`1.101`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M129.405 122.865s-5.272 7.403-9.422 10.768`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M119.306 107.329s.452 4.366-2.127 32.062`,stroke:`#E4EBF7`,"stroke-width":`1.101`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M150.028 151.232h-49.837a1.01 1.01 0 0 1-1.01-1.01v-31.688c0-.557.452-1.01 1.01-1.01h49.837c.558 0 1.01.453 1.01 1.01v31.688a1.01 1.01 0 0 1-1.01 1.01`,fill:`#F2D7AD`},null),U(`path`,{d:`M150.29 151.232h-19.863v-33.707h20.784v32.786a.92.92 0 0 1-.92.92`,fill:`#F4D19D`},null),U(`path`,{d:`M123.554 127.896H92.917a.518.518 0 0 1-.425-.816l6.38-9.113c.193-.277.51-.442.85-.442h31.092l-7.26 10.371z`,fill:`#F2D7AD`},null),U(`path`,{fill:`#CC9B6E`,d:`M123.689 128.447H99.25v-.519h24.169l7.183-10.26.424.298z`},null),U(`path`,{d:`M158.298 127.896h-18.669a2.073 2.073 0 0 1-1.659-.83l-7.156-9.541h19.965c.49 0 .95.23 1.244.622l6.69 8.92a.519.519 0 0 1-.415.83`,fill:`#F4D19D`},null),U(`path`,{fill:`#CC9B6E`,d:`M157.847 128.479h-19.384l-7.857-10.475.415-.31 7.7 10.266h19.126zM130.554 150.685l-.032-8.177.519-.002.032 8.177z`},null),U(`path`,{fill:`#CC9B6E`,d:`M130.511 139.783l-.08-21.414.519-.002.08 21.414zM111.876 140.932l-.498-.143 1.479-5.167.498.143zM108.437 141.06l-2.679-2.935 2.665-3.434.41.318-2.397 3.089 2.384 2.612zM116.607 141.06l-.383-.35 2.383-2.612-2.397-3.089.41-.318 2.665 3.434z`},null),U(`path`,{d:`M154.316 131.892l-3.114-1.96.038 3.514-1.043.092c-1.682.115-3.634.23-4.789.23-1.902 0-2.693 2.258 2.23 2.648l-2.645-.596s-2.168 1.317.504 2.3c0 0-1.58 1.217.561 2.58-.584 3.504 5.247 4.058 7.122 3.59 1.876-.47 4.233-2.359 4.487-5.16.28-3.085-.89-5.432-3.35-7.238`,fill:`#FFC6A0`},null),U(`path`,{d:`M153.686 133.577s-6.522.47-8.36.372c-1.836-.098-1.904 2.19 2.359 2.264 3.739.15 5.451-.044 5.451-.044`,stroke:`#DB836E`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M145.16 135.877c-1.85 1.346.561 2.355.561 2.355s3.478.898 6.73.617`,stroke:`#DB836E`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M151.89 141.71s-6.28.111-6.73-2.132c-.223-1.346.45-1.402.45-1.402M146.114 140.868s-1.103 3.16 5.44 3.533M151.202 129.932v3.477M52.838 89.286c3.533-.337 8.423-1.248 13.582-7.754`,stroke:`#DB836E`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M168.567 248.318a6.647 6.647 0 0 1-6.647-6.647v-66.466a6.647 6.647 0 1 1 13.294 0v66.466a6.647 6.647 0 0 1-6.647 6.647`,fill:`#5BA02E`},null),U(`path`,{d:`M176.543 247.653a6.647 6.647 0 0 1-6.646-6.647v-33.232a6.647 6.647 0 1 1 13.293 0v33.232a6.647 6.647 0 0 1-6.647 6.647`,fill:`#92C110`},null),U(`path`,{d:`M186.443 293.613H158.92a3.187 3.187 0 0 1-3.187-3.187v-46.134a3.187 3.187 0 0 1 3.187-3.187h27.524a3.187 3.187 0 0 1 3.187 3.187v46.134a3.187 3.187 0 0 1-3.187 3.187`,fill:`#F2D7AD`},null),U(`path`,{d:`M88.979 89.48s7.776 5.384 16.6 2.842`,stroke:`#E4EBF7`,"stroke-width":`1.101`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null)])]),iH=()=>U(`svg`,{width:`254`,height:`294`},[U(`defs`,null,[U(`path`,{d:`M0 .335h253.49v253.49H0z`},null),U(`path`,{d:`M0 293.665h253.49V.401H0z`},null)]),U(`g`,{fill:`none`,"fill-rule":`evenodd`},[U(`g`,{transform:`translate(0 .067)`},[U(`mask`,{fill:`#fff`},null),U(`path`,{d:`M0 128.134v-2.11C0 56.608 56.273.334 125.69.334h2.11c69.416 0 125.69 56.274 125.69 125.69v2.11c0 69.417-56.274 125.69-125.69 125.69h-2.11C56.273 253.824 0 197.551 0 128.134`,fill:`#E4EBF7`,mask:`url(#b)`},null)]),U(`path`,{d:`M39.989 132.108a8.332 8.332 0 1 1-16.581-1.671 8.332 8.332 0 0 1 16.58 1.671`,fill:`#FFF`},null),U(`path`,{d:`M37.19 135.59l10.553 5.983M48.665 147.884l-12.734 10.861`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M40.11 160.816a5.706 5.706 0 1 1-11.354-1.145 5.706 5.706 0 0 1 11.354 1.145M57.943 144.6a5.747 5.747 0 1 1-11.436-1.152 5.747 5.747 0 0 1 11.436 1.153M99.656 27.434l30.024-.013a4.619 4.619 0 1 0-.004-9.238l-30.024.013a4.62 4.62 0 0 0 .004 9.238M111.14 45.896l30.023-.013a4.62 4.62 0 1 0-.004-9.238l-30.024.013a4.619 4.619 0 1 0 .004 9.238`,fill:`#FFF`},null),U(`path`,{d:`M113.53 27.421v-.002l15.89-.007a4.619 4.619 0 1 0 .005 9.238l-15.892.007v-.002a4.618 4.618 0 0 0-.004-9.234M150.167 70.091h-3.979a4.789 4.789 0 0 1-4.774-4.775 4.788 4.788 0 0 1 4.774-4.774h3.979a4.789 4.789 0 0 1 4.775 4.774 4.789 4.789 0 0 1-4.775 4.775`,fill:`#FFF`},null),U(`path`,{d:`M171.687 30.234c0-16.392 13.289-29.68 29.681-29.68 16.392 0 29.68 13.288 29.68 29.68 0 16.393-13.288 29.681-29.68 29.681s-29.68-13.288-29.68-29.68`,fill:`#FF603B`},null),U(`path`,{d:`M203.557 19.435l-.676 15.035a1.514 1.514 0 0 1-3.026 0l-.675-15.035a2.19 2.19 0 1 1 4.377 0m-.264 19.378c.513.477.77 1.1.77 1.87s-.257 1.393-.77 1.907c-.55.476-1.21.733-1.943.733a2.545 2.545 0 0 1-1.87-.77c-.55-.514-.806-1.136-.806-1.87 0-.77.256-1.393.806-1.87.513-.513 1.137-.733 1.87-.733.77 0 1.43.22 1.943.733`,fill:`#FFF`},null),U(`path`,{d:`M119.3 133.275c4.426-.598 3.612-1.204 4.079-4.778.675-5.18-3.108-16.935-8.262-25.118-1.088-10.72-12.598-11.24-12.598-11.24s4.312 4.895 4.196 16.199c1.398 5.243.804 14.45.804 14.45s5.255 11.369 11.78 10.487`,fill:`#FFB594`},null),U(`path`,{d:`M100.944 91.61s1.463-.583 3.211.582c8.08 1.398 10.368 6.706 11.3 11.368 1.864 1.282 1.864 2.33 1.864 3.496.365.777 1.515 3.03 1.515 3.03s-7.225 1.748-10.954 6.758c-1.399-6.41-6.936-25.235-6.936-25.235`,fill:`#FFF`},null),U(`path`,{d:`M94.008 90.5l1.019-5.815-9.23-11.874-5.233 5.581-2.593 9.863s8.39 5.128 16.037 2.246`,fill:`#FFB594`},null),U(`path`,{d:`M82.931 78.216s-4.557-2.868-2.445-6.892c1.632-3.107 4.537 1.139 4.537 1.139s.524-3.662 3.139-3.662c.523-1.046 1.569-4.184 1.569-4.184s11.507 2.615 13.6 3.138c-.001 5.23-2.317 19.529-7.884 19.969-8.94.706-12.516-9.508-12.516-9.508`,fill:`#FFC6A0`},null),U(`path`,{d:`M102.971 72.243c2.616-2.093 3.489-9.775 3.489-9.775s-2.492-.492-6.676-2.062c-4.708-2.092-12.867-4.771-17.575.982-9.54 4.41-2.062 19.93-2.062 19.93l2.729-3.037s-3.956-3.304-2.092-6.277c2.183-3.48 3.943 1.08 3.943 1.08s.64-2.4 3.6-3.36c.356-.714 1.04-2.69 1.44-3.872a1.08 1.08 0 0 1 1.27-.707c2.41.56 8.723 2.03 11.417 2.676.524.126.876.619.825 1.156l-.308 3.266z`,fill:`#520038`},null),U(`path`,{d:`M101.22 76.514c-.104.613-.585 1.044-1.076.96-.49-.082-.805-.646-.702-1.26.104-.613.585-1.044 1.076-.961.491.083.805.647.702 1.26M94.26 75.074c-.104.613-.585 1.044-1.076.96-.49-.082-.805-.646-.702-1.26.104-.613.585-1.044 1.076-.96.491.082.805.646.702 1.26`,fill:`#552950`},null),U(`path`,{stroke:`#DB836E`,"stroke-width":`1.063`,"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M99.206 73.644l-.9 1.62-.3 4.38h-2.24`},null),U(`path`,{d:`M99.926 73.284s1.8-.72 2.52.54`,stroke:`#5C2552`,"stroke-width":`1.117`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M81.367 73.084s.48-1.12 1.12-.72c.64.4 1.28 1.44.56 2s.16 1.68.16 1.68`,stroke:`#DB836E`,"stroke-width":`1.117`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M92.326 71.724s1.84 1.12 4.16.96`,stroke:`#5C2552`,"stroke-width":`1.117`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M92.726 80.604s2.24 1.2 4.4 1.2M93.686 83.164s.96.4 1.52.32M83.687 80.044s1.786 6.547 9.262 7.954`,stroke:`#DB836E`,"stroke-width":`1.063`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M95.548 91.663s-1.068 2.821-8.298 2.105c-7.23-.717-10.29-5.044-10.29-5.044`,stroke:`#E4EBF7`,"stroke-width":`1.136`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M78.126 87.478s6.526 4.972 16.47 2.486c0 0 9.577 1.02 11.536 5.322 5.36 11.77.543 36.835 0 39.962 3.496 4.055-.466 8.483-.466 8.483-15.624-3.548-35.81-.6-35.81-.6-4.849-3.546-1.223-9.044-1.223-9.044L62.38 110.32c-2.485-15.227.833-19.803 3.549-20.743 3.03-1.049 8.04-1.282 8.04-1.282.496-.058 1.08-.076 1.37-.233 2.36-1.282 2.787-.583 2.787-.583`,fill:`#FFF`},null),U(`path`,{d:`M65.828 89.81s-6.875.465-7.59 8.156c-.466 8.857 3.03 10.954 3.03 10.954s6.075 22.102 16.796 22.957c8.39-2.176 4.758-6.702 4.661-11.42-.233-11.304-7.108-16.897-7.108-16.897s-4.212-13.75-9.789-13.75`,fill:`#FFC6A0`},null),U(`path`,{d:`M71.716 124.225s.855 11.264 9.828 6.486c4.765-2.536 7.581-13.828 9.789-22.568 1.456-5.768 2.58-12.197 2.58-12.197l-4.973-1.709s-2.408 5.516-7.769 12.275c-4.335 5.467-9.144 11.11-9.455 17.713`,fill:`#FFC6A0`},null),U(`path`,{d:`M108.463 105.191s1.747 2.724-2.331 30.535c2.376 2.216 1.053 6.012-.233 7.51`,stroke:`#E4EBF7`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M123.262 131.527s-.427 2.732-11.77 1.981c-15.187-1.006-25.326-3.25-25.326-3.25l.933-5.8s.723.215 9.71-.068c11.887-.373 18.714-6.07 24.964-1.022 4.039 3.263 1.489 8.16 1.489 8.16`,fill:`#FFC6A0`},null),U(`path`,{d:`M70.24 90.974s-5.593-4.739-11.054 2.68c-3.318 7.223.517 15.284 2.664 19.578-.31 3.729 2.33 4.311 2.33 4.311s.108.895 1.516 2.68c4.078-7.03 6.72-9.166 13.711-12.546-.328-.656-1.877-3.265-1.825-3.767.175-1.69-1.282-2.623-1.282-2.623s-.286-.156-1.165-2.738c-.788-2.313-2.036-5.177-4.895-7.575`,fill:`#FFF`},null),U(`path`,{d:`M90.232 288.027s4.855 2.308 8.313 1.155c3.188-1.063 5.12.755 8.002 1.331 2.881.577 7.769 1.243 13.207-1.424-.117-6.228-7.786-4.499-13.518-7.588-2.895-1.56-4.276-5.336-4.066-9.944H91.544s-1.573 11.89-1.312 16.47`,fill:`#CBD1D1`},null),U(`path`,{d:`M90.207 287.833s2.745 1.437 7.639.738c3.456-.494 3.223.66 7.418 1.282 4.195.621 13.092-.194 14.334-1.126.466 1.242-.388 2.33-.388 2.33s-1.709.682-5.438.932c-2.295.154-8.098.276-10.14-.621-2.02-1.554-4.894-1.515-6.06-.234-4.427 1.075-7.184-.31-7.184-.31l-.181-2.991z`,fill:`#2B0849`},null),U(`path`,{d:`M98.429 272.257h3.496s-.117 7.574 5.127 9.671c-5.244.7-9.672-2.602-8.623-9.671`,fill:`#A4AABA`},null),U(`path`,{d:`M44.425 272.046s-2.208 7.774-4.702 12.899c-1.884 3.874-4.428 7.854 5.729 7.854 6.97 0 9.385-.503 7.782-6.917-1.604-6.415.279-13.836.279-13.836h-9.088z`,fill:`#CBD1D1`},null),U(`path`,{d:`M38.066 290.277s2.198 1.225 6.954 1.225c6.376 0 8.646-1.73 8.646-1.73s.63 1.168-.649 2.27c-1.04.897-3.77 1.668-7.745 1.621-4.347-.05-6.115-.593-7.062-1.224-.864-.577-.72-1.657-.144-2.162`,fill:`#2B0849`},null),U(`path`,{d:`M45.344 274.041s.035 1.592-.329 3.07c-.365 1.49-1.13 3.255-1.184 4.34-.061 1.206 4.755 1.657 5.403.036.65-1.622 1.357-6.737 2.006-7.602.648-.865-5.14-2.222-5.896.156`,fill:`#A4AABA`},null),U(`path`,{d:`M89.476 277.57l13.899.095s1.349-56.643 1.925-66.909c.576-10.267 3.923-45.052 1.042-65.585l-13.037-.669-23.737.81s-.452 4.12-1.243 10.365c-.065.515-.708.874-.777 1.417-.078.608.439 1.407.332 2.044-2.455 14.627-5.797 32.736-8.256 46.837-.121.693-1.282 1.048-1.515 2.796-.042.314.22 1.584.116 1.865-7.14 19.473-12.202 52.601-15.66 67.19l15.176-.015s2.282-10.145 4.185-18.871c2.922-13.389 24.012-88.32 24.012-88.32l3.133-.954-.158 48.568s-.233 1.282.35 2.098c.583.815-.581 1.167-.408 2.331l.408 1.864s-.466 7.458-.932 12.352c-.467 4.895 1.145 40.69 1.145 40.69`,fill:`#7BB2F9`},null),U(`path`,{d:`M64.57 218.881c1.197.099 4.195-2.097 7.225-5.127M96.024 222.534s2.881-1.152 6.34-4.034`,stroke:`#648BD8`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M96.973 219.373s2.882-1.153 6.34-4.034`,stroke:`#648BD8`,"stroke-width":`1.032`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M63.172 222.144s2.724-.614 6.759-3.496M74.903 146.166c-.281 3.226.31 8.856-4.506 9.478M93.182 144.344s.115 14.557-1.344 15.65c-2.305 1.73-3.107 2.02-3.107 2.02M89.197 144.923s.269 13.144-1.01 25.088M83.525 170.71s6.81-1.051 9.116-1.051M46.026 270.045l-.892 4.538M46.937 263.289l-.815 4.157M62.725 202.503c-.33 1.618-.102 1.904-.449 3.438 0 0-2.756 1.903-2.29 3.923.466 2.02-.31 3.424-4.505 17.252-1.762 5.807-4.233 18.922-6.165 28.278-.03.144-.521 2.646-1.14 5.8M64.158 194.136c-.295 1.658-.6 3.31-.917 4.938M71.33 146.787l-1.244 10.877s-1.14.155-.519 2.33c.117 1.399-2.778 16.39-5.382 31.615M44.242 273.727H58.07`,stroke:`#648BD8`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M106.18 142.117c-3.028-.489-18.825-2.744-36.219.2a.625.625 0 0 0-.518.644c.063 1.307.044 2.343.015 2.995a.617.617 0 0 0 .716.636c3.303-.534 17.037-2.412 35.664-.266.347.04.66-.214.692-.56.124-1.347.16-2.425.17-3.029a.616.616 0 0 0-.52-.62`,fill:`#192064`},null),U(`path`,{d:`M96.398 145.264l.003-5.102a.843.843 0 0 0-.809-.847 114.104 114.104 0 0 0-8.141-.014.85.85 0 0 0-.82.847l-.003 5.097c0 .476.388.857.864.845 2.478-.064 5.166-.067 8.03.017a.848.848 0 0 0 .876-.843`,fill:`#FFF`},null),U(`path`,{d:`M95.239 144.296l.002-3.195a.667.667 0 0 0-.643-.672c-1.9-.061-3.941-.073-6.094-.01a.675.675 0 0 0-.654.672l-.002 3.192c0 .376.305.677.68.669 1.859-.042 3.874-.043 6.02.012.376.01.69-.291.691-.668`,fill:`#192064`},null),U(`path`,{d:`M90.102 273.522h12.819M91.216 269.761c.006 3.519-.072 5.55 0 6.292M90.923 263.474c-.009 1.599-.016 2.558-.016 4.505M90.44 170.404l.932 46.38s.7 1.631-.233 2.796c-.932 1.166 2.564.7.932 2.33-1.63 1.633.933 1.166 0 3.497-.618 1.546-1.031 21.921-1.138 36.513`,stroke:`#648BD8`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M73.736 98.665l2.214 4.312s2.098.816 1.865 2.68l.816 2.214M64.297 116.611c.233-.932 2.176-7.147 12.585-10.488M77.598 90.042s7.691 6.137 16.547 2.72`,stroke:`#E4EBF7`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M91.974 86.954s5.476-.816 7.574-4.545c1.297-.345.72 2.212-.33 3.671-.7.971-1.01 1.554-1.01 1.554s.194.31.155.816c-.053.697-.175.653-.272 1.048-.081.335.108.657 0 1.049-.046.17-.198.5-.382.878-.12.249-.072.687-.2.948-.231.469-1.562 1.87-2.622 2.855-3.826 3.554-5.018 1.644-6.001-.408-.894-1.865-.661-5.127-.874-6.875-.35-2.914-2.622-3.03-1.923-4.429.343-.685 2.87.69 3.263 1.748.757 2.04 2.952 1.807 2.622 1.69`,fill:`#FFC6A0`},null),U(`path`,{d:`M99.8 82.429c-.465.077-.35.272-.97 1.243-.622.971-4.817 2.932-6.39 3.224-2.589.48-2.278-1.56-4.254-2.855-1.69-1.107-3.562-.638-1.398 1.398.99.932.932 1.107 1.398 3.205.335 1.506-.64 3.67.7 5.593`,stroke:`#DB836E`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M79.543 108.673c-2.1 2.926-4.266 6.175-5.557 8.762`,stroke:`#E59788`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M87.72 124.768s-2.098-1.942-5.127-2.719c-3.03-.777-3.574-.155-5.516.078-1.942.233-3.885-.932-3.652.7.233 1.63 5.05 1.01 5.206 2.097.155 1.087-6.37 2.796-8.313 2.175-.777.777.466 1.864 2.02 2.175.233 1.554 2.253 1.554 2.253 1.554s.699 1.01 2.641 1.088c2.486 1.32 8.934-.7 10.954-1.554 2.02-.855-.466-5.594-.466-5.594`,fill:`#FFC6A0`},null),U(`path`,{d:`M73.425 122.826s.66 1.127 3.167 1.418c2.315.27 2.563.583 2.563.583s-2.545 2.894-9.07 2.272M72.416 129.274s3.826.097 4.933-.718M74.98 130.75s1.961.136 3.36-.505M77.232 131.916s1.748.019 2.914-.505M73.328 122.321s-.595-1.032 1.262-.427c1.671.544 2.833.055 5.128.155 1.389.061 3.067-.297 3.982.15 1.606.784 3.632 2.181 3.632 2.181s10.526 1.204 19.033-1.127M78.864 108.104s-8.39 2.758-13.168 12.12`,stroke:`#E59788`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M109.278 112.533s3.38-3.613 7.575-4.662`,stroke:`#E4EBF7`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M107.375 123.006s9.697-2.745 11.445-.88`,stroke:`#E59788`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M194.605 83.656l3.971-3.886M187.166 90.933l3.736-3.655M191.752 84.207l-4.462-4.56M198.453 91.057l-4.133-4.225M129.256 163.074l3.718-3.718M122.291 170.039l3.498-3.498M126.561 163.626l-4.27-4.27M132.975 170.039l-3.955-3.955`,stroke:`#BFCDDD`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M190.156 211.779h-1.604a4.023 4.023 0 0 1-4.011-4.011V175.68a4.023 4.023 0 0 1 4.01-4.01h1.605a4.023 4.023 0 0 1 4.011 4.01v32.088a4.023 4.023 0 0 1-4.01 4.01`,fill:`#A3B4C6`},null),U(`path`,{d:`M237.824 212.977a4.813 4.813 0 0 1-4.813 4.813h-86.636a4.813 4.813 0 0 1 0-9.626h86.636a4.813 4.813 0 0 1 4.813 4.813`,fill:`#A3B4C6`},null),U(`mask`,{fill:`#fff`},null),U(`path`,{fill:`#A3B4C6`,mask:`url(#d)`,d:`M154.098 190.096h70.513v-84.617h-70.513z`},null),U(`path`,{d:`M224.928 190.096H153.78a3.219 3.219 0 0 1-3.208-3.209V167.92a3.219 3.219 0 0 1 3.208-3.21h71.148a3.219 3.219 0 0 1 3.209 3.21v18.967a3.219 3.219 0 0 1-3.21 3.209M224.928 130.832H153.78a3.218 3.218 0 0 1-3.208-3.208v-18.968a3.219 3.219 0 0 1 3.208-3.209h71.148a3.219 3.219 0 0 1 3.209 3.21v18.967a3.218 3.218 0 0 1-3.21 3.208`,fill:`#BFCDDD`,mask:`url(#d)`},null),U(`path`,{d:`M159.563 120.546a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M166.98 120.546a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M174.397 120.546a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M222.539 120.546h-22.461a.802.802 0 0 1-.802-.802v-3.208c0-.443.359-.803.802-.803h22.46c.444 0 .803.36.803.803v3.208c0 .443-.36.802-.802.802`,fill:`#FFF`,mask:`url(#d)`},null),U(`path`,{d:`M224.928 160.464H153.78a3.218 3.218 0 0 1-3.208-3.209v-18.967a3.219 3.219 0 0 1 3.208-3.209h71.148a3.219 3.219 0 0 1 3.209 3.209v18.967a3.218 3.218 0 0 1-3.21 3.209`,fill:`#BFCDDD`,mask:`url(#d)`},null),U(`path`,{d:`M173.455 130.832h49.301M164.984 130.832h6.089M155.952 130.832h6.75M173.837 160.613h49.3M165.365 160.613h6.089M155.57 160.613h6.751`,stroke:`#7C90A5`,"stroke-width":`1.124`,"stroke-linecap":`round`,"stroke-linejoin":`round`,mask:`url(#d)`},null),U(`path`,{d:`M159.563 151.038a2.407 2.407 0 1 1 0-4.814 2.407 2.407 0 0 1 0 4.814M166.98 151.038a2.407 2.407 0 1 1 0-4.814 2.407 2.407 0 0 1 0 4.814M174.397 151.038a2.407 2.407 0 1 1 .001-4.814 2.407 2.407 0 0 1 0 4.814M222.539 151.038h-22.461a.802.802 0 0 1-.802-.802v-3.209c0-.443.359-.802.802-.802h22.46c.444 0 .803.36.803.802v3.209c0 .443-.36.802-.802.802M159.563 179.987a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M166.98 179.987a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M174.397 179.987a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M222.539 179.987h-22.461a.802.802 0 0 1-.802-.802v-3.209c0-.443.359-.802.802-.802h22.46c.444 0 .803.36.803.802v3.209c0 .443-.36.802-.802.802`,fill:`#FFF`,mask:`url(#d)`},null),U(`path`,{d:`M203.04 221.108h-27.372a2.413 2.413 0 0 1-2.406-2.407v-11.448a2.414 2.414 0 0 1 2.406-2.407h27.372a2.414 2.414 0 0 1 2.407 2.407V218.7a2.413 2.413 0 0 1-2.407 2.407`,fill:`#BFCDDD`,mask:`url(#d)`},null),U(`path`,{d:`M177.259 207.217v11.52M201.05 207.217v11.52`,stroke:`#A3B4C6`,"stroke-width":`1.124`,"stroke-linecap":`round`,"stroke-linejoin":`round`,mask:`url(#d)`},null),U(`path`,{d:`M162.873 267.894a9.422 9.422 0 0 1-9.422-9.422v-14.82a9.423 9.423 0 0 1 18.845 0v14.82a9.423 9.423 0 0 1-9.423 9.422`,fill:`#5BA02E`,mask:`url(#d)`},null),U(`path`,{d:`M171.22 267.83a9.422 9.422 0 0 1-9.422-9.423v-3.438a9.423 9.423 0 0 1 18.845 0v3.438a9.423 9.423 0 0 1-9.422 9.423`,fill:`#92C110`,mask:`url(#d)`},null),U(`path`,{d:`M181.31 293.666h-27.712a3.209 3.209 0 0 1-3.209-3.21V269.79a3.209 3.209 0 0 1 3.209-3.21h27.711a3.209 3.209 0 0 1 3.209 3.21v20.668a3.209 3.209 0 0 1-3.209 3.209`,fill:`#F2D7AD`,mask:`url(#d)`},null)])]),aH=()=>U(`svg`,{width:`251`,height:`294`},[U(`g`,{fill:`none`,"fill-rule":`evenodd`},[U(`path`,{d:`M0 129.023v-2.084C0 58.364 55.591 2.774 124.165 2.774h2.085c68.574 0 124.165 55.59 124.165 124.165v2.084c0 68.575-55.59 124.166-124.165 124.166h-2.085C55.591 253.189 0 197.598 0 129.023`,fill:`#E4EBF7`},null),U(`path`,{d:`M41.417 132.92a8.231 8.231 0 1 1-16.38-1.65 8.231 8.231 0 0 1 16.38 1.65`,fill:`#FFF`},null),U(`path`,{d:`M38.652 136.36l10.425 5.91M49.989 148.505l-12.58 10.73`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M41.536 161.28a5.636 5.636 0 1 1-11.216-1.13 5.636 5.636 0 0 1 11.216 1.13M59.154 145.261a5.677 5.677 0 1 1-11.297-1.138 5.677 5.677 0 0 1 11.297 1.138M100.36 29.516l29.66-.013a4.562 4.562 0 1 0-.004-9.126l-29.66.013a4.563 4.563 0 0 0 .005 9.126M111.705 47.754l29.659-.013a4.563 4.563 0 1 0-.004-9.126l-29.66.013a4.563 4.563 0 1 0 .005 9.126`,fill:`#FFF`},null),U(`path`,{d:`M114.066 29.503V29.5l15.698-.007a4.563 4.563 0 1 0 .004 9.126l-15.698.007v-.002a4.562 4.562 0 0 0-.004-9.122M185.405 137.723c-.55 5.455-5.418 9.432-10.873 8.882-5.456-.55-9.432-5.418-8.882-10.873.55-5.455 5.418-9.432 10.873-8.882 5.455.55 9.432 5.418 8.882 10.873`,fill:`#FFF`},null),U(`path`,{d:`M180.17 143.772l12.572 7.129M193.841 158.42L178.67 171.36`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M185.55 171.926a6.798 6.798 0 1 1-13.528-1.363 6.798 6.798 0 0 1 13.527 1.363M204.12 155.285a6.848 6.848 0 1 1-13.627-1.375 6.848 6.848 0 0 1 13.626 1.375`,fill:`#FFF`},null),U(`path`,{d:`M152.988 194.074a2.21 2.21 0 1 1-4.42 0 2.21 2.21 0 0 1 4.42 0zM225.931 118.217a2.21 2.21 0 1 1-4.421 0 2.21 2.21 0 0 1 4.421 0zM217.09 153.051a2.21 2.21 0 1 1-4.421 0 2.21 2.21 0 0 1 4.42 0zM177.84 109.842a2.21 2.21 0 1 1-4.422 0 2.21 2.21 0 0 1 4.421 0zM196.114 94.454a2.21 2.21 0 1 1-4.421 0 2.21 2.21 0 0 1 4.421 0zM202.844 182.523a2.21 2.21 0 1 1-4.42 0 2.21 2.21 0 0 1 4.42 0z`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{stroke:`#FFF`,"stroke-width":`2`,d:`M215.125 155.262l-1.902 20.075-10.87 5.958M174.601 176.636l-6.322 9.761H156.98l-4.484 6.449M175.874 127.28V111.56M221.51 119.404l-12.77 7.859-15.228-7.86V96.668`},null),U(`path`,{d:`M180.68 29.32C180.68 13.128 193.806 0 210 0c16.193 0 29.32 13.127 29.32 29.32 0 16.194-13.127 29.322-29.32 29.322-16.193 0-29.32-13.128-29.32-29.321`,fill:`#A26EF4`},null),U(`path`,{d:`M221.45 41.706l-21.563-.125a1.744 1.744 0 0 1-1.734-1.754l.071-12.23a1.744 1.744 0 0 1 1.754-1.734l21.562.125c.964.006 1.74.791 1.735 1.755l-.071 12.229a1.744 1.744 0 0 1-1.754 1.734`,fill:`#FFF`},null),U(`path`,{d:`M215.106 29.192c-.015 2.577-2.049 4.654-4.543 4.64-2.494-.014-4.504-2.115-4.489-4.693l.04-6.925c.016-2.577 2.05-4.654 4.543-4.64 2.494.015 4.504 2.116 4.49 4.693l-.04 6.925zm-4.53-14.074a6.877 6.877 0 0 0-6.916 6.837l-.043 7.368a6.877 6.877 0 0 0 13.754.08l.042-7.368a6.878 6.878 0 0 0-6.837-6.917zM167.566 68.367h-3.93a4.73 4.73 0 0 1-4.717-4.717 4.73 4.73 0 0 1 4.717-4.717h3.93a4.73 4.73 0 0 1 4.717 4.717 4.73 4.73 0 0 1-4.717 4.717`,fill:`#FFF`},null),U(`path`,{d:`M168.214 248.838a6.611 6.611 0 0 1-6.61-6.611v-66.108a6.611 6.611 0 0 1 13.221 0v66.108a6.611 6.611 0 0 1-6.61 6.61`,fill:`#5BA02E`},null),U(`path`,{d:`M176.147 248.176a6.611 6.611 0 0 1-6.61-6.61v-33.054a6.611 6.611 0 1 1 13.221 0v33.053a6.611 6.611 0 0 1-6.61 6.611`,fill:`#92C110`},null),U(`path`,{d:`M185.994 293.89h-27.376a3.17 3.17 0 0 1-3.17-3.17v-45.887a3.17 3.17 0 0 1 3.17-3.17h27.376a3.17 3.17 0 0 1 3.17 3.17v45.886a3.17 3.17 0 0 1-3.17 3.17`,fill:`#F2D7AD`},null),U(`path`,{d:`M81.972 147.673s6.377-.927 17.566-1.28c11.729-.371 17.57 1.086 17.57 1.086s3.697-3.855.968-8.424c1.278-12.077 5.982-32.827.335-48.273-1.116-1.339-3.743-1.512-7.536-.62-1.337.315-7.147-.149-7.983-.1l-15.311-.347s-3.487-.17-8.035-.508c-1.512-.113-4.227-1.683-5.458-.338-.406.443-2.425 5.669-1.97 16.077l8.635 35.642s-3.141 3.61 1.219 7.085`,fill:`#FFF`},null),U(`path`,{d:`M75.768 73.325l-.9-6.397 11.982-6.52s7.302-.118 8.038 1.205c.737 1.324-5.616.993-5.616.993s-1.836 1.388-2.615 2.5c-1.654 2.363-.986 6.471-8.318 5.986-1.708.284-2.57 2.233-2.57 2.233`,fill:`#FFC6A0`},null),U(`path`,{d:`M52.44 77.672s14.217 9.406 24.973 14.444c1.061.497-2.094 16.183-11.892 11.811-7.436-3.318-20.162-8.44-21.482-14.496-.71-3.258 2.543-7.643 8.401-11.76M141.862 80.113s-6.693 2.999-13.844 6.876c-3.894 2.11-10.137 4.704-12.33 7.988-6.224 9.314 3.536 11.22 12.947 7.503 6.71-2.651 28.999-12.127 13.227-22.367`,fill:`#FFB594`},null),U(`path`,{d:`M76.166 66.36l3.06 3.881s-2.783 2.67-6.31 5.747c-7.103 6.195-12.803 14.296-15.995 16.44-3.966 2.662-9.754 3.314-12.177-.118-3.553-5.032.464-14.628 31.422-25.95`,fill:`#FFC6A0`},null),U(`path`,{d:`M64.674 85.116s-2.34 8.413-8.912 14.447c.652.548 18.586 10.51 22.144 10.056 5.238-.669 6.417-18.968 1.145-20.531-.702-.208-5.901-1.286-8.853-2.167-.87-.26-1.611-1.71-3.545-.936l-1.98-.869zM128.362 85.826s5.318 1.956 7.325 13.734c-.546.274-17.55 12.35-21.829 7.805-6.534-6.94-.766-17.393 4.275-18.61 4.646-1.121 5.03-1.37 10.23-2.929`,fill:`#FFF`},null),U(`path`,{d:`M78.18 94.656s.911 7.41-4.914 13.078`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M87.397 94.68s3.124 2.572 10.263 2.572c7.14 0 9.074-3.437 9.074-3.437`,stroke:`#E4EBF7`,"stroke-width":`.932`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M117.184 68.639l-6.781-6.177s-5.355-4.314-9.223-.893c-3.867 3.422 4.463 2.083 5.653 4.165 1.19 2.082.848 1.143-2.083.446-5.603-1.331-2.082.893 2.975 5.355 2.091 1.845 6.992.955 6.992.955l2.467-3.851z`,fill:`#FFC6A0`},null),U(`path`,{d:`M105.282 91.315l-.297-10.937-15.918-.027-.53 10.45c-.026.403.17.788.515.999 2.049 1.251 9.387 5.093 15.799.424.287-.21.443-.554.431-.91`,fill:`#FFB594`},null),U(`path`,{d:`M107.573 74.24c.817-1.147.982-9.118 1.015-11.928a1.046 1.046 0 0 0-.965-1.055l-4.62-.365c-7.71-1.044-17.071.624-18.253 6.346-5.482 5.813-.421 13.244-.421 13.244s1.963 3.566 4.305 6.791c.756 1.041.398-3.731 3.04-5.929 5.524-4.594 15.899-7.103 15.899-7.103`,fill:`#5C2552`},null),U(`path`,{d:`M88.426 83.206s2.685 6.202 11.602 6.522c7.82.28 8.973-7.008 7.434-17.505l-.909-5.483c-6.118-2.897-15.478.54-15.478.54s-.576 2.044-.19 5.504c-2.276 2.066-1.824 5.618-1.824 5.618s-.905-1.922-1.98-2.321c-.86-.32-1.897.089-2.322 1.98-1.04 4.632 3.667 5.145 3.667 5.145`,fill:`#FFC6A0`},null),U(`path`,{stroke:`#DB836E`,"stroke-width":`1.145`,"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M100.843 77.099l1.701-.928-1.015-4.324.674-1.406`},null),U(`path`,{d:`M105.546 74.092c-.022.713-.452 1.279-.96 1.263-.51-.016-.904-.607-.882-1.32.021-.713.452-1.278.96-1.263.51.016.904.607.882 1.32M97.592 74.349c-.022.713-.452 1.278-.961 1.263-.509-.016-.904-.607-.882-1.32.022-.713.452-1.279.961-1.263.51.016.904.606.882 1.32`,fill:`#552950`},null),U(`path`,{d:`M91.132 86.786s5.269 4.957 12.679 2.327`,stroke:`#DB836E`,"stroke-width":`1.145`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M99.776 81.903s-3.592.232-1.44-2.79c1.59-1.496 4.897-.46 4.897-.46s1.156 3.906-3.457 3.25`,fill:`#DB836E`},null),U(`path`,{d:`M102.88 70.6s2.483.84 3.402.715M93.883 71.975s2.492-1.144 4.778-1.073`,stroke:`#5C2552`,"stroke-width":`1.526`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M86.32 77.374s.961.879 1.458 2.106c-.377.48-1.033 1.152-.236 1.809M99.337 83.719s1.911.151 2.509-.254`,stroke:`#DB836E`,"stroke-width":`1.145`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M87.782 115.821l15.73-3.012M100.165 115.821l10.04-2.008`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M66.508 86.763s-1.598 8.83-6.697 14.078`,stroke:`#E4EBF7`,"stroke-width":`1.114`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M128.31 87.934s3.013 4.121 4.06 11.785`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M64.09 84.816s-6.03 9.912-13.607 9.903`,stroke:`#DB836E`,"stroke-width":`.795`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M112.366 65.909l-.142 5.32s5.993 4.472 11.945 9.202c4.482 3.562 8.888 7.455 10.985 8.662 4.804 2.766 8.9 3.355 11.076 1.808 4.071-2.894 4.373-9.878-8.136-15.263-4.271-1.838-16.144-6.36-25.728-9.73`,fill:`#FFC6A0`},null),U(`path`,{d:`M130.532 85.488s4.588 5.757 11.619 6.214`,stroke:`#DB836E`,"stroke-width":`.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M121.708 105.73s-.393 8.564-1.34 13.612`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M115.784 161.512s-3.57-1.488-2.678-7.14`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M101.52 290.246s4.326 2.057 7.408 1.03c2.842-.948 4.564.673 7.132 1.186 2.57.514 6.925 1.108 11.772-1.269-.104-5.551-6.939-4.01-12.048-6.763-2.582-1.39-3.812-4.757-3.625-8.863h-9.471s-1.402 10.596-1.169 14.68`,fill:`#CBD1D1`},null),U(`path`,{d:`M101.496 290.073s2.447 1.281 6.809.658c3.081-.44 3.74.485 7.479 1.039 3.739.554 10.802-.07 11.91-.9.415 1.108-.347 2.077-.347 2.077s-1.523.608-4.847.831c-2.045.137-5.843.293-7.663-.507-1.8-1.385-5.286-1.917-5.77-.243-3.947.958-7.41-.288-7.41-.288l-.16-2.667z`,fill:`#2B0849`},null),U(`path`,{d:`M108.824 276.19h3.116s-.103 6.751 4.57 8.62c-4.673.624-8.62-2.32-7.686-8.62`,fill:`#A4AABA`},null),U(`path`,{d:`M57.65 272.52s-2.122 7.47-4.518 12.396c-1.811 3.724-4.255 7.548 5.505 7.548 6.698 0 9.02-.483 7.479-6.648-1.541-6.164.268-13.296.268-13.296H57.65z`,fill:`#CBD1D1`},null),U(`path`,{d:`M51.54 290.04s2.111 1.178 6.682 1.178c6.128 0 8.31-1.662 8.31-1.662s.605 1.122-.624 2.18c-1 .862-3.624 1.603-7.444 1.559-4.177-.049-5.876-.57-6.786-1.177-.831-.554-.692-1.593-.138-2.078`,fill:`#2B0849`},null),U(`path`,{d:`M58.533 274.438s.034 1.529-.315 2.95c-.352 1.431-1.087 3.127-1.139 4.17-.058 1.16 4.57 1.592 5.194.035.623-1.559 1.303-6.475 1.927-7.306.622-.831-4.94-2.135-5.667.15`,fill:`#A4AABA`},null),U(`path`,{d:`M100.885 277.015l13.306.092s1.291-54.228 1.843-64.056c.552-9.828 3.756-43.13.997-62.788l-12.48-.64-22.725.776s-.433 3.944-1.19 9.921c-.062.493-.677.838-.744 1.358-.075.582.42 1.347.318 1.956-2.35 14.003-6.343 32.926-8.697 46.425-.116.663-1.227 1.004-1.45 2.677-.04.3.21 1.516.112 1.785-6.836 18.643-10.89 47.584-14.2 61.551l14.528-.014s2.185-8.524 4.008-16.878c2.796-12.817 22.987-84.553 22.987-84.553l3-.517 1.037 46.1s-.223 1.228.334 2.008c.558.782-.556 1.117-.39 2.233l.39 1.784s-.446 7.14-.892 11.826c-.446 4.685-.092 38.954-.092 38.954`,fill:`#7BB2F9`},null),U(`path`,{d:`M77.438 220.434c1.146.094 4.016-2.008 6.916-4.91M107.55 223.931s2.758-1.103 6.069-3.862`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M108.459 220.905s2.759-1.104 6.07-3.863`,stroke:`#648BD8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M76.099 223.557s2.608-.587 6.47-3.346M87.33 150.82c-.27 3.088.297 8.478-4.315 9.073M104.829 149.075s.11 13.936-1.286 14.983c-2.207 1.655-2.975 1.934-2.975 1.934M101.014 149.63s.035 12.81-1.19 24.245M94.93 174.965s7.174-1.655 9.38-1.655M75.671 204.754c-.316 1.55-.64 3.067-.973 4.535 0 0-1.45 1.822-1.003 3.756.446 1.934-.943 2.034-4.96 15.273-1.686 5.559-4.464 18.49-6.313 27.447-.078.38-4.018 18.06-4.093 18.423M77.043 196.743a313.269 313.269 0 0 1-.877 4.729M83.908 151.414l-1.19 10.413s-1.091.148-.496 2.23c.111 1.34-2.66 15.692-5.153 30.267M57.58 272.94h13.238`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M117.377 147.423s-16.955-3.087-35.7.199c.157 2.501-.002 4.128-.002 4.128s14.607-2.802 35.476-.31c.251-2.342.226-4.017.226-4.017`,fill:`#192064`},null),U(`path`,{d:`M107.511 150.353l.004-4.885a.807.807 0 0 0-.774-.81c-2.428-.092-5.04-.108-7.795-.014a.814.814 0 0 0-.784.81l-.003 4.88c0 .456.371.82.827.808a140.76 140.76 0 0 1 7.688.017.81.81 0 0 0 .837-.806`,fill:`#FFF`},null),U(`path`,{d:`M106.402 149.426l.002-3.06a.64.64 0 0 0-.616-.643 94.135 94.135 0 0 0-5.834-.009.647.647 0 0 0-.626.643l-.001 3.056c0 .36.291.648.651.64 1.78-.04 3.708-.041 5.762.012.36.009.662-.279.662-.64`,fill:`#192064`},null),U(`path`,{d:`M101.485 273.933h12.272M102.652 269.075c.006 3.368.04 5.759.11 6.47M102.667 263.125c-.009 1.53-.015 2.98-.016 4.313M102.204 174.024l.893 44.402s.669 1.561-.224 2.677c-.892 1.116 2.455.67.893 2.231-1.562 1.562.893 1.116 0 3.347-.592 1.48-.988 20.987-1.09 34.956`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null)])]),oH=e=>{let{componentCls:t,lineHeightHeading3:n,iconCls:r,padding:i,paddingXL:a,paddingXS:o,paddingLG:s,marginXS:c,lineHeight:l}=e;return{[t]:{padding:`${s*2}px ${a}px`,"&-rtl":{direction:`rtl`}},[`${t} ${t}-image`]:{width:e.imageWidth,height:e.imageHeight,margin:`auto`},[`${t} ${t}-icon`]:{marginBottom:s,textAlign:`center`,[`& > ${r}`]:{fontSize:e.resultIconFontSize}},[`${t} ${t}-title`]:{color:e.colorTextHeading,fontSize:e.resultTitleFontSize,lineHeight:n,marginBlock:c,textAlign:`center`},[`${t} ${t}-subtitle`]:{color:e.colorTextDescription,fontSize:e.resultSubtitleFontSize,lineHeight:l,textAlign:`center`},[`${t} ${t}-content`]:{marginTop:s,padding:`${s}px ${i*2.5}px`,backgroundColor:e.colorFillAlter},[`${t} ${t}-extra`]:{margin:e.resultExtraMargin,textAlign:`center`,"& > *":{marginInlineEnd:o,"&:last-child":{marginInlineEnd:0}}}}},sH=e=>{let{componentCls:t,iconCls:n}=e;return{[`${t}-success ${t}-icon > ${n}`]:{color:e.resultSuccessIconColor},[`${t}-error ${t}-icon > ${n}`]:{color:e.resultErrorIconColor},[`${t}-info ${t}-icon > ${n}`]:{color:e.resultInfoIconColor},[`${t}-warning ${t}-icon > ${n}`]:{color:e.resultWarningIconColor}}},cH=e=>[oH(e),sH(e)],lH=e=>cH(e),uH=v(`Result`,e=>{let{paddingLG:t,fontSizeHeading3:n}=e,r=e.fontSize,i=`${t}px 0 0 0`,a=e.colorInfo,o=e.colorError,s=e.colorSuccess,c=e.colorWarning;return[lH(B(e,{resultTitleFontSize:n,resultSubtitleFontSize:r,resultIconFontSize:n*3,resultExtraMargin:i,resultInfoIconColor:a,resultErrorIconColor:o,resultSuccessIconColor:s,resultWarningIconColor:c}))]},{imageWidth:250,imageHeight:295}),dH={success:qe,error:tt,info:Wt,warning:nH},fH={404:rH,500:iH,403:aH},pH=Object.keys(fH),mH=()=>({prefixCls:String,icon:f.any,status:{type:[Number,String],default:`info`},title:f.any,subTitle:f.any,extra:f.any}),hH=(e,t)=>{let{status:n,icon:r}=t;if(pH.includes(`${n}`)){let t=fH[n];return U(`div`,{class:`${e}-icon ${e}-image`},[U(t,null,null)])}let i=dH[n],a=r||U(i,null,null);return U(`div`,{class:`${e}-icon`},[a])},gH=(e,t)=>t&&U(`div`,{class:`${e}-extra`},[t]),_H=u({compatConfig:{MODE:3},name:`AResult`,inheritAttrs:!1,props:mH(),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`result`,e),[o,s]=uH(i),c=J(()=>K(i.value,s.value,`${i.value}-${e.status}`,{[`${i.value}-rtl`]:a.value===`rtl`}));return()=>{let t=e.title??n.title?.call(n),a=e.subTitle??n.subTitle?.call(n),s=e.icon??n.icon?.call(n),l=e.extra??n.extra?.call(n),u=i.value;return o(U(`div`,Y(Y({},r),{},{class:[c.value,r.class]}),[hH(u,{status:e.status,icon:s}),U(`div`,{class:`${u}-title`},[t]),a&&U(`div`,{class:`${u}-subtitle`},[a]),gH(u,l),n.default&&U(`div`,{class:`${u}-content`},[n.default()])]))}}});_H.PRESENTED_IMAGE_403=fH[403],_H.PRESENTED_IMAGE_404=fH[404],_H.PRESENTED_IMAGE_500=fH[500],_H.install=function(e){return e.component(_H.name,_H),e};var vH=a(HA),yH=(e,t)=>{let{attrs:n}=t,{included:r,vertical:i,style:a,class:o}=n,{length:s,offset:c,reverse:l}=n;s<0&&(l=!l,s=Math.abs(s),c=100-c);let u=i?{[l?`top`:`bottom`]:`${c}%`,[l?`bottom`:`top`]:`auto`,height:`${s}%`}:{[l?`right`:`left`]:`${c}%`,[l?`left`:`right`]:`auto`,width:`${s}%`},d=Z(Z({},a),u);return r?U(`div`,{class:o,style:d},null):null};yH.inheritAttrs=!1;var bH=(t,n,r,i,a,o)=>{e(!r||i>0,`Slider`,"`Slider[step]` should be a positive number in order to make Slider[dots] work.");let s=Object.keys(n).map(parseFloat).sort((e,t)=>e-t);if(r&&i)for(let e=a;e<=o;e+=i)s.indexOf(e)===-1&&s.push(e);return s},xH=(e,t)=>{let{attrs:n}=t,{prefixCls:r,vertical:i,reverse:a,marks:o,dots:s,step:c,included:l,lowerBound:u,upperBound:d,max:f,min:p,dotStyle:m,activeDotStyle:h}=n,g=f-p,_=bH(i,o,s,c,p,f).map(e=>{let t=`${Math.abs(e-p)/g*100}%`,n=!l&&e===d||l&&e<=d&&e>=u,o=i?Z(Z({},m),{[a?`top`:`bottom`]:t}):Z(Z({},m),{[a?`right`:`left`]:t});return n&&(o=Z(Z({},o),h)),U(`span`,{class:K({[`${r}-dot`]:!0,[`${r}-dot-active`]:n,[`${r}-dot-reverse`]:a}),style:o,key:e},null)});return U(`div`,{class:`${r}-step`},[_])};xH.inheritAttrs=!1;var SH=(e,t)=>{let{attrs:n,slots:r}=t,{class:i,vertical:a,reverse:o,marks:s,included:c,upperBound:l,lowerBound:u,max:d,min:f,onClickLabel:p}=n,m=Object.keys(s),h=r.mark,g=d-f,_=m.map(parseFloat).sort((e,t)=>e-t).map(e=>{let t=typeof s[e]==`function`?s[e]():s[e],n=typeof t==`object`&&!Nt(t),r=n?t.label:t;if(!r&&r!==0)return null;h&&(r=h({point:e,label:r}));let d=!c&&e===l||c&&e<=l&&e>=u,m=K({[`${i}-text`]:!0,[`${i}-text-active`]:d}),_={marginBottom:`-50%`,[o?`top`:`bottom`]:`${(e-f)/g*100}%`},v={transform:`translateX(${o?`50%`:`-50%`})`,msTransform:`translateX(${o?`50%`:`-50%`})`,[o?`right`:`left`]:`${(e-f)/g*100}%`},y=a?_:v;return U(`span`,Y({class:m,style:n?Z(Z({},y),t.style):y,key:e,onMousedown:t=>p(t,e)},{[sr?`onTouchstartPassive`:`onTouchstart`]:t=>p(t,e)}),[r])});return U(`div`,{class:i},[_])};SH.inheritAttrs=!1;var CH=u({compatConfig:{MODE:3},name:`Handle`,inheritAttrs:!1,props:{prefixCls:String,vertical:{type:Boolean,default:void 0},offset:Number,disabled:{type:Boolean,default:void 0},min:Number,max:Number,value:Number,tabindex:f.oneOfType([f.number,f.string]),reverse:{type:Boolean,default:void 0},ariaLabel:String,ariaLabelledBy:String,ariaValueTextFormatter:Function,onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function}},setup(e,t){let{attrs:n,emit:r,expose:i}=t,a=q(!1),o=q(),s=()=>{document.activeElement===o.value&&(a.value=!0)},c=e=>{a.value=!1,r(`blur`,e)},l=()=>{a.value=!1},u=()=>{var e;(e=o.value)==null||e.focus()},d=()=>{var e;(e=o.value)==null||e.blur()},f=()=>{a.value=!0,u()},p=e=>{e.preventDefault(),u(),r(`mousedown`,e)};i({focus:u,blur:d,clickFocus:f,ref:o});let m=null;V(()=>{m=cr(document,`mouseup`,s)}),ut(()=>{m?.remove()});let h=J(()=>{let{vertical:t,offset:n,reverse:r}=e;return t?{[r?`top`:`bottom`]:`${n}%`,[r?`bottom`:`top`]:`auto`,transform:r?null:`translateY(+50%)`}:{[r?`right`:`left`]:`${n}%`,[r?`left`:`right`]:`auto`,transform:`translateX(${r?`+`:`-`}50%)`}});return()=>{let{prefixCls:t,disabled:r,min:i,max:s,value:u,tabindex:d,ariaLabel:f,ariaLabelledBy:m,ariaValueTextFormatter:g,onMouseenter:_,onMouseleave:v}=e,y=K(n.class,{[`${t}-handle-click-focused`]:a.value}),b={"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":u,"aria-disabled":!!r},x=[n.style,h.value],S=d||0;(r||d===null)&&(S=null);let C;return g&&(C=g(u)),U(`div`,Y(Y({},Z(Z(Z(Z({},n),{role:`slider`,tabindex:S}),b),{class:y,onBlur:c,onKeydown:l,onMousedown:p,onMouseenter:_,onMouseleave:v,ref:o,style:x})),{},{"aria-label":f,"aria-labelledby":m,"aria-valuetext":C}),null)}}});function wH(e,t){try{return Object.keys(t).some(n=>e.target===t[n].ref)}catch{return!1}}function TH(e,t){let{min:n,max:r}=t;return er}function EH(e){return e.touches.length>1||e.type.toLowerCase()===`touchend`&&e.touches.length>0}function DH(e,t){let{marks:n,step:r,min:i,max:a}=t,o=Object.keys(n).map(parseFloat);if(r!==null){let t=10**OH(r),n=Math.floor((a*t-i*t)/(r*t)),s=Math.min((e-i)/r,n),c=Math.round(s)*r+i;o.push(c)}let s=o.map(t=>Math.abs(e-t));return o[s.indexOf(Math.min(...s))]}function OH(e){let t=e.toString(),n=0;return t.indexOf(`.`)>=0&&(n=t.length-t.indexOf(`.`)-1),n}function kH(e,t){let n=1;return window.visualViewport&&(n=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(e?t.clientY:t.pageX)/n}function AH(e,t){let n=1;return window.visualViewport&&(n=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(e?t.touches[0].clientY:t.touches[0].pageX)/n}function jH(e,t){let n=t.getBoundingClientRect();return e?n.top+n.height*.5:window.scrollX+n.left+n.width*.5}function MH(e,t){let{max:n,min:r}=t;return e<=r?r:e>=n?n:e}function NH(e,t){let{step:n}=t,r=isFinite(DH(e,t))?DH(e,t):0;return n===null?r:parseFloat(r.toFixed(OH(n)))}function PH(e){e.stopPropagation(),e.preventDefault()}function FH(e,t,n){let r={increase:(e,t)=>e+t,decrease:(e,t)=>e-t},i=r[e](Object.keys(n.marks).indexOf(JSON.stringify(t)),1),a=Object.keys(n.marks)[i];return n.step?r[e](t,n.step):Object.keys(n.marks).length&&n.marks[a]?n.marks[a]:t}function IH(e,t,n){let r=`increase`,i=`decrease`,a=r;switch(e.keyCode){case $.UP:a=t&&n?i:r;break;case $.RIGHT:a=!t&&n?i:r;break;case $.DOWN:a=t&&n?r:i;break;case $.LEFT:a=!t&&n?r:i;break;case $.END:return(e,t)=>t.max;case $.HOME:return(e,t)=>t.min;case $.PAGE_UP:return(e,t)=>e+t.step*2;case $.PAGE_DOWN:return(e,t)=>e-t.step*2;default:return}return(e,t)=>FH(a,e,t)}var LH=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{this.document=this.sliderRef&&this.sliderRef.ownerDocument;let{autofocus:e,disabled:t}=this;e&&!t&&this.focus()})},beforeUnmount(){this.$nextTick(()=>{this.removeDocumentEvents()})},methods:{defaultHandle(e){var{index:t,directives:n,className:r,style:i}=e,a=LH(e,[`index`,`directives`,`className`,`style`]);return delete a.dragging,a.value===null?null:U(CH,Z(Z({},a),{class:r,style:i,key:t}),null)},onDown(e,t){let n=t,{draggableTrack:r,vertical:i}=this.$props,{bounds:a}=this.$data,o=r&&this.positionGetValue&&this.positionGetValue(n)||[],s=wH(e,this.handlesRefs);if(this.dragTrack=r&&a.length>=2&&!s&&!o.map((e,t)=>{let n=t?!0:e>=a[t];return t===o.length-1?e<=a[t]:n}).some(e=>!e),this.dragTrack)this.dragOffset=n,this.startBounds=[...a];else{if(!s)this.dragOffset=0;else{let t=jH(i,e.target);this.dragOffset=n-t,n=t}this.onStart(n)}},onMouseDown(e){if(e.button!==0)return;this.removeDocumentEvents();let t=this.$props.vertical,n=kH(t,e);this.onDown(e,n),this.addDocumentMouseEvents()},onTouchStart(e){if(EH(e))return;let t=this.vertical,n=AH(t,e);this.onDown(e,n),this.addDocumentTouchEvents(),PH(e)},onFocus(e){let{vertical:t}=this;if(wH(e,this.handlesRefs)&&!this.dragTrack){let n=jH(t,e.target);this.dragOffset=0,this.onStart(n),PH(e),this.$emit(`focus`,e)}},onBlur(e){this.dragTrack||this.onEnd(),this.$emit(`blur`,e)},onMouseUp(){this.handlesRefs[this.prevMovedHandleIndex]&&this.handlesRefs[this.prevMovedHandleIndex].clickFocus()},onMouseMove(e){if(!this.sliderRef){this.onEnd();return}let t=kH(this.vertical,e);this.onMove(e,t-this.dragOffset,this.dragTrack,this.startBounds)},onTouchMove(e){if(EH(e)||!this.sliderRef){this.onEnd();return}let t=AH(this.vertical,e);this.onMove(e,t-this.dragOffset,this.dragTrack,this.startBounds)},onKeyDown(e){this.sliderRef&&wH(e,this.handlesRefs)&&this.onKeyboard(e)},onClickMarkLabel(e,t){e.stopPropagation(),this.onChange({sValue:t}),this.setState({sValue:t},()=>this.onEnd(!0))},getSliderStart(){let e=this.sliderRef,{vertical:t,reverse:n}=this,r=e.getBoundingClientRect();return t?n?r.bottom:r.top:window.scrollX+(n?r.right:r.left)},getSliderLength(){let e=this.sliderRef;if(!e)return 0;let t=e.getBoundingClientRect();return this.vertical?t.height:t.width},addDocumentTouchEvents(){this.onTouchMoveListener=cr(this.document,`touchmove`,this.onTouchMove),this.onTouchUpListener=cr(this.document,`touchend`,this.onEnd)},addDocumentMouseEvents(){this.onMouseMoveListener=cr(this.document,`mousemove`,this.onMouseMove),this.onMouseUpListener=cr(this.document,`mouseup`,this.onEnd)},removeDocumentEvents(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()},focus(){var e;this.$props.disabled||(e=this.handlesRefs[0])==null||e.focus()},blur(){this.$props.disabled||Object.keys(this.handlesRefs).forEach(e=>{var t,n;(n=(t=this.handlesRefs[e])?.blur)==null||n.call(t)})},calcValue(e){let{vertical:t,min:n,max:r}=this,i=Math.abs(Math.max(e,0)/this.getSliderLength());return t?(1-i)*(r-n)+n:i*(r-n)+n},calcValueByPos(e){let t=(this.reverse?-1:1)*(e-this.getSliderStart());return this.trimAlignValue(this.calcValue(t))},calcOffset(e){let{min:t,max:n}=this,r=(e-t)/(n-t);return Math.max(0,r*100)},saveSlider(e){this.sliderRef=e},saveHandle(e,t){this.handlesRefs[e]=t}},render(){let{prefixCls:e,marks:t,dots:n,step:r,included:i,disabled:a,vertical:o,reverse:s,min:l,max:u,maximumTrackStyle:d,railStyle:f,dotStyle:p,activeDotStyle:m,id:h}=this,{class:g,style:_}=this.$attrs,{tracks:v,handles:y}=this.renderSlider(),b=K(e,g,{[`${e}-with-marks`]:Object.keys(t).length,[`${e}-disabled`]:a,[`${e}-vertical`]:o,[`${e}-horizontal`]:!o}),x={vertical:o,marks:t,included:i,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:u,min:l,reverse:s,class:`${e}-mark`,onClickLabel:a?RH:this.onClickMarkLabel},S={[sr?`onTouchstartPassive`:`onTouchstart`]:a?RH:this.onTouchStart};return U(`div`,Y(Y({id:h,ref:this.saveSlider,tabindex:`-1`,class:b},S),{},{onMousedown:a?RH:this.onMouseDown,onMouseup:a?RH:this.onMouseUp,onKeydown:a?RH:this.onKeyDown,onFocus:a?RH:this.onFocus,onBlur:a?RH:this.onBlur,style:_}),[U(`div`,{class:`${e}-rail`,style:Z(Z({},d),f)},null),v,U(xH,{prefixCls:e,vertical:o,reverse:s,marks:t,dots:n,step:r,included:i,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:u,min:l,dotStyle:p,activeDotStyle:m},null),y,U(SH,x,{mark:this.$slots.mark}),c(this)])}})}var BH=zH(u({compatConfig:{MODE:3},name:`Slider`,mixins:[cu],inheritAttrs:!1,props:{defaultValue:Number,value:Number,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:f.oneOfType([f.number,f.string]),reverse:{type:Boolean,default:void 0},min:Number,max:Number,ariaLabelForHandle:String,ariaLabelledByForHandle:String,ariaValueTextFormatterForHandle:String,startPoint:Number},emits:[`beforeChange`,`afterChange`,`change`],data(){let e=this.defaultValue===void 0?this.min:this.defaultValue,t=this.value===void 0?e:this.value;return{sValue:this.trimAlignValue(t),dragging:!1}},watch:{value:{handler(e){this.setChangeValue(e)},deep:!0},min(){let{sValue:e}=this;this.setChangeValue(e)},max(){let{sValue:e}=this;this.setChangeValue(e)}},methods:{setChangeValue(e){let t=e===void 0?this.sValue:e,n=this.trimAlignValue(t,this.$props);n!==this.sValue&&(this.setState({sValue:n}),TH(t,this.$props)&&this.$emit(`change`,n))},onChange(e){let t=!E(this,`value`),n=e.sValue>this.max?Z(Z({},e),{sValue:this.max}):e;t&&this.setState(n);let r=n.sValue;this.$emit(`change`,r)},onStart(e){this.setState({dragging:!0});let{sValue:t}=this;this.$emit(`beforeChange`,t);let n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e,n!==t&&(this.prevMovedHandleIndex=0,this.onChange({sValue:n}))},onEnd(e){let{dragging:t}=this;this.removeDocumentEvents(),(t||e)&&this.$emit(`afterChange`,this.sValue),this.setState({dragging:!1})},onMove(e,t){PH(e);let{sValue:n}=this,r=this.calcValueByPos(t);r!==n&&this.onChange({sValue:r})},onKeyboard(e){let{reverse:t,vertical:n}=this.$props,r=IH(e,n,t);if(r){PH(e);let{sValue:t}=this,n=r(t,this.$props),i=this.trimAlignValue(n);if(i===t)return;this.onChange({sValue:i}),this.$emit(`afterChange`,i),this.onEnd()}},getLowerBound(){let e=this.$props.startPoint||this.$props.min;return this.$data.sValue>e?e:this.$data.sValue},getUpperBound(){return this.$data.sValue1&&arguments[1]!==void 0?arguments[1]:{};if(e===null)return null;let n=Z(Z({},this.$props),t);return NH(MH(e,n),n)},getTrack(e){let{prefixCls:t,reverse:n,vertical:r,included:i,minimumTrackStyle:a,mergedTrackStyle:o,length:s,offset:c}=e;return U(yH,{class:`${t}-track`,vertical:r,included:i,offset:c,reverse:n,length:s,style:Z(Z({},a),o)},null)},renderSlider(){let{prefixCls:e,vertical:t,included:n,disabled:r,minimumTrackStyle:i,trackStyle:a,handleStyle:o,tabindex:s,ariaLabelForHandle:c,ariaLabelledByForHandle:l,ariaValueTextFormatterForHandle:u,min:d,max:f,startPoint:p,reverse:m,handle:h,defaultHandle:g}=this,_=h||g,{sValue:v,dragging:y}=this,b=this.calcOffset(v),x=_({class:`${e}-handle`,prefixCls:e,vertical:t,offset:b,value:v,dragging:y,disabled:r,min:d,max:f,reverse:m,index:0,tabindex:s,ariaLabel:c,ariaLabelledBy:l,ariaValueTextFormatter:u,style:o[0]||o,ref:e=>this.saveHandle(0,e),onFocus:this.onFocus,onBlur:this.onBlur}),S=p===void 0?0:this.calcOffset(p),C=a[0]||a;return{tracks:this.getTrack({prefixCls:e,reverse:m,vertical:t,included:n,offset:S,minimumTrackStyle:i,mergedTrackStyle:C,length:b-S}),handles:x}}}})),VH=e=>{let{value:t,handle:n,bounds:r,props:i}=e,{allowCross:a,pushable:o}=i,s=Number(o),c=MH(t,i),l=c;return!a&&n!=null&&r!==void 0&&(n>0&&c<=r[n-1]+s&&(l=r[n-1]+s),n=r[n+1]-s&&(l=r[n+1]-s)),NH(l,i)},HH={defaultValue:f.arrayOf(f.number),value:f.arrayOf(f.number),count:Number,pushable:oe(f.oneOfType([f.looseBool,f.number])),allowCross:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},reverse:{type:Boolean,default:void 0},tabindex:f.arrayOf(f.number),prefixCls:String,min:Number,max:Number,autofocus:{type:Boolean,default:void 0},ariaLabelGroupForHandles:Array,ariaLabelledByGroupForHandles:Array,ariaValueTextFormatterGroupForHandles:Array,draggableTrack:{type:Boolean,default:void 0}},UH=zH(u({compatConfig:{MODE:3},name:`Range`,mixins:[cu],inheritAttrs:!1,props:Zn(HH,{count:1,allowCross:!0,pushable:!1,tabindex:[],draggableTrack:!1,ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]}),emits:[`beforeChange`,`afterChange`,`change`],displayName:`Range`,data(){let{count:e,min:t,max:n}=this,r=Array(...Array(e+1)).map(()=>t),i=E(this,`defaultValue`)?this.defaultValue:r,{value:a}=this;a===void 0&&(a=i);let o=a.map((e,t)=>VH({value:e,handle:t,props:this.$props}));return{sHandle:null,recent:o[0]===n?0:o.length-1,bounds:o}},watch:{value:{handler(e){let{bounds:t}=this;this.setChangeValue(e||t)},deep:!0},min(){let{value:e}=this;this.setChangeValue(e||this.bounds)},max(){let{value:e}=this;this.setChangeValue(e||this.bounds)}},methods:{setChangeValue(e){let{bounds:t}=this,n=e.map((e,n)=>VH({value:e,handle:n,bounds:t,props:this.$props}));if(t.length===n.length){if(n.every((e,n)=>e===t[n]))return null}else n=e.map((e,t)=>VH({value:e,handle:t,props:this.$props}));if(this.setState({bounds:n}),e.some(e=>TH(e,this.$props))){let t=e.map(e=>MH(e,this.$props));this.$emit(`change`,t)}},onChange(e){if(!E(this,`value`))this.setState(e);else{let t={};[`sHandle`,`recent`].forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),Object.keys(t).length&&this.setState(t)}let t=Z(Z({},this.$data),e).bounds;this.$emit(`change`,t)},positionGetValue(e){let t=this.getValue(),n=this.calcValueByPos(e),r=this.getClosestBound(n),i=this.getBoundNeedMoving(n,r);if(n===t[i])return null;let a=[...t];return a[i]=n,a},onStart(e){let{bounds:t}=this;this.$emit(`beforeChange`,t);let n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e;let r=this.getClosestBound(n);if(this.prevMovedHandleIndex=this.getBoundNeedMoving(n,r),this.setState({sHandle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex}),n===t[this.prevMovedHandleIndex])return;let i=[...t];i[this.prevMovedHandleIndex]=n,this.onChange({bounds:i})},onEnd(e){let{sHandle:t}=this;this.removeDocumentEvents(),t||(this.dragTrack=!1),(t!==null||e)&&this.$emit(`afterChange`,this.bounds),this.setState({sHandle:null})},onMove(e,t,n,r){PH(e);let{$data:i,$props:a}=this,o=a.max||100,s=a.min||0;if(n){let e=a.vertical?-t:t;e=a.reverse?-e:e;let n=o-Math.max(...r),c=s-Math.min(...r),l=Math.min(Math.max(e/(this.getSliderLength()/100),c),n),u=r.map(e=>Math.floor(Math.max(Math.min(e+l,o),s)));i.bounds.map((e,t)=>e===u[t]).some(e=>!e)&&this.onChange({bounds:u});return}let{bounds:c,sHandle:l}=this,u=this.calcValueByPos(t);u!==c[l]&&this.moveTo(u)},onKeyboard(e){let{reverse:t,vertical:n}=this.$props,r=IH(e,n,t);if(r){PH(e);let{bounds:t,sHandle:n}=this,i=t[n===null?this.recent:n],a=VH({value:r(i,this.$props),handle:n,bounds:t,props:this.$props});if(a===i)return;this.moveTo(a,!0)}},getClosestBound(e){let{bounds:t}=this,n=0;for(let r=1;r=t[r]&&(n=r);return Math.abs(t[n+1]-e)e-t),this.internalPointsCache={marks:e,step:t,points:a}}return this.internalPointsCache.points},moveTo(e,t){let n=[...this.bounds],{sHandle:r,recent:i}=this,a=r===null?i:r;n[a]=e;let o=a;this.$props.pushable===!1?this.$props.allowCross&&(n.sort((e,t)=>e-t),o=n.indexOf(e)):this.pushSurroundingHandles(n,o),this.onChange({recent:o,sHandle:o,bounds:n}),t&&(this.$emit(`afterChange`,n),this.setState({},()=>{this.handlesRefs[o].focus()}),this.onEnd())},pushSurroundingHandles(e,t){let n=e[t],{pushable:r}=this,i=Number(r),a=0;if(e[t+1]-n=r.length||i<0)return!1;let a=t+n,o=r[i],{pushable:s}=this,c=Number(s),l=n*(e[a]-o);return this.pushHandle(e,a,n,c-l)?(e[t]=o,!0):!1},trimAlignValue(e){let{sHandle:t,bounds:n}=this;return VH({value:e,handle:t,bounds:n,props:this.$props})},ensureValueNotConflict(e,t,n){let{allowCross:r,pushable:i}=n,a=this.$data||{},{bounds:o}=a;if(e=e===void 0?a.sHandle:e,i=Number(i),!r&&e!=null&&o!==void 0){if(e>0&&t<=o[e-1]+i)return o[e-1]+i;if(e=o[e+1]-i)return o[e+1]-i}return t},getTrack(e){let{bounds:t,prefixCls:n,reverse:r,vertical:i,included:a,offsets:o,trackStyle:s}=e;return t.slice(0,-1).map((e,t)=>{let c=t+1;return U(yH,{class:K({[`${n}-track`]:!0,[`${n}-track-${c}`]:!0}),vertical:i,reverse:r,included:a,offset:o[c-1],length:o[c]-o[c-1],style:s[t],key:c},null)})},renderSlider(){let{sHandle:e,bounds:t,prefixCls:n,vertical:r,included:i,disabled:a,min:o,max:s,reverse:c,handle:l,defaultHandle:u,trackStyle:d,handleStyle:f,tabindex:p,ariaLabelGroupForHandles:m,ariaLabelledByGroupForHandles:h,ariaValueTextFormatterGroupForHandles:g}=this,_=l||u,v=t.map(e=>this.calcOffset(e)),y=`${n}-handle`,b=t.map((t,i)=>{let l=p[i]||0;(a||p[i]===null)&&(l=null);let u=e===i;return _({class:K({[y]:!0,[`${y}-${i+1}`]:!0,[`${y}-dragging`]:u}),prefixCls:n,vertical:r,dragging:u,offset:v[i],value:t,index:i,tabindex:l,min:o,max:s,reverse:c,disabled:a,style:f[i],ref:e=>this.saveHandle(i,e),onFocus:this.onFocus,onBlur:this.onBlur,ariaLabel:m[i],ariaLabelledBy:h[i],ariaValueTextFormatter:g[i]})});return{tracks:this.getTrack({bounds:t,prefixCls:n,reverse:c,vertical:r,included:i,offsets:v,trackStyle:d}),handles:b}}}})),WH=u({compatConfig:{MODE:3},name:`SliderTooltip`,inheritAttrs:!1,props:Cy(),setup(e,t){let{attrs:n,slots:r}=t,i=H(null),a=H(null);function o(){ir.cancel(a.value),a.value=null}function s(){a.value=ir(()=>{var e;(e=i.value)==null||e.forcePopupAlign(),a.value=null})}let c=()=>{o(),e.open&&s()};return G([()=>e.open,()=>e.title],()=>{c()},{flush:`post`,immediate:!0}),ft(()=>{c()}),ut(()=>{o()}),()=>U(Ty,Y(Y({ref:i},e),n),r)}}),GH=e=>{let{componentCls:t,controlSize:n,dotSize:r,marginFull:i,marginPart:a,colorFillContentHover:o}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,height:n,margin:`${a}px ${i}px`,padding:0,cursor:`pointer`,touchAction:`none`,"&-vertical":{margin:`${i}px ${a}px`},[`${t}-rail`]:{position:`absolute`,backgroundColor:e.colorFillTertiary,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},[`${t}-track`]:{position:`absolute`,backgroundColor:e.colorPrimaryBorder,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},"&:hover":{[`${t}-rail`]:{backgroundColor:e.colorFillSecondary},[`${t}-track`]:{backgroundColor:e.colorPrimaryBorderHover},[`${t}-dot`]:{borderColor:o},[`${t}-handle::after`]:{boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorderHover}`},[`${t}-dot-active`]:{borderColor:e.colorPrimary}},[`${t}-handle`]:{position:`absolute`,width:e.handleSize,height:e.handleSize,outline:`none`,[`${t}-dragging`]:{zIndex:1},"&::before":{content:`""`,position:`absolute`,insetInlineStart:-e.handleLineWidth,insetBlockStart:-e.handleLineWidth,width:e.handleSize+e.handleLineWidth*2,height:e.handleSize+e.handleLineWidth*2,backgroundColor:`transparent`},"&::after":{content:`""`,position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:e.handleSize,height:e.handleSize,backgroundColor:e.colorBgElevated,boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorder}`,borderRadius:`50%`,cursor:`pointer`,transition:` + inset-inline-start ${e.motionDurationMid}, + inset-block-start ${e.motionDurationMid}, + width ${e.motionDurationMid}, + height ${e.motionDurationMid}, + box-shadow ${e.motionDurationMid} + `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),insetBlockStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),width:e.handleSizeHover+e.handleLineWidthHover*2,height:e.handleSizeHover+e.handleLineWidthHover*2},"&::after":{boxShadow:`0 0 0 ${e.handleLineWidthHover}px ${e.colorPrimary}`,width:e.handleSizeHover,height:e.handleSizeHover,insetInlineStart:(e.handleSize-e.handleSizeHover)/2,insetBlockStart:(e.handleSize-e.handleSizeHover)/2}}},[`${t}-mark`]:{position:`absolute`,fontSize:e.fontSize},[`${t}-mark-text`]:{position:`absolute`,display:`inline-block`,color:e.colorTextDescription,textAlign:`center`,wordBreak:`keep-all`,cursor:`pointer`,userSelect:`none`,"&-active":{color:e.colorText}},[`${t}-step`]:{position:`absolute`,background:`transparent`,pointerEvents:`none`},[`${t}-dot`]:{position:`absolute`,width:r,height:r,backgroundColor:e.colorBgElevated,border:`${e.handleLineWidth}px solid ${e.colorBorderSecondary}`,borderRadius:`50%`,cursor:`pointer`,transition:`border-color ${e.motionDurationSlow}`,"&-active":{borderColor:e.colorPrimaryBorder}},[`&${t}-disabled`]:{cursor:`not-allowed`,[`${t}-rail`]:{backgroundColor:`${e.colorFillSecondary} !important`},[`${t}-track`]:{backgroundColor:`${e.colorTextDisabled} !important`},[` + ${t}-dot + `]:{backgroundColor:e.colorBgElevated,borderColor:e.colorTextDisabled,boxShadow:`none`,cursor:`not-allowed`},[`${t}-handle::after`]:{backgroundColor:e.colorBgElevated,cursor:`not-allowed`,width:e.handleSize,height:e.handleSize,boxShadow:`0 0 0 ${e.handleLineWidth}px ${new we(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString()}`,insetInlineStart:0,insetBlockStart:0},[` + ${t}-mark-text, + ${t}-dot + `]:{cursor:`not-allowed !important`}}})}},KH=(e,t)=>{let{componentCls:n,railSize:r,handleSize:i,dotSize:a}=e,o=t?`paddingBlock`:`paddingInline`,s=t?`width`:`height`,c=t?`height`:`width`,l=t?`insetBlockStart`:`insetInlineStart`,u=t?`top`:`insetInlineStart`;return{[o]:r,[c]:r*3,[`${n}-rail`]:{[s]:`100%`,[c]:r},[`${n}-track`]:{[c]:r},[`${n}-handle`]:{[l]:(r*3-i)/2},[`${n}-mark`]:{insetInlineStart:0,top:0,[u]:i,[s]:`100%`},[`${n}-step`]:{insetInlineStart:0,top:0,[u]:r,[s]:`100%`,[c]:r},[`${n}-dot`]:{position:`absolute`,[l]:(r-a)/2}}},qH=e=>{let{componentCls:t,marginPartWithMark:n}=e;return{[`${t}-horizontal`]:Z(Z({},KH(e,!0)),{[`&${t}-with-marks`]:{marginBottom:n}})}},JH=e=>{let{componentCls:t}=e;return{[`${t}-vertical`]:Z(Z({},KH(e,!1)),{height:`100%`})}},YH=v(`Slider`,e=>{let t=B(e,{marginPart:(e.controlHeight-e.controlSize)/2,marginFull:e.controlSize/2,marginPartWithMark:e.controlHeightLG-e.controlSize});return[GH(t),qH(t),JH(t)]},e=>{let t=e.controlHeightLG/4;return{controlSize:t,railSize:4,handleSize:t,handleSizeHover:e.controlHeightSM/2,dotSize:8,handleLineWidth:e.lineWidth+1,handleLineWidthHover:e.lineWidth+3}}),XH=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);itypeof e==`number`?e.toString():``,QH=a(u({compatConfig:{MODE:3},name:`ASlider`,inheritAttrs:!1,props:{id:String,prefixCls:String,tooltipPrefixCls:String,range:W([Boolean,Object]),reverse:Q(),min:Number,max:Number,step:W([Object,Number]),marks:Qt(),dots:Q(),value:W([Array,Number]),defaultValue:W([Array,Number]),included:Q(),disabled:Q(),vertical:Q(),tipFormatter:W([Function,Object],()=>ZH),tooltipOpen:Q(),tooltipVisible:Q(),tooltipPlacement:_(),getTooltipPopupContainer:d(),autofocus:Q(),handleStyle:W([Array,Object]),trackStyle:W([Array,Object]),onChange:d(),onAfterChange:d(),onFocus:d(),onBlur:d(),"onUpdate:value":d()},slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i,expose:a}=t,{prefixCls:o,rootPrefixCls:s,direction:c,getPopupContainer:l,configProvider:u}=X(`slider`,e),[d,f]=YH(o),p=zf(),m=H(),h=H({}),g=(e,t)=>{h.value[e]=t},_=J(()=>e.tooltipPlacement?e.tooltipPlacement:e.vertical?c.value===`rtl`?`left`:`right`:`top`),v=()=>{var e;(e=m.value)==null||e.focus()},y=()=>{var e;(e=m.value)==null||e.blur()},b=e=>{i(`update:value`,e),i(`change`,e),p.onFieldChange()},x=e=>{i(`blur`,e)};a({focus:v,blur:y});let S=t=>{var{tooltipPrefixCls:n}=t,r=t.info,{value:i,dragging:a,index:c}=r,u=XH(r,[`value`,`dragging`,`index`]);let{tipFormatter:d,tooltipOpen:f=e.tooltipVisible,getTooltipPopupContainer:p}=e,m=d?h.value[c]||a:!1,v=f||f===void 0&&m;return U(WH,{prefixCls:n,title:d?d(i):``,open:v,placement:_.value,transitionName:`${s.value}-zoom-down`,key:c,overlayClassName:`${o.value}-tooltip`,getPopupContainer:p||l?.value},{default:()=>[U(CH,Y(Y({},u),{},{value:i,onMouseenter:()=>g(c,!0),onMouseleave:()=>g(c,!1)}),null)]})};return()=>{let{tooltipPrefixCls:t,range:i,id:a=p.id.value}=e,s=XH(e,[`tooltipPrefixCls`,`range`,`id`]),l=u.getPrefixCls(`tooltip`,t),h=K(n.class,{[`${o.value}-rtl`]:c.value===`rtl`},f.value);c.value===`rtl`&&!s.vertical&&(s.reverse=!s.reverse);let g;return typeof i==`object`&&(g=i.draggableTrack),d(i?U(UH,Y(Y(Y({},n),s),{},{step:s.step,draggableTrack:g,class:h,ref:m,handle:e=>S({tooltipPrefixCls:l,prefixCls:o.value,info:e}),prefixCls:o.value,onChange:b,onBlur:x}),{mark:r.mark}):U(BH,Y(Y(Y({},n),s),{},{id:a,step:s.step,class:h,ref:m,handle:e=>S({tooltipPrefixCls:l,prefixCls:o.value,info:e}),prefixCls:o.value,onChange:b,onBlur:x}),{mark:r.mark}))}}}));function $H(e){return typeof e==`string`}function eU(){}var tU=()=>({prefixCls:String,itemWidth:String,active:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},status:_(),iconPrefix:String,icon:f.any,adjustMarginRight:String,stepNumber:Number,stepIndex:Number,description:f.any,title:f.any,subTitle:f.any,progressDot:oe(f.oneOfType([f.looseBool,f.func])),tailContent:f.any,icons:f.shape({finish:f.any,error:f.any}).loose,onClick:d(),onStepClick:d(),stepIcon:d(),itemRender:d(),__legacy:Q()}),nU=u({compatConfig:{MODE:3},name:`Step`,inheritAttrs:!1,props:tU(),setup(e,t){let{slots:n,emit:r,attrs:i}=t,a=t=>{r(`click`,t),r(`stepClick`,e.stepIndex)},o=t=>{let{icon:r,title:i,description:a}=t,{prefixCls:o,stepNumber:s,status:c,iconPrefix:l,icons:u,progressDot:d=n.progressDot,stepIcon:f=n.stepIcon}=e,p,m=K(`${o}-icon`,`${l}icon`,{[`${l}icon-${r}`]:r&&$H(r),[`${l}icon-check`]:!r&&c===`finish`&&(u&&!u.finish||!u),[`${l}icon-cross`]:!r&&c===`error`&&(u&&!u.error||!u)}),h=U(`span`,{class:`${o}-icon-dot`},null);return p=d?typeof d==`function`?U(`span`,{class:`${o}-icon`},[d({iconDot:h,index:s-1,status:c,title:i,description:a,prefixCls:o})]):U(`span`,{class:`${o}-icon`},[h]):r&&!$H(r)?U(`span`,{class:`${o}-icon`},[r]):u&&u.finish&&c===`finish`?U(`span`,{class:`${o}-icon`},[u.finish]):u&&u.error&&c===`error`?U(`span`,{class:`${o}-icon`},[u.error]):r||c===`finish`||c===`error`?U(`span`,{class:m},null):U(`span`,{class:`${o}-icon`},[s]),f&&(p=f({index:s-1,status:c,title:i,description:a,node:p})),p};return()=>{let{prefixCls:t,itemWidth:r,active:s,status:c=`wait`,tailContent:l,adjustMarginRight:u,disabled:d,title:f=n.title?.call(n),description:p=n.description?.call(n),subTitle:m=n.subTitle?.call(n),icon:h=n.icon?.call(n),onClick:g,onStepClick:_}=e,v=c||`wait`,y=K(`${t}-item`,`${t}-item-${v}`,{[`${t}-item-custom`]:h,[`${t}-item-active`]:s,[`${t}-item-disabled`]:d===!0}),b={};r&&(b.width=r),u&&(b.marginRight=u);let x={onClick:g||eU};_&&!d&&(x.role=`button`,x.tabindex=0,x.onClick=a);let S=U(`div`,Y(Y({},Br(i,[`__legacy`])),{},{class:[y,i.class],style:[i.style,b]}),[U(`div`,Y(Y({},x),{},{class:`${t}-item-container`}),[U(`div`,{class:`${t}-item-tail`},[l]),U(`div`,{class:`${t}-item-icon`},[o({icon:h,title:f,description:p})]),U(`div`,{class:`${t}-item-content`},[U(`div`,{class:`${t}-item-title`},[f,m&&U(`div`,{title:typeof m==`string`?m:void 0,class:`${t}-item-subtitle`},[m])]),p&&U(`div`,{class:`${t}-item-description`},[p])])])]);return e.itemRender?e.itemRender(S):S}}}),rU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i[]),icons:f.shape({finish:f.any,error:f.any}).loose,stepIcon:d(),isInline:f.looseBool,itemRender:d()},emits:[`change`],setup(e,t){let{slots:n,emit:r}=t,i=t=>{let{current:n}=e;n!==t&&r(`change`,t)},a=(t,r,a)=>{let{prefixCls:o,iconPrefix:s,status:c,current:l,initial:u,icons:d,stepIcon:f=n.stepIcon,isInline:p,itemRender:m,progressDot:h=n.progressDot}=e,g=p||h,_=Z(Z({},t),{class:``}),v=u+r,y={active:v===l,stepNumber:v+1,stepIndex:v,key:v,prefixCls:o,iconPrefix:s,progressDot:g,stepIcon:f,icons:d,onStepClick:i};return c===`error`&&r===l-1&&(_.class=`${o}-next-error`),_.status||(v===l?_.status=c:vm(_,e)),U(nU,Y(Y(Y({},_),y),{},{__legacy:!1}),null))},o=(e,t)=>a(Z({},e.props),t,t=>ao(e,t));return()=>{let{prefixCls:t,direction:r,type:i,labelPlacement:s,iconPrefix:c,status:l,size:u,current:d,progressDot:f=n.progressDot,initial:p,icons:m,items:h,isInline:g,itemRender:_}=e,v=rU(e,[`prefixCls`,`direction`,`type`,`labelPlacement`,`iconPrefix`,`status`,`size`,`current`,`progressDot`,`initial`,`icons`,`items`,`isInline`,`itemRender`]),y=i===`navigation`,b=g||f,x=g?`horizontal`:r,S=g?void 0:u,C=b?`vertical`:s;return U(`div`,Y({class:K(t,`${t}-${r}`,{[`${t}-${S}`]:S,[`${t}-label-${C}`]:x===`horizontal`,[`${t}-dot`]:!!b,[`${t}-navigation`]:y,[`${t}-inline`]:g})},v),[h.filter(e=>e).map((e,t)=>a(e,t)),dt(n.default?.call(n)).map(o)])}}}),aU=e=>{let{componentCls:t,stepsIconCustomTop:n,stepsIconCustomSize:r,stepsIconCustomFontSize:i}=e;return{[`${t}-item-custom`]:{[`> ${t}-item-container > ${t}-item-icon`]:{height:`auto`,background:`none`,border:0,[`> ${t}-icon`]:{top:n,width:r,height:r,fontSize:i,lineHeight:`${r}px`}}},[`&:not(${t}-vertical)`]:{[`${t}-item-custom`]:{[`${t}-item-icon`]:{width:`auto`,background:`none`}}}}},oU=e=>{let{componentCls:t,stepsIconSize:n,lineHeight:r,stepsSmallIconSize:i}=e;return{[`&${t}-label-vertical`]:{[`${t}-item`]:{overflow:`visible`,"&-tail":{marginInlineStart:n/2+e.controlHeightLG,padding:`${e.paddingXXS}px ${e.paddingLG}px`},"&-content":{display:`block`,width:(n/2+e.controlHeightLG)*2,marginTop:e.marginSM,textAlign:`center`},"&-icon":{display:`inline-block`,marginInlineStart:e.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:`none`}},"&-subtitle":{display:`block`,marginBottom:e.marginXXS,marginInlineStart:0,lineHeight:r}},[`&${t}-small:not(${t}-dot)`]:{[`${t}-item`]:{"&-icon":{marginInlineStart:e.controlHeightLG+(n-i)/2}}}}}},sU=e=>{let{componentCls:t,stepsNavContentMaxWidth:n,stepsNavArrowColor:r,stepsNavActiveColor:i,motionDurationSlow:a}=e;return{[`&${t}-navigation`]:{paddingTop:e.paddingSM,[`&${t}-small`]:{[`${t}-item`]:{"&-container":{marginInlineStart:-e.marginSM}}},[`${t}-item`]:{overflow:`visible`,textAlign:`center`,"&-container":{display:`inline-block`,height:`100%`,marginInlineStart:-e.margin,paddingBottom:e.paddingSM,textAlign:`start`,transition:`opacity ${a}`,[`${t}-item-content`]:{maxWidth:n},[`${t}-item-title`]:Z(Z({maxWidth:`100%`,paddingInlineEnd:0},xe),{"&::after":{display:`none`}})},[`&:not(${t}-item-active)`]:{[`${t}-item-container[role='button']`]:{cursor:`pointer`,"&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:`none`}},"&::after":{position:`absolute`,top:`calc(50% - ${e.paddingSM/2}px)`,insetInlineStart:`100%`,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,borderTop:`${e.lineWidth}px ${e.lineType} ${r}`,borderBottom:`none`,borderInlineStart:`none`,borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${r}`,transform:`translateY(-50%) translateX(-50%) rotate(45deg)`,content:`""`},"&::before":{position:`absolute`,bottom:0,insetInlineStart:`50%`,display:`inline-block`,width:0,height:e.lineWidthBold,backgroundColor:i,transition:`width ${a}, inset-inline-start ${a}`,transitionTimingFunction:`ease-out`,content:`""`}},[`${t}-item${t}-item-active::before`]:{insetInlineStart:0,width:`100%`}},[`&${t}-navigation${t}-vertical`]:{[`> ${t}-item`]:{marginInlineEnd:0,"&::before":{display:`none`},[`&${t}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:`unset`,display:`block`,width:e.lineWidth*3,height:`calc(100% - ${e.marginLG}px)`},"&::after":{position:`relative`,insetInlineStart:`50%`,display:`block`,width:e.controlHeight*.25,height:e.controlHeight*.25,marginBottom:e.marginXS,textAlign:`center`,transform:`translateY(-50%) translateX(-50%) rotate(135deg)`},[`> ${t}-item-container > ${t}-item-tail`]:{visibility:`hidden`}}},[`&${t}-navigation${t}-horizontal`]:{[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{visibility:`hidden`}}}},cU=e=>{let{antCls:t,componentCls:n}=e;return{[`&${n}-with-progress`]:{[`${n}-item`]:{paddingTop:e.paddingXXS,[`&-process ${n}-item-container ${n}-item-icon ${n}-icon`]:{color:e.processIconColor}},[`&${n}-vertical > ${n}-item `]:{paddingInlineStart:e.paddingXXS,[`> ${n}-item-container > ${n}-item-tail`]:{top:e.marginXXS,insetInlineStart:e.stepsIconSize/2-e.lineWidth+e.paddingXXS}},[`&, &${n}-small`]:{[`&${n}-horizontal ${n}-item:first-child`]:{paddingBottom:e.paddingXXS,paddingInlineStart:e.paddingXXS}},[`&${n}-small${n}-vertical > ${n}-item > ${n}-item-container > ${n}-item-tail`]:{insetInlineStart:e.stepsSmallIconSize/2-e.lineWidth+e.paddingXXS},[`&${n}-label-vertical`]:{[`${n}-item ${n}-item-tail`]:{top:e.margin-2*e.lineWidth}},[`${n}-item-icon`]:{position:`relative`,[`${t}-progress`]:{position:`absolute`,insetBlockStart:(e.stepsIconSize-e.stepsProgressSize-e.lineWidth*2)/2,insetInlineStart:(e.stepsIconSize-e.stepsProgressSize-e.lineWidth*2)/2}}}}},lU=e=>{let{componentCls:t,descriptionWidth:n,lineHeight:r,stepsCurrentDotSize:i,stepsDotSize:a,motionDurationSlow:o}=e;return{[`&${t}-dot, &${t}-dot${t}-small`]:{[`${t}-item`]:{"&-title":{lineHeight:r},"&-tail":{top:Math.floor((e.stepsDotSize-e.lineWidth*3)/2),width:`100%`,marginTop:0,marginBottom:0,marginInline:`${n/2}px 0`,padding:0,"&::after":{width:`calc(100% - ${e.marginSM*2}px)`,height:e.lineWidth*3,marginInlineStart:e.marginSM}},"&-icon":{width:a,height:a,marginInlineStart:(e.descriptionWidth-a)/2,paddingInlineEnd:0,lineHeight:`${a}px`,background:`transparent`,border:0,[`${t}-icon-dot`]:{position:`relative`,float:`left`,width:`100%`,height:`100%`,borderRadius:100,transition:`all ${o}`,"&::after":{position:`absolute`,top:-e.marginSM,insetInlineStart:(a-e.controlHeightLG*1.5)/2,width:e.controlHeightLG*1.5,height:e.controlHeight,background:`transparent`,content:`""`}}},"&-content":{width:n},[`&-process ${t}-item-icon`]:{position:`relative`,top:(a-i)/2,width:i,height:i,lineHeight:`${i}px`,background:`none`,marginInlineStart:(e.descriptionWidth-i)/2},[`&-process ${t}-icon`]:{[`&:first-child ${t}-icon-dot`]:{insetInlineStart:0}}}},[`&${t}-vertical${t}-dot`]:{[`${t}-item-icon`]:{marginTop:(e.controlHeight-a)/2,marginInlineStart:0,background:`none`},[`${t}-item-process ${t}-item-icon`]:{marginTop:(e.controlHeight-i)/2,top:0,insetInlineStart:(a-i)/2,marginInlineStart:0},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:(e.controlHeight-a)/2,insetInlineStart:0,margin:0,padding:`${a+e.paddingXS}px 0 ${e.paddingXS}px`,"&::after":{marginInlineStart:(a-e.lineWidth)/2}},[`&${t}-small`]:{[`${t}-item-icon`]:{marginTop:(e.controlHeightSM-a)/2},[`${t}-item-process ${t}-item-icon`]:{marginTop:(e.controlHeightSM-i)/2},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:(e.controlHeightSM-a)/2}},[`${t}-item:first-child ${t}-icon-dot`]:{insetInlineStart:0},[`${t}-item-content`]:{width:`inherit`}}}},uU=e=>{let{componentCls:t}=e;return{[`&${t}-rtl`]:{direction:`rtl`,[`${t}-item`]:{"&-subtitle":{float:`left`}},[`&${t}-navigation`]:{[`${t}-item::after`]:{transform:`rotate(-45deg)`}},[`&${t}-vertical`]:{[`> ${t}-item`]:{"&::after":{transform:`rotate(225deg)`},[`${t}-item-icon`]:{float:`right`}}},[`&${t}-dot`]:{[`${t}-item-icon ${t}-icon-dot, &${t}-small ${t}-item-icon ${t}-icon-dot`]:{float:`right`}}}}},dU=e=>{let{componentCls:t,stepsSmallIconSize:n,fontSizeSM:r,fontSize:i,colorTextDescription:a}=e;return{[`&${t}-small`]:{[`&${t}-horizontal:not(${t}-label-vertical) ${t}-item`]:{paddingInlineStart:e.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${t}-item-icon`]:{width:n,height:n,marginTop:0,marginBottom:0,marginInline:`0 ${e.marginXS}px`,fontSize:r,lineHeight:`${n}px`,textAlign:`center`,borderRadius:n},[`${t}-item-title`]:{paddingInlineEnd:e.paddingSM,fontSize:i,lineHeight:`${n}px`,"&::after":{top:n/2}},[`${t}-item-description`]:{color:a,fontSize:i},[`${t}-item-tail`]:{top:n/2-e.paddingXXS},[`${t}-item-custom ${t}-item-icon`]:{width:`inherit`,height:`inherit`,lineHeight:`inherit`,background:`none`,border:0,borderRadius:0,[`> ${t}-icon`]:{fontSize:n,lineHeight:`${n}px`,transform:`none`}}}}},fU=e=>{let{componentCls:t,stepsSmallIconSize:n,stepsIconSize:r}=e;return{[`&${t}-vertical`]:{display:`flex`,flexDirection:`column`,[`> ${t}-item`]:{display:`block`,flex:`1 0 auto`,paddingInlineStart:0,overflow:`visible`,[`${t}-item-icon`]:{float:`left`,marginInlineEnd:e.margin},[`${t}-item-content`]:{display:`block`,minHeight:e.controlHeight*1.5,overflow:`hidden`},[`${t}-item-title`]:{lineHeight:`${r}px`},[`${t}-item-description`]:{paddingBottom:e.paddingSM}},[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{position:`absolute`,top:0,insetInlineStart:e.stepsIconSize/2-e.lineWidth,width:e.lineWidth,height:`100%`,padding:`${r+e.marginXXS*1.5}px 0 ${e.marginXXS*1.5}px`,"&::after":{width:e.lineWidth,height:`100%`}},[`> ${t}-item:not(:last-child) > ${t}-item-container > ${t}-item-tail`]:{display:`block`},[` > ${t}-item > ${t}-item-container > ${t}-item-content > ${t}-item-title`]:{"&::after":{display:`none`}},[`&${t}-small ${t}-item-container`]:{[`${t}-item-tail`]:{position:`absolute`,top:0,insetInlineStart:e.stepsSmallIconSize/2-e.lineWidth,padding:`${n+e.marginXXS*1.5}px 0 ${e.marginXXS*1.5}px`},[`${t}-item-title`]:{lineHeight:`${n}px`}}}}},pU=e=>{let{componentCls:t,inlineDotSize:n,inlineTitleColor:r,inlineTailColor:i}=e,a=e.paddingXS+e.lineWidth,o={[`${t}-item-container ${t}-item-content ${t}-item-title`]:{color:r}};return{[`&${t}-inline`]:{width:`auto`,display:`inline-flex`,[`${t}-item`]:{flex:`none`,"&-container":{padding:`${a}px ${e.paddingXXS}px 0`,margin:`0 ${e.marginXXS/2}px`,borderRadius:e.borderRadiusSM,cursor:`pointer`,transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:n,height:n,marginInlineStart:`calc(50% - ${n/2}px)`,[`> ${t}-icon`]:{top:0},[`${t}-icon-dot`]:{borderRadius:e.fontSizeSM/4}},"&-content":{width:`auto`,marginTop:e.marginXS-e.lineWidth},"&-title":{color:r,fontSize:e.fontSizeSM,lineHeight:e.lineHeightSM,fontWeight:`normal`,marginBottom:e.marginXXS/2},"&-description":{display:`none`},"&-tail":{marginInlineStart:0,top:a+n/2,transform:`translateY(-50%)`,"&:after":{width:`100%`,height:e.lineWidth,borderRadius:0,marginInlineStart:0,background:i}},[`&:first-child ${t}-item-tail`]:{width:`50%`,marginInlineStart:`50%`},[`&:last-child ${t}-item-tail`]:{display:`block`,width:`50%`},"&-wait":Z({[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:e.colorBorderBg,border:`${e.lineWidth}px ${e.lineType} ${i}`}},o),"&-finish":Z({[`${t}-item-tail::after`]:{backgroundColor:i},[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:i,border:`${e.lineWidth}px ${e.lineType} ${i}`}},o),"&-error":o,"&-active, &-process":Z({[`${t}-item-icon`]:{width:n,height:n,marginInlineStart:`calc(50% - ${n/2}px)`,top:0}},o),[`&:not(${t}-item-active) > ${t}-item-container[role='button']:hover`]:{[`${t}-item-title`]:{color:r}}}}}},mU;(function(e){e.wait=`wait`,e.process=`process`,e.finish=`finish`,e.error=`error`})(mU||={});var hU=(e,t)=>{let n=`${t.componentCls}-item`,r=`${e}IconColor`,i=`${e}TitleColor`,a=`${e}DescriptionColor`,o=`${e}TailColor`,s=`${e}IconBgColor`,c=`${e}IconBorderColor`,l=`${e}DotColor`;return{[`${n}-${e} ${n}-icon`]:{backgroundColor:t[s],borderColor:t[c],[`> ${t.componentCls}-icon`]:{color:t[r],[`${t.componentCls}-icon-dot`]:{background:t[l]}}},[`${n}-${e}${n}-custom ${n}-icon`]:{[`> ${t.componentCls}-icon`]:{color:t[l]}},[`${n}-${e} > ${n}-container > ${n}-content > ${n}-title`]:{color:t[i],"&::after":{backgroundColor:t[o]}},[`${n}-${e} > ${n}-container > ${n}-content > ${n}-description`]:{color:t[a]},[`${n}-${e} > ${n}-container > ${n}-tail::after`]:{backgroundColor:t[o]}}},gU=e=>{let{componentCls:t,motionDurationSlow:n}=e,r=`${t}-item`;return Z(Z(Z(Z(Z(Z({[r]:{position:`relative`,display:`inline-block`,flex:1,overflow:`hidden`,verticalAlign:`top`,"&:last-child":{flex:`none`,[`> ${r}-container > ${r}-tail, > ${r}-container > ${r}-content > ${r}-title::after`]:{display:`none`}}},[`${r}-container`]:{outline:`none`},[`${r}-icon, ${r}-content`]:{display:`inline-block`,verticalAlign:`top`},[`${r}-icon`]:{width:e.stepsIconSize,height:e.stepsIconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:e.marginXS,fontSize:e.stepsIconFontSize,fontFamily:e.fontFamily,lineHeight:`${e.stepsIconSize}px`,textAlign:`center`,borderRadius:e.stepsIconSize,border:`${e.lineWidth}px ${e.lineType} transparent`,transition:`background-color ${n}, border-color ${n}`,[`${t}-icon`]:{position:`relative`,top:e.stepsIconTop,color:e.colorPrimary,lineHeight:1}},[`${r}-tail`]:{position:`absolute`,top:e.stepsIconSize/2-e.paddingXXS,insetInlineStart:0,width:`100%`,"&::after":{display:`inline-block`,width:`100%`,height:e.lineWidth,background:e.colorSplit,borderRadius:e.lineWidth,transition:`background ${n}`,content:`""`}},[`${r}-title`]:{position:`relative`,display:`inline-block`,paddingInlineEnd:e.padding,color:e.colorText,fontSize:e.fontSizeLG,lineHeight:`${e.stepsTitleLineHeight}px`,"&::after":{position:`absolute`,top:e.stepsTitleLineHeight/2,insetInlineStart:`100%`,display:`block`,width:9999,height:e.lineWidth,background:e.processTailColor,content:`""`}},[`${r}-subtitle`]:{display:`inline`,marginInlineStart:e.marginXS,color:e.colorTextDescription,fontWeight:`normal`,fontSize:e.fontSize},[`${r}-description`]:{color:e.colorTextDescription,fontSize:e.fontSize}},hU(mU.wait,e)),hU(mU.process,e)),{[`${r}-process > ${r}-container > ${r}-title`]:{fontWeight:e.fontWeightStrong}}),hU(mU.finish,e)),hU(mU.error,e)),{[`${r}${t}-next-error > ${t}-item-title::after`]:{background:e.colorError},[`${r}-disabled`]:{cursor:`not-allowed`}})},_U=e=>{let{componentCls:t,motionDurationSlow:n}=e;return{[`& ${t}-item`]:{[`&:not(${t}-item-active)`]:{[`& > ${t}-item-container[role='button']`]:{cursor:`pointer`,[`${t}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${t}-icon`]:{transition:`color ${n}`}},"&:hover":{[`${t}-item`]:{"&-title, &-subtitle, &-description":{color:e.colorPrimary}}}},[`&:not(${t}-item-process)`]:{[`& > ${t}-item-container[role='button']:hover`]:{[`${t}-item`]:{"&-icon":{borderColor:e.colorPrimary,[`${t}-icon`]:{color:e.colorPrimary}}}}}}},[`&${t}-horizontal:not(${t}-label-vertical)`]:{[`${t}-item`]:{paddingInlineStart:e.padding,whiteSpace:`nowrap`,"&:first-child":{paddingInlineStart:0},[`&:last-child ${t}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:`none`},"&-description":{maxWidth:e.descriptionWidth,whiteSpace:`normal`}}}}},vU=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z({},rn(e)),{display:`flex`,width:`100%`,fontSize:0,textAlign:`initial`}),gU(e)),_U(e)),aU(e)),dU(e)),fU(e)),oU(e)),lU(e)),sU(e)),uU(e)),cU(e)),pU(e))}},yU=v(`Steps`,e=>{let{wireframe:t,colorTextDisabled:n,fontSizeHeading3:r,fontSize:i,controlHeight:a,controlHeightLG:o,colorTextLightSolid:s,colorText:c,colorPrimary:l,colorTextLabel:u,colorTextDescription:d,colorTextQuaternary:f,colorFillContent:p,controlItemBgActive:m,colorError:h,colorBgContainer:g,colorBorderSecondary:_}=e,v=e.controlHeight,y=e.colorSplit;return[vU(B(e,{processTailColor:y,stepsNavArrowColor:n,stepsIconSize:v,stepsIconCustomSize:v,stepsIconCustomTop:0,stepsIconCustomFontSize:o/2,stepsIconTop:-.5,stepsIconFontSize:i,stepsTitleLineHeight:a,stepsSmallIconSize:r,stepsDotSize:a/4,stepsCurrentDotSize:o/4,stepsNavContentMaxWidth:`auto`,processIconColor:s,processTitleColor:c,processDescriptionColor:c,processIconBgColor:l,processIconBorderColor:l,processDotColor:l,waitIconColor:t?n:u,waitTitleColor:d,waitDescriptionColor:d,waitTailColor:y,waitIconBgColor:t?g:p,waitIconBorderColor:t?n:`transparent`,waitDotColor:n,finishIconColor:l,finishTitleColor:c,finishDescriptionColor:d,finishTailColor:l,finishIconBgColor:t?g:m,finishIconBorderColor:t?l:m,finishDotColor:l,errorIconColor:s,errorTitleColor:h,errorDescriptionColor:h,errorTailColor:y,errorIconBgColor:h,errorIconBorderColor:h,errorDotColor:h,stepsNavActiveColor:l,stepsProgressSize:o,inlineDotSize:6,inlineTitleColor:f,inlineTailColor:_}))]},{descriptionWidth:140}),bU=u({compatConfig:{MODE:3},name:`ASteps`,inheritAttrs:!1,props:Zn({prefixCls:String,iconPrefix:String,current:Number,initial:Number,percent:Number,responsive:Q(),items:Ue(),labelPlacement:_(),status:_(),size:_(),direction:_(),progressDot:W([Boolean,Function]),type:_(),onChange:d(),"onUpdate:current":d()},{current:0,responsive:!0,labelPlacement:`horizontal`}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i}=t,{prefixCls:a,direction:o,configProvider:s}=X(`steps`,e),[c,l]=yU(a),[,u]=re(),d=Uv(),f=J(()=>e.responsive&&d.value.xs?`vertical`:e.direction),p=J(()=>s.getPrefixCls(``,e.iconPrefix)),m=e=>{i(`update:current`,e),i(`change`,e)},h=J(()=>e.type===`inline`),g=J(()=>h.value?void 0:e.percent),_=t=>{let{node:n,status:r}=t;if(r===`process`&&e.percent!==void 0){let t=e.size===`small`?u.value.controlHeight:u.value.controlHeightLG;return U(`div`,{class:`${a.value}-progress-icon`},[U(zV,{type:`circle`,percent:g.value,size:t,strokeWidth:4,format:()=>null},null),n])}return n},v=J(()=>({finish:U(Df,{class:`${a.value}-finish-icon`},null),error:U(Pe,{class:`${a.value}-error-icon`},null)}));return()=>{let t=K({[`${a.value}-rtl`]:o.value===`rtl`,[`${a.value}-with-progress`]:g.value!==void 0},n.class,l.value);return c(U(iU,Y(Y(Y({icons:v.value},n),Br(e,[`percent`,`responsive`])),{},{items:e.items,direction:f.value,prefixCls:a.value,iconPrefix:p.value,class:t,onChange:m,isInline:h.value,itemRender:h.value?(e,t)=>e.description?U(Ty,{title:e.description},{default:()=>[t]}):t:void 0}),Z({stepIcon:_},r)))}}}),xU=u(Z(Z({compatConfig:{MODE:3}},nU),{name:`AStep`,props:tU()})),SU=Z(bU,{Step:xU,install:e=>(e.component(bU.name,bU),e.component(xU.name,xU),e)}),CU=e=>{let{componentCls:t}=e,n=`${t}-inner`;return{[t]:{[`&${t}-small`]:{minWidth:e.switchMinWidthSM,height:e.switchHeightSM,lineHeight:`${e.switchHeightSM}px`,[`${t}-inner`]:{paddingInlineStart:e.switchInnerMarginMaxSM,paddingInlineEnd:e.switchInnerMarginMinSM,[`${n}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSizeSM+e.switchPadding*2}px - ${e.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSizeSM+e.switchPadding*2}px + ${e.switchInnerMarginMaxSM*2}px)`},[`${n}-unchecked`]:{marginTop:-e.switchHeightSM,marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:e.switchPinSizeSM,height:e.switchPinSizeSM},[`${t}-loading-icon`]:{top:(e.switchPinSizeSM-e.switchLoadingIconSize)/2,fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:e.switchInnerMarginMinSM,paddingInlineEnd:e.switchInnerMarginMaxSM,[`${n}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${n}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding*2}px + ${e.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSizeSM+e.switchPadding*2}px - ${e.switchInnerMarginMaxSM*2}px)`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding}px)`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${n}`]:{[`${n}-unchecked`]:{marginInlineStart:e.marginXXS/2,marginInlineEnd:-e.marginXXS/2}},[`&${t}-checked ${n}`]:{[`${n}-checked`]:{marginInlineStart:-e.marginXXS/2,marginInlineEnd:e.marginXXS/2}}}}}}},wU=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:`relative`,top:(e.switchPinSize-e.fontSize)/2,color:e.switchLoadingIconColor,verticalAlign:`top`},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}},TU=e=>{let{componentCls:t}=e,n=`${t}-handle`;return{[t]:{[n]:{position:`absolute`,top:e.switchPadding,insetInlineStart:e.switchPadding,width:e.switchPinSize,height:e.switchPinSize,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:e.colorWhite,borderRadius:e.switchPinSize/2,boxShadow:e.switchHandleShadow,transition:`all ${e.switchDuration} ease-in-out`,content:`""`}},[`&${t}-checked ${n}`]:{insetInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding}px)`},[`&:not(${t}-disabled):active`]:{[`${n}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${n}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},EU=e=>{let{componentCls:t}=e,n=`${t}-inner`;return{[t]:{[n]:{display:`block`,overflow:`hidden`,borderRadius:100,height:`100%`,paddingInlineStart:e.switchInnerMarginMax,paddingInlineEnd:e.switchInnerMarginMin,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${n}-checked, ${n}-unchecked`]:{display:`block`,color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:`none`},[`${n}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSize+e.switchPadding*2}px - ${e.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSize+e.switchPadding*2}px + ${e.switchInnerMarginMax*2}px)`},[`${n}-unchecked`]:{marginTop:-e.switchHeight,marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${n}`]:{paddingInlineStart:e.switchInnerMarginMin,paddingInlineEnd:e.switchInnerMarginMax,[`${n}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${n}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding*2}px + ${e.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSize+e.switchPadding*2}px - ${e.switchInnerMarginMax*2}px)`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${n}`]:{[`${n}-unchecked`]:{marginInlineStart:e.switchPadding*2,marginInlineEnd:-e.switchPadding*2}},[`&${t}-checked ${n}`]:{[`${n}-checked`]:{marginInlineStart:-e.switchPadding*2,marginInlineEnd:e.switchPadding*2}}}}}},DU=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,boxSizing:`border-box`,minWidth:e.switchMinWidth,height:e.switchHeight,lineHeight:`${e.switchHeight}px`,verticalAlign:`middle`,background:e.colorTextQuaternary,border:`0`,borderRadius:100,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,userSelect:`none`,[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),de(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:`not-allowed`,opacity:e.switchDisabledOpacity,"*":{boxShadow:`none`,cursor:`not-allowed`}},[`&${t}-rtl`]:{direction:`rtl`}})}},OU=v(`Switch`,e=>{let t=e.fontSize*e.lineHeight,n=e.controlHeight/2,r=t-4,i=n-4,a=B(e,{switchMinWidth:r*2+8,switchHeight:t,switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchInnerMarginMin:r/2,switchInnerMarginMax:r+2+4,switchPadding:2,switchPinSize:r,switchBg:e.colorBgContainer,switchMinWidthSM:i*2+4,switchHeightSM:n,switchInnerMarginMinSM:i/2,switchInnerMarginMaxSM:i+2+4,switchPinSizeSM:i,switchHandleShadow:`0 2px 4px 0 ${new we(`#00230b`).setAlpha(.2).toRgbString()}`,switchLoadingIconSize:e.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:`-30%`});return[DU(a),EU(a),TU(a),wU(a),CU(a)]}),kU=m(`small`,`default`),AU=a(u({compatConfig:{MODE:3},name:`ASwitch`,__ANT_SWITCH:!0,inheritAttrs:!1,props:{id:String,prefixCls:String,size:f.oneOf(kU),disabled:{type:Boolean,default:void 0},checkedChildren:f.any,unCheckedChildren:f.any,tabindex:f.oneOfType([f.string,f.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:f.oneOfType([f.string,f.number,f.looseBool]),checkedValue:f.oneOfType([f.string,f.number,f.looseBool]).def(!0),unCheckedValue:f.oneOfType([f.string,f.number,f.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function},slots:Object,setup(t,n){let{attrs:r,slots:a,expose:o,emit:s}=n,c=zf(),l=at(),u=J(()=>t.disabled??l.value);i(()=>{e(!(`defaultChecked`in r),`Switch`,`'defaultChecked' is deprecated, please use 'v-model:checked'`),e(!(`value`in r),`Switch`,"`value` is not validate prop, do you mean `checked`?")});let d=H(t.checked===void 0?r.defaultChecked:t.checked),f=J(()=>d.value===t.checkedValue);G(()=>t.checked,()=>{d.value=t.checked});let{prefixCls:p,direction:m,size:h}=X(`switch`,t),[g,_]=OU(p),v=H(),y=()=>{var e;(e=v.value)==null||e.focus()};o({focus:y,blur:()=>{var e;(e=v.value)==null||e.blur()}}),V(()=>{z(()=>{t.autofocus&&!u.value&&v.value.focus()})});let b=(e,t)=>{u.value||(s(`update:checked`,e),s(`change`,e,t),c.onFieldChange())},x=e=>{s(`blur`,e)},S=e=>{y();let n=f.value?t.unCheckedValue:t.checkedValue;b(n,e),s(`click`,n,e)},C=e=>{e.keyCode===$.LEFT?b(t.unCheckedValue,e):e.keyCode===$.RIGHT&&b(t.checkedValue,e),s(`keydown`,e)},w=e=>{var t;(t=v.value)==null||t.blur(),s(`mouseup`,e)},T=J(()=>({[`${p.value}-small`]:h.value===`small`,[`${p.value}-loading`]:t.loading,[`${p.value}-checked`]:f.value,[`${p.value}-disabled`]:u.value,[p.value]:!0,[`${p.value}-rtl`]:m.value===`rtl`,[_.value]:!0}));return()=>g(U(db,null,{default:()=>[U(`button`,Y(Y(Y({},Br(t,[`prefixCls`,`checkedChildren`,`unCheckedChildren`,`checked`,`autofocus`,`checkedValue`,`unCheckedValue`,`id`,`onChange`,`onUpdate:checked`])),r),{},{id:t.id??c.id.value,onKeydown:C,onClick:S,onBlur:x,onMouseup:w,type:`button`,role:`switch`,"aria-checked":d.value,disabled:u.value||t.loading,class:[r.class,T.value],ref:v}),[U(`div`,{class:`${p.value}-handle`},[t.loading?U(qt,{class:`${p.value}-loading-icon`},null):null]),U(`span`,{class:`${p.value}-inner`},[U(`span`,{class:`${p.value}-inner-checked`},[on(a,t,`checkedChildren`)]),U(`span`,{class:`${p.value}-inner-unchecked`},[on(a,t,`unCheckedChildren`)])])])]}))}})),jU=Symbol(`TableContextProps`),MU=e=>{fe(jU,e)},NU=()=>g(jU,{}),PU=`RC_TABLE_KEY`;function FU(e){return e==null?[]:Array.isArray(e)?e:[e]}function IU(e,t){if(!t&&typeof t!=`number`)return e;let n=FU(t),r=e;for(let e=0;e{let{key:r,dataIndex:i}=e||{},a=r||FU(i).join(`-`)||PU;for(;n[a];)a=`${a}_next`;n[a]=!0,t.push(a)}),t}function RU(){let e={};function t(e,n){n&&Object.keys(n).forEach(r=>{let i=n[r];i&&typeof i==`object`?(e[r]=e[r]||{},t(e[r],i)):e[r]=i})}return[...arguments].forEach(n=>{t(e,n)}),e}function zU(e){return e!=null}var BU=Symbol(`SlotsContextProps`),VU=e=>{fe(BU,e)},HU=()=>g(BU,J(()=>({}))),UU=Symbol(`ContextProps`),WU=e=>{fe(UU,e)},GU=()=>g(UU,{onResizeColumn:()=>{}}),KU=`RC_TABLE_INTERNAL_COL_DEFINE`,qU=Symbol(`HoverContextProps`),JU=e=>{fe(qU,e)},YU=()=>g(qU,{startRow:q(-1),endRow:q(-1),onHover(){}}),XU=q(!1),ZU=()=>{V(()=>{XU.value=XU.value||OA(`position`,`sticky`)})},QU=()=>XU,$U=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i=n}function tW(e){return e&&typeof e==`object`&&!Array.isArray(e)&&!p(e)}var nW=u({name:`Cell`,props:[`prefixCls`,`record`,`index`,`renderIndex`,`dataIndex`,`customRender`,`component`,`colSpan`,`rowSpan`,`fixLeft`,`fixRight`,`firstFixLeft`,`lastFixLeft`,`firstFixRight`,`lastFixRight`,`appendNode`,`additionalProps`,`ellipsis`,`align`,`rowType`,`isSticky`,`column`,`cellType`,`transformCellText`],setup(e,t){let{slots:n}=t,r=HU(),{onHover:i,startRow:a,endRow:o}=YU(),s=J(()=>e.colSpan??e.additionalProps?.colSpan??e.additionalProps?.colspan),c=J(()=>e.rowSpan??e.additionalProps?.rowSpan??e.additionalProps?.rowspan),l=Wv(()=>{let{index:t}=e;return eW(t,c.value||1,a.value,o.value)}),u=QU(),d=(t,n)=>{var r;let{record:a,index:o,additionalProps:s}=e;a&&i(o,o+n-1),(r=s?.onMouseenter)==null||r.call(s,t)},f=t=>{var n;let{record:r,additionalProps:a}=e;r&&i(-1,-1),(n=a?.onMouseleave)==null||n.call(a,t)},m=e=>{let t=dt(e)[0];return p(t)?t.type===vt?t.children:Array.isArray(t.children)?m(t.children):void 0:t},h=q(null);return G([l,()=>e.prefixCls,h],()=>{let t=ae(h.value);t&&(l.value?rS(t,`${e.prefixCls}-cell-row-hover`):iS(t,`${e.prefixCls}-cell-row-hover`))}),()=>{let{prefixCls:t,record:i,index:a,renderIndex:o,dataIndex:l,customRender:g,component:_=`td`,fixLeft:v,fixRight:y,firstFixLeft:b,lastFixLeft:x,firstFixRight:S,lastFixRight:C,appendNode:w=n.appendNode?.call(n),additionalProps:T={},ellipsis:E,align:D,rowType:O,isSticky:k,column:A={},cellType:j}=e,M=`${t}-cell`,N,P,F=n.default?.call(n);if(zU(F)||j===`header`)P=F;else{let t=IU(i,l);if(P=t,g){let e=g({text:t,value:t,record:i,index:a,renderIndex:o,column:A.__originColumn__});tW(e)?(P=e.children,N=e.props):P=e}!(`RC_TABLE_INTERNAL_COL_DEFINE`in A)&&j===`body`&&r.value.bodyCell&&!A.slots?.customRender&&(P=ce(uo(r.value,`bodyCell`,{text:t,value:t,record:i,index:a,column:A.__originColumn__},()=>{let e=P===void 0?t:P;return[typeof e==`object`&&Nt(e)||typeof e!=`object`?e:null]}))),e.transformCellText&&(P=e.transformCellText({text:P,record:i,index:a,column:A.__originColumn__}))}typeof P==`object`&&!Array.isArray(P)&&!p(P)&&(P=null),E&&(x||S)&&(P=U(`span`,{class:`${M}-content`},[P])),Array.isArray(P)&&P.length===1&&(P=P[0]);let I=N||{},{colSpan:L,rowSpan:ee,style:te,class:ne}=I,R=$U(I,[`colSpan`,`rowSpan`,`style`,`class`]),re=(L===void 0?s.value:L)??1,ie=(ee===void 0?c.value:ee)??1;if(re===0||ie===0)return null;let ae={},oe=typeof v==`number`&&u.value,z=typeof y==`number`&&u.value;oe&&(ae.position=`sticky`,ae.left=`${v}px`),z&&(ae.position=`sticky`,ae.right=`${y}px`);let se={};D&&(se.textAlign=D);let B,V=E===!0?{showTitle:!0}:E;return V&&(V.showTitle||O===`header`)&&(typeof P==`string`||typeof P==`number`?B=P.toString():p(P)&&(B=m([P]))),U(_,Y(Y({},Z(Z(Z({title:B},R),T),{colSpan:re===1?null:re,rowSpan:ie===1?null:ie,class:K(M,{[`${M}-fix-left`]:oe&&u.value,[`${M}-fix-left-first`]:b&&u.value,[`${M}-fix-left-last`]:x&&u.value,[`${M}-fix-right`]:z&&u.value,[`${M}-fix-right-first`]:S&&u.value,[`${M}-fix-right-last`]:C&&u.value,[`${M}-ellipsis`]:E,[`${M}-with-append`]:w,[`${M}-fix-sticky`]:(oe||z)&&k&&u.value},T.class,ne),onMouseenter:e=>{d(e,ie)},onMouseleave:f,style:[T.style,se,ae,te]})),{},{ref:h}),{default:()=>[w,P,n.dragHandle?.call(n)]})}}});function rW(e,t,n,r,i){let a=n[e]||{},o=n[t]||{},s,c;a.fixed===`left`?s=r.left[e]:o.fixed===`right`&&(c=r.right[t]);let l=!1,u=!1,d=!1,f=!1,p=n[t+1],m=n[e-1];return i===`rtl`?s===void 0?c!==void 0&&(d=!(p&&p.fixed===`right`)):f=!(m&&m.fixed===`left`):s===void 0?c!==void 0&&(u=!(m&&m.fixed===`right`)):l=!(p&&p.fixed===`left`),{fixLeft:s,fixRight:c,lastFixLeft:l,firstFixRight:u,lastFixRight:d,firstFixLeft:f,isSticky:r.isSticky}}var iW={mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`},touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`}},aW=50,oW=u({compatConfig:{MODE:3},name:`DragHandle`,props:{prefixCls:String,width:{type:Number,required:!0},minWidth:{type:Number,default:aW},maxWidth:{type:Number,default:1/0},column:{type:Object,default:void 0}},setup(e){let t=0,n={remove:()=>{}},r={remove:()=>{}},i=()=>{n.remove(),r.remove()};y(()=>{i()}),S(()=>{pi(!isNaN(e.width),`Table`,`width must be a number when use resizable`)});let{onResizeColumn:a}=GU(),o=J(()=>typeof e.minWidth==`number`&&!isNaN(e.minWidth)?e.minWidth:aW),s=J(()=>typeof e.maxWidth==`number`&&!isNaN(e.maxWidth)?e.maxWidth:1/0),c=Zt(),l=0,u=q(!1),d,f=n=>{let r=0;r=n.touches?n.touches.length?n.touches[0].pageX:n.changedTouches[0].pageX:n.pageX;let i=t-r,c=Math.max(l-i,o.value);c=Math.min(c,s.value),ir.cancel(d),d=ir(()=>{a(c,e.column.__originColumn__)})},p=e=>{f(e)},m=e=>{u.value=!1,f(e),i()},h=(e,a)=>{u.value=!0,i(),l=c.vnode.el.parentNode.getBoundingClientRect().width,!(e instanceof MouseEvent&&e.which!==1)&&(e.stopPropagation&&e.stopPropagation(),t=e.touches?e.touches[0].pageX:e.pageX,n=cr(document.documentElement,a.move,p),r=cr(document.documentElement,a.stop,m))},g=e=>{e.stopPropagation(),e.preventDefault(),h(e,iW.mouse)},_=e=>{e.stopPropagation(),e.preventDefault(),h(e,iW.touch)},v=e=>{e.stopPropagation(),e.preventDefault()};return()=>{let{prefixCls:t}=e,n={[sr?`onTouchstartPassive`:`onTouchstart`]:e=>_(e)};return U(`div`,Y(Y({class:`${t}-resize-handle ${u.value?`dragging`:``}`,onMousedown:g},n),{},{onClick:v}),[U(`div`,{class:`${t}-resize-handle-line`},null)])}}}),sW=u({name:`HeaderRow`,props:[`cells`,`stickyOffsets`,`flattenColumns`,`rowComponent`,`cellComponent`,`index`,`customHeaderRow`],setup(e){let t=NU();return()=>{let{prefixCls:n,direction:r}=t,{cells:i,stickyOffsets:a,flattenColumns:o,rowComponent:s,cellComponent:c,customHeaderRow:l,index:u}=e,d;l&&(d=l(i.map(e=>e.column),u));let f=LU(i.map(e=>e.column));return U(s,d,{default:()=>[i.map((e,t)=>{let{column:i}=e,s=rW(e.colStart,e.colEnd,o,a,r),l;i&&i.customHeaderCell&&(l=e.column.customHeaderCell(i));let u=i;return U(nW,Y(Y(Y({},e),{},{cellType:`header`,ellipsis:i.ellipsis,align:i.align,component:c,prefixCls:n,key:f[t]},s),{},{additionalProps:l,rowType:`header`,column:i}),{default:()=>i.title,dragHandle:()=>u.resizable?U(oW,{prefixCls:n,width:u.width,minWidth:u.minWidth,maxWidth:u.maxWidth,column:u},null):null})})]})}}});function cW(e){let t=[];function n(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[i]=t[i]||[];let a=r;return e.filter(Boolean).map(e=>{let r={key:e.key,class:K(e.className,e.class),column:e,colStart:a},o=1,s=e.children;return s&&s.length>0&&(o=n(s,a,i+1).reduce((e,t)=>e+t,0),r.hasSubColumns=!0),`colSpan`in e&&({colSpan:o}=e),`rowSpan`in e&&(r.rowSpan=e.rowSpan),r.colSpan=o,r.colEnd=r.colStart+o-1,t[i].push(r),a+=o,o})}n(e,0);let r=t.length;for(let e=0;e{!(`rowSpan`in t)&&!t.hasSubColumns&&(t.rowSpan=r-e)});return t}var lW=u({name:`TableHeader`,inheritAttrs:!1,props:[`columns`,`flattenColumns`,`stickyOffsets`,`customHeaderRow`],setup(e){let t=NU(),n=J(()=>cW(e.columns));return()=>{let{prefixCls:r,getComponent:i}=t,{stickyOffsets:a,flattenColumns:o,customHeaderRow:s}=e,c=i([`header`,`wrapper`],`thead`),l=i([`header`,`row`],`tr`),u=i([`header`,`cell`],`th`);return U(c,{class:`${r}-thead`},{default:()=>[n.value.map((e,t)=>U(sW,{key:t,flattenColumns:o,cells:e,stickyOffsets:a,rowComponent:l,cellComponent:u,customHeaderRow:s,index:t},null))]})}}}),uW=Symbol(`ExpandedRowProps`),dW=e=>{fe(uW,e)},fW=()=>g(uW,{}),pW=u({name:`ExpandedRow`,inheritAttrs:!1,props:[`prefixCls`,`component`,`cellComponent`,`expanded`,`colSpan`,`isEmpty`],setup(e,t){let{slots:n,attrs:r}=t,i=NU(),{fixHeader:a,fixColumn:o,componentWidth:s,horizonScroll:c}=fW();return()=>{let{prefixCls:t,component:l,cellComponent:u,expanded:d,colSpan:f,isEmpty:p}=e;return U(l,{class:r.class,style:{display:d?null:`none`}},{default:()=>[U(nW,{component:u,prefixCls:t,colSpan:f},{default:()=>{let e=n.default?.call(n);return(p?c.value:o.value)&&(e=U(`div`,{style:{width:`${s.value-(a.value?i.scrollbarSize:0)}px`,position:`sticky`,left:0,overflow:`hidden`},class:`${t}-expanded-row-fixed`},[e])),e}})]})}}}),mW=u({name:`MeasureCell`,props:[`columnKey`],setup(e,t){let{emit:n}=t,r=H();return V(()=>{r.value&&n(`columnResize`,e.columnKey,r.value.offsetWidth)}),()=>U(Qn,{onResize:t=>{let{offsetWidth:r}=t;n(`columnResize`,e.columnKey,r)}},{default:()=>[U(`td`,{ref:r,style:{padding:0,border:0,height:0}},[U(`div`,{style:{height:0,overflow:`hidden`}},[en(`\xA0`)])])]})}}),hW=Symbol(`BodyContextProps`),gW=e=>{fe(hW,e)},_W=()=>g(hW,{}),vW=u({name:`BodyRow`,inheritAttrs:!1,props:[`record`,`index`,`renderIndex`,`recordKey`,`expandedKeys`,`rowComponent`,`cellComponent`,`customRow`,`rowExpandable`,`indent`,`rowKey`,`getRowKey`,`childrenColumnName`],setup(e,t){let{attrs:n}=t,r=NU(),i=_W(),a=q(!1),o=J(()=>e.expandedKeys&&e.expandedKeys.has(e.recordKey));S(()=>{o.value&&(a.value=!0)});let s=J(()=>i.expandableType===`row`&&(!e.rowExpandable||e.rowExpandable(e.record))),c=J(()=>i.expandableType===`nest`),l=J(()=>e.childrenColumnName&&e.record&&e.record[e.childrenColumnName]),u=J(()=>s.value||c.value),d=(e,t)=>{i.onTriggerExpand(e,t)},f=J(()=>e.customRow?.call(e,e.record,e.index)||{}),p=function(t){var n,r;i.expandRowByClick&&u.value&&d(e.record,t);var a=[...arguments].slice(1);(r=(n=f.value)?.onClick)==null||r.call(n,t,...a)},m=J(()=>{let{record:t,index:n,indent:r}=e,{rowClassName:a}=i;return typeof a==`string`?a:typeof a==`function`?a(t,n,r):``}),h=J(()=>LU(i.flattenColumns));return()=>{let{class:t,style:u}=n,{record:g,index:_,rowKey:v,indent:y=0,rowComponent:b,cellComponent:x}=e,{prefixCls:S,fixedInfoList:C,transformCellText:w}=r,{flattenColumns:T,expandedRowClassName:E,indentSize:D,expandIcon:O,expandedRowRender:k,expandIconColumnIndex:A}=i,j=U(b,Y(Y({},f.value),{},{"data-row-key":v,class:K(t,`${S}-row`,`${S}-row-level-${y}`,m.value,f.value.class),style:[u,f.value.style],onClick:p}),{default:()=>[T.map((t,n)=>{let{customRender:r,dataIndex:i,className:a}=t,s=h[n],u=C[n],f;t.customCell&&(f=t.customCell(g,_,t));let p=n===(A||0)&&c.value?U($e,null,[U(`span`,{style:{paddingLeft:`${D*y}px`},class:`${S}-row-indent indent-level-${y}`},null),O({prefixCls:S,expanded:o.value,expandable:l.value,record:g,onExpand:d})]):null;return U(nW,Y(Y({cellType:`body`,class:a,ellipsis:t.ellipsis,align:t.align,component:x,prefixCls:S,key:s,record:g,index:_,renderIndex:e.renderIndex,dataIndex:i,customRender:r},u),{},{additionalProps:f,column:t,transformCellText:w,appendNode:p}),null)})]}),M;if(s.value&&(a.value||o.value)){let e=k({record:g,index:_,indent:y+1,expanded:o.value}),t=E&&E(g,_,y);M=U(pW,{expanded:o.value,class:K(`${S}-expanded-row`,`${S}-expanded-row-level-${y+1}`,t),prefixCls:S,component:b,cellComponent:x,colSpan:T.length,isEmpty:!1},{default:()=>[e]})}return U($e,null,[j,M])}}});function yW(e,t,n,r,i,a){let o=[];o.push({record:e,indent:t,index:a});let s=i(e),c=r?.has(s);if(e&&Array.isArray(e[n])&&c)for(let a=0;a{let i=t.value,a=n.value,o=e.value;if(a?.size){let e=[];for(let t=0;t({record:e,indent:0,index:t}))})}var xW=Symbol(`ResizeContextProps`),SW=e=>{fe(xW,e)},CW=()=>g(xW,{onColumnResize:()=>{}}),wW=u({name:`TableBody`,props:[`data`,`getRowKey`,`measureColumnWidth`,`expandedKeys`,`customRow`,`rowExpandable`,`childrenColumnName`],setup(e,t){let{slots:n}=t,r=CW(),i=NU(),a=_W(),o=bW(St(e,`data`),St(e,`childrenColumnName`),St(e,`expandedKeys`),St(e,`getRowKey`)),s=q(-1),c=q(-1),l;return JU({startRow:s,endRow:c,onHover:(e,t)=>{clearTimeout(l),l=setTimeout(()=>{s.value=e,c.value=t},100)}}),()=>{let{data:t,getRowKey:s,measureColumnWidth:c,expandedKeys:l,customRow:u,rowExpandable:d,childrenColumnName:f}=e,{onColumnResize:p}=r,{prefixCls:m,getComponent:h}=i,{flattenColumns:g}=a,_=h([`body`,`wrapper`],`tbody`),v=h([`body`,`row`],`tr`),y=h([`body`,`cell`],`td`),b;b=t.length?o.value.map((e,t)=>{let{record:n,indent:r,index:i}=e,a=s(n,t);return U(vW,{key:a,rowKey:a,record:n,recordKey:a,index:t,renderIndex:i,rowComponent:v,cellComponent:y,expandedKeys:l,customRow:u,getRowKey:s,rowExpandable:d,childrenColumnName:f,indent:r},null)}):U(pW,{expanded:!0,class:`${m}-placeholder`,prefixCls:m,component:v,cellComponent:y,colSpan:g.length,isEmpty:!0},{default:()=>[n.emptyNode?.call(n)]});let x=LU(g);return U(_,{class:`${m}-tbody`},{default:()=>[c&&U(`tr`,{"aria-hidden":`true`,class:`${m}-measure-row`,style:{height:0,fontSize:0}},[x.map(e=>U(mW,{key:e,columnKey:e,onColumnResize:p},null))]),b]})}}}),TW={},EW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{fixed:n}=t,r=n===!0?`left`:n,i=t.children;return i&&i.length>0?[...e,...DW(i).map(e=>Z({fixed:r},e))]:[...e,Z(Z({},t),{fixed:r})]},[])}function OW(e){return e.map(e=>{let{fixed:t}=e,n=EW(e,[`fixed`]),r=t;return t===`left`?r=`right`:t===`right`&&(r=`left`),Z({fixed:r},n)})}function kW(e,t){let{prefixCls:n,columns:r,expandable:i,expandedKeys:a,getRowKey:o,onTriggerExpand:s,expandIcon:c,rowExpandable:l,expandIconColumnIndex:u,direction:d,expandRowByClick:f,expandColumnWidth:p,expandFixed:m}=e,h=HU(),g=J(()=>{if(i.value){let e=r.value.slice();if(!e.includes(TW)){let t=u.value||0;t>=0&&e.splice(t,0,TW)}let t=e.indexOf(TW);e=e.filter((e,n)=>e!==TW||n===t);let i=r.value[t],d;d=(m.value===`left`||m.value)&&!u.value?`left`:(m.value===`right`||m.value)&&u.value===r.value.length?`right`:i?i.fixed:null;let g=a.value,_=l.value,v=c.value,y=n.value,b=f.value,x={[KU]:{class:`${n.value}-expand-icon-col`,columnType:`EXPAND_COLUMN`},title:uo(h.value,`expandColumnTitle`,{},()=>[``]),fixed:d,class:`${n.value}-row-expand-icon-cell`,width:p.value,customRender:e=>{let{record:t,index:n}=e,r=o.value(t,n),i=g.has(r),a=!_||_(t),c=v({prefixCls:y,expanded:i,expandable:a,record:t,onExpand:s});return b?U(`span`,{onClick:e=>e.stopPropagation()},[c]):c}};return e.map(e=>e===TW?x:e)}return r.value.filter(e=>e!==TW)}),_=J(()=>{let e=g.value;return t.value&&(e=t.value(e)),e.length||(e=[{customRender:()=>null}]),e});return[_,J(()=>d.value===`rtl`?OW(DW(_.value)):DW(_.value))]}function AW(e){let t=q(e),n,r=q([]);function i(e){r.value.push(e),ir.cancel(n),n=ir(()=>{let e=r.value;r.value=[],e.forEach(e=>{t.value=e(t.value)})})}return ut(()=>{ir.cancel(n)}),[t,i]}function jW(e){let t=H(e||null),n=H();function r(){clearTimeout(n.value)}function i(e){t.value=e,r(),n.value=setTimeout(()=>{t.value=null,n.value=void 0},100)}function a(){return t.value}return ut(()=>{r()}),[i,a]}function MW(e,t,n){return J(()=>{let r=[],i=[],a=0,o=0,s=e.value,c=t.value,l=n.value;for(let e=0;e=0;--e){let r=t[e],a=n&&n[e],s=a&&a.RC_TABLE_INTERNAL_COL_DEFINE;if(r||s||o){let t=s||{},{columnType:n}=t,a=NW(t,[`columnType`]);i.unshift(U(`col`,Y({key:e,style:{width:typeof r==`number`?`${r}px`:r}},a),null)),o=!0}}return U(`colgroup`,null,[i])}function FW(e,t){let{slots:n}=t;return U(`div`,null,[n.default?.call(n)])}FW.displayName=`Panel`;var IW=0,LW=u({name:`TableSummary`,props:[`fixed`],setup(e,t){let{slots:n}=t,r=NU(),i=`table-summary-uni-key-${++IW}`,a=J(()=>e.fixed===``||e.fixed);return S(()=>{r.summaryCollect(i,a.value)}),ut(()=>{r.summaryCollect(i,!1)}),()=>n.default?.call(n)}}),RW=u({compatConfig:{MODE:3},name:`ATableSummaryRow`,setup(e,t){let{slots:n}=t;return()=>U(`tr`,null,[n.default?.call(n)])}}),zW=Symbol(`SummaryContextProps`),BW=e=>{fe(zW,e)},VW=()=>g(zW,{}),HW=u({name:`ATableSummaryCell`,props:[`index`,`colSpan`,`rowSpan`,`align`],setup(e,t){let{attrs:n,slots:r}=t,i=NU(),a=VW();return()=>{let{index:t,colSpan:o=1,rowSpan:s,align:c}=e,{prefixCls:l,direction:u}=i,{scrollColumnIndex:d,stickyOffsets:f,flattenColumns:p}=a,m=t+o-1+1===d?o+1:o,h=rW(t,t+m-1,p,f,u);return U(nW,Y({class:n.class,index:t,component:`td`,prefixCls:l,record:null,dataIndex:null,align:c,colSpan:m,rowSpan:s,customRender:()=>r.default?.call(r)},h),null)}}}),UW=u({name:`TableFooter`,inheritAttrs:!1,props:[`stickyOffsets`,`flattenColumns`],setup(e,t){let{slots:n}=t,r=NU();return BW(Ne({stickyOffsets:St(e,`stickyOffsets`),flattenColumns:St(e,`flattenColumns`),scrollColumnIndex:J(()=>{let t=e.flattenColumns.length-1;return e.flattenColumns[t]?.scrollbar?t:null})})),()=>{let{prefixCls:e}=r;return U(`tfoot`,{class:`${e}-summary`},[n.default?.call(n)])}}}),WW=LW;function GW(e){let{prefixCls:t,record:n,onExpand:r,expanded:i,expandable:a}=e,o=`${t}-row-expand-icon`;if(!a)return U(`span`,{class:[o,`${t}-row-spaced`]},null);let s=e=>{r(n,e),e.stopPropagation()};return U(`span`,{class:{[o]:!0,[`${t}-row-expanded`]:i,[`${t}-row-collapsed`]:!i},onClick:s},null)}function KW(e,t,n){let r=[];function i(e){(e||[]).forEach((e,a)=>{r.push(t(e,a)),i(e[n])})}return i(e),r}var qW=u({name:`StickyScrollBar`,inheritAttrs:!1,props:[`offsetScroll`,`container`,`scrollBodyRef`,`scrollBodySizeInfo`],emits:[`scroll`],setup(e,t){let{emit:n,expose:r}=t,i=NU(),a=q(0),o=q(0),s=q(0);S(()=>{a.value=e.scrollBodySizeInfo.scrollWidth||0,o.value=e.scrollBodySizeInfo.clientWidth||0,s.value=a.value&&o.value*(o.value/a.value)},{flush:`post`});let c=q(),[l,u]=AW({scrollLeft:0,isHiddenScrollBar:!0}),d=H({delta:0,x:0}),f=q(!1),p=()=>{f.value=!1},m=e=>{d.value={delta:e.pageX-l.value.scrollLeft,x:0},f.value=!0,e.preventDefault()},h=e=>{let{buttons:t}=e||(window==null?void 0:window.event);if(!f.value||t===0){f.value&&=!1;return}let r=d.value.x+e.pageX-d.value.x-d.value.delta;r<=0&&(r=0),r+s.value>=o.value&&(r=o.value-s.value),n(`scroll`,{scrollLeft:r/o.value*(a.value+2)}),d.value.x=e.pageX},g=()=>{if(!e.scrollBodyRef.value)return;let t=Au(e.scrollBodyRef.value).top,n=t+e.scrollBodyRef.value.offsetHeight,r=e.container===window?document.documentElement.scrollTop+window.innerHeight:Au(e.container).top+e.container.clientHeight;n-uu()<=r||t>=r-e.offsetScroll?u(e=>Z(Z({},e),{isHiddenScrollBar:!0})):u(e=>Z(Z({},e),{isHiddenScrollBar:!1}))};r({setScrollLeft:e=>{u(t=>Z(Z({},t),{scrollLeft:e/a.value*o.value||0}))}});let _=null,v=null,y=null,b=null;V(()=>{_=cr(document.body,`mouseup`,p,!1),v=cr(document.body,`mousemove`,h,!1),y=cr(window,`resize`,g,!1)}),ft(()=>{z(()=>{g()})}),V(()=>{setTimeout(()=>{G([s,f],()=>{g()},{immediate:!0,flush:`post`})})}),G(()=>e.container,()=>{b?.remove(),b=cr(e.container,`scroll`,g,!1)},{immediate:!0,flush:`post`}),ut(()=>{_?.remove(),v?.remove(),b?.remove(),y?.remove()}),G(()=>Z({},l.value),(t,n)=>{t.isHiddenScrollBar!==n?.isHiddenScrollBar&&!t.isHiddenScrollBar&&u(t=>{let n=e.scrollBodyRef.value;return n?Z(Z({},t),{scrollLeft:n.scrollLeft/n.scrollWidth*n.clientWidth}):t})},{immediate:!0});let x=uu();return()=>{if(a.value<=o.value||!s.value||l.value.isHiddenScrollBar)return null;let{prefixCls:t}=i;return U(`div`,{style:{height:`${x}px`,width:`${o.value}px`,bottom:`${e.offsetScroll}px`},class:`${t}-sticky-scroll`},[U(`div`,{onMousedown:m,ref:c,class:K(`${t}-sticky-scroll-bar`,{[`${t}-sticky-scroll-bar-active`]:f.value}),style:{width:`${s.value}px`,transform:`translate3d(${l.value.scrollLeft}px, 0, 0)`}},null)])}}}),JW=It()?window:null;function YW(e,t){return J(()=>{let{offsetHeader:n=0,offsetSummary:r=0,offsetScroll:i=0,getContainer:a=()=>JW}=typeof e.value==`object`?e.value:{},o=a()||JW,s=!!e.value;return{isSticky:s,stickyClassName:s?`${t.value}-sticky-holder`:``,offsetHeader:n,offsetSummary:r,offsetScroll:i,container:o}})}function XW(e,t){return J(()=>{let n=[],r=e.value,i=t.value;for(let e=0;ea.isSticky&&!e.fixHeader?0:a.scrollbarSize),s=H(),c=e=>{let{currentTarget:t,deltaX:n}=e;n&&(i(`scroll`,{currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())},l=H();V(()=>{z(()=>{l.value=cr(s.value,`wheel`,c)})}),ut(()=>{var e;(e=l.value)==null||e.remove()});let u=J(()=>e.flattenColumns.every(e=>e.width&&e.width!==0&&e.width!==`0px`)),d=H([]),f=H([]);S(()=>{let t=e.flattenColumns[e.flattenColumns.length-1],n={fixed:t?t.fixed:null,scrollbar:!0,customHeaderCell:()=>({class:`${a.prefixCls}-cell-scrollbar`})};d.value=o.value?[...e.columns,n]:e.columns,f.value=o.value?[...e.flattenColumns,n]:e.flattenColumns});let p=J(()=>{let{stickyOffsets:t,direction:n}=e,{right:r,left:i}=t;return Z(Z({},t),{left:n===`rtl`?[...i.map(e=>e+o.value),0]:i,right:n===`rtl`?r:[...r.map(e=>e+o.value),0],isSticky:a.isSticky})}),m=XW(St(e,`colWidths`),St(e,`columCount`));return()=>{let{noData:t,columCount:i,stickyTopOffset:c,stickyBottomOffset:l,stickyClassName:h,maxContentScroll:g}=e,{isSticky:_}=a;return U(`div`,{style:Z({overflow:`hidden`},_?{top:`${c}px`,bottom:`${l}px`}:{}),ref:s,class:K(n.class,{[h]:!!h})},[U(`table`,{style:{tableLayout:`fixed`,visibility:t||m.value?null:`hidden`}},[(!t||!g||u.value)&&U(PW,{colWidths:m.value?[...m.value,o.value]:[],columCount:i+1,columns:f.value},null),r.default?.call(r,Z(Z({},e),{stickyOffsets:p.value,columns:d.value,flattenColumns:f.value}))])])}}});function QW(e){return Ne(Pg([...arguments].slice(1).map(t=>[t,St(e,t)])))}var $W=[],eG={},tG=`rc-table-internal-hook`,nG=u({name:`VcTable`,inheritAttrs:!1,props:`prefixCls.data.columns.rowKey.tableLayout.scroll.rowClassName.title.footer.id.showHeader.components.customRow.customHeaderRow.direction.expandFixed.expandColumnWidth.expandedRowKeys.defaultExpandedRowKeys.expandedRowRender.expandRowByClick.expandIcon.onExpand.onExpandedRowsChange.onUpdate:expandedRowKeys.defaultExpandAllRows.indentSize.expandIconColumnIndex.expandedRowClassName.childrenColumnName.rowExpandable.sticky.transformColumns.internalHooks.internalRefs.canExpandable.onUpdateInternalRefs.transformCellText`.split(`.`),emits:[`expand`,`expandedRowsChange`,`updateInternalRefs`,`update:expandedRowKeys`],setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=J(()=>e.data||$W),o=J(()=>!!a.value.length),s=J(()=>RU(e.components,{})),c=(e,t)=>IU(s.value,e)||t,l=J(()=>{let t=e.rowKey;return typeof t==`function`?t:e=>e&&e[t]}),u=J(()=>e.expandIcon||GW),d=J(()=>e.childrenColumnName||`children`),f=J(()=>e.expandedRowRender?`row`:e.canExpandable||a.value.some(e=>e&&typeof e==`object`&&e[d.value])?`nest`:!1),p=q([]);S(()=>{e.defaultExpandedRowKeys&&(p.value=e.defaultExpandedRowKeys),e.defaultExpandAllRows&&(p.value=KW(a.value,l.value,d.value))})();let m=J(()=>new Set(e.expandedRowKeys||p.value||[])),h=e=>{let t=l.value(e,a.value.indexOf(e)),n,r=m.value.has(t);r?(m.value.delete(t),n=[...m.value]):n=[...m.value,t],p.value=n,i(`expand`,!r,e),i(`update:expandedRowKeys`,n),i(`expandedRowsChange`,n)},g=H(0),[_,v]=kW(Z(Z({},Ft(e)),{expandable:J(()=>!!e.expandedRowRender),expandedKeys:m,getRowKey:l,onTriggerExpand:h,expandIcon:u}),J(()=>e.internalHooks===`rc-table-internal-hook`?e.transformColumns:null)),y=J(()=>({columns:_.value,flattenColumns:v.value})),b=H(),x=H(),C=H(),w=H({scrollWidth:0,clientWidth:0}),T=H(),[E,D]=ff(!1),[k,A]=ff(!1),[j,M]=AW(new Map),N=J(()=>LU(v.value)),P=J(()=>N.value.map(e=>j.value.get(e))),F=J(()=>v.value.length),I=MW(P,F,St(e,`direction`)),L=J(()=>e.scroll&&zU(e.scroll.y)),ee=J(()=>e.scroll&&zU(e.scroll.x)||!!e.expandFixed),te=J(()=>ee.value&&v.value.some(e=>{let{fixed:t}=e;return t})),ne=H(),R=YW(St(e,`sticky`),St(e,`prefixCls`)),re=Ne({}),ie=J(()=>{let e=Object.values(re)[0];return(L.value||R.value.isSticky)&&e}),ae=(e,t)=>{t?re[e]=t:delete re[e]},oe=H({}),se=H({}),B=H({});S(()=>{L.value&&(se.value={overflowY:`scroll`,maxHeight:xt(e.scroll.y)}),ee.value&&(oe.value={overflowX:`auto`},L.value||(se.value={overflowY:`hidden`}),B.value={width:e.scroll.x===!0?`auto`:xt(e.scroll.x),minWidth:`100%`})});let ce=(e,t)=>{fo(b.value)&&M(n=>{if(n.get(e)!==t){let r=new Map(n);return r.set(e,t),r}return n})},[le,ue]=jW(null);function de(e,t){if(!t)return;if(typeof t==`function`){t(e);return}let n=t.$el||t;n.scrollLeft!==e&&(n.scrollLeft=e)}let fe=t=>{let{currentTarget:n,scrollLeft:r}=t,i=e.direction===`rtl`,a=typeof r==`number`?r:n.scrollLeft,o=n||eG;if((!ue()||ue()===o)&&(le(o),de(a,x.value),de(a,C.value),de(a,T.value),de(a,ne.value?.setScrollLeft)),n){let{scrollWidth:e,clientWidth:t}=n;i?(D(-a0)):(D(a>0),A(a{ee.value&&C.value?fe({currentTarget:C.value}):(D(!1),A(!1))},me,he=e=>{e!==g.value&&(pe(),g.value=b.value?b.value.offsetWidth:e)},ge=e=>{let{width:t}=e;if(clearTimeout(me),g.value===0){he(t);return}me=setTimeout(()=>{he(t)},100)};G([ee,()=>e.data,()=>e.columns],()=>{ee.value&&pe()},{flush:`post`});let[_e,W]=ff(0);ZU(),V(()=>{z(()=>{pe(),W(fu(C.value).width),w.value={scrollWidth:C.value?.scrollWidth||0,clientWidth:C.value?.clientWidth||0}})}),O(()=>{z(()=>{let e=C.value?.scrollWidth||0,t=C.value?.clientWidth||0;(w.value.scrollWidth!==e||w.value.clientWidth!==t)&&(w.value={scrollWidth:e,clientWidth:t})})}),S(()=>{e.internalHooks===`rc-table-internal-hook`&&e.internalRefs&&e.onUpdateInternalRefs({body:C.value?C.value.$el||C.value:null})},{flush:`post`});let ve=J(()=>e.tableLayout?e.tableLayout:te.value?e.scroll.x===`max-content`?`auto`:`fixed`:L.value||R.value.isSticky||v.value.some(e=>{let{ellipsis:t}=e;return t})?`fixed`:`auto`),ye=()=>o.value?null:r.emptyText?.call(r)||`No Data`;MU(Ne(Z(Z({},Ft(QW(e,`prefixCls`,`direction`,`transformCellText`))),{getComponent:c,scrollbarSize:_e,fixedInfoList:J(()=>v.value.map((t,n)=>rW(n,n,v.value,I.value,e.direction))),isSticky:J(()=>R.value.isSticky),summaryCollect:ae}))),gW(Ne(Z(Z({},Ft(QW(e,`rowClassName`,`expandedRowClassName`,`expandRowByClick`,`expandedRowRender`,`expandIconColumnIndex`,`indentSize`))),{columns:_,flattenColumns:v,tableLayout:ve,expandIcon:u,expandableType:f,onTriggerExpand:h}))),SW({onColumnResize:ce}),dW({componentWidth:g,fixHeader:L,fixColumn:te,horizonScroll:ee});let be=()=>U(wW,{data:a.value,measureColumnWidth:L.value||ee.value||R.value.isSticky,expandedKeys:m.value,rowExpandable:e.rowExpandable,getRowKey:l.value,customRow:e.customRow,childrenColumnName:d.value},{emptyNode:ye}),xe=()=>U(PW,{colWidths:v.value.map(e=>{let{width:t}=e;return t}),columns:v.value},null);return()=>{let{prefixCls:t,scroll:i,tableLayout:o,direction:s,title:l=r.title,footer:u=r.footer,id:d,showHeader:f,customHeaderRow:p}=e,{isSticky:m,offsetHeader:h,offsetSummary:g,offsetScroll:S,stickyClassName:D,container:O}=R.value,A=c([`table`],`table`),j=c([`body`]),M=r.summary?.call(r,{pageData:a.value}),N=()=>null,re={colWidths:P.value,columCount:v.value.length,stickyOffsets:I.value,customHeaderRow:p,fixHeader:L.value,scroll:i};if(L.value||m){let e=()=>null;typeof j==`function`?(e=()=>j(a.value,{scrollbarSize:_e.value,ref:C,onScroll:fe}),re.colWidths=v.value.map((e,t)=>{let{width:n}=e,r=t===_.value.length-1?n-_e.value:n;return typeof r==`number`&&!Number.isNaN(r)?r:0})):e=()=>U(`div`,{style:Z(Z({},oe.value),se.value),onScroll:fe,ref:C,class:K(`${t}-body`)},[U(A,{style:Z(Z({},B.value),{tableLayout:ve.value})},{default:()=>[xe(),be(),!ie.value&&M&&U(UW,{stickyOffsets:I.value,flattenColumns:v.value},{default:()=>[M]})]})]);let n=Z(Z(Z({noData:!a.value.length,maxContentScroll:ee.value&&i.x===`max-content`},re),y.value),{direction:s,stickyClassName:D,onScroll:fe});N=()=>U($e,null,[f!==!1&&U(ZW,Y(Y({},n),{},{stickyTopOffset:h,class:`${t}-header`,ref:x}),{default:e=>U($e,null,[U(lW,e,null),ie.value===`top`&&U(UW,e,{default:()=>[M]})])}),e(),ie.value&&ie.value!==`top`&&U(ZW,Y(Y({},n),{},{stickyBottomOffset:g,class:`${t}-summary`,ref:T}),{default:e=>U(UW,e,{default:()=>[M]})}),m&&C.value&&U(qW,{ref:ne,offsetScroll:S,scrollBodyRef:C,onScroll:fe,container:O,scrollBodySizeInfo:w.value},null)])}else N=()=>U(`div`,{style:Z(Z({},oe.value),se.value),class:K(`${t}-content`),onScroll:fe,ref:C},[U(A,{style:Z(Z({},B.value),{tableLayout:ve.value})},{default:()=>[xe(),f!==!1&&U(lW,Y(Y({},re),y.value),null),be(),M&&U(UW,{stickyOffsets:I.value,flattenColumns:v.value},{default:()=>[M]})]})]);let ae=Bu(n,{aria:!0,data:!0}),z=()=>U(`div`,Y(Y({},ae),{},{class:K(t,{[`${t}-rtl`]:s===`rtl`,[`${t}-ping-left`]:E.value,[`${t}-ping-right`]:k.value,[`${t}-layout-fixed`]:o===`fixed`,[`${t}-fixed-header`]:L.value,[`${t}-fixed-column`]:te.value,[`${t}-scroll-horizontal`]:ee.value,[`${t}-has-fix-left`]:v.value[0]&&v.value[0].fixed,[`${t}-has-fix-right`]:v.value[F.value-1]&&v.value[F.value-1].fixed===`right`,[n.class]:n.class}),style:n.style,id:d,ref:b}),[l&&U(FW,{class:`${t}-title`},{default:()=>[l(a.value)]}),U(`div`,{class:`${t}-container`},[N()]),u&&U(FW,{class:`${t}-footer`},{default:()=>[u(a.value)]})]);return ee.value?U(Qn,{onResize:ge},{default:z}):z()}}});function rG(){let e=Z({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t{let r=n[t];r!==void 0&&(e[t]=r)})}return e}function iG(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&typeof t==`object`?t:{}).forEach(t=>{let r=e[t];typeof r!=`function`&&(n[t]=r)}),n}function aG(e,t,n){let r=J(()=>t.value&&typeof t.value==`object`?t.value:{}),i=J(()=>r.value.total||0),[a,o]=ff(()=>({current:`defaultCurrent`in r.value?r.value.defaultCurrent:1,pageSize:`defaultPageSize`in r.value?r.value.defaultPageSize:10})),s=J(()=>{let t=rG(a.value,r.value,{total:i.value>0?i.value:e.value}),n=Math.ceil((i.value||e.value)/t.pageSize);return t.current>n&&(t.current=n||1),t}),c=(e,n)=>{t.value!==!1&&o({current:e??1,pageSize:n||s.value.pageSize})},l=(e,i)=>{var a,o;t.value&&((o=(a=r.value).onChange)==null||o.call(a,e,i)),c(e,i),n(e,i||s.value.pageSize)};return[J(()=>t.value===!1?{}:Z(Z({},s.value),{onChange:l})),c]}function oG(e,t,n){let r=q({});G([e,t,n],()=>{let i=new Map,a=n.value,o=t.value;function s(e){e.forEach((e,t)=>{let n=a(e,t);i.set(n,e),e&&typeof e==`object`&&o in e&&s(e[o]||[])})}s(e.value),r.value={kvMap:i}},{deep:!0,immediate:!0});function i(e){return r.value.kvMap.get(e)}return[i]}var sG={},cG=`SELECT_ALL`,lG=`SELECT_INVERT`,uG=`SELECT_NONE`,dG=[];function fG(e,t){let n=[];return(t||[]).forEach(t=>{n.push(t),t&&typeof t==`object`&&e in t&&(n=[...n,...fG(e,t[e])])}),n}function pG(e,t){let n=J(()=>{let t=e.value||{},{checkStrictly:n=!0}=t;return Z(Z({},t),{checkStrictly:n})}),[r,i]=df(n.value.selectedRowKeys||n.value.defaultSelectedRowKeys||dG,{value:J(()=>n.value.selectedRowKeys)}),a=q(new Map),o=e=>{if(n.value.preserveSelectedRowKeys){let n=new Map;e.forEach(e=>{let r=t.getRecordByKey(e);!r&&a.value.has(e)&&(r=a.value.get(e)),n.set(e,r)}),a.value=n}};S(()=>{o(r.value)});let s=J(()=>n.value.checkStrictly?null:Hk(t.data.value,{externalGetKey:t.getRowKey.value,childrenPropName:t.childrenColumnName.value}).keyEntities),c=J(()=>fG(t.childrenColumnName.value,t.pageData.value)),l=J(()=>{let e=new Map,r=t.getRowKey.value,i=n.value.getCheckboxProps;return c.value.forEach((t,n)=>{let a=r(t,n),o=(i?i(t):null)||{};e.set(a,o)}),e}),{maxLevel:u,levelEntities:d}=hA(s),f=e=>!!l.value.get(t.getRowKey.value(e))?.disabled,p=J(()=>{if(n.value.checkStrictly)return[r.value||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=iA(r.value,!0,s.value,u.value,d.value,f);return[e||[],t]}),m=J(()=>p.value[0]),h=J(()=>p.value[1]),g=J(()=>{let e=n.value.type===`radio`?m.value.slice(0,1):m.value;return new Set(e)}),_=J(()=>n.value.type===`radio`?new Set:new Set(h.value)),[v,y]=ff(null),b=e=>{let r,s;o(e);let{preserveSelectedRowKeys:c,onChange:l}=n.value,{getRecordByKey:u}=t;c?(r=e,s=e.map(e=>a.value.get(e))):(r=[],s=[],e.forEach(e=>{let t=u(e);t!==void 0&&(r.push(e),s.push(t))})),i(r),l?.(r,s)},x=(e,r,i,a)=>{let{onSelect:o}=n.value,{getRecordByKey:s}=t||{};if(o){let t=i.map(e=>s(e));o(s(e),r,t,a)}b(i)},C=J(()=>{let{onSelectInvert:e,onSelectNone:r,selections:i,hideSelectAll:a}=n.value,{data:o,pageData:s,getRowKey:c,locale:u}=t;return!i||a?null:(i===!0?[cG,lG,uG]:i).map(t=>t===`SELECT_ALL`?{key:`all`,text:u.value.selectionAll,onSelect(){b(o.value.map((e,t)=>c.value(e,t)).filter(e=>!l.value.get(e)?.disabled||g.value.has(e)))}}:t===`SELECT_INVERT`?{key:`invert`,text:u.value.selectInvert,onSelect(){let t=new Set(g.value);s.value.forEach((e,n)=>{let r=c.value(e,n);l.value.get(r)?.disabled||(t.has(r)?t.delete(r):t.add(r))});let n=Array.from(t);e&&(pi(!1,`Table`,"`onSelectInvert` will be removed in future. Please use `onChange` instead."),e(n)),b(n)}}:t===`SELECT_NONE`?{key:`none`,text:u.value.selectNone,onSelect(){r?.(),b(Array.from(g.value).filter(e=>l.value.get(e)?.disabled))}}:t)}),w=J(()=>c.value.length);return[r=>{let{onSelectAll:i,onSelectMultiple:a,columnWidth:o,type:p,fixed:h,renderCell:S,hideSelectAll:T,checkStrictly:E}=n.value,{prefixCls:D,getRecordByKey:O,getRowKey:k,expandType:A,getPopupContainer:j}=t;if(!e.value)return r.filter(e=>e!==sG);let M=r.slice(),N=new Set(g.value),P=c.value.map(k.value).filter(e=>!l.value.get(e).disabled),F=P.every(e=>N.has(e)),I=P.some(e=>N.has(e)),L=()=>{let e=[];F?P.forEach(t=>{N.delete(t),e.push(t)}):P.forEach(t=>{N.has(t)||(N.add(t),e.push(t))});let t=Array.from(N);i?.(!F,t.map(e=>O(e)),e.map(e=>O(e))),b(t)},ee;if(p!==`radio`){let e;if(C.value){let t=U(wS,{getPopupContainer:j.value},{default:()=>[C.value.map((e,t)=>{let{key:n,text:r,onSelect:i}=e;return U(wS.Item,{key:n||t,onClick:()=>{i?.(P)}},{default:()=>[r]})})]});e=U(`div`,{class:`${D.value}-selection-extra`},[U(kP,{overlay:t,getPopupContainer:j.value},{default:()=>[U(`span`,null,[U(Cf,null,null)])]})])}let t=c.value.map((e,t)=>{let n=k.value(e,t),r=l.value.get(n)||{};return Z({checked:N.has(n)},r)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===w.value,r=n&&t.every(e=>{let{checked:t}=e;return t}),i=n&&t.some(e=>{let{checked:t}=e;return t});ee=!T&&U(`div`,{class:`${D.value}-selection`},[U(vN,{checked:n?r:!!w.value&&F,indeterminate:n?!r&&i:!F&&I,onChange:L,disabled:w.value===0||n,"aria-label":e?`Custom selection`:`Select all`,skipGroup:!0},null),e])}let te;te=p===`radio`?e=>{let{record:t,index:n}=e,r=k.value(t,n),i=N.has(r);return{node:U(ET,Y(Y({},l.value.get(r)),{},{checked:i,onClick:e=>e.stopPropagation(),onChange:e=>{N.has(r)||x(r,!0,[r],e.nativeEvent)}}),null),checked:i}}:e=>{let{record:t,index:n}=e,r=k.value(t,n),i=N.has(r),o=_.value.has(r),c=l.value.get(r),p;return A.value===`nest`?(p=o,pi(typeof c?.indeterminate!=`boolean`,`Table`,"set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.")):p=c?.indeterminate??o,{node:U(vN,Y(Y({},c),{},{indeterminate:p,checked:i,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,o=-1,c=-1;if(n&&E){let e=new Set([v.value,r]);P.some((t,n)=>{if(e.has(t))if(o===-1)o=n;else return c=n,!0;return!1})}if(c!==-1&&o!==c&&E){let e=P.slice(o,c+1),t=[];i?e.forEach(e=>{N.has(e)&&(t.push(e),N.delete(e))}):e.forEach(e=>{N.has(e)||(t.push(e),N.add(e))});let n=Array.from(N);a?.(!i,n.map(e=>O(e)),t.map(e=>O(e))),b(n)}else{let e=m.value;if(E){let n=i?wk(e,r):Tk(e,r);x(r,!i,n,t)}else{let{checkedKeys:n,halfCheckedKeys:a}=iA([...e,r],!0,s.value,u.value,d.value,f),o=n;if(i){let e=new Set(n);e.delete(r),o=iA(Array.from(e),{checked:!1,halfCheckedKeys:a},s.value,u.value,d.value,f).checkedKeys}x(r,!i,o,t)}}y(r)}}),null),checked:i}};let ne=e=>{let{record:t,index:n}=e,{node:r,checked:i}=te({record:t,index:n});return S?S(i,t,n,r):r};if(!M.includes(sG))if(M.findIndex(e=>e.RC_TABLE_INTERNAL_COL_DEFINE?.columnType===`EXPAND_COLUMN`)===0){let[e,...t]=M;M=[e,sG,...t]}else M=[sG,...M];let R=M.indexOf(sG);M=M.filter((e,t)=>e!==sG||t===R);let re=M[R-1],ie=M[R+1],ae=h;ae===void 0&&(ie?.fixed===void 0?re?.fixed!==void 0&&(ae=re.fixed):ae=ie.fixed),ae&&re&&re.RC_TABLE_INTERNAL_COL_DEFINE?.columnType===`EXPAND_COLUMN`&&re.fixed===void 0&&(re.fixed=ae);let oe={fixed:ae,width:o,className:`${D.value}-selection-column`,title:n.value.columnTitle||ee,customRender:ne,[KU]:{class:`${D.value}-selection-col`}};return M.map(e=>e===sG?oe:e)},g]}var mG={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z`}}]},name:`caret-down`,theme:`outlined`};function hG(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:[]),t=[];return e.forEach(e=>{if(!e)return;let n=e.key,r=e.props?.style||{},i=e.props?.class||``,a=e.props||{};for(let[e,t]of Object.entries(a))a[ue(e)]=t;let o=e.children||{},{default:s}=o,c=Z(Z(Z({},SG(o,[`default`])),a),{style:r,class:i});if(n&&(c.key=n),e.type?.__ANT_TABLE_COLUMN_GROUP)c.children=EG(typeof s==`function`?s():s);else{let t=e.children?.default;c.customRender=c.customRender||t}t.push(c)}),t}var DG=`ascend`,OG=`descend`;function kG(e){return typeof e.sorter==`object`&&typeof e.sorter.multiple==`number`&&e.sorter.multiple}function AG(e){return typeof e==`function`?e:e&&typeof e==`object`&&e.compare?e.compare:!1}function jG(e,t){return t?e[e.indexOf(t)+1]:e[0]}function MG(e,t,n){let r=[];function i(e,t){r.push({column:e,key:CG(e,t),multiplePriority:kG(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let o=wG(a,n);e.children?(`sortOrder`in e&&i(e,o),r=[...r,...MG(e.children,t,o)]):e.sorter&&(`sortOrder`in e?i(e,o):t&&e.defaultSortOrder&&r.push({column:e,key:CG(e,o),multiplePriority:kG(e),sortOrder:e.defaultSortOrder}))}),r}function NG(e,t,n,r,i,a,o,s){return(t||[]).map((t,c)=>{let l=wG(c,s),u=t;if(u.sorter){let s=u.sortDirections||i,c=u.showSorterTooltip===void 0?o:u.showSorterTooltip,d=CG(u,l),f=n.find(e=>{let{key:t}=e;return t===d}),p=f?f.sortOrder:null,m=jG(s,p),h=s.includes(DG)&&U(xG,{class:K(`${e}-column-sorter-up`,{active:p===DG}),role:`presentation`},null),g=s.includes(OG)&&U(_G,{role:`presentation`,class:K(`${e}-column-sorter-down`,{active:p===OG})},null),{cancelSort:_,triggerAsc:v,triggerDesc:y}=a||{},b=_;m===OG?b=y:m===DG&&(b=v);let x=typeof c==`object`?c:{title:b};u=Z(Z({},u),{className:K(u.className,{[`${e}-column-sort`]:p}),title:n=>{let r=U(`div`,{class:`${e}-column-sorters`},[U(`span`,{class:`${e}-column-title`},[TG(t.title,n)]),U(`span`,{class:K(`${e}-column-sorter`,{[`${e}-column-sorter-full`]:!!(h&&g)})},[U(`span`,{class:`${e}-column-sorter-inner`},[h,g])])]);return c?U(Ty,x,{default:()=>[r]}):r},customHeaderCell:n=>{let i=t.customHeaderCell&&t.customHeaderCell(n)||{},a=i.onClick,o=i.onKeydown;return i.onClick=e=>{r({column:t,key:d,sortOrder:m,multiplePriority:kG(t)}),a&&a(e)},i.onKeydown=e=>{e.keyCode===$.ENTER&&(r({column:t,key:d,sortOrder:m,multiplePriority:kG(t)}),o?.(e))},p&&(i[`aria-sort`]=p===`ascend`?`ascending`:`descending`),i.class=K(i.class,`${e}-column-has-sorters`),i.tabindex=0,i}})}return`children`in u&&(u=Z(Z({},u),{children:NG(e,u.children,n,r,i,a,o,l)})),u})}function PG(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function FG(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(PG);return t.length===0&&e.length?Z(Z({},PG(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function IG(e,t,n){let r=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),i=e.slice(),a=r.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return AG(t)&&n});return a.length?i.sort((e,t)=>{for(let n=0;n{let r=e[n];return r?Z(Z({},e),{[n]:IG(r,t,n)}):e}):i}function LG(e){let{prefixCls:t,mergedColumns:n,onSorterChange:r,sortDirections:i,tableLocale:a,showSorterTooltip:o}=e,[s,c]=ff(MG(n.value,!0)),l=J(()=>{let e=!0,t=MG(n.value,!1);if(!t.length)return s.value;let r=[];function i(t){e?r.push(t):r.push(Z(Z({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{a===null?(i(t),t.sortOrder&&(t.multiplePriority===!1?e=!1:a=!0)):(a&&t.multiplePriority!==!1||(e=!1),i(t))}),r}),u=J(()=>{let e=l.value.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}});function d(e){let t;t=e.multiplePriority===!1||!l.value.length||l.value[0].multiplePriority===!1?[e]:[...l.value.filter(t=>{let{key:n}=t;return n!==e.key}),e],c(t),r(FG(t),t)}return[e=>NG(t.value,e,l.value,d,i.value,a.value,o.value),l,u,J(()=>FG(l.value))]}var RG={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z`}}]},name:`filter`,theme:`filled`};function zG(e){for(var t=1;t{let{keyCode:t}=e;t===$.ENTER&&e.stopPropagation()},UG=(e,t)=>{let{slots:n}=t;return U(`div`,{onClick:e=>e.stopPropagation(),onKeydown:HG},[n.default?.call(n)])},WG=u({compatConfig:{MODE:3},name:`FilterSearch`,inheritAttrs:!1,props:{value:_(),onChange:d(),filterSearch:W([Boolean,Function]),tablePrefixCls:_(),locale:Qt()},setup(e){return()=>{let{value:t,onChange:n,filterSearch:r,tablePrefixCls:i,locale:a}=e;return r?U(`div`,{class:`${i}-filter-dropdown-search`},[U(hI,{placeholder:a.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,class:`${i}-filter-dropdown-search-input`},{prefix:()=>U(jf,null,null)})]):null}}}),GG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.motion?e.motion:aS()),c=(t,n)=>{var r,i,a,c;n===`appear`?(i=(r=s.value)?.onAfterEnter)==null||i.call(r,t):n===`leave`&&((c=(a=s.value)?.onAfterLeave)==null||c.call(a,t)),o.value||e.onMotionEnd(),o.value=!0};return G(()=>e.motionNodes,()=>{e.motionNodes&&e.motionType===`hide`&&i.value&&z(()=>{i.value=!1})},{immediate:!0,flush:`post`}),V(()=>{e.motionNodes&&e.onMotionStart()}),ut(()=>{e.motionNodes&&c()}),()=>{let{motion:t,motionNodes:o,motionType:l,active:u,eventKey:d}=e,f=GG(e,[`motion`,`motionNodes`,`motionType`,`active`,`eventKey`]);return o?U(Re,Y(Y({},s.value),{},{appear:l===`show`,onAfterAppear:e=>c(e,`appear`),onAfterLeave:e=>c(e,`leave`)}),{default:()=>[Mt(U(`div`,{class:`${a.value.prefixCls}-treenode-motion`},[o.map(e=>{let t=GG(e.data,[]),{title:n,key:i,isStart:a,isEnd:o}=e;return delete t.children,U(Ck,Y(Y({},t),{},{title:n,active:u,data:e.data,key:i,eventKey:i,isStart:a,isEnd:o}),r)})]),[[ht,i.value]])]}):U(Ck,Y(Y({class:n.class,style:n.style},f),{},{active:u,eventKey:d}),r)}}});function qG(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function i(e,t){let n=new Map;e.forEach(e=>{n.set(e,!0)});let r=t.filter(e=>!n.has(e));return r.length===1?r[0]:null}return ne.key===n)+1],i=t.findIndex(e=>e.key===n);if(r){let e=t.findIndex(e=>e.key===r.key);return t.slice(i+1,e)}return t.slice(i+1)}var YG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{},QG=`RC_TREE_MOTION_${Math.random()}`,$G={key:QG},eK={key:QG,level:0,index:0,pos:`0`,node:$G,nodes:[$G]},tK={parent:null,children:[],pos:eK.pos,data:$G,title:null,key:QG,isStart:[],isEnd:[]};function nK(e,t,n,r){return t===!1||!n?e:e.slice(0,Math.ceil(n/r)+1)}function rK(e){let{key:t,pos:n}=e;return Lk(t,n)}function iK(e){let t=String(e.key),n=e;for(;n.parent;)n=n.parent,t=`${n.key} > ${t}`;return t}var aK=u({compatConfig:{MODE:3},name:`NodeList`,inheritAttrs:!1,props:_k,setup(e,t){let{expose:n,attrs:r}=t,i=H(),a=H(),{expandedKeys:o,flattenNodes:s}=mk();n({scrollTo:e=>{i.value.scrollTo(e)},getIndentWidth:()=>a.value.offsetWidth});let c=q(s.value),l=q([]),u=H(null);function d(){c.value=s.value,l.value=[],u.value=null,e.onListChangeEnd()}let f=dk();G([()=>o.value.slice(),s],(t,n)=>{let[r,i]=t,[a,o]=n,s=qG(a,r);if(s.key!==null){let{virtual:t,height:n,itemHeight:r}=e;if(s.add){let e=o.findIndex(e=>{let{key:t}=e;return t===s.key}),a=nK(JG(o,i,s.key),t,n,r),d=o.slice();d.splice(e+1,0,tK),c.value=d,l.value=a,u.value=`show`}else{let e=i.findIndex(e=>{let{key:t}=e;return t===s.key}),a=nK(JG(i,o,s.key),t,n,r),d=i.slice();d.splice(e+1,0,tK),c.value=d,l.value=a,u.value=`hide`}}else o!==i&&(c.value=i)}),G(()=>f.value.dragging,e=>{e||d()});let p=J(()=>e.motion===void 0?c.value:s.value),m=()=>{e.onActiveChange(null)};return()=>{let t=Z(Z({},e),r),{prefixCls:n,selectable:o,checkable:s,disabled:c,motion:f,height:h,itemHeight:g,virtual:_,focusable:v,activeItem:y,focused:b,tabindex:x,onKeydown:S,onFocus:C,onBlur:w,onListChangeStart:T,onListChangeEnd:E}=t,D=YG(t,[`prefixCls`,`selectable`,`checkable`,`disabled`,`motion`,`height`,`itemHeight`,`virtual`,`focusable`,`activeItem`,`focused`,`tabindex`,`onKeydown`,`onFocus`,`onBlur`,`onListChangeStart`,`onListChangeEnd`]);return U($e,null,[b&&y&&U(`span`,{style:XG,"aria-live":`assertive`},[iK(y)]),U(`div`,null,[U(`input`,{style:XG,disabled:v===!1||c,tabindex:v===!1?null:x,onKeydown:S,onFocus:C,onBlur:w,value:``,onChange:ZG,"aria-label":`for screen reader`},null)]),U(`div`,{class:`${n}-treenode`,"aria-hidden":!0,style:{position:`absolute`,pointerEvents:`none`,visibility:`hidden`,height:0,overflow:`hidden`}},[U(`div`,{class:`${n}-indent`},[U(`div`,{ref:a,class:`${n}-indent-unit`},null)])]),U(Ud,Y(Y({},Br(D,[`onActiveChange`])),{},{data:p.value,itemKey:rK,height:h,fullHeight:!1,virtual:_,itemHeight:g,prefixCls:`${n}-list`,ref:i,onVisibleChange:(e,t)=>{let n=new Set(e);t.filter(e=>!n.has(e)).some(e=>rK(e)===QG)&&d()}}),{default:e=>{let{pos:t}=e,n=YG(e.data,[]),{title:r,key:i,isStart:a,isEnd:o}=e,s=Lk(i,t);return delete n.key,delete n.children,U(KG,Y(Y({},n),{},{eventKey:s,title:r,active:!!y&&i===y.key,data:e.data,isStart:a,isEnd:o,motion:f,motionNodes:i===QG?l.value:null,motionType:u.value,onMotionStart:T,onMotionEnd:d,onMousemove:m}),null)}})])}}});function oK(e){let{dropPosition:t,dropLevelOffset:n,indent:r}=e,i={pointerEvents:`none`,position:`absolute`,right:0,backgroundColor:`red`,height:`2px`};switch(t){case-1:i.top=0,i.left=`${-n*r}px`;break;case 1:i.bottom=0,i.left=`${-n*r}px`;break;case 0:i.bottom=0,i.left=`${r}`;break}return U(`div`,{style:i},null)}var sK=10,cK=u({compatConfig:{MODE:3},name:`Tree`,inheritAttrs:!1,props:Zn(vk(),{prefixCls:`vc-tree`,showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,expandAction:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:oK,allowDrop:()=>!0}),setup(e,t){let{attrs:n,slots:r,expose:i}=t,a=q(!1),o={},s=q(),c=q([]),l=q([]),u=q([]),d=q([]),f=q([]),p=q([]),m={},h=Ne({draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),g=q([]);G([()=>e.treeData,()=>e.children],()=>{g.value=e.treeData===void 0?zk(Ht(e.children)):e.treeData.slice()},{immediate:!0,deep:!0});let _=q({}),v=q(!1),b=q(null),x=q(!1),C=J(()=>Rk(e.fieldNames)),w=q(),T=null,E=null,D=null,O=J(()=>({expandedKeysSet:k.value,selectedKeysSet:A.value,loadedKeysSet:j.value,loadingKeysSet:M.value,checkedKeysSet:N.value,halfCheckedKeysSet:P.value,dragOverNodeKey:h.dragOverNodeKey,dropPosition:h.dropPosition,keyEntities:_.value})),k=J(()=>new Set(p.value)),A=J(()=>new Set(c.value)),j=J(()=>new Set(d.value)),M=J(()=>new Set(f.value)),N=J(()=>new Set(l.value)),P=J(()=>new Set(u.value));S(()=>{if(g.value){let e=Hk(g.value,{fieldNames:C.value});_.value=Z({[QG]:eK},e.keyEntities)}});let F=!1;G([()=>e.expandedKeys,()=>e.autoExpandParent,_],(t,n)=>{let[r,i]=t,[a,o]=n,s=p.value;if(e.expandedKeys!==void 0||F&&i!==o)s=e.autoExpandParent||!F&&e.defaultExpandParent?Fk(e.expandedKeys,_.value):e.expandedKeys;else if(!F&&e.defaultExpandAll){let e=Z({},_.value);delete e[QG],s=Object.keys(e).map(t=>e[t].key)}else!F&&e.defaultExpandedKeys&&(s=e.autoExpandParent||e.defaultExpandParent?Fk(e.defaultExpandedKeys,_.value):e.defaultExpandedKeys);s&&(p.value=s),F=!0},{immediate:!0});let I=q([]);S(()=>{I.value=Bk(g.value,p.value,C.value)}),S(()=>{e.selectable&&(e.selectedKeys===void 0?!F&&e.defaultSelectedKeys&&(c.value=Nk(e.defaultSelectedKeys,e)):c.value=Nk(e.selectedKeys,e))});let{maxLevel:L,levelEntities:ee}=hA(_);S(()=>{if(e.checkable){let t;if(e.checkedKeys===void 0?!F&&e.defaultCheckedKeys?t=Pk(e.defaultCheckedKeys)||{}:g.value&&(t=Pk(e.checkedKeys)||{checkedKeys:l.value,halfCheckedKeys:u.value}):t=Pk(e.checkedKeys)||{},t){let{checkedKeys:n=[],halfCheckedKeys:r=[]}=t;if(!e.checkStrictly){let e=iA(n,!0,_.value,L.value,ee.value);({checkedKeys:n,halfCheckedKeys:r}=e)}l.value=n,u.value=r}}}),S(()=>{e.loadedKeys&&(d.value=e.loadedKeys)});let te=()=>{Z(h,{dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},ne=e=>{w.value.scrollTo(e)};G(()=>e.activeKey,()=>{e.activeKey!==void 0&&(b.value=e.activeKey)},{immediate:!0}),G(b,e=>{z(()=>{e!==null&&ne({key:e})})},{immediate:!0,flush:`post`});let R=t=>{e.expandedKeys===void 0&&(p.value=t)},re=()=>{h.draggingNodeKey!==null&&Z(h,{draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),T=null,D=null},ie=(t,n)=>{let{onDragend:r}=e;h.dragOverNodeKey=null,re(),r?.({event:t,node:n.eventData}),E=null},ae=e=>{ie(e,null,!0),window.removeEventListener(`dragend`,ae)},oe=(t,n)=>{let{onDragstart:r}=e,{eventKey:i,eventData:a}=n;E=n,T={x:t.clientX,y:t.clientY};let o=wk(p.value,i);h.draggingNodeKey=i,h.dragChildrenKeys=kk(i,_.value),s.value=w.value.getIndentWidth(),R(o),window.addEventListener(`dragend`,ae),r&&r({event:t,node:a})},se=(t,n)=>{let{onDragenter:r,onExpand:i,allowDrop:a,direction:c}=e,{pos:l,eventKey:u}=n;if(D!==u&&(D=u),!E){te();return}let{dropPosition:d,dropLevelOffset:f,dropTargetKey:m,dropContainerKey:g,dropTargetPos:v,dropAllowed:y,dragOverNodeKey:b}=Mk(t,E,n,s.value,T,a,I.value,_.value,k.value,c);if(h.dragChildrenKeys.indexOf(m)!==-1||!y){te();return}if(o||={},Object.keys(o).forEach(e=>{clearTimeout(o[e])}),E.eventKey!==n.eventKey&&(o[l]=window.setTimeout(()=>{if(h.draggingNodeKey===null)return;let e=p.value.slice(),r=_.value[n.eventKey];r&&(r.children||[]).length&&(e=Tk(p.value,n.eventKey)),R(e),i&&i(e,{node:n.eventData,expanded:!0,nativeEvent:t})},800)),E.eventKey===m&&f===0){te();return}Z(h,{dragOverNodeKey:b,dropPosition:d,dropLevelOffset:f,dropTargetKey:m,dropContainerKey:g,dropTargetPos:v,dropAllowed:y}),r&&r({event:t,node:n.eventData,expandedKeys:p.value})},B=(t,n)=>{let{onDragover:r,allowDrop:i,direction:a}=e;if(!E)return;let{dropPosition:o,dropLevelOffset:c,dropTargetKey:l,dropContainerKey:u,dropAllowed:d,dropTargetPos:f,dragOverNodeKey:p}=Mk(t,E,n,s.value,T,i,I.value,_.value,k.value,a);h.dragChildrenKeys.indexOf(l)!==-1||!d||(E.eventKey===l&&c===0?h.dropPosition===null&&h.dropLevelOffset===null&&h.dropTargetKey===null&&h.dropContainerKey===null&&h.dropTargetPos===null&&h.dropAllowed===!1&&h.dragOverNodeKey===null||te():o===h.dropPosition&&c===h.dropLevelOffset&&l===h.dropTargetKey&&u===h.dropContainerKey&&f===h.dropTargetPos&&d===h.dropAllowed&&p===h.dragOverNodeKey||Z(h,{dropPosition:o,dropLevelOffset:c,dropTargetKey:l,dropContainerKey:u,dropTargetPos:f,dropAllowed:d,dragOverNodeKey:p}),r&&r({event:t,node:n.eventData}))},V=(t,n)=>{D===n.eventKey&&!t.currentTarget.contains(t.relatedTarget)&&(te(),D=null);let{onDragleave:r}=e;r&&r({event:t,node:n.eventData})},ce=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{dragChildrenKeys:i,dropPosition:a,dropTargetKey:o,dropTargetPos:s,dropAllowed:c}=h;if(!c)return;let{onDrop:l}=e;if(h.dragOverNodeKey=null,re(),o===null)return;let u=Z(Z({},Uk(o,Ht(O.value))),{active:Se.value?.key===o,data:_.value[o].node});i.indexOf(o);let d=Ek(s),f={event:t,node:Wk(u),dragNode:E?E.eventData:null,dragNodesKeys:[E.eventKey].concat(i),dropToGap:a!==0,dropPosition:a+Number(d[d.length-1])};r||l?.(f),E=null},le=(e,t)=>{let{expanded:n,key:r}=t,i=I.value.filter(e=>e.key===r)[0],a=Wk(Z(Z({},Uk(r,O.value)),{data:i.data}));R(n?wk(p.value,r):Tk(p.value,r)),ve(e,a)},H=(t,n)=>{let{onClick:r,expandAction:i}=e;i===`click`&&le(t,n),r&&r(t,n)},ue=(t,n)=>{let{onDblclick:r,expandAction:i}=e;(i===`doubleclick`||i===`dblclick`)&&le(t,n),r&&r(t,n)},de=(t,n)=>{let r=c.value,{onSelect:i,multiple:a}=e,{selected:o}=n,s=n[C.value.key],l=!o;r=l?a?Tk(r,s):[s]:wk(r,s);let u=_.value,d=r.map(e=>{let t=u[e];return t?t.node:null}).filter(e=>e);e.selectedKeys===void 0&&(c.value=r),i&&i(r,{event:`select`,selected:l,node:n,selectedNodes:d,nativeEvent:t})},fe=(t,n,r)=>{let{checkStrictly:i,onCheck:a}=e,o=n[C.value.key],s,c={event:`check`,node:n,checked:r,nativeEvent:t},d=_.value;if(i){let t=r?Tk(l.value,o):wk(l.value,o);s={checked:t,halfChecked:wk(u.value,o)},c.checkedNodes=t.map(e=>d[e]).filter(e=>e).map(e=>e.node),e.checkedKeys===void 0&&(l.value=t)}else{let{checkedKeys:t,halfCheckedKeys:n}=iA([...l.value,o],!0,d,L.value,ee.value);if(!r){let e=new Set(t);e.delete(o),{checkedKeys:t,halfCheckedKeys:n}=iA(Array.from(e),{checked:!1,halfCheckedKeys:n},d,L.value,ee.value)}s=t,c.checkedNodes=[],c.checkedNodesPositions=[],c.halfCheckedKeys=n,t.forEach(e=>{let t=d[e];if(!t)return;let{node:n,pos:r}=t;c.checkedNodes.push(n),c.checkedNodesPositions.push({node:n,pos:r})}),e.checkedKeys===void 0&&(l.value=t,u.value=n)}a&&a(s,c)},pe=t=>{let n=t[C.value.key],r=new Promise((r,i)=>{let{loadData:a,onLoad:o}=e;if(!a||j.value.has(n)||M.value.has(n))return null;a(t).then(()=>{let i=Tk(d.value,n),a=wk(f.value,n);o&&o(i,{event:`load`,node:t}),e.loadedKeys===void 0&&(d.value=i),f.value=a,r()}).catch(t=>{let a=wk(f.value,n);if(f.value=a,m[n]=(m[n]||0)+1,m[n]>=sK){let t=Tk(d.value,n);e.loadedKeys===void 0&&(d.value=t),r()}i(t)}),f.value=Tk(f.value,n)});return r.catch(()=>{}),r},me=(t,n)=>{let{onMouseenter:r}=e;r&&r({event:t,node:n})},he=(t,n)=>{let{onMouseleave:r}=e;r&&r({event:t,node:n})},ge=(t,n)=>{let{onRightClick:r}=e;r&&(t.preventDefault(),r({event:t,node:n}))},_e=t=>{let{onFocus:n}=e;v.value=!0,n&&n(t)},W=t=>{let{onBlur:n}=e;v.value=!1,xe(null),n&&n(t)},ve=(t,n)=>{let r=p.value,{onExpand:i,loadData:a}=e,{expanded:o}=n,s=n[C.value.key];if(x.value)return;r.indexOf(s);let c=!o;if(r=c?Tk(r,s):wk(r,s),R(r),i&&i(r,{node:n,expanded:c,nativeEvent:t}),c&&a){let e=pe(n);e&&e.then(()=>{}).catch(e=>{let t=wk(p.value,s);R(t),Promise.reject(e)})}},ye=()=>{x.value=!0},be=()=>{setTimeout(()=>{x.value=!1})},xe=t=>{let{onActiveChange:n}=e;b.value!==t&&(e.activeKey!==void 0&&(b.value=t),t!==null&&ne({key:t}),n&&n(t))},Se=J(()=>b.value===null?null:I.value.find(e=>{let{key:t}=e;return t===b.value})||null),Ce=e=>{let t=I.value.findIndex(e=>{let{key:t}=e;return t===b.value});t===-1&&e<0&&(t=I.value.length),t=(t+e+I.value.length)%I.value.length;let n=I.value[t];if(n){let{key:e}=n;xe(e)}else xe(null)},we=J(()=>Wk(Z(Z({},Uk(b.value,O.value)),{data:Se.value.data,active:!0}))),Te=t=>{let{onKeydown:n,checkable:r,selectable:i}=e;switch(t.which){case $.UP:Ce(-1),t.preventDefault();break;case $.DOWN:Ce(1),t.preventDefault();break}let a=Se.value;if(a&&a.data){let e=a.data.isLeaf===!1||!!(a.data.children||[]).length,n=we.value;switch(t.which){case $.LEFT:e&&k.value.has(b.value)?ve({},n):a.parent&&xe(a.parent.key),t.preventDefault();break;case $.RIGHT:e&&!k.value.has(b.value)?ve({},n):a.children&&a.children.length&&xe(a.children[0].key),t.preventDefault();break;case $.ENTER:case $.SPACE:r&&!n.disabled&&n.checkable!==!1&&!n.disableCheckbox?fe({},n,!N.value.has(b.value)):!r&&i&&!n.disabled&&n.selectable!==!1&&de({},n);break}}n&&n(t)};return i({onNodeExpand:ve,scrollTo:ne,onKeydown:Te,selectedKeys:J(()=>c.value),checkedKeys:J(()=>l.value),halfCheckedKeys:J(()=>u.value),loadedKeys:J(()=>d.value),loadingKeys:J(()=>f.value),expandedKeys:J(()=>p.value)}),y(()=>{window.removeEventListener(`dragend`,ae),a.value=!0}),pk({expandedKeys:p,selectedKeys:c,loadedKeys:d,loadingKeys:f,checkedKeys:l,halfCheckedKeys:u,expandedKeysSet:k,selectedKeysSet:A,loadedKeysSet:j,loadingKeysSet:M,checkedKeysSet:N,halfCheckedKeysSet:P,flattenNodes:I}),()=>{let{draggingNodeKey:t,dropLevelOffset:i,dropContainerKey:a,dropTargetKey:o,dropPosition:c,dragOverNodeKey:l}=h,{prefixCls:u,showLine:d,focusable:f,tabindex:p=0,selectable:m,showIcon:g,icon:y=r.icon,switcherIcon:x,draggable:S,checkable:C,checkStrictly:T,disabled:E,motion:D,loadData:O,filterTreeNode:k,height:A,itemHeight:j,virtual:M,dropIndicatorRender:N,onContextmenu:P,onScroll:F,direction:I,rootClassName:L,rootStyle:ee}=e,{class:te,style:ne}=n,R=Bu(Z(Z({},e),n),{aria:!0,data:!0}),re;return re=S?typeof S==`object`?S:typeof S==`function`?{nodeDraggable:S}:{}:!1,U(uk,{value:{prefixCls:u,selectable:m,showIcon:g,icon:y,switcherIcon:x,draggable:re,draggingNodeKey:t,checkable:C,customCheckable:r.checkable,checkStrictly:T,disabled:E,keyEntities:_.value,dropLevelOffset:i,dropContainerKey:a,dropTargetKey:o,dropPosition:c,dragOverNodeKey:l,dragging:t!==null,indent:s.value,direction:I,dropIndicatorRender:N,loadData:O,filterTreeNode:k,onNodeClick:H,onNodeDoubleClick:ue,onNodeExpand:ve,onNodeSelect:de,onNodeCheck:fe,onNodeLoad:pe,onNodeMouseEnter:me,onNodeMouseLeave:he,onNodeContextMenu:ge,onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:B,onNodeDragLeave:V,onNodeDragEnd:ie,onNodeDrop:ce,slots:r}},{default:()=>[U(`div`,{role:`tree`,class:K(u,te,L,{[`${u}-show-line`]:d,[`${u}-focused`]:v.value,[`${u}-active-focused`]:b.value!==null}),style:ee},[U(aK,Y({ref:w,prefixCls:u,style:ne,disabled:E,selectable:m,checkable:!!C,motion:D,height:A,itemHeight:j,virtual:M,focusable:f,focused:v.value,tabindex:p,activeItem:Se.value,onFocus:_e,onBlur:W,onKeydown:Te,onActiveChange:xe,onListChangeStart:ye,onListChangeEnd:be,onContextmenu:P,onScroll:F},R),null)])]})}}}),lK=cK,uK={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z`}}]},name:`file`,theme:`outlined`};function dK(e){for(var t=1;t({[`.${e}-switcher-icon`]:{display:`inline-block`,fontSize:10,verticalAlign:`baseline`,svg:{transition:`transform ${t.motionDurationSlow}`}}}),AK=(e,t)=>({[`.${e}-drop-indicator`]:{position:`absolute`,zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:`none`,"&:after":{position:`absolute`,top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:`transparent`,border:`${t.lineWidthBold}px solid ${t.colorPrimary}`,borderRadius:`50%`,content:`""`}}}),jK=(e,t)=>{let{treeCls:n,treeNodeCls:r,treeNodePadding:i,treeTitleHeight:a}=t,o=(a-t.fontSizeLG)/2,s=t.paddingXS;return{[n]:Z(Z({},rn(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:`rotate(90deg)`}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Z({},I(t)),[`${n}-list-holder-inner`]:{alignItems:`flex-start`},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:`stretch`,[`${n}-node-content-wrapper`]:{flex:`auto`},[`${r}.dragging`]:{position:`relative`,"&:after":{position:`absolute`,top:0,insetInlineEnd:0,bottom:i,insetInlineStart:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:OK,animationDuration:t.motionDurationSlow,animationPlayState:`running`,animationFillMode:`forwards`,content:`""`,pointerEvents:`none`}}}},[`${r}`]:{display:`flex`,alignItems:`flex-start`,padding:`0 0 ${i}px 0`,outline:`none`,"&-rtl":{direction:`rtl`},"&-disabled":{[`${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:`not-allowed`,"&:hover":{background:`transparent`}}},[`&-active ${n}-node-content-wrapper`]:Z({},I(t)),[`&:not(${r}-disabled).filter-node ${n}-title`]:{color:`inherit`,fontWeight:500},"&-draggable":{[`${n}-draggable-icon`]:{width:a,lineHeight:`${a}px`,textAlign:`center`,visibility:`visible`,opacity:.2,transition:`opacity ${t.motionDurationSlow}`,[`${r}:hover &`]:{opacity:.45}},[`&${r}-disabled`]:{[`${n}-draggable-icon`]:{visibility:`hidden`}}}},[`${n}-indent`]:{alignSelf:`stretch`,whiteSpace:`nowrap`,userSelect:`none`,"&-unit":{display:`inline-block`,width:a}},[`${n}-draggable-icon`]:{visibility:`hidden`},[`${n}-switcher`]:Z(Z({},kK(e,t)),{position:`relative`,flex:`none`,alignSelf:`stretch`,width:a,margin:0,lineHeight:`${a}px`,textAlign:`center`,cursor:`pointer`,userSelect:`none`,"&-noop":{cursor:`default`},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:`rotate(-90deg)`}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:`relative`,zIndex:1,display:`inline-block`,width:`100%`,height:`100%`,"&:before":{position:`absolute`,top:0,insetInlineEnd:a/2,bottom:-i,marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:`""`},"&:after":{position:`absolute`,width:a/2*.8,height:a/2,borderBottom:`1px solid ${t.colorBorder}`,content:`""`}}}),[`${n}-checkbox`]:{top:`initial`,marginInlineEnd:s,marginBlockStart:o},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:`relative`,zIndex:`auto`,minHeight:a,margin:0,padding:`0 ${t.paddingXS/2}px`,color:`inherit`,lineHeight:`${a}px`,background:`transparent`,borderRadius:t.borderRadius,cursor:`pointer`,transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:t.controlItemBgHover},[`&${n}-node-selected`]:{backgroundColor:t.controlItemBgActive},[`${n}-iconEle`]:{display:`inline-block`,width:a,height:a,lineHeight:`${a}px`,textAlign:`center`,verticalAlign:`top`,"&:empty":{display:`none`}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:`transparent`},[`${n}-node-content-wrapper`]:Z({lineHeight:`${a}px`,userSelect:`none`},AK(e,t)),[`${r}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${t.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:`relative`,height:`100%`,"&:before":{position:`absolute`,top:0,insetInlineEnd:a/2,bottom:-i,borderInlineEnd:`1px solid ${t.colorBorder}`,content:`""`},"&-end":{"&:before":{display:`none`}}}},[`${n}-switcher`]:{background:`transparent`,"&-line-icon":{verticalAlign:`-0.15em`}}},[`${r}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:`auto !important`,bottom:`auto !important`,height:`${a/2}px !important`}}}}})}},MK=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:r}=e;return{[`${t}${t}-directory`]:{[n]:{position:`relative`,"&:before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:`background-color ${e.motionDurationMid}`,content:`""`,pointerEvents:`none`},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},[`${t}-switcher`]:{transition:`color ${e.motionDurationMid}`},[`${t}-node-content-wrapper`]:{borderRadius:0,userSelect:`none`,"&:hover":{background:`transparent`},[`&${t}-node-selected`]:{color:e.colorTextLightSolid,background:`transparent`}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:e.colorPrimary},[`${t}-switcher`]:{color:e.colorTextLightSolid},[`${t}-node-content-wrapper`]:{color:e.colorTextLightSolid,background:`transparent`}}}}}},NK=(e,t)=>{let n=`.${e}`,r=`${n}-treenode`,i=t.paddingXS/2,a=t.controlHeightSM,o=B(t,{treeCls:n,treeNodeCls:r,treeNodePadding:i,treeTitleHeight:a});return[jK(e,o),MK(o)]},PK=v(`Tree`,(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:tN(`${n}-checkbox`,e)},NK(n,e),$_(e)]}),FK=()=>{let e=vk();return Z(Z({},e),{showLine:W([Boolean,Object]),multiple:Q(),autoExpandParent:Q(),checkStrictly:Q(),checkable:Q(),disabled:Q(),defaultExpandAll:Q(),defaultExpandParent:Q(),defaultExpandedKeys:Ue(),expandedKeys:Ue(),checkedKeys:W([Array,Object]),defaultCheckedKeys:Ue(),selectedKeys:Ue(),defaultSelectedKeys:Ue(),selectable:Q(),loadedKeys:Ue(),draggable:Q(),showIcon:Q(),icon:d(),switcherIcon:f.any,prefixCls:String,replaceFields:Qt(),blockNode:Q(),openAnimation:f.any,onDoubleclick:e.onDblclick,"onUpdate:selectedKeys":d(),"onUpdate:checkedKeys":d(),"onUpdate:expandedKeys":d()})},IK=u({compatConfig:{MODE:3},name:`ATree`,inheritAttrs:!1,props:Zn(FK(),{checkable:!1,selectable:!0,showIcon:!1,blockNode:!1}),slots:Object,setup(e,t){let{attrs:n,expose:r,emit:i,slots:a}=t;e.treeData===void 0&&a.default;let{prefixCls:o,direction:s,virtual:c}=X(`tree`,e),[l,u]=PK(o),d=H();r({treeRef:d,onNodeExpand:function(){var e;(e=d.value)==null||e.onNodeExpand(...arguments)},scrollTo:e=>{var t;(t=d.value)==null||t.scrollTo(e)},selectedKeys:J(()=>d.value?.selectedKeys),checkedKeys:J(()=>d.value?.checkedKeys),halfCheckedKeys:J(()=>d.value?.halfCheckedKeys),loadedKeys:J(()=>d.value?.loadedKeys),loadingKeys:J(()=>d.value?.loadingKeys),expandedKeys:J(()=>d.value?.expandedKeys)}),S(()=>{pi(e.replaceFields===void 0,`Tree`,"`replaceFields` is deprecated, please use fieldNames instead")});let f=(e,t)=>{i(`update:checkedKeys`,e),i(`check`,e,t)},p=(e,t)=>{i(`update:expandedKeys`,e),i(`expand`,e,t)},m=(e,t)=>{i(`update:selectedKeys`,e),i(`select`,e,t)};return()=>{let{showIcon:t,showLine:r,switcherIcon:i=a.switcherIcon,icon:h=a.icon,blockNode:g,checkable:_,selectable:v,fieldNames:y=e.replaceFields,motion:b=e.openAnimation,itemHeight:x=28,onDoubleclick:S,onDblclick:C}=e,w=Z(Z(Z({},n),Br(e,[`onUpdate:checkedKeys`,`onUpdate:expandedKeys`,`onUpdate:selectedKeys`,`onDoubleclick`])),{showLine:!!r,dropIndicatorRender:DK,fieldNames:y,icon:h,itemHeight:x}),T=a.default?dt(a.default()):void 0;return l(U(lK,Y(Y({},w),{},{virtual:c.value,motion:b,ref:d,prefixCls:o.value,class:K({[`${o.value}-icon-hide`]:!t,[`${o.value}-block-node`]:g,[`${o.value}-unselectable`]:!v,[`${o.value}-rtl`]:s.value===`rtl`},n.class,u.value),direction:s.value,checkable:_,selectable:v,switcherIcon:e=>EK(o.value,i,e,a.leafIcon,r),onCheck:f,onExpand:p,onSelect:m,onDblclick:C||S,children:T}),Z(Z({},a),{checkable:()=>U(`span`,{class:`${o.value}-checkbox-inner`},null)})))}}}),LK={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z`}}]},name:`folder-open`,theme:`outlined`};function RK(e){for(var t=1;t{if(s===GK.End)return!1;if(c(e)){if(o.push(e),s===GK.None)s=GK.Start;else if(s===GK.Start)return s=GK.End,!1}else s===GK.Start&&o.push(e);return n.includes(e)}),o}function JK(e,t,n){let r=[...t],i=[];return KK(e,n,(e,t)=>{let n=r.indexOf(e);return n!==-1&&(i.push(t),r.splice(n,1)),!!r.length}),i}var YK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iZ(Z({},FK()),{expandAction:W([Boolean,String])});function ZK(e){let{isLeaf:t,expanded:n}=e;return U(t?pK:n?BK:WK,null,null)}var QK=u({compatConfig:{MODE:3},name:`ADirectoryTree`,inheritAttrs:!1,props:Zn(XK(),{showIcon:!0,expandAction:`click`}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i,expose:a}=t,o=H(e.treeData||zk(dt(r.default?.call(r))));G(()=>e.treeData,()=>{o.value=e.treeData}),O(()=>{z(()=>{e.treeData===void 0&&r.default&&(o.value=zk(dt(r.default?.call(r))))})});let s=H(),c=H(),l=J(()=>Rk(e.fieldNames)),u=H();a({scrollTo:e=>{var t;(t=u.value)==null||t.scrollTo(e)},selectedKeys:J(()=>u.value?.selectedKeys),checkedKeys:J(()=>u.value?.checkedKeys),halfCheckedKeys:J(()=>u.value?.halfCheckedKeys),loadedKeys:J(()=>u.value?.loadedKeys),loadingKeys:J(()=>u.value?.loadingKeys),expandedKeys:J(()=>u.value?.expandedKeys)});let d=()=>{let{keyEntities:t}=Hk(o.value,{fieldNames:l.value}),n;return n=e.defaultExpandAll?Object.keys(t):e.defaultExpandParent?Fk(e.expandedKeys||e.defaultExpandedKeys||[],t):e.expandedKeys||e.defaultExpandedKeys,n},f=H(e.selectedKeys||e.defaultSelectedKeys||[]),p=H(d());G(()=>e.selectedKeys,()=>{e.selectedKeys!==void 0&&(f.value=e.selectedKeys)},{immediate:!0}),G(()=>e.expandedKeys,()=>{e.expandedKeys!==void 0&&(p.value=e.expandedKeys)},{immediate:!0});let m=Eg((e,t)=>{let{isLeaf:n}=t;n||e.shiftKey||e.metaKey||e.ctrlKey||u.value.onNodeExpand(e,t)},200,{leading:!0}),h=(t,n)=>{e.expandedKeys===void 0&&(p.value=t),i(`update:expandedKeys`,t),i(`expand`,t,n)},g=(t,n)=>{let{expandAction:r}=e;r===`click`&&m(t,n),i(`click`,t,n)},_=(t,n)=>{let{expandAction:r}=e;(r===`dblclick`||r===`doubleclick`)&&m(t,n),i(`doubleclick`,t,n),i(`dblclick`,t,n)},v=(t,n)=>{let{multiple:r}=e,{node:a,nativeEvent:u}=n,d=a[l.value.key],m=Z(Z({},n),{selected:!0}),h=u?.ctrlKey||u?.metaKey,g=u?.shiftKey,_;r&&h?(_=t,s.value=d,c.value=_,m.selectedNodes=JK(o.value,_,l.value)):r&&g?(_=Array.from(new Set([...c.value||[],...qK({treeData:o.value,expandedKeys:p.value,startKey:d,endKey:s.value,fieldNames:l.value})])),m.selectedNodes=JK(o.value,_,l.value)):(_=[d],s.value=d,c.value=_,m.selectedNodes=JK(o.value,_,l.value)),i(`update:selectedKeys`,_),i(`select`,_,m),e.selectedKeys===void 0&&(f.value=_)},y=(e,t)=>{i(`update:checkedKeys`,e),i(`check`,e,t)},{prefixCls:b,direction:x}=X(`tree`,e);return()=>{let t=K(`${b.value}-directory`,{[`${b.value}-directory-rtl`]:x.value===`rtl`},n.class),{icon:i=r.icon,blockNode:a=!0}=e,o=YK(e,[`icon`,`blockNode`]);return U(IK,Y(Y(Y({},n),{},{icon:i||ZK,ref:u,blockNode:a},o),{},{prefixCls:b.value,class:t,expandedKeys:p.value,selectedKeys:f.value,onSelect:v,onClick:g,onDblclick:_,onExpand:h,onCheck:y}),r)}}}),$K=Ck,eq=Z(IK,{DirectoryTree:QK,TreeNode:$K,install:e=>(e.component(IK.name,IK),e.component($K.name,$K),e.component(QK.name,QK),e)});function tq(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new Set;function i(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=r.has(e);if(br(!o,`Warning: There may be circular references`),o)return!1;if(e===t)return!0;if(n&&a>1)return!1;r.add(e);let s=a+1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ni(e[n],t[n],s))}return!1}return i(e,t)}var{SubMenu:nq,Item:rq}=wS;function iq(e){return e.some(e=>{let{children:t}=e;return t&&t.length>0})}function aq(e,t){return typeof t==`string`||typeof t==`number`?t?.toString().toLowerCase().includes(e.trim().toLowerCase()):!1}function oq(e){let{filters:t,prefixCls:n,filteredKeys:r,filterMultiple:i,searchValue:a,filterSearch:o}=e;return t.map((e,t)=>{let s=String(e.value);if(e.children)return U(nq,{key:s||t,title:e.text,popupClassName:`${n}-dropdown-submenu`},{default:()=>[oq({filters:e.children,prefixCls:n,filteredKeys:r,filterMultiple:i,searchValue:a,filterSearch:o})]});let c=i?vN:ET,l=U(rq,{key:e.value===void 0?t:s},{default:()=>[U(c,{checked:r.includes(s)},null),U(`span`,null,[e.text])]});return a.trim()?typeof o==`function`?o(a,e)?l:void 0:aq(a,e.text)?l:void 0:l})}var sq=u({name:`FilterDropdown`,props:[`tablePrefixCls`,`prefixCls`,`dropdownPrefixCls`,`column`,`filterState`,`filterMultiple`,`filterMode`,`filterSearch`,`columnKey`,`triggerFilter`,`locale`,`getPopupContainer`],setup(e,t){let{slots:n}=t,r=HU(),i=J(()=>e.filterMode??`menu`),a=J(()=>e.filterSearch??!1),o=J(()=>e.column.filterDropdownOpen||e.column.filterDropdownVisible),s=J(()=>e.column.onFilterDropdownOpenChange||e.column.onFilterDropdownVisibleChange),c=q(!1),l=J(()=>!!(e.filterState&&(e.filterState.filteredKeys?.length||e.filterState.forceFiltered))),u=J(()=>uq(e.column?.filters)),d=J(()=>{let{filterDropdown:t,slots:n={},customFilterDropdown:i}=e.column;return t||n.filterDropdown&&r.value[n.filterDropdown]||i&&r.value.customFilterDropdown}),f=J(()=>{let{filterIcon:t,slots:n={}}=e.column;return t||n.filterIcon&&r.value[n.filterIcon]||r.value.customFilterIcon}),p=e=>{var t;c.value=e,(t=s.value)==null||t.call(s,e)},m=J(()=>typeof o.value==`boolean`?o.value:c.value),h=J(()=>e.filterState?.filteredKeys),g=q([]),_=e=>{let{selectedKeys:t}=e;g.value=t},v=(t,n)=>{let{node:r,checked:i}=n;e.filterMultiple?_({selectedKeys:t}):_({selectedKeys:i&&r.key?[r.key]:[]})};G(h,()=>{c.value&&_({selectedKeys:h.value||[]})},{immediate:!0});let y=q([]),b=q(),x=e=>{b.value=setTimeout(()=>{y.value=e})},S=()=>{clearTimeout(b.value)};ut(()=>{clearTimeout(b.value)});let C=q(``),w=e=>{let{value:t}=e.target;C.value=t};G(c,()=>{c.value||(C.value=``)});let T=t=>{let{column:n,columnKey:r,filterState:i}=e,a=t&&t.length?t:null;if(a===null&&(!i||!i.filteredKeys)||tq(a,i?.filteredKeys,!0))return null;e.triggerFilter({column:n,key:r,filteredKeys:a})},E=()=>{p(!1),T(g.value)},D=function(){let{confirm:t,closeDropdown:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};t&&T([]),n&&p(!1),C.value=``,e.column.filterResetToDefaultFilteredValue?g.value=(e.column.defaultFilteredValue||[]).map(e=>String(e)):g.value=[]},O=function(){let{closeDropdown:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};e&&p(!1),T(g.value)},k=e=>{e&&h.value!==void 0&&(g.value=h.value||[]),p(e),!e&&!d.value&&E()},{direction:A}=X(``,e),j=e=>{if(e.target.checked){let e=u.value;g.value=e}else g.value=[]},M=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),r={title:e.text,key:e.value===void 0?t:n};return e.children&&(r.children=M({filters:e.children})),r})},N=e=>Z(Z({},e),{text:e.title,value:e.key,children:e.children?.map(e=>N(e))||[]}),P=J(()=>M({filters:e.column.filters})),F=J(()=>K({[`${e.dropdownPrefixCls}-menu-without-submenu`]:!iq(e.column.filters||[])})),I=()=>{let t=g.value,{column:n,locale:r,tablePrefixCls:o,filterMultiple:s,dropdownPrefixCls:c,getPopupContainer:l,prefixCls:d}=e;return(n.filters||[]).length===0?U(te,{image:te.PRESENTED_IMAGE_SIMPLE,description:r.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:`16px 0`}},null):i.value===`tree`?U($e,null,[U(WG,{filterSearch:a.value,value:C.value,onChange:w,tablePrefixCls:o,locale:r},null),U(`div`,{class:`${o}-filter-dropdown-tree`},[s?U(vN,{class:`${o}-filter-dropdown-checkall`,onChange:j,checked:t.length===u.value.length,indeterminate:t.length>0&&t.length[r.filterCheckall]}):null,U(eq,{checkable:!0,selectable:!1,blockNode:!0,multiple:s,checkStrictly:!s,class:`${c}-menu`,onCheck:v,checkedKeys:t,selectedKeys:t,showIcon:!1,treeData:P.value,autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:C.value.trim()?e=>typeof a.value==`function`?a.value(C.value,N(e)):aq(C.value,e.title):void 0},null)])]):U($e,null,[U(WG,{filterSearch:a.value,value:C.value,onChange:w,tablePrefixCls:o,locale:r},null),U(wS,{multiple:s,prefixCls:`${c}-menu`,class:F.value,onClick:S,onSelect:_,onDeselect:_,selectedKeys:t,getPopupContainer:l,openKeys:y.value,onOpenChange:x},{default:()=>oq({filters:n.filters||[],filterSearch:a.value,prefixCls:d,filteredKeys:g.value,filterMultiple:s,searchValue:C.value})})])},L=J(()=>{let t=g.value;return e.column.filterResetToDefaultFilteredValue?tq((e.column.defaultFilteredValue||[]).map(e=>String(e)),t,!0):t.length===0});return()=>{let{tablePrefixCls:t,prefixCls:r,column:i,dropdownPrefixCls:a,locale:o,getPopupContainer:s}=e,c;c=typeof d.value==`function`?d.value({prefixCls:`${a}-custom`,setSelectedKeys:e=>_({selectedKeys:e}),selectedKeys:g.value,confirm:O,clearFilters:D,filters:i.filters,visible:m.value,column:i.__originColumn__,close:()=>{p(!1)}}):d.value?d.value:U($e,null,[I(),U(`div`,{class:`${r}-dropdown-btns`},[U(Qb,{type:`link`,size:`small`,disabled:L.value,onClick:()=>D()},{default:()=>[o.filterReset]}),U(Qb,{type:`primary`,size:`small`,onClick:E},{default:()=>[o.filterConfirm]})])]);let u=U(UG,{class:`${r}-dropdown`},{default:()=>[c]}),h;return h=typeof f.value==`function`?f.value({filtered:l.value,column:i.__originColumn__}):f.value?f.value:U(VG,null,null),U(`div`,{class:`${r}-column`},[U(`span`,{class:`${t}-column-title`},[n.default?.call(n)]),U(kP,{overlay:u,trigger:[`click`],open:m.value,onOpenChange:k,getPopupContainer:s,placement:A.value===`rtl`?`bottomLeft`:`bottomRight`},{default:()=>[U(`span`,{role:`button`,tabindex:-1,class:K(`${r}-trigger`,{active:l.value}),onClick:e=>{e.stopPropagation()}},[h])]})])}}});function cq(e,t,n){let r=[];return(e||[]).forEach((e,i)=>{let a=wG(i,n),o=e.filterDropdown||e?.slots?.filterDropdown||e.customFilterDropdown;if(e.filters||o||`onFilter`in e)if(`filteredValue`in e){let t=e.filteredValue;o||(t=t?.map(String)??t),r.push({column:e,key:CG(e,a),filteredKeys:t,forceFiltered:e.filtered})}else r.push({column:e,key:CG(e,a),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered});`children`in e&&(r=[...r,...cq(e.children,t,a)])}),r}function lq(e,t,n,r,i,a,o,s){return n.map((n,c)=>{let l=wG(c,s),{filterMultiple:u=!0,filterMode:d,filterSearch:f}=n,p=n,m=n.filterDropdown||n?.slots?.filterDropdown||n.customFilterDropdown;if(p.filters||m){let s=CG(p,l),c=r.find(e=>{let{key:t}=e;return s===t});p=Z(Z({},p),{title:r=>U(sq,{tablePrefixCls:e,prefixCls:`${e}-filter`,dropdownPrefixCls:t,column:p,columnKey:s,filterState:c,filterMultiple:u,filterMode:d,filterSearch:f,triggerFilter:a,locale:i,getPopupContainer:o},{default:()=>[TG(n.title,r)]})})}return`children`in p&&(p=Z(Z({},p),{children:lq(e,t,p.children,r,i,a,o,l)})),p})}function uq(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:r}=e;t.push(n),r&&(t=[...t,...uq(r)])}),t}function dq(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:r,column:i}=e,a=i.filterDropdown||i?.slots?.filterDropdown||i.customFilterDropdown,{filters:o}=i;if(a)t[n]=r||null;else if(Array.isArray(r)){let e=uq(o);t[n]=e.filter(e=>r.includes(String(e)))}else t[n]=null}),t}function fq(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:r},filteredKeys:i}=t;return n&&i&&i.length?e.filter(e=>i.some(t=>{let i=uq(r),a=i.findIndex(e=>String(e)===String(t)),o=a===-1?t:i[a];return n(o,e)})):e},e)}function pq(e){return e.flatMap(e=>`children`in e?[e,...pq(e.children||[])]:[e])}function mq(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,locale:i,onFilterChange:a,getPopupContainer:o}=e,s=J(()=>pq(r.value)),[c,l]=ff(cq(s.value,!0)),u=J(()=>{let e=cq(s.value,!1);if(e.length===0)return e;let t=!0,n=!0;if(e.forEach(e=>{let{filteredKeys:r}=e;r===void 0?n=!1:t=!1}),t){let e=(s.value||[]).map((e,t)=>CG(e,wG(t)));return c.value.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=s.value[e.findIndex(e=>e===t.key)];return Z(Z({},t),{column:Z(Z({},t.column),n),forceFiltered:n.filtered})})}return pi(n,`Table`,"Columns should all contain `filteredValue` or not contain `filteredValue`."),e}),d=J(()=>dq(u.value)),f=e=>{let t=u.value.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),l(t),a(dq(t),t)};return[e=>lq(t.value,n.value,e,u.value,i.value,f,o.value),u,d]}function hq(e,t){return e.map(e=>{let n=Z({},e);return n.title=TG(n.title,t),`children`in n&&(n.children=hq(n.children,t)),n})}function gq(e){return[t=>hq(t,e.value)]}function _q(e){return function(t){let{prefixCls:n,onExpand:r,record:i,expanded:a,expandable:o}=t,s=`${n}-row-expand-icon`;return U(`button`,{type:`button`,onClick:e=>{r(i,e),e.stopPropagation()},class:K(s,{[`${s}-spaced`]:!o,[`${s}-expanded`]:o&&a,[`${s}-collapsed`]:o&&!a}),"aria-label":a?e.collapse:e.expand,"aria-expanded":a},null)}}function vq(e,t){let n=t.value;return e.map(e=>{if(e===sG||e===TW)return e;let r=Z({},e),{slots:i={}}=r;return r.__originColumn__=e,pi(!(`slots`in r),`Table`,"`column.slots` is deprecated. Please use `v-slot:headerCell` `v-slot:bodyCell` instead."),Object.keys(i).forEach(e=>{let t=i[e];r[e]===void 0&&n[t]&&(r[e]=n[t])}),t.value.headerCell&&!e.slots?.title&&(r.title=uo(t.value,`headerCell`,{title:e.title,column:e},()=>[e.title])),`children`in r&&Array.isArray(r.children)&&(r.children=vq(r.children,t)),r})}function yq(e){return[t=>vq(t,e)]}var bq=e=>{let{componentCls:t}=e,n=`${e.lineWidth}px ${e.lineType} ${e.tableBorderColor}`,r=(n,r,i)=>({[`&${t}-${n}`]:{[`> ${t}-container`]:{[`> ${t}-content, > ${t}-body`]:{"> table > tbody > tr > td":{[`> ${t}-expanded-row-fixed`]:{margin:`-${r}px -${i+e.lineWidth}px`}}}}}});return{[`${t}-wrapper`]:{[`${t}${t}-bordered`]:Z(Z(Z({[`> ${t}-title`]:{border:n,borderBottom:0},[`> ${t}-container`]:{borderInlineStart:n,[` + > ${t}-content, + > ${t}-header, + > ${t}-body, + > ${t}-summary + `]:{"> table":{"\n > thead > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:n},"> thead":{"> tr:not(:last-child) > th":{borderBottom:n},"> tr > th::before":{backgroundColor:`transparent !important`}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{[`> ${t}-cell-fix-right-first::after`]:{borderInlineEnd:n}},"> tbody > tr > td":{[`> ${t}-expanded-row-fixed`]:{margin:`-${e.tablePaddingVertical}px -${e.tablePaddingHorizontal+e.lineWidth}px`,"&::after":{position:`absolute`,top:0,insetInlineEnd:e.lineWidth,bottom:0,borderInlineEnd:n,content:`""`}}}}},[` + > ${t}-content, + > ${t}-header + `]:{"> table":{borderTop:n}}},[`&${t}-scroll-horizontal`]:{[`> ${t}-container > ${t}-body`]:{"> table > tbody":{[` + > tr${t}-expanded-row, + > tr${t}-placeholder + `]:{"> td":{borderInlineEnd:0}}}}}},r(`middle`,e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),r(`small`,e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{[`> ${t}-footer`]:{border:n,borderTop:0}}),[`${t}-cell`]:{[`${t}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${e.lineWidth}px 0 ${e.lineWidth}px ${e.tableHeaderBg}`}}}}},xq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-cell-ellipsis`]:Z(Z({},xe),{wordBreak:`keep-all`,[` + &${t}-cell-fix-left-last, + &${t}-cell-fix-right-first + `]:{overflow:`visible`,[`${t}-cell-content`]:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`}},[`${t}-column-title`]:{overflow:`hidden`,textOverflow:`ellipsis`,wordBreak:`keep-all`}})}}},Sq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-tbody > tr${t}-placeholder`]:{textAlign:`center`,color:e.colorTextDisabled,"&:hover > td":{background:e.colorBgContainer}}}}},Cq=e=>{let{componentCls:t,antCls:n,controlInteractiveSize:r,motionDurationSlow:i,lineWidth:a,paddingXS:o,lineType:s,tableBorderColor:c,tableExpandIconBg:l,tableExpandColumnWidth:u,borderRadius:d,fontSize:f,fontSizeSM:p,lineHeight:m,tablePaddingVertical:h,tablePaddingHorizontal:g,tableExpandedRowBg:_,paddingXXS:v}=e,y=r/2-a,b=y*2+a*3,x=`${a}px ${s} ${c}`,S=v-a;return{[`${t}-wrapper`]:{[`${t}-expand-icon-col`]:{width:u},[`${t}-row-expand-icon-cell`]:{textAlign:`center`,[`${t}-row-expand-icon`]:{display:`inline-flex`,float:`none`,verticalAlign:`sub`}},[`${t}-row-indent`]:{height:1,float:`left`},[`${t}-row-expand-icon`]:Z(Z({},Lr(e)),{position:`relative`,float:`left`,boxSizing:`border-box`,width:b,height:b,padding:0,color:`inherit`,lineHeight:`${b}px`,background:l,border:x,borderRadius:d,transform:`scale(${r/b})`,transition:`all ${i}`,userSelect:`none`,"&:focus, &:hover, &:active":{borderColor:`currentcolor`},"&::before, &::after":{position:`absolute`,background:`currentcolor`,transition:`transform ${i} ease-out`,content:`""`},"&::before":{top:y,insetInlineEnd:S,insetInlineStart:S,height:a},"&::after":{top:S,bottom:S,insetInlineStart:y,width:a,transform:`rotate(90deg)`},"&-collapsed::before":{transform:`rotate(-180deg)`},"&-collapsed::after":{transform:`rotate(0deg)`},"&-spaced":{"&::before, &::after":{display:`none`,content:`none`},background:`transparent`,border:0,visibility:`hidden`}}),[`${t}-row-indent + ${t}-row-expand-icon`]:{marginTop:(f*m-a*3)/2-Math.ceil((p*1.4-a*3)/2),marginInlineEnd:o},[`tr${t}-expanded-row`]:{"&, &:hover":{"> td":{background:_}},[`${n}-descriptions-view`]:{display:`flex`,table:{flex:`auto`,width:`auto`}}},[`${t}-expanded-row-fixed`]:{position:`relative`,margin:`-${h}px -${g}px`,padding:`${h}px ${g}px`}}}},wq=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:i,tableFilterDropdownSearchWidth:a,paddingXXS:o,paddingXS:s,colorText:c,lineWidth:l,lineType:u,tableBorderColor:d,tableHeaderIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:h,motionDurationSlow:g,colorTextDescription:_,colorPrimary:v,tableHeaderFilterActiveBg:y,colorTextDisabled:b,tableFilterDropdownBg:x,tableFilterDropdownHeight:S,controlItemBgHover:C,controlItemBgActive:w,boxShadowSecondary:T}=e,E=`${n}-dropdown`,D=`${t}-filter-dropdown`,O=`${n}-tree`,k=`${l}px ${u} ${d}`;return[{[`${t}-wrapper`]:{[`${t}-filter-column`]:{display:`flex`,justifyContent:`space-between`},[`${t}-filter-trigger`]:{position:`relative`,display:`flex`,alignItems:`center`,marginBlock:-o,marginInline:`${o}px ${-m/2}px`,padding:`0 ${o}px`,color:f,fontSize:p,borderRadius:h,cursor:`pointer`,transition:`all ${g}`,"&:hover":{color:_,background:y},"&.active":{color:v}}}},{[`${n}-dropdown`]:{[D]:Z(Z({},rn(e)),{minWidth:i,backgroundColor:x,borderRadius:h,boxShadow:T,[`${E}-menu`]:{maxHeight:S,overflowX:`hidden`,border:0,boxShadow:`none`,"&:empty::after":{display:`block`,padding:`${s}px 0`,color:b,fontSize:p,textAlign:`center`,content:`"Not Found"`}},[`${D}-tree`]:{paddingBlock:`${s}px 0`,paddingInline:s,[O]:{padding:0},[`${O}-treenode ${O}-node-content-wrapper:hover`]:{backgroundColor:C},[`${O}-treenode-checkbox-checked ${O}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:w}}},[`${D}-search`]:{padding:s,borderBottom:k,"&-input":{input:{minWidth:a},[r]:{color:b}}},[`${D}-checkall`]:{width:`100%`,marginBottom:o,marginInlineStart:o},[`${D}-btns`]:{display:`flex`,justifyContent:`space-between`,padding:`${s-l}px ${s}px`,overflow:`hidden`,backgroundColor:`inherit`,borderTop:k}})}},{[`${n}-dropdown ${D}, ${D}-submenu`]:{[`${n}-checkbox-wrapper + span`]:{paddingInlineStart:s,color:c},"> ul":{maxHeight:`calc(100vh - 130px)`,overflowX:`hidden`,overflowY:`auto`}}}]},Tq=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:i,zIndexTableFixed:a,tableBg:o,zIndexTableSticky:s}=e,c=r;return{[`${t}-wrapper`]:{[` + ${t}-cell-fix-left, + ${t}-cell-fix-right + `]:{position:`sticky !important`,zIndex:a,background:o},[` + ${t}-cell-fix-left-first::after, + ${t}-cell-fix-left-last::after + `]:{position:`absolute`,top:0,right:{_skip_check_:!0,value:0},bottom:-n,width:30,transform:`translateX(100%)`,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},[`${t}-cell-fix-left-all::after`]:{display:`none`},[` + ${t}-cell-fix-right-first::after, + ${t}-cell-fix-right-last::after + `]:{position:`absolute`,top:0,bottom:-n,left:{_skip_check_:!0,value:0},width:30,transform:`translateX(-100%)`,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},[`${t}-container`]:{"&::before, &::after":{position:`absolute`,top:0,bottom:0,zIndex:s+1,width:30,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},[`${t}-ping-left`]:{[`&:not(${t}-has-fix-left) ${t}-container`]:{position:`relative`,"&::before":{boxShadow:`inset 10px 0 8px -8px ${c}`}},[` + ${t}-cell-fix-left-first::after, + ${t}-cell-fix-left-last::after + `]:{boxShadow:`inset 10px 0 8px -8px ${c}`},[`${t}-cell-fix-left-last::before`]:{backgroundColor:`transparent !important`}},[`${t}-ping-right`]:{[`&:not(${t}-has-fix-right) ${t}-container`]:{position:`relative`,"&::after":{boxShadow:`inset -10px 0 8px -8px ${c}`}},[` + ${t}-cell-fix-right-first::after, + ${t}-cell-fix-right-last::after + `]:{boxShadow:`inset -10px 0 8px -8px ${c}`}}}}},Eq=e=>{let{componentCls:t,antCls:n}=e;return{[`${t}-wrapper`]:{[`${t}-pagination${n}-pagination`]:{margin:`${e.margin}px 0`},[`${t}-pagination`]:{display:`flex`,flexWrap:`wrap`,rowGap:e.paddingXS,"> *":{flex:`none`},"&-left":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-right":{justifyContent:`flex-end`}}}}},Dq=e=>{let{componentCls:t,tableRadius:n}=e;return{[`${t}-wrapper`]:{[t]:{[`${t}-title, ${t}-header`]:{borderRadius:`${n}px ${n}px 0 0`},[`${t}-title + ${t}-container`]:{borderStartStartRadius:0,borderStartEndRadius:0,table:{borderRadius:0,"> thead > tr:first-child":{"th:first-child":{borderRadius:0},"th:last-child":{borderRadius:0}}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:`0 0 ${n}px ${n}px`}}}}},Oq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper-rtl`]:{direction:`rtl`,table:{direction:`rtl`},[`${t}-pagination-left`]:{justifyContent:`flex-end`},[`${t}-pagination-right`]:{justifyContent:`flex-start`},[`${t}-row-expand-icon`]:{"&::after":{transform:`rotate(-90deg)`},"&-collapsed::before":{transform:`rotate(180deg)`},"&-collapsed::after":{transform:`rotate(0deg)`}}}}},kq=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:i,paddingXS:a,tableHeaderIconColor:o,tableHeaderIconColorHover:s}=e;return{[`${t}-wrapper`]:{[`${t}-selection-col`]:{width:e.tableSelectionColumnWidth},[`${t}-bordered ${t}-selection-col`]:{width:e.tableSelectionColumnWidth+a*2},[` + table tr th${t}-selection-column, + table tr td${t}-selection-column + `]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:`center`,[`${n}-radio-wrapper`]:{marginInlineEnd:0}},[`table tr th${t}-selection-column${t}-cell-fix-left`]:{zIndex:e.zIndexTableFixed+1},[`table tr th${t}-selection-column::after`]:{backgroundColor:`transparent !important`},[`${t}-selection`]:{position:`relative`,display:`inline-flex`,flexDirection:`column`},[`${t}-selection-extra`]:{position:`absolute`,top:0,zIndex:1,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,marginInlineStart:`100%`,paddingInlineStart:`${e.tablePaddingHorizontal/4}px`,[r]:{color:o,fontSize:i,verticalAlign:`baseline`,"&:hover":{color:s}}}}}},Aq=e=>{let{componentCls:t}=e,n=(n,r,i,a)=>({[`${t}${t}-${n}`]:{fontSize:a,[` + ${t}-title, + ${t}-footer, + ${t}-thead > tr > th, + ${t}-tbody > tr > td, + tfoot > tr > th, + tfoot > tr > td + `]:{padding:`${r}px ${i}px`},[`${t}-filter-trigger`]:{marginInlineEnd:`-${i/2}px`},[`${t}-expanded-row-fixed`]:{margin:`-${r}px -${i}px`},[`${t}-tbody`]:{[`${t}-wrapper:only-child ${t}`]:{marginBlock:`-${r}px`,marginInline:`${e.tableExpandColumnWidth-i}px -${i}px`}},[`${t}-selection-column`]:{paddingInlineStart:`${i/4}px`}}});return{[`${t}-wrapper`]:Z(Z({},n(`middle`,e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),n(`small`,e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},jq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper ${t}-resize-handle`]:{position:`absolute`,top:0,height:`100% !important`,bottom:0,left:` auto !important`,right:` -8px`,cursor:`col-resize`,touchAction:`none`,userSelect:`auto`,width:`16px`,zIndex:1,"&-line":{display:`block`,width:`1px`,marginLeft:`7px`,height:`100% !important`,backgroundColor:e.colorPrimary,opacity:0},"&:hover &-line":{opacity:1}},[`${t}-wrapper ${t}-resize-handle.dragging`]:{overflow:`hidden`,[`${t}-resize-handle-line`]:{opacity:1},"&:before":{position:`absolute`,top:0,bottom:0,content:`" "`,width:`200vw`,transform:`translateX(-50%)`,opacity:0}}}},Mq=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,tableHeaderIconColor:i,tableHeaderIconColorHover:a}=e;return{[`${t}-wrapper`]:{[`${t}-thead th${t}-column-has-sorters`]:{outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:`transparent !important`}},"&:focus-visible":{color:e.colorPrimary},[` + &${t}-cell-fix-left:hover, + &${t}-cell-fix-right:hover + `]:{background:e.tableFixedHeaderSortActiveBg}},[`${t}-thead th${t}-column-sort`]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:`transparent !important`}},[`td${t}-column-sort`]:{background:e.tableBodySortBg},[`${t}-column-title`]:{position:`relative`,zIndex:1,flex:1},[`${t}-column-sorters`]:{display:`flex`,flex:`auto`,alignItems:`center`,justifyContent:`space-between`,"&::after":{position:`absolute`,inset:0,width:`100%`,height:`100%`,content:`""`}},[`${t}-column-sorter`]:{marginInlineStart:n,color:i,fontSize:0,transition:`color ${e.motionDurationSlow}`,"&-inner":{display:`inline-flex`,flexDirection:`column`,alignItems:`center`},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},[`${t}-column-sorter-up + ${t}-column-sorter-down`]:{marginTop:`-0.3em`}},[`${t}-column-sorters:hover ${t}-column-sorter`]:{color:a}}}},Nq=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:i,tableScrollThumbSize:a,tableScrollBg:o,zIndexTableSticky:s}=e,c=`${e.lineWidth}px ${e.lineType} ${e.tableBorderColor}`;return{[`${t}-wrapper`]:{[`${t}-sticky`]:{"&-holder":{position:`sticky`,zIndex:s,background:e.colorBgContainer},"&-scroll":{position:`sticky`,bottom:0,height:`${a}px !important`,zIndex:s,display:`flex`,alignItems:`center`,background:o,borderTop:c,opacity:n,"&:hover":{transformOrigin:`center bottom`},"&-bar":{height:a,backgroundColor:r,borderRadius:100,transition:`all ${e.motionDurationSlow}, transform none`,position:`absolute`,bottom:0,"&:hover, &-active":{backgroundColor:i}}}}}}},Pq=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r}=e,i=`${n}px ${e.lineType} ${r}`;return{[`${t}-wrapper`]:{[`${t}-summary`]:{position:`relative`,zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:i}}},[`div${t}-summary`]:{boxShadow:`0 -${n}px 0 ${r}`}}}},Fq=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:i,lineWidth:a,lineType:o,tableBorderColor:s,tableFontSize:c,tableBg:l,tableRadius:u,tableHeaderTextColor:d,motionDurationMid:f,tableHeaderBg:p,tableHeaderCellSplitColor:m,tableRowHoverBg:h,tableSelectedRowBg:g,tableSelectedRowHoverBg:_,tableFooterTextColor:v,tableFooterBg:y,paddingContentVerticalLG:b}=e,x=`${a}px ${o} ${s}`;return{[`${t}-wrapper`]:Z(Z({clear:`both`,maxWidth:`100%`},D()),{[t]:Z(Z({},rn(e)),{fontSize:c,background:l,borderRadius:`${u}px ${u}px 0 0`}),table:{width:`100%`,textAlign:`start`,borderRadius:`${u}px ${u}px 0 0`,borderCollapse:`separate`,borderSpacing:0},[` + ${t}-thead > tr > th, + ${t}-tbody > tr > td, + tfoot > tr > th, + tfoot > tr > td + `]:{position:`relative`,padding:`${b}px ${i}px`,overflowWrap:`break-word`},[`${t}-title`]:{padding:`${r}px ${i}px`},[`${t}-thead`]:{"\n > tr > th,\n > tr > td\n ":{position:`relative`,color:d,fontWeight:n,textAlign:`start`,background:p,borderBottom:x,transition:`background ${f} ease`,"&[colspan]:not([colspan='1'])":{textAlign:`center`},[`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]:{position:`absolute`,top:`50%`,insetInlineEnd:0,width:1,height:`1.6em`,backgroundColor:m,transform:`translateY(-50%)`,transition:`background-color ${f}`,content:`""`}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},[`${t}:not(${t}-bordered)`]:{[`${t}-tbody`]:{"> tr":{"> td":{borderTop:x,borderBottom:`transparent`},"&:last-child > td":{borderBottom:x},[`&:first-child > td, + &${t}-measure-row + tr > td`]:{borderTop:`none`,borderTopColor:`transparent`}}}},[`${t}${t}-bordered`]:{[`${t}-tbody`]:{"> tr":{"> td":{borderBottom:x}}}},[`${t}-tbody`]:{"> tr":{"> td":{transition:`background ${f}, border-color ${f}`,[` + > ${t}-wrapper:only-child, + > ${t}-expanded-row-fixed > ${t}-wrapper:only-child + `]:{[t]:{marginBlock:`-${r}px`,marginInline:`${e.tableExpandColumnWidth-i}px -${i}px`,[`${t}-tbody > tr:last-child > td`]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},[` + &${t}-row:hover > td, + > td${t}-cell-row-hover + `]:{background:h},[`&${t}-row-selected`]:{"> td":{background:g},"&:hover > td":{background:_}}}},[`${t}-footer`]:{padding:`${r}px ${i}px`,color:v,background:y}})}},Iq=v(`Table`,e=>{let{controlItemBgActive:t,controlItemBgActiveHover:n,colorTextPlaceholder:r,colorTextHeading:i,colorSplit:a,colorBorderSecondary:o,fontSize:s,padding:c,paddingXS:l,paddingSM:u,controlHeight:d,colorFillAlter:f,colorIcon:p,colorIconHover:m,opacityLoading:h,colorBgContainer:g,borderRadiusLG:_,colorFillContent:v,colorFillSecondary:y,controlInteractiveSize:b}=e,x=new we(p),S=new we(m),C=t,w=new we(y).onBackground(g).toHexString(),T=new we(v).onBackground(g).toHexString(),E=new we(f).onBackground(g).toHexString(),D=B(e,{tableFontSize:s,tableBg:g,tableRadius:_,tablePaddingVertical:c,tablePaddingHorizontal:c,tablePaddingVerticalMiddle:u,tablePaddingHorizontalMiddle:l,tablePaddingVerticalSmall:l,tablePaddingHorizontalSmall:l,tableBorderColor:o,tableHeaderTextColor:i,tableHeaderBg:E,tableFooterTextColor:i,tableFooterBg:E,tableHeaderCellSplitColor:o,tableHeaderSortBg:w,tableHeaderSortHoverBg:T,tableHeaderIconColor:x.clone().setAlpha(x.getAlpha()*h).toRgbString(),tableHeaderIconColorHover:S.clone().setAlpha(S.getAlpha()*h).toRgbString(),tableBodySortBg:E,tableFixedHeaderSortActiveBg:w,tableHeaderFilterActiveBg:v,tableFilterDropdownBg:g,tableRowHoverBg:E,tableSelectedRowBg:C,tableSelectedRowHoverBg:n,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:s,tableFontSizeSmall:s,tableSelectionColumnWidth:d,tableExpandIconBg:g,tableExpandColumnWidth:b+2*e.padding,tableExpandedRowBg:f,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:r,tableScrollThumbBgHover:i,tableScrollBg:a});return[Fq(D),Eq(D),Pq(D),Mq(D),wq(D),bq(D),Dq(D),Cq(D),Pq(D),Sq(D),kq(D),Tq(D),Nq(D),xq(D),Aq(D),jq(D),Oq(D)]}),Lq=[],Rq=()=>({prefixCls:_(),columns:Ue(),rowKey:W([String,Function]),tableLayout:_(),rowClassName:W([String,Function]),title:d(),footer:d(),id:_(),showHeader:Q(),components:Qt(),customRow:d(),customHeaderRow:d(),direction:_(),expandFixed:W([Boolean,String]),expandColumnWidth:Number,expandedRowKeys:Ue(),defaultExpandedRowKeys:Ue(),expandedRowRender:d(),expandRowByClick:Q(),expandIcon:d(),onExpand:d(),onExpandedRowsChange:d(),"onUpdate:expandedRowKeys":d(),defaultExpandAllRows:Q(),indentSize:Number,expandIconColumnIndex:Number,showExpandColumn:Q(),expandedRowClassName:d(),childrenColumnName:_(),rowExpandable:d(),sticky:W([Boolean,Object]),dropdownPrefixCls:String,dataSource:Ue(),pagination:W([Boolean,Object]),loading:W([Boolean,Object]),size:_(),bordered:Q(),locale:Qt(),onChange:d(),onResizeColumn:d(),rowSelection:Qt(),getPopupContainer:d(),scroll:Qt(),sortDirections:Ue(),showSorterTooltip:W([Boolean,Object],!0),transformCellText:d()}),zq=u({name:`InternalTable`,inheritAttrs:!1,props:Zn(Z(Z({},Rq()),{contextSlots:Qt()}),{rowKey:`key`}),setup(e,t){let{attrs:n,slots:r,expose:i,emit:a}=t;pi(!(typeof e.rowKey==`function`&&e.rowKey.length>1),`Table`,"`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected."),VU(J(()=>e.contextSlots)),WU({onResizeColumn:(e,t)=>{a(`resizeColumn`,e,t)}});let o=Uv(),s=J(()=>{let t=new Set(Object.keys(o.value).filter(e=>o.value[e]));return e.columns.filter(e=>!e.responsive||e.responsive.some(e=>t.has(e)))}),{size:c,renderEmpty:l,direction:u,prefixCls:d,configProvider:f}=X(`table`,e),[p,m]=Iq(d),h=J(()=>e.transformCellText||f.transformCellText?.value),[g]=Kt(`Table`,Ye.Table,St(e,`locale`)),_=J(()=>e.dataSource||Lq),v=J(()=>f.getPrefixCls(`dropdown`,e.dropdownPrefixCls)),y=J(()=>e.childrenColumnName||`children`),b=J(()=>_.value.some(e=>e?.[y.value])?`nest`:e.expandedRowRender?`row`:null),x=Ne({body:null}),C=e=>{Z(x,e)},w=J(()=>typeof e.rowKey==`function`?e.rowKey:t=>t?.[e.rowKey]),[T]=oG(_,y,w),E={},D=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{pagination:i,scroll:a,onChange:o}=e,s=Z(Z({},E),t);r&&(E.resetPagination(),s.pagination.current&&(s.pagination.current=1),i&&i.onChange&&i.onChange(1,s.pagination.pageSize)),a&&a.scrollToFirstRowOnChange!==!1&&x.body&&ii(0,{getContainer:()=>x.body}),o?.(s.pagination,s.filters,s.sorter,{currentDataSource:fq(IG(_.value,s.sorterStates,y.value),s.filterStates),action:n})},[O,k,A,j]=LG({prefixCls:d,mergedColumns:s,onSorterChange:(e,t)=>{D({sorter:e,sorterStates:t},`sort`,!1)},sortDirections:J(()=>e.sortDirections||[`ascend`,`descend`]),tableLocale:g,showSorterTooltip:St(e,`showSorterTooltip`)}),M=J(()=>IG(_.value,k.value,y.value)),[N,P,F]=mq({prefixCls:d,locale:g,dropdownPrefixCls:v,mergedColumns:s,onFilterChange:(e,t)=>{D({filters:e,filterStates:t},`filter`,!0)},getPopupContainer:St(e,`getPopupContainer`)}),I=J(()=>fq(M.value,P.value)),[L]=yq(St(e,`contextSlots`)),[ee]=gq(J(()=>{let e={},t=F.value;return Object.keys(t).forEach(n=>{t[n]!==null&&(e[n]=t[n])}),Z(Z({},A.value),{filters:e})})),[te,ne]=aG(J(()=>I.value.length),St(e,`pagination`),(e,t)=>{D({pagination:Z(Z({},E.pagination),{current:e,pageSize:t})},`paginate`)});S(()=>{E.sorter=j.value,E.sorterStates=k.value,E.filters=F.value,E.filterStates=P.value,E.pagination=e.pagination===!1?{}:iG(te.value,e.pagination),E.resetPagination=ne});let R=J(()=>{if(e.pagination===!1||!te.value.pageSize)return I.value;let{current:t=1,total:n,pageSize:r=10}=te.value;return pi(t>0,`Table`,"`current` should be positive number."),I.value.lengthr?I.value.slice((t-1)*r,t*r):I.value:I.value.slice((t-1)*r,t*r)});S(()=>{z(()=>{let{total:e,pageSize:t=10}=te.value;I.value.lengtht&&pi(!1,`Table`,"`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.")})},{flush:`post`});let re=J(()=>e.showExpandColumn===!1?-1:b.value===`nest`&&e.expandIconColumnIndex===void 0?+!!e.rowSelection:e.expandIconColumnIndex>0&&e.rowSelection?e.expandIconColumnIndex-1:e.expandIconColumnIndex),ie=H();G(()=>e.rowSelection,()=>{ie.value=e.rowSelection?Z({},e.rowSelection):e.rowSelection},{deep:!0,immediate:!0});let[ae,oe]=pG(ie,{prefixCls:d,data:I,pageData:R,getRowKey:w,getRecordByKey:T,expandType:b,childrenColumnName:y,locale:g,getPopupContainer:J(()=>e.getPopupContainer)}),se=(t,n,r)=>{let i,{rowClassName:a}=e;return i=K(typeof a==`function`?a(t,n,r):a),K({[`${d.value}-row-selected`]:oe.value.has(w.value(t,n))},i)};i({selectedKeySet:oe});let B=J(()=>typeof e.indentSize==`number`?e.indentSize:15),V=e=>ee(ae(N(O(L(e)))));return()=>{let{expandIcon:t=r.expandIcon||_q(g.value),pagination:i,loading:a,bordered:o}=e,f,v;if(i!==!1&&te.value?.total){let e;e=te.value.size?te.value.size:c.value===`small`||c.value===`middle`?`small`:void 0;let t=t=>U(_z,Y(Y({},te.value),{},{class:[`${d.value}-pagination ${d.value}-pagination-${t}`,te.value.class],size:e}),null),n=u.value===`rtl`?`left`:`right`,{position:r}=te.value;if(r!==null&&Array.isArray(r)){let e=r.find(e=>e.includes(`top`)),i=r.find(e=>e.includes(`bottom`)),a=r.every(e=>`${e}`==`none`);!e&&!i&&!a&&(v=t(n)),e&&(f=t(e.toLowerCase().replace(`top`,``))),i&&(v=t(i.toLowerCase().replace(`bottom`,``)))}else v=t(n)}let y;typeof a==`boolean`?y={spinning:a}:typeof a==`object`&&(y=Z({spinning:!0},a));let b=K(`${d.value}-wrapper`,{[`${d.value}-wrapper-rtl`]:u.value===`rtl`},n.class,m.value),S=Br(e,[`columns`]);return p(U(`div`,{class:b,style:n.style},[U(HR,Y({spinning:!1},y),{default:()=>[f,U(nG,Y(Y(Y({},n),S),{},{expandedRowKeys:e.expandedRowKeys,defaultExpandedRowKeys:e.defaultExpandedRowKeys,expandIconColumnIndex:re.value,indentSize:B.value,expandIcon:t,columns:s.value,direction:u.value,prefixCls:d.value,class:K({[`${d.value}-middle`]:c.value===`middle`,[`${d.value}-small`]:c.value===`small`,[`${d.value}-bordered`]:o,[`${d.value}-empty`]:_.value.length===0}),data:R.value,rowKey:w.value,rowClassName:se,internalHooks:tG,internalRefs:x,onUpdateInternalRefs:C,transformColumns:V,transformCellText:h.value}),Z(Z({},r),{emptyText:()=>r.emptyText?.call(r)||e.locale?.emptyText||l(`Table`)})),v]})]))}}}),Bq=u({name:`ATable`,inheritAttrs:!1,props:Zn(Rq(),{rowKey:`key`}),slots:Object,setup(e,t){let{attrs:n,slots:r,expose:i}=t,a=H();return i({table:a}),()=>{let t=e.columns||EG(r.default?.call(r));return U(zq,Y(Y(Y({ref:a},n),e),{},{columns:t||[],expandedRowRender:r.expandedRowRender||e.expandedRowRender,contextSlots:Z({},r)}),r)}}}),Vq=u({name:`ATableColumn`,slots:Object,render(){return null}}),Hq=u({name:`ATableColumnGroup`,slots:Object,__ANT_TABLE_COLUMN_GROUP:!0,render(){return null}}),Uq=RW,Wq=HW,Gq=Z(WW,{Cell:Wq,Row:Uq,name:`ATableSummary`}),Kq=Z(Bq,{SELECTION_ALL:cG,SELECTION_INVERT:lG,SELECTION_NONE:uG,SELECTION_COLUMN:sG,EXPAND_COLUMN:TW,Column:Vq,ColumnGroup:Hq,Summary:Gq,install:e=>(e.component(Gq.name,Gq),e.component(Wq.name,Wq),e.component(Uq.name,Uq),e.component(Bq.name,Bq),e.component(Vq.name,Vq),e.component(Hq.name,Hq),e)}),qq=u({compatConfig:{MODE:3},name:`Search`,inheritAttrs:!1,props:Zn({prefixCls:String,placeholder:String,value:String,handleClear:Function,disabled:{type:Boolean,default:void 0},onChange:Function},{placeholder:``}),emits:[`change`],setup(e,t){let{emit:n}=t,r=t=>{var r;n(`change`,t),t.target.value===``&&((r=e.handleClear)==null||r.call(e))};return()=>{let{placeholder:t,value:n,prefixCls:i,disabled:a}=e;return U(hI,{placeholder:t,class:i,value:n,onChange:r,disabled:a,allowClear:!0},{prefix:()=>U(jf,null,null)})}}});function Jq(){}var Yq=u({compatConfig:{MODE:3},name:`ListItem`,inheritAttrs:!1,props:{renderedText:f.any,renderedEl:f.any,item:f.any,checked:Q(),prefixCls:String,disabled:Q(),showRemove:Q(),onClick:Function,onRemove:Function},emits:[`click`,`remove`],setup(e,t){let{emit:n}=t;return()=>{let{renderedText:t,renderedEl:r,item:i,checked:a,disabled:o,prefixCls:s,showRemove:c}=e,l=K({[`${s}-content-item`]:!0,[`${s}-content-item-disabled`]:o||i.disabled}),u;return(typeof t==`string`||typeof t==`number`)&&(u=String(t)),U(Ke,{componentName:`Transfer`,defaultLocale:Ye.Transfer},{default:e=>{let t=U(`span`,{class:`${s}-content-item-text`},[r]);return c?U(`li`,{class:l,title:u},[t,U(JB,{disabled:o||i.disabled,class:`${s}-content-item-remove`,"aria-label":e.remove,onClick:()=>{n(`remove`,i)}},{default:()=>[U(sn,null,null)]})]):U(`li`,{class:l,title:u,onClick:o||i.disabled?Jq:()=>{n(`click`,i)}},[U(vN,{class:`${s}-checkbox`,checked:a,disabled:o||i.disabled},null),t])}})}}}),Xq={prefixCls:String,filteredRenderItems:f.array.def([]),selectedKeys:f.array,disabled:Q(),showRemove:Q(),pagination:f.any,onItemSelect:Function,onScroll:Function,onItemRemove:Function};function Zq(e){if(!e)return null;let t={pageSize:10,simple:!0,showSizeChanger:!1,showLessItems:!1};return typeof e==`object`?Z(Z({},t),e):t}var Qq=u({compatConfig:{MODE:3},name:`ListBody`,inheritAttrs:!1,props:Xq,emits:[`itemSelect`,`itemRemove`,`scroll`],setup(e,t){let{emit:n,expose:r}=t,i=H(1),a=t=>{let{selectedKeys:r}=e,i=r.indexOf(t.key)>=0;n(`itemSelect`,t.key,!i)},o=e=>{n(`itemRemove`,[e.key])},s=e=>{n(`scroll`,e)},c=J(()=>Zq(e.pagination));G([c,()=>e.filteredRenderItems],()=>{if(c.value){let t=Math.ceil(e.filteredRenderItems.length/c.value.pageSize);i.value=Math.min(i.value,t)}},{immediate:!0});let l=J(()=>{let{filteredRenderItems:t}=e,n=t;return c.value&&(n=t.slice((i.value-1)*c.value.pageSize,i.value*c.value.pageSize)),n}),u=e=>{i.value=e};return r({items:l}),()=>{let{prefixCls:t,filteredRenderItems:n,selectedKeys:r,disabled:d,showRemove:f}=e,p=null;c.value&&(p=U(_z,{simple:c.value.simple,showSizeChanger:c.value.showSizeChanger,showLessItems:c.value.showLessItems,size:`small`,disabled:d,class:`${t}-pagination`,total:n.length,pageSize:c.value.pageSize,current:i.value,onChange:u},null));let m=l.value.map(e=>{let{renderedEl:n,renderedText:i,item:s}=e,{disabled:c}=s,l=r.indexOf(s.key)>=0;return U(Yq,{disabled:d||c,key:s.key,item:s,renderedText:i,renderedEl:n,checked:l,prefixCls:t,onClick:a,onRemove:o,showRemove:f},null)});return U($e,null,[U(`ul`,{class:K(`${t}-content`,{[`${t}-content-show-remove`]:f}),onScroll:s},[m]),p])}}}),$q=e=>{let t=new Map;return e.forEach((e,n)=>{t.set(e,n)}),t},eJ=e=>{let t=new Map;return e.forEach((e,n)=>{let{disabled:r,key:i}=e;r&&t.set(i,n)}),t},tJ=()=>null;function nJ(e){return!!(e&&!Nt(e)&&Object.prototype.toString.call(e)===`[object Object]`)}function rJ(e){return e.filter(e=>!e.disabled).map(e=>e.key)}var iJ=u({compatConfig:{MODE:3},name:`TransferList`,inheritAttrs:!1,props:{prefixCls:String,dataSource:Ue([]),filter:String,filterOption:Function,checkedKeys:f.arrayOf(f.string),handleFilter:Function,handleClear:Function,renderItem:Function,showSearch:Q(!1),searchPlaceholder:String,notFoundContent:f.any,itemUnit:String,itemsUnit:String,renderList:f.any,disabled:Q(),direction:_(),showSelectAll:Q(),remove:String,selectAll:String,selectCurrent:String,selectInvert:String,removeAll:String,removeCurrent:String,selectAllLabel:f.any,showRemove:Q(),pagination:f.any,onItemSelect:Function,onItemSelectAll:Function,onItemRemove:Function,onScroll:Function},slots:Object,setup(e,t){let{attrs:n,slots:r}=t,i=H(``),a=H(),o=H(),s=(e,t)=>{let n=e?e(t):null,r=!!n&&dt(n).length>0;return r||(n=U(Qq,Y(Y({},t),{},{ref:o}),null)),{customize:r,bodyContent:n}},c=t=>{let{renderItem:n=tJ}=e,r=n(t),i=nJ(r);return{renderedText:i?r.value:r,renderedEl:i?r.label:r,item:t}},l=H([]),u=H([]);S(()=>{let t=[],n=[];e.dataSource.forEach(e=>{let r=c(e),{renderedText:a}=r;if(i.value&&i.value.trim()&&!_(a,e))return null;t.push(e),n.push(r)}),l.value=t,u.value=n});let d=J(()=>{let{checkedKeys:t}=e;if(t.length===0)return`none`;let n=$q(t);return l.value.every(e=>n.has(e.key)||!!e.disabled)?`all`:`part`}),f=J(()=>rJ(l.value)),p=(t,n)=>Array.from(new Set([...t,...e.checkedKeys])).filter(e=>n.indexOf(e)===-1),m=t=>{let{disabled:n,prefixCls:r}=t,i=d.value===`all`;return U(vN,{disabled:e.dataSource?.length===0||n,checked:i,indeterminate:d.value===`part`,class:`${r}-checkbox`,onChange:()=>{let t=f.value;e.onItemSelectAll(p(i?[]:t,i?e.checkedKeys:[]))}},null)},h=t=>{var n;let{target:{value:r}}=t;i.value=r,(n=e.handleFilter)==null||n.call(e,t)},g=t=>{var n;i.value=``,(n=e.handleClear)==null||n.call(e,t)},_=(t,n)=>{let{filterOption:r}=e;return r?r(i.value,n):t.includes(i.value)},v=(t,n)=>{let{itemsUnit:r,itemUnit:i,selectAllLabel:a}=e;if(a)return typeof a==`function`?a({selectedCount:t,totalCount:n}):a;let o=n>1?r:i;return U($e,null,[(t>0?`${t}/`:``)+n,en(` `),o])},y=J(()=>Array.isArray(e.notFoundContent)?e.notFoundContent[e.direction===`left`?0:1]:e.notFoundContent),b=(t,r,o,c,d,f)=>{let p=d?U(`div`,{class:`${t}-body-search-wrapper`},[U(qq,{prefixCls:`${t}-search`,onChange:h,handleClear:g,placeholder:r,value:i.value,disabled:f},null)]):null,m,{onEvents:_}=je(n),{bodyContent:v,customize:b}=s(c,Z(Z(Z({},e),{filteredItems:l.value,filteredRenderItems:u.value,selectedKeys:o}),_));return m=b?U(`div`,{class:`${t}-body-customize-wrapper`},[v]):l.value.length?v:U(`div`,{class:`${t}-body-not-found`},[y.value]),U(`div`,{class:d?`${t}-body ${t}-body-with-search`:`${t}-body`,ref:a},[p,m])};return()=>{let{prefixCls:t,checkedKeys:i,disabled:a,showSearch:s,searchPlaceholder:c,selectAll:u,selectCurrent:d,selectInvert:h,removeAll:g,removeCurrent:_,renderList:y,onItemSelectAll:x,onItemRemove:S,showSelectAll:C=!0,showRemove:w,pagination:T}=e,E=r.footer?.call(r,Z({},e)),D=K(t,{[`${t}-with-pagination`]:!!T,[`${t}-with-footer`]:!!E}),O=b(t,c,i,y,s,a),k=E?U(`div`,{class:`${t}-footer`},[E]):null,A=!w&&!T&&m({disabled:a,prefixCls:t}),j=null;j=w?U(wS,null,{default:()=>[T&&U(wS.Item,{key:`removeCurrent`,onClick:()=>{let e=rJ((o.value.items||[]).map(e=>e.item));S?.(e)}},{default:()=>[_]}),U(wS.Item,{key:`removeAll`,onClick:()=>{S?.(f.value)}},{default:()=>[g]})]}):U(wS,null,{default:()=>[U(wS.Item,{key:`selectAll`,onClick:()=>{let e=f.value;x(p(e,[]))}},{default:()=>[u]}),T&&U(wS.Item,{onClick:()=>{let e=rJ((o.value.items||[]).map(e=>e.item));x(p(e,[]))}},{default:()=>[d]}),U(wS.Item,{key:`selectInvert`,onClick:()=>{let e;e=T?rJ((o.value.items||[]).map(e=>e.item)):f.value;let t=new Set(i),n=[],r=[];e.forEach(e=>{t.has(e)?r.push(e):n.push(e)}),x(p(n,r))}},{default:()=>[h]})]});let M=U(kP,{class:`${t}-header-dropdown`,overlay:j,disabled:a},{default:()=>[U(Cf,null,null)]});return U(`div`,{class:D,style:n.style},[U(`div`,{class:`${t}-header`},[C?U($e,null,[A,M]):null,U(`span`,{class:`${t}-header-selected`},[U(`span`,null,[v(i.length,l.value.length)]),U(`span`,{class:`${t}-header-title`},[r.titleText?.call(r)])])]),O,k])}}});function aJ(){}var oJ=e=>{let{disabled:t,moveToLeft:n=aJ,moveToRight:r=aJ,leftArrowText:i=``,rightArrowText:a=``,leftActive:o,rightActive:s,class:c,style:l,direction:u,oneWay:d}=e;return U(`div`,{class:c,style:l},[U(Qb,{type:`primary`,size:`small`,disabled:t||!s,onClick:r,icon:U(u===`rtl`?wA:gx,null,null)},{default:()=>[a]}),!d&&U(Qb,{type:`primary`,size:`small`,disabled:t||!o,onClick:n,icon:U(u===`rtl`?gx:wA,null,null)},{default:()=>[i]})])};oJ.displayName=`Operation`,oJ.inheritAttrs=!1;var sJ=e=>{let{antCls:t,componentCls:n,listHeight:r,controlHeightLG:i,marginXXS:a,margin:o}=e,s=`${t}-table`,c=`${t}-input`;return{[`${n}-customize-list`]:{[`${n}-list`]:{flex:`1 1 50%`,width:`auto`,height:`auto`,minHeight:r},[`${s}-wrapper`]:{[`${s}-small`]:{border:0,borderRadius:0,[`${s}-selection-column`]:{width:i,minWidth:i}},[`${s}-pagination${s}-pagination`]:{margin:`${o}px 0 ${a}px`}},[`${c}[disabled]`]:{backgroundColor:`transparent`}}}},cJ=(e,t)=>{let{componentCls:n,colorBorder:r}=e;return{[`${n}-list`]:{borderColor:t,"&-search:not([disabled])":{borderColor:r}}}},lJ=e=>{let{componentCls:t}=e;return{[`${t}-status-error`]:Z({},cJ(e,e.colorError)),[`${t}-status-warning`]:Z({},cJ(e,e.colorWarning))}},uJ=e=>{let{componentCls:t,colorBorder:n,colorSplit:r,lineWidth:i,transferItemHeight:a,transferHeaderHeight:s,transferHeaderVerticalPadding:c,transferItemPaddingVertical:l,controlItemBgActive:u,controlItemBgActiveHover:d,colorTextDisabled:f,listHeight:p,listWidth:m,listWidthLG:h,fontSizeIcon:g,marginXS:_,paddingSM:v,lineType:y,iconCls:b,motionDurationSlow:x}=e;return{display:`flex`,flexDirection:`column`,width:m,height:p,border:`${i}px ${y} ${n}`,borderRadius:e.borderRadiusLG,"&-with-pagination":{width:h,height:`auto`},"&-search":{[`${b}-search`]:{color:f}},"&-header":{display:`flex`,flex:`none`,alignItems:`center`,height:s,padding:`${c-i}px ${v}px ${c}px`,color:e.colorText,background:e.colorBgContainer,borderBottom:`${i}px ${y} ${r}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,"> *:not(:last-child)":{marginInlineEnd:4},"> *":{flex:`none`},"&-title":Z(Z({},xe),{flex:`auto`,textAlign:`end`}),"&-dropdown":Z(Z({},o()),{fontSize:g,transform:`translateY(10%)`,cursor:`pointer`,"&[disabled]":{cursor:`not-allowed`}})},"&-body":{display:`flex`,flex:`auto`,flexDirection:`column`,overflow:`hidden`,fontSize:e.fontSize,"&-search-wrapper":{position:`relative`,flex:`none`,padding:v}},"&-content":{flex:`auto`,margin:0,padding:0,overflow:`auto`,listStyle:`none`,"&-item":{display:`flex`,alignItems:`center`,minHeight:a,padding:`${l}px ${v}px`,transition:`all ${x}`,"> *:not(:last-child)":{marginInlineEnd:_},"> *":{flex:`none`},"&-text":Z(Z({},xe),{flex:`auto`}),"&-remove":{position:`relative`,color:n,cursor:`pointer`,transition:`all ${x}`,"&:hover":{color:e.colorLinkHover},"&::after":{position:`absolute`,insert:`-${l}px -50%`,content:`""`}},[`&:not(${t}-list-content-item-disabled)`]:{"&:hover":{backgroundColor:e.controlItemBgHover,cursor:`pointer`},[`&${t}-list-content-item-checked:hover`]:{backgroundColor:d}},"&-checked":{backgroundColor:u},"&-disabled":{color:f,cursor:`not-allowed`}},[`&-show-remove ${t}-list-content-item:not(${t}-list-content-item-disabled):hover`]:{background:`transparent`,cursor:`default`}},"&-pagination":{padding:`${e.paddingXS}px 0`,textAlign:`end`,borderTop:`${i}px ${y} ${r}`},"&-body-not-found":{flex:`none`,width:`100%`,margin:`auto 0`,color:f,textAlign:`center`},"&-footer":{borderTop:`${i}px ${y} ${r}`},"&-checkbox":{lineHeight:1}}},dJ=e=>{let{antCls:t,iconCls:n,componentCls:r,transferHeaderHeight:i,marginXS:a,marginXXS:o,fontSizeIcon:s,fontSize:c,lineHeight:l}=e;return{[r]:Z(Z({},rn(e)),{position:`relative`,display:`flex`,alignItems:`stretch`,[`${r}-disabled`]:{[`${r}-list`]:{background:e.colorBgContainerDisabled}},[`${r}-list`]:uJ(e),[`${r}-operation`]:{display:`flex`,flex:`none`,flexDirection:`column`,alignSelf:`center`,margin:`0 ${a}px`,verticalAlign:`middle`,[`${t}-btn`]:{display:`block`,"&:first-child":{marginBottom:o},[n]:{fontSize:s}}},[`${t}-empty-image`]:{maxHeight:i/2-Math.round(c*l)}})}},fJ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},pJ=v(`Transfer`,e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeightLG:i,controlHeight:a}=e,o=Math.round(t*n),s=i,c=a,l=B(e,{transferItemHeight:c,transferHeaderHeight:s,transferHeaderVerticalPadding:Math.ceil((s-r-o)/2),transferItemPaddingVertical:(c-o)/2});return[dJ(l),sJ(l),lJ(l),fJ(l)]},{listWidth:180,listHeight:200,listWidthLG:250}),mJ=a(u({compatConfig:{MODE:3},name:`ATransfer`,inheritAttrs:!1,props:{id:String,prefixCls:String,dataSource:Ue([]),disabled:Q(),targetKeys:Ue(),selectedKeys:Ue(),render:d(),listStyle:W([Function,Object],()=>({})),operationStyle:Qt(void 0),titles:Ue(),operations:Ue(),showSearch:Q(!1),filterOption:d(),searchPlaceholder:String,notFoundContent:f.any,locale:Qt(),rowKey:d(),showSelectAll:Q(),selectAllLabels:Ue(),children:d(),oneWay:Q(),pagination:W([Object,Boolean]),status:_(),onChange:d(),onSelectChange:d(),onSearch:d(),onScroll:d(),"onUpdate:targetKeys":d(),"onUpdate:selectedKeys":d()},slots:Object,setup(e,t){let{emit:n,attrs:r,slots:i,expose:a}=t,{configProvider:o,prefixCls:s,direction:c}=X(`transfer`,e),[l,u]=pJ(s),d=H([]),f=H([]),p=zf(),m=Vf.useInject(),h=J(()=>Wf(m.status,e.status));G(()=>e.selectedKeys,()=>{d.value=e.selectedKeys?.filter(t=>e.targetKeys.indexOf(t)===-1)||[],f.value=e.selectedKeys?.filter(t=>e.targetKeys.indexOf(t)>-1)||[]},{immediate:!0});let g=(t,n)=>{let r={notFoundContent:n(`Transfer`)},a=on(i,e,`notFoundContent`);return a&&(r.notFoundContent=a),e.searchPlaceholder!==void 0&&(r.searchPlaceholder=e.searchPlaceholder),Z(Z(Z({},t),r),e.locale)},_=t=>{let{targetKeys:r=[],dataSource:i=[]}=e,a=t===`right`?d.value:f.value,o=eJ(i),s=a.filter(e=>!o.has(e)),c=$q(s),l=t===`right`?s.concat(r):r.filter(e=>!c.has(e)),u=t===`right`?`left`:`right`;t===`right`?d.value=[]:f.value=[],n(`update:targetKeys`,l),w(u,[]),n(`change`,l,t,s),p.onFieldChange()},v=()=>{_(`left`)},y=()=>{_(`right`)},b=(e,t)=>{w(e,t)},x=e=>b(`left`,e),C=e=>b(`right`,e),w=(t,r)=>{t===`left`?(e.selectedKeys||(d.value=r),n(`update:selectedKeys`,[...r,...f.value]),n(`selectChange`,r,Ht(f.value))):(e.selectedKeys||(f.value=r),n(`update:selectedKeys`,[...r,...d.value]),n(`selectChange`,Ht(d.value),r))},T=(e,t)=>{let r=t.target.value;n(`search`,e,r)},E=e=>{T(`left`,e)},D=e=>{T(`right`,e)},O=e=>{n(`search`,e,``)},k=()=>{O(`left`)},A=()=>{O(`right`)},j=(e,t,n)=>{let r=e===`left`?[...d.value]:[...f.value],i=r.indexOf(t);i>-1&&r.splice(i,1),n&&r.push(t),w(e,r)},M=(e,t)=>j(`left`,e,t),N=(e,t)=>j(`right`,e,t),P=t=>{let{targetKeys:r=[]}=e,i=r.filter(e=>!t.includes(e));n(`update:targetKeys`,i),n(`change`,i,`left`,[...t])},F=(e,t)=>{n(`scroll`,e,t)},I=e=>{F(`left`,e)},L=e=>{F(`right`,e)},ee=(e,t)=>typeof e==`function`?e({direction:t}):e,te=H([]),ne=H([]);S(()=>{let{dataSource:t,rowKey:n,targetKeys:r=[]}=e,i=[],a=Array(r.length),o=$q(r);t.forEach(e=>{n&&(e.key=n(e)),o.has(e.key)?a[o.get(e.key)]=e:i.push(e)}),te.value=i,ne.value=a}),a({handleSelectChange:w});let R=t=>{let{disabled:n,operations:a=[],showSearch:l,listStyle:_,operationStyle:b,filterOption:S,showSelectAll:w,selectAllLabels:T=[],oneWay:O,pagination:j,id:F=p.id.value}=e,{class:R,style:re}=r,ie=i.children,ae=!ie&&j,oe=o.renderEmpty,z=g(t,oe),{footer:se}=i,B=e.render||i.render,V=f.value.length>0,ce=d.value.length>0,le=K(s.value,R,{[`${s.value}-disabled`]:n,[`${s.value}-customize-list`]:!!ie,[`${s.value}-rtl`]:c.value===`rtl`},Uf(s.value,h.value,m.hasFeedback),u.value),H=e.titles,ue=(H&&H[0])??i.leftTitle?.call(i)??(z.titles||[``,``])[0],de=(H&&H[1])??i.rightTitle?.call(i)??(z.titles||[``,``])[1];return U(`div`,Y(Y({},r),{},{class:le,style:re,id:F}),[U(iJ,Y({key:`leftList`,prefixCls:`${s.value}-list`,dataSource:te.value,filterOption:S,style:ee(_,`left`),checkedKeys:d.value,handleFilter:E,handleClear:k,onItemSelect:M,onItemSelectAll:x,renderItem:B,showSearch:l,renderList:ie,onScroll:I,disabled:n,direction:c.value===`rtl`?`right`:`left`,showSelectAll:w,selectAllLabel:T[0]||i.leftSelectAllLabel,pagination:ae},z),{titleText:()=>ue,footer:se}),U(oJ,{key:`operation`,class:`${s.value}-operation`,rightActive:ce,rightArrowText:a[0],moveToRight:y,leftActive:V,leftArrowText:a[1],moveToLeft:v,style:b,disabled:n,direction:c.value,oneWay:O},null),U(iJ,Y({key:`rightList`,prefixCls:`${s.value}-list`,dataSource:ne.value,filterOption:S,style:ee(_,`right`),checkedKeys:f.value,handleFilter:D,handleClear:A,onItemSelect:N,onItemSelectAll:C,onItemRemove:P,renderItem:B,showSearch:l,renderList:ie,onScroll:L,disabled:n,direction:c.value===`rtl`?`left`:`right`,showSelectAll:w,selectAllLabel:T[1]||i.rightSelectAllLabel,showRemove:O,pagination:ae},z),{titleText:()=>de,footer:se})])};return()=>l(U(Ke,{componentName:`Transfer`,defaultLocale:Ye.Transfer,children:R},null))}}));function hJ(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function gJ(e){let{label:t,value:n,children:r}=e||{},i=n||`value`;return{_title:t?[t]:[`title`,`label`],value:i,key:i,children:r||`children`}}function _J(e){return e.disabled||e.disableCheckbox||e.checkable===!1}function vJ(e,t){let n=[];function r(e){e.forEach(e=>{n.push(e[t.value]);let i=e[t.children];i&&r(i)})}return r(e),n}function yJ(e){return e==null}var bJ=Symbol(`TreeSelectContextPropsKey`);function xJ(e){return fe(bJ,e)}function SJ(){return g(bJ,{})}var CJ={width:0,height:0,display:`flex`,overflow:`hidden`,opacity:0,border:0,padding:0,margin:0},wJ=u({compatConfig:{MODE:3},name:`OptionList`,inheritAttrs:!1,setup(e,t){let{slots:n,expose:r}=t,i=_d(),a=rd(),o=SJ(),s=H(),c=Wd(()=>o.treeData,[()=>i.open,()=>o.treeData],e=>e[0]),l=J(()=>{let{checkable:e,halfCheckedKeys:t,checkedKeys:n}=a;return e?{checked:n,halfChecked:t}:null});G(()=>i.open,()=>{z(()=>{var e;i.open&&!i.multiple&&a.checkedKeys.length&&((e=s.value)==null||e.scrollTo({key:a.checkedKeys[0]}))})},{immediate:!0,flush:`post`});let u=J(()=>String(i.searchValue).toLowerCase()),d=e=>u.value?String(e[a.treeNodeFilterProp]).toLowerCase().includes(u.value):!1,f=q(a.treeDefaultExpandedKeys),p=q(null);G(()=>i.searchValue,()=>{i.searchValue&&(p.value=vJ(Ht(o.treeData),Ht(o.fieldNames)))},{immediate:!0});let m=J(()=>a.treeExpandedKeys?a.treeExpandedKeys.slice():i.searchValue?p.value:f.value),h=e=>{var t;f.value=e,p.value=e,(t=a.onTreeExpand)==null||t.call(a,e)},g=e=>{e.preventDefault()},_=(e,t)=>{let{node:n}=t;var r,s;let{checkable:c,checkedKeys:l}=a;c&&_J(n)||((r=o.onSelect)==null||r.call(o,n.key,{selected:!l.includes(n.key)}),i.multiple||(s=i.toggleOpen)==null||s.call(i,!1))},v=H(null),y=J(()=>a.keyEntities[v.value]),b=e=>{v.value=e};return r({scrollTo:function(){var e,t=[...arguments];return((e=s.value)?.scrollTo)?.call(e,...t)},onKeydown:e=>{var t;let{which:n}=e;switch(n){case $.UP:case $.DOWN:case $.LEFT:case $.RIGHT:(t=s.value)==null||t.onKeydown(e);break;case $.ENTER:if(y.value){let{selectable:e,value:t}=y.value.node||{};e!==!1&&_(null,{node:{key:v.value},selected:!a.checkedKeys.includes(t)})}break;case $.ESC:i.toggleOpen(!1)}},onKeyup:()=>{}}),()=>{let{prefixCls:e,multiple:t,searchValue:r,open:u,notFoundContent:f=n.notFoundContent?.call(n)}=i,{listHeight:p,listItemHeight:x,virtual:S,dropdownMatchSelectWidth:C,treeExpandAction:w}=o,{checkable:T,treeDefaultExpandAll:E,treeIcon:D,showTreeIcon:O,switcherIcon:k,treeLine:A,loadData:j,treeLoadedKeys:M,treeMotion:N,onTreeLoad:P,checkedKeys:F}=a;if(c.value.length===0)return U(`div`,{role:`listbox`,class:`${e}-empty`,onMousedown:g},[f]);let I={fieldNames:o.fieldNames};return M&&(I.loadedKeys=M),m.value&&(I.expandedKeys=m.value),U(`div`,{onMousedown:g},[y.value&&u&&U(`span`,{style:CJ,"aria-live":`assertive`},[y.value.node.value]),U(cK,Y(Y({ref:s,focusable:!1,prefixCls:`${e}-tree`,treeData:c.value,height:p,itemHeight:x,virtual:S!==!1&&C!==!1,multiple:t,icon:D,showIcon:O,switcherIcon:k,showLine:A,loadData:r?null:j,motion:N,activeKey:v.value,checkable:T,checkStrictly:!0,checkedKeys:l.value,selectedKeys:T?[]:F,defaultExpandAll:E},I),{},{onActiveChange:b,onSelect:_,onCheck:_,onExpand:h,onLoad:P,filterTreeNode:d,expandAction:w}),Z(Z({},n),{checkable:a.customSlots.treeCheckable}))])}}}),TJ=`SHOW_ALL`,EJ=`SHOW_PARENT`,DJ=`SHOW_CHILD`;function OJ(e,t,n,r){let i=new Set(e);return t===`SHOW_CHILD`?e.filter(e=>{let t=n[e];return!(t&&t.children&&t.children.some(e=>{let{node:t}=e;return i.has(t[r.value])})&&t.children.every(e=>{let{node:t}=e;return _J(t)||i.has(t[r.value])}))}):t===`SHOW_PARENT`?e.filter(e=>{let t=n[e],r=t?t.parent:null;return!(r&&!_J(r.node)&&i.has(r.key))}):e}var kJ=()=>null;kJ.inheritAttrs=!1,kJ.displayName=`ATreeSelectNode`,kJ.isTreeSelectNode=!0;var AJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:[]).map(e=>{if(!jJ(e))return null;let n=e.children||{},r=e.key,i={};for(let[t,n]of Object.entries(e.props))i[ue(t)]=n;let{isLeaf:a,checkable:o,selectable:s,disabled:c,disableCheckbox:l}=i,u={isLeaf:a||a===``||void 0,checkable:o||o===``||void 0,selectable:s||s===``||void 0,disabled:c||c===``||void 0,disableCheckbox:l||l===``||void 0},d=Z(Z({},i),u),{title:f=n.title?.call(n,d),switcherIcon:p=n.switcherIcon?.call(n,d)}=i,m=AJ(i,[`title`,`switcherIcon`]),h=n.default?.call(n),g=Z(Z(Z({},m),{title:f,switcherIcon:p,key:r,isLeaf:a}),u),_=t(h);return _.length&&(g.children=_),g})}return t(e)}function NJ(e){if(!e)return e;let t=Z({},e);return`props`in t||Object.defineProperty(t,"props",{get(){return t}}),t}function PJ(e,t,n,r,i,a){let o=null,s=null;function c(){function e(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`0`,c=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return r.map((r,l)=>{let u=`${i}-${l}`,d=r[a.value],f=n.includes(d),p=e(r[a.children]||[],u,f),m=U(kJ,r,{default:()=>[p.map(e=>e.node)]});if(t===d&&(o=m),f){let e={pos:u,node:m,children:p};return c||s.push(e),e}return null}).filter(e=>e)}s||(s=[],e(r),s.sort((e,t)=>{let{node:{props:{value:r}}}=e,{node:{props:{value:i}}}=t;return n.indexOf(r)-n.indexOf(i)}))}Object.defineProperty(e,"triggerNode",{get(){return c(),o}}),Object.defineProperty(e,"allCheckedNodes",{get(){return c(),i?s:s.map(e=>{let{node:t}=e;return t})}})}function FJ(e,t){let{id:n,pId:r,rootPId:i}=t,a={},o=[];return e.map(e=>{let t=Z({},e),r=t[n];return a[r]=t,t.key=t.key||r,t}).forEach(e=>{let t=e[r],n=a[t];n&&(n.children=n.children||[],n.children.push(e)),(t===i||!n&&i===null)&&o.push(e)}),o}function IJ(e,t,n){let r=q();return G([n,e,t],()=>{let i=n.value;e.value?r.value=n.value?FJ(Ht(e.value),Z({id:`id`,pId:`pId`,rootPId:null},i===!0?{}:i)):Ht(e.value).slice():r.value=MJ(Ht(t.value))},{immediate:!0,deep:!0}),r}var LJ=(e=>{let t=q({valueLabels:new Map}),n=q();return G(e,()=>{n.value=Ht(e.value)},{immediate:!0}),[J(()=>{let{valueLabels:e}=t.value,r=new Map,i=n.value.map(t=>{let{value:n}=t,i=t.label??e.get(n);return r.set(n,i),Z(Z({},t),{label:i})});return t.value.valueLabels=r,i})]}),RJ=((e,t)=>{let n=q(new Map),r=q({});return S(()=>{let i=t.value,a=Hk(e.value,{fieldNames:i,initWrapper:e=>Z(Z({},e),{valueEntities:new Map}),processEntity:(e,t)=>{let n=e.node[i.value];t.valueEntities.set(n,e)}});n.value=a.valueEntities,r.value=a.keyEntities}),{valueEntities:n,keyEntities:r}}),zJ=((e,t,n,r,i,a)=>{let o=q([]),s=q([]);return S(()=>{let c=e.value.map(e=>{let{value:t}=e;return t}),l=t.value.map(e=>{let{value:t}=e;return t}),u=c.filter(e=>!r.value[e]);n.value&&({checkedKeys:c,halfCheckedKeys:l}=iA(c,!0,r.value,i.value,a.value)),o.value=Array.from(new Set([...u,...c])),s.value=l}),[o,s]}),BJ=((e,t,n)=>{let{treeNodeFilterProp:r,filterTreeNode:i,fieldNames:a}=n;return J(()=>{let{children:n}=a.value,o=t.value,s=r?.value;if(!o||i.value===!1)return e.value;let c;if(typeof i.value==`function`)c=i.value;else{let e=o.toUpperCase();c=(t,n)=>{let r=n[s];return String(r).toUpperCase().includes(e)}}function l(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=[];for(let i=0,a=e.length;ie.treeCheckable&&!e.treeCheckStrictly),s=J(()=>e.treeCheckable||e.treeCheckStrictly),c=J(()=>e.treeCheckStrictly||e.labelInValue),l=J(()=>s.value||e.multiple),u=J(()=>gJ(e.fieldNames)),[d,f]=df(``,{value:J(()=>e.searchValue===void 0?e.inputValue:e.searchValue),postState:e=>e||``}),p=t=>{var n;f(t),(n=e.onSearch)==null||n.call(e,t)},m=IJ(St(e,`treeData`),St(e,`children`),St(e,`treeDataSimpleMode`)),{keyEntities:h,valueEntities:g}=RJ(m,u),_=e=>{let t=[],n=[];return e.forEach(e=>{g.value.has(e)?n.push(e):t.push(e)}),{missingRawValues:t,existRawValues:n}},v=BJ(m,d,{fieldNames:u,treeNodeFilterProp:St(e,`treeNodeFilterProp`),filterTreeNode:St(e,`filterTreeNode`)}),y=t=>{if(t){if(e.treeNodeLabelProp)return t[e.treeNodeLabelProp];let{_title:n}=u.value;for(let e=0;ehJ(e).map(e=>HJ(e)?{value:e}:e),x=e=>b(e).map(e=>{let{label:t}=e,{value:n,halfChecked:r}=e,i,a=g.value.get(n);return a&&(t??=y(a.node),i=a.node.disabled),{label:t,value:n,halfChecked:r,disabled:i}}),[C,w]=df(e.defaultValue,{value:St(e,`value`)}),T=J(()=>b(C.value)),E=q([]),D=q([]);S(()=>{let e=[],t=[];T.value.forEach(n=>{n.halfChecked?t.push(n):e.push(n)}),E.value=e,D.value=t});let O=J(()=>E.value.map(e=>e.value)),{maxLevel:k,levelEntities:A}=hA(h),[j,M]=zJ(E,D,o,h,k,A),[N]=LJ(J(()=>{let t=OJ(j.value,e.showCheckedStrategy,h.value,u.value).map(e=>h.value[e]?.node?.[u.value.value]??e).map(e=>({value:e,label:E.value.find(t=>t.value===e)?.label})),n=x(t),r=n[0];return!l.value&&r&&yJ(r.value)&&yJ(r.label)?[]:n.map(e=>Z(Z({},e),{label:e.label??e.value}))})),P=(t,n,r)=>{let i=x(t);if(w(i),e.autoClearSearchValue&&f(``),e.onChange){let i=t;o.value&&(i=OJ(t,e.showCheckedStrategy,h.value,u.value).map(e=>{let t=g.value.get(e);return t?t.node[u.value.value]:e}));let{triggerValue:a,selected:d}=n||{triggerValue:void 0,selected:void 0},f=i;if(e.treeCheckStrictly){let e=D.value.filter(e=>!i.includes(e.value));f=[...f,...e]}let p=x(f),_={preValue:E.value,triggerValue:a},v=!0;(e.treeCheckStrictly||r===`selection`&&!d)&&(v=!1),PJ(_,a,t,m.value,v,u.value),s.value?_.checked=d:_.selected=d;let y=c.value?p:p.map(e=>e.value);e.onChange(l.value?y:y[0],c.value?null:p.map(e=>e.label),_)}},F=(t,n)=>{let{selected:r,source:i}=n;var a,s;let c=Ht(h.value),d=Ht(g.value),f=c[t]?.node,p=f?.[u.value.value]??t;if(!l.value)P([p],{selected:!0,triggerValue:p},`option`);else{let e=r?[...O.value,p]:j.value.filter(e=>e!==p);if(o.value){let{missingRawValues:t,existRawValues:n}=_(e),i=n.map(e=>d.get(e).key),a;r?{checkedKeys:a}=iA(i,!0,c,k.value,A.value):{checkedKeys:a}=iA(i,{checked:!1,halfCheckedKeys:M.value},c,k.value,A.value),e=[...t,...a.map(e=>c[e].node[u.value.value])]}P(e,{selected:r,triggerValue:p},i||`option`)}r||!l.value?(a=e.onSelect)==null||a.call(e,p,NJ(f)):(s=e.onDeselect)==null||s.call(e,p,NJ(f))},I=t=>{if(e.onDropdownVisibleChange){let n={};Object.defineProperty(n,"documentClickClose",{get(){return!1}}),e.onDropdownVisibleChange(t,n)}},L=(e,t)=>{let n=e.map(e=>e.value);if(t.type===`clear`){P(n,{},`selection`);return}t.values.length&&F(t.values[0].value,{selected:!1,source:`selection`})},{treeNodeFilterProp:ee,loadData:te,treeLoadedKeys:ne,onTreeLoad:R,treeDefaultExpandAll:re,treeExpandedKeys:ie,treeDefaultExpandedKeys:ae,onTreeExpand:oe,virtual:z,listHeight:se,listItemHeight:B,treeLine:V,treeIcon:ce,showTreeIcon:le,switcherIcon:ue,treeMotion:de,customSlots:fe,dropdownMatchSelectWidth:pe,treeExpandAction:me}=Ft(e);nd(yd({checkable:s,loadData:te,treeLoadedKeys:ne,onTreeLoad:R,checkedKeys:j,halfCheckedKeys:M,treeDefaultExpandAll:re,treeExpandedKeys:ie,treeDefaultExpandedKeys:ae,onTreeExpand:oe,treeIcon:ce,treeMotion:de,showTreeIcon:le,switcherIcon:ue,treeLine:V,treeNodeFilterProp:ee,keyEntities:h,customSlots:fe})),xJ(yd({virtual:z,listHeight:se,listItemHeight:B,treeData:v,fieldNames:u,onSelect:F,dropdownMatchSelectWidth:pe,treeExpandAction:me}));let he=H();return r({focus(){var e;(e=he.value)==null||e.focus()},blur(){var e;(e=he.value)==null||e.blur()},scrollTo(e){var t;(t=he.value)==null||t.scrollTo(e)}}),()=>{let t=Br(e,`id.prefixCls.customSlots.value.defaultValue.onChange.onSelect.onDeselect.searchValue.inputValue.onSearch.autoClearSearchValue.filterTreeNode.treeNodeFilterProp.showCheckedStrategy.treeNodeLabelProp.multiple.treeCheckable.treeCheckStrictly.labelInValue.fieldNames.treeDataSimpleMode.treeData.children.loadData.treeLoadedKeys.onTreeLoad.treeDefaultExpandAll.treeExpandedKeys.treeDefaultExpandedKeys.onTreeExpand.virtual.listHeight.listItemHeight.onDropdownVisibleChange.treeLine.treeIcon.showTreeIcon.switcherIcon.treeMotion`.split(`.`));return U(Ed,Y(Y(Y({ref:he},n),t),{},{id:a,prefixCls:e.prefixCls,mode:l.value?`multiple`:void 0,displayValues:N.value,onDisplayValuesChange:L,searchValue:d.value,onSearch:p,OptionList:wJ,emptyOptions:!m.value.length,onDropdownVisibleChange:I,tagRender:e.tagRender||i.tagRender,dropdownMatchSelectWidth:e.dropdownMatchSelectWidth??!0}),i)}}}),WJ=e=>{let{componentCls:t,treePrefixCls:n,colorBgElevated:r}=e,i=`.${n}`;return[{[`${t}-dropdown`]:[{padding:`${e.paddingXS}px ${e.paddingXS/2}px`},NK(n,B(e,{colorBgContainer:r})),{[i]:{borderRadius:0,"&-list-holder-inner":{alignItems:`stretch`,[`${i}-treenode`]:{[`${i}-node-content-wrapper`]:{flex:`auto`}}}}},tN(`${n}-checkbox`,e),{"&-rtl":{direction:`rtl`,[`${i}-switcher${i}-switcher_close`]:{[`${i}-switcher-icon svg`]:{transform:`rotate(90deg)`}}}}]}]};function GJ(e,t){return v(`TreeSelect`,e=>[WJ(B(e,{treePrefixCls:t.value}))])(e)}var KJ=(e,t,n)=>n===void 0?`${e}-${t}`:n;function qJ(){return Z(Z({},Br(VJ(),[`showTreeIcon`,`treeMotion`,`inputIcon`,`getInputElement`,`treeLine`,`customSlots`])),{suffixIcon:f.any,size:_(),bordered:Q(),treeLine:W([Boolean,Object]),replaceFields:Qt(),placement:_(),status:_(),popupClassName:String,dropdownClassName:String,"onUpdate:value":d(),"onUpdate:treeExpandedKeys":d(),"onUpdate:searchValue":d()})}var JJ=u({compatConfig:{MODE:3},name:`ATreeSelect`,inheritAttrs:!1,props:Zn(qJ(),{choiceTransitionName:``,listHeight:256,treeIcon:!1,listItemHeight:26,bordered:!0}),slots:Object,setup(e,t){let{attrs:n,slots:r,expose:i,emit:a}=t;e.treeData===void 0&&r.default,pi(e.multiple!==!1||!e.treeCheckable,`TreeSelect`,"`multiple` will always be `true` when `treeCheckable` is true"),pi(e.replaceFields===void 0,`TreeSelect`,"`replaceFields` is deprecated, please use fieldNames instead"),pi(!e.dropdownClassName,`TreeSelect`,"`dropdownClassName` is deprecated. Please use `popupClassName` instead.");let o=zf(),s=Vf.useInject(),c=J(()=>Wf(s.status,e.status)),{prefixCls:l,renderEmpty:u,direction:d,virtual:f,dropdownMatchSelectWidth:p,size:m,getPopupContainer:h,getPrefixCls:g,disabled:_}=X(`select`,e),{compactSize:v,compactItemClassnames:y}=u_(l,d),b=J(()=>v.value||m.value),x=at(),S=J(()=>_.value??x.value),C=J(()=>g()),w=J(()=>e.placement===void 0?d.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement),T=J(()=>KJ(C.value,me(w.value),e.transitionName)),E=J(()=>KJ(C.value,``,e.choiceTransitionName)),D=J(()=>g(`select-tree`,e.prefixCls)),O=J(()=>g(`tree-select`,e.prefixCls)),[k,A]=gv(l),[j]=GJ(O,D),M=J(()=>K(e.popupClassName||e.dropdownClassName,`${O.value}-dropdown`,{[`${O.value}-dropdown-rtl`]:d.value===`rtl`},A.value)),N=J(()=>!!(e.treeCheckable||e.multiple)),P=J(()=>e.showArrow===void 0?e.loading||!N.value:e.showArrow),F=H();i({focus(){var e,t;(t=(e=F.value).focus)==null||t.call(e)},blur(){var e,t;(t=(e=F.value).blur)==null||t.call(e)}});let I=function(){var e=[...arguments];a(`update:value`,e[0]),a(`change`,...e),o.onFieldChange()},L=e=>{a(`update:treeExpandedKeys`,e),a(`treeExpand`,e)},ee=e=>{a(`update:searchValue`,e),a(`search`,e)},te=e=>{a(`blur`,e),o.onFieldBlur()};return()=>{let{notFoundContent:t=r.notFoundContent?.call(r),prefixCls:i,bordered:a,listHeight:m,listItemHeight:g,multiple:_,treeIcon:v,treeLine:x,showArrow:C,switcherIcon:ne=r.switcherIcon?.call(r),fieldNames:R=e.replaceFields,id:re=o.id.value,placeholder:ie=r.placeholder?.call(r)}=e,{isFormItemInput:ae,hasFeedback:oe,feedbackIcon:z}=s,{suffixIcon:se,removeIcon:B,clearIcon:V}=Mf(Z(Z({},e),{multiple:N.value,showArrow:P.value,hasFeedback:oe,feedbackIcon:z,prefixCls:l.value}),r),le;le=t===void 0?u(`Select`):t;let H=Br(e,[`suffixIcon`,`itemIcon`,`removeIcon`,`clearIcon`,`switcherIcon`,`bordered`,`status`,`onUpdate:value`,`onUpdate:treeExpandedKeys`,`onUpdate:searchValue`]),ue=K(!i&&O.value,{[`${l.value}-lg`]:b.value===`large`,[`${l.value}-sm`]:b.value===`small`,[`${l.value}-rtl`]:d.value===`rtl`,[`${l.value}-borderless`]:!a,[`${l.value}-in-form-item`]:ae},Uf(l.value,c.value,oe),y.value,n.class,A.value),de={};return e.treeData===void 0&&r.default&&(de.children=ce(r.default())),k(j(U(UJ,Y(Y(Y(Y({},n),H),{},{disabled:S.value,virtual:f.value,dropdownMatchSelectWidth:p.value,id:re,fieldNames:R,ref:F,prefixCls:l.value,class:ue,listHeight:m,listItemHeight:g,treeLine:!!x,inputIcon:se,multiple:_,removeIcon:B,clearIcon:V,switcherIcon:e=>EK(D.value,ne,e,r.leafIcon,x),showTreeIcon:v,notFoundContent:le,getPopupContainer:h?.value,treeMotion:null,dropdownClassName:M.value,choiceTransitionName:E.value,onChange:I,onBlur:te,onSearch:ee,onTreeExpand:L},de),{},{transitionName:T.value,customSlots:Z(Z({},r),{treeCheckable:()=>U(`span`,{class:`${l.value}-tree-checkbox-inner`},null)}),maxTagPlaceholder:e.maxTagPlaceholder||r.maxTagPlaceholder,placement:w.value,showArrow:oe||C,placeholder:ie}),Z(Z({},r),{treeCheckable:()=>U(`span`,{class:`${l.value}-tree-checkbox-inner`},null)}))))}}}),YJ=kJ,XJ=Z(JJ,{TreeNode:kJ,SHOW_ALL:TJ,SHOW_PARENT:EJ,SHOW_CHILD:DJ,install:e=>(e.component(JJ.name,JJ),e.component(YJ.displayName,YJ),e)}),ZJ=()=>({format:String,showNow:Q(),showHour:Q(),showMinute:Q(),showSecond:Q(),use12Hours:Q(),hourStep:Number,minuteStep:Number,secondStep:Number,hideDisabledOptions:Q(),popupClassName:String,status:_()});function QJ(e){let{TimePicker:t,RangePicker:n}=rP(e,Z(Z({},ZJ()),{order:{type:Boolean,default:!0}}));return{TimePicker:u({name:`ATimePicker`,inheritAttrs:!1,props:Z(Z(Z(Z({},UN()),WN()),ZJ()),{addon:{type:Function}}),slots:Object,setup(e,n){let{slots:r,expose:i,emit:a,attrs:o}=n,s=e,c=zf();pi(!(r.addon||s.addon),`TimePicker`,"`addon` is deprecated. Please use `v-slot:renderExtraFooter` instead.");let l=H();i({focus:()=>{var e;(e=l.value)==null||e.focus()},blur:()=>{var e;(e=l.value)==null||e.blur()}});let u=(e,t)=>{a(`update:value`,e),a(`change`,e,t),c.onFieldChange()},d=e=>{a(`update:open`,e),a(`openChange`,e)},f=e=>{a(`focus`,e)},p=e=>{a(`blur`,e),c.onFieldBlur()},m=e=>{a(`ok`,e)};return()=>{let{id:e=c.id.value}=s;return U(t,Y(Y(Y({},o),Br(s,[`onUpdate:value`,`onUpdate:open`])),{},{id:e,dropdownClassName:s.popupClassName,mode:void 0,ref:l,renderExtraFooter:s.addon||r.addon||s.renderExtraFooter||r.renderExtraFooter,onChange:u,onOpenChange:d,onFocus:f,onBlur:p,onOk:m}),r)}}}),TimeRangePicker:u({name:`ATimeRangePicker`,inheritAttrs:!1,props:Z(Z(Z(Z({},UN()),GN()),ZJ()),{order:{type:Boolean,default:!0}}),slots:Object,setup(e,t){let{slots:r,expose:i,emit:a,attrs:o}=t,s=e,c=H(),l=zf();i({focus:()=>{var e;(e=c.value)==null||e.focus()},blur:()=>{var e;(e=c.value)==null||e.blur()}});let u=(e,t)=>{a(`update:value`,e),a(`change`,e,t),l.onFieldChange()},d=e=>{a(`update:open`,e),a(`openChange`,e)},f=e=>{a(`focus`,e)},p=e=>{a(`blur`,e),l.onFieldBlur()},m=(e,t)=>{a(`panelChange`,e,t)},h=e=>{a(`ok`,e)},g=(e,t,n)=>{a(`calendarChange`,e,t,n)};return()=>{let{id:e=l.id.value}=s;return U(n,Y(Y(Y({},o),Br(s,[`onUpdate:open`,`onUpdate:value`])),{},{id:e,dropdownClassName:s.popupClassName,picker:`time`,mode:void 0,ref:c,onChange:u,onOpenChange:d,onFocus:f,onBlur:p,onPanelChange:m,onOk:h,onCalendarChange:g}),r)}}})}}var{TimePicker:$J,TimeRangePicker:eY}=QJ(nC),tY=Z($J,{TimePicker:$J,TimeRangePicker:eY,install:e=>(e.component($J.name,$J),e.component(eY.name,eY),e)}),nY=u({compatConfig:{MODE:3},name:`ATimelineItem`,props:Zn({prefixCls:String,color:String,dot:f.any,pending:Q(),position:f.oneOf(m(`left`,`right`,``)).def(``),label:f.any},{color:`blue`,pending:!1}),slots:Object,setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`timeline`,e),i=J(()=>({[`${r.value}-item`]:!0,[`${r.value}-item-pending`]:e.pending})),a=J(()=>/blue|red|green|gray/.test(e.color||``)?void 0:e.color||`blue`),o=J(()=>({[`${r.value}-item-head`]:!0,[`${r.value}-item-head-${e.color||`blue`}`]:!a.value}));return()=>{let{label:t=n.label?.call(n),dot:s=n.dot?.call(n)}=e;return U(`li`,{class:i.value},[t&&U(`div`,{class:`${r.value}-item-label`},[t]),U(`div`,{class:`${r.value}-item-tail`},null),U(`div`,{class:[o.value,!!s&&`${r.value}-item-head-custom`],style:{borderColor:a.value,color:a.value}},[s]),U(`div`,{class:`${r.value}-item-content`},[n.default?.call(n)])])}}}),rY=e=>{let{componentCls:t}=e;return{[t]:Z(Z({},rn(e)),{margin:0,padding:0,listStyle:`none`,[`${t}-item`]:{position:`relative`,margin:0,paddingBottom:e.timeLineItemPaddingBottom,fontSize:e.fontSize,listStyle:`none`,"&-tail":{position:`absolute`,insetBlockStart:e.timeLineItemHeadSize,insetInlineStart:(e.timeLineItemHeadSize-e.timeLineItemTailWidth)/2,height:`calc(100% - ${e.timeLineItemHeadSize}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px ${e.lineType} ${e.colorSplit}`},"&-pending":{[`${t}-item-head`]:{fontSize:e.fontSizeSM,backgroundColor:`transparent`},[`${t}-item-tail`]:{display:`none`}},"&-head":{position:`absolute`,width:e.timeLineItemHeadSize,height:e.timeLineItemHeadSize,backgroundColor:e.colorBgContainer,border:`${e.timeLineHeadBorderWidth}px ${e.lineType} transparent`,borderRadius:`50%`,"&-blue":{color:e.colorPrimary,borderColor:e.colorPrimary},"&-red":{color:e.colorError,borderColor:e.colorError},"&-green":{color:e.colorSuccess,borderColor:e.colorSuccess},"&-gray":{color:e.colorTextDisabled,borderColor:e.colorTextDisabled}},"&-head-custom":{position:`absolute`,insetBlockStart:e.timeLineItemHeadSize/2,insetInlineStart:e.timeLineItemHeadSize/2,width:`auto`,height:`auto`,marginBlockStart:0,paddingBlock:e.timeLineItemCustomHeadPaddingVertical,lineHeight:1,textAlign:`center`,border:0,borderRadius:0,transform:`translate(-50%, -50%)`},"&-content":{position:`relative`,insetBlockStart:-(e.fontSize*e.lineHeight-e.fontSize)+e.lineWidth,marginInlineStart:e.margin+e.timeLineItemHeadSize,marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:`break-word`},"&-last":{[`> ${t}-item-tail`]:{display:`none`},[`> ${t}-item-content`]:{minHeight:e.controlHeightLG*1.2}}},[`&${t}-alternate, + &${t}-right, + &${t}-label`]:{[`${t}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:`50%`},"&-head":{marginInlineStart:`-${e.marginXXS}px`,"&-custom":{marginInlineStart:e.timeLineItemTailWidth/2}},"&-left":{[`${t}-item-content`]:{insetInlineStart:`calc(50% - ${e.marginXXS}px)`,width:`calc(50% - ${e.marginSM}px)`,textAlign:`start`}},"&-right":{[`${t}-item-content`]:{width:`calc(50% - ${e.marginSM}px)`,margin:0,textAlign:`end`}}}},[`&${t}-right`]:{[`${t}-item-right`]:{[`${t}-item-tail, + ${t}-item-head, + ${t}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(e.timeLineItemHeadSize+e.timeLineItemTailWidth)/2}px)`},[`${t}-item-content`]:{width:`calc(100% - ${e.timeLineItemHeadSize+e.marginXS}px)`}}},[`&${t}-pending + ${t}-item-last + ${t}-item-tail`]:{display:`block`,height:`calc(100% - ${e.margin}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px dotted ${e.colorSplit}`},[`&${t}-reverse + ${t}-item-last + ${t}-item-tail`]:{display:`none`},[`&${t}-reverse ${t}-item-pending`]:{[`${t}-item-tail`]:{insetBlockStart:e.margin,display:`block`,height:`calc(100% - ${e.margin}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px dotted ${e.colorSplit}`},[`${t}-item-content`]:{minHeight:e.controlHeightLG*1.2}},[`&${t}-label`]:{[`${t}-item-label`]:{position:`absolute`,insetBlockStart:-(e.fontSize*e.lineHeight-e.fontSize)+e.timeLineItemTailWidth,width:`calc(50% - ${e.marginSM}px)`,textAlign:`end`},[`${t}-item-right`]:{[`${t}-item-label`]:{insetInlineStart:`calc(50% + ${e.marginSM}px)`,width:`calc(50% - ${e.marginSM}px)`,textAlign:`start`}}},"&-rtl":{direction:`rtl`,[`${t}-item-head-custom`]:{transform:`translate(50%, -50%)`}}})}},iY=v(`Timeline`,e=>[rY(B(e,{timeLineItemPaddingBottom:e.padding*1.25,timeLineItemHeadSize:10,timeLineItemCustomHeadPaddingVertical:e.paddingXXS,timeLinePaddingInlineEnd:2,timeLineItemTailWidth:e.lineWidthBold,timeLineHeadBorderWidth:e.wireframe?e.lineWidthBold:e.lineWidth*3}))]),aY=u({compatConfig:{MODE:3},name:`ATimeline`,inheritAttrs:!1,props:Zn({prefixCls:String,pending:f.any,pendingDot:f.any,reverse:Q(),mode:f.oneOf(m(`left`,`alternate`,`right`,``))},{reverse:!1,mode:``}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`timeline`,e),[o,s]=iY(i),c=(t,n)=>{let r=t.props||{};return e.mode===`alternate`?r.position===`right`?`${i.value}-item-right`:r.position===`left`||n%2==0?`${i.value}-item-left`:`${i.value}-item-right`:e.mode===`left`?`${i.value}-item-left`:e.mode===`right`||r.position===`right`?`${i.value}-item-right`:``};return()=>{let{pending:t=n.pending?.call(n),pendingDot:l=n.pendingDot?.call(n),reverse:u,mode:d}=e,f=typeof t==`boolean`?null:t,p=dt(n.default?.call(n)),m=t?U(nY,{pending:!!t,dot:l||U(qt,null,null)},{default:()=>[f]}):null;m&&p.push(m);let h=u?p.reverse():p,g=h.length,_=`${i.value}-item-last`,v=h.map((e,n)=>{let r=n===g-2?_:``,i=n===g-1?_:``;return it(e,{class:K([!u&&t?r:i,c(e,n)])})}),y=h.some(e=>!!(e.props?.label||e.children?.label)),b=K(i.value,{[`${i.value}-pending`]:!!t,[`${i.value}-reverse`]:!!u,[`${i.value}-${d}`]:!!d&&!y,[`${i.value}-label`]:y,[`${i.value}-rtl`]:a.value===`rtl`},r.class,s.value);return o(U(`ul`,Y(Y({},r),{},{class:b}),[v]))}}});aY.Item=nY,aY.install=function(e){return e.component(aY.name,aY),e.component(nY.name,nY),e};var oY=aY,sY={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z`}}]},name:`enter`,theme:`outlined`};function cY(e){for(var t=1;t{let{sizeMarginHeadingVerticalEnd:i,fontWeightStrong:a}=r;return{marginBottom:i,color:n,fontWeight:a,fontSize:e,lineHeight:t}},fY=e=>{let t=[1,2,3,4,5],n={};return t.forEach(t=>{n[` + h${t}&, + div&-h${t}, + div&-h${t} > textarea, + h${t} + `]=dY(e[`fontSizeHeading${t}`],e[`lineHeightHeading${t}`],e.colorTextHeading,e)}),n},pY=e=>{let{componentCls:t}=e;return{"a&, a":Z(Z({},Lr(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,"&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:`none`}}})}},mY=()=>({code:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.2em 0.1em`,fontSize:`85%`,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3},kbd:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.15em 0.1em`,fontSize:`90%`,background:`rgba(150, 150, 150, 0.06)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:w[2]},"u, ins":{textDecoration:`underline`,textDecorationSkipInk:`auto`},"s, del":{textDecoration:`line-through`},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:`0 1em`,padding:0,li:{marginInline:`20px 0`,marginBlock:0,paddingInline:`4px 0`,paddingBlock:0}},ul:{listStyleType:`circle`,ul:{listStyleType:`disc`}},ol:{listStyleType:`decimal`},"pre, blockquote":{margin:`1em 0`},pre:{padding:`0.4em 0.6em`,whiteSpace:`pre-wrap`,wordWrap:`break-word`,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3,code:{display:`inline`,margin:0,padding:0,fontSize:`inherit`,fontFamily:`inherit`,background:`transparent`,border:0}},blockquote:{paddingInline:`0.6em 0`,paddingBlock:0,borderInlineStart:`4px solid rgba(100, 100, 100, 0.2)`,opacity:.85}}),hY=e=>{let{componentCls:t}=e,n=qT(e).inputPaddingVertical+1;return{"&-edit-content":{position:`relative`,"div&":{insetInlineStart:-e.paddingSM,marginTop:-n,marginBottom:`calc(1em - ${n}px)`},[`${t}-edit-content-confirm`]:{position:`absolute`,insetInlineEnd:e.marginXS+2,insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:`normal`,fontSize:e.fontSize,fontStyle:`normal`,pointerEvents:`none`},textarea:{margin:`0!important`,MozTransition:`none`,height:`1em`}}}},gY=e=>({"&-copy-success":{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}}}),_Y=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:`inline-block`,maxWidth:`100%`},"&-single-line":{whiteSpace:`nowrap`},"&-ellipsis-single-line":{overflow:`hidden`,textOverflow:`ellipsis`,"a&, span&":{verticalAlign:`bottom`}},"&-ellipsis-multiple-line":{display:`-webkit-box`,overflow:`hidden`,WebkitLineClamp:3,WebkitBoxOrient:`vertical`}}),vY=e=>{let{componentCls:t,sizeMarginHeadingVerticalStart:n}=e;return{[t]:Z(Z(Z(Z(Z(Z(Z(Z(Z({color:e.colorText,wordBreak:`break-word`,lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccess},[`&${t}-warning`]:{color:e.colorWarning},[`&${t}-danger`]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,userSelect:`none`},"\n div&,\n p\n ":{marginBottom:`1em`}},fY(e)),{[` + & + h1${t}, + & + h2${t}, + & + h3${t}, + & + h4${t}, + & + h5${t} + `]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),mY()),pY(e)),{[` + ${t}-expand, + ${t}-edit, + ${t}-copy + `]:Z(Z({},Lr(e)),{marginInlineStart:e.marginXXS})}),hY(e)),gY(e)),_Y()),{"&-rtl":{direction:`rtl`}})}},yY=v(`Typography`,e=>[vY(e)],{sizeMarginHeadingVerticalStart:`1.2em`,sizeMarginHeadingVerticalEnd:`0.5em`}),bY=u({compatConfig:{MODE:3},name:`Editable`,inheritAttrs:!1,props:{prefixCls:String,value:String,maxlength:Number,autoSize:{type:[Boolean,Object]},onSave:Function,onCancel:Function,onEnd:Function,onChange:Function,originContent:String,direction:String,component:String},setup(e,t){let{emit:n,slots:r,attrs:i}=t,{prefixCls:a}=Ft(e),o=Ne({current:e.value||``,lastKeyCode:void 0,inComposition:!1,cancelFlag:!1});G(()=>e.value,e=>{o.current=e});let s=H();V(()=>{if(s.value){let e=s.value?.resizableTextArea?.textArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}});function c(e){s.value=e}function l(e){let{target:{value:t}}=e;o.current=t.replace(/[\r\n]/g,``),n(`change`,o.current)}function u(){o.inComposition=!0}function d(){o.inComposition=!1}function f(e){let{keyCode:t}=e;t===$.ENTER&&e.preventDefault(),!o.inComposition&&(o.lastKeyCode=t)}function p(t){let{keyCode:r,ctrlKey:i,altKey:a,metaKey:s,shiftKey:c}=t;o.lastKeyCode===r&&!o.inComposition&&!i&&!a&&!s&&!c&&(r===$.ENTER?(h(),n(`end`)):r===$.ESC&&(o.current=e.originContent,n(`cancel`)))}function m(){h()}function h(){n(`save`,o.current.trim())}let[g,_]=yY(a);return()=>{let t=K({[`${a.value}`]:!0,[`${a.value}-edit-content`]:!0,[`${a.value}-rtl`]:e.direction===`rtl`,[e.component?`${a.value}-${e.component}`:``]:!0},i.class,_.value);return g(U(`div`,Y(Y({},i),{},{class:t}),[U(nI,{ref:c,maxlength:e.maxlength,value:o.current,onChange:l,onKeydown:f,onKeyup:p,onCompositionstart:u,onCompositionend:d,onBlur:m,rows:1,autoSize:e.autoSize===void 0||e.autoSize},null),r.enterIcon?r.enterIcon({className:`${e.prefixCls}-edit-content-confirm`}):U(uY,{class:`${e.prefixCls}-edit-content-confirm`},null)]))}}}),xY=3,SY=8,CY,wY={padding:0,margin:0,display:`inline`,lineHeight:`inherit`};function TY(e,t){e.setAttribute(`aria-hidden`,`true`);let n=ju(window.getComputedStyle(t));e.setAttribute(`style`,n),e.style.position=`fixed`,e.style.left=`0`,e.style.height=`auto`,e.style.minHeight=`auto`,e.style.maxHeight=`auto`,e.style.paddingTop=`0`,e.style.paddingBottom=`0`,e.style.borderTopWidth=`0`,e.style.borderBottomWidth=`0`,e.style.top=`-999999px`,e.style.zIndex=`-1000`,e.style.textOverflow=`clip`,e.style.whiteSpace=`normal`,e.style.webkitLineClamp=`none`}function EY(e){let t=document.createElement(`div`);TY(t,e),t.appendChild(document.createTextNode(`text`)),document.body.appendChild(t);let n=t.getBoundingClientRect().height;return document.body.removeChild(t),n}var DY=((e,t,n,r,i)=>{CY||(CY=document.createElement(`div`),CY.setAttribute(`aria-hidden`,`true`),document.body.appendChild(CY));let{rows:a,suffix:o=``}=t,s=EY(e),c=Math.round(s*a*100)/100;TY(CY,e);let l=Rt({render(){return U(`div`,{style:wY},[U(`span`,{style:wY},[n,o]),U(`span`,{style:wY},[r])])}});l.mount(CY);function u(){return Math.round(CY.getBoundingClientRect().height*100)/100-.1<=c}if(u())return l.unmount(),{content:n,text:CY.innerHTML,ellipsis:!1};let d=Array.prototype.slice.apply(CY.childNodes[0].childNodes[0].cloneNode(!0).childNodes).filter(e=>{let{nodeType:t,data:n}=e;return t!==SY&&n!==``}),f=Array.prototype.slice.apply(CY.childNodes[0].childNodes[1].cloneNode(!0).childNodes);l.unmount();let p=[];CY.innerHTML=``;let m=document.createElement(`span`);CY.appendChild(m);let h=document.createTextNode(i+o);m.appendChild(h),f.forEach(e=>{CY.appendChild(e)});function g(e){m.insertBefore(e,h)}function _(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.length,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=Math.floor((n+r)/2);if(e.textContent=t.slice(0,a),n>=r-1)for(let i=r;i>=n;--i){let n=t.slice(0,i);if(e.textContent=n,u()||!n)return i===t.length?{finished:!1,vNode:t}:{finished:!0,vNode:n}}return u()?_(e,t,a,r,a):_(e,t,n,a,i)}function v(e){if(e.nodeType===xY){let t=e.textContent||``,n=document.createTextNode(t);return g(n),_(n,t)}return{finished:!1,vNode:null}}return d.some(e=>{let{finished:t,vNode:n}=v(e);return n&&p.push(n),t}),{content:p,text:CY.innerHTML,ellipsis:!0}}),OY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=Z(Z({},e),r),{prefixCls:c,direction:l,component:u=`article`}=t,d=OY(t,[`prefixCls`,`direction`,`component`]);return o(U(u,Y(Y({},d),{},{class:K(i.value,{[`${i.value}-rtl`]:a.value===`rtl`},r.class,s.value)}),{default:()=>[n.default?.call(n)]}))}}}),AY=()=>{let e=document.getSelection();if(!e.rangeCount)return function(){};let t=document.activeElement,n=[];for(let t=0;t({editable:{type:[Boolean,Object],default:void 0},copyable:{type:[Boolean,Object],default:void 0},prefixCls:String,component:String,type:String,disabled:{type:Boolean,default:void 0},ellipsis:{type:[Boolean,Object],default:void 0},code:{type:Boolean,default:void 0},mark:{type:Boolean,default:void 0},underline:{type:Boolean,default:void 0},delete:{type:Boolean,default:void 0},strong:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},content:String,"onUpdate:content":Function}),WY=u({compatConfig:{MODE:3},name:`TypographyBase`,inheritAttrs:!1,props:UY(),setup(t,n){let{slots:r,attrs:i,emit:a}=n,{prefixCls:o,direction:s}=X(`typography`,t),c=Ne({copied:!1,ellipsisText:``,ellipsisContent:null,isEllipsis:!1,expanded:!1,clientRendered:!1,expandStr:``,copyStr:``,copiedStr:``,editStr:``,copyId:void 0,rafId:void 0,prevProps:void 0,originContent:``}),l=H(),u=H(),d=J(()=>{let e=t.ellipsis;return e?Z({rows:1,expandable:!1},typeof e==`object`?e:null):{}});V(()=>{c.clientRendered=!0,E()}),ut(()=>{clearTimeout(c.copyId),ir.cancel(c.rafId)}),G([()=>d.value.rows,()=>t.content],()=>{z(()=>{w()})},{flush:`post`,deep:!0}),S(()=>{t.content===void 0&&(e(!t.editable,`Typography`,"When `editable` is enabled, please use `content` instead of children"),e(!t.ellipsis,`Typography`,"When `ellipsis` is enabled, please use `content` instead of children"))});function f(){return t.ellipsis||t.editable?t.content:ae(l.value)?.innerText}function p(e){let{onExpand:t}=d.value;c.expanded=!0,t?.(e)}function m(e){e.preventDefault(),c.originContent=t.content,C(!0)}function h(e){g(e),C(!1)}function g(e){let{onChange:n}=y.value;e!==t.content&&(a(`update:content`,e),n?.(e))}function _(){var e,t;(t=(e=y.value).onCancel)==null||t.call(e),C(!1)}function v(e){e.preventDefault(),e.stopPropagation();let{copyable:n}=t,r=Z({},typeof n==`object`?n:null);r.text===void 0&&(r.text=f()),PY(r.text||``),c.copied=!0,z(()=>{r.onCopy&&r.onCopy(e),c.copyId=setTimeout(()=>{c.copied=!1},3e3)})}let y=J(()=>{let e=t.editable;return e?Z({},typeof e==`object`?e:null):{editing:!1}}),[b,x]=df(!1,{value:J(()=>y.value.editing)});function C(e){let{onStart:t}=y.value;e&&t&&t(),x(e)}G(b,e=>{var t;e||(t=u.value)==null||t.focus()},{flush:`post`});function w(e){if(e){let{width:t,height:n}=e;if(!t||!n)return}ir.cancel(c.rafId),c.rafId=ir(()=>{E()})}let T=J(()=>{let{rows:e,expandable:n,suffix:r,onEllipsis:i,tooltip:a}=d.value;return r||a||t.editable||t.copyable||n||i?!1:e===1?VY:BY}),E=()=>{let{ellipsisText:e,isEllipsis:n}=c,{rows:r,suffix:i,onEllipsis:a}=d.value;if(!r||r<0||!ae(l.value)||c.expanded||t.content===void 0||T.value)return;let{content:o,text:s,ellipsis:u}=DY(ae(l.value),{rows:r,suffix:i},t.content,M(!0),HY);(e!==s||c.isEllipsis!==u)&&(c.ellipsisText=s,c.ellipsisContent=o,c.isEllipsis=u,n!==u&&a&&a(u))};function D(e,t){let{mark:n,code:r,underline:i,delete:a,strong:o,keyboard:s}=e,c=t;function l(e,t){if(!e)return;let n=function(){return c}();c=U(t,null,{default:()=>[n]})}return l(o,`strong`),l(i,`u`),l(a,`del`),l(r,`code`),l(n,`mark`),l(s,`kbd`),c}function O(e){let{expandable:t,symbol:n}=d.value;if(!t||!e&&(c.expanded||!c.isEllipsis))return null;let i=(r.ellipsisSymbol?r.ellipsisSymbol():n)||c.expandStr;return U(`a`,{key:`expand`,class:`${o.value}-expand`,onClick:p,"aria-label":c.expandStr},[i])}function k(){if(!t.editable)return;let{tooltip:e,triggerType:n=[`icon`]}=t.editable,i=r.editableIcon?r.editableIcon():U(ln,{role:`button`},null),a=r.editableTooltip?r.editableTooltip():c.editStr,s=typeof a==`string`?a:``;return n.indexOf(`icon`)===-1?null:U(Ty,{key:`edit`,title:e===!1?``:a},{default:()=>[U(JB,{ref:u,class:`${o.value}-edit`,onClick:m,"aria-label":s},{default:()=>[i]})]})}function A(){if(!t.copyable)return;let{tooltip:e}=t.copyable,n=c.copied?c.copiedStr:c.copyStr,i=r.copyableTooltip?r.copyableTooltip({copied:c.copied}):n,a=typeof i==`string`?i:``,s=c.copied?U(Df,null,null):U(RY,null,null),l=r.copyableIcon?r.copyableIcon({copied:!!c.copied}):s;return U(Ty,{key:`copy`,title:e===!1?``:i},{default:()=>[U(JB,{class:[`${o.value}-copy`,{[`${o.value}-copy-success`]:c.copied}],onClick:v,"aria-label":a},{default:()=>[l]})]})}function j(){let{class:e,style:n}=i,{maxlength:a,autoSize:l,onEnd:u}=y.value;return U(bY,{class:e,style:n,prefixCls:o.value,value:t.content,originContent:c.originContent,maxlength:a,autoSize:l,onSave:h,onChange:g,onCancel:_,onEnd:u,direction:s.value,component:t.component},{enterIcon:r.editableEnterIcon})}function M(e){return[O(e),k(),A()].filter(e=>e)}return()=>{let{triggerType:e=[`icon`]}=y.value,n=t.ellipsis||t.editable?t.content===void 0?r.default?.call(r):t.content:r.default?r.default():t.content;return b.value?j():U(Ke,{componentName:`Text`,children:a=>{let u=Z(Z({},t),i),{type:f,disabled:p,content:h,class:g,style:_}=u,v=zY(u,[`type`,`disabled`,`content`,`class`,`style`]),{rows:y,suffix:b,tooltip:x}=d.value,{edit:S,copy:C,copied:E,expand:O}=a;c.editStr=S,c.copyStr=C,c.copiedStr=E,c.expandStr=O;let k=Br(v,[`prefixCls`,`editable`,`copyable`,`ellipsis`,`mark`,`code`,`delete`,`underline`,`strong`,`keyboard`,`onUpdate:content`]),A=T.value,j=y===1&&A,N=y&&y>1&&A,P=n;if(y&&c.isEllipsis&&!c.expanded&&!A){let{title:e}=v,t=e||``;!e&&(typeof n==`string`||typeof n==`number`)&&(t=String(n)),t=t?.slice(String(c.ellipsisContent||``).length),P=U($e,null,[Ht(c.ellipsisContent),U(`span`,{title:t,"aria-hidden":`true`},[HY]),b])}else P=U($e,null,[n,b]);P=D(t,P);let F=x&&y&&c.isEllipsis&&!c.expanded&&!A,I=r.ellipsisTooltip?r.ellipsisTooltip():x;return U(Qn,{onResize:w,disabled:!y},{default:()=>[U(kY,Y({ref:l,class:[{[`${o.value}-${f}`]:f,[`${o.value}-disabled`]:p,[`${o.value}-ellipsis`]:y,[`${o.value}-single-line`]:y===1&&!c.isEllipsis,[`${o.value}-ellipsis-single-line`]:j,[`${o.value}-ellipsis-multiple-line`]:N},g],style:Z(Z({},_),{WebkitLineClamp:N?y:void 0}),"aria-label":void 0,direction:s.value,onClick:e.indexOf(`text`)===-1?()=>{}:m},k),{default:()=>[F?U(Ty,{title:x===!0?n:I},{default:()=>[U(`span`,null,[P])]}):P,M()]})]})}},null)}}}),GY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iBr(Z(Z({},UY()),{ellipsis:{type:Boolean,default:void 0}}),[`component`]),qY=(t,n)=>{let{slots:r,attrs:i}=n,a=Z(Z({},t),i),{ellipsis:o,rel:s}=a,c=GY(a,[`ellipsis`,`rel`]);e(typeof o!=`object`,`Typography.Link`,"`ellipsis` only supports boolean value.");let l=Z(Z({},c),{rel:s===void 0&&c.target===`_blank`?`noopener noreferrer`:s,ellipsis:!!o,component:`a`});return delete l.navigate,U(WY,l,r)};qY.displayName=`ATypographyLink`,qY.inheritAttrs=!1,qY.props=KY();var JY=()=>Br(UY(),[`component`]),YY=(e,t)=>{let{slots:n,attrs:r}=t;return U(WY,Z(Z(Z({},e),{component:`div`}),r),n)};YY.displayName=`ATypographyParagraph`,YY.inheritAttrs=!1,YY.props=JY();var XY=()=>Z(Z({},Br(UY(),[`component`])),{ellipsis:{type:[Boolean,Object],default:void 0}}),ZY=(t,n)=>{let{slots:r,attrs:i}=n,{ellipsis:a}=t;return e(typeof a!=`object`||!a||!(`expandable`in a)&&!(`rows`in a),`Typography.Text`,"`ellipsis` do not support `expandable` or `rows` props."),U(WY,Z(Z(Z({},t),{ellipsis:a&&typeof a==`object`?Br(a,[`expandable`,`rows`]):a,component:`span`}),i),r)};ZY.displayName=`ATypographyText`,ZY.inheritAttrs=!1,ZY.props=XY();var QY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iZ(Z({},Br(UY(),[`component`,`strong`])),{level:Number}),tX=(t,n)=>{let{slots:r,attrs:i}=n,{level:a=1}=t,o=QY(t,[`level`]),s;return $Y.includes(a)?s=`h${a}`:(e(!1,`Typography`,"Title only accept `1 | 2 | 3 | 4 | 5` as `level` value."),s=`h1`),U(WY,Z(Z(Z({},o),{component:s}),i),r)};tX.displayName=`ATypographyTitle`,tX.inheritAttrs=!1,tX.props=eX(),kY.Text=ZY,kY.Title=tX,kY.Paragraph=YY,kY.Link=qY,kY.Base=WY,kY.install=function(e){return e.component(kY.name,kY),e.component(kY.Text.displayName,ZY),e.component(kY.Title.displayName,tX),e.component(kY.Paragraph.displayName,YY),e.component(kY.Link.displayName,qY),e};var nX=kY;function rX(e,t){let n=`cannot ${e.method} ${e.action} ${t.status}'`,r=Error(n);return r.status=t.status,r.method=e.method,r.url=e.action,r}function iX(e){let t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function aX(e){let t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});let n=new FormData;e.data&&Object.keys(e.data).forEach(t=>{let r=e.data[t];if(Array.isArray(r)){r.forEach(e=>{n.append(`${t}[]`,e)});return}n.append(t,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(rX(e,t),iX(t)):e.onSuccess(iX(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&`withCredentials`in t&&(t.withCredentials=!0);let r=e.headers||{};return r[`X-Requested-With`]!==null&&t.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),Object.keys(r).forEach(e=>{r[e]!==null&&t.setRequestHeader(e,r[e])}),t.send(n),{abort(){t.abort()}}}var oX=+new Date,sX=0;function cX(){return`vc-upload-${oX}-${++sX}`}var lX=((e,t)=>{if(e&&t){let n=Array.isArray(t)?t:t.split(`,`),r=e.name||``,i=e.type||``,a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if(t.charAt(0)===`.`){let e=r.toLowerCase(),n=t.toLowerCase(),i=[n];return(n===`.jpg`||n===`.jpeg`)&&(i=[`.jpg`,`.jpeg`]),i.some(t=>e.endsWith(t))}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,``):i===t?!0:/^\w+$/.test(t)?(`${t}`,!0):!1})}return!0});function uX(e,t){let n=e.createReader(),r=[];function i(){n.readEntries(e=>{let n=Array.prototype.slice.apply(e);r=r.concat(n),n.length?i():t(r)})}i()}var dX=(e,t,n)=>{let r=(e,i)=>{e.path=i||``,e.isFile?e.file(r=>{n(r)&&(e.fullPath&&!r.webkitRelativePath&&(Object.defineProperties(r,{webkitRelativePath:{writable:!0}}),r.webkitRelativePath=e.fullPath.replace(/^\//,``),Object.defineProperties(r,{webkitRelativePath:{writable:!1}})),t([r]))}):e.isDirectory&&uX(e,t=>{t.forEach(t=>{r(t,`${i}${e.name}/`)})})};e.forEach(e=>{r(e.webkitGetAsEntry())})},fX=()=>({capture:[Boolean,String],multipart:{type:Boolean,default:void 0},name:String,disabled:{type:Boolean,default:void 0},componentTag:String,action:[String,Function],method:String,directory:{type:Boolean,default:void 0},data:[Object,Function],headers:Object,accept:String,multiple:{type:Boolean,default:void 0},onBatchStart:Function,onReject:Function,onStart:Function,onError:Function,onSuccess:Function,onProgress:Function,beforeUpload:Function,customRequest:Function,withCredentials:{type:Boolean,default:void 0},openFileDialogOnClick:{type:Boolean,default:void 0},prefixCls:String,id:String,onMouseenter:Function,onMouseleave:Function,onClick:Function}),pX=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},mX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ipX(this,void 0,void 0,function*(){let{beforeUpload:r}=e,i=t;if(r){try{i=yield r(t,n)}catch{i=!1}if(i===!1)return{origin:t,parsedFile:null,action:null,data:null}}let{action:a}=e,o;o=typeof a==`function`?yield a(t):a;let{data:s}=e,c;c=typeof s==`function`?yield s(t):s;let l=(typeof i==`object`||typeof i==`string`)&&i?i:t,u;u=l instanceof File?l:new File([l],t.name,{type:t.type});let d=u;return d.uid=t.uid,{origin:t,data:c,parsedFile:d,action:o}}),u=t=>{let{data:n,origin:r,action:i,parsedFile:a}=t;if(!c)return;let{onStart:s,customRequest:l,name:u,headers:d,withCredentials:f,method:p}=e,{uid:m}=r,h=l||aX,g={action:i,filename:u,data:n,file:a,headers:d,withCredentials:f,method:p||`post`,onProgress:t=>{let{onProgress:n}=e;n?.(t,a)},onSuccess:(t,n)=>{let{onSuccess:r}=e;r?.(t,a,n),delete o[m]},onError:(t,n)=>{let{onError:r}=e;r?.(t,n,a),delete o[m]}};s(r),o[m]=h(g)},d=()=>{a.value=cX()},f=e=>{if(e){let t=e.uid?e.uid:e;o[t]&&o[t].abort&&o[t].abort(),delete o[t]}else Object.keys(o).forEach(e=>{o[e]&&o[e].abort&&o[e].abort(),delete o[e]})};V(()=>{c=!0}),ut(()=>{c=!1,f()});let p=t=>{let n=[...t],r=n.map(e=>(e.uid=cX(),l(e,n)));Promise.all(r).then(t=>{let{onBatchStart:n}=e;n?.(t.map(e=>{let{origin:t,parsedFile:n}=e;return{file:t,parsedFile:n}})),t.filter(e=>e.parsedFile!==null).forEach(e=>{u(e)})})},m=t=>{let{accept:n,directory:r}=e,{files:i}=t.target,a=[...i].filter(e=>!r||lX(e,n));p(a),d()},h=t=>{let n=s.value;if(!n)return;let{onClick:r}=e;n.click(),r&&r(t)},g=e=>{e.key===`Enter`&&h(e)},_=t=>{let{multiple:n}=e;if(t.preventDefault(),t.type!==`dragover`)if(e.directory)dX(Array.prototype.slice.call(t.dataTransfer.items),p,t=>lX(t,e.accept));else{let r=t_(Array.prototype.slice.call(t.dataTransfer.files),t=>lX(t,e.accept)),i=r[0],a=r[1];n===!1&&(i=i.slice(0,1)),p(i),a.length&&e.onReject&&e.onReject(a)}};return i({abort:f}),()=>{let{componentTag:t,prefixCls:i,disabled:o,id:c,multiple:l,accept:u,capture:d,directory:f,openFileDialogOnClick:p,onMouseenter:v,onMouseleave:y}=e,b=mX(e,[`componentTag`,`prefixCls`,`disabled`,`id`,`multiple`,`accept`,`capture`,`directory`,`openFileDialogOnClick`,`onMouseenter`,`onMouseleave`]),x={[i]:!0,[`${i}-disabled`]:o,[r.class]:!!r.class},S=f?{directory:`directory`,webkitdirectory:`webkitdirectory`}:{};return U(t,Y(Y({},o?{}:{onClick:p?h:()=>{},onKeydown:p?g:()=>{},onMouseenter:v,onMouseleave:y,onDrop:_,onDragover:_,tabindex:`0`}),{},{class:x,role:`button`,style:r.style}),{default:()=>[U(`input`,Y(Y(Y({},Bu(b,{aria:!0,data:!0})),{},{id:c,type:`file`,ref:s,onClick:e=>e.stopPropagation(),onCancel:e=>e.stopPropagation(),key:a.value,style:{display:`none`},accept:u},S),{},{multiple:l,onChange:m},d==null?{}:{capture:d}),null),n.default?.call(n)]})}}});function gX(){}var _X=u({compatConfig:{MODE:3},name:`Upload`,inheritAttrs:!1,props:Zn(fX(),{componentTag:`span`,prefixCls:`rc-upload`,data:{},headers:{},name:`file`,multipart:!1,onStart:gX,onError:gX,onSuccess:gX,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0}),setup(e,t){let{slots:n,attrs:r,expose:i}=t,a=H();return i({abort:e=>{var t;(t=a.value)==null||t.abort(e)}}),()=>U(hX,Y(Y(Y({},e),r),{},{ref:a}),n)}}),vX={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z`}}]},name:`paper-clip`,theme:`outlined`};function yX(e){for(var t=1;t{let{uid:n}=t;return n===e.uid});return r===-1?n.push(e):n[r]=e,n}function PX(e,t){let n=e.uid===void 0?`name`:`uid`;return t.filter(t=>t[n]===e[n])[0]}function FX(e,t){let n=e.uid===void 0?`name`:`uid`,r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}var IX=function(){let e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:``).split(`/`),t=e[e.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(t)||[``])[0]},LX=e=>e.indexOf(`image/`)===0,RX=e=>{if(e.type&&!e.thumbUrl)return LX(e.type);let t=e.thumbUrl||e.url||``,n=IX(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(n)?!0:!(/^data:/.test(t)||n)},zX=200;function BX(e){return new Promise(t=>{if(!e.type||!LX(e.type)){t(``);return}let n=document.createElement(`canvas`);n.width=zX,n.height=zX,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${zX}px; height: ${zX}px; z-index: 9999; display: none;`,document.body.appendChild(n);let r=n.getContext(`2d`),i=new Image;if(i.onload=()=>{let{width:e,height:a}=i,o=zX,s=zX,c=0,l=0;e>a?(s=zX/e*a,l=-(s-o)/2):(o=zX/a*e,c=-(o-s)/2),r.drawImage(i,c,l,o,s);let u=n.toDataURL();document.body.removeChild(n),t(u)},i.crossOrigin=`anonymous`,e.type.startsWith(`image/svg+xml`)){let t=new FileReader;t.addEventListener(`load`,()=>{t.result&&(i.src=t.result)}),t.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var VX={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`download`,theme:`outlined`};function HX(e){for(var t=1;t{a.value=setTimeout(()=>{i.value=!0},300)}),ut(()=>{clearTimeout(a.value)});let o=q(e.file?.status);G(()=>e.file?.status,e=>{e!==`removed`&&(o.value=e)});let{rootPrefixCls:s}=X(`upload`,e),c=J(()=>ge(`${s.value}-fade`));return()=>{let{prefixCls:t,locale:a,listType:s,file:l,items:u,progress:d,iconRender:f=n.iconRender,actionIconRender:p=n.actionIconRender,itemRender:m=n.itemRender,isImgUrl:h,showPreviewIcon:g,showRemoveIcon:_,showDownloadIcon:v,previewIcon:y=n.previewIcon,removeIcon:b=n.removeIcon,downloadIcon:x=n.downloadIcon,onPreview:S,onDownload:C,onClose:w}=e,{class:T,style:E}=r,D=f({file:l}),O=U(`div`,{class:`${t}-text-icon`},[D]);if(s===`picture`||s===`picture-card`)if(o.value===`uploading`||!l.thumbUrl&&!l.url)O=U(`div`,{class:{[`${t}-list-item-thumbnail`]:!0,[`${t}-list-item-file`]:o.value!==`uploading`}},[D]);else{let e=h?.(l)?U(`img`,{src:l.thumbUrl||l.url,alt:l.name,class:`${t}-list-item-image`,crossorigin:l.crossOrigin},null):D;O=U(`a`,{class:{[`${t}-list-item-thumbnail`]:!0,[`${t}-list-item-file`]:h&&!h(l)},onClick:e=>S(l,e),href:l.url||l.thumbUrl,target:`_blank`,rel:`noopener noreferrer`},[e])}let k={[`${t}-list-item`]:!0,[`${t}-list-item-${o.value}`]:!0},A=typeof l.linkProps==`string`?JSON.parse(l.linkProps):l.linkProps,j=_?p({customIcon:b?b({file:l}):U(sn,null,null),callback:()=>w(l),prefixCls:t,title:a.removeFile}):null,M=v&&o.value===`done`?p({customIcon:x?x({file:l}):U(WX,null,null),callback:()=>C(l),prefixCls:t,title:a.downloadFile}):null,N=s!==`picture-card`&&U(`span`,{key:`download-delete`,class:[`${t}-list-item-actions`,{picture:s===`picture`}]},[M,j]),P=`${t}-list-item-name`,F=l.url?[U(`a`,Y(Y({key:`view`,target:`_blank`,rel:`noopener noreferrer`,class:P,title:l.name},A),{},{href:l.url,onClick:e=>S(l,e)}),[l.name]),N]:[U(`span`,{key:`view`,class:P,onClick:e=>S(l,e),title:l.name},[l.name]),N],I=g?U(`a`,{href:l.url||l.thumbUrl,target:`_blank`,rel:`noopener noreferrer`,style:l.url||l.thumbUrl?void 0:{pointerEvents:`none`,opacity:.5},onClick:e=>S(l,e),title:a.previewFile},[y?y({file:l}):U(oI,null,null)]):null,L=s===`picture-card`&&o.value!==`uploading`&&U(`span`,{class:`${t}-list-item-actions`},[I,o.value===`done`&&M,j]),ee=U(`div`,{class:k},[O,F,L,i.value&&U(Re,c.value,{default:()=>[Mt(U(`div`,{class:`${t}-list-item-progress`},[`percent`in l?U(zV,Y(Y({},d),{},{type:`line`,percent:l.percent}),null):null]),[[ht,o.value===`uploading`]])]})]),te={[`${t}-list-item-container`]:!0,[`${T}`]:!!T},ne=l.response&&typeof l.response==`string`?l.response:l.error?.statusText||l.error?.message||a.uploadError,R=o.value===`error`?U(Ty,{title:ne,getPopupContainer:e=>e.parentNode},{default:()=>[ee]}):ee;return U(`div`,{class:te,style:E},[m?m({originNode:R,file:l,fileList:u,actions:{download:C.bind(null,l),preview:S.bind(null,l),remove:w.bind(null,l)}}):R])}}}),KX=(e,t)=>{let{slots:n}=t;return dt(n.default?.call(n))[0]},qX=u({compatConfig:{MODE:3},name:`AUploadList`,props:Zn(jX(),{listType:`text`,progress:{strokeWidth:2,showInfo:!1},showRemoveIcon:!0,showDownloadIcon:!1,showPreviewIcon:!0,previewFile:BX,isImageUrl:RX,items:[],appendActionVisible:!0}),setup(e,t){let{slots:n,expose:r}=t,i=q(!1);V(()=>{i.value});let a=q([]);G(()=>e.items,function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.value=e.slice()},{immediate:!0,deep:!0}),S(()=>{if(e.listType!==`picture`&&e.listType!==`picture-card`)return;let t=!1;(e.items||[]).forEach((n,r)=>{typeof document>`u`||typeof window>`u`||!window.FileReader||!window.File||!(n.originFileObj instanceof File||n.originFileObj instanceof Blob)||n.thumbUrl!==void 0||(n.thumbUrl=``,e.previewFile&&e.previewFile(n.originFileObj).then(e=>{let i=e||``;i!==n.thumbUrl&&(a.value[r].thumbUrl=i,t=!0)}))}),t&&st(a)});let o=(t,n)=>{if(e.onPreview)return n?.preventDefault(),e.onPreview(t)},s=t=>{typeof e.onDownload==`function`?e.onDownload(t):t.url&&window.open(t.url)},c=t=>{var n;(n=e.onRemove)==null||n.call(e,t)},u=t=>{let{file:r}=t,i=e.iconRender||n.iconRender;if(i)return i({file:r,listType:e.listType});let a=r.status===`uploading`,o=e.isImageUrl&&e.isImageUrl(r)?U(TX,null,null):U(kX,null,null),s=U(a?qt:xX,null,null);return e.listType===`picture`?s=a?U(qt,null,null):o:e.listType===`picture-card`&&(s=a?e.locale.uploading:o),s},d=e=>{let{customIcon:t,callback:n,prefixCls:r,title:i}=e,a={type:`text`,size:`small`,title:i,onClick:()=>{n()},class:`${r}-list-item-action`};return Nt(t)?U(Qb,a,{icon:()=>t}):U(Qb,a,{default:()=>[U(`span`,null,[t])]})};r({handlePreview:o,handleDownload:s});let{prefixCls:f,rootPrefixCls:p}=X(`upload`,e),m=J(()=>({[`${f.value}-list`]:!0,[`${f.value}-list-${e.listType}`]:!0})),h=J(()=>{let t=Z({},aS(`${p.value}-motion-collapse`));delete t.onAfterAppear,delete t.onAfterEnter,delete t.onAfterLeave;let n=Z(Z({},l(`${f.value}-${e.listType===`picture-card`?`animate-inline`:`animate`}`)),{class:m.value,appear:i.value});return e.listType===`picture-card`?n:Z(Z({},t),n)});return()=>{let{listType:t,locale:r,isImageUrl:i,showPreviewIcon:l,showRemoveIcon:p,showDownloadIcon:m,removeIcon:g,previewIcon:_,downloadIcon:v,progress:y,appendAction:b,itemRender:x,appendActionVisible:S}=e,C=b?.(),w=a.value;return U(Tt,Y(Y({},h.value),{},{tag:`div`}),{default:()=>[w.map(e=>{let{uid:a}=e;return U(GX,{key:a,locale:r,prefixCls:f.value,file:e,items:w,progress:y,listType:t,isImgUrl:i,showPreviewIcon:l,showRemoveIcon:p,showDownloadIcon:m,onPreview:o,onDownload:s,onClose:c,removeIcon:g,previewIcon:_,downloadIcon:v,itemRender:x},Z(Z({},n),{iconRender:u,actionIconRender:d}))}),b?Mt(U(KX,{key:`__ant_upload_appendAction`},{default:()=>C}),[[ht,!!S]]):null]})}}}),JX=e=>{let{componentCls:t,iconCls:n}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:`relative`,width:`100%`,height:`100%`,textAlign:`center`,background:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:`pointer`,transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:`${e.padding}px 0`},[`${t}-btn`]:{display:`table`,width:`100%`,height:`100%`,outline:`none`},[`${t}-drag-container`]:{display:`table-cell`,verticalAlign:`middle`},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${e.marginXXS}px`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{cursor:`not-allowed`,[`p${t}-drag-icon ${n}, + p${t}-text, + p${t}-hint + `]:{color:e.colorTextDisabled}}}}}},YX=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSize:i,lineHeight:a}=e,o=`${t}-list-item`,s=`${o}-actions`,c=`${o}-action`,l=Math.round(i*a);return{[`${t}-wrapper`]:{[`${t}-list`]:Z(Z({},D()),{lineHeight:e.lineHeight,[o]:{position:`relative`,height:e.lineHeight*i,marginTop:e.marginXS,fontSize:i,display:`flex`,alignItems:`center`,transition:`background-color ${e.motionDurationSlow}`,"&:hover":{backgroundColor:e.controlItemBgHover},[`${o}-name`]:Z(Z({},xe),{padding:`0 ${e.paddingXS}px`,lineHeight:a,flex:`auto`,transition:`all ${e.motionDurationSlow}`}),[s]:{[c]:{opacity:0},[`${c}${n}-btn-sm`]:{height:l,border:0,lineHeight:1,"> span":{transform:`scale(1)`}},[` + ${c}:focus, + &.picture ${c} + `]:{opacity:1},[r]:{color:e.colorTextDescription,transition:`all ${e.motionDurationSlow}`},[`&:hover ${r}`]:{color:e.colorText}},[`${t}-icon ${r}`]:{color:e.colorTextDescription,fontSize:i},[`${o}-progress`]:{position:`absolute`,bottom:-e.uploadProgressOffset,width:`100%`,paddingInlineStart:i+e.paddingXS,fontSize:i,lineHeight:0,pointerEvents:`none`,"> div":{margin:0}}},[`${o}:hover ${c}`]:{opacity:1,color:e.colorText},[`${o}-error`]:{color:e.colorError,[`${o}-name, ${t}-icon ${r}`]:{color:e.colorError},[s]:{[`${r}, ${r}:hover`]:{color:e.colorError},[c]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:`table`,width:0,height:0,content:`""`}}})}}},XX=new N(`uploadAnimateInlineIn`,{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),ZX=new N(`uploadAnimateInlineOut`,{to:{width:0,height:0,margin:0,padding:0,opacity:0}}),QX=e=>{let{componentCls:t}=e,n=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${n}-appear, ${n}-enter, ${n}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:`forwards`},[`${n}-appear, ${n}-enter`]:{animationName:XX},[`${n}-leave`]:{animationName:ZX}}},XX,ZX]},$X=e=>{let{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:i}=e,a=`${t}-list`,o=`${a}-item`;return{[`${t}-wrapper`]:{[`${a}${a}-picture, ${a}${a}-picture-card`]:{[o]:{position:`relative`,height:r+e.lineWidth*2+e.paddingXS*2,padding:e.paddingXS,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:`transparent`},[`${o}-thumbnail`]:Z(Z({},xe),{width:r,height:r,lineHeight:`${r+e.paddingSM}px`,textAlign:`center`,flex:`none`,[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:`block`,width:`100%`,height:`100%`,overflow:`hidden`}}),[`${o}-progress`]:{bottom:i,width:`calc(100% - ${e.paddingSM*2}px)`,marginTop:0,paddingInlineStart:r+e.paddingXS}},[`${o}-error`]:{borderColor:e.colorError,[`${o}-thumbnail ${n}`]:{"svg path[fill='#e6f7ff']":{fill:e.colorErrorBg},"svg path[fill='#1890ff']":{fill:e.colorError}}},[`${o}-uploading`]:{borderStyle:`dashed`,[`${o}-name`]:{marginBottom:i}}}}}},eZ=e=>{let{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:i}=e,a=`${t}-list`,o=`${a}-item`,s=e.uploadPicCardSize;return{[`${t}-wrapper${t}-picture-card-wrapper`]:Z(Z({},D()),{display:`inline-block`,width:`100%`,[`${t}${t}-select`]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:`center`,verticalAlign:`top`,backgroundColor:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:`pointer`,transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,textAlign:`center`},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${a}${a}-picture-card`]:{[`${a}-item-container`]:{display:`inline-block`,width:s,height:s,marginBlock:`0 ${e.marginXS}px`,marginInline:`0 ${e.marginXS}px`,verticalAlign:`top`},"&::after":{display:`none`},[o]:{height:`100%`,margin:0,"&::before":{position:`absolute`,zIndex:1,width:`calc(100% - ${e.paddingXS*2}px)`,height:`calc(100% - ${e.paddingXS*2}px)`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:`" "`}},[`${o}:hover`]:{[`&::before, ${o}-actions`]:{opacity:1}},[`${o}-actions`]:{position:`absolute`,insetInlineStart:0,zIndex:10,width:`100%`,whiteSpace:`nowrap`,textAlign:`center`,opacity:0,transition:`all ${e.motionDurationSlow}`,[`${n}-eye, ${n}-download, ${n}-delete`]:{zIndex:10,width:r,margin:`0 ${e.marginXXS}px`,fontSize:r,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`}},[`${o}-actions, ${o}-actions:hover`]:{[`${n}-eye, ${n}-download, ${n}-delete`]:{color:new we(i).setAlpha(.65).toRgbString(),"&:hover":{color:i}}},[`${o}-thumbnail, ${o}-thumbnail img`]:{position:`static`,display:`block`,width:`100%`,height:`100%`,objectFit:`contain`},[`${o}-name`]:{display:`none`,textAlign:`center`},[`${o}-file + ${o}-name`]:{position:`absolute`,bottom:e.margin,display:`block`,width:`calc(100% - ${e.paddingXS*2}px)`},[`${o}-uploading`]:{[`&${o}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:`none`}},[`${o}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${e.paddingXS*2}px)`,paddingInlineStart:0}}})}},tZ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},nZ=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Z(Z({},rn(e)),{[t]:{outline:0,"input[type='file']":{cursor:`pointer`}},[`${t}-select`]:{display:`inline-block`},[`${t}-disabled`]:{color:n,cursor:`not-allowed`}})}},rZ=v(`Upload`,e=>{let{fontSizeHeading3:t,fontSize:n,lineHeight:r,lineWidth:i,controlHeightLG:a}=e,o=Math.round(n*r),s=B(e,{uploadThumbnailSize:t*2,uploadProgressOffset:o/2+i,uploadPicCardSize:a*2.55});return[nZ(s),JX(s),$X(s),eZ(s),YX(s),QX(s),tZ(s),$_(s)]}),iZ=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},aZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ic.value??d.value),[p,m]=df(e.defaultFileList||[],{value:St(e,`fileList`),postState:e=>{let t=Date.now();return(e??[]).map((e,n)=>(!e.uid&&!Object.isFrozen(e)&&(e.uid=`__AUTO__${t}_${n}__`),e))}}),h=H(`drop`),g=H(null);V(()=>{pi(e.fileList!==void 0||r.value===void 0,`Upload`,"`value` is not a valid prop, do you mean `fileList`?"),pi(e.transformFile===void 0,`Upload`,"`transformFile` is deprecated. Please use `beforeUpload` directly."),pi(e.remove===void 0,`Upload`,"`remove` props is deprecated. Please use `remove` event.")});let _=(t,n,r)=>{var i,o;let s=[...n];e.maxCount===1?s=s.slice(-1):e.maxCount&&(s=s.slice(0,e.maxCount)),m(s);let c={file:t,fileList:s};r&&(c.event=r),(i=e[`onUpdate:fileList`])==null||i.call(e,c.fileList),(o=e.onChange)==null||o.call(e,c),a.onFieldChange()},v=(t,n)=>iZ(this,void 0,void 0,function*(){let{beforeUpload:r,transformFile:i}=e,a=t;if(r){let e=yield r(t,n);if(e===!1)return!1;if(delete t[oZ],e===oZ)return Object.defineProperty(t,oZ,{value:!0,configurable:!0}),!1;typeof e==`object`&&e&&(a=e)}return i&&(a=yield i(a)),a}),y=e=>{let t=e.filter(e=>!e.file[oZ]);if(!t.length)return;let n=t.map(e=>MX(e.file)),r=[...p.value];n.forEach(e=>{r=NX(e,r)}),n.forEach((e,n)=>{let i=e;if(t[n].parsedFile)e.status=`uploading`;else{let{originFileObj:t}=e,n;try{n=new File([t],t.name,{type:t.type})}catch{n=new Blob([t],{type:t.type}),n.name=t.name,n.lastModifiedDate=new Date,n.lastModified=new Date().getTime()}n.uid=e.uid,i=n}_(i,r)})},b=(e,t,n)=>{try{typeof e==`string`&&(e=JSON.parse(e))}catch{}if(!PX(t,p.value))return;let r=MX(t);r.status=`done`,r.percent=100,r.response=e,r.xhr=n;let i=NX(r,p.value);_(r,i)},x=(e,t)=>{if(!PX(t,p.value))return;let n=MX(t);n.status=`uploading`,n.percent=e.percent;let r=NX(n,p.value);_(n,r,e)},S=(e,t,n)=>{if(!PX(n,p.value))return;let r=MX(n);r.error=e,r.response=t,r.status=`error`;let i=NX(r,p.value);_(r,i)},C=t=>{let n,r=e.onRemove||e.remove;Promise.resolve(typeof r==`function`?r(t):r).then(e=>{var r,i;if(e===!1)return;let a=FX(t,p.value);a&&(n=Z(Z({},t),{status:`removed`}),(r=p.value)==null||r.forEach(e=>{let t=n.uid===void 0?`name`:`uid`;e[t]===n[t]&&!Object.isFrozen(e)&&(e.status=`removed`)}),(i=g.value)==null||i.abort(n),_(n,a))})},w=t=>{var n;h.value=t.type,t.type===`drop`&&((n=e.onDrop)==null||n.call(e,t))};i({onBatchStart:y,onSuccess:b,onProgress:x,onError:S,fileList:p,upload:g});let[T]=Kt(`Upload`,Ye.Upload,J(()=>e.locale)),E=(t,r)=>{let{removeIcon:i,previewIcon:a,downloadIcon:s,previewFile:c,onPreview:l,onDownload:u,isImageUrl:d,progress:m,itemRender:h,iconRender:g,showUploadList:_}=e,{showDownloadIcon:v,showPreviewIcon:y,showRemoveIcon:b}=typeof _==`boolean`?{}:_;return _?U(qX,{prefixCls:o.value,listType:e.listType,items:p.value,previewFile:c,onPreview:l,onDownload:u,onRemove:C,showRemoveIcon:!f.value&&b,showPreviewIcon:y,showDownloadIcon:v,removeIcon:i,previewIcon:a,downloadIcon:s,iconRender:g,locale:T.value,isImageUrl:d,progress:m,itemRender:h,appendActionVisible:r,appendAction:t},Z({},n)):t?.()};return()=>{let{listType:t,type:i}=e,{class:c,style:d}=r,m=aZ(r,[`class`,`style`]),_=Z(Z(Z({onBatchStart:y,onError:S,onProgress:x,onSuccess:b},m),e),{id:e.id??a.id.value,prefixCls:o.value,beforeUpload:v,onChange:void 0,disabled:f.value});delete _.remove,(!n.default||f.value)&&delete _.id;let C={[`${o.value}-rtl`]:s.value===`rtl`};if(i===`drag`){let e=K(o.value,{[`${o.value}-drag`]:!0,[`${o.value}-drag-uploading`]:p.value.some(e=>e.status===`uploading`),[`${o.value}-drag-hover`]:h.value===`dragover`,[`${o.value}-disabled`]:f.value,[`${o.value}-rtl`]:s.value===`rtl`},r.class,u.value);return l(U(`span`,Y(Y({},r),{},{class:K(`${o.value}-wrapper`,C,c,u.value)}),[U(`div`,{class:e,onDrop:w,onDragover:w,onDragleave:w,style:r.style},[U(_X,Y(Y({},_),{},{ref:g,class:`${o.value}-btn`}),Y({default:()=>[U(`div`,{class:`${o.value}-drag-container`},[n.default?.call(n)])]},n))]),E()]))}let T=K(o.value,{[`${o.value}-select`]:!0,[`${o.value}-select-${t}`]:!0,[`${o.value}-disabled`]:f.value,[`${o.value}-rtl`]:s.value===`rtl`}),D=ce(n.default?.call(n)),O=e=>U(`div`,{class:T,style:e},[U(_X,Y(Y({},_),{},{ref:g}),n)]);return l(t===`picture-card`?U(`span`,Y(Y({},r),{},{class:K(`${o.value}-wrapper`,`${o.value}-picture-card-wrapper`,C,r.class,u.value)}),[E(O,!!(D&&D.length))]):U(`span`,Y(Y({},r),{},{class:K(`${o.value}-wrapper`,C,r.class,u.value)}),[O(D&&D.length?void 0:{display:`none`}),E()]))}}}),cZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{height:t}=e,i=cZ(e,[`height`]),{style:a}=r,o=cZ(r,[`style`]);return U(sZ,Z(Z(Z({},i),o),{type:`drag`,style:Z(Z({},a),{height:typeof t==`number`?`${t}px`:t})}),n)}}}),uZ=lZ,dZ=Z(sZ,{Dragger:lZ,LIST_IGNORE:oZ,install(e){return e.component(sZ.name,sZ),e.component(lZ.name,lZ),e}});function fZ(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function pZ(e){return Object.keys(e).map(t=>`${fZ(t)}: ${e[t]};`).join(` `)}function mZ(){return window.devicePixelRatio||1}function hZ(e,t,n,r){e.translate(t,n),e.rotate(Math.PI/180*Number(r)),e.translate(-t,-n)}var gZ=(e,t)=>{let n=!1;return e.removedNodes.length&&(n=Array.from(e.removedNodes).some(e=>e===t)),e.type===`attributes`&&e.target===t&&(n=!0),n},_Z=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i2&&arguments[2]!==void 0?arguments[2]:{},{window:r=$w}=n,i=_Z(n,[`window`]),a,o=Zw(()=>r&&`MutationObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=G(()=>Yw(e),e=>{s(),o.value&&r&&e&&(a=new MutationObserver(t),a.observe(e,i))},{immediate:!0}),l=()=>{s(),c()};return qw(l),{isSupported:o,stop:l}}var yZ=2,bZ=3,xZ=a(u({name:`AWatermark`,inheritAttrs:!1,props:Zn({zIndex:Number,rotate:Number,width:Number,height:Number,image:String,content:W([String,Array]),font:Qt(),rootClassName:String,gap:Ue(),offset:Ue()},{zIndex:9,rotate:-22,font:{},gap:[100,100]}),setup(e,t){let{slots:n,attrs:r}=t,[,i]=re(),a=q(),o=q(),s=q(!1),c=J(()=>e.gap?.[0]??100),l=J(()=>e.gap?.[1]??100),u=J(()=>c.value/2),d=J(()=>l.value/2),f=J(()=>e.offset?.[0]??u.value),p=J(()=>e.offset?.[1]??d.value),m=J(()=>e.font?.fontSize??i.value.fontSizeLG),h=J(()=>e.font?.fontWeight??`normal`),g=J(()=>e.font?.fontStyle??`normal`),_=J(()=>e.font?.fontFamily??`sans-serif`),v=J(()=>e.font?.color??i.value.colorFill),y=J(()=>{let t={zIndex:e.zIndex??9,position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,pointerEvents:`none`,backgroundRepeat:`repeat`},n=f.value-u.value,r=p.value-d.value;return n>0&&(t.left=`${n}px`,t.width=`calc(100% - ${n}px)`,n=0),r>0&&(t.top=`${r}px`,t.height=`calc(100% - ${r}px)`,r=0),t.backgroundPosition=`${n}px ${r}px`,t}),b=()=>{o.value&&=(o.value.remove(),void 0)},x=(e,t)=>{var n;a.value&&o.value&&(s.value=!0,o.value.setAttribute(`style`,pZ(Z(Z({},y.value),{backgroundImage:`url('${e}')`,backgroundSize:`${(c.value+t)*yZ}px`}))),(n=a.value)==null||n.append(o.value),setTimeout(()=>{s.value=!1}))},S=t=>{let n=120,r=64,i=e.content,a=e.image,o=e.width,s=e.height;if(!a&&t.measureText){t.font=`${Number(m.value)}px ${_.value}`;let e=Array.isArray(i)?i:[i],a=e.map(e=>t.measureText(e).width);n=Math.ceil(Math.max(...a)),r=Number(m.value)*e.length+(e.length-1)*bZ}return[o??n,s??r]},C=(t,n,r,i,a)=>{let o=mZ(),s=e.content,c=Number(m.value)*o;t.font=`${g.value} normal ${h.value} ${c}px/${a}px ${_.value}`,t.fillStyle=v.value,t.textAlign=`center`,t.textBaseline=`top`,t.translate(i/2,0),(Array.isArray(s)?s:[s])?.forEach((e,i)=>{t.fillText(e??``,n,r+i*(c+bZ*o))})},w=()=>{let t=document.createElement(`canvas`),n=t.getContext(`2d`),r=e.image,i=e.rotate??-22;if(n){o.value||=document.createElement(`div`);let e=mZ(),[a,s]=S(n),u=(c.value+a)*e,d=(l.value+s)*e;t.setAttribute(`width`,`${u*yZ}px`),t.setAttribute(`height`,`${d*yZ}px`);let f=c.value*e/2,p=l.value*e/2,m=a*e,h=s*e,g=(m+c.value*e)/2,_=(h+l.value*e)/2,v=f+u,y=p+d,b=g+u,w=_+d;if(n.save(),hZ(n,g,_,i),r){let e=new Image;e.onload=()=>{n.drawImage(e,f,p,m,h),n.restore(),hZ(n,b,w,i),n.drawImage(e,v,y,m,h),x(t.toDataURL(),a)},e.crossOrigin=`anonymous`,e.referrerPolicy=`no-referrer`,e.src=r}else C(n,f,p,m,h),n.restore(),hZ(n,b,w,i),C(n,v,y,m,h),x(t.toDataURL(),a)}};return V(()=>{w()}),G(()=>[e,i.value.colorFill,i.value.fontSizeLG],()=>{w()},{deep:!0,flush:`post`}),ut(()=>{b()}),vZ(a,e=>{s.value||e.forEach(e=>{gZ(e,o.value)&&(b(),w())})},{attributes:!0,subtree:!0,childList:!0,attributeFilter:[`style`,`class`]}),()=>U(`div`,Y(Y({},r),{},{ref:a,class:[r.class,e.rootClassName],style:[{position:`relative`},r.style]}),[n.default?.call(n)])}}));function SZ(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:`not-allowed`}}}function CZ(e){return{backgroundColor:e.bgColorSelected,boxShadow:e.boxShadow}}var wZ=Z({overflow:`hidden`},xe),TZ=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z({},rn(e)),{display:`inline-block`,padding:e.segmentedContainerPadding,color:e.labelColor,backgroundColor:e.bgColor,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`${t}-group`]:{position:`relative`,display:`flex`,alignItems:`stretch`,justifyItems:`flex-start`,width:`100%`},[`&${t}-rtl`]:{direction:`rtl`},[`&${t}-block`]:{display:`flex`},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:`relative`,textAlign:`center`,cursor:`pointer`,transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,"&-selected":Z(Z({},CZ(e)),{color:e.labelColorHover}),"&::after":{content:`""`,position:`absolute`,width:`100%`,height:`100%`,top:0,insetInlineStart:0,borderRadius:`inherit`,transition:`background-color ${e.motionDurationMid}`,pointerEvents:`none`},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.labelColorHover,"&::after":{backgroundColor:e.bgColorHover}},"&-label":Z({minHeight:e.controlHeight-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeight-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`},wZ),"&-icon + *":{marginInlineStart:e.marginSM/2},"&-input":{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:`none`}},[`${t}-thumb`]:Z(Z({},CZ(e)),{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:`100%`,padding:`${e.paddingXXS}px 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:`transparent`}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:e.controlHeightLG-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightLG-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:e.controlHeightSM-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightSM-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontalSM}px`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),SZ(`&-disabled ${t}-item`,e)),SZ(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:`transform, width`}})}},EZ=v(`Segmented`,e=>{let{lineWidthBold:t,lineWidth:n,colorTextLabel:r,colorText:i,colorFillSecondary:a,colorBgLayout:o,colorBgElevated:s}=e;return[TZ(B(e,{segmentedPaddingHorizontal:e.controlPaddingHorizontal-n,segmentedPaddingHorizontalSM:e.controlPaddingHorizontalSM-n,segmentedContainerPadding:t,labelColor:r,labelColorHover:i,bgColor:o,bgColorHover:a,bgColorSelected:s}))]}),DZ=e=>e?{left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth}:null,OZ=e=>e===void 0?void 0:`${e}px`,kZ=u({props:{value:nn(),getValueIndex:nn(),prefixCls:nn(),motionName:nn(),onMotionStart:nn(),onMotionEnd:nn(),direction:nn(),containerRef:nn()},emits:[`motionStart`,`motionEnd`],setup(e,t){let{emit:n}=t,r=H(),i=t=>{let n=e.getValueIndex(t),r=e.containerRef.value?.querySelectorAll(`.${e.prefixCls}-item`)[n];return r?.offsetParent&&r},a=H(null),o=H(null);G(()=>e.value,(e,t)=>{let r=i(t),s=i(e),c=DZ(r),l=DZ(s);a.value=c,o.value=l,n(r&&s?`motionStart`:`motionEnd`)},{flush:`post`});let s=J(()=>e.direction===`rtl`?OZ(-a.value?.right):OZ(a.value?.left)),c=J(()=>e.direction===`rtl`?OZ(-o.value?.right):OZ(o.value?.left)),l,u=e=>{clearTimeout(l),z(()=>{e&&(e.style.transform=`translateX(var(--thumb-start-left))`,e.style.width=`var(--thumb-start-width)`)})},d=t=>{l=setTimeout(()=>{t&&(rS(t,`${e.motionName}-appear-active`),t.style.transform=`translateX(var(--thumb-active-left))`,t.style.width=`var(--thumb-active-width)`)})},f=t=>{a.value=null,o.value=null,t&&(t.style.transform=null,t.style.width=null,iS(t,`${e.motionName}-appear-active`)),n(`motionEnd`)},p=J(()=>({"--thumb-start-left":s.value,"--thumb-start-width":OZ(a.value?.width),"--thumb-active-left":c.value,"--thumb-active-width":OZ(o.value?.width)}));return ut(()=>{clearTimeout(l)}),()=>{let t={ref:r,style:p.value,class:[`${e.prefixCls}-thumb`]};return U(Re,{appear:!0,onBeforeEnter:u,onEnter:d,onAfterEnter:f},{default:()=>[!a.value||!o.value?null:U(`div`,t,null)]})}}});function AZ(e){return e.map(e=>typeof e==`object`&&e?e:{label:e?.toString(),title:e?.toString(),value:e})}var jZ=()=>({prefixCls:String,options:Ue(),block:Q(),disabled:Q(),size:_(),value:Z(Z({},W([String,Number])),{required:!0}),motionName:String,onChange:d(),"onUpdate:value":d()}),MZ=(e,t)=>{let{slots:n,emit:r}=t,{value:i,disabled:a,payload:o,title:s,prefixCls:c,label:l=n.label,checked:u,className:d}=e,f=e=>{a||r(`change`,e,i)};return U(`label`,{class:K({[`${c}-item-disabled`]:a},d)},[U(`input`,{class:`${c}-item-input`,type:`radio`,disabled:a,checked:u,onChange:f},null),U(`div`,{class:`${c}-item-label`,title:typeof s==`string`?s:``},[typeof l==`function`?l({value:i,disabled:a,payload:o,title:s}):l??i])])};MZ.inheritAttrs=!1;var NZ=a(u({name:`ASegmented`,inheritAttrs:!1,props:Zn(jZ(),{options:[],motionName:`thumb-motion`}),slots:Object,setup(e,t){let{emit:n,slots:r,attrs:i}=t,{prefixCls:a,direction:o,size:s}=X(`segmented`,e),[c,l]=EZ(a),u=q(),d=q(!1),f=J(()=>AZ(e.options)),p=(t,r)=>{e.disabled||(n(`update:value`,r),n(`change`,r))};return()=>{let t=a.value;return c(U(`div`,Y(Y({},i),{},{class:K(t,{[l.value]:!0,[`${t}-block`]:e.block,[`${t}-disabled`]:e.disabled,[`${t}-lg`]:s.value==`large`,[`${t}-sm`]:s.value==`small`,[`${t}-rtl`]:o.value===`rtl`},i.class),ref:u}),[U(`div`,{class:`${t}-group`},[U(kZ,{containerRef:u,prefixCls:t,value:e.value,motionName:`${t}-${e.motionName}`,direction:o.value,getValueIndex:e=>f.value.findIndex(t=>t.value===e),onMotionStart:()=>{d.value=!0},onMotionEnd:()=>{d.value=!1}},null),f.value.map(n=>U(MZ,Y(Y({key:n.value,prefixCls:t,checked:n.value===e.value,onChange:p},n),{},{className:K(n.className,`${t}-item`,{[`${t}-item-selected`]:n.value===e.value&&!d.value}),disabled:!!e.disabled||!!n.disabled}),r))])]))}}})),PZ=e=>{let{componentCls:t}=e;return{[t]:Z(Z({},rn(e)),{display:`flex`,justifyContent:`center`,alignItems:`center`,padding:e.paddingSM,backgroundColor:e.colorWhite,borderRadius:e.borderRadiusLG,border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,position:`relative`,width:`100%`,height:`100%`,overflow:`hidden`,[`& > ${t}-mask`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:10,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`,color:e.colorText,lineHeight:e.lineHeight,background:e.QRCodeMaskBackgroundColor,textAlign:`center`,[`& > ${t}-expired , & > ${t}-scanned`]:{color:e.QRCodeTextColor}},"&-icon":{marginBlockEnd:e.marginXS,fontSize:e.controlHeight}}),[`${t}-borderless`]:{borderColor:`transparent`}}},FZ=v(`QRCode`,e=>PZ(B(e,{QRCodeTextColor:`rgba(0, 0, 0, 0.88)`,QRCodeMaskBackgroundColor:`rgba(255, 255, 255, 0.96)`}))),IZ={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z`}}]},name:`appstore`,theme:`outlined`};function LZ(e){for(var t=1;t({size:{type:Number,default:160},value:{type:String,required:!0},type:_(`canvas`),color:String,bgColor:String,includeMargin:Boolean,imageSettings:Qt()}),dQ=()=>Z(Z({},uQ()),{errorLevel:_(`M`),icon:String,iconSize:{type:Number,default:40},status:_(`active`),bordered:{type:Boolean,default:!0}}),fQ;(function(e){class t{static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:40,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(!(t.MIN_VERSION<=o&&o<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=o;;u++){let n=t.getNumDataCodewords(u,r)*8,i=a.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.lengthm[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],et.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;ne+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.lengtht.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}class a{static makeBytes(e){let t=[];for(let r of e)n(r,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let r=0;r=1<1&&arguments[1]!==void 0?arguments[1]:0,n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function wQ(e,t){return e.slice().map((e,n)=>n=t.y+t.h?e:e.map((e,n)=>n=t.x+t.w?e:!1))}function TQ(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*SQ),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);d={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}return{x:l,y:u,h:c,w:s,excavation:d}}function EQ(e,t){return t==null?e?bQ:xQ:Math.floor(t)}var DQ=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),OQ=u({name:`QRCodeCanvas`,inheritAttrs:!1,props:Z(Z({},uQ()),{level:String,bgColor:String,fgColor:String,marginSize:Number}),setup(e,t){let{attrs:n,expose:r}=t,i=J(()=>e.imageSettings?.src),a=q(null),o=q(null),s=q(!1);return r({toDataURL:(e,t)=>a.value?.toDataURL(e,t)}),S(()=>{let{value:t,size:n=hQ,level:r=gQ,bgColor:i=_Q,fgColor:c=vQ,includeMargin:l=yQ,marginSize:u,imageSettings:d}=e;if(a.value!=null){let e=a.value,f=e.getContext(`2d`);if(!f)return;let p=pQ.QrCode.encodeText(t,mQ[r]).getModules(),m=EQ(l,u),h=p.length+m*2,g=TQ(p,n,m,d),_=o.value,v=s.value&&g!=null&&_!==null&&_.complete&&_.naturalHeight!==0&&_.naturalWidth!==0;v&&g.excavation!=null&&(p=wQ(p,g.excavation));let y=window.devicePixelRatio||1;e.height=e.width=n*y;let b=n/h*y;f.scale(b,b),f.fillStyle=i,f.fillRect(0,0,h,h),f.fillStyle=c,DQ?f.fill(new Path2D(CQ(p,m))):p.forEach(function(e,t){e.forEach(function(e,n){e&&f.fillRect(n+m,t+m,1,1)})}),v&&f.drawImage(_,g.x+m,g.y+m,g.w,g.h)}},{flush:`post`}),G(i,()=>{s.value=!1}),()=>{let t=e.size??hQ,r={height:`${t}px`,width:`${t}px`},c=null;return i.value!=null&&(c=U(`img`,{src:i.value,key:i.value,style:{display:`none`},onLoad:()=>{s.value=!0},ref:o},null)),U($e,null,[U(`canvas`,Y(Y({},n),{},{style:[r,n.style],ref:a}),null),c])}}}),kQ=u({name:`QRCodeSVG`,inheritAttrs:!1,props:Z(Z({},uQ()),{color:String,level:String,bgColor:String,fgColor:String,marginSize:Number,title:String}),setup(e){let t=null,n=null,r=null,i=null,a=null,o=null;return S(()=>{let{value:s,size:c=hQ,level:l=gQ,includeMargin:u=yQ,marginSize:d,imageSettings:f}=e;t=pQ.QrCode.encodeText(s,mQ[l]).getModules(),n=EQ(u,d),r=t.length+n*2,i=TQ(t,c,n,f),f!=null&&i!=null&&(i.excavation!=null&&(t=wQ(t,i.excavation)),o=U(`image`,{"xlink:href":f.src,height:i.h,width:i.w,x:i.x+n,y:i.y+n,preserveAspectRatio:`none`},null)),a=CQ(t,n)}),()=>{let t=e.bgColor&&_Q,n=e.fgColor&&vQ;return U(`svg`,{height:e.size,width:e.size,viewBox:`0 0 ${r} ${r}`},[!!e.title&&U(`title`,null,[e.title]),U(`path`,{fill:t,d:`M0,0 h${r}v${r}H0z`,"shape-rendering":`crispEdges`},null),U(`path`,{fill:n,d:a,"shape-rendering":`crispEdges`},null),o])}}}),AQ=a(u({name:`AQrcode`,inheritAttrs:!1,props:dQ(),emits:[`refresh`],setup(e,t){let{emit:n,attrs:r,expose:i}=t,[a]=Kt(`QRCode`),{prefixCls:o}=X(`qrcode`,e),[s,c]=FZ(o),[,l]=re(),u=H();i({toDataURL:(e,t)=>u.value?.toDataURL(e,t)});let d=J(()=>{let{value:t,icon:n=``,size:r=160,iconSize:i=40,color:a=l.value.colorText,bgColor:o=`transparent`,errorLevel:s=`M`}=e,c={src:n,x:void 0,y:void 0,height:i,width:i,excavate:!0};return{value:t,size:r-(l.value.paddingSM+l.value.lineWidth)*2,level:s,bgColor:o,fgColor:a,imageSettings:n?c:void 0}});return()=>{let t=o.value;return s(U(`div`,Y(Y({},r),{},{style:[r.style,{width:`${e.size}px`,height:`${e.size}px`,backgroundColor:d.value.bgColor}],class:[c.value,t,{[`${t}-borderless`]:!e.bordered}]}),[e.status!==`active`&&U(`div`,{class:`${t}-mask`},[e.status===`loading`&&U(HR,null,null),e.status===`expired`&&U($e,null,[U(`p`,{class:`${t}-expired`},[a.value.expired]),U(Qb,{type:`link`,onClick:e=>n(`refresh`,e)},{default:()=>[a.value.refresh],icon:()=>U(un,null,null)})]),e.status===`scanned`&&U(`p`,{class:`${t}-scanned`},[a.value.scanned])]),e.type===`canvas`?U(OQ,Y({ref:u},d.value),null):U(kQ,d.value,null)]))}}}));function jQ(e){let t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:r,right:i,bottom:a,left:o}=e.getBoundingClientRect();return r>=0&&o>=0&&i<=t&&a<=n}function MQ(e,t,n,r){let[i,a]=ff(void 0);S(()=>{let t=typeof e.value==`function`?e.value():e.value;a(t||null)},{flush:`post`});let[o,s]=ff(null),c=()=>{if(!t.value){s(null);return}if(i.value){!jQ(i.value)&&t.value&&i.value.scrollIntoView(r.value);let{left:e,top:n,width:a,height:c}=i.value.getBoundingClientRect(),l={left:e,top:n,width:a,height:c,radius:0};JSON.stringify(o.value)!==JSON.stringify(l)&&s(l)}else s(null)};return V(()=>{G([t,i],()=>{c()},{flush:`post`,immediate:!0}),window.addEventListener(`resize`,c)}),ut(()=>{window.removeEventListener(`resize`,c)}),[J(()=>{if(!o.value)return o.value;let e=n.value?.offset||6,t=n.value?.radius||2;return{left:o.value.left-e,top:o.value.top-e,width:o.value.width+e*2,height:o.value.height+e*2,radius:t}}),i]}var NQ=()=>({arrow:W([Boolean,Object]),target:W([String,Function,Object]),title:W([String,Object]),description:W([String,Object]),placement:_(),mask:W([Object,Boolean],!0),className:{type:String},style:Qt(),scrollIntoViewOptions:W([Boolean,Object])}),PQ=()=>Z(Z({},NQ()),{prefixCls:{type:String},total:{type:Number},current:{type:Number},onClose:d(),onFinish:d(),renderPanel:d(),onPrev:d(),onNext:d()}),FQ=u({name:`DefaultPanel`,inheritAttrs:!1,props:PQ(),setup(e,t){let{attrs:n}=t;return()=>{let{prefixCls:t,current:r,total:i,title:a,description:o,onClose:s,onPrev:c,onNext:l,onFinish:u}=e;return U(`div`,Y(Y({},n),{},{class:K(`${t}-content`,n.class)}),[U(`div`,{class:`${t}-inner`},[U(`button`,{type:`button`,onClick:s,"aria-label":`Close`,class:`${t}-close`},[U(`span`,{class:`${t}-close-x`},[en(`×`)])]),U(`div`,{class:`${t}-header`},[U(`div`,{class:`${t}-title`},[a])]),U(`div`,{class:`${t}-description`},[o]),U(`div`,{class:`${t}-footer`},[U(`div`,{class:`${t}-sliders`},[i>1?[...Array.from({length:i}).keys()].map((e,t)=>U(`span`,{key:e,class:t===r?`active`:``},null)):null]),U(`div`,{class:`${t}-buttons`},[r===0?null:U(`button`,{class:`${t}-prev-btn`,onClick:c},[en(`Prev`)]),r===i-1?U(`button`,{class:`${t}-finish-btn`,onClick:u},[en(`Finish`)]):U(`button`,{class:`${t}-next-btn`,onClick:l},[en(`Next`)])])])])])}}}),IQ=u({name:`TourStep`,inheritAttrs:!1,props:PQ(),setup(e,t){let{attrs:n}=t;return()=>{let{current:t,renderPanel:r}=e;return U($e,null,[typeof r==`function`?r(Z(Z({},n),e),t):U(FQ,Y(Y({},n),e),null)])}}}),LQ=0,RQ=It();function zQ(){let e;return RQ?(e=LQ,LQ+=1):e=`TEST_OR_SSR`,e}function BQ(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H(``),t=`vc_unique_${zQ()}`;return e.value||t}var VQ={fill:`transparent`,"pointer-events":`auto`},HQ=u({name:`TourMask`,props:{prefixCls:{type:String},pos:Qt(),rootClassName:{type:String},showMask:Q(),fill:{type:String,default:`rgba(0,0,0,0.5)`},open:Q(),animated:W([Boolean,Object]),zIndex:{type:Number}},setup(e,t){let{attrs:n}=t,r=BQ();return()=>{let{prefixCls:t,open:i,rootClassName:a,pos:o,showMask:s,fill:c,animated:l,zIndex:u}=e,d=`${t}-mask-${r}`,f=typeof l==`object`?l?.placeholder:l;return U(bu,{visible:i,autoLock:!0},{default:()=>i&&U(`div`,Y(Y({},n),{},{class:K(`${t}-mask`,a,n.class),style:[{position:`fixed`,left:0,right:0,top:0,bottom:0,zIndex:u,pointerEvents:`none`},n.style]}),[s?U(`svg`,{style:{width:`100%`,height:`100%`}},[U(`defs`,null,[U(`mask`,{id:d},[U(`rect`,{x:`0`,y:`0`,width:`100vw`,height:`100vh`,fill:`white`},null),o&&U(`rect`,{x:o.left,y:o.top,rx:o.radius,width:o.width,height:o.height,fill:`black`,class:f?`${t}-placeholder-animated`:``},null)])]),U(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:c,mask:`url(#${d})`},null),o&&U($e,null,[U(`rect`,Y(Y({},VQ),{},{x:`0`,y:`0`,width:`100%`,height:o.top}),null),U(`rect`,Y(Y({},VQ),{},{x:`0`,y:`0`,width:o.left,height:`100%`}),null),U(`rect`,Y(Y({},VQ),{},{x:`0`,y:o.top+o.height,width:`100%`,height:`calc(100vh - ${o.top+o.height}px)`}),null),U(`rect`,Y(Y({},VQ),{},{x:o.left+o.width,y:`0`,width:`calc(100vw - ${o.left+o.width}px)`,height:`100%`}),null)])]):null])})}}}),UQ=[0,0],WQ={left:{points:[`cr`,`cl`],offset:[-8,0]},right:{points:[`cl`,`cr`],offset:[8,0]},top:{points:[`bc`,`tc`],offset:[0,-8]},bottom:{points:[`tc`,`bc`],offset:[0,8]},topLeft:{points:[`bl`,`tl`],offset:[0,-8]},leftTop:{points:[`tr`,`tl`],offset:[-8,0]},topRight:{points:[`br`,`tr`],offset:[0,-8]},rightTop:{points:[`tl`,`tr`],offset:[8,0]},bottomRight:{points:[`tr`,`br`],offset:[0,8]},rightBottom:{points:[`bl`,`br`],offset:[8,0]},bottomLeft:{points:[`tl`,`bl`],offset:[0,8]},leftBottom:{points:[`br`,`bl`],offset:[-8,0]}};function GQ(){let e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t={};return Object.keys(WQ).forEach(n=>{t[n]=Z(Z({},WQ[n]),{autoArrow:e,targetOffset:UQ})}),t}GQ();var KQ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{builtinPlacements:e,popupAlign:t}=Di();return{builtinPlacements:e,popupAlign:t,steps:Ue(),open:Q(),defaultCurrent:{type:Number},current:{type:Number},onChange:d(),onClose:d(),onFinish:d(),mask:W([Boolean,Object],!0),arrow:W([Boolean,Object],!0),rootClassName:{type:String},placement:_(`bottom`),prefixCls:{type:String,default:`rc-tour`},renderPanel:d(),gap:Qt(),animated:W([Boolean,Object]),scrollIntoViewOptions:W([Boolean,Object],!0),zIndex:{type:Number,default:1001}}},YQ=u({name:`Tour`,inheritAttrs:!1,props:Zn(JQ(),{}),setup(e){let{defaultCurrent:t,placement:n,mask:r,scrollIntoViewOptions:i,open:a,gap:o,arrow:s}=Ft(e),c=H(),[l,u]=df(0,{value:J(()=>e.current),defaultValue:t.value}),[d,f]=df(void 0,{value:J(()=>e.open),postState:t=>l.value<0||l.value>=e.steps.length?!1:t??!0}),p=q(d.value);S(()=>{d.value&&!p.value&&u(0),p.value=d.value});let m=J(()=>e.steps[l.value]||{}),h=J(()=>m.value.placement??n.value),g=J(()=>d.value&&(m.value.mask??r.value)),_=J(()=>m.value.scrollIntoViewOptions??i.value),[v,y]=MQ(J(()=>m.value.target),a,o,_),b=J(()=>y.value?m.value.arrow===void 0?s.value:m.value.arrow:!1),x=J(()=>typeof b.value==`object`&&b.value.pointAtCenter);G(x,()=>{var e;(e=c.value)==null||e.forcePopupAlign()}),G(l,()=>{var e;(e=c.value)==null||e.forcePopupAlign()});let C=t=>{var n;u(t),(n=e.onChange)==null||n.call(e,t)};return()=>{let{prefixCls:t,steps:n,onClose:r,onFinish:i,rootClassName:a,renderPanel:o,animated:s,zIndex:u}=e,p=KQ(e,[`prefixCls`,`steps`,`onClose`,`onFinish`,`rootClassName`,`renderPanel`,`animated`,`zIndex`]);if(y.value===void 0)return null;let _=()=>{f(!1),r?.(l.value)},S=typeof g.value==`boolean`?g.value:!!g.value,w=typeof g.value==`boolean`?void 0:g.value,T=()=>y.value||document.body,E=()=>U(IQ,Y({arrow:b.value,key:`content`,prefixCls:t,total:n.length,renderPanel:o,onPrev:()=>{C(l.value-1)},onNext:()=>{C(l.value+1)},onClose:_,current:l.value,onFinish:()=>{_(),i?.()}},m.value),null),D=J(()=>{let e=v.value||qQ,t={};return Object.keys(e).forEach(n=>{typeof e[n]==`number`?t[n]=`${e[n]}px`:t[n]=e[n]}),t});return d.value?U($e,null,[U(HQ,{zIndex:u,prefixCls:t,pos:v.value,showMask:S,style:w?.style,fill:w?.color,open:d.value,animated:s,rootClassName:a},null),U(Su,Y(Y({},p),{},{arrow:!!p.arrow,builtinPlacements:m.value.target?p.builtinPlacements??GQ(x.value):void 0,ref:c,popupStyle:m.value.target?m.value.style:Z(Z({},m.value.style),{position:`fixed`,left:qQ.left,top:qQ.top,transform:`translate(-50%, -50%)`}),popupPlacement:h.value,popupVisible:d.value,popupClassName:K(a,m.value.className),prefixCls:t,popup:E,forceRender:!1,destroyPopupOnHide:!0,zIndex:u,mask:!1,getTriggerDOMNode:T}),{default:()=>[U(bu,{visible:d.value,autoLock:!0},{default:()=>[U(`div`,{class:K(a,`${t}-target-placeholder`),style:Z(Z({},D.value),{position:`fixed`,pointerEvents:`none`})},null)]})]})]):null}}}),XQ=()=>Z(Z({},JQ()),{steps:{type:Array},prefixCls:{type:String},current:{type:Number},type:{type:String},"onUpdate:current":Function}),ZQ=u({name:`ATourPanel`,inheritAttrs:!1,props:Z(Z({},PQ()),{cover:{type:Object},nextButtonProps:{type:Object},prevButtonProps:{type:Object},current:{type:Number},type:{type:String}}),setup(e,t){let{attrs:n,slots:r}=t,{current:i,total:a}=Ft(e),o=J(()=>i.value===a.value-1),s=t=>{var n;let r=e.prevButtonProps;(n=e.onPrev)==null||n.call(e,t),typeof r?.onClick==`function`&&r?.onClick()},c=t=>{var n,r;let i=e.nextButtonProps;o.value?(n=e.onFinish)==null||n.call(e,t):(r=e.onNext)==null||r.call(e,t),typeof i?.onClick==`function`&&i?.onClick()};return()=>{let{prefixCls:t,title:l,onClose:u,cover:d,description:f,type:p,arrow:m}=e,h=e.prevButtonProps,g=e.nextButtonProps,_;l&&(_=U(`div`,{class:`${t}-header`},[U(`div`,{class:`${t}-title`},[l])]));let v;f&&(v=U(`div`,{class:`${t}-description`},[f]));let y;d&&(y=U(`div`,{class:`${t}-cover`},[d]));let b;b=r.indicatorsRender?r.indicatorsRender({current:i.value,total:a}):[...Array.from({length:a.value}).keys()].map((e,n)=>U(`span`,{key:e,class:K(n===i.value&&`${t}-indicator-active`,`${t}-indicator`)},null));let x=p===`primary`?`default`:`primary`,S={type:`default`,ghost:p===`primary`};return U(gt,{componentName:`Tour`,defaultLocale:Ye.Tour},{default:e=>U(`div`,Y(Y({},n),{},{class:K(p===`primary`?`${t}-primary`:``,n.class,`${t}-content`)}),[m&&U(`div`,{class:`${t}-arrow`,key:`arrow`},null),U(`div`,{class:`${t}-inner`},[U(Pe,{class:`${t}-close`,onClick:u},null),y,_,v,U(`div`,{class:`${t}-footer`},[a.value>1&&U(`div`,{class:`${t}-indicators`},[b]),U(`div`,{class:`${t}-buttons`},[i.value===0?null:U(Qb,Y(Y(Y({},S),h),{},{onClick:s,size:`small`,class:K(`${t}-prev-btn`,h?.className)}),{default:()=>[Vt(h?.children)?h.children():h?.children??e.Previous]}),U(Qb,Y(Y({type:x},g),{},{onClick:c,size:`small`,class:K(`${t}-next-btn`,g?.className)}),{default:()=>[Vt(g?.children)?g?.children():o.value?e.Finish:e.Next]})])])])])})}}}),QQ=e=>{let{defaultType:t,steps:n,current:r,defaultCurrent:i}=e,a=H(i?.value);G(J(()=>r?.value),e=>{a.value=e??i?.value},{immediate:!0});let o=e=>{a.value=e},s=J(()=>typeof a.value==`number`?n&&n.value?.[a.value]?.type:t?.value);return{currentMergedType:J(()=>s.value??t?.value),updateInnerCurrent:o}},$Q=e=>{let{componentCls:t,lineHeight:n,padding:r,paddingXS:i,borderRadius:a,borderRadiusXS:o,colorPrimary:s,colorText:c,colorFill:l,indicatorHeight:u,indicatorWidth:d,boxShadowTertiary:f,tourZIndexPopup:p,fontSize:m,colorBgContainer:h,fontWeightStrong:g,marginXS:_,colorTextLightSolid:v,tourBorderRadius:y,colorWhite:b,colorBgTextHover:x,tourCloseSize:S,motionDurationSlow:C,antCls:w}=e;return[{[t]:Z(Z({},rn(e)),{color:c,position:`absolute`,zIndex:p,display:`block`,visibility:`visible`,fontSize:m,lineHeight:n,width:520,"--antd-arrow-background-color":h,"&-pure":{maxWidth:`100%`,position:`relative`},[`&${t}-hidden`]:{display:`none`},[`${t}-content`]:{position:`relative`},[`${t}-inner`]:{textAlign:`start`,textDecoration:`none`,borderRadius:y,boxShadow:f,position:`relative`,backgroundColor:h,border:`none`,backgroundClip:`padding-box`,[`${t}-close`]:{position:`absolute`,top:r,insetInlineEnd:r,color:e.colorIcon,outline:`none`,width:S,height:S,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:`flex`,alignItems:`center`,justifyContent:`center`,"&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?`transparent`:e.colorFillContent}},[`${t}-cover`]:{textAlign:`center`,padding:`${r+S+i}px ${r}px 0`,img:{width:`100%`}},[`${t}-header`]:{padding:`${r}px ${r}px ${i}px`,[`${t}-title`]:{lineHeight:n,fontSize:m,fontWeight:g}},[`${t}-description`]:{padding:`0 ${r}px`,lineHeight:n,wordWrap:`break-word`},[`${t}-footer`]:{padding:`${i}px ${r}px ${r}px`,textAlign:`end`,borderRadius:`0 0 ${o}px ${o}px`,display:`flex`,[`${t}-indicators`]:{display:`inline-block`,[`${t}-indicator`]:{width:d,height:u,display:`inline-block`,borderRadius:`50%`,background:l,"&:not(:last-child)":{marginInlineEnd:u},"&-active":{background:s}}},[`${t}-buttons`]:{marginInlineStart:`auto`,[`${w}-btn`]:{marginInlineStart:_}}}},[`${t}-primary, &${t}-primary`]:{"--antd-arrow-background-color":s,[`${t}-inner`]:{color:v,textAlign:`start`,textDecoration:`none`,backgroundColor:s,borderRadius:a,boxShadow:f,[`${t}-close`]:{color:v},[`${t}-indicators`]:{[`${t}-indicator`]:{background:new we(v).setAlpha(.15).toRgbString(),"&-active":{background:v}}},[`${t}-prev-btn`]:{color:v,borderColor:new we(v).setAlpha(.15).toRgbString(),backgroundColor:s,"&:hover":{backgroundColor:new we(v).setAlpha(.15).toRgbString(),borderColor:`transparent`}},[`${t}-next-btn`]:{color:s,borderColor:`transparent`,background:b,"&:hover":{background:new we(x).onBackground(b).toRgbString()}}}}}),[`${t}-mask`]:{[`${t}-placeholder-animated`]:{transition:`all ${C}`}},[[`&-placement-left`,`&-placement-leftTop`,`&-placement-leftBottom`,`&-placement-right`,`&-placement-rightTop`,`&-placement-rightBottom`].join(`,`)]:{[`${t}-inner`]:{borderRadius:Math.min(y,8)}}},yy(e,{colorBg:`var(--antd-arrow-background-color)`,contentRadius:y,limitVerticalRadius:!0})]},e$=v(`Tour`,e=>{let{borderRadiusLG:t,fontSize:n,lineHeight:r}=e;return[$Q(B(e,{tourZIndexPopup:e.zIndexPopupBase+70,indicatorWidth:6,indicatorHeight:6,tourBorderRadius:t,tourCloseSize:n*r}))]}),t$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{steps:t,current:a,type:o,rootClassName:s}=e,c=t$(e,[`steps`,`current`,`type`,`rootClassName`]),h=K({[`${l.value}-primary`]:p.value===`primary`,[`${l.value}-rtl`]:u.value===`rtl`},f.value,s),g=(e,t)=>U(ZQ,Y(Y({},e),{},{type:o,current:t}),{indicatorsRender:i.indicatorsRender}),_=e=>{m(e),r(`update:current`,e),r(`change`,e)},v=J(()=>uy({arrowPointAtCenter:!0,autoAdjustOverflow:!0}));return d(U(YQ,Y(Y(Y({},n),c),{},{rootClassName:h,prefixCls:l.value,current:a,defaultCurrent:e.defaultCurrent,animated:!0,renderPanel:g,onChange:_,steps:t,builtinPlacements:v.value}),null))}}})),r$=Symbol(`appConfigContext`),i$=e=>fe(r$,e),a$=()=>g(r$,{}),o$=Symbol(`appContext`),s$=e=>fe(o$,e),c$=Ne({message:{},notification:{},modal:{}}),l$=()=>g(o$,c$),u$=e=>{let{componentCls:t,colorText:n,fontSize:r,lineHeight:i,fontFamily:a}=e;return{[t]:{color:n,fontSize:r,lineHeight:i,fontFamily:a}}},d$=v(`App`,e=>[u$(e)]),f$=()=>({rootClassName:String,message:Qt(),notification:Qt()}),p$=()=>l$(),m$=u({name:`AApp`,props:Zn(f$(),{}),setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`app`,e),[i,a]=d$(r),o=J(()=>K(a.value,r.value,e.rootClassName)),s=a$(),c=J(()=>({message:Z(Z({},s.message),e.message),notification:Z(Z({},s.notification),e.notification)}));i$(c.value);let[l,u]=wt(c.value.message),[d,f]=ot(c.value.notification),[p,m]=CB();return s$(J(()=>({message:l,notification:d,modal:p})).value),()=>i(U(`div`,{class:o.value},[m(),u(),f(),n.default?.call(n)]))}});m$.useApp=p$,m$.install=function(e){e.component(m$.name,m$)};var h$=[`wrap`,`nowrap`,`wrap-reverse`],g$=[`flex-start`,`flex-end`,`start`,`end`,`center`,`space-between`,`space-around`,`space-evenly`,`stretch`,`normal`,`left`,`right`],_$=[`center`,`start`,`end`,`flex-start`,`flex-end`,`self-start`,`self-end`,`baseline`,`normal`,`stretch`],v$=(e,t)=>{let n={};return h$.forEach(r=>{n[`${e}-wrap-${r}`]=t.wrap===r}),n},y$=(e,t)=>{let n={};return _$.forEach(r=>{n[`${e}-align-${r}`]=t.align===r}),n[`${e}-align-stretch`]=!t.align&&!!t.vertical,n},b$=(e,t)=>{let n={};return g$.forEach(r=>{n[`${e}-justify-${r}`]=t.justify===r}),n};function x$(e,t){return K(Z(Z(Z({},v$(e,t)),y$(e,t)),b$(e,t)))}var S$=e=>{let{componentCls:t}=e;return{[t]:{display:`flex`,"&-vertical":{flexDirection:`column`},"&-rtl":{direction:`rtl`},"&:empty":{display:`none`}}}},C$=e=>{let{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}},w$=e=>{let{componentCls:t}=e,n={};return h$.forEach(e=>{n[`${t}-wrap-${e}`]={flexWrap:e}}),n},T$=e=>{let{componentCls:t}=e,n={};return _$.forEach(e=>{n[`${t}-align-${e}`]={alignItems:e}}),n},E$=e=>{let{componentCls:t}=e,n={};return g$.forEach(e=>{n[`${t}-justify-${e}`]={justifyContent:e}}),n},D$=v(`Flex`,e=>{let t=B(e,{flexGapSM:e.paddingXS,flexGap:e.padding,flexGapLG:e.paddingLG});return[S$(t),C$(t),w$(t),T$(t),E$(t)]});function O$(e){return[`small`,`middle`,`large`].includes(e)}var k$=()=>({prefixCls:_(),vertical:Q(),wrap:_(),justify:_(),align:_(),flex:W([Number,String]),gap:W([Number,String]),component:nn()}),A$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i[o.value,c.value,x$(o.value,e),{[`${o.value}-rtl`]:a.value===`rtl`,[`${o.value}-gap-${e.gap}`]:O$(e.gap),[`${o.value}-vertical`]:e.vertical??i?.value.vertical}]);return()=>{let{flex:t,gap:i,component:a=`div`}=e,o=A$(e,[`flex`,`gap`,`component`]),c={};return t&&(c.flex=t),i&&!O$(i)&&(c.gap=`${i}px`),s(U(a,Y({class:[r.class,l.value],style:[r.style,c]},Br(o,[`justify`,`wrap`,`align`,`vertical`])),{default:()=>[n.default?.call(n)]}))}}})),M$=yn({Affix:()=>Gr,Alert:()=>zv,Anchor:()=>vi,AnchorLink:()=>fi,App:()=>m$,AutoComplete:()=>kv,AutoCompleteOptGroup:()=>Dv,AutoCompleteOption:()=>Ev,Avatar:()=>My,AvatarGroup:()=>jy,BackTop:()=>yF,Badge:()=>Xy,BadgeRibbon:()=>qy,Breadcrumb:()=>NS,BreadcrumbItem:()=>Sx,BreadcrumbSeparator:()=>MS,Button:()=>Qb,ButtonGroup:()=>qb,Calendar:()=>oE,Card:()=>FD,CardGrid:()=>PD,CardMeta:()=>ND,Carousel:()=>$O,Cascader:()=>lN,CheckableTag:()=>kN,Checkbox:()=>vN,CheckboxGroup:()=>_N,Col:()=>bN,Collapse:()=>qD,CollapsePanel:()=>KD,Comment:()=>CN,Compact:()=>m_,ConfigProvider:()=>Bt,DatePicker:()=>dP,Descriptions:()=>TP,DescriptionsItem:()=>vP,DirectoryTree:()=>QK,Divider:()=>OP,Drawer:()=>qP,Dropdown:()=>kP,DropdownButton:()=>fx,Empty:()=>te,Flex:()=>j$,FloatButton:()=>bF,FloatButtonGroup:()=>mF,Form:()=>QM,FormItem:()=>UM,FormItemRest:()=>Bf,Grid:()=>yN,Image:()=>EL,ImagePreviewGroup:()=>TL,Input:()=>hI,InputGroup:()=>LF,InputNumber:()=>aR,InputPassword:()=>mI,InputSearch:()=>zF,Layout:()=>kR,LayoutContent:()=>OR,LayoutFooter:()=>ER,LayoutHeader:()=>TR,LayoutSider:()=>DR,List:()=>Ez,ListItem:()=>xz,ListItemMeta:()=>vz,LocaleProvider:()=>Lt,Mentions:()=>rB,MentionsOption:()=>nB,Menu:()=>wS,MenuDivider:()=>sS,MenuItem:()=>Kx,MenuItemGroup:()=>oS,Modal:()=>TB,MonthPicker:()=>oP,PageHeader:()=>tV,Pagination:()=>_z,Popconfirm:()=>aV,Popover:()=>Ay,Progress:()=>zV,QRCode:()=>AQ,QuarterPicker:()=>lP,Radio:()=>ET,RadioButton:()=>TT,RadioGroup:()=>wT,RangePicker:()=>uP,Rate:()=>QV,Result:()=>_H,Row:()=>vH,Segmented:()=>NZ,Select:()=>yv,SelectOptGroup:()=>xv,SelectOption:()=>bv,Skeleton:()=>AD,SkeletonAvatar:()=>kD,SkeletonButton:()=>TD,SkeletonImage:()=>OD,SkeletonInput:()=>ED,SkeletonTitle:()=>tD,Slider:()=>QH,Space:()=>QB,Spin:()=>HR,Statistic:()=>LB,StatisticCountdown:()=>IB,Step:()=>xU,Steps:()=>SU,SubMenu:()=>tS,Switch:()=>AU,TabPane:()=>UE,Table:()=>Kq,TableColumn:()=>Vq,TableColumnGroup:()=>Hq,TableSummary:()=>Gq,TableSummaryCell:()=>Wq,TableSummaryRow:()=>Uq,Tabs:()=>GE,Tag:()=>AN,Textarea:()=>nI,TimePicker:()=>tY,TimeRangePicker:()=>eY,Timeline:()=>oY,TimelineItem:()=>nY,Tooltip:()=>Ty,Tour:()=>n$,Transfer:()=>mJ,Tree:()=>eq,TreeNode:()=>$K,TreeSelect:()=>XJ,TreeSelectNode:()=>YJ,Typography:()=>nX,TypographyLink:()=>qY,TypographyParagraph:()=>YY,TypographyText:()=>ZY,TypographyTitle:()=>tX,Upload:()=>dZ,UploadDragger:()=>uZ,Watermark:()=>xZ,WeekPicker:()=>aP,message:()=>Le,notification:()=>Pt}),N$={version:x,install:function(e){return Object.keys(M$).forEach(t=>{let n=M$[t];n.install&&e.use(n)}),e.use(Fr.StyleProvider),e.config.globalProperties.$message=Le,e.config.globalProperties.$notification=Pt,e.config.globalProperties.$info=TB.info,e.config.globalProperties.$success=TB.success,e.config.globalProperties.$error=TB.error,e.config.globalProperties.$warning=TB.warning,e.config.globalProperties.$confirm=TB.confirm,e.config.globalProperties.$destroyAll=TB.destroyAll,e}},P$=typeof document<`u`;function F$(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function I$(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&F$(e.default)}var L$=Object.assign;function R$(e,t){let n={};for(let r in t){let i=t[r];n[r]=B$(i)?i.map(e):e(i)}return n}var z$=()=>{},B$=Array.isArray;function V$(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var H$=/#/g,U$=/&/g,W$=/\//g,G$=/=/g,K$=/\?/g,q$=/\+/g,J$=/%5B/g,Y$=/%5D/g,X$=/%5E/g,Z$=/%60/g,Q$=/%7B/g,$$=/%7C/g,e1=/%7D/g,t1=/%20/g;function n1(e){return e==null?``:encodeURI(``+e).replace($$,`|`).replace(J$,`[`).replace(Y$,`]`)}function r1(e){return n1(e).replace(Q$,`{`).replace(e1,`}`).replace(X$,`^`)}function i1(e){return n1(e).replace(q$,`%2B`).replace(t1,`+`).replace(H$,`%23`).replace(U$,`%26`).replace(Z$,"`").replace(Q$,`{`).replace(e1,`}`).replace(X$,`^`)}function a1(e){return i1(e).replace(G$,`%3D`)}function o1(e){return n1(e).replace(H$,`%23`).replace(K$,`%3F`)}function s1(e){return o1(e).replace(W$,`%2F`)}function c1(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var l1=/\/$/,u1=e=>e.replace(l1,``);function d1(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=y1(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:c1(o)}}function f1(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function p1(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function m1(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&h1(t.matched[r],n.matched[i])&&g1(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function h1(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function g1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!_1(e[n],t[n]))return!1;return!0}function _1(e,t){return B$(e)?v1(e,t):B$(t)?v1(t,e):e?.valueOf()===t?.valueOf()}function v1(e,t){return B$(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function y1(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var b1={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},x1=function(e){return e.pop=`pop`,e.push=`push`,e}({}),S1=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function C1(e){if(!e)if(P$){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),u1(e)}var w1=/^[^#]+#/;function T1(e,t){return e.replace(w1,`#`)+t}function E1(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var D1=()=>({left:window.scrollX,top:window.scrollY});function O1(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=E1(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function k1(e,t){return(history.state?history.state.position-t:-1)+e}var A1=new Map;function j1(e,t){A1.set(e,t)}function M1(e){let t=A1.get(e);return A1.delete(e),t}function N1(e){return typeof e==`string`||e&&typeof e==`object`}function P1(e){return typeof e==`string`||typeof e==`symbol`}var F1=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),I1=Symbol(``);F1.MATCHER_NOT_FOUND,F1.NAVIGATION_GUARD_REDIRECT,F1.NAVIGATION_ABORTED,F1.NAVIGATION_CANCELLED,F1.NAVIGATION_DUPLICATED;function L1(e,t){return L$(Error(),{type:e,[I1]:!0},t)}function R1(e,t){return e instanceof Error&&I1 in e&&(t==null||!!(e.type&t))}function z1(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;ee&&i1(e)):[r&&i1(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function V1(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=B$(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var H1=Symbol(``),U1=Symbol(``),W1=Symbol(``),G1=Symbol(``),K1=Symbol(``);function q1(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function J1(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(L1(F1.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):N1(e)?c(L1(F1.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Y1(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(F$(s)){let c=(s.__vccOpts||s)[t];c&&a.push(J1(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=I$(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&J1(c,n,r,o,e,i)()}))}}return a}function X1(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oh1(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>h1(e,s))||i.push(s))}return[n,r,i]}var Z1=()=>location.protocol+`//`+location.host;function Q1(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),p1(n,``)}return p1(n,e)+r+i}function $1(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Q1(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:x1.pop,direction:u?u>0?S1.forward:S1.back:S1.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(L$({},e.state,{scroll:D1()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function e0(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?D1():null}}function t0(e){let{history:t,location:n}=window,r={value:Q1(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Z1()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,L$({},t.state,e0(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=L$({},i.value,t.state,{forward:e,scroll:D1()});a(o.current,o,!0),a(e,L$({},e0(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function n0(e){e=C1(e);let t=t0(e),n=$1(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=L$({location:``,base:e,go:r,createHref:T1.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function r0(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),n0(e)}var i0=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),a0=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(a0||{}),o0={type:i0.Static,value:``},s0=/[a-zA-Z0-9_]/;function c0(e){if(!e)return[[]];if(e===`/`)return[[o0]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=a0.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===a0.Static?a.push({type:i0.Static,value:l}):n===a0.Param||n===a0.ParamRegExp||n===a0.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:i0.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;st.length?t.length===1&&t[0]===d0.Static+d0.Segment?1:-1:0}function h0(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}var _0={strict:!1,end:!0,sensitive:!1};function v0(e,t,n){let r=L$(p0(c0(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function y0(e,t){let n=[],r=new Map;t=V$(_0,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=x0(e);s.aliasOf=r&&r.record;let l=V$(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(x0(L$({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=v0(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!C0(d)&&o(e.name)),D0(d)&&c(d),s.children){let e=s.children;for(let t=0;t{o(f)}:z$}function o(e){if(P1(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=T0(e,n);n.splice(t,0,e),e.record.name&&!C0(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw L1(F1.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=L$(b0(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&b0(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw L1(F1.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=L$({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:w0(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function b0(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function x0(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:S0(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function S0(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function C0(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function w0(e){return e.reduce((e,t)=>L$(e,t.meta),{})}function T0(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;h0(e,t[i])<0?r=i:n=i+1}let i=E0(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function E0(e){let t=e;for(;t=t.parent;)if(D0(t)&&h0(e,t)===0)return t}function D0({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function O0(e){let t=g(W1),n=g(G1),r=J(()=>{let n=ze(e.to);return t.resolve(n)}),i=J(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(h1.bind(null,i));if(o>-1)return o;let s=N0(e[t-2]);return t>1&&N0(i)===s&&a[a.length-1].path!==s?a.findIndex(h1.bind(null,e[t-2])):o}),a=J(()=>i.value>-1&&M0(n.params,r.value.params)),o=J(()=>i.value>-1&&i.value===n.matched.length-1&&g1(n.params,r.value.params));function s(n={}){if(j0(n)){let n=t[ze(e.replace)?`replace`:`push`](ze(e.to)).catch(z$);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:J(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function k0(e){return e.length===1?e[0]:e}var A0=u({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:O0,setup(e,{slots:t}){let n=Ne(O0(e)),{options:r}=g(W1),i=J(()=>({[P0(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[P0(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&k0(t.default(n));return e.custom?r:_e(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function j0(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function M0(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!B$(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function N0(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var P0=(e,t,n)=>e??t??n,F0=u({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=g(K1),i=J(()=>e.route||r.value),a=g(U1,0),o=J(()=>{let e=ze(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=J(()=>i.value.matched[o.value]);fe(U1,J(()=>o.value+1)),fe(H1,s),fe(K1,i);let c=H();return G(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!h1(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return I0(n.default,{Component:l,route:r});let u=o.props[a],d=_e(l,L$({},u?u===!0?r.params:typeof u==`function`?u(r):u:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:c}));return I0(n.default,{Component:d,route:r})||d}}});function I0(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var L0=F0;function R0(e){let n=y0(e.routes,e),r=e.parseQuery||z1,i=e.stringifyQuery||B1,a=e.history,o=q1(),s=q1(),c=q1(),l=q(b1),u=b1;P$&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=R$.bind(null,e=>``+e),f=R$.bind(null,s1),p=R$.bind(null,c1);function m(e,t){let r,i;return P1(e)?(r=n.getRecordMatcher(e),i=t):i=e,n.addRoute(i,r)}function h(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)}function g(){return n.getRoutes().map(e=>e.record)}function _(e){return!!n.getRecordMatcher(e)}function v(e,t){if(t=L$({},t||l.value),typeof e==`string`){let i=d1(r,e,t.path),o=n.resolve({path:i.path},t),s=a.createHref(i.fullPath);return L$(i,o,{params:p(o.params),hash:c1(i.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=L$({},e,{path:d1(r,e.path,t.path).path});else{let n=L$({},e.params);for(let e in n)n[e]??delete n[e];o=L$({},e,{params:f(n)}),t.params=f(t.params)}let s=n.resolve(o,t),c=e.hash||``;s.params=d(p(s.params));let u=f1(i,L$({},e,{hash:r1(c),path:s.path})),m=a.createHref(u);return L$({fullPath:u,hash:c,query:i===B1?V1(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function y(e){return typeof e==`string`?d1(r,e,l.value.path):L$({},e)}function b(e,t){if(u!==e)return L1(F1.NAVIGATION_CANCELLED,{from:t,to:e})}function x(e){return w(e)}function S(e){return x(L$(y(e),{replace:!0}))}function C(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=y(i):{path:i},i.params={}),L$({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function w(e,t){let n=u=v(e),r=l.value,a=e.state,o=e.force,s=e.replace===!0,c=C(n,r);if(c)return w(L$(y(c),{state:typeof c==`object`?L$({},a,c.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&m1(i,r,n)&&(f=L1(F1.NAVIGATION_DUPLICATED,{to:d,from:r}),ee(r,r,!0,!1)),(f?Promise.resolve(f):D(d,r)).catch(e=>R1(e)?R1(e,F1.NAVIGATION_GUARD_REDIRECT)?e:L(e):F(e,d,r)).then(e=>{if(e){if(R1(e,F1.NAVIGATION_GUARD_REDIRECT))return w(L$({replace:s},y(e.to),{state:typeof e.to==`object`?L$({},a,e.to.state):a,force:o}),t||d)}else e=k(d,r,!0,s,a);return O(d,r,e),e})}function T(e,t){let n=b(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=R.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function D(e,t){let n,[r,i,a]=X1(e,t);n=Y1(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(J1(r,e,t))});let c=T.bind(null,e,t);return n.push(c),ie(n).then(()=>{n=[];for(let r of o.list())n.push(J1(r,e,t));return n.push(c),ie(n)}).then(()=>{n=Y1(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(J1(r,e,t))});return n.push(c),ie(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(B$(r.beforeEnter))for(let i of r.beforeEnter)n.push(J1(i,e,t));else n.push(J1(r.beforeEnter,e,t));return n.push(c),ie(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Y1(a,`beforeRouteEnter`,e,t,E),n.push(c),ie(n))).then(()=>{n=[];for(let r of s.list())n.push(J1(r,e,t));return n.push(c),ie(n)}).catch(e=>R1(e,F1.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function O(e,t,n){c.list().forEach(r=>E(()=>r(e,t,n)))}function k(e,t,n,r,i){let o=b(e,t);if(o)return o;let s=t===b1,c=P$?history.state:{};n&&(r||s?a.replace(e.fullPath,L$({scroll:s&&c&&c.scroll},i)):a.push(e.fullPath,i)),l.value=e,ee(e,t,n,s),L()}let A;function j(){A||=a.listen((e,t,n)=>{if(!re.listening)return;let r=v(e),i=C(r,re.currentRoute.value);if(i){w(L$(i,{replace:!0,force:!0}),r).catch(z$);return}u=r;let o=l.value;P$&&j1(k1(o.fullPath,n.delta),D1()),D(r,o).catch(e=>R1(e,F1.NAVIGATION_ABORTED|F1.NAVIGATION_CANCELLED)?e:R1(e,F1.NAVIGATION_GUARD_REDIRECT)?(w(L$(y(e.to),{force:!0}),r).then(e=>{R1(e,F1.NAVIGATION_ABORTED|F1.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===x1.pop&&a.go(-1,!1)}).catch(z$),Promise.reject()):(n.delta&&a.go(-n.delta,!1),F(e,r,o))).then(e=>{e||=k(r,o,!1),e&&(n.delta&&!R1(e,F1.NAVIGATION_CANCELLED)?a.go(-n.delta,!1):n.type===x1.pop&&R1(e,F1.NAVIGATION_ABORTED|F1.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),O(r,o,e)}).catch(z$)})}let M=q1(),N=q1(),P;function F(e,t,n){L(e);let r=N.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function I(){return P&&l.value!==b1?Promise.resolve():new Promise((e,t)=>{M.add([e,t])})}function L(e){return P||(P=!e,j(),M.list().forEach(([t,n])=>e?n(e):t()),M.reset()),e}function ee(t,n,r,i){let{scrollBehavior:a}=e;if(!P$||!a)return Promise.resolve();let o=!r&&M1(k1(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return z().then(()=>a(t,n,o)).then(e=>e&&O1(e)).catch(e=>F(e,t,n))}let te=e=>a.go(e),ne,R=new Set,re={currentRoute:l,listening:!0,addRoute:m,removeRoute:h,clearRoutes:n.clearRoutes,hasRoute:_,getRoutes:g,resolve:v,options:e,push:x,replace:S,go:te,back:()=>te(-1),forward:()=>te(1),beforeEach:o.add,beforeResolve:s.add,afterEach:c.add,onError:N.add,isReady:I,install(e){e.component(`RouterLink`,A0),e.component(`RouterView`,L0),e.config.globalProperties.$router=re,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>ze(l)}),P$&&!ne&&l.value===b1&&(ne=!0,x(a.location).catch(e=>{}));let n={};for(let e in b1)Object.defineProperty(n,e,{get:()=>l.value[e],enumerable:!0});e.provide(W1,re),e.provide(G1,t(n)),e.provide(K1,l);let r=e.unmount;R.add(e),e.unmount=function(){R.delete(e),R.size<1&&(u=b1,A&&A(),A=null,l.value=b1,ne=!1,P=!1),r()}}};function ie(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return re}function z0(){return g(W1)}function B0(e){return g(G1)}var V0=u({__name:`App`,setup(e){let t=z0(),n=B0(),r=H(!1),i=H([String(n.name)]);G(()=>n.name,e=>{i.value=[String(e)]});let a=[{key:`Dashboard`,icon:qZ,label:`仪表盘`},{key:`Settings`,icon:UZ,label:`系统设置`},{key:`Configs`,icon:aQ,label:`品牌配置`},{key:`SysCategories`,icon:zZ,label:`默认分类`},{key:`Personas`,icon:lQ,label:`AI 性格`},{key:`Avatars`,icon:ZZ,label:`AI 形象`},{key:`Stickers`,icon:tQ,label:`表情包库`},{key:`Users`,icon:dn,label:`用户管理`}];return(e,n)=>{let o=s(`a-menu-item`),c=s(`a-menu`),l=s(`a-layout-sider`),u=s(`router-view`),d=s(`a-layout-content`),f=s(`a-layout`);return L(),Jt(f,{style:{"min-height":`100vh`}},{default:P(()=>[U(l,{collapsed:r.value,"onUpdate:collapsed":n[2]||=e=>r.value=e,collapsible:``,theme:`light`,width:200,style:{"border-right":`1px solid #f0f0f0`}},{default:P(()=>[n[3]||=Fe(`div`,{style:{padding:`18px 20px`,"font-size":`16px`,"font-weight":`700`,"white-space":`nowrap`,overflow:`hidden`}},[Fe(`span`,{style:{color:`#25211E`,"margin-right":`6px`}},`✎`),en(`记之 Admin `)],-1),U(c,{selectedKeys:i.value,"onUpdate:selectedKeys":n[0]||=e=>i.value=e,mode:`inline`,style:{borderRight:0},onClick:n[1]||=({key:e})=>ze(t).push({name:e})},{default:P(()=>[(L(),He($e,null,an(a,e=>U(o,{key:e.key},{default:P(()=>[(L(),Jt(T(e.icon))),Fe(`span`,null,Et(e.label),1)]),_:2},1024)),64))]),_:1},8,[`selectedKeys`]),n[4]||=Fe(`div`,{style:{position:`absolute`,bottom:`16px`,left:`20px`,"font-size":`11px`,color:`#bbb`}},`v20260718-1630`,-1)]),_:1},8,[`collapsed`]),U(f,null,{default:P(()=>[U(d,{style:{margin:`18px 20px`,padding:`20px`,background:`#fff`,"border-radius":`10px`,"min-height":`360px`}},{default:P(()=>[U(u)]),_:1})]),_:1})]),_:1})}}}),H0=`modulepreload`,U0=function(e){return`/`+e},W0={},G0=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=U0(t,n),t=s(t),t in W0)return;W0[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:H0,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},K0=R0({history:r0(),routes:[{path:`/`,redirect:`/dashboard`},{path:`/dashboard`,name:`Dashboard`,component:()=>G0(()=>import(`./Dashboard-Bz-m6xqH.js`),__vite__mapDeps([0,1,2,3]))},{path:`/settings`,name:`Settings`,component:()=>G0(()=>import(`./Settings-CYKsnZ8p.js`),__vite__mapDeps([4,1,3]))},{path:`/configs`,name:`Configs`,component:()=>G0(()=>import(`./Configs-B71XpYgR.js`),__vite__mapDeps([5,1,3]))},{path:`/categories`,name:`SysCategories`,component:()=>G0(()=>import(`./SysCategories-BOgkBEQn.js`),__vite__mapDeps([6,1,7,3]))},{path:`/personas`,name:`Personas`,component:()=>G0(()=>import(`./Personas-DuQ1Lxau.js`),__vite__mapDeps([8,1,7,3]))},{path:`/avatars`,name:`Avatars`,component:()=>G0(()=>import(`./Avatars-C3PMIHdp.js`),__vite__mapDeps([9,1,7,3]))},{path:`/stickers`,name:`Stickers`,component:()=>G0(()=>import(`./Stickers-CJkJknEj.js`),__vite__mapDeps([10,1,7,3]))},{path:`/users`,name:`Users`,component:()=>G0(()=>import(`./Users-DYYWsaDQ.js`),__vite__mapDeps([11,1,12,3]))}]}),q0=Rt(V0);q0.use(K0),q0.use(N$),q0.mount(`#app`);export{yn as t}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/assets/index-Dt7HDEKz.js b/backend/MiaoJiZhang.Api/wwwroot/assets/index-Dt7HDEKz.js new file mode 100644 index 0000000..b857f69 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/assets/index-Dt7HDEKz.js @@ -0,0 +1,363 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-CQIRtW2A.js","assets/config-provider-q7ATIdCu.js","assets/TeamOutlined-0klbs6LP.js","assets/api-C4vz6nB3.js","assets/Settings-EMIo5EVq.js","assets/Configs-CBb0vA8L.js","assets/SysCategories-BGspm7GG.js","assets/EditOutlined-CeylGsUo.js","assets/Personas-CyY-EFRT.js","assets/Avatars-MuMOZ3tF.js","assets/Stickers-5pBxfoSQ.js","assets/Users-B1R9gLaP.js","assets/ReloadOutlined-CVrW_3-b.js"])))=>i.map(i=>d[i]); +import{$ as e,$n as t,$t as n,A as r,An as i,At as a,B as o,Bn as s,Bt as c,C as l,Cn as u,Ct as d,D as f,Dn as p,Dt as m,E as h,En as g,Et as _,F as v,Fn as y,Ft as b,G as x,Gn as S,Gt as C,H as w,Hn as T,Ht as E,I as D,In as O,It as k,J as A,Jn as j,Jt as M,K as N,Kn as P,Kt as F,L as I,Ln as L,Lt as ee,M as te,Mn as ne,Mt as R,N as re,Nn as ie,Nt as ae,O as oe,On as z,Ot as se,P as B,Pn as V,Pt as ce,Q as le,Qn as H,Qt as ue,R as de,Rn as fe,Rt as pe,S as me,Sn as U,St as he,T as ge,Tn as _e,Tt as W,U as ve,Un as ye,Ut as be,V as xe,Vn as Se,Vt as Ce,W as we,Wn as G,Wt as Te,X as Ee,Xn as De,Xt as Oe,Y as ke,Yn as Ae,Yt as je,Z as Me,Zn as Ne,Zt as K,_ as Pe,_n as Fe,_t as Ie,a as Le,an as Re,ar as ze,at as Be,b as Ve,bn as He,bt as Ue,c as We,cn as Ge,ct as Ke,d as qe,dn as Je,dt as Ye,en as Xe,er as q,et as Ze,f as Qe,fn as $e,ft as et,g as tt,gn as J,gt as nt,h as rt,hn as it,ht as at,i as ot,in as Y,ir as st,it as ct,j as lt,jn as ut,jt as dt,k as X,kn as ft,kt as pt,l as mt,ln as ht,lt as gt,m as _t,mn as vt,mt as yt,n as bt,nn as xt,nr as St,nt as Ct,o as wt,on as Tt,or as Et,ot as Dt,p as Ot,pn as kt,pt as At,q as jt,qn as Mt,qt as Nt,r as Pt,rn as Z,rr as Ft,rt as It,s as Lt,sn as Rt,st as zt,t as Bt,tn as Vt,tr as Ht,tt as Ut,u as Wt,un as Gt,ut as Kt,v as qt,vn as Jt,vt as Yt,w as Xt,wn as Zt,wt as Qt,x as $t,xn as en,xt as Q,y as tn,yt as nn,z as rn,zn as an,zt as on}from"./config-provider-q7ATIdCu.js";import{n as sn,r as cn,t as ln}from"./EditOutlined-CeylGsUo.js";import{t as un}from"./ReloadOutlined-CVrW_3-b.js";import{t as dn}from"./TeamOutlined-0klbs6LP.js";var fn=Object.create,pn=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,hn=Object.getOwnPropertyNames,gn=Object.getPrototypeOf,_n=Object.prototype.hasOwnProperty,vn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),yn=(e,t)=>{let n={};for(var r in e)pn(n,r,{get:e[r],enumerable:!0});return t||pn(n,Symbol.toStringTag,{value:`Module`}),n},bn=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=hn(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=mn(t,s))||r.enumerable});return e},xn=(e,t,n)=>(n=e==null?{}:fn(gn(e)),bn(t||!e||!e.__esModule?pn(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Sn=(function(){if(typeof Map<`u`)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t?(n=r,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){!Cn||this.connected_||(document.addEventListener(`transitionend`,this.onTransitionEnd_),window.addEventListener(`resize`,this.refresh),An?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(`DOMSubtreeModified`,this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Cn||!this.connected_||(document.removeEventListener(`transitionend`,this.onTransitionEnd_),window.removeEventListener(`resize`,this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(`DOMSubtreeModified`,this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?``:t;kn.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||=new e,this.instance_},e.instance_=null,e}(),Mn=(function(e,t){for(var n=0,r=Object.keys(t);n`u`||!(Element instanceof Object))){if(!(e instanceof Nn(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)||(t.set(e,new Gn(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof Nn(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new Kn(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Jn=typeof WeakMap<`u`?new WeakMap:new Sn,Yn=function(){function e(t){if(!(this instanceof e))throw TypeError(`Cannot call a class as a function.`);if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);var n=new qn(t,jn.getInstance(),this);Jn.set(this,n)}return e}();[`observe`,`unobserve`,`disconnect`].forEach(function(e){Yn.prototype[e]=function(){var t;return(t=Jn.get(this))[e].apply(t,arguments)}});var Xn=(function(){return wn.ResizeObserver===void 0?Yn:wn.ResizeObserver})(),Zn=(e,t)=>{let n=Z({},e);return Object.keys(t).forEach(e=>{let r=n[e];if(r)r.type||r.default?r.default=t[e]:r.def?r.def(t[e]):n[e]={type:r,default:t[e]};else throw Error(`not have ${e} prop`)}),n},Qn=u({compatConfig:{MODE:3},name:`ResizeObserver`,props:{disabled:Boolean,onResize:Function},emits:[`resize`],setup(e,t){let{slots:n}=t,r=Ne({width:0,height:0,offsetHeight:0,offsetWidth:0}),i=null,a=null,o=()=>{a&&=(a.disconnect(),null)},s=t=>{let{onResize:n}=e,i=t[0].target,{width:a,height:o}=i.getBoundingClientRect(),{offsetWidth:s,offsetHeight:c}=i,l=Math.floor(a),u=Math.floor(o);if(r.width!==l||r.height!==u||r.offsetWidth!==s||r.offsetHeight!==c){let e={width:l,height:u,offsetWidth:s,offsetHeight:c};Z(r,e),n&&Promise.resolve().then(()=>{n(Z(Z({},e),{offsetWidth:s,offsetHeight:c}),i)})}},c=Zt(),l=()=>{let{disabled:t}=e;if(t){o();return}let n=ae(c);n!==i&&(o(),i=n),!a&&n&&(a=new Xn(s),a.observe(n))};return V(()=>{l()}),O(()=>{l()}),y(()=>{o()}),G(()=>e.disabled,()=>{l()},{flush:`post`}),()=>n.default?.call(n)[0]}}),$n=e=>setTimeout(e,16),er=e=>clearTimeout(e);typeof window<`u`&&`requestAnimationFrame`in window&&($n=e=>window.requestAnimationFrame(e),er=e=>window.cancelAnimationFrame(e));var tr=0,nr=new Map;function rr(e){nr.delete(e)}function ir(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;tr+=1;let n=tr;function r(t){if(t===0)rr(n),e();else{let e=$n(()=>{r(t-1)});nr.set(n,e)}}return r(t),n}ir.cancel=e=>{let t=nr.get(e);return rr(t),er(t)};function ar(e){let t,n=n=>()=>{t=null,e(...n)},r=function(){t??=ir(n([...arguments]))};return r.cancel=()=>{ir.cancel(t),t=null},r}var or=!1;try{let e=Object.defineProperty({},"passive",{get(){or=!0}});window.addEventListener(`testPassive`,null,e),window.removeEventListener(`testPassive`,null,e)}catch{}var sr=or;function cr(e,t,n,r){if(e&&e.addEventListener){let i=r;i===void 0&&sr&&(t===`touchstart`||t===`touchmove`||t===`wheel`)&&(i={passive:!1}),e.addEventListener(t,n,i)}return{remove:()=>{e&&e.removeEventListener&&e.removeEventListener(t,n)}}}function lr(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function ur(e,t,n){if(n!==void 0&&t.top>e.top-n)return`${n+t.top}px`}function dr(e,t,n){if(n!==void 0&&t.bottomt.target===e);n?n.affixList.push(t):(n={target:e,affixList:[t],eventHandlers:{}},pr.push(n),fr.forEach(t=>{n.eventHandlers[t]=cr(e,t,()=>{n.affixList.forEach(e=>{let{lazyUpdatePosition:t}=e.exposed;t()},(t===`touchstart`||t===`touchmove`)&&sr?{passive:!0}:!1)})}))}function hr(e){let t=pr.find(t=>{let n=t.affixList.some(t=>t===e);return n&&(t.affixList=t.affixList.filter(t=>t!==e)),n});t&&t.affixList.length===0&&(pr=pr.filter(e=>e!==t),fr.forEach(e=>{let n=t.eventHandlers[e];n&&n.remove&&n.remove()}))}var gr={};function _r(e,t){}function vr(e,t){}function yr(e,t,n){!t&&!gr[n]&&(e(!1,n),gr[n]=!0)}function br(e,t){yr(_r,e,t)}function xr(e,t){yr(vr,e,t)}function Sr(e,t){let{path:n,parentSelectors:r}=t;br(!1,`[Ant Design Vue CSS-in-JS] ${n?`Error in '${n}': `:``}${e}${r.length?` Selector info: ${r.join(` -> `)}`:``}`)}function Cr(e){return(e.match(/:not\(([^)]*)\)/)?.[1]||``).split(/(\[[^[]*])|(?=[.#])/).filter(e=>e).length>1}function wr(e){return e.parentSelectors.reduce((e,t)=>e?t.includes(`&`)?t.replace(/&/g,e):`${e} ${t}`:t,``)}var Tr=(e,t,n)=>{let r=wr(n).match(/:not\([^)]*\)/g)||[];r.length>0&&r.some(Cr)&&Sr(`Concat ':not' selector not support in legacy browsers.`,n)},Er=(e,t,n)=>{switch(e){case`marginLeft`:case`marginRight`:case`paddingLeft`:case`paddingRight`:case`left`:case`right`:case`borderLeft`:case`borderLeftWidth`:case`borderLeftStyle`:case`borderLeftColor`:case`borderRight`:case`borderRightWidth`:case`borderRightStyle`:case`borderRightColor`:case`borderTopLeftRadius`:case`borderTopRightRadius`:case`borderBottomLeftRadius`:case`borderBottomRightRadius`:Sr(`You seem to be using non-logical property '${e}' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n);return;case`margin`:case`padding`:case`borderWidth`:case`borderStyle`:if(typeof t==`string`){let r=t.split(` `).map(e=>e.trim());r.length===4&&r[1]!==r[3]&&Sr(`You seem to be using '${e}' property with different left ${e} and right ${e}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n)}return;case`clear`:case`textAlign`:(t===`left`||t===`right`)&&Sr(`You seem to be using non-logical value '${t}' of ${e}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n);return;case`borderRadius`:typeof t==`string`&&t.split(`/`).map(e=>e.trim()).reduce((e,t)=>{if(e)return e;let n=t.split(` `).map(e=>e.trim());return n.length>=2&&n[0]!==n[1]||n.length===3&&n[1]!==n[2]||n.length===4&&n[2]!==n[3]||e},!1)&&Sr(`You seem to be using non-logical value '${t}' of ${e}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,n);return;default:}},Dr=(e,t,n)=>{n.parentSelectors.some(e=>e.split(`,`).some(e=>e.split(`&`).length>2))&&Sr("Should not use more than one `&` in a selector.",n)};function Or(e){if(typeof e==`number`)return[e];let t=String(e).split(/\s+/),n=``,r=0;return t.reduce((e,t)=>(t.includes(`(`)?(n+=t,r+=t.split(`(`).length-1):t.includes(`)`)?(n+=` ${t}`,r-=t.split(`)`).length-1,r===0&&(e.push(n),n=``)):r>0?n+=` ${t}`:e.push(t),e),[])}function kr(e){return e.notSplit=!0,e}var Ar={inset:[`top`,`right`,`bottom`,`left`],insetBlock:[`top`,`bottom`],insetBlockStart:[`top`],insetBlockEnd:[`bottom`],insetInline:[`left`,`right`],insetInlineStart:[`left`],insetInlineEnd:[`right`],marginBlock:[`marginTop`,`marginBottom`],marginBlockStart:[`marginTop`],marginBlockEnd:[`marginBottom`],marginInline:[`marginLeft`,`marginRight`],marginInlineStart:[`marginLeft`],marginInlineEnd:[`marginRight`],paddingBlock:[`paddingTop`,`paddingBottom`],paddingBlockStart:[`paddingTop`],paddingBlockEnd:[`paddingBottom`],paddingInline:[`paddingLeft`,`paddingRight`],paddingInlineStart:[`paddingLeft`],paddingInlineEnd:[`paddingRight`],borderBlock:kr([`borderTop`,`borderBottom`]),borderBlockStart:kr([`borderTop`]),borderBlockEnd:kr([`borderBottom`]),borderInline:kr([`borderLeft`,`borderRight`]),borderInlineStart:kr([`borderLeft`]),borderInlineEnd:kr([`borderRight`]),borderBlockWidth:[`borderTopWidth`,`borderBottomWidth`],borderBlockStartWidth:[`borderTopWidth`],borderBlockEndWidth:[`borderBottomWidth`],borderInlineWidth:[`borderLeftWidth`,`borderRightWidth`],borderInlineStartWidth:[`borderLeftWidth`],borderInlineEndWidth:[`borderRightWidth`],borderBlockStyle:[`borderTopStyle`,`borderBottomStyle`],borderBlockStartStyle:[`borderTopStyle`],borderBlockEndStyle:[`borderBottomStyle`],borderInlineStyle:[`borderLeftStyle`,`borderRightStyle`],borderInlineStartStyle:[`borderLeftStyle`],borderInlineEndStyle:[`borderRightStyle`],borderBlockColor:[`borderTopColor`,`borderBottomColor`],borderBlockStartColor:[`borderTopColor`],borderBlockEndColor:[`borderBottomColor`],borderInlineColor:[`borderLeftColor`,`borderRightColor`],borderInlineStartColor:[`borderLeftColor`],borderInlineEndColor:[`borderRightColor`],borderStartStartRadius:[`borderTopLeftRadius`],borderStartEndRadius:[`borderTopRightRadius`],borderEndStartRadius:[`borderBottomLeftRadius`],borderEndEndRadius:[`borderBottomRightRadius`]};function jr(e){return{_skip_check_:!0,value:e}}var Mr={visit:e=>{let t={};return Object.keys(e).forEach(n=>{let r=e[n],i=Ar[n];if(i&&(typeof r==`number`||typeof r==`string`)){let e=Or(r);i.length&&i.notSplit?i.forEach(e=>{t[e]=jr(r)}):i.length===1?t[i[0]]=jr(r):i.length===2?i.forEach((n,r)=>{t[n]=jr(e[r]??e[0])}):i.length===4?i.forEach((n,r)=>{t[n]=jr(e[r]??e[r-2]??e[0])}):t[n]=r}else t[n]=r}),t}},Nr=/url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;function Pr(e,t){let n=10**(t+1),r=Math.floor(e*n);return Math.round(r/10)*10/n}var Fr={Theme:le,createTheme:Me,useStyleRegister:A,useCacheToken:Ee,createCache:Be,useStyleInject:Dt,useStyleProvider:zt,Keyframes:N,extractStyle:jt,legacyLogicalPropertiesTransformer:Mr,px2remTransformer:function(){let{rootValue:e=16,precision:t=5,mediaQuery:n=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(n,r)=>{if(!r)return n;let i=parseFloat(r);return i<=1?n:`${Pr(i/e,t)}rem`};return{visit:e=>{let t=Z({},e);return Object.entries(e).forEach(e=>{let[i,a]=e;if(typeof a==`string`&&a.includes(`px`)){let e=a.replace(Nr,r);t[i]=e}!ke[i]&&typeof a==`number`&&a!==0&&(t[i]=`${a}px`.replace(Nr,r));let o=i.trim();if(o.startsWith(`@`)&&o.includes(`px`)&&n){let e=i.replace(Nr,r);t[e]=t[i],delete t[i]}}),t}}},logicalPropertiesLinter:Er,legacyNotSelectorLinter:Tr,parentSelectorLinter:Dr,StyleProvider:ct},Ir=[`blue`,`purple`,`cyan`,`green`,`magenta`,`pink`,`red`,`orange`,`yellow`,`volcano`,`geekblue`,`lime`,`gold`],Lr=e=>({color:e.colorLink,textDecoration:`none`,outline:`none`,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}}),Rr=(e,t,n,r,i)=>{let a=e/2,o=a,s=n*1/Math.sqrt(2),c=a-n*(1-1/Math.sqrt(2)),l=a-1/Math.sqrt(2)*t,u=n*(Math.sqrt(2)-1)+1/Math.sqrt(2)*t,d=2*a-l,f=u,p=2*a-s,m=c,h=2*a-0,g=o,_=a*Math.sqrt(2)+n*(Math.sqrt(2)-2),v=n*(Math.sqrt(2)-1);return{pointerEvents:`none`,width:e,height:e,overflow:`hidden`,"&::after":{content:`""`,position:`absolute`,width:_,height:_,bottom:0,insetInline:0,margin:`auto`,borderRadius:{_skip_check_:!0,value:`0 0 ${t}px 0`},transform:`translateY(50%) rotate(-135deg)`,boxShadow:i,zIndex:0,background:`transparent`},"&::before":{position:`absolute`,bottom:0,insetInlineStart:0,width:e,height:e/2,background:r,clipPath:{_multi_value_:!0,value:[`polygon(${v}px 100%, 50% ${v}px, ${2*a-v}px 100%, ${v}px 100%)`,`path('M 0 ${o} A ${n} ${n} 0 0 0 ${s} ${c} L ${l} ${u} A ${t} ${t} 0 0 1 ${d} ${f} L ${p} ${m} A ${n} ${n} 0 0 0 ${h} ${g} Z')`]},content:`""`}}};function zr(e,t){return Ir.reduce((n,r)=>{let i=e[`${r}-1`],a=e[`${r}-3`],o=e[`${r}-6`],s=e[`${r}-7`];return Z(Z({},n),t(r,{lightColor:i,lightBorderColor:a,darkColor:o,textColor:s}))},{})}function Br(e,t){let n=Z({},e);for(let e=0;e{let{componentCls:t}=e;return{[t]:{position:`fixed`,zIndex:e.zIndexPopup}}},Hr=v(`Affix`,e=>[Vr(B(e,{zIndexPopup:e.zIndexBase+10}))]);function Ur(){return typeof window<`u`?window:null}var Wr;(function(e){e[e.None=0]=`None`,e[e.Prepare=1]=`Prepare`})(Wr||={});var Gr=a(u({compatConfig:{MODE:3},name:`AAffix`,inheritAttrs:!1,props:{offsetTop:Number,offsetBottom:Number,target:{type:Function,default:Ur},prefixCls:String,onChange:Function,onTestUpdatePosition:Function},setup(e,t){let{slots:n,emit:r,expose:i,attrs:a}=t,o=q(),s=q(),c=Ne({affixStyle:void 0,placeholderStyle:void 0,status:Wr.None,lastAffix:!1,prevTarget:null,timeout:null}),l=Zt(),u=J(()=>e.offsetBottom===void 0&&e.offsetTop===void 0?0:e.offsetTop),d=J(()=>e.offsetBottom),f=()=>{let{status:t,lastAffix:n}=c,{target:i}=e;if(t!==Wr.Prepare||!s.value||!o.value||!i)return;let a=i();if(!a)return;let l={status:Wr.None},f=lr(o.value);if(f.top===0&&f.left===0&&f.width===0&&f.height===0)return;let p=lr(a),m=ur(f,p,u.value),h=dr(f,p,d.value);if(!(f.top===0&&f.left===0&&f.width===0&&f.height===0)){if(m!==void 0){let e=`${f.width}px`,t=`${f.height}px`;l.affixStyle={position:`fixed`,top:m,width:e,height:t},l.placeholderStyle={width:e,height:t}}else if(h!==void 0){let e=`${f.width}px`,t=`${f.height}px`;l.affixStyle={position:`fixed`,bottom:h,width:e,height:t},l.placeholderStyle={width:e,height:t}}l.lastAffix=!!l.affixStyle,n!==l.lastAffix&&r(`change`,l.lastAffix),Z(c,l)}},p=()=>{Z(c,{status:Wr.Prepare,affixStyle:void 0,placeholderStyle:void 0})},m=ar(()=>{p()}),h=ar(()=>{let{target:t}=e,{affixStyle:n}=c;if(t&&n){let e=t();if(e&&o.value){let t=lr(e),r=lr(o.value),i=ur(r,t,u.value),a=dr(r,t,d.value);if(i!==void 0&&n.top===i||a!==void 0&&n.bottom===a)return}}p()});i({updatePosition:m,lazyUpdatePosition:h}),G(()=>e.target,e=>{let t=e?.()||null;c.prevTarget!==t&&(hr(l),t&&(mr(t,l),m()),c.prevTarget=t)}),G(()=>[e.offsetTop,e.offsetBottom],m),V(()=>{let{target:t}=e;t&&(c.timeout=setTimeout(()=>{mr(t(),l),m()}))}),O(()=>{f()}),y(()=>{clearTimeout(c.timeout),hr(l),m.cancel(),h.cancel()});let{prefixCls:g}=X(`affix`,e),[_,v]=Hr(g);return()=>{let{affixStyle:t,placeholderStyle:r,status:i}=c,l=K({[g.value]:t,[v.value]:!0}),u=Br(e,[`prefixCls`,`offsetTop`,`offsetBottom`,`target`,`onChange`,`onTestUpdatePosition`]);return _(U(Qn,{onResize:m},{default:()=>[U(`div`,Y(Y(Y({},u),a),{},{ref:o,"data-measure-status":i}),[t&&U(`div`,{style:r,"aria-hidden":`true`},null),U(`div`,{class:l,ref:s,style:t},[n.default?.call(n)])])]}))}}}));function Kr(e){return typeof e==`object`&&!!e&&e.nodeType===1}function qr(e,t){return(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`}function Jr(e,t){if(e.clientHeightt||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0}var Xr=function(e,t){var n=window,r=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,c=typeof o==`function`?o:function(e){return e!==o};if(!Kr(e))throw TypeError(`Invalid target`);for(var l,u=document.scrollingElement||document.documentElement,d=[],f=e;Kr(f)&&c(f);){if((f=(l=f).parentElement??(l.getRootNode().host||null))===u){d.push(f);break}f!=null&&f===document.body&&Jr(f)&&!Jr(document.documentElement)||f!=null&&Jr(f,s)&&d.push(f)}for(var p=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,h=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,_=e.getBoundingClientRect(),v=_.height,y=_.width,b=_.top,x=_.right,S=_.bottom,C=_.left,w=i===`start`||i===`nearest`?b:i===`end`?S:b+v/2,T=a===`center`?C+y/2:a===`end`?x:C,E=[],D=0;D=0&&C>=0&&S<=m&&x<=p&&b>=M&&S<=P&&C>=F&&x<=N)return E;var I=getComputedStyle(O),L=parseInt(I.borderLeftWidth,10),ee=parseInt(I.borderTopWidth,10),te=parseInt(I.borderRightWidth,10),ne=parseInt(I.borderBottomWidth,10),R=0,re=0,ie=`offsetWidth`in O?O.offsetWidth-O.clientWidth-L-te:0,ae=`offsetHeight`in O?O.offsetHeight-O.clientHeight-ee-ne:0,oe=`offsetWidth`in O?O.offsetWidth===0?0:j/O.offsetWidth:0,z=`offsetHeight`in O?O.offsetHeight===0?0:A/O.offsetHeight:0;if(u===O)R=i===`start`?w:i===`end`?w-m:i===`nearest`?Yr(g,g+m,m,ee,ne,g+w,g+w+v,v):w-m/2,re=a===`start`?T:a===`center`?T-p/2:a===`end`?T-p:Yr(h,h+p,p,L,te,h+T,h+T+y,y),R=Math.max(0,R+g),re=Math.max(0,re+h);else{R=i===`start`?w-M-ee:i===`end`?w-P+ne+ae:i===`nearest`?Yr(M,P,A,ee,ne+ae,w,w+v,v):w-(M+A/2)+ae/2,re=a===`start`?T-F-L:a===`center`?T-(F+j/2)+ie/2:a===`end`?T-N+te+ie:Yr(F,N,j,L,te+ie,T,T+y,y);var se=O.scrollLeft,B=O.scrollTop;w+=B-(R=Math.max(0,Math.min(B+R/z,O.scrollHeight-A/z+ae))),T+=se-(re=Math.max(0,Math.min(se+re/oe,O.scrollWidth-j/oe+ie)))}E.push({el:O,top:R,left:re})}return E};function Zr(e){return e===Object(e)&&Object.keys(e).length!==0}function Qr(e,t){t===void 0&&(t=`auto`);var n=`scrollBehavior`in document.body.style;e.forEach(function(e){var r=e.el,i=e.top,a=e.left;r.scroll&&n?r.scroll({top:i,left:a,behavior:t}):(r.scrollTop=i,r.scrollLeft=a)})}function $r(e){return e===!1?{block:`end`,inline:`nearest`}:Zr(e)?e:{block:`start`,inline:`nearest`}}function ei(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(Zr(t)&&typeof t.behavior==`function`)return t.behavior(n?Xr(e,t):[]);if(n){var r=$r(t);return Qr(Xr(e,r),r.behavior)}}function ti(e,t,n,r){let i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function ni(e){return e!=null&&e===e.window}function ri(e,t){if(typeof window>`u`)return 0;let n=t?`scrollTop`:`scrollLeft`,r=0;return ni(e)?r=e[t?`scrollY`:`scrollX`]:e instanceof Document?r=e.documentElement[n]:(e instanceof HTMLElement||e)&&(r=e[n]),e&&!ni(e)&&typeof r!=`number`&&(r=(e.ownerDocument??e).documentElement?.[n]),r}function ii(e){let{getContainer:t=()=>window,callback:n,duration:r=450}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t(),a=ri(i,!0),o=Date.now(),s=()=>{let t=Date.now()-o,c=ti(t>r?r:t,a,e,r);ni(i)?i.scrollTo(window.scrollX,c):i instanceof Document?i.documentElement.scrollTop=c:i.scrollTop=c,t{fe(oi,e)},ci=()=>g(oi,{registerLink:ai,unregisterLink:ai,scrollTo:ai,activeLink:J(()=>``),handleClick:ai,direction:J(()=>`vertical`)}),li=e=>{let{componentCls:t,holderOffsetBlock:n,motionDurationSlow:r,lineWidthBold:i,colorPrimary:a,lineType:o,colorSplit:s}=e;return{[`${t}-wrapper`]:{marginBlockStart:-n,paddingBlockStart:n,backgroundColor:`transparent`,[t]:Z(Z({},rn(e)),{position:`relative`,paddingInlineStart:i,[`${t}-link`]:{paddingBlock:e.anchorPaddingBlock,paddingInline:`${e.anchorPaddingInline}px 0`,"&-title":Z(Z({},xe),{position:`relative`,display:`block`,marginBlockEnd:e.anchorTitleBlock,color:e.colorText,transition:`all ${e.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${t}-link-title`]:{color:e.colorPrimary},[`${t}-link`]:{paddingBlock:e.anchorPaddingBlockSecondary}}}),[`&:not(${t}-wrapper-horizontal)`]:{[t]:{"&::before":{position:`absolute`,left:{_skip_check_:!0,value:0},top:0,height:`100%`,borderInlineStart:`${i}px ${o} ${s}`,content:`" "`},[`${t}-ink`]:{position:`absolute`,left:{_skip_check_:!0,value:0},display:`none`,transform:`translateY(-50%)`,transition:`top ${r} ease-in-out`,width:i,backgroundColor:a,[`&${t}-ink-visible`]:{display:`inline-block`}}}},[`${t}-fixed ${t}-ink ${t}-ink`]:{display:`none`}}}},ui=e=>{let{componentCls:t,motionDurationSlow:n,lineWidthBold:r,colorPrimary:i}=e;return{[`${t}-wrapper-horizontal`]:{position:`relative`,"&::before":{position:`absolute`,left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`1px ${e.lineType} ${e.colorSplit}`,content:`" "`},[t]:{overflowX:`scroll`,position:`relative`,display:`flex`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`},[`${t}-link:first-of-type`]:{paddingInline:0},[`${t}-ink`]:{position:`absolute`,bottom:0,transition:`left ${n} ease-in-out, width ${n} ease-in-out`,height:r,backgroundColor:i}}}}},di=v(`Anchor`,e=>{let{fontSize:t,fontSizeLG:n,padding:r,paddingXXS:i}=e,a=B(e,{holderOffsetBlock:i,anchorPaddingBlock:i,anchorPaddingBlockSecondary:i/2,anchorPaddingInline:r,anchorTitleBlock:t/14*3,anchorBallSize:n/2});return[li(a),ui(a)]}),fi=u({compatConfig:{MODE:3},name:`AAnchorLink`,inheritAttrs:!1,props:Zn({prefixCls:String,href:String,title:nn(),target:String,customTitleProps:Qt()},{href:`#`}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,i=null,{handleClick:a,scrollTo:o,unregisterLink:s,registerLink:c,activeLink:l}=ci(),{prefixCls:u}=X(`anchor`,e),d=t=>{let{href:n}=e;a(t,{title:i,href:n}),o(n)};return G(()=>e.href,(e,t)=>{z(()=>{s(t),c(e)})}),V(()=>{c(e.href)}),ut(()=>{s(e.href)}),()=>{let{href:t,target:a,title:o=n.title,customTitleProps:s={}}=e,c=u.value;i=typeof o==`function`?o(s):o;let f=l.value===t,p=K(`${c}-link`,{[`${c}-link-active`]:f},r.class),m=K(`${c}-link-title`,{[`${c}-link-title-active`]:f});return U(`div`,Y(Y({},r),{},{class:p}),[U(`a`,{class:m,href:t,title:typeof i==`string`?i:``,target:a,onClick:d},[n.customTitle?n.customTitle(s):i]),n.default?.call(n)])}}}),pi=((e,t,n)=>{br(e,`[ant-design-vue: ${t}] ${n}`)});function mi(){return window}function hi(e,t){if(!e.getClientRects().length)return 0;let n=e.getBoundingClientRect();return n.width||n.height?t===window?(t=e.ownerDocument.documentElement,n.top-t.clientTop):n.top-t.getBoundingClientRect().top:n.top}var gi=/#([\S ]+)$/,_i=u({compatConfig:{MODE:3},name:`AAnchor`,inheritAttrs:!1,props:{prefixCls:String,offsetTop:Number,bounds:Number,affix:{type:Boolean,default:!0},showInkInFixed:{type:Boolean,default:!1},getContainer:Function,wrapperClass:String,wrapperStyle:{type:Object,default:void 0},getCurrentAnchor:Function,targetOffset:Number,items:Ue(),direction:f.oneOf([`vertical`,`horizontal`]).def(`vertical`),onChange:Function,onClick:Function},setup(e,t){let{emit:n,attrs:r,slots:i,expose:a}=t,{prefixCls:o,getTargetContainer:s,direction:c}=X(`anchor`,e),l=J(()=>e.direction??`vertical`),u=H(null),d=H(),f=Ne({links:[],scrollContainer:null,scrollEvent:null,animating:!1}),p=H(null),m=J(()=>{let{getContainer:t}=e;return t||s?.value||mi}),h=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5,n=[],r=m.value();return f.links.forEach(i=>{let a=gi.exec(i.toString());if(!a)return;let o=document.getElementById(a[1]);if(o){let a=hi(o,r);at.top>e.top?t:e).link:``},g=t=>{let{getCurrentAnchor:r}=e;p.value!==t&&(p.value=typeof r==`function`?r(t):t,n(`change`,t))},_=t=>{let{offsetTop:n,targetOffset:r}=e;g(t);let i=gi.exec(t);if(!i)return;let a=document.getElementById(i[1]);if(!a)return;let o=m.value(),s=ri(o,!0)+hi(a,o);s-=r===void 0?n||0:r,f.animating=!0,ii(s,{callback:()=>{f.animating=!1},getContainer:m.value})};a({scrollTo:_});let v=()=>{if(f.animating)return;let{offsetTop:t,bounds:n,targetOffset:r}=e,i=h(r===void 0?t||0:r,n);g(i)},y=()=>{let e=d.value.querySelector(`.${o.value}-link-title-active`);if(e&&u.value){let t=l.value===`horizontal`;u.value.style.top=t?``:`${e.offsetTop+e.clientHeight/2}px`,u.value.style.height=t?``:`${e.clientHeight}px`,u.value.style.left=t?`${e.offsetLeft}px`:``,u.value.style.width=t?`${e.clientWidth}px`:``,t&&ei(e,{scrollMode:`if-needed`,block:`nearest`})}};si({registerLink:e=>{f.links.includes(e)||f.links.push(e)},unregisterLink:e=>{let t=f.links.indexOf(e);t!==-1&&f.links.splice(t,1)},activeLink:p,scrollTo:_,handleClick:(e,t)=>{n(`click`,e,t)},direction:l}),V(()=>{z(()=>{let e=m.value();f.scrollContainer=e,f.scrollEvent=cr(f.scrollContainer,`scroll`,v),v()})}),ut(()=>{f.scrollEvent&&f.scrollEvent.remove()}),O(()=>{if(f.scrollEvent){let e=m.value();f.scrollContainer!==e&&(f.scrollContainer=e,f.scrollEvent.remove(),f.scrollEvent=cr(f.scrollContainer,`scroll`,v),v())}y()});let b=e=>Array.isArray(e)?e.map(e=>{let{children:t,key:n,href:r,target:a,class:o,style:s,title:c}=e;return U(fi,{key:n,href:r,target:a,class:o,style:s,title:c,customTitleProps:e},{default:()=>[l.value===`vertical`?b(t):null],customTitle:i.customTitle})}):null,[x,S]=di(o);return()=>{let{offsetTop:t,affix:n,showInkInFixed:a}=e,s=o.value,f=K(`${s}-ink`,{[`${s}-ink-visible`]:p.value}),h=K(S.value,e.wrapperClass,`${s}-wrapper`,{[`${s}-wrapper-horizontal`]:l.value===`horizontal`,[`${s}-rtl`]:c.value===`rtl`}),g=K(s,{[`${s}-fixed`]:!n&&!a}),_=U(`div`,{class:h,style:Z({maxHeight:t?`calc(100vh - ${t}px)`:`100vh`},e.wrapperStyle),ref:d},[U(`div`,{class:g},[U(`span`,{class:f,ref:u},null),Array.isArray(e.items)?b(e.items):i.default?.call(i)])]);return x(n?U(Gr,Y(Y({},r),{},{offsetTop:t,target:m.value}),{default:()=>[_]}):_)}}});_i.Link=fi,_i.install=function(e){return e.component(_i.name,_i),e.component(_i.Link.name,_i.Link),e};var vi=_i;function yi(e,t){let{key:n}=e,r;return`value`in e&&({value:r}=e),n??(r===void 0?`rc-index-key-${t}`:r)}function bi(e,t){let{label:n,value:r,options:i}=e||{};return{label:n||(t?`children`:`label`),value:r||`value`,options:i||`options`}}function xi(e){let{fieldNames:t,childrenAsData:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],{label:i,value:a,options:o}=bi(t,!1);function s(e,t){e.forEach(e=>{let c=e[i];if(t||!(o in e)){let n=e[a];r.push({key:yi(e,r.length),groupOption:t,data:e,label:c,value:n})}else{let t=c;t===void 0&&n&&(t=e.label),r.push({key:yi(e,r.length),group:!0,data:e,label:t}),s(e[o],!0)}})}return s(e,!1),r}function Si(e){let t=Z({},e);return`props`in t||Object.defineProperty(t,"props",{get(){return t}}),t}function Ci(e,t){if(!t||!t.length)return null;let n=!1;function r(e,t){let[i,...a]=t;if(!i)return[e];let o=e.split(i);return n||=o.length>1,o.reduce((e,t)=>[...e,...r(t,a)],[]).filter(e=>e)}let i=r(e,t);return n?i:null}function wi(){return``}function Ti(e){return e?e.ownerDocument:window.document}function Ei(){}var Di=()=>({action:f.oneOfType([f.string,f.arrayOf(f.string)]).def([]),showAction:f.any.def([]),hideAction:f.any.def([]),getPopupClassNameFromAlign:f.any.def(wi),onPopupVisibleChange:Function,afterPopupVisibleChange:f.func.def(Ei),popup:f.any,arrow:f.bool.def(!0),popupStyle:{type:Object,default:void 0},prefixCls:f.string.def(`rc-trigger-popup`),popupClassName:f.string.def(``),popupPlacement:String,builtinPlacements:f.object,popupTransitionName:String,popupAnimation:f.any,mouseEnterDelay:f.number.def(0),mouseLeaveDelay:f.number.def(.1),zIndex:Number,focusDelay:f.number.def(0),blurDelay:f.number.def(.15),getPopupContainer:Function,getDocument:f.func.def(Ti),forceRender:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:!1},mask:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},popupAlign:f.object.def(()=>({})),popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},maskTransitionName:String,maskAnimation:String,stretch:String,alignPoint:{type:Boolean,default:void 0},autoDestroy:{type:Boolean,default:!1},mobile:Object,getTriggerDOMNode:Function}),Oi={visible:Boolean,prefixCls:String,zIndex:Number,destroyPopupOnHide:Boolean,forceRender:Boolean,arrow:{type:Boolean,default:!0},animation:[String,Object],transitionName:String,stretch:{type:String},align:{type:Object},point:{type:Object},getRootDomNode:{type:Function},getClassNameFromAlign:{type:Function},onAlign:{type:Function},onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function},onTouchstart:{type:Function}},ki=Z(Z({},Oi),{mobile:{type:Object}}),Ai=Z(Z({},Oi),{mask:Boolean,mobile:{type:Object},maskAnimation:String,maskTransitionName:String});function ji(e){let{prefixCls:t,visible:n,zIndex:r,mask:i,maskAnimation:a,maskTransitionName:o}=e;if(!i)return null;let s={};return(o||a)&&(s=h({prefixCls:t,transitionName:o,animation:a})),U(Re,Y({appear:!0},s),{default:()=>[Mt(U(`div`,{style:{zIndex:r},class:`${t}-mask`},null),[[Se(`if`),n]])]})}ji.displayName=`Mask`;var Mi=u({compatConfig:{MODE:3},name:`MobilePopupInner`,inheritAttrs:!1,props:ki,emits:[`mouseenter`,`mouseleave`,`mousedown`,`touchstart`,`align`],setup(e,t){let{expose:n,slots:r}=t,i=H();return n({forceAlign:()=>{},getElement:()=>i.value}),()=>{let{zIndex:t,visible:n,prefixCls:a,mobile:{popupClassName:o,popupStyle:s,popupMotion:c={},popupRender:l}={}}=e,u=Z({zIndex:t},s),d=ce(r.default?.call(r));d.length>1&&(d=U(`div`,{class:`${a}-content`},[d])),l&&(d=l(d));let f=K(a,o);return U(Re,Y({ref:i},c),{default:()=>[n?U(`div`,{class:f,style:u},[d]):null]})}}}),Ni=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Pi=[`measure`,`align`,null,`motion`],Fi=((e,t)=>{let n=q(null),r=q(),i=q(!1);function a(e){i.value||(n.value=e)}function o(){ir.cancel(r.value)}function s(e){o(),r.value=ir(()=>{let t=n.value;switch(n.value){case`align`:t=`motion`;break;case`motion`:t=`stable`;break;default:}a(t),e?.()})}return G(e,()=>{a(`measure`)},{immediate:!0,flush:`post`}),V(()=>{G(n,()=>{switch(n.value){case`measure`:t();break;default:}n.value&&(r.value=ir(()=>Ni(void 0,void 0,void 0,function*(){let e=Pi.indexOf(n.value),t=Pi[e+1];t&&e!==-1&&a(t)})))},{immediate:!0,flush:`post`})}),ut(()=>{i.value=!0,o()}),[n,s]}),Ii=(e=>{let t=q({width:0,height:0});function n(e){t.value={width:e.offsetWidth,height:e.offsetHeight}}return[J(()=>{let n={};if(e.value){let{width:r,height:i}=t.value;e.value.indexOf(`height`)!==-1&&i?n.height=`${i}px`:e.value.indexOf(`minHeight`)!==-1&&i&&(n.minHeight=`${i}px`),e.value.indexOf(`width`)!==-1&&r?n.width=`${r}px`:e.value.indexOf(`minWidth`)!==-1&&r&&(n.minWidth=`${r}px`)}return n}),n]});function Li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Ua(e,t,n,r){var i=La.clone(e),a={width:t.width,height:t.height};return r.adjustX&&i.left=n.left&&i.left+a.width>n.right&&(a.width-=i.left+a.width-n.right),r.adjustX&&i.left+a.width>n.right&&(i.left=Math.max(n.right-a.width,n.left)),r.adjustY&&i.top=n.top&&i.top+a.height>n.bottom&&(a.height-=i.top+a.height-n.bottom),r.adjustY&&i.top+a.height>n.bottom&&(i.top=Math.max(n.bottom-a.height,n.top)),La.mix(i,a)}function Wa(e){var t,n,r;if(!La.isWindow(e)&&e.nodeType!==9)t=La.offset(e),n=La.outerWidth(e),r=La.outerHeight(e);else{var i=La.getWindow(e);t={left:La.getWindowScrollLeft(i),top:La.getWindowScrollTop(i)},n=La.viewportWidth(i),r=La.viewportHeight(i)}return t.width=n,t.height=r,t}function Ga(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,a=e.height,o=e.left,s=e.top;return n===`c`?s+=a/2:n===`b`&&(s+=a),r===`c`?o+=i/2:r===`r`&&(o+=i),{left:o,top:s}}function Ka(e,t,n,r,i){var a=Ga(t,n[1]),o=Ga(e,n[0]),s=[o.left-a.left,o.top-a.top];return{left:Math.round(e.left-s[0]+r[0]-i[0]),top:Math.round(e.top-s[1]+r[1]-i[1])}}function qa(e,t,n){return e.leftn.right}function Ja(e,t,n){return e.topn.bottom}function Ya(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.right||r.top>=n.bottom}function ro(e,t,n){var r=n.target||t;return to(e,Wa(r),n,!no(r,n.overflow&&n.overflow.alwaysByViewport))}ro.__getOffsetParent=za,ro.__getVisibleRectForElement=Ha;function io(e,t,n){var r,i,a=La.getDocument(e),o=a.defaultView||a.parentWindow,s=La.getWindowScrollLeft(o),c=La.getWindowScrollTop(o),l=La.viewportWidth(o),u=La.viewportHeight(o);r=`pageX`in t?t.pageX:s+t.clientX,i=`pageY`in t?t.pageY:c+t.clientY;var d={left:r,top:i,width:0,height:0},f=r>=0&&r<=s+l&&i>=0&&i<=c+u,p=[n.points[0],`cc`];return to(e,d,Ri(Ri({},n),{},{points:p}),f)}function ao(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0&&arguments[3],a=t;if(Array.isArray(t)&&(a=dt(t)[0]),!a)return null;let o=it(a,n,i);return o.props=r?Z(Z({},o.props),n):o.props,e(typeof o.props.class!=`object`,`class must be string`),o}function oo(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e.map(e=>ao(e,t,n))}function so(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(Array.isArray(e))return e.map(e=>so(e,t,n,r));{if(!p(e))return e;let i=ao(e,t,n,r);return Array.isArray(i.children)&&(i.children=so(i.children)),i}}function co(e,t,n){Ge(it(e,Z({},t)),n)}var lo=e=>(e||[]).some(e=>!p(e)||!(e.type===Je||e.type===$e&&!lo(e.children)))?e:null;function uo(e,t,n,r){let i=e[t]?.call(e,n);return lo(i)?i:r?.()}var fo=(e=>{if(!e)return!1;if(e.offsetParent)return!0;if(e.getBBox){let t=e.getBBox();if(t.width||t.height)return!0}if(e.getBoundingClientRect){let t=e.getBoundingClientRect();if(t.width||t.height)return!0}return!1});function po(e,t){return e===t?!0:!e||!t?!1:`pageX`in t&&`pageY`in t?e.pageX===t.pageX&&e.pageY===t.pageY:`clientX`in t&&`clientY`in t&&e.clientX===t.clientX&&e.clientY===t.clientY}function mo(e,t){e!==document.activeElement&&Ct(t,e)&&typeof e.focus==`function`&&e.focus()}function ho(e,t){let n=null,r=null;function i(e){let[{target:i}]=e;if(!document.documentElement.contains(i))return;let{width:a,height:o}=i.getBoundingClientRect(),s=Math.floor(a),c=Math.floor(o);(n!==s||r!==c)&&Promise.resolve().then(()=>{t({width:s,height:c})}),n=s,r=c}let a=new Xn(i);return e&&a.observe(e),()=>{a.disconnect()}}var go=((e,t)=>{let n=!1,r=null;function i(){clearTimeout(r)}function a(o){if(!n||o===!0){if(e()===!1)return;n=!0,i(),r=setTimeout(()=>{n=!1},t.value)}else i(),r=setTimeout(()=>{n=!1,a()},t.value)}return[a,()=>{n=!1,i()}]});function _o(){this.__data__=[],this.size=0}function vo(e,t){return e===t||e!==e&&t!==t}function yo(e,t){for(var n=e.length;n--;)if(vo(e[n][0],t))return n;return-1}var bo=Array.prototype.splice;function xo(e){var t=this.__data__,n=yo(t,e);return n<0?!1:(n==t.length-1?t.pop():bo.call(t,n,1),--this.size,!0)}function So(e){var t=this.__data__,n=yo(t,e);return n<0?void 0:t[n][1]}function Co(e){return yo(this.__data__,e)>-1}function wo(e,t){var n=this.__data__,r=yo(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function To(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Hs?new Rs:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=Nc}var Fc=`[object Arguments]`,Ic=`[object Array]`,Lc=`[object Boolean]`,Rc=`[object Date]`,zc=`[object Error]`,Bc=`[object Function]`,Vc=`[object Map]`,Hc=`[object Number]`,Uc=`[object Object]`,Wc=`[object RegExp]`,Gc=`[object Set]`,Kc=`[object String]`,qc=`[object WeakMap]`,Jc=`[object ArrayBuffer]`,Yc=`[object DataView]`,Xc=`[object Float32Array]`,Zc=`[object Float64Array]`,Qc=`[object Int8Array]`,$c=`[object Int16Array]`,el=`[object Int32Array]`,tl=`[object Uint8Array]`,nl=`[object Uint8ClampedArray]`,rl=`[object Uint16Array]`,il=`[object Uint32Array]`,al={};al[Xc]=al[Zc]=al[Qc]=al[$c]=al[el]=al[tl]=al[nl]=al[rl]=al[il]=!0,al[Fc]=al[Ic]=al[Jc]=al[Lc]=al[Yc]=al[Rc]=al[zc]=al[Bc]=al[Vc]=al[Hc]=al[Uc]=al[Wc]=al[Gc]=al[Kc]=al[qc]=!1;function ol(e){return vc(e)&&Pc(e.length)&&!!al[Wo(e)]}function sl(e){return function(t){return e(t)}}var cl=typeof exports==`object`&&exports&&!exports.nodeType&&exports,ll=cl&&typeof module==`object`&&module&&!module.nodeType&&module,ul=ll&&ll.exports===cl&&Ao.process,dl=function(){try{return ll&&ll.require&&ll.require(`util`).types||ul&&ul.binding&&ul.binding(`util`)}catch{}}(),fl=dl&&dl.isTypedArray,pl=fl?sl(fl):ol,ml=Object.prototype.hasOwnProperty;function hl(e,t){var n=uc(e),r=!n&&wc(e),i=!n&&!r&&kc(e),a=!n&&!r&&!i&&pl(e),o=n||r||i||a,s=o?_c(e.length,String):[],c=s.length;for(var l in e)(t||ml.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Mc(l,c)))&&s.push(l);return s}var gl=Object.prototype;function _l(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||gl)}function vl(e,t){return function(n){return e(t(n))}}var yl=vl(Object.keys,Object),bl=Object.prototype.hasOwnProperty;function xl(e){if(!_l(e))return yl(e);var t=[];for(var n in Object(e))bl.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Sl(e){return e!=null&&Pc(e.length)&&!Xo(e)}function Cl(e){return Sl(e)?hl(e):xl(e)}function wl(e){return dc(e,Cl,gc)}var Tl=1,El=Object.prototype.hasOwnProperty;function Dl(e,t,n,r,i,a){var o=n&Tl,s=wl(e),c=s.length;if(c!=wl(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:El.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l{let{disabled:t,target:n,align:r,onAlign:o}=e;if(!t&&n&&a.value){let e=a.value,t,s=eu(n),c=tu(n);i.value.element=s,i.value.point=c,i.value.align=r;let{activeElement:l}=document;return s&&fo(s)?t=ro(e,s,r):c&&(t=io(e,c,r)),mo(l,e),o&&t&&o(e,t),!0}return!1},J(()=>e.monitorBufferTime)),c=H({cancel:()=>{}}),l=H({cancel:()=>{}}),u=()=>{let t=e.target,n=eu(t),r=tu(t);a.value!==l.value.element&&(l.value.cancel(),l.value.element=a.value,l.value.cancel=ho(a.value,o)),(i.value.element!==n||!po(i.value.point,r)||!Ql(i.value.align,e.align))&&(o(),c.value.element!==n&&(c.value.cancel(),c.value.element=n,c.value.cancel=ho(n,o)))};V(()=>{z(()=>{u()})}),O(()=>{z(()=>{u()})}),G(()=>e.disabled,e=>{e?s():o()},{immediate:!0,flush:`post`});let d=H(null);return G(()=>e.monitorWindowResize,e=>{e?d.value||=cr(window,`resize`,o):d.value&&=(d.value.remove(),null)},{flush:`post`}),y(()=>{c.value.cancel(),l.value.cancel(),d.value&&d.value.remove(),s()}),n({forceAlign:()=>o(!0)}),()=>{let e=r?.default();return e?ao(e[0],{ref:a},!0,!0):null}}}),ru=u({compatConfig:{MODE:3},name:`PopupInner`,inheritAttrs:!1,props:Oi,emits:[`mouseenter`,`mouseleave`,`mousedown`,`touchstart`,`align`],setup(e,t){let{expose:n,attrs:r,slots:i}=t,a=q(),o=q(),s=q(),[c,l]=Ii(St(e,`stretch`)),u=()=>{e.stretch&&l(e.getRootDomNode())},d=q(!1),f;G(()=>e.visible,t=>{clearTimeout(f),t?f=setTimeout(()=>{d.value=e.visible}):d.value=!1},{immediate:!0});let[p,m]=Fi(d,u),g=q(),_=()=>e.point?e.point:e.getRootDomNode,v=()=>{var e;(e=a.value)==null||e.forceAlign()},y=(t,n)=>{var r;let i=e.getClassNameFromAlign(n),a=s.value;s.value!==i&&(s.value=i),p.value===`align`&&(a===i?m(()=>{var e;(e=g.value)==null||e.call(g)}):Promise.resolve().then(()=>{v()}),(r=e.onAlign)==null||r.call(e,t,n))},b=J(()=>{let t=typeof e.animation==`object`?e.animation:h(e);return[`onAfterEnter`,`onAfterLeave`].forEach(e=>{let n=t[e];t[e]=e=>{m(),p.value=`stable`,n?.(e)}}),t}),x=()=>new Promise(e=>{g.value=e});G([b,p],()=>{!b.value&&p.value===`motion`&&m()},{immediate:!0}),n({forceAlign:v,getElement:()=>o.value.$el||o.value});let S=J(()=>!(e.align?.points&&(p.value===`align`||p.value===`stable`)));return()=>{let{zIndex:t,align:n,prefixCls:l,destroyPopupOnHide:u,onMouseenter:f,onMouseleave:m,onTouchstart:h=()=>{},onMousedown:g}=e,v=p.value,C=[Z(Z({},c.value),{zIndex:t,opacity:v===`motion`||v===`stable`||!d.value?null:0,pointerEvents:!d.value&&v!==`stable`?`none`:null}),r.style],w=ce(i.default?.call(i,{visible:e.visible}));w.length>1&&(w=U(`div`,{class:`${l}-content`},[w]));let T=K(l,r.class,s.value,!e.arrow&&`${l}-arrow-hidden`),E=d.value||!e.visible?ge(b.value.name,b.value):{};return U(Re,Y(Y({ref:o},E),{},{onBeforeEnter:x}),{default:()=>!u||e.visible?Mt(U(nu,{target:_(),key:`popup`,ref:a,monitorWindowResize:!0,disabled:S.value,align:n,onAlign:y},{default:()=>U(`div`,{class:T,onMouseenter:f,onMouseleave:m,onMousedown:Gt(g,[`capture`]),[sr?`onTouchstartPassive`:`onTouchstart`]:Gt(h,[`capture`]),style:C},[w])}),[[ht,d.value]]):null})}}}),iu=u({compatConfig:{MODE:3},name:`Popup`,inheritAttrs:!1,props:Ai,setup(e,t){let{attrs:n,slots:r,expose:i}=t,a=q(!1),o=q(!1),s=q(),c=q();return G([()=>e.visible,()=>e.mobile],()=>{a.value=e.visible,e.visible&&e.mobile&&(o.value=!0)},{immediate:!0,flush:`post`}),i({forceAlign:()=>{var e;(e=s.value)==null||e.forceAlign()},getElement:()=>s.value?.getElement()}),()=>{let t=Z(Z(Z({},e),n),{visible:a.value}),i=o.value?U(Mi,Y(Y({},t),{},{mobile:e.mobile,ref:s}),{default:r.default}):U(ru,Y(Y({},t),{},{ref:s}),{default:r.default});return U(`div`,{ref:c},[U(ji,t,null),i])}}});function au(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function ou(e,t,n){return Z(Z({},e[t]||{}),n)}function su(e,t,n,r){let{points:i}=n,a=Object.keys(e);for(let n=0;n0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=typeof e==`function`?e(this.$data,this.$props):e;if(this.getDerivedStateFromProps){let e=this.getDerivedStateFromProps(pe(this),Z(Z({},this.$data),n));if(e===null)return;n=Z(Z({},n),e||{})}Z(this.$data,n),this._.isMounted&&this.$forceUpdate(),z(()=>{t&&t()})},__emit(){let e=[].slice.call(arguments,0),t=e[0];t=`on${t[0].toUpperCase()}${t.substring(1)}`;let n=this.$props[t]||this.$attrs[t];if(e.length&&n)if(Array.isArray(n))for(let t=0,r=n.length;t`u`)return 0;if(e||lu===void 0){let e=document.createElement(`div`);e.style.width=`100%`,e.style.height=`200px`;let t=document.createElement(`div`),n=t.style;n.position=`absolute`,n.top=`0`,n.left=`0`,n.pointerEvents=`none`,n.visibility=`hidden`,n.width=`200px`,n.height=`150px`,n.overflow=`hidden`,t.appendChild(e),document.body.appendChild(t);let r=e.offsetWidth;t.style.overflow=`scroll`;let i=e.offsetWidth;r===i&&(i=t.clientWidth),document.body.removeChild(t),lu=r-i}return lu}function du(e){let t=e.match(/^(.*)px$/),n=Number(t?.[1]);return Number.isNaN(n)?uu():n}function fu(e){if(typeof document>`u`||!e||!(e instanceof Element))return{width:0,height:0};let{width:t,height:n}=getComputedStyle(e,`::-webkit-scrollbar`);return{width:du(t),height:du(n)}}var pu=`vc-util-locker-${Date.now()}`,mu=0;function hu(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}function gu(e){let t=J(()=>!!e&&!!e.value);mu+=1;let n=`${pu}_${mu}`;S(e=>{if(It()){if(t.value){let e=uu();Ut(` +html body { + overflow-y: hidden; + ${hu()?`width: calc(100% - ${e}px);`:``} +}`,n)}else Ze(n);e(()=>{Ze(n)})}},{flush:`post`})}var _u=0,vu=It(),yu=e=>{if(!vu)return null;if(e){if(typeof e==`string`)return document.querySelectorAll(e)[0];if(typeof e==`function`)return e();if(typeof e==`object`&&e instanceof window.HTMLElement)return e}return document.body},bu=u({compatConfig:{MODE:3},name:`PortalWrapper`,inheritAttrs:!1,props:{wrapperClassName:String,forceRender:{type:Boolean,default:void 0},getContainer:f.any,visible:{type:Boolean,default:void 0},autoLock:Q(),didUpdate:Function},setup(e,t){let{slots:n}=t,r=q(),i=q(),a=q(),o=q(1),s=It()&&document.createElement(`div`),c=()=>{var e;r.value===s&&((e=r.value?.parentNode)==null||e.removeChild(r.value)),r.value=null},l=null,u=function(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]||r.value&&!r.value.parentNode?(l=yu(e.getContainer),l?(l.appendChild(r.value),!0):!1):!0},d=()=>vu?(r.value||(r.value=s,u(!0)),f(),r.value):null,f=()=>{let{wrapperClassName:t}=e;r.value&&t&&t!==r.value.className&&(r.value.className=t)};return O(()=>{f(),u()}),gu(J(()=>e.autoLock&&e.visible&&It()&&(r.value===document.body||r.value===s))),V(()=>{let t=!1;G([()=>e.visible,()=>e.getContainer],(n,r)=>{let[i,a]=n,[o,s]=r;vu&&(l=yu(e.getContainer),l===document.body&&(i&&!o?_u+=1:t&&--_u)),t&&(typeof a==`function`&&typeof s==`function`?a.toString()!==s.toString():a!==s)&&c(),t=!0},{immediate:!0,flush:`post`}),z(()=>{u()||(a.value=ir(()=>{o.value+=1}))})}),ut(()=>{let{visible:t}=e;vu&&l===document.body&&(_u=t&&_u?_u-1:_u),c(),ir.cancel(a.value)}),()=>{let{forceRender:t,visible:r}=e,a=null,s={getOpenCount:()=>_u,getContainer:d};return o.value&&(t||r||i.value)&&(a=U(Ve,{getContainer:d,ref:i,didUpdate:e.didUpdate},{default:()=>n.default?.call(n,s)})),a}}}),xu=[`onClick`,`onMousedown`,`onTouchstart`,`onMouseenter`,`onMouseleave`,`onFocus`,`onBlur`,`onContextmenu`],Su=u({compatConfig:{MODE:3},name:`Trigger`,mixins:[cu],inheritAttrs:!1,props:Di(),setup(e){let t=J(()=>{let{popupPlacement:t,popupAlign:n,builtinPlacements:r}=e;return t&&r?ou(r,t,n):n}),n=q(null);return{vcTriggerContext:g(`vcTriggerContext`,{}),popupRef:n,setPopupRef:e=>{n.value=e},triggerRef:q(null),align:t,focusTime:null,clickOutsideHandler:null,contextmenuOutsideHandler1:null,contextmenuOutsideHandler2:null,touchOutsideHandler:null,attachId:null,delayTimer:null,hasPopupMouseDown:!1,preClickTime:null,preTouchTime:null,mouseDownTimeout:null,childOriginEvents:{}}},data(){let e=this.$props,t;return t=this.popupVisible===void 0?!!e.defaultPopupVisible:!!e.popupVisible,xu.forEach(e=>{this[`fire${e}`]=t=>{this.fireEvents(e,t)}}),{prevPopupVisible:t,sPopupVisible:t,point:null}},watch:{popupVisible(e){e!==void 0&&(this.prevPopupVisible=this.sPopupVisible,this.sPopupVisible=e)}},created(){fe(`vcTriggerContext`,{onPopupMouseDown:this.onPopupMouseDown,onPopupMouseenter:this.onPopupMouseenter,onPopupMouseleave:this.onPopupMouseleave}),$t(this)},deactivated(){this.setPopupVisible(!1)},mounted(){this.$nextTick(()=>{this.updatedCal()})},updated(){this.$nextTick(()=>{this.updatedCal()})},beforeUnmount(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ir.cancel(this.attachId)},methods:{updatedCal(){let e=this.$props;if(this.$data.sPopupVisible){let t;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextmenuToShow())&&(t=e.getDocument(this.getRootDomNode()),this.clickOutsideHandler=cr(t,`mousedown`,this.onDocumentClick)),this.touchOutsideHandler||=(t||=e.getDocument(this.getRootDomNode()),cr(t,`touchstart`,this.onDocumentClick,sr?{passive:!1}:!1)),!this.contextmenuOutsideHandler1&&this.isContextmenuToShow()&&(t||=e.getDocument(this.getRootDomNode()),this.contextmenuOutsideHandler1=cr(t,`scroll`,this.onContextmenuClose)),!this.contextmenuOutsideHandler2&&this.isContextmenuToShow()&&(this.contextmenuOutsideHandler2=cr(window,`blur`,this.onContextmenuClose))}else this.clearOutsideHandler()},onMouseenter(e){let{mouseEnterDelay:t}=this.$props;this.fireEvents(`onMouseenter`,e),this.delaySetPopupVisible(!0,t,t?null:e)},onMouseMove(e){this.fireEvents(`onMousemove`,e),this.setPoint(e)},onMouseleave(e){this.fireEvents(`onMouseleave`,e),this.delaySetPopupVisible(!1,this.$props.mouseLeaveDelay)},onPopupMouseenter(){let{vcTriggerContext:e={}}=this;e.onPopupMouseenter&&e.onPopupMouseenter(),this.clearDelayTimer()},onPopupMouseleave(e){if(e&&e.relatedTarget&&!e.relatedTarget.setTimeout&&Ct(this.popupRef?.getElement(),e.relatedTarget))return;this.isMouseLeaveToHide()&&this.delaySetPopupVisible(!1,this.$props.mouseLeaveDelay);let{vcTriggerContext:t={}}=this;t.onPopupMouseleave&&t.onPopupMouseleave(e)},onFocus(e){this.fireEvents(`onFocus`,e),this.clearDelayTimer(),this.isFocusToShow()&&(this.focusTime=Date.now(),this.delaySetPopupVisible(!0,this.$props.focusDelay))},onMousedown(e){this.fireEvents(`onMousedown`,e),this.preClickTime=Date.now()},onTouchstart(e){this.fireEvents(`onTouchstart`,e),this.preTouchTime=Date.now()},onBlur(e){Ct(e.target,e.relatedTarget||document.activeElement)||(this.fireEvents(`onBlur`,e),this.clearDelayTimer(),this.isBlurToHide()&&this.delaySetPopupVisible(!1,this.$props.blurDelay))},onContextmenu(e){e.preventDefault(),this.fireEvents(`onContextmenu`,e),this.setPopupVisible(!0,e)},onContextmenuClose(){this.isContextmenuToShow()&&this.close()},onClick(e){if(this.fireEvents(`onClick`,e),this.focusTime){let e;if(this.preClickTime&&this.preTouchTime?e=Math.min(this.preClickTime,this.preTouchTime):this.preClickTime?e=this.preClickTime:this.preTouchTime&&(e=this.preTouchTime),Math.abs(e-this.focusTime)<20)return;this.focusTime=0}this.preClickTime=0,this.preTouchTime=0,this.isClickToShow()&&(this.isClickToHide()||this.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault(),e&&e.domEvent&&e.domEvent.preventDefault();let t=!this.$data.sPopupVisible;(this.isClickToHide()&&!t||t&&this.isClickToShow())&&this.setPopupVisible(!this.$data.sPopupVisible,e)},onPopupMouseDown(){let{vcTriggerContext:e={}}=this;this.hasPopupMouseDown=!0,clearTimeout(this.mouseDownTimeout),this.mouseDownTimeout=setTimeout(()=>{this.hasPopupMouseDown=!1},0),e.onPopupMouseDown&&e.onPopupMouseDown(...arguments)},onDocumentClick(e){if(this.$props.mask&&!this.$props.maskClosable)return;let t=e.target,n=this.getRootDomNode(),r=this.getPopupDomNode();(!Ct(n,t)||this.isContextMenuOnly())&&!Ct(r,t)&&!this.hasPopupMouseDown&&this.delaySetPopupVisible(!1,.1)},getPopupDomNode(){return this.popupRef?.getElement()||null},getRootDomNode(){let{getTriggerDOMNode:e}=this.$props;if(e)return ae(e(this.triggerRef?.$el?.nodeName===`#comment`?null:ae(this.triggerRef)));try{let e=this.triggerRef?.$el?.nodeName===`#comment`?null:ae(this.triggerRef);if(e)return e}catch{}return ae(this)},handleGetPopupClassFromAlign(e){let t=[],{popupPlacement:n,builtinPlacements:r,prefixCls:i,alignPoint:a,getPopupClassNameFromAlign:o}=this.$props;return n&&r&&t.push(su(r,i,e,a)),o&&t.push(o(e)),t.join(` `)},getPopupAlign(){let{popupPlacement:e,popupAlign:t,builtinPlacements:n}=this.$props;return e&&n?ou(n,e,t):t},getComponent(){let e={};this.isMouseEnterToShow()&&(e.onMouseenter=this.onPopupMouseenter),this.isMouseLeaveToHide()&&(e.onMouseleave=this.onPopupMouseleave),e.onMousedown=this.onPopupMouseDown,e[sr?`onTouchstartPassive`:`onTouchstart`]=this.onPopupMouseDown;let{handleGetPopupClassFromAlign:t,getRootDomNode:n,$attrs:r}=this,{prefixCls:i,destroyPopupOnHide:a,popupClassName:o,popupAnimation:s,popupTransitionName:c,popupStyle:l,mask:u,maskAnimation:d,maskTransitionName:f,zIndex:p,stretch:m,alignPoint:h,mobile:g,arrow:_,forceRender:v}=this.$props,{sPopupVisible:y,point:b}=this.$data;return U(iu,Z(Z({prefixCls:i,arrow:_,destroyPopupOnHide:a,visible:y,point:h?b:null,align:this.align,animation:s,getClassNameFromAlign:t,stretch:m,getRootDomNode:n,mask:u,zIndex:p,transitionName:c,maskAnimation:d,maskTransitionName:f,class:o,style:l,onAlign:r.onPopupAlign||Ei},e),{ref:this.setPopupRef,mobile:g,forceRender:v}),{default:this.$slots.popup||(()=>k(this,`popup`))})},attachParent(e){ir.cancel(this.attachId);let{getPopupContainer:t,getDocument:n}=this.$props,r=this.getRootDomNode(),i;t?(r||t.length===0)&&(i=t(r)):i=n(this.getRootDomNode()).body,i?i.appendChild(e):this.attachId=ir(()=>{this.attachParent(e)})},getContainer(){let{$props:e}=this,{getDocument:t}=e,n=t(this.getRootDomNode()).createElement(`div`);return n.style.position=`absolute`,n.style.top=`0`,n.style.left=`0`,n.style.width=`100%`,this.attachParent(n),n},setPopupVisible(e,t){let{alignPoint:n,sPopupVisible:r,onPopupVisibleChange:i}=this;this.clearDelayTimer(),r!==e&&(E(this,`popupVisible`)||this.setState({sPopupVisible:e,prevPopupVisible:r}),i&&i(e)),n&&t&&e&&this.setPoint(t)},setPoint(e){let{alignPoint:t}=this.$props;!t||!e||this.setState({point:{pageX:e.pageX,pageY:e.pageY}})},handlePortalUpdate(){this.prevPopupVisible!==this.sPopupVisible&&this.afterPopupVisibleChange(this.sPopupVisible)},delaySetPopupVisible(e,t,n){let r=t*1e3;if(this.clearDelayTimer(),r){let t=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=setTimeout(()=>{this.setPopupVisible(e,t),this.clearDelayTimer()},r)}else this.setPopupVisible(e,n)},clearDelayTimer(){this.delayTimer&&=(clearTimeout(this.delayTimer),null)},clearOutsideHandler(){this.clickOutsideHandler&&=(this.clickOutsideHandler.remove(),null),this.contextmenuOutsideHandler1&&=(this.contextmenuOutsideHandler1.remove(),null),this.contextmenuOutsideHandler2&&=(this.contextmenuOutsideHandler2.remove(),null),this.touchOutsideHandler&&=(this.touchOutsideHandler.remove(),null)},createTwoChains(e){let t=()=>{},n=ee(this);return this.childOriginEvents[e]&&n[e]?this[`fire${e}`]:(t=this.childOriginEvents[e]||n[e]||t,t)},isClickToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`click`)!==-1||t.indexOf(`click`)!==-1},isContextMenuOnly(){let{action:e}=this.$props;return e===`contextmenu`||e.length===1&&e[0]===`contextmenu`},isContextmenuToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`contextmenu`)!==-1||t.indexOf(`contextmenu`)!==-1},isClickToHide(){let{action:e,hideAction:t}=this.$props;return e.indexOf(`click`)!==-1||t.indexOf(`click`)!==-1},isMouseEnterToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`hover`)!==-1||t.indexOf(`mouseenter`)!==-1},isMouseLeaveToHide(){let{action:e,hideAction:t}=this.$props;return e.indexOf(`hover`)!==-1||t.indexOf(`mouseleave`)!==-1},isFocusToShow(){let{action:e,showAction:t}=this.$props;return e.indexOf(`focus`)!==-1||t.indexOf(`focus`)!==-1},isBlurToHide(){let{action:e,hideAction:t}=this.$props;return e.indexOf(`focus`)!==-1||t.indexOf(`blur`)!==-1},forcePopupAlign(){var e;this.$data.sPopupVisible&&((e=this.popupRef)==null||e.forceAlign())},fireEvents(e,t){this.childOriginEvents[e]&&this.childOriginEvents[e](t);let n=this.$props[e]||this.$attrs[e];n&&n(t)},close(){this.setPopupVisible(!1)}},render(){let{$attrs:e}=this,t=dt(c(this)),{alignPoint:n,getPopupContainer:r}=this.$props,i=t[0];this.childOriginEvents=ee(i);let a={key:`trigger`};this.isContextmenuToShow()?a.onContextmenu=this.onContextmenu:a.onContextmenu=this.createTwoChains(`onContextmenu`),this.isClickToHide()||this.isClickToShow()?(a.onClick=this.onClick,a.onMousedown=this.onMousedown,a[sr?`onTouchstartPassive`:`onTouchstart`]=this.onTouchstart):(a.onClick=this.createTwoChains(`onClick`),a.onMousedown=this.createTwoChains(`onMousedown`),a[sr?`onTouchstartPassive`:`onTouchstart`]=this.createTwoChains(`onTouchstart`)),this.isMouseEnterToShow()?(a.onMouseenter=this.onMouseenter,n&&(a.onMousemove=this.onMouseMove)):a.onMouseenter=this.createTwoChains(`onMouseenter`),this.isMouseLeaveToHide()?a.onMouseleave=this.onMouseleave:a.onMouseleave=this.createTwoChains(`onMouseleave`),this.isFocusToShow()||this.isBlurToHide()?(a.onFocus=this.onFocus,a.onBlur=this.onBlur):(a.onFocus=this.createTwoChains(`onFocus`),a.onBlur=e=>{e&&(!e.relatedTarget||!Ct(e.target,e.relatedTarget))&&this.createTwoChains(`onBlur`)(e)});let o=K(i&&i.props&&i.props.class,e.class);return o&&(a.class=o),U($e,null,[ao(i,Z(Z({},a),{ref:`triggerRef`}),!0,!0),U(bu,{key:`portal`,getContainer:r&&(()=>r(this.getRootDomNode())),didUpdate:this.handlePortalUpdate,visible:this.$data.sPopupVisible},{default:this.getComponent})])}}),Cu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=e===!0?0:1;return{bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},Tu=u({name:`SelectTrigger`,inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:f.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:f.oneOfType([Number,Boolean]).def(!0),popupElement:f.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(e,t){let{slots:n,attrs:r,expose:i}=t,a=J(()=>{let{dropdownMatchSelectWidth:t}=e;return wu(t)}),o=H();return i({getPopupElement:()=>o.value}),()=>{let t=Z(Z({},e),r),{empty:i=!1}=t,{visible:s,dropdownAlign:c,prefixCls:l,popupElement:u,dropdownClassName:d,dropdownStyle:f,direction:p=`ltr`,placement:m,dropdownMatchSelectWidth:h,containerWidth:g,dropdownRender:_,animation:v,transitionName:y,getPopupContainer:b,getTriggerDOMNode:x,onPopupVisibleChange:S,onPopupMouseEnter:C,onPopupFocusin:w,onPopupFocusout:T}=Cu(t,[`empty`]),E=`${l}-dropdown`,D=u;_&&(D=_({menuNode:u,props:e}));let O=v?`${E}-${v}`:y,k=Z({minWidth:`${g}px`},f);return typeof h==`number`?k.width=`${h}px`:h&&(k.width=`${g}px`),U(Su,Y(Y({},e),{},{showAction:S?[`click`]:[],hideAction:S?[`click`]:[],popupPlacement:m||(p===`rtl`?`bottomRight`:`bottomLeft`),builtinPlacements:a.value,prefixCls:E,popupTransitionName:O,popupAlign:c,popupVisible:s,getPopupContainer:b,popupClassName:K(d,{[`${E}-empty`]:i}),popupStyle:k,getTriggerDOMNode:x,onPopupVisibleChange:S}),{default:n.default,popup:()=>U(`div`,{ref:o,onMouseenter:C,onFocusin:w,onFocusout:T},[D])})}}}),$={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){let{keyCode:t}=e;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=$.F1&&t<=$.F12)return!1;switch(t){case $.ALT:case $.CAPS_LOCK:case $.CONTEXT_MENU:case $.CTRL:case $.DOWN:case $.END:case $.ESC:case $.HOME:case $.INSERT:case $.LEFT:case $.MAC_FF_META:case $.META:case $.NUMLOCK:case $.NUM_CENTER:case $.PAGE_DOWN:case $.PAGE_UP:case $.PAUSE:case $.PRINT_SCREEN:case $.RIGHT:case $.SHIFT:case $.UP:case $.WIN_KEY:case $.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=$.ZERO&&e<=$.NINE||e>=$.NUM_ZERO&&e<=$.NUM_MULTIPLY||e>=$.A&&e<=$.Z||window.navigator.userAgent.indexOf(`WebKit`)!==-1&&e===0)return!0;switch(e){case $.SPACE:case $.QUESTION_MARK:case $.NUM_PLUS:case $.NUM_MINUS:case $.NUM_PERIOD:case $.NUM_DIVISION:case $.SEMICOLON:case $.DASH:case $.EQUALS:case $.COMMA:case $.PERIOD:case $.SLASH:case $.APOSTROPHE:case $.SINGLE_QUOTE:case $.OPEN_SQUARE_BRACKET:case $.BACKSLASH:case $.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Eu=(e,t)=>{let{slots:n}=t,{class:r,customizeIcon:i,customizeIconProps:a,onMousedown:o,onClick:s}=e,c;return c=typeof i==`function`?i(a):p(i)?it(i):i,U(`span`,{class:r,onMousedown:e=>{e.preventDefault(),o&&o(e)},style:{userSelect:`none`,WebkitUserSelect:`none`},unselectable:`on`,onClick:s,"aria-hidden":!0},[c===void 0?U(`span`,{class:r.split(/\s+/).map(e=>`${e}-icon`)},[n.default?.call(n)]):c])};Eu.inheritAttrs=!1,Eu.displayName=`TransBtn`,Eu.props={class:String,customizeIcon:f.any,customizeIconProps:f.any,onMousedown:Function,onClick:Function};var Du=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{r.value&&r.value.focus()},blur:()=>{r.value&&r.value.blur()},input:r,setSelectionRange:(e,t,n)=>{var i;(i=r.value)==null||i.setSelectionRange(e,t,n)},select:()=>{var e;(e=r.value)==null||e.select()},getSelectionStart:()=>r.value?.selectionStart,getSelectionEnd:()=>r.value?.selectionEnd,getScrollTop:()=>r.value?.scrollTop}),()=>{let{tag:t,value:n}=e;return U(t,Y(Y({},Du(e,[`tag`,`value`])),{},{ref:r,value:n}),null)}}});function ku(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function Au(e){let t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.scrollX||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.scrollY||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function ju(e){return Array.prototype.slice.apply(e).map(t=>`${t}: ${e.getPropertyValue(t)};`).join(``)}function Mu(e){return Object.keys(e).reduce((t,n)=>(e[n]==null||(t+=`${n}: ${e[n]};`),t),``)}var Nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.value,s],()=>{s.value||(o.value=e.value)},{immediate:!0});let c=e=>{n(`change`,e)},l=e=>{s.value=!0,e.target.composing=!0,n(`compositionstart`,e)},u=e=>{s.value=!1,e.target.composing=!1,n(`compositionend`,e);let t=document.createEvent(`HTMLEvents`);t.initEvent(`input`,!0,!0),e.target.dispatchEvent(t),c(e)},d=t=>{if(s.value&&e.lazy){o.value=t.target.value;return}n(`input`,t)},f=e=>{n(`blur`,e)},p=e=>{n(`focus`,e)},m=()=>{a.value&&a.value.focus()},h=()=>{a.value&&a.value.blur()},g=e=>{n(`keydown`,e)},_=e=>{n(`keyup`,e)};i({focus:m,blur:h,input:J(()=>a.value?.input),setSelectionRange:(e,t,n)=>{var r;(r=a.value)==null||r.setSelectionRange(e,t,n)},select:()=>{var e;(e=a.value)==null||e.select()},getSelectionStart:()=>a.value?.getSelectionStart(),getSelectionEnd:()=>a.value?.getSelectionEnd(),getScrollTop:()=>a.value?.getScrollTop()});let v=e=>{n(`mousedown`,e)},y=e=>{n(`paste`,e)},b=J(()=>e.style&&typeof e.style!=`string`?Mu(e.style):e.style);return()=>{let{style:t,lazy:n}=e;return U(Ou,Y(Y(Y({},Nu(e,[`style`,`lazy`])),r),{},{style:b.value,onInput:d,onChange:c,onBlur:f,onFocus:p,ref:a,value:o.value,onCompositionstart:l,onCompositionend:u,onKeyup:_,onKeydown:g,onPaste:y,onMousedown:v}),null)}}}),Fu=u({compatConfig:{MODE:3},name:`SelectInput`,inheritAttrs:!1,props:{inputRef:f.any,prefixCls:String,id:String,inputElement:f.VueNode,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,editable:{type:Boolean,default:void 0},activeDescendantId:String,value:String,open:{type:Boolean,default:void 0},tabindex:f.oneOfType([f.number,f.string]),attrs:f.object,onKeydown:{type:Function},onMousedown:{type:Function},onChange:{type:Function},onPaste:{type:Function},onCompositionstart:{type:Function},onCompositionend:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},setup(e){let t=null,n=g(`VCSelectContainerEvent`);return()=>{let{prefixCls:r,id:i,inputElement:a,disabled:o,tabindex:s,autofocus:c,autocomplete:l,editable:u,activeDescendantId:d,value:f,onKeydown:p,onMousedown:m,onChange:h,onPaste:g,onCompositionstart:_,onCompositionend:v,onFocus:y,onBlur:b,open:x,inputRef:S,attrs:C}=e,w=a||U(Pu,null,null),T=w.props||{},{onKeydown:E,onInput:D,onFocus:O,onBlur:k,onMousedown:A,onCompositionstart:j,onCompositionend:M,style:N}=T;return w=ao(w,Z(Z(Z(Z(Z({type:`search`},T),{id:i,ref:S,disabled:o,tabindex:s,lazy:!1,autocomplete:l||`off`,autofocus:c,class:K(`${r}-selection-search-input`,w?.props?.class),role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-owns":`${i}_list`,"aria-autocomplete":`list`,"aria-controls":`${i}_list`,"aria-activedescendant":d}),C),{value:u?f:``,readonly:!u,unselectable:u?null:`on`,style:Z(Z({},N),{opacity:u?null:0}),onKeydown:e=>{p(e),E&&E(e)},onMousedown:e=>{m(e),A&&A(e)},onInput:e=>{h(e),D&&D(e)},onCompositionstart(e){_(e),j&&j(e)},onCompositionend(e){v(e),M&&M(e)},onPaste:g,onFocus:function(){clearTimeout(t),O&&O(arguments.length<=0?void 0:arguments[0]),y&&y(arguments.length<=0?void 0:arguments[0]),n?.focus(arguments.length<=0?void 0:arguments[0])},onBlur:function(){var e=[...arguments];t=setTimeout(()=>{k&&k(e[0]),b&&b(e[0]),n?.blur(e[0])},100)}}),w.type===`textarea`?{}:{type:`search`}),!0,!0),w}}}),Iu=`accept acceptcharset accesskey action allowfullscreen allowtransparency +alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge +charset checked classid classname colspan cols content contenteditable contextmenu +controls coords crossorigin data datetime default defer dir disabled download draggable +enctype form formaction formenctype formmethod formnovalidate formtarget frameborder +headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity +is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media +mediagroup method min minlength multiple muted name novalidate nonce open +optimum pattern placeholder poster preload radiogroup readonly rel required +reversed role rowspan rows sandbox scope scoped scrolling seamless selected +shape size sizes span spellcheck src srcdoc srclang srcset start step style +summary tabindex target title type usemap value width wmode wrap onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown + onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick + onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown + onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel + onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough + onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata + onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),Lu=`aria-`,Ru=`data-`;function zu(e,t){return e.indexOf(t)===0}function Bu(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n;n=t===!1?{aria:!0,data:!0,attr:!0}:t===!0?{aria:!0}:Z({},t);let r={};return Object.keys(e).forEach(t=>{(n.aria&&(t===`role`||zu(t,Lu))||n.data&&zu(t,Ru)||n.attr&&(Iu.includes(t)||Iu.includes(t.toLowerCase())))&&(r[t]=e[t])}),r}var Vu=Symbol(`OverflowContextProviderKey`),Hu=u({compatConfig:{MODE:3},name:`OverflowContextProvider`,inheritAttrs:!1,props:{value:{type:Object}},setup(e,t){let{slots:n}=t;return fe(Vu,J(()=>e.value)),()=>n.default?.call(n)}}),Uu=()=>g(Vu,J(()=>null)),Wu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.responsive&&!e.display),a=H();r({itemNodeRef:a});function o(t){e.registerSize(e.itemKey,t)}return y(()=>{o(null)}),()=>{let{prefixCls:t,invalidate:r,item:s,renderItem:c,responsive:l,registerSize:u,itemKey:d,display:f,order:p,component:m=`div`}=e,h=Wu(e,[`prefixCls`,`invalidate`,`item`,`renderItem`,`responsive`,`registerSize`,`itemKey`,`display`,`order`,`component`]),g=n.default?.call(n),_=c&&s!==Gu?c(s):g,v;r||(v={opacity:+!i.value,height:i.value?0:Gu,overflowY:i.value?`hidden`:Gu,order:l?p:Gu,pointerEvents:i.value?`none`:Gu,position:i.value?`absolute`:Gu});let y={};return i.value&&(y[`aria-hidden`]=!0),U(Qn,{disabled:!l,onResize:e=>{let{offsetWidth:t}=e;o(t)}},{default:()=>U(m,Y(Y(Y({class:K(!r&&t),style:v},y),h),{},{ref:a}),{default:()=>[_]})})}}}),qu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{if(!i.value){let{component:t=`div`}=e;return U(t,Y(Y({},qu(e,[`component`])),r),{default:()=>[n.default?.call(n)]})}let t=i.value,{className:a}=t,o=qu(t,[`className`]),{class:s}=r,c=qu(r,[`class`]);return U(Hu,{value:null},{default:()=>[U(Ku,Y(Y(Y({class:K(a,s)},o),c),e),n)]})}}}),Yu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.ssr===`full`),o=q(null),s=J(()=>o.value||0),c=q(new Map),l=q(0),u=q(0),d=q(0),f=q(null),p=q(null),m=J(()=>p.value===null&&a.value?2**53-1:p.value||0),h=q(!1),g=J(()=>`${e.prefixCls}-item`),_=J(()=>Math.max(l.value,u.value)),v=J(()=>!!(e.data.length&&e.maxCount===Xu)),y=J(()=>e.maxCount===Zu),b=J(()=>v.value||typeof e.maxCount==`number`&&e.data.length>e.maxCount),x=J(()=>{let t=e.data;return v.value?t=o.value===null&&a.value?e.data:e.data.slice(0,Math.min(e.data.length,s.value/e.itemWidth)):typeof e.maxCount==`number`&&(t=e.data.slice(0,e.maxCount)),t}),S=J(()=>v.value?e.data.slice(m.value+1):e.data.slice(x.value.length)),C=(t,n)=>typeof e.itemKey==`function`?e.itemKey(t):(e.itemKey&&t?.[e.itemKey])??n,w=J(()=>e.renderItem||(e=>e)),T=(t,n)=>{p.value=t,n||(h.value=t{o.value=t.clientWidth},D=(e,t)=>{let n=new Map(c.value);t===null?n.delete(e):n.set(e,t),c.value=n},O=(e,t)=>{l.value=u.value,u.value=t},k=(e,t)=>{d.value=t},A=e=>c.value.get(C(x.value[e],e));return G([s,c,u,d,()=>e.itemKey,x],()=>{if(s.value&&_.value&&x.value){let t=d.value,n=x.value.length,r=n-1;if(!n){T(0),f.value=null;return}for(let e=0;es.value){T(e-1),f.value=t-n-d.value+u.value;break}}e.suffix&&A(0)+d.value>s.value&&(f.value=null)}}),()=>{let t=h.value&&!!S.value.length,{itemComponent:r,renderRawItem:a,renderRawRest:o,renderRest:s,prefixCls:c=`rc-overflow`,suffix:l,component:u=`div`,id:d,onMousedown:p}=e,{class:_,style:T}=n,A=Yu(n,[`class`,`style`]),j={};f.value!==null&&v.value&&(j={position:`absolute`,left:`${f.value}px`,top:0});let M={prefixCls:g.value,responsive:v.value,component:r,invalidate:y.value},N=a?(e,t)=>{let n=C(e,t);return U(Hu,{key:n,value:Z(Z({},M),{order:t,item:e,itemKey:n,registerSize:D,display:t<=m.value})},{default:()=>[a(e,t)]})}:(e,t)=>{let n=C(e,t);return U(Ku,Y(Y({},M),{},{order:t,key:n,item:e,renderItem:w.value,itemKey:n,registerSize:D,display:t<=m.value}),null)},P=()=>null,F={order:t?m.value:2**53-1,className:`${g.value} ${g.value}-rest`,registerSize:O,display:t};if(o)o&&(P=()=>U(Hu,{value:Z(Z({},M),F)},{default:()=>[o(S.value)]}));else{let e=s||Qu;P=()=>U(Ku,Y(Y({},M),F),{default:()=>typeof e==`function`?e(S.value):e})}return U(Qn,{disabled:!v.value,onResize:E},{default:()=>U(u,Y({id:d,class:K(!y.value&&c,_),style:T,onMousedown:p,role:e.role},A),{default:()=>[x.value.map(N),b.value?P():null,l&&U(Ku,Y(Y({},M),{},{order:m.value,class:`${g.value}-suffix`,registerSize:k,display:!0,style:j}),{default:()=>l}),i.default?.call(i)]})})}}});$u.Item=Ju,$u.RESPONSIVE=Xu,$u.INVALIDATE=Zu;var ed=$u,td=Symbol(`TreeSelectLegacyContextPropsKey`);function nd(e){return fe(td,e)}function rd(){return g(td,{})}var id={id:String,prefixCls:String,values:f.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:f.any,placeholder:f.any,disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:f.oneOfType([f.number,f.string]),compositionStatus:Boolean,removeIcon:f.any,choiceTransitionName:String,maxTagCount:f.oneOfType([f.number,f.string]),maxTagTextLength:Number,maxTagPlaceholder:f.any.def(()=>e=>`+ ${e.length} ...`),tagRender:Function,onToggleOpen:{type:Function},onRemove:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},ad=e=>{e.preventDefault(),e.stopPropagation()},od=u({name:`MultipleSelectSelector`,inheritAttrs:!1,props:id,setup(e){let t=q(),n=q(0),r=q(!1),i=rd(),a=J(()=>`${e.prefixCls}-selection`),o=J(()=>e.open||e.mode===`tags`?e.searchValue:``),s=J(()=>e.mode===`tags`||e.showSearch&&(e.open||r.value)),c=H(``);S(()=>{c.value=o.value}),V(()=>{G(c,()=>{n.value=t.value.scrollWidth},{flush:`post`,immediate:!0})});function l(t,n,r,i,o){return U(`span`,{class:K(`${a.value}-item`,{[`${a.value}-item-disabled`]:r}),title:typeof t==`string`||typeof t==`number`?t.toString():void 0},[U(`span`,{class:`${a.value}-item-content`},[n]),i&&U(Eu,{class:`${a.value}-item-remove`,onMousedown:ad,onClick:o,customizeIcon:e.removeIcon},{default:()=>[en(`×`)]})])}function u(t,n,r,a,o,s){let c=t=>{ad(t),e.onToggleOpen(!open)},l=s;return i.keyEntities&&(l=i.keyEntities[t]?.node||{}),U(`span`,{key:t,onMousedown:c},[e.tagRender({label:n,value:t,disabled:r,closable:a,onClose:o,option:l})])}function d(t){let{disabled:n,label:r,value:i,option:a}=t,o=!e.disabled&&!n,s=r;if(typeof e.maxTagTextLength==`number`&&(typeof r==`string`||typeof r==`number`)){let t=String(s);t.length>e.maxTagTextLength&&(s=`${t.slice(0,e.maxTagTextLength)}...`)}let c=n=>{var r;n&&n.stopPropagation(),(r=e.onRemove)==null||r.call(e,t)};return typeof e.tagRender==`function`?u(i,s,n,o,c,a):l(r,s,n,o,c)}function f(t){let{maxTagPlaceholder:n=e=>`+ ${e.length} ...`}=e,r=typeof n==`function`?n(t):n;return l(r,r,!1)}let p=t=>{let n=t.target.composing;c.value=t.target.value,n||e.onInputChange(t)};return()=>{let{id:i,prefixCls:l,values:u,open:m,inputRef:h,placeholder:g,disabled:_,autofocus:v,autocomplete:y,activeDescendantId:b,tabindex:x,compositionStatus:S,onInputPaste:C,onInputKeyDown:w,onInputMouseDown:T,onInputCompositionStart:E,onInputCompositionEnd:D}=e,O=U(`div`,{class:`${a.value}-search`,style:{width:n.value+`px`},key:`input`},[U(Fu,{inputRef:h,open:m,prefixCls:l,id:i,inputElement:null,disabled:_,autofocus:v,autocomplete:y,editable:s.value,activeDescendantId:b,value:c.value,onKeydown:w,onMousedown:T,onChange:p,onPaste:C,onCompositionstart:E,onCompositionend:D,tabindex:x,attrs:Bu(e,!0),onFocus:()=>r.value=!0,onBlur:()=>r.value=!1},null),U(`span`,{ref:t,class:`${a.value}-search-mirror`,"aria-hidden":!0},[c.value,en(`\xA0`)])]);return U($e,null,[U(ed,{prefixCls:`${a.value}-overflow`,data:u,renderItem:d,renderRest:f,suffix:O,itemKey:`key`,maxCount:e.maxTagCount,key:`overflow`},null),!u.length&&!o.value&&!S&&U(`span`,{class:`${a.value}-placeholder`},[g])])}}}),sd={inputElement:f.any,id:String,prefixCls:String,values:f.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:f.any,placeholder:f.any,compositionStatus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:f.oneOfType([f.number,f.string]),activeValue:String,backfill:{type:Boolean,default:void 0},optionLabelRender:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},cd=u({name:`SingleSelector`,setup(e){let t=q(!1),n=J(()=>e.mode===`combobox`),r=J(()=>n.value||e.showSearch),i=J(()=>{let r=e.searchValue||``;return n.value&&e.activeValue&&!t.value&&(r=e.activeValue),r}),a=rd();G([n,()=>e.activeValue],()=>{n.value&&(t.value=!1)},{immediate:!0});let o=J(()=>e.mode!==`combobox`&&!e.open&&!e.showSearch?!1:!!i.value||e.compositionStatus),s=J(()=>{let t=e.values[0];return t&&(typeof t.label==`string`||typeof t.label==`number`)?t.label.toString():void 0}),c=()=>{if(e.values[0])return null;let t=o.value?{visibility:`hidden`}:void 0;return U(`span`,{class:`${e.prefixCls}-selection-placeholder`,style:t},[e.placeholder])},l=n=>{n.target.composing||(t.value=!0,e.onInputChange(n))};return()=>{let{inputElement:t,prefixCls:u,id:d,values:f,inputRef:p,disabled:m,autofocus:h,autocomplete:g,activeDescendantId:_,open:v,tabindex:y,optionLabelRender:b,onInputKeyDown:x,onInputMouseDown:S,onInputPaste:C,onInputCompositionStart:w,onInputCompositionEnd:T}=e,E=f[0],D=null;if(E&&a.customSlots){let e=E.key??E.value,t=a.keyEntities[e]?.node||{};D=a.customSlots[t.slots?.title]||a.customSlots.title||E.label,typeof D==`function`&&(D=D(t))}else D=b&&E?b(E.option):E?.label;return U($e,null,[U(`span`,{class:`${u}-selection-search`},[U(Fu,{inputRef:p,prefixCls:u,id:d,open:v,inputElement:t,disabled:m,autofocus:h,autocomplete:g,editable:r.value,activeDescendantId:_,value:i.value,onKeydown:x,onMousedown:S,onChange:l,onPaste:C,onCompositionstart:w,onCompositionend:T,tabindex:y,attrs:Bu(e,!0)},null)]),!n.value&&E&&!o.value&&U(`span`,{class:`${u}-selection-item`,title:s.value},[U($e,{key:E.key??E.value},[D])]),c()])}}});cd.props=sd,cd.inheritAttrs=!1;function ld(e){return![$.ESC,$.SHIFT,$.BACKSPACE,$.TAB,$.WIN_KEY,$.ALT,$.META,$.WIN_KEY_RIGHT,$.CTRL,$.SEMICOLON,$.EQUALS,$.CAPS_LOCK,$.CONTEXT_MENU,$.F1,$.F2,$.F3,$.F4,$.F5,$.F6,$.F7,$.F8,$.F9,$.F10,$.F11,$.F12].includes(e)}function ud(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=null,n;ut(()=>{clearTimeout(n)});function r(r){(r||t===null)&&(t=r),clearTimeout(n),n=setTimeout(()=>{t=null},e)}return[()=>t,r]}function dd(){let e=t=>{e.current=t};return e}var fd=u({name:`Selector`,inheritAttrs:!1,props:{id:String,prefixCls:String,showSearch:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},values:f.array,multiple:{type:Boolean,default:void 0},mode:String,searchValue:String,activeValue:String,inputElement:f.any,autofocus:{type:Boolean,default:void 0},activeDescendantId:String,tabindex:f.oneOfType([f.number,f.string]),disabled:{type:Boolean,default:void 0},placeholder:f.any,removeIcon:f.any,maxTagCount:f.oneOfType([f.number,f.string]),maxTagTextLength:Number,maxTagPlaceholder:f.any,tagRender:Function,optionLabelRender:Function,tokenWithEnter:{type:Boolean,default:void 0},choiceTransitionName:String,onToggleOpen:{type:Function},onSearch:Function,onSearchSubmit:Function,onRemove:Function,onInputKeyDown:{type:Function},domRef:Function},setup(e,t){let{expose:n}=t,r=dd(),i=H(!1),[a,o]=ud(0),s=t=>{let{which:n}=t;(n===$.UP||n===$.DOWN)&&t.preventDefault(),e.onInputKeyDown&&e.onInputKeyDown(t),n===$.ENTER&&e.mode===`tags`&&!i.value&&!e.open&&e.onSearchSubmit(t.target.value),ld(n)&&e.onToggleOpen(!0)},c=()=>{o(!0)},l=null,u=t=>{e.onSearch(t,!0,i.value)!==!1&&e.onToggleOpen(!0)},d=()=>{i.value=!0},f=t=>{i.value=!1,e.mode!==`combobox`&&u(t.target.value)},p=t=>{let{target:{value:n}}=t;if(e.tokenWithEnter&&l&&/[\r\n]/.test(l)){let e=l.replace(/[\r\n]+$/,``).replace(/\r\n/g,` `).replace(/[\r\n]/g,` `);n=n.replace(e,l)}l=null,u(n)},m=e=>{let{clipboardData:t}=e;l=t.getData(`text`)},h=e=>{let{target:t}=e;t!==r.current&&(document.body.style.msTouchAction===void 0?r.current.focus():setTimeout(()=>{r.current.focus()}))},g=t=>{let n=a();t.target!==r.current&&!n&&t.preventDefault(),(e.mode!==`combobox`&&(!e.showSearch||!n)||!e.open)&&(e.open&&e.onSearch(``,!0,!1),e.onToggleOpen())};return n({focus:()=>{r.current.focus()},blur:()=>{r.current.blur()}}),()=>{let{prefixCls:t,domRef:n,mode:a}=e,o={inputRef:r,onInputKeyDown:s,onInputMouseDown:c,onInputChange:p,onInputPaste:m,compositionStatus:i.value,onInputCompositionStart:d,onInputCompositionEnd:f},l=U(a===`multiple`||a===`tags`?od:cd,Y(Y({},e),o),null);return U(`div`,{ref:n,class:`${t}-selector`,onClick:h,onMousedown:g},[l])}}});function pd(e,t,n){function r(r){let i=r.target;i.shadowRoot&&r.composed&&(i=r.composedPath()[0]||i);let a=[e[0]?.value,(e[1]?.value)?.getPopupElement()];t.value&&a.every(e=>e&&!e.contains(i)&&e!==i)&&n(!1)}V(()=>{window.addEventListener(`mousedown`,r)}),ut(()=>{window.removeEventListener(`mousedown`,r)})}function md(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=q(!1),n,r=()=>{clearTimeout(n)};return V(()=>{r()}),[t,(i,a)=>{r(),n=setTimeout(()=>{t.value=i,a&&a()},e)},r]}var hd=Symbol(`BaseSelectContextKey`);function gd(e){return fe(hd,e)}function _d(){return g(hd,{})}var vd=(()=>{if(typeof navigator>`u`||typeof window>`u`)return!1;let e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e?.substring(0,4))});function yd(e){return Ae(e)?Ne(new Proxy({},{get(t,n,r){return Reflect.get(e.value,n,r)},set(t,n,r){return e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):Ne(e)}var bd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({prefixCls:String,id:String,omitDomProps:Array,displayValues:Array,onDisplayValuesChange:Function,activeValue:String,activeDescendantId:String,onActiveValueChange:Function,searchValue:String,onSearch:Function,onSearchSplit:Function,maxLength:Number,OptionList:f.any,emptyOptions:Boolean}),Cd=()=>({showSearch:{type:Boolean,default:void 0},tagRender:{type:Function},optionLabelRender:{type:Function},direction:{type:String},tabindex:Number,autofocus:Boolean,notFoundContent:f.any,placeholder:f.any,onClear:Function,choiceTransitionName:String,mode:String,disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{type:Function},getInputElement:{type:Function},getRawInputElement:{type:Function},maxTagTextLength:Number,maxTagCount:{type:[String,Number]},maxTagPlaceholder:f.any,tokenSeparators:{type:Array},allowClear:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},inputIcon:f.any,clearIcon:f.any,removeIcon:f.any,animation:String,transitionName:String,dropdownStyle:{type:Object},dropdownClassName:String,dropdownMatchSelectWidth:{type:[Boolean,Number],default:void 0},dropdownRender:{type:Function},dropdownAlign:Object,placement:{type:String},getPopupContainer:{type:Function},showAction:{type:Array},onBlur:{type:Function},onFocus:{type:Function},onKeyup:Function,onKeydown:Function,onMousedown:Function,onPopupScroll:Function,onInputKeyDown:Function,onMouseenter:Function,onMouseleave:Function,onClick:Function}),wd=()=>Z(Z({},Sd()),Cd());function Td(e){return e===`tags`||e===`multiple`}var Ed=u({compatConfig:{MODE:3},name:`BaseSelect`,inheritAttrs:!1,props:Zn(wd(),{showAction:[],notFoundContent:`Not Found`}),setup(e,t){let{attrs:n,expose:r,slots:i}=t,a=J(()=>Td(e.mode)),o=J(()=>e.showSearch===void 0?a.value||e.mode===`combobox`:e.showSearch),s=q(!1);V(()=>{s.value=vd()});let c=rd(),l=q(null),u=dd(),d=q(null),f=q(null),p=q(null),m=H(!1),[h,g,_]=md();r({focus:()=>{var e;(e=f.value)==null||e.focus()},blur:()=>{var e;(e=f.value)==null||e.blur()},scrollTo:e=>p.value?.scrollTo(e)});let v=J(()=>{if(e.mode!==`combobox`)return e.searchValue;let t=e.displayValues[0]?.value;return typeof t==`string`||typeof t==`number`?String(t):``}),y=e.open===void 0?e.defaultOpen:e.open,b=q(y),x=q(y),C=t=>{b.value=e.open===void 0?t:e.open,x.value=b.value};G(()=>e.open,()=>{C(e.open)});let w=J(()=>!e.notFoundContent&&e.emptyOptions);S(()=>{x.value=b.value,(e.disabled||w.value&&x.value&&e.mode===`combobox`)&&(x.value=!1)});let T=J(()=>!w.value&&x.value),E=t=>{let n=t===void 0?!x.value:t;x.value!==n&&!e.disabled&&(C(n),e.onDropdownVisibleChange&&e.onDropdownVisibleChange(n),!n&&L.value&&(L.value=!1,g(!1,()=>{F.value=!1,m.value=!1})))},D=J(()=>(e.tokenSeparators||[]).some(e=>[` +`,`\r +`].includes(e))),O=(t,n,r)=>{var i,a;let o=!0,s=t;(i=e.onActiveValueChange)==null||i.call(e,null);let c=r?null:Ci(t,e.tokenSeparators);return e.mode!==`combobox`&&c&&(s=``,(a=e.onSearchSplit)==null||a.call(e,c),E(!1),o=!1),e.onSearch&&v.value!==s&&e.onSearch(s,{source:n?`typing`:`effect`}),o},k=t=>{var n;!t||!t.trim()||(n=e.onSearch)==null||n.call(e,t,{source:`submit`})};G(x,()=>{!x.value&&!a.value&&e.mode!==`combobox`&&O(``,!1,!1)},{immediate:!0,flush:`post`}),G(()=>e.disabled,()=>{b.value&&e.disabled&&C(!1),e.disabled&&!m.value&&g(!1)},{immediate:!0});let[A,j]=ud(),M=function(t){var n;let r=A(),{which:i}=t;if(i===$.ENTER&&(e.mode!==`combobox`&&t.preventDefault(),x.value||E(!0)),j(!!v.value),i===$.BACKSPACE&&!r&&a.value&&!v.value&&e.displayValues.length){let t=[...e.displayValues],n=null;for(let e=t.length-1;e>=0;--e){let r=t[e];if(!r.disabled){t.splice(e,1),n=r;break}}n&&e.onDisplayValuesChange(t,{type:`remove`,values:[n]})}var o=[...arguments].slice(1);x.value&&p.value&&p.value.onKeydown(t,...o),(n=e.onKeydown)==null||n.call(e,t,...o)},N=function(t){var n=[...arguments].slice(1);x.value&&p.value&&p.value.onKeyup(t,...n),e.onKeyup&&e.onKeyup(t,...n)},P=t=>{let n=e.displayValues.filter(e=>e!==t);e.onDisplayValuesChange(n,{type:`remove`,values:[t]})},F=q(!1),I=function(){g(!0),e.disabled||(e.onFocus&&!F.value&&e.onFocus(...arguments),e.showAction&&e.showAction.includes(`focus`)&&E(!0)),F.value=!0},L=H(!1),ee=function(){if(L.value||(m.value=!0,g(!1,()=>{F.value=!1,m.value=!1,E(!1)}),e.disabled))return;let t=v.value;t&&(e.mode===`tags`?e.onSearch(t,{source:`submit`}):e.mode===`multiple`&&e.onSearch(``,{source:`blur`})),e.onBlur&&e.onBlur(...arguments)},te=()=>{L.value=!0},ne=()=>{L.value=!1};fe(`VCSelectContainerEvent`,{focus:I,blur:ee});let R=[];V(()=>{R.forEach(e=>clearTimeout(e)),R.splice(0,R.length)}),ut(()=>{R.forEach(e=>clearTimeout(e)),R.splice(0,R.length)});let re=function(t){var n;let{target:r}=t,i=d.value?.getPopupElement();if(i&&i.contains(r)){let e=setTimeout(()=>{var t;let n=R.indexOf(e);n!==-1&&R.splice(n,1),_(),!s.value&&!i.contains(document.activeElement)&&((t=f.value)==null||t.focus())});R.push(e)}var a=[...arguments].slice(1);(n=e.onMousedown)==null||n.call(e,t,...a)},ie=q(null),ae=()=>{};return V(()=>{G(T,()=>{if(T.value){let e=Math.ceil(l.value?.offsetWidth);ie.value!==e&&!Number.isNaN(e)&&(ie.value=e)}},{immediate:!0,flush:`post`})}),pd([l,d],T,E),gd(yd(Z(Z({},Ft(e)),{open:x,triggerOpen:T,showSearch:o,multiple:a,toggleOpen:E}))),()=>{let t=Z(Z({},e),n),{prefixCls:r,id:s,open:m,defaultOpen:g,mode:_,showSearch:y,searchValue:b,onSearch:S,allowClear:C,clearIcon:w,showArrow:A,inputIcon:j,disabled:F,loading:I,getInputElement:L,getPopupContainer:ee,placement:R,animation:oe,transitionName:z,dropdownStyle:se,dropdownClassName:B,dropdownMatchSelectWidth:V,dropdownRender:ce,dropdownAlign:le,showAction:H,direction:ue,tokenSeparators:de,tagRender:fe,optionLabelRender:pe,onPopupScroll:me,onDropdownVisibleChange:he,onFocus:ge,onBlur:_e,onKeyup:W,onKeydown:ve,onMousedown:ye,onClear:be,omitDomProps:xe,getRawInputElement:Se,displayValues:Ce,onDisplayValuesChange:we,emptyOptions:G,activeDescendantId:Te,activeValue:Ee,OptionList:De}=t,Oe=bd(t,`prefixCls.id.open.defaultOpen.mode.showSearch.searchValue.onSearch.allowClear.clearIcon.showArrow.inputIcon.disabled.loading.getInputElement.getPopupContainer.placement.animation.transitionName.dropdownStyle.dropdownClassName.dropdownMatchSelectWidth.dropdownRender.dropdownAlign.showAction.direction.tokenSeparators.tagRender.optionLabelRender.onPopupScroll.onDropdownVisibleChange.onFocus.onBlur.onKeyup.onKeydown.onMousedown.onClear.omitDomProps.getRawInputElement.displayValues.onDisplayValuesChange.emptyOptions.activeDescendantId.activeValue.OptionList`.split(`.`)),ke=_===`combobox`&&L&&L()||null,Ae=typeof Se==`function`&&Se(),je=Z({},Oe),Me;Ae&&(Me=e=>{E(e)}),xd.forEach(e=>{delete je[e]}),xe?.forEach(e=>{delete je[e]});let Ne=A===void 0?I||!a.value&&_!==`combobox`:A,Pe;Ne&&(Pe=U(Eu,{class:K(`${r}-arrow`,{[`${r}-arrow-loading`]:I}),customizeIcon:j,customizeIconProps:{loading:I,searchValue:v.value,open:x.value,focused:h.value,showSearch:o.value}},null));let Fe;!F&&C&&(Ce.length||v.value)&&(Fe=U(Eu,{class:`${r}-clear`,onMousedown:()=>{be?.(),we([],{type:`clear`,values:Ce}),O(``,!1,!1)},customizeIcon:w},{default:()=>[en(`×`)]}));let Ie=U(De,{ref:p},Z(Z({},c.customSlots),{option:i.option})),Le=K(r,n.class,{[`${r}-focused`]:h.value,[`${r}-multiple`]:a.value,[`${r}-single`]:!a.value,[`${r}-allow-clear`]:C,[`${r}-show-arrow`]:Ne,[`${r}-disabled`]:F,[`${r}-loading`]:I,[`${r}-open`]:x.value,[`${r}-customize-input`]:ke,[`${r}-show-search`]:o.value}),Re=U(Tu,{ref:d,disabled:F,prefixCls:r,visible:T.value,popupElement:Ie,containerWidth:ie.value,animation:oe,transitionName:z,dropdownStyle:se,dropdownClassName:B,direction:ue,dropdownMatchSelectWidth:V,dropdownRender:ce,dropdownAlign:le,placement:R,getPopupContainer:ee,empty:G,getTriggerDOMNode:()=>u.current,onPopupVisibleChange:Me,onPopupMouseEnter:ae,onPopupFocusin:te,onPopupFocusout:ne},{default:()=>Ae?Nt(Ae)&&ao(Ae,{ref:u},!1,!0):U(fd,Y(Y({},e),{},{domRef:u,prefixCls:r,inputElement:ke,ref:f,id:s,showSearch:o.value,mode:_,activeDescendantId:Te,tagRender:fe,optionLabelRender:pe,values:Ce,open:x.value,onToggleOpen:E,activeValue:Ee,searchValue:v.value,onSearch:O,onSearchSubmit:k,onRemove:P,tokenWithEnter:D.value}),null)}),ze;return ze=Ae?Re:U(`div`,Y(Y({},je),{},{class:Le,ref:l,onMousedown:re,onKeydown:M,onKeyup:N}),[h.value&&!x.value&&U(`span`,{style:{width:0,height:0,position:`absolute`,overflow:`hidden`,opacity:0},"aria-live":`polite`},[`${Ce.map(e=>{let{label:t,value:n}=e;return[`number`,`string`].includes(typeof t)?t:n}).join(`, `)}`]),Re,Pe,Fe]),ze}}}),Dd=(e,t)=>{let{height:n,offset:r,prefixCls:i,onInnerResize:a}=e,{slots:o}=t,s={},c={display:`flex`,flexDirection:`column`};return r!==void 0&&(s={height:`${n}px`,position:`relative`,overflow:`hidden`},c=Z(Z({},c),{transform:`translateY(${r}px)`,position:`absolute`,left:0,right:0,top:0})),U(`div`,{style:s},[U(Qn,{onResize:e=>{let{offsetHeight:t}=e;t&&a&&a()}},{default:()=>[U(`div`,{style:c,class:K({[`${i}-holder-inner`]:i})},[o.default?.call(o)])]})])};Dd.displayName=`Filter`,Dd.inheritAttrs=!1,Dd.props={prefixCls:String,height:Number,offset:Number,onInnerResize:Function};var Od=(e,t)=>{let{setRef:n}=e,{slots:r}=t,i=ce(r.default?.call(r));return i&&i.length?it(i[0],{ref:n}):i};Od.props={setRef:{type:Function,default:()=>{}}};var kd=20;function Ad(e){return`touches`in e?e.touches[0].pageY:e.pageY}var jd=u({compatConfig:{MODE:3},name:`ScrollBar`,inheritAttrs:!1,props:{prefixCls:String,scrollTop:Number,scrollHeight:Number,height:Number,count:Number,onScroll:{type:Function},onStartMove:{type:Function},onStopMove:{type:Function}},setup(){return{moveRaf:null,scrollbarRef:dd(),thumbRef:dd(),visibleTimeout:null,state:Ne({dragging:!1,pageY:null,startTop:null,visible:!1})}},watch:{scrollTop:{handler(){this.delayHidden()},flush:`post`}},mounted(){var e,t;(e=this.scrollbarRef.current)==null||e.addEventListener(`touchstart`,this.onScrollbarTouchStart,sr?{passive:!1}:!1),(t=this.thumbRef.current)==null||t.addEventListener(`touchstart`,this.onMouseDown,sr?{passive:!1}:!1)},beforeUnmount(){this.removeEvents(),clearTimeout(this.visibleTimeout)},methods:{delayHidden(){clearTimeout(this.visibleTimeout),this.state.visible=!0,this.visibleTimeout=setTimeout(()=>{this.state.visible=!1},2e3)},onScrollbarTouchStart(e){e.preventDefault()},onContainerMouseDown(e){e.stopPropagation(),e.preventDefault()},patchEvents(){window.addEventListener(`mousemove`,this.onMouseMove),window.addEventListener(`mouseup`,this.onMouseUp),this.thumbRef.current.addEventListener(`touchmove`,this.onMouseMove,sr?{passive:!1}:!1),this.thumbRef.current.addEventListener(`touchend`,this.onMouseUp)},removeEvents(){window.removeEventListener(`mousemove`,this.onMouseMove),window.removeEventListener(`mouseup`,this.onMouseUp),this.scrollbarRef.current.removeEventListener(`touchstart`,this.onScrollbarTouchStart,sr?{passive:!1}:!1),this.thumbRef.current&&(this.thumbRef.current.removeEventListener(`touchstart`,this.onMouseDown,sr?{passive:!1}:!1),this.thumbRef.current.removeEventListener(`touchmove`,this.onMouseMove,sr?{passive:!1}:!1),this.thumbRef.current.removeEventListener(`touchend`,this.onMouseUp)),ir.cancel(this.moveRaf)},onMouseDown(e){let{onStartMove:t}=this.$props;Z(this.state,{dragging:!0,pageY:Ad(e),startTop:this.getTop()}),t(),this.patchEvents(),e.stopPropagation(),e.preventDefault()},onMouseMove(e){let{dragging:t,pageY:n,startTop:r}=this.state,{onScroll:i}=this.$props;if(ir.cancel(this.moveRaf),t){let t=r+(Ad(e)-n),a=this.getEnableScrollRange(),o=this.getEnableHeightRange(),s=o?t/o:0,c=Math.ceil(s*a);this.moveRaf=ir(()=>{i(c)})}},onMouseUp(){let{onStopMove:e}=this.$props;this.state.dragging=!1,e(),this.removeEvents()},getSpinHeight(){let{height:e,scrollHeight:t}=this.$props,n=e/t*100;return n=Math.max(n,kd),n=Math.min(n,e/2),Math.floor(n)},getEnableScrollRange(){let{scrollHeight:e,height:t}=this.$props;return e-t||0},getEnableHeightRange(){let{height:e}=this.$props;return e-this.getSpinHeight()||0},getTop(){let{scrollTop:e}=this.$props,t=this.getEnableScrollRange(),n=this.getEnableHeightRange();return e===0||t===0?0:e/t*n},showScroll(){let{height:e,scrollHeight:t}=this.$props;return t>e}},render(){let{dragging:e,visible:t}=this.state,{prefixCls:n}=this.$props,r=this.getSpinHeight()+`px`,i=this.getTop()+`px`,a=this.showScroll(),o=a&&t;return U(`div`,{ref:this.scrollbarRef,class:K(`${n}-scrollbar`,{[`${n}-scrollbar-show`]:a}),style:{width:`8px`,top:0,bottom:0,right:0,position:`absolute`,display:o?void 0:`none`},onMousedown:this.onContainerMouseDown,onMousemove:this.delayHidden},[U(`div`,{ref:this.thumbRef,class:K(`${n}-scrollbar-thumb`,{[`${n}-scrollbar-thumb-moving`]:e}),style:{width:`100%`,height:r,top:i,left:0,position:`absolute`,background:`rgba(0, 0, 0, 0.5)`,borderRadius:`99px`,cursor:`pointer`,userSelect:`none`},onMousedown:this.onMouseDown},null)])}});function Md(e,t,n,r){let i=new Map,a=new Map,o=H(Symbol(`update`));G(e,()=>{o.value=Symbol(`update`)});let s;function c(){ir.cancel(s)}function l(){c(),s=ir(()=>{i.forEach((e,t)=>{if(e&&e.offsetParent){let{offsetHeight:n}=e;a.get(t)!==n&&(o.value=Symbol(`update`),a.set(t,e.offsetHeight))}})})}function u(e,a){let o=t(e),s=i.get(o);a?(i.set(o,a.$el||a),l()):i.delete(o),!s!=!a&&(a?n?.(e):r?.(e))}return y(()=>{c()}),[u,l,a,o]}function Nd(e,t,n,r,i,a,o,s){let c;return l=>{if(l==null){s();return}ir.cancel(c);let u=t.value,d=r.itemHeight;if(typeof l==`number`)o(l);else if(l&&typeof l==`object`){let t,{align:r}=l;`index`in l?{index:t}=l:t=u.findIndex(e=>i(e)===l.key);let{offset:s=0}=l,f=(l,p)=>{if(l<0||!e.value)return;let m=e.value.clientHeight,h=!1,g=p;if(m){let a=p||r,c=0,l=0,f=0,_=Math.min(u.length,t);for(let e=0;e<=_;e+=1){let r=i(u[e]);l=c;let a=n.get(r);f=l+(a===void 0?d:a),c=f,e===t&&a===void 0&&(h=!0)}let v=e.value.scrollTop,y=null;switch(a){case`top`:y=l-s;break;case`bottom`:y=f-m+s;break;default:{let e=v+m;le&&(g=`bottom`)}}y!==null&&y!==v&&o(y)}c=ir(()=>{h&&a(),f(l-1,g)},2)};f(5)}}}var Pd=typeof navigator==`object`&&/Firefox/i.test(navigator.userAgent),Fd=((e,t)=>{let n=!1,r=null;function i(){clearTimeout(r),n=!0,r=setTimeout(()=>{n=!1},50)}return function(a){let o=arguments.length>1&&arguments[1]!==void 0&&arguments[1],s=a<0&&e.value||a>0&&t.value;return o&&s?(clearTimeout(r),n=!1):(!s||n)&&i(),!n&&s}});function Id(e,t,n,r){let i=0,a=null,o=null,s=!1,c=Fd(t,n);function l(t){if(!e.value)return;ir.cancel(a);let{deltaY:n}=t;i+=n,o=n,!c(n)&&(Pd||t.preventDefault(),a=ir(()=>{r(i*(s?10:1)),i=0}))}function u(t){e.value&&(s=t.detail===o)}return[l,u]}var Ld=14/15;function Rd(e,t,n){let r=!1,i=0,a=null,o=null,s=()=>{a&&(a.removeEventListener(`touchmove`,c),a.removeEventListener(`touchend`,l))},c=e=>{if(r){let t=Math.ceil(e.touches[0].pageY),r=i-t;i=t,n(r)&&e.preventDefault(),clearInterval(o),o=setInterval(()=>{r*=Ld,(!n(r,!0)||Math.abs(r)<=.1)&&clearInterval(o)},16)}},l=()=>{r=!1,s()},u=e=>{s(),e.touches.length===1&&!r&&(r=!0,i=Math.ceil(e.touches[0].pageY),a=e.target,a.addEventListener(`touchmove`,c,{passive:!1}),a.addEventListener(`touchend`,l))},d=()=>{};V(()=>{document.addEventListener(`touchmove`,d,{passive:!1}),G(e,e=>{t.value.removeEventListener(`touchstart`,u),s(),clearInterval(o),e&&t.value.addEventListener(`touchstart`,u,{passive:!1})},{immediate:!0})}),ut(()=>{document.removeEventListener(`touchmove`,d)})}var zd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let a=i(e,t+n,{});return U(Od,{key:o(e),setRef:t=>r(e,t)},{default:()=>[a]})})}var Ud=u({compatConfig:{MODE:3},name:`List`,inheritAttrs:!1,props:{prefixCls:String,data:f.array,height:Number,itemHeight:Number,fullHeight:{type:Boolean,default:void 0},itemKey:{type:[String,Number,Function],required:!0},component:{type:[String,Object]},virtual:{type:Boolean,default:void 0},children:Function,onScroll:Function,onMousedown:Function,onMouseenter:Function,onVisibleChange:Function},setup(e,t){let{expose:n}=t,r=J(()=>{let{height:t,itemHeight:n,virtual:r}=e;return!!(r!==!1&&t&&n)}),i=J(()=>{let{height:t,itemHeight:n,data:i}=e;return r.value&&i&&n*i.length>t}),a=Ne({scrollTop:0,scrollMoving:!1}),o=J(()=>e.data||Bd),s=q([]);G(o,()=>{s.value=Ht(o.value).slice()},{immediate:!0});let c=q(e=>void 0);G(()=>e.itemKey,e=>{typeof e==`function`?c.value=e:c.value=t=>t?.[e]},{immediate:!0});let l=q(),u=q(),d=q(),f=e=>c.value(e),p={getKey:f};function m(e){let t;t=typeof e==`function`?e(a.scrollTop):e;let n=C(t);l.value&&(l.value.scrollTop=n),a.scrollTop=n}let[h,g,_,v]=Md(s,f,null,null),y=Ne({scrollHeight:void 0,start:0,end:0,offset:void 0}),b=q(0);V(()=>{z(()=>{b.value=u.value?.offsetHeight||0})}),O(()=>{z(()=>{b.value=u.value?.offsetHeight||0})}),G([r,s],()=>{r.value||Z(y,{scrollHeight:void 0,start:0,end:s.value.length-1,offset:void 0})},{immediate:!0}),G([r,s,b,i],()=>{r.value&&!i.value&&Z(y,{scrollHeight:b.value,start:0,end:s.value.length-1,offset:void 0}),l.value&&(a.scrollTop=l.value.scrollTop)},{immediate:!0}),G([i,r,()=>a.scrollTop,s,v,()=>e.height,b],()=>{if(!r.value||!i.value)return;let t=0,n,o,c,l=s.value.length,u=s.value,d=a.scrollTop,{itemHeight:p,height:m}=e,h=d+m;for(let e=0;e=d&&(n=e,o=t),c===void 0&&s>h&&(c=e),t=s}n===void 0&&(n=0,o=0,c=Math.ceil(m/p)),c===void 0&&(c=l-1),c=Math.min(c+1,l),Z(y,{scrollHeight:t,start:n,end:c,offset:o})},{immediate:!0});let x=J(()=>y.scrollHeight-e.height);function C(e){let t=e;return Number.isNaN(x.value)||(t=Math.min(t,x.value)),t=Math.max(t,0),t}let w=J(()=>a.scrollTop<=0),T=J(()=>a.scrollTop>=x.value),E=Fd(w,T);function D(e){m(e)}function k(t){var n;let{scrollTop:r}=t.currentTarget;r!==a.scrollTop&&m(r),(n=e.onScroll)==null||n.call(e,t)}let[A,j]=Id(r,w,T,e=>{m(t=>t+e)});Rd(r,l,(e,t)=>E(e,t)?!1:(A({preventDefault(){},deltaY:e}),!0));function M(e){r.value&&e.preventDefault()}let N=()=>{l.value&&(l.value.removeEventListener(`wheel`,A,sr?{passive:!1}:!1),l.value.removeEventListener(`DOMMouseScroll`,j),l.value.removeEventListener(`MozMousePixelScroll`,M))};S(()=>{z(()=>{l.value&&(N(),l.value.addEventListener(`wheel`,A,sr?{passive:!1}:!1),l.value.addEventListener(`DOMMouseScroll`,j),l.value.addEventListener(`MozMousePixelScroll`,M))})}),ut(()=>{N()}),n({scrollTo:Nd(l,s,_,e,f,g,m,()=>{var e;(e=d.value)==null||e.delayHidden()})});let P=J(()=>{let t=null;return e.height&&(t=Z({[e.fullHeight?`height`:`maxHeight`]:e.height+`px`},Vd),r.value&&(t.overflowY=`hidden`,a.scrollMoving&&(t.pointerEvents=`none`))),t});return G([()=>y.start,()=>y.end,s],()=>{if(e.onVisibleChange){let t=s.value.slice(y.start,y.end+1);e.onVisibleChange(t,s.value)}},{flush:`post`}),{state:a,mergedData:s,componentStyle:P,onFallbackScroll:k,onScrollBar:D,componentRef:l,useVirtual:r,calRes:y,collectHeight:g,setInstance:h,sharedConfig:p,scrollBarRef:d,fillerInnerRef:u,delayHideScrollBar:()=>{var e;(e=d.value)==null||e.delayHidden()}}},render(){let e=Z(Z({},this.$props),this.$attrs),{prefixCls:t=`rc-virtual-list`,height:n,itemHeight:r,fullHeight:i,data:a,itemKey:o,virtual:s,component:c=`div`,onScroll:l,children:u=this.$slots.default,style:d,class:f}=e,p=zd(e,[`prefixCls`,`height`,`itemHeight`,`fullHeight`,`data`,`itemKey`,`virtual`,`component`,`onScroll`,`children`,`style`,`class`]),m=K(t,f),{scrollTop:h}=this.state,{scrollHeight:g,offset:_,start:v,end:y}=this.calRes,{componentStyle:b,onFallbackScroll:x,onScrollBar:S,useVirtual:C,collectHeight:w,sharedConfig:T,setInstance:E,mergedData:D,delayHideScrollBar:O}=this;return U(`div`,Y({style:Z(Z({},d),{position:`relative`}),class:m},p),[U(c,{class:`${t}-holder`,style:b,ref:`componentRef`,onScroll:x,onMouseenter:O},{default:()=>[U(Dd,{prefixCls:t,height:g,offset:_,onInnerResize:w,ref:`fillerInnerRef`},{default:()=>Hd(D,v,y,E,u,T)})]}),C&&U(jd,{ref:`scrollBarRef`,prefixCls:t,scrollTop:h,height:n,scrollHeight:g,count:D.length,onScroll:S,onStartMove:()=>{this.state.scrollMoving=!0},onStopMove:()=>{this.state.scrollMoving=!1}},null)])}});function Wd(e,t,n){let r=H(e());return G(t,(t,i)=>{n?n(t,i)&&(r.value=e()):r.value=e()}),r}function Gd(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Kd=Symbol(`SelectContextKey`);function qd(e){return fe(Kd,e)}function Jd(){return g(Kd,{})}var Yd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i`${i.prefixCls}-item`),s=Wd(()=>a.flattenOptions,[()=>i.open,()=>a.flattenOptions],e=>e[0]),c=dd(),l=e=>{e.preventDefault()},u=e=>{c.current&&c.current.scrollTo(typeof e==`number`?{index:e}:e)},d=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=s.value.length;for(let r=0;r1&&arguments[1]!==void 0&&arguments[1];f.activeIndex=e;let n={source:t?`keyboard`:`mouse`},r=s.value[e];if(!r){a.onActiveValue(null,-1,n);return}a.onActiveValue(r.value,e,n)};G([()=>s.value.length,()=>i.searchValue],()=>{p(a.defaultActiveFirstOption===!1?-1:d(0))},{immediate:!0});let m=e=>a.rawValues.has(e)&&i.mode!==`combobox`;G([()=>i.open,()=>i.searchValue],()=>{if(!i.multiple&&i.open&&a.rawValues.size===1){let e=Array.from(a.rawValues)[0],t=Ht(s.value).findIndex(t=>{let{data:n}=t;return n[a.fieldNames.value]===e});t!==-1&&(p(t),z(()=>{u(t)}))}i.open&&z(()=>{var e;(e=c.current)==null||e.scrollTo(void 0)})},{immediate:!0,flush:`post`});let h=e=>{e!==void 0&&a.onSelect(e,{selected:!a.rawValues.has(e)}),i.multiple||i.toggleOpen(!1)},g=e=>typeof e.label==`function`?e.label():e.label;function _(e){let t=s.value[e];if(!t)return null;let n=t.data||{},{value:r}=n,{group:a}=t,o=Bu(n,!0),c=g(t);return t?U(`div`,Y(Y({"aria-label":typeof c==`string`&&!a?c:null},o),{},{key:e,role:a?`presentation`:`option`,id:`${i.id}_list_${e}`,"aria-selected":m(r)}),[r]):null}return n({onKeydown:e=>{let{which:t,ctrlKey:n}=e;switch(t){case $.N:case $.P:case $.UP:case $.DOWN:{let e=0;if(t===$.UP?e=-1:t===$.DOWN?e=1:Gd()&&n&&(t===$.N?e=1:t===$.P&&(e=-1)),e!==0){let t=d(f.activeIndex+e,e);u(t),p(t,!0)}break}case $.ENTER:{let t=s.value[f.activeIndex];t&&!t.data.disabled?h(t.value):h(void 0),i.open&&e.preventDefault();break}case $.ESC:i.toggleOpen(!1),i.open&&e.stopPropagation()}},onKeyup:()=>{},scrollTo:e=>{u(e)}}),()=>{let{id:e,notFoundContent:t,onPopupScroll:n}=i,{menuItemSelectedIcon:u,fieldNames:d,virtual:v,listHeight:y,listItemHeight:b}=a,x=r.option,{activeIndex:S}=f,C=Object.keys(d).map(e=>d[e]);return s.value.length===0?U(`div`,{role:`listbox`,id:`${e}_list`,class:`${o.value}-empty`,onMousedown:l},[t]):U($e,null,[U(`div`,{role:`listbox`,id:`${e}_list`,style:{height:0,width:0,overflow:`hidden`}},[_(S-1),_(S),_(S+1)]),U(Ud,{itemKey:`key`,ref:c,data:s.value,height:y,itemHeight:b,fullHeight:!1,onMousedown:l,onScroll:n,virtual:v},{default:(e,t)=>{let{group:n,groupOption:r,data:i,value:a}=e,{key:s}=i,c=typeof e.label==`function`?e.label():e.label;if(n){let e=i.title??(Xd(c)&&c);return U(`div`,{class:K(o.value,`${o.value}-group`),title:e},[x?x(i):c===void 0?s:c])}let{disabled:l,title:d,children:f,style:_,class:v,className:y}=i,b=Yd(i,[`disabled`,`title`,`children`,`style`,`class`,`className`]),w=Br(b,C),T=m(a),E=`${o.value}-option`,D=K(o.value,E,v,y,{[`${E}-grouped`]:r,[`${E}-active`]:S===t&&!l,[`${E}-disabled`]:l,[`${E}-selected`]:T}),O=g(e),k=!u||typeof u==`function`||T,A=typeof O==`number`?O:O||a,j=Xd(A)?A.toString():void 0;return d!==void 0&&(j=d),U(`div`,Y(Y({},w),{},{"aria-selected":T,class:D,title:j,onMousemove:e=>{b.onMousemove&&b.onMousemove(e),!(S===t||l)&&p(t)},onClick:e=>{l||h(a),b.onClick&&b.onClick(e)},style:_}),[U(`div`,{class:`${E}-content`},[x?x(i):A]),Nt(u)||T,k&&U(Eu,{class:`${o.value}-option-state`,customizeIcon:u,customizeIconProps:{isSelected:T}},{default:()=>[T?`✓`:null]})])}})])}}}),Qd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0&&arguments[1];return ce(e).map((e,n)=>{if(!Nt(e)||!e.type)return null;let{type:{isSelectOptGroup:r},key:i,children:a,props:o}=e;if(t||!r)return $d(e);let s=a&&a.default?a.default():void 0,c=o?.label||a.label?.call(a)||i;return Z(Z({key:`__RC_SELECT_GRP__${i===null?n:String(i)}__`},o),{label:c,options:ef(s||[])})}).filter(e=>e)}function tf(e,t,n){let r=q(),i=q(),a=q(),o=q([]);return G([e,t],()=>{e.value?o.value=Ht(e.value).slice():o.value=ef(t.value)},{immediate:!0,deep:!0}),S(()=>{let e=o.value,t=new Map,s=new Map,c=n.value;function l(e){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(let r=0;r0&&arguments[0]!==void 0?arguments[0]:H(``),t=`rc_select_${af()}`;return e.value||t}function sf(e){return Array.isArray(e)?e:e===void 0?[]:[e]}typeof window<`u`&&window.document&&window.document.documentElement;function cf(e,t){return sf(e).join(``).toUpperCase().includes(t)}var lf=((e,t,n,r,i)=>J(()=>{let a=n.value,o=i?.value,s=r?.value;if(!a||s===!1)return e.value;let{options:c,label:l,value:u}=t.value,d=[],f=typeof s==`function`,p=a.toUpperCase(),m=f?s:(e,t)=>o?cf(t[o],p):t[c]?cf(t[l===`children`?`label`:l],p):cf(t[u],p),h=f?e=>Si(e):e=>e;return e.value.forEach(e=>{if(e[c]){if(m(a,h(e)))d.push(e);else{let t=e[c].filter(e=>m(a,h(e)));t.length&&d.push(Z(Z({},e),{[c]:t}))}return}m(a,h(e))&&d.push(e)}),d})),uf=((e,t)=>{let n=q({values:new Map,options:new Map});return[J(()=>{let{values:r,options:i}=n.value,a=e.value.map(e=>e.label===void 0?Z(Z({},e),{label:r.get(e.value)?.label}):e),o=new Map,s=new Map;return a.forEach(e=>{o.set(e.value,e),s.set(e.value,t.value.get(e.value)||i.get(e.value))}),n.value.values=o,n.value.options=s,a}),e=>t.value.get(e)||n.value.options.get(e)]});function df(e,t){let{defaultValue:n,value:r=H()}=t||{},i=typeof e==`function`?e():e;r.value!==void 0&&(i=ze(r)),n!==void 0&&(i=typeof n==`function`?n():n);let a=H(i),o=H(i);S(()=>{let e=r.value===void 0?a.value:r.value;t.postState&&(e=t.postState(e)),o.value=e});function s(e){let n=o.value;a.value=e,Ht(o.value)!==e&&t.onChange&&t.onChange(e,n)}return G(r,()=>{a.value=r.value}),[o,s]}function ff(e){let t=H(typeof e==`function`?e():e);function n(e){t.value=e}return[t,n]}var pf=[`inputValue`];function mf(){return Z(Z({},Cd()),{prefixCls:String,id:String,backfill:{type:Boolean,default:void 0},fieldNames:Object,inputValue:String,searchValue:String,onSearch:Function,autoClearSearchValue:{type:Boolean,default:void 0},onSelect:Function,onDeselect:Function,filterOption:{type:[Boolean,Function],default:void 0},filterSort:Function,optionFilterProp:String,optionLabelProp:String,options:Array,defaultActiveFirstOption:{type:Boolean,default:void 0},virtual:{type:Boolean,default:void 0},listHeight:Number,listItemHeight:Number,menuItemSelectedIcon:f.any,mode:String,labelInValue:{type:Boolean,default:void 0},value:f.any,defaultValue:f.any,onChange:Function,children:Array})}function hf(e){return!e||typeof e!=`object`}var gf=u({compatConfig:{MODE:3},name:`VcSelect`,inheritAttrs:!1,props:Zn(mf(),{prefixCls:`vc-select`,autoClearSearchValue:!0,listHeight:200,listItemHeight:20,dropdownMatchSelectWidth:!0}),setup(e,t){let{expose:n,attrs:r,slots:i}=t,a=of(St(e,`id`)),o=J(()=>Td(e.mode)),s=J(()=>!!(!e.options&&e.children)),c=J(()=>e.filterOption===void 0&&e.mode===`combobox`?!1:e.filterOption),l=J(()=>bi(e.fieldNames,s.value)),[u,d]=df(``,{value:J(()=>e.searchValue===void 0?e.inputValue:e.searchValue),postState:e=>e||``}),f=tf(St(e,`options`),St(e,`children`),l),{valueOptions:p,labelOptions:m,options:h}=f,g=t=>sf(t).map(t=>{let n,r,i,a;hf(t)?n=t:(i=t.key,r=t.label,n=t.value??i);let o=p.value.get(n);return o&&(r===void 0&&(r=o?.[e.optionLabelProp||l.value.label]),i===void 0&&(i=o?.key??n),a=o?.disabled),{label:r,value:n,key:i,disabled:a,option:o}}),[_,v]=df(e.defaultValue,{value:St(e,`value`)}),[y,b]=uf(J(()=>{let t=g(_.value);return e.mode===`combobox`&&!t[0]?.value?[]:t}),p),x=J(()=>{if(!e.mode&&y.value.length===1){let e=y.value[0];if(e.value===null&&(e.label===null||e.label===void 0))return[]}return y.value.map(e=>Z(Z({},e),{label:(typeof e.label==`function`?e.label():e.label)??e.value}))}),C=J(()=>new Set(y.value.map(e=>e.value)));S(()=>{if(e.mode===`combobox`){let e=y.value[0]?.value;e!=null&&d(String(e))}},{flush:`post`});let w=(e,t)=>{let n=t??e;return{[l.value.value]:e,[l.value.label]:n}},T=q();S(()=>{if(e.mode!==`tags`){T.value=h.value;return}let t=h.value.slice(),n=e=>p.value.has(e);[...y.value].sort((e,t)=>e.value{let r=e.value;n(r)||t.push(w(r,e.label))}),T.value=t});let E=lf(T,l,u,c,St(e,`optionFilterProp`)),D=J(()=>e.mode!==`tags`||!u.value||E.value.some(t=>t[e.optionFilterProp||`value`]===u.value)?E.value:[w(u.value),...E.value]),O=J(()=>e.filterSort?[...D.value].sort((t,n)=>e.filterSort(t,n)):D.value),k=J(()=>xi(O.value,{fieldNames:l.value,childrenAsData:s.value})),A=t=>{let n=g(t);if(v(n),e.onChange&&(n.length!==y.value.length||n.some((e,t)=>y.value[t]?.value!==e?.value))){let t=e.labelInValue?n.map(e=>Z(Z({},e),{originLabel:e.label,label:typeof e.label==`function`?e.label():e.label})):n.map(e=>e.value),r=n.map(e=>Si(b(e.value)));e.onChange(o.value?t:t[0],o.value?r:r[0])}},[j,M]=ff(null),[N,P]=ff(0),F=J(()=>e.defaultActiveFirstOption===void 0?e.mode!==`combobox`:e.defaultActiveFirstOption),I=function(t,n){let{source:r=`keyboard`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};P(n),e.backfill&&e.mode===`combobox`&&t!==null&&r===`keyboard`&&M(String(t))},L=(t,n)=>{let r=()=>{let n=b(t),r=n?.[l.value.label];return[e.labelInValue?{label:typeof r==`function`?r():r,originLabel:r,value:t,key:n?.key??t}:t,Si(n)]};if(n&&e.onSelect){let[t,n]=r();e.onSelect(t,n)}else if(!n&&e.onDeselect){let[t,n]=r();e.onDeselect(t,n)}},ee=(t,n)=>{let r,i=!o.value||n.selected;r=i?o.value?[...y.value,t]:[t]:y.value.filter(e=>e.value!==t),A(r),L(t,i),e.mode===`combobox`?M(``):(!o.value||e.autoClearSearchValue)&&(d(``),M(``))},te=(e,t)=>{A(e),(t.type===`remove`||t.type===`clear`)&&t.values.forEach(e=>{L(e.value,!1)})},ne=(t,n)=>{var r;if(d(t),M(null),n.source===`submit`){let e=(t||``).trim();if(e){let t=Array.from(new Set([...C.value,e]));A(t),L(e,!0),d(``)}return}n.source!==`blur`&&(e.mode===`combobox`&&A(t),(r=e.onSearch)==null||r.call(e,t))},R=t=>{let n=t;e.mode!==`tags`&&(n=t.map(e=>m.value.get(e)?.value).filter(e=>e!==void 0));let r=Array.from(new Set([...C.value,...n]));A(r),r.forEach(e=>{L(e,!0)})},re=J(()=>e.virtual!==!1&&e.dropdownMatchSelectWidth!==!1);qd(yd(Z(Z({},f),{flattenOptions:k,onActiveValue:I,defaultActiveFirstOption:F,onSelect:ee,menuItemSelectedIcon:St(e,`menuItemSelectedIcon`),rawValues:C,fieldNames:l,virtual:re,listHeight:St(e,`listHeight`),listItemHeight:St(e,`listItemHeight`),childrenAsData:s})));let ie=H();n({focus(){var e;(e=ie.value)==null||e.focus()},blur(){var e;(e=ie.value)==null||e.blur()},scrollTo(e){var t;(t=ie.value)==null||t.scrollTo(e)}});let ae=J(()=>Br(e,`id.mode.prefixCls.backfill.fieldNames.inputValue.searchValue.onSearch.autoClearSearchValue.onSelect.onDeselect.dropdownMatchSelectWidth.filterOption.filterSort.optionFilterProp.optionLabelProp.options.children.defaultActiveFirstOption.menuItemSelectedIcon.virtual.listHeight.listItemHeight.value.defaultValue.labelInValue.onChange`.split(`.`)));return()=>U(Ed,Y(Y(Y({},ae.value),r),{},{id:a,prefixCls:e.prefixCls,ref:ie,omitDomProps:pf,mode:e.mode,displayValues:x.value,onDisplayValuesChange:te,searchValue:u.value,onSearch:ne,onSearchSplit:R,dropdownMatchSelectWidth:e.dropdownMatchSelectWidth,OptionList:Zd,emptyOptions:!k.value.length,activeValue:j.value,activeDescendantId:`${a}_list_${N.value}`}),i)}}),_f=()=>null;_f.isSelectOption=!0,_f.displayName=`ASelectOption`;var vf=()=>null;vf.isSelectOptGroup=!0,vf.displayName=`ASelectOptGroup`;var yf=gf,bf={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z`}}]},name:`down`,theme:`outlined`};function xf(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{loading:n,multiple:r,prefixCls:i,hasFeedback:a,feedbackIcon:o,showArrow:s}=e,c=e.suffixIcon||t.suffixIcon&&t.suffixIcon(),l=e.clearIcon||t.clearIcon&&t.clearIcon(),u=e.menuItemSelectedIcon||t.menuItemSelectedIcon&&t.menuItemSelectedIcon(),d=e.removeIcon||t.removeIcon&&t.removeIcon(),f=l??U(tt,null,null),p=e=>U($e,null,[s!==!1&&e,a&&o]),m=null;if(c!==void 0)m=p(c);else if(n)m=p(U(qt,{spin:!0},null));else{let e=`${i}-suffix`;m=t=>{let{open:n,showSearch:r}=t;return p(U(n&&r?jf:Cf,{class:e},null))}}let h=null;h=u===void 0?r?U(Df,null,null):null:u;let g=null;return g=d===void 0?U(Pe,null,null):d,{clearIcon:f,suffixIcon:m,itemIcon:h,removeIcon:g}}function Nf(e){let t=Symbol(`contextKey`);return{useProvide:(e,n)=>{let r=Ne({});return fe(t,r),S(()=>{Z(r,e,n||{})}),r},useInject:()=>g(t,e)||{}}}var Pf=Symbol(`ContextProps`),Ff=Symbol(`InternalContextProps`),If=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:J(()=>!0),n=H(new Map);Zt(),G([t,n],()=>{}),fe(Pf,e),fe(Ff,{addFormItemField:(e,t)=>{n.value.set(e,t),n.value=new Map(n.value)},removeFormItemField:e=>{n.value.delete(e),n.value=new Map(n.value)}})},Lf={id:J(()=>void 0),onFieldBlur:()=>{},onFieldChange:()=>{},clearValidate:()=>{}},Rf={addFormItemField:()=>{},removeFormItemField:()=>{}},zf=()=>{let e=g(Ff,Rf),t=Symbol(`FormItemFieldKey`),n=Zt();return e.addFormItemField(t,n.type),ut(()=>{e.removeFormItemField(t)}),fe(Ff,Rf),fe(Pf,Lf),g(Pf,Lf)},Bf=u({compatConfig:{MODE:3},name:`AFormItemRest`,setup(e,t){let{slots:n}=t;return fe(Ff,Rf),fe(Pf,Lf),()=>n.default?.call(n)}}),Vf=Nf({}),Hf=u({name:`NoFormStatus`,setup(e,t){let{slots:n}=t;return Vf.useProvide({}),()=>n.default?.call(n)}});function Uf(e,t,n){return K({[`${e}-status-success`]:t===`success`,[`${e}-status-warning`]:t===`warning`,[`${e}-status-error`]:t===`error`,[`${e}-status-validating`]:t===`validating`,[`${e}-has-feedback`]:n})}var Wf=(e,t)=>t||e,Gf=e=>{let{componentCls:t}=e;return{[t]:{display:`inline-flex`,"&-block":{display:`flex`,width:`100%`},"&-vertical":{flexDirection:`column`}}}},Kf=e=>{let{componentCls:t}=e;return{[t]:{display:`inline-flex`,"&-rtl":{direction:`rtl`},"&-vertical":{flexDirection:`column`},"&-align":{flexDirection:`column`,"&-center":{alignItems:`center`},"&-start":{alignItems:`flex-start`},"&-end":{alignItems:`flex-end`},"&-baseline":{alignItems:`baseline`}},[`${t}-item`]:{"&:empty":{display:`none`}}}}},qf=v(`Space`,e=>[Kf(e),Gf(e)]),Jf=`[object Symbol]`;function Yf(e){return typeof e==`symbol`||vc(e)&&Wo(e)==Jf}function Xf(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=xp)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Tp(e){return function(){return e}}var Ep=function(){try{var e=ds(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Dp=wp(Ep?function(e,t){return Ep(e,`toString`,{configurable:!0,enumerable:!1,value:Tp(t),writable:!0})}:hp);function Op(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}function Pp(e,t,n){t==`__proto__`&&Ep?Ep(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Fp=Object.prototype.hasOwnProperty;function Ip(e,t,n){var r=e[t];(!(Fp.call(e,t)&&vo(r,n))||n===void 0&&!(t in e))&&Pp(e,t,n)}function Lp(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a0&&n(s)?t>1?lm(s,t-1,n,r,i):lc(i,s):r||(i[i.length]=s)}return i}function um(e){return e!=null&&e.length?lm(e,1):[]}function dm(e){return Dp(zp(e,void 0,um),e+``)}var fm=vl(Object.getPrototypeOf,Object),pm=`[object Object]`,mm=Function.prototype,hm=Object.prototype,gm=mm.toString,_m=hm.hasOwnProperty,vm=gm.call(Object);function ym(e){if(!vc(e)||Wo(e)!=pm)return!1;var t=fm(e);if(t===null)return!0;var n=_m.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&gm.call(n)==vm}function bm(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=t||n<0||d&&r>=a}function _(){var e=Sg();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Sg())}function x(){var e=Sg(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Dg(e){return vc(e)&&Sl(e)}function Og(e,t,n){for(var r=-1,i=e==null?0:e.length;++r-1?i[a?t[o]:o]:void 0}}var jg=Math.max;function Mg(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:mp(n);return i<0&&(i=jg(r+i,0)),kp(e,pg(t,3),i)}var Ng=Ag(Mg);function Pg(e){for(var t=-1,n=e==null?0:e.length,r={};++t=120&&u.length>=120)?new Rs(o&&u):void 0}u=e[0];var d=-1,f=s[0];outer:for(;++d1,t}),Lp(e,jm(e),n),r&&(n=qh(n,Yg|Xg|Zg,Jg));for(var i=t.length;i--;)qg(n,t[i]);return n});function $g(e,t,n,r){if(!Go(e))return e;t=nm(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=a_){var l=t?null:i_(e);if(l)return Ks(l);o=!1,i=Bs,c=new Rs}else c=t?[]:s;outer:for(;++r({compactSize:String,compactDirection:f.oneOf(m(`horizontal`,`vertical`)).def(`horizontal`),isFirstItem:Q(),isLastItem:Q()}),l_=Nf(null),u_=(e,t)=>{let n=l_.useInject(),r=J(()=>{if(!n||Ug(n))return``;let{compactDirection:r,isFirstItem:i,isLastItem:a}=n,o=r===`vertical`?`-vertical-`:`-`;return K({[`${e.value}-compact${o}item`]:!0,[`${e.value}-compact${o}first-item`]:i,[`${e.value}-compact${o}last-item`]:a,[`${e.value}-compact${o}item-rtl`]:t.value===`rtl`})});return{compactSize:J(()=>n?.compactSize),compactDirection:J(()=>n?.compactDirection),compactItemClassnames:r}},d_=u({name:`NoCompactStyle`,setup(e,t){let{slots:n}=t;return l_.useProvide(null),()=>n.default?.call(n)}}),f_=()=>({prefixCls:String,size:{type:String},direction:f.oneOf(m(`horizontal`,`vertical`)).def(`horizontal`),align:f.oneOf(m(`start`,`end`,`center`,`baseline`)),block:{type:Boolean,default:void 0}}),p_=u({name:`CompactItem`,props:c_(),setup(e,t){let{slots:n}=t;return l_.useProvide(e),()=>n.default?.call(n)}}),m_=u({name:`ASpaceCompact`,inheritAttrs:!1,props:f_(),setup(e,t){let{attrs:n,slots:r}=t,{prefixCls:i,direction:a}=X(`space-compact`,e),o=l_.useInject(),[s,c]=qf(i),l=J(()=>K(i.value,c.value,{[`${i.value}-rtl`]:a.value===`rtl`,[`${i.value}-block`]:e.block,[`${i.value}-vertical`]:e.direction===`vertical`}));return()=>{let t=ce(r.default?.call(r)||[]);return t.length===0?null:s(U(`div`,Y(Y({},n),{},{class:[l.value,n.class]}),[t.map((n,r)=>{let a=n&&n.key||`${i.value}-item-${r}`,s=!o||Ug(o);return U(p_,{key:a,compactSize:e.size??`middle`,compactDirection:e.direction,isFirstItem:r===0&&(s||o?.isFirstItem),isLastItem:r===t.length-1&&(s||o?.isLastItem)},{default:()=>[n]})})]))}}}),h_=e=>({animationDuration:e,animationFillMode:`both`}),g_=e=>({animationDuration:e,animationFillMode:`both`}),__=function(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0&&arguments[4]?`&`:``;return{[` + ${i}${e}-enter, + ${i}${e}-appear + `]:Z(Z({},h_(r)),{animationPlayState:`paused`}),[`${i}${e}-leave`]:Z(Z({},g_(r)),{animationPlayState:`paused`}),[` + ${i}${e}-enter${e}-enter-active, + ${i}${e}-appear${e}-appear-active + `]:{animationName:t,animationPlayState:`running`},[`${i}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:`running`,pointerEvents:`none`}}},v_=new N(`antFadeIn`,{"0%":{opacity:0},"100%":{opacity:1}}),y_=new N(`antFadeOut`,{"0%":{opacity:1},"100%":{opacity:0}}),b_=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],{antCls:n}=e,r=`${n}-fade`,i=t?`&`:``;return[__(r,v_,y_,e.motionDurationMid,t),{[` + ${i}${r}-enter, + ${i}${r}-appear + `]:{opacity:0,animationTimingFunction:`linear`},[`${i}${r}-leave`]:{animationTimingFunction:`linear`}}]},x_=new N(`antMoveDownIn`,{"0%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),S_=new N(`antMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0}}),C_=new N(`antMoveLeftIn`,{"0%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),w_=new N(`antMoveLeftOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),T_=new N(`antMoveRightIn`,{"0%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),E_=new N(`antMoveRightOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),D_={"move-up":{inKeyframes:new N(`antMoveUpIn`,{"0%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),outKeyframes:new N(`antMoveUpOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0}})},"move-down":{inKeyframes:x_,outKeyframes:S_},"move-left":{inKeyframes:C_,outKeyframes:w_},"move-right":{inKeyframes:T_,outKeyframes:E_}},O_=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=D_[t];return[__(r,i,a,e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},k_=new N(`antSlideUpIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1}}),A_=new N(`antSlideUpOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),j_=new N(`antSlideDownIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1}}),M_=new N(`antSlideDownOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0}}),N_=new N(`antSlideLeftIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1}}),P_=new N(`antSlideLeftOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),F_=new N(`antSlideRightIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1}}),I_=new N(`antSlideRightOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0}}),L_={"slide-up":{inKeyframes:k_,outKeyframes:A_},"slide-down":{inKeyframes:j_,outKeyframes:M_},"slide-left":{inKeyframes:N_,outKeyframes:P_},"slide-right":{inKeyframes:F_,outKeyframes:I_}},R_=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=L_[t];return[__(r,i,a,e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:`scale(0)`,transformOrigin:`0% 0%`,opacity:0,animationTimingFunction:e.motionEaseOutQuint},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},z_=new N(`antZoomIn`,{"0%":{transform:`scale(0.2)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),B_=new N(`antZoomOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.2)`,opacity:0}}),V_=new N(`antZoomBigIn`,{"0%":{transform:`scale(0.8)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),H_=new N(`antZoomBigOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.8)`,opacity:0}}),U_=new N(`antZoomUpIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 0%`}}),W_=new N(`antZoomUpOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 0%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0}}),G_=new N(`antZoomLeftIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`0% 50%`}}),K_=new N(`antZoomLeftOut`,{"0%":{transform:`scale(1)`,transformOrigin:`0% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0}}),q_=new N(`antZoomRightIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`100% 50%`}}),J_=new N(`antZoomRightOut`,{"0%":{transform:`scale(1)`,transformOrigin:`100% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0}}),Y_=new N(`antZoomDownIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 100%`}}),X_=new N(`antZoomDownOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 100%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0}}),Z_={zoom:{inKeyframes:z_,outKeyframes:B_},"zoom-big":{inKeyframes:V_,outKeyframes:H_},"zoom-big-fast":{inKeyframes:V_,outKeyframes:H_},"zoom-left":{inKeyframes:G_,outKeyframes:K_},"zoom-right":{inKeyframes:q_,outKeyframes:J_},"zoom-up":{inKeyframes:U_,outKeyframes:W_},"zoom-down":{inKeyframes:Y_,outKeyframes:X_}},Q_=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Z_[t];return[__(r,i,a,t===`zoom-big-fast`?e.motionDurationFast:e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:`scale(0)`,opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:`none`}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},$_=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:`hidden`,"&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, + opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:`hidden`,transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, + opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),ev=e=>{let{controlPaddingHorizontal:t}=e;return{position:`relative`,display:`block`,minHeight:e.controlHeight,padding:`${(e.controlHeight-e.fontSize*e.lineHeight)/2}px ${t}px`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,boxSizing:`border-box`}},tv=e=>{let{antCls:t,componentCls:n}=e,r=`${n}-item`;return[{[`${n}-dropdown`]:Z(Z({},rn(e)),{position:`absolute`,top:-9999,zIndex:e.zIndexPopup,boxSizing:`border-box`,padding:e.paddingXXS,overflow:`hidden`,fontSize:e.fontSize,fontVariant:`initial`,backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,[` + &${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-bottomLeft, + &${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-bottomLeft + `]:{animationName:k_},[` + &${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-topLeft, + &${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-topLeft + `]:{animationName:j_},[`&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-bottomLeft`]:{animationName:A_},[`&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-topLeft`]:{animationName:M_},"&-hidden":{display:`none`},"&-empty":{color:e.colorTextDisabled},[`${r}-empty`]:Z(Z({},ev(e)),{color:e.colorTextDisabled}),[`${r}`]:Z(Z({},ev(e)),{cursor:`pointer`,transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:`default`},"&-option":{display:`flex`,"&-content":Z({flex:`auto`},xe),"&-state":{flex:`none`},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.controlItemBgHover},[`&-selected:not(${r}-option-disabled)`]:{color:e.colorText,fontWeight:e.fontWeightStrong,backgroundColor:e.controlItemBgActive,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:`not-allowed`},"&-grouped":{paddingInlineStart:e.controlPaddingHorizontal*2}}}),"&-rtl":{direction:`rtl`}})},R_(e,`slide-up`),R_(e,`slide-down`),O_(e,`move-up`),O_(e,`move-down`)]},nv=2;function rv(e){let{controlHeightSM:t,controlHeight:n,lineWidth:r}=e,i=(n-t)/2-r;return[i,Math.ceil(i/2)]}function iv(e,t){let{componentCls:n,iconCls:r}=e,i=`${n}-selection-overflow`,a=e.controlHeightSM,[s]=rv(e);return{[`${n}-multiple${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[i]:{position:`relative`,display:`flex`,flex:`auto`,flexWrap:`wrap`,maxWidth:`100%`,"&-item":{flex:`none`,alignSelf:`center`,maxWidth:`100%`,display:`inline-flex`}},[`${n}-selector`]:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,padding:`${s-nv}px ${nv*2}px`,borderRadius:e.borderRadius,[`${n}-show-search&`]:{cursor:`text`},[`${n}-disabled&`]:{background:e.colorBgContainerDisabled,cursor:`not-allowed`},"&:after":{display:`inline-block`,width:0,margin:`${nv}px 0`,lineHeight:`${a}px`,content:`"\\a0"`}},[` + &${n}-show-arrow ${n}-selector, + &${n}-allow-clear ${n}-selector + `]:{paddingInlineEnd:e.fontSizeIcon+e.controlPaddingHorizontal},[`${n}-selection-item`]:{position:`relative`,display:`flex`,flex:`none`,boxSizing:`border-box`,maxWidth:`100%`,height:a,marginTop:nv,marginBottom:nv,lineHeight:`${a-e.lineWidth*2}px`,background:e.colorFillSecondary,border:`${e.lineWidth}px solid ${e.colorSplit}`,borderRadius:e.borderRadiusSM,cursor:`default`,transition:`font-size ${e.motionDurationSlow}, line-height ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,userSelect:`none`,marginInlineEnd:nv*2,paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS/2,[`${n}-disabled&`]:{color:e.colorTextDisabled,borderColor:e.colorBorder,cursor:`not-allowed`},"&-content":{display:`inline-block`,marginInlineEnd:e.paddingXS/2,overflow:`hidden`,whiteSpace:`pre`,textOverflow:`ellipsis`},"&-remove":Z(Z({},o()),{display:`inline-block`,color:e.colorIcon,fontWeight:`bold`,fontSize:10,lineHeight:`inherit`,cursor:`pointer`,[`> ${r}`]:{verticalAlign:`-0.2em`},"&:hover":{color:e.colorIconHover}})},[`${i}-item + ${i}-item`]:{[`${n}-selection-search`]:{marginInlineStart:0}},[`${n}-selection-search`]:{display:`inline-flex`,position:`relative`,maxWidth:`100%`,marginInlineStart:e.inputPaddingHorizontalBase-s,"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:`${a}px`,transition:`all ${e.motionDurationSlow}`},"&-input":{width:`100%`,minWidth:4.1},"&-mirror":{position:`absolute`,top:0,insetInlineStart:0,insetInlineEnd:`auto`,zIndex:999,whiteSpace:`pre`,visibility:`hidden`}},[`${n}-selection-placeholder `]:{position:`absolute`,top:`50%`,insetInlineStart:e.inputPaddingHorizontalBase,insetInlineEnd:e.inputPaddingHorizontalBase,transform:`translateY(-50%)`,transition:`all ${e.motionDurationSlow}`}}}}function av(e){let{componentCls:t}=e,n=B(e,{controlHeight:e.controlHeightSM,controlHeightSM:e.controlHeightXS,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),[,r]=rv(e);return[iv(e),iv(n,`sm`),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInlineStart:e.controlPaddingHorizontalSM-e.lineWidth,insetInlineEnd:`auto`},[`${t}-selection-search`]:{marginInlineStart:r}}},iv(B(e,{fontSize:e.fontSizeLG,controlHeight:e.controlHeightLG,controlHeightSM:e.controlHeight,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius}),`lg`)]}function ov(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.controlHeight-e.lineWidth*2,o=Math.ceil(e.fontSize*1.25);return{[`${n}-single${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[`${n}-selector`]:Z(Z({},rn(e)),{display:`flex`,borderRadius:i,[`${n}-selection-search`]:{position:`absolute`,top:0,insetInlineStart:r,insetInlineEnd:r,bottom:0,"&-input":{width:`100%`}},[` + ${n}-selection-item, + ${n}-selection-placeholder + `]:{padding:0,lineHeight:`${a}px`,transition:`all ${e.motionDurationSlow}`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${a}px`}},[`${n}-selection-item`]:{position:`relative`,userSelect:`none`},[`${n}-selection-placeholder`]:{transition:`none`,pointerEvents:`none`},[[`&:after`,`${n}-selection-item:after`,`${n}-selection-placeholder:after`].join(`,`)]:{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`}}),[` + &${n}-show-arrow ${n}-selection-item, + &${n}-show-arrow ${n}-selection-placeholder + `]:{paddingInlineEnd:o},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:`100%`,height:e.controlHeight,padding:`0 ${r}px`,[`${n}-selection-search-input`]:{height:a},"&:after":{lineHeight:`${a}px`}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:`none`},[`${n}-selection-search`]:{position:`static`,width:`100%`},[`${n}-selection-placeholder`]:{position:`absolute`,insetInlineStart:0,insetInlineEnd:0,padding:`0 ${r}px`,"&:after":{display:`none`}}}}}}}function sv(e){let{componentCls:t}=e,n=e.controlPaddingHorizontalSM-e.lineWidth;return[ov(e),ov(B(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),`sm`),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selection-search`]:{insetInlineStart:n,insetInlineEnd:n},[`${t}-selector`]:{padding:`0 ${n}px`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:n+e.fontSize*1.5},[` + &${t}-show-arrow ${t}-selection-item, + &${t}-show-arrow ${t}-selection-placeholder + `]:{paddingInlineEnd:e.fontSize*1.5}}}},ov(B(e,{controlHeight:e.controlHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`lg`)]}function cv(e,t,n){let{focusElCls:r,focus:i,borderElCls:a}=n,o=a?`> *`:``,s=[`hover`,i?`focus`:null,`active`].filter(Boolean).map(e=>`&:${e} ${o}`).join(`,`);return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:-e.lineWidth},"&-item":Z(Z({[s]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${o}`]:{zIndex:0}})}}function lv(e,t,n){let{borderElCls:r}=n,i=r?`> ${r}`:``;return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function uv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0},{componentCls:n}=e,r=`${n}-compact`;return{[r]:Z(Z({},cv(e,r,t)),lv(n,r,t))}}var dv=e=>{let{componentCls:t}=e;return{position:`relative`,backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:`pointer`},[`${t}-show-search&`]:{cursor:`text`,input:{cursor:`auto`,color:`inherit`}},[`${t}-disabled&`]:{color:e.colorTextDisabled,background:e.colorBgContainerDisabled,cursor:`not-allowed`,[`${t}-multiple&`]:{background:e.colorBgContainerDisabled},input:{cursor:`not-allowed`}}}},fv=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{componentCls:r,borderHoverColor:i,outlineColor:a,antCls:o}=t,s=n?{[`${r}-selector`]:{borderColor:i}}:{};return{[e]:{[`&:not(${r}-disabled):not(${r}-customize-input):not(${o}-pagination-size-changer)`]:Z(Z({},s),{[`${r}-focused& ${r}-selector`]:{borderColor:i,boxShadow:`0 0 0 ${t.controlOutlineWidth}px ${a}`,borderInlineEndWidth:`${t.controlLineWidth}px !important`,outline:0},[`&:hover ${r}-selector`]:{borderColor:i,borderInlineEndWidth:`${t.controlLineWidth}px !important`}})}}},pv=e=>{let{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:`transparent`,border:`none`,outline:`none`,appearance:`none`,"&::-webkit-search-cancel-button":{display:`none`,"-webkit-appearance":`none`}}}},mv=e=>{let{componentCls:t,inputPaddingHorizontalBase:n,iconCls:r}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,cursor:`pointer`,[`&:not(${t}-customize-input) ${t}-selector`]:Z(Z({},dv(e)),pv(e)),[`${t}-selection-item`]:Z({flex:1,fontWeight:`normal`},xe),[`${t}-selection-placeholder`]:Z(Z({},xe),{flex:1,color:e.colorTextPlaceholder,pointerEvents:`none`}),[`${t}-arrow`]:Z(Z({},o()),{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:n,height:e.fontSizeIcon,marginTop:-e.fontSizeIcon/2,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:`center`,pointerEvents:`none`,display:`flex`,alignItems:`center`,[r]:{verticalAlign:`top`,transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:`top`},[`&:not(${t}-suffix)`]:{pointerEvents:`auto`}},[`${t}-disabled &`]:{cursor:`not-allowed`},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:n,zIndex:1,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:-e.fontSizeIcon/2,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:`normal`,lineHeight:1,textAlign:`center`,textTransform:`none`,background:e.colorBgContainer,cursor:`pointer`,opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:`auto`,"&:before":{display:`block`},"&:hover":{color:e.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:n+e.fontSize+e.paddingXXS}}}},hv=e=>{let{componentCls:t}=e;return[{[t]:{[`&-borderless ${t}-selector`]:{backgroundColor:`transparent !important`,borderColor:`transparent !important`,boxShadow:`none !important`},[`&${t}-in-form-item`]:{width:`100%`}}},mv(e),sv(e),av(e),tv(e),{[`${t}-rtl`]:{direction:`rtl`}},fv(t,B(e,{borderHoverColor:e.colorPrimaryHover,outlineColor:e.controlOutline})),fv(`${t}-status-error`,B(e,{borderHoverColor:e.colorErrorHover,outlineColor:e.colorErrorOutline}),!0),fv(`${t}-status-warning`,B(e,{borderHoverColor:e.colorWarningHover,outlineColor:e.colorWarningOutline}),!0),uv(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]},gv=v(`Select`,(e,t)=>{let{rootPrefixCls:n}=t;return[hv(B(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.paddingSM-1}))]},e=>({zIndexPopup:e.zIndexPopupBase+50})),_v=()=>Z(Z({},Br(mf(),[`inputIcon`,`mode`,`getInputElement`,`getRawInputElement`,`backfill`])),{value:W([Array,Object,String,Number]),defaultValue:W([Array,Object,String,Number]),notFoundContent:f.any,suffixIcon:f.any,itemIcon:f.any,size:_(),mode:_(),bordered:Q(!0),transitionName:String,choiceTransitionName:_(``),popupClassName:String,dropdownClassName:String,placement:_(),status:_(),"onUpdate:value":d()}),vv=`SECRET_COMBOBOX_MODE_DO_NOT_USE`,yv=u({compatConfig:{MODE:3},name:`ASelect`,Option:_f,OptGroup:vf,inheritAttrs:!1,props:Zn(_v(),{listHeight:256,listItemHeight:24}),SECRET_COMBOBOX_MODE_DO_NOT_USE:vv,slots:Object,setup(e,t){let{attrs:n,emit:r,slots:i,expose:a}=t,o=H(),s=zf(),c=Vf.useInject(),l=J(()=>Wf(c.status,e.status)),u=()=>{var e;(e=o.value)==null||e.focus()},d=()=>{var e;(e=o.value)==null||e.blur()},f=e=>{var t;(t=o.value)==null||t.scrollTo(e)},p=J(()=>{let{mode:t}=e;if(t!==`combobox`)return t===vv?`combobox`:t}),{prefixCls:m,direction:h,configProvider:g,renderEmpty:_,size:v,getPrefixCls:y,getPopupContainer:b,disabled:x,select:S}=X(`select`,e),{compactSize:C,compactItemClassnames:w}=u_(m,h),T=J(()=>C.value||v.value),E=at(),D=J(()=>x.value??E.value),[O,k]=gv(m),A=J(()=>y()),j=J(()=>e.placement===void 0?h.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement),M=J(()=>Xt(A.value,me(j.value),e.transitionName)),N=J(()=>K({[`${m.value}-lg`]:T.value===`large`,[`${m.value}-sm`]:T.value===`small`,[`${m.value}-rtl`]:h.value===`rtl`,[`${m.value}-borderless`]:!e.bordered,[`${m.value}-in-form-item`]:c.isFormItemInput},Uf(m.value,l.value,c.hasFeedback),w.value,k.value)),P=function(){var e=[...arguments];r(`update:value`,e[0]),r(`change`,...e),s.onFieldChange()},F=e=>{r(`blur`,e),s.onFieldBlur()};a({blur:d,focus:u,scrollTo:f});let I=J(()=>p.value===`multiple`||p.value===`tags`),L=J(()=>e.showArrow===void 0?e.loading||!(I.value||p.value===`combobox`):e.showArrow);return()=>{let{notFoundContent:t,listHeight:r=256,listItemHeight:a=24,popupClassName:l,dropdownClassName:u,virtual:d,dropdownMatchSelectWidth:f,id:v=s.id.value,placeholder:y=i.placeholder?.call(i),showArrow:x}=e,{hasFeedback:C,feedbackIcon:w}=c,{}=g,T;T=t===void 0?i.notFoundContent?i.notFoundContent():p.value===`combobox`?null:_?.(`Select`)||U(lt,{componentName:`Select`},null):t;let{suffixIcon:E,itemIcon:A,removeIcon:j,clearIcon:ee}=Mf(Z(Z({},e),{multiple:I.value,prefixCls:m.value,hasFeedback:C,feedbackIcon:w,showArrow:L.value}),i),te=Br(e,[`prefixCls`,`suffixIcon`,`itemIcon`,`removeIcon`,`clearIcon`,`size`,`bordered`,`status`]),ne=K(l||u,{[`${m.value}-dropdown-${h.value}`]:h.value===`rtl`},k.value);return O(U(yf,Y(Y(Y({ref:o,virtual:d,dropdownMatchSelectWidth:f},te),n),{},{showSearch:e.showSearch??S?.value?.showSearch,placeholder:y,listHeight:r,listItemHeight:a,mode:p.value,prefixCls:m.value,direction:h.value,inputIcon:E,menuItemSelectedIcon:A,removeIcon:j,clearIcon:ee,notFoundContent:T,class:[N.value,n.class],getPopupContainer:b?.value,dropdownClassName:ne,onChange:P,onBlur:F,id:v,dropdownRender:te.dropdownRender||i.dropdownRender,transitionName:M.value,children:i.default?.call(i),tagRender:e.tagRender||i.tagRender,optionLabelRender:i.optionLabel,maxTagPlaceholder:e.maxTagPlaceholder||i.maxTagPlaceholder,showArrow:C||x,disabled:D.value}),{option:i.option}))}}});yv.install=function(e){return e.component(yv.name,yv),e.component(yv.Option.displayName,yv.Option),e.component(yv.OptGroup.displayName,yv.OptGroup),e};var bv=yv.Option,xv=yv.OptGroup,Sv=()=>null;Sv.isSelectOption=!0,Sv.displayName=`AAutoCompleteOption`;var Cv=()=>null;Cv.isSelectOptGroup=!0,Cv.displayName=`AAutoCompleteOptGroup`;function wv(e){return e?.type?.isSelectOption||e?.type?.isSelectOptGroup}var Tv=()=>Z(Z({},Br(_v(),[`loading`,`mode`,`optionLabelProp`,`labelInValue`])),{dataSource:Array,dropdownMenuStyle:{type:Object,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},prefixCls:String,showSearch:{type:Boolean,default:void 0},transitionName:String,choiceTransitionName:{type:String,default:`zoom`},autofocus:{type:Boolean,default:void 0},backfill:{type:Boolean,default:void 0},filterOption:{type:[Boolean,Function],default:!1},defaultActiveFirstOption:{type:Boolean,default:!0},status:String}),Ev=Sv,Dv=Cv,Ov=u({compatConfig:{MODE:3},name:`AAutoComplete`,inheritAttrs:!1,props:Tv(),slots:Object,setup(t,n){let{slots:r,attrs:i,expose:a}=n;e(!(`dataSource`in r),`AutoComplete`,"`dataSource` slot is deprecated, please use props `options` instead."),e(!(`options`in r),`AutoComplete`,"`options` slot is deprecated, please use props `options` instead."),e(!t.dropdownClassName,`AutoComplete`,"`dropdownClassName` is deprecated, please use `popupClassName` instead.");let o=H(),s=()=>{let e=ce(r.default?.call(r));return e.length?e[0]:void 0};a({focus:()=>{var e;(e=o.value)==null||e.focus()},blur:()=>{var e;(e=o.value)==null||e.blur()}});let{prefixCls:c}=X(`select`,t);return()=>{let{size:e,dataSource:n,notFoundContent:a=r.notFoundContent?.call(r)}=t,l,{class:u}=i,d={[u]:!!u,[`${c.value}-lg`]:e===`large`,[`${c.value}-sm`]:e===`small`,[`${c.value}-show-search`]:!0,[`${c.value}-auto-complete`]:!0};if(t.options===void 0){let e=r.dataSource?.call(r)||r.options?.call(r)||[];l=e.length&&wv(e[0])?e:n?n.map(e=>{if(Nt(e))return e;switch(typeof e){case`string`:return U(Sv,{key:e,value:e},{default:()=>[e]});case`object`:return U(Sv,{key:e.value,value:e.value},{default:()=>[e.text]});default:throw Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}}):[]}return U(yv,Br(Z(Z(Z({},t),i),{mode:yv.SECRET_COMBOBOX_MODE_DO_NOT_USE,getInputElement:s,notFoundContent:a,class:d,popupClassName:t.popupClassName||t.dropdownClassName,ref:o}),[`dataSource`,`loading`]),Y({default:()=>[l]},Br(r,[`default`,`dataSource`,`options`])))}}}),kv=Z(Ov,{Option:Sv,OptGroup:Cv,install(e){return e.component(Ov.name,Ov),e.component(Sv.displayName,Sv),e.component(Cv.displayName,Cv),e}}),Av=(e,t,n,r,i)=>({backgroundColor:e,border:`${r.lineWidth}px ${r.lineType} ${t}`,[`${i}-icon`]:{color:n}}),jv=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:i,fontSize:a,fontSizeLG:o,lineHeight:s,borderRadiusLG:c,motionEaseInOutCirc:l,alertIconSizeLG:u,colorText:d,paddingContentVerticalSM:f,alertPaddingHorizontal:p,paddingMD:m,paddingContentHorizontalLG:h}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,display:`flex`,alignItems:`center`,padding:`${f}px ${p}px`,wordWrap:`break-word`,borderRadius:c,[`&${t}-rtl`]:{direction:`rtl`},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:`none`,fontSize:a,lineHeight:s},"&-message":{color:d},[`&${t}-motion-leave`]:{overflow:`hidden`,opacity:1,transition:`max-height ${n} ${l}, opacity ${n} ${l}, + padding-top ${n} ${l}, padding-bottom ${n} ${l}, + margin-bottom ${n} ${l}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:`0 !important`,paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:`flex-start`,paddingInline:h,paddingBlock:m,[`${t}-icon`]:{marginInlineEnd:i,fontSize:u,lineHeight:0},[`${t}-message`]:{display:`block`,marginBottom:r,color:d,fontSize:o},[`${t}-description`]:{display:`block`}},[`${t}-banner`]:{marginBottom:0,border:`0 !important`,borderRadius:0}}},Mv=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:i,colorWarning:a,colorWarningBorder:o,colorWarningBg:s,colorError:c,colorErrorBorder:l,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":Av(i,r,n,e,t),"&-info":Av(p,f,d,e,t),"&-warning":Av(s,o,a,e,t),"&-error":Z(Z({},Av(u,l,c,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},Nv=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:i,fontSizeIcon:a,colorIcon:o,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:`hidden`,fontSize:a,lineHeight:`${a}px`,backgroundColor:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,[`${n}-close`]:{color:o,transition:`color ${r}`,"&:hover":{color:s}}},"&-close-text":{color:o,transition:`color ${r}`,"&:hover":{color:s}}}}},Pv=e=>[jv(e),Mv(e),Nv(e)],Fv=v(`Alert`,e=>{let{fontSizeHeading3:t}=e;return[Pv(B(e,{alertIconSizeLG:t,alertPaddingHorizontal:12}))]}),Iv={success:qe,info:mt,error:tt,warning:Wt},Lv={success:rt,info:Ot,error:Qe,warning:_t},Rv=m(`success`,`info`,`warning`,`error`),zv=a(u({compatConfig:{MODE:3},name:`AAlert`,inheritAttrs:!1,props:{type:f.oneOf(Rv),closable:{type:Boolean,default:void 0},closeText:f.any,message:f.any,description:f.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:f.any,closeIcon:f.any,onClose:Function},setup(e,t){let{slots:n,emit:r,attrs:i,expose:a}=t,{prefixCls:o,direction:s}=X(`alert`,e),[c,l]=Fv(o),u=q(!1),d=q(!1),f=q(),p=e=>{e.preventDefault();let t=f.value;t.style.height=`${t.offsetHeight}px`,t.style.height=`${t.offsetHeight}px`,u.value=!0,r(`close`,e)},m=()=>{var t;u.value=!1,d.value=!0,(t=e.afterClose)==null||t.call(e)},h=J(()=>{let{type:t}=e;return t===void 0?e.banner?`warning`:`info`:t});a({animationEnd:m});let g=q({});return()=>{let{banner:t,closeIcon:r=n.closeIcon?.call(n)}=e,{closable:a,showIcon:_}=e,v=e.closeText??n.closeText?.call(n),y=e.description??n.description?.call(n),b=e.message??n.message?.call(n),x=e.icon??n.icon?.call(n),S=n.action?.call(n);_=t&&_===void 0?!0:_;let C=(y?Lv:Iv)[h.value]||null;v&&(a=!0);let w=o.value,T=K(w,{[`${w}-${h.value}`]:!0,[`${w}-closing`]:u.value,[`${w}-with-description`]:!!y,[`${w}-no-icon`]:!_,[`${w}-banner`]:!!t,[`${w}-closable`]:a,[`${w}-rtl`]:s.value===`rtl`,[l.value]:!0}),E=a?U(`button`,{type:`button`,onClick:p,class:`${w}-close-icon`,tabindex:0},[v?U(`span`,{class:`${w}-close-text`},[v]):r===void 0?U(Pe,null,null):r]):null,D=x&&(Nt(x)?ao(x,{class:`${w}-icon`}):U(`span`,{class:`${w}-icon`},[x]))||U(C,{class:`${w}-icon`},null),O=ge(`${w}-motion`,{appear:!1,css:!0,onAfterLeave:m,onBeforeLeave:e=>{e.style.maxHeight=`${e.offsetHeight}px`},onLeave:e=>{e.style.maxHeight=`0px`}});return c(d.value?null:U(Re,O,{default:()=>[Mt(U(`div`,Y(Y({role:`alert`},i),{},{style:[i.style,g.value],class:[i.class,T],"data-show":!u.value,ref:f}),[_?D:null,U(`div`,{class:`${w}-content`},[b?U(`div`,{class:`${w}-message`},[b]):null,y?U(`div`,{class:`${w}-description`},[y]):null]),S?U(`div`,{class:`${w}-action`},[S]):null,E]),[[ht,!u.value]])]}))}}})),Bv=[`xxxl`,`xxl`,`xl`,`lg`,`md`,`sm`,`xs`],Vv=e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`,xxxl:`{min-width: ${e.screenXXXL}px}`});function Hv(){let[,e]=re();return J(()=>{let t=Vv(e.value),n=new Map,r=-1,i={};return{matchHandlers:{},dispatch(e){return i=e,n.forEach(e=>e(i)),n.size>=1},subscribe(e){return n.size||this.register(),r+=1,n.set(r,e),e(i),r},unsubscribe(e){n.delete(e),n.size||this.unregister()},unregister(){Object.keys(t).forEach(e=>{let n=t[e],r=this.matchHandlers[n];r?.mql.removeListener(r?.listener)}),n.clear()},register(){Object.keys(t).forEach(e=>{let n=t[e],r=t=>{let{matches:n}=t;this.dispatch(Z(Z({},i),{[e]:n}))},a=window.matchMedia(n);a.addListener(r),this.matchHandlers[n]={mql:a,listener:r},r(a)})},responsiveMap:t}})}function Uv(){let e=q({}),t=null,n=Hv();return V(()=>{t=n.value.subscribe(t=>{e.value=t})}),y(()=>{n.value.unsubscribe(t)}),e}function Wv(e){let t=q();return S(()=>{t.value=e()},{flush:`sync`}),t}var Gv=e=>{let{antCls:t,componentCls:n,iconCls:r,avatarBg:i,avatarColor:a,containerSize:o,containerSizeLG:s,containerSizeSM:c,textFontSize:l,textFontSizeLG:u,textFontSizeSM:d,borderRadius:f,borderRadiusLG:p,borderRadiusSM:m,lineWidth:h,lineType:g}=e,_=(e,t,i)=>({width:e,height:e,lineHeight:`${e-h*2}px`,borderRadius:`50%`,[`&${n}-square`]:{borderRadius:i},[`${n}-string`]:{position:`absolute`,left:{_skip_check_:!0,value:`50%`},transformOrigin:`0 center`},[`&${n}-icon`]:{fontSize:t,[`> ${r}`]:{margin:0}}});return{[n]:Z(Z(Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,overflow:`hidden`,color:a,whiteSpace:`nowrap`,textAlign:`center`,verticalAlign:`middle`,background:i,border:`${h}px ${g} transparent`,"&-image":{background:`transparent`},[`${t}-image-img`]:{display:`block`}}),_(o,l,f)),{"&-lg":Z({},_(s,u,p)),"&-sm":Z({},_(c,d,m)),"> img":{display:`block`,width:`100%`,height:`100%`,objectFit:`cover`}})}},Kv=e=>{let{componentCls:t,groupBorderColor:n,groupOverlapping:r,groupSpace:i}=e;return{[`${t}-group`]:{display:`inline-flex`,[`${t}`]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:r}},[`${t}-group-popover`]:{[`${t} + ${t}`]:{marginInlineStart:i}}}},qv=v(`Avatar`,e=>{let{colorTextLightSolid:t,colorTextPlaceholder:n}=e,r=B(e,{avatarBg:n,avatarColor:t});return[Gv(r),Kv(r)]},e=>{let{controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:i,fontSizeLG:a,fontSizeXL:o,fontSizeHeading3:s,marginXS:c,marginXXS:l,colorBorderBg:u}=e;return{containerSize:t,containerSizeLG:n,containerSizeSM:r,textFontSize:Math.round((a+o)/2),textFontSizeLG:s,textFontSizeSM:i,groupSpace:l,groupOverlapping:-c,groupBorderColor:u}}),Jv=Symbol(`AvatarContextKey`),Yv=()=>g(Jv,{}),Xv=e=>fe(Jv,e),Zv=u({compatConfig:{MODE:3},name:`AAvatar`,inheritAttrs:!1,props:{prefixCls:String,shape:{type:String,default:`circle`},size:{type:[Number,String,Object],default:()=>`default`},src:String,srcset:String,icon:f.any,alt:String,gap:Number,draggable:{type:Boolean,default:void 0},crossOrigin:String,loadError:{type:Function}},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,i=q(!0),a=q(!1),o=q(1),s=q(null),c=q(null),{prefixCls:l}=X(`avatar`,e),[u,d]=qv(l),f=Yv(),p=J(()=>e.size==="default"?f.size:e.size),m=Uv(),h=Wv(()=>{if(typeof e.size!=`object`)return;let t=Bv.find(e=>m.value[e]);return e.size[t]}),g=e=>h.value?{width:`${h.value}px`,height:`${h.value}px`,lineHeight:`${h.value}px`,fontSize:`${e?h.value/2:18}px`}:{},_=()=>{if(!s.value||!c.value)return;let t=s.value.offsetWidth,n=c.value.offsetWidth;if(t!==0&&n!==0){let{gap:r=4}=e;r*2{let{loadError:t}=e;t?.()!==!1&&(i.value=!1)};return G(()=>e.src,()=>{z(()=>{i.value=!0,o.value=1})}),G(()=>e.gap,()=>{z(()=>{_()})}),V(()=>{z(()=>{_(),a.value=!0})}),()=>{let{shape:t,src:m,alt:h,srcset:y,draggable:b,crossOrigin:x}=e,S=f.shape??t,C=on(n,e,`icon`),w=l.value,T={[`${r.class}`]:!!r.class,[w]:!0,[`${w}-lg`]:p.value===`large`,[`${w}-sm`]:p.value===`small`,[`${w}-${S}`]:!0,[`${w}-image`]:m&&i.value,[`${w}-icon`]:C,[d.value]:!0},E=typeof p.value==`number`?{width:`${p.value}px`,height:`${p.value}px`,lineHeight:`${p.value}px`,fontSize:C?`${p.value/2}px`:`18px`}:{},D=n.default?.call(n),O;if(m&&i.value)O=U(`img`,{draggable:b,src:m,srcset:y,onError:v,alt:h,crossorigin:x},null);else if(C)O=C;else if(a.value||o.value!==1){let e=`scale(${o.value}) translateX(-50%)`,t={msTransform:e,WebkitTransform:e,transform:e},n=typeof p.value==`number`?{lineHeight:`${p.value}px`}:{};O=U(Qn,{onResize:_},{default:()=>[U(`span`,{class:`${w}-string`,ref:s,style:Z(Z({},n),t)},[D])]})}else O=U(`span`,{class:`${w}-string`,ref:s,style:{opacity:0}},[D]);return u(U(`span`,Y(Y({},r),{},{ref:c,class:T,style:[E,g(!!C),r.style]}),[O]))}}}),Qv={adjustX:1,adjustY:1},$v=[0,0],ey={left:{points:[`cr`,`cl`],overflow:Qv,offset:[-4,0],targetOffset:$v},right:{points:[`cl`,`cr`],overflow:Qv,offset:[4,0],targetOffset:$v},top:{points:[`bc`,`tc`],overflow:Qv,offset:[0,-4],targetOffset:$v},bottom:{points:[`tc`,`bc`],overflow:Qv,offset:[0,4],targetOffset:$v},topLeft:{points:[`bl`,`tl`],overflow:Qv,offset:[0,-4],targetOffset:$v},leftTop:{points:[`tr`,`tl`],overflow:Qv,offset:[-4,0],targetOffset:$v},topRight:{points:[`br`,`tr`],overflow:Qv,offset:[0,-4],targetOffset:$v},rightTop:{points:[`tl`,`tr`],overflow:Qv,offset:[4,0],targetOffset:$v},bottomRight:{points:[`tr`,`br`],overflow:Qv,offset:[0,4],targetOffset:$v},rightBottom:{points:[`bl`,`br`],overflow:Qv,offset:[4,0],targetOffset:$v},bottomLeft:{points:[`tl`,`bl`],overflow:Qv,offset:[0,4],targetOffset:$v},leftBottom:{points:[`br`,`bl`],overflow:Qv,offset:[-4,0],targetOffset:$v}},ty=u({compatConfig:{MODE:3},name:`TooltipContent`,props:{prefixCls:String,id:String,overlayInnerStyle:f.any},setup(e,t){let{slots:n}=t;return()=>U(`div`,{class:`${e.prefixCls}-inner`,id:e.id,role:`tooltip`,style:e.overlayInnerStyle},[n.overlay?.call(n)])}}),ny=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{}),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:f.string.def(`rc-tooltip`),mouseEnterDelay:f.number.def(.1),mouseLeaveDelay:f.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:f.object.def(()=>({})),arrowContent:f.any.def(null),tipId:String,builtinPlacements:f.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function,arrow:{type:Boolean,default:!0}},setup(e,t){let{slots:n,attrs:r,expose:i}=t,a=q(),o=()=>{let{prefixCls:t,tipId:r,overlayInnerStyle:i}=e;return[e.arrow?U(`div`,{class:`${t}-arrow`,key:`arrow`},[on(n,e,`arrowContent`)]):null,U(ty,{key:`content`,prefixCls:t,id:r,overlayInnerStyle:i},{overlay:n.overlay})]};i({getPopupDomNode:()=>a.value.getPopupDomNode(),triggerDOM:a,forcePopupAlign:()=>a.value?.forcePopupAlign()});let s=q(!1),c=q(!1);return S(()=>{let{destroyTooltipOnHide:t}=e;if(typeof t==`boolean`)s.value=t;else if(t&&typeof t==`object`){let{keepParent:e}=t;s.value=e===!0,c.value=e===!1}}),()=>{let{overlayClassName:t,trigger:i,mouseEnterDelay:l,mouseLeaveDelay:u,overlayStyle:d,prefixCls:f,afterVisibleChange:p,transitionName:m,animation:h,placement:g,align:_,destroyTooltipOnHide:v,defaultVisible:y}=e,b=Z({},ny(e,[`overlayClassName`,`trigger`,`mouseEnterDelay`,`mouseLeaveDelay`,`overlayStyle`,`prefixCls`,`afterVisibleChange`,`transitionName`,`animation`,`placement`,`align`,`destroyTooltipOnHide`,`defaultVisible`]));return e.visible!==void 0&&(b.popupVisible=e.visible),U(Su,Z(Z(Z({popupClassName:t,prefixCls:f,action:i,builtinPlacements:ey,popupPlacement:g,popupAlign:_,afterPopupVisibleChange:p,popupTransitionName:m,popupAnimation:h,defaultPopupVisible:y,destroyPopupOnHide:s.value,autoDestroy:c.value,mouseLeaveDelay:u,popupStyle:d,mouseEnterDelay:l},b),r),{onPopupVisibleChange:e.onVisibleChange||ry,onPopupAlign:e.onPopupAlign||ry,ref:a,arrow:!!e.arrow,popup:o()}),{default:n.default})}}}),ay=(()=>({trigger:[String,Array],open:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:String,color:String,transitionName:String,overlayStyle:Qt(),overlayInnerStyle:Qt(),overlayClassName:String,openClassName:String,prefixCls:String,mouseEnterDelay:Number,mouseLeaveDelay:Number,getPopupContainer:Function,arrowPointAtCenter:{type:Boolean,default:void 0},arrow:{type:[Boolean,Object],default:!0},autoAdjustOverflow:{type:[Boolean,Object],default:void 0},destroyTooltipOnHide:{type:Boolean,default:void 0},align:Qt(),builtinPlacements:Qt(),children:Array,onVisibleChange:Function,"onUpdate:visible":Function,onOpenChange:Function,"onUpdate:open":Function})),oy={adjustX:1,adjustY:1},sy={adjustX:0,adjustY:0},cy=[0,0];function ly(e){return typeof e==`boolean`?e?oy:sy:Z(Z({},sy),e)}function uy(e){let{arrowWidth:t=4,horizontalArrowShift:n=16,verticalArrowShift:r=8,autoAdjustOverflow:i,arrowPointAtCenter:a}=e,o={left:{points:[`cr`,`cl`],offset:[-4,0]},right:{points:[`cl`,`cr`],offset:[4,0]},top:{points:[`bc`,`tc`],offset:[0,-4]},bottom:{points:[`tc`,`bc`],offset:[0,4]},topLeft:{points:[`bl`,`tc`],offset:[-(n+t),-4]},leftTop:{points:[`tr`,`cl`],offset:[-4,-(r+t)]},topRight:{points:[`br`,`tc`],offset:[n+t,-4]},rightTop:{points:[`tl`,`cr`],offset:[4,-(r+t)]},bottomRight:{points:[`tr`,`bc`],offset:[n+t,4]},rightBottom:{points:[`bl`,`cr`],offset:[4,r+t]},bottomLeft:{points:[`tl`,`bc`],offset:[-(n+t),4]},leftBottom:{points:[`br`,`cl`],offset:[-4,r+t]}};return Object.keys(o).forEach(e=>{o[e]=a?Z(Z({},o[e]),{overflow:ly(i),targetOffset:cy}):Z(Z({},ey[e]),{overflow:ly(i)}),o[e].ignoreShake=!0}),o}function dy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(let t=0,n=e.length;t`${e}-inverse`),py=[`success`,`processing`,`error`,`default`,`warning`];function my(e){return!(arguments.length>1&&arguments[1]!==void 0)||arguments[1]?[...fy,...Ir].includes(e):Ir.includes(e)}function hy(e){return py.includes(e)}function gy(e,t){let n=my(t),r=K({[`${e}-${t}`]:t&&n}),i={},a={};return t&&!n&&(i.background=t,a[`--antd-arrow-background-color`]=t),{className:r,overlayStyle:i,arrowStyle:a}}function _y(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;return e.map(e=>`${t}${e}`).join(`,`)}function vy(e){let{sizePopupArrow:t,contentRadius:n,borderRadiusOuter:r,limitVerticalRadius:i}=e,a=t/2-Math.ceil(r*(Math.sqrt(2)-1)),o=(n>12?n+2:12)-a;return{dropdownArrowOffset:o,dropdownArrowOffsetVertical:i?8-a:o}}function yy(e,t){let{componentCls:n,sizePopupArrow:r,marginXXS:i,borderRadiusXS:a,borderRadiusOuter:o,boxShadowPopoverArrow:s}=e,{colorBg:c,showArrowCls:l,contentRadius:u=e.borderRadiusLG,limitVerticalRadius:d}=t,{dropdownArrowOffsetVertical:f,dropdownArrowOffset:p}=vy({sizePopupArrow:r,contentRadius:u,borderRadiusOuter:o,limitVerticalRadius:d}),m=r/2+i;return{[n]:{[`${n}-arrow`]:[Z(Z({position:`absolute`,zIndex:1,display:`block`},Rr(r,a,o,c,s)),{"&:before":{background:c}})],[[`&-placement-top ${n}-arrow`,`&-placement-topLeft ${n}-arrow`,`&-placement-topRight ${n}-arrow`].join(`,`)]:{bottom:0,transform:`translateY(100%) rotate(180deg)`},[`&-placement-top ${n}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(100%) rotate(180deg)`},[`&-placement-topLeft ${n}-arrow`]:{left:{_skip_check_:!0,value:p}},[`&-placement-topRight ${n}-arrow`]:{right:{_skip_check_:!0,value:p}},[[`&-placement-bottom ${n}-arrow`,`&-placement-bottomLeft ${n}-arrow`,`&-placement-bottomRight ${n}-arrow`].join(`,`)]:{top:0,transform:`translateY(-100%)`},[`&-placement-bottom ${n}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(-100%)`},[`&-placement-bottomLeft ${n}-arrow`]:{left:{_skip_check_:!0,value:p}},[`&-placement-bottomRight ${n}-arrow`]:{right:{_skip_check_:!0,value:p}},[[`&-placement-left ${n}-arrow`,`&-placement-leftTop ${n}-arrow`,`&-placement-leftBottom ${n}-arrow`].join(`,`)]:{right:{_skip_check_:!0,value:0},transform:`translateX(100%) rotate(90deg)`},[`&-placement-left ${n}-arrow`]:{top:{_skip_check_:!0,value:`50%`},transform:`translateY(-50%) translateX(100%) rotate(90deg)`},[`&-placement-leftTop ${n}-arrow`]:{top:f},[`&-placement-leftBottom ${n}-arrow`]:{bottom:f},[[`&-placement-right ${n}-arrow`,`&-placement-rightTop ${n}-arrow`,`&-placement-rightBottom ${n}-arrow`].join(`,`)]:{left:{_skip_check_:!0,value:0},transform:`translateX(-100%) rotate(-90deg)`},[`&-placement-right ${n}-arrow`]:{top:{_skip_check_:!0,value:`50%`},transform:`translateY(-50%) translateX(-100%) rotate(-90deg)`},[`&-placement-rightTop ${n}-arrow`]:{top:f},[`&-placement-rightBottom ${n}-arrow`]:{bottom:f},[_y([`&-placement-topLeft`,`&-placement-top`,`&-placement-topRight`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingBottom:m},[_y([`&-placement-bottomLeft`,`&-placement-bottom`,`&-placement-bottomRight`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingTop:m},[_y([`&-placement-leftTop`,`&-placement-left`,`&-placement-leftBottom`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingRight:{_skip_check_:!0,value:m}},[_y([`&-placement-rightTop`,`&-placement-right`,`&-placement-rightBottom`].map(e=>e+=`:not(&-arrow-hidden)`),l)]:{paddingLeft:{_skip_check_:!0,value:m}}}}}var by=e=>{let{componentCls:t,tooltipMaxWidth:n,tooltipColor:r,tooltipBg:i,tooltipBorderRadius:a,zIndexPopup:o,controlHeight:s,boxShadowSecondary:c,paddingSM:l,paddingXS:u,tooltipRadiusOuter:d}=e;return[{[t]:Z(Z(Z(Z({},rn(e)),{position:`absolute`,zIndex:o,display:`block`,"&":[{width:`max-content`},{width:`intrinsic`}],maxWidth:n,visibility:`visible`,"&-hidden":{display:`none`},"--antd-arrow-background-color":i,[`${t}-inner`]:{minWidth:s,minHeight:s,padding:`${l/2}px ${u}px`,color:r,textAlign:`start`,textDecoration:`none`,wordWrap:`break-word`,backgroundColor:i,borderRadius:a,boxShadow:c},[[`&-placement-left`,`&-placement-leftTop`,`&-placement-leftBottom`,`&-placement-right`,`&-placement-rightTop`,`&-placement-rightBottom`].join(`,`)]:{[`${t}-inner`]:{borderRadius:Math.min(a,8)}},[`${t}-content`]:{position:`relative`}}),zr(e,(e,n)=>{let{darkColor:r}=n;return{[`&${t}-${e}`]:{[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{"--antd-arrow-background-color":r}}}})),{"&-rtl":{direction:`rtl`}})},yy(B(e,{borderRadiusOuter:d}),{colorBg:`var(--antd-arrow-background-color)`,showArrowCls:``,contentRadius:a,limitVerticalRadius:!0}),{[`${t}-pure`]:{position:`relative`,maxWidth:`none`}}]},xy=((e,t)=>v(`Tooltip`,e=>{if(t?.value===!1)return[];let{borderRadius:n,colorTextLightSolid:r,colorBgDefault:i,borderRadiusOuter:a}=e;return[by(B(e,{tooltipMaxWidth:250,tooltipColor:r,tooltipBorderRadius:n,tooltipBg:i,tooltipRadiusOuter:a>4?4:a})),Q_(e,`zoom-big-fast`)]},e=>{let{zIndexPopupBase:t,colorBgSpotlight:n}=e;return{zIndexPopup:t+70,colorBgDefault:n}})(e)),Sy=(e,t)=>{let n={},r=Z({},e);return t.forEach(t=>{e&&t in e&&(n[t]=e[t],delete r[t])}),{picked:n,omitted:r}},Cy=()=>Z(Z({},ay()),{title:f.any}),wy=()=>({trigger:`hover`,align:{},placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),Ty=a(u({compatConfig:{MODE:3},name:`ATooltip`,inheritAttrs:!1,props:Zn(Cy(),{trigger:`hover`,align:{},placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i,expose:a}=t,{prefixCls:o,getPopupContainer:s,direction:c,rootPrefixCls:l}=X(`tooltip`,e),u=J(()=>e.open??e.visible),d=H(dy([e.open,e.visible])),f=H(),p;G(u,e=>{ir.cancel(p),p=ir(()=>{d.value=!!e})});let m=()=>{let t=e.title??n.title;return!t&&t!==0},h=e=>{let t=m();u.value===void 0&&(d.value=!t&&e),t||(r(`update:visible`,e),r(`visibleChange`,e),r(`update:open`,e),r(`openChange`,e))};a({getPopupDomNode:()=>f.value.getPopupDomNode(),open:d,forcePopupAlign:()=>f.value?.forcePopupAlign()});let g=J(()=>{let{builtinPlacements:t,autoAdjustOverflow:n,arrow:r,arrowPointAtCenter:i}=e,a=i;return typeof r==`object`&&(a=r.pointAtCenter??i),t||uy({arrowPointAtCenter:a,autoAdjustOverflow:n})}),_=e=>e||e===``,v=e=>{let t=e.type;if(typeof t==`object`&&e.props&&((t.__ANT_BUTTON===!0||t===`button`)&&_(e.props.disabled)||t.__ANT_SWITCH===!0&&(_(e.props.disabled)||_(e.props.loading))||t.__ANT_RADIO===!0&&_(e.props.disabled))){let{picked:t,omitted:n}=Sy(Ce(e),[`position`,`left`,`right`,`top`,`bottom`,`float`,`display`,`zIndex`]),r=Z(Z({display:`inline-block`},t),{cursor:`not-allowed`,lineHeight:1,width:e.props&&e.props.block?`100%`:void 0}),i=ao(e,{style:Z(Z({},n),{pointerEvents:`none`})},!0);return U(`span`,{style:r,class:`${o.value}-disabled-compatible-wrapper`},[i])}return e},y=()=>e.title??n.title?.call(n),b=(e,t)=>{let n=g.value,r=Object.keys(n).find(e=>n[e].points[0]===t.points?.[0]&&n[e].points[1]===t.points?.[1]);if(r){let n=e.getBoundingClientRect(),i={top:`50%`,left:`50%`};r.indexOf(`top`)>=0||r.indexOf(`Bottom`)>=0?i.top=`${n.height-t.offset[1]}px`:(r.indexOf(`Top`)>=0||r.indexOf(`bottom`)>=0)&&(i.top=`${-t.offset[1]}px`),r.indexOf(`left`)>=0||r.indexOf(`Right`)>=0?i.left=`${n.width-t.offset[0]}px`:(r.indexOf(`right`)>=0||r.indexOf(`Left`)>=0)&&(i.left=`${-t.offset[0]}px`),e.style.transformOrigin=`${i.left} ${i.top}`}},x=J(()=>gy(o.value,e.color)),S=J(()=>i[`data-popover-inject`]),[w,T]=xy(o,J(()=>!S.value));return()=>{let{openClassName:t,overlayClassName:r,overlayStyle:a,overlayInnerStyle:p}=e,_=dt(n.default?.call(n))??null;_=_.length===1?_[0]:_;let S=d.value;if(u.value===void 0&&m()&&(S=!1),!_)return null;let E=v(Nt(_)&&!C(_)?_:U(`span`,null,[_])),D=K({[t||`${o.value}-open`]:!0,[E.props&&E.props.class]:E.props&&E.props.class}),O=K(r,{[`${o.value}-rtl`]:c.value===`rtl`},x.value.className,T.value),k=Z(Z({},x.value.overlayStyle),p),A=x.value.arrowStyle,j=Z(Z(Z({},i),e),{prefixCls:o.value,arrow:!!e.arrow,getPopupContainer:s?.value,builtinPlacements:g.value,visible:S,ref:f,overlayClassName:O,overlayStyle:Z(Z({},A),a),overlayInnerStyle:k,onVisibleChange:h,onPopupAlign:b,transitionName:Xt(l.value,`zoom-big-fast`,e.transitionName)});return w(U(iy,j,{default:()=>[d.value?ao(E,{class:D}):E],arrowContent:()=>U(`span`,{class:`${o.value}-arrow-content`},null),overlay:y}))}}})),Ey=e=>{let{componentCls:t,popoverBg:n,popoverColor:r,width:i,fontWeightStrong:a,popoverPadding:o,boxShadowSecondary:s,colorTextHeading:c,borderRadiusLG:l,zIndexPopup:u,marginXS:d,colorBgElevated:f}=e;return[{[t]:Z(Z({},rn(e)),{position:`absolute`,top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:`normal`,whiteSpace:`normal`,textAlign:`start`,cursor:`auto`,userSelect:`text`,"--antd-arrow-background-color":f,"&-rtl":{direction:`rtl`},"&-hidden":{display:`none`},[`${t}-content`]:{position:`relative`},[`${t}-inner`]:{backgroundColor:n,backgroundClip:`padding-box`,borderRadius:l,boxShadow:s,padding:o},[`${t}-title`]:{minWidth:i,marginBottom:d,color:c,fontWeight:a},[`${t}-inner-content`]:{color:r}})},yy(e,{colorBg:`var(--antd-arrow-background-color)`}),{[`${t}-pure`]:{position:`relative`,maxWidth:`none`,[`${t}-content`]:{display:`inline-block`}}}]},Dy=e=>{let{componentCls:t}=e;return{[t]:Ir.map(n=>{let r=e[`${n}-6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":r,[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{background:`transparent`}}}})}},Oy=e=>{let{componentCls:t,lineWidth:n,lineType:r,colorSplit:i,paddingSM:a,controlHeight:o,fontSize:s,lineHeight:c,padding:l}=e,u=o-Math.round(s*c),d=u/2,f=u/2-n,p=l;return{[t]:{[`${t}-inner`]:{padding:0},[`${t}-title`]:{margin:0,padding:`${d}px ${p}px ${f}px`,borderBottom:`${n}px ${r} ${i}`},[`${t}-inner-content`]:{padding:`${a}px ${p}px`}}}},ky=v(`Popover`,e=>{let{colorBgElevated:t,colorText:n,wireframe:r}=e,i=B(e,{popoverBg:t,popoverColor:n,popoverPadding:12});return[Ey(i),Dy(i),r&&Oy(i),Q_(i,`zoom-big`)]},e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+30,width:177}}),Ay=a(u({compatConfig:{MODE:3},name:`APopover`,inheritAttrs:!1,props:Zn(Z(Z({},ay()),{content:nn(),title:nn()}),Z(Z({},wy()),{trigger:`hover`,placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1})),setup(t,n){let{expose:r,slots:i,attrs:a}=n,o=H();e(t.visible===void 0,`popover`,"`visible` will be removed in next major version, please use `open` instead."),r({getPopupDomNode:()=>{var e;return((e=o.value)?.getPopupDomNode)?.call(e)}});let{prefixCls:s,configProvider:c}=X(`popover`,t),[l,u]=ky(s),d=J(()=>c.getPrefixCls()),f=()=>{let{title:e=dt(i.title?.call(i)),content:n=dt(i.content?.call(i))}=t,r=!!(Array.isArray(e)?e.length:e),a=!!(Array.isArray(n)?n.length:e);return!r&&!a?null:U($e,null,[r&&U(`div`,{class:`${s.value}-title`},[e]),U(`div`,{class:`${s.value}-inner-content`},[n])])};return()=>{let e=K(t.overlayClassName,u.value);return l(U(Ty,Y(Y(Y({},Br(t,[`title`,`content`])),a),{},{prefixCls:s.value,ref:o,overlayClassName:e,transitionName:Xt(d.value,`zoom-big`,t.transitionName),"data-popover-inject":!0}),{title:f,default:i.default}))}}})),jy=u({compatConfig:{MODE:3},name:`AAvatarGroup`,inheritAttrs:!1,props:{prefixCls:String,maxCount:Number,maxStyle:{type:Object,default:void 0},maxPopoverPlacement:{type:String,default:`top`},maxPopoverTrigger:String,size:{type:[Number,String,Object],default:`default`},shape:{type:String,default:`circle`}},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`avatar`,e),o=J(()=>`${i.value}-group`),[s,c]=qv(i);return S(()=>{Xv({size:e.size,shape:e.shape})}),()=>{let{maxPopoverPlacement:t=`top`,maxCount:i,maxStyle:l,maxPopoverTrigger:u=`hover`,shape:d}=e,f={[o.value]:!0,[`${o.value}-rtl`]:a.value===`rtl`,[`${r.class}`]:!!r.class,[c.value]:!0},p=ce(on(n,e)).map((e,t)=>ao(e,{key:`avatar-key-${t}`})),m=p.length;if(i&&i[U(Zv,{style:l,shape:d},{default:()=>[`+${m-i}`]})]})),s(U(`div`,Y(Y({},r),{},{class:f,style:r.style}),[e]))}return s(U(`div`,Y(Y({},r),{},{class:f,style:r.style}),[p]))}}});Zv.Group=jy,Zv.install=function(e){return e.component(Zv.name,Zv),e.component(jy.name,jy),e};var My=Zv;function Ny(e){let{prefixCls:t,value:n,current:r,offset:i=0}=e,a;return i&&(a={position:`absolute`,top:`${i}00%`,left:0}),U(`p`,{style:a,class:K(`${t}-only-unit`,{current:r})},[n])}function Py(e,t,n){let r=e,i=0;for(;(r+10)%10!==t;)r+=n,i+=n;return i}var Fy=u({compatConfig:{MODE:3},name:`SingleNumber`,props:{prefixCls:String,value:String,count:Number},setup(e){let t=J(()=>Number(e.value)),n=J(()=>Math.abs(e.count)),r=Ne({prevValue:t.value,prevCount:n.value}),i=()=>{r.prevValue=t.value,r.prevCount=n.value},a=H();return G(t,()=>{clearTimeout(a.value),a.value=setTimeout(()=>{i()},1e3)},{flush:`post`}),y(()=>{clearTimeout(a.value)}),()=>{let a,o={},s=t.value;if(r.prevValue===s||Number.isNaN(s)||Number.isNaN(r.prevValue))a=[Ny(Z(Z({},e),{current:!0}))],o={transition:`none`};else{a=[];let t=s+10,i=[];for(let e=s;e<=t;e+=1)i.push(e);let c=i.findIndex(e=>e%10===r.prevValue);a=i.map((t,n)=>{let r=t%10;return Ny(Z(Z({},e),{value:r,offset:n-c,current:n===c}))});let l=r.prevCounti()},[a])}}}),Iy=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=Z(Z({},e),n),{prefixCls:a,count:o,title:s,show:c,component:l=`sup`,class:u,style:d}=t,f=Z(Z({},Iy(t,[`prefixCls`,`count`,`title`,`show`,`component`,`class`,`style`])),{style:d,"data-show":e.show,class:K(i.value,u),title:s}),p=o;if(o&&Number(o)%1==0){let e=String(o).split(``);p=e.map((t,n)=>U(Fy,{prefixCls:i.value,count:Number(o),value:t,key:e.length-n},null))}d&&d.borderColor&&(f.style=Z(Z({},d),{boxShadow:`0 0 0 1px ${d.borderColor} inset`}));let m=dt(r.default?.call(r));return m&&m.length?ao(m,{class:K(`${i.value}-custom-component`)},!1):U(l,f,{default:()=>[p]})}}}),Ry=new N(`antStatusProcessing`,{"0%":{transform:`scale(0.8)`,opacity:.5},"100%":{transform:`scale(2.4)`,opacity:0}}),zy=new N(`antZoomBadgeIn`,{"0%":{transform:`scale(0) translate(50%, -50%)`,opacity:0},"100%":{transform:`scale(1) translate(50%, -50%)`}}),By=new N(`antZoomBadgeOut`,{"0%":{transform:`scale(1) translate(50%, -50%)`},"100%":{transform:`scale(0) translate(50%, -50%)`,opacity:0}}),Vy=new N(`antNoWrapperZoomBadgeIn`,{"0%":{transform:`scale(0)`,opacity:0},"100%":{transform:`scale(1)`}}),Hy=new N(`antNoWrapperZoomBadgeOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0)`,opacity:0}}),Uy=new N(`antBadgeLoadingCircle`,{"0%":{transformOrigin:`50%`},"100%":{transform:`translate(50%, -50%) rotate(360deg)`,transformOrigin:`50%`}}),Wy=e=>{let{componentCls:t,iconCls:n,antCls:r,badgeFontHeight:i,badgeShadowSize:a,badgeHeightSm:o,motionDurationSlow:s,badgeStatusSize:c,marginXS:l,badgeRibbonOffset:u}=e,d=`${r}-scroll-number`,f=`${r}-ribbon`,p=`${r}-ribbon-wrapper`,m=zr(e,(e,n)=>{let{darkColor:r}=n;return{[`&${t} ${t}-color-${e}`]:{background:r,[`&:not(${t}-count)`]:{color:r}}}}),h=zr(e,(e,t)=>{let{darkColor:n}=t;return{[`&${f}-color-${e}`]:{background:n,color:n}}});return{[t]:Z(Z(Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,width:`fit-content`,lineHeight:1,[`${t}-count`]:{zIndex:e.badgeZIndex,minWidth:e.badgeHeight,height:e.badgeHeight,color:e.badgeTextColor,fontWeight:e.badgeFontWeight,fontSize:e.badgeFontSize,lineHeight:`${e.badgeHeight}px`,whiteSpace:`nowrap`,textAlign:`center`,background:e.badgeColor,borderRadius:e.badgeHeight/2,boxShadow:`0 0 0 ${a}px ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:o,height:o,fontSize:e.badgeFontSizeSm,lineHeight:`${o}px`,borderRadius:o/2},[`${t}-multiple-words`]:{padding:`0 ${e.paddingXS}px`},[`${t}-dot`]:{zIndex:e.badgeZIndex,width:e.badgeDotSize,minWidth:e.badgeDotSize,height:e.badgeDotSize,background:e.badgeColor,borderRadius:`100%`,boxShadow:`0 0 0 ${a}px ${e.badgeShadowColor}`},[`${t}-dot${d}`]:{transition:`background ${s}`},[`${t}-count, ${t}-dot, ${d}-custom-component`]:{position:`absolute`,top:0,insetInlineEnd:0,transform:`translate(50%, -50%)`,transformOrigin:`100% 0%`,[`&${n}-spin`]:{animationName:Uy,animationDuration:`1s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`}},[`&${t}-status`]:{lineHeight:`inherit`,verticalAlign:`baseline`,[`${t}-status-dot`]:{position:`relative`,top:-1,display:`inline-block`,width:c,height:c,verticalAlign:`middle`,borderRadius:`50%`},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:`visible`,color:e.colorPrimary,backgroundColor:e.colorPrimary,"&::after":{position:`absolute`,top:0,insetInlineStart:0,width:`100%`,height:`100%`,borderWidth:a,borderStyle:`solid`,borderColor:`inherit`,borderRadius:`50%`,animationName:Ry,animationDuration:e.badgeProcessingDuration,animationIterationCount:`infinite`,animationTimingFunction:`ease-in-out`,content:`""`}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:l,color:e.colorText,fontSize:e.fontSize}}}),m),{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:zy,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:`both`},[`${t}-zoom-leave`]:{animationName:By,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:`both`},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:Vy,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:Hy,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:`middle`},[`${d}-custom-component, ${t}-count`]:{transform:`none`},[`${d}-custom-component, ${d}`]:{position:`relative`,top:`auto`,display:`block`,transformOrigin:`50% 50%`}},[`${d}`]:{overflow:`hidden`,[`${d}-only`]:{position:`relative`,display:`inline-block`,height:e.badgeHeight,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:`preserve-3d`,WebkitBackfaceVisibility:`hidden`,[`> p${d}-only-unit`]:{height:e.badgeHeight,margin:0,WebkitTransformStyle:`preserve-3d`,WebkitBackfaceVisibility:`hidden`}},[`${d}-symbol`]:{verticalAlign:`top`}},"&-rtl":{direction:`rtl`,[`${t}-count, ${t}-dot, ${d}-custom-component`]:{transform:`translate(-50%, -50%)`}}}),[`${p}`]:{position:`relative`},[`${f}`]:Z(Z(Z(Z({},rn(e)),{position:`absolute`,top:l,padding:`0 ${e.paddingXS}px`,color:e.colorPrimary,lineHeight:`${i}px`,whiteSpace:`nowrap`,backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${f}-text`]:{color:e.colorTextLightSolid},[`${f}-corner`]:{position:`absolute`,top:`100%`,width:u,height:u,color:`currentcolor`,border:`${u/2}px solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:`top`,filter:e.badgeRibbonCornerFilter}}),h),{[`&${f}-placement-end`]:{insetInlineEnd:-u,borderEndEndRadius:0,[`${f}-corner`]:{insetInlineEnd:0,borderInlineEndColor:`transparent`,borderBlockEndColor:`transparent`}},[`&${f}-placement-start`]:{insetInlineStart:-u,borderEndStartRadius:0,[`${f}-corner`]:{insetInlineStart:0,borderBlockEndColor:`transparent`,borderInlineStartColor:`transparent`}},"&-rtl":{direction:`rtl`}})}},Gy=v(`Badge`,e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:i,marginXS:a,colorBorderBg:o}=e,s=Math.round(t*n),c=i,l=s-2*c,u=e.colorBgContainer,d=r,f=e.colorError,p=e.colorErrorHover;return[Wy(B(e,{badgeFontHeight:s,badgeShadowSize:c,badgeZIndex:`auto`,badgeHeight:l,badgeTextColor:u,badgeFontWeight:`normal`,badgeFontSize:d,badgeColor:f,badgeColorHover:p,badgeShadowColor:o,badgeHeightSm:t,badgeDotSize:r/2,badgeFontSizeSm:r,badgeStatusSize:r/2,badgeProcessingDuration:`1.2s`,badgeRibbonOffset:a,badgeRibbonCornerTransform:`scaleY(0.75)`,badgeRibbonCornerFilter:`brightness(75%)`}))]}),Ky=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);imy(e.color,!1)),l=J(()=>[i.value,`${i.value}-placement-${e.placement}`,{[`${i.value}-rtl`]:a.value===`rtl`,[`${i.value}-color-${e.color}`]:c.value}]);return()=>{let{class:t,style:a}=n,u=Ky(n,[`class`,`style`]),d={},f={};return e.color&&!c.value&&(d.background=e.color,f.color=e.color),o(U(`div`,Y({class:`${i.value}-wrapper ${s.value}`},u),[r.default?.call(r),U(`div`,{class:[l.value,t,s.value],style:Z(Z({},d),a)},[U(`span`,{class:`${i.value}-text`},[e.text||r.text?.call(r)]),U(`div`,{class:`${i.value}-corner`,style:f},null)])]))}}}),Jy=e=>!isNaN(parseFloat(e))&&isFinite(e),Yy=u({compatConfig:{MODE:3},name:`ABadge`,Ribbon:qy,inheritAttrs:!1,props:{count:f.any.def(null),showZero:{type:Boolean,default:void 0},overflowCount:{type:Number,default:99},dot:{type:Boolean,default:void 0},prefixCls:String,scrollNumberPrefixCls:String,status:{type:String},size:{type:String,default:`default`},color:String,text:f.any,offset:Array,numberStyle:{type:Object,default:void 0},title:String},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`badge`,e),[o,s]=Gy(i),c=J(()=>e.count>e.overflowCount?`${e.overflowCount}+`:e.count),l=J(()=>c.value===`0`||c.value===0),u=J(()=>e.count===null||l.value&&!e.showZero),d=J(()=>(e.status!==null&&e.status!==void 0||e.color!==null&&e.color!==void 0)&&u.value),f=J(()=>e.dot&&!l.value),p=J(()=>f.value?``:c.value),m=J(()=>(p.value===null||p.value===void 0||p.value===``||l.value&&!e.showZero)&&!f.value),h=H(e.count),g=H(p.value),_=H(f.value);G([()=>e.count,p,f],()=>{m.value||(h.value=e.count,g.value=p.value,_.value=f.value)},{immediate:!0});let v=J(()=>my(e.color,!1)),y=J(()=>({[`${i.value}-status-dot`]:d.value,[`${i.value}-status-${e.status}`]:!!e.status,[`${i.value}-color-${e.color}`]:v.value})),b=J(()=>e.color&&!v.value?{background:e.color,color:e.color}:{}),x=J(()=>({[`${i.value}-dot`]:_.value,[`${i.value}-count`]:!_.value,[`${i.value}-count-sm`]:e.size===`small`,[`${i.value}-multiple-words`]:!_.value&&g.value&&g.value.toString().length>1,[`${i.value}-status-${e.status}`]:!!e.status,[`${i.value}-color-${e.color}`]:v.value}));return()=>{let{offset:t,title:c,color:l}=e,u=r.style,f=on(n,e,`text`),p=i.value,_=h.value,S=ce(n.default?.call(n));S=S.length?S:null;let C=!!(!m.value||n.count),w=(()=>{if(!t)return Z({},u);let e={marginTop:Jy(t[1])?`${t[1]}px`:t[1]};return a.value===`rtl`?e.left=`${parseInt(t[0],10)}px`:e.right=`${-parseInt(t[0],10)}px`,Z(Z({},e),u)})(),T=c??(typeof _==`string`||typeof _==`number`?_:void 0),E=C||!f?null:U(`span`,{class:`${p}-status-text`},[f]),D=typeof _==`object`||_===void 0&&n.count?ao(_??n.count?.call(n),{style:w},!1):null,O=K(p,{[`${p}-status`]:d.value,[`${p}-not-a-wrapper`]:!S,[`${p}-rtl`]:a.value===`rtl`},r.class,s.value);if(!S&&d.value){let e=w.color;return o(U(`span`,Y(Y({},r),{},{class:O,style:w}),[U(`span`,{class:y.value,style:b.value},null),U(`span`,{style:{color:e},class:`${p}-status-text`},[f])]))}let k=ge(S?`${p}-zoom`:``,{appear:!1}),A=Z(Z({},w),e.numberStyle);return l&&!v.value&&(A||={},A.background=l),o(U(`span`,Y(Y({},r),{},{class:O}),[S,U(Re,k,{default:()=>[Mt(U(Ly,{prefixCls:e.scrollNumberPrefixCls,show:C,class:x.value,count:g.value,title:T,style:A,key:`scrollNumber`},{default:()=>[D]}),[[ht,C]])]}),E]))}}});Yy.install=function(e){return e.component(Yy.name,Yy),e.component(qy.name,qy),e};var Xy=Yy,Zy={adjustX:1,adjustY:1},Qy=[0,0],$y={topLeft:{points:[`bl`,`tl`],overflow:Zy,offset:[0,-4],targetOffset:Qy},topCenter:{points:[`bc`,`tc`],overflow:Zy,offset:[0,-4],targetOffset:Qy},topRight:{points:[`br`,`tr`],overflow:Zy,offset:[0,-4],targetOffset:Qy},bottomLeft:{points:[`tl`,`bl`],overflow:Zy,offset:[0,4],targetOffset:Qy},bottomCenter:{points:[`tc`,`bc`],overflow:Zy,offset:[0,4],targetOffset:Qy},bottomRight:{points:[`tr`,`br`],overflow:Zy,offset:[0,4],targetOffset:Qy}},eb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.visible,e=>{e!==void 0&&(a.value=e)});let o=H();i({triggerRef:o});let s=t=>{e.visible===void 0&&(a.value=!1),r(`overlayClick`,t)},c=t=>{e.visible===void 0&&(a.value=t),r(`visibleChange`,t)},l=()=>{let t=n.overlay?.call(n),r={prefixCls:`${e.prefixCls}-menu`,onClick:s};return U($e,{key:M},[e.arrow&&U(`div`,{class:`${e.prefixCls}-arrow`},null),ao(t,r,!1)])},u=J(()=>{let{minOverlayWidthMatchTrigger:t=!e.alignPoint}=e;return t}),d=()=>{let t=n.default?.call(n);return a.value&&t?ao(t[0],{class:e.openClassName||`${e.prefixCls}-open`},!1):t},f=J(()=>!e.hideAction&&e.trigger.indexOf(`contextmenu`)!==-1?[`click`]:e.hideAction);return()=>{let{prefixCls:t,arrow:n,showAction:r,overlayStyle:i,trigger:s,placement:p,align:m,getPopupContainer:h,transitionName:g,animation:_,overlayClassName:v}=e;return U(Su,Y(Y({},eb(e,[`prefixCls`,`arrow`,`showAction`,`overlayStyle`,`trigger`,`placement`,`align`,`getPopupContainer`,`transitionName`,`animation`,`overlayClassName`])),{},{prefixCls:t,ref:o,popupClassName:K(v,{[`${t}-show-arrow`]:n}),popupStyle:i,builtinPlacements:$y,action:s,showAction:r,hideAction:f.value||[],popupPlacement:p,popupAlign:m,popupTransitionName:g,popupAnimation:_,popupVisible:a.value,stretch:u.value?`minWidth`:``,onPopupVisibleChange:c,getPopupContainer:h}),{popup:l,default:d})}}}),nb=e=>{let{componentCls:t,colorPrimary:n}=e;return{[t]:{position:`absolute`,background:`transparent`,pointerEvents:`none`,boxSizing:`border-box`,color:`var(--wave-color, ${n})`,boxShadow:`0 0 0 0 currentcolor`,opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(`,`),"&-active":{boxShadow:`0 0 0 6px currentcolor`,opacity:0}}}}},rb=v(`Wave`,e=>[nb(e)]);function ib(e){let t=(e||``).match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}function ab(e){return e&&e!==`#fff`&&e!==`#ffffff`&&e!==`rgb(255, 255, 255)`&&e!==`rgba(255, 255, 255, 1)`&&ib(e)&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&e!==`transparent`}function ob(e){let{borderTopColor:t,borderColor:n,backgroundColor:r}=getComputedStyle(e);return ab(t)?t:ab(n)?n:ab(r)?r:null}function sb(e){return Number.isNaN(e)?0:e}var cb=u({props:{target:Qt(),className:String},setup(e){let t=q(null),[n,r]=ff(null),[i,a]=ff([]),[o,s]=ff(0),[c,l]=ff(0),[u,d]=ff(0),[f,p]=ff(0),[m,h]=ff(!1);function g(){let{target:t}=e,n=getComputedStyle(t);r(ob(t));let i=n.position===`static`,{borderLeftWidth:o,borderTopWidth:c}=n;s(i?t.offsetLeft:sb(-parseFloat(o))),l(i?t.offsetTop:sb(-parseFloat(c))),d(t.offsetWidth),p(t.offsetHeight);let{borderTopLeftRadius:u,borderTopRightRadius:f,borderBottomLeftRadius:m,borderBottomRightRadius:h}=n;a([u,f,h,m].map(e=>sb(parseFloat(e))))}let _,v,y,b=()=>{clearTimeout(y),ir.cancel(v),_?.disconnect()},x=()=>{let e=t.value?.parentElement;e&&(Ge(null,e),e.parentElement&&e.parentElement.removeChild(e))};V(()=>{b(),y=setTimeout(()=>{x()},5e3);let{target:t}=e;t&&(v=ir(()=>{g(),h(!0)}),typeof ResizeObserver<`u`&&(_=new ResizeObserver(g),_.observe(t)))}),ut(()=>{b()});let S=e=>{e.propertyName===`opacity`&&x()};return()=>{if(!m.value)return null;let r={left:`${o.value}px`,top:`${c.value}px`,width:`${u.value}px`,height:`${f.value}px`,borderRadius:i.value.map(e=>`${e}px`).join(` `)};return n&&(r[`--wave-color`]=n.value),U(Re,{appear:!0,name:`wave-motion`,appearFromClass:`wave-motion-appear`,appearActiveClass:`wave-motion-appear`,appearToClass:`wave-motion-appear wave-motion-appear-active`},{default:()=>[U(`div`,{ref:t,class:e.className,style:r,onTransitionend:S},null)]})}}});function lb(e,t){let n=document.createElement(`div`);return n.style.position=`absolute`,n.style.left=`0px`,n.style.top=`0px`,e?.insertBefore(n,e?.firstChild),Ge(U(cb,{target:e,className:t},null),n),()=>{Ge(null,n),n.parentElement&&n.parentElement.removeChild(n)}}function ub(e,t){let n=Zt(),r;function i(){let i=ae(n);r?.(),!(t?.value?.disabled||!i)&&(r=lb(i,e.value))}return ut(()=>{r?.()}),i}var db=u({compatConfig:{MODE:3},name:`Wave`,props:{disabled:Boolean},setup(e,t){let{slots:n}=t,r=Zt(),{prefixCls:i,wave:a}=X(`wave`,e),[,o]=rb(i),s=ub(J(()=>K(i.value,o.value)),a),c,l=()=>{ae(r).removeEventListener(`click`,c,!0)};return V(()=>{G(()=>e.disabled,()=>{l(),z(()=>{let t=ae(r);t?.removeEventListener(`click`,c,!0),!(!t||t.nodeType!==1||e.disabled)&&(c=e=>{e.target.tagName===`INPUT`||!fo(e.target)||!t.getAttribute||t.getAttribute(`disabled`)||t.disabled||t.className.includes(`disabled`)||t.className.includes(`-leave`)||s()},t.addEventListener(`click`,c,!0))})},{immediate:!0,flush:`post`})}),ut(()=>{l()}),()=>n.default?.call(n)[0]}});function fb(e){return e===`danger`?{danger:!0}:{type:e}}var pb=()=>({prefixCls:String,type:String,htmlType:{type:String,default:`button`},shape:{type:String},size:{type:String},loading:{type:[Boolean,Object],default:()=>!1},disabled:{type:Boolean,default:void 0},ghost:{type:Boolean,default:void 0},block:{type:Boolean,default:void 0},danger:{type:Boolean,default:void 0},icon:f.any,href:String,target:String,title:String,onClick:he(),onMousedown:he()}),mb=e=>{e&&(e.style.width=`0px`,e.style.opacity=`0`,e.style.transform=`scale(0)`)},hb=e=>{z(()=>{e&&(e.style.width=`${e.scrollWidth}px`,e.style.opacity=`1`,e.style.transform=`scale(1)`)})},gb=e=>{e&&e.style&&(e.style.width=null,e.style.opacity=null,e.style.transform=null)},_b=u({compatConfig:{MODE:3},name:`LoadingIcon`,props:{prefixCls:String,loading:[Boolean,Object],existIcon:Boolean},setup(e){return()=>{let{existIcon:t,prefixCls:n,loading:r}=e;if(t)return U(`span`,{class:`${n}-loading-icon`},[U(qt,null,null)]);let i=!!r;return U(Re,{name:`${n}-loading-icon-motion`,onBeforeEnter:mb,onEnter:hb,onAfterEnter:gb,onBeforeLeave:hb,onLeave:e=>{setTimeout(()=>{mb(e)})},onAfterLeave:gb},{default:()=>[i?U(`span`,{class:`${n}-loading-icon`},[U(qt,null,null)]):null]})}}}),vb=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),yb=e=>{let{componentCls:t,fontSize:n,lineWidth:r,colorPrimaryHover:i,colorErrorHover:a}=e;return{[`${t}-group`]:[{position:`relative`,display:`inline-flex`,[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-r,[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:`relative`,zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},vb(`${t}-primary`,i),vb(`${t}-danger`,a)]}};function bb(e,t){return{[`&-item:not(${t}-last-item)`]:{marginBottom:-e.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function xb(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function Sb(e){let t=`${e.componentCls}-compact-vertical`;return{[t]:Z(Z({},bb(e,t)),xb(e.componentCls,t))}}var Cb=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{outline:`none`,position:`relative`,display:`inline-block`,fontWeight:400,whiteSpace:`nowrap`,textAlign:`center`,backgroundImage:`none`,backgroundColor:`transparent`,border:`${e.lineWidth}px ${e.lineType} transparent`,cursor:`pointer`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:`none`,touchAction:`manipulation`,lineHeight:e.lineHeight,color:e.colorText,"> span":{display:`inline-block`},[`> ${n} + span, > span + ${n}`]:{marginInlineStart:e.marginXS},"> a":{color:`currentColor`},"&:not(:disabled)":Z({},de(e)),[`&-icon-only${t}-compact-item`]:{flex:`none`},[`&-compact-item${t}-primary`]:{[`&:not([disabled]) + ${t}-compact-item${t}-primary:not([disabled])`]:{position:`relative`,"&:before":{position:`absolute`,top:-e.lineWidth,insetInlineStart:-e.lineWidth,display:`inline-block`,width:e.lineWidth,height:`calc(100% + ${e.lineWidth*2}px)`,backgroundColor:e.colorPrimaryHover,content:`""`}}},"&-compact-vertical-item":{[`&${t}-primary`]:{[`&:not([disabled]) + ${t}-compact-vertical-item${t}-primary:not([disabled])`]:{position:`relative`,"&:before":{position:`absolute`,top:-e.lineWidth,insetInlineStart:-e.lineWidth,display:`inline-block`,width:`calc(100% + ${e.lineWidth*2}px)`,height:e.lineWidth,backgroundColor:e.colorPrimaryHover,content:`""`}}}}}}},wb=(e,t)=>({"&:not(:disabled)":{"&:hover":e,"&:active":t}}),Tb=e=>({minWidth:e.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:`50%`}),Eb=e=>({borderRadius:e.controlHeight,paddingInlineStart:e.controlHeight/2,paddingInlineEnd:e.controlHeight/2}),Db=e=>({cursor:`not-allowed`,borderColor:e.colorBorder,color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,boxShadow:`none`}),Ob=(e,t,n,r,i,a,o)=>({[`&${e}-background-ghost`]:Z(Z({color:t||void 0,backgroundColor:`transparent`,borderColor:n||void 0,boxShadow:`none`},wb(Z({backgroundColor:`transparent`},a),Z({backgroundColor:`transparent`},o))),{"&:disabled":{cursor:`not-allowed`,color:r||void 0,borderColor:i||void 0}})}),kb=e=>({"&:disabled":Z({},Db(e))}),Ab=e=>Z({},kb(e)),jb=e=>({"&:disabled":{cursor:`not-allowed`,color:e.colorTextDisabled}}),Mb=e=>Z(Z(Z(Z(Z({},Ab(e)),{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,boxShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`}),wb({color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),Ob(e.componentCls,e.colorBgContainer,e.colorBgContainer,e.colorTextDisabled,e.colorBorder)),{[`&${e.componentCls}-dangerous`]:Z(Z(Z({color:e.colorError,borderColor:e.colorError},wb({color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),Ob(e.componentCls,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder)),kb(e))}),Nb=e=>Z(Z(Z(Z(Z({},Ab(e)),{color:e.colorTextLightSolid,backgroundColor:e.colorPrimary,boxShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`}),wb({color:e.colorTextLightSolid,backgroundColor:e.colorPrimaryHover},{color:e.colorTextLightSolid,backgroundColor:e.colorPrimaryActive})),Ob(e.componentCls,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),{[`&${e.componentCls}-dangerous`]:Z(Z(Z({backgroundColor:e.colorError,boxShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`},wb({backgroundColor:e.colorErrorHover},{backgroundColor:e.colorErrorActive})),Ob(e.componentCls,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),kb(e))}),Pb=e=>Z(Z({},Mb(e)),{borderStyle:`dashed`}),Fb=e=>Z(Z(Z({color:e.colorLink},wb({color:e.colorLinkHover},{color:e.colorLinkActive})),jb(e)),{[`&${e.componentCls}-dangerous`]:Z(Z({color:e.colorError},wb({color:e.colorErrorHover},{color:e.colorErrorActive})),jb(e))}),Ib=e=>Z(Z(Z({},wb({color:e.colorText,backgroundColor:e.colorBgTextHover},{color:e.colorText,backgroundColor:e.colorBgTextActive})),jb(e)),{[`&${e.componentCls}-dangerous`]:Z(Z({color:e.colorError},jb(e)),wb({color:e.colorErrorHover,backgroundColor:e.colorErrorBg},{color:e.colorErrorHover,backgroundColor:e.colorErrorBg}))}),Lb=e=>Z(Z({},Db(e)),{[`&${e.componentCls}:hover`]:Z({},Db(e))}),Rb=e=>{let{componentCls:t}=e;return{[`${t}-default`]:Mb(e),[`${t}-primary`]:Nb(e),[`${t}-dashed`]:Pb(e),[`${t}-link`]:Fb(e),[`${t}-text`]:Ib(e),[`${t}-disabled`]:Lb(e)}},zb=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,{componentCls:n,iconCls:r,controlHeight:i,fontSize:a,lineHeight:o,lineWidth:s,borderRadius:c,buttonPaddingHorizontal:l}=e,u=Math.max(0,(i-a*o)/2-s),d=l-s,f=`${n}-icon-only`;return[{[`${n}${t}`]:{fontSize:a,height:i,padding:`${u}px ${d}px`,borderRadius:c,[`&${f}`]:{width:i,paddingInlineStart:0,paddingInlineEnd:0,[`&${n}-round`]:{width:`auto`},"> span":{transform:`scale(1.143)`}},[`&${n}-loading`]:{opacity:e.opacityLoading,cursor:`default`},[`${n}-loading-icon`]:{transition:`width ${e.motionDurationSlow} ${e.motionEaseInOut}, opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`&:not(${f}) ${n}-loading-icon > ${r}`]:{marginInlineEnd:e.marginXS}}},{[`${n}${n}-circle${t}`]:Tb(e)},{[`${n}${n}-round${t}`]:Eb(e)}]},Bb=e=>zb(e),Vb=e=>zb(B(e,{controlHeight:e.controlHeightSM,padding:e.paddingXS,buttonPaddingHorizontal:8,borderRadius:e.borderRadiusSM}),`${e.componentCls}-sm`),Hb=e=>zb(B(e,{controlHeight:e.controlHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`${e.componentCls}-lg`),Ub=e=>{let{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:`100%`}}}},Wb=v(`Button`,e=>{let{controlTmpOutline:t,paddingContentHorizontal:n}=e,r=B(e,{colorOutlineDefault:t,buttonPaddingHorizontal:n});return[Cb(r),Vb(r),Bb(r),Hb(r),Ub(r),Rb(r),yb(r),uv(e,{focus:!1}),Sb(e)]}),Gb=()=>({prefixCls:String,size:{type:String}}),Kb=Nf(),qb=u({compatConfig:{MODE:3},name:`AButtonGroup`,props:Gb(),setup(e,t){let{slots:n}=t,{prefixCls:r,direction:i}=X(`btn-group`,e),[,,a]=re();Kb.useProvide(Ne({size:J(()=>e.size)}));let o=J(()=>{let{size:t}=e,n=``;switch(t){case`large`:n=`lg`;break;case`small`:n=`sm`;break;case`middle`:case void 0:break;default:pi(!t,`Button.Group`,"Invalid prop `size`.")}return{[`${r.value}`]:!0,[`${r.value}-${n}`]:n,[`${r.value}-rtl`]:i.value===`rtl`,[a.value]:!0}});return()=>U(`div`,{class:o.value},[ce(n.default?.call(n))])}}),Jb=/^[\u4e00-\u9fa5]{2}$/,Yb=Jb.test.bind(Jb);function Xb(e){return e===`text`||e===`link`}var Zb=u({compatConfig:{MODE:3},name:`AButton`,inheritAttrs:!1,__ANT_BUTTON:!0,props:Zn(pb(),{type:`default`}),slots:Object,setup(e,t){let{slots:n,attrs:r,emit:i,expose:a}=t,{prefixCls:o,autoInsertSpaceInButton:s,direction:c,size:l}=X(`btn`,e),[u,d]=Wb(o),f=Kb.useInject(),p=at(),m=J(()=>e.disabled??p.value),h=q(null),g=q(void 0),_=!1,v=q(!1),y=q(!1),b=J(()=>s.value!==!1),{compactSize:x,compactItemClassnames:C}=u_(o,c),w=J(()=>typeof e.loading==`object`&&e.loading.delay?e.loading.delay||!0:!!e.loading);G(w,e=>{clearTimeout(g.value),typeof w.value==`number`?g.value=setTimeout(()=>{v.value=e},w.value):v.value=e},{immediate:!0});let T=J(()=>{let{type:t,shape:n=`default`,ghost:r,block:i,danger:a}=e,s=o.value,u={large:`lg`,small:`sm`,middle:void 0},p=x.value||f?.size||l.value,m=p&&u[p]||``;return[C.value,{[d.value]:!0,[`${s}`]:!0,[`${s}-${n}`]:n!=="default"&&n,[`${s}-${t}`]:t,[`${s}-${m}`]:m,[`${s}-loading`]:v.value,[`${s}-background-ghost`]:r&&!Xb(t),[`${s}-two-chinese-chars`]:y.value&&b.value,[`${s}-block`]:i,[`${s}-dangerous`]:!!a,[`${s}-rtl`]:c.value===`rtl`}]}),E=()=>{let e=h.value;if(!e||s.value===!1)return;let t=e.textContent;_&&Yb(t)?y.value||=!0:y.value&&=!1},D=e=>{if(v.value||m.value){e.preventDefault();return}i(`click`,e)},k=e=>{i(`mousedown`,e)},A=(e,t)=>{let n=t?` `:``;if(e.type===vt){let t=e.children.trim();return Yb(t)&&(t=t.split(``).join(n)),U(`span`,null,[t])}return e};return S(()=>{pi(!(e.ghost&&Xb(e.type)),`Button`,"`link` or `text` button can't be a `ghost` button.")}),V(E),O(E),ut(()=>{g.value&&clearTimeout(g.value)}),a({focus:()=>{var e;(e=h.value)==null||e.focus()},blur:()=>{var e;(e=h.value)==null||e.blur()}}),()=>{let{icon:t=n.icon?.call(n)}=e,i=ce(n.default?.call(n));_=i.length===1&&!t&&!Xb(e.type);let{type:a,htmlType:s,href:c,title:l,target:d}=e,f=v.value?`loading`:t,p=Z(Z({},r),{title:l,disabled:m.value,class:[T.value,r.class,{[`${o.value}-icon-only`]:i.length===0&&!!f}],onClick:D,onMousedown:k});m.value||delete p.disabled;let g=t&&!v.value?t:U(_b,{existIcon:!!t,prefixCls:o.value,loading:!!v.value},null),y=i.map(e=>A(e,_&&b.value));if(c!==void 0)return u(U(`a`,Y(Y({},p),{},{href:c,target:d,ref:h}),[g,y]));let x=U(`button`,Y(Y({},p),{},{ref:h,type:s}),[g,y]);if(!Xb(a)){let e=function(){return x}();x=U(db,{ref:`wave`,disabled:!!v.value},{default:()=>[e]})}return u(x)}}});Zb.Group=qb,Zb.install=function(e){return e.component(Zb.name,Zb),e.component(qb.name,qb),e};var Qb=Zb,$b=()=>({arrow:W([Boolean,Object]),trigger:{type:[Array,String]},menu:Qt(),overlay:f.any,visible:Q(),open:Q(),disabled:Q(),danger:Q(),autofocus:Q(),align:Qt(),getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:Qt(),forceRender:Q(),mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:Q(),destroyPopupOnHide:Q(),onVisibleChange:{type:Function},"onUpdate:visible":{type:Function},onOpenChange:{type:Function},"onUpdate:open":{type:Function}}),ex=pb(),tx=()=>Z(Z({},$b()),{type:ex.type,size:String,htmlType:ex.htmlType,href:String,disabled:Q(),prefixCls:String,icon:f.any,title:String,loading:ex.loading,onClick:he()}),nx={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z`}}]},name:`ellipsis`,theme:`outlined`};function rx(e){for(var t=1;t{let{componentCls:t,antCls:n,paddingXS:r,opacityLoading:i}=e;return{[`${t}-button`]:{whiteSpace:`nowrap`,[`&${n}-btn-group > ${n}-btn`]:{[`&-loading, &-loading + ${n}-btn`]:{cursor:`default`,pointerEvents:`none`,opacity:i},[`&:last-child:not(:first-child):not(${n}-btn-icon-only)`]:{paddingInline:r}}}}},sx=e=>{let{componentCls:t,menuCls:n,colorError:r,colorTextLightSolid:i}=e,a=`${n}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${n} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:r,"&:hover":{color:i,backgroundColor:r}}}}}},cx=e=>{let{componentCls:t,menuCls:n,zIndexPopup:r,dropdownArrowDistance:i,dropdownArrowOffset:a,sizePopupArrow:o,antCls:s,iconCls:c,motionDurationMid:l,dropdownPaddingVertical:u,fontSize:d,dropdownEdgeChildPadding:f,colorTextDisabled:p,fontSizeIcon:m,controlPaddingHorizontal:h,colorBgElevated:g,boxShadowPopoverArrow:_}=e;return[{[t]:Z(Z({},rn(e)),{position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:r,display:`block`,"&::before":{position:`absolute`,insetBlock:-i+o/2,zIndex:-9999,opacity:1e-4,content:`""`},[`${t}-wrap`]:{position:`relative`,[`${s}-btn > ${c}-down`]:{fontSize:m},[`${c}-down::before`]:{transition:`transform ${l}`}},[`${t}-wrap-open`]:{[`${c}-down::before`]:{transform:`rotate(180deg)`}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:`none`},[` + &-show-arrow${t}-placement-topLeft, + &-show-arrow${t}-placement-top, + &-show-arrow${t}-placement-topRight + `]:{paddingBottom:i},[` + &-show-arrow${t}-placement-bottomLeft, + &-show-arrow${t}-placement-bottom, + &-show-arrow${t}-placement-bottomRight + `]:{paddingTop:i},[`${t}-arrow`]:Z({position:`absolute`,zIndex:1,display:`block`},Rr(o,e.borderRadiusXS,e.borderRadiusOuter,g,_)),[` + &-placement-top > ${t}-arrow, + &-placement-topLeft > ${t}-arrow, + &-placement-topRight > ${t}-arrow + `]:{bottom:i,transform:`translateY(100%) rotate(180deg)`},[`&-placement-top > ${t}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(100%) rotate(180deg)`},[`&-placement-topLeft > ${t}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-topRight > ${t}-arrow`]:{right:{_skip_check_:!0,value:a}},[` + &-placement-bottom > ${t}-arrow, + &-placement-bottomLeft > ${t}-arrow, + &-placement-bottomRight > ${t}-arrow + `]:{top:i,transform:`translateY(-100%)`},[`&-placement-bottom > ${t}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateY(-100%) translateX(-50%)`},[`&-placement-bottomLeft > ${t}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-bottomRight > ${t}-arrow`]:{right:{_skip_check_:!0,value:a}},[`&${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottomLeft, + &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottomLeft, + &${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottom, + &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottom, + &${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottomRight, + &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:k_},[`&${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-topLeft, + &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-topLeft, + &${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-top, + &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-top, + &${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-topRight, + &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-topRight`]:{animationName:j_},[`&${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottomLeft, + &${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottom, + &${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:A_},[`&${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-topLeft, + &${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-top, + &${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-topRight`]:{animationName:M_}})},{[`${t} ${n}`]:{position:`relative`,margin:0},[`${n}-submenu-popup`]:{position:`absolute`,zIndex:r,background:`transparent`,boxShadow:`none`,transformOrigin:`0 0`,"ul,li":{listStyle:`none`},ul:{marginInline:`0.3em`}},[`${t}, ${t}-menu-submenu`]:{[n]:Z(Z({padding:f,listStyleType:`none`,backgroundColor:g,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary},de(e)),{[`${n}-item-group-title`]:{padding:`${u}px ${h}px`,color:e.colorTextDescription,transition:`all ${l}`},[`${n}-item`]:{position:`relative`,display:`flex`,alignItems:`center`,borderRadius:e.borderRadiusSM},[`${n}-item-icon`]:{minWidth:d,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${n}-title-content`]:{flex:`auto`,"> a":{color:`inherit`,transition:`all ${l}`,"&:hover":{color:`inherit`},"&::after":{position:`absolute`,inset:0,content:`""`}}},[`${n}-item, ${n}-submenu-title`]:Z(Z({clear:`both`,margin:0,padding:`${u}px ${h}px`,color:e.colorText,fontWeight:`normal`,fontSize:d,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${l}`,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},de(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:p,cursor:`not-allowed`,"&:hover":{color:p,backgroundColor:g,cursor:`not-allowed`},a:{pointerEvents:`none`}},"&-divider":{height:1,margin:`${e.marginXXS}px 0`,overflow:`hidden`,lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:`absolute`,insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:`0 !important`,color:e.colorTextDescription,fontSize:m,fontStyle:`normal`}}}),[`${n}-item-group-list`]:{margin:`0 ${e.marginXS}px`,padding:0,listStyle:`none`},[`${n}-submenu-title`]:{paddingInlineEnd:h+e.fontSizeSM},[`${n}-submenu-vertical`]:{position:`relative`},[`${n}-submenu${n}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:p,backgroundColor:g,cursor:`not-allowed`}},[`${n}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}})}},[R_(e,`slide-up`),R_(e,`slide-down`),O_(e,`move-up`),O_(e,`move-down`),Q_(e,`zoom-big`)]]},lx=v(`Dropdown`,(e,t)=>{let{rootPrefixCls:n}=t,{marginXXS:r,sizePopupArrow:i,controlHeight:a,fontSize:o,lineHeight:s,paddingXXS:c,componentCls:l,borderRadiusOuter:u,borderRadiusLG:d}=e,f=(a-o*s)/2,{dropdownArrowOffset:p}=vy({sizePopupArrow:i,contentRadius:d,borderRadiusOuter:u}),m=B(e,{menuCls:`${l}-menu`,rootPrefixCls:n,dropdownArrowDistance:i/2+r,dropdownArrowOffset:p,dropdownPaddingVertical:f,dropdownEdgeChildPadding:c});return[cx(m),ox(m),sx(m)]},e=>({zIndexPopup:e.zIndexPopupBase+50})),ux=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{i(`update:visible`,e),i(`visibleChange`,e),i(`update:open`,e),i(`openChange`,e)},{prefixCls:o,direction:s,getPopupContainer:c}=X(`dropdown`,e),l=J(()=>`${o.value}-button`),[u,d]=lx(o);return()=>{let t=Z(Z({},e),r),{type:i=`default`,disabled:o,danger:f,loading:p,htmlType:m,class:h=``,overlay:g=n.overlay?.call(n),trigger:_,align:v,open:y,visible:b,onVisibleChange:x,placement:S=s.value===`rtl`?`bottomLeft`:`bottomRight`,href:C,title:w,icon:T=n.icon?.call(n)||U(ax,null,null),mouseEnterDelay:E,mouseLeaveDelay:D,overlayClassName:O,overlayStyle:k,destroyPopupOnHide:A,onClick:j,"onUpdate:open":M}=t,N=ux(t,[`type`,`disabled`,`danger`,`loading`,`htmlType`,`class`,`overlay`,`trigger`,`align`,`open`,`visible`,`onVisibleChange`,`placement`,`href`,`title`,`icon`,`mouseEnterDelay`,`mouseLeaveDelay`,`overlayClassName`,`overlayStyle`,`destroyPopupOnHide`,`onClick`,`onUpdate:open`]),P={align:v,disabled:o,trigger:o?[]:_,placement:S,getPopupContainer:c?.value,onOpenChange:a,mouseEnterDelay:E,mouseLeaveDelay:D,open:y??b,overlayClassName:O,overlayStyle:k,destroyPopupOnHide:A},F=U(Qb,{danger:f,type:i,disabled:o,loading:p,onClick:j,htmlType:m,href:C,title:w},{default:n.default}),I=U(Qb,{danger:f,type:i,icon:T},null);return u(U(dx,Y(Y({},N),{},{class:K(l.value,h,d.value)}),{default:()=>[n.leftButton?n.leftButton({button:F}):F,U(bx,P,{default:()=>[n.rightButton?n.rightButton({button:I}):I],overlay:()=>g})]}))}}}),px={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z`}}]},name:`right`,theme:`outlined`};function mx(e){for(var t=1;tg(_x,void 0),yx=e=>{let{prefixCls:t,mode:n,selectable:r,validator:i,onClick:a,expandIcon:o}=vx()||{};fe(_x,{prefixCls:J(()=>e.prefixCls?.value??t?.value),mode:J(()=>e.mode?.value??n?.value),selectable:J(()=>e.selectable?.value??r?.value),validator:e.validator??i,onClick:e.onClick??a,expandIcon:e.expandIcon??o?.value})},bx=u({compatConfig:{MODE:3},name:`ADropdown`,inheritAttrs:!1,props:Zn($b(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:`bottomLeft`,trigger:`hover`}),slots:Object,setup(t,n){let{slots:r,attrs:i,emit:a}=n,{prefixCls:o,rootPrefixCls:s,direction:c,getPopupContainer:l}=X(`dropdown`,t),[u,d]=lx(o),f=J(()=>{let{placement:e=``,transitionName:n}=t;return n===void 0?e.includes(`top`)?`${s.value}-slide-down`:`${s.value}-slide-up`:n});yx({prefixCls:J(()=>`${o.value}-menu`),expandIcon:J(()=>U(`span`,{class:`${o.value}-menu-submenu-arrow`},[U(gx,{class:`${o.value}-menu-submenu-arrow-icon`},null)])),mode:J(()=>`vertical`),selectable:J(()=>!1),onClick:()=>{},validator:t=>{let{mode:n}=t;e(!n||n===`vertical`,`Dropdown`,`mode="${n}" is not supported for Dropdown's Menu.`)}});let p=()=>{var e;let n=t.overlay||r.overlay?.call(r),i=Array.isArray(n)?n[0]:n;if(!i)return null;let a=i.props||{};pi(!a.mode||a.mode===`vertical`,`Dropdown`,`mode="${a.mode}" is not supported for Dropdown's Menu.`);let{selectable:s=!1,expandIcon:c=((e=i.children)?.expandIcon)?.call(e)}=a,l=c!==void 0&&Nt(c)?c:U(`span`,{class:`${o.value}-menu-submenu-arrow`},[U(gx,{class:`${o.value}-menu-submenu-arrow-icon`},null)]);return Nt(i)?ao(i,{mode:`vertical`,selectable:s,expandIcon:()=>l}):i},m=J(()=>{let e=t.placement;if(!e)return c.value===`rtl`?`bottomRight`:`bottomLeft`;if(e.includes(`Center`)){let t=e.slice(0,e.indexOf(`Center`));return pi(!e.includes(`Center`),`Dropdown`,`You are using '${e}' placement in Dropdown, which is deprecated. Try to use '${t}' instead.`),t}return e}),h=J(()=>typeof t.visible==`boolean`?t.visible:t.open),g=e=>{a(`update:visible`,e),a(`visibleChange`,e),a(`update:open`,e),a(`openChange`,e)};return()=>{let{arrow:e,trigger:n,disabled:a,overlayClassName:s}=t,_=r.default?.call(r)[0],v=ao(_,Z({class:K(_?.props?.class,{[`${o.value}-rtl`]:c.value===`rtl`},`${o.value}-trigger`)},a?{disabled:a}:{})),y=K(s,d.value,{[`${o.value}-rtl`]:c.value===`rtl`}),b=a?[]:n,x;b&&b.includes(`contextmenu`)&&(x=!0);let S=uy({arrowPointAtCenter:typeof e==`object`&&e.pointAtCenter,autoAdjustOverflow:!0}),C=Br(Z(Z(Z({},t),i),{visible:h.value,builtinPlacements:S,overlayClassName:y,arrow:!!e,alignPoint:x,prefixCls:o.value,getPopupContainer:l?.value,transitionName:f.value,trigger:b,onVisibleChange:g,placement:m.value}),[`overlay`,`onUpdate:visible`]);return u(U(tb,C,{default:()=>[v],overlay:p}))}}});bx.Button=fx;var xx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let i=on(n,e,`overlay`);return i?U(bx,Y(Y({},e.dropdownProps),{},{overlay:i,placement:`bottom`}),{default:()=>[U(`span`,{class:`${r}-overlay-link`},[t,U(Cf,null,null)])]}):t},s=e=>{i(`click`,e)};return()=>{let t=on(n,e,`separator`)??`/`,i=on(n,e),{class:c,style:l}=r,u=xx(r,[`class`,`style`]),d;return d=e.href===void 0?U(`span`,Y({class:`${a.value}-link`,onClick:s},u),[i]):U(`a`,Y({class:`${a.value}-link`,onClick:s},u),[i]),d=o(d,a.value),i==null?null:U(`li`,{class:c,style:l},[d,t&&U(`span`,{class:`${a.value}-separator`},[t])])}}});function Cx(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o{fe(Tx,e)},Dx=()=>g(Tx),Ox=Symbol(`ForceRenderKey`),kx=e=>{fe(Ox,e)},Ax=()=>g(Ox,!1),jx=Symbol(`menuFirstLevelContextKey`),Mx=e=>{fe(jx,e)},Nx=()=>g(jx,!0),Px=u({compatConfig:{MODE:3},name:`MenuContextProvider`,inheritAttrs:!1,props:{mode:{type:String,default:void 0},overflowDisabled:{type:Boolean,default:void 0}},setup(e,t){let{slots:n}=t,r=Z({},Dx());return e.mode!==void 0&&(r.mode=St(e,`mode`)),e.overflowDisabled!==void 0&&(r.overflowDisabled=St(e,`overflowDisabled`)),Ex(r),()=>n.default?.call(n)}}),Fx=Symbol(`siderCollapsed`),Ix=Symbol(`siderHookProvider`),Lx=`$$__vc-menu-more__key`,Rx=Symbol(`KeyPathContext`),zx=()=>g(Rx,{parentEventKeys:J(()=>[]),parentKeys:J(()=>[]),parentInfo:{}}),Bx=(e,t,n)=>{let{parentEventKeys:r,parentKeys:i}=zx(),a=J(()=>[...r.value,e]),o=J(()=>[...i.value,t]);return fe(Rx,{parentEventKeys:a,parentKeys:o,parentInfo:n}),o},Vx=Symbol(`measure`),Hx=u({compatConfig:{MODE:3},setup(e,t){let{slots:n}=t;return fe(Vx,!0),()=>n.default?.call(n)}}),Ux=()=>g(Vx,!1);function Wx(e){let{mode:t,rtl:n,inlineIndent:r}=Dx();return J(()=>t.value===`inline`?n.value?{paddingRight:`${e.value*r.value}px`}:{paddingLeft:`${e.value*r.value}px`}:null)}var Gx=0,Kx=u({compatConfig:{MODE:3},name:`AMenuItem`,inheritAttrs:!1,props:{id:String,role:String,disabled:Boolean,danger:Boolean,title:{type:[String,Boolean],default:void 0},icon:f.any,onMouseenter:Function,onMouseleave:Function,onClick:Function,onKeydown:Function,onFocus:Function,originItemValue:Qt()},slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t,a=Zt(),o=Ux(),s=typeof a.vnode.key==`symbol`?String(a.vnode.key):a.vnode.key;pi(typeof a.vnode.key!=`symbol`,`MenuItem`,`MenuItem \`:key="${String(s)}"\` not support Symbol type`);let c=`menu_item_${++Gx}_$$_${s}`,{parentEventKeys:l,parentKeys:u}=zx(),{prefixCls:d,activeKeys:f,disabled:p,changeActiveKeys:m,rtl:h,inlineCollapsed:g,siderCollapsed:_,onItemClick:v,selectedKeys:y,registerMenuInfo:b,unRegisterMenuInfo:x}=Dx(),S=Nx(),C=q(!1),w=J(()=>[...u.value,s]);b(c,{eventKey:c,key:s,parentEventKeys:l,parentKeys:u,isLeaf:!0}),ut(()=>{x(c)}),G(f,()=>{C.value=!!f.value.find(e=>e===s)},{immediate:!0});let T=J(()=>p.value||e.disabled),E=J(()=>y.value.includes(s)),D=J(()=>{let t=`${d.value}-item`;return{[`${t}`]:!0,[`${t}-danger`]:e.danger,[`${t}-active`]:C.value,[`${t}-selected`]:E.value,[`${t}-disabled`]:T.value}}),O=t=>({key:s,eventKey:c,keyPath:w.value,eventKeyPath:[...l.value,c],domEvent:t,item:Z(Z({},e),i)}),k=e=>{if(T.value)return;let t=O(e);r(`click`,e),v(t)},A=e=>{T.value||(m(w.value),r(`mouseenter`,e))},j=e=>{T.value||(m([]),r(`mouseleave`,e))},M=e=>{if(r(`keydown`,e),e.which===$.ENTER){let t=O(e);r(`click`,e),v(t)}},N=e=>{m(w.value),r(`focus`,e)},P=(e,t)=>{let n=U(`span`,{class:`${d.value}-title-content`},[t]);return(!e||Nt(t)&&t.type===`span`)&&t&&g.value&&S&&typeof t==`string`?U(`div`,{class:`${d.value}-inline-collapsed-noicon`},[t.charAt(0)]):n},F=Wx(J(()=>w.value.length));return()=>{if(o)return null;let t=e.title??n.title?.call(n),r=ce(n.default?.call(n)),a=r.length,c=t;t===void 0?c=S&&a?r:``:t===!1&&(c=``);let l={title:c};!_.value&&!g.value&&(l.title=null,l.open=!1);let u={};e.role===`option`&&(u[`aria-selected`]=E.value);let f=e.icon??n.icon?.call(n,e);return U(Ty,Y(Y({},l),{},{placement:h.value?`left`:`right`,overlayClassName:`${d.value}-inline-collapsed-tooltip`}),{default:()=>[U(ed.Item,Y(Y(Y({component:`li`},i),{},{id:e.id,style:Z(Z({},i.style||{}),F.value),class:[D.value,{[`${i.class}`]:!!i.class,[`${d.value}-item-only-child`]:(f?a+1:a)===1}],role:e.role||`menuitem`,tabindex:e.disabled?null:-1,"data-menu-id":s,"aria-disabled":e.disabled},u),{},{onMouseenter:A,onMouseleave:j,onClick:k,onKeydown:M,onFocus:N,title:typeof t==`string`?t:void 0}),{default:()=>[ao(typeof f==`function`?f(e.originItemValue):f,{class:`${d.value}-item-icon`},!1),P(f,r)]})]})}}}),qx={adjustX:1,adjustY:1},Jx={topLeft:{points:[`bl`,`tl`],overflow:qx,offset:[0,-7]},bottomLeft:{points:[`tl`,`bl`],overflow:qx,offset:[0,7]},leftTop:{points:[`tr`,`tl`],overflow:qx,offset:[-4,0]},rightTop:{points:[`tl`,`tr`],overflow:qx,offset:[4,0]}},Yx={topLeft:{points:[`bl`,`tl`],overflow:qx,offset:[0,-7]},bottomLeft:{points:[`tl`,`bl`],overflow:qx,offset:[0,7]},rightTop:{points:[`tr`,`tl`],overflow:qx,offset:[-4,0]},leftTop:{points:[`tl`,`tr`],overflow:qx,offset:[4,0]}},Xx={horizontal:`bottomLeft`,vertical:`rightTop`,"vertical-left":`rightTop`,"vertical-right":`leftTop`},Zx=u({compatConfig:{MODE:3},name:`PopupTrigger`,inheritAttrs:!1,props:{prefixCls:String,mode:String,visible:Boolean,popupClassName:String,popupOffset:Array,disabled:Boolean,onVisibleChange:Function},slots:Object,emits:[`visibleChange`],setup(e,t){let{slots:n,emit:r}=t,i=q(!1),{getPopupContainer:a,rtl:o,subMenuOpenDelay:s,subMenuCloseDelay:c,builtinPlacements:l,triggerSubMenuAction:u,forceSubMenuRender:d,motion:f,defaultMotions:p,rootClassName:m}=Dx(),h=Ax(),g=J(()=>o.value?Z(Z({},Yx),l.value):Z(Z({},Jx),l.value)),_=J(()=>Xx[e.mode]),v=q();G(()=>e.visible,e=>{ir.cancel(v.value),v.value=ir(()=>{i.value=e})},{immediate:!0}),ut(()=>{ir.cancel(v.value)});let y=e=>{r(`visibleChange`,e)},b=J(()=>{let t=f.value||p.value?.[e.mode]||p.value?.other,n=typeof t==`function`?t():t;return n?ge(n.name,{css:!0}):void 0});return()=>{let{prefixCls:t,popupClassName:r,mode:l,popupOffset:f,disabled:p}=e;return U(Su,{prefixCls:t,popupClassName:K(`${t}-popup`,{[`${t}-rtl`]:o.value},r,m.value),stretch:l===`horizontal`?`minWidth`:null,getPopupContainer:a.value,builtinPlacements:g.value,popupPlacement:_.value,popupVisible:i.value,popupAlign:f&&{offset:f},action:p?[]:[u.value],mouseEnterDelay:s.value,mouseLeaveDelay:c.value,onPopupVisibleChange:y,forceRender:h||d.value,popupAnimation:b.value},{popup:n.popup,default:n.default})}}}),Qx=(e,t)=>{let{slots:n,attrs:r}=t,{prefixCls:i,mode:a}=Dx();return U(`ul`,Y(Y({},r),{},{class:K(i.value,`${i.value}-sub`,`${i.value}-${a.value===`inline`?`inline`:`vertical`}`),"data-menu-list":!0}),[n.default?.call(n)])};Qx.displayName=`SubMenuList`;var $x=u({compatConfig:{MODE:3},name:`InlineSubMenuList`,inheritAttrs:!1,props:{id:String,open:Boolean,keyPath:Array},setup(e,t){let{slots:n}=t,r=J(()=>`inline`),{motion:i,mode:a,defaultMotions:o}=Dx(),s=J(()=>a.value===r.value),c=H(!s.value),l=J(()=>s.value?e.open:!1);G(a,()=>{s.value&&(c.value=!1)},{flush:`post`});let u=J(()=>{let t=i.value||o.value?.[r.value]||o.value?.other;return Z(Z({},typeof t==`function`?t():t),{appear:e.keyPath.length<=1})});return()=>c.value?null:U(Px,{mode:r.value},{default:()=>[U(Re,u.value,{default:()=>[Mt(U(Qx,{id:e.id},{default:()=>[n.default?.call(n)]}),[[ht,l.value]])]})]})}}),eS=0,tS=u({compatConfig:{MODE:3},name:`ASubMenu`,inheritAttrs:!1,props:{icon:f.any,title:f.any,disabled:Boolean,level:Number,popupClassName:String,popupOffset:Array,internalPopupClose:Boolean,eventKey:String,expandIcon:Function,theme:String,onMouseenter:Function,onMouseleave:Function,onTitleClick:Function,originItemValue:Qt()},slots:Object,setup(e,t){let{slots:n,attrs:r,emit:i}=t;var a;Mx(!1);let o=Ux(),s=Zt(),c=typeof s.vnode.key==`symbol`?String(s.vnode.key):s.vnode.key;pi(typeof s.vnode.key!=`symbol`,`SubMenu`,`SubMenu \`:key="${String(c)}"\` not support Symbol type`);let l=Oe(c)?c:`sub_menu_${++eS}_$$_not_set_key`,u=e.eventKey??(Oe(c)?`sub_menu_${++eS}_$$_${c}`:l),{parentEventKeys:d,parentInfo:f,parentKeys:p}=zx(),m=J(()=>[...p.value,l]),h={eventKey:u,key:l,parentEventKeys:d,childrenEventKeys:q([]),parentKeys:p};(a=f.childrenEventKeys)==null||a.value.push(u),ut(()=>{f.childrenEventKeys&&(f.childrenEventKeys.value=f.childrenEventKeys?.value.filter(e=>e!=u))}),Bx(u,l,h);let{prefixCls:g,activeKeys:_,disabled:v,changeActiveKeys:y,mode:b,inlineCollapsed:x,openKeys:S,overflowDisabled:C,onOpenChange:w,registerMenuInfo:T,unRegisterMenuInfo:E,selectedSubMenuKeys:D,expandIcon:O,theme:k}=Dx(),A=c!=null,j=!o&&(Ax()||!A);kx(j),(o&&A||!o&&!A||j)&&(T(u,h),ut(()=>{E(u)}));let M=J(()=>`${g.value}-submenu`),N=J(()=>v.value||e.disabled),P=q(),F=q(),I=J(()=>S.value.includes(l)),L=J(()=>!C.value&&I.value),ee=J(()=>D.value.includes(l)),te=q(!1);G(_,()=>{te.value=!!_.value.find(e=>e===l)},{immediate:!0});let ne=e=>{N.value||(i(`titleClick`,e,l),b.value===`inline`&&w(l,!I.value))},R=e=>{N.value||(y(m.value),i(`mouseenter`,e))},re=e=>{N.value||(y([]),i(`mouseleave`,e))},ie=Wx(J(()=>m.value.length)),ae=e=>{b.value!==`inline`&&w(l,e)},oe=()=>{y(m.value)},z=u&&`${u}-popup`,se=J(()=>K(g.value,`${g.value}-${e.theme||k.value}`,e.popupClassName)),B=(t,n)=>{if(!n)return x.value&&!p.value.length&&t&&typeof t==`string`?U(`div`,{class:`${g.value}-inline-collapsed-noicon`},[t.charAt(0)]):U(`span`,{class:`${g.value}-title-content`},[t]);let r=Nt(t)&&t.type===`span`;return U($e,null,[ao(typeof n==`function`?n(e.originItemValue):n,{class:`${g.value}-item-icon`},!1),r?t:U(`span`,{class:`${g.value}-title-content`},[t])])},V=J(()=>b.value!==`inline`&&m.value.length>1?`vertical`:b.value),ce=J(()=>b.value===`horizontal`?`vertical`:b.value),le=J(()=>V.value===`horizontal`?`vertical`:V.value),H=()=>{let t=M.value,r=e.icon??n.icon?.call(n,e),i=e.expandIcon||n.expandIcon||O.value,a=B(on(n,e,`title`),r);return U(`div`,{style:ie.value,class:`${t}-title`,tabindex:N.value?null:-1,ref:P,title:typeof a==`string`?a:null,"data-menu-id":l,"aria-expanded":L.value,"aria-haspopup":!0,"aria-controls":z,"aria-disabled":N.value,onClick:ne,onFocus:oe},[a,b.value!==`horizontal`&&i?i(Z(Z({},e),{isOpen:L.value})):U(`i`,{class:`${t}-arrow`},null)])};return()=>{if(o)return A?n.default?.call(n):null;let t=M.value,i=()=>null;if(!C.value&&b.value!==`inline`){let r=b.value===`horizontal`?[0,8]:[10,0];i=()=>U(Zx,{mode:V.value,prefixCls:t,visible:!e.internalPopupClose&&L.value,popupClassName:se.value,popupOffset:e.popupOffset||r,disabled:N.value,onVisibleChange:ae},{default:()=>[H()],popup:()=>U(Px,{mode:le.value},{default:()=>[U(Qx,{id:z,ref:F},{default:n.default})]})})}else i=()=>U(Zx,null,{default:H});return U(Px,{mode:ce.value},{default:()=>[U(ed.Item,Y(Y({component:`li`},r),{},{role:`none`,class:K(t,`${t}-${b.value}`,r.class,{[`${t}-open`]:L.value,[`${t}-active`]:te.value,[`${t}-selected`]:ee.value,[`${t}-disabled`]:N.value}),onMouseenter:R,onMouseleave:re,"data-submenu-id":l}),{default:()=>U($e,null,[i(),!C.value&&U($x,{id:z,open:L.value,keyPath:m.value},{default:n.default})])})]})}}});function nS(e,t){return e.classList?e.classList.contains(t):` ${e.className} `.indexOf(` ${t} `)>-1}function rS(e,t){e.classList?e.classList.add(t):nS(e,t)||(e.className=`${e.className} ${t}`)}function iS(e,t){e.classList?e.classList.remove(t):nS(e,t)&&(e.className=` ${e.className} `.replace(` ${t} `,` `))}var aS=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`ant-motion-collapse`;return{name:e,appear:arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,css:!0,onBeforeEnter:t=>{t.style.height=`0px`,t.style.opacity=`0`,rS(t,e)},onEnter:e=>{z(()=>{e.style.height=`${e.scrollHeight}px`,e.style.opacity=`1`})},onAfterEnter:t=>{t&&(iS(t,e),t.style.height=null,t.style.opacity=null)},onBeforeLeave:t=>{rS(t,e),t.style.height=`${t.offsetHeight}px`,t.style.opacity=null},onLeave:e=>{setTimeout(()=>{e.style.height=`0px`,e.style.opacity=`0`})},onAfterLeave:t=>{t&&(iS(t,e),t.style&&(t.style.height=null,t.style.opacity=null))}}},oS=u({compatConfig:{MODE:3},name:`AMenuItemGroup`,inheritAttrs:!1,props:{title:f.any,originItemValue:Qt()},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i}=Dx(),a=J(()=>`${i.value}-item-group`),o=Ux();return()=>o?n.default?.call(n):U(`li`,Y(Y({},r),{},{onClick:e=>e.stopPropagation(),class:a.value}),[U(`div`,{title:typeof e.title==`string`?e.title:void 0,class:`${a.value}-title`},[on(n,e,`title`)]),U(`ul`,{class:`${a.value}-list`},[n.default?.call(n)])])}}),sS=u({compatConfig:{MODE:3},name:`AMenuDivider`,props:{prefixCls:String,dashed:Boolean},setup(e){let{prefixCls:t}=Dx(),n=J(()=>({[`${t.value}-item-divider`]:!0,[`${t.value}-item-divider-dashed`]:!!e.dashed}));return()=>U(`li`,{class:n.value},null)}}),cS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{if(e&&typeof e==`object`){let i=e,{label:a,children:o,key:s,type:c}=i,l=cS(i,[`label`,`children`,`key`,`type`]),u=s??`tmp-${r}`,d=n?n.parentKeys.slice():[],f=[],p={eventKey:u,key:u,parentEventKeys:H(d),parentKeys:H(d),childrenEventKeys:H(f),isLeaf:!1};if(o||c===`group`){if(c===`group`){let r=lS(o,t,n);return U(oS,Y(Y({key:u},l),{},{title:a,originItemValue:e}),{default:()=>[r]})}t.set(u,p),n&&n.childrenEventKeys.push(u);let r=lS(o,t,{childrenEventKeys:f,parentKeys:[].concat(d,u)});return U(tS,Y(Y({key:u},l),{},{title:a,originItemValue:e}),{default:()=>[r]})}return c===`divider`?U(sS,Y({key:u},l),null):(p.isLeaf=!0,t.set(u,p),U(Kx,Y(Y({key:u},l),{},{originItemValue:e}),{default:()=>[a]}))}return null}).filter(e=>e)}function uS(e){let t=q([]),n=q(!1),r=q(new Map);return G(()=>e.items,()=>{let i=new Map;n.value=!1,e.items?(n.value=!0,t.value=lS(e.items,i)):t.value=void 0,r.value=i},{immediate:!0,deep:!0}),{itemsNodes:t,store:r,hasItmes:n}}var dS=e=>{let{componentCls:t,motionDurationSlow:n,menuHorizontalHeight:r,colorSplit:i,lineWidth:a,lineType:o,menuItemPaddingInline:s}=e;return{[`${t}-horizontal`]:{lineHeight:`${r}px`,border:0,borderBottom:`${a}px ${o} ${i}`,boxShadow:`none`,"&::after":{display:`block`,clear:`both`,height:0,content:`"\\20"`},[`${t}-item, ${t}-submenu`]:{position:`relative`,display:`inline-block`,verticalAlign:`bottom`,paddingInline:s},[`> ${t}-item:hover, + > ${t}-item-active, + > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:`transparent`},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${n}`,`background ${n}`].join(`,`)},[`${t}-submenu-arrow`]:{display:`none`}}}},fS=e=>{let{componentCls:t,menuArrowOffset:n}=e;return{[`${t}-rtl`]:{direction:`rtl`},[`${t}-submenu-rtl`]:{transformOrigin:`100% 0`},[`${t}-rtl${t}-vertical, + ${t}-submenu-rtl ${t}-vertical`]:{[`${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${n})`},"&::after":{transform:`rotate(45deg) translateY(${n})`}}}}},pS=e=>Z({},I(e)),mS=(e,t)=>{let{componentCls:n,colorItemText:r,colorItemTextSelected:i,colorGroupTitle:a,colorItemBg:o,colorSubItemBg:s,colorItemBgSelected:c,colorActiveBarHeight:l,colorActiveBarWidth:u,colorActiveBarBorderSize:d,motionDurationSlow:f,motionEaseInOut:p,motionEaseOut:m,menuItemPaddingInline:h,motionDurationMid:g,colorItemTextHover:_,lineType:v,colorSplit:y,colorItemTextDisabled:b,colorDangerItemText:x,colorDangerItemTextHover:S,colorDangerItemTextSelected:C,colorDangerItemBgActive:w,colorDangerItemBgSelected:T,colorItemBgHover:E,menuSubMenuBg:D,colorItemTextSelectedHorizontal:O,colorItemBgSelectedHorizontal:k}=e;return{[`${n}-${t}`]:{color:r,background:o,[`&${n}-root:focus-visible`]:Z({},pS(e)),[`${n}-item-group-title`]:{color:a},[`${n}-submenu-selected`]:{[`> ${n}-submenu-title`]:{color:i}},[`${n}-item-disabled, ${n}-submenu-disabled`]:{color:`${b} !important`},[`${n}-item:hover, ${n}-submenu-title:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:_}},[`&:not(${n}-horizontal)`]:{[`${n}-item:not(${n}-item-selected)`]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:c}},[`${n}-submenu-title`]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:c}}},[`${n}-item-danger`]:{color:x,[`&${n}-item:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:S}},[`&${n}-item:active`]:{background:w}},[`${n}-item a`]:{"&, &:hover":{color:`inherit`}},[`${n}-item-selected`]:{color:i,[`&${n}-item-danger`]:{color:C},"a, a:hover":{color:`inherit`}},[`& ${n}-item-selected`]:{backgroundColor:c,[`&${n}-item-danger`]:{backgroundColor:T}},[`${n}-item, ${n}-submenu-title`]:{[`&:not(${n}-item-disabled):focus-visible`]:Z({},pS(e))},[`&${n}-submenu > ${n}`]:{backgroundColor:D},[`&${n}-popup > ${n}`]:{backgroundColor:o},[`&${n}-horizontal`]:Z(Z({},t===`dark`?{borderBottom:0}:{}),{[`> ${n}-item, > ${n}-submenu`]:{top:d,marginTop:-d,marginBottom:0,borderRadius:0,"&::after":{position:`absolute`,insetInline:h,bottom:0,borderBottom:`${l}px solid transparent`,transition:`border-color ${f} ${p}`,content:`""`},"&:hover, &-active, &-open":{"&::after":{borderBottomWidth:l,borderBottomColor:O}},"&-selected":{color:O,backgroundColor:k,"&::after":{borderBottomWidth:l,borderBottomColor:O}}}}),[`&${n}-root`]:{[`&${n}-inline, &${n}-vertical`]:{borderInlineEnd:`${d}px ${v} ${y}`}},[`&${n}-inline`]:{[`${n}-sub${n}-inline`]:{background:s},[`${n}-item, ${n}-submenu-title`]:d&&u?{width:`calc(100% + ${d}px)`}:{},[`${n}-item`]:{position:`relative`,"&::after":{position:`absolute`,insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${u}px solid ${i}`,transform:`scaleY(0.0001)`,opacity:0,transition:[`transform ${g} ${m}`,`opacity ${g} ${m}`].join(`,`),content:`""`},[`&${n}-item-danger`]:{"&::after":{borderInlineEndColor:C}}},[`${n}-selected, ${n}-item-selected`]:{"&::after":{transform:`scaleY(1)`,opacity:1,transition:[`transform ${g} ${p}`,`opacity ${g} ${p}`].join(`,`)}}}}}},hS=e=>{let{componentCls:t,menuItemHeight:n,itemMarginInline:r,padding:i,menuArrowSize:a,marginXS:o,marginXXS:s}=e,c=i+a+o;return{[`${t}-item`]:{position:`relative`},[`${t}-item, ${t}-submenu-title`]:{height:n,lineHeight:`${n}px`,paddingInline:i,overflow:`hidden`,textOverflow:`ellipsis`,marginInline:r,marginBlock:s,width:`calc(100% - ${r*2}px)`},[`${t}-submenu`]:{paddingBottom:.02},[`> ${t}-item, + > ${t}-submenu > ${t}-submenu-title`]:{height:n,lineHeight:`${n}px`},[`${t}-item-group-list ${t}-submenu-title, + ${t}-submenu-title`]:{paddingInlineEnd:c}}},gS=e=>{let{componentCls:t,iconCls:n,menuItemHeight:r,colorTextLightSolid:i,dropdownWidth:a,controlHeightLG:o,motionDurationMid:s,motionEaseOut:c,paddingXL:l,fontSizeSM:u,fontSizeLG:d,motionDurationSlow:f,paddingXS:p,boxShadowSecondary:m}=e,h={height:r,lineHeight:`${r}px`,listStylePosition:`inside`,listStyleType:`disc`};return[{[t]:{"&-inline, &-vertical":Z({[`&${t}-root`]:{boxShadow:`none`}},hS(e))},[`${t}-submenu-popup`]:{[`${t}-vertical`]:Z(Z({},hS(e)),{boxShadow:m})}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:a,maxHeight:`calc(100vh - ${o*2.5}px)`,padding:`0`,overflow:`hidden`,borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:`hidden`,overflowY:`auto`}}},{[`${t}-inline`]:{width:`100%`,[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:`flex`,alignItems:`center`,transition:[`border-color ${f}`,`background ${f}`,`padding ${s} ${c}`].join(`,`),[`> ${t}-title-content`]:{flex:`auto`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`},"> *":{flex:`none`}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:`none`,[`& > ${t}-submenu > ${t}-submenu-title`]:h,[`& ${t}-item-group-title`]:{paddingInlineStart:l}},[`${t}-item`]:h}},{[`${t}-inline-collapsed`]:{width:r*2,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:d,textAlign:`center`}}},[`> ${t}-item, + > ${t}-item-group > ${t}-item-group-list > ${t}-item, + > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title, + > ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${u}px)`,textOverflow:`clip`,[` + ${t}-submenu-arrow, + ${t}-submenu-expand-icon + `]:{opacity:0},[`${t}-item-icon, ${n}`]:{margin:0,fontSize:d,lineHeight:`${r}px`,"+ span":{display:`inline-block`,opacity:0}}},[`${t}-item-icon, ${n}`]:{display:`inline-block`},"&-tooltip":{pointerEvents:`none`,[`${t}-item-icon, ${n}`]:{display:`none`},"a, a:hover":{color:i}},[`${t}-item-group-title`]:Z(Z({},xe),{paddingInline:p})}}]},_S=e=>{let{componentCls:t,fontSize:n,motionDurationSlow:r,motionDurationMid:i,motionEaseInOut:a,motionEaseOut:s,iconCls:c,controlHeightSM:l}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:`relative`,display:`block`,margin:0,whiteSpace:`nowrap`,cursor:`pointer`,transition:[`border-color ${r}`,`background ${r}`,`padding ${r} ${a}`].join(`,`),[`${t}-item-icon, ${c}`]:{minWidth:n,fontSize:n,transition:[`font-size ${i} ${s}`,`margin ${r} ${a}`,`color ${r}`].join(`,`),"+ span":{marginInlineStart:l-n,opacity:1,transition:[`opacity ${r} ${a}`,`margin ${r}`,`color ${r}`].join(`,`)}},[`${t}-item-icon`]:Z({},o()),[`&${t}-item-only-child`]:{[`> ${c}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:`none !important`,cursor:`not-allowed`,"&::after":{borderColor:`transparent !important`},a:{color:`inherit !important`},[`> ${t}-submenu-title`]:{color:`inherit !important`,cursor:`not-allowed`}}}},vS=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:r,borderRadius:i,menuArrowSize:a,menuArrowOffset:o}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:`absolute`,top:`50%`,insetInlineEnd:e.margin,width:a,color:`currentcolor`,transform:`translateY(-50%)`,transition:`transform ${n} ${r}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:`absolute`,width:a*.6,height:a*.15,backgroundColor:`currentcolor`,borderRadius:i,transition:[`background ${n} ${r}`,`transform ${n} ${r}`,`top ${n} ${r}`,`color ${n} ${r}`].join(`,`),content:`""`},"&::before":{transform:`rotate(45deg) translateY(-${o})`},"&::after":{transform:`rotate(-45deg) translateY(${o})`}}}}},yS=e=>{let{antCls:t,componentCls:n,fontSize:r,motionDurationSlow:i,motionDurationMid:a,motionEaseInOut:o,lineHeight:s,paddingXS:c,padding:l,colorSplit:u,lineWidth:d,zIndexPopup:f,borderRadiusLG:p,radiusSubMenuItem:m,menuArrowSize:h,menuArrowOffset:g,lineType:_,menuPanelMaskInset:v}=e;return[{"":{[`${n}`]:Z(Z({},D()),{"&-hidden":{display:`none`}})},[`${n}-submenu-hidden`]:{display:`none`}},{[n]:Z(Z(Z(Z(Z(Z(Z({},rn(e)),D()),{marginBottom:0,paddingInlineStart:0,fontSize:r,lineHeight:0,listStyle:`none`,outline:`none`,transition:`width ${i} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:`none`},"&-overflow":{display:`flex`,[`${n}-item`]:{flex:`none`}},[`${n}-item, ${n}-submenu, ${n}-submenu-title`]:{borderRadius:e.radiusItem},[`${n}-item-group-title`]:{padding:`${c}px ${l}px`,fontSize:r,lineHeight:s,transition:`all ${i}`},[`&-horizontal ${n}-submenu`]:{transition:[`border-color ${i} ${o}`,`background ${i} ${o}`].join(`,`)},[`${n}-submenu, ${n}-submenu-inline`]:{transition:[`border-color ${i} ${o}`,`background ${i} ${o}`,`padding ${a} ${o}`].join(`,`)},[`${n}-submenu ${n}-sub`]:{cursor:`initial`,transition:[`background ${i} ${o}`,`padding ${i} ${o}`].join(`,`)},[`${n}-title-content`]:{transition:`color ${i}`},[`${n}-item a`]:{"&::before":{position:`absolute`,inset:0,backgroundColor:`transparent`,content:`""`}},[`${n}-item-divider`]:{overflow:`hidden`,lineHeight:0,borderColor:u,borderStyle:_,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:`dashed`}}}),_S(e)),{[`${n}-item-group`]:{[`${n}-item-group-list`]:{margin:0,padding:0,[`${n}-item, ${n}-submenu-title`]:{paddingInline:`${r*2}px ${l}px`}}},"&-submenu":{"&-popup":{position:`absolute`,zIndex:f,background:`transparent`,borderRadius:p,boxShadow:`none`,transformOrigin:`0 0`,"&::before":{position:`absolute`,inset:`${v}px 0 0`,zIndex:-1,width:`100%`,height:`100%`,opacity:0,content:`""`}},"&-placement-rightTop::before":{top:0,insetInlineStart:v},[`> ${n}`]:Z(Z(Z({borderRadius:p},_S(e)),vS(e)),{[`${n}-item, ${n}-submenu > ${n}-submenu-title`]:{borderRadius:m},[`${n}-submenu-title::after`]:{transition:`transform ${i} ${o}`}})}}),vS(e)),{[`&-inline-collapsed ${n}-submenu-arrow, + &-inline ${n}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${g})`},"&::after":{transform:`rotate(45deg) translateX(-${g})`}},[`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]:{transform:`translateY(-${h*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${g})`},"&::before":{transform:`rotate(45deg) translateX(${g})`}}})},{[`${t}-layout-header`]:{[n]:{lineHeight:`inherit`}}}]},bS=((e,t)=>v(`Menu`,(e,n)=>{let{overrideComponentToken:r}=n;if(t?.value===!1)return[];let{colorBgElevated:i,colorPrimary:a,colorError:o,colorErrorHover:s,colorTextLightSolid:c}=e,{controlHeightLG:l,fontSize:u}=e,d=u/7*5,f=B(e,{menuItemHeight:l,menuItemPaddingInline:e.margin,menuArrowSize:d,menuHorizontalHeight:l*1.15,menuArrowOffset:`${d*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:i}),p=new we(c).setAlpha(.65).toRgbString(),m=B(f,{colorItemText:p,colorItemTextHover:c,colorGroupTitle:p,colorItemTextSelected:c,colorItemBg:`#001529`,colorSubItemBg:`#000c17`,colorItemBgActive:`transparent`,colorItemBgSelected:a,colorActiveBarWidth:0,colorActiveBarHeight:0,colorActiveBarBorderSize:0,colorItemTextDisabled:new we(c).setAlpha(.25).toRgbString(),colorDangerItemText:o,colorDangerItemTextHover:s,colorDangerItemTextSelected:c,colorDangerItemBgActive:o,colorDangerItemBgSelected:o,menuSubMenuBg:`#001529`,colorItemTextSelectedHorizontal:c,colorItemBgSelectedHorizontal:a},Z({},r));return[yS(f),dS(f),gS(f),mS(f,`light`),mS(m,`dark`),fS(f),$_(f),R_(f,`slide-up`),R_(f,`slide-down`),Q_(f,`zoom-big`)]},e=>{let{colorPrimary:t,colorError:n,colorTextDisabled:r,colorErrorBg:i,colorText:a,colorTextDescription:o,colorBgContainer:s,colorFillAlter:c,colorFillContent:l,lineWidth:u,lineWidthBold:d,controlItemBgActive:f,colorBgTextHover:p}=e;return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,colorItemText:a,colorItemTextHover:a,colorItemTextHoverHorizontal:t,colorGroupTitle:o,colorItemTextSelected:t,colorItemTextSelectedHorizontal:t,colorItemBg:s,colorItemBgHover:p,colorItemBgActive:l,colorSubItemBg:c,colorItemBgSelected:f,colorItemBgSelectedHorizontal:`transparent`,colorActiveBarWidth:0,colorActiveBarHeight:d,colorActiveBarBorderSize:u,colorItemTextDisabled:r,colorDangerItemText:n,colorDangerItemTextHover:n,colorDangerItemTextSelected:n,colorDangerItemBgActive:i,colorDangerItemBgSelected:i,itemMarginInline:e.marginXXS}})(e)),xS=()=>({id:String,prefixCls:String,items:Array,disabled:Boolean,inlineCollapsed:Boolean,disabledOverflow:Boolean,forceSubMenuRender:Boolean,openKeys:Array,selectedKeys:Array,activeKey:String,selectable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},tabindex:{type:[Number,String]},motion:Object,role:String,theme:{type:String,default:`light`},mode:{type:String,default:`vertical`},inlineIndent:{type:Number,default:24},subMenuOpenDelay:{type:Number,default:0},subMenuCloseDelay:{type:Number,default:.1},builtinPlacements:{type:Object},triggerSubMenuAction:{type:String,default:`hover`},getPopupContainer:Function,expandIcon:Function,onOpenChange:Function,onSelect:Function,onDeselect:Function,onClick:[Function,Array],onFocus:Function,onBlur:Function,onMousedown:Function,"onUpdate:openKeys":Function,"onUpdate:selectedKeys":Function,"onUpdate:activeKey":Function}),SS=[],CS=u({compatConfig:{MODE:3},name:`AMenu`,inheritAttrs:!1,props:xS(),slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t,{direction:a,getPrefixCls:o}=X(`menu`,e),s=vx(),c=J(()=>o(`menu`,e.prefixCls||s?.prefixCls?.value)),[l,u]=bS(c,J(()=>!s)),d=q(new Map),f=g(Fx,H(void 0)),p=J(()=>f.value===void 0?e.inlineCollapsed:f.value),{itemsNodes:m}=uS(e),h=q(!1);V(()=>{h.value=!0}),S(()=>{pi(!(e.inlineCollapsed===!0&&e.mode!==`inline`),`Menu`,"`inlineCollapsed` should only be used when `mode` is inline."),pi(!(f.value!==void 0&&e.inlineCollapsed===!0),`Menu`,"`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.")});let _=H([]),v=H([]),y=H({});G(d,()=>{let e={};for(let t of d.value.values())e[t.key]=t;y.value=e},{flush:`post`}),S(()=>{if(e.activeKey!==void 0){let t=[],n=e.activeKey?y.value[e.activeKey]:void 0;t=n&&e.activeKey!==void 0?s_([].concat(ze(n.parentKeys),e.activeKey)):[],wx(_.value,t)||(_.value=t)}}),G(()=>e.selectedKeys,e=>{e&&(v.value=e.slice())},{immediate:!0,deep:!0});let b=H([]);G([y,v],()=>{let e=[];v.value.forEach(t=>{let n=y.value[t];n&&(e=e.concat(ze(n.parentKeys)))}),e=s_(e),wx(b.value,e)||(b.value=e)},{immediate:!0});let x=t=>{if(e.selectable){let{key:n}=t,i=v.value.includes(n),a;a=e.multiple?i?v.value.filter(e=>e!==n):[...v.value,n]:[n];let o=Z(Z({},t),{selectedKeys:a});wx(a,v.value)||(e.selectedKeys===void 0&&(v.value=a),r(`update:selectedKeys`,a),i&&e.multiple?r(`deselect`,o):r(`select`,o))}O.value!==`inline`&&!e.multiple&&C.value.length&&j(SS)},C=H([]);G(()=>e.openKeys,function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C.value;wx(C.value,e)||(C.value=e.slice())},{immediate:!0,deep:!0});let w,T=t=>{clearTimeout(w),w=setTimeout(()=>{e.activeKey===void 0&&(_.value=t),r(`update:activeKey`,t[t.length-1])})},E=J(()=>!!e.disabled),D=J(()=>a.value===`rtl`),O=H(`vertical`),k=q(!1);S(()=>{(e.mode===`inline`||e.mode===`vertical`)&&p.value?(O.value=`vertical`,k.value=p.value):(O.value=e.mode,k.value=!1),s?.mode?.value&&(O.value=s.mode.value)});let A=J(()=>O.value===`inline`),j=e=>{C.value=e,r(`update:openKeys`,e),r(`openChange`,e)},M=H(C.value),N=q(!1);G(C,()=>{A.value&&(M.value=C.value)},{immediate:!0}),G(A,()=>{if(!N.value){N.value=!0;return}A.value?C.value=M.value:j(SS)},{immediate:!0});let P=J(()=>({[`${c.value}`]:!0,[`${c.value}-root`]:!0,[`${c.value}-${O.value}`]:!0,[`${c.value}-inline-collapsed`]:k.value,[`${c.value}-rtl`]:D.value,[`${c.value}-${e.theme}`]:!0})),F=J(()=>o()),I=J(()=>({horizontal:{name:`${F.value}-slide-up`},inline:aS(`${F.value}-motion-collapse`),other:{name:`${F.value}-zoom-big`}}));Mx(!0);let L=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[],n=d.value;return e.forEach(e=>{let{key:r,childrenEventKeys:i}=n.get(e);t.push(r,...L(ze(i)))}),t},ee=e=>{var t;r(`click`,e),x(e),(t=s?.onClick)==null||t.call(s)},te=(e,t)=>{let n=y.value[e]?.childrenEventKeys||[],r=C.value.filter(t=>t!==e);if(t)r.push(e);else if(O.value!==`inline`){let e=L(ze(n));r=s_(r.filter(t=>!e.includes(t)))}wx(C,r)||j(r)},ne=(e,t)=>{d.value.set(e,t),d.value=new Map(d.value)},R=e=>{d.value.delete(e),d.value=new Map(d.value)},re=H(0),ie=J(()=>e.expandIcon||n.expandIcon||s?.expandIcon?.value?t=>{let r=e.expandIcon||n.expandIcon;return r=typeof r==`function`?r(t):r,ao(r,{class:`${c.value}-submenu-expand-icon`},!1)}:null);Ex({prefixCls:c,activeKeys:_,openKeys:C,selectedKeys:v,changeActiveKeys:T,disabled:E,rtl:D,mode:O,inlineIndent:J(()=>e.inlineIndent),subMenuCloseDelay:J(()=>e.subMenuCloseDelay),subMenuOpenDelay:J(()=>e.subMenuOpenDelay),builtinPlacements:J(()=>e.builtinPlacements),triggerSubMenuAction:J(()=>e.triggerSubMenuAction),getPopupContainer:J(()=>e.getPopupContainer),inlineCollapsed:k,theme:J(()=>e.theme),siderCollapsed:f,defaultMotions:J(()=>h.value?I.value:null),motion:J(()=>h.value?e.motion:null),overflowDisabled:q(void 0),onOpenChange:te,onItemClick:ee,registerMenuInfo:ne,unRegisterMenuInfo:R,selectedSubMenuKeys:b,expandIcon:ie,forceSubMenuRender:J(()=>e.forceSubMenuRender),rootClassName:u});let ae=()=>m.value||ce(n.default?.call(n));return()=>{let t=ae(),r=re.value>=t.length-1||O.value!==`horizontal`||e.disabledOverflow,a=t=>O.value!==`horizontal`||e.disabledOverflow?t:t.map((e,t)=>U(Px,{key:e.key,overflowDisabled:t>re.value},{default:()=>e})),o=n.overflowedIndicator?.call(n)||U(ax,null,null);return l(U(ed,Y(Y({},i),{},{onMousedown:e.onMousedown,prefixCls:`${c.value}-overflow`,component:`ul`,itemComponent:Kx,class:[P.value,i.class,u.value],role:`menu`,id:e.id,data:a(t),renderRawItem:e=>e,renderRawRest:e=>{let n=e.length,i=n?t.slice(-n):null;return U($e,null,[U(tS,{eventKey:Lx,key:Lx,title:o,disabled:r,internalPopupClose:n===0},{default:()=>i}),U(Hx,null,{default:()=>[U(tS,{eventKey:Lx,key:Lx,title:o,disabled:r,internalPopupClose:n===0},{default:()=>i})]})])},maxCount:O.value!==`horizontal`||e.disabledOverflow?ed.INVALIDATE:ed.RESPONSIVE,ssr:`full`,"data-menu-list":!0,onVisibleChange:e=>{re.value=e}}),{default:()=>[U(kt,{to:`body`},{default:()=>[U(`div`,{style:{display:`none`},"aria-hidden":!0},[U(Hx,null,{default:()=>[a(ae())]})])]})]}))}}});CS.install=function(e){return e.component(CS.name,CS),e.component(Kx.name,Kx),e.component(tS.name,tS),e.component(sS.name,sS),e.component(oS.name,oS),e},CS.Item=Kx,CS.Divider=sS,CS.SubMenu=tS,CS.ItemGroup=oS;var wS=CS,TS=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:Z(Z({},rn(e)),{color:e.breadcrumbBaseColor,fontSize:e.breadcrumbFontSize,[n]:{fontSize:e.breadcrumbIconFontSize},ol:{display:`flex`,flexWrap:`wrap`,margin:0,padding:0,listStyle:`none`},a:Z({color:e.breadcrumbLinkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:`inline-block`,marginInline:-e.marginXXS,"&:hover":{color:e.breadcrumbLinkColorHover,backgroundColor:e.colorBgTextHover}},de(e)),"li:last-child":{color:e.breadcrumbLastItemColor,[`& > ${t}-separator`]:{display:`none`}},[`${t}-separator`]:{marginInline:e.breadcrumbSeparatorMargin,color:e.breadcrumbSeparatorColor},[`${t}-link`]:{[` + > ${n} + span, + > ${n} + a + `]:{marginInlineStart:e.marginXXS}},[`${t}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:`inline-block`,padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${n}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.breadcrumbLinkColorHover,backgroundColor:e.colorBgTextHover,a:{color:e.breadcrumbLinkColorHover}},a:{"&:hover":{backgroundColor:`transparent`}}},[`&${e.componentCls}-rtl`]:{direction:`rtl`}})}},ES=v(`Breadcrumb`,e=>[TS(B(e,{breadcrumbBaseColor:e.colorTextDescription,breadcrumbFontSize:e.fontSize,breadcrumbIconFontSize:e.fontSize,breadcrumbLinkColor:e.colorTextDescription,breadcrumbLinkColorHover:e.colorText,breadcrumbLastItemColor:e.colorText,breadcrumbSeparatorMargin:e.marginXS,breadcrumbSeparatorColor:e.colorTextDescription}))]),DS=()=>({prefixCls:String,routes:{type:Array},params:f.any,separator:f.any,itemRender:{type:Function}});function OS(e,t){if(!e.breadcrumbName)return null;let n=Object.keys(t).join(`|`);return e.breadcrumbName.replace(RegExp(`:(${n})`,`g`),(e,n)=>t[n]||e)}function kS(e){let{route:t,params:n,routes:r,paths:i}=e,a=r.indexOf(t)===r.length-1,o=OS(t,n);return a?U(`span`,null,[o]):U(`a`,{href:`#/${i.join(`/`)}`},[o])}var AS=u({compatConfig:{MODE:3},name:`ABreadcrumb`,inheritAttrs:!1,props:DS(),slots:Object,setup(t,n){let{slots:r,attrs:i}=n,{prefixCls:a,direction:o}=X(`breadcrumb`,t),[s,c]=ES(a),l=(e,t)=>(e=(e||``).replace(/^\//,``),Object.keys(t).forEach(n=>{e=e.replace(`:${n}`,t[n])}),e),u=(e,t,n)=>{let r=[...e],i=l(t||``,n);return i&&r.push(i),r},d=e=>{let{routes:t=[],params:n={},separator:r,itemRender:i=kS}=e,a=[];return t.map(e=>{let o=l(e.path,n);o&&a.push(o);let s=[...a],c=null;e.children&&e.children.length&&(c=U(wS,{items:e.children.map(e=>({key:e.path||e.breadcrumbName,label:i({route:e,params:n,routes:t,paths:u(s,e.path,n)})}))},null));let d={separator:r};return c&&(d.overlay=c),U(Sx,Y(Y({},d),{},{key:o||e.breadcrumbName}),{default:()=>[i({route:e,params:n,routes:t,paths:s})]})})};return()=>{let n,{routes:l,params:u={}}=t,f=ce(on(r,t)),p=on(r,t,`separator`)??`/`,m=t.itemRender||r.itemRender||kS;l&&l.length>0?n=d({routes:l,params:u,separator:p,itemRender:m}):f.length&&(n=f.map((t,n)=>(e(typeof t.type==`object`&&(t.type.__ANT_BREADCRUMB_ITEM||t.type.__ANT_BREADCRUMB_SEPARATOR),`Breadcrumb`,`Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children`),it(t,{separator:p,key:n}))));let h={[a.value]:!0,[`${a.value}-rtl`]:o.value===`rtl`,[`${i.class}`]:!!i.class,[c.value]:!0};return s(U(`nav`,Y(Y({},i),{},{class:h}),[U(`ol`,null,[n])]))}}}),jS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{separator:e,class:t}=r,a=jS(r,[`separator`,`class`]),o=ce(n.default?.call(n));return U(`span`,Y({class:[`${i.value}-separator`,t]},a),[o.length>0?o:`/`])}}});AS.Item=Sx,AS.Separator=MS,AS.install=function(e){return e.component(AS.name,AS),e.component(Sx.name,Sx),e.component(MS.name,MS),e};var NS=AS,PS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e){(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekday=r()})(e,(function(){return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,n=this.$W,r=(n{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localeData=r()})(e,(function(){return function(e,t,n){var r=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,t,n,r,a){var o=e.name?e:e.$locale(),s=i(o[t]),c=i(o[n]),l=s||c.map((function(e){return e.slice(0,r)}));if(!a)return l;var u=o.weekStart;return l.map((function(e,t){return l[(t+(u||0))%7]}))},o=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}(e.formats[t.toUpperCase()])},c=function(){var e=this;return{months:function(t){return t?t.format(`MMMM`):a(e,`months`)},monthsShort:function(t){return t?t.format(`MMM`):a(e,`monthsShort`,`months`,3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format(`dddd`):a(e,`weekdays`)},weekdaysMin:function(t){return t?t.format(`dd`):a(e,`weekdaysMin`,`weekdays`,2)},weekdaysShort:function(t){return t?t.format(`ddd`):a(e,`weekdaysShort`,`weekdays`,3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return a(o(),`months`)},n.monthsShort=function(){return a(o(),`monthsShort`,`months`,3)},n.weekdays=function(e){return a(o(),`weekdays`,null,null,e)},n.weekdaysShort=function(e){return a(o(),`weekdaysShort`,`weekdays`,3,e)},n.weekdaysMin=function(e){return a(o(),`weekdaysMin`,`weekdays`,2,e)}}}))})),LS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekOfYear=r()})(e,(function(){var e=`week`,t=`year`;return function(n,r,i){var a=r.prototype;a.week=function(n){if(n===void 0&&(n=null),n!==null)return this.add(7*(n-this.week()),`day`);var r=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var a=i(this).startOf(t).add(1,t).date(r),o=i(this).endOf(e);if(a.isBefore(o))return 1}var s=i(this).startOf(t).date(r).startOf(e).subtract(1,`millisecond`),c=this.diff(s,e,!0);return c<0?i(this).startOf(`week`).week():Math.ceil(c)},a.weeks=function(e){return e===void 0&&(e=null),this.week(e)}}}))})),RS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekYear=r()})(e,(function(){return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return t===1&&e===11?n+1:e===0&&t>=52?n-1:n}}}))})),zS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_quarterOfYear=r()})(e,(function(){var e=`month`,t=`quarter`;return function(n,r){var i=r.prototype;i.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var a=i.add;i.add=function(n,r){return n=Number(n),this.$utils().p(r)===t?this.add(3*n,e):a.bind(this)(n,r)};var o=i.startOf;i.startOf=function(n,r){var i=this.$utils(),a=!!i.u(r)||r;if(i.p(n)===t){var s=this.quarter()-1;return a?this.month(3*s).startOf(e).startOf(`day`):this.month(3*s+2).endOf(e).endOf(`day`)}return o.bind(this)(n,r)}}}))})),BS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),VS=vn(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),HS=xn(PS()),US=xn(FS()),WS=xn(IS()),GS=xn(LS()),KS=xn(RS()),qS=xn(zS()),JS=xn(BS()),YS=xn(VS());HS.default.extend(YS.default),HS.default.extend(JS.default),HS.default.extend(US.default),HS.default.extend(WS.default),HS.default.extend(GS.default),HS.default.extend(KS.default),HS.default.extend(qS.default),HS.default.extend((e,t)=>{let n=t.prototype,r=n.format;n.format=function(e){let t=(e||``).replace(`Wo`,`wo`);return r.bind(this)(t)}});var XS={bn_BD:`bn-bd`,by_BY:`be`,en_GB:`en-gb`,en_US:`en`,fr_BE:`fr`,fr_CA:`fr-ca`,hy_AM:`hy-am`,kmr_IQ:`ku`,nl_BE:`nl-be`,pt_BR:`pt-br`,zh_CN:`zh-cn`,zh_HK:`zh-hk`,zh_TW:`zh-tw`},ZS=e=>XS[e]||e.split(`_`)[0],QS=()=>{xr(!1,`Not match any format. Please help to fire a issue about this.`)},$S=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|k{1,2}|S/g;function eC(e,t,n){let r=[...new Set(e.split(n))],i=0;for(let e=0;et)return a;i+=n.length}}var tC=(e,t)=>{if(!e)return null;if(HS.default.isDayjs(e))return e;let n=t.matchAll($S),r=(0,HS.default)(e,t);if(n===null)return r;for(let t of n){let n=t[0],i=t.index;if(n===`Q`){let t=eC(e,i,e.slice(i-1,i)).match(/\d+/)[0];r=r.quarter(parseInt(t))}if(n.toLowerCase()===`wo`){let t=eC(e,i,e.slice(i-1,i)).match(/\d+/)[0];r=r.week(parseInt(t))}n.toLowerCase()===`ww`&&(r=r.week(parseInt(e.slice(i,i+n.length)))),n.toLowerCase()===`w`&&(r=r.week(parseInt(e.slice(i,i+n.length+1))))}return r},nC={getNow:()=>(0,HS.default)(),getFixedDate:e=>(0,HS.default)(e,[`YYYY-M-DD`,`YYYY-MM-DD`]),getEndDate:e=>e.endOf(`month`),getWeekDay:e=>{let t=e.locale(`en`);return t.weekday()+t.localeData().firstDayOfWeek()},getYear:e=>e.year(),getMonth:e=>e.month(),getDate:e=>e.date(),getHour:e=>e.hour(),getMinute:e=>e.minute(),getSecond:e=>e.second(),addYear:(e,t)=>e.add(t,`year`),addMonth:(e,t)=>e.add(t,`month`),addDate:(e,t)=>e.add(t,`day`),setYear:(e,t)=>e.year(t),setMonth:(e,t)=>e.month(t),setDate:(e,t)=>e.date(t),setHour:(e,t)=>e.hour(t),setMinute:(e,t)=>e.minute(t),setSecond:(e,t)=>e.second(t),isAfter:(e,t)=>e.isAfter(t),isValidate:e=>e.isValid(),locale:{getWeekFirstDay:e=>(0,HS.default)().locale(ZS(e)).localeData().firstDayOfWeek(),getWeekFirstDate:(e,t)=>t.locale(ZS(e)).weekday(0),getWeek:(e,t)=>t.locale(ZS(e)).week(),getShortWeekDays:e=>(0,HS.default)().locale(ZS(e)).localeData().weekdaysMin(),getShortMonths:e=>(0,HS.default)().locale(ZS(e)).localeData().monthsShort(),format:(e,t,n)=>t.locale(ZS(e)).format(n),parse:(e,t,n)=>{let r=ZS(e);for(let e=0;eArray.isArray(e)?e.map(e=>tC(e,t)):tC(e,t),toString:(e,t)=>Array.isArray(e)?e.map(e=>HS.default.isDayjs(e)?e.format(t):e):HS.default.isDayjs(e)?e.format(t):e};function rC(e){let t=ye();return Z(Z({},e),t)}var iC=Symbol(`PanelContextProps`),aC=e=>{fe(iC,e)},oC=()=>g(iC,{}),sC={visibility:`hidden`};function cC(e,t){let{slots:n}=t,{prefixCls:r,prevIcon:i=`‹`,nextIcon:a=`›`,superPrevIcon:o=`«`,superNextIcon:s=`»`,onSuperPrev:c,onSuperNext:l,onPrev:u,onNext:d}=rC(e),{hideNextBtn:f,hidePrevBtn:p}=oC();return U(`div`,{class:r},[c&&U(`button`,{type:`button`,onClick:c,tabindex:-1,class:`${r}-super-prev-btn`,style:p.value?sC:{}},[o]),u&&U(`button`,{type:`button`,onClick:u,tabindex:-1,class:`${r}-prev-btn`,style:p.value?sC:{}},[i]),U(`div`,{class:`${r}-view`},[n.default?.call(n)]),d&&U(`button`,{type:`button`,onClick:d,tabindex:-1,class:`${r}-next-btn`,style:f.value?sC:{}},[a]),l&&U(`button`,{type:`button`,onClick:l,tabindex:-1,class:`${r}-super-next-btn`,style:f.value?sC:{}},[s])])}cC.displayName=`Header`,cC.inheritAttrs=!1;function lC(e){let t=rC(e),{prefixCls:n,generateConfig:r,viewDate:i,onPrevDecades:a,onNextDecades:o}=t,{hideHeader:s}=oC();if(s)return null;let c=`${n}-header`,l=r.getYear(i),u=Math.floor(l/100)*100,d=u+100-1;return U(cC,Y(Y({},t),{},{prefixCls:c,onSuperPrev:a,onSuperNext:o}),{default:()=>[u,en(`-`),d]})}lC.displayName=`DecadeHeader`,lC.inheritAttrs=!1;function uC(e,t,n,r,i){let a=e.setHour(t,n);return a=e.setMinute(a,r),a=e.setSecond(a,i),a}function dC(e,t,n){if(!n)return t;let r=t;return r=e.setHour(r,e.getHour(n)),r=e.setMinute(r,e.getMinute(n)),r=e.setSecond(r,e.getSecond(n)),r}function fC(e,t,n,r,i,a){let o=Math.floor(e/r)*r;if(o{e.stopPropagation(),x||r(g)},onMouseenter:()=>{!x&&_&&_(g)},onMouseleave:()=>{!x&&v&&v(g)}},[f?f(g):U(`div`,{class:`${b}-inner`},[d(g)])]))}x.push(U(`tr`,{key:e,class:c&&c(a)},[t]))}return U(`div`,{class:`${t}-body`},[U(`table`,{class:`${t}-content`},[g&&U(`thead`,null,[U(`tr`,null,[g])]),U(`tbody`,null,[x])])])}mC.displayName=`PanelBody`,mC.inheritAttrs=!1;var hC=4;function gC(e){let t=rC(e),{prefixCls:n,viewDate:r,generateConfig:i}=t,a=`${n}-cell`,o=i.getYear(r),s=Math.floor(o/10)*10,c=Math.floor(o/100)*100,l=c+100-1,u=i.setYear(r,c-Math.ceil((3*hC*10-100)/2));return U(mC,Y(Y({},t),{},{rowNum:hC,colNum:3,baseDate:u,getCellText:e=>{let t=i.getYear(e);return`${t}-${t+9}`},getCellClassName:e=>{let t=i.getYear(e),n=t+9;return{[`${a}-in-view`]:c<=t&&n<=l,[`${a}-selected`]:t===s}},getCellDate:(e,t)=>i.addYear(e,t*10)}),null)}gC.displayName=`DecadeBody`,gC.inheritAttrs=!1;var _C=new Map;function vC(e,t){let n;function r(){fo(e)?t():n=ir(()=>{r()})}return r(),()=>{ir.cancel(n)}}function yC(e,t,n){if(_C.get(e)&&ir.cancel(_C.get(e)),n<=0){_C.set(e,ir(()=>{e.scrollTop=t}));return}let r=(t-e.scrollTop)/n*10;_C.set(e,ir(()=>{e.scrollTop+=r,e.scrollTop!==t&&yC(e,t,n-10)}))}function bC(e,t){let{onLeftRight:n,onCtrlLeftRight:r,onUpDown:i,onPageUpDown:a,onEnter:o}=t,{which:s,ctrlKey:c,metaKey:l}=e;switch(s){case $.LEFT:if(c||l){if(r)return r(-1),!0}else if(n)return n(-1),!0;break;case $.RIGHT:if(c||l){if(r)return r(1),!0}else if(n)return n(1),!0;break;case $.UP:if(i)return i(-1),!0;break;case $.DOWN:if(i)return i(1),!0;break;case $.PAGE_UP:if(a)return a(-1),!0;break;case $.PAGE_DOWN:if(a)return a(1),!0;break;case $.ENTER:if(o)return o(),!0;break}return!1}function xC(e,t,n,r){let i=e;if(!i)switch(t){case`time`:i=r?`hh:mm:ss a`:`HH:mm:ss`;break;case`week`:i=`gggg-wo`;break;case`month`:i=`YYYY-MM`;break;case`quarter`:i=`YYYY-[Q]Q`;break;case`year`:i=`YYYY`;break;default:i=n?`YYYY-MM-DD HH:mm:ss`:`YYYY-MM-DD`}return i}function SC(e,t,n){let r=e===`time`?8:10,i=typeof t==`function`?t(n.getNow()).length:t.length;return Math.max(r,i)+2}var CC=null,wC=new Set;function TC(e){return!CC&&typeof window<`u`&&window.addEventListener&&(CC=e=>{[...wC].forEach(t=>{t(e)})},window.addEventListener(`mousedown`,CC)),wC.add(e),()=>{wC.delete(e),wC.size===0&&(window.removeEventListener(`mousedown`,CC),CC=null)}}function EC(e){let t=e.target;return e.composed&&t.shadowRoot&&e.composedPath?.call(e)[0]||t}var DC={year:e=>e===`month`||e===`date`?`year`:e,month:e=>e===`date`?`month`:e,quarter:e=>e===`month`||e===`date`?`quarter`:e,week:e=>e===`date`?`week`:e,time:null,date:null};function OC(e,t){return e.some(e=>e&&e.contains(t))}function kC(e){let t=rC(e),{prefixCls:n,onViewDateChange:r,generateConfig:i,viewDate:a,operationRef:o,onSelect:s,onPanelChange:c}=t,l=`${n}-decade-panel`;o.value={onKeydown:e=>bC(e,{onLeftRight:e=>{s(i.addYear(a,e*10),`key`)},onCtrlLeftRight:e=>{s(i.addYear(a,e*100),`key`)},onUpDown:e=>{s(i.addYear(a,e*10*3),`key`)},onEnter:()=>{c(`year`,a)}})};let u=e=>{let t=i.addYear(a,e*100);r(t),c(null,t)};return U(`div`,{class:l},[U(lC,Y(Y({},t),{},{prefixCls:n,onPrevDecades:()=>{u(-1)},onNextDecades:()=>{u(1)}}),null),U(gC,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{s(e,`mouse`),c(`year`,e)}}),null)])}kC.displayName=`DecadePanel`,kC.inheritAttrs=!1;function AC(e,t){if(!e&&!t)return!0;if(!e||!t)return!1}function jC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:Math.floor(e.getYear(t)/10)===Math.floor(e.getYear(n)/10)}function MC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:e.getYear(t)===e.getYear(n)}function NC(e,t){return Math.floor(e.getMonth(t)/3)+1}function PC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:MC(e,t,n)&&NC(e,t)===NC(e,n)}function FC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:MC(e,t,n)&&e.getMonth(t)===e.getMonth(n)}function IC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:e.getYear(t)===e.getYear(n)&&e.getMonth(t)===e.getMonth(n)&&e.getDate(t)===e.getDate(n)}function LC(e,t,n){let r=AC(t,n);return typeof r==`boolean`?r:e.getHour(t)===e.getHour(n)&&e.getMinute(t)===e.getMinute(n)&&e.getSecond(t)===e.getSecond(n)}function RC(e,t,n,r){let i=AC(n,r);return typeof i==`boolean`?i:e.locale.getWeek(t,n)===e.locale.getWeek(t,r)}function zC(e,t,n){return IC(e,t,n)&&LC(e,t,n)}function BC(e,t,n,r){return!t||!n||!r?!1:!IC(e,t,r)&&!IC(e,n,r)&&e.isAfter(r,t)&&e.isAfter(n,r)}function VC(e,t,n){let r=t.locale.getWeekFirstDay(e),i=t.setDate(n,1),a=t.getWeekDay(i),o=t.addDate(i,r-a);return t.getMonth(o)===t.getMonth(n)&&t.getDate(o)>1&&(o=t.addDate(o,-7)),o}function HC(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(t){case`year`:return n.addYear(e,r*10);case`quarter`:case`month`:return n.addYear(e,r);default:return n.addMonth(e,r)}}function UC(e,t){let{generateConfig:n,locale:r,format:i}=t;return typeof i==`function`?i(e):n.locale.format(r.locale,e,i)}function WC(e,t){let{generateConfig:n,locale:r,formatList:i}=t;return!e||typeof i[0]==`function`?null:n.locale.parse(r.locale,e,i)}function GC(e){let{cellDate:t,mode:n,disabledDate:r,generateConfig:i}=e;if(!r)return!1;let a=(e,n,a)=>{let o=n;for(;o<=a;){let n;switch(e){case`date`:if(n=i.setDate(t,o),!r(n))return!1;break;case`month`:if(n=i.setMonth(t,o),!GC({cellDate:n,mode:`month`,generateConfig:i,disabledDate:r}))return!1;break;case`year`:if(n=i.setYear(t,o),!GC({cellDate:n,mode:`year`,generateConfig:i,disabledDate:r}))return!1;break}o+=1}return!0};switch(n){case`date`:case`week`:return r(t);case`month`:return a(`date`,1,i.getDate(i.getEndDate(t)));case`quarter`:{let e=Math.floor(i.getMonth(t)/3)*3;return a(`month`,e,e+2)}case`year`:return a(`month`,0,11);case`decade`:{let e=i.getYear(t),n=Math.floor(e/10)*10;return a(`year`,n,n+10-1)}}}function KC(e){let t=rC(e),{hideHeader:n}=oC();if(n.value)return null;let{prefixCls:r,generateConfig:i,locale:a,value:o,format:s}=t;return U(cC,{prefixCls:`${r}-header`},{default:()=>[o?UC(o,{locale:a,format:s,generateConfig:i}):`\xA0`]})}KC.displayName=`TimeHeader`,KC.inheritAttrs=!1;var qC=u({name:`TimeUnitColumn`,props:[`prefixCls`,`units`,`onSelect`,`value`,`active`,`hideDisabledOptions`],setup(e){let{open:t}=oC(),n=q(null),r=H(new Map),i=H();return G(()=>e.value,()=>{let i=r.value.get(e.value);i&&t.value!==!1&&yC(n.value,i.offsetTop,120)}),ut(()=>{var e;(e=i.value)==null||e.call(i)}),G(t,()=>{var a;(a=i.value)==null||a.call(i),z(()=>{if(t.value){let t=r.value.get(e.value);t&&(i.value=vC(t,()=>{yC(n.value,t.offsetTop,0)}))}})},{immediate:!0,flush:`post`}),()=>{let{prefixCls:t,units:i,onSelect:a,value:o,active:s,hideDisabledOptions:c}=e,l=`${t}-cell`;return U(`ul`,{class:K(`${t}-column`,{[`${t}-column-active`]:s}),ref:n,style:{position:`relative`}},[i.map(e=>c&&e.disabled?null:U(`li`,{key:e.value,ref:t=>{r.value.set(e.value,t)},class:K(l,{[`${l}-disabled`]:e.disabled,[`${l}-selected`]:o===e.value}),onClick:()=>{e.disabled||a(e.value)}},[U(`div`,{class:`${l}-inner`},[e.label])]))])}}});function JC(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`0`,r=String(e);for(;r.length{(n.startsWith(`data-`)||n.startsWith(`aria-`)||n===`role`||n===`name`)&&!n.startsWith(`data-__`)&&(t[n]=e[n])}),t}function QC(e,t){return e?e[t]:null}function $C(e,t,n){let r=[QC(e,0),QC(e,1)];return r[n]=typeof t==`function`?t(r[n]):t,!r[0]&&!r[1]?null:r}function ew(e,t,n,r){let i=[];for(let a=e;a<=t;a+=n)i.push({label:JC(a,2),value:a,disabled:(r||[]).includes(a)});return i}var tw=u({compatConfig:{MODE:3},name:`TimeBody`,inheritAttrs:!1,props:[`generateConfig`,`prefixCls`,`operationRef`,`activeColumnIndex`,`value`,`showHour`,`showMinute`,`showSecond`,`use12Hours`,`hourStep`,`minuteStep`,`secondStep`,`disabledHours`,`disabledMinutes`,`disabledSeconds`,`disabledTime`,`hideDisabledOptions`,`onSelect`],setup(e){let t=J(()=>e.value?e.generateConfig.getHour(e.value):-1),n=J(()=>e.use12Hours?t.value>=12:!1),r=J(()=>e.use12Hours?t.value%12:t.value),i=J(()=>e.value?e.generateConfig.getMinute(e.value):-1),a=J(()=>e.value?e.generateConfig.getSecond(e.value):-1),o=H(e.generateConfig.getNow()),s=H(),c=H(),l=H();ne(()=>{o.value=e.generateConfig.getNow()}),S(()=>{if(e.disabledTime){let t=e.disabledTime(o);[s.value,c.value,l.value]=[t.disabledHours,t.disabledMinutes,t.disabledSeconds]}else[s.value,c.value,l.value]=[e.disabledHours,e.disabledMinutes,e.disabledSeconds]});let u=(t,n,r,i)=>{let a=e.value||e.generateConfig.getNow(),o=Math.max(0,n),s=Math.max(0,r),c=Math.max(0,i);return a=uC(e.generateConfig,a,!e.use12Hours||!t?o:o+12,s,c),a},d=J(()=>ew(0,23,e.hourStep??1,s.value&&s.value())),f=J(()=>{if(!e.use12Hours)return[!1,!1];let t=[!0,!0];return d.value.forEach(e=>{let{disabled:n,value:r}=e;n||(r>=12?t[1]=!1:t[0]=!1)}),t}),p=J(()=>e.use12Hours?d.value.filter(n.value?e=>e.value>=12:e=>e.value<12).map(e=>{let t=e.value%12,n=t===0?`12`:JC(t,2);return Z(Z({},e),{label:n,value:t})}):d.value),m=J(()=>ew(0,59,e.minuteStep??1,c.value&&c.value(t.value))),h=J(()=>ew(0,59,e.secondStep??1,l.value&&l.value(t.value,i.value)));return()=>{let{prefixCls:t,operationRef:o,activeColumnIndex:s,showHour:c,showMinute:l,showSecond:d,use12Hours:g,hideDisabledOptions:_,onSelect:v}=e,y=[],b=`${t}-content`,x=`${t}-time-panel`;o.value={onUpDown:e=>{let t=y[s];if(t){let n=t.units.findIndex(e=>e.value===t.value),r=t.units.length;for(let i=1;i{v(u(n.value,e,i.value,a.value),`mouse`)}),S(l,U(qC,{key:`minute`},null),i.value,m.value,e=>{v(u(n.value,r.value,e,a.value),`mouse`)}),S(d,U(qC,{key:`second`},null),a.value,h.value,e=>{v(u(n.value,r.value,i.value,e),`mouse`)});let C=-1;return typeof n.value==`boolean`&&(C=+!!n.value),S(g===!0,U(qC,{key:`12hours`},null),C,[{label:`AM`,value:0,disabled:f.value[0]},{label:`PM`,value:1,disabled:f.value[1]}],e=>{v(u(!!e,r.value,i.value,a.value),`mouse`)}),U(`div`,{class:b},[y.map(e=>{let{node:t}=e;return t})])}}}),nw=e=>e.filter(e=>e!==!1).length;function rw(e){let t=rC(e),{generateConfig:n,format:r=`HH:mm:ss`,prefixCls:i,active:a,operationRef:o,showHour:s,showMinute:c,showSecond:l,use12Hours:u=!1,onSelect:d,value:f}=t,p=`${i}-time-panel`,m=H(),h=H(-1),g=nw([s,c,l,u]);return o.value={onKeydown:e=>bC(e,{onLeftRight:e=>{h.value=(h.value+e+g)%g},onUpDown:e=>{h.value===-1?h.value=0:m.value&&m.value.onUpDown(e)},onEnter:()=>{d(f||n.getNow(),`key`),h.value=-1}}),onBlur:()=>{h.value=-1}},U(`div`,{class:K(p,{[`${p}-active`]:a})},[U(KC,Y(Y({},t),{},{format:r,prefixCls:i}),null),U(tw,Y(Y({},t),{},{prefixCls:i,activeColumnIndex:h.value,operationRef:m}),null)])}rw.displayName=`TimePanel`,rw.inheritAttrs=!1;function iw(e){let{cellPrefixCls:t,generateConfig:n,rangedValue:r,hoverRangedValue:i,isInView:a,isSameCell:o,offsetCell:s,today:c,value:l}=e;function u(e){let u=s(e,-1),d=s(e,1),f=QC(r,0),p=QC(r,1),m=QC(i,0),h=QC(i,1),g=BC(n,m,h,e);function _(e){return o(f,e)}function v(e){return o(p,e)}let y=o(m,e),b=o(h,e),x=(g||b)&&(!a(u)||v(u)),S=(g||y)&&(!a(d)||_(d));return{[`${t}-in-view`]:a(e),[`${t}-in-range`]:BC(n,f,p,e),[`${t}-range-start`]:_(e),[`${t}-range-end`]:v(e),[`${t}-range-start-single`]:_(e)&&!p,[`${t}-range-end-single`]:v(e)&&!f,[`${t}-range-start-near-hover`]:_(e)&&(o(u,m)||BC(n,m,h,u)),[`${t}-range-end-near-hover`]:v(e)&&(o(d,h)||BC(n,m,h,d)),[`${t}-range-hover`]:g,[`${t}-range-hover-start`]:y,[`${t}-range-hover-end`]:b,[`${t}-range-hover-edge-start`]:x,[`${t}-range-hover-edge-end`]:S,[`${t}-range-hover-edge-start-near-range`]:x&&o(u,p),[`${t}-range-hover-edge-end-near-range`]:S&&o(d,f),[`${t}-today`]:o(c,e),[`${t}-selected`]:o(l,e)}}return u}var aw=Symbol(`RangeContextProps`),ow=e=>{fe(aw,e)},sw=()=>g(aw,{rangedValue:H(),hoverRangedValue:H(),inRange:H(),panelPosition:H()}),cw=u({compatConfig:{MODE:3},name:`PanelContextProvider`,inheritAttrs:!1,props:{value:{type:Object,default:()=>({})}},setup(e,t){let{slots:n}=t,r={rangedValue:H(e.value.rangedValue),hoverRangedValue:H(e.value.hoverRangedValue),inRange:H(e.value.inRange),panelPosition:H(e.value.panelPosition)};return ow(r),G(()=>e.value,()=>{Object.keys(e.value).forEach(t=>{r[t]&&(r[t].value=e.value[t])})}),()=>n.default?.call(n)}});function lw(e){let t=rC(e),{prefixCls:n,generateConfig:r,prefixColumn:i,locale:a,rowCount:o,viewDate:s,value:c,dateRender:l}=t,{rangedValue:u,hoverRangedValue:d}=sw(),f=VC(a.locale,r,s),p=`${n}-cell`,m=r.locale.getWeekFirstDay(a.locale),h=r.getNow(),g=[],_=a.shortWeekDays||(r.locale.getShortWeekDays?r.locale.getShortWeekDays(a.locale):[]);i&&g.push(U(`th`,{key:`empty`,"aria-label":`empty cell`},null));for(let e=0;e<7;e+=1)g.push(U(`th`,{key:e},[_[(e+m)%7]]));let v=iw({cellPrefixCls:p,today:h,value:c,generateConfig:r,rangedValue:i?null:u.value,hoverRangedValue:i?null:d.value,isSameCell:(e,t)=>IC(r,e,t),isInView:e=>FC(r,e,s),offsetCell:(e,t)=>r.addDate(e,t)}),y=l?e=>l({current:e,today:h}):void 0;return U(mC,Y(Y({},t),{},{rowNum:o,colNum:7,baseDate:f,getCellNode:y,getCellText:r.getDate,getCellClassName:v,getCellDate:r.addDate,titleCell:e=>UC(e,{locale:a,format:`YYYY-MM-DD`,generateConfig:r}),headerCells:g}),null)}lw.displayName=`DateBody`,lw.inheritAttrs=!1,lw.props=[`prefixCls`,`generateConfig`,`value?`,`viewDate`,`locale`,`rowCount`,`onSelect`,`dateRender?`,`disabledDate?`,`prefixColumn?`,`rowClassName?`];function uw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,viewDate:a,onNextMonth:o,onPrevMonth:s,onNextYear:c,onPrevYear:l,onYearClick:u,onMonthClick:d}=t,{hideHeader:f}=oC();if(f.value)return null;let p=`${n}-header`,m=i.shortMonths||(r.locale.getShortMonths?r.locale.getShortMonths(i.locale):[]),h=r.getMonth(a),g=U(`button`,{type:`button`,key:`year`,onClick:u,tabindex:-1,class:`${n}-year-btn`},[UC(a,{locale:i,format:i.yearFormat,generateConfig:r})]),_=U(`button`,{type:`button`,key:`month`,onClick:d,tabindex:-1,class:`${n}-month-btn`},[i.monthFormat?UC(a,{locale:i,format:i.monthFormat,generateConfig:r}):m[h]]),v=i.monthBeforeYear?[_,g]:[g,_];return U(cC,Y(Y({},t),{},{prefixCls:p,onSuperPrev:l,onPrev:s,onNext:o,onSuperNext:c}),{default:()=>[v]})}uw.displayName=`DateHeader`,uw.inheritAttrs=!1;var dw=6;function fw(e){let t=rC(e),{prefixCls:n,panelName:r=`date`,keyboardConfig:i,active:a,operationRef:o,generateConfig:s,value:c,viewDate:l,onViewDateChange:u,onPanelChange:d,onSelect:f}=t,p=`${n}-${r}-panel`;o.value={onKeydown:e=>bC(e,Z({onLeftRight:e=>{f(s.addDate(c||l,e),`key`)},onCtrlLeftRight:e=>{f(s.addYear(c||l,e),`key`)},onUpDown:e=>{f(s.addDate(c||l,e*7),`key`)},onPageUpDown:e=>{f(s.addMonth(c||l,e),`key`)}},i))};let m=e=>{let t=s.addYear(l,e);u(t),d(null,t)},h=e=>{let t=s.addMonth(l,e);u(t),d(null,t)};return U(`div`,{class:K(p,{[`${p}-active`]:a})},[U(uw,Y(Y({},t),{},{prefixCls:n,value:c,viewDate:l,onPrevYear:()=>{m(-1)},onNextYear:()=>{m(1)},onPrevMonth:()=>{h(-1)},onNextMonth:()=>{h(1)},onMonthClick:()=>{d(`month`,l)},onYearClick:()=>{d(`year`,l)}}),null),U(lw,Y(Y({},t),{},{onSelect:e=>f(e,`mouse`),prefixCls:n,value:c,viewDate:l,rowCount:dw}),null)])}fw.displayName=`DatePanel`,fw.inheritAttrs=!1;var pw=YC(`date`,`time`);function mw(e){let t=rC(e),{prefixCls:n,operationRef:r,generateConfig:i,value:a,defaultValue:o,disabledTime:s,showTime:c,onSelect:l}=t,u=`${n}-datetime-panel`,d=H(null),f=H({}),p=H({}),m=typeof c==`object`?Z({},c):{};function h(e){return pw[pw.indexOf(d.value)+e]||null}let g=e=>{p.value.onBlur&&p.value.onBlur(e),d.value=null};r.value={onKeydown:e=>{if(e.which===$.TAB){let t=h(e.shiftKey?-1:1);return d.value=t,t&&e.preventDefault(),!0}if(d.value){let t=d.value===`date`?f:p;return t.value&&t.value.onKeydown&&t.value.onKeydown(e),!0}return[$.LEFT,$.RIGHT,$.UP,$.DOWN].includes(e.which)?(d.value=`date`,!0):!1},onBlur:g,onClose:g};let _=(e,t)=>{let n=e;t===`date`&&!a&&m.defaultValue?(n=i.setHour(n,i.getHour(m.defaultValue)),n=i.setMinute(n,i.getMinute(m.defaultValue)),n=i.setSecond(n,i.getSecond(m.defaultValue))):t===`time`&&!a&&o&&(n=i.setYear(n,i.getYear(o)),n=i.setMonth(n,i.getMonth(o)),n=i.setDate(n,i.getDate(o))),l&&l(n,`mouse`)},v=s?s(a||null):{};return U(`div`,{class:K(u,{[`${u}-active`]:d.value})},[U(fw,Y(Y({},t),{},{operationRef:f,active:d.value===`date`,onSelect:e=>{_(dC(i,e,!a&&typeof c==`object`?c.defaultValue:null),`date`)}}),null),U(rw,Y(Y(Y(Y({},t),{},{format:void 0},m),v),{},{disabledTime:null,defaultValue:void 0,operationRef:p,active:d.value===`time`,onSelect:e=>{_(e,`time`)}}),null)])}mw.displayName=`DatetimePanel`,mw.inheritAttrs=!1;function hw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,value:a}=t,o=`${n}-cell`,s=e=>U(`td`,{key:`week`,class:K(o,`${o}-week`)},[r.locale.getWeek(i.locale,e)]),c=`${n}-week-panel-row`;return U(fw,Y(Y({},t),{},{panelName:`week`,prefixColumn:s,rowClassName:e=>K(c,{[`${c}-selected`]:RC(r,i.locale,a,e)}),keyboardConfig:{onLeftRight:null}}),null)}hw.displayName=`WeekPanel`,hw.inheritAttrs=!1;function gw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,viewDate:a,onNextYear:o,onPrevYear:s,onYearClick:c}=t,{hideHeader:l}=oC();if(l.value)return null;let u=`${n}-header`;return U(cC,Y(Y({},t),{},{prefixCls:u,onSuperPrev:s,onSuperNext:o}),{default:()=>[U(`button`,{type:`button`,onClick:c,class:`${n}-year-btn`},[UC(a,{locale:i,format:i.yearFormat,generateConfig:r})])]})}gw.displayName=`MonthHeader`,gw.inheritAttrs=!1;var _w=4;function vw(e){let t=rC(e),{prefixCls:n,locale:r,value:i,viewDate:a,generateConfig:o,monthCellRender:s}=t,{rangedValue:c,hoverRangedValue:l}=sw(),u=iw({cellPrefixCls:`${n}-cell`,value:i,generateConfig:o,rangedValue:c.value,hoverRangedValue:l.value,isSameCell:(e,t)=>FC(o,e,t),isInView:()=>!0,offsetCell:(e,t)=>o.addMonth(e,t)}),d=r.shortMonths||(o.locale.getShortMonths?o.locale.getShortMonths(r.locale):[]),f=o.setMonth(a,0),p=s?e=>s({current:e,locale:r}):void 0;return U(mC,Y(Y({},t),{},{rowNum:_w,colNum:3,baseDate:f,getCellNode:p,getCellText:e=>r.monthFormat?UC(e,{locale:r,format:r.monthFormat,generateConfig:o}):d[o.getMonth(e)],getCellClassName:u,getCellDate:o.addMonth,titleCell:e=>UC(e,{locale:r,format:`YYYY-MM`,generateConfig:o})}),null)}vw.displayName=`MonthBody`,vw.inheritAttrs=!1;function yw(e){let t=rC(e),{prefixCls:n,operationRef:r,onViewDateChange:i,generateConfig:a,value:o,viewDate:s,onPanelChange:c,onSelect:l}=t,u=`${n}-month-panel`;r.value={onKeydown:e=>bC(e,{onLeftRight:e=>{l(a.addMonth(o||s,e),`key`)},onCtrlLeftRight:e=>{l(a.addYear(o||s,e),`key`)},onUpDown:e=>{l(a.addMonth(o||s,e*3),`key`)},onEnter:()=>{c(`date`,o||s)}})};let d=e=>{let t=a.addYear(s,e);i(t),c(null,t)};return U(`div`,{class:u},[U(gw,Y(Y({},t),{},{prefixCls:n,onPrevYear:()=>{d(-1)},onNextYear:()=>{d(1)},onYearClick:()=>{c(`year`,s)}}),null),U(vw,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{l(e,`mouse`),c(`date`,e)}}),null)])}yw.displayName=`MonthPanel`,yw.inheritAttrs=!1;function bw(e){let t=rC(e),{prefixCls:n,generateConfig:r,locale:i,viewDate:a,onNextYear:o,onPrevYear:s,onYearClick:c}=t,{hideHeader:l}=oC();if(l.value)return null;let u=`${n}-header`;return U(cC,Y(Y({},t),{},{prefixCls:u,onSuperPrev:s,onSuperNext:o}),{default:()=>[U(`button`,{type:`button`,onClick:c,class:`${n}-year-btn`},[UC(a,{locale:i,format:i.yearFormat,generateConfig:r})])]})}bw.displayName=`QuarterHeader`,bw.inheritAttrs=!1;var xw=1;function Sw(e){let t=rC(e),{prefixCls:n,locale:r,value:i,viewDate:a,generateConfig:o}=t,{rangedValue:s,hoverRangedValue:c}=sw(),l=iw({cellPrefixCls:`${n}-cell`,value:i,generateConfig:o,rangedValue:s.value,hoverRangedValue:c.value,isSameCell:(e,t)=>PC(o,e,t),isInView:()=>!0,offsetCell:(e,t)=>o.addMonth(e,t*3)}),u=o.setDate(o.setMonth(a,0),1);return U(mC,Y(Y({},t),{},{rowNum:xw,colNum:4,baseDate:u,getCellText:e=>UC(e,{locale:r,format:r.quarterFormat||`[Q]Q`,generateConfig:o}),getCellClassName:l,getCellDate:(e,t)=>o.addMonth(e,t*3),titleCell:e=>UC(e,{locale:r,format:`YYYY-[Q]Q`,generateConfig:o})}),null)}Sw.displayName=`QuarterBody`,Sw.inheritAttrs=!1;function Cw(e){let t=rC(e),{prefixCls:n,operationRef:r,onViewDateChange:i,generateConfig:a,value:o,viewDate:s,onPanelChange:c,onSelect:l}=t,u=`${n}-quarter-panel`;r.value={onKeydown:e=>bC(e,{onLeftRight:e=>{l(a.addMonth(o||s,e*3),`key`)},onCtrlLeftRight:e=>{l(a.addYear(o||s,e),`key`)},onUpDown:e=>{l(a.addYear(o||s,e),`key`)}})};let d=e=>{let t=a.addYear(s,e);i(t),c(null,t)};return U(`div`,{class:u},[U(bw,Y(Y({},t),{},{prefixCls:n,onPrevYear:()=>{d(-1)},onNextYear:()=>{d(1)},onYearClick:()=>{c(`year`,s)}}),null),U(Sw,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{l(e,`mouse`)}}),null)])}Cw.displayName=`QuarterPanel`,Cw.inheritAttrs=!1;function ww(e){let t=rC(e),{prefixCls:n,generateConfig:r,viewDate:i,onPrevDecade:a,onNextDecade:o,onDecadeClick:s}=t,{hideHeader:c}=oC();if(c.value)return null;let l=`${n}-header`,u=r.getYear(i),d=Math.floor(u/10)*10,f=d+10-1;return U(cC,Y(Y({},t),{},{prefixCls:l,onSuperPrev:a,onSuperNext:o}),{default:()=>[U(`button`,{type:`button`,onClick:s,class:`${n}-decade-btn`},[d,en(`-`),f])]})}ww.displayName=`YearHeader`,ww.inheritAttrs=!1;var Tw=4;function Ew(e){let t=rC(e),{prefixCls:n,value:r,viewDate:i,locale:a,generateConfig:o}=t,{rangedValue:s,hoverRangedValue:c}=sw(),l=`${n}-cell`,u=o.getYear(i),d=Math.floor(u/10)*10,f=d+10-1,p=o.setYear(i,d-Math.ceil((3*Tw-10)/2)),m=iw({cellPrefixCls:l,value:r,generateConfig:o,rangedValue:s.value,hoverRangedValue:c.value,isSameCell:(e,t)=>MC(o,e,t),isInView:e=>{let t=o.getYear(e);return d<=t&&t<=f},offsetCell:(e,t)=>o.addYear(e,t)});return U(mC,Y(Y({},t),{},{rowNum:Tw,colNum:3,baseDate:p,getCellText:o.getYear,getCellClassName:m,getCellDate:o.addYear,titleCell:e=>UC(e,{locale:a,format:`YYYY`,generateConfig:o})}),null)}Ew.displayName=`YearBody`,Ew.inheritAttrs=!1;function Dw(e){let t=rC(e),{prefixCls:n,operationRef:r,onViewDateChange:i,generateConfig:a,value:o,viewDate:s,sourceMode:c,onSelect:l,onPanelChange:u}=t,d=`${n}-year-panel`;r.value={onKeydown:e=>bC(e,{onLeftRight:e=>{l(a.addYear(o||s,e),`key`)},onCtrlLeftRight:e=>{l(a.addYear(o||s,e*10),`key`)},onUpDown:e=>{l(a.addYear(o||s,e*3),`key`)},onEnter:()=>{u(c===`date`?`date`:`month`,o||s)}})};let f=e=>{let t=a.addYear(s,e*10);i(t),u(null,t)};return U(`div`,{class:d},[U(ww,Y(Y({},t),{},{prefixCls:n,onPrevDecade:()=>{f(-1)},onNextDecade:()=>{f(1)},onDecadeClick:()=>{u(`decade`,s)}}),null),U(Ew,Y(Y({},t),{},{prefixCls:n,onSelect:e=>{u(c===`date`?`date`:`month`,e),l(e,`mouse`)}}),null)])}Dw.displayName=`YearPanel`,Dw.inheritAttrs=!1;function Ow(e,t,n){return n?U(`div`,{class:`${e}-footer-extra`},[n(t)]):null}function kw(e){let{prefixCls:t,components:n={},needConfirmButton:r,onNow:i,onOk:a,okDisabled:o,showNow:s,locale:c}=e,l,u;if(r){let e=n.button||`button`;i&&s!==!1&&(l=U(`li`,{class:`${t}-now`},[U(`a`,{class:`${t}-now-btn`,onClick:i},[c.now])])),u=r&&U(`li`,{class:`${t}-ok`},[U(e,{disabled:o,onClick:e=>{e.stopPropagation(),a&&a()}},{default:()=>[c.ok]})])}return!l&&!u?null:U(`ul`,{class:`${t}-ranges`},[l,u])}function Aw(){return u({name:`PickerPanel`,inheritAttrs:!1,props:{prefixCls:String,locale:Object,generateConfig:Object,value:Object,defaultValue:Object,pickerValue:Object,defaultPickerValue:Object,disabledDate:Function,mode:String,picker:{type:String,default:`date`},tabindex:{type:[Number,String],default:0},showNow:{type:Boolean,default:void 0},showTime:[Boolean,Object],showToday:Boolean,renderExtraFooter:Function,dateRender:Function,hideHeader:{type:Boolean,default:void 0},onSelect:Function,onChange:Function,onPanelChange:Function,onMousedown:Function,onPickerValueChange:Function,onOk:Function,components:Object,direction:String,hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1}},setup(e,t){let{attrs:n}=t,r=J(()=>e.picker===`date`&&!!e.showTime||e.picker===`time`),i=J(()=>24%e.hourStep==0),a=J(()=>60%e.minuteStep==0),o=J(()=>60%e.secondStep==0),s=oC(),{operationRef:c,onSelect:l,hideRanges:u,defaultOpenValue:d}=s,{inRange:f,panelPosition:p,rangedValue:m,hoverRangedValue:h}=sw(),g=H({}),[_,v]=df(null,{value:St(e,`value`),defaultValue:e.defaultValue,postState:t=>!t&&d?.value&&e.picker===`time`?d.value:t}),[y,b]=df(null,{value:St(e,`pickerValue`),defaultValue:e.defaultPickerValue||_.value,postState:t=>{let{generateConfig:n,showTime:r,defaultValue:i}=e,a=n.getNow();return t?!_.value&&e.showTime?typeof r==`object`?dC(n,Array.isArray(t)?t[0]:t,r.defaultValue||a):i?dC(n,Array.isArray(t)?t[0]:t,i):dC(n,Array.isArray(t)?t[0]:t,a):t:a}}),x=t=>{b(t),e.onPickerValueChange&&e.onPickerValueChange(t)},S=t=>{let n=DC[e.picker];return n?n(t):t},[C,w]=df(()=>e.picker===`time`?`time`:S(`date`),{value:St(e,`mode`)});G(()=>e.picker,()=>{w(e.picker)});let T=H(C.value),E=e=>{T.value=e},D=(t,n)=>{let{onPanelChange:r,generateConfig:i}=e,a=S(t||C.value);E(C.value),w(a),r&&(C.value!==a||zC(i,y.value,y.value))&&r(n,a)},O=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{picker:i,generateConfig:a,onSelect:o,onChange:s,disabledDate:c}=e;(C.value===i||r)&&(v(t),o&&o(t),l&&l(t,n),s&&!zC(a,t,_.value)&&!c?.(t)&&s(t))},k=e=>g.value&&g.value.onKeydown?([$.LEFT,$.RIGHT,$.UP,$.DOWN,$.PAGE_UP,$.PAGE_DOWN,$.ENTER].includes(e.which)&&e.preventDefault(),g.value.onKeydown(e)):!1,A=e=>{g.value&&g.value.onBlur&&g.value.onBlur(e)},j=()=>{let{generateConfig:t,hourStep:n,minuteStep:r,secondStep:s}=e,c=t.getNow(),l=fC(t.getHour(c),t.getMinute(c),t.getSecond(c),i.value?n:1,a.value?r:1,o.value?s:1),u=uC(t,c,l[0],l[1],l[2]);O(u,`submit`)},M=J(()=>{let{prefixCls:t,direction:n}=e;return K(`${t}-panel`,{[`${t}-panel-has-range`]:m&&m.value&&m.value[0]&&m.value[1],[`${t}-panel-has-range-hover`]:h&&h.value&&h.value[0]&&h.value[1],[`${t}-panel-rtl`]:n===`rtl`})});return aC(Z(Z({},s),{mode:C,hideHeader:J(()=>e.hideHeader===void 0?s.hideHeader?.value:e.hideHeader),hidePrevBtn:J(()=>f.value&&p.value===`right`),hideNextBtn:J(()=>f.value&&p.value===`left`)})),G(()=>e.value,()=>{e.value&&b(e.value)}),()=>{let{prefixCls:t=`ant-picker`,locale:i,generateConfig:a,disabledDate:o,picker:s=`date`,tabindex:l=0,showNow:d,showTime:f,showToday:m,renderExtraFooter:h,onMousedown:v,onOk:b,components:S}=e;c&&p.value!==`right`&&(c.value={onKeydown:k,onClose:()=>{g.value&&g.value.onClose&&g.value.onClose()}});let w,E=Z(Z(Z({},n),e),{operationRef:g,prefixCls:t,viewDate:y.value,value:_.value,onViewDateChange:x,sourceMode:T.value,onPanelChange:D,disabledDate:o});switch(delete E.onChange,delete E.onSelect,C.value){case`decade`:w=U(kC,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`year`:w=U(Dw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`month`:w=U(yw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`quarter`:w=U(Cw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`week`:w=U(hw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;case`time`:delete E.showTime,w=U(rw,Y(Y(Y({},E),typeof f==`object`?f:null),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null);break;default:w=U(f?mw:fw,Y(Y({},E),{},{onSelect:(e,t)=>{x(e),O(e,t)}}),null)}let N,P;u?.value||(N=Ow(t,C.value,h),P=kw({prefixCls:t,components:S,needConfirmButton:r.value,okDisabled:!_.value||o&&o(_.value),locale:i,showNow:d,onNow:r.value&&j,onOk:()=>{_.value&&(O(_.value,`submit`,!0),b&&b(_.value))}}));let F;if(m&&C.value===`date`&&s===`date`&&!f){let e=a.getNow(),n=`${t}-today-btn`,r=o&&o(e);F=U(`a`,{class:K(n,r&&`${n}-disabled`),"aria-disabled":r,onClick:()=>{r||O(e,`mouse`,!0)}},[i.today])}return U(`div`,{tabindex:l,class:K(M.value,n.class),style:n.style,onKeydown:k,onBlur:A,onMousedown:v},[w,N||P||F?U(`div`,{class:`${t}-footer`},[N,P,F]):null])}}})}var jw=Aw(),Mw=(e=>U(jw,e)),Nw={bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function Pw(e,t){let{slots:n}=t,{prefixCls:r,popupStyle:i,visible:a,dropdownClassName:o,dropdownAlign:s,transitionName:c,getPopupContainer:l,range:u,popupPlacement:d,direction:f}=rC(e),p=`${r}-dropdown`;return U(Su,{showAction:[],hideAction:[],popupPlacement:d===void 0?f===`rtl`?`bottomRight`:`bottomLeft`:d,builtinPlacements:Nw,prefixCls:p,popupTransitionName:c,popupAlign:s,popupVisible:a,popupClassName:K(o,{[`${p}-range`]:u,[`${p}-rtl`]:f===`rtl`}),popupStyle:i,getPopupContainer:l},{default:n.default,popup:n.popupElement})}var Fw=u({name:`PresetPanel`,props:{prefixCls:String,presets:{type:Array,default:()=>[]},onClick:Function,onHover:Function},setup(e){return()=>e.presets.length?U(`div`,{class:`${e.prefixCls}-presets`},[U(`ul`,null,[e.presets.map((t,n)=>{let{label:r,value:i}=t;return U(`li`,{key:n,onClick:t=>{t.stopPropagation(),e.onClick(i)},onMouseenter:()=>{var t;(t=e.onHover)==null||t.call(e,i)},onMouseleave:()=>{var t;(t=e.onHover)==null||t.call(e,null)}},[r])})])]):null}});function Iw(e){let{open:t,value:n,isClickOutside:r,triggerOpen:i,forwardKeydown:a,onKeydown:o,blurToCancel:s,onSubmit:c,onCancel:l,onFocus:u,onBlur:d}=e,f=q(!1),p=q(!1),m=q(!1),h=q(!1),g=q(!1),_=J(()=>({onMousedown:()=>{f.value=!0,i(!0)},onKeydown:e=>{if(o(e,()=>{g.value=!0}),!g.value){switch(e.which){case $.ENTER:t.value?c()!==!1&&(f.value=!0):i(!0),e.preventDefault();return;case $.TAB:f.value&&t.value&&!e.shiftKey?(f.value=!1,e.preventDefault()):!f.value&&t.value&&!a(e)&&e.shiftKey&&(f.value=!0,e.preventDefault());return;case $.ESC:f.value=!0,l();return}!t.value&&![$.SHIFT].includes(e.which)?i(!0):f.value||a(e)}},onFocus:e=>{f.value=!0,p.value=!0,u&&u(e)},onBlur:e=>{if(m.value||!r(document.activeElement)){m.value=!1;return}s.value?setTimeout(()=>{let{activeElement:e}=document;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;r(e)&&l()},0):t.value&&(i(!1),h.value&&c()),p.value=!1,d&&d(e)}}));G(t,()=>{h.value=!1}),G(n,()=>{h.value=!0});let v=q();return V(()=>{v.value=TC(e=>{let n=EC(e);if(t.value){let e=r(n);e?(!p.value||e)&&i(!1):(m.value=!0,ir(()=>{m.value=!1}))}})}),ut(()=>{v.value&&v.value()}),[_,{focused:p,typing:f}]}function Lw(e){let{valueTexts:t,onTextChange:n}=e,r=H(``);function i(e){r.value=e,n(e)}function a(){r.value=t.value[0]}return G(()=>[...t.value],function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];e.join(`||`)!==n.join(`||`)&&t.value.every(e=>e!==r.value)&&a()},{immediate:!0}),[r,i,a]}function Rw(e,t){let{formatList:n,generateConfig:r,locale:i}=t,a=Wd(()=>{if(!e.value)return[[``],``];let t=``,a=[];for(let o=0;ot[0]!==e[0]||!wx(t[1],e[1]));return[J(()=>a.value[0]),J(()=>a.value[1])]}function zw(e,t){let{formatList:n,generateConfig:r,locale:i}=t,a=H(null),o;function s(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(ir.cancel(o),t){a.value=e;return}o=ir(()=>{a.value=e})}let[,c]=Rw(a,{formatList:n,generateConfig:r,locale:i});function l(e){s(e)}function u(){s(null,arguments.length>0&&arguments[0]!==void 0&&arguments[0])}return G(e,()=>{u(!0)}),ut(()=>{ir.cancel(o)}),[c,l,u]}function Bw(e,t){return J(()=>e?.value?e.value:t?.value?(br(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.keys(t.value).map(e=>{let n=t.value[e];return{label:e,value:typeof n==`function`?n():n}})):[])}function Vw(){return u({name:`Picker`,inheritAttrs:!1,props:`prefixCls.id.tabindex.dropdownClassName.dropdownAlign.popupStyle.transitionName.generateConfig.locale.inputReadOnly.allowClear.autofocus.showTime.showNow.showHour.showMinute.showSecond.picker.format.use12Hours.value.defaultValue.open.defaultOpen.defaultOpenValue.suffixIcon.presets.clearIcon.disabled.disabledDate.placeholder.getPopupContainer.panelRender.inputRender.onChange.onOpenChange.onPanelChange.onFocus.onBlur.onMousedown.onMouseup.onMouseenter.onMouseleave.onContextmenu.onClick.onKeydown.onSelect.direction.autocomplete.showToday.renderExtraFooter.dateRender.minuteStep.hourStep.secondStep.hideDisabledOptions`.split(`.`),setup(e,t){let{attrs:n,expose:r}=t,i=H(null),a=Bw(J(()=>e.presets)),o=J(()=>e.picker??`date`),s=J(()=>o.value===`date`&&!!e.showTime||o.value===`time`),c=J(()=>XC(xC(e.format,o.value,e.showTime,e.use12Hours))),l=H(null),u=H(null),d=H(null),[f,p]=df(null,{value:St(e,`value`),defaultValue:e.defaultValue}),m=H(f.value),h=e=>{m.value=e},g=H(null),[_,v]=df(!1,{value:St(e,`open`),defaultValue:e.defaultOpen,postState:t=>!e.disabled&&t,onChange:t=>{e.onOpenChange&&e.onOpenChange(t),!t&&g.value&&g.value.onClose&&g.value.onClose()}}),[y,b]=Rw(m,{formatList:c,generateConfig:St(e,`generateConfig`),locale:St(e,`locale`)}),[x,S,C]=Lw({valueTexts:y,onTextChange:t=>{let n=WC(t,{locale:e.locale,formatList:c.value,generateConfig:e.generateConfig});n&&(!e.disabledDate||!e.disabledDate(n))&&h(n)}}),w=t=>{let{onChange:n,generateConfig:r,locale:i}=e;h(t),p(t),n&&!zC(r,f.value,t)&&n(t,t?UC(t,{generateConfig:r,locale:i,format:c.value[0]}):``)},T=t=>{e.disabled&&t||v(t)},E=e=>_.value&&g.value&&g.value.onKeydown?g.value.onKeydown(e):!1,D=function(){e.onMouseup&&e.onMouseup(...arguments),i.value&&(i.value.focus(),T(!0))},[O,{focused:k,typing:A}]=Iw({blurToCancel:s,open:_,value:x,triggerOpen:T,forwardKeydown:E,isClickOutside:e=>!OC([l.value,u.value,d.value],e),onSubmit:()=>!m.value||e.disabledDate&&e.disabledDate(m.value)?!1:(w(m.value),T(!1),C(),!0),onCancel:()=>{T(!1),h(f.value),C()},onKeydown:(t,n)=>{var r;(r=e.onKeydown)==null||r.call(e,t,n)},onFocus:t=>{var n;(n=e.onFocus)==null||n.call(e,t)},onBlur:t=>{var n;(n=e.onBlur)==null||n.call(e,t)}});G([_,y],()=>{_.value||(h(f.value),!y.value.length||y.value[0]===``?S(``):b.value!==x.value&&C())}),G(o,()=>{_.value||C()}),G(f,()=>{h(f.value)});let[j,M,N]=zw(x,{formatList:c,generateConfig:St(e,`generateConfig`),locale:St(e,`locale`)});return aC({operationRef:g,hideHeader:J(()=>o.value===`time`),onSelect:(e,t)=>{(t===`submit`||t!==`key`&&!s.value)&&(w(e),T(!1))},open:_,defaultOpenValue:St(e,`defaultOpenValue`),onDateMouseenter:M,onDateMouseleave:N}),r({focus:()=>{i.value&&i.value.focus()},blur:()=>{i.value&&i.value.blur()}}),()=>{let{prefixCls:t=`rc-picker`,id:r,tabindex:o,dropdownClassName:s,dropdownAlign:p,popupStyle:g,transitionName:v,generateConfig:y,locale:b,inputReadOnly:C,allowClear:E,autofocus:M,picker:P=`date`,defaultOpenValue:F,suffixIcon:I,clearIcon:L,disabled:ee,placeholder:te,getPopupContainer:ne,panelRender:R,onMousedown:re,onMouseenter:ie,onMouseleave:ae,onContextmenu:oe,onClick:z,onSelect:se,direction:B,autocomplete:V=`off`}=e,ce=Z(Z(Z({},e),n),{class:K({[`${t}-panel-focused`]:!A.value}),style:void 0,pickerValue:void 0,onPickerValueChange:void 0,onChange:null}),le=U(`div`,{class:`${t}-panel-layout`},[U(Fw,{prefixCls:t,presets:a.value,onClick:e=>{w(e),T(!1)}},null),U(Mw,Y(Y({},ce),{},{generateConfig:y,value:m.value,locale:b,tabindex:-1,onSelect:e=>{se?.(e),h(e)},direction:B,onPanelChange:(t,n)=>{let{onPanelChange:r}=e;N(!0),r?.(t,n)}}),null)]);R&&(le=R(le));let H=U(`div`,{class:`${t}-panel-container`,ref:l,onMousedown:e=>{e.preventDefault()}},[le]),ue;I&&(ue=U(`span`,{class:`${t}-suffix`},[I]));let de;E&&f.value&&!ee&&(de=U(`span`,{onMousedown:e=>{e.preventDefault(),e.stopPropagation()},onMouseup:e=>{e.preventDefault(),e.stopPropagation(),w(null),T(!1)},class:`${t}-clear`,role:`button`},[L||U(`span`,{class:`${t}-clear-btn`},null)]));let fe=Z(Z(Z(Z({id:r,tabindex:o,disabled:ee,readonly:C||typeof c.value[0]==`function`||!A.value,value:j.value||x.value,onInput:e=>{S(e.target.value)},autofocus:M,placeholder:te,ref:i,title:x.value},O.value),{size:SC(P,c.value[0],y)}),ZC(e)),{autocomplete:V}),pe=e.inputRender?e.inputRender(fe):U(`input`,fe,null),me=B===`rtl`?`bottomRight`:`bottomLeft`;return U(`div`,{ref:d,class:K(t,n.class,{[`${t}-disabled`]:ee,[`${t}-focused`]:k.value,[`${t}-rtl`]:B===`rtl`}),style:n.style,onMousedown:re,onMouseup:D,onMouseenter:ie,onMouseleave:ae,onContextmenu:oe,onClick:z},[U(`div`,{class:K(`${t}-input`,{[`${t}-input-placeholder`]:!!j.value}),ref:u},[pe,ue,de]),U(Pw,{visible:_.value,popupStyle:g,prefixCls:t,dropdownClassName:s,dropdownAlign:p,getPopupContainer:ne,transitionName:v,popupPlacement:me,direction:B},{default:()=>[U(`div`,{style:{pointerEvents:`none`,position:`absolute`,top:0,bottom:0,left:0,right:0}},null)],popupElement:()=>H})])}}})}var Hw=Vw();function Uw(e,t){let{picker:n,locale:r,selectedValue:i,disabledDate:a,disabled:o,generateConfig:s}=e,c=J(()=>QC(i.value,0)),l=J(()=>QC(i.value,1));function u(e){return s.value.locale.getWeekFirstDate(r.value.locale,e)}function d(e){let t=s.value.getYear(e),n=s.value.getMonth(e);return t*100+n}function f(e){let t=s.value.getYear(e),n=NC(s.value,e);return t*10+n}return[e=>{if(a&&(a?.value)?.call(a,e))return!0;if(o[1]&&l)return!IC(s.value,e,l.value)&&s.value.isAfter(e,l.value);if(t.value[1]&&l.value)switch(n.value){case`quarter`:return f(e)>f(l.value);case`month`:return d(e)>d(l.value);case`week`:return u(e)>u(l.value);default:return!IC(s.value,e,l.value)&&s.value.isAfter(e,l.value)}return!1},e=>{if(a.value?.call(a,e))return!0;if(o[0]&&c)return!IC(s.value,e,l.value)&&s.value.isAfter(c.value,e);if(t.value[0]&&c.value)switch(n.value){case`quarter`:return f(e)jC(r,e,t));case`quarter`:case`month`:return a((e,t)=>MC(r,e,t));default:return a((e,t)=>FC(r,e,t))}}function Gw(e,t,n,r){let i=QC(e,0),a=QC(e,1);if(t===0)return i;if(i&&a)switch(Ww(i,a,n,r)){case`same`:return i;case`closing`:return i;default:return HC(a,n,r,-1)}return i}function Kw(e){let{values:t,picker:n,defaultDates:r,generateConfig:i}=e,a=H([QC(r,0),QC(r,1)]),o=H(null),s=J(()=>QC(t.value,0)),c=J(()=>QC(t.value,1)),l=e=>a.value[e]?a.value[e]:QC(o.value,e)||Gw(t.value,e,n.value,i.value)||s.value||c.value||i.value.getNow(),u=H(null),d=H(null);S(()=>{u.value=l(0),d.value=l(1)});function f(e,n){if(e){let r=$C(o.value,e,n);a.value=$C(a.value,null,n)||[null,null];let i=(n+1)%2;QC(t.value,i)||(r=$C(r,e,i)),o.value=r}else(s.value||c.value)&&(o.value=null)}return[u,d,f]}function qw(e){return j()?(De(e),!0):!1}function Jw(e){return typeof e==`function`?e():ze(e)}function Yw(e){let t=Jw(e);return t?.$el??t}function Xw(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Zt()?V(e):t?e():z(e)}function Zw(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=q(),r=()=>n.value=!!e();return r(),Xw(r,t),n}var Qw=typeof window<`u`;Qw&&(window==null?void 0:window.navigator)?.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);var $w=Qw?window:void 0;Qw&&window.document,Qw&&window.navigator,Qw&&window.location;var eT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i2&&arguments[2]!==void 0?arguments[2]:{},{window:r=$w}=n,i=eT(n,[`window`]),a,o=Zw(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=G(()=>Yw(e),e=>{s(),o.value&&r&&e&&(a=new ResizeObserver(t),a.observe(e,i))},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return qw(l),{isSupported:o,stop:l}}function nT(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{width:0,height:0},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{box:r=`content-box`}=n,i=q(t.width),a=q(t.height);return tT(e,e=>{let[t]=e,n=r===`border-box`?t.borderBoxSize:r===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;n?(i.value=n.reduce((e,t)=>{let{inlineSize:n}=t;return e+n},0),a.value=n.reduce((e,t)=>{let{blockSize:n}=t;return e+n},0)):(i.value=t.contentRect.width,a.value=t.contentRect.height)},n),G(()=>Yw(e),e=>{i.value=e?t.width:0,a.value=e?t.height:0}),{width:i,height:a}}function rT(e,t){return e&&e[0]&&e[1]&&t.isAfter(e[0],e[1])?[e[1],e[0]]:e}function iT(e,t,n,r){return!!(e||r&&r[t]||n[(t+1)%2])}function aT(){return u({name:`RangerPicker`,inheritAttrs:!1,props:`prefixCls.id.popupStyle.dropdownClassName.transitionName.dropdownAlign.getPopupContainer.generateConfig.locale.placeholder.autofocus.disabled.format.picker.showTime.showNow.showHour.showMinute.showSecond.use12Hours.separator.value.defaultValue.defaultPickerValue.open.defaultOpen.disabledDate.disabledTime.dateRender.panelRender.ranges.allowEmpty.allowClear.suffixIcon.clearIcon.pickerRef.inputReadOnly.mode.renderExtraFooter.onChange.onOpenChange.onPanelChange.onCalendarChange.onFocus.onBlur.onMousedown.onMouseup.onMouseenter.onMouseleave.onClick.onOk.onKeydown.components.order.direction.activePickerIndex.autocomplete.minuteStep.hourStep.secondStep.hideDisabledOptions.disabledMinutes.presets.prevIcon.nextIcon.superPrevIcon.superNextIcon`.split(`.`),setup(e,t){let{attrs:n,expose:r}=t,i=J(()=>e.picker===`date`&&!!e.showTime||e.picker===`time`),a=Bw(J(()=>e.presets),J(()=>e.ranges)),o=H({}),s=H(null),c=H(null),l=H(null),u=H(null),d=H(null),f=H(null),p=H(null),m=H(null),h=J(()=>XC(xC(e.format,e.picker,e.showTime,e.use12Hours))),[g,_]=df(0,{value:St(e,`activePickerIndex`)}),v=H(null),y=J(()=>{let{disabled:t}=e;return Array.isArray(t)?t:[t||!1,t||!1]}),[b,x]=df(null,{value:St(e,`value`),defaultValue:e.defaultValue,postState:t=>e.picker===`time`&&!e.order?t:rT(t,e.generateConfig)}),[S,C,w]=Kw({values:b,picker:St(e,`picker`),defaultDates:e.defaultPickerValue,generateConfig:St(e,`generateConfig`)}),[T,E]=df(b.value,{postState:t=>{let n=t;if(y.value[0]&&y.value[1])return n;for(let t=0;t<2;t+=1)y.value[t]&&!QC(n,t)&&!QC(e.allowEmpty,t)&&(n=$C(n,e.generateConfig.getNow(),t));return n}}),[D,O]=df([e.picker,e.picker],{value:St(e,`mode`)});G(()=>e.picker,()=>{O([e.picker,e.picker])});let k=(t,n)=>{var r;O(t),(r=e.onPanelChange)==null||r.call(e,n,t)},[A,j]=Uw({picker:St(e,`picker`),selectedValue:T,locale:St(e,`locale`),disabled:y,disabledDate:St(e,`disabledDate`),generateConfig:St(e,`generateConfig`)},o),[M,N]=df(!1,{value:St(e,`open`),defaultValue:e.defaultOpen,postState:e=>!y.value[g.value]&&e,onChange:t=>{var n;(n=e.onOpenChange)==null||n.call(e,t),!t&&v.value&&v.value.onClose&&v.value.onClose()}}),P=J(()=>M.value&&g.value===0),F=J(()=>M.value&&g.value===1),I=H(0),L=H(0),ee=H(0),{width:te}=nT(s);G([M,te],()=>{!M.value&&s.value&&(ee.value=te.value)});let{width:ne}=nT(c),{width:R}=nT(m),{width:re}=nT(l),{width:ie}=nT(d);G([g,M,ne,R,re,ie,()=>e.direction],()=>{L.value=0,g.value?l.value&&d.value&&(L.value=re.value+ie.value,ne.value&&R.value&&L.value>ne.value-R.value-(e.direction===`rtl`||m.value.offsetLeft>L.value?0:m.value.offsetLeft)&&(I.value=L.value)):g.value===0&&(I.value=0)},{immediate:!0});let ae=H();function oe(e,t){if(e)clearTimeout(ae.value),o.value[t]=!0,_(t),N(e),M.value||w(null,t);else if(g.value===t){N(e);let t=o.value;ae.value=setTimeout(()=>{t===o.value&&(o.value={})})}}function z(e){oe(!0,e),setTimeout(()=>{let t=[f,p][e];t.value&&t.value.focus()},0)}function se(t,n){let r=t,i=QC(r,0),a=QC(r,1),{generateConfig:s,locale:c,picker:l,order:u,onCalendarChange:d,allowEmpty:f,onChange:p,showTime:m}=e;i&&a&&s.isAfter(i,a)&&(l===`week`&&!RC(s,c.locale,i,a)||l===`quarter`&&!PC(s,i,a)||l!==`week`&&l!==`quarter`&&l!==`time`&&!(m?zC(s,i,a):IC(s,i,a))?(n===0?(r=[i,null],a=null):(i=null,r=[null,a]),o.value={[n]:!0}):(l!==`time`||u!==!1)&&(r=rT(r,s))),E(r);let _=r&&r[0]?UC(r[0],{generateConfig:s,locale:c,format:h.value[0]}):``,v=r&&r[1]?UC(r[1],{generateConfig:s,locale:c,format:h.value[0]}):``;d&&d(r,[_,v],{range:n===0?`start`:`end`});let S=iT(i,0,y.value,f),C=iT(a,1,y.value,f);(r===null||S&&C)&&(x(r),p&&(!zC(s,QC(b.value,0),i)||!zC(s,QC(b.value,1),a))&&p(r,[_,v]));let w=null;n===0&&!y.value[1]?w=1:n===1&&!y.value[0]&&(w=0),w!==null&&w!==g.value&&(!o.value[w]||!QC(r,w))&&QC(r,n)?z(w):oe(!1,n)}let B=e=>M&&v.value&&v.value.onKeydown?v.value.onKeydown(e):!1,V={formatList:h,generateConfig:St(e,`generateConfig`),locale:St(e,`locale`)},[ce,le]=Rw(J(()=>QC(T.value,0)),V),[ue,de]=Rw(J(()=>QC(T.value,1)),V),fe=(t,n)=>{let r=WC(t,{locale:e.locale,formatList:h.value,generateConfig:e.generateConfig});r&&!(n===0?A:j)(r)&&(E($C(T.value,r,n)),w(r,n))},[pe,me,he]=Lw({valueTexts:ce,onTextChange:e=>fe(e,0)}),[ge,_e,W]=Lw({valueTexts:ue,onTextChange:e=>fe(e,1)}),[ve,ye]=ff(null),[be,xe]=ff(null),[Se,Ce,we]=zw(pe,V),[Te,Ee,De]=zw(ge,V),Oe=e=>{xe($C(T.value,e,g.value)),g.value===0?Ce(e):Ee(e)},ke=()=>{xe($C(T.value,null,g.value)),g.value===0?we():De()},Ae=(t,n)=>({forwardKeydown:B,onBlur:t=>{var n;(n=e.onBlur)==null||n.call(e,t)},isClickOutside:e=>!OC([c.value,l.value,u.value,s.value],e),onFocus:n=>{var r;_(t),(r=e.onFocus)==null||r.call(e,n)},triggerOpen:e=>{oe(e,t)},onSubmit:()=>{if(!T.value||e.disabledDate&&e.disabledDate(T.value[t]))return!1;se(T.value,t),n()},onCancel:()=>{oe(!1,t),E(b.value),n()}}),[je,{focused:Me,typing:Ne}]=Iw(Z(Z({},Ae(0,he)),{blurToCancel:i,open:P,value:pe,onKeydown:(t,n)=>{var r;(r=e.onKeydown)==null||r.call(e,t,n)}})),[Pe,{focused:Fe,typing:Ie}]=Iw(Z(Z({},Ae(1,W)),{blurToCancel:i,open:F,value:ge,onKeydown:(t,n)=>{var r;(r=e.onKeydown)==null||r.call(e,t,n)}})),Le=t=>{var n;(n=e.onClick)==null||n.call(e,t),!M.value&&!f.value.contains(t.target)&&!p.value.contains(t.target)&&(y.value[0]?y.value[1]||z(1):z(0))},Re=t=>{var n;(n=e.onMousedown)==null||n.call(e,t),M.value&&(Me.value||Fe.value)&&!f.value.contains(t.target)&&!p.value.contains(t.target)&&t.preventDefault()},ze=J(()=>b.value?.[0]?UC(b.value[0],{locale:e.locale,format:`YYYYMMDDHHmmss`,generateConfig:e.generateConfig}):``),Be=J(()=>b.value?.[1]?UC(b.value[1],{locale:e.locale,format:`YYYYMMDDHHmmss`,generateConfig:e.generateConfig}):``);G([M,ce,ue],()=>{M.value||(E(b.value),!ce.value.length||ce.value[0]===``?me(``):le.value!==pe.value&&he(),!ue.value.length||ue.value[0]===``?_e(``):de.value!==ge.value&&W())}),G([ze,Be],()=>{E(b.value)}),r({focus:()=>{f.value&&f.value.focus()},blur:()=>{f.value&&f.value.blur(),p.value&&p.value.blur()}});let Ve=J(()=>M.value&&be.value&&be.value[0]&&be.value[1]&&e.generateConfig.isAfter(be.value[1],be.value[0])?be.value:null);function He(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{generateConfig:r,showTime:i,dateRender:a,direction:o,disabledTime:s,prefixCls:c,locale:l}=e,u=i;if(i&&typeof i==`object`&&i.defaultValue){let e=i.defaultValue;u=Z(Z({},i),{defaultValue:QC(e,g.value)||void 0})}let d=null;return a&&(d=e=>{let{current:t,today:n}=e;return a({current:t,today:n,info:{range:g.value?`end`:`start`}})}),U(cw,{value:{inRange:!0,panelPosition:t,rangedValue:ve.value||T.value,hoverRangedValue:Ve.value}},{default:()=>[U(Mw,Y(Y(Y({},e),n),{},{dateRender:d,showTime:u,mode:D.value[g.value],generateConfig:r,style:void 0,direction:o,disabledDate:g.value===0?A:j,disabledTime:e=>s?s(e,g.value===0?`start`:`end`):!1,class:K({[`${c}-panel-focused`]:g.value===0?!Ne.value:!Ie.value}),value:QC(T.value,g.value),locale:l,tabIndex:-1,onPanelChange:(e,n)=>{g.value===0&&we(!0),g.value===1&&De(!0),k($C(D.value,n,g.value),$C(T.value,e,g.value));let i=e;t===`right`&&D.value[g.value]===n&&(i=HC(i,n,r,-1)),w(i,g.value)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:g.value===0?QC(T.value,1):QC(T.value,0)}),null)]})}return aC({operationRef:v,hideHeader:J(()=>e.picker===`time`),onDateMouseenter:Oe,onDateMouseleave:ke,hideRanges:J(()=>!0),onSelect:(e,t)=>{let n=$C(T.value,e,g.value);t===`submit`||t!==`key`&&!i.value?(se(n,g.value),g.value===0?we():De()):E(n)},open:M}),()=>{let{prefixCls:t=`rc-picker`,id:r,popupStyle:o,dropdownClassName:_,transitionName:v,dropdownAlign:x,getPopupContainer:E,generateConfig:O,locale:k,placeholder:A,autofocus:j,picker:N=`date`,showTime:P,separator:F=`~`,disabledDate:te,panelRender:ne,allowClear:R,suffixIcon:re,clearIcon:ie,inputReadOnly:ae,renderExtraFooter:z,onMouseenter:B,onMouseleave:V,onMouseup:ce,onOk:le,components:H,direction:ue,autocomplete:de=`off`}=e,fe=ue===`rtl`?{right:`${L.value}px`}:{left:`${L.value}px`};function he(){let e,n=Ow(t,D.value[g.value],z),r=kw({prefixCls:t,components:H,needConfirmButton:i.value,okDisabled:!QC(T.value,g.value)||te&&te(T.value[g.value]),locale:k,onOk:()=>{QC(T.value,g.value)&&(se(T.value,g.value),le&&le(T.value))}});if(N!==`time`&&!P){let t=g.value===0?S.value:C.value,n=HC(t,N,O),r=D.value[g.value]===N,i=He(r?`left`:!1,{pickerValue:t,onPickerValueChange:e=>{w(e,g.value)}}),a=He(`right`,{pickerValue:n,onPickerValueChange:e=>{w(HC(e,N,O,-1),g.value)}});e=ue===`rtl`?U($e,null,[a,r&&i]):U($e,null,[i,r&&a])}else e=He();let o=U(`div`,{class:`${t}-panel-layout`},[U(Fw,{prefixCls:t,presets:a.value,onClick:e=>{se(e,null),oe(!1,g.value)},onHover:e=>{ye(e)}},null),U(`div`,null,[U(`div`,{class:`${t}-panels`},[e]),(n||r)&&U(`div`,{class:`${t}-footer`},[n,r])])]);return ne&&(o=ne(o)),U(`div`,{class:`${t}-panel-container`,style:{marginLeft:`${I.value}px`},ref:c,onMousedown:e=>{e.preventDefault()}},[o])}let W=U(`div`,{class:K(`${t}-range-wrapper`,`${t}-${N}-range-wrapper`),style:{minWidth:`${ee.value}px`}},[U(`div`,{ref:m,class:`${t}-range-arrow`,style:fe},null),he()]),ve;re&&(ve=U(`span`,{class:`${t}-suffix`},[re]));let be;R&&(QC(b.value,0)&&!y.value[0]||QC(b.value,1)&&!y.value[1])&&(be=U(`span`,{onMousedown:e=>{e.preventDefault(),e.stopPropagation()},onMouseup:e=>{e.preventDefault(),e.stopPropagation();let t=b.value;y.value[0]||(t=$C(t,null,0)),y.value[1]||(t=$C(t,null,1)),se(t,null),oe(!1,g.value)},class:`${t}-clear`},[ie||U(`span`,{class:`${t}-clear-btn`},null)]));let xe={size:SC(N,h.value[0],O)},Ce=0,we=0;l.value&&u.value&&d.value&&(g.value===0?we=l.value.offsetWidth:(Ce=L.value,we=u.value.offsetWidth));let G=ue===`rtl`?{right:`${Ce}px`}:{left:`${Ce}px`};return U(`div`,Y({ref:s,class:K(t,`${t}-range`,n.class,{[`${t}-disabled`]:y.value[0]&&y.value[1],[`${t}-focused`]:g.value===0?Me.value:Fe.value,[`${t}-rtl`]:ue===`rtl`}),style:n.style,onClick:Le,onMouseenter:B,onMouseleave:V,onMousedown:Re,onMouseup:ce},ZC(e)),[U(`div`,{class:K(`${t}-input`,{[`${t}-input-active`]:g.value===0,[`${t}-input-placeholder`]:!!Se.value}),ref:l},[U(`input`,Y(Y(Y({id:r,disabled:y.value[0],readonly:ae||typeof h.value[0]==`function`||!Ne.value,value:Se.value||pe.value,onInput:e=>{me(e.target.value)},autofocus:j,placeholder:QC(A,0)||``,ref:f},je.value),xe),{},{autocomplete:de}),null)]),U(`div`,{class:`${t}-range-separator`,ref:d},[F]),U(`div`,{class:K(`${t}-input`,{[`${t}-input-active`]:g.value===1,[`${t}-input-placeholder`]:!!Te.value}),ref:u},[U(`input`,Y(Y(Y({disabled:y.value[1],readonly:ae||typeof h.value[0]==`function`||!Ie.value,value:Te.value||ge.value,onInput:e=>{_e(e.target.value)},placeholder:QC(A,1)||``,ref:p},Pe.value),xe),{},{autocomplete:de}),null)]),U(`div`,{class:`${t}-active-bar`,style:Z(Z({},G),{width:`${we}px`,position:`absolute`})},null),ve,be,U(Pw,{visible:M.value,popupStyle:o,prefixCls:t,dropdownClassName:_,dropdownAlign:x,getPopupContainer:E,transitionName:v,range:!0,direction:ue},{default:()=>[U(`div`,{style:{pointerEvents:`none`,position:`absolute`,top:0,bottom:0,left:0,right:0}},null)],popupElement:()=>W})])}}})}var oT=aT(),sT=Hw,cT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.checked,()=>{a.value=e.checked}),i({focus(){var e;(e=o.value)==null||e.focus()},blur(){var e;(e=o.value)==null||e.blur()}});let s=H(),c=t=>{if(e.disabled)return;e.checked===void 0&&(a.value=t.target.checked),t.shiftKey=s.value;let n={target:Z(Z({},e),{checked:t.target.checked}),stopPropagation(){t.stopPropagation()},preventDefault(){t.preventDefault()},nativeEvent:t};e.checked!==void 0&&(o.value.checked=!!e.checked),r(`change`,n),s.value=!1},l=e=>{r(`click`,e),s.value=e.shiftKey};return()=>{let{prefixCls:t,name:r,id:i,type:s,disabled:u,readonly:d,tabindex:f,autofocus:p,value:m,required:h}=e,g=cT(e,[`prefixCls`,`name`,`id`,`type`,`disabled`,`readonly`,`tabindex`,`autofocus`,`value`,`required`]),{class:_,onFocus:v,onBlur:y,onKeydown:b,onKeypress:x,onKeyup:S}=n,C=Z(Z({},g),n),w=Object.keys(C).reduce((e,t)=>((t.startsWith(`data-`)||t.startsWith(`aria-`)||t===`role`)&&(e[t]=C[t]),e),{}),T=K(t,_,{[`${t}-checked`]:a.value,[`${t}-disabled`]:u}),E=Z(Z({name:r,id:i,type:s,readonly:d,disabled:u,tabindex:f,class:`${t}-input`,checked:!!a.value,autofocus:p,value:m},w),{onChange:c,onClick:l,onFocus:v,onBlur:y,onKeydown:b,onKeypress:x,onKeyup:S,required:h});return U(`span`,{class:T},[U(`input`,Y({ref:o},E),null),U(`span`,{class:`${t}-inner`},null)])}}}),uT=Symbol(`radioGroupContextKey`),dT=e=>{fe(uT,e)},fT=()=>g(uT,void 0),pT=Symbol(`radioOptionTypeContextKey`),mT=e=>{fe(pT,e)},hT=()=>g(pT,void 0),gT=new N(`antRadioEffect`,{"0%":{transform:`scale(1)`,opacity:.5},"100%":{transform:`scale(1.6)`,opacity:0}}),_T=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-group`;return{[r]:Z(Z({},rn(e)),{display:`inline-block`,fontSize:0,[`&${r}-rtl`]:{direction:`rtl`},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:`none`}})}},vT=e=>{let{componentCls:t,radioWrapperMarginRight:n,radioCheckedColor:r,radioSize:i,motionDurationSlow:a,motionDurationMid:o,motionEaseInOut:s,motionEaseInOutCirc:c,radioButtonBg:l,colorBorder:u,lineWidth:d,radioDotSize:f,colorBgContainerDisabled:p,colorTextDisabled:m,paddingXS:h,radioDotDisabledColor:g,lineType:_,radioDotDisabledSize:v,wireframe:y,colorWhite:b}=e,x=`${t}-inner`;return{[`${t}-wrapper`]:Z(Z({},rn(e)),{position:`relative`,display:`inline-flex`,alignItems:`baseline`,marginInlineStart:0,marginInlineEnd:n,cursor:`pointer`,[`&${t}-wrapper-rtl`]:{direction:`rtl`},"&-disabled":{cursor:`not-allowed`,color:e.colorTextDisabled},"&::after":{display:`inline-block`,width:0,overflow:`hidden`,content:`"\\a0"`},[`${t}-checked::after`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:`100%`,height:`100%`,border:`${d}px ${_} ${r}`,borderRadius:`50%`,visibility:`hidden`,animationName:gT,animationDuration:a,animationTimingFunction:s,animationFillMode:`both`,content:`""`},[t]:Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,outline:`none`,cursor:`pointer`,alignSelf:`center`}),[`${t}-wrapper:hover &, + &:hover ${x}`]:{borderColor:r},[`${t}-input:focus-visible + ${x}`]:Z({},I(e)),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:`visible`},[`${t}-inner`]:{"&::after":{boxSizing:`border-box`,position:`absolute`,insetBlockStart:`50%`,insetInlineStart:`50%`,display:`block`,width:i,height:i,marginBlockStart:i/-2,marginInlineStart:i/-2,backgroundColor:y?r:b,borderBlockStart:0,borderInlineStart:0,borderRadius:i,transform:`scale(0)`,opacity:0,transition:`all ${a} ${c}`,content:`""`},boxSizing:`border-box`,position:`relative`,insetBlockStart:0,insetInlineStart:0,display:`block`,width:i,height:i,backgroundColor:l,borderColor:u,borderStyle:`solid`,borderWidth:d,borderRadius:`50%`,transition:`all ${o}`},[`${t}-input`]:{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:`pointer`,opacity:0},[`${t}-checked`]:{[x]:{borderColor:r,backgroundColor:y?l:r,"&::after":{transform:`scale(${f/i})`,opacity:1,transition:`all ${a} ${c}`}}},[`${t}-disabled`]:{cursor:`not-allowed`,[x]:{backgroundColor:p,borderColor:u,cursor:`not-allowed`,"&::after":{backgroundColor:g}},[`${t}-input`]:{cursor:`not-allowed`},[`${t}-disabled + span`]:{color:m,cursor:`not-allowed`},[`&${t}-checked`]:{[x]:{"&::after":{transform:`scale(${v/i})`}}}},[`span${t} + *`]:{paddingInlineStart:h,paddingInlineEnd:h}})}},yT=e=>{let{radioButtonColor:t,controlHeight:n,componentCls:r,lineWidth:i,lineType:a,colorBorder:o,motionDurationSlow:s,motionDurationMid:c,radioButtonPaddingHorizontal:l,fontSize:u,radioButtonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:m,paddingXS:h,borderRadius:g,borderRadiusSM:_,borderRadiusLG:v,radioCheckedColor:y,radioButtonCheckedBg:b,radioButtonHoverColor:x,radioButtonActiveColor:S,radioSolidCheckedColor:C,colorTextDisabled:w,colorBgContainerDisabled:T,radioDisabledButtonCheckedColor:E,radioDisabledButtonCheckedBg:D}=e;return{[`${r}-button-wrapper`]:{position:`relative`,display:`inline-block`,height:n,margin:0,paddingInline:l,paddingBlock:0,color:t,fontSize:u,lineHeight:`${n-i*2}px`,background:d,border:`${i}px ${a} ${o}`,borderBlockStartWidth:i+.02,borderInlineStartWidth:0,borderInlineEndWidth:i,cursor:`pointer`,transition:[`color ${c}`,`background ${c}`,`border-color ${c}`,`box-shadow ${c}`].join(`,`),a:{color:t},[`> ${r}-button`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:`100%`,height:`100%`},"&:not(:first-child)":{"&::before":{position:`absolute`,insetBlockStart:-i,insetInlineStart:-i,display:`block`,boxSizing:`content-box`,width:1,height:`100%`,paddingBlock:i,paddingInline:0,backgroundColor:o,transition:`background-color ${s}`,content:`""`}},"&:first-child":{borderInlineStart:`${i}px ${a} ${o}`,borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},[`${r}-group-large &`]:{height:p,fontSize:f,lineHeight:`${p-i*2}px`,"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},[`${r}-group-small &`]:{height:m,paddingInline:h-i,paddingBlock:0,lineHeight:`${m-i*2}px`,"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},"&:hover":{position:`relative`,color:y},"&:has(:focus-visible)":Z({},I(e)),[`${r}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:`none`},[`&-checked:not(${r}-button-wrapper-disabled)`]:{zIndex:1,color:y,background:b,borderColor:y,"&::before":{backgroundColor:y},"&:first-child":{borderColor:y},"&:hover":{color:x,borderColor:x,"&::before":{backgroundColor:x}},"&:active":{color:S,borderColor:S,"&::before":{backgroundColor:S}}},[`${r}-group-solid &-checked:not(${r}-button-wrapper-disabled)`]:{color:C,background:y,borderColor:y,"&:hover":{color:C,background:x,borderColor:x},"&:active":{color:C,background:S,borderColor:S}},"&-disabled":{color:w,backgroundColor:T,borderColor:o,cursor:`not-allowed`,"&:first-child, &:hover":{color:w,backgroundColor:T,borderColor:o}},[`&-disabled${r}-button-wrapper-checked`]:{color:E,backgroundColor:D,borderColor:o,boxShadow:`none`}}}},bT=v(`Radio`,e=>{let{padding:t,lineWidth:n,controlItemBgActiveDisabled:r,colorTextDisabled:i,colorBgContainer:a,fontSizeLG:o,controlOutline:s,colorPrimaryHover:c,colorPrimaryActive:l,colorText:u,colorPrimary:d,marginXS:f,controlOutlineWidth:p,colorTextLightSolid:m,wireframe:h}=e,g=`0 0 0 ${p}px ${s}`,_=g,v=o,y=v-8,b=B(e,{radioFocusShadow:g,radioButtonFocusShadow:_,radioSize:v,radioDotSize:h?y:v-(4+n)*2,radioDotDisabledSize:y,radioCheckedColor:d,radioDotDisabledColor:i,radioSolidCheckedColor:m,radioButtonBg:a,radioButtonCheckedBg:a,radioButtonColor:u,radioButtonHoverColor:c,radioButtonActiveColor:l,radioButtonPaddingHorizontal:t-n,radioDisabledButtonCheckedBg:r,radioDisabledButtonCheckedColor:i,radioWrapperMarginRight:f});return[_T(b),vT(b),yT(b)]}),xT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({prefixCls:String,checked:Q(),disabled:Q(),isGroup:Q(),value:f.any,name:String,id:String,autofocus:Q(),onChange:d(),onFocus:d(),onBlur:d(),onClick:d(),"onUpdate:checked":d(),"onUpdate:value":d()}),CT=u({compatConfig:{MODE:3},name:`ARadio`,inheritAttrs:!1,props:ST(),setup(e,t){let{emit:n,expose:r,slots:i,attrs:a}=t,o=zf(),s=Vf.useInject(),c=hT(),l=fT(),u=at(),d=J(()=>h.value??u.value),f=H(),{prefixCls:p,direction:m,disabled:h}=X(`radio`,e),g=J(()=>l?.optionType.value===`button`||c===`button`?`${p.value}-button`:p.value),_=at(),[v,y]=bT(p);r({focus:()=>{f.value.focus()},blur:()=>{f.value.blur()}});let b=e=>{let t=e.target.checked;n(`update:checked`,t),n(`update:value`,t),n(`change`,e),o.onFieldChange()},x=e=>{n(`change`,e),l&&l.onChange&&l.onChange(e)};return()=>{let t=l,{prefixCls:n,id:r=o.id.value}=e,c=xT(e,[`prefixCls`,`id`]),u=Z(Z({prefixCls:g.value,id:r},Br(c,[`onUpdate:checked`,`onUpdate:value`])),{disabled:h.value??_.value});t?(u.name=t.name.value,u.onChange=x,u.checked=e.value===t.value.value,u.disabled=d.value||t.disabled.value):u.onChange=b;let p=K({[`${g.value}-wrapper`]:!0,[`${g.value}-wrapper-checked`]:u.checked,[`${g.value}-wrapper-disabled`]:u.disabled,[`${g.value}-wrapper-rtl`]:m.value===`rtl`,[`${g.value}-wrapper-in-form-item`]:s.isFormItemInput},a.class,y.value);return v(U(`label`,Y(Y({},a),{},{class:p}),[U(lT,Y(Y({},u),{},{type:`radio`,ref:f}),null),i.default&&U(`span`,null,[i.default()])]))}}}),wT=u({compatConfig:{MODE:3},name:`ARadioGroup`,inheritAttrs:!1,props:{prefixCls:String,value:f.any,size:_(),options:Ue(),disabled:Q(),name:String,buttonStyle:_(`outline`),id:String,optionType:_(`default`),onChange:d(),"onUpdate:value":d()},setup(e,t){let{slots:n,emit:r,attrs:i}=t,a=zf(),{prefixCls:o,direction:s,size:c}=X(`radio`,e),[l,u]=bT(o),d=H(e.value),f=H(!1);return G(()=>e.value,e=>{d.value=e,f.value=!1}),dT({onChange:t=>{let n=d.value,{value:i}=t.target;`value`in e||(d.value=i),!f.value&&i!==n&&(f.value=!0,r(`update:value`,i),r(`change`,t),a.onFieldChange()),z(()=>{f.value=!1})},value:d,disabled:J(()=>e.disabled),name:J(()=>e.name),optionType:J(()=>e.optionType)}),()=>{let{options:t,buttonStyle:r,id:f=a.id.value}=e,p=`${o.value}-group`,m=K(p,`${p}-${r}`,{[`${p}-${c.value}`]:c.value,[`${p}-rtl`]:s.value===`rtl`},i.class,u.value),h=null;return h=t&&t.length>0?t.map(t=>{if(typeof t==`string`||typeof t==`number`)return U(CT,{key:t,prefixCls:o.value,disabled:e.disabled,value:t,checked:d.value===t},{default:()=>[t]});let{value:n,disabled:r,label:i}=t;return U(CT,{key:`radio-group-value-options-${n}`,prefixCls:o.value,disabled:r||e.disabled,value:n,checked:d.value===n},{default:()=>[i]})}):n.default?.call(n),l(U(`div`,Y(Y({},i),{},{class:m,id:f}),[h]))}}}),TT=u({compatConfig:{MODE:3},name:`ARadioButton`,inheritAttrs:!1,props:ST(),setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i}=X(`radio`,e);return mT(`button`),()=>U(CT,Y(Y(Y({},r),e),{},{prefixCls:i.value}),{default:()=>[n.default?.call(n)]})}});CT.Group=wT,CT.Button=TT,CT.install=function(e){return e.component(CT.name,CT),e.component(CT.Group.name,CT.Group),e.component(CT.Button.name,CT.Button),e};var ET=CT,DT=10,OT=20;function kT(e){let{fullscreen:t,validRange:n,generateConfig:r,locale:i,prefixCls:a,value:o,onChange:s,divRef:c}=e,l=r.getYear(o||r.getNow()),u=l-DT,d=u+OT;n&&(u=r.getYear(n[0]),d=r.getYear(n[1])+1);let f=i&&i.year===`年`?`年`:``,p=[];for(let e=u;e{let t=r.setYear(o,e);if(n){let[e,i]=n,a=r.getYear(t),o=r.getMonth(t);a===r.getYear(i)&&o>r.getMonth(i)&&(t=r.setMonth(t,r.getMonth(i))),a===r.getYear(e)&&oc.value},null)}kT.inheritAttrs=!1;function AT(e){let{prefixCls:t,fullscreen:n,validRange:r,value:i,generateConfig:a,locale:o,onChange:s,divRef:c}=e,l=a.getMonth(i||a.getNow()),u=0,d=11;if(r){let[e,t]=r,n=a.getYear(i);a.getYear(t)===n&&(d=a.getMonth(t)),a.getYear(e)===n&&(u=a.getMonth(e))}let f=o.shortMonths||a.locale.getShortMonths(o.locale),p=[];for(let e=u;e<=d;e+=1)p.push({label:f[e],value:e});return U(yv,{size:n?void 0:`small`,class:`${t}-month-select`,value:l,options:p,onChange:e=>{s(a.setMonth(i,e))},getPopupContainer:()=>c.value},null)}AT.inheritAttrs=!1;function jT(e){let{prefixCls:t,locale:n,mode:r,fullscreen:i,onModeChange:a}=e;return U(wT,{onChange:e=>{let{target:{value:t}}=e;a(t)},value:r,size:i?void 0:`small`,class:`${t}-mode-switch`},{default:()=>[U(TT,{value:`month`},{default:()=>[n.month]}),U(TT,{value:`year`},{default:()=>[n.year]})]})}jT.inheritAttrs=!1;var MT=u({name:`CalendarHeader`,inheritAttrs:!1,props:[`mode`,`prefixCls`,`value`,`validRange`,`generateConfig`,`locale`,`mode`,`fullscreen`],setup(e,t){let{attrs:n}=t,r=H(null),i=Vf.useInject();return Vf.useProvide(i,{isFormItemInput:!1}),()=>{let t=Z(Z({},e),n),{prefixCls:i,fullscreen:a,mode:o,onChange:s,onModeChange:c}=t,l=Z(Z({},t),{fullscreen:a,divRef:r});return U(`div`,{class:`${i}-header`,ref:r},[U(kT,Y(Y({},l),{},{onChange:e=>{s(e,`year`)}}),null),o===`month`&&U(AT,Y(Y({},l),{},{onChange:e=>{s(e,`month`)}}),null),U(jT,Y(Y({},l),{},{onModeChange:c}),null)])}}}),NT=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:`none`},"&:placeholder-shown":{textOverflow:`ellipsis`}}),PT=e=>({borderColor:e.inputBorderHoverColor,borderInlineEndWidth:e.lineWidth}),FT=e=>({borderColor:e.inputBorderHoverColor,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`,borderInlineEndWidth:e.lineWidth,outline:0}),IT=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:`none`,cursor:`not-allowed`,opacity:1,"&:hover":Z({},PT(B(e,{inputBorderHoverColor:e.colorBorder})))}),LT=e=>{let{inputPaddingVerticalLG:t,fontSizeLG:n,lineHeightLG:r,borderRadiusLG:i,inputPaddingHorizontalLG:a}=e;return{padding:`${t}px ${a}px`,fontSize:n,lineHeight:r,borderRadius:i}},RT=e=>({padding:`${e.inputPaddingVerticalSM}px ${e.controlPaddingHorizontalSM-1}px`,borderRadius:e.borderRadiusSM}),zT=(e,t)=>{let{componentCls:n,colorError:r,colorWarning:i,colorErrorOutline:a,colorWarningOutline:o,colorErrorBorderHover:s,colorWarningBorderHover:c}=e;return{[`&-status-error:not(${t}-disabled):not(${t}-borderless)${t}`]:{borderColor:r,"&:hover":{borderColor:s},"&:focus, &-focused":Z({},FT(B(e,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:a}))),[`${n}-prefix`]:{color:r}},[`&-status-warning:not(${t}-disabled):not(${t}-borderless)${t}`]:{borderColor:i,"&:hover":{borderColor:c},"&:focus, &-focused":Z({},FT(B(e,{inputBorderActiveColor:i,inputBorderHoverColor:i,controlOutline:o}))),[`${n}-prefix`]:{color:i}}}},BT=e=>Z(Z({position:`relative`,display:`inline-block`,width:`100%`,minWidth:0,padding:`${e.inputPaddingVertical}px ${e.inputPaddingHorizontal}px`,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,backgroundColor:e.colorBgContainer,backgroundImage:`none`,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:e.colorBorder,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},NT(e.colorTextPlaceholder)),{"&:hover":Z({},PT(e)),"&:focus, &-focused":Z({},FT(e)),"&-disabled, &[disabled]":Z({},IT(e)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:`transparent`,border:`none`,boxShadow:`none`}},"textarea&":{maxWidth:`100%`,height:`auto`,minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:`bottom`,transition:`all ${e.motionDurationSlow}, height 0s`,resize:`vertical`},"&-lg":Z({},LT(e)),"&-sm":Z({},RT(e)),"&-rtl":{direction:`rtl`},"&-textarea-rtl":{direction:`rtl`}}),VT=e=>{let{componentCls:t,antCls:n}=e;return{position:`relative`,display:`table`,width:`100%`,borderCollapse:`separate`,borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Z({},LT(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Z({},RT(e)),[`> ${t}`]:{display:`table-cell`,"&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:`table-cell`,width:1,whiteSpace:`nowrap`,verticalAlign:`middle`,"&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:`block !important`},"&-addon":{position:`relative`,padding:`0 ${e.inputPaddingHorizontal}px`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,textAlign:`center`,backgroundColor:e.colorFillAlter,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`-${e.inputPaddingVertical+1}px -${e.inputPaddingHorizontal}px`,[`&${n}-select-single:not(${n}-select-customize-input)`]:{[`${n}-select-selector`]:{backgroundColor:`inherit`,border:`${e.lineWidth}px ${e.lineType} transparent`,boxShadow:`none`}},"&-open, &-focused":{[`${n}-select-selector`]:{color:e.colorPrimary}}},[`${n}-cascader-picker`]:{margin:`-9px -${e.inputPaddingHorizontal}px`,backgroundColor:`transparent`,[`${n}-cascader-input`]:{textAlign:`start`,border:0,boxShadow:`none`}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${t}`]:{float:`inline-start`,width:`100%`,marginBottom:0,textAlign:`inherit`,"&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Z(Z({display:`block`},D()),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:`inline-block`,float:`none`,verticalAlign:`top`,borderRadius:0},[`& > ${t}-affix-wrapper`]:{display:`inline-flex`},[`& > ${n}-picker-range`]:{display:`inline-flex`},"& > *:not(:last-child)":{marginInlineEnd:-e.lineWidth,borderInlineEndWidth:e.lineWidth},[`${t}`]:{float:`none`},[`& > ${n}-select > ${n}-select-selector, + & > ${n}-select-auto-complete ${t}, + & > ${n}-cascader-picker ${t}, + & > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child, + & > ${n}-select:first-child > ${n}-select-selector, + & > ${n}-select-auto-complete:first-child ${t}, + & > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child, + & > ${n}-select:last-child > ${n}-select-selector, + & > ${n}-cascader-picker:last-child ${t}, + & > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:`top`},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:-e.lineWidth,[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}}),[`&&-sm ${n}-btn`]:{fontSize:e.fontSizeSM,height:e.controlHeightSM,lineHeight:`normal`},[`&&-lg ${n}-btn`]:{fontSize:e.fontSizeLG,height:e.controlHeightLG,lineHeight:`normal`},[`&&-lg ${n}-select-single ${n}-select-selector`]:{height:`${e.controlHeightLG}px`,[`${n}-select-selection-item, ${n}-select-selection-placeholder`]:{lineHeight:`${e.controlHeightLG-2}px`},[`${n}-select-selection-search-input`]:{height:`${e.controlHeightLG}px`}},[`&&-sm ${n}-select-single ${n}-select-selector`]:{height:`${e.controlHeightSM}px`,[`${n}-select-selection-item, ${n}-select-selection-placeholder`]:{lineHeight:`${e.controlHeightSM-2}px`},[`${n}-select-selection-search-input`]:{height:`${e.controlHeightSM}px`}}}},HT=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r}=e,i=(n-r*2-16)/2;return{[t]:Z(Z(Z(Z({},rn(e)),BT(e)),zT(e,t)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:i,paddingBottom:i}}})}},UT=e=>{let{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:`hidden`},"&-has-suffix":{margin:`0 ${e.inputAffixPadding}px`}},"&-textarea-with-clear-btn":{padding:`0 !important`,border:`0 !important`,[`${t}-clear-icon`]:{position:`absolute`,insetBlockStart:e.paddingXS,insetInlineEnd:e.paddingXS,zIndex:1}}}},WT=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e;return{[`${t}-affix-wrapper`]:Z(Z(Z(Z(Z({},BT(e)),{display:`inline-flex`,[`&:not(${t}-affix-wrapper-disabled):hover`]:Z(Z({},PT(e)),{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${t}[disabled]`]:{background:`transparent`}},[`> input${t}`]:{padding:0,fontSize:`inherit`,border:`none`,borderRadius:0,outline:`none`,"&:focus":{boxShadow:`none !important`}},"&::before":{width:0,visibility:`hidden`,content:`"\\a0"`},[`${t}`]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,"> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),UT(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:`pointer`,transition:`all ${i}`,"&:hover":{color:o}}}),zT(e,`${t}-affix-wrapper`))}},GT=e=>{let{componentCls:t,colorError:n,colorSuccess:r,borderRadiusLG:i,borderRadiusSM:a}=e;return{[`${t}-group`]:Z(Z(Z({},rn(e)),VT(e)),{"&-rtl":{direction:`rtl`},"&-wrapper":{display:`inline-block`,width:`100%`,textAlign:`start`,verticalAlign:`top`,"&-rtl":{direction:`rtl`},"&-lg":{[`${t}-group-addon`]:{borderRadius:i}},"&-sm":{[`${t}-group-addon`]:{borderRadius:a}},"&-status-error":{[`${t}-group-addon`]:{color:n,borderColor:n}},"&-status-warning":{[`${t}-group-addon:last-child`]:{color:r,borderColor:r}}}})}},KT=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[`${t}`]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,[`+ ${t}-group-addon ${r}-button:not(${n}-btn-primary)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{borderRadius:0},[`${t}-lg`]:{lineHeight:e.lineHeightLG-2e-4},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0},[`${r}-button:not(${n}-btn-primary)`]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${r}-button`]:{height:e.controlHeightLG},[`&-small ${r}-button`]:{height:e.controlHeightSM},"&-rtl":{direction:`rtl`},[`&${t}-compact-item`]:{[`&:not(${t}-compact-last-item)`]:{[`${t}-group-addon`]:{[`${t}-search-button`]:{marginInlineEnd:-e.lineWidth,borderRadius:0}}},[`&:not(${t}-compact-first-item)`]:{[`${t},${t}-affix-wrapper`]:{borderRadius:0}},[`> ${t}-group-addon ${t}-search-button, + > ${t}, + ${t}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}};function qT(e){return B(e,{inputAffixPadding:e.paddingXXS,inputPaddingVertical:Math.max(Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2*10)/10-e.lineWidth,3),inputPaddingVerticalLG:Math.ceil((e.controlHeightLG-e.fontSizeLG*e.lineHeightLG)/2*10)/10-e.lineWidth,inputPaddingVerticalSM:Math.max(Math.round((e.controlHeightSM-e.fontSize*e.lineHeight)/2*10)/10-e.lineWidth,0),inputPaddingHorizontal:e.paddingSM-e.lineWidth,inputPaddingHorizontalSM:e.paddingXS-e.lineWidth,inputPaddingHorizontalLG:e.controlPaddingHorizontal-e.lineWidth,inputBorderHoverColor:e.colorPrimaryHover,inputBorderActiveColor:e.colorPrimaryHover})}var JT=e=>{let{componentCls:t,inputPaddingHorizontal:n,paddingLG:r}=e,i=`${t}-textarea`;return{[i]:{position:`relative`,[`${i}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:n,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`},"&-status-error,\n &-status-warning,\n &-status-success,\n &-status-validating":{[`&${i}-has-feedback`]:{[`${t}`]:{paddingInlineEnd:r}}},"&-show-count":{[`> ${t}`]:{height:`100%`},"&::after":{color:e.colorTextDescription,whiteSpace:`nowrap`,content:`attr(data-count)`,pointerEvents:`none`,float:`right`}},"&-rtl":{"&::after":{float:`left`}}}}},YT=v(`Input`,e=>{let t=qT(e);return[HT(t),JT(t),WT(t),GT(t),KT(t),uv(t)]}),XT=(e,t,n,r)=>{let{lineHeight:i}=e,a=Math.floor(n*i)+2,o=Math.max((t-a)/2,0);return{padding:`${o}px ${r}px ${Math.max(t-a-o,0)}px`}},ZT=e=>{let{componentCls:t,pickerCellCls:n,pickerCellInnerCls:r,pickerPanelCellHeight:i,motionDurationSlow:a,borderRadiusSM:o,motionDurationMid:s,controlItemBgHover:c,lineWidth:l,lineType:u,colorPrimary:d,controlItemBgActive:f,colorTextLightSolid:p,controlHeightSM:m,pickerDateHoverRangeBorderColor:h,pickerCellBorderGap:g,pickerBasicCellHoverWithRangeColor:_,pickerPanelCellWidth:v,colorTextDisabled:y,colorBgContainerDisabled:b}=e;return{"&::before":{position:`absolute`,top:`50%`,insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:i,transform:`translateY(-50%)`,transition:`all ${a}`,content:`""`},[r]:{position:`relative`,zIndex:2,display:`inline-block`,minWidth:i,height:i,lineHeight:`${i}px`,borderRadius:o,transition:`background ${s}, border ${s}`},[`&:hover:not(${n}-in-view), + &:hover:not(${n}-selected):not(${n}-range-start):not(${n}-range-end):not(${n}-range-hover-start):not(${n}-range-hover-end)`]:{[r]:{background:c}},[`&-in-view${n}-today ${r}`]:{"&::before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${l}px ${u} ${d}`,borderRadius:o,content:`""`}},[`&-in-view${n}-in-range`]:{position:`relative`,"&::before":{background:f}},[`&-in-view${n}-selected ${r}, + &-in-view${n}-range-start ${r}, + &-in-view${n}-range-end ${r}`]:{color:p,background:d},[`&-in-view${n}-range-start:not(${n}-range-start-single), + &-in-view${n}-range-end:not(${n}-range-end-single)`]:{"&::before":{background:f}},[`&-in-view${n}-range-start::before`]:{insetInlineStart:`50%`},[`&-in-view${n}-range-end::before`]:{insetInlineEnd:`50%`},[`&-in-view${n}-range-hover-start:not(${n}-in-range):not(${n}-range-start):not(${n}-range-end), + &-in-view${n}-range-hover-end:not(${n}-in-range):not(${n}-range-start):not(${n}-range-end), + &-in-view${n}-range-hover-start${n}-range-start-single, + &-in-view${n}-range-hover-start${n}-range-start${n}-range-end${n}-range-end-near-hover, + &-in-view${n}-range-hover-end${n}-range-start${n}-range-end${n}-range-start-near-hover, + &-in-view${n}-range-hover-end${n}-range-end-single, + &-in-view${n}-range-hover:not(${n}-in-range)`]:{"&::after":{position:`absolute`,top:`50%`,zIndex:0,height:m,borderTop:`${l}px dashed ${h}`,borderBottom:`${l}px dashed ${h}`,transform:`translateY(-50%)`,transition:`all ${a}`,content:`""`}},"&-range-hover-start::after,\n &-range-hover-end::after,\n &-range-hover::after":{insetInlineEnd:0,insetInlineStart:g},[`&-in-view${n}-in-range${n}-range-hover::before, + &-in-view${n}-range-start${n}-range-hover::before, + &-in-view${n}-range-end${n}-range-hover::before, + &-in-view${n}-range-start:not(${n}-range-start-single)${n}-range-hover-start::before, + &-in-view${n}-range-end:not(${n}-range-end-single)${n}-range-hover-end::before, + ${t}-panel + > :not(${t}-date-panel) + &-in-view${n}-in-range${n}-range-hover-start::before, + ${t}-panel + > :not(${t}-date-panel) + &-in-view${n}-in-range${n}-range-hover-end::before`]:{background:_},[`&-in-view${n}-range-start:not(${n}-range-start-single):not(${n}-range-end) ${r}`]:{borderStartStartRadius:o,borderEndStartRadius:o,borderStartEndRadius:0,borderEndEndRadius:0},[`&-in-view${n}-range-end:not(${n}-range-end-single):not(${n}-range-start) ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o},[`&-range-hover${n}-range-end::after`]:{insetInlineStart:`50%`},[`tr > &-in-view${n}-range-hover:first-child::after, + tr > &-in-view${n}-range-hover-end:first-child::after, + &-in-view${n}-start${n}-range-hover-edge-start${n}-range-hover-edge-start-near-range::after, + &-in-view${n}-range-hover-edge-start:not(${n}-range-hover-edge-start-near-range)::after, + &-in-view${n}-range-hover-start::after`]:{insetInlineStart:(v-i)/2,borderInlineStart:`${l}px dashed ${h}`,borderStartStartRadius:l,borderEndStartRadius:l},[`tr > &-in-view${n}-range-hover:last-child::after, + tr > &-in-view${n}-range-hover-start:last-child::after, + &-in-view${n}-end${n}-range-hover-edge-end${n}-range-hover-edge-end-near-range::after, + &-in-view${n}-range-hover-edge-end:not(${n}-range-hover-edge-end-near-range)::after, + &-in-view${n}-range-hover-end::after`]:{insetInlineEnd:(v-i)/2,borderInlineEnd:`${l}px dashed ${h}`,borderStartEndRadius:l,borderEndEndRadius:l},"&-disabled":{color:y,pointerEvents:`none`,[r]:{background:`transparent`},"&::before":{background:b}},[`&-disabled${n}-today ${r}::before`]:{borderColor:y}}},QT=e=>{let{componentCls:t,pickerCellInnerCls:n,pickerYearMonthCellWidth:r,pickerControlIconSize:i,pickerPanelCellWidth:a,paddingSM:o,paddingXS:s,paddingXXS:c,colorBgContainer:l,lineWidth:u,lineType:d,borderRadiusLG:f,colorPrimary:p,colorTextHeading:m,colorSplit:h,pickerControlIconBorderWidth:g,colorIcon:_,pickerTextHeight:v,motionDurationMid:y,colorIconHover:b,fontWeightStrong:x,pickerPanelCellHeight:S,pickerCellPaddingVertical:C,colorTextDisabled:w,colorText:T,fontSize:E,pickerBasicCellHoverWithRangeColor:D,motionDurationSlow:O,pickerPanelWithoutTimeCellHeight:k,pickerQuarterPanelContentHeight:A,colorLink:j,colorLinkActive:M,colorLinkHover:N,pickerDateHoverRangeBorderColor:P,borderRadiusSM:F,colorTextLightSolid:I,borderRadius:L,controlItemBgHover:ee,pickerTimePanelColumnHeight:te,pickerTimePanelColumnWidth:ne,pickerTimePanelCellHeight:R,controlItemBgActive:re,marginXXS:ie}=e,ae=a*7+o*2+4,oe=(ae-s*2)/3-r-o;return{[t]:{"&-panel":{display:`inline-flex`,flexDirection:`column`,textAlign:`center`,background:l,border:`${u}px ${d} ${h}`,borderRadius:f,outline:`none`,"&-focused":{borderColor:p},"&-rtl":{direction:`rtl`,[`${t}-prev-icon, + ${t}-super-prev-icon`]:{transform:`rotate(45deg)`},[`${t}-next-icon, + ${t}-super-next-icon`]:{transform:`rotate(-135deg)`}}},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel,\n &-week-panel,\n &-date-panel,\n &-time-panel":{display:`flex`,flexDirection:`column`,width:ae},"&-header":{display:`flex`,padding:`0 ${s}px`,color:m,borderBottom:`${u}px ${d} ${h}`,"> *":{flex:`none`},button:{padding:0,color:_,lineHeight:`${v}px`,background:`transparent`,border:0,cursor:`pointer`,transition:`color ${y}`},"> button":{minWidth:`1.6em`,fontSize:E,"&:hover":{color:b}},"&-view":{flex:`auto`,fontWeight:x,lineHeight:`${v}px`,button:{color:`inherit`,fontWeight:`inherit`,verticalAlign:`top`,"&:not(:first-child)":{marginInlineStart:s},"&:hover":{color:p}}}},"&-prev-icon,\n &-next-icon,\n &-super-prev-icon,\n &-super-next-icon":{position:`relative`,display:`inline-block`,width:i,height:i,"&::before":{position:`absolute`,top:0,insetInlineStart:0,display:`inline-block`,width:i,height:i,border:`0 solid currentcolor`,borderBlockStartWidth:g,borderBlockEndWidth:0,borderInlineStartWidth:g,borderInlineEndWidth:0,content:`""`}},"&-super-prev-icon,\n &-super-next-icon":{"&::after":{position:`absolute`,top:Math.ceil(i/2),insetInlineStart:Math.ceil(i/2),display:`inline-block`,width:i,height:i,border:`0 solid currentcolor`,borderBlockStartWidth:g,borderBlockEndWidth:0,borderInlineStartWidth:g,borderInlineEndWidth:0,content:`""`}},"&-prev-icon,\n &-super-prev-icon":{transform:`rotate(-45deg)`},"&-next-icon,\n &-super-next-icon":{transform:`rotate(135deg)`},"&-content":{width:`100%`,tableLayout:`fixed`,borderCollapse:`collapse`,"th, td":{position:`relative`,minWidth:S,fontWeight:`normal`},th:{height:S+C*2,color:T,verticalAlign:`middle`}},"&-cell":Z({padding:`${C}px 0`,color:w,cursor:`pointer`,"&-in-view":{color:T}},ZT(e)),[`&-date-panel ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-start ${n}, + &-date-panel ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-end ${n}`]:{"&::after":{position:`absolute`,top:0,bottom:0,zIndex:-1,background:D,transition:`all ${O}`,content:`""`}},[`&-date-panel + ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-start + ${n}::after`]:{insetInlineEnd:-(a-S)/2,insetInlineStart:0},[`&-date-panel ${t}-cell-in-view${t}-cell-in-range${t}-cell-range-hover-end ${n}::after`]:{insetInlineEnd:0,insetInlineStart:-(a-S)/2},[`&-range-hover${t}-range-start::after`]:{insetInlineEnd:`50%`},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${t}-content`]:{height:k*4},[n]:{padding:`0 ${s}px`}},"&-quarter-panel":{[`${t}-content`]:{height:A}},[`&-panel ${t}-footer`]:{borderTop:`${u}px ${d} ${h}`},"&-footer":{width:`min-content`,minWidth:`100%`,lineHeight:`${v-2*u}px`,textAlign:`center`,"&-extra":{padding:`0 ${o}`,lineHeight:`${v-2*u}px`,textAlign:`start`,"&:not(:last-child)":{borderBottom:`${u}px ${d} ${h}`}}},"&-now":{textAlign:`start`},"&-today-btn":{color:j,"&:hover":{color:N},"&:active":{color:M},[`&${t}-today-btn-disabled`]:{color:w,cursor:`not-allowed`}},"&-decade-panel":{[n]:{padding:`0 ${s/2}px`},[`${t}-cell::before`]:{display:`none`}},"&-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${t}-body`]:{padding:`0 ${s}px`},[n]:{width:r},[`${t}-cell-range-hover-start::after`]:{insetInlineStart:oe,borderInlineStart:`${u}px dashed ${P}`,borderStartStartRadius:F,borderBottomStartRadius:F,borderStartEndRadius:0,borderBottomEndRadius:0,[`${t}-panel-rtl &`]:{insetInlineEnd:oe,borderInlineEnd:`${u}px dashed ${P}`,borderStartStartRadius:0,borderBottomStartRadius:0,borderStartEndRadius:F,borderBottomEndRadius:F}},[`${t}-cell-range-hover-end::after`]:{insetInlineEnd:oe,borderInlineEnd:`${u}px dashed ${P}`,borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:L,borderEndEndRadius:L,[`${t}-panel-rtl &`]:{insetInlineStart:oe,borderInlineStart:`${u}px dashed ${P}`,borderStartStartRadius:L,borderEndStartRadius:L,borderStartEndRadius:0,borderEndEndRadius:0}}},"&-week-panel":{[`${t}-body`]:{padding:`${s}px ${o}px`},[`${t}-cell`]:{[`&:hover ${n}, + &-selected ${n}, + ${n}`]:{background:`transparent !important`}},"&-row":{td:{transition:`background ${y}`,"&:first-child":{borderStartStartRadius:F,borderEndStartRadius:F},"&:last-child":{borderStartEndRadius:F,borderEndEndRadius:F}},"&:hover td":{background:ee},"&-selected td,\n &-selected:hover td":{background:p,[`&${t}-cell-week`]:{color:new we(I).setAlpha(.5).toHexString()},[`&${t}-cell-today ${n}::before`]:{borderColor:I},[n]:{color:I}}}},"&-date-panel":{[`${t}-body`]:{padding:`${s}px ${o}px`},[`${t}-content`]:{width:a*7,th:{width:a}}},"&-datetime-panel":{display:`flex`,[`${t}-time-panel`]:{borderInlineStart:`${u}px ${d} ${h}`},[`${t}-date-panel, + ${t}-time-panel`]:{transition:`opacity ${O}`},"&-active":{[`${t}-date-panel, + ${t}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:`auto`,minWidth:`auto`,direction:`ltr`,[`${t}-content`]:{display:`flex`,flex:`auto`,height:te},"&-column":{flex:`1 0 auto`,width:ne,margin:`${c}px 0`,padding:0,overflowY:`hidden`,textAlign:`start`,listStyle:`none`,transition:`background ${y}`,overflowX:`hidden`,"&::after":{display:`block`,height:te-R,content:`""`},"&:not(:first-child)":{borderInlineStart:`${u}px ${d} ${h}`},"&-active":{background:new we(re).setAlpha(.2).toHexString()},"&:hover":{overflowY:`auto`},"> li":{margin:0,padding:0,[`&${t}-time-panel-cell`]:{marginInline:ie,[`${t}-time-panel-cell-inner`]:{display:`block`,width:ne-2*ie,height:R,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:(ne-R)/2,color:T,lineHeight:`${R}px`,borderRadius:F,cursor:`pointer`,transition:`background ${y}`,"&:hover":{background:ee}},"&-selected":{[`${t}-time-panel-cell-inner`]:{background:re}},"&-disabled":{[`${t}-time-panel-cell-inner`]:{color:w,background:`transparent`,cursor:`not-allowed`}}}}}},[`&-datetime-panel ${t}-time-panel-column:after`]:{height:te-R+c*2}}}},$T=e=>{let{componentCls:t,colorBgContainer:n,colorError:r,colorErrorOutline:i,colorWarning:a,colorWarningOutline:o}=e;return{[t]:{[`&-status-error${t}`]:{"&, &:not([disabled]):hover":{backgroundColor:n,borderColor:r},"&-focused, &:focus":Z({},FT(B(e,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:i}))),[`${t}-active-bar`]:{background:r}},[`&-status-warning${t}`]:{"&, &:not([disabled]):hover":{backgroundColor:n,borderColor:a},"&-focused, &:focus":Z({},FT(B(e,{inputBorderActiveColor:a,inputBorderHoverColor:a,controlOutline:o}))),[`${t}-active-bar`]:{background:a}}}}},eE=e=>{let{componentCls:t,antCls:n,boxShadowPopoverArrow:r,controlHeight:i,fontSize:a,inputPaddingHorizontal:o,colorBgContainer:s,lineWidth:c,lineType:l,colorBorder:u,borderRadius:d,motionDurationMid:f,colorBgContainerDisabled:p,colorTextDisabled:m,colorTextPlaceholder:h,controlHeightLG:g,fontSizeLG:_,controlHeightSM:v,inputPaddingHorizontalSM:y,paddingXS:b,marginXS:x,colorTextDescription:S,lineWidthBold:C,lineHeight:w,colorPrimary:T,motionDurationSlow:E,zIndexPopup:D,paddingXXS:O,paddingSM:k,pickerTextHeight:A,controlItemBgActive:j,colorPrimaryBorder:M,sizePopupArrow:N,borderRadiusXS:P,borderRadiusOuter:F,colorBgElevated:I,borderRadiusLG:L,boxShadowSecondary:ee,borderRadiusSM:te,colorSplit:ne,controlItemBgHover:R,presetsWidth:re,presetsMaxWidth:ie}=e;return[{[t]:Z(Z(Z({},rn(e)),XT(e,i,a,o)),{position:`relative`,display:`inline-flex`,alignItems:`center`,background:s,lineHeight:1,border:`${c}px ${l} ${u}`,borderRadius:d,transition:`border ${f}, box-shadow ${f}`,"&:hover, &-focused":Z({},PT(e)),"&-focused":Z({},FT(e)),[`&${t}-disabled`]:{background:p,borderColor:u,cursor:`not-allowed`,[`${t}-suffix`]:{color:m}},[`&${t}-borderless`]:{backgroundColor:`transparent !important`,borderColor:`transparent !important`,boxShadow:`none !important`},[`${t}-input`]:{position:`relative`,display:`inline-flex`,alignItems:`center`,width:`100%`,"> input":Z(Z({},BT(e)),{flex:`auto`,minWidth:1,height:`auto`,padding:0,background:`transparent`,border:0,"&:focus":{boxShadow:`none`},"&[disabled]":{background:`transparent`}}),"&:hover":{[`${t}-clear`]:{opacity:1}},"&-placeholder":{"> input":{color:h}}},"&-large":Z(Z({},XT(e,g,_,o)),{[`${t}-input > input`]:{fontSize:_}}),"&-small":Z({},XT(e,v,a,y)),[`${t}-suffix`]:{display:`flex`,flex:`none`,alignSelf:`center`,marginInlineStart:b/2,color:m,lineHeight:1,pointerEvents:`none`,"> *":{verticalAlign:`top`,"&:not(:last-child)":{marginInlineEnd:x}}},[`${t}-clear`]:{position:`absolute`,top:`50%`,insetInlineEnd:0,color:m,lineHeight:1,background:s,transform:`translateY(-50%)`,cursor:`pointer`,opacity:0,transition:`opacity ${f}, color ${f}`,"> *":{verticalAlign:`top`},"&:hover":{color:S}},[`${t}-separator`]:{position:`relative`,display:`inline-block`,width:`1em`,height:_,color:m,fontSize:_,verticalAlign:`top`,cursor:`default`,[`${t}-focused &`]:{color:S},[`${t}-range-separator &`]:{[`${t}-disabled &`]:{cursor:`not-allowed`}}},"&-range":{position:`relative`,display:`inline-flex`,[`${t}-clear`]:{insetInlineEnd:o},"&:hover":{[`${t}-clear`]:{opacity:1}},[`${t}-active-bar`]:{bottom:-c,height:C,marginInlineStart:o,background:T,opacity:0,transition:`all ${E} ease-out`,pointerEvents:`none`},[`&${t}-focused`]:{[`${t}-active-bar`]:{opacity:1}},[`${t}-range-separator`]:{alignItems:`center`,padding:`0 ${b}px`,lineHeight:1},[`&${t}-small`]:{[`${t}-clear`]:{insetInlineEnd:y},[`${t}-active-bar`]:{marginInlineStart:y}}},"&-dropdown":Z(Z(Z({},rn(e)),QT(e)),{position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:D,[`&${t}-dropdown-hidden`]:{display:`none`},[`&${t}-dropdown-placement-bottomLeft`]:{[`${t}-range-arrow`]:{top:0,display:`block`,transform:`translateY(-100%)`}},[`&${t}-dropdown-placement-topLeft`]:{[`${t}-range-arrow`]:{bottom:0,display:`block`,transform:`translateY(100%) rotate(180deg)`}},[`&${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-topLeft, + &${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-topRight, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-topLeft, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-topRight`]:{animationName:j_},[`&${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-bottomLeft, + &${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-bottomRight, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-bottomLeft, + &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-bottomRight`]:{animationName:k_},[`&${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-topLeft, + &${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-topRight`]:{animationName:M_},[`&${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-bottomLeft, + &${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-bottomRight`]:{animationName:A_},[`${t}-panel > ${t}-time-panel`]:{paddingTop:O},[`${t}-ranges`]:{marginBottom:0,padding:`${O}px ${k}px`,overflow:`hidden`,lineHeight:`${A-2*c-b/2}px`,textAlign:`start`,listStyle:`none`,display:`flex`,justifyContent:`space-between`,"> li":{display:`inline-block`},[`${t}-preset > ${n}-tag-blue`]:{color:T,background:j,borderColor:M,cursor:`pointer`},[`${t}-ok`]:{marginInlineStart:`auto`}},[`${t}-range-wrapper`]:{display:`flex`,position:`relative`},[`${t}-range-arrow`]:Z({position:`absolute`,zIndex:1,display:`none`,marginInlineStart:o*1.5,transition:`left ${E} ease-out`},Rr(N,P,F,I,r)),[`${t}-panel-container`]:{overflow:`hidden`,verticalAlign:`top`,background:I,borderRadius:L,boxShadow:ee,transition:`margin ${E}`,[`${t}-panel-layout`]:{display:`flex`,flexWrap:`nowrap`,alignItems:`stretch`},[`${t}-presets`]:{display:`flex`,flexDirection:`column`,minWidth:re,maxWidth:ie,ul:{height:0,flex:`auto`,listStyle:`none`,overflow:`auto`,margin:0,padding:b,borderInlineEnd:`${c}px ${l} ${ne}`,li:Z(Z({},xe),{borderRadius:te,paddingInline:b,paddingBlock:(v-Math.round(a*w))/2,cursor:`pointer`,transition:`all ${E}`,"+ li":{marginTop:x},"&:hover":{background:R}})}},[`${t}-panels`]:{display:`inline-flex`,flexWrap:`nowrap`,direction:`ltr`,[`${t}-panel`]:{borderWidth:`0 0 ${c}px`},"&:last-child":{[`${t}-panel`]:{borderWidth:0}}},[`${t}-panel`]:{verticalAlign:`top`,background:`transparent`,borderRadius:0,borderWidth:0,[`${t}-content, + table`]:{textAlign:`center`},"&-focused":{borderColor:u}}}}),"&-dropdown-range":{padding:`${N*2/3}px 0`,"&-hidden":{display:`none`}},"&-rtl":{direction:`rtl`,[`${t}-separator`]:{transform:`rotate(180deg)`},[`${t}-footer`]:{"&-extra":{direction:`rtl`}}}})},R_(e,`slide-up`),R_(e,`slide-down`),O_(e,`move-up`),O_(e,`move-down`)]},tE=e=>{let{componentCls:t,controlHeightLG:n,controlHeightSM:r,colorPrimary:i,paddingXXS:a}=e;return{pickerCellCls:`${t}-cell`,pickerCellInnerCls:`${t}-cell-inner`,pickerTextHeight:n,pickerPanelCellWidth:r*1.5,pickerPanelCellHeight:r,pickerDateHoverRangeBorderColor:new we(i).lighten(20).toHexString(),pickerBasicCellHoverWithRangeColor:new we(i).lighten(35).toHexString(),pickerPanelWithoutTimeCellHeight:n*1.65,pickerYearMonthCellWidth:n*1.5,pickerTimePanelColumnHeight:224,pickerTimePanelColumnWidth:n*1.4,pickerTimePanelCellHeight:28,pickerQuarterPanelContentHeight:n*1.4,pickerCellPaddingVertical:a,pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconBorderWidth:1.5}},nE=v(`DatePicker`,e=>{let t=B(qT(e),tE(e));return[eE(t),$T(t),uv(e,{focusElCls:`${e.componentCls}-focused`})]},e=>({presetsWidth:120,presetsMaxWidth:200,zIndexPopup:e.zIndexPopupBase+50})),rE=e=>{let{calendarCls:t,componentCls:n,calendarFullBg:r,calendarFullPanelBg:i,calendarItemActiveBg:a}=e;return{[t]:Z(Z(Z({},QT(e)),rn(e)),{background:r,"&-rtl":{direction:`rtl`},[`${t}-header`]:{display:`flex`,justifyContent:`flex-end`,padding:`${e.paddingSM}px 0`,[`${t}-year-select`]:{minWidth:e.yearControlWidth},[`${t}-month-select`]:{minWidth:e.monthControlWidth,marginInlineStart:e.marginXS},[`${t}-mode-switch`]:{marginInlineStart:e.marginXS}}}),[`${t} ${n}-panel`]:{background:i,border:0,borderTop:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,borderRadius:0,[`${n}-month-panel, ${n}-date-panel`]:{width:`auto`},[`${n}-body`]:{padding:`${e.paddingXS}px 0`},[`${n}-content`]:{width:`100%`}},[`${t}-mini`]:{borderRadius:e.borderRadiusLG,[`${t}-header`]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS},[`${n}-panel`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${n}-content`]:{height:e.miniContentHeight,th:{height:`auto`,padding:0,lineHeight:`${e.weekHeight}px`}},[`${n}-cell::before`]:{pointerEvents:`none`}},[`${t}${t}-full`]:{[`${n}-panel`]:{display:`block`,width:`100%`,textAlign:`end`,background:r,border:0,[`${n}-body`]:{"th, td":{padding:0},th:{height:`auto`,paddingInlineEnd:e.paddingSM,paddingBottom:e.paddingXXS,lineHeight:`${e.weekHeight}px`}}},[`${n}-cell`]:{"&::before":{display:`none`},"&:hover":{[`${t}-date`]:{background:e.controlItemBgHover}},[`${t}-date-today::before`]:{display:`none`},[`&-in-view${n}-cell-selected`]:{[`${t}-date, ${t}-date-today`]:{background:a}},"&-selected, &-selected:hover":{[`${t}-date, ${t}-date-today`]:{[`${t}-date-value`]:{color:e.colorPrimary}}}},[`${t}-date`]:{display:`block`,width:`auto`,height:`auto`,margin:`0 ${e.marginXS/2}px`,padding:`${e.paddingXS/2}px ${e.paddingXS}px 0`,border:0,borderTop:`${e.lineWidthBold}px ${e.lineType} ${e.colorSplit}`,borderRadius:0,transition:`background ${e.motionDurationSlow}`,"&-value":{lineHeight:`${e.dateValueHeight}px`,transition:`color ${e.motionDurationSlow}`},"&-content":{position:`static`,width:`auto`,height:e.dateContentHeight,overflowY:`auto`,color:e.colorText,lineHeight:e.lineHeight,textAlign:`start`},"&-today":{borderColor:e.colorPrimary,[`${t}-date-value`]:{color:e.colorText}}}},[`@media only screen and (max-width: ${e.screenXS}px) `]:{[`${t}`]:{[`${t}-header`]:{display:`block`,[`${t}-year-select`]:{width:`50%`},[`${t}-month-select`]:{width:`calc(50% - ${e.paddingXS}px)`},[`${t}-mode-switch`]:{width:`100%`,marginTop:e.marginXS,marginInlineStart:0,"> label":{width:`50%`,textAlign:`center`}}}}}}},iE=v(`Calendar`,e=>{let t=`${e.componentCls}-calendar`;return[rE(B(qT(e),tE(e),{calendarCls:t,pickerCellInnerCls:`${e.componentCls}-cell-inner`,calendarFullBg:e.colorBgContainer,calendarFullPanelBg:e.colorBgContainer,calendarItemActiveBg:e.controlItemBgActive,dateValueHeight:e.controlHeightSM,weekHeight:e.controlHeightSM*.75,dateContentHeight:(e.fontSizeSM*e.lineHeightSM+e.marginXS)*3+e.lineWidth*2}))]},{yearControlWidth:80,monthControlWidth:70,miniContentHeight:256});function aE(e){function t(t,n){return t&&n&&e.getYear(t)===e.getYear(n)}function n(n,r){return t(n,r)&&e.getMonth(n)===e.getMonth(r)}function r(t,r){return n(t,r)&&e.getDate(t)===e.getDate(r)}let i=u({name:`ACalendar`,inheritAttrs:!1,props:{prefixCls:String,locale:{type:Object,default:void 0},validRange:{type:Array,default:void 0},disabledDate:{type:Function,default:void 0},dateFullCellRender:{type:Function,default:void 0},dateCellRender:{type:Function,default:void 0},monthFullCellRender:{type:Function,default:void 0},monthCellRender:{type:Function,default:void 0},headerRender:{type:Function,default:void 0},value:{type:[Object,String],default:void 0},defaultValue:{type:[Object,String],default:void 0},mode:{type:String,default:void 0},fullscreen:{type:Boolean,default:void 0},onChange:{type:Function,default:void 0},"onUpdate:value":{type:Function,default:void 0},onPanelChange:{type:Function,default:void 0},onSelect:{type:Function,default:void 0},valueFormat:{type:String,default:void 0}},slots:Object,setup(i,a){let{emit:o,slots:s,attrs:c}=a,l=i,{prefixCls:u,direction:d}=X(`picker`,l),[f,p]=iE(u),m=J(()=>`${u.value}-calendar`),h=t=>l.valueFormat?e.toString(t,l.valueFormat):t,g=J(()=>l.value?l.valueFormat?e.toDate(l.value,l.valueFormat):l.value:l.value===``?void 0:l.value),[_,v]=df(()=>g.value||e.getNow(),{defaultValue:J(()=>l.defaultValue?l.valueFormat?e.toDate(l.defaultValue,l.valueFormat):l.defaultValue:l.defaultValue===``?void 0:l.defaultValue).value,value:g}),[y,b]=df(`month`,{value:St(l,`mode`)}),x=J(()=>y.value===`year`?`month`:`date`),S=J(()=>t=>(l.validRange?e.isAfter(l.validRange[0],t)||e.isAfter(t,l.validRange[1]):!1)||!!l.disabledDate?.call(l,t)),C=(e,t)=>{o(`panelChange`,h(e),t)},w=e=>{if(v(e),!r(e,_.value)){(x.value===`date`&&!n(e,_.value)||x.value===`month`&&!t(e,_.value))&&C(e,y.value);let r=h(e);o(`update:value`,r),o(`change`,r)}},T=e=>{b(e),C(_.value,e)},E=(e,t)=>{w(e),o(`select`,h(e),{source:t})},[D]=Kt(`Calendar`,J(()=>{let{locale:e}=l,t=Z(Z({},et),e);return t.lang=Z(Z({},t.lang),(e||{}).lang),t}));return()=>{let t=e.getNow(),{dateFullCellRender:i=s?.dateFullCellRender,dateCellRender:a=s?.dateCellRender,monthFullCellRender:o=s?.monthFullCellRender,monthCellRender:h=s?.monthCellRender,headerRender:g=s?.headerRender,fullscreen:v=!0,validRange:b}=l,C=n=>{let{current:o}=n;return i?i({current:o}):U(`div`,{class:K(`${u.value}-cell-inner`,`${m.value}-date`,{[`${m.value}-date-today`]:r(t,o)})},[U(`div`,{class:`${m.value}-date-value`},[String(e.getDate(o)).padStart(2,`0`)]),U(`div`,{class:`${m.value}-date-content`},[a&&a({current:o})])])},w=(r,i)=>{let{current:a}=r;if(o)return o({current:a});let s=i.shortMonths||e.locale.getShortMonths(i.locale);return U(`div`,{class:K(`${u.value}-cell-inner`,`${m.value}-date`,{[`${m.value}-date-today`]:n(t,a)})},[U(`div`,{class:`${m.value}-date-value`},[s[e.getMonth(a)]]),U(`div`,{class:`${m.value}-date-content`},[h&&h({current:a})])])};return f(U(`div`,Y(Y({},c),{},{class:K(m.value,{[`${m.value}-full`]:v,[`${m.value}-mini`]:!v,[`${m.value}-rtl`]:d.value===`rtl`},c.class,p.value)}),[g?g({value:_.value,type:y.value,onChange:e=>{E(e,`customize`)},onTypeChange:T}):U(MT,{prefixCls:m.value,value:_.value,generateConfig:e,mode:y.value,fullscreen:v,locale:D.value.lang,validRange:b,onChange:E,onModeChange:T},null),U(Mw,{value:_.value,prefixCls:u.value,locale:D.value.lang,generateConfig:e,dateRender:C,monthCellRender:e=>w(e,D.value.lang),onSelect:e=>{E(e,x.value)},mode:x.value,picker:x.value,disabledDate:S.value,hideHeader:!0},null)]))}}});return i.install=function(e){return e.component(i.name,i),e},i}var oE=a(aE(nC));function sE(e){let t=q(),n=q(!1);function r(){var r=[...arguments];n.value||(ir.cancel(t.value),t.value=ir(()=>{e(...r)}))}return ut(()=>{n.value=!0,ir.cancel(t.value)}),r}function cE(e){let t=q([]),n=q(typeof e==`function`?e():e),r=sE(()=>{let e=n.value;t.value.forEach(t=>{e=t(e)}),t.value=[],n.value=e});function i(e){t.value.push(e),r()}return[n,i]}var lE=u({compatConfig:{MODE:3},name:`TabNode`,props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:[`click`,`resize`,`remove`,`focus`],setup(e,t){let{expose:n,attrs:r}=t,i=H();function a(t){e.tab?.disabled||e.onClick(t)}n({domRef:i});function o(t){t.preventDefault(),t.stopPropagation(),e.editable.onEdit(`remove`,{key:e.tab?.key,event:t})}let s=J(()=>e.editable&&e.closable!==!1&&!e.tab?.disabled);return()=>{let{prefixCls:t,id:n,active:c,tab:{key:l,tab:u,disabled:d,closeIcon:f},renderWrapper:p,removeAriaLabel:m,editable:h,onFocus:g}=e,_=`${t}-tab`,v=U(`div`,{key:l,ref:i,class:K(_,{[`${_}-with-remove`]:s.value,[`${_}-active`]:c,[`${_}-disabled`]:d}),style:r.style,onClick:a},[U(`div`,{role:`tab`,"aria-selected":c,id:n&&`${n}-tab-${l}`,class:`${_}-btn`,"aria-controls":n&&`${n}-panel-${l}`,"aria-disabled":d,tabindex:d?null:0,onClick:e=>{e.stopPropagation(),a(e)},onKeydown:e=>{[$.SPACE,$.ENTER].includes(e.which)&&(e.preventDefault(),a(e))},onFocus:g},[typeof u==`function`?u():u]),s.value&&U(`button`,{type:`button`,"aria-label":m||`remove`,tabindex:0,class:`${_}-remove`,onClick:e=>{e.stopPropagation(),o(e)}},[f?.()||h.removeIcon?.call(h)||`×`])]);return p?p(v):v}}}),uE={width:0,height:0,left:0,top:0};function dE(e,t){let n=H(new Map);return S(()=>{let r=new Map,i=e.value,a=t.value.get(i[0]?.key)||uE,o=a.left+a.width;for(let e=0;e{let{prefixCls:t,editable:n,locale:a}=e;return!n||n.showAdd===!1?null:U(`button`,{ref:i,type:`button`,class:`${t}-nav-add`,style:r.style,"aria-label":a?.addAriaLabel||`Add tab`,onClick:e=>{n.onEdit(`add`,{event:e})}},[n.addIcon?n.addIcon():`+`])}}}),pE=u({compatConfig:{MODE:3},name:`OperationNode`,inheritAttrs:!1,props:{prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:f.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function},popupClassName:String,getPopupContainer:d()},emits:[`tabClick`],slots:Object,setup(e,t){let{attrs:n,slots:r}=t,[i,a]=ff(!1),[o,s]=ff(null),c=t=>{let n=e.tabs.filter(e=>!e.disabled),r=n.findIndex(e=>e.key===o.value)||0,i=n.length;for(let e=0;e{let{which:n}=t;if(!i.value){[$.DOWN,$.SPACE,$.ENTER].includes(n)&&(a(!0),t.preventDefault());return}switch(n){case $.UP:c(-1),t.preventDefault();break;case $.DOWN:c(1),t.preventDefault();break;case $.ESC:a(!1);break;case $.SPACE:case $.ENTER:o.value!==null&&e.onTabClick(o.value,t);break}},u=J(()=>`${e.id}-more-popup`),d=J(()=>o.value===null?null:`${u.value}-${o.value}`),f=(t,n)=>{t.preventDefault(),t.stopPropagation(),e.editable.onEdit(`remove`,{key:n,event:t})};return V(()=>{G(o,()=>{let e=document.getElementById(d.value);e&&e.scrollIntoView&&e.scrollIntoView(!1)},{flush:`post`,immediate:!0})}),G(i,()=>{i.value||s(null)}),yx({}),()=>{let{prefixCls:t,id:s,tabs:c,locale:p,mobile:m,moreIcon:h=r.moreIcon?.call(r)||U(ax,null,null),moreTransitionName:g,editable:_,tabBarGutter:v,rtl:y,onTabClick:b,popupClassName:x}=e;if(!c.length)return null;let S=`${t}-dropdown`,C=p?.dropdownAriaLabel,w={[y?`marginRight`:`marginLeft`]:v};c.length||(w.visibility=`hidden`,w.order=1);let T=K({[`${S}-rtl`]:y,[`${x}`]:!0}),E=m?null:U(tb,{prefixCls:S,trigger:[`hover`],visible:i.value,transitionName:g,onVisibleChange:a,overlayClassName:T,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:e.getPopupContainer},{overlay:()=>U(wS,{onClick:e=>{let{key:t,domEvent:n}=e;b(t,n),a(!1)},id:u.value,tabindex:-1,role:`listbox`,"aria-activedescendant":d.value,selectedKeys:[o.value],"aria-label":C===void 0?`expanded dropdown`:C},{default:()=>[c.map(t=>{let n=_&&t.closable!==!1&&!t.disabled;return U(Kx,{key:t.key,id:`${u.value}-${t.key}`,role:`option`,"aria-controls":s&&`${s}-panel-${t.key}`,disabled:t.disabled},{default:()=>[U(`span`,null,[typeof t.tab==`function`?t.tab():t.tab]),n&&U(`button`,{type:`button`,"aria-label":e.removeAriaLabel||`remove`,tabindex:0,class:`${S}-menu-item-remove`,onClick:e=>{e.stopPropagation(),f(e,t.key)}},[t.closeIcon?.call(t)||_.removeIcon?.call(_)||`×`])]})})]}),default:()=>U(`button`,{type:`button`,class:`${t}-nav-more`,style:w,tabindex:-1,"aria-hidden":`true`,"aria-haspopup":`listbox`,"aria-controls":u.value,id:`${s}-more`,"aria-expanded":i.value,onKeydown:l},[h])});return U(`div`,{class:K(`${t}-nav-operations`,n.class),style:n.style},[E,U(fE,{prefixCls:t,locale:p,editable:_},null)])}}}),mE=Symbol(`tabsContextKey`),hE=e=>{fe(mE,e)},gE=()=>g(mE,{tabs:H([]),prefixCls:H()});u({compatConfig:{MODE:3},name:`TabsContextProvider`,inheritAttrs:!1,props:{tabs:{type:Object,default:void 0},prefixCls:{type:String,default:void 0}},setup(e,t){let{slots:n}=t;return hE(Ft(e)),()=>n.default?.call(n)}});var _E=.1,vE=.01,yE=20,bE=.995**yE;function xE(e,t){let[n,r]=ff(),[i,a]=ff(0),[o,s]=ff(0),[c,l]=ff(),u=H();function d(e){let{screenX:t,screenY:n}=e.touches[0];r({x:t,y:n}),clearInterval(u.value)}function f(e){if(!n.value)return;e.preventDefault();let{screenX:o,screenY:c}=e.touches[0],u=o-n.value.x,d=c-n.value.y;t(u,d),r({x:o,y:c});let f=Date.now();s(f-i.value),a(f),l({x:u,y:d})}function p(){if(!n.value)return;let e=c.value;if(r(null),l(null),e){let n=e.x/o.value,r=e.y/o.value;if(Math.max(Math.abs(n),Math.abs(r))<_E)return;let i=n,a=r;u.value=setInterval(()=>{if(Math.abs(i)o?(i=n,m.value=`x`):(i=r,m.value=`y`),t(-i,-i)&&e.preventDefault()}let g=H({onTouchStart:d,onTouchMove:f,onTouchEnd:p,onWheel:h});function _(e){g.value.onTouchStart(e)}function v(e){g.value.onTouchMove(e)}function y(e){g.value.onTouchEnd(e)}function b(e){g.value.onWheel(e)}V(()=>{var t,n;document.addEventListener(`touchmove`,v,{passive:!1}),document.addEventListener(`touchend`,y,{passive:!1}),(t=e.value)==null||t.addEventListener(`touchstart`,_,{passive:!1}),(n=e.value)==null||n.addEventListener(`wheel`,b,{passive:!1})}),ut(()=>{document.removeEventListener(`touchmove`,v),document.removeEventListener(`touchend`,y)})}function SE(e,t){let n=H(e);function r(e){let r=typeof e==`function`?e(n.value):e;r!==n.value&&t(r,n.value),n.value=r}return[n,r]}var CE=()=>{let e=H(new Map);return ne(()=>{e.value=new Map}),[t=>n=>{e.value.set(t,n)},e]},wE={width:0,height:0,left:0,top:0,right:0},TE=()=>({id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:Qt(),editable:Qt(),moreIcon:f.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:Qt(),popupClassName:String,getPopupContainer:d(),onTabClick:{type:Function},onTabScroll:{type:Function}}),EE=(e,t)=>{let{offsetWidth:n,offsetHeight:r,offsetTop:i,offsetLeft:a}=e,{width:o,height:s,x:c,y:l}=e.getBoundingClientRect();return Math.abs(o-n)<1?[o,s,c-t.x,l-t.y]:[n,r,a,i]},DE=u({compatConfig:{MODE:3},name:`TabNavList`,inheritAttrs:!1,props:TE(),slots:Object,emits:[`tabClick`,`tabScroll`],setup(e,t){let{attrs:n,slots:r}=t,{tabs:i,prefixCls:a}=gE(),o=q(),s=q(),c=q(),l=q(),[u,d]=CE(),f=J(()=>e.tabPosition===`top`||e.tabPosition===`bottom`),[p,m]=SE(0,(t,n)=>{f.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?`left`:`right`})}),[h,g]=SE(0,(t,n)=>{!f.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?`top`:`bottom`})}),[_,v]=ff(0),[y,b]=ff(0),[x,C]=ff(null),[w,T]=ff(null),[E,D]=ff(0),[O,k]=ff(0),[A,j]=cE(new Map),M=dE(i,A),N=J(()=>`${a.value}-nav-operations-hidden`),P=q(0),F=q(0);S(()=>{f.value?e.rtl?(P.value=0,F.value=Math.max(0,_.value-x.value)):(P.value=Math.min(0,x.value-_.value),F.value=0):(P.value=Math.min(0,w.value-y.value),F.value=0)});let I=e=>eF.value?F.value:e,L=q(),[ee,te]=ff(),ne=()=>{te(Date.now())},R=()=>{clearTimeout(L.value)},re=(e,t)=>{e(e=>I(e+t))};xE(o,(e,t)=>{if(f.value){if(x.value>=_.value)return!1;re(m,e)}else{if(w.value>=y.value)return!1;re(g,t)}return R(),ne(),!0}),G(ee,()=>{R(),ee.value&&(L.value=setTimeout(()=>{te(0)},100))});let ie=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey,n=M.value.get(t)||{width:0,height:0,left:0,right:0,top:0};if(f.value){let t=p.value;e.rtl?n.rightp.value+x.value&&(t=n.right+n.width-x.value):n.left<-p.value?t=-n.left:n.left+n.width>-p.value+x.value&&(t=-(n.left+n.width-x.value)),g(0),m(I(t))}else{let e=h.value;n.top<-h.value?e=-n.top:n.top+n.height>-h.value+w.value&&(e=-(n.top+n.height-w.value)),m(0),g(I(e))}},ae=q(0),oe=q(0);S(()=>{let t,n,r,a,o,s,c=M.value;[`top`,`bottom`].includes(e.tabPosition)?(t=`width`,a=x.value,o=_.value,s=E.value,n=e.rtl?`right`:`left`,r=Math.abs(p.value)):(t=`height`,a=w.value,o=_.value,s=O.value,n=`top`,r=-h.value);let l=a;o+s>a&&or+l){f=e-1;break}}let m=0;for(let e=d-1;e>=0;--e)if((c.get(u[e].key)||wE)[n]{j(()=>{let e=new Map,t=s.value?.getBoundingClientRect();return i.value.forEach(n=>{let{key:r}=n,i=d.value.get(r),a=i?.$el||i;if(a){let[n,i,o,s]=EE(a,t);e.set(r,{width:n,height:i,left:o,top:s})}}),e})};G(()=>i.value.map(e=>e.key).join(`%%`),()=>{z()},{flush:`post`});let se=()=>{let e=o.value?.offsetWidth||0,t=o.value?.offsetHeight||0,n=l.value?.$el||{},r=n.offsetWidth||0,i=n.offsetHeight||0;C(e),T(t),D(r),k(i);let a=(s.value?.offsetWidth||0)-r,c=(s.value?.offsetHeight||0)-i;v(a),b(c),z()},B=J(()=>[...i.value.slice(0,ae.value),...i.value.slice(oe.value+1)]),[V,ce]=ff(),le=J(()=>M.value.get(e.activeKey)),H=q(),ue=()=>{ir.cancel(H.value)};G([le,f,()=>e.rtl],()=>{let t={};le.value&&(f.value?(e.rtl?t.right=xt(le.value.right):t.left=xt(le.value.left),t.width=xt(le.value.width)):(t.top=xt(le.value.top),t.height=xt(le.value.height))),ue(),H.value=ir(()=>{ce(t)})}),G([()=>e.activeKey,le,M,f],()=>{ie()},{flush:`post`}),G([()=>e.rtl,()=>e.tabBarGutter,()=>e.activeKey,()=>i.value],()=>{se()},{flush:`post`});let de=e=>{let{position:t,prefixCls:n,extra:r}=e;if(!r)return null;let i=r?.({position:t});return i?U(`div`,{class:`${n}-extra-content`},[i]):null};return ut(()=>{R(),ue()}),()=>{let{id:t,animated:d,activeKey:m,rtl:g,editable:v,locale:b,tabPosition:S,tabBarGutter:C,onTabClick:T}=e,{class:E,style:D}=n,O=a.value,k=!!B.value.length,A=`${O}-nav-wrap`,j,M,P,F;f.value?g?(M=p.value>0,j=p.value+x.value<_.value):(j=p.value<0,M=-p.value+x.value<_.value):(P=h.value<0,F=-h.value+w.value{let{key:i}=e;return U(lE,{id:t,prefixCls:O,key:i,tab:e,style:n===0?void 0:I,closable:e.closable,editable:v,active:i===m,removeAriaLabel:b?.removeAriaLabel,ref:u(i),onClick:e=>{T(i,e)},onFocus:()=>{ie(i),ne(),o.value&&(g||(o.value.scrollLeft=0),o.value.scrollTop=0)}},r)});return U(`div`,{role:`tablist`,class:K(`${O}-nav`,E),style:D,onKeydown:()=>{ne()}},[U(de,{position:`left`,prefixCls:O,extra:r.leftExtra},null),U(Qn,{onResize:se},{default:()=>[U(`div`,{class:K(A,{[`${A}-ping-left`]:j,[`${A}-ping-right`]:M,[`${A}-ping-top`]:P,[`${A}-ping-bottom`]:F}),ref:o},[U(Qn,{onResize:se},{default:()=>[U(`div`,{ref:s,class:`${O}-nav-list`,style:{transform:`translate(${p.value}px, ${h.value}px)`,transition:ee.value?`none`:void 0}},[L,U(fE,{ref:l,prefixCls:O,locale:b,editable:v,style:Z(Z({},L.length===0?void 0:I),{visibility:k?`hidden`:null})},null),U(`div`,{class:K(`${O}-ink-bar`,{[`${O}-ink-bar-animated`]:d.inkBar}),style:V.value},null)])]})])]}),U(pE,Y(Y({},e),{},{removeAriaLabel:b?.removeAriaLabel,ref:c,prefixCls:O,tabs:B.value,class:!k&&N.value}),r_(r,[`moreIcon`])),U(de,{position:`right`,prefixCls:O,extra:r.rightExtra},null),U(de,{position:`right`,prefixCls:O,extra:r.tabBarExtraContent},null)])}}}),OE=u({compatConfig:{MODE:3},name:`TabPanelList`,inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup(e){let{tabs:t,prefixCls:n}=gE();return()=>{let{id:r,activeKey:i,animated:a,tabPosition:o,rtl:s,destroyInactiveTabPane:c}=e,l=a.tabPane,u=n.value,d=t.value.findIndex(e=>e.key===i);return U(`div`,{class:`${u}-content-holder`},[U(`div`,{class:[`${u}-content`,`${u}-content-${o}`,{[`${u}-content-animated`]:l}],style:d&&l?{[s?`marginRight`:`marginLeft`]:`-${d}00%`}:null},[t.value.map(e=>ao(e.node,{key:e.key,prefixCls:u,tabKey:e.key,id:r,animated:l,active:e.key===i,destroyInactiveTabPane:c}))])])}}}),kE=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:`none`,"&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:`absolute`,transition:`none`,inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[R_(e,`slide-up`),R_(e,`slide-down`)]]},AE=e=>{let{componentCls:t,tabsCardHorizontalPadding:n,tabsCardHeadBackground:r,tabsCardGutter:i,colorSplit:a}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:r,border:`${e.lineWidth}px ${e.lineType} ${a}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:e.colorPrimary,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:`hidden`}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${i}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${i}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},jE=e=>{let{componentCls:t,tabsHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{[`${t}-dropdown`]:Z(Z({},rn(e)),{position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:`block`,"&-hidden":{display:`none`},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${r}px 0`,overflowX:`hidden`,overflowY:`auto`,textAlign:{_skip_check_:!0,value:`left`},listStyleType:`none`,backgroundColor:e.colorBgContainer,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,"&-item":Z(Z({},xe),{display:`flex`,alignItems:`center`,minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:`nowrap`},"&-remove":{flex:`none`,marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:`transparent`,border:0,cursor:`pointer`,"&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:`transparent`,cursor:`not-allowed`}}})}})}},ME=e=>{let{componentCls:t,margin:n,colorSplit:r}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:`column`,[`> ${t}-nav, > div > ${t}-nav`]:{margin:`0 0 ${n}px 0`,"&::before":{position:`absolute`,right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${r}`,content:`''`},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow}, + right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav, + > div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:`${n}px`,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:`column`,minWidth:e.controlHeight*1.25,[`${t}-tab`]:{padding:`${e.paddingXS}px ${e.paddingLG}px`,textAlign:`center`},[`${t}-tab + ${t}-tab`]:{margin:`${e.margin}px 0 0 0`},[`${t}-nav-wrap`]:{flexDirection:`column`,"&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:`1 0 auto`,flexDirection:`column`}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-e.lineWidth},borderRight:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},NE=e=>{let{componentCls:t,padding:n}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px 0`,fontSize:e.fontSize}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${n}px 0`,fontSize:e.fontSizeLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXXS*1.5}px ${n}px`}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${e.borderRadius}px ${e.borderRadius}px`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadius}px ${e.borderRadius}px 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadius}px 0 0 ${e.borderRadius}px`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px ${n}px ${e.paddingXXS*1.5}px`}}}}}},PE=e=>{let{componentCls:t,tabsActiveColor:n,tabsHoverColor:r,iconCls:i,tabsHorizontalGutter:a}=e,o=`${t}-tab`;return{[o]:{position:`relative`,display:`inline-flex`,alignItems:`center`,padding:`${e.paddingSM}px 0`,fontSize:`${e.fontSize}px`,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,"&-btn, &-remove":Z({"&:focus:not(:focus-visible), &:active":{color:n}},de(e)),"&-btn":{outline:`none`,transition:`all 0.3s`},"&-remove":{flex:`none`,marginRight:{_skip_check_:!0,value:-e.marginXXS},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},"&:hover":{color:r},[`&${o}-active ${o}-btn`]:{color:e.colorPrimary,textShadow:e.tabsActiveTextShadow},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[`&${o}-disabled ${o}-btn, &${o}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${o}-remove ${i}`]:{margin:0},[i]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${o} + ${o}`]:{margin:{_skip_check_:!0,value:`0 0 0 ${a}px`}}}},FE=e=>{let{componentCls:t,tabsHorizontalGutter:n,iconCls:r,tabsCardGutter:i}=e;return{[`${t}-rtl`]:{direction:`rtl`,[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:`0 0 0 ${n}px`},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${e.marginSM}px`}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${e.marginXXS}px`},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:`${i}px`},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:`rtl`},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:`right`}}}}},IE=e=>{let{componentCls:t,tabsCardHorizontalPadding:n,tabsCardHeight:r,tabsCardGutter:i,tabsHoverColor:a,tabsActiveColor:o,colorSplit:s}=e;return{[t]:Z(Z(Z(Z({},rn(e)),{display:`flex`,[`> ${t}-nav, > div > ${t}-nav`]:{position:`relative`,display:`flex`,flex:`none`,alignItems:`center`,[`${t}-nav-wrap`]:{position:`relative`,display:`flex`,flex:`auto`,alignSelf:`stretch`,overflow:`hidden`,whiteSpace:`nowrap`,transform:`translate(0)`,"&::before, &::after":{position:`absolute`,zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:`''`,pointerEvents:`none`}},[`${t}-nav-list`]:{position:`relative`,display:`flex`,transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:`flex`,alignSelf:`stretch`},[`${t}-nav-operations-hidden`]:{position:`absolute`,visibility:`hidden`,pointerEvents:`none`},[`${t}-nav-more`]:{position:`relative`,padding:n,background:`transparent`,border:0,"&::after":{position:`absolute`,right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.controlHeightLG/8,transform:`translateY(100%)`,content:`''`}},[`${t}-nav-add`]:Z({minWidth:`${r}px`,marginLeft:{_skip_check_:!0,value:`${i}px`},padding:`0 ${e.paddingXS}px`,background:`transparent`,border:`${e.lineWidth}px ${e.lineType} ${s}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,outline:`none`,cursor:`pointer`,color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:o}},de(e))},[`${t}-extra-content`]:{flex:`none`},[`${t}-ink-bar`]:{position:`absolute`,background:e.colorPrimary,pointerEvents:`none`}}),PE(e)),{[`${t}-content`]:{position:`relative`,display:`flex`,width:`100%`,"&-animated":{transition:`margin 0.3s`}},[`${t}-content-holder`]:{flex:`auto`,minWidth:0,minHeight:0},[`${t}-tabpane`]:{outline:`none`,flex:`none`,width:`100%`}}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping'])`]:{justifyContent:`center`}}}}}},LE=v(`Tabs`,e=>{let t=e.controlHeightLG,n=B(e,{tabsHoverColor:e.colorPrimaryHover,tabsActiveColor:e.colorPrimaryActive,tabsCardHorizontalPadding:`${(t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth}px ${e.padding}px`,tabsCardHeight:t,tabsCardGutter:e.marginXXS/2,tabsHorizontalGutter:32,tabsCardHeadBackground:e.colorFillAlter,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:`0 0 0.25px currentcolor`,tabsDropdownHeight:200,tabsDropdownWidth:120});return[NE(n),FE(n),ME(n),jE(n),AE(n),IE(n),kE(n)]},e=>({zIndexPopup:e.zIndexPopupBase+50})),RE=0,zE=()=>({prefixCls:{type:String},id:{type:String},popupClassName:String,getPopupContainer:d(),activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:_(),animated:W([Boolean,Object]),renderTabBar:d(),tabBarGutter:{type:Number},tabBarStyle:Qt(),tabPosition:_(),destroyInactiveTabPane:Q(),hideAdd:Boolean,type:_(),size:_(),centered:Boolean,onEdit:d(),onChange:d(),onTabClick:d(),onTabScroll:d(),"onUpdate:activeKey":d(),locale:Qt(),onPrevClick:d(),onNextClick:d(),tabBarExtraContent:f.any});function BE(e){return e.map(e=>{if(Nt(e)){let t=Z({},e.props||{});for(let[e,n]of Object.entries(t))delete t[e],t[ue(e)]=n;let n=e.children||{},r=e.key===void 0?void 0:e.key,{tab:i=n.tab,disabled:a,forceRender:o,closable:s,animated:c,active:l,destroyInactiveTabPane:u}=t;return Z(Z({key:r},t),{node:e,closeIcon:n.closeIcon,tab:i,disabled:a===``||a,forceRender:o===``||o,closable:s===``||s,animated:c===``||c,active:l===``||l,destroyInactiveTabPane:u===``||u})}return null}).filter(e=>e)}var VE=u({compatConfig:{MODE:3},name:`InternalTabs`,inheritAttrs:!1,props:Z(Z({},Zn(zE(),{tabPosition:`top`,animated:{inkBar:!0,tabPane:!1}})),{tabs:Ue()}),slots:Object,setup(e,t){let{attrs:n,slots:r}=t;pi(e.onPrevClick===void 0&&e.onNextClick===void 0,`Tabs`,"`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),pi(e.tabBarExtraContent===void 0,`Tabs`,"`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),pi(r.tabBarExtraContent===void 0,`Tabs`,"`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");let{prefixCls:i,direction:a,size:o,rootPrefixCls:s,getPopupContainer:c}=X(`tabs`,e),[l,u]=LE(i),d=J(()=>a.value===`rtl`),f=J(()=>{let{animated:t,tabPosition:n}=e;return t===!1||[`left`,`right`].includes(n)?{inkBar:!1,tabPane:!1}:t===!0?{inkBar:!0,tabPane:!0}:Z({inkBar:!0,tabPane:!1},typeof t==`object`?t:{})}),[p,m]=ff(!1);V(()=>{m(vd())});let[h,g]=df(()=>e.tabs[0]?.key,{value:J(()=>e.activeKey),defaultValue:e.defaultActiveKey}),[_,v]=ff(()=>e.tabs.findIndex(e=>e.key===h.value));S(()=>{let t=e.tabs.findIndex(e=>e.key===h.value);t===-1&&(t=Math.max(0,Math.min(_.value,e.tabs.length-1)),g(e.tabs[t]?.key)),v(t)});let[y,b]=df(null,{value:J(()=>e.id)}),x=J(()=>p.value&&![`left`,`right`].includes(e.tabPosition)?`top`:e.tabPosition);V(()=>{e.id||(b(`rc-tabs-${RE}`),RE+=1)});let C=(t,n)=>{var r,i;(r=e.onTabClick)==null||r.call(e,t,n);let a=t!==h.value;g(t),a&&((i=e.onChange)==null||i.call(e,t))};return hE({tabs:J(()=>e.tabs),prefixCls:i}),()=>{let{id:t,type:a,tabBarGutter:m,tabBarStyle:g,locale:_,destroyInactiveTabPane:v,renderTabBar:b=r.renderTabBar,onTabScroll:S,hideAdd:w,centered:T}=e,E={id:y.value,activeKey:h.value,animated:f.value,tabPosition:x.value,rtl:d.value,mobile:p.value},D;a===`editable-card`&&(D={onEdit:(t,n)=>{let{key:r,event:i}=n;var a;(a=e.onEdit)==null||a.call(e,t===`add`?i:r,t)},removeIcon:()=>U(Pe,null,null),addIcon:r.addIcon?r.addIcon:()=>U(cn,null,null),showAdd:w!==!0});let O,k=Z(Z({},E),{moreTransitionName:`${s.value}-slide-up`,editable:D,locale:_,tabBarGutter:m,onTabClick:C,onTabScroll:S,style:g,getPopupContainer:c.value,popupClassName:K(e.popupClassName,u.value)});O=b?b(Z(Z({},k),{DefaultTabBar:DE})):U(DE,k,r_(r,[`moreIcon`,`leftExtra`,`rightExtra`,`tabBarExtraContent`]));let A=i.value;return l(U(`div`,Y(Y({},n),{},{id:t,class:K(A,`${A}-${x.value}`,{[u.value]:!0,[`${A}-${o.value}`]:o.value,[`${A}-card`]:[`card`,`editable-card`].includes(a),[`${A}-editable-card`]:a===`editable-card`,[`${A}-centered`]:T,[`${A}-mobile`]:p.value,[`${A}-editable`]:a===`editable-card`,[`${A}-rtl`]:d.value},n.class)}),[O,U(OE,Y(Y({destroyInactiveTabPane:v},E),{},{animated:f.value}),null)]))}}}),HE=u({compatConfig:{MODE:3},name:`ATabs`,inheritAttrs:!1,props:Zn(zE(),{tabPosition:`top`,animated:{inkBar:!0,tabPane:!1}}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=e=>{i(`update:activeKey`,e),i(`change`,e)};return()=>{let t=BE(ce(r.default?.call(r)));return U(VE,Y(Y(Y({},Br(e,[`onUpdate:activeKey`])),n),{},{onChange:a,tabs:t}),r)}}}),UE=u({compatConfig:{MODE:3},name:`ATabPane`,inheritAttrs:!1,__ANT_TAB_PANE:!0,props:{tab:f.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}},slots:Object,setup(e,t){let{attrs:n,slots:r}=t,i=H(e.forceRender);G([()=>e.active,()=>e.destroyInactiveTabPane],()=>{e.active?i.value=!0:e.destroyInactiveTabPane&&(i.value=!1)},{immediate:!0});let a=J(()=>e.active?{}:e.animated?{visibility:`hidden`,height:0,overflowY:`hidden`}:{display:`none`});return()=>{let{prefixCls:t,forceRender:o,id:s,active:c,tabKey:l}=e;return U(`div`,{id:s&&`${s}-panel-${l}`,role:`tabpanel`,tabindex:c?0:-1,"aria-labelledby":s&&`${s}-tab-${l}`,"aria-hidden":!c,style:[a.value,n.style],class:[`${t}-tabpane`,c&&`${t}-tabpane-active`,n.class]},[(c||i.value||o)&&r.default?.call(r)])}}}),WE=HE;WE.TabPane=UE,WE.install=function(e){return e.component(WE.name,WE),e.component(UE.name,UE),e};var GE=WE,KE=e=>{let{antCls:t,componentCls:n,cardHeadHeight:r,cardPaddingBase:i,cardHeadTabsMarginBottom:a}=e;return Z(Z({display:`flex`,justifyContent:`center`,flexDirection:`column`,minHeight:r,marginBottom:-1,padding:`0 ${i}px`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,background:`transparent`,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},D()),{"&-wrapper":{width:`100%`,display:`flex`,alignItems:`center`},"&-title":Z(Z({display:`inline-block`,flex:1},xe),{[` + > ${n}-typography, + > ${n}-typography-edit-content + `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:`both`,marginBottom:a,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,"&-bar":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`}}})},qE=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:` + ${i}px 0 0 0 ${n}, + 0 ${i}px 0 0 ${n}, + ${i}px ${i}px 0 0 ${n}, + ${i}px 0 0 0 ${n} inset, + 0 ${i}px 0 0 ${n} inset; + `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},JE=e=>{let{componentCls:t,iconCls:n,cardActionsLiMargin:r,cardActionsIconSize:i,colorBorderSecondary:a}=e;return Z(Z({margin:0,padding:0,listStyle:`none`,background:e.colorBgContainer,borderTop:`${e.lineWidth}px ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `},D()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:`center`,"> span":{position:`relative`,display:`block`,minWidth:e.cardActionsIconSize*2,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,"&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:`inline-block`,width:`100%`,color:e.colorTextDescription,lineHeight:`${e.fontSize*e.lineHeight}px`,transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:`${i*e.lineHeight}px`}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${a}`}}})},YE=e=>Z(Z({margin:`-${e.marginXXS}px 0`,display:`flex`},D()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:`hidden`,flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Z({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},xe),"&-description":{color:e.colorTextDescription}}),XE=e=>{let{componentCls:t,cardPaddingBase:n,colorFillAlter:r}=e;return{[`${t}-head`]:{padding:`0 ${n}px`,background:r,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${e.padding}px ${n}px`}}},ZE=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},QE=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadow:a,cardPaddingBase:o}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:KE(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:``,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:Z({padding:o,borderRadius:` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},D()),[`${t}-grid`]:qE(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`},img:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`}},[`${t}-actions`]:JE(e),[`${t}-meta`]:YE(e)}),[`${t}-bordered`]:{border:`${e.lineWidth}px ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:`pointer`,transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:`transparent`,boxShadow:n}},[`${t}-contain-grid`]:{[`${t}-body`]:{display:`flex`,flexWrap:`wrap`},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:-e.lineWidth,marginInlineStart:-e.lineWidth,padding:0}},[`${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:r}}},[`${t}-type-inner`]:XE(e),[`${t}-loading`]:ZE(e),[`${t}-rtl`]:{direction:`rtl`}}},$E=e=>{let{componentCls:t,cardPaddingSM:n,cardHeadHeightSM:r}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:r,padding:`0 ${n}px`,fontSize:e.fontSize,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{minHeight:r,paddingTop:0,display:`flex`,alignItems:`center`}}}}},eD=v(`Card`,e=>{let t=B(e,{cardShadow:e.boxShadowCard,cardHeadHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,cardHeadHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardHeadTabsMarginBottom:-e.padding-e.lineWidth,cardActionsLiMargin:`${e.paddingSM}px 0`,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[QE(t),$E(t)]}),tD=u({compatConfig:{MODE:3},name:`SkeletonTitle`,props:{prefixCls:String,width:{type:[Number,String]}},setup(e){return()=>{let{prefixCls:t,width:n}=e;return U(`h3`,{class:t,style:{width:typeof n==`number`?`${n}px`:n}},null)}}}),nD=u({compatConfig:{MODE:3},name:`SkeletonParagraph`,props:{prefixCls:String,width:{type:[Number,String,Array]},rows:Number},setup(e){let t=t=>{let{width:n,rows:r=2}=e;if(Array.isArray(n))return n[t];if(r-1===t)return n};return()=>{let{prefixCls:n,rows:r}=e,i=[...Array(r)].map((e,n)=>{let r=t(n);return U(`li`,{key:n,style:{width:typeof r==`number`?`${r}px`:r}},null)});return U(`ul`,{class:n},[i])}}}),rD=()=>({prefixCls:String,size:[String,Number],shape:String,active:{type:Boolean,default:void 0}}),iD=e=>{let{prefixCls:t,size:n,shape:r}=e,i=K({[`${t}-lg`]:n===`large`,[`${t}-sm`]:n===`small`}),a=K({[`${t}-circle`]:r===`circle`,[`${t}-square`]:r===`square`,[`${t}-round`]:r===`round`}),o=typeof n==`number`?{width:`${n}px`,height:`${n}px`,lineHeight:`${n}px`}:{};return U(`span`,{class:K(t,i,a),style:o},null)};iD.displayName=`SkeletonElement`;var aD=new N(`ant-skeleton-loading`,{"0%":{transform:`translateX(-37.5%)`},"100%":{transform:`translateX(37.5%)`}}),oD=e=>({height:e,lineHeight:`${e}px`}),sD=e=>Z({width:e},oD(e)),cD=e=>({position:`relative`,zIndex:0,overflow:`hidden`,background:`transparent`,"&::after":{position:`absolute`,top:0,insetInlineEnd:`-150%`,bottom:0,insetInlineStart:`-150%`,background:e.skeletonLoadingBackground,animationName:aD,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:`ease`,animationIterationCount:`infinite`,content:`""`}}),lD=e=>Z({width:e*5,minWidth:e*5},oD(e)),uD=e=>{let{skeletonAvatarCls:t,color:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a}=e;return{[`${t}`]:Z({display:`inline-block`,verticalAlign:`top`,background:n},sD(r)),[`${t}${t}-circle`]:{borderRadius:`50%`},[`${t}${t}-lg`]:Z({},sD(i)),[`${t}${t}-sm`]:Z({},sD(a))}},dD=e=>{let{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:i,controlHeightSM:a,color:o}=e;return{[`${r}`]:Z({display:`inline-block`,verticalAlign:`top`,background:o,borderRadius:n},lD(t)),[`${r}-lg`]:Z({},lD(i)),[`${r}-sm`]:Z({},lD(a))}},fD=e=>Z({width:e},oD(e)),pD=e=>{let{skeletonImageCls:t,imageSizeBase:n,color:r,borderRadiusSM:i}=e;return{[`${t}`]:Z(Z({display:`flex`,alignItems:`center`,justifyContent:`center`,verticalAlign:`top`,background:r,borderRadius:i},fD(n*2)),{[`${t}-path`]:{fill:`#bfbfbf`},[`${t}-svg`]:Z(Z({},fD(n)),{maxWidth:n*4,maxHeight:n*4}),[`${t}-svg${t}-svg-circle`]:{borderRadius:`50%`}}),[`${t}${t}-circle`]:{borderRadius:`50%`}}},mD=(e,t,n)=>{let{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:`50%`},[`${n}${r}-round`]:{borderRadius:t}}},hD=e=>Z({width:e*2,minWidth:e*2},oD(e)),gD=e=>{let{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a,color:o}=e;return Z(Z(Z(Z(Z({[`${n}`]:Z({display:`inline-block`,verticalAlign:`top`,background:o,borderRadius:t,width:r*2,minWidth:r*2},hD(r))},mD(e,r,n)),{[`${n}-lg`]:Z({},hD(i))}),mD(e,i,`${n}-lg`)),{[`${n}-sm`]:Z({},hD(a))}),mD(e,a,`${n}-sm`))},_D=e=>{let{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:i,skeletonButtonCls:a,skeletonInputCls:o,skeletonImageCls:s,controlHeight:c,controlHeightLG:l,controlHeightSM:u,color:d,padding:f,marginSM:p,borderRadius:m,skeletonTitleHeight:h,skeletonBlockRadius:g,skeletonParagraphLineHeight:_,controlHeightXS:v,skeletonParagraphMarginTop:y}=e;return{[`${t}`]:{display:`table`,width:`100%`,[`${t}-header`]:{display:`table-cell`,paddingInlineEnd:f,verticalAlign:`top`,[`${n}`]:Z({display:`inline-block`,verticalAlign:`top`,background:d},sD(c)),[`${n}-circle`]:{borderRadius:`50%`},[`${n}-lg`]:Z({},sD(l)),[`${n}-sm`]:Z({},sD(u))},[`${t}-content`]:{display:`table-cell`,width:`100%`,verticalAlign:`top`,[`${r}`]:{width:`100%`,height:h,background:d,borderRadius:g,[`+ ${i}`]:{marginBlockStart:u}},[`${i}`]:{padding:0,"> li":{width:`100%`,height:_,listStyle:`none`,background:d,borderRadius:g,"+ li":{marginBlockStart:v}}},[`${i}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:`61%`}},[`&-round ${t}-content`]:{[`${r}, ${i} > li`]:{borderRadius:m}}},[`${t}-with-avatar ${t}-content`]:{[`${r}`]:{marginBlockStart:p,[`+ ${i}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Z(Z(Z(Z({display:`inline-block`,width:`auto`},gD(e)),uD(e)),dD(e)),pD(e)),[`${t}${t}-block`]:{width:`100%`,[`${a}`]:{width:`100%`},[`${o}`]:{width:`100%`}},[`${t}${t}-active`]:{[` + ${r}, + ${i} > li, + ${n}, + ${a}, + ${o}, + ${s} + `]:Z({},cD(e))}}},vD=v(`Skeleton`,e=>{let{componentCls:t}=e;return[_D(B(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:e.controlHeight*1.5,skeletonTitleHeight:e.controlHeight/2,skeletonBlockRadius:e.borderRadiusSM,skeletonParagraphLineHeight:e.controlHeight/2,skeletonParagraphMarginTop:e.marginLG+e.marginXXS,borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.color} 25%, ${e.colorGradientEnd} 37%, ${e.color} 63%)`,skeletonLoadingMotionDuration:`1.4s`}))]},e=>{let{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n}}),yD=()=>({active:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},prefixCls:String,avatar:{type:[Boolean,Object],default:void 0},title:{type:[Boolean,Object],default:void 0},paragraph:{type:[Boolean,Object],default:void 0},round:{type:Boolean,default:void 0}});function bD(e){return e&&typeof e==`object`?e:{}}function xD(e,t){return e&&!t?{size:`large`,shape:`square`}:{size:`large`,shape:`circle`}}function SD(e,t){return!e&&t?{width:`38%`}:e&&t?{width:`50%`}:{}}function CD(e,t){let n={};return(!e||!t)&&(n.width=`61%`),!e&&t?n.rows=3:n.rows=2,n}var wD=u({compatConfig:{MODE:3},name:`ASkeleton`,props:Zn(yD(),{avatar:!1,title:!0,paragraph:!0}),setup(e,t){let{slots:n}=t,{prefixCls:r,direction:i}=X(`skeleton`,e),[a,o]=vD(r);return()=>{let{loading:t,avatar:s,title:c,paragraph:l,active:u,round:d}=e,f=r.value;if(t||e.loading===void 0){let e=!!s||s===``,t=!!c||c===``,n=!!l||l===``,r;if(e){let e=Z(Z({prefixCls:`${f}-avatar`},xD(t,n)),bD(s));r=U(`div`,{class:`${f}-header`},[U(iD,e,null)])}let p;if(t||n){let r;t&&(r=U(tD,Z(Z({prefixCls:`${f}-title`},SD(e,n)),bD(c)),null));let i;n&&(i=U(nD,Z(Z({prefixCls:`${f}-paragraph`},CD(e,t)),bD(l)),null)),p=U(`div`,{class:`${f}-content`},[r,i])}let m=K(f,{[`${f}-with-avatar`]:e,[`${f}-active`]:u,[`${f}-rtl`]:i.value===`rtl`,[`${f}-round`]:d,[o.value]:!0});return a(U(`div`,{class:m},[r,p]))}return n.default?.call(n)}}}),TD=u({compatConfig:{MODE:3},name:`ASkeletonButton`,props:Zn(Z(Z({},rD()),{size:String,block:Boolean}),{size:`default`}),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active,[`${t.value}-block`]:e.block},r.value));return()=>n(U(`div`,{class:i.value},[U(iD,Y(Y({},e),{},{prefixCls:`${t.value}-button`}),null)]))}}),ED=u({compatConfig:{MODE:3},name:`ASkeletonInput`,props:Z(Z({},Br(rD(),[`shape`])),{size:String,block:Boolean}),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active,[`${t.value}-block`]:e.block},r.value));return()=>n(U(`div`,{class:i.value},[U(iD,Y(Y({},e),{},{prefixCls:`${t.value}-input`}),null)]))}}),DD=`M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z`,OD=u({compatConfig:{MODE:3},name:`ASkeletonImage`,props:Br(rD(),[`size`,`shape`,`active`]),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,r.value));return()=>n(U(`div`,{class:i.value},[U(`div`,{class:`${t.value}-image`},[U(`svg`,{viewBox:`0 0 1098 1024`,xmlns:`http://www.w3.org/2000/svg`,class:`${t.value}-image-svg`},[U(`path`,{d:DD,class:`${t.value}-image-path`},null)])])]))}}),kD=u({compatConfig:{MODE:3},name:`ASkeletonAvatar`,props:Zn(Z(Z({},rD()),{shape:String}),{size:`default`,shape:`circle`}),setup(e){let{prefixCls:t}=X(`skeleton`,e),[n,r]=vD(t),i=J(()=>K(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active},r.value));return()=>n(U(`div`,{class:i.value},[U(iD,Y(Y({},e),{},{prefixCls:`${t.value}-avatar`}),null)]))}});wD.Button=TD,wD.Avatar=kD,wD.Input=ED,wD.Image=OD,wD.Title=tD,wD.install=function(e){return e.component(wD.name,wD),e.component(wD.Button.name,TD),e.component(wD.Avatar.name,kD),e.component(wD.Input.name,ED),e.component(wD.Image.name,OD),e.component(wD.Title.name,tD),e};var AD=wD,{TabPane:jD}=GE,MD=u({compatConfig:{MODE:3},name:`ACard`,inheritAttrs:!1,props:{prefixCls:String,title:f.any,extra:f.any,bordered:{type:Boolean,default:!0},bodyStyle:{type:Object,default:void 0},headStyle:{type:Object,default:void 0},loading:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},type:{type:String},size:{type:String},actions:f.any,tabList:{type:Array},tabBarExtraContent:f.any,activeTabKey:String,defaultActiveTabKey:String,cover:f.any,onTabChange:{type:Function}},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a,size:o}=X(`card`,e),[s,c]=eD(i),l=e=>e.map((t,n)=>p(t)&&!Te(t)||!p(t)?U(`li`,{style:{width:`${100/e.length}%`},key:`action-${n}`},[U(`span`,null,[t])]):null),u=t=>{var n;(n=e.onTabChange)==null||n.call(e,t)},d=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t;return e.forEach(e=>{e&&ym(e.type)&&e.type.__ANT_CARD_GRID&&(t=!0)}),t};return()=>{let{headStyle:t={},bodyStyle:f={},loading:p,bordered:m=!0,type:h,tabList:g,hoverable:_,activeTabKey:v,defaultActiveTabKey:y,tabBarExtraContent:b=R(n.tabBarExtraContent?.call(n)),title:x=R(n.title?.call(n)),extra:S=R(n.extra?.call(n)),actions:C=R(n.actions?.call(n)),cover:w=R(n.cover?.call(n))}=e,T=ce(n.default?.call(n)),E=i.value,D={[`${E}`]:!0,[c.value]:!0,[`${E}-loading`]:p,[`${E}-bordered`]:m,[`${E}-hoverable`]:!!_,[`${E}-contain-grid`]:d(T),[`${E}-contain-tabs`]:g&&g.length,[`${E}-${o.value}`]:o.value,[`${E}-type-${h}`]:!!h,[`${E}-rtl`]:a.value===`rtl`},O=U(AD,{loading:!0,active:!0,paragraph:{rows:4},title:!1},{default:()=>[T]}),k=v!==void 0,A={size:`large`,[k?`activeKey`:`defaultActiveKey`]:k?v:y,onChange:u,class:`${E}-head-tabs`},j,M=g&&g.length?U(GE,A,{default:()=>[g.map(e=>{let{tab:t,slots:r}=e,i=r?.tab;pi(!r,`Card`,"tabList slots is deprecated, Please use `customTab` instead.");let a=t===void 0?n[i]?n[i](e):null:t;return a=uo(n,`customTab`,e,()=>[a]),U(jD,{tab:a,key:e.key,disabled:e.disabled},null)})],rightExtra:b?()=>b:null}):null;(x||S||M)&&(j=U(`div`,{class:`${E}-head`,style:t},[U(`div`,{class:`${E}-head-wrapper`},[x&&U(`div`,{class:`${E}-head-title`},[x]),S&&U(`div`,{class:`${E}-extra`},[S])]),M]));let N=w?U(`div`,{class:`${E}-cover`},[w]):null,P=U(`div`,{class:`${E}-body`,style:f},[p?O:T]),F=C&&C.length?U(`ul`,{class:`${E}-actions`},[l(C)]):null;return s(U(`div`,Y(Y({ref:`cardContainerRef`},r),{},{class:[D,r.class]}),[j,N,T&&T.length?P:null,F]))}}}),ND=u({compatConfig:{MODE:3},name:`ACardMeta`,props:{prefixCls:String,title:pt(),description:pt(),avatar:pt()},slots:Object,setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`card`,e);return()=>{let t={[`${r.value}-meta`]:!0},i=on(n,e,`avatar`),a=on(n,e,`title`),o=on(n,e,`description`),s=i?U(`div`,{class:`${r.value}-meta-avatar`},[i]):null,c=a?U(`div`,{class:`${r.value}-meta-title`},[a]):null,l=o?U(`div`,{class:`${r.value}-meta-description`},[o]):null,u=c||l?U(`div`,{class:`${r.value}-meta-detail`},[c,l]):null;return U(`div`,{class:t},[s,u])}}}),PD=u({compatConfig:{MODE:3},name:`ACardGrid`,__ANT_CARD_GRID:!0,props:{prefixCls:String,hoverable:{type:Boolean,default:!0}},setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`card`,e),i=J(()=>({[`${r.value}-grid`]:!0,[`${r.value}-grid-hoverable`]:e.hoverable}));return()=>U(`div`,{class:i.value},[n.default?.call(n)])}});MD.Meta=ND,MD.Grid=PD,MD.install=function(e){return e.component(MD.name,MD),e.component(ND.name,ND),e.component(PD.name,PD),e};var FD=MD,ID=()=>({prefixCls:String,activeKey:W([Array,Number,String]),defaultActiveKey:W([Array,Number,String]),accordion:Q(),destroyInactivePanel:Q(),bordered:Q(),expandIcon:d(),openAnimation:f.object,expandIconPosition:_(),collapsible:_(),ghost:Q(),onChange:d(),"onUpdate:activeKey":d()}),LD=()=>({openAnimation:f.object,prefixCls:String,header:f.any,headerClass:String,showArrow:Q(),isActive:Q(),destroyInactivePanel:Q(),disabled:Q(),accordion:Q(),forceRender:Q(),expandIcon:d(),extra:f.any,panelKey:W(),collapsible:_(),role:String,onItemClick:d()}),RD=e=>{let{componentCls:t,collapseContentBg:n,padding:r,collapseContentPaddingHorizontal:i,collapseHeaderBg:a,collapseHeaderPadding:s,collapsePanelBorderRadius:c,lineWidth:l,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:m,fontSize:h,lineHeight:g,marginSM:_,paddingSM:v,motionDurationSlow:y,fontSizeIcon:b}=e,x=`${l}px ${u} ${d}`;return{[t]:Z(Z({},rn(e)),{backgroundColor:a,border:x,borderBottom:0,borderRadius:`${c}px`,"&-rtl":{direction:`rtl`},[`& > ${t}-item`]:{borderBottom:x,"&:last-child":{[` + &, + & > ${t}-header`]:{borderRadius:`0 0 ${c}px ${c}px`}},[`> ${t}-header`]:{position:`relative`,display:`flex`,flexWrap:`nowrap`,alignItems:`flex-start`,padding:s,color:p,lineHeight:g,cursor:`pointer`,transition:`all ${y}, visibility 0s`,[`> ${t}-header-text`]:{flex:`auto`},"&:focus":{outline:`none`},[`${t}-expand-icon`]:{height:h*g,display:`flex`,alignItems:`center`,paddingInlineEnd:_},[`${t}-arrow`]:Z(Z({},o()),{fontSize:b,svg:{transition:`transform ${y}`}}),[`${t}-header-text`]:{marginInlineEnd:`auto`}},[`${t}-header-collapsible-only`]:{cursor:`default`,[`${t}-header-text`]:{flex:`none`,cursor:`pointer`},[`${t}-expand-icon`]:{cursor:`pointer`}},[`${t}-icon-collapsible-only`]:{cursor:`default`,[`${t}-expand-icon`]:{cursor:`pointer`}},[`&${t}-no-arrow`]:{[`> ${t}-header`]:{paddingInlineStart:v}}},[`${t}-content`]:{color:f,backgroundColor:n,borderTop:x,[`& > ${t}-content-box`]:{padding:`${r}px ${i}px`},"&-hidden":{display:`none`}},[`${t}-item:last-child`]:{[`> ${t}-content`]:{borderRadius:`0 0 ${c}px ${c}px`}},[`& ${t}-item-disabled > ${t}-header`]:{"\n &,\n & > .arrow\n ":{color:m,cursor:`not-allowed`}},[`&${t}-icon-position-end`]:{[`& > ${t}-item`]:{[`> ${t}-header`]:{[`${t}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:_}}}}})}},zD=e=>{let{componentCls:t}=e,n=`> ${t}-item > ${t}-header ${t}-arrow svg`;return{[`${t}-rtl`]:{[n]:{transform:`rotate(180deg)`}}}},BD=e=>{let{componentCls:t,collapseHeaderBg:n,paddingXXS:r,colorBorder:i}=e;return{[`${t}-borderless`]:{backgroundColor:n,border:0,[`> ${t}-item`]:{borderBottom:`1px solid ${i}`},[` + > ${t}-item:last-child, + > ${t}-item:last-child ${t}-header + `]:{borderRadius:0},[`> ${t}-item:last-child`]:{borderBottom:0},[`> ${t}-item > ${t}-content`]:{backgroundColor:`transparent`,borderTop:0},[`> ${t}-item > ${t}-content > ${t}-content-box`]:{paddingTop:r}}}},VD=e=>{let{componentCls:t,paddingSM:n}=e;return{[`${t}-ghost`]:{backgroundColor:`transparent`,border:0,[`> ${t}-item`]:{borderBottom:0,[`> ${t}-content`]:{backgroundColor:`transparent`,border:0,[`> ${t}-content-box`]:{paddingBlock:n}}}}}},HD=v(`Collapse`,e=>{let t=B(e,{collapseContentBg:e.colorBgContainer,collapseHeaderBg:e.colorFillAlter,collapseHeaderPadding:`${e.paddingSM}px ${e.padding}px`,collapsePanelBorderRadius:e.borderRadiusLG,collapseContentPaddingHorizontal:16});return[RD(t),BD(t),VD(t),zD(t),$_(t)]});function UD(e){let t=e;if(!Array.isArray(t)){let e=typeof t;t=e===`number`||e===`string`?[t]:[]}return t.map(e=>String(e))}var WD=u({compatConfig:{MODE:3},name:`ACollapse`,inheritAttrs:!1,props:Zn(ID(),{accordion:!1,destroyInactivePanel:!1,bordered:!0,expandIconPosition:`start`}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=H(UD(dy([e.activeKey,e.defaultActiveKey])));G(()=>e.activeKey,()=>{a.value=UD(e.activeKey)},{deep:!0});let{prefixCls:o,direction:s,rootPrefixCls:c}=X(`collapse`,e),[l,u]=HD(o),d=J(()=>{let{expandIconPosition:t}=e;return t===void 0?s.value===`rtl`?`end`:`start`:t}),f=t=>{let{expandIcon:n=r.expandIcon}=e,i=n?n(t):U(gx,{rotate:t.isActive?90:void 0},null);return U(`div`,{class:[`${o.value}-expand-icon`,u.value],onClick:()=>[`header`,`icon`].includes(e.collapsible)&&m(t.panelKey)},[Nt(Array.isArray(n)?i[0]:i)?ao(i,{class:`${o.value}-arrow`},!1):i])},p=t=>{e.activeKey===void 0&&(a.value=t);let n=e.accordion?t[0]:t;i(`update:activeKey`,n),i(`change`,n)},m=t=>{let n=a.value;if(e.accordion)n=n[0]===t?[]:[t];else{n=[...n];let e=n.indexOf(t);e>-1?n.splice(e,1):n.push(t)}p(n)},h=(t,n)=>{var r;if(Te(t))return;let i=a.value,{accordion:s,destroyInactivePanel:l,collapsible:u,openAnimation:d}=e,p=d||aS(`${c.value}-motion-collapse`),h=String(t.key??n),{header:g=((r=t.children)?.header)?.call(r),headerClass:_,collapsible:v,disabled:y}=t.props||{},b=!1;b=s?i[0]===h:i.indexOf(h)>-1;let x=v??u;return(y||y===``)&&(x=`disabled`),ao(t,{key:h,panelKey:h,header:g,headerClass:_,isActive:b,prefixCls:o.value,destroyInactivePanel:l,openAnimation:p,accordion:s,onItemClick:x===`disabled`?null:m,expandIcon:f,collapsible:x})},g=()=>ce(r.default?.call(r)).map(h);return()=>{let{accordion:t,bordered:r,ghost:i}=e,a=K(o.value,{[`${o.value}-borderless`]:!r,[`${o.value}-icon-position-${d.value}`]:!0,[`${o.value}-rtl`]:s.value===`rtl`,[`${o.value}-ghost`]:!!i,[n.class]:!!n.class},u.value);return l(U(`div`,Y(Y({class:a},Xe(n)),{},{style:n.style,role:t?`tablist`:null}),[g()]))}}}),GD=u({compatConfig:{MODE:3},name:`PanelContent`,props:LD(),setup(e,t){let{slots:n}=t,r=q(!1);return S(()=>{(e.isActive||e.forceRender)&&(r.value=!0)}),()=>{if(!r.value)return null;let{prefixCls:t,isActive:i,role:a}=e;return U(`div`,{class:K(`${t}-content`,{[`${t}-content-active`]:i,[`${t}-content-inactive`]:!i}),role:a},[U(`div`,{class:`${t}-content-box`},[n.default?.call(n)])])}}}),KD=u({compatConfig:{MODE:3},name:`ACollapsePanel`,inheritAttrs:!1,props:Zn(LD(),{showArrow:!0,isActive:!1,onItemClick(){},headerClass:``,forceRender:!1}),slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t;pi(e.disabled===void 0,`Collapse.Panel`,'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');let{prefixCls:a}=X(`collapse`,e),o=()=>{r(`itemClick`,e.panelKey)},s=e=>{(e.key===`Enter`||e.keyCode===13||e.which===13)&&o()};return()=>{let{header:t=n.header?.call(n),headerClass:r,isActive:c,showArrow:l,destroyInactivePanel:u,accordion:d,forceRender:f,openAnimation:p,expandIcon:m=n.expandIcon,extra:h=n.extra?.call(n),collapsible:g}=e,_=g===`disabled`,v=a.value,y=K(`${v}-header`,{[r]:r,[`${v}-header-collapsible-only`]:g===`header`,[`${v}-icon-collapsible-only`]:g===`icon`}),b=K({[`${v}-item`]:!0,[`${v}-item-active`]:c,[`${v}-item-disabled`]:_,[`${v}-no-arrow`]:!l,[`${i.class}`]:!!i.class}),x=U(`i`,{class:`arrow`},null);l&&typeof m==`function`&&(x=m(e));let S=Mt(U(GD,{prefixCls:v,isActive:c,forceRender:f,role:d?`tabpanel`:null},{default:n.default}),[[ht,c]]),C=Z({appear:!1,css:!1},p);return U(`div`,Y(Y({},i),{},{class:b}),[U(`div`,{class:y,onClick:()=>![`header`,`icon`].includes(g)&&o(),role:d?`tab`:`button`,tabindex:_?-1:0,"aria-expanded":c,onKeypress:s},[l&&x,U(`span`,{onClick:()=>g===`header`&&o(),class:`${v}-header-text`},[t]),h&&U(`div`,{class:`${v}-extra`},[h])]),U(Re,C,{default:()=>[!u||c?S:null]})])}}});WD.Panel=KD,WD.install=function(e){return e.component(WD.name,WD),e.component(KD.name,KD),e};var qD=WD,JD=function(e){return e.replace(/[A-Z]/g,function(e){return`-`+e.toLowerCase()}).toLowerCase()},YD=function(e){return/[height|width]$/.test(e)},XD=function(e){let t=``,n=Object.keys(e);return n.forEach(function(r,i){let a=e[r];r=JD(r),YD(r)&&typeof a==`number`&&(a+=`px`),a===!0?t+=r:a===!1?t+=`not `+r:t+=`(`+r+`: `+a+`)`,i{[`touchstart`,`touchmove`,`wheel`].includes(e.type)||e.preventDefault()},nO=e=>{let t=[],n=rO(e),r=iO(e);for(let i=n;ie.currentSlide-aO(e),iO=e=>e.currentSlide+oO(e),aO=e=>e.centerMode?Math.floor(e.slidesToShow/2)+ +(parseInt(e.centerPadding)>0):0,oO=e=>e.centerMode?Math.floor((e.slidesToShow-1)/2)+1+ +(parseInt(e.centerPadding)>0):e.slidesToShow,sO=e=>e&&e.offsetWidth||0,cO=e=>e&&e.offsetHeight||0,lO=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r=e.startX-e.curX,i=e.startY-e.curY;return n=Math.round(Math.atan2(i,r)*180/Math.PI),n<0&&(n=360-Math.abs(n)),n<=45&&n>=0||n<=360&&n>=315?`left`:n>=135&&n<=225?`right`:t===!0?n>=35&&n<=135?`up`:`down`:`vertical`},uO=e=>{let t=!0;return e.infinite||(e.centerMode&&e.currentSlide>=e.slideCount-1||e.slideCount<=e.slidesToShow||e.currentSlide>=e.slideCount-e.slidesToShow)&&(t=!1),t},dO=(e,t)=>{let n={};return t.forEach(t=>n[t]=e[t]),n},fO=e=>{let t=e.children.length,n=e.listRef,r=Math.ceil(sO(n)),i=e.trackRef,a=Math.ceil(sO(i)),o;if(e.vertical)o=r;else{let t=e.centerMode&&parseInt(e.centerPadding)*2;typeof e.centerPadding==`string`&&e.centerPadding.slice(-1)===`%`&&(t*=r/100),o=Math.ceil((r-t)/e.slidesToShow)}let s=n&&cO(n.querySelector(`[data-index="0"]`)),c=s*e.slidesToShow,l=e.currentSlide===void 0?e.initialSlide:e.currentSlide;e.rtl&&e.currentSlide===void 0&&(l=t-1-e.initialSlide);let u=e.lazyLoadedList||[],d=nO(Z(Z({},e),{currentSlide:l,lazyLoadedList:u}),e);u=u.concat(d);let f={slideCount:t,slideWidth:o,listWidth:r,trackWidth:a,currentSlide:l,slideHeight:s,listHeight:c,lazyLoadedList:u};return e.autoplaying===null&&e.autoplay&&(f.autoplaying=`playing`),f},pO=e=>{let{waitForAnimate:t,animating:n,fade:r,infinite:i,index:a,slideCount:o,lazyLoad:s,currentSlide:c,centerMode:l,slidesToScroll:u,slidesToShow:d,useCSS:f}=e,{lazyLoadedList:p}=e;if(t&&n)return{};let m=a,h,g,_,v={},y={},b=i?a:eO(a,0,o-1);if(r){if(!i&&(a<0||a>=o))return{};a<0?m=a+o:a>=o&&(m=a-o),s&&p.indexOf(m)<0&&(p=p.concat(m)),v={animating:!0,currentSlide:m,lazyLoadedList:p,targetSlide:m},y={animating:!1,targetSlide:m}}else h=m,m<0?(h=m+o,i?o%u!==0&&(h=o-o%u):h=0):!uO(e)&&m>c?m=h=c:l&&m>=o?(m=i?o:o-1,h=i?0:o-1):m>=o&&(h=m-o,i?o%u!==0&&(h=0):h=o-d),!i&&m+d>=o&&(h=o-d),g=TO(Z(Z({},e),{slideIndex:m})),_=TO(Z(Z({},e),{slideIndex:h})),i||(g===_&&(m=h),g=_),s&&(p=p.concat(nO(Z(Z({},e),{currentSlide:m})))),f?(v={animating:!0,currentSlide:h,trackStyle:wO(Z(Z({},e),{left:g})),lazyLoadedList:p,targetSlide:b},y={animating:!1,currentSlide:h,trackStyle:CO(Z(Z({},e),{left:_})),swipeLeft:null,targetSlide:b}):v={currentSlide:h,trackStyle:CO(Z(Z({},e),{left:_})),lazyLoadedList:p,targetSlide:b};return{state:v,nextState:y}},mO=(e,t)=>{let n,r,i,{slidesToScroll:a,slidesToShow:o,slideCount:s,currentSlide:c,targetSlide:l,lazyLoad:u,infinite:d}=e,f=s%a===0?(s-c)%a:0;if(t.message===`previous`)r=f===0?a:o-f,i=c-r,u&&!d&&(n=c-r,i=n===-1?s-1:n),d||(i=l-a);else if(t.message===`next`)r=f===0?a:f,i=c+r,u&&!d&&(i=(c+a)%s+f),d||(i=l+a);else if(t.message===`dots`)i=t.index*t.slidesToScroll;else if(t.message===`children`){if(i=t.index,d){let n=kO(Z(Z({},e),{targetSlide:i}));i>t.currentSlide&&n===`left`?i-=s:ie.target.tagName.match(`TEXTAREA|INPUT|SELECT`)||!t?``:e.keyCode===37?n?`next`:`previous`:e.keyCode===39?n?`previous`:`next`:``,gO=(e,t,n)=>(e.target.tagName===`IMG`&&tO(e),!t||!n&&e.type.indexOf(`mouse`)!==-1?``:{dragging:!0,touchObject:{startX:e.touches?e.touches[0].pageX:e.clientX,startY:e.touches?e.touches[0].pageY:e.clientY,curX:e.touches?e.touches[0].pageX:e.clientX,curY:e.touches?e.touches[0].pageY:e.clientY}}),_O=(e,t)=>{let{scrolling:n,animating:r,vertical:i,swipeToSlide:a,verticalSwiping:o,rtl:s,currentSlide:c,edgeFriction:l,edgeDragged:u,onEdge:d,swiped:f,swiping:p,slideCount:m,slidesToScroll:h,infinite:g,touchObject:_,swipeEvent:v,listHeight:y,listWidth:b}=t;if(n)return;if(r)return tO(e);i&&a&&o&&tO(e);let x,S={},C=TO(t);_.curX=e.touches?e.touches[0].pageX:e.clientX,_.curY=e.touches?e.touches[0].pageY:e.clientY,_.swipeLength=Math.round(Math.sqrt((_.curX-_.startX)**2));let w=Math.round(Math.sqrt((_.curY-_.startY)**2));if(!o&&!p&&w>10)return{scrolling:!0};o&&(_.swipeLength=w);let T=(s?-1:1)*(_.curX>_.startX?1:-1);o&&(T=_.curY>_.startY?1:-1);let E=Math.ceil(m/h),D=lO(t.touchObject,o),O=_.swipeLength;return g||(c===0&&(D===`right`||D===`down`)||c+1>=E&&(D===`left`||D===`up`)||!uO(t)&&(D===`left`||D===`up`))&&(O=_.swipeLength*l,u===!1&&d&&(d(D),S.edgeDragged=!0)),!f&&v&&(v(D),S.swiped=!0),x=i?C+y/b*O*T:s?C-O*T:C+O*T,o&&(x=C+O*T),S=Z(Z({},S),{touchObject:_,swipeLeft:x,trackStyle:CO(Z(Z({},t),{left:x}))}),Math.abs(_.curX-_.startX)10&&(S.swiping=!0,tO(e)),S},vO=(e,t)=>{let{dragging:n,swipe:r,touchObject:i,listWidth:a,touchThreshold:o,verticalSwiping:s,listHeight:c,swipeToSlide:l,scrolling:u,onSwipe:d,targetSlide:f,currentSlide:p,infinite:m}=t;if(!n)return r&&tO(e),{};let h=s?c/o:a/o,g=lO(i,s),_={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(u||!i.swipeLength)return _;if(i.swipeLength>h){tO(e),d&&d(g);let n,r,i=m?p:f;switch(g){case`left`:case`up`:r=i+xO(t),n=l?bO(t,r):r,_.currentDirection=0;break;case`right`:case`down`:r=i-xO(t),n=l?bO(t,r):r,_.currentDirection=1;break;default:n=i}_.triggerSlideHandler=n}else{let e=TO(t);_.trackStyle=wO(Z(Z({},t),{left:e}))}return _},yO=e=>{let t=e.infinite?e.slideCount*2:e.slideCount,n=e.infinite?e.slidesToShow*-1:0,r=e.infinite?e.slidesToShow*-1:0,i=[];for(;n{let n=yO(e),r=0;if(t>n[n.length-1])t=n[n.length-1];else for(let e in n){if(t{let t=e.centerMode?e.slideWidth*Math.floor(e.slidesToShow/2):0;if(e.swipeToSlide){let n,r=e.listRef,i=r.querySelectorAll&&r.querySelectorAll(`.slick-slide`)||[];if(Array.from(i).every(r=>{if(!e.vertical){if(r.offsetLeft-t+sO(r)/2>e.swipeLeft*-1)return n=r,!1}else if(r.offsetTop+cO(r)/2>e.swipeLeft*-1)return n=r,!1;return!0}),!n)return 0;let a=e.rtl===!0?e.slideCount-e.currentSlide:e.currentSlide;return Math.abs(n.dataset.index-a)||1}else return e.slidesToScroll},SO=(e,t)=>t.reduce((t,n)=>t&&e.hasOwnProperty(n),!0)?null:console.error(`Keys Missing:`,e),CO=e=>{SO(e,[`left`,`variableWidth`,`slideCount`,`slidesToShow`,`slideWidth`]);let t,n,r=e.slideCount+2*e.slidesToShow;e.vertical?n=r*e.slideHeight:t=OO(e)*e.slideWidth;let i={opacity:1,transition:``,WebkitTransition:``};if(e.useTransform){let t=e.vertical?`translate3d(0px, `+e.left+`px, 0px)`:`translate3d(`+e.left+`px, 0px, 0px)`,n=e.vertical?`translate3d(0px, `+e.left+`px, 0px)`:`translate3d(`+e.left+`px, 0px, 0px)`,r=e.vertical?`translateY(`+e.left+`px)`:`translateX(`+e.left+`px)`;i=Z(Z({},i),{WebkitTransform:t,transform:n,msTransform:r})}else e.vertical?i.top=e.left:i.left=e.left;return e.fade&&(i={opacity:1}),t&&(i.width=t+`px`),n&&(i.height=n+`px`),window&&!window.addEventListener&&window.attachEvent&&(e.vertical?i.marginTop=e.left+`px`:i.marginLeft=e.left+`px`),i},wO=e=>{SO(e,[`left`,`variableWidth`,`slideCount`,`slidesToShow`,`slideWidth`,`speed`,`cssEase`]);let t=CO(e);return e.useTransform?(t.WebkitTransition=`-webkit-transform `+e.speed+`ms `+e.cssEase,t.transition=`transform `+e.speed+`ms `+e.cssEase):e.vertical?t.transition=`top `+e.speed+`ms `+e.cssEase:t.transition=`left `+e.speed+`ms `+e.cssEase,t},TO=e=>{if(e.unslick)return 0;SO(e,[`slideIndex`,`trackRef`,`infinite`,`centerMode`,`slideCount`,`slidesToShow`,`slidesToScroll`,`slideWidth`,`listWidth`,`variableWidth`,`slideHeight`]);let{slideIndex:t,trackRef:n,infinite:r,centerMode:i,slideCount:a,slidesToShow:o,slidesToScroll:s,slideWidth:c,listWidth:l,variableWidth:u,slideHeight:d,fade:f,vertical:p}=e,m=0,h,g,_=0;if(f||e.slideCount===1)return 0;let v=0;if(r?(v=-EO(e),a%s!==0&&t+s>a&&(v=-(t>a?o-(t-a):a%s)),i&&(v+=parseInt(o/2))):(a%s!==0&&t+s>a&&(v=o-a%s),i&&(v=parseInt(o/2))),m=v*c,_=v*d,h=p?t*d*-1+_:t*c*-1+m,u===!0){let a,o=n;if(a=t+EO(e),g=o&&o.childNodes[a],h=g?g.offsetLeft*-1:0,i===!0){a=r?t+EO(e):t,g=o&&o.children[a],h=0;for(let e=0;ee.unslick||!e.infinite?0:e.variableWidth?e.slideCount:e.slidesToShow+ +!!e.centerMode,DO=e=>e.unslick||!e.infinite?0:e.slideCount,OO=e=>e.slideCount===1?1:EO(e)+e.slideCount+DO(e),kO=e=>e.targetSlide>e.currentSlide?e.targetSlide>e.currentSlide+AO(e)?`left`:`right`:e.targetSlide{let{slidesToShow:t,centerMode:n,rtl:r,centerPadding:i}=e;if(n){let e=(t-1)/2+1;return parseInt(i)>0&&(e+=1),r&&t%2==0&&(e+=1),e}return r?0:t-1},jO=e=>{let{slidesToShow:t,centerMode:n,rtl:r,centerPadding:i}=e;if(n){let e=(t-1)/2+1;return parseInt(i)>0&&(e+=1),!r&&t%2==0&&(e+=1),e}return r?t-1:0},MO=()=>!!(typeof window<`u`&&window.document&&window.document.createElement),NO=e=>{let t,n,r,i;i=e.rtl?e.slideCount-1-e.index:e.index;let a=i<0||i>=e.slideCount;e.centerMode?(r=Math.floor(e.slidesToShow/2),n=(i-e.currentSlide)%e.slideCount===0,i>e.currentSlide-r-1&&i<=e.currentSlide+r&&(t=!0)):t=e.currentSlide<=i&&i=e.slideCount?e.targetSlide-e.slideCount:e.targetSlide,{"slick-slide":!0,"slick-active":t,"slick-center":n,"slick-cloned":a,"slick-current":i===o}},PO=function(e){let t={};return(e.variableWidth===void 0||e.variableWidth===!1)&&(t.width=e.slideWidth+(typeof e.slideWidth==`number`?`px`:``)),e.fade&&(t.position=`relative`,e.vertical?t.top=-e.index*parseInt(e.slideHeight)+`px`:t.left=-e.index*parseInt(e.slideWidth)+`px`,t.opacity=+(e.currentSlide===e.index),e.useCSS&&(t.transition=`opacity `+e.speed+`ms `+e.cssEase+`, visibility `+e.speed+`ms `+e.cssEase)),t},FO=(e,t)=>e.key+`-`+t,IO=function(e,t){let n,r=[],i=[],a=[],o=t.length,s=rO(e),c=iO(e);return t.forEach((t,l)=>{let u,d={message:`children`,index:l,slidesToScroll:e.slidesToScroll,currentSlide:e.currentSlide};u=!e.lazyLoad||e.lazyLoad&&e.lazyLoadedList.indexOf(l)>=0?t:U(`div`);let f=PO(Z(Z({},e),{index:l})),p=u.props.class||``,m=NO(Z(Z({},e),{index:l}));if(r.push(so(u,{key:`original`+FO(u,l),tabindex:`-1`,"data-index":l,"aria-hidden":!m[`slick-active`],class:K(m,p),style:Z(Z({outline:`none`},u.props.style||{}),f),onClick:()=>{e.focusOnSelect&&e.focusOnSelect(d)}})),e.infinite&&e.fade===!1){let r=o-l;r<=EO(e)&&o!==e.slidesToShow&&(n=-r,n>=s&&(u=t),m=NO(Z(Z({},e),{index:n})),i.push(so(u,{key:`precloned`+FO(u,n),class:K(m,p),tabindex:`-1`,"data-index":n,"aria-hidden":!m[`slick-active`],style:Z(Z({},u.props.style||{}),f),onClick:()=>{e.focusOnSelect&&e.focusOnSelect(d)}}))),o!==e.slidesToShow&&(n=o+l,n{e.focusOnSelect&&e.focusOnSelect(d)}})))}}),e.rtl?i.concat(r,a).reverse():i.concat(r,a)},LO=(e,t)=>{let{attrs:n,slots:r}=t,i=IO(n,ce(r?.default())),{onMouseenter:a,onMouseover:o,onMouseleave:s}=n,c={onMouseenter:a,onMouseover:o,onMouseleave:s};return U(`div`,Z({class:`slick-track`,style:n.trackStyle},c),[i])};LO.inheritAttrs=!1;var RO=function(e){let t;return t=e.infinite?Math.ceil(e.slideCount/e.slidesToScroll):Math.ceil((e.slideCount-e.slidesToShow)/e.slidesToScroll)+1,t},zO=(e,t)=>{let{attrs:n}=t,{slideCount:r,slidesToScroll:i,slidesToShow:a,infinite:o,currentSlide:s,appendDots:c,customPaging:l,clickHandler:u,dotsClass:d,onMouseenter:f,onMouseover:p,onMouseleave:m}=n,h=RO({slideCount:r,slidesToScroll:i,slidesToShow:a,infinite:o}),g={onMouseenter:f,onMouseover:p,onMouseleave:m},_=[];for(let e=0;e=c&&s<=n:s===c}),f={message:`dots`,index:e,slidesToScroll:i,currentSlide:s};function p(e){e&&e.preventDefault(),u(f)}_=_.concat(U(`li`,{key:e,class:d},[ao(l({i:e}),{onClick:p})]))}return ao(c({dots:_}),Z({class:d},g))};zO.inheritAttrs=!1;function BO(){}function VO(e,t,n){n&&n.preventDefault(),t(e,n)}var HO=(e,t)=>{let{attrs:n}=t,{clickHandler:r,infinite:i,currentSlide:a,slideCount:o,slidesToShow:s}=n,c={"slick-arrow":!0,"slick-prev":!0},l=function(e){VO({message:`previous`},r,e)};!i&&(a===0||o<=s)&&(c[`slick-disabled`]=!0,l=BO);let u={key:`0`,"data-role":`none`,class:c,style:{display:`block`},onClick:l},d={currentSlide:a,slideCount:o},f;return f=n.prevArrow?ao(n.prevArrow(Z(Z({},u),d)),{key:`0`,class:c,style:{display:`block`},onClick:l},!1):U(`button`,Y({key:`0`,type:`button`},u),[` `,en(`Previous`)]),f};HO.inheritAttrs=!1;var UO=(e,t)=>{let{attrs:n}=t,{clickHandler:r,currentSlide:i,slideCount:a}=n,o={"slick-arrow":!0,"slick-next":!0},s=function(e){VO({message:`next`},r,e)};uO(n)||(o[`slick-disabled`]=!0,s=BO);let c={key:`1`,"data-role":`none`,class:K(o),style:{display:`block`},onClick:s},l={currentSlide:i,slideCount:a},u;return u=n.nextArrow?ao(n.nextArrow(Z(Z({},c),l)),{key:`1`,class:K(o),style:{display:`block`},onClick:s},!1):U(`button`,Y({key:`1`,type:`button`},c),[` `,en(`Next`)]),u};UO.inheritAttrs=!1;var WO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{this.currentSlide>=e.children.length&&this.changeSlide({message:`index`,index:e.children.length-e.slidesToShow,currentSlide:this.currentSlide}),!this.preProps.autoplay&&e.autoplay?this.handleAutoPlay(`playing`):e.autoplay?this.handleAutoPlay(`update`):this.pause(`paused`)}),this.preProps=Z({},e)}},mounted(){if(this.__emit(`init`),this.lazyLoad){let e=nO(Z(Z({},this.$props),this.$data));e.length>0&&(this.setState(t=>({lazyLoadedList:t.lazyLoadedList.concat(e)})),this.__emit(`lazyLoad`,e))}this.$nextTick(()=>{let e=Z({listRef:this.list,trackRef:this.track,children:this.children},this.$props);this.updateState(e,!0,()=>{this.adaptHeight(),this.autoplay&&this.handleAutoPlay(`playing`)}),this.lazyLoad===`progressive`&&(this.lazyLoadTimer=setInterval(this.progressiveLazyLoad,1e3)),this.ro=new Xn(()=>{this.animating?(this.onWindowResized(!1),this.callbackTimers.push(setTimeout(()=>this.onWindowResized(),this.speed))):this.onWindowResized()}),this.ro.observe(this.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(`.slick-slide`),e=>{e.onfocus=this.$props.pauseOnFocus?this.onSlideFocus:null,e.onblur=this.$props.pauseOnFocus?this.onSlideBlur:null}),window.addEventListener?window.addEventListener(`resize`,this.onWindowResized):window.attachEvent(`onresize`,this.onWindowResized)})},beforeUnmount(){var e;this.animationEndCallback&&clearTimeout(this.animationEndCallback),this.lazyLoadTimer&&clearInterval(this.lazyLoadTimer),this.callbackTimers.length&&(this.callbackTimers.forEach(e=>clearTimeout(e)),this.callbackTimers=[]),window.addEventListener?window.removeEventListener(`resize`,this.onWindowResized):window.detachEvent(`onresize`,this.onWindowResized),this.autoplayTimer&&clearInterval(this.autoplayTimer),(e=this.ro)==null||e.disconnect()},updated(){if(this.checkImagesLoad(),this.__emit(`reInit`),this.lazyLoad){let e=nO(Z(Z({},this.$props),this.$data));e.length>0&&(this.setState(t=>({lazyLoadedList:t.lazyLoadedList.concat(e)})),this.__emit(`lazyLoad`))}this.adaptHeight()},methods:{listRefHandler(e){this.list=e},trackRefHandler(e){this.track=e},adaptHeight(){if(this.adaptiveHeight&&this.list){let e=this.list.querySelector(`[data-index="${this.currentSlide}"]`);this.list.style.height=cO(e)+`px`}},onWindowResized(e){this.debouncedResize&&this.debouncedResize.cancel(),this.debouncedResize=Eg(()=>this.resizeWindow(e),50),this.debouncedResize()},resizeWindow(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.track)return;let t=Z(Z({listRef:this.list,trackRef:this.track,children:this.children},this.$props),this.$data);this.updateState(t,e,()=>{this.autoplay?this.handleAutoPlay(`update`):this.pause(`paused`)}),this.setState({animating:!1}),clearTimeout(this.animationEndCallback),delete this.animationEndCallback},updateState(e,t,n){let r=fO(e);e=Z(Z(Z({},e),r),{slideIndex:r.currentSlide});let i=TO(e);e=Z(Z({},e),{left:i});let a=CO(e);(t||this.children.length!==e.children.length)&&(r.trackStyle=a),this.setState(r,n)},ssrInit(){let e=this.children;if(this.variableWidth){let t=0,n=0,r=[],i=EO(Z(Z(Z({},this.$props),this.$data),{slideCount:e.length})),a=DO(Z(Z(Z({},this.$props),this.$data),{slideCount:e.length}));e.forEach(e=>{let n=(e.props.style?.width)?.split(`px`)[0]||0;r.push(n),t+=n});for(let e=0;e{let r=()=>++n&&n>=t&&this.onWindowResized();if(!e.onclick)e.onclick=()=>e.parentNode.focus();else{let t=e.onclick;e.onclick=()=>{t(),e.parentNode.focus()}}e.onload||(this.$props.lazyLoad?e.onload=()=>{this.adaptHeight(),this.callbackTimers.push(setTimeout(this.onWindowResized,this.speed))}:(e.onload=r,e.onerror=()=>{r(),this.__emit(`lazyLoadError`)}))})},progressiveLazyLoad(){let e=[],t=Z(Z({},this.$props),this.$data);for(let n=this.currentSlide;n=-EO(t);n--)if(this.lazyLoadedList.indexOf(n)<0){e.push(n);break}e.length>0?(this.setState(t=>({lazyLoadedList:t.lazyLoadedList.concat(e)})),this.__emit(`lazyLoad`,e)):this.lazyLoadTimer&&(clearInterval(this.lazyLoadTimer),delete this.lazyLoadTimer)},slideHandler(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],{asNavFor:n,beforeChange:r,speed:i,afterChange:a}=this.$props,{state:o,nextState:s}=pO(Z(Z(Z({index:e},this.$props),this.$data),{trackRef:this.track,useCSS:this.useCSS&&!t}));if(!o)return;r&&r(this.currentSlide,o.currentSlide);let c=o.lazyLoadedList.filter(e=>this.lazyLoadedList.indexOf(e)<0);this.$attrs.onLazyLoad&&c.length>0&&this.__emit(`lazyLoad`,c),!this.$props.waitForAnimate&&this.animationEndCallback&&(clearTimeout(this.animationEndCallback),a&&a(this.currentSlide),delete this.animationEndCallback),this.setState(o,()=>{n&&this.asNavForIndex!==e&&(this.asNavForIndex=e,n.innerSlider.slideHandler(e)),s&&(this.animationEndCallback=setTimeout(()=>{let{animating:e}=s,t=WO(s,[`animating`]);this.setState(t,()=>{this.callbackTimers.push(setTimeout(()=>this.setState({animating:e}),10)),a&&a(o.currentSlide),delete this.animationEndCallback})},i))})},changeSlide(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=mO(Z(Z({},this.$props),this.$data),e);if(!(n!==0&&!n)&&(t===!0?this.slideHandler(n,t):this.slideHandler(n),this.$props.autoplay&&this.handleAutoPlay(`update`),this.$props.focusOnSelect)){let e=this.list.querySelectorAll(`.slick-current`);e[0]&&e[0].focus()}},clickHandler(e){this.clickable===!1&&(e.stopPropagation(),e.preventDefault()),this.clickable=!0},keyHandler(e){let t=hO(e,this.accessibility,this.rtl);t!==``&&this.changeSlide({message:t})},selectHandler(e){this.changeSlide(e)},disableBodyScroll(){window.ontouchmove=e=>{e||=window.event,e.preventDefault&&e.preventDefault(),e.returnValue=!1}},enableBodyScroll(){window.ontouchmove=null},swipeStart(e){this.verticalSwiping&&this.disableBodyScroll();let t=gO(e,this.swipe,this.draggable);t!==``&&this.setState(t)},swipeMove(e){let t=_O(e,Z(Z(Z({},this.$props),this.$data),{trackRef:this.track,listRef:this.list,slideIndex:this.currentSlide}));t&&(t.swiping&&(this.clickable=!1),this.setState(t))},swipeEnd(e){let t=vO(e,Z(Z(Z({},this.$props),this.$data),{trackRef:this.track,listRef:this.list,slideIndex:this.currentSlide}));if(!t)return;let n=t.triggerSlideHandler;delete t.triggerSlideHandler,this.setState(t),n!==void 0&&(this.slideHandler(n),this.$props.verticalSwiping&&this.enableBodyScroll())},touchEnd(e){this.swipeEnd(e),this.clickable=!0},slickPrev(){this.callbackTimers.push(setTimeout(()=>this.changeSlide({message:`previous`}),0))},slickNext(){this.callbackTimers.push(setTimeout(()=>this.changeSlide({message:`next`}),0))},slickGoTo(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(e=Number(e),isNaN(e))return``;this.callbackTimers.push(setTimeout(()=>this.changeSlide({message:`index`,index:e,currentSlide:this.currentSlide},t),0))},play(){let e;if(this.rtl)e=this.currentSlide-this.slidesToScroll;else if(uO(Z(Z({},this.$props),this.$data)))e=this.currentSlide+this.slidesToScroll;else return!1;this.slideHandler(e)},handleAutoPlay(e){this.autoplayTimer&&clearInterval(this.autoplayTimer);let t=this.autoplaying;if(e===`update`){if(t===`hovered`||t===`focused`||t===`paused`)return}else if(e===`leave`){if(t===`paused`||t===`focused`)return}else if(e===`blur`&&(t===`paused`||t===`hovered`))return;this.autoplayTimer=setInterval(this.play,this.autoplaySpeed+50),this.setState({autoplaying:`playing`})},pause(e){this.autoplayTimer&&=(clearInterval(this.autoplayTimer),null);let t=this.autoplaying;e===`paused`?this.setState({autoplaying:`paused`}):e===`focused`?(t===`hovered`||t===`playing`)&&this.setState({autoplaying:`focused`}):t===`playing`&&this.setState({autoplaying:`hovered`})},onDotsOver(){this.autoplay&&this.pause(`hovered`)},onDotsLeave(){this.autoplay&&this.autoplaying===`hovered`&&this.handleAutoPlay(`leave`)},onTrackOver(){this.autoplay&&this.pause(`hovered`)},onTrackLeave(){this.autoplay&&this.autoplaying===`hovered`&&this.handleAutoPlay(`leave`)},onSlideFocus(){this.autoplay&&this.pause(`focused`)},onSlideBlur(){this.autoplay&&this.autoplaying===`focused`&&this.handleAutoPlay(`blur`)},customPaging(e){let{i:t}=e;return U(`button`,null,[t+1])},appendDots(e){let{dots:t}=e;return U(`ul`,{style:{display:`block`}},[t])}},render(){let e=K(`slick-slider`,this.$attrs.class,{"slick-vertical":this.vertical,"slick-initialized":!0}),t=Z(Z({},this.$props),this.$data),n=dO(t,[`fade`,`cssEase`,`speed`,`infinite`,`centerMode`,`focusOnSelect`,`currentSlide`,`lazyLoad`,`lazyLoadedList`,`rtl`,`slideWidth`,`slideHeight`,`listHeight`,`vertical`,`slidesToShow`,`slidesToScroll`,`slideCount`,`trackStyle`,`variableWidth`,`unslick`,`centerPadding`,`targetSlide`,`useCSS`]),{pauseOnHover:r}=this.$props;n=Z(Z({},n),{focusOnSelect:this.focusOnSelect&&this.clickable?this.selectHandler:null,ref:this.trackRefHandler,onMouseleave:r?this.onTrackLeave:GO,onMouseover:r?this.onTrackOver:GO});let i;if(this.dots===!0&&this.slideCount>=this.slidesToShow){let e=dO(t,[`dotsClass`,`slideCount`,`slidesToShow`,`currentSlide`,`slidesToScroll`,`clickHandler`,`children`,`infinite`,`appendDots`]);e.customPaging=this.customPaging,e.appendDots=this.appendDots;let{customPaging:n,appendDots:r}=this.$slots;n&&(e.customPaging=n),r&&(e.appendDots=r);let{pauseOnDotsHover:a}=this.$props;e=Z(Z({},e),{clickHandler:this.changeSlide,onMouseover:a?this.onDotsOver:GO,onMouseleave:a?this.onDotsLeave:GO}),i=U(zO,e,null)}let a,o,s=dO(t,[`infinite`,`centerMode`,`currentSlide`,`slideCount`,`slidesToShow`]);s.clickHandler=this.changeSlide;let{prevArrow:c,nextArrow:l}=this.$slots;c&&(s.prevArrow=c),l&&(s.nextArrow=l),this.arrows&&(a=U(HO,s,null),o=U(UO,s,null));let u=null;this.vertical&&(u={height:typeof this.listHeight==`number`?`${this.listHeight}px`:this.listHeight});let d=null;this.vertical===!1?this.centerMode===!0&&(d={padding:`0px `+this.centerPadding}):this.centerMode===!0&&(d={padding:this.centerPadding+` 0px`});let f=Z(Z({},u),d),p=this.touchMove,m={ref:this.listRefHandler,class:`slick-list`,style:f,onClick:this.clickHandler,onMousedown:p?this.swipeStart:GO,onMousemove:this.dragging&&p?this.swipeMove:GO,onMouseup:p?this.swipeEnd:GO,onMouseleave:this.dragging&&p?this.swipeEnd:GO,[sr?`onTouchstartPassive`:`onTouchstart`]:p?this.swipeStart:GO,[sr?`onTouchmovePassive`:`onTouchmove`]:this.dragging&&p?this.swipeMove:GO,onTouchend:p?this.touchEnd:GO,onTouchcancel:this.dragging&&p?this.swipeEnd:GO,onKeydown:this.accessibility?this.keyHandler:GO},h={class:e,dir:`ltr`,style:this.$attrs.style};return this.unslick&&(m={class:`slick-list`,ref:this.listRefHandler},h={class:e}),U(`div`,h,[this.unslick?``:a,U(`div`,m,[U(LO,n,{default:()=>[this.children]})]),this.unslick?``:o,this.unslick?``:i])}},qO=u({name:`Slider`,mixins:[cu],inheritAttrs:!1,props:Z({},QD),data(){return this._responsiveMediaHandlers=[],{breakpoint:null}},mounted(){if(this.responsive){let e=this.responsive.map(e=>e.breakpoint);e.sort((e,t)=>e-t),e.forEach((t,n)=>{let r;r=ZD(n===0?{minWidth:0,maxWidth:t}:{minWidth:e[n-1]+1,maxWidth:t}),MO()&&this.media(r,()=>{this.setState({breakpoint:t})})});let t=ZD({minWidth:e.slice(-1)[0]});MO()&&this.media(t,()=>{this.setState({breakpoint:null})})}},beforeUnmount(){this._responsiveMediaHandlers.forEach(function(e){e.mql.removeListener(e.listener)})},methods:{innerSliderRefHandler(e){this.innerSlider=e},media(e,t){let n=window.matchMedia(e),r=e=>{let{matches:n}=e;n&&t()};n.addListener(r),r(n),this._responsiveMediaHandlers.push({mql:n,query:e,listener:r})},slickPrev(){var e;(e=this.innerSlider)==null||e.slickPrev()},slickNext(){var e;(e=this.innerSlider)==null||e.slickNext()},slickGoTo(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];var n;(n=this.innerSlider)==null||n.slickGoTo(e,t)},slickPause(){var e;(e=this.innerSlider)==null||e.pause(`paused`)},slickPlay(){var e;(e=this.innerSlider)==null||e.handleAutoPlay(`play`)}},render(){let e,t;this.breakpoint?(t=this.responsive.filter(e=>e.breakpoint===this.breakpoint),e=t[0].settings===`unslick`?`unslick`:Z(Z({},this.$props),t[0].settings)):e=Z({},this.$props),e.centerMode&&(e.slidesToScroll,e.slidesToScroll=1),e.fade&&(e.slidesToShow,e.slidesToScroll,e.slidesToShow=1,e.slidesToScroll=1);let n=c(this)||[];n=n.filter(e=>typeof e==`string`?!!e.trim():!!e),e.variableWidth&&(e.rows>1||e.slidesPerRow>1)&&(console.warn(`variableWidth is not supported in case of rows > 1 or slidesPerRow > 1`),e.variableWidth=!1);let r=[],i=null;for(let t=0;t=n.length));a+=1)o.push(ao(n[a],{key:100*t+10*r+a,tabindex:-1,style:{width:`${100/e.slidesPerRow}%`,display:`inline-block`}}));a.push(U(`div`,{key:10*t+r},[o]))}e.variableWidth?r.push(U(`div`,{key:t,style:{width:i}},[a])):r.push(U(`div`,{key:t},[a]))}return e===`unslick`?U(`div`,{class:`regular slider `+(this.className||``)},[n]):(r.length<=e.slidesToShow&&(e.unslick=!0),U(KO,Y(Y({},Z(Z(Z({},this.$attrs),e),{children:r,ref:this.innerSliderRefHandler})),{},{__propsSymbol__:[]}),this.$slots))}}),JO=e=>{let{componentCls:t,antCls:n,carouselArrowSize:r,carouselDotOffset:i,marginXXS:a}=e,o=-r*1.25,s=a;return{[t]:Z(Z({},rn(e)),{".slick-slider":{position:`relative`,display:`block`,boxSizing:`border-box`,touchAction:`pan-y`,WebkitTouchCallout:`none`,WebkitTapHighlightColor:`transparent`,".slick-track, .slick-list":{transform:`translate3d(0, 0, 0)`,touchAction:`pan-y`}},".slick-list":{position:`relative`,display:`block`,margin:0,padding:0,overflow:`hidden`,"&:focus":{outline:`none`},"&.dragging":{cursor:`pointer`},".slick-slide":{pointerEvents:`none`,[`input${n}-radio-input, input${n}-checkbox-input`]:{visibility:`hidden`},"&.slick-active":{pointerEvents:`auto`,[`input${n}-radio-input, input${n}-checkbox-input`]:{visibility:`visible`}},"> div > div":{verticalAlign:`bottom`}}},".slick-track":{position:`relative`,top:0,insetInlineStart:0,display:`block`,"&::before, &::after":{display:`table`,content:`""`},"&::after":{clear:`both`}},".slick-slide":{display:`none`,float:`left`,height:`100%`,minHeight:1,img:{display:`block`},"&.dragging img":{pointerEvents:`none`}},".slick-initialized .slick-slide":{display:`block`},".slick-vertical .slick-slide":{display:`block`,height:`auto`},".slick-arrow.slick-hidden":{display:`none`},".slick-prev, .slick-next":{position:`absolute`,top:`50%`,display:`block`,width:r,height:r,marginTop:-r/2,padding:0,color:`transparent`,fontSize:0,lineHeight:0,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,"&:hover, &:focus":{color:`transparent`,background:`transparent`,outline:`none`,"&::before":{opacity:1}},"&.slick-disabled::before":{opacity:.25}},".slick-prev":{insetInlineStart:o,"&::before":{content:`"←"`}},".slick-next":{insetInlineEnd:o,"&::before":{content:`"→"`}},".slick-dots":{position:`absolute`,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:15,display:`flex !important`,justifyContent:`center`,paddingInlineStart:0,listStyle:`none`,"&-bottom":{bottom:i},"&-top":{top:i,bottom:`auto`},li:{position:`relative`,display:`inline-block`,flex:`0 1 auto`,boxSizing:`content-box`,width:e.dotWidth,height:e.dotHeight,marginInline:s,padding:0,textAlign:`center`,textIndent:-999,verticalAlign:`top`,transition:`all ${e.motionDurationSlow}`,button:{position:`relative`,display:`block`,width:`100%`,height:e.dotHeight,padding:0,color:`transparent`,fontSize:0,background:e.colorBgContainer,border:0,borderRadius:1,outline:`none`,cursor:`pointer`,opacity:.3,transition:`all ${e.motionDurationSlow}`,"&: hover, &:focus":{opacity:.75},"&::after":{position:`absolute`,inset:-s,content:`""`}},"&.slick-active":{width:e.dotWidthActive,"& button":{background:e.colorBgContainer,opacity:1},"&: hover, &:focus":{opacity:1}}}}})}},YO=e=>{let{componentCls:t,carouselDotOffset:n,marginXXS:r}=e,i={width:e.dotHeight,height:e.dotWidth};return{[`${t}-vertical`]:{".slick-dots":{top:`50%`,bottom:`auto`,flexDirection:`column`,width:e.dotHeight,height:`auto`,margin:0,transform:`translateY(-50%)`,"&-left":{insetInlineEnd:`auto`,insetInlineStart:n},"&-right":{insetInlineEnd:n,insetInlineStart:`auto`},li:Z(Z({},i),{margin:`${r}px 0`,verticalAlign:`baseline`,button:i,"&.slick-active":Z(Z({},i),{button:i})})}}}},XO=e=>{let{componentCls:t}=e;return[{[`${t}-rtl`]:{direction:`rtl`,".slick-dots":{[`${t}-rtl&`]:{flexDirection:`row-reverse`}}}},{[`${t}-vertical`]:{".slick-dots":{[`${t}-rtl&`]:{flexDirection:`column`}}}}]},ZO=v(`Carousel`,e=>{let{controlHeightLG:t,controlHeightSM:n}=e,r=B(e,{carouselArrowSize:t/2,carouselDotOffset:n/2});return[JO(r),YO(r),XO(r)]},{dotWidth:16,dotHeight:3,dotWidthActive:24}),QO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0&&arguments[1];var n;(n=o.value)==null||n.slickGoTo(e,t)},autoplay:e=>{var t;(t=o.value?.innerSlider)==null||t.handleAutoPlay(e)},prev:()=>{var e;(e=o.value)==null||e.slickPrev()},next:()=>{var e;(e=o.value)==null||e.slickNext()},innerSlider:J(()=>o.value?.innerSlider)}),S(()=>{e(t.vertical===void 0,`Carousel`,"`vertical` is deprecated, please use `dotPosition` instead.")});let{prefixCls:s,direction:c}=X(`carousel`,t),[l,u]=ZO(s),d=J(()=>t.dotPosition?t.dotPosition:t.vertical===void 0?`bottom`:t.vertical?`right`:`bottom`),f=J(()=>d.value===`left`||d.value===`right`),p=J(()=>{let e=`slick-dots`;return K({[e]:!0,[`${e}-${d.value}`]:!0,[`${t.dotsClass}`]:!!t.dotsClass})});return()=>{let{dots:e,arrows:n,draggable:a,effect:d}=t,{class:m,style:h}=i,g=QO(i,[`class`,`style`]),_=d===`fade`||t.fade,v=K(s.value,{[`${s.value}-rtl`]:c.value===`rtl`,[`${s.value}-vertical`]:f.value,[`${m}`]:!!m},u.value);return l(U(`div`,{class:v,style:h},[U(qO,Y(Y(Y({ref:o},t),g),{},{dots:!!e,dotsClass:p.value,arrows:n,draggable:a,fade:_,vertical:f.value}),r)]))}}})),ek=`__RC_CASCADER_SPLIT__`,tk=`SHOW_PARENT`,nk=`SHOW_CHILD`;function rk(e){return e.join(ek)}function ik(e){return e.map(rk)}function ak(e){return e.split(ek)}function ok(e){let{label:t,value:n,children:r}=e||{},i=n||`value`;return{label:t||`label`,value:i,key:i,children:r||`children`}}function sk(e,t){return e.isLeaf??!e[t.children]?.length}function ck(e){let t=e.parentElement;if(!t)return;let n=e.offsetTop-t.offsetTop;n-t.scrollTop<0?t.scrollTo({top:n}):n+e.offsetHeight-t.scrollTop>t.offsetHeight&&t.scrollTo({top:n+e.offsetHeight-t.offsetHeight})}var lk=Symbol(`TreeContextKey`),uk=u({compatConfig:{MODE:3},name:`TreeContext`,props:{value:{type:Object}},setup(e,t){let{slots:n}=t;return fe(lk,J(()=>e.value)),()=>n.default?.call(n)}}),dk=()=>g(lk,J(()=>({}))),fk=Symbol(`KeysStateKey`),pk=e=>{fe(fk,e)},mk=()=>g(fk,{expandedKeys:q([]),selectedKeys:q([]),loadedKeys:q([]),loadingKeys:q([]),checkedKeys:q([]),halfCheckedKeys:q([]),expandedKeysSet:J(()=>new Set),selectedKeysSet:J(()=>new Set),loadedKeysSet:J(()=>new Set),loadingKeysSet:J(()=>new Set),checkedKeysSet:J(()=>new Set),halfCheckedKeysSet:J(()=>new Set),flattenNodes:q([])}),hk=e=>{let{prefixCls:t,level:n,isStart:r,isEnd:i}=e,a=`${t}-indent-unit`,o=[];for(let e=0;e({prefixCls:String,focusable:{type:Boolean,default:void 0},activeKey:[Number,String],tabindex:Number,children:f.any,treeData:{type:Array},fieldNames:{type:Object},showLine:{type:[Boolean,Object],default:void 0},showIcon:{type:Boolean,default:void 0},icon:f.any,selectable:{type:Boolean,default:void 0},expandAction:[String,Boolean],disabled:{type:Boolean,default:void 0},multiple:{type:Boolean,default:void 0},checkable:{type:Boolean,default:void 0},checkStrictly:{type:Boolean,default:void 0},draggable:{type:[Function,Boolean]},defaultExpandParent:{type:Boolean,default:void 0},autoExpandParent:{type:Boolean,default:void 0},defaultExpandAll:{type:Boolean,default:void 0},defaultExpandedKeys:{type:Array},expandedKeys:{type:Array},defaultCheckedKeys:{type:Array},checkedKeys:{type:[Object,Array]},defaultSelectedKeys:{type:Array},selectedKeys:{type:Array},allowDrop:{type:Function},dropIndicatorRender:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onKeydown:{type:Function},onContextmenu:{type:Function},onClick:{type:Function},onDblclick:{type:Function},onScroll:{type:Function},onExpand:{type:Function},onCheck:{type:Function},onSelect:{type:Function},onLoad:{type:Function},loadData:{type:Function},loadedKeys:{type:Array},onMouseenter:{type:Function},onMouseleave:{type:Function},onRightClick:{type:Function},onDragstart:{type:Function},onDragenter:{type:Function},onDragover:{type:Function},onDragleave:{type:Function},onDragend:{type:Function},onDrop:{type:Function},onActiveChange:{type:Function},filterTreeNode:{type:Function},motion:f.any,switcherIcon:f.any,height:Number,itemHeight:Number,virtual:{type:Boolean,default:void 0},direction:{type:String},rootClassName:String,rootStyle:Object}),yk=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i"`v-slot:"+e+"` ")}`;let a=q(!1),o=dk(),{expandedKeysSet:s,selectedKeysSet:c,loadedKeysSet:l,loadingKeysSet:u,checkedKeysSet:d,halfCheckedKeysSet:f}=mk(),{dragOverNodeKey:p,dropPosition:m,keyEntities:h}=o.value,g=J(()=>Uk(e.eventKey,{expandedKeysSet:s.value,selectedKeysSet:c.value,loadedKeysSet:l.value,loadingKeysSet:u.value,checkedKeysSet:d.value,halfCheckedKeysSet:f.value,dragOverNodeKey:p,dropPosition:m,keyEntities:h})),_=Wv(()=>g.value.expanded),v=Wv(()=>g.value.selected),y=Wv(()=>g.value.checked),b=Wv(()=>g.value.loaded),x=Wv(()=>g.value.loading),S=Wv(()=>g.value.halfChecked),C=Wv(()=>g.value.dragOver),w=Wv(()=>g.value.dragOverGapTop),T=Wv(()=>g.value.dragOverGapBottom),E=Wv(()=>g.value.pos),D=q(),k=J(()=>{let{eventKey:t}=e,{keyEntities:n}=o.value,{children:r}=n[t]||{};return!!(r||[]).length}),A=J(()=>{let{isLeaf:t}=e,{loadData:n}=o.value,r=k.value;return t===!1?!1:t||!n&&!r||n&&b.value&&!r}),j=J(()=>A.value?null:_.value?bk:xk),M=J(()=>{let{disabled:t}=e,{disabled:n}=o.value;return!!(n||t)}),N=J(()=>{let{checkable:t}=e,{checkable:n}=o.value;return!n||t===!1?!1:n}),P=J(()=>{let{selectable:t}=e,{selectable:n}=o.value;return typeof t==`boolean`?t:n}),F=J(()=>{let{data:t,active:n,checkable:r,disableCheckbox:i,disabled:a,selectable:o}=e;return Z(Z({active:n,checkable:r,disableCheckbox:i,disabled:a,selectable:o},t),{dataRef:t,data:t,isLeaf:A.value,checked:y.value,expanded:_.value,loading:x.value,selected:v.value,halfChecked:S.value})}),I=Zt(),L=J(()=>{let{eventKey:t}=e,{keyEntities:n}=o.value,{parent:r}=n[t]||{};return Z(Z({},Wk(Z({},e,g.value))),{parent:r})}),ee=Ne({eventData:L,eventKey:J(()=>e.eventKey),selectHandle:D,pos:E,key:I.vnode.key});i(ee);let te=e=>{let{onNodeDoubleClick:t}=o.value;t(e,L.value)},ne=e=>{if(M.value)return;let{onNodeSelect:t}=o.value;e.preventDefault(),t(e,L.value)},R=t=>{if(M.value)return;let{disableCheckbox:n}=e,{onNodeCheck:r}=o.value;if(!N.value||n)return;t.preventDefault();let i=!y.value;r(t,L.value,i)},re=e=>{let{onNodeClick:t}=o.value;t(e,L.value),P.value?ne(e):R(e)},ie=e=>{let{onNodeMouseEnter:t}=o.value;t(e,L.value)},ae=e=>{let{onNodeMouseLeave:t}=o.value;t(e,L.value)},oe=e=>{let{onNodeContextMenu:t}=o.value;t(e,L.value)},z=e=>{let{onNodeDragStart:t}=o.value;e.stopPropagation(),a.value=!0,t(e,ee);try{e.dataTransfer.setData(`text/plain`,``)}catch{}},se=e=>{let{onNodeDragEnter:t}=o.value;e.preventDefault(),e.stopPropagation(),t(e,ee)},B=e=>{let{onNodeDragOver:t}=o.value;e.preventDefault(),e.stopPropagation(),t(e,ee)},ce=e=>{let{onNodeDragLeave:t}=o.value;e.stopPropagation(),t(e,ee)},le=e=>{let{onNodeDragEnd:t}=o.value;e.stopPropagation(),a.value=!1,t(e,ee)},H=e=>{let{onNodeDrop:t}=o.value;e.preventDefault(),e.stopPropagation(),a.value=!1,t(e,ee)},ue=e=>{let{onNodeExpand:t}=o.value;x.value||t(e,L.value)},de=()=>{let{data:t}=e,{draggable:n}=o.value;return!!(n&&(!n.nodeDraggable||n.nodeDraggable(t)))},fe=()=>{let{draggable:e,prefixCls:t}=o.value;return e&&e?.icon?U(`span`,{class:`${t}-draggable-icon`},[e.icon]):null},pe=()=>{let{switcherIcon:t=r.switcherIcon||o.value.slots?.[e.data?.slots?.switcherIcon]}=e,{switcherIcon:n}=o.value,i=t||n;return typeof i==`function`?i(F.value):i},me=()=>{let{loadData:e,onNodeLoad:t}=o.value;x.value||e&&_.value&&!A.value&&!k.value&&!b.value&&t(L.value)};V(()=>{me()}),O(()=>{me()});let he=()=>{let{prefixCls:e}=o.value,t=pe();if(A.value)return t===!1?null:U(`span`,{class:K(`${e}-switcher`,`${e}-switcher-noop`)},[t]);let n=K(`${e}-switcher`,`${e}-switcher_${_.value?bk:xk}`);return t===!1?null:U(`span`,{onClick:ue,class:n},[t])},ge=()=>{var t;let{disableCheckbox:n}=e,{prefixCls:r}=o.value,i=M.value;return N.value?U(`span`,{class:K(`${r}-checkbox`,y.value&&`${r}-checkbox-checked`,!y.value&&S.value&&`${r}-checkbox-indeterminate`,(i||n)&&`${r}-checkbox-disabled`),onClick:R},[(t=o.value).customCheckable?.call(t)]):null},_e=()=>{let{prefixCls:e}=o.value;return U(`span`,{class:K(`${e}-iconEle`,`${e}-icon__${j.value||`docu`}`,x.value&&`${e}-icon_loading`)},null)},W=()=>{let{disabled:t,eventKey:n}=e,{draggable:r,dropLevelOffset:i,dropPosition:a,prefixCls:s,indent:c,dropIndicatorRender:l,dragOverNodeKey:u,direction:d}=o.value;return!t&&r!==!1&&u===n?l({dropPosition:a,dropLevelOffset:i,indent:c,prefixCls:s,direction:d}):null},ve=()=>{let{icon:t=r.icon,data:n}=e,i=r.title||o.value.slots?.[e.data?.slots?.title]||o.value.slots?.title||e.title,{prefixCls:s,showIcon:c,icon:l,loadData:u}=o.value,d=M.value,f=`${s}-node-content-wrapper`,p;if(c){let e=t||o.value.slots?.[n?.slots?.icon]||l;p=e?U(`span`,{class:K(`${s}-iconEle`,`${s}-icon__customize`)},[typeof e==`function`?e(F.value):e]):_e()}else u&&x.value&&(p=_e());let m;m=typeof i==`function`?i(F.value):i,m=m===void 0?Sk:m;let h=U(`span`,{class:`${s}-title`},[m]);return U(`span`,{ref:D,title:typeof i==`string`?i:``,class:K(`${f}`,`${f}-${j.value||`normal`}`,!d&&(v.value||a.value)&&`${s}-node-selected`),onMouseenter:ie,onMouseleave:ae,onContextmenu:oe,onClick:re,onDblclick:te},[p,h,W()])};return()=>{let t=Z(Z({},e),n),{eventKey:r,isLeaf:i,isStart:a,isEnd:s,domRef:c,active:l,data:u,onMousemove:d,selectable:f}=t,p=yk(t,[`eventKey`,`isLeaf`,`isStart`,`isEnd`,`domRef`,`active`,`data`,`onMousemove`,`selectable`]),{prefixCls:m,filterTreeNode:h,keyEntities:g,dropContainerKey:b,dropTargetKey:E,draggingNodeKey:D}=o.value,O=M.value,k=Bu(p,{aria:!0,data:!0}),{level:A}=g[r]||{},j=s[s.length-1],N=de(),P=!O&&N,F=D===r,I=f===void 0?void 0:{"aria-selected":!!f};return U(`div`,Y(Y({ref:c,class:K(n.class,`${m}-treenode`,{[`${m}-treenode-disabled`]:O,[`${m}-treenode-switcher-${_.value?`open`:`close`}`]:!i,[`${m}-treenode-checkbox-checked`]:y.value,[`${m}-treenode-checkbox-indeterminate`]:S.value,[`${m}-treenode-selected`]:v.value,[`${m}-treenode-loading`]:x.value,[`${m}-treenode-active`]:l,[`${m}-treenode-leaf-last`]:j,[`${m}-treenode-draggable`]:P,dragging:F,"drop-target":E===r,"drop-container":b===r,"drag-over":!O&&C.value,"drag-over-gap-top":!O&&w.value,"drag-over-gap-bottom":!O&&T.value,"filter-node":h&&h(L.value)}),style:n.style,draggable:P,"aria-grabbed":F,onDragstart:P?z:void 0,onDragenter:N?se:void 0,onDragover:N?B:void 0,onDragleave:N?ce:void 0,onDrop:N?H:void 0,onDragend:N?le:void 0,onMousemove:d},I),k),[U(hk,{prefixCls:m,level:A,isStart:a,isEnd:s},null),fe(),he(),ge(),ve()])}}});function wk(e,t){if(!e)return[];let n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function Tk(e,t){let n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function Ek(e){return e.split(`-`)}function Dk(e,t){return`${e}-${t}`}function Ok(e){return e&&e.type&&e.type.isTreeNode}function kk(e,t){let n=[],r=t[e];function i(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>{let{key:t,children:r}=e;n.push(t),i(r)})}return i(r.children),n}function Ak(e){if(e.parent){let t=Ek(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function jk(e){let t=Ek(e.pos);return Number(t[t.length-1])===0}function Mk(e,t,n,r,i,a,o,s,c,l){let{clientX:u,clientY:d}=e,{top:f,height:p}=e.target.getBoundingClientRect(),m=((l===`rtl`?-1:1)*((i?.x||0)-u)-12)/r,h=s[n.eventKey];if(de.key===h.key);h=s[o[e<=0?0:e-1].key]}let g=h.key,_=h,v=h.key,y=0,b=0;if(!c.has(g))for(let e=0;e-1.5?a({dragNode:x,dropNode:S,dropPosition:1})?y=1:C=!1:a({dragNode:x,dropNode:S,dropPosition:0})?y=0:a({dragNode:x,dropNode:S,dropPosition:1})?y=1:C=!1:a({dragNode:x,dropNode:S,dropPosition:1})?y=1:C=!1,{dropPosition:y,dropLevelOffset:b,dropTargetKey:h.key,dropTargetPos:h.pos,dragOverNodeKey:v,dropContainerKey:y===0?null:h.parent?.key||null,dropAllowed:C}}function Nk(e,t){if(!e)return;let{multiple:n}=t;return n?e.slice():e.length?[e[0]]:e}function Pk(e){if(!e)return null;let t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(typeof e==`object`)t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return null;return t}function Fk(e,t){let n=new Set;function r(e){if(n.has(e))return;let i=t[e];if(!i)return;n.add(e);let{parent:a,node:o}=i;o.disabled||a&&r(a.key)}return(e||[]).forEach(e=>{r(e)}),[...n]}var Ik=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:[]).map(e=>{if(!Ok(e))return null;let n=e.children||{},r=e.key,i={};for(let[t,n]of Object.entries(e.props))i[ue(t)]=n;let{isLeaf:a,checkable:o,selectable:s,disabled:c,disableCheckbox:l}=i,u={isLeaf:a||a===``||void 0,checkable:o||o===``||void 0,selectable:s||s===``||void 0,disabled:c||c===``||void 0,disableCheckbox:l||l===``||void 0},d=Z(Z({},i),u),{title:f=n.title?.call(n,d),icon:p=n.icon?.call(n,d),switcherIcon:m=n.switcherIcon?.call(n,d)}=i,h=Ik(i,[`title`,`icon`,`switcherIcon`]),g=n.default?.call(n),_=Z(Z(Z({},h),{title:f,icon:p,switcherIcon:m,key:r,isLeaf:a}),u),v=t(g);return v.length&&(_.children=v),_})}return t(e)}function Bk(e,t,n){let{_title:r,key:i,children:a}=Rk(n),o=new Set(t===!0?[]:t),s=[];function c(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e.map((l,u)=>{let d=Dk(n?n.pos:`0`,u),f=Lk(l[i],d),p;for(let e=0;ee[a]:typeof a==`function`&&(u=e=>a(e)):u=(e,t)=>Lk(e[s],t);function d(n,r,i,a){let o=n?n[l]:e,s=n?Dk(i.pos,r):`0`,c=n?[...a,n]:[];n&&t({node:n,index:r,pos:s,key:u(n,s),parentPos:i.node?i.pos:null,level:i.level+1,nodes:c}),o&&o.forEach((e,t)=>{d(e,t,{node:n,pos:s,level:i?i.level+1:-1},c)})}d(null)}function Hk(e){let{initWrapper:t,processEntity:n,onProcessFinished:r,externalGetKey:i,childrenPropName:a,fieldNames:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,c=i||s,l={},u={},d={posEntities:l,keyEntities:u};return t&&(d=t(d)||d),Vk(e,e=>{let{node:t,index:r,pos:i,key:a,parentPos:o,level:s,nodes:c}=e,f={node:t,nodes:c,index:r,key:a,pos:i,level:s},p=Lk(a,i);l[i]=f,u[p]=f,f.parent=l[o],f.parent&&(f.parent.children=f.parent.children||[],f.parent.children.push(f)),n&&n(f,d)},{externalGetKey:c,childrenPropName:a,fieldNames:o}),r&&r(d),d}function Uk(e,t){let{expandedKeysSet:n,selectedKeysSet:r,loadedKeysSet:i,loadingKeysSet:a,checkedKeysSet:o,halfCheckedKeysSet:s,dragOverNodeKey:c,dropPosition:l,keyEntities:u}=t,d=u[e];return{eventKey:e,expanded:n.has(e),selected:r.has(e),loaded:i.has(e),loading:a.has(e),checked:o.has(e),halfChecked:s.has(e),pos:String(d?d.pos:``),parent:d.parent,dragOver:c===e&&l===0,dragOverGapTop:c===e&&l===-1,dragOverGapBottom:c===e&&l===1}}function Wk(e){let{data:t,expanded:n,selected:r,checked:i,loaded:a,loading:o,halfChecked:s,dragOver:c,dragOverGapTop:l,dragOverGapBottom:u,pos:d,active:f,eventKey:p}=e,m=Z(Z({dataRef:t},t),{expanded:n,selected:r,checked:i,loaded:a,loading:o,halfChecked:s,dragOver:c,dragOverGapTop:l,dragOverGapBottom:u,pos:d,active:f,eventKey:p,key:p});return`props`in m||Object.defineProperty(m,"props",{get(){return e}}),m}var Gk=((e,t)=>J(()=>Hk(e.value,{fieldNames:t.value,initWrapper:e=>Z(Z({},e),{pathKeyEntities:{}}),processEntity:(e,n)=>{let r=e.nodes.map(e=>e[t.value.value]).join(ek);n.pathKeyEntities[r]=e,e.key=r}}).pathKeyEntities));function Kk(e){let t=q(!1),n=H({});return S(()=>{if(!e.value){t.value=!1,n.value={};return}let r={matchInputWidth:!0,limit:50};e.value&&typeof e.value==`object`&&(r=Z(Z({},r),e.value)),r.limit<=0&&delete r.limit,t.value=!0,n.value=r}),{showSearch:t,searchConfig:n}}var qk=`__rc_cascader_search_mark__`,Jk=(e,t,n)=>{let{label:r}=n;return t.some(t=>String(t[r]).toLowerCase().includes(e.toLowerCase()))},Yk=e=>{let{path:t,fieldNames:n}=e;return t.map(e=>e[n.label]).join(` / `)},Xk=((e,t,n,r,i,a)=>J(()=>{let{filter:o=Jk,render:s=Yk,limit:c=50,sort:l}=i.value,u=[];if(!e.value)return[];function d(t,i){t.forEach(t=>{if(!l&&c>0&&u.length>=c)return;let f=[...i,t],p=t[n.value.children];(!p||p.length===0||a.value)&&o(e.value,f,{label:n.value.label})&&u.push(Z(Z({},t),{[n.value.label]:s({inputValue:e.value,path:f,prefixCls:r.value,fieldNames:n.value}),[qk]:f})),p&&d(t[n.value.children],f)})}return d(t.value,[]),l&&u.sort((t,r)=>l(t[qk],r[qk],e.value,n.value)),c>0?u.slice(0,c):u}));function Zk(e,t,n){let r=new Set(e);return e.filter(e=>{let i=t[e],a=i?i.parent:null,o=i?i.children:null;return n===`SHOW_CHILD`?!(o&&o.some(e=>e.key&&r.has(e.key))):!(a&&!a.node.disabled&&r.has(a.key))})}function Qk(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=t,a=[];for(let t=0;t{let t=e[n.value];return r?String(t)===String(o):t===o}),c=s===-1?null:i?.[s];a.push({value:c?.[n.value]??o,index:s,option:c}),i=c?.[n.children]}return a}var $k=((e,t,n)=>J(()=>{let r=[],i=[];return n.value.forEach(n=>{Qk(n,e.value,t.value).every(e=>e.option)?i.push(n):r.push(n)}),[i,r]}));function eA(e,t){let n=new Set;return e.forEach(e=>{t.has(e)||n.add(e)}),n}function tA(e){let{disabled:t,disableCheckbox:n,checkable:r}=e||{};return!!(t||n)||r===!1}function nA(e,t,n,r){let i=new Set(e),a=new Set;for(let e=0;e<=n;e+=1)(t.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:a=[]}=e;i.has(t)&&!r(n)&&a.filter(e=>!r(e.node)).forEach(e=>{i.add(e.key)})});let o=new Set;for(let e=n;e>=0;--e)(t.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(r(n)||!e.parent||o.has(e.parent.key))return;if(r(e.parent.node)){o.add(t.key);return}let s=!0,c=!1;(t.children||[]).filter(e=>!r(e.node)).forEach(e=>{let{key:t}=e,n=i.has(t);s&&!n&&(s=!1),!c&&(n||a.has(t))&&(c=!0)}),s&&i.add(t.key),c&&a.add(t.key),o.add(t.key)});return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(eA(a,i))}}function rA(e,t,n,r,i){let a=new Set(e),o=new Set(t);for(let e=0;e<=r;e+=1)(n.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:r=[]}=e;!a.has(t)&&!o.has(t)&&!i(n)&&r.filter(e=>!i(e.node)).forEach(e=>{a.delete(e.key)})});o=new Set;let s=new Set;for(let e=r;e>=0;--e)(n.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(i(n)||!e.parent||s.has(e.parent.key))return;if(i(e.parent.node)){s.add(t.key);return}let r=!0,c=!1;(t.children||[]).filter(e=>!i(e.node)).forEach(e=>{let{key:t}=e,n=a.has(t);r&&!n&&(r=!1),!c&&(n||o.has(t))&&(c=!0)}),r||a.delete(t.key),c&&o.add(t.key),s.add(t.key)});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(eA(o,a))}}function iA(e,t,n,r,i,a){let o=[],s;s=a||tA;let c=new Set(e.filter(e=>{let t=!!n[e];return t||o.push(e),t}));o.length,`${o.slice(0,100).map(e=>`'${e}'`).join(`, `)}`;let l;return l=t===!0?nA(c,i,r,s):rA(c,t.halfCheckedKeys,i,r,s),l}var aA=((e,t,n,r,i)=>J(()=>{let a=i.value||(e=>{let{labels:t}=e,n=r.value?t.slice(-1):t;return n.every(e=>[`string`,`number`].includes(typeof e))?n.join(` / `):n.reduce((e,t,n)=>{let r=Nt(t)?ao(t,{key:n}):t;return n===0?[r]:[...e,` / `,r]},[])});return e.value.map(e=>{let r=Qk(e,t.value,n.value),i=a({labels:r.map(e=>{let{option:t,value:r}=e;return t?.[n.value.label]??r}),selectedOptions:r.map(e=>{let{option:t}=e;return t})}),o=rk(e);return{label:i,value:o,key:o,valueCells:e}})})),oA=Symbol(`CascaderContextKey`),sA=e=>{fe(oA,e)},cA=()=>g(oA),lA=(()=>{let e=_d(),{values:t}=cA(),[n,r]=ff([]);return G(()=>e.open,()=>{if(e.open&&!e.multiple){let e=t.value[0];r(e||[])}},{immediate:!0}),[n,r]}),uA=((e,t,n,r,i,a)=>{let o=_d(),s=J(()=>o.direction===`rtl`),[c,l,u]=[H([]),H(),H([])];S(()=>{let e=-1,i=t.value,a=[],o=[],s=r.value.length;for(let t=0;te[n.value.value]===r.value[t]);if(s===-1)break;e=s,a.push(e),o.push(r.value[t]),i=i[e][n.value.children]}let d=t.value;for(let e=0;e{i(e)},f=e=>{let t=u.value.length,r=l.value;r===-1&&e<0&&(r=t);for(let i=0;i{if(c.value.length>1){let e=c.value.slice(0,-1);d(e)}else o.toggleOpen(!1)},m=()=>{let e=(u.value[l.value]?.[n.value.children]||[]).find(e=>!e.disabled);if(e){let t=[...c.value,e[n.value.value]];d(t)}};e.expose({onKeydown:e=>{let{which:t}=e;switch(t){case $.UP:case $.DOWN:{let e=0;t===$.UP?e=-1:t===$.DOWN&&(e=1),e!==0&&f(e);break}case $.LEFT:s.value?m():p();break;case $.RIGHT:s.value?p():m();break;case $.BACKSPACE:o.searchValue||p();break;case $.ENTER:if(c.value.length){let e=u.value[l.value],t=e?.__rc_cascader_search_mark__||[];t.length?a(t.map(e=>e[n.value.value]),t[t.length-1]):a(c.value,e)}break;case $.ESC:o.toggleOpen(!1),open&&e.stopPropagation()}},onKeyup:()=>{}})});function dA(e){let{prefixCls:t,checked:n,halfChecked:r,disabled:i,onClick:a}=e,{customSlots:o,checkable:s}=cA(),c=s.value===!1?s.value:o.value.checkable,l=typeof c==`function`?c():typeof c==`boolean`?null:c;return U(`span`,{class:{[t]:!0,[`${t}-checked`]:n,[`${t}-indeterminate`]:!n&&r,[`${t}-disabled`]:i},onClick:a},[l])}dA.props=[`prefixCls`,`checked`,`halfChecked`,`disabled`,`onClick`],dA.displayName=`Checkbox`,dA.inheritAttrs=!1;var fA=`__cascader_fix_label__`;function pA(e){let{prefixCls:t,multiple:n,options:r,activeValue:i,prevValuePath:a,onToggleOpen:o,onSelect:s,onActive:c,checkedSet:l,halfCheckedSet:u,loadingKeys:d,isSelectable:f}=e;var p,m;let h=`${t}-menu`,g=`${t}-menu-item`,{fieldNames:_,changeOnSelect:v,expandTrigger:y,expandIcon:b,loadingIcon:x,dropdownMenuColumnStyle:S,customSlots:C}=cA(),w=b.value??(p=C.value).expandIcon?.call(p),T=x.value??(m=C.value).loadingIcon?.call(m),E=y.value===`hover`;return U(`ul`,{class:h,role:`menu`},[r.map(e=>{let{disabled:r}=e,p=e[qk],m=e.__cascader_fix_label__??e[_.value.label],h=e[_.value.value],y=sk(e,_.value),b=p?p.map(e=>e[_.value.value]):[...a,h],x=rk(b),C=d.includes(x),D=l.has(x),O=u.has(x),k=()=>{!r&&(!E||!y)&&c(b)},A=()=>{f(e)&&s(b,y)},j;return typeof e.title==`string`?j=e.title:typeof m==`string`&&(j=m),U(`li`,{key:x,class:[g,{[`${g}-expand`]:!y,[`${g}-active`]:i===h,[`${g}-disabled`]:r,[`${g}-loading`]:C}],style:S.value,role:`menuitemcheckbox`,title:j,"aria-checked":D,"data-path-key":x,onClick:()=>{k(),(!n||y)&&A()},onDblclick:()=>{v.value&&o(!1)},onMouseenter:()=>{E&&k()},onMousedown:e=>{e.preventDefault()}},[n&&U(dA,{prefixCls:`${t}-checkbox`,checked:D,halfChecked:O,disabled:r,onClick:e=>{e.stopPropagation(),A()}},null),U(`div`,{class:`${g}-content`},[m]),!C&&w&&!y&&U(`div`,{class:`${g}-expand-icon`},[ao(w)]),C&&T&&U(`div`,{class:`${g}-loading-icon`},[ao(T)])])})])}pA.props=[`prefixCls`,`multiple`,`options`,`activeValue`,`prevValuePath`,`onToggleOpen`,`onSelect`,`onActive`,`checkedSet`,`halfCheckedSet`,`loadingKeys`,`isSelectable`],pA.displayName=`Column`,pA.inheritAttrs=!1;var mA=u({compatConfig:{MODE:3},name:`OptionList`,inheritAttrs:!1,setup(e,t){let{attrs:n,slots:r}=t,i=_d(),a=H(),o=J(()=>i.direction===`rtl`),{options:s,values:c,halfValues:l,fieldNames:u,changeOnSelect:d,onSelect:f,searchOptions:p,dropdownPrefixCls:m,loadData:h,expandTrigger:g,customSlots:_}=cA(),v=J(()=>m.value||i.prefixCls),y=q([]),b=e=>{if(!h.value||i.searchValue)return;let t=Qk(e,s.value,u.value).map(e=>{let{option:t}=e;return t}),n=t[t.length-1];if(n&&!sk(n,u.value)){let n=rk(e);y.value=[...y.value,n],h.value(t)}};S(()=>{y.value.length&&y.value.forEach(e=>{let t=Qk(ak(e),s.value,u.value,!0).map(e=>{let{option:t}=e;return t}),n=t[t.length-1];(!n||n[u.value.children]||sk(n,u.value))&&(y.value=y.value.filter(t=>t!==e))})});let x=J(()=>new Set(ik(c.value))),C=J(()=>new Set(ik(l.value))),[w,T]=lA(),E=e=>{T(e),b(e)},D=e=>{let{disabled:t}=e,n=sk(e,u.value);return!t&&(n||d.value||i.multiple)},O=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];f(e),!i.multiple&&(t||d.value&&(g.value===`hover`||n))&&i.toggleOpen(!1)},k=J(()=>i.searchValue?p.value:s.value),A=J(()=>{let e=[{options:k.value}],t=k.value;for(let n=0;ne[u.value.value]===r)?.[u.value.children];if(!i?.length)break;t=i,e.push({options:i})}return e});uA(t,k,u,w,E,(e,t)=>{D(t)&&O(e,sk(t,u.value),!0)});let j=e=>{e.preventDefault()};return V(()=>{G(w,e=>{for(let t=0;t{var e;let{notFoundContent:t=r.notFoundContent?.call(r)||(e=_.value).notFoundContent?.call(e),multiple:s,toggleOpen:c}=i,l=!A.value[0]?.options?.length,d=[{[u.value.value]:`__EMPTY__`,[fA]:t,disabled:!0}],f=Z(Z({},n),{multiple:!l&&s,onSelect:O,onActive:E,onToggleOpen:c,checkedSet:x.value,halfCheckedSet:C.value,loadingKeys:y.value,isSelectable:D}),p=(l?[{options:d}]:A.value).map((e,t)=>{let n=w.value.slice(0,t),r=w.value[t];return U(pA,Y(Y({key:t},f),{},{prefixCls:v.value,options:e.options,prevValuePath:n,activeValue:r}),null)});return U(`div`,{class:[`${v.value}-menus`,{[`${v.value}-menu-empty`]:l,[`${v.value}-rtl`]:o.value}],onMousedown:j,ref:a},[p])}}});function hA(e){let t=H(0),n=q();return S(()=>{let r=new Map,i=0,a=e.value||{};for(let e in a)if(Object.prototype.hasOwnProperty.call(a,e)){let t=a[e],{level:n}=t,o=r.get(n);o||(o=new Set,r.set(n,o)),o.add(t),i=Math.max(i,n)}t.value=i,n.value=r}),{maxLevel:t,levelEntities:n}}function gA(){return Z(Z({},Br(Cd(),[`tokenSeparators`,`mode`,`showSearch`])),{id:String,prefixCls:String,fieldNames:Qt(),children:Array,value:{type:[String,Number,Array]},defaultValue:{type:[String,Number,Array]},changeOnSelect:{type:Boolean,default:void 0},displayRender:Function,checkable:{type:Boolean,default:void 0},showCheckedStrategy:{type:String,default:tk},showSearch:{type:[Boolean,Object],default:void 0},searchValue:String,onSearch:Function,expandTrigger:String,options:Array,dropdownPrefixCls:String,loadData:Function,popupVisible:{type:Boolean,default:void 0},dropdownClassName:String,dropdownMenuColumnStyle:{type:Object,default:void 0},popupStyle:{type:Object,default:void 0},dropdownStyle:{type:Object,default:void 0},popupPlacement:String,placement:String,onPopupVisibleChange:Function,onDropdownVisibleChange:Function,expandIcon:f.any,loadingIcon:f.any})}function _A(){return Z(Z({},gA()),{onChange:Function,customSlots:Object})}function vA(e){return Array.isArray(e)&&Array.isArray(e[0])}function yA(e){return e?vA(e)?e:(e.length===0?[]:[e]).map(e=>Array.isArray(e)?e:[e]):[]}var bA=u({compatConfig:{MODE:3},name:`Cascader`,inheritAttrs:!1,props:Zn(_A(),{}),setup(e,t){let{attrs:n,expose:r,slots:i}=t,a=of(St(e,`id`)),o=J(()=>!!e.checkable),[s,c]=df(e.defaultValue,{value:J(()=>e.value),postState:yA}),l=J(()=>ok(e.fieldNames)),u=J(()=>e.options||[]),d=Gk(u,l),f=e=>{let t=d.value;return e.map(e=>{let{nodes:n}=t[e];return n.map(e=>e[l.value.value])})},[p,m]=df(``,{value:J(()=>e.searchValue),postState:e=>e||``}),h=(t,n)=>{m(t),n.source!==`blur`&&e.onSearch&&e.onSearch(t)},{showSearch:g,searchConfig:_}=Kk(St(e,`showSearch`)),v=Xk(p,u,l,J(()=>e.dropdownPrefixCls||e.prefixCls),_,St(e,`changeOnSelect`)),y=$k(u,l,s),[b,x,C]=[H([]),H([]),H([])],{maxLevel:w,levelEntities:T}=hA(d);S(()=>{let[e,t]=y.value;if(!o.value||!s.value.length){[b.value,x.value,C.value]=[e,[],t];return}let n=ik(e),r=d.value,{checkedKeys:i,halfCheckedKeys:a}=iA(n,!0,r,w.value,T.value);[b.value,x.value,C.value]=[f(i),f(a),t]});let E=aA(J(()=>{let t=Zk(ik(b.value),d.value,e.showCheckedStrategy);return[...C.value,...f(t)]}),u,l,o,St(e,`displayRender`)),D=t=>{if(c(t),e.onChange){let n=yA(t),r=n.map(e=>Qk(e,u.value,l.value).map(e=>e.option)),i=o.value?n:n[0],a=o.value?r:r[0];e.onChange(i,a)}},O=t=>{if(m(``),!o.value)D(t);else{let n=rk(t),r=ik(b.value),i=ik(x.value),a=r.includes(n),o=C.value.some(e=>rk(e)===n),s=b.value,c=C.value;if(o&&!a)c=C.value.filter(e=>rk(e)!==n);else{let t=a?r.filter(e=>e!==n):[...r,n],o;a?{checkedKeys:o}=iA(t,{checked:!1,halfCheckedKeys:i},d.value,w.value,T.value):{checkedKeys:o}=iA(t,!0,d.value,w.value,T.value);let c=Zk(o,d.value,e.showCheckedStrategy);s=f(c)}D([...c,...s])}},k=(e,t)=>{if(t.type===`clear`){D([]);return}let{valueCells:n}=t.values[0];O(n)},A=J(()=>e.open===void 0?e.popupVisible:e.open),j=J(()=>e.dropdownStyle||e.popupStyle||{}),M=J(()=>e.placement||e.popupPlacement),N=t=>{var n,r;(n=e.onDropdownVisibleChange)==null||n.call(e,t),(r=e.onPopupVisibleChange)==null||r.call(e,t)},{changeOnSelect:P,checkable:F,dropdownPrefixCls:I,loadData:L,expandTrigger:ee,expandIcon:te,loadingIcon:ne,dropdownMenuColumnStyle:R,customSlots:re,dropdownClassName:ie}=Ft(e);sA({options:u,fieldNames:l,values:b,halfValues:x,changeOnSelect:P,onSelect:O,checkable:F,searchOptions:v,dropdownPrefixCls:I,loadData:L,expandTrigger:ee,expandIcon:te,loadingIcon:ne,dropdownMenuColumnStyle:R,customSlots:re});let ae=H();r({focus(){var e;(e=ae.value)==null||e.focus()},blur(){var e;(e=ae.value)==null||e.blur()},scrollTo(e){var t;(t=ae.value)==null||t.scrollTo(e)}});let oe=J(()=>Br(e,`id.prefixCls.fieldNames.defaultValue.value.changeOnSelect.onChange.displayRender.checkable.searchValue.onSearch.showSearch.expandTrigger.options.dropdownPrefixCls.loadData.popupVisible.open.dropdownClassName.dropdownMenuColumnStyle.popupPlacement.placement.onDropdownVisibleChange.onPopupVisibleChange.expandIcon.loadingIcon.customSlots.showCheckedStrategy.children`.split(`.`)));return()=>{let t=!(p.value?v.value:u.value).length,{dropdownMatchSelectWidth:r=!1}=e,s=p.value&&_.value.matchInputWidth||t?{}:{minWidth:`auto`};return U(Ed,Y(Y(Y({},oe.value),n),{},{ref:ae,id:a,prefixCls:e.prefixCls,dropdownMatchSelectWidth:r,dropdownStyle:Z(Z({},j.value),s),displayValues:E.value,onDisplayValuesChange:k,mode:o.value?`multiple`:void 0,searchValue:p.value,onSearch:h,showSearch:g.value,OptionList:mA,emptyOptions:t,open:A.value,dropdownClassName:ie.value,placement:M.value,onDropdownVisibleChange:N,getRawInputElement:()=>i.default?.call(i)}),i)}}}),xA={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z`}}]},name:`left`,theme:`outlined`};function SA(e){for(var t=1;tIt()&&window.document.documentElement,EA=e=>{if(It()&&window.document.documentElement){let t=Array.isArray(e)?e:[e],{documentElement:n}=window.document;return t.some(e=>e in n.style)}return!1},DA=(e,t)=>{if(!EA(e))return!1;let n=document.createElement(`div`),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function OA(e,t){return!Array.isArray(e)&&t!==void 0?DA(e,t):EA(e)}var kA,AA=()=>{if(!TA())return!1;if(kA!==void 0)return kA;let e=document.createElement(`div`);return e.style.display=`flex`,e.style.flexDirection=`column`,e.style.rowGap=`1px`,e.appendChild(document.createElement(`div`)),e.appendChild(document.createElement(`div`)),document.body.appendChild(e),kA=e.scrollHeight===1,document.body.removeChild(e),kA},jA=(()=>{let e=q(!1);return V(()=>{e.value=AA()}),e}),MA=Symbol(`rowContextKey`),NA=e=>{fe(MA,e)},PA=()=>g(MA,{gutter:J(()=>void 0),wrap:J(()=>void 0),supportFlexGap:J(()=>void 0)}),FA=e=>{let{componentCls:t}=e;return{[t]:{display:`flex`,flexFlow:`row wrap`,minWidth:0,"&::before, &::after":{display:`flex`},"&-no-wrap":{flexWrap:`nowrap`},"&-start":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-end":{justifyContent:`flex-end`},"&-space-between":{justifyContent:`space-between`},"&-space-around ":{justifyContent:`space-around`},"&-space-evenly ":{justifyContent:`space-evenly`},"&-top":{alignItems:`flex-start`},"&-middle":{alignItems:`center`},"&-bottom":{alignItems:`flex-end`}}}},IA=e=>{let{componentCls:t}=e;return{[t]:{position:`relative`,maxWidth:`100%`,minHeight:1}}},LA=(e,t)=>{let{componentCls:n,gridColumns:r}=e,i={};for(let e=r;e>=0;e--)e===0?(i[`${n}${t}-${e}`]={display:`none`},i[`${n}-push-${e}`]={insetInlineStart:`auto`},i[`${n}-pull-${e}`]={insetInlineEnd:`auto`},i[`${n}${t}-push-${e}`]={insetInlineStart:`auto`},i[`${n}${t}-pull-${e}`]={insetInlineEnd:`auto`},i[`${n}${t}-offset-${e}`]={marginInlineEnd:0},i[`${n}${t}-order-${e}`]={order:0}):(i[`${n}${t}-${e}`]={display:`block`,flex:`0 0 ${e/r*100}%`,maxWidth:`${e/r*100}%`},i[`${n}${t}-push-${e}`]={insetInlineStart:`${e/r*100}%`},i[`${n}${t}-pull-${e}`]={insetInlineEnd:`${e/r*100}%`},i[`${n}${t}-offset-${e}`]={marginInlineStart:`${e/r*100}%`},i[`${n}${t}-order-${e}`]={order:e});return i},RA=(e,t)=>LA(e,t),zA=(e,t,n)=>({[`@media (min-width: ${t}px)`]:Z({},RA(e,n))}),BA=v(`Grid`,e=>[FA(e)]),VA=v(`Grid`,e=>{let t=B(e,{gridColumns:24}),n={"-sm":t.screenSMMin,"-md":t.screenMDMin,"-lg":t.screenLGMin,"-xl":t.screenXLMin,"-xxl":t.screenXXLMin};return[IA(t),RA(t,``),RA(t,`-xs`),Object.keys(n).map(e=>zA(t,n[e],e)).reduce((e,t)=>Z(Z({},e),t),{})]}),HA=u({compatConfig:{MODE:3},name:`ARow`,inheritAttrs:!1,props:{align:W([String,Object]),justify:W([String,Object]),prefixCls:String,gutter:W([Number,Array,Object],0),wrap:{type:Boolean,default:void 0}},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`row`,e),[o,s]=BA(i),c,l=Hv(),u=H({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),d=H({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),f=t=>J(()=>{if(typeof e[t]==`string`)return e[t];if(typeof e[t]!=`object`)return``;for(let n=0;n{c=l.value.subscribe(t=>{d.value=t;let n=e.gutter||0;(!Array.isArray(n)&&typeof n==`object`||Array.isArray(n)&&(typeof n[0]==`object`||typeof n[1]==`object`))&&(u.value=t)})}),ut(()=>{l.value.unsubscribe(c)});let g=J(()=>{let t=[void 0,void 0],{gutter:n=0}=e;return(Array.isArray(n)?n:[n,void 0]).forEach((e,n)=>{if(typeof e==`object`)for(let r=0;re.wrap)});let _=J(()=>K(i.value,{[`${i.value}-no-wrap`]:e.wrap===!1,[`${i.value}-${m.value}`]:m.value,[`${i.value}-${p.value}`]:p.value,[`${i.value}-rtl`]:a.value===`rtl`},r.class,s.value)),v=J(()=>{let e=g.value,t={},n=e[0]!=null&&e[0]>0?`${e[0]/-2}px`:void 0,r=e[1]!=null&&e[1]>0?`${e[1]/-2}px`:void 0;return n&&(t.marginLeft=n,t.marginRight=n),h.value?t.rowGap=`${e[1]}px`:r&&(t.marginTop=r,t.marginBottom=r),t});return()=>o(U(`div`,Y(Y({},r),{},{class:_.value,style:Z(Z({},v.value),r.style)}),[n.default?.call(n)]))}});function UA(){return UA=Object.assign?Object.assign.bind():function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function JA(e,t,n){return JA=qA()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&KA(i,n.prototype),i},JA.apply(null,arguments)}function YA(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function XA(e){var t=typeof Map==`function`?new Map:void 0;return XA=function(e){if(e===null||!YA(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return JA(e,arguments,GA(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),KA(n,e)},XA(e)}var ZA=/%[sdj%]/g,QA=function(){};function $A(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function ej(e){var t=[...arguments].slice(1),n=0,r=t.length;return typeof e==`function`?e.apply(null,t):typeof e==`string`?e.replace(ZA,function(e){if(e===`%%`)return`%`;if(n>=r)return e;switch(e){case`%s`:return String(t[n++]);case`%d`:return Number(t[n++]);case`%j`:try{return JSON.stringify(t[n++])}catch{return`[Circular]`}break;default:return e}}):e}function tj(e){return e===`string`||e===`url`||e===`hex`||e===`email`||e===`date`||e===`pattern`}function nj(e,t){return!!(e==null||t===`array`&&Array.isArray(e)&&!e.length||tj(t)&&typeof e==`string`&&!e)}function rj(e,t,n){var r=[],i=0,a=e.length;function o(e){r.push.apply(r,e||[]),i++,i===a&&n(r)}e.forEach(function(e){t(e,o)})}function ij(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var s=r;r+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},_j={integer:function(e){return _j.number(e)&&parseInt(e,10)===e},float:function(e){return _j.number(e)&&!_j.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime==`function`&&typeof e.getMonth==`function`&&typeof e.getYear==`function`&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&typeof e==`number`},object:function(e){return typeof e==`object`&&!_j.array(e)},method:function(e){return typeof e==`function`},email:function(e){return typeof e==`string`&&e.length<=320&&!!e.match(gj.email)},url:function(e){return typeof e==`string`&&e.length<=2048&&!!e.match(hj())},hex:function(e){return typeof e==`string`&&!!e.match(gj.hex)}},vj=function(e,t,n,r,i){if(e.required&&t===void 0){fj(e,t,n,r,i);return}var a=[`integer`,`float`,`array`,`regexp`,`object`,`method`,`email`,`number`,`date`,`url`,`hex`],o=e.type;a.indexOf(o)>-1?_j[o](t)||r.push(ej(i.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(ej(i.messages.types[o],e.fullField,e.type))},yj=function(e,t,n,r,i){var a=typeof e.len==`number`,o=typeof e.min==`number`,s=typeof e.max==`number`,c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=t,u=null,d=typeof t==`number`,f=typeof t==`string`,p=Array.isArray(t);if(d?u=`number`:f?u=`string`:p&&(u=`array`),!u)return!1;p&&(l=t.length),f&&(l=t.replace(c,`_`).length),a?l!==e.len&&r.push(ej(i.messages[u].len,e.fullField,e.len)):o&&!s&&le.max?r.push(ej(i.messages[u].max,e.fullField,e.max)):o&&s&&(le.max)&&r.push(ej(i.messages[u].range,e.fullField,e.min,e.max))},bj=`enum`,xj={required:fj,whitespace:pj,type:vj,range:yj,enum:function(e,t,n,r,i){e[bj]=Array.isArray(e[bj])?e[bj]:[],e[bj].indexOf(t)===-1&&r.push(ej(i.messages[bj],e.fullField,e[bj].join(`, `)))},pattern:function(e,t,n,r,i){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(ej(i.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern==`string`&&(new RegExp(e.pattern).test(t)||r.push(ej(i.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},Sj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,`string`)&&!e.required)return n();xj.required(e,t,r,a,i,`string`),nj(t,`string`)||(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i),xj.pattern(e,t,r,a,i),e.whitespace===!0&&xj.whitespace(e,t,r,a,i))}n(a)},Cj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj.type(e,t,r,a,i)}n(a)},wj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===``&&(t=void 0),nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},Tj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj.type(e,t,r,a,i)}n(a)},Ej=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),nj(t)||xj.type(e,t,r,a,i)}n(a)},Dj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},Oj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},kj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();xj.required(e,t,r,a,i,`array`),t!=null&&(xj.type(e,t,r,a,i),xj.range(e,t,r,a,i))}n(a)},Aj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj.type(e,t,r,a,i)}n(a)},jj=`enum`,Mj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i),t!==void 0&&xj[jj](e,t,r,a,i)}n(a)},Nj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,`string`)&&!e.required)return n();xj.required(e,t,r,a,i),nj(t,`string`)||xj.pattern(e,t,r,a,i)}n(a)},Pj=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,`date`)&&!e.required)return n();if(xj.required(e,t,r,a,i),!nj(t,`date`)){var o=t instanceof Date?t:new Date(t);xj.type(e,o,r,a,i),o&&xj.range(e,o.getTime(),r,a,i)}}n(a)},Fj=function(e,t,n,r,i){var a=[],o=Array.isArray(t)?`array`:typeof t;xj.required(e,t,r,a,i,o),n(a)},Ij=function(e,t,n,r,i){var a=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t,a)&&!e.required)return n();xj.required(e,t,r,o,i,a),nj(t,a)||xj.type(e,t,r,o,i)}n(o)},Lj={string:Sj,method:Cj,number:wj,boolean:Tj,regexp:Ej,integer:Dj,float:Oj,array:kj,object:Aj,enum:Mj,pattern:Nj,date:Pj,url:Ij,hex:Ij,email:Ij,required:Fj,any:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nj(t)&&!e.required)return n();xj.required(e,t,r,a,i)}n(a)}};function Rj(){return{default:`Validation error on field %s`,required:`%s is required`,enum:`%s must be one of %s`,whitespace:`%s cannot be empty`,date:{format:`%s date %s is invalid for format %s`,parse:`%s date could not be parsed, %s is invalid `,invalid:`%s date %s is invalid`},types:{string:`%s is not a %s`,method:`%s is not a %s (function)`,array:`%s is not an %s`,object:`%s is not an %s`,number:`%s is not a %s`,date:`%s is not a %s`,boolean:`%s is not a %s`,integer:`%s is not an %s`,float:`%s is not a %s`,regexp:`%s is not a valid %s`,email:`%s is not a valid %s`,url:`%s is not a valid %s`,hex:`%s is not a valid %s`},string:{len:`%s must be exactly %s characters`,min:`%s must be at least %s characters`,max:`%s cannot be longer than %s characters`,range:`%s must be between %s and %s characters`},number:{len:`%s must equal %s`,min:`%s cannot be less than %s`,max:`%s cannot be greater than %s`,range:`%s must be between %s and %s`},array:{len:`%s must be exactly %s in length`,min:`%s cannot be less than %s in length`,max:`%s cannot be greater than %s in length`,range:`%s must be between %s and %s in length`},pattern:{mismatch:`%s value %s does not match pattern %s`},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var zj=Rj(),Bj=function(){function e(e){this.rules=null,this._messages=zj,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw Error(`Cannot configure a schema with no rules`);if(typeof e!=`object`||Array.isArray(e))throw Error(`Rules must be an object`);this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})},t.messages=function(e){return e&&(this._messages=dj(Rj(),e)),this._messages},t.validate=function(t,n,r){var i=this;n===void 0&&(n={}),r===void 0&&(r=function(){});var a=t,o=n,s=r;if(typeof o==`function`&&(s=o,o={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(null,a),Promise.resolve(a);function c(e){var t=[],n={};function r(e){if(Array.isArray(e)){var n;t=(n=t).concat.apply(n,e)}else t.push(e)}for(var i=0;i3&&arguments[3]!==void 0&&arguments[3];return t.length&&r&&n===void 0&&!Hj(e,t.slice(0,-1))?e:Uj(e,t,n,r)}function Gj(e){return Vj(e)}function Kj(e,t){return Hj(e,t)}function qj(e,t,n){return Wj(e,t,n,arguments.length>3&&arguments[3]!==void 0&&arguments[3])}function Jj(e,t){return e&&e.some(e=>$j(e,t))}function Yj(e){return typeof e==`object`&&!!e&&Object.getPrototypeOf(e)===Object.prototype}function Xj(e,t){let n=Array.isArray(e)?[...e]:Z({},e);return t&&Object.keys(t).forEach(e=>{let r=n[e],i=t[e],a=Yj(r)&&Yj(i);n[e]=a?Xj(r,i||{}):i}),n}function Zj(e){return[...arguments].slice(1).reduce((e,t)=>Xj(e,t),e)}function Qj(e,t){let n={};return t.forEach(t=>{let r=Kj(e,t);n=qj(n,t,r)}),n}function $j(e,t){return!e||!t||e.length!==t.length?!1:e.every((e,n)=>t[n]===e)}var eM="'${name}' is not a valid ${type}",tM={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:eM,method:eM,array:eM,object:eM,number:eM,date:eM,boolean:eM,integer:eM,float:eM,regexp:eM,email:eM,url:eM,hex:eM},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},nM=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},rM=Bj;function iM(e,t){return e.replace(/\$\{\w+\}/g,e=>t[e.slice(2,-1)])}function aM(e,t,n,r,i){return nM(this,void 0,void 0,function*(){let a=Z({},n);delete a.ruleIndex,delete a.trigger;let o=null;a&&a.type===`array`&&a.defaultField&&(o=a.defaultField,delete a.defaultField);let s=new rM({[e]:[a]}),c=Zj({},tM,r.validateMessages);s.messages(c);let l=[];try{yield Promise.resolve(s.validate({[e]:t},Z({},r)))}catch(e){e.errors?l=e.errors.map((e,t)=>{let{message:n}=e;return Nt(n)?it(n,{key:`error_${t}`}):n}):(console.error(e),l=[c.default()])}if(!l.length&&o)return(yield Promise.all(t.map((t,n)=>aM(`${e}.${n}`,t,o,r,i)))).reduce((e,t)=>[...e,...t],[]);let u=Z(Z(Z({},n),{name:e,enum:(n.enum||[]).join(`, `)}),i);return l.map(e=>typeof e==`string`?iM(e,u):e)})}function oM(e,t,n,r,i,a){let o=e.join(`.`),s=n.map((e,t)=>{let n=e.validator,r=Z(Z({},e),{ruleIndex:t});return n&&(r.validator=(e,t,r)=>{let i=!1,a=n(e,t,function(){var e=[...arguments];Promise.resolve().then(()=>{i||r(...e)})});i=a&&typeof a.then==`function`&&typeof a.catch==`function`,i&&a.then(()=>{r()}).catch(e=>{r(e||` `)})}),r}).sort((e,t)=>{let{warningOnly:n,ruleIndex:r}=e,{warningOnly:i,ruleIndex:a}=t;return!!n==!!i?r-a:n?1:-1}),c;if(i===!0)c=new Promise((e,n)=>nM(this,void 0,void 0,function*(){for(let e=0;eaM(o,t,e,r,a).then(t=>({errors:t,rule:e})));c=(i?cM(e):sM(e)).then(e=>Promise.reject(e))}return c.catch(e=>e),c}function sM(e){return nM(this,void 0,void 0,function*(){return Promise.all(e).then(e=>[].concat(...e))})}function cM(e){return nM(this,void 0,void 0,function*(){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(r=>{r.errors.length&&n([r]),t+=1,t===e.length&&n([])})})})})}var lM=Symbol(`formContextKey`),uM=e=>{fe(lM,e)},dM=()=>g(lM,{name:J(()=>void 0),labelAlign:J(()=>`right`),vertical:J(()=>!1),addField:(e,t)=>{},removeField:e=>{},model:J(()=>void 0),rules:J(()=>void 0),colon:J(()=>void 0),labelWrap:J(()=>void 0),labelCol:J(()=>void 0),requiredMark:J(()=>!1),validateTrigger:J(()=>void 0),onValidate:()=>{},validateMessages:J(()=>tM)}),fM=Symbol(`formItemPrefixContextKey`),pM=e=>{fe(fM,e)},mM=()=>g(fM,{prefixCls:J(()=>``)});function hM(e){return typeof e==`number`?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}var gM=()=>({span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}),_M=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`],vM=u({compatConfig:{MODE:3},name:`ACol`,inheritAttrs:!1,props:gM(),setup(e,t){let{slots:n,attrs:r}=t,{gutter:i,supportFlexGap:a,wrap:o}=PA(),{prefixCls:s,direction:c}=X(`col`,e),[l,u]=VA(s),d=J(()=>{let{span:t,order:n,offset:i,push:a,pull:o}=e,l=s.value,d={};return _M.forEach(t=>{let n={},r=e[t];typeof r==`number`?n.span=r:typeof r==`object`&&(n=r||{}),d=Z(Z({},d),{[`${l}-${t}-${n.span}`]:n.span!==void 0,[`${l}-${t}-order-${n.order}`]:n.order||n.order===0,[`${l}-${t}-offset-${n.offset}`]:n.offset||n.offset===0,[`${l}-${t}-push-${n.push}`]:n.push||n.push===0,[`${l}-${t}-pull-${n.pull}`]:n.pull||n.pull===0,[`${l}-rtl`]:c.value===`rtl`})}),K(l,{[`${l}-${t}`]:t!==void 0,[`${l}-order-${n}`]:n,[`${l}-offset-${i}`]:i,[`${l}-push-${a}`]:a,[`${l}-pull-${o}`]:o},d,r.class,u.value)}),f=J(()=>{let{flex:t}=e,n=i.value,r={};if(n&&n[0]>0){let e=`${n[0]/2}px`;r.paddingLeft=e,r.paddingRight=e}if(n&&n[1]>0&&!a.value){let e=`${n[1]/2}px`;r.paddingTop=e,r.paddingBottom=e}return t&&(r.flex=hM(t),o.value===!1&&!r.minWidth&&(r.minWidth=0)),r});return()=>l(U(`div`,Y(Y({},r),{},{class:d.value,style:[f.value,r.style]}),[n.default?.call(n)]))}}),yM={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}},{tag:`path`,attrs:{d:`M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`question-circle`,theme:`outlined`};function bM(e){for(var t=1;t{let{slots:n,emit:r,attrs:i}=t,{prefixCls:a,htmlFor:o,labelCol:s,labelAlign:c,colon:l,required:u,requiredMark:d}=Z(Z({},e),i),[f]=Kt(`Form`),p=e.label??n.label?.call(n);if(!p)return null;let{vertical:m,labelAlign:h,labelCol:g,labelWrap:_,colon:v}=dM(),y=s||g?.value||{},b=c||h?.value,x=`${a}-item-label`,S=K(x,b===`left`&&`${x}-left`,y.class,{[`${x}-wrap`]:!!_.value}),C=p,w=l===!0||v?.value!==!1&&l!==!1;if(w&&!m.value&&typeof p==`string`&&p.trim()!==``&&(C=p.replace(/[:|:]\s*$/,``)),e.tooltip||n.tooltip){let t=U(`span`,{class:`${a}-item-tooltip`},[U(Ty,{title:e.tooltip},{default:()=>[U(SM,null,null)]})]);C=U($e,null,[C,n.tooltip?n.tooltip?.call(n,{class:`${a}-item-tooltip`}):t])}d===`optional`&&!u&&(C=U($e,null,[C,U(`span`,{class:`${a}-item-optional`},[f.value?.optional||Ye.Form?.optional])]));let T=K({[`${a}-item-required`]:u,[`${a}-item-required-mark-optional`]:d===`optional`,[`${a}-item-no-colon`]:!w});return U(vM,Y(Y({},y),{},{class:S}),{default:()=>[U(`label`,{for:o,class:T,title:typeof p==`string`?p:``,onClick:e=>r(`click`,e)},[C])]})};CM.displayName=`FormItemLabel`,CM.inheritAttrs=!1;var wM=e=>{let{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:`hidden`,transition:`height ${e.motionDurationSlow} ${e.motionEaseInOut}, + opacity ${e.motionDurationSlow} ${e.motionEaseInOut}, + transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:`translateY(-5px)`,opacity:0,"&-active":{transform:`translateY(0)`,opacity:1}},[`&${r}-leave-active`]:{transform:`translateY(-5px)`}}}}},TM=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},label:{fontSize:e.fontSize},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),EM=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},DM=e=>{let{componentCls:t}=e;return{[e.componentCls]:Z(Z(Z({},rn(e)),TM(e)),{[`${t}-text`]:{display:`inline-block`,paddingInlineEnd:e.paddingSM},"&-small":Z({},EM(e,e.controlHeightSM)),"&-large":Z({},EM(e,e.controlHeightLG))})}},OM=e=>{let{formItemCls:t,iconCls:n,componentCls:r,rootPrefixCls:i}=e;return{[t]:Z(Z({},rn(e)),{marginBottom:e.marginLG,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden, + &-hidden.${i}-row`]:{display:`none`},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{display:`inline-block`,flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:`${e.lineHeight} - 0.25em`,whiteSpace:`unset`},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:e.controlHeight,color:e.colorTextHeading,fontSize:e.fontSize,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:`top`},[`&${t}-required:not(${t}-required-mark-optional)::before`]:{display:`inline-block`,marginInlineEnd:e.marginXXS,color:e.colorError,fontSize:e.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`,[`${r}-hide-required-mark &`]:{display:`none`}},[`${t}-optional`]:{display:`inline-block`,marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`${r}-hide-required-mark &`]:{display:`none`}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:e.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:e.marginXXS/2,marginInlineEnd:e.marginXS},[`&${t}-no-colon::after`]:{content:`" "`}}},[`${t}-control`]:{display:`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${i}-col-'"]):not([class*="' ${i}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:e.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`}}},[t]:{"&-explain, &-extra":{clear:`both`,color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:`auto`,opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:`center`,visibility:`visible`,animationName:z_,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},kM=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label.${r}-col-24 + ${n}-control`]:{minWidth:`unset`}}}},AM=e=>{let{componentCls:t,formItemCls:n}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[n]:{flex:`none`,flexWrap:`nowrap`,marginInlineEnd:e.margin,marginBottom:0,"&-with-help":{marginBottom:e.marginLG},[`> ${n}-label, + > ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},jM=e=>({margin:0,padding:`0 0 ${e.paddingXS}px`,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{display:`none`}}}),MM=e=>{let{componentCls:t,formItemCls:n}=e;return{[`${n} ${n}-label`]:jM(e),[t]:{[n]:{flexWrap:`wrap`,[`${n}-label, + ${n}-control`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}},NM=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-vertical`]:{[n]:{"&-row":{flexDirection:`column`},"&-label > label":{height:`auto`},[`${t}-item-control`]:{width:`100%`}}},[`${t}-vertical ${n}-label, + .${r}-col-24${n}-label, + .${r}-col-xl-24${n}-label`]:jM(e),[`@media (max-width: ${e.screenXSMax}px)`]:[MM(e),{[t]:{[`.${r}-col-xs-24${n}-label`]:jM(e)}}],[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{[`.${r}-col-sm-24${n}-label`]:jM(e)}},[`@media (max-width: ${e.screenMDMax}px)`]:{[t]:{[`.${r}-col-md-24${n}-label`]:jM(e)}},[`@media (max-width: ${e.screenLGMax}px)`]:{[t]:{[`.${r}-col-lg-24${n}-label`]:jM(e)}}}},PM=v(`Form`,(e,t)=>{let{rootPrefixCls:n}=t,r=B(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:n});return[DM(r),OM(r),wM(r),kM(r),AM(r),NM(r),$_(r),z_]}),FM=u({compatConfig:{MODE:3},name:`ErrorList`,inheritAttrs:!1,props:[`errors`,`help`,`onErrorVisibleChanged`,`helpStatus`,`warnings`],setup(e,t){let{attrs:n}=t,{prefixCls:r,status:i}=mM(),a=J(()=>`${r.value}-item-explain`),o=J(()=>!!(e.errors&&e.errors.length)),s=H(i.value),[,c]=PM(r);return G([o,i],()=>{o.value&&(s.value=i.value)}),()=>{let t=aS(`${r.value}-show-help-item`),i=l(`${r.value}-show-help-item`,t);return i.role=`alert`,i.class=[c.value,a.value,n.class,`${r.value}-show-help`],U(Re,Y(Y({},ge(`${r.value}-show-help`)),{},{onAfterEnter:()=>e.onErrorVisibleChanged(!0),onAfterLeave:()=>e.onErrorVisibleChanged(!1)}),{default:()=>[Mt(U(Tt,Y(Y({},i),{},{tag:`div`}),{default:()=>[e.errors?.map((e,t)=>U(`div`,{key:t,class:s.value?`${a.value}-${s.value}`:``},[e]))]}),[[ht,!!e.errors?.length]])]})}}}),IM=u({compatConfig:{MODE:3},slots:Object,inheritAttrs:!1,props:[`prefixCls`,`errors`,`hasFeedback`,`onDomErrorVisibleChange`,`wrapperCol`,`help`,`extra`,`status`,`marginBottom`,`onErrorVisibleChanged`],setup(e,t){let{slots:n}=t,r=dM(),{wrapperCol:i}=r,a=Z({},r);return delete a.labelCol,delete a.wrapperCol,uM(a),pM({prefixCls:J(()=>e.prefixCls),status:J(()=>e.status)}),()=>{let{prefixCls:t,wrapperCol:r,marginBottom:a,onErrorVisibleChanged:o,help:s=n.help?.call(n),errors:c=dt(n.errors?.call(n)),extra:l=n.extra?.call(n)}=e,u=`${t}-item`,d=r||i?.value||{},f=K(`${u}-control`,d.class);return U(vM,Y(Y({},d),{},{class:f}),{default:()=>U($e,null,[U(`div`,{class:`${u}-control-input`},[U(`div`,{class:`${u}-control-input-content`},[n.default?.call(n)])]),a!==null||c.length?U(`div`,{style:{display:`flex`,flexWrap:`nowrap`}},[U(FM,{errors:c,help:s,class:`${u}-explain-connected`,onErrorVisibleChanged:o},null),!!a&&U(`div`,{style:{width:0,height:`${a}px`}},null)]):null,l?U(`div`,{class:`${u}-extra`},[l]):null])})}}});function LM(e){let t=q(e.value.slice()),n=null;return S(()=>{clearTimeout(n),n=setTimeout(()=>{t.value=e.value},e.value.length?0:10)}),t}m(`success`,`warning`,`error`,`validating`,``);var RM={success:qe,warning:Wt,error:tt,validating:qt};function zM(e,t,n){let r=e,i=t,a=0;try{for(let e=i.length;a({htmlFor:String,prefixCls:String,label:f.any,help:f.any,extra:f.any,labelCol:{type:Object},wrapperCol:{type:Object},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:String,prop:{type:[String,Number,Array]},name:{type:[String,Number,Array]},rules:[Array,Object],autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:f.oneOf(m(``,`success`,`warning`,`error`,`validating`)),validateTrigger:{type:[String,Array]},messageVariables:{type:Object},hidden:Boolean,noStyle:Boolean,tooltip:String}),VM=0,HM=`form_item`,UM=u({compatConfig:{MODE:3},name:`AFormItem`,inheritAttrs:!1,__ANT_NEW_FORM_ITEM:!0,props:BM(),slots:Object,setup(e,t){let{slots:n,attrs:r,expose:i}=t;e.prop;let a=`form-item-${++VM}`,{prefixCls:o}=X(`form`,e),[s,c]=PM(o),l=q(),u=dM(),d=J(()=>e.name||e.prop),f=q([]),p=q(!1),m=q(),h=J(()=>{let e=d.value;return Gj(e)}),g=J(()=>{if(h.value.length){let e=u.name.value,t=h.value.join(`_`);return e?`${e}_${t}`:`${HM}_${t}`}else return}),_=()=>{let e=u.model.value;if(!(!e||!d.value))return zM(e,h.value,!0).v},v=J(()=>_()),y=q(Xh(v.value)),b=J(()=>{let t=e.validateTrigger===void 0?u.validateTrigger.value:e.validateTrigger;return t=t===void 0?`change`:t,Vj(t)}),x=J(()=>{let t=u.rules.value,n=e.rules,r=e.required===void 0?[]:{required:!!e.required,trigger:b.value},i=zM(t,h.value);t=t?i.o[i.k]||i.v:[];let a=[].concat(n||t||[]);return Ng(a,e=>e.required)?a:a.concat(r)}),C=J(()=>{let t=x.value,n=!1;return t&&t.length&&t.every(e=>e.required?(n=!0,!1):!0),n||e.required}),w=q();S(()=>{w.value=e.validateStatus});let T=J(()=>{let t={};return typeof e.label==`string`?t.label=e.label:e.name&&(t.label=String(e.name)),e.messageVariables&&(t=Z(Z({},t),e.messageVariables)),t}),E=t=>{if(h.value.length===0)return;let{validateFirst:n=!1}=e,{triggerName:r}=t||{},i=x.value;if(r&&(i=i.filter(e=>{let{trigger:t}=e;return!t&&!b.value.length||Vj(t||b.value).includes(r)})),!i.length)return Promise.resolve();let a=oM(h.value,v.value,i,Z({validateMessages:u.validateMessages.value},t),n,T.value);return w.value=`validating`,f.value=[],a.catch(e=>e).then(function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(w.value===`validating`){let t=e.filter(e=>e&&e.errors.length);w.value=t.length?`error`:`success`,f.value=t.map(e=>e.errors),u.onValidate(d.value,!f.value.length,f.value.length?Ht(f.value[0]):null)}}),a},D=()=>{E({triggerName:`blur`})},O=()=>{if(p.value){p.value=!1;return}E({triggerName:`change`})},k=()=>{w.value=e.validateStatus,p.value=!1,f.value=[]},A=()=>{w.value=e.validateStatus,p.value=!0,f.value=[];let t=u.model.value||{},n=v.value,r=zM(t,h.value,!0);Array.isArray(n)?r.o[r.k]=[].concat(y.value??[]):r.o[r.k]=y.value,z(()=>{p.value=!1})},j=J(()=>e.htmlFor===void 0?g.value:e.htmlFor),M=()=>{let e=j.value;if(!e||!m.value)return;let t=m.value.$el.querySelector(`[id="${e}"]`);t&&t.focus&&t.focus()};i({onFieldBlur:D,onFieldChange:O,clearValidate:k,resetField:A}),If({id:g,onFieldBlur:()=>{e.autoLink&&D()},onFieldChange:()=>{e.autoLink&&O()},clearValidate:k},J(()=>!!(e.autoLink&&u.model.value&&d.value)));let N=!1;G(d,e=>{e?N||(N=!0,u.addField(a,{fieldValue:v,fieldId:g,fieldName:d,resetField:A,clearValidate:k,namePath:h,validateRules:E,rules:x})):(N=!1,u.removeField(a))},{immediate:!0}),ut(()=>{u.removeField(a)});let P=LM(f),F=J(()=>e.validateStatus===void 0?P.value.length?`error`:w.value:e.validateStatus),I=J(()=>({[`${o.value}-item`]:!0,[c.value]:!0,[`${o.value}-item-has-feedback`]:F.value&&e.hasFeedback,[`${o.value}-item-has-success`]:F.value===`success`,[`${o.value}-item-has-warning`]:F.value===`warning`,[`${o.value}-item-has-error`]:F.value===`error`,[`${o.value}-item-is-validating`]:F.value===`validating`,[`${o.value}-item-hidden`]:e.hidden})),L=Ne({});Vf.useProvide(L),S(()=>{let t;if(e.hasFeedback){let e=F.value&&RM[F.value];t=e?U(`span`,{class:K(`${o.value}-item-feedback-icon`,`${o.value}-item-feedback-icon-${F.value}`)},[U(e,null,null)]):null}Z(L,{status:F.value,hasFeedback:e.hasFeedback,feedbackIcon:t,isFormItemInput:!0})});let ee=q(null),te=q(!1),ne=()=>{if(l.value){let e=getComputedStyle(l.value);ee.value=parseInt(e.marginBottom,10)}};V(()=>{G(te,()=>{te.value&&ne()},{flush:`post`,immediate:!0})});let R=e=>{e||(ee.value=null)};return()=>{if(e.noStyle)return n.default?.call(n);let t=e.help??(n.help?dt(n.help()):null),i=!!(t!=null&&Array.isArray(t)&&t.length||P.value.length);return te.value=i,s(U(`div`,{class:[I.value,i?`${o.value}-item-with-help`:``,r.class],ref:l},[U(HA,Y(Y({},r),{},{class:`${o.value}-item-row`,key:`row`}),{default:()=>U($e,null,[U(CM,Y(Y({},e),{},{htmlFor:j.value,required:C.value,requiredMark:u.requiredMark.value,prefixCls:o.value,onClick:M,label:e.label}),{label:n.label,tooltip:n.tooltip}),U(IM,Y(Y({},e),{},{errors:t==null?P.value:Vj(t),marginBottom:ee.value,prefixCls:o.value,status:F.value,ref:m,help:t,extra:e.extra??n.extra?.call(n),onErrorVisibleChanged:R}),{default:n.default})])}),!!ee.value&&U(`div`,{class:`${o.value}-margin-offset`,style:{marginBottom:`-${ee.value}px`}},null)]))}}});function WM(e){let t=!1,n=e.length,r=[];return e.length?new Promise((i,a)=>{e.forEach((e,o)=>{e.catch(e=>(t=!0,e)).then(e=>{--n,r[o]=e,!(n>0)&&(t&&a(r),i(r))})})}):Promise.resolve([])}function GM(e){let t=!1;return e&&e.length&&e.every(e=>e.required?(t=!0,!1):!0),t}function KM(e){return e==null?[]:Array.isArray(e)?e:[e]}function qM(e,t,n){let r=e;t=t.replace(/\[(\w+)\]/g,`.$1`),t=t.replace(/^\./,``);let i=t.split(`.`),a=0;for(let e=i.length;a1&&arguments[1]!==void 0?arguments[1]:H({}),n=arguments.length>2?arguments[2]:void 0,r=Xh(ze(e)),i=Ne({}),a=q([]),o=n=>{Z(ze(e),Z(Z({},Xh(r)),n)),z(()=>{Object.keys(i).forEach(e=>{i[e]={autoLink:!1,required:GM(ze(t)[e])}})})},s=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t.length?e.filter(e=>Rg(KM(e.trigger||`change`),t).length):e},c=null,l=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a=[],o={};for(let c=0;c({name:l,errors:[],warnings:[]})).catch(e=>{let t=[],n=[];return e.forEach(e=>{let{rule:{warningOnly:r},errors:i}=e;r?n.push(...i):t.push(...i)}),t.length?Promise.reject({name:l,errors:t,warnings:n}):{name:l,errors:t,warnings:n}}))}let l=WM(a);c=l;let d=l.then(()=>c===l?Promise.resolve(o):Promise.reject([])).catch(e=>{let t=e.filter(e=>e&&e.errors.length);return t.length?Promise.reject({values:o,errorFields:t,outOfDate:c!==l}):Promise.resolve(o)});return d.catch(e=>e),d},u=function(e,t,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=oM([e],t,r,Z({validateMessages:tM},a),!!a.validateFirst);return i[e]?(i[e].validateStatus=`validating`,o.catch(e=>e).then(function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];var r;if(i[e].validateStatus===`validating`){let a=t.filter(e=>e&&e.errors.length);i[e].validateStatus=a.length?`error`:`success`,i[e].help=a.length?a.map(e=>e.errors):null,(r=n?.onValidate)==null||r.call(n,e,!a.length,a.length?Ht(i[e].help[0]):null)}}),o):o.catch(e=>e)},d=(e,t)=>{let n=[],r=!0;e?n=Array.isArray(e)?e:[e]:(r=!1,n=a.value);let i=l(n,t||{},r);return i.catch(e=>e),i},f=e=>{let t=[];t=e?Array.isArray(e)?e:[e]:a.value,t.forEach(e=>{i[e]&&Z(i[e],{validateStatus:``,help:null})})},p=e=>{let t={autoLink:!1},n=[],r=Array.isArray(e)?e:[e];for(let e=0;e{let t=[];a.value.forEach(r=>{let i=qM(e,r,!1),a=qM(m,r,!1);(h&&n?.immediate&&i.isValid||!Ql(i.v,a.v))&&t.push(r)}),d(t,{trigger:`change`}),h=!1,m=Xh(Ht(e))},_=n?.debounce,v=!0;return G(t,()=>{a.value=t?Object.keys(ze(t)):[],!v&&n&&n.validateOnRuleChange&&d(),v=!1},{deep:!0,immediate:!0}),G(a,()=>{let e={};a.value.forEach(n=>{e[n]=Z({},i[n],{autoLink:!1,required:GM(ze(t)[n])}),delete i[n]});for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&delete i[e];Z(i,e)},{immediate:!0}),G(e,_&&_.wait?Eg(g,_.wait,Qg(_,[`wait`])):g,{immediate:n&&!!n.immediate,deep:!0}),{modelRef:e,rulesRef:t,initialModel:r,validateInfos:i,resetFields:o,validate:d,validateField:u,mergeValidateInfo:p,clearValidate:f}}var YM=()=>({layout:f.oneOf(m(`horizontal`,`inline`,`vertical`)),labelCol:Qt(),wrapperCol:Qt(),colon:Q(),labelAlign:_(),labelWrap:Q(),prefixCls:String,requiredMark:W([String,Boolean]),hideRequiredMark:Q(),model:f.object,rules:Qt(),validateMessages:Qt(),validateOnRuleChange:Q(),scrollToFirstError:nn(),onSubmit:d(),name:String,validateTrigger:W([String,Array]),size:_(),disabled:Q(),onValuesChange:d(),onFieldsChange:d(),onFinish:d(),onFinishFailed:d(),onValidate:d()});function XM(e,t){return Ql(Vj(e),Vj(t))}var ZM=u({compatConfig:{MODE:3},name:`AForm`,inheritAttrs:!1,props:Zn(YM(),{layout:`horizontal`,hideRequiredMark:!1,colon:!0}),Item:UM,useForm:JM,setup(t,n){let{emit:i,slots:a,expose:o,attrs:s}=n,{prefixCls:c,direction:l,form:u,size:d,disabled:f}=X(`form`,t),p=J(()=>t.requiredMark===``||t.requiredMark),m=J(()=>p.value===void 0?u&&u.value?.requiredMark!==void 0?u.value.requiredMark:!t.hideRequiredMark:p.value);r(d),nt(f);let h=J(()=>t.colon??u.value?.colon),{validateMessages:g}=Yt(),_=J(()=>Z(Z(Z({},tM),g.value),t.validateMessages)),[v,y]=PM(c),b=J(()=>K(c.value,{[`${c.value}-${t.layout}`]:!0,[`${c.value}-hide-required-mark`]:m.value===!1,[`${c.value}-rtl`]:l.value===`rtl`,[`${c.value}-${d.value}`]:d.value},y.value)),x=H(),S={},C=(e,t)=>{S[e]=t},w=e=>{delete S[e]},T=e=>{let t=!!e,n=t?Vj(e).map(Gj):[];return t?Object.values(S).filter(e=>n.findIndex(t=>XM(t,e.fieldName.value))>-1):Object.values(S)},E=n=>{if(!t.model){e(!1,`Form`,`model is required for resetFields to work.`);return}T(n).forEach(e=>{e.resetField()})},D=e=>{T(e).forEach(e=>{e.clearValidate()})},O=e=>{let{scrollToFirstError:n}=t;if(i(`finishFailed`,e),n&&e.errorFields.length){let t={};typeof n==`object`&&(t=n),A(e.errorFields[0].name,t)}},k=function(){return N(...arguments)},A=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=T(e?[e]:void 0);if(n.length){let e=n[0].fieldId.value,r=e?document.getElementById(e):null;r&&ei(r,Z({scrollMode:`if-needed`,block:`nearest`},t))}},j=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(e===!0){let e=[];return Object.values(S).forEach(t=>{let{namePath:n}=t;e.push(n.value)}),Qj(t.model,e)}else return Qj(t.model,e)},M=(n,r)=>{if(e(!(n instanceof Function),`Form`,`validateFields/validateField/validate not support callback, please use promise instead`),!t.model)return e(!1,`Form`,`model is required for validateFields to work.`),Promise.reject("Form `model` is required for validateFields to work.");let i=!!n,a=i?Vj(n).map(Gj):[],o=[];Object.values(S).forEach(e=>{if(i||a.push(e.namePath.value),!e.rules?.value.length)return;let t=e.namePath.value;if(!i||Jj(a,t)){let n=e.validateRules(Z({validateMessages:_.value},r));o.push(n.then(()=>({name:t,errors:[],warnings:[]})).catch(e=>{let n=[],r=[];return e.forEach(e=>{let{rule:{warningOnly:t},errors:i}=e;t?r.push(...i):n.push(...i)}),n.length?Promise.reject({name:t,errors:n,warnings:r}):{name:t,errors:n,warnings:r}}))}});let s=WM(o);x.value=s;let c=s.then(()=>x.value===s?Promise.resolve(j(a)):Promise.reject([])).catch(e=>{let t=e.filter(e=>e&&e.errors.length);return Promise.reject({values:j(a),errorFields:t,outOfDate:x.value!==s})});return c.catch(e=>e),c},N=function(){return M(...arguments)},P=e=>{e.preventDefault(),e.stopPropagation(),i(`submit`,e),t.model&&M().then(e=>{i(`finish`,e)}).catch(e=>{O(e)})};return o({resetFields:E,clearValidate:D,validateFields:M,getFieldsValue:j,validate:k,scrollToField:A}),uM({model:J(()=>t.model),name:J(()=>t.name),labelAlign:J(()=>t.labelAlign),labelCol:J(()=>t.labelCol),labelWrap:J(()=>t.labelWrap),wrapperCol:J(()=>t.wrapperCol),vertical:J(()=>t.layout===`vertical`),colon:h,requiredMark:m,validateTrigger:J(()=>t.validateTrigger),rules:J(()=>t.rules),addField:C,removeField:w,onValidate:(e,t,n)=>{i(`validate`,e,t,n)},validateMessages:_}),G(()=>t.rules,()=>{t.validateOnRuleChange&&M()}),()=>v(U(`form`,Y(Y({},s),{},{onSubmit:P,class:[b.value,s.class]}),[a.default?.call(a)]))}});ZM.useInjectFormItemContext=zf,ZM.ItemRest=Bf,ZM.install=function(e){return e.component(ZM.name,ZM),e.component(ZM.Item.name,ZM.Item),e.component(Bf.name,Bf),e};var QM=ZM,$M=new N(`antCheckboxEffect`,{"0%":{transform:`scale(1)`,opacity:.5},"100%":{transform:`scale(1.6)`,opacity:0}}),eN=e=>{let{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Z(Z({},rn(e)),{display:`inline-flex`,flexWrap:`wrap`,columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Z(Z({},rn(e)),{display:`inline-flex`,alignItems:`baseline`,cursor:`pointer`,"&:after":{display:`inline-block`,width:0,overflow:`hidden`,content:`'\\a0'`},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Z(Z({},rn(e)),{position:`relative`,whiteSpace:`nowrap`,lineHeight:1,cursor:`pointer`,alignSelf:`center`,[`${t}-input`]:{position:`absolute`,inset:0,zIndex:1,cursor:`pointer`,opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:Z({},I(e))},[`${t}-inner`]:{boxSizing:`border-box`,position:`relative`,top:0,insetInlineStart:0,display:`block`,width:e.checkboxSize,height:e.checkboxSize,direction:`ltr`,backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:`separate`,transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:`border-box`,position:`absolute`,top:`50%`,insetInlineStart:`21.5%`,display:`table`,width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:`rotate(45deg) scale(0) translate(-50%,-50%)`,opacity:0,content:`""`,transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[t]:{"&-indeterminate":{[`${t}-inner`]:{"&:after":{top:`50%`,insetInlineStart:`50%`,width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:`translate(-50%, -50%) scale(1)`,opacity:1,content:`""`}}}}},{[`${n}:hover ${t}:after`]:{visibility:`visible`},[` + ${n}:not(${n}-disabled), + ${t}:not(${t}-disabled) + `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:`rotate(45deg) scale(1) translate(-50%,-50%)`,transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}},"&:after":{position:`absolute`,top:0,insetInlineStart:0,width:`100%`,height:`100%`,borderRadius:e.borderRadiusSM,visibility:`hidden`,border:`${e.lineWidthBold}px solid ${e.colorPrimary}`,animationName:$M,animationDuration:e.motionDurationSlow,animationTimingFunction:`ease-in-out`,animationFillMode:`backwards`,content:`""`,transition:`all ${e.motionDurationSlow}`}},[` + ${n}-checked:not(${n}-disabled), + ${t}-checked:not(${t}-disabled) + `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`},[`&:hover ${t}:after`]:{borderColor:e.colorPrimaryHover}}},{[`${n}-disabled`]:{cursor:`not-allowed`},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:`not-allowed`,pointerEvents:`none`},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:`none`},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function tN(e,t){return[eN(B(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))]}var nN=v(`Checkbox`,(e,t)=>{let{prefixCls:n}=t;return[tN(n,e)]}),rN=e=>{let{prefixCls:t,componentCls:n,antCls:r}=e,i=`${n}-menu-item`,a=` + &${i}-expand ${i}-expand-icon, + ${i}-loading-icon + `,o=Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2);return[{[n]:{width:e.controlWidth}},{[`${n}-dropdown`]:[tN(`${t}-checkbox`,e),{[`&${r}-select-dropdown`]:{padding:0}},{[n]:{"&-checkbox":{top:0,marginInlineEnd:e.paddingXS},"&-menus":{display:`flex`,flexWrap:`nowrap`,alignItems:`flex-start`,[`&${n}-menu-empty`]:{[`${n}-menu`]:{width:`100%`,height:`auto`,[i]:{color:e.colorTextDisabled}}}},"&-menu":{flexGrow:1,minWidth:e.controlItemWidth,height:e.dropdownHeight,margin:0,padding:e.paddingXXS,overflow:`auto`,verticalAlign:`top`,listStyle:`none`,"-ms-overflow-style":`-ms-autohiding-scrollbar`,"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-item":Z(Z({},xe),{display:`flex`,flexWrap:`nowrap`,alignItems:`center`,padding:`${o}px ${e.paddingSM}px`,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,"&:hover":{background:e.controlItemBgHover},"&-disabled":{color:e.colorTextDisabled,cursor:`not-allowed`,"&:hover":{background:`transparent`},[a]:{color:e.colorTextDisabled}},[`&-active:not(${i}-disabled)`]:{"&, &:hover":{fontWeight:e.fontWeightStrong,backgroundColor:e.controlItemBgActive}},"&-content":{flex:`auto`},[a]:{marginInlineStart:e.paddingXXS,color:e.colorTextDescription,fontSize:e.fontSizeIcon},"&-keyword":{color:e.colorHighlight}})}}}]},{[`${n}-dropdown-rtl`]:{direction:`rtl`}},uv(e)]},iN=v(`Cascader`,e=>[rN(e)],{controlWidth:184,controlItemWidth:111,dropdownHeight:180}),aN=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ir===0?[n]:[...e,t,n],[]),i=[],a=0;return r.forEach((t,r)=>{let o=a+t.length,s=e.slice(a,o);a=o,r%2==1&&(s=U(`span`,{class:`${n}-menu-item-keyword`,key:`seperator`},[s])),i.push(s)}),i}var sN=e=>{let{inputValue:t,path:n,prefixCls:r,fieldNames:i}=e,a=[],o=t.toLowerCase();return n.forEach((e,t)=>{t!==0&&a.push(` / `);let n=e[i.label],s=typeof n;(s===`string`||s===`number`)&&(n=oN(String(n),o,r)),a.push(n)}),a};function cN(){return Z(Z({},Br(_A(),[`customSlots`,`checkable`,`options`])),{multiple:{type:Boolean,default:void 0},size:String,bordered:{type:Boolean,default:void 0},placement:{type:String},suffixIcon:f.any,status:String,options:Array,popupClassName:String,dropdownClassName:String,"onUpdate:value":Function})}var lN=a(Z(u({compatConfig:{MODE:3},name:`ACascader`,inheritAttrs:!1,props:Zn(cN(),{bordered:!0,choiceTransitionName:``,allowClear:!0}),setup(e,t){let{attrs:n,expose:r,slots:i,emit:a}=t,o=zf(),s=Vf.useInject(),c=J(()=>Wf(s.status,e.status)),{prefixCls:l,rootPrefixCls:u,getPrefixCls:d,direction:f,getPopupContainer:p,renderEmpty:m,size:h,disabled:g}=X(`cascader`,e),_=J(()=>d(`select`,e.prefixCls)),{compactSize:v,compactItemClassnames:y}=u_(_,f),b=J(()=>v.value||h.value),x=at(),S=J(()=>g.value??x.value),[C,w]=gv(_),[T]=iN(l),E=J(()=>f.value===`rtl`),D=J(()=>{if(!e.showSearch)return e.showSearch;let t={render:sN};return typeof e.showSearch==`object`&&(t=Z(Z({},t),e.showSearch)),t}),O=J(()=>K(e.popupClassName||e.dropdownClassName,`${l.value}-dropdown`,{[`${l.value}-dropdown-rtl`]:E.value},w.value)),k=H();r({focus(){var e;(e=k.value)==null||e.focus()},blur(){var e;(e=k.value)==null||e.blur()}});let A=function(){var e=[...arguments];a(`update:value`,e[0]),a(`change`,...e),o.onFieldChange()},j=function(){a(`blur`,...arguments),o.onFieldBlur()},M=J(()=>e.showArrow===void 0?e.loading||!e.multiple:e.showArrow),N=J(()=>e.placement===void 0?f.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement);return()=>{let{notFoundContent:t=i.notFoundContent?.call(i),expandIcon:r=i.expandIcon?.call(i),multiple:a,bordered:d,allowClear:h,choiceTransitionName:g,transitionName:v,id:x=o.id.value}=e,P=aN(e,[`notFoundContent`,`expandIcon`,`multiple`,`bordered`,`allowClear`,`choiceTransitionName`,`transitionName`,`id`]),F=t||m(`Cascader`),I=r;r||(I=E.value?U(wA,null,null):U(gx,null,null));let L=U(`span`,{class:`${_.value}-menu-item-loading-icon`},[U(qt,{spin:!0},null)]),{suffixIcon:ee,removeIcon:te,clearIcon:ne}=Mf(Z(Z({},e),{hasFeedback:s.hasFeedback,feedbackIcon:s.feedbackIcon,multiple:a,prefixCls:_.value,showArrow:M.value}),i);return T(C(U(bA,Y(Y(Y({},P),n),{},{id:x,prefixCls:_.value,class:[l.value,{[`${_.value}-lg`]:b.value===`large`,[`${_.value}-sm`]:b.value===`small`,[`${_.value}-rtl`]:E.value,[`${_.value}-borderless`]:!d,[`${_.value}-in-form-item`]:s.isFormItemInput},Uf(_.value,c.value,s.hasFeedback),y.value,n.class,w.value],disabled:S.value,direction:f.value,placement:N.value,notFoundContent:F,allowClear:h,showSearch:D.value,expandIcon:I,inputIcon:ee,removeIcon:te,clearIcon:ne,loadingIcon:L,checkable:!!a,dropdownClassName:O.value,dropdownPrefixCls:l.value,choiceTransitionName:Xt(u.value,``,g),transitionName:Xt(u.value,me(N.value),v),getPopupContainer:p?.value,customSlots:Z(Z({},i),{checkable:()=>U(`span`,{class:`${l.value}-checkbox-inner`},null)}),tagRender:e.tagRender||i.tagRender,displayRender:e.displayRender||i.displayRender,maxTagPlaceholder:e.maxTagPlaceholder||i.maxTagPlaceholder,showArrow:s.hasFeedback||e.showArrow,onChange:A,onBlur:j,ref:k}),i)))}}}),{SHOW_CHILD:nk,SHOW_PARENT:tk})),uN=()=>({name:String,prefixCls:String,options:Ue([]),disabled:Boolean,id:String}),dN=()=>Z(Z({},uN()),{defaultValue:Ue(),value:Ue(),onChange:d(),"onUpdate:value":d()}),fN=()=>({prefixCls:String,defaultChecked:Q(),checked:Q(),disabled:Q(),isGroup:Q(),value:f.any,name:String,id:String,indeterminate:Q(),type:_(`checkbox`),autofocus:Q(),onChange:d(),"onUpdate:checked":d(),onClick:d(),skipGroup:Q(!1)}),pN=()=>Z(Z({},fN()),{indeterminate:Q(!1)}),mN=Symbol(`CheckboxGroupContext`),hN=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ih?.disabled.value||d.value);S(()=>{!t.skipGroup&&h&&h.registerValue(_,t.value)}),ut(()=>{h&&h.cancelValue(_)}),V(()=>{e(!!(t.checked!==void 0||h||t.value===void 0),`Checkbox`,"`value` is not validate prop, do you mean `checked`?")});let y=e=>{let t=e.target.checked;r(`update:checked`,t),r(`change`,e),s.onFieldChange()},b=H();return o({focus:()=>{var e;(e=b.value)==null||e.focus()},blur:()=>{var e;(e=b.value)==null||e.blur()}}),()=>{let e=ce(a.default?.call(a)),{indeterminate:n,skipGroup:o,id:d=s.id.value}=t,g=hN(t,[`indeterminate`,`skipGroup`,`id`]),{onMouseenter:_,onMouseleave:x,onInput:S,class:C,style:w}=i,T=hN(i,[`onMouseenter`,`onMouseleave`,`onInput`,`class`,`style`]),E=Z(Z(Z(Z({},g),{id:d,prefixCls:l.value}),T),{disabled:v.value});h&&!o?(E.onChange=function(){r(`change`,...arguments),h.toggleOption({label:e,value:t.value})},E.name=h.name.value,E.checked=h.mergedValue.value.includes(t.value),E.disabled=v.value||f.value,E.indeterminate=n):E.onChange=y;let D=K({[`${l.value}-wrapper`]:!0,[`${l.value}-rtl`]:u.value===`rtl`,[`${l.value}-wrapper-checked`]:E.checked,[`${l.value}-wrapper-disabled`]:E.disabled,[`${l.value}-wrapper-in-form-item`]:c.isFormItemInput},C,m.value),O=K({[`${l.value}-indeterminate`]:n},m.value);return p(U(`label`,{class:D,style:w,onMouseenter:_,onMouseleave:x},[U(lT,Y(Y({"aria-checked":n?`mixed`:void 0},E),{},{class:O,ref:b}),null),e.length?U(`span`,null,[e]):null]))}}}),_N=u({compatConfig:{MODE:3},name:`ACheckboxGroup`,inheritAttrs:!1,props:dN(),setup(e,t){let{slots:n,attrs:r,emit:i,expose:a}=t,o=zf(),{prefixCls:s,direction:c}=X(`checkbox`,e),l=J(()=>`${s.value}-group`),[u,d]=nN(l),f=H((e.value===void 0?e.defaultValue:e.value)||[]);G(()=>e.value,()=>{f.value=e.value||[]});let p=J(()=>e.options.map(e=>typeof e==`string`||typeof e==`number`?{label:e,value:e}:e)),m=H(Symbol()),h=H(new Map),g=e=>{h.value.delete(e),m.value=Symbol()},_=(e,t)=>{h.value.set(e,t),m.value=Symbol()},v=H(new Map);return G(m,()=>{let e=new Map;for(let t of h.value.values())e.set(t,!0);v.value=e}),fe(mN,{cancelValue:g,registerValue:_,toggleOption:t=>{let n=f.value.indexOf(t.value),r=[...f.value];n===-1?r.push(t.value):r.splice(n,1),e.value===void 0&&(f.value=r);let a=r.filter(e=>v.value.has(e)).sort((e,t)=>p.value.findIndex(t=>t.value===e)-p.value.findIndex(e=>e.value===t));i(`update:value`,a),i(`change`,a),o.onFieldChange()},mergedValue:f,name:J(()=>e.name),disabled:J(()=>e.disabled)}),a({mergedValue:f}),()=>{let{id:t=o.id.value}=e,i=null;return p.value&&p.value.length>0&&(i=p.value.map(t=>U(gN,{prefixCls:s.value,key:t.value.toString(),disabled:`disabled`in t?t.disabled:e.disabled,indeterminate:t.indeterminate,value:t.value,checked:f.value.indexOf(t.value)!==-1,onChange:t.onChange,class:`${l.value}-item`},{default:()=>[n.label===void 0?t.label:n.label?.call(n,t)]}))),u(U(`div`,Y(Y({},r),{},{class:[l.value,{[`${l.value}-rtl`]:c.value===`rtl`},r.class,d.value],id:t}),[i||n.default?.call(n)]))}}});gN.Group=_N,gN.install=function(e){return e.component(gN.name,gN),e.component(_N.name,_N),e};var vN=gN,yN={useBreakpoint:Uv},bN=a(vM),xN=e=>{let{componentCls:t,commentBg:n,commentPaddingBase:r,commentNestIndent:i,commentFontSizeBase:a,commentFontSizeSm:o,commentAuthorNameColor:s,commentAuthorTimeColor:c,commentActionColor:l,commentActionHoverColor:u,commentActionsMarginBottom:d,commentActionsMarginTop:f,commentContentDetailPMarginBottom:p}=e;return{[t]:{position:`relative`,backgroundColor:n,[`${t}-inner`]:{display:`flex`,padding:r},[`${t}-avatar`]:{position:`relative`,flexShrink:0,marginRight:e.marginSM,cursor:`pointer`,img:{width:`32px`,height:`32px`,borderRadius:`50%`}},[`${t}-content`]:{position:`relative`,flex:`1 1 auto`,minWidth:`1px`,fontSize:a,wordWrap:`break-word`,"&-author":{display:`flex`,flexWrap:`wrap`,justifyContent:`flex-start`,marginBottom:e.marginXXS,fontSize:a,"& > a,& > span":{paddingRight:e.paddingXS,fontSize:o,lineHeight:`18px`},"&-name":{color:s,fontSize:a,transition:`color ${e.motionDurationSlow}`,"> *":{color:s,"&:hover":{color:s}}},"&-time":{color:c,whiteSpace:`nowrap`,cursor:`auto`}},"&-detail p":{marginBottom:p,whiteSpace:`pre-wrap`}},[`${t}-actions`]:{marginTop:f,marginBottom:d,paddingLeft:0,"> li":{display:`inline-block`,color:l,"> span":{marginRight:`10px`,color:l,fontSize:o,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,userSelect:`none`,"&:hover":{color:u}}}},[`${t}-nested`]:{marginLeft:i},"&-rtl":{direction:`rtl`}}}},SN=v(`Comment`,e=>[xN(B(e,{commentBg:`inherit`,commentPaddingBase:`${e.paddingMD}px 0`,commentNestIndent:`44px`,commentFontSizeBase:e.fontSize,commentFontSizeSm:e.fontSizeSM,commentAuthorNameColor:e.colorTextTertiary,commentAuthorTimeColor:e.colorTextPlaceholder,commentActionColor:e.colorTextTertiary,commentActionHoverColor:e.colorTextSecondary,commentActionsMarginBottom:`inherit`,commentActionsMarginTop:e.marginSM,commentContentDetailPMarginBottom:`inherit`}))]),CN=a(u({compatConfig:{MODE:3},name:`AComment`,inheritAttrs:!1,props:{actions:Array,author:f.any,avatar:f.any,content:f.any,prefixCls:String,datetime:f.any},slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`comment`,e),[o,s]=SN(i),c=(e,t)=>U(`div`,{class:`${e}-nested`},[t]),l=e=>!e||!e.length?null:e.map((e,t)=>U(`li`,{key:`action-${t}`},[e]));return()=>{let t=i.value,u=e.actions??n.actions?.call(n),d=e.author??n.author?.call(n),f=e.avatar??n.avatar?.call(n),p=e.content??n.content?.call(n),m=e.datetime??n.datetime?.call(n),h=U(`div`,{class:`${t}-avatar`},[typeof f==`string`?U(`img`,{src:f,alt:`comment-avatar`},null):f]),g=u?U(`ul`,{class:`${t}-actions`},[l(Array.isArray(u)?u:[u])]):null,_=U(`div`,{class:`${t}-content-author`},[d&&U(`span`,{class:`${t}-content-author-name`},[d]),m&&U(`span`,{class:`${t}-content-author-time`},[m])]),v=U(`div`,{class:`${t}-content`},[_,U(`div`,{class:`${t}-content-detail`},[p]),g]),y=U(`div`,{class:`${t}-inner`},[h,v]),b=ce(n.default?.call(n));return o(U(`div`,Y(Y({},r),{},{class:[t,{[`${t}-rtl`]:a.value===`rtl`},r.class,s.value]}),[y,b&&b.length?c(t,b):null]))}}})),wN=(e,t)=>{let{attrs:n,slots:r}=t;return U(Qb,Y(Y({size:`small`,type:`primary`},e),n),r)},TN=(e,t,r)=>{let i=n(r);return{[`${e.componentCls}-${t}`]:{color:e[`color${r}`],background:e[`color${i}Bg`],borderColor:e[`color${i}Border`],[`&${e.componentCls}-borderless`]:{borderColor:`transparent`}}}},EN=e=>zr(e,(t,n)=>{let{textColor:r,lightBorderColor:i,lightColor:a,darkColor:o}=n;return{[`${e.componentCls}-${t}`]:{color:r,background:a,borderColor:i,"&-inverse":{color:e.colorTextLightSolid,background:o,borderColor:o},[`&${e.componentCls}-borderless`]:{borderColor:`transparent`}}}}),DN=e=>{let{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:i}=e,a=r-n,o=t-n;return{[i]:Z(Z({},rn(e)),{display:`inline-block`,height:`auto`,marginInlineEnd:e.marginXS,paddingInline:a,fontSize:e.tagFontSize,lineHeight:`${e.tagLineHeight}px`,whiteSpace:`nowrap`,background:e.tagDefaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:`start`,[`&${i}-rtl`]:{direction:`rtl`},"&, a, a:hover":{color:e.tagDefaultColor},[`${i}-close-icon`]:{marginInlineStart:o,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-has-color`]:{borderColor:`transparent`,[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:`transparent`,borderColor:`transparent`,cursor:`pointer`,[`&:not(${i}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:`none`},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:a}}),[`${i}-borderless`]:{borderColor:`transparent`,background:e.tagBorderlessBg}}},ON=v(`Tag`,e=>{let{fontSize:t,lineHeight:n,lineWidth:r,fontSizeIcon:i}=e,a=Math.round(t*n),o=e.fontSizeSM,s=a-r*2,c=e.colorFillAlter,l=e.colorText,u=B(e,{tagFontSize:o,tagLineHeight:s,tagDefaultBg:c,tagDefaultColor:l,tagIconSize:i-2*r,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[DN(u),EN(u),TN(u,`success`,`Success`),TN(u,`processing`,`Info`),TN(u,`error`,`Error`),TN(u,`warning`,`Warning`)]}),kN=u({compatConfig:{MODE:3},name:`ACheckableTag`,inheritAttrs:!1,props:{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function},setup(e,t){let{slots:n,emit:r,attrs:i}=t,{prefixCls:a}=X(`tag`,e),[o,s]=ON(a),c=t=>{let{checked:n}=e;r(`update:checked`,!n),r(`change`,!n),r(`click`,t)},l=J(()=>K(a.value,s.value,{[`${a.value}-checkable`]:!0,[`${a.value}-checkable-checked`]:e.checked}));return()=>o(U(`span`,Y(Y({},i),{},{class:[l.value,i.class],onClick:c}),[n.default?.call(n)]))}}),AN=u({compatConfig:{MODE:3},name:`ATag`,inheritAttrs:!1,props:{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:f.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},onClick:he(),"onUpdate:visible":Function,icon:f.any,bordered:{type:Boolean,default:!0}},slots:Object,setup(e,t){let{slots:n,emit:r,attrs:i}=t,{prefixCls:a,direction:o}=X(`tag`,e),[s,c]=ON(a),l=q(!0);S(()=>{e.visible!==void 0&&(l.value=e.visible)});let u=t=>{t.stopPropagation(),r(`update:visible`,!1),r(`close`,t),!t.defaultPrevented&&e.visible===void 0&&(l.value=!1)},d=J(()=>my(e.color)||hy(e.color)),f=J(()=>K(a.value,c.value,{[`${a.value}-${e.color}`]:d.value,[`${a.value}-has-color`]:e.color&&!d.value,[`${a.value}-hidden`]:!l.value,[`${a.value}-rtl`]:o.value===`rtl`,[`${a.value}-borderless`]:!e.bordered})),p=e=>{r(`click`,e)};return()=>{let{icon:t=n.icon?.call(n),color:r,closeIcon:o=n.closeIcon?.call(n),closable:c=!1}=e,l=()=>c?o?U(`span`,{class:`${a.value}-close-icon`,onClick:u},[o]):U(Pe,{class:`${a.value}-close-icon`,onClick:u},null):null,m={backgroundColor:r&&!d.value?r:void 0},h=t||null,g=n.default?.call(n),_=h?U($e,null,[h,U(`span`,null,[g])]):g,v=e.onClick!==void 0,y=U(`span`,Y(Y({},i),{},{onClick:p,class:[f.value,i.class],style:[m,i.style]}),[_,l()]);return s(v?U(db,null,{default:()=>[y]}):y)}}});AN.CheckableTag=kN,AN.install=function(e){return e.component(AN.name,AN),e.component(kN.name,kN),e};function jN(e,t){let{slots:n,attrs:r}=t;return U(AN,Y(Y({color:`blue`},e),r),n)}var MN={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z`}}]},name:`calendar`,theme:`outlined`};function NN(e){for(var t=1;t_.value||m.value),[b,x]=nE(d),S=H();a({focus:()=>{var e;(e=S.value)==null||e.focus()},blur:()=>{var e;(e=S.value)==null||e.blur()}});let C=t=>c.valueFormat?e.toString(t,c.valueFormat):t,w=(e,t)=>{let n=C(e);s(`update:value`,n),s(`change`,n,t),l.onFieldChange()},T=e=>{s(`update:open`,e),s(`openChange`,e)},E=e=>{s(`focus`,e)},D=e=>{s(`blur`,e),l.onFieldBlur()},O=(e,t)=>{let n=C(e);s(`panelChange`,n,t)},k=e=>{let t=C(e);s(`ok`,t)},[A]=Kt(`DatePicker`,At),j=J(()=>c.value?c.valueFormat?e.toDate(c.value,c.valueFormat):c.value:c.value===``?void 0:c.value),M=J(()=>c.defaultValue?c.valueFormat?e.toDate(c.defaultValue,c.valueFormat):c.defaultValue:c.defaultValue===``?void 0:c.defaultValue),N=J(()=>c.defaultPickerValue?c.valueFormat?e.toDate(c.defaultPickerValue,c.valueFormat):c.defaultPickerValue:c.defaultPickerValue===``?void 0:c.defaultPickerValue);return()=>{let t=Z(Z({},A.value),c.locale),r=Z(Z({},c),o),{bordered:a=!0,placeholder:s,suffixIcon:m=i.suffixIcon?.call(i),showToday:_=!0,transitionName:C,allowClear:P=!0,dateRender:F=i.dateRender,renderExtraFooter:I=i.renderExtraFooter,monthCellRender:L=i.monthCellRender||c.monthCellContentRender||i.monthCellContentRender,clearIcon:ee=i.clearIcon?.call(i),id:te=l.id.value}=r,ne=KN(r,[`bordered`,`placeholder`,`suffixIcon`,`showToday`,`transitionName`,`allowClear`,`dateRender`,`renderExtraFooter`,`monthCellRender`,`clearIcon`,`id`]),R=r.showTime===``||r.showTime,{format:re}=r,ie={};n&&(ie.picker=n);let ae=n||r.picker||`date`;ie=Z(Z(Z({},ie),R?nP(Z({format:re,picker:ae},typeof R==`object`?R:{})):{}),ae===`time`?nP(Z(Z({format:re},ne),{picker:ae})):{});let oe=d.value,z=U($e,null,[m||U(n===`time`?zN:FN,null,null),u.hasFeedback&&u.feedbackIcon]);return b(U(sT,Y(Y(Y({monthCellRender:L,dateRender:F,renderExtraFooter:I,ref:S,placeholder:BN(t,ae,s),suffixIcon:z,dropdownAlign:HN(f.value,c.placement),clearIcon:ee||U(tt,null,null),allowClear:P,transitionName:C||`${h.value}-slide-up`},ne),ie),{},{id:te,picker:ae,value:j.value,defaultValue:M.value,defaultPickerValue:N.value,showToday:_,locale:t.lang,class:K({[`${oe}-${y.value}`]:y.value,[`${oe}-borderless`]:!a},Uf(oe,Wf(u.status,c.status),u.hasFeedback),o.class,x.value,v.value),disabled:g.value,prefixCls:oe,getPopupContainer:o.getCalendarContainer||p.value,generateConfig:e,prevIcon:i.prevIcon?.call(i)||U(`span`,{class:`${oe}-prev-icon`},null),nextIcon:i.nextIcon?.call(i)||U(`span`,{class:`${oe}-next-icon`},null),superPrevIcon:i.superPrevIcon?.call(i)||U(`span`,{class:`${oe}-super-prev-icon`},null),superNextIcon:i.superNextIcon?.call(i)||U(`span`,{class:`${oe}-super-next-icon`},null),components:eP,direction:f.value,dropdownClassName:K(x.value,c.popupClassName,c.dropdownClassName),onChange:w,onOpenChange:T,onFocus:E,onBlur:D,onPanelChange:O,onOk:k}),null))}}})}return{DatePicker:n(void 0,`ADatePicker`),WeekPicker:n(`week`,`AWeekPicker`),MonthPicker:n(`month`,`AMonthPicker`),YearPicker:n(`year`,`AYearPicker`),TimePicker:n(`time`,`TimePicker`),QuarterPicker:n(`quarter`,`AQuarterPicker`)}}var JN={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z`}}]},name:`swap-right`,theme:`outlined`};function YN(e){for(var t=1;tg.value||p.value),[y,b]=nE(u),x=H();r({focus:()=>{var e;(e=x.value)==null||e.focus()},blur:()=>{var e;(e=x.value)==null||e.blur()}});let S=t=>s.valueFormat?e.toString(t,s.valueFormat):t,C=(e,t)=>{let n=S(e);o(`update:value`,n),o(`change`,n,t),c.onFieldChange()},w=e=>{o(`update:open`,e),o(`openChange`,e)},T=e=>{o(`focus`,e)},E=e=>{o(`blur`,e),c.onFieldBlur()},D=(e,t)=>{let n=S(e);o(`panelChange`,n,t)},O=e=>{let t=S(e);o(`ok`,t)},k=(e,t,n)=>{let r=S(e);o(`calendarChange`,r,t,n)},[A]=Kt(`DatePicker`,At),j=J(()=>s.value&&s.valueFormat?e.toDate(s.value,s.valueFormat):s.value),M=J(()=>s.defaultValue&&s.valueFormat?e.toDate(s.defaultValue,s.valueFormat):s.defaultValue),N=J(()=>s.defaultPickerValue&&s.valueFormat?e.toDate(s.defaultPickerValue,s.valueFormat):s.defaultPickerValue);return()=>{let t=Z(Z({},A.value),s.locale),n=Z(Z({},s),a),{prefixCls:r,bordered:o=!0,placeholder:p,suffixIcon:g=i.suffixIcon?.call(i),picker:S=`date`,transitionName:P,allowClear:F=!0,dateRender:I=i.dateRender,renderExtraFooter:L=i.renderExtraFooter,separator:ee=i.separator?.call(i),clearIcon:te=i.clearIcon?.call(i),id:ne=c.id.value}=n,R=QN(n,[`prefixCls`,`bordered`,`placeholder`,`suffixIcon`,`picker`,`transitionName`,`allowClear`,`dateRender`,`renderExtraFooter`,`separator`,`clearIcon`,`id`]);delete R[`onUpdate:value`],delete R[`onUpdate:open`];let{format:re,showTime:ie}=n,ae={};ae=Z(Z(Z({},ae),ie?nP(Z({format:re,picker:S},ie)):{}),S===`time`?nP(Z(Z({format:re},Br(R,[`disabledTime`])),{picker:S})):{});let oe=u.value,z=U($e,null,[g||U(S===`time`?zN:FN,null,null),l.hasFeedback&&l.feedbackIcon]);return y(U(oT,Y(Y(Y({dateRender:I,renderExtraFooter:L,separator:ee||U(`span`,{"aria-label":`to`,class:`${oe}-separator`},[U(ZN,null,null)]),ref:x,dropdownAlign:HN(d.value,s.placement),placeholder:VN(t,S,p),suffixIcon:z,clearIcon:te||U(tt,null,null),allowClear:F,transitionName:P||`${m.value}-slide-up`},R),ae),{},{disabled:h.value,id:ne,value:j.value,defaultValue:M.value,defaultPickerValue:N.value,picker:S,class:K({[`${oe}-${v.value}`]:v.value,[`${oe}-borderless`]:!o},Uf(oe,Wf(l.status,s.status),l.hasFeedback),a.class,b.value,_.value),locale:t.lang,prefixCls:oe,getPopupContainer:a.getCalendarContainer||f.value,generateConfig:e,prevIcon:i.prevIcon?.call(i)||U(`span`,{class:`${oe}-prev-icon`},null),nextIcon:i.nextIcon?.call(i)||U(`span`,{class:`${oe}-next-icon`},null),superPrevIcon:i.superPrevIcon?.call(i)||U(`span`,{class:`${oe}-super-prev-icon`},null),superNextIcon:i.superNextIcon?.call(i)||U(`span`,{class:`${oe}-super-next-icon`},null),components:eP,direction:d.value,dropdownClassName:K(b.value,s.popupClassName,s.dropdownClassName),onChange:C,onOpenChange:w,onFocus:T,onBlur:E,onPanelChange:D,onOk:O,onCalendarChange:k}),null))}}})}var eP={button:wN,rangeItem:jN};function tP(e){return e?Array.isArray(e)?e:[e]:[]}function nP(e){let{format:t,picker:n,showHour:r,showMinute:i,showSecond:a,use12Hours:o}=e,s=tP(t)[0],c=Z({},e);return s&&typeof s==`string`&&(!s.includes(`s`)&&a===void 0&&(c.showSecond=!1),!s.includes(`m`)&&i===void 0&&(c.showMinute=!1),!s.includes(`H`)&&!s.includes(`h`)&&r===void 0&&(c.showHour=!1),(s.includes(`a`)||s.includes(`A`))&&o===void 0&&(c.use12Hours=!0)),n===`time`?c:(typeof s==`function`&&delete c.format,{showTime:c})}function rP(e,t){let{DatePicker:n,WeekPicker:r,MonthPicker:i,YearPicker:a,TimePicker:o,QuarterPicker:s}=qN(e,t);return{DatePicker:n,WeekPicker:r,MonthPicker:i,YearPicker:a,TimePicker:o,QuarterPicker:s,RangePicker:$N(e,t)}}var{DatePicker:iP,WeekPicker:aP,MonthPicker:oP,YearPicker:sP,TimePicker:cP,QuarterPicker:lP,RangePicker:uP}=rP(nC),dP=Z(iP,{WeekPicker:aP,MonthPicker:oP,YearPicker:sP,RangePicker:uP,TimePicker:cP,QuarterPicker:lP,install:e=>(e.component(iP.name,iP),e.component(uP.name,uP),e.component(oP.name,oP),e.component(aP.name,aP),e.component(lP.name,lP),e)});function fP(e){return e!=null}var pP=e=>{let{itemPrefixCls:t,component:n,span:r,labelStyle:i,contentStyle:a,bordered:o,label:s,content:c,colon:l}=e,u=n;return o?U(u,{class:[{[`${t}-item-label`]:fP(s),[`${t}-item-content`]:fP(c)}],colSpan:r},{default:()=>[fP(s)&&U(`span`,{style:i},[s]),fP(c)&&U(`span`,{style:a},[c])]}):U(u,{class:[`${t}-item`],colSpan:r},{default:()=>[U(`div`,{class:`${t}-item-container`},[(s||s===0)&&U(`span`,{class:[`${t}-item-label`,{[`${t}-item-no-colon`]:!l}],style:i},[s]),(c||c===0)&&U(`span`,{class:`${t}-item-content`,style:a},[c])])]})},mP=e=>{let t=(e,t,n)=>{let{colon:r,prefixCls:i,bordered:a}=t,{component:o,type:s,showLabel:l,showContent:u,labelStyle:d,contentStyle:f}=n;return e.map((e,t)=>{var n;let p=e.props||{},{prefixCls:m=i,span:h=1,labelStyle:g=p[`label-style`],contentStyle:_=p[`content-style`],label:v=((n=e.children)?.label)?.call(n)}=p,y=c(e),x=b(e),S=Ce(e),{key:C}=e;return typeof o==`string`?U(pP,{key:`${s}-${String(C)||t}`,class:x,style:S,labelStyle:Z(Z({},d),g),contentStyle:Z(Z({},f),_),span:h,colon:r,component:o,itemPrefixCls:m,bordered:a,label:l?v:null,content:u?y:null},null):[U(pP,{key:`label-${String(C)||t}`,class:x,style:Z(Z(Z({},d),S),g),span:1,colon:r,component:o[0],itemPrefixCls:m,bordered:a,label:v},null),U(pP,{key:`content-${String(C)||t}`,class:x,style:Z(Z(Z({},f),S),_),span:h*2-1,component:o[1],itemPrefixCls:m,bordered:a,content:y},null)]})},{prefixCls:n,vertical:r,row:i,index:a,bordered:o}=e,{labelStyle:s,contentStyle:l}=g(wP,{labelStyle:H({}),contentStyle:H({})});return r?U($e,null,[U(`tr`,{key:`label-${a}`,class:`${n}-row`},[t(i,e,{component:`th`,type:`label`,showLabel:!0,labelStyle:s.value,contentStyle:l.value})]),U(`tr`,{key:`content-${a}`,class:`${n}-row`},[t(i,e,{component:`td`,type:`content`,showContent:!0,labelStyle:s.value,contentStyle:l.value})])]):U(`tr`,{key:a,class:`${n}-row`},[t(i,e,{component:o?[`th`,`td`]:`td`,type:`item`,showLabel:!0,showContent:!0,labelStyle:s.value,contentStyle:l.value})])},hP=e=>{let{componentCls:t,descriptionsSmallPadding:n,descriptionsDefaultPadding:r,descriptionsMiddlePadding:i,descriptionsBg:a}=e;return{[`&${t}-bordered`]:{[`${t}-view`]:{border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:`auto`,borderCollapse:`collapse`}},[`${t}-item-label, ${t}-item-content`]:{padding:r,borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:`none`}},[`${t}-item-label`]:{backgroundColor:a,"&::after":{display:`none`}},[`${t}-row`]:{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBottom:`none`}},[`&${t}-middle`]:{[`${t}-item-label, ${t}-item-content`]:{padding:i}},[`&${t}-small`]:{[`${t}-item-label, ${t}-item-content`]:{padding:n}}}}},gP=e=>{let{componentCls:t,descriptionsExtraColor:n,descriptionItemPaddingBottom:r,descriptionsItemLabelColonMarginRight:i,descriptionsItemLabelColonMarginLeft:a,descriptionsTitleMarginBottom:o}=e;return{[t]:Z(Z(Z({},rn(e)),hP(e)),{"&-rtl":{direction:`rtl`},[`${t}-header`]:{display:`flex`,alignItems:`center`,marginBottom:o},[`${t}-title`]:Z(Z({},xe),{flex:`auto`,color:e.colorText,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:`auto`,color:n,fontSize:e.fontSize},[`${t}-view`]:{width:`100%`,borderRadius:e.borderRadiusLG,table:{width:`100%`,tableLayout:`fixed`}},[`${t}-row`]:{"> th, > td":{paddingBottom:r},"&:last-child":{borderBottom:`none`}},[`${t}-item-label`]:{color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:`start`,"&::after":{content:`":"`,position:`relative`,top:-.5,marginInline:`${a}px ${i}px`},[`&${t}-item-no-colon::after`]:{content:`""`}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:`""`}},[`${t}-item-content`]:{display:`table-cell`,flex:1,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:`break-word`,overflowWrap:`break-word`},[`${t}-item`]:{paddingBottom:0,verticalAlign:`top`,"&-container":{display:`flex`,[`${t}-item-label`]:{display:`inline-flex`,alignItems:`baseline`},[`${t}-item-content`]:{display:`inline-flex`,alignItems:`baseline`}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}},_P=v(`Descriptions`,e=>{let t=e.colorFillAlter,n=e.fontSizeSM*e.lineHeightSM,r=e.colorText,i=`${e.paddingXS}px ${e.padding}px`,a=`${e.padding}px ${e.paddingLG}px`,o=`${e.paddingSM}px ${e.paddingLG}px`,s=e.padding,c=e.marginXS;return[gP(B(e,{descriptionsBg:t,descriptionsTitleMarginBottom:n,descriptionsExtraColor:r,descriptionItemPaddingBottom:s,descriptionsSmallPadding:i,descriptionsDefaultPadding:a,descriptionsMiddlePadding:o,descriptionsItemLabelColonMarginRight:c,descriptionsItemLabelColonMarginLeft:e.marginXXS/2}))]});f.any;var vP=u({compatConfig:{MODE:3},name:`ADescriptionsItem`,props:{prefixCls:String,label:f.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}},setup(e,t){let{slots:n}=t;return()=>n.default?.call(n)}}),yP={xxxl:3,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function bP(e,t){if(typeof e==`number`)return e;if(typeof e==`object`)for(let n=0;nn)&&(i=ao(t,{span:n}),e(r===void 0,`Descriptions`,"Sum of column `span` in a line not match `column` of Descriptions.")),i}function SP(e,t){let n=ce(e),r=[],i=[],a=t;return n.forEach((e,o)=>{let s=e.props?.span,c=s||1;if(o===n.length-1){i.push(xP(e,a,s)),r.push(i);return}c({prefixCls:String,bordered:{type:Boolean,default:void 0},size:{type:String,default:`default`},title:f.any,extra:f.any,column:{type:[Number,Object],default:()=>yP},layout:String,colon:{type:Boolean,default:void 0},labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0}}),wP=Symbol(`descriptionsContext`),TP=u({compatConfig:{MODE:3},name:`ADescriptions`,inheritAttrs:!1,props:CP(),slots:Object,Item:vP,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:a,direction:o}=X(`descriptions`,e),s,c=H({}),[l,u]=_P(a),d=Hv();i(()=>{s=d.value.subscribe(t=>{typeof e.column==`object`&&(c.value=t)})}),ut(()=>{d.value.unsubscribe(s)}),fe(wP,{labelStyle:St(e,`labelStyle`),contentStyle:St(e,`contentStyle`)});let f=J(()=>bP(e.column,c.value));return()=>{let{size:t,bordered:i=!1,layout:s=`horizontal`,colon:c=!0,title:d=n.title?.call(n),extra:p=n.extra?.call(n)}=e,m=SP(n.default?.call(n),f.value);return l(U(`div`,Y(Y({},r),{},{class:[a.value,{[`${a.value}-${t}`]:t!=="default",[`${a.value}-bordered`]:!!i,[`${a.value}-rtl`]:o.value===`rtl`},r.class,u.value]}),[(d||p)&&U(`div`,{class:`${a.value}-header`},[d&&U(`div`,{class:`${a.value}-title`},[d]),p&&U(`div`,{class:`${a.value}-extra`},[p])]),U(`div`,{class:`${a.value}-view`},[U(`table`,null,[U(`tbody`,null,[m.map((e,t)=>U(mP,{key:t,index:t,colon:c,prefixCls:a.value,vertical:s===`vertical`,bordered:i,row:e},null))])])])]))}}});TP.install=function(e){return e.component(TP.name,TP),e.component(TP.Item.name,TP.Item),e};var EP=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:i}=e;return{[t]:Z(Z({},rn(e)),{borderBlockStart:`${i}px solid ${r}`,"&-vertical":{position:`relative`,top:`-0.06em`,display:`inline-block`,height:`0.9em`,margin:`0 ${e.dividerVerticalGutterMargin}px`,verticalAlign:`middle`,borderTop:0,borderInlineStart:`${i}px solid ${r}`},"&-horizontal":{display:`flex`,clear:`both`,width:`100%`,minWidth:`100%`,margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:`flex`,alignItems:`center`,margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:`nowrap`,textAlign:`center`,borderBlockStart:`0 ${r}`,"&::before, &::after":{position:`relative`,width:`50%`,borderBlockStart:`${i}px solid transparent`,borderBlockStartColor:`inherit`,borderBlockEnd:0,transform:`translateY(50%)`,content:`''`}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:`5%`},"&::after":{width:`95%`}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:`95%`},"&::after":{width:`5%`}},[`${t}-inner-text`]:{display:`inline-block`,padding:`0 1em`},"&-dashed":{background:`none`,borderColor:r,borderStyle:`dashed`,borderWidth:`${i}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:`dashed none none`}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:i,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:`100%`},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:`100%`},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}},DP=v(`Divider`,e=>[EP(B(e,{dividerVerticalGutterMargin:e.marginXS,dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG}))],{sizePaddingEdgeHorizontal:0}),OP=a(u({name:`ADivider`,inheritAttrs:!1,compatConfig:{MODE:3},props:{prefixCls:String,type:{type:String,default:`horizontal`},dashed:{type:Boolean,default:!1},orientation:{type:String,default:`center`},plain:{type:Boolean,default:!1},orientationMargin:[String,Number]},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`divider`,e),[o,s]=DP(i),c=J(()=>e.orientation===`left`&&e.orientationMargin!=null),l=J(()=>e.orientation===`right`&&e.orientationMargin!=null),u=J(()=>{let{type:t,dashed:n,plain:r}=e,o=i.value;return{[o]:!0,[s.value]:!!s.value,[`${o}-${t}`]:!0,[`${o}-dashed`]:!!n,[`${o}-plain`]:!!r,[`${o}-rtl`]:a.value===`rtl`,[`${o}-no-default-orientation-margin-left`]:c.value,[`${o}-no-default-orientation-margin-right`]:l.value}}),d=J(()=>{let t=typeof e.orientationMargin==`number`?`${e.orientationMargin}px`:e.orientationMargin;return Z(Z({},c.value&&{marginLeft:t}),l.value&&{marginRight:t})}),f=J(()=>e.orientation.length>0?`-`+e.orientation:e.orientation);return()=>{let e=ce(n.default?.call(n));return o(U(`div`,Y(Y({},r),{},{class:[u.value,e.length?`${i.value}-with-text ${i.value}-with-text${f.value}`:``,r.class],role:`separator`}),[e.length?U(`span`,{class:`${i.value}-inner-text`,style:d.value},[e]):null]))}}}));bx.Button=fx,bx.install=function(e){return e.component(bx.name,bx),e.component(fx.name,fx),e};var kP=bx,AP=()=>({prefixCls:String,width:f.oneOfType([f.string,f.number]),height:f.oneOfType([f.string,f.number]),style:{type:Object,default:void 0},class:String,rootClassName:String,rootStyle:Qt(),placement:{type:String},wrapperClassName:String,level:{type:[String,Array]},levelMove:{type:[Number,Function,Array]},duration:String,ease:String,showMask:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},afterVisibleChange:Function,keyboard:{type:Boolean,default:void 0},contentWrapperStyle:Ue(),autofocus:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},motion:d(),maskMotion:Qt()}),jP=()=>Z(Z({},AP()),{forceRender:{type:Boolean,default:void 0},getContainer:f.oneOfType([f.string,f.func,f.object,f.looseBool])}),MP=()=>Z(Z({},AP()),{getContainer:Function,getOpenCount:Function,scrollLocker:f.any,inline:Boolean});function NP(e){return Array.isArray(e)?e:[e]}var PP={transition:`transitionend`,WebkitTransition:`webkitTransitionEnd`,MozTransition:`transitionend`,OTransition:`oTransitionEnd otransitionend`};PP[Object.keys(PP).filter(e=>{if(typeof document>`u`)return!1;let t=document.getElementsByTagName(`html`)[0];return e in(t?t.style:{})})[0]];var FP=!(typeof window<`u`&&window.document&&window.document.createElement),IP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{z(()=>{var t;let{open:n,getContainer:r,showMask:i,autofocus:a}=e,o=r?.();h(e),n&&(o&&o.parentNode===document.body&&(LP[u]=n),z(()=>{a&&d()}),i&&((t=e.scrollLocker)==null||t.lock()))})}),G(()=>e.level,()=>{h(e)},{flush:`post`}),G(()=>e.open,()=>{let{open:t,getContainer:n,scrollLocker:r,showMask:i,autofocus:a}=e,o=n?.();o&&o.parentNode===document.body&&(LP[u]=!!t),t?(a&&d(),i&&r?.lock()):r?.unLock()},{flush:`post`}),y(()=>{var t;let{open:n}=e;delete LP[u],n&&(document.body.style.touchAction=``),(t=e.scrollLocker)==null||t.unLock()}),G(()=>e.placement,e=>{e&&(c.value=null)});let d=()=>{var e,t;(t=(e=a.value)?.focus)==null||t.call(e)},f=e=>{n(`close`,e)},p=e=>{e.keyCode===$.ESC&&(e.stopPropagation(),f(e))},m=()=>{let{open:t,afterVisibleChange:n}=e;n&&n(!!t)},h=e=>{let{level:t,getContainer:n}=e;if(FP)return;let r=n?.(),i=r?r.parentNode:null;l=[],t===`all`?(i?Array.prototype.slice.call(i.children):[]).forEach(e=>{e.nodeName!==`SCRIPT`&&e.nodeName!==`STYLE`&&e.nodeName!==`LINK`&&e!==r&&l.push(e)}):t&&NP(t).forEach(e=>{document.querySelectorAll(e).forEach(e=>{l.push(e)})})},g=e=>{n(`handleClick`,e)},_=q(!1);return G(a,()=>{z(()=>{_.value=!0})}),()=>{let{width:t,height:n,open:l,prefixCls:u,placement:d,level:h,levelMove:v,ease:y,duration:b,getContainer:x,onChange:S,afterVisibleChange:C,showMask:w,maskClosable:T,maskStyle:E,keyboard:D,getOpenCount:O,scrollLocker:k,contentWrapperStyle:A,style:j,class:M,rootClassName:N,rootStyle:P,maskMotion:F,motion:I,inline:L}=e,ee=IP(e,`width.height.open.prefixCls.placement.level.levelMove.ease.duration.getContainer.onChange.afterVisibleChange.showMask.maskClosable.maskStyle.keyboard.getOpenCount.scrollLocker.contentWrapperStyle.style.class.rootClassName.rootStyle.maskMotion.motion.inline`.split(`.`)),te=l&&_.value,ne=K(u,{[`${u}-${d}`]:!0,[`${u}-open`]:te,[`${u}-inline`]:L,"no-mask":!w,[N]:!0}),R=typeof I==`function`?I(d):I;return U(`div`,Y(Y({},Br(ee,[`autofocus`])),{},{tabindex:-1,class:ne,style:P,ref:a,onKeydown:te&&D?p:void 0}),[U(Re,F,{default:()=>[w&&Mt(U(`div`,{class:`${u}-mask`,onClick:T?f:void 0,style:E,ref:o},null),[[ht,te]])]}),U(Re,Y(Y({},R),{},{onAfterEnter:m,onAfterLeave:m}),{default:()=>[Mt(U(`div`,{class:`${u}-content-wrapper`,style:[A],ref:i},[U(`div`,{class:[`${u}-content`,M],style:j,ref:c},[r.default?.call(r)]),r.handler?U(`div`,{onClick:g,ref:s},[r.handler?.call(r)]):null]),[[ht,te]])]})])}}}),zP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{},showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:``,keyboard:!0,forceRender:!1,autofocus:!0}),emits:[`handleClick`,`close`],setup(e,t){let{emit:n,slots:r}=t,i=H(null),a=e=>{n(`handleClick`,e)},o=e=>{n(`close`,e)};return()=>{let{getContainer:t,wrapperClassName:n,rootClassName:s,rootStyle:c,forceRender:l}=e,u=zP(e,[`getContainer`,`wrapperClassName`,`rootClassName`,`rootStyle`,`forceRender`]),d=null;if(!t)return U(RP,Y(Y({},u),{},{rootClassName:s,rootStyle:c,open:e.open,onClose:o,onHandleClick:a,inline:!0}),r);let f=!!r.handler||l;return(f||e.open||i.value)&&(d=U(bu,{autoLock:!0,visible:e.open,forceRender:f,getContainer:t,wrapperClassName:n},{default:t=>{var{visible:n,afterClose:l}=t,d=zP(t,[`visible`,`afterClose`]);return U(RP,Y(Y(Y({ref:i},u),d),{},{rootClassName:s,rootStyle:c,open:n===void 0?e.open:n,afterVisibleChange:l===void 0?e.afterVisibleChange:l,onClose:o,onHandleClick:a}),r)}})),d}}}),VP=e=>{let{componentCls:t,motionDurationSlow:n}=e,r={"&-enter, &-appear, &-leave":{"&-start":{transition:`none`},"&-active":{transition:`all ${n}`}}};return{[t]:{[`${t}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${n}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${t}-panel-motion`]:{"&-left":[r,{"&-enter, &-appear":{"&-start":{transform:`translateX(-100%) !important`},"&-active":{transform:`translateX(0)`}},"&-leave":{transform:`translateX(0)`,"&-active":{transform:`translateX(-100%)`}}}],"&-right":[r,{"&-enter, &-appear":{"&-start":{transform:`translateX(100%) !important`},"&-active":{transform:`translateX(0)`}},"&-leave":{transform:`translateX(0)`,"&-active":{transform:`translateX(100%)`}}}],"&-top":[r,{"&-enter, &-appear":{"&-start":{transform:`translateY(-100%) !important`},"&-active":{transform:`translateY(0)`}},"&-leave":{transform:`translateY(0)`,"&-active":{transform:`translateY(-100%)`}}}],"&-bottom":[r,{"&-enter, &-appear":{"&-start":{transform:`translateY(100%) !important`},"&-active":{transform:`translateY(0)`}},"&-leave":{transform:`translateY(0)`,"&-active":{transform:`translateY(100%)`}}}]}}}},HP=e=>{let{componentCls:t,zIndexPopup:n,colorBgMask:r,colorBgElevated:i,motionDurationSlow:a,motionDurationMid:o,padding:s,paddingLG:c,fontSizeLG:l,lineHeightLG:u,lineWidth:d,lineType:f,colorSplit:p,marginSM:m,colorIcon:h,colorIconHover:g,colorText:_,fontWeightStrong:v,drawerFooterPaddingVertical:y,drawerFooterPaddingHorizontal:b}=e,x=`${t}-content-wrapper`;return{[t]:{position:`fixed`,inset:0,zIndex:n,pointerEvents:`none`,"&-pure":{position:`relative`,background:i,[`&${t}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:`absolute`},[`${t}-mask`]:{position:`absolute`,inset:0,zIndex:n,background:r,pointerEvents:`auto`},[x]:{position:`absolute`,zIndex:n,transition:`all ${a}`,"&-hidden":{display:`none`}},[`&-left > ${x}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${x}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${x}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${x}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${t}-content`]:{width:`100%`,height:`100%`,overflow:`auto`,background:i,pointerEvents:`auto`},[`${t}-wrapper-body`]:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`},[`${t}-header`]:{display:`flex`,flex:0,alignItems:`center`,padding:`${s}px ${c}px`,fontSize:l,lineHeight:u,borderBottom:`${d}px ${f} ${p}`,"&-title":{display:`flex`,flex:1,alignItems:`center`,minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:`none`},[`${t}-close`]:{display:`inline-block`,marginInlineEnd:m,color:h,fontWeight:v,fontSize:l,fontStyle:`normal`,lineHeight:1,textAlign:`center`,textTransform:`none`,textDecoration:`none`,background:`transparent`,border:0,outline:0,cursor:`pointer`,transition:`color ${o}`,textRendering:`auto`,"&:focus, &:hover":{color:g,textDecoration:`none`}},[`${t}-title`]:{flex:1,margin:0,color:_,fontWeight:e.fontWeightStrong,fontSize:l,lineHeight:u},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:c,overflow:`auto`},[`${t}-footer`]:{flexShrink:0,padding:`${y}px ${b}px`,borderTop:`${d}px ${f} ${p}`},"&-rtl":{direction:`rtl`}}}},UP=v(`Drawer`,e=>{let t=B(e,{drawerFooterPaddingVertical:e.paddingXS,drawerFooterPaddingHorizontal:e.padding});return[HP(t),VP(t)]},e=>({zIndexPopup:e.zIndexPopupBase})),WP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.open??e.visible);G(u,()=>{u.value?c.value=!0:l.value=!1},{immediate:!0}),G([u,c],()=>{u.value&&c.value&&(l.value=!0)},{immediate:!0});let d=g(`parentDrawerOpts`,null),{prefixCls:f,getPopupContainer:p,direction:m}=X(`drawer`,e),[h,_]=UP(f),v=J(()=>e.getContainer===void 0&&p?.value?()=>p.value(document.body):e.getContainer);pi(!e.afterVisibleChange,`Drawer`,"`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"),fe(`parentDrawerOpts`,{setPush:()=>{a.value=!0},setPull:()=>{a.value=!1,z(()=>{b()})}}),V(()=>{u.value&&d&&d.setPush()}),y(()=>{d&&d.setPull()}),G(l,()=>{d&&(l.value?d.setPush():d.setPull())},{flush:`post`});let b=()=>{var e,t;(t=(e=s.value)?.domFocus)==null||t.call(e)},x=e=>{n(`update:visible`,!1),n(`update:open`,!1),n(`close`,e)},S=t=>{var r;t||(o.value===!1&&(o.value=!0),e.destroyOnClose&&(c.value=!1)),(r=e.afterVisibleChange)==null||r.call(e,t),n(`afterVisibleChange`,t),n(`afterOpenChange`,t)},C=J(()=>{let{push:t,placement:n}=e,r;return r=typeof t==`boolean`?t?KP.distance:0:t.distance,r=parseFloat(String(r||0)),n===`left`||n===`right`?`translateX(${n===`left`?r:-r}px)`:n===`top`||n===`bottom`?`translateY(${n===`top`?r:-r}px)`:null}),w=J(()=>e.width??(e.size===`large`?736:378)),T=J(()=>e.height??(e.size===`large`?736:378)),E=J(()=>{let{mask:t,placement:n}=e;if(!l.value&&!t)return{};let r={};return n===`left`||n===`right`?r.width=Jy(w.value)?`${w.value}px`:w.value:r.height=Jy(T.value)?`${T.value}px`:T.value,r}),D=J(()=>{let{zIndex:t,contentWrapperStyle:n}=e,r=E.value;return[{zIndex:t,transform:a.value?C.value:void 0},Z({},n),r]}),O=t=>{let{closable:n,headerStyle:i}=e,a=on(r,e,`extra`),o=on(r,e,`title`);return!o&&!n?null:U(`div`,{class:K(`${t}-header`,{[`${t}-header-close-only`]:n&&!o&&!a}),style:i},[U(`div`,{class:`${t}-header-title`},[k(t),o&&U(`div`,{class:`${t}-title`},[o])]),a&&U(`div`,{class:`${t}-extra`},[a])])},k=t=>{let{closable:n}=e,i=r.closeIcon?r.closeIcon?.call(r):e.closeIcon;return n&&U(`button`,{key:`closer`,onClick:x,"aria-label":`Close`,class:`${t}-close`},[i===void 0?U(Pe,null,null):i])},A=t=>{if(o.value&&!e.forceRender&&!c.value)return null;let{bodyStyle:n,drawerStyle:i}=e;return U(`div`,{class:`${t}-wrapper-body`,style:i},[O(t),U(`div`,{key:`body`,class:`${t}-body`,style:n},[r.default?.call(r)]),j(t)])},j=t=>{let n=on(r,e,`footer`);return n?U(`div`,{class:`${t}-footer`,style:e.footerStyle},[n]):null},M=J(()=>K({"no-mask":!e.mask,[`${f.value}-rtl`]:m.value===`rtl`},e.rootClassName,_.value)),N=J(()=>ge(Xt(f.value,`mask-motion`))),P=e=>ge(Xt(f.value,`panel-motion-${e}`));return()=>{let{width:t,height:n,placement:a,mask:o,forceRender:c}=e,u=WP(e,[`width`,`height`,`placement`,`mask`,`forceRender`]),d=Z(Z(Z({},i),Br(u,[`size`,`closeIcon`,`closable`,`destroyOnClose`,`drawerStyle`,`headerStyle`,`bodyStyle`,`title`,`push`,`onAfterVisibleChange`,`onClose`,`onUpdate:visible`,`onUpdate:open`,`visible`])),{forceRender:c,onClose:x,afterVisibleChange:S,handler:!1,prefixCls:f.value,open:l.value,showMask:o,placement:a,ref:s});return h(U(d_,null,{default:()=>[U(BP,Y(Y({},d),{},{maskMotion:N.value,motion:P,width:w.value,height:T.value,getContainer:v.value,rootClassName:M.value,rootStyle:e.rootStyle,contentWrapperStyle:D.value}),{handler:e.handle?()=>e.handle:r.handle,default:()=>A(f.value)})]}))}}})),JP={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z`}}]},name:`file-text`,theme:`outlined`};function YP(e){for(var t=1;t({prefixCls:String,description:f.any,type:_(`default`),shape:_(`circle`),tooltip:f.any,href:String,target:String,badge:Qt(),onClick:d()}),$P=()=>({prefixCls:_()}),eF=()=>Z(Z({},QP()),{trigger:_(),open:Q(),onOpenChange:d(),"onUpdate:open":d()}),tF=()=>Z(Z({},QP()),{prefixCls:String,duration:Number,target:d(),visibilityHeight:Number,onClick:d()}),nF=u({compatConfig:{MODE:3},name:`AFloatButtonContent`,inheritAttrs:!1,props:$P(),setup(e,t){let{attrs:n,slots:r}=t;return()=>{let{prefixCls:t}=e,i=dt(r.description?.call(r));return U(`div`,Y(Y({},n),{},{class:[n.class,`${t}-content`]}),[r.icon||i.length?U($e,null,[r.icon&&U(`div`,{class:`${t}-icon`},[r.icon()]),i.length?U(`div`,{class:`${t}-description`},[i]):null]):U(`div`,{class:`${t}-icon`},[U(ZP,null,null)])])}}}),rF=Symbol(`floatButtonGroupContext`),iF=e=>(fe(rF,e),e),aF=()=>g(rF,{shape:H()}),oF=e=>e===0?0:e-Math.sqrt(e**2/2),sF=e=>{let{componentCls:t,floatButtonSize:n,motionDurationSlow:r,motionEaseInOutCirc:i}=e,a=`${t}-group`,o=new N(`antFloatButtonMoveDownIn`,{"0%":{transform:`translate3d(0, ${n}px, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),s=new N(`antFloatButtonMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, ${n}px, 0)`,transformOrigin:`0 0`,opacity:0}});return[{[`${a}-wrap`]:Z({},__(`${a}-wrap`,o,s,r,!0))},{[`${a}-wrap`]:{[` + &${a}-wrap-enter, + &${a}-wrap-appear + `]:{opacity:0,animationTimingFunction:i},[`&${a}-wrap-leave`]:{animationTimingFunction:i}}}]},cF=e=>{let{antCls:t,componentCls:n,floatButtonSize:r,margin:i,borderRadiusLG:a,borderRadiusSM:o,badgeOffset:s,floatButtonBodyPadding:c}=e,l=`${n}-group`;return{[l]:Z(Z({},rn(e)),{zIndex:99,display:`block`,border:`none`,position:`fixed`,width:r,height:`auto`,boxShadow:`none`,minHeight:r,insetInlineEnd:e.floatButtonInsetInlineEnd,insetBlockEnd:e.floatButtonInsetBlockEnd,borderRadius:a,[`${l}-wrap`]:{zIndex:-1,display:`block`,position:`relative`,marginBottom:i},[`&${l}-rtl`]:{direction:`rtl`},[n]:{position:`static`}}),[`${l}-circle`]:{[`${n}-circle:not(:last-child)`]:{marginBottom:e.margin,[`${n}-body`]:{width:r,height:r,borderRadius:`50%`}}},[`${l}-square`]:{[`${n}-square`]:{borderRadius:0,padding:0,"&:first-child":{borderStartStartRadius:a,borderStartEndRadius:a},"&:last-child":{borderEndStartRadius:a,borderEndEndRadius:a},"&:not(:last-child)":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-badge`]:{[`${t}-badge-count`]:{top:-(c+s),insetInlineEnd:-(c+s)}}},[`${l}-wrap`]:{display:`block`,borderRadius:a,boxShadow:e.boxShadowSecondary,[`${n}-square`]:{boxShadow:`none`,marginTop:0,borderRadius:0,padding:c,"&:first-child":{borderStartStartRadius:a,borderStartEndRadius:a},"&:last-child":{borderEndStartRadius:a,borderEndEndRadius:a},"&:not(:last-child)":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${n}-body`]:{width:e.floatButtonBodySize,height:e.floatButtonBodySize}}}},[`${l}-circle-shadow`]:{boxShadow:`none`},[`${l}-square-shadow`]:{boxShadow:e.boxShadowSecondary,[`${n}-square`]:{boxShadow:`none`,padding:c,[`${n}-body`]:{width:e.floatButtonBodySize,height:e.floatButtonBodySize,borderRadius:o}}}}},lF=e=>{let{antCls:t,componentCls:n,floatButtonBodyPadding:r,floatButtonIconSize:i,floatButtonSize:a,borderRadiusLG:o,badgeOffset:s,dotOffsetInSquare:c,dotOffsetInCircle:l}=e;return{[n]:Z(Z({},rn(e)),{border:`none`,position:`fixed`,cursor:`pointer`,zIndex:99,display:`block`,justifyContent:`center`,alignItems:`center`,width:a,height:a,insetInlineEnd:e.floatButtonInsetInlineEnd,insetBlockEnd:e.floatButtonInsetBlockEnd,boxShadow:e.boxShadowSecondary,"&-pure":{position:`relative`,inset:`auto`},"&:empty":{display:`none`},[`${t}-badge`]:{width:`100%`,height:`100%`,[`${t}-badge-count`]:{transform:`translate(0, 0)`,transformOrigin:`center`,top:-s,insetInlineEnd:-s}},[`${n}-body`]:{width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all ${e.motionDurationMid}`,[`${n}-content`]:{overflow:`hidden`,textAlign:`center`,minHeight:a,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,padding:`${r/2}px ${r}px`,[`${n}-icon`]:{textAlign:`center`,margin:`auto`,width:i,fontSize:i,lineHeight:1}}}}),[`${n}-rtl`]:{direction:`rtl`},[`${n}-circle`]:{height:a,borderRadius:`50%`,[`${t}-badge`]:{[`${t}-badge-dot`]:{top:l,insetInlineEnd:l}},[`${n}-body`]:{borderRadius:`50%`}},[`${n}-square`]:{height:`auto`,minHeight:a,borderRadius:o,[`${t}-badge`]:{[`${t}-badge-dot`]:{top:c,insetInlineEnd:c}},[`${n}-body`]:{height:`auto`,borderRadius:o}},[`${n}-default`]:{backgroundColor:e.floatButtonBackgroundColor,transition:`background-color ${e.motionDurationMid}`,[`${n}-body`]:{backgroundColor:e.floatButtonBackgroundColor,transition:`background-color ${e.motionDurationMid}`,"&:hover":{backgroundColor:e.colorFillContent},[`${n}-content`]:{[`${n}-icon`]:{color:e.colorText},[`${n}-description`]:{display:`flex`,alignItems:`center`,lineHeight:`${e.fontSizeLG}px`,color:e.colorText,fontSize:e.fontSizeSM}}}},[`${n}-primary`]:{backgroundColor:e.colorPrimary,[`${n}-body`]:{backgroundColor:e.colorPrimary,transition:`background-color ${e.motionDurationMid}`,"&:hover":{backgroundColor:e.colorPrimaryHover},[`${n}-content`]:{[`${n}-icon`]:{color:e.colorTextLightSolid},[`${n}-description`]:{display:`flex`,alignItems:`center`,lineHeight:`${e.fontSizeLG}px`,color:e.colorTextLightSolid,fontSize:e.fontSizeSM}}}}}},uF=v(`FloatButton`,e=>{let{colorTextLightSolid:t,colorBgElevated:n,controlHeightLG:r,marginXXL:i,marginLG:a,fontSize:o,fontSizeIcon:s,controlItemBgHover:c,paddingXXS:l,borderRadiusLG:u}=e,d=B(e,{floatButtonBackgroundColor:n,floatButtonColor:t,floatButtonHoverBackgroundColor:c,floatButtonFontSize:o,floatButtonIconSize:s*1.5,floatButtonSize:r,floatButtonInsetBlockEnd:i,floatButtonInsetInlineEnd:a,floatButtonBodySize:r-l*2,floatButtonBodyPadding:l,badgeOffset:l*1.5,dotOffsetInCircle:oF(r/2),dotOffsetInSquare:oF(u)});return[cF(d),lF(d),b_(e),sF(d)]}),dF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ic?.value||e.shape);return()=>{let{prefixCls:t,type:c=`default`,shape:d=`circle`,description:f=r.description?.call(r),tooltip:p,badge:m={}}=e,h=dF(e,[`prefixCls`,`type`,`shape`,`description`,`tooltip`,`badge`]),g=K(i.value,`${i.value}-${c}`,`${i.value}-${u.value}`,{[`${i.value}-rtl`]:a.value===`rtl`},n.class,s.value),_=U(Ty,{placement:`left`},{title:r.tooltip||p?()=>r.tooltip&&r.tooltip()||p:void 0,default:()=>U(Xy,m,{default:()=>[U(`div`,{class:`${i.value}-body`},[U(nF,{prefixCls:i.value},{icon:r.icon,description:()=>f})])]})});return o(e.href?U(`a`,Y(Y(Y({ref:l},n),h),{},{class:g}),[_]):U(`button`,Y(Y(Y({ref:l},n),h),{},{class:g,type:`button`}),[_]))}}}),mF=u({compatConfig:{MODE:3},name:`AFloatButtonGroup`,inheritAttrs:!1,props:Zn(eF(),{type:`default`,shape:`circle`}),setup(e,t){let{attrs:n,slots:r,emit:i}=t,{prefixCls:a,direction:o}=X(fF,e),[s,c]=uF(a),[l,u]=df(!1,{value:J(()=>e.open)}),d=H(null),f=H(null);iF({shape:J(()=>e.shape)});let p={onMouseenter(){var t;u(!0),i(`update:open`,!0),(t=e.onOpenChange)==null||t.call(e,!0)},onMouseleave(){var t;u(!1),i(`update:open`,!1),(t=e.onOpenChange)==null||t.call(e,!1)}},m=J(()=>e.trigger===`hover`?p:{}),h=()=>{var t;let n=!l.value;i(`update:open`,n),(t=e.onOpenChange)==null||t.call(e,n),u(n)},g=t=>{var n;if(d.value?.contains(t.target)){ae(f.value)?.contains(t.target)&&h();return}u(!1),i(`update:open`,!1),(n=e.onOpenChange)==null||n.call(e,!1)};return G(J(()=>e.trigger),e=>{It()&&(document.removeEventListener(`click`,g),e===`click`&&document.addEventListener(`click`,g))},{immediate:!0}),ut(()=>{document.removeEventListener(`click`,g)}),()=>{let{shape:t=`circle`,type:i=`default`,tooltip:u,description:p,trigger:h}=e,g=`${a.value}-group`,_=K(g,c.value,n.class,{[`${g}-rtl`]:o.value===`rtl`,[`${g}-${t}`]:t,[`${g}-${t}-shadow`]:!h}),v=K(c.value,`${g}-wrap`),y=ge(`${g}-wrap`);return s(U(`div`,Y(Y({ref:d},n),{},{class:_},m.value),[h&&[`click`,`hover`].includes(h)?U($e,null,[U(Re,y,{default:()=>[Mt(U(`div`,{class:v},[r.default&&r.default()]),[[ht,l.value]])]}),U(pF,{ref:f,type:i,shape:t,tooltip:u,description:p},{icon:()=>l.value?r.closeIcon?.call(r)||U(Pe,null,null):r.icon?.call(r)||U(ZP,null,null),tooltip:r.tooltip,description:r.description})]):r.default?.call(r)]))}}}),hF={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z`}}]},name:`vertical-align-top`,theme:`outlined`};function gF(e){for(var t=1;twindow,duration:450,type:`default`,shape:`circle`}),setup(e,t){let{slots:n,attrs:r,emit:i}=t,{prefixCls:a,direction:o}=X(fF,e),[s]=uF(a),c=H(),l=Ne({visible:e.visibilityHeight===0,scrollEvent:null}),u=()=>c.value&&c.value.ownerDocument?c.value.ownerDocument:window,d=t=>{let{target:n=u,duration:r}=e;ii(0,{getContainer:n,duration:r}),i(`click`,t)},f=ar(t=>{let{visibilityHeight:n}=e,r=ri(t.target,!0);l.visible=r>=n}),p=()=>{let{target:t}=e,n=(t||u)();f({target:n}),n?.addEventListener(`scroll`,f)},m=()=>{let{target:t}=e,n=(t||u)();f.cancel(),n?.removeEventListener(`scroll`,f)};G(()=>e.target,()=>{m(),z(()=>{p()})}),V(()=>{z(()=>{p()})}),ft(()=>{z(()=>{p()})}),ie(()=>{m()}),ut(()=>{m()});let h=aF();return()=>{let{description:t,type:i,shape:u,tooltip:f,badge:p}=e,m=Z(Z({},r),{shape:h?.shape.value||u,onClick:d,class:{[`${a.value}`]:!0,[`${r.class}`]:r.class,[`${a.value}-rtl`]:o.value===`rtl`},description:t,type:i,tooltip:f,badge:p}),g=ge(`fade`);return s(U(Re,g,{default:()=>[Mt(U(pF,Y(Y({},m),{},{ref:c}),{icon:()=>n.icon?.call(n)||U(vF,null,null)}),[[ht,l.visible]])]}))}}});pF.Group=mF,pF.BackTop=yF,pF.install=function(e){return e.component(pF.name,pF),e.component(mF.name,mF),e.component(yF.name,yF),e};var bF=pF,xF=e=>e!=null&&(!Array.isArray(e)||dt(e).length);function SF(e){return xF(e.prefix)||xF(e.suffix)||xF(e.allowClear)}function CF(e){return xF(e.addonBefore)||xF(e.addonAfter)}function wF(e){return e==null?``:String(e)}function TF(e,t,n,r){if(!n)return;let i=t;if(t.type===`click`){Object.defineProperty(i,"target",{writable:!0}),Object.defineProperty(i,"currentTarget",{writable:!0});let t=e.cloneNode(!0);i.target=t,i.currentTarget=t,t.value=``,n(i);return}if(r!==void 0){Object.defineProperty(i,"target",{writable:!0}),Object.defineProperty(i,"currentTarget",{writable:!0}),i.target=e,i.currentTarget=e,e.value=r,n(i);return}n(i)}function EF(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case`start`:e.setSelectionRange(0,0);break;case`end`:e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var DF=()=>({addonBefore:f.any,addonAfter:f.any,prefix:f.any,suffix:f.any,clearIcon:f.any,affixWrapperClassName:String,groupClassName:String,wrapperClassName:String,inputClassName:String,allowClear:{type:Boolean,default:void 0}}),OF=()=>Z(Z({},DF()),{value:{type:[String,Number,Symbol],default:void 0},defaultValue:{type:[String,Number,Symbol],default:void 0},inputElement:f.any,prefixCls:String,disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:void 0},triggerFocus:Function,readonly:{type:Boolean,default:void 0},handleReset:Function,hidden:{type:Boolean,default:void 0}}),kF=()=>Z(Z({},OF()),{id:String,placeholder:{type:[String,Number]},autocomplete:String,type:_(`text`),name:String,size:{type:String},autofocus:{type:Boolean,default:void 0},lazy:{type:Boolean,default:!0},maxlength:Number,loading:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},showCount:{type:[Boolean,Object]},htmlSize:Number,onPressEnter:Function,onKeydown:Function,onKeyup:Function,onFocus:Function,onBlur:Function,onChange:Function,onInput:Function,"onUpdate:value":Function,onCompositionstart:Function,onCompositionend:Function,valueModifiers:Object,hidden:{type:Boolean,default:void 0},status:String}),AF=u({name:`BaseInput`,inheritAttrs:!1,props:OF(),setup(e,t){let{slots:n,attrs:r}=t,i=H(),a=t=>{if(i.value?.contains(t.target)){let{triggerFocus:t}=e;t?.()}},o=()=>{let{allowClear:t,value:r,disabled:i,readonly:a,handleReset:o,suffix:s=n.suffix,prefixCls:c}=e;if(!t)return null;let l=!i&&!a&&r,u=`${c}-clear-icon`,d=n.clearIcon?.call(n)||`*`;return U(`span`,{onClick:o,onMousedown:e=>e.preventDefault(),class:K({[`${u}-hidden`]:!l,[`${u}-has-suffix`]:!!s},u),role:`button`,tabindex:-1},[d])};return()=>{let{focused:t,value:s,disabled:c,allowClear:l,readonly:u,hidden:d,prefixCls:f,prefix:p=n.prefix?.call(n),suffix:m=n.suffix?.call(n),addonAfter:h=n.addonAfter,addonBefore:g=n.addonBefore,inputElement:_,affixWrapperClassName:v,wrapperClassName:y,groupClassName:b}=e,x=ao(_,{value:s,hidden:d});if(SF({prefix:p,suffix:m,allowClear:l})){let e=`${f}-affix-wrapper`,n=K(e,{[`${e}-disabled`]:c,[`${e}-focused`]:t,[`${e}-readonly`]:u,[`${e}-input-with-clear-btn`]:m&&l&&s},!CF({addonAfter:h,addonBefore:g})&&r.class,v),y=(m||l)&&U(`span`,{class:`${f}-suffix`},[o(),m]);x=U(`span`,{class:n,style:r.style,hidden:!CF({addonAfter:h,addonBefore:g})&&d,onMousedown:a,ref:i},[p&&U(`span`,{class:`${f}-prefix`},[p]),ao(_,{style:null,value:s,hidden:null}),y])}if(CF({addonAfter:h,addonBefore:g})){let e=`${f}-group`,t=`${e}-addon`,n=K(`${f}-wrapper`,e,y);return U(`span`,{class:K(`${f}-group-wrapper`,r.class,b),style:r.style,hidden:d},[U(`span`,{class:n},[g&&U(`span`,{class:t},[g]),ao(x,{style:null,hidden:null}),h&&U(`span`,{class:t},[h])])])}return x}}}),jF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.value,()=>{o.value=e.value}),G(()=>e.disabled,()=>{e.disabled&&(s.value=!1)});let u=e=>{c.value&&EF(c.value.input,e)};i({focus:u,blur:()=>{var e;(e=c.value.input)==null||e.blur()},input:J(()=>c.value.input?.input),stateValue:o,setSelectionRange:(e,t,n)=>{var r;(r=c.value.input)==null||r.setSelectionRange(e,t,n)},select:()=>{var e;(e=c.value.input)==null||e.select()}});let d=e=>{a(`change`,e)},f=(t,n)=>{o.value!==t&&(e.value===void 0?o.value=t:z(()=>{var e;c.value.input.value!==o.value&&((e=l.value)==null||e.$forceUpdate())}),z(()=>{n&&n()}))},p=e=>{let{value:t}=e.target;if(o.value===t)return;let n=e.target.value;TF(c.value.input,e,d),f(n)},m=e=>{e.keyCode===13&&a(`pressEnter`,e),a(`keydown`,e)},h=e=>{s.value=!0,a(`focus`,e)},g=e=>{s.value=!1,a(`blur`,e)},_=e=>{TF(c.value.input,e,d),f(``,()=>{u()})},v=()=>{let{addonBefore:t=n.addonBefore,addonAfter:i=n.addonAfter,disabled:a,valueModifiers:o={},htmlSize:s,autocomplete:l,prefixCls:u,inputClassName:d,prefix:f=n.prefix?.call(n),suffix:_=n.suffix?.call(n),allowClear:v,type:y=`text`}=e,b=Z(Z(Z({},Br(e,[`prefixCls`,`onPressEnter`,`addonBefore`,`addonAfter`,`prefix`,`suffix`,`allowClear`,`defaultValue`,`size`,`bordered`,`htmlSize`,`lazy`,`showCount`,`valueModifiers`,`showCount`,`affixWrapperClassName`,`groupClassName`,`inputClassName`,`wrapperClassName`])),r),{autocomplete:l,onChange:p,onInput:p,onFocus:h,onBlur:g,onKeydown:m,class:K(u,{[`${u}-disabled`]:a},d,!CF({addonAfter:i,addonBefore:t})&&!SF({prefix:f,suffix:_,allowClear:v})&&r.class),ref:c,key:`ant-input`,size:s,type:y,lazy:e.lazy});return o.lazy&&delete b.onInput,b.autofocus||delete b.autofocus,U(Pu,Br(b,[`size`]),null)},y=()=>{let{maxlength:t,suffix:r=n.suffix?.call(n),showCount:i,prefixCls:a}=e,s=Number(t)>0;if(r||i){let e=[...wF(o.value)].length,n=typeof i==`object`?i.formatter({count:e,maxlength:t}):`${e}${s?` / ${t}`:``}`;return U($e,null,[!!i&&U(`span`,{class:K(`${a}-show-count-suffix`,{[`${a}-show-count-has-suffix`]:!!r})},[n]),r])}return null};return V(()=>{}),()=>{let{prefixCls:t,disabled:i}=e;return U(AF,Y(Y(Y({},jF(e,[`prefixCls`,`disabled`])),r),{},{ref:l,prefixCls:t,inputElement:v(),handleReset:_,value:wF(o.value),focused:s.value,triggerFocus:u,suffix:y(),disabled:i}),n)}}}),NF=()=>Br(kF(),[`wrapperClassName`,`groupClassName`,`inputClassName`,`affixWrapperClassName`]),PF=()=>Z(Z({},Br(NF(),[`prefix`,`addonBefore`,`addonAfter`,`suffix`])),{rows:Number,autosize:{type:[Boolean,Object],default:void 0},autoSize:{type:[Boolean,Object],default:void 0},onResize:{type:Function},onCompositionstart:he(),onCompositionend:he(),valueModifiers:Object}),FF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iWf(c.status,e.status)),{direction:u,prefixCls:d,size:f,autocomplete:p}=X(`input`,e),{compactSize:m,compactItemClassnames:h}=u_(d,u),g=J(()=>m.value||f.value),[_,v]=YT(d),y=at();i({focus:e=>{var t;(t=o.value)==null||t.focus(e)},blur:()=>{var e;(e=o.value)==null||e.blur()},input:o,setSelectionRange:(e,t,n)=>{var r;(r=o.value)==null||r.setSelectionRange(e,t,n)},select:()=>{var e;(e=o.value)==null||e.select()}});let b=H([]),x=()=>{b.value.push(setTimeout(()=>{var e;o.value?.input&&o.value?.input.getAttribute(`type`)===`password`&&o.value?.input.hasAttribute(`value`)&&((e=o.value)==null||e.input.removeAttribute(`value`))}))};V(()=>{x()}),ne(()=>{b.value.forEach(e=>clearTimeout(e))}),ut(()=>{b.value.forEach(e=>clearTimeout(e))});let S=e=>{x(),a(`blur`,e),s.onFieldBlur()},C=e=>{x(),a(`focus`,e)},w=e=>{a(`update:value`,e.target.value),a(`change`,e),a(`input`,e),s.onFieldChange()};return()=>{let{hasFeedback:t,feedbackIcon:i}=c,{allowClear:a,bordered:f=!0,prefix:m=n.prefix?.call(n),suffix:b=n.suffix?.call(n),addonAfter:x=n.addonAfter?.call(n),addonBefore:T=n.addonBefore?.call(n),id:E=s.id?.value}=e,D=FF(e,[`allowClear`,`bordered`,`prefix`,`suffix`,`addonAfter`,`addonBefore`,`id`]),O=(t||b)&&U($e,null,[b,t&&i]),k=d.value,A=SF({prefix:m,suffix:b})||!!t,j=n.clearIcon||(()=>U(tt,null,null));return _(U(MF,Y(Y(Y({},r),Br(D,[`onUpdate:value`,`onChange`,`onInput`])),{},{onChange:w,id:E,disabled:e.disabled??y.value,ref:o,prefixCls:k,autocomplete:p.value,onBlur:S,onFocus:C,prefix:m,suffix:O,allowClear:a,addonAfter:x&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[x]})]}),addonBefore:T&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[T]})]}),class:[r.class,h.value],inputClassName:K({[`${k}-sm`]:g.value===`small`,[`${k}-lg`]:g.value===`large`,[`${k}-rtl`]:u.value===`rtl`,[`${k}-borderless`]:!f},!A&&Uf(k,l.value),v.value),affixWrapperClassName:K({[`${k}-affix-wrapper-sm`]:g.value===`small`,[`${k}-affix-wrapper-lg`]:g.value===`large`,[`${k}-affix-wrapper-rtl`]:u.value===`rtl`,[`${k}-affix-wrapper-borderless`]:!f},Uf(`${k}-affix-wrapper`,l.value,t),v.value),wrapperClassName:K({[`${k}-group-rtl`]:u.value===`rtl`},v.value),groupClassName:K({[`${k}-group-wrapper-sm`]:g.value===`small`,[`${k}-group-wrapper-lg`]:g.value===`large`,[`${k}-group-wrapper-rtl`]:u.value===`rtl`},Uf(`${k}-group-wrapper`,l.value,t),v.value)}),Z(Z({},n),{clearIcon:j})))}}}),LF=u({compatConfig:{MODE:3},name:`AInputGroup`,inheritAttrs:!1,props:{prefixCls:String,size:{type:String},compact:{type:Boolean,default:void 0}},setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a,getPrefixCls:o}=X(`input-group`,e),s=Vf.useInject();Vf.useProvide(s,{isFormItemInput:!1});let[c,l]=YT(J(()=>o(`input`))),u=J(()=>{let t=i.value;return{[`${t}`]:!0,[l.value]:!0,[`${t}-lg`]:e.size===`large`,[`${t}-sm`]:e.size===`small`,[`${t}-compact`]:e.compact,[`${t}-rtl`]:a.value===`rtl`}});return()=>c(U(`span`,Y(Y({},r),{},{class:K(u.value,r.class)}),[n.default?.call(n)]))}}),RF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{var e;(e=o.value)==null||e.focus()},blur:()=>{var e;(e=o.value)==null||e.blur()}});let c=e=>{a(`update:value`,e.target.value),e&&e.target&&e.type===`click`&&a(`search`,e.target.value,e),a(`change`,e)},l=e=>{document.activeElement===o.value?.input&&e.preventDefault()},u=e=>{a(`search`,o.value?.input?.stateValue,e)},d=t=>{s.value||e.loading||u(t)},f=e=>{s.value=!0,a(`compositionstart`,e)},p=e=>{s.value=!1,a(`compositionend`,e)},{prefixCls:m,getPrefixCls:h,direction:g,size:_}=X(`input-search`,e),v=J(()=>h(`input`,e.inputPrefixCls));return()=>{let{disabled:t,loading:i,addonAfter:a=n.addonAfter?.call(n),suffix:s=n.suffix?.call(n)}=e,h=RF(e,[`disabled`,`loading`,`addonAfter`,`suffix`]),{enterButton:y=n.enterButton?.call(n)??!1}=e;y||=y===``;let b=typeof y==`boolean`?U(jf,null,null):null,x=`${m.value}-button`,S=Array.isArray(y)?y[0]:y,C,w=S.type&&ym(S.type)&&S.type.__ANT_BUTTON;if(w||S.tagName===`button`)C=ao(S,Z({onMousedown:l,onClick:u,key:`enterButton`},w?{class:x,size:_.value}:{}),!1);else{let e=b&&!y;C=U(Qb,{class:x,type:y?`primary`:void 0,size:_.value,disabled:t,key:`enterButton`,onMousedown:l,onClick:u,loading:i,icon:e?b:null},{default:()=>[e?null:b||y]})}a&&(C=[C,a]);let T=K(m.value,{[`${m.value}-rtl`]:g.value===`rtl`,[`${m.value}-${_.value}`]:!!_.value,[`${m.value}-with-button`]:!!y},r.class);return U(IF,Y(Y(Y({ref:o},Br(h,[`onUpdate:value`,`onSearch`,`enterButton`])),r),{},{onPressEnter:d,onCompositionstart:f,onCompositionend:p,size:_.value,prefixCls:v.value,addonAfter:C,suffix:s,onChange:c,class:T,disabled:t}),n)}}}),BF=e=>e!=null&&(!Array.isArray(e)||dt(e).length);function VF(e){return BF(e.addonBefore)||BF(e.addonAfter)}var HF=[`text`,`input`],UF=u({compatConfig:{MODE:3},name:`ClearableLabeledInput`,inheritAttrs:!1,props:{prefixCls:String,inputType:f.oneOf(m(`text`,`input`)),value:nn(),defaultValue:nn(),allowClear:{type:Boolean,default:void 0},element:nn(),handleReset:Function,disabled:{type:Boolean,default:void 0},direction:{type:String},size:{type:String},suffix:nn(),prefix:nn(),addonBefore:nn(),addonAfter:nn(),readonly:{type:Boolean,default:void 0},focused:{type:Boolean,default:void 0},bordered:{type:Boolean,default:!0},triggerFocus:{type:Function},hidden:Boolean,status:String,hashId:String},setup(e,t){let{slots:n,attrs:r}=t,i=Vf.useInject(),a=t=>{let{value:r,disabled:i,readonly:a,handleReset:o,suffix:s=n.suffix}=e,c=!i&&!a&&r,l=`${t}-clear-icon`;return U(tt,{onClick:o,onMousedown:e=>e.preventDefault(),class:K({[`${l}-hidden`]:!c,[`${l}-has-suffix`]:!!s},l),role:`button`},null)},o=(t,o)=>{let{value:s,allowClear:c,direction:l,bordered:u,hidden:d,status:f,addonAfter:p=n.addonAfter,addonBefore:m=n.addonBefore,hashId:h}=e,{status:g,hasFeedback:_}=i;return c?U(`span`,{class:K(`${t}-affix-wrapper`,`${t}-affix-wrapper-textarea-with-clear-btn`,Uf(`${t}-affix-wrapper`,Wf(g,f),_),{[`${t}-affix-wrapper-rtl`]:l===`rtl`,[`${t}-affix-wrapper-borderless`]:!u,[`${r.class}`]:!VF({addonAfter:p,addonBefore:m})&&r.class},h),style:r.style,hidden:d},[ao(o,{style:null,value:s,disabled:e.disabled}),a(t)]):ao(o,{value:s,disabled:e.disabled})};return()=>{let{prefixCls:t,inputType:r,element:i=n.element?.call(n)}=e;return r===HF[0]?o(t,i):null}}}),WF=` + min-height:0 !important; + max-height:none !important; + height:0 !important; + visibility:hidden !important; + overflow:hidden !important; + position:absolute !important; + z-index:-1000 !important; + top:0 !important; + right:0 !important; + pointer-events: none !important; +`,GF=[`letter-spacing`,`line-height`,`padding-top`,`padding-bottom`,`font-family`,`font-weight`,`font-size`,`font-variant`,`text-rendering`,`text-transform`,`width`,`text-indent`,`padding-left`,`padding-right`,`border-width`,`box-sizing`,`word-break`,`white-space`],KF={},qF;function JF(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.getAttribute(`id`)||e.getAttribute(`data-reactid`)||e.getAttribute(`name`);if(t&&KF[n])return KF[n];let r=window.getComputedStyle(e),i=r.getPropertyValue(`box-sizing`)||r.getPropertyValue(`-moz-box-sizing`)||r.getPropertyValue(`-webkit-box-sizing`),a=parseFloat(r.getPropertyValue(`padding-bottom`))+parseFloat(r.getPropertyValue(`padding-top`)),o=parseFloat(r.getPropertyValue(`border-bottom-width`))+parseFloat(r.getPropertyValue(`border-top-width`)),s={sizingStyle:GF.map(e=>`${e}:${r.getPropertyValue(e)}`).join(`;`),paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(KF[n]=s),s}function YF(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;qF||(qF=document.createElement(`textarea`),qF.setAttribute(`tab-index`,`-1`),qF.setAttribute(`aria-hidden`,`true`),document.body.appendChild(qF)),e.getAttribute(`wrap`)?qF.setAttribute(`wrap`,e.getAttribute(`wrap`)):qF.removeAttribute(`wrap`);let{paddingSize:i,borderSize:a,boxSizing:o,sizingStyle:s}=JF(e,t);qF.setAttribute(`style`,`${s};${WF}`),qF.value=e.value||e.placeholder||``;let c,l,u,d=qF.scrollHeight;if(o===`border-box`?d+=a:o===`content-box`&&(d-=i),n!==null||r!==null){qF.value=` `;let e=qF.scrollHeight-i;n!==null&&(c=e*n,o===`border-box`&&(c=c+i+a),d=Math.max(c,d)),r!==null&&(l=e*r,o===`border-box`&&(l=l+i+a),u=d>l?``:`hidden`,d=Math.min(l,d))}let f={height:`${d}px`,overflowY:u,resize:`none`};return c&&(f.minHeight=`${c}px`),l&&(f.maxHeight=`${l}px`),f}var XF=0,ZF=1,QF=2,$F=u({compatConfig:{MODE:3},name:`ResizableTextArea`,inheritAttrs:!1,props:PF(),setup(t,n){let{attrs:r,emit:i,expose:a}=n,o=H(),s=H({}),c=H(QF);ut(()=>{ir.cancel(void 0),ir.cancel(void 0)});let l=()=>{try{if(o.value&&document.activeElement===o.value.input){let e=o.value.getSelectionStart(),t=o.value.getSelectionEnd(),n=o.value.getScrollTop();o.value.setSelectionRange(e,t),o.value.setScrollTop(n)}}catch{}},u=H(),d=H();S(()=>{let e=t.autoSize||t.autosize;e?(u.value=e.minRows,d.value=e.maxRows):(u.value=void 0,d.value=void 0)});let f=J(()=>!!(t.autoSize||t.autosize)),p=()=>{c.value=XF};G([()=>t.value,u,d,f],()=>{f.value&&p()},{immediate:!0});let m=H();G([c,o],()=>{if(o.value)if(c.value===XF)c.value=ZF;else if(c.value===ZF){let e=YF(o.value.input,!1,u.value,d.value);c.value=QF,m.value=e}else l()},{immediate:!0,flush:`post`});let h=Zt(),g=H(),_=()=>{ir.cancel(g.value)},v=e=>{c.value===QF&&(i(`resize`,e),f.value&&(_(),g.value=ir(()=>{p()})))};ut(()=>{_()}),a({resizeTextarea:()=>{p()},textArea:J(()=>o.value?.input),instance:h}),e(t.autosize===void 0,`Input.TextArea`,`autosize is deprecated, please use autoSize instead.`);let y=()=>{let{prefixCls:e,disabled:n}=t,i=Br(t,[`prefixCls`,`onPressEnter`,`autoSize`,`autosize`,`defaultValue`,`allowClear`,`type`,`maxlength`,`valueModifiers`]),a=K(e,r.class,{[`${e}-disabled`]:n}),l=f.value?m.value:null,u=[r.style,s.value,l],d=Z(Z(Z({},i),r),{style:u,class:a});return(c.value===XF||c.value===ZF)&&u.push({overflowX:`hidden`,overflowY:`hidden`}),d.autofocus||delete d.autofocus,d.rows===0&&delete d.rows,U(Qn,{onResize:v,disabled:!f.value},{default:()=>[U(Pu,Y(Y({},d),{},{ref:o,tag:`textarea`}),null)]})};return()=>y()}});function eI(e,t){return[...e||``].slice(0,t).join(``)}function tI(e,t,n,r){let i=n;return e?i=eI(n,r):[...t||``].lengthr&&(i=t),i}var nI=u({compatConfig:{MODE:3},name:`ATextarea`,inheritAttrs:!1,props:PF(),setup(e,t){let{attrs:n,expose:r,emit:i}=t,a=zf(),o=Vf.useInject(),s=J(()=>Wf(o.status,e.status)),c=q(e.value??e.defaultValue),l=q(),u=q(``),{prefixCls:d,size:f,direction:p}=X(`input`,e),[m,h]=YT(d),g=at(),_=J(()=>e.showCount===``||e.showCount||!1),v=J(()=>Number(e.maxlength)>0),y=q(!1),b=q(),x=q(0),C=e=>{y.value=!0,b.value=u.value,x.value=e.currentTarget.selectionStart,i(`compositionstart`,e)},w=t=>{y.value=!1;let n=t.currentTarget.value;v.value&&(n=tI(x.value>=e.maxlength+1||x.value===b.value?.length,b.value,n,e.maxlength)),n!==u.value&&(O(n),TF(t.currentTarget,t,j,n)),i(`compositionend`,t)},T=Zt();G(()=>e.value,()=>{`value`in T.vnode.props,c.value=e.value??``});let E=e=>{EF(l.value?.textArea,e)},D=()=>{var e;(e=l.value?.textArea)==null||e.blur()},O=(t,n)=>{c.value!==t&&(e.value===void 0?c.value=t:z(()=>{var e,t,n;l.value.textArea.value!==u.value&&((n=(e=l.value)==null?void 0:(t=e.instance).update)==null||n.call(t))}),z(()=>{n&&n()}))},k=e=>{e.keyCode===13&&i(`pressEnter`,e),i(`keydown`,e)},A=t=>{let{onBlur:n}=e;n?.(t),a.onFieldBlur()},j=e=>{i(`update:value`,e.target.value),i(`change`,e),i(`input`,e),a.onFieldChange()},M=e=>{TF(l.value.textArea,e,j),O(``,()=>{E()})},N=t=>{let n=t.target.value;if(c.value!==n){if(v.value){let r=t.target;n=tI(r.selectionStart>=e.maxlength+1||r.selectionStart===n.length||!r.selectionStart,u.value,n,e.maxlength)}TF(t.currentTarget,t,j,n),O(n)}},P=()=>{let{class:t}=n,{bordered:r=!0}=e,i=Z(Z(Z({},Br(e,[`allowClear`])),n),{class:[{[`${d.value}-borderless`]:!r,[`${t}`]:t&&!_.value,[`${d.value}-sm`]:f.value===`small`,[`${d.value}-lg`]:f.value===`large`},Uf(d.value,s.value),h.value],disabled:g.value,showCount:null,prefixCls:d.value,onInput:N,onChange:N,onBlur:A,onKeydown:k,onCompositionstart:C,onCompositionend:w});return e.valueModifiers?.lazy&&delete i.onInput,U($F,Y(Y({},i),{},{id:i?.id??a.id.value,ref:l,maxlength:e.maxlength,lazy:e.lazy}),null)};return r({focus:E,blur:D,resizableTextArea:l}),S(()=>{let t=wF(c.value);!y.value&&v.value&&(e.value===null||e.value===void 0)&&(t=eI(t,e.maxlength)),u.value=t}),()=>{let{maxlength:t,bordered:r=!0,hidden:i}=e,{style:a,class:s}=n,c=U(UF,Y(Y({},Z(Z(Z({},e),n),{prefixCls:d.value,inputType:`text`,handleReset:M,direction:p.value,bordered:r,style:_.value?void 0:a,hashId:h.value,disabled:e.disabled??g.value})),{},{value:u.value,status:e.status}),{element:P});if(_.value||o.hasFeedback){let e=[...u.value].length,n=``;n=typeof _.value==`object`?_.value.formatter({value:u.value,count:e,maxlength:t}):`${e}${v.value?` / ${t}`:``}`,c=U(`div`,{hidden:i,class:K(`${d.value}-textarea`,{[`${d.value}-textarea-rtl`]:p.value===`rtl`,[`${d.value}-textarea-show-count`]:_.value,[`${d.value}-textarea-in-form-item`]:o.isFormItemInput},`${d.value}-textarea-show-count`,s,h.value),style:a,"data-count":typeof n==`object`?void 0:n},[c,o.hasFeedback&&U(`span`,{class:`${d.value}-textarea-suffix`},[o.feedbackIcon])])}return m(c)}}}),rI={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z`}}]},name:`eye`,theme:`outlined`};function iI(e){for(var t=1;tU(e?oI:uI,null,null),mI=u({compatConfig:{MODE:3},name:`AInputPassword`,inheritAttrs:!1,props:Z(Z({},NF()),{prefixCls:String,inputPrefixCls:String,action:{type:String,default:`click`},visibilityToggle:{type:Boolean,default:!0},visible:{type:Boolean,default:void 0},"onUpdate:visible":Function,iconRender:Function}),setup(e,t){let{slots:n,attrs:r,expose:i,emit:a}=t,o=q(!1),s=()=>{let{disabled:t}=e;t||(o.value=!o.value,a(`update:visible`,o.value))};S(()=>{e.visible!==void 0&&(o.value=!!e.visible)});let c=q();i({focus:()=>{var e;(e=c.value)==null||e.focus()},blur:()=>{var e;(e=c.value)==null||e.blur()}});let l=t=>{let{action:r,iconRender:i=n.iconRender||pI}=e,a=fI[r]||``,c=i(o.value),l={[a]:s,class:`${t}-icon`,key:`passwordIcon`,onMousedown:e=>{e.preventDefault()},onMouseup:e=>{e.preventDefault()}};return ao(Nt(c)?c:U(`span`,null,[c]),l)},{prefixCls:u,getPrefixCls:d}=X(`input-password`,e),f=J(()=>d(`input`,e.inputPrefixCls)),p=()=>{let{size:t,visibilityToggle:i}=e,a=dI(e,[`size`,`visibilityToggle`]),s=i&&l(u.value),d=K(u.value,r.class,{[`${u.value}-${t}`]:!!t}),p=Z(Z(Z({},Br(a,[`suffix`,`iconRender`,`action`])),r),{type:o.value?`text`:`password`,class:d,prefixCls:f.value,suffix:s});return t&&(p.size=t),U(IF,Y({ref:c},p),n)};return()=>p()}});IF.Group=LF,IF.Search=zF,IF.TextArea=nI,IF.Password=mI,IF.install=function(e){return e.component(IF.name,IF),e.component(IF.Group.name,IF.Group),e.component(IF.Search.name,IF.Search),e.component(IF.TextArea.name,IF.TextArea),e.component(IF.Password.name,IF.Password),e};var hI=IF;function gI(){return{keyboard:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},afterClose:Function,closable:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},destroyOnClose:{type:Boolean,default:void 0},mousePosition:f.shape({x:Number,y:Number}).loose,title:f.any,footer:f.any,transitionName:String,maskTransitionName:String,animation:f.any,maskAnimation:f.any,wrapStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},maskStyle:{type:Object,default:void 0},prefixCls:String,wrapClassName:String,rootClassName:String,width:[String,Number],height:[String,Number],zIndex:Number,bodyProps:f.any,maskProps:f.any,wrapProps:f.any,getContainer:f.any,dialogStyle:{type:Object,default:void 0},dialogClass:String,closeIcon:f.any,forceRender:{type:Boolean,default:void 0},getOpenCount:Function,focusTriggerAfterClose:{type:Boolean,default:void 0},onClose:Function,modalRender:Function}}function _I(e,t,n){let r=t;return!r&&n&&(r=`${e}-${n}`),r}var vI=-1;function yI(){return vI+=1,vI}function bI(e,t){let n=e[`page${t?`Y`:`X`}Offset`],r=`scroll${t?`Top`:`Left`}`;if(typeof n!=`number`){let t=e.document;n=t.documentElement[r],typeof n!=`number`&&(n=t.body[r])}return n}function xI(e){let t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=bI(i),n.top+=bI(i,!0),n}var SI={width:0,height:0,overflow:`hidden`,outline:`none`},CI={outline:`none`},wI=u({compatConfig:{MODE:3},name:`DialogContent`,inheritAttrs:!1,props:Z(Z({},gI()),{motionName:String,ariaId:String,onVisibleChanged:Function,onMousedown:Function,onMouseup:Function}),setup(e,t){let{expose:n,slots:r,attrs:i}=t,a=H(),o=H(),s=H();n({focus:()=>{var e;(e=a.value)==null||e.focus({preventScroll:!0})},changeActive:e=>{let{activeElement:t}=document;e&&t===o.value?a.value.focus({preventScroll:!0}):!e&&t===a.value&&o.value.focus({preventScroll:!0})}});let c=H(),l=J(()=>{let{width:t,height:n}=e,r={};return t!==void 0&&(r.width=typeof t==`number`?`${t}px`:t),n!==void 0&&(r.height=typeof n==`number`?`${n}px`:n),c.value&&(r.transformOrigin=c.value),r}),u=()=>{z(()=>{if(s.value){let t=xI(s.value);c.value=e.mousePosition?`${e.mousePosition.x-t.left}px ${e.mousePosition.y-t.top}px`:``}})},d=t=>{e.onVisibleChanged(t)};return()=>{let{prefixCls:t,footer:n=r.footer?.call(r),title:c=r.title?.call(r),ariaId:f,closable:p,closeIcon:m=r.closeIcon?.call(r),onClose:h,bodyStyle:g,bodyProps:_,onMousedown:v,onMouseup:y,visible:b,modalRender:x=r.modalRender,destroyOnClose:S,motionName:C}=e,w;n&&(w=U(`div`,{class:`${t}-footer`},[n]));let T;c&&(T=U(`div`,{class:`${t}-header`},[U(`div`,{class:`${t}-title`,id:f},[c])]));let E;p&&(E=U(`button`,{type:`button`,onClick:h,"aria-label":`Close`,class:`${t}-close`},[m||U(`span`,{class:`${t}-close-x`},null)]));let D=U(`div`,{class:`${t}-content`},[E,T,U(`div`,Y({class:`${t}-body`,style:g},_),[r.default?.call(r)]),w]);return U(Re,Y(Y({},ge(C)),{},{onBeforeEnter:u,onAfterEnter:()=>d(!0),onAfterLeave:()=>d(!1)}),{default:()=>[b||!S?Mt(U(`div`,Y(Y({},i),{},{ref:s,key:`dialog-element`,role:`document`,style:[l.value,i.style],class:[t,i.class],onMousedown:v,onMouseup:y}),[U(`div`,{tabindex:0,ref:a,style:CI},[x?x({originVNode:D}):D]),U(`div`,{tabindex:0,ref:o,style:SI},null)]),[[ht,b]]):null]})}}}),TI=u({compatConfig:{MODE:3},name:`DialogMask`,props:{prefixCls:String,visible:Boolean,motionName:String,maskProps:Object},setup(e,t){let{}=t;return()=>{let{prefixCls:t,visible:n,maskProps:r,motionName:i}=e;return U(Re,ge(i),{default:()=>[Mt(U(`div`,Y({class:`${t}-mask`},r),null),[[ht,n]])]})}}}),EI=u({compatConfig:{MODE:3},name:`VcDialog`,inheritAttrs:!1,props:Zn(Z(Z({},gI()),{getOpenCount:Function,scrollLocker:Object}),{mask:!0,visible:!1,keyboard:!0,closable:!0,maskClosable:!0,destroyOnClose:!1,prefixCls:`rc-dialog`,getOpenCount:()=>null,focusTriggerAfterClose:!0}),setup(e,t){let{attrs:n,slots:r}=t,i=q(),a=q(),o=q(),s=q(e.visible),c=q(`vcDialogTitle${yI()}`),l=t=>{var n,r;if(t)Ct(a.value,document.activeElement)||(i.value=document.activeElement,(n=o.value)==null||n.focus());else{let t=s.value;if(s.value=!1,e.mask&&i.value&&e.focusTriggerAfterClose){try{i.value.focus({preventScroll:!0})}catch{}i.value=null}t&&((r=e.afterClose)==null||r.call(e))}},u=t=>{var n;(n=e.onClose)==null||n.call(e,t)},d=q(!1),f=q(),p=()=>{clearTimeout(f.value),d.value=!0},m=()=>{f.value=setTimeout(()=>{d.value=!1})},h=t=>{if(!e.maskClosable)return null;d.value?d.value=!1:a.value===t.target&&u(t)},g=t=>{if(e.keyboard&&t.keyCode===$.ESC){t.stopPropagation(),u(t);return}e.visible&&t.keyCode===$.TAB&&o.value.changeActive(!t.shiftKey)};return G(()=>e.visible,()=>{e.visible&&(s.value=!0)},{flush:`post`}),ut(()=>{var t;clearTimeout(f.value),(t=e.scrollLocker)==null||t.unLock()}),S(()=>{var t,n;(t=e.scrollLocker)==null||t.unLock(),s.value&&((n=e.scrollLocker)==null||n.lock())}),()=>{let{prefixCls:t,mask:i,visible:d,maskTransitionName:f,maskAnimation:_,zIndex:v,wrapClassName:y,rootClassName:b,wrapStyle:x,closable:S,maskProps:C,maskStyle:w,transitionName:T,animation:E,wrapProps:D,title:O=r.title}=e,{style:k,class:A}=n;return U(`div`,Y({class:[`${t}-root`,b]},Bu(e,{data:!0})),[U(TI,{prefixCls:t,visible:i&&d,motionName:_I(t,f,_),style:Z({zIndex:v},w),maskProps:C},null),U(`div`,Y({tabIndex:-1,onKeydown:g,class:K(`${t}-wrap`,y),ref:a,onClick:h,role:`dialog`,"aria-labelledby":O?c.value:null,style:Z(Z({zIndex:v},x),{display:s.value?null:`none`})},D),[U(wI,Y(Y({},Br(e,[`scrollLocker`])),{},{style:k,class:A,onMousedown:p,onMouseup:m,ref:o,closable:S,ariaId:c.value,prefixCls:t,visible:d,onClose:u,onVisibleChanged:l,motionName:_I(t,T,E)}),r)])])}}}),DI=u({compatConfig:{MODE:3},name:`DialogWrap`,inheritAttrs:!1,props:Zn(gI(),{visible:!1}),setup(e,t){let{attrs:n,slots:r}=t,i=H(e.visible);return $t({},{inTriggerContext:!1}),G(()=>e.visible,()=>{e.visible&&(i.value=!0)},{flush:`post`}),()=>{let{visible:t,getContainer:a,forceRender:o,destroyOnClose:s=!1,afterClose:c}=e,l=Z(Z(Z({},e),n),{ref:`_component`,key:`dialog`});return a===!1?U(EI,Y(Y({},l),{},{getOpenCount:()=>2}),r):!o&&s&&!i.value?null:U(bu,{autoLock:!0,visible:t,forceRender:o,getContainer:a},{default:e=>(l=Z(Z(Z({},l),e),{afterClose:()=>{c?.(),i.value=!1}}),U(EI,l,r))})}}});function OI(e){let t=H(null),n=Ne(Z({},e)),r=H([]);return V(()=>{t.value&&ir.cancel(t.value)}),[n,e=>{t.value===null&&(r.value=[],t.value=ir(()=>{let e;r.value.forEach(t=>{e=Z(Z({},e),t)}),Z(n,e),t.value=null})),r.value.push(e)}]}function kI(e,t,n,r){let i=t+n,a=(n-r)/2;if(n>r){if(t>0)return{[e]:a};if(t<0&&ir)return{[e]:t<0?a:-a};return{}}function AI(e,t,n,r){let{width:i,height:a}=ku(),o=null;return e<=i&&t<=a?o={x:0,y:0}:(e>i||t>a)&&(o=Z(Z({},kI(`x`,n,e,i)),kI(`y`,r,t,a))),o}var jI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{fe(MI,e)},inject:()=>g(MI,{isPreviewGroup:q(!1),previewUrls:J(()=>new Map),setPreviewUrls:()=>{},current:H(null),setCurrent:()=>{},setShowPreview:()=>{},setMousePosition:()=>{},registerImage:null,rootClassName:``})},PI=u({compatConfig:{MODE:3},name:`PreviewGroup`,inheritAttrs:!1,props:{previewPrefixCls:String,preview:{type:[Boolean,Object],default:!0},icons:{type:Object,default:()=>({})}},setup(e,t){let{slots:n}=t,r=J(()=>{let t={visible:void 0,onVisibleChange:()=>{},getContainer:void 0,current:0};return typeof e.preview==`object`?zI(e.preview,t):t}),i=Ne(new Map),a=H(),o=J(()=>r.value.visible),s=J(()=>r.value.getContainer),[c,l]=df(!!o.value,{value:o,onChange:(e,t)=>{var n,i;(i=(n=r.value).onVisibleChange)==null||i.call(n,e,t)}}),u=H(null),d=J(()=>o.value!==void 0),f=J(()=>Array.from(i.keys())),p=J(()=>f.value[r.value.current]),m=J(()=>new Map(Array.from(i).filter(e=>{let[,{canPreview:t}]=e;return!!t}).map(e=>{let[t,{url:n}]=e;return[t,n]}))),h=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;i.set(e,{url:t,canPreview:n})},g=e=>{a.value=e},_=e=>{u.value=e},v=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return i.set(e,{url:t,canPreview:n}),()=>{i.delete(e)}},y=e=>{e?.stopPropagation(),l(!1),_(null)};return G(p,e=>{g(e)},{immediate:!0,flush:`post`}),S(()=>{c.value&&d.value&&g(p.value)},{flush:`post`}),NI.provide({isPreviewGroup:q(!0),previewUrls:m,setPreviewUrls:h,current:a,setCurrent:g,setShowPreview:l,setMousePosition:_,registerImage:v}),()=>{let t=jI(r.value,[]);return U($e,null,[n.default&&n.default(),U(II,Y(Y({},t),{},{"ria-hidden":!c.value,visible:c.value,prefixCls:e.previewPrefixCls,onClose:y,mousePosition:u.value,src:m.value.get(a.value),icons:e.icons,getContainer:s.value}),null)])}}}),FI={x:0,y:0},II=u({compatConfig:{MODE:3},name:`Preview`,inheritAttrs:!1,props:Z(Z({},gI()),{src:String,alt:String,rootClassName:String,icons:{type:Object,default:()=>({})}}),emits:[`close`,`afterClose`],setup(e,t){let{emit:n,attrs:r}=t,{rotateLeft:i,rotateRight:a,zoomIn:o,zoomOut:s,close:c,left:l,right:u,flipX:d,flipY:f}=Ne(e.icons),p=q(1),m=q(0),h=Ne({x:1,y:1}),[g,_]=OI(FI),v=()=>n(`close`),b=q(),x=Ne({originX:0,originY:0,deltaX:0,deltaY:0}),S=q(!1),{previewUrls:C,current:w,isPreviewGroup:T,setCurrent:E}=NI.inject(),D=J(()=>C.value.size),O=J(()=>Array.from(C.value.keys())),k=J(()=>O.value.indexOf(w.value)),A=J(()=>T.value?C.value.get(w.value):e.src),j=J(()=>T.value&&D.value>1),M=q({wheelDirection:0}),N=()=>{p.value=1,m.value=0,h.x=1,h.y=1,_(FI),n(`afterClose`)},P=e=>{e?p.value+=.5:p.value++,_(FI)},F=e=>{p.value>1&&(e?p.value-=.5:p.value--),_(FI)},I=()=>{m.value+=90},L=()=>{m.value-=90},ee=()=>{h.x=-h.x},te=()=>{h.y=-h.y},ne=e=>{e.preventDefault(),e.stopPropagation(),k.value>0&&E(O.value[k.value-1])},R=e=>{e.preventDefault(),e.stopPropagation(),k.valueP(),type:`zoomIn`},{icon:s,onClick:()=>F(),type:`zoomOut`,disabled:J(()=>p.value===1)},{icon:a,onClick:I,type:`rotateRight`},{icon:i,onClick:L,type:`rotateLeft`},{icon:d,onClick:ee,type:`flipX`},{icon:f,onClick:te,type:`flipY`}],z=()=>{if(e.visible&&S.value){let e=b.value.offsetWidth*p.value,t=b.value.offsetHeight*p.value,{left:n,top:r}=Au(b.value),i=m.value%180!=0;S.value=!1;let a=AI(i?t:e,i?e:t,n,r);a&&_(Z({},a))}},se=e=>{e.button===0&&(e.preventDefault(),e.stopPropagation(),x.deltaX=e.pageX-g.x,x.deltaY=e.pageY-g.y,x.originX=g.x,x.originY=g.y,S.value=!0)},B=t=>{e.visible&&S.value&&_({x:t.pageX-x.deltaX,y:t.pageY-x.deltaY})},ce=t=>{if(!e.visible)return;t.preventDefault();let n=t.deltaY;M.value={wheelDirection:n}},le=t=>{!e.visible||!j.value||(t.preventDefault(),t.keyCode===$.LEFT?k.value>0&&E(O.value[k.value-1]):t.keyCode===$.RIGHT&&k.value{e.visible&&(p.value!==1&&(p.value=1),(g.x!==FI.x||g.y!==FI.y)&&_(FI))},ue=()=>{};return V(()=>{G([()=>e.visible,S],()=>{ue();let e,t,n=cr(window,`mouseup`,z,!1),r=cr(window,`mousemove`,B,!1),i=cr(window,`wheel`,ce,{passive:!1}),a=cr(window,`keydown`,le,!1);try{window.top!==window.self&&(e=cr(window.top,`mouseup`,z,!1),t=cr(window.top,`mousemove`,B,!1))}catch(e){`${e}`}ue=()=>{n.remove(),r.remove(),i.remove(),a.remove(),e&&e.remove(),t&&t.remove()}},{flush:`post`,immediate:!0}),G([M],()=>{let{wheelDirection:e}=M.value;e>0?F(!0):e<0&&P(!0)})}),y(()=>{ue()}),()=>{let{visible:t,prefixCls:n,rootClassName:i}=e;return U(DI,Y(Y({},r),{},{transitionName:e.transitionName,maskTransitionName:e.maskTransitionName,closable:!1,keyboard:!0,prefixCls:n,onClose:v,afterClose:N,visible:t,wrapClassName:re,rootClassName:i,getContainer:e.getContainer}),{default:()=>[U(`div`,{class:[`${e.prefixCls}-operations-wrapper`,i]},[U(`ul`,{class:`${e.prefixCls}-operations`},[oe.map(t=>{let{icon:n,onClick:r,type:i,disabled:a}=t;return U(`li`,{class:K(ie,{[`${e.prefixCls}-operations-operation-disabled`]:a&&a?.value}),onClick:r,key:i},[it(n,{class:ae})])})])]),U(`div`,{class:`${e.prefixCls}-img-wrapper`,style:{transform:`translate3d(${g.x}px, ${g.y}px, 0)`}},[U(`img`,{onMousedown:se,onDblclick:H,ref:b,class:`${e.prefixCls}-img`,src:A.value,alt:e.alt,style:{transform:`scale3d(${h.x*p.value}, ${h.y*p.value}, 1) rotate(${m.value}deg)`}},null)]),j.value&&U(`div`,{class:K(`${e.prefixCls}-switch-left`,{[`${e.prefixCls}-switch-left-disabled`]:k.value<=0}),onClick:ne},[l]),j.value&&U(`div`,{class:K(`${e.prefixCls}-switch-right`,{[`${e.prefixCls}-switch-right-disabled`]:k.value>=D.value-1}),onClick:R},[u])]})}}}),LI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({src:String,wrapperClassName:String,wrapperStyle:{type:Object,default:void 0},rootClassName:String,prefixCls:String,previewPrefixCls:String,width:[Number,String],height:[Number,String],previewMask:{type:[Boolean,Function],default:void 0},placeholder:f.any,fallback:String,preview:{type:[Boolean,Object],default:!0},onClick:{type:Function},onError:{type:Function}}),zI=(e,t)=>{let n=Z({},e);return Object.keys(t).forEach(r=>{e[r]===void 0&&(n[r]=t[r])}),n},BI=0,VI=u({compatConfig:{MODE:3},name:`VcImage`,inheritAttrs:!1,props:RI(),emits:[`click`,`error`],setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=J(()=>e.prefixCls),o=J(()=>`${a.value}-preview`),s=J(()=>{let t={visible:void 0,onVisibleChange:()=>{},getContainer:void 0};return typeof e.preview==`object`?zI(e.preview,t):t}),c=J(()=>s.value.src??e.src),l=J(()=>e.placeholder&&e.placeholder!==!0||r.placeholder),u=J(()=>s.value.visible),d=J(()=>s.value.getContainer),f=J(()=>u.value!==void 0),[p,m]=df(!!u.value,{value:u,onChange:(e,t)=>{var n,r;(r=(n=s.value).onVisibleChange)==null||r.call(n,e,t)}}),h=H(l.value?`loading`:`normal`);G(()=>e.src,()=>{h.value=l.value?`loading`:`normal`});let g=H(null),_=J(()=>h.value===`error`),{isPreviewGroup:v,setCurrent:b,setShowPreview:x,setMousePosition:S,registerImage:C}=NI.inject(),w=H(BI++),T=J(()=>e.preview&&!_.value),E=()=>{h.value=`normal`},D=e=>{h.value=`error`,i(`error`,e)},O=e=>{if(!f.value){let{left:t,top:n}=Au(e.target);v.value?(b(w.value),S({x:t,y:n})):g.value={x:t,y:n}}v.value?x(!0):m(!0),i(`click`,e)},k=()=>{m(!1),f.value||(g.value=null)},A=H(null);G(()=>A,()=>{h.value===`loading`&&A.value.complete&&(A.value.naturalWidth||A.value.naturalHeight)&&E()});let j=()=>{};V(()=>{G([c,T],()=>{if(j(),!v.value)return()=>{};j=C(w.value,c.value,T.value),T.value||j()},{flush:`post`,immediate:!0})}),y(()=>{j()});let M=e=>Gg(e)?e+`px`:e;return()=>{let{prefixCls:t,wrapperClassName:a,fallback:l,src:u,placeholder:f,wrapperStyle:m,rootClassName:y,width:b,height:x,crossorigin:S,decoding:C,alt:w,sizes:j,srcset:N,usemap:P,class:F,style:I}=Z(Z({},e),n),L=s.value,{icons:ee,maskClassName:te}=L,ne=LI(L,[`icons`,`maskClassName`]),R=K(t,a,y,{[`${t}-error`]:_.value}),re=_.value&&l?l:c.value,ie={crossorigin:S,decoding:C,alt:w,sizes:j,srcset:N,usemap:P,width:b,height:x,class:K(`${t}-img`,{[`${t}-img-placeholder`]:f===!0},F),style:Z({height:M(x)},I)};return U($e,null,[U(`div`,{class:R,onClick:T.value?O:e=>{i(`click`,e)},style:Z({width:M(b),height:M(x)},m)},[U(`img`,Y(Y(Y({},ie),_.value&&l?{src:l}:{onLoad:E,onError:D,src:u}),{},{ref:A}),null),h.value===`loading`&&U(`div`,{"aria-hidden":`true`,class:`${t}-placeholder`},[f||r.placeholder&&r.placeholder()]),r.previewMask&&T.value&&U(`div`,{class:[`${t}-mask`,te]},[r.previewMask()])]),!v.value&&T.value&&U(II,Y(Y({},ne),{},{"aria-hidden":!p.value,visible:p.value,prefixCls:o.value,onClose:k,mousePosition:g.value,src:re,alt:w,getContainer:d.value,icons:ee,rootClassName:y}),null)])}}});VI.PreviewGroup=PI;var HI=VI,UI={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z`}},{tag:`path`,attrs:{d:`M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z`}}]},name:`rotate-left`,theme:`outlined`};function WI(e){for(var t=1;t{let{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}${e.antCls}-zoom-enter, ${t}${e.antCls}-zoom-appear`]:{transform:`none`,opacity:0,animationDuration:e.motionDurationSlow,userSelect:`none`},[`${t}${e.antCls}-zoom-leave ${t}-content`]:{pointerEvents:`none`},[`${t}-mask`]:Z(Z({},lL(`fixed`)),{zIndex:e.zIndexPopupBase,height:`100%`,backgroundColor:e.colorBgMask,[`${t}-hidden`]:{display:`none`}}),[`${t}-wrap`]:Z(Z({},lL(`fixed`)),{overflow:`auto`,outline:0,WebkitOverflowScrolling:`touch`})}},{[`${t}-root`]:b_(e)}]},dL=e=>{let{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap`]:{zIndex:e.zIndexPopupBase,position:`fixed`,inset:0,overflow:`auto`,outline:0,WebkitOverflowScrolling:`touch`},[`${t}-wrap-rtl`]:{direction:`rtl`},[`${t}-centered`]:{textAlign:`center`,"&::before":{display:`inline-block`,width:0,height:`100%`,verticalAlign:`middle`,content:`""`},[t]:{top:0,display:`inline-block`,paddingBottom:0,textAlign:`start`,verticalAlign:`middle`}},[`@media (max-width: ${e.screenSMMax})`]:{[t]:{maxWidth:`calc(100vw - 16px)`,margin:`${e.marginXS} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Z(Z({},rn(e)),{pointerEvents:`none`,position:`relative`,top:100,width:`auto`,maxWidth:`calc(100vw - ${e.margin*2}px)`,margin:`0 auto`,paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.modalHeadingColor,fontWeight:e.fontWeightStrong,fontSize:e.modalHeaderTitleFontSize,lineHeight:e.modalHeaderTitleLineHeight,wordWrap:`break-word`},[`${t}-content`]:{position:`relative`,backgroundColor:e.modalContentBg,backgroundClip:`padding-box`,border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadowSecondary,pointerEvents:`auto`,padding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`},[`${t}-close`]:Z({position:`absolute`,top:(e.modalHeaderCloseSize-e.modalCloseBtnSize)/2,insetInlineEnd:(e.modalHeaderCloseSize-e.modalCloseBtnSize)/2,zIndex:e.zIndexPopupBase+10,padding:0,color:e.modalCloseColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:`none`,background:`transparent`,borderRadius:e.borderRadiusSM,width:e.modalConfirmIconSize,height:e.modalConfirmIconSize,border:0,outline:0,cursor:`pointer`,transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:`block`,fontSize:e.fontSizeLG,fontStyle:`normal`,lineHeight:`${e.modalCloseBtnSize}px`,textAlign:`center`,textTransform:`none`,textRendering:`auto`},"&:hover":{color:e.modalIconHoverColor,backgroundColor:e.wireframe?`transparent`:e.colorFillContent,textDecoration:`none`},"&:active":{backgroundColor:e.wireframe?`transparent`:e.colorFillContentHover}},de(e)),[`${t}-header`]:{color:e.colorText,background:e.modalHeaderBg,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,marginBottom:e.marginXS},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:`break-word`},[`${t}-footer`]:{textAlign:`end`,background:e.modalFooterBg,marginTop:e.marginSM,[`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]:{marginBottom:0,marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:`hidden`}})},{[`${t}-pure-panel`]:{top:`auto`,padding:0,display:`flex`,flexDirection:`column`,[`${t}-content, + ${t}-body, + ${t}-confirm-body-wrapper`]:{display:`flex`,flexDirection:`column`,flex:`auto`},[`${t}-confirm-body`]:{marginBottom:`auto`}}}]},fL=e=>{let{componentCls:t}=e,n=`${t}-confirm`;return{[n]:{"&-rtl":{direction:`rtl`},[`${e.antCls}-modal-header`]:{display:`none`},[`${n}-body-wrapper`]:Z({},D()),[`${n}-body`]:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,[`${n}-title`]:{flex:`0 0 100%`,display:`block`,overflow:`hidden`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.modalHeaderTitleFontSize,lineHeight:e.modalHeaderTitleLineHeight,[`+ ${n}-content`]:{marginBlockStart:e.marginXS,flexBasis:`100%`,maxWidth:`calc(100% - ${e.modalConfirmIconSize+e.marginSM}px)`}},[`${n}-content`]:{color:e.colorText,fontSize:e.fontSize},[`> ${e.iconCls}`]:{flex:`none`,marginInlineEnd:e.marginSM,fontSize:e.modalConfirmIconSize,[`+ ${n}-title`]:{flex:1},[`+ ${n}-title + ${n}-content`]:{marginInlineStart:e.modalConfirmIconSize+e.marginSM}}},[`${n}-btns`]:{textAlign:`end`,marginTop:e.marginSM,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${n}-error ${n}-body > ${e.iconCls}`]:{color:e.colorError},[`${n}-warning ${n}-body > ${e.iconCls}, + ${n}-confirm ${n}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${n}-info ${n}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${n}-success ${n}-body > ${e.iconCls}`]:{color:e.colorSuccess},[`${t}-zoom-leave ${t}-btns`]:{pointerEvents:`none`}}},pL=e=>{let{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:`rtl`,[`${t}-confirm-body`]:{direction:`rtl`}}}}},mL=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-confirm`;return{[t]:{[`${t}-content`]:{padding:0},[`${t}-header`]:{padding:e.modalHeaderPadding,borderBottom:`${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`,marginBottom:0},[`${t}-body`]:{padding:e.modalBodyPadding},[`${t}-footer`]:{padding:`${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`,borderTop:`${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`,marginTop:0}},[r]:{[`${n}-modal-body`]:{padding:`${e.padding*2}px ${e.padding*2}px ${e.paddingLG}px`},[`${r}-body`]:{[`> ${e.iconCls}`]:{marginInlineEnd:e.margin,[`+ ${r}-title + ${r}-content`]:{marginInlineStart:e.modalConfirmIconSize+e.margin}}},[`${r}-btns`]:{marginTop:e.marginLG}}}},hL=v(`Modal`,e=>{let t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5,i=B(e,{modalBodyPadding:e.paddingLG,modalHeaderBg:e.colorBgElevated,modalHeaderPadding:`${t}px ${e.paddingLG}px`,modalHeaderBorderWidth:e.lineWidth,modalHeaderBorderStyle:e.lineType,modalHeaderTitleLineHeight:r,modalHeaderTitleFontSize:n,modalHeaderBorderColorSplit:e.colorSplit,modalHeaderCloseSize:r*n+t*2,modalContentBg:e.colorBgElevated,modalHeadingColor:e.colorTextHeading,modalCloseColor:e.colorTextDescription,modalFooterBg:`transparent`,modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterPaddingVertical:e.paddingXS,modalFooterPaddingHorizontal:e.padding,modalFooterBorderWidth:e.lineWidth,modalConfirmTitleFontSize:e.fontSizeLG,modalIconHoverColor:e.colorIconHover,modalConfirmIconSize:e.fontSize*e.lineHeight,modalCloseBtnSize:e.controlHeightLG*.55});return[dL(i),fL(i),pL(i),uL(i),e.wireframe&&mL(i),Q_(i,`zoom`)]}),gL=e=>({position:e||`absolute`,inset:0}),_L=e=>{let{iconCls:t,motionDurationSlow:n,paddingXXS:r,marginXXS:i,prefixCls:a}=e;return{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fff`,background:new we(`#000`).setAlpha(.5).toRgbString(),cursor:`pointer`,opacity:0,transition:`opacity ${n}`,[`.${a}-mask-info`]:Z(Z({},xe),{padding:`0 ${r}px`,[t]:{marginInlineEnd:i,svg:{verticalAlign:`baseline`}}})}},vL=e=>{let{previewCls:t,modalMaskBg:n,paddingSM:r,previewOperationColorDisabled:i,motionDurationSlow:a}=e,o=new we(n).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${t}-operations`]:Z(Z({},rn(e)),{display:`flex`,flexDirection:`row-reverse`,alignItems:`center`,color:e.previewOperationColor,listStyle:`none`,background:o.toRgbString(),pointerEvents:`auto`,"&-operation":{marginInlineStart:r,padding:r,cursor:`pointer`,transition:`all ${a}`,userSelect:`none`,"&:hover":{background:s.toRgbString()},"&-disabled":{color:i,pointerEvents:`none`},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:`absolute`,left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%)`},"&-icon":{fontSize:e.previewOperationSize}})}},yL=e=>{let{modalMaskBg:t,iconCls:n,previewOperationColorDisabled:r,previewCls:i,zIndexPopup:a,motionDurationSlow:o}=e,s=new we(t).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${i}-switch-left, ${i}-switch-right`]:{position:`fixed`,insetBlockStart:`50%`,zIndex:a+1,display:`flex`,alignItems:`center`,justifyContent:`center`,width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:s.toRgbString(),borderRadius:`50%`,transform:`translateY(-50%)`,cursor:`pointer`,transition:`all ${o}`,pointerEvents:`auto`,userSelect:`none`,"&:hover":{background:c.toRgbString()},"&-disabled":{"&, &:hover":{color:r,background:`transparent`,cursor:`not-allowed`,[`> ${n}`]:{cursor:`not-allowed`}}},[`> ${n}`]:{fontSize:e.previewOperationSize}},[`${i}-switch-left`]:{insetInlineStart:e.marginSM},[`${i}-switch-right`]:{insetInlineEnd:e.marginSM}}},bL=e=>{let{motionEaseOut:t,previewCls:n,motionDurationSlow:r,componentCls:i}=e;return[{[`${i}-preview-root`]:{[n]:{height:`100%`,textAlign:`center`,pointerEvents:`none`},[`${n}-body`]:Z(Z({},gL()),{overflow:`hidden`}),[`${n}-img`]:{maxWidth:`100%`,maxHeight:`100%`,verticalAlign:`middle`,transform:`scale3d(1, 1, 1)`,cursor:`grab`,transition:`transform ${r} ${t} 0s`,userSelect:`none`,pointerEvents:`auto`,"&-wrapper":Z(Z({},gL()),{transition:`transform ${r} ${t} 0s`,display:`flex`,justifyContent:`center`,alignItems:`center`,"&::before":{display:`inline-block`,width:1,height:`50%`,marginInlineEnd:-1,content:`""`}})},[`${n}-moving`]:{[`${n}-preview-img`]:{cursor:`grabbing`,"&-wrapper":{transitionDuration:`0s`}}}}},{[`${i}-preview-root`]:{[`${n}-wrap`]:{zIndex:e.zIndexPopup}}},{[`${i}-preview-operations-wrapper`]:{position:`fixed`,insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:`100%`},"&":[vL(e),yL(e)]}]},xL=e=>{let{componentCls:t}=e;return{[t]:{position:`relative`,display:`inline-block`,[`${t}-img`]:{width:`100%`,height:`auto`,verticalAlign:`middle`},[`${t}-img-placeholder`]:{backgroundColor:e.colorBgContainerDisabled,backgroundImage:`url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')`,backgroundRepeat:`no-repeat`,backgroundPosition:`center center`,backgroundSize:`30%`},[`${t}-mask`]:Z({},_L(e)),[`${t}-mask:hover`]:{opacity:1},[`${t}-placeholder`]:Z({},gL())}}},SL=e=>{let{previewCls:t}=e;return{[`${t}-root`]:Q_(e,`zoom`),"&":b_(e,!0)}},CL=v(`Image`,e=>{let t=`${e.componentCls}-preview`,n=B(e,{previewCls:t,modalMaskBg:new we(`#000`).setAlpha(.45).toRgbString(),imagePreviewSwitchSize:e.controlHeightLG});return[xL(n),bL(n),uL(B(n,{componentCls:t})),SL(n)]},e=>({zIndexPopup:e.zIndexPopupBase+80,previewOperationColor:new we(e.colorTextLightSolid).toRgbString(),previewOperationColorDisabled:new we(e.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5})),wL={rotateLeft:U(KI,null,null),rotateRight:U(XI,null,null),zoomIn:U(eL,null,null),zoomOut:U(iL,null,null),close:U(Pe,null,null),left:U(wA,null,null),right:U(gx,null,null),flipX:U(cL,null,null),flipY:U(cL,{rotate:90},null)},TL=u({compatConfig:{MODE:3},name:`AImagePreviewGroup`,inheritAttrs:!1,props:{previewPrefixCls:String,preview:nn()},setup(e,t){let{attrs:n,slots:r}=t,{prefixCls:i,rootPrefixCls:a}=X(`image`,e),o=J(()=>`${i.value}-preview`),[s,c]=CL(i),l=J(()=>{let{preview:t}=e;if(t===!1)return t;let n=typeof t==`object`?t:{};return Z(Z({},n),{rootClassName:c.value,transitionName:Xt(a.value,`zoom`,n.transitionName),maskTransitionName:Xt(a.value,`fade`,n.maskTransitionName)})});return()=>s(U(PI,Y(Y({},Z(Z({},n),e)),{},{preview:l.value,icons:wL,previewPrefixCls:o.value}),r))}}),EL=u({name:`AImage`,inheritAttrs:!1,props:RI(),setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,rootPrefixCls:a,configProvider:o}=X(`image`,e),[s,c]=CL(i),l=J(()=>{let{preview:t}=e;if(t===!1)return t;let n=typeof t==`object`?t:{};return Z(Z({icons:wL},n),{transitionName:Xt(a.value,`zoom`,n.transitionName),maskTransitionName:Xt(a.value,`fade`,n.maskTransitionName)})});return()=>{let t=o.locale?.value?.Image||Ye.Image,a=()=>U(`div`,{class:`${i.value}-mask-info`},[U(oI,null,null),t?.preview]),{previewMask:u=n.previewMask||a}=e;return s(U(HI,Y(Y({},Z(Z(Z({},r),e),{prefixCls:i.value})),{},{preview:l.value,rootClassName:K(e.rootClassName,c.value)}),Z(Z({},n),{previewMask:typeof u==`function`?u:null})))}}});EL.PreviewGroup=TL,EL.install=function(e){return e.component(EL.name,EL),e.component(EL.PreviewGroup.name,EL.PreviewGroup),e};var DL={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z`}}]},name:`up`,theme:`outlined`};function OL(e){for(var t=1;t2**53-1)return String(jL()?BigInt(e).toString():2**53-1);if(e<-(2**53-1))return String(jL()?BigInt(e).toString():-(2**53-1));t=e.toFixed(PL(t))}return ML(t).fullStr}function IL(e){return typeof e==`number`?!Number.isNaN(e):e?/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e):!1}function LL(e){return!e&&e!==0&&!Number.isNaN(e)||!String(e).trim()}var RL=class e{constructor(e){if(this.origin=``,LL(e)){this.empty=!0;return}this.origin=String(e),this.number=Number(e)}negate(){return new e(-this.toNumber())}add(t){if(this.isInvalidate())return new e(t);let n=Number(t);if(Number.isNaN(n))return this;let r=this.number+n;if(r>2**53-1)return new e(2**53-1);if(r<-(2**53-1))return new e(-(2**53-1));let i=Math.max(PL(this.number),PL(n));return new e(r.toFixed(i))}isEmpty(){return this.empty}isNaN(){return Number.isNaN(this.number)}isInvalidate(){return this.isEmpty()||this.isNaN()}equals(e){return this.toNumber()===e?.toNumber()}lessEquals(e){return this.add(e.negate().toString()).toNumber()<=0}toNumber(){return this.number}toString(){return!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]?this.isInvalidate()?``:FL(this.number):this.origin}},zL=class e{constructor(e){if(this.origin=``,LL(e)){this.empty=!0;return}if(this.origin=String(e),e===`-`||Number.isNaN(e)){this.nan=!0;return}let t=e;if(NL(t)&&(t=Number(t)),t=typeof t==`string`?t:FL(t),IL(t)){let e=ML(t);this.negative=e.negative;let n=e.trimStr.split(`.`);this.integer=BigInt(n[0]);let r=n[1]||`0`;this.decimal=BigInt(r),this.decimalLen=r.length}else this.nan=!0}getMark(){return this.negative?`-`:``}getIntegerStr(){return this.integer.toString()}getDecimalStr(){return this.decimal.toString().padStart(this.decimalLen,`0`)}alignDecimal(e){let t=`${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(e,`0`)}`;return BigInt(t)}negate(){let t=new e(this.toString());return t.negative=!t.negative,t}add(t){if(this.isInvalidate())return new e(t);let n=new e(t);if(n.isInvalidate())return this;let r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),{negativeStr:i,trimStr:a}=ML((this.alignDecimal(r)+n.alignDecimal(r)).toString()),o=`${i}${a.padStart(r+1,`0`)}`;return new e(`${o.slice(0,-r)}.${o.slice(-r)}`)}isEmpty(){return this.empty}isNaN(){return this.nan}isInvalidate(){return this.isEmpty()||this.isNaN()}equals(e){return this.toString()===e?.toString()}lessEquals(e){return this.add(e.negate().toString()).toNumber()<=0}toNumber(){return this.isNaN()?NaN:Number(this.toString())}toString(){return!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]?this.isInvalidate()?``:ML(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr:this.origin}};function BL(e){return jL()?new zL(e):new RL(e)}function VL(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(e===``)return``;let{negativeStr:i,integerStr:a,decimalStr:o}=ML(e),s=`${t}${o}`,c=`${i}${a}`;if(n>=0){let a=Number(o[n]);return a>=5&&!r?VL(BL(e).add(`${i}0.${`0`.repeat(n)}${10-a}`).toString(),t,n,r):n===0?c:`${c}${t}${o.padEnd(n,`0`).slice(0,n)}`}return s===`.0`?c:`${c}${s}`}var HL=200,UL=600,WL=u({compatConfig:{MODE:3},name:`StepHandler`,inheritAttrs:!1,props:{prefixCls:String,upDisabled:Boolean,downDisabled:Boolean,onStep:d()},slots:Object,setup(e,t){let{slots:n,emit:r}=t,i=H(),a=(e,t)=>{e.preventDefault(),r(`step`,t);function n(){r(`step`,t),i.value=setTimeout(n,HL)}i.value=setTimeout(n,UL)},o=()=>{clearTimeout(i.value)};return ut(()=>{o()}),()=>{if(vd())return null;let{prefixCls:t,upDisabled:r,downDisabled:i}=e,s=`${t}-handler`,c=K(s,`${s}-up`,{[`${s}-up-disabled`]:r}),l=K(s,`${s}-down`,{[`${s}-down-disabled`]:i}),u={unselectable:`on`,role:`button`,onMouseup:o,onMouseleave:o},{upNode:d,downNode:f}=n;return U(`div`,{class:`${s}-wrap`},[U(`span`,Y(Y({},u),{},{onMousedown:e=>{a(e,!0)},"aria-label":`Increase Value`,"aria-disabled":r,class:c}),[d?.()||U(`span`,{unselectable:`on`,class:`${t}-handler-up-inner`},null)]),U(`span`,Y(Y({},u),{},{onMousedown:e=>{a(e,!1)},"aria-label":`Decrease Value`,"aria-disabled":i,class:l}),[f?.()||U(`span`,{unselectable:`on`,class:`${t}-handler-down-inner`},null)])])}}});function GL(e,t){let n=H(null);function r(){try{let{selectionStart:t,selectionEnd:r,value:i}=e.value,a=i.substring(0,t),o=i.substring(r);n.value={start:t,end:r,value:i,beforeTxt:a,afterTxt:o}}catch{}}function i(){if(e.value&&n.value&&t.value)try{let{value:t}=e.value,{beforeTxt:r,afterTxt:i,start:a}=n.value,o=t.length;if(t.endsWith(i))o=t.length-n.value.afterTxt.length;else if(t.startsWith(r))o=r.length;else{let e=r[a-1],n=t.indexOf(e,a-1);n!==-1&&(o=n+1)}e.value.setSelectionRange(o,o)}catch(e){`${e.message}`}}return[r,i]}var KL=(()=>{let e=q(0),t=()=>{ir.cancel(e.value)};return ut(()=>{t()}),n=>{t(),e.value=ir(()=>{n()})}}),qL=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie||t.isEmpty()?t.toString():t.toNumber(),YL=e=>{let t=BL(e);return t.isInvalidate()?null:t},XL=()=>({stringMode:Q(),defaultValue:W([String,Number]),value:W([String,Number]),prefixCls:_(),min:W([String,Number]),max:W([String,Number]),step:W([String,Number],1),tabindex:Number,controls:Q(!0),readonly:Q(),disabled:Q(),autofocus:Q(),keyboard:Q(!0),parser:d(),formatter:d(),precision:Number,decimalSeparator:String,onInput:d(),onChange:d(),onPressEnter:d(),onStep:d(),onBlur:d(),onFocus:d()}),ZL=u({compatConfig:{MODE:3},name:`InnerInputNumber`,inheritAttrs:!1,props:Z(Z({},XL()),{lazy:Boolean}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i,expose:a}=t,o=q(),s=q(!1),c=q(!1),l=q(!1),u=q(BL(e.value));function d(t){e.value===void 0&&(u.value=t)}let f=(t,n)=>{if(!n)return e.precision>=0?e.precision:Math.max(PL(t),PL(e.step))},p=t=>{let n=String(t);if(e.parser)return e.parser(n);let r=n;return e.decimalSeparator&&(r=r.replace(e.decimalSeparator,`.`)),r.replace(/[^\w.-]+/g,``)},m=q(``),h=(t,n)=>{if(e.formatter)return e.formatter(t,{userTyping:n,input:String(m.value)});let r=typeof t==`number`?FL(t):t;if(!n){let t=f(r,n);if(IL(r)&&(e.decimalSeparator||t>=0)){let n=e.decimalSeparator||`.`;r=VL(r,n,t)}}return r};m.value=(()=>{let t=e.value;return u.value.isInvalidate()&&[`string`,`number`].includes(typeof t)?Number.isNaN(t)?``:t:h(u.value.toString(),!1)})();function g(e,t){m.value=h(e.isInvalidate()?e.toString(!1):e.toString(!t),t)}let _=J(()=>YL(e.max)),v=J(()=>YL(e.min)),y=J(()=>!_.value||!u.value||u.value.isInvalidate()?!1:_.value.lessEquals(u.value)),b=J(()=>!v.value||!u.value||u.value.isInvalidate()?!1:u.value.lessEquals(v.value)),[x,S]=GL(o,s),C=e=>_.value&&!e.lessEquals(_.value)?_.value:v.value&&!v.value.lessEquals(e)?v.value:null,w=e=>!C(e),T=(t,n)=>{var r;let i=t,a=w(i)||i.isEmpty();if(!i.isEmpty()&&!n&&(i=C(i)||i,a=!0),!e.readonly&&!e.disabled&&a){let t=i.toString(),a=f(t,n);return a>=0&&(i=BL(VL(t,`.`,a))),i.equals(u.value)||(d(i),(r=e.onChange)==null||r.call(e,i.isEmpty()?null:JL(e.stringMode,i)),e.value===void 0&&g(i,n)),i}return u.value},E=KL(),D=t=>{var n;if(x(),m.value=t,!l.value){let e=BL(p(t));e.isNaN()||T(e,!0)}(n=e.onInput)==null||n.call(e,t),E(()=>{let n=t;e.parser||(n=t.replace(/。/g,`.`)),n!==t&&D(n)})},O=()=>{l.value=!0},k=()=>{l.value=!1,D(o.value.value)},A=e=>{D(e.target.value)},j=t=>{var n,r;if(t&&y.value||!t&&b.value)return;c.value=!1;let i=BL(e.step);t||(i=i.negate());let a=(u.value||BL(0)).add(i.toString()),s=T(a,!1);(n=e.onStep)==null||n.call(e,JL(e.stringMode,s),{offset:e.step,type:t?`up`:`down`}),(r=o.value)==null||r.focus()},M=t=>{let n=BL(p(m.value)),r=n;r=n.isNaN()?u.value:T(n,t),e.value===void 0?r.isNaN()||g(r,!1):g(u.value,!1)},N=()=>{c.value=!0},P=t=>{var n;let{which:r}=t;c.value=!0,r===$.ENTER&&(l.value||(c.value=!1),M(!1),(n=e.onPressEnter)==null||n.call(e,t)),e.keyboard!==!1&&!l.value&&[$.UP,$.DOWN].includes(r)&&(j($.UP===r),t.preventDefault())},F=()=>{c.value=!1},I=e=>{M(!1),s.value=!1,c.value=!1,i(`blur`,e)};return G(()=>e.precision,()=>{u.value.isInvalidate()||g(u.value,!1)},{flush:`post`}),G(()=>e.value,()=>{let t=BL(e.value);u.value=t;let n=BL(p(m.value));(!t.equals(n)||!c.value||e.formatter)&&g(t,c.value)},{flush:`post`}),G(m,()=>{e.formatter&&S()},{flush:`post`}),G(()=>e.disabled,e=>{e&&(s.value=!1)}),a({focus:()=>{var e;(e=o.value)==null||e.focus()},blur:()=>{var e;(e=o.value)==null||e.blur()}}),()=>{let t=Z(Z({},n),e),{prefixCls:a=`rc-input-number`,min:c,max:l,step:d=1,defaultValue:f,value:p,disabled:h,readonly:g,keyboard:_,controls:v=!0,autofocus:x,stringMode:S,parser:C,formatter:T,precision:E,decimalSeparator:D,onChange:M,onInput:L,onPressEnter:ee,onStep:te,lazy:ne,class:R,style:re}=t,ie=qL(t,[`prefixCls`,`min`,`max`,`step`,`defaultValue`,`value`,`disabled`,`readonly`,`keyboard`,`controls`,`autofocus`,`stringMode`,`parser`,`formatter`,`precision`,`decimalSeparator`,`onChange`,`onInput`,`onPressEnter`,`onStep`,`lazy`,`class`,`style`]),{upHandler:ae,downHandler:oe}=r,z=`${a}-input`,se={};return ne?se.onChange=A:se.onInput=A,U(`div`,{class:K(a,R,{[`${a}-focused`]:s.value,[`${a}-disabled`]:h,[`${a}-readonly`]:g,[`${a}-not-a-number`]:u.value.isNaN(),[`${a}-out-of-range`]:!u.value.isInvalidate()&&!w(u.value)}),style:re,onKeydown:P,onKeyup:F},[v&&U(WL,{prefixCls:a,upDisabled:y.value,downDisabled:b.value,onStep:j},{upNode:ae,downNode:oe}),U(`div`,{class:`${z}-wrap`},[U(`input`,Y(Y(Y({autofocus:x,autocomplete:`off`,role:`spinbutton`,"aria-valuemin":c,"aria-valuemax":l,"aria-valuenow":u.value.isInvalidate()?null:u.value.toString(),step:d},ie),{},{ref:o,class:z,value:m.value,disabled:h,readonly:g,onFocus:e=>{s.value=!0,i(`focus`,e)}},se),{},{onBlur:I,onCompositionstart:O,onCompositionend:k,onBeforeinput:N}),null)])])}}});function QL(e){return e!=null}var $L=e=>{let{componentCls:t,lineWidth:n,lineType:r,colorBorder:i,borderRadius:a,fontSizeLG:s,controlHeightLG:c,controlHeightSM:l,colorError:u,inputPaddingHorizontalSM:d,colorTextDescription:f,motionDurationMid:p,colorPrimary:m,controlHeight:h,inputPaddingHorizontal:g,colorBgContainer:_,colorTextDisabled:v,borderRadiusSM:y,borderRadiusLG:b,controlWidth:x,handleVisible:S}=e;return[{[t]:Z(Z(Z(Z({},rn(e)),BT(e)),zT(e,t)),{display:`inline-block`,width:x,margin:0,padding:0,border:`${n}px ${r} ${i}`,borderRadius:a,"&-rtl":{direction:`rtl`,[`${t}-input`]:{direction:`rtl`}},"&-lg":{padding:0,fontSize:s,borderRadius:b,[`input${t}-input`]:{height:c-2*n}},"&-sm":{padding:0,borderRadius:y,[`input${t}-input`]:{height:l-2*n,padding:`0 ${d}px`}},"&:hover":Z({},PT(e)),"&-focused":Z({},FT(e)),"&-disabled":Z(Z({},IT(e)),{[`${t}-input`]:{cursor:`not-allowed`}}),"&-out-of-range":{input:{color:u}},"&-group":Z(Z(Z({},rn(e)),VT(e)),{"&-wrapper":{display:`inline-block`,textAlign:`start`,verticalAlign:`top`,[`${t}-affix-wrapper`]:{width:`100%`},"&-lg":{[`${t}-group-addon`]:{borderRadius:b}},"&-sm":{[`${t}-group-addon`]:{borderRadius:y}}}}),[t]:{"&-input":Z(Z({width:`100%`,height:h-2*n,padding:`0 ${g}px`,textAlign:`start`,backgroundColor:`transparent`,border:0,borderRadius:a,outline:0,transition:`all ${p} linear`,appearance:`textfield`,color:e.colorText,fontSize:`inherit`,verticalAlign:`top`},NT(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:`none`,appearance:`none`}})}})},{[t]:{[`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]:{opacity:1},[`${t}-handler-wrap`]:{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:`100%`,background:_,borderStartStartRadius:0,borderStartEndRadius:a,borderEndEndRadius:a,borderEndStartRadius:0,opacity:+(S===!0),display:`flex`,flexDirection:`column`,alignItems:`stretch`,transition:`opacity ${p} linear ${p}`,[`${t}-handler`]:{display:`flex`,alignItems:`center`,justifyContent:`center`,flex:`auto`,height:`40%`,[` + ${t}-handler-up-inner, + ${t}-handler-down-inner + `]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},[`${t}-handler`]:{height:`50%`,overflow:`hidden`,color:f,fontWeight:`bold`,lineHeight:0,textAlign:`center`,cursor:`pointer`,borderInlineStart:`${n}px ${r} ${i}`,transition:`all ${p} linear`,"&:active":{background:e.colorFillAlter},"&:hover":{height:`60%`,[` + ${t}-handler-up-inner, + ${t}-handler-down-inner + `]:{color:m}},"&-up-inner, &-down-inner":Z(Z({},o()),{color:f,transition:`all ${p} linear`,userSelect:`none`})},[`${t}-handler-up`]:{borderStartEndRadius:a},[`${t}-handler-down`]:{borderBlockStart:`${n}px ${r} ${i}`,borderEndEndRadius:a},"&-disabled, &-readonly":{[`${t}-handler-wrap`]:{display:`none`},[`${t}-input`]:{color:`inherit`}},[` + ${t}-handler-up-disabled, + ${t}-handler-down-disabled + `]:{cursor:`not-allowed`},[` + ${t}-handler-up-disabled:hover &-handler-up-inner, + ${t}-handler-down-disabled:hover &-handler-down-inner + `]:{color:v}}},{[`${t}-borderless`]:{borderColor:`transparent`,boxShadow:`none`,[`${t}-handler-down`]:{borderBlockStartWidth:0}}}]},eR=e=>{let{componentCls:t,inputPaddingHorizontal:n,inputAffixPadding:r,controlWidth:i,borderRadiusLG:a,borderRadiusSM:o}=e;return{[`${t}-affix-wrapper`]:Z(Z(Z({},BT(e)),zT(e,`${t}-affix-wrapper`)),{position:`relative`,display:`inline-flex`,width:i,padding:0,paddingInlineStart:n,"&-lg":{borderRadius:a},"&-sm":{borderRadius:o},[`&:not(${t}-affix-wrapper-disabled):hover`]:Z(Z({},PT(e)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${t}[disabled]`]:{background:`transparent`}},[`> div${t}`]:{width:`100%`,border:`none`,outline:`none`,[`&${t}-focused`]:{boxShadow:`none !important`}},[`input${t}-input`]:{padding:0},"&::before":{width:0,visibility:`hidden`,content:`"\\a0"`},[`${t}-handler-wrap`]:{zIndex:2},[t]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,pointerEvents:`none`},"&-prefix":{marginInlineEnd:r},"&-suffix":{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:`100%`,marginInlineEnd:n,marginInlineStart:r}}})}},tR=v(`InputNumber`,e=>{let t=qT(e);return[$L(t),eR(t),uv(t)]},e=>({controlWidth:90,handleWidth:e.controlHeightSM-e.lineWidth*2,handleFontSize:e.fontSize/2,handleVisible:`auto`})),nR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iWf(s.status,e.status)),{prefixCls:l,size:u,direction:d,disabled:f}=X(`input-number`,e),{compactSize:p,compactItemClassnames:m}=u_(l,d),h=at(),g=J(()=>f.value??h.value),[_,v]=tR(l),y=J(()=>p.value||u.value),b=q(e.value??e.defaultValue),x=q(!1);G(()=>e.value,()=>{b.value=e.value});let S=q(null),C=()=>{var e;(e=S.value)==null||e.focus()};r({focus:C,blur:()=>{var e;(e=S.value)==null||e.blur()}});let w=t=>{e.value===void 0&&(b.value=t),n(`update:value`,t),n(`change`,t),o.onFieldChange()},T=e=>{x.value=!1,n(`blur`,e),o.onFieldBlur()},E=e=>{x.value=!0,n(`focus`,e)};return()=>{let{hasFeedback:t,isFormItemInput:n,feedbackIcon:r}=s,u=e.id??o.id.value,f=Z(Z(Z({},i),e),{id:u,disabled:g.value}),{class:p,bordered:h,readonly:D,style:O,addonBefore:k=a.addonBefore?.call(a),addonAfter:A=a.addonAfter?.call(a),prefix:j=a.prefix?.call(a),valueModifiers:M={}}=f,N=nR(f,[`class`,`bordered`,`readonly`,`style`,`addonBefore`,`addonAfter`,`prefix`,`valueModifiers`]),P=l.value,F=K({[`${P}-lg`]:y.value===`large`,[`${P}-sm`]:y.value===`small`,[`${P}-rtl`]:d.value===`rtl`,[`${P}-readonly`]:D,[`${P}-borderless`]:!h,[`${P}-in-form-item`]:n},Uf(P,c.value),p,m.value,v.value),I=U(ZL,Y(Y({},Br(N,[`size`,`defaultValue`])),{},{ref:S,lazy:!!M.lazy,value:b.value,class:F,prefixCls:P,readonly:D,onChange:w,onBlur:T,onFocus:E}),{upHandler:a.upIcon?()=>U(`span`,{class:`${P}-handler-up-inner`},[a.upIcon()]):()=>U(AL,{class:`${P}-handler-up-inner`},null),downHandler:a.downIcon?()=>U(`span`,{class:`${P}-handler-down-inner`},[a.downIcon()]):()=>U(Cf,{class:`${P}-handler-down-inner`},null)}),L=QL(k)||QL(A),ee=QL(j);if((ee||t)&&(I=U(`div`,{class:K(`${P}-affix-wrapper`,Uf(`${P}-affix-wrapper`,c.value,t),{[`${P}-affix-wrapper-focused`]:x.value,[`${P}-affix-wrapper-disabled`]:g.value,[`${P}-affix-wrapper-sm`]:y.value===`small`,[`${P}-affix-wrapper-lg`]:y.value===`large`,[`${P}-affix-wrapper-rtl`]:d.value===`rtl`,[`${P}-affix-wrapper-readonly`]:D,[`${P}-affix-wrapper-borderless`]:!h,[`${p}`]:!L&&p},v.value),style:O,onClick:C},[ee&&U(`span`,{class:`${P}-prefix`},[j]),I,t&&U(`span`,{class:`${P}-suffix`},[r])])),L){let e=`${P}-group`,n=`${e}-addon`,r=k?U(`div`,{class:n},[k]):null,i=A?U(`div`,{class:n},[A]):null,a=K(`${P}-wrapper`,e,{[`${e}-rtl`]:d.value===`rtl`},v.value);I=U(`div`,{class:K(`${P}-group-wrapper`,{[`${P}-group-wrapper-sm`]:y.value===`small`,[`${P}-group-wrapper-lg`]:y.value===`large`,[`${P}-group-wrapper-rtl`]:d.value===`rtl`},Uf(`${l}-group-wrapper`,c.value,t),p,v.value),style:O},[U(`div`,{class:a},[r&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[r]})]}),I,i&&U(d_,null,{default:()=>[U(Hf,null,{default:()=>[i]})]})])])}return _(ao(I,{style:O}))}}}),aR=Z(iR,{install:e=>(e.component(iR.name,iR),e)}),oR=e=>{let{componentCls:t,colorBgContainer:n,colorBgBody:r,colorText:i}=e;return{[`${t}-sider-light`]:{background:n,[`${t}-sider-trigger`]:{color:i,background:n},[`${t}-sider-zero-width-trigger`]:{color:i,background:n,border:`1px solid ${r}`,borderInlineStart:0}}}},sR=e=>{let{antCls:t,componentCls:n,colorText:r,colorTextLightSolid:i,colorBgHeader:a,colorBgBody:o,colorBgTrigger:s,layoutHeaderHeight:c,layoutHeaderPaddingInline:l,layoutHeaderColor:u,layoutFooterPadding:d,layoutTriggerHeight:f,layoutZeroTriggerSize:p,motionDurationMid:m,motionDurationSlow:h,fontSize:g,borderRadius:_}=e;return{[n]:Z(Z({display:`flex`,flex:`auto`,flexDirection:`column`,color:r,minHeight:0,background:o,"&, *":{boxSizing:`border-box`},[`&${n}-has-sider`]:{flexDirection:`row`,[`> ${n}, > ${n}-content`]:{width:0}},[`${n}-header, &${n}-footer`]:{flex:`0 0 auto`},[`${n}-header`]:{height:c,paddingInline:l,color:u,lineHeight:`${c}px`,background:a,[`${t}-menu`]:{lineHeight:`inherit`}},[`${n}-footer`]:{padding:d,color:r,fontSize:g,background:o},[`${n}-content`]:{flex:`auto`,minHeight:0},[`${n}-sider`]:{position:`relative`,minWidth:0,background:a,transition:`all ${m}, background 0s`,"&-children":{height:`100%`,marginTop:-.1,paddingTop:.1,[`${t}-menu${t}-menu-inline-collapsed`]:{width:`auto`}},"&-has-trigger":{paddingBottom:f},"&-right":{order:1},"&-trigger":{position:`fixed`,bottom:0,zIndex:1,height:f,color:i,lineHeight:`${f}px`,textAlign:`center`,background:s,cursor:`pointer`,transition:`all ${m}`},"&-zero-width":{"> *":{overflow:`hidden`},"&-trigger":{position:`absolute`,top:c,insetInlineEnd:-p,zIndex:1,width:p,height:p,color:i,fontSize:e.fontSizeXL,display:`flex`,alignItems:`center`,justifyContent:`center`,background:a,borderStartStartRadius:0,borderStartEndRadius:_,borderEndEndRadius:_,borderEndStartRadius:0,cursor:`pointer`,transition:`background ${h} ease`,"&::after":{position:`absolute`,inset:0,background:`transparent`,transition:`all ${h}`,content:`""`},"&:hover::after":{background:`rgba(255, 255, 255, 0.2)`},"&-right":{insetInlineStart:-p,borderStartStartRadius:_,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:_}}}}},oR(e)),{"&-rtl":{direction:`rtl`}})}},cR=v(`Layout`,e=>{let{colorText:t,controlHeightSM:n,controlHeight:r,controlHeightLG:i,marginXXS:a}=e,o=i*1.25;return[sR(B(e,{layoutHeaderHeight:r*2,layoutHeaderPaddingInline:o,layoutHeaderColor:t,layoutFooterPadding:`${n}px ${o}px`,layoutTriggerHeight:i+a*2,layoutZeroTriggerSize:i}))]},e=>{let{colorBgLayout:t}=e;return{colorBgHeader:`#001529`,colorBgBody:t,colorBgTrigger:`#002140`}}),lR=()=>({prefixCls:String,hasSider:{type:Boolean,default:void 0},tagName:String});function uR(e){let{suffixCls:t,tagName:n,name:r}=e;return e=>u({compatConfig:{MODE:3},name:r,props:lR(),setup(r,i){let{slots:a}=i,{prefixCls:o}=X(t,r);return()=>U(e,Z(Z({},r),{prefixCls:o.value,tagName:n}),a)}})}var dR=u({compatConfig:{MODE:3},props:lR(),setup(e,t){let{slots:n}=t;return()=>U(e.tagName,{class:e.prefixCls},n)}}),fR=u({compatConfig:{MODE:3},inheritAttrs:!1,props:lR(),setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(``,e),[o,s]=cR(i),c=H([]);fe(Ix,{addSider:e=>{c.value=[...c.value,e]},removeSider:e=>{c.value=c.value.filter(t=>t!==e)}});let l=J(()=>{let{prefixCls:t,hasSider:n}=e;return{[s.value]:!0,[`${t}`]:!0,[`${t}-has-sider`]:typeof n==`boolean`?n:c.value.length>0,[`${t}-rtl`]:a.value===`rtl`}});return()=>{let{tagName:t}=e;return o(U(t,Z(Z({},r),{class:[l.value,r.class]}),n))}}}),pR=uR({suffixCls:`layout`,tagName:`section`,name:`ALayout`})(fR),mR=uR({suffixCls:`layout-header`,tagName:`header`,name:`ALayoutHeader`})(dR),hR=uR({suffixCls:`layout-footer`,tagName:`footer`,name:`ALayoutFooter`})(dR),gR=uR({suffixCls:`layout-content`,tagName:`main`,name:`ALayoutContent`})(dR),_R={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z`}}]},name:`bars`,theme:`outlined`};function vR(e){for(var t=1;t({prefixCls:String,collapsible:{type:Boolean,default:void 0},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean,default:void 0},reverseArrow:{type:Boolean,default:void 0},zeroWidthTriggerStyle:{type:Object,default:void 0},trigger:f.any,width:f.oneOfType([f.number,f.string]),collapsedWidth:f.oneOfType([f.number,f.string]),breakpoint:f.oneOf(m(`xs`,`sm`,`md`,`lg`,`xl`,`xxl`,`xxxl`)),theme:f.oneOf(m(`light`,`dark`)).def(`dark`),onBreakpoint:Function,onCollapse:Function}),CR=(()=>{let e=0;return function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return e+=1,`${t}${e}`}})(),wR=u({compatConfig:{MODE:3},name:`ALayoutSider`,inheritAttrs:!1,props:Zn(SR(),{collapsible:!1,defaultCollapsed:!1,reverseArrow:!1,width:200,collapsedWidth:80}),emits:[`breakpoint`,`update:collapsed`,`collapse`],setup(e,t){let{emit:n,attrs:r,slots:i}=t,{prefixCls:a}=X(`layout-sider`,e),o=g(Ix,void 0),s=q(!!(e.collapsed===void 0?e.defaultCollapsed:e.collapsed)),c=q(!1);G(()=>e.collapsed,()=>{s.value=!!e.collapsed}),fe(Fx,s);let l=(t,r)=>{e.collapsed===void 0&&(s.value=t),n(`update:collapsed`,t),n(`collapse`,t,r)},u=q(e=>{c.value=e.matches,n(`breakpoint`,e.matches),s.value!==e.matches&&l(e.matches,`responsive`)}),d;function f(e){return u.value(e)}let p=CR(`ant-sider-`);o&&o.addSider(p),V(()=>{G(()=>e.breakpoint,()=>{try{d?.removeEventListener(`change`,f)}catch{d?.removeListener(f)}if(typeof window<`u`){let{matchMedia:t}=window;if(t&&e.breakpoint&&e.breakpoint in xR){d=t(`(max-width: ${xR[e.breakpoint]})`);try{d.addEventListener(`change`,f)}catch{d.addListener(f)}f(d)}}},{immediate:!0})}),ut(()=>{try{d?.removeEventListener(`change`,f)}catch{d?.removeListener(f)}o&&o.removeSider(p)});let m=()=>{l(!s.value,`clickTrigger`)};return()=>{let t=a.value,{collapsedWidth:n,width:o,reverseArrow:l,zeroWidthTriggerStyle:u,trigger:d=i.trigger?.call(i),collapsible:f,theme:p}=e,h=s.value?n:o,g=Jy(h)?`${h}px`:String(h),_=parseFloat(String(n||0))===0?U(`span`,{onClick:m,class:K(`${t}-zero-width-trigger`,`${t}-zero-width-trigger-${l?`right`:`left`}`),style:u},[d||U(bR,null,null)]):null,v={expanded:U(l?gx:wA,null,null),collapsed:U(l?wA:gx,null,null)}[s.value?`collapsed`:`expanded`],y=d===null?null:_||U(`div`,{class:`${t}-trigger`,onClick:m,style:{width:g}},[d||v]),b=[r.style,{flex:`0 0 ${g}`,maxWidth:g,minWidth:g,width:g}],x=K(t,`${t}-${p}`,{[`${t}-collapsed`]:!!s.value,[`${t}-has-trigger`]:f&&d!==null&&!_,[`${t}-below`]:!!c.value,[`${t}-zero-width`]:parseFloat(g)===0},r.class);return U(`aside`,Y(Y({},r),{},{class:x,style:b}),[U(`div`,{class:`${t}-children`},[i.default?.call(i)]),f||c.value&&_?y:null])}}}),TR=mR,ER=hR,DR=wR,OR=gR,kR=Z(pR,{Header:mR,Footer:hR,Content:gR,Sider:wR,install:e=>(e.component(pR.name,pR),e.component(mR.name,mR),e.component(hR.name,hR),e.component(wR.name,wR),e.component(gR.name,gR),e)});function AR(e,t,n){var r=n||{},i=r.noTrailing,a=i!==void 0&&i,o=r.noLeading,s=o!==void 0&&o,c=r.debounceMode,l=c===void 0?void 0:c,u,d=!1,f=0;function p(){u&&clearTimeout(u)}function m(e){var t=(e||{}).upcomingOnly,n=t!==void 0&&t;p(),d=!n}function h(){var n=[...arguments],r=this,i=Date.now()-f;if(d)return;function o(){f=Date.now(),t.apply(r,n)}function c(){u=void 0}!s&&l&&!u&&o(),p(),l===void 0&&i>e?s?(f=Date.now(),a||(u=setTimeout(l?c:o,e))):o():a!==!0&&(u=setTimeout(l?c:o,l===void 0?e-i:e))}return h.cancel=m,h}function jR(e,t,n){var r=(n||{}).atBegin;return AR(e,t,{debounceMode:(r!==void 0&&r)!==!1})}var MR=new N(`antSpinMove`,{to:{opacity:1}}),NR=new N(`antRotate`,{to:{transform:`rotate(405deg)`}}),PR=e=>({[`${e.componentCls}`]:Z(Z({},rn(e)),{position:`absolute`,display:`none`,color:e.colorPrimary,textAlign:`center`,verticalAlign:`middle`,opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:`static`,display:`inline-block`,opacity:1},"&-nested-loading":{position:`relative`,[`> div > ${e.componentCls}`]:{position:`absolute`,top:0,insetInlineStart:0,zIndex:4,display:`block`,width:`100%`,height:`100%`,maxHeight:e.contentHeight,[`${e.componentCls}-dot`]:{position:`absolute`,top:`50%`,insetInlineStart:`50%`,margin:-e.spinDotSize/2},[`${e.componentCls}-text`]:{position:`absolute`,top:`50%`,width:`100%`,paddingTop:(e.spinDotSize-e.fontSize)/2+2,textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSize/2)-10},"&-sm":{[`${e.componentCls}-dot`]:{margin:-e.spinDotSizeSM/2},[`${e.componentCls}-text`]:{paddingTop:(e.spinDotSizeSM-e.fontSize)/2+2},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSizeSM/2)-10}},"&-lg":{[`${e.componentCls}-dot`]:{margin:-(e.spinDotSizeLG/2)},[`${e.componentCls}-text`]:{paddingTop:(e.spinDotSizeLG-e.fontSize)/2+2},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSizeLG/2)-10}}},[`${e.componentCls}-container`]:{position:`relative`,transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:`100%`,height:`100%`,background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:`""`,pointerEvents:`none`}},[`${e.componentCls}-blur`]:{clear:`both`,opacity:.5,userSelect:`none`,pointerEvents:`none`,"&::after":{opacity:.4,pointerEvents:`auto`}}},"&-tip":{color:e.spinDotDefault},[`${e.componentCls}-dot`]:{position:`relative`,display:`inline-block`,fontSize:e.spinDotSize,width:`1em`,height:`1em`,"&-item":{position:`absolute`,display:`block`,width:(e.spinDotSize-e.marginXXS/2)/2,height:(e.spinDotSize-e.marginXXS/2)/2,backgroundColor:e.colorPrimary,borderRadius:`100%`,transform:`scale(0.75)`,transformOrigin:`50% 50%`,opacity:.3,animationName:MR,animationDuration:`1s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`,animationDirection:`alternate`,"&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:`0.4s`},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:`0.8s`},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:`1.2s`}},"&-spin":{transform:`rotate(45deg)`,animationName:NR,animationDuration:`1.2s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`}},[`&-sm ${e.componentCls}-dot`]:{fontSize:e.spinDotSizeSM,i:{width:(e.spinDotSizeSM-e.marginXXS/2)/2,height:(e.spinDotSizeSM-e.marginXXS/2)/2}},[`&-lg ${e.componentCls}-dot`]:{fontSize:e.spinDotSizeLG,i:{width:(e.spinDotSizeLG-e.marginXXS)/2,height:(e.spinDotSizeLG-e.marginXXS)/2}},[`&${e.componentCls}-show-text ${e.componentCls}-text`]:{display:`block`}})}),FR=v(`Spin`,e=>[PR(B(e,{spinDotDefault:e.colorTextDescription,spinDotSize:e.controlHeightLG/2,spinDotSizeSM:e.controlHeightLG*.35,spinDotSizeLG:e.controlHeight}))],{contentHeight:400}),IR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i({prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:f.any,delay:Number,indicator:f.any}),RR=null;function zR(e,t){return!!e&&!!t&&!isNaN(Number(t))}function BR(e){let t=e.indicator;RR=typeof t==`function`?t:()=>U(t,null,null)}var VR=u({compatConfig:{MODE:3},name:`ASpin`,inheritAttrs:!1,props:Zn(LR(),{size:`default`,spinning:!0,wrapperClassName:``}),setup(e,t){let{attrs:n,slots:r}=t,{prefixCls:i,size:a,direction:o}=X(`spin`,e),[s,c]=FR(i),l=q(e.spinning&&!zR(e.spinning,e.delay)),u;return G([()=>e.spinning,()=>e.delay],()=>{u?.cancel(),u=jR(e.delay,()=>{l.value=e.spinning}),u?.()},{immediate:!0,flush:`post`}),ut(()=>{u?.cancel()}),()=>{let{class:t}=n,u=IR(n,[`class`]),{tip:d=r.tip?.call(r)}=e,f=r.default?.call(r),m={[c.value]:!0,[i.value]:!0,[`${i.value}-sm`]:a.value===`small`,[`${i.value}-lg`]:a.value===`large`,[`${i.value}-spinning`]:l.value,[`${i.value}-show-text`]:!!d,[`${i.value}-rtl`]:o.value===`rtl`,[t]:!!t};function h(t){let n=`${t}-dot`,i=on(r,e,`indicator`);return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),p(i)?it(i,{class:n}):RR&&p(RR())?it(RR(),{class:n}):U(`span`,{class:`${n} ${t}-dot-spin`},[U(`i`,{class:`${t}-dot-item`},null),U(`i`,{class:`${t}-dot-item`},null),U(`i`,{class:`${t}-dot-item`},null),U(`i`,{class:`${t}-dot-item`},null)]))}let g=U(`div`,Y(Y({},u),{},{class:m,"aria-live":`polite`,"aria-busy":l.value}),[h(i.value),d?U(`div`,{class:`${i.value}-text`},[d]):null]);if(f&&dt(f).length){let t={[`${i.value}-container`]:!0,[`${i.value}-blur`]:l.value};return s(U(`div`,{class:[`${i.value}-nested-loading`,e.wrapperClassName,c.value]},[l.value&&U(`div`,{key:`loading`},[g]),U(`div`,{class:t,key:`container`},[f])]))}return s(g)}}});VR.setDefaultIndicator=BR,VR.install=function(e){return e.component(VR.name,VR),e};var HR=VR,UR={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z`}}]},name:`double-left`,theme:`outlined`};function WR(e){for(var t=1;tU(yv,Z(Z(Z({},e),{size:`small`}),n),r)}}),QR=u({name:`MiddleSelect`,inheritAttrs:!1,props:_v(),Option:yv.Option,setup(e,t){let{attrs:n,slots:r}=t;return()=>U(yv,Z(Z(Z({},e),{size:`middle`}),n),r)}}),$R=u({compatConfig:{MODE:3},name:`Pager`,inheritAttrs:!1,props:{rootPrefixCls:String,page:Number,active:{type:Boolean,default:void 0},last:{type:Boolean,default:void 0},locale:f.object,showTitle:{type:Boolean,default:void 0},itemRender:{type:Function,default:()=>{}},onClick:{type:Function},onKeypress:{type:Function}},eimt:[`click`,`keypress`],setup(e,t){let{emit:n,attrs:r}=t,i=()=>{n(`click`,e.page)},a=t=>{n(`keypress`,t,i,e.page)};return()=>{let{showTitle:t,page:n,itemRender:o}=e,{class:s,style:c}=r,l=`${e.rootPrefixCls}-item`,u=K(l,`${l}-${e.page}`,{[`${l}-active`]:e.active,[`${l}-disabled`]:!e.page},s);return U(`li`,{onClick:i,onKeypress:a,title:t?String(n):null,tabindex:`0`,class:u,style:c},[o({page:n,type:`page`,originalElement:U(`a`,{rel:`nofollow`},[n])})])}}}),ez={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},tz=u({compatConfig:{MODE:3},props:{disabled:{type:Boolean,default:void 0},changeSize:Function,quickGo:Function,selectComponentClass:f.any,current:Number,pageSizeOptions:f.array.def([`10`,`20`,`50`,`100`]),pageSize:Number,buildOptionText:Function,locale:f.object,rootPrefixCls:String,selectPrefixCls:String,goButton:f.any},setup(e){let t=H(``),n=J(()=>!t.value||isNaN(t.value)?void 0:Number(t.value)),r=t=>`${t.value} ${e.locale.items_per_page}`,i=e=>{let{value:n}=e.target;t.value!==n&&(t.value=n)},a=r=>{let{goButton:i,quickGo:a,rootPrefixCls:o}=e;if(!(i||t.value===``))if(r.relatedTarget&&(r.relatedTarget.className.indexOf(`${o}-item-link`)>=0||r.relatedTarget.className.indexOf(`${o}-item`)>=0)){t.value=``;return}else a(n.value),t.value=``},o=r=>{t.value!==``&&(r.keyCode===ez.ENTER||r.type===`click`)&&(e.quickGo(n.value),t.value=``)},s=J(()=>{let{pageSize:t,pageSizeOptions:n}=e;return n.some(e=>e.toString()===t.toString())?n:n.concat([t.toString()]).sort((e,t)=>(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t)))});return()=>{let{rootPrefixCls:n,locale:c,changeSize:l,quickGo:u,goButton:d,selectComponentClass:f,selectPrefixCls:p,pageSize:m,disabled:h}=e,g=`${n}-options`,_=null,v=null,y=null;if(!l&&!u)return null;if(l&&f){let t=e.buildOptionText||r,n=s.value.map((e,n)=>U(f.Option,{key:n,value:e},{default:()=>[t({value:e})]}));_=U(f,{disabled:h,prefixCls:p,showSearch:!1,class:`${g}-size-changer`,optionLabelProp:`children`,value:(m||s.value[0]).toString(),onChange:e=>l(Number(e)),getPopupContainer:e=>e.parentNode},{default:()=>[n]})}return u&&(d&&(y=typeof d==`boolean`?U(`button`,{type:`button`,onClick:o,onKeyup:o,disabled:h,class:`${g}-quick-jumper-button`},[c.jump_to_confirm]):U(`span`,{onClick:o,onKeyup:o},[d])),v=U(`div`,{class:`${g}-quick-jumper`},[c.jump_to,U(Pu,{disabled:h,type:`text`,value:t.value,onInput:i,onChange:i,onKeyup:o,onBlur:a},null),c.page,y])),U(`li`,{class:`${g}`},[_,v])}}}),nz={items_per_page:`条/页`,jump_to:`跳至`,jump_to_confirm:`确定`,page:`页`,prev_page:`上一页`,next_page:`下一页`,prev_5:`向前 5 页`,next_5:`向后 5 页`,prev_3:`向前 3 页`,next_3:`向后 3 页`},rz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ir?r:n,E(this,`current`)||(t.stateCurrent=n,t.stateCurrentInputValue=n),t.statePageSize=e,this.setState(t)},stateCurrent(e,t){this.$nextTick(()=>{if(this.$refs.paginationNode){let e=this.$refs.paginationNode.querySelector(`.${this.prefixCls}-item-${t}`);e&&document.activeElement===e&&e.blur()}})},total(){let e={},t=oz(this.pageSize,this.$data,this.$props);if(E(this,`current`)){let n=Math.min(this.current,t);e.stateCurrent=n,e.stateCurrentInputValue=n}else{let n=this.stateCurrent;n=n===0&&t>0?1:Math.min(this.stateCurrent,t),e.stateCurrent=n}this.setState(e)}},methods:{getJumpPrevPage(){return Math.max(1,this.stateCurrent-(this.showLessItems?3:5))},getJumpNextPage(){return Math.min(oz(void 0,this.$data,this.$props),this.stateCurrent+(this.showLessItems?3:5))},getItemIcon(e,t){let{prefixCls:n}=this.$props;return k(this,e,this.$props)||U(`button`,{type:`button`,"aria-label":t,class:`${n}-item-link`},null)},getValidValue(e){let t=e.target.value,n=oz(void 0,this.$data,this.$props),{stateCurrentInputValue:r}=this.$data,i;return i=t===``?t:isNaN(Number(t))?r:t>=n?n:Number(t),i},isValid(e){return iz(e)&&e!==this.stateCurrent},shouldDisplayQuickJumper(){let{showQuickJumper:e,pageSize:t,total:n}=this.$props;return n<=t?!1:e},handleKeyDown(e){(e.keyCode===ez.ARROW_UP||e.keyCode===ez.ARROW_DOWN)&&e.preventDefault()},handleKeyUp(e){let t=this.getValidValue(e);t!==this.stateCurrentInputValue&&this.setState({stateCurrentInputValue:t}),e.keyCode===ez.ENTER?this.handleChange(t):e.keyCode===ez.ARROW_UP?this.handleChange(t-1):e.keyCode===ez.ARROW_DOWN&&this.handleChange(t+1)},changePageSize(e){let t=this.stateCurrent,n=t,r=oz(e,this.$data,this.$props);t=t>r?r:t,r===0&&(t=this.stateCurrent),typeof e==`number`&&(E(this,`pageSize`)||this.setState({statePageSize:e}),E(this,`current`)||this.setState({stateCurrent:t,stateCurrentInputValue:t})),this.__emit(`update:pageSize`,e),t!==n&&this.__emit(`update:current`,t),this.__emit(`showSizeChange`,t,e),this.__emit(`change`,t,e)},handleChange(e){let{disabled:t}=this.$props,n=e;if(this.isValid(n)&&!t){let e=oz(void 0,this.$data,this.$props);return n>e?n=e:n<1&&(n=1),E(this,`current`)||this.setState({stateCurrent:n,stateCurrentInputValue:n}),this.__emit(`update:current`,n),this.__emit(`change`,n,this.statePageSize),n}return this.stateCurrent},prev(){this.hasPrev()&&this.handleChange(this.stateCurrent-1)},next(){this.hasNext()&&this.handleChange(this.stateCurrent+1)},jumpPrev(){this.handleChange(this.getJumpPrevPage())},jumpNext(){this.handleChange(this.getJumpNextPage())},hasPrev(){return this.stateCurrent>1},hasNext(){return this.stateCurrentn:e},runIfEnter(e,t){(e.key===`Enter`||e.charCode===13)&&(e.preventDefault(),t(...[...arguments].slice(2)))},runIfEnterPrev(e){this.runIfEnter(e,this.prev)},runIfEnterNext(e){this.runIfEnter(e,this.next)},runIfEnterJumpPrev(e){this.runIfEnter(e,this.jumpPrev)},runIfEnterJumpNext(e){this.runIfEnter(e,this.jumpNext)},handleGoTO(e){(e.keyCode===ez.ENTER||e.type===`click`)&&this.handleChange(this.stateCurrentInputValue)},renderPrev(e){let{itemRender:t}=this.$props,n=t({page:e,type:`prev`,originalElement:this.getItemIcon(`prevIcon`,`prev page`)}),r=!this.hasPrev();return Nt(n)?ao(n,r?{disabled:r}:{}):n},renderNext(e){let{itemRender:t}=this.$props,n=t({page:e,type:`next`,originalElement:this.getItemIcon(`nextIcon`,`next page`)}),r=!this.hasNext();return Nt(n)?ao(n,r?{disabled:r}:{}):n}},render(){let{prefixCls:e,disabled:t,hideOnSinglePage:n,total:r,locale:i,showQuickJumper:a,showLessItems:o,showTitle:s,showTotal:c,simple:l,itemRender:u,showPrevNextJumpers:d,jumpPrevIcon:f,jumpNextIcon:p,selectComponentClass:m,selectPrefixCls:h,pageSizeOptions:g}=this.$props,{stateCurrent:_,statePageSize:v}=this,y=je(this.$attrs).extraAttrs,{class:b}=y,x=rz(y,[`class`]);if(n===!0&&this.total<=v)return null;let S=oz(void 0,this.$data,this.$props),C=[],w=null,T=null,E=null,D=null,O=null,k=a&&a.goButton,A=o?1:2,j=_-1>0?_-1:0,M=_+1=A*2&&_!==3&&(C[0]=U($R,{locale:i,rootPrefixCls:e,onClick:this.handleChange,onKeypress:this.runIfEnter,key:r,page:r,class:`${e}-item-after-jump-prev`,active:!1,showTitle:this.showTitle,itemRender:u},null),C.unshift(w)),S-_>=A*2&&_!==S-2&&(C[C.length-1]=U($R,{locale:i,rootPrefixCls:e,onClick:this.handleChange,onKeypress:this.runIfEnter,key:a,page:a,class:`${e}-item-before-jump-next`,active:!1,showTitle:this.showTitle,itemRender:u},null),C.push(T)),r!==1&&C.unshift(E),a!==S&&C.push(D)}let F=null;c&&(F=U(`li`,{class:`${e}-total-text`},[c(r,[r===0?0:(_-1)*v+1,_*v>r?r:_*v])]));let I=!N||!S,L=!P||!S,ee=this.buildOptionText||this.$slots.buildOptionText;return U(`ul`,Y(Y({unselectable:`on`,ref:`paginationNode`},x),{},{class:K({[`${e}`]:!0,[`${e}-disabled`]:t},b)}),[F,U(`li`,{title:s?i.prev_page:null,onClick:this.prev,tabindex:I?null:0,onKeypress:this.runIfEnterPrev,class:K(`${e}-prev`,{[`${e}-disabled`]:I}),"aria-disabled":I},[this.renderPrev(j)]),C,U(`li`,{title:s?i.next_page:null,onClick:this.next,tabindex:L?null:0,onKeypress:this.runIfEnterNext,class:K(`${e}-next`,{[`${e}-disabled`]:L}),"aria-disabled":L},[this.renderNext(M)]),U(tz,{disabled:t,locale:i,rootPrefixCls:e,selectComponentClass:m,selectPrefixCls:h,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:_,pageSize:v,pageSizeOptions:g,buildOptionText:ee||null,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:k},null)])}}),cz=e=>{let{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:`not-allowed`,[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:`not-allowed`}},"&:focus-visible":{cursor:`not-allowed`,[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:`not-allowed`}}},[`&${t}-disabled`]:{cursor:`not-allowed`,[`&${t}-mini`]:{[` + &:hover ${t}-item:not(${t}-item-active), + &:active ${t}-item:not(${t}-item-active), + &:hover ${t}-item-link, + &:active ${t}-item-link + `]:{backgroundColor:`transparent`}},[`${t}-item`]:{cursor:`not-allowed`,"&:hover, &:active":{backgroundColor:`transparent`},a:{color:e.colorTextDisabled,backgroundColor:`transparent`,border:`none`,cursor:`not-allowed`},"&-active":{borderColor:e.colorBorder,backgroundColor:e.paginationItemDisabledBgActive,"&:hover, &:active":{backgroundColor:e.paginationItemDisabledBgActive},a:{color:e.paginationItemDisabledColorActive}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:`not-allowed`,"&:hover, &:active":{backgroundColor:`transparent`},[`${t}-simple&`]:{backgroundColor:`transparent`,"&:hover, &:active":{backgroundColor:`transparent`}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}},[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{[`&${t}-disabled ${t}-item-link`]:{"&:hover, &:active":{backgroundColor:`transparent`}}}}}},lz=e=>{let{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`},[`&${t}-mini ${t}-item`]:{minWidth:e.paginationItemSizeSM,height:e.paginationItemSizeSM,margin:0,lineHeight:`${e.paginationItemSizeSM-2}px`},[`&${t}-mini ${t}-item:not(${t}-item-active)`]:{backgroundColor:`transparent`,borderColor:`transparent`,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.paginationItemSizeSM,height:e.paginationItemSizeSM,margin:0,lineHeight:`${e.paginationItemSizeSM}px`,[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:`transparent`}},[` + &${t}-mini ${t}-prev ${t}-item-link, + &${t}-mini ${t}-next ${t}-item-link + `]:{backgroundColor:`transparent`,borderColor:`transparent`,"&::after":{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.paginationItemSizeSM,marginInlineEnd:0,lineHeight:`${e.paginationItemSizeSM}px`},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.paginationMiniOptionsSizeChangerTop},"&-quick-jumper":{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`,input:Z(Z({},RT(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},uz=e=>{let{componentCls:t}=e;return{[` + &${t}-simple ${t}-prev, + &${t}-simple ${t}-next + `]:{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`,verticalAlign:`top`,[`${t}-item-link`]:{height:e.paginationItemSizeSM,backgroundColor:`transparent`,border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.paginationItemSizeSM,lineHeight:`${e.paginationItemSizeSM}px`}}},[`&${t}-simple ${t}-simple-pager`]:{display:`inline-block`,height:e.paginationItemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:`border-box`,height:`100%`,marginInlineEnd:e.marginXS,padding:`0 ${e.paginationItemPaddingInline}px`,textAlign:`center`,backgroundColor:e.paginationItemInputBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:`none`,transition:`border-color ${e.motionDurationMid}`,color:`inherit`,"&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${e.inputOutlineOffset}px 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:`not-allowed`}}}}},dz=e=>{let{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:`relative`,[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:`auto`}},[`${t}-item-ellipsis`]:{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:`block`,margin:`auto`,color:e.colorTextDisabled,fontFamily:`Arial, Helvetica, sans-serif`,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:`center`,textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},"&:focus-visible":Z({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},I(e))},[` + ${t}-prev, + ${t}-jump-prev, + ${t}-jump-next + `]:{marginInlineEnd:e.marginXS},[` + ${t}-prev, + ${t}-next, + ${t}-jump-prev, + ${t}-jump-next + `]:{display:`inline-block`,minWidth:e.paginationItemSize,height:e.paginationItemSize,color:e.colorText,fontFamily:e.paginationFontFamily,lineHeight:`${e.paginationItemSize}px`,textAlign:`center`,verticalAlign:`middle`,listStyle:`none`,borderRadius:e.borderRadius,cursor:`pointer`,transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{fontFamily:`Arial, Helvetica, sans-serif`,outline:0,button:{color:e.colorText,cursor:`pointer`,userSelect:`none`},[`${t}-item-link`]:{display:`block`,width:`100%`,height:`100%`,padding:0,fontSize:e.fontSizeSM,textAlign:`center`,backgroundColor:`transparent`,border:`${e.lineWidth}px ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:`none`,transition:`all ${e.motionDurationMid}`},[`&:focus-visible ${t}-item-link`]:Z({},I(e)),[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:`transparent`}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:`inline-block`,marginInlineStart:e.margin,verticalAlign:`middle`,"&-size-changer.-select":{display:`inline-block`,width:`auto`},"&-quick-jumper":{display:`inline-block`,height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:`${e.controlHeight}px`,verticalAlign:`top`,input:Z(Z({},BT(e)),{width:e.controlHeightLG*1.25,height:e.controlHeight,boxSizing:`border-box`,margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},fz=e=>{let{componentCls:t}=e;return{[`${t}-item`]:Z(Z({display:`inline-block`,minWidth:e.paginationItemSize,height:e.paginationItemSize,marginInlineEnd:e.marginXS,fontFamily:e.paginationFontFamily,lineHeight:`${e.paginationItemSize-2}px`,textAlign:`center`,verticalAlign:`middle`,listStyle:`none`,backgroundColor:`transparent`,border:`${e.lineWidth}px ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:`pointer`,userSelect:`none`,a:{display:`block`,padding:`0 ${e.paginationItemPaddingInline}px`,color:e.colorText,transition:`none`,"&:hover":{textDecoration:`none`}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}}},de(e)),{"&-active":{fontWeight:e.paginationFontWeightActive,backgroundColor:e.paginationItemBgActive,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}})}},pz=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z(Z(Z(Z({},rn(e)),{"ul, ol":{margin:0,padding:0,listStyle:`none`},"&::after":{display:`block`,clear:`both`,height:0,overflow:`hidden`,visibility:`hidden`,content:`""`},[`${t}-total-text`]:{display:`inline-block`,height:e.paginationItemSize,marginInlineEnd:e.marginXS,lineHeight:`${e.paginationItemSize-2}px`,verticalAlign:`middle`}}),fz(e)),dz(e)),uz(e)),lz(e)),cz(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:`none`}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:`none`}}}),[`&${e.componentCls}-rtl`]:{direction:`rtl`}}},mz=e=>{let{componentCls:t}=e;return{[`${t}${t}-disabled`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.paginationItemDisabledBgActive}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[t]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.paginationItemBg},[`${t}-item-link`]:{backgroundColor:e.paginationItemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.paginationItemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.paginationItemBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.paginationItemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}},hz=v(`Pagination`,e=>{let t=B(e,{paginationItemSize:e.controlHeight,paginationFontFamily:e.fontFamily,paginationItemBg:e.colorBgContainer,paginationItemBgActive:e.colorBgContainer,paginationFontWeightActive:e.fontWeightStrong,paginationItemSizeSM:e.controlHeightSM,paginationItemInputBg:e.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:e.controlItemBgActiveDisabled,paginationItemDisabledColorActive:e.colorTextDisabled,paginationItemLinkBg:e.colorBgContainer,inputOutlineOffset:`0 0`,paginationMiniOptionsMarginInlineStart:e.marginXXS/2,paginationMiniQuickJumperInputWidth:e.controlHeightLG*1.1,paginationItemPaddingInline:e.marginXXS*1.5,paginationEllipsisLetterSpacing:e.marginXXS/2,paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:`0.13em`},qT(e));return[pz(t),e.wireframe&&mz(t)]}),gz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ia.getPrefixCls(`select`,e.selectPrefixCls)),d=Uv(),[f]=Kt(`Pagination`,yt,St(e,`locale`)),p=e=>{let t=U(`span`,{class:`${e}-item-ellipsis`},[en(`•••`)]);return{prevIcon:U(`button`,{class:`${e}-item-link`,type:`button`,tabindex:-1},[o.value===`rtl`?U(gx,null,null):U(wA,null,null)]),nextIcon:U(`button`,{class:`${e}-item-link`,type:`button`,tabindex:-1},[o.value===`rtl`?U(wA,null,null):U(gx,null,null)]),jumpPrevIcon:U(`a`,{rel:`nofollow`,class:`${e}-item-link`},[U(`div`,{class:`${e}-item-container`},[o.value===`rtl`?U(XR,{class:`${e}-item-link-icon`},null):U(KR,{class:`${e}-item-link-icon`},null),t])]),jumpNextIcon:U(`a`,{rel:`nofollow`,class:`${e}-item-link`},[U(`div`,{class:`${e}-item-container`},[o.value===`rtl`?U(KR,{class:`${e}-item-link-icon`},null):U(XR,{class:`${e}-item-link-icon`},null),t])])}};return()=>{let{itemRender:t=n.itemRender,buildOptionText:a=n.buildOptionText,selectComponentClass:m,responsive:h}=e,g=gz(e,[`itemRender`,`buildOptionText`,`selectComponentClass`,`responsive`]),_=s.value===`small`||!!(d.value?.xs&&!s.value&&h),v=Z(Z(Z(Z(Z({},g),p(i.value)),{prefixCls:i.value,selectPrefixCls:u.value,selectComponentClass:m||(_?ZR:QR),locale:f.value,buildOptionText:a}),r),{class:K({[`${i.value}-mini`]:_,[`${i.value}-rtl`]:o.value===`rtl`},r.class,l.value),itemRender:t});return c(U(sz,v,null))}}})),vz=u({compatConfig:{MODE:3},name:`AListItemMeta`,props:{avatar:f.any,description:f.any,prefixCls:String,title:f.any},displayName:`AListItemMeta`,__ANT_LIST_ITEM_META:!0,slots:Object,setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`list`,e);return()=>{let t=`${r.value}-item-meta`,i=e.title??n.title?.call(n),a=e.description??n.description?.call(n),o=e.avatar??n.avatar?.call(n),s=U(`div`,{class:`${r.value}-item-meta-content`},[i&&U(`h4`,{class:`${r.value}-item-meta-title`},[i]),a&&U(`div`,{class:`${r.value}-item-meta-description`},[a])]);return U(`div`,{class:t},[o&&U(`div`,{class:`${r.value}-item-meta-avatar`},[o]),(i||a)&&s])}}}),yz=Symbol(`ListContextKey`),bz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let e=n.default?.call(n)||[],t;return e.forEach(e=>{F(e)&&!Te(e)&&(t=!0)}),t&&e.length>1},c=()=>{let t=e.extra??n.extra?.call(n);return i.value===`vertical`?!!t:!s()};return()=>{let{class:t}=r,s=bz(r,[`class`]),l=o.value,u=e.extra??n.extra?.call(n),d=n.default?.call(n),f=e.actions??ce(n.actions?.call(n));f=f&&!Array.isArray(f)?[f]:f;let p=f&&f.length>0&&U(`ul`,{class:`${l}-item-action`,key:`actions`},[f.map((e,t)=>U(`li`,{key:`${l}-item-action-${t}`},[e,t!==f.length-1&&U(`em`,{class:`${l}-item-action-split`},null)]))]),m=U(a.value?`div`:`li`,Y(Y({},s),{},{class:K(`${l}-item`,{[`${l}-item-no-flex`]:!c()},t)}),{default:()=>[i.value===`vertical`&&u?[U(`div`,{class:`${l}-item-main`,key:`content`},[d,p]),U(`div`,{class:`${l}-item-extra`,key:`extra`},[u])]:[d,p,ao(u,{key:`extra`})]]});return a.value?U(vM,{flex:1,style:e.colStyle},{default:()=>[m]}):m}}}),Sz=e=>{let{listBorderedCls:t,componentCls:n,paddingLG:r,margin:i,padding:a,listItemPaddingSM:o,marginLG:s,borderRadiusLG:c}=e;return{[`${t}`]:{border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:c,[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:r},[`${n}-pagination`]:{margin:`${i}px ${s}px`}},[`${t}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:o}},[`${t}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:`${a}px ${r}px`}}}},Cz=e=>{let{componentCls:t,screenSM:n,screenMD:r,marginLG:i,marginSM:a,margin:o}=e;return{[`@media screen and (max-width:${r})`]:{[`${t}`]:{[`${t}-item`]:{[`${t}-item-action`]:{marginInlineStart:i}}},[`${t}-vertical`]:{[`${t}-item`]:{[`${t}-item-extra`]:{marginInlineStart:i}}}},[`@media screen and (max-width: ${n})`]:{[`${t}`]:{[`${t}-item`]:{flexWrap:`wrap`,[`${t}-action`]:{marginInlineStart:a}}},[`${t}-vertical`]:{[`${t}-item`]:{flexWrap:`wrap-reverse`,[`${t}-item-main`]:{minWidth:e.contentWidth},[`${t}-item-extra`]:{margin:`auto auto ${o}px`}}}}}},wz=e=>{let{componentCls:t,antCls:n,controlHeight:r,minHeight:i,paddingSM:a,marginLG:o,padding:s,listItemPadding:c,colorPrimary:l,listItemPaddingSM:u,listItemPaddingLG:d,paddingXS:f,margin:p,colorText:m,colorTextDescription:h,motionDurationSlow:g,lineWidth:_}=e;return{[`${t}`]:Z(Z({},rn(e)),{position:`relative`,"*":{outline:`none`},[`${t}-header, ${t}-footer`]:{background:`transparent`,paddingBlock:a},[`${t}-pagination`]:{marginBlockStart:o,textAlign:`end`,[`${n}-pagination-options`]:{textAlign:`start`}},[`${t}-spin`]:{minHeight:i,textAlign:`center`},[`${t}-items`]:{margin:0,padding:0,listStyle:`none`},[`${t}-item`]:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:c,color:m,[`${t}-item-meta`]:{display:`flex`,flex:1,alignItems:`flex-start`,maxWidth:`100%`,[`${t}-item-meta-avatar`]:{marginInlineEnd:s},[`${t}-item-meta-content`]:{flex:`1 0`,width:0,color:m},[`${t}-item-meta-title`]:{marginBottom:e.marginXXS,color:m,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:m,transition:`all ${g}`,"&:hover":{color:l}}},[`${t}-item-meta-description`]:{color:h,fontSize:e.fontSize,lineHeight:e.lineHeight}},[`${t}-item-action`]:{flex:`0 0 auto`,marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:`none`,"& > li":{position:`relative`,display:`inline-block`,padding:`0 ${f}px`,color:h,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:`center`,"&:first-child":{paddingInlineStart:0}},[`${t}-item-action-split`]:{position:`absolute`,insetBlockStart:`50%`,insetInlineEnd:0,width:_,height:Math.ceil(e.fontSize*e.lineHeight)-e.marginXXS*2,transform:`translateY(-50%)`,backgroundColor:e.colorSplit}}},[`${t}-empty`]:{padding:`${s}px 0`,color:h,fontSize:e.fontSizeSM,textAlign:`center`},[`${t}-empty-text`]:{padding:s,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:`center`},[`${t}-item-no-flex`]:{display:`block`}}),[`${t}-grid ${n}-col > ${t}-item`]:{display:`block`,maxWidth:`100%`,marginBlockEnd:p,paddingBlock:0,borderBlockEnd:`none`},[`${t}-vertical ${t}-item`]:{alignItems:`initial`,[`${t}-item-main`]:{display:`block`,flex:1},[`${t}-item-extra`]:{marginInlineStart:o},[`${t}-item-meta`]:{marginBlockEnd:s,[`${t}-item-meta-title`]:{marginBlockEnd:a,color:m,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${t}-item-action`]:{marginBlockStart:s,marginInlineStart:`auto`,"> li":{padding:`0 ${s}px`,"&:first-child":{paddingInlineStart:0}}}},[`${t}-split ${t}-item`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:`none`}},[`${t}-split ${t}-header`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-split${t}-empty ${t}-footer`]:{borderTop:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-loading ${t}-spin-nested-loading`]:{minHeight:r},[`${t}-split${t}-something-after-last-item ${n}-spin-container > ${t}-items > ${t}-item:last-child`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-lg ${t}-item`]:{padding:d},[`${t}-sm ${t}-item`]:{padding:u},[`${t}:not(${t}-vertical)`]:{[`${t}-item-no-flex`]:{[`${t}-item-action`]:{float:`right`}}}}},Tz=v(`List`,e=>{let t=B(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG,listItemPadding:`${e.paddingContentVertical}px ${e.paddingContentHorizontalLG}px`,listItemPaddingSM:`${e.paddingContentVerticalSM}px ${e.paddingContentHorizontal}px`,listItemPaddingLG:`${e.paddingContentVerticalLG}px ${e.paddingContentHorizontalLG}px`});return[wz(t),Sz(t),Cz(t)]},{contentWidth:220}),Ez=u({compatConfig:{MODE:3},name:`AList`,inheritAttrs:!1,Item:xz,props:Zn({bordered:Q(),dataSource:Ue(),extra:pt(),grid:Qt(),itemLayout:String,loading:W([Boolean,Object]),loadMore:pt(),pagination:W([Boolean,Object]),prefixCls:String,rowKey:W([String,Number,Function]),renderItem:d(),size:String,split:Q(),header:pt(),footer:pt(),locale:Qt()},{dataSource:[],bordered:!1,split:!0,loading:!1,pagination:!1}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t;fe(yz,{grid:St(e,`grid`),itemLayout:St(e,`itemLayout`)});let i={current:1,total:0},{prefixCls:a,direction:o,renderEmpty:s}=X(`list`,e),[c,l]=Tz(a),u=J(()=>e.pagination&&typeof e.pagination==`object`?e.pagination:{}),d=H(u.value.defaultCurrent??1),f=H(u.value.defaultPageSize??10);G(u,()=>{`current`in u.value&&(d.value=u.value.current),`pageSize`in u.value&&(f.value=u.value.pageSize)});let p=[],m=e=>(t,n)=>{d.value=t,f.value=n,u.value[e]&&u.value[e](t,n)},h=m(`onChange`),g=m(`onShowSizeChange`),_=J(()=>typeof e.loading==`boolean`?{spinning:e.loading}:e.loading),v=J(()=>_.value&&_.value.spinning),y=J(()=>{let t=``;switch(e.size){case`large`:t=`lg`;break;case`small`:t=`sm`;break;default:break}return t}),b=J(()=>({[`${a.value}`]:!0,[`${a.value}-vertical`]:e.itemLayout===`vertical`,[`${a.value}-${y.value}`]:y.value,[`${a.value}-split`]:e.split,[`${a.value}-bordered`]:e.bordered,[`${a.value}-loading`]:v.value,[`${a.value}-grid`]:!!e.grid,[`${a.value}-rtl`]:o.value===`rtl`})),x=J(()=>{let t=Z(Z(Z({},i),{total:e.dataSource.length,current:d.value,pageSize:f.value}),e.pagination||{}),n=Math.ceil(t.total/t.pageSize);return t.current>n&&(t.current=n),t}),S=J(()=>{let t=[...e.dataSource];return e.pagination&&e.dataSource.length>(x.value.current-1)*x.value.pageSize&&(t=[...e.dataSource].splice((x.value.current-1)*x.value.pageSize,x.value.pageSize)),t}),C=Uv(),w=Wv(()=>{for(let e=0;e{if(!e.grid)return;let t=w.value&&e.grid[w.value]?e.grid[w.value]:e.grid.column;if(t)return{width:`${100/t}%`,maxWidth:`${100/t}%`}}),E=(t,r)=>{let i=e.renderItem??n.renderItem;if(!i)return null;let a,o=typeof e.rowKey;return a=o===`function`?e.rowKey(t):o===`string`||o===`number`?t[e.rowKey]:t.key,a||=`list-item-${r}`,p[r]=a,i({item:t,index:r})};return()=>{let t=e.loadMore??n.loadMore?.call(n),i=e.footer??n.footer?.call(n),o=e.header??n.header?.call(n),u=ce(n.default?.call(n)),d=!!(t||e.pagination||i),f=K(Z(Z({},b.value),{[`${a.value}-something-after-last-item`]:d}),r.class,l.value),m=e.pagination?U(`div`,{class:`${a.value}-pagination`},[U(_z,Y(Y({},x.value),{},{onChange:h,onShowSizeChange:g}),null)]):null,y=v.value&&U(`div`,{style:{minHeight:`53px`}},null);if(S.value.length>0){p.length=0;let t=S.value.map((e,t)=>E(e,t)),n=t.map((e,t)=>U(`div`,{key:p[t],style:T.value},[e]));y=e.grid?U(HA,{gutter:e.grid.gutter},{default:()=>[n]}):U(`ul`,{class:`${a.value}-items`},[t])}else!u.length&&!v.value&&(y=U(`div`,{class:`${a.value}-empty-text`},[e.locale?.emptyText||s(`List`)]));let C=x.value.position||`bottom`;return c(U(`div`,Y(Y({},r),{},{class:f}),[(C===`top`||C===`both`)&&m,o&&U(`div`,{class:`${a.value}-header`},[o]),U(HR,_.value,{default:()=>[y,u]}),i&&U(`div`,{class:`${a.value}-footer`},[i]),t||(C===`bottom`||C===`both`)&&m]))}}});Ez.install=function(e){return e.component(Ez.name,Ez),e.component(Ez.Item.name,Ez.Item),e.component(Ez.Item.Meta.name,Ez.Item.Meta),e};function Dz(e){let{selectionStart:t}=e;return e.value.slice(0,t)}function Oz(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;return(Array.isArray(t)?t:[t]).reduce((t,n)=>{let r=e.lastIndexOf(n);return r>t.location?{location:r,prefix:n}:t},{location:-1,prefix:``})}function kz(e){return(e||``).toLowerCase()}function Az(e,t,n){let r=e[0];if(!r||r===n)return e;let i=e,a=t.length;for(let e=0;e[]}},setup(e,t){let{slots:n}=t,{activeIndex:r,setActiveIndex:i,selectOption:a,onFocus:o=Iz,loading:s}=g(Fz,{activeIndex:q(),loading:q(!1)}),c,l=e=>{clearTimeout(c),c=setTimeout(()=>{o(e)})};return ut(()=>{clearTimeout(c)}),()=>{let{prefixCls:t,options:o}=e,c=o[r.value]||{};return U(wS,{prefixCls:`${t}-menu`,activeKey:c.value,onSelect:e=>{let{key:t}=e,n=o.find(e=>{let{value:n}=e;return n===t});a(n)},onMousedown:l},{default:()=>[!s.value&&o.map((e,t)=>{let{value:r,disabled:a,label:o=e.value,class:s,style:c}=e;return U(Kx,{key:r,disabled:a,onMouseenter:()=>{i(t)},class:s,style:c},{default:()=>[n.option?.call(n,e)??(typeof o==`function`?o(e):o)]})}),!s.value&&o.length===0?U(Kx,{key:`notFoundContent`,disabled:!0},{default:()=>[n.notFoundContent?.call(n)]}):null,s.value&&U(Kx,{key:`loading`,disabled:!0},{default:()=>[U(HR,{size:`small`},null)]})]})}}}),Rz={bottomRight:{points:[`tl`,`br`],offset:[0,4],overflow:{adjustX:0,adjustY:1}},bottomLeft:{points:[`tr`,`bl`],offset:[0,4],overflow:{adjustX:0,adjustY:1}},topRight:{points:[`bl`,`tr`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topLeft:{points:[`br`,`tl`],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}},zz=u({compatConfig:{MODE:3},name:`KeywordTrigger`,props:{loading:{type:Boolean,default:void 0},options:{type:Array,default:()=>[]},prefixCls:String,placement:String,visible:{type:Boolean,default:void 0},transitionName:String,getPopupContainer:Function,direction:String,dropdownClassName:String},setup(e,t){let{slots:n}=t,r=()=>`${e.prefixCls}-dropdown`,i=()=>{let{options:t}=e;return U(Lz,{prefixCls:r(),options:t},{notFoundContent:n.notFoundContent,option:n.option})},a=J(()=>{let{placement:t,direction:n}=e,r=`topRight`;return r=n===`rtl`?t===`top`?`topLeft`:`bottomLeft`:t===`top`?`topRight`:`bottomRight`,r});return()=>{let{visible:t,transitionName:o,getPopupContainer:s}=e;return U(Su,{prefixCls:r(),popupVisible:t,popup:i(),popupClassName:e.dropdownClassName,popupPlacement:a.value,popupTransitionName:o,builtinPlacements:Rz,getPopupContainer:s},{default:n.default})}}}),Bz=m(`top`,`bottom`),Vz={autofocus:{type:Boolean,default:void 0},prefix:f.oneOfType([f.string,f.arrayOf(f.string)]),prefixCls:String,value:String,disabled:{type:Boolean,default:void 0},split:String,transitionName:String,placement:f.oneOf(Bz),character:f.any,characterRender:Function,filterOption:{type:[Boolean,Function]},validateSearch:Function,getPopupContainer:{type:Function},options:Ue(),loading:{type:Boolean,default:void 0},rows:[Number,String],direction:{type:String}},Hz=Z(Z({},Vz),{dropdownClassName:String}),Uz={prefix:`@`,split:` `,rows:1,validateSearch:Nz,filterOption:()=>Pz};Zn(Hz,Uz);var Wz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{l.value=e.value});let u=e=>{n(`change`,e)},d=e=>{let{target:{value:t}}=e;u(t)},f=(e,t,n)=>{Z(l,{measuring:!0,measureText:e,measurePrefix:t,measureLocation:n,activeIndex:0})},p=e=>{Z(l,{measuring:!1,measureLocation:0,measureText:null}),e?.()},m=e=>{let{which:t}=e;if(l.measuring){if(t===$.UP||t===$.DOWN){let n=T.value.length,r=t===$.UP?-1:1,i=(l.activeIndex+r+n)%n;l.activeIndex=i,e.preventDefault()}else if(t===$.ESC)p();else if(t===$.ENTER){if(e.preventDefault(),!T.value.length){p();return}let t=T.value[l.activeIndex];x(t)}}},h=t=>{let{key:r,which:i}=t,{measureText:a,measuring:o}=l,{prefix:s,validateSearch:c}=e,u=t.target;if(u.composing)return;let d=Dz(u),{location:m,prefix:h}=Oz(d,s);if([$.ESC,$.UP,$.DOWN,$.ENTER].indexOf(i)===-1)if(m!==-1){let t=d.slice(m+h.length),i=c(t,e),s=!!w(t).length;i?(r===h||r===`Shift`||o||t!==a&&s)&&f(t,h,m):o&&p(),i&&n(`search`,t,h)}else o&&p()},g=e=>{l.measuring||n(`pressenter`,e)},_=e=>{y(e)},v=e=>{b(e)},y=e=>{clearTimeout(c.value);let{isFocus:t}=l;!t&&e&&n(`focus`,e),l.isFocus=!0},b=e=>{c.value=setTimeout(()=>{l.isFocus=!1,p(),n(`blur`,e)},100)},x=t=>{let{split:r}=e,{value:i=``}=t,{text:a,selectionLocation:o}=jz(l.value,{measureLocation:l.measureLocation,targetText:i,prefix:l.measurePrefix,selectionStart:s.value.getSelectionStart(),split:r});u(a),p(()=>{Mz(s.value.input,o)}),n(`select`,t,l.measurePrefix)},C=e=>{l.activeIndex=e},w=t=>{let n=t||l.measureText||``,{filterOption:r}=e;return e.options.filter(e=>!r||r(n,e))},T=J(()=>w());return i({blur:()=>{s.value.blur()},focus:()=>{s.value.focus()}}),fe(Fz,{activeIndex:St(l,`activeIndex`),setActiveIndex:C,selectOption:x,onFocus:y,onBlur:b,loading:St(e,`loading`)}),O(()=>{z(()=>{l.measuring&&(o.value.scrollTop=s.value.getScrollTop())})}),()=>{let{measureLocation:t,measurePrefix:n,measuring:i}=l,{prefixCls:c,placement:u,transitionName:f,getPopupContainer:p,direction:y}=e,b=Wz(e,[`prefixCls`,`placement`,`transitionName`,`getPopupContainer`,`direction`]),{class:x,style:S}=r,C=Wz(r,[`class`,`style`]),w=Z(Z(Z({},Br(b,[`value`,`prefix`,`split`,`validateSearch`,`filterOption`,`options`,`loading`])),C),{onChange:Gz,onSelect:Gz,value:l.value,onInput:d,onBlur:v,onKeydown:m,onKeyup:h,onFocus:_,onPressenter:g});return U(`div`,{class:K(c,x),style:S},[U(Pu,Y(Y({},w),{},{ref:s,tag:`textarea`}),null),i&&U(`div`,{ref:o,class:`${c}-measure`},[l.value.slice(0,t),U(zz,{prefixCls:c,transitionName:f,dropdownClassName:e.dropdownClassName,placement:u,options:i?T.value:[],visible:!0,direction:y,getPopupContainer:p},{default:()=>[U(`span`,null,[n])],notFoundContent:a.notFoundContent,option:a.option}),l.value.slice(t+n.length)])])}}}),qz=Z(Z({},{value:String,disabled:Boolean,payload:Qt()}),{label:nn([])}),Jz={name:`Option`,props:qz,render(e,t){let{slots:n}=t;return n.default?.call(n)}};u(Z({compatConfig:{MODE:3}},Jz));var Yz=Kz,Xz=e=>{let{componentCls:t,colorTextDisabled:n,controlItemBgHover:r,controlPaddingHorizontal:i,colorText:a,motionDurationSlow:o,lineHeight:s,controlHeight:c,inputPaddingHorizontal:l,inputPaddingVertical:u,fontSize:d,colorBgElevated:f,borderRadiusLG:p,boxShadowSecondary:m}=e,h=Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2);return{[t]:Z(Z(Z(Z(Z({},rn(e)),BT(e)),{position:`relative`,display:`inline-block`,height:`auto`,padding:0,overflow:`hidden`,lineHeight:s,whiteSpace:`pre-wrap`,verticalAlign:`bottom`}),zT(e,t)),{"&-disabled":{"> textarea":Z({},IT(e))},"&-focused":Z({},FT(e)),[`&-affix-wrapper ${t}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:l,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`},[`> textarea, ${t}-measure`]:{color:a,boxSizing:`border-box`,minHeight:c-2,margin:0,padding:`${u}px ${l}px`,overflow:`inherit`,overflowX:`hidden`,overflowY:`auto`,fontWeight:`inherit`,fontSize:`inherit`,fontFamily:`inherit`,fontStyle:`inherit`,fontVariant:`inherit`,fontSizeAdjust:`inherit`,fontStretch:`inherit`,lineHeight:`inherit`,direction:`inherit`,letterSpacing:`inherit`,whiteSpace:`inherit`,textAlign:`inherit`,verticalAlign:`top`,wordWrap:`break-word`,wordBreak:`inherit`,tabSize:`inherit`},"> textarea":Z({width:`100%`,border:`none`,outline:`none`,resize:`none`,backgroundColor:`inherit`},NT(e.colorTextPlaceholder)),[`${t}-measure`]:{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:-1,color:`transparent`,pointerEvents:`none`,"> span":{display:`inline-block`,minHeight:`1em`}},"&-dropdown":Z(Z({},rn(e)),{position:`absolute`,top:-9999,insetInlineStart:-9999,zIndex:e.zIndexPopup,boxSizing:`border-box`,fontSize:d,fontVariant:`initial`,backgroundColor:f,borderRadius:p,outline:`none`,boxShadow:m,"&-hidden":{display:`none`},[`${t}-dropdown-menu`]:{maxHeight:e.dropdownHeight,marginBottom:0,paddingInlineStart:0,overflow:`auto`,listStyle:`none`,outline:`none`,"&-item":Z(Z({},xe),{position:`relative`,display:`block`,minWidth:e.controlItemWidth,padding:`${h}px ${i}px`,color:a,fontWeight:`normal`,lineHeight:s,cursor:`pointer`,transition:`background ${o} ease`,"&:hover":{backgroundColor:r},"&:first-child":{borderStartStartRadius:p,borderStartEndRadius:p,borderEndStartRadius:0,borderEndEndRadius:0},"&:last-child":{borderStartStartRadius:0,borderStartEndRadius:0,borderEndStartRadius:p,borderEndEndRadius:p},"&-disabled":{color:n,cursor:`not-allowed`,"&:hover":{color:n,backgroundColor:r,cursor:`not-allowed`}},"&-selected":{color:a,fontWeight:e.fontWeightStrong,backgroundColor:r},"&-active":{backgroundColor:r}})}})})}},Zz=v(`Mentions`,e=>[Xz(qT(e))],e=>({dropdownHeight:250,controlItemWidth:100,zIndexPopup:e.zIndexPopupBase+50})),Qz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:``,{prefix:t=`@`,split:n=` `}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Array.isArray(t)?t:[t];return e.split(n).map(function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=null;return r.some(n=>e.slice(0,n.length)===n?(t=n,!0):!1),t===null?null:{prefix:t,value:e.slice(t.length)}}).filter(e=>!!e&&!!e.value)},tB=u({compatConfig:{MODE:3},name:`AMentions`,inheritAttrs:!1,props:Z(Z({},Vz),{loading:{type:Boolean,default:void 0},onFocus:{type:Function},onBlur:{type:Function},onSelect:{type:Function},onChange:{type:Function},onPressenter:{type:Function},"onUpdate:value":{type:Function},notFoundContent:f.any,defaultValue:String,id:String,status:String}),slots:Object,setup(t,n){let{slots:r,emit:i,attrs:a,expose:o}=n,{prefixCls:s,renderEmpty:c,direction:l}=X(`mentions`,t),[u,d]=Zz(s),f=q(!1),p=q(null),m=q(t.value??t.defaultValue??``),h=zf(),g=Vf.useInject(),_=J(()=>Wf(g.status,t.status));yx({prefixCls:J(()=>`${s.value}-menu`),mode:J(()=>`vertical`),selectable:J(()=>!1),onClick:()=>{},validator:t=>{let{mode:n}=t;e(!n||n===`vertical`,`Mentions`,`mode="${n}" is not supported for Mentions's Menu.`)}}),G(()=>t.value,e=>{m.value=e});let v=e=>{f.value=!0,i(`focus`,e)},y=e=>{f.value=!1,i(`blur`,e),h.onFieldBlur()},b=function(){i(`select`,...arguments),f.value=!0},x=e=>{t.value===void 0&&(m.value=e),i(`update:value`,e),i(`change`,e),h.onFieldChange()},S=()=>{let e=t.notFoundContent;return e===void 0?r.notFoundContent?r.notFoundContent():c(`Select`):e},C=()=>ce(r.default?.call(r)||[]).map(e=>{var t;return Z(Z({},pe(e)),{label:((t=e.children)?.default)?.call(t)})});o({focus:()=>{p.value.focus()},blur:()=>{p.value.blur()}});let w=J(()=>t.loading?$z:t.filterOption);return()=>{let{disabled:e,getPopupContainer:n,rows:i=1,id:o=h.id.value}=t,c=Qz(t,[`disabled`,`getPopupContainer`,`rows`,`id`]),{hasFeedback:T,feedbackIcon:E}=g,{class:D}=a,O=Qz(a,[`class`]),k=Br(c,[`defaultValue`,`onUpdate:value`,`prefixCls`]),A=K({[`${s.value}-disabled`]:e,[`${s.value}-focused`]:f.value,[`${s.value}-rtl`]:l.value===`rtl`},Uf(s.value,_.value),!T&&D,d.value),j=U(Yz,Y(Y({},Z(Z(Z(Z({prefixCls:s.value},k),{disabled:e,direction:l.value,filterOption:w.value,getPopupContainer:n,options:t.loading?[{value:`ANTDV_SEARCHING`,disabled:!0,label:U(HR,{size:`small`},null)}]:t.options||C(),class:A}),O),{rows:i,onChange:x,onSelect:b,onFocus:v,onBlur:y,ref:p,value:m.value,id:o})),{},{dropdownClassName:d.value}),{notFoundContent:S,option:r.option});return u(T?U(`div`,{class:K(`${s.value}-affix-wrapper`,Uf(`${s.value}-affix-wrapper`,_.value,T),D,d.value)},[j,U(`span`,{class:`${s.value}-suffix`},[E])]):j)}}}),nB=u(Z(Z({compatConfig:{MODE:3}},Jz),{name:`AMentionsOption`,props:qz})),rB=Z(tB,{Option:nB,getMentions:eB,install:e=>(e.component(tB.name,tB),e.component(nB.name,nB),e)}),iB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{aB={x:e.pageX,y:e.pageY},setTimeout(()=>aB=null,100)},!0);var oB=u({compatConfig:{MODE:3},name:`AModal`,inheritAttrs:!1,props:Zn({prefixCls:String,visible:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},confirmLoading:{type:Boolean,default:void 0},title:f.any,closable:{type:Boolean,default:void 0},closeIcon:f.any,onOk:Function,onCancel:Function,"onUpdate:visible":Function,"onUpdate:open":Function,onChange:Function,afterClose:Function,centered:{type:Boolean,default:void 0},width:[String,Number],footer:f.any,okText:f.any,okType:String,cancelText:f.any,icon:f.any,maskClosable:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},okButtonProps:Qt(),cancelButtonProps:Qt(),destroyOnClose:{type:Boolean,default:void 0},wrapClassName:String,maskTransitionName:String,transitionName:String,getContainer:{type:[String,Function,Boolean,Object],default:void 0},zIndex:Number,bodyStyle:Qt(),maskStyle:Qt(),mask:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},wrapProps:Object,focusTriggerAfterClose:{type:Boolean,default:void 0},modalRender:Function,mousePosition:Qt()},{width:520,confirmLoading:!1,okType:`primary`}),setup(t,n){let{emit:r,slots:i,attrs:a}=n,[o]=Kt(`Modal`),{prefixCls:s,rootPrefixCls:c,direction:l,getPopupContainer:u}=X(`modal`,t),[d,f]=hL(s);e(t.visible===void 0,`Modal`,"`visible` will be removed in next major version, please use `open` instead.");let p=e=>{r(`update:visible`,!1),r(`update:open`,!1),r(`cancel`,e),r(`change`,!1)},m=e=>{r(`ok`,e)},h=()=>{let{okText:e=i.okText?.call(i),okType:n,cancelText:r=i.cancelText?.call(i),confirmLoading:a}=t;return U($e,null,[U(Qb,Y({onClick:p},t.cancelButtonProps),{default:()=>[r||o.value.cancelText]}),U(Qb,Y(Y({},fb(n)),{},{loading:a,onClick:m},t.okButtonProps),{default:()=>[e||o.value.okText]})])};return()=>{let{prefixCls:e,visible:n,open:r,wrapClassName:o,centered:m,getContainer:g,closeIcon:_=i.closeIcon?.call(i),focusTriggerAfterClose:v=!0}=t,y=iB(t,[`prefixCls`,`visible`,`open`,`wrapClassName`,`centered`,`getContainer`,`closeIcon`,`focusTriggerAfterClose`]),b=K(o,{[`${s.value}-centered`]:!!m,[`${s.value}-wrap-rtl`]:l.value===`rtl`});return d(U(DI,Y(Y(Y({},y),a),{},{rootClassName:f.value,class:K(f.value,a.class),getContainer:g||u?.value,prefixCls:s.value,wrapClassName:b,visible:r??n,onClose:p,focusTriggerAfterClose:v,transitionName:Xt(c.value,`zoom`,t.transitionName),maskTransitionName:Xt(c.value,`fade`,t.maskTransitionName),mousePosition:y.mousePosition??aB}),Z(Z({},i),{footer:i.footer||h,closeIcon:()=>U(`span`,{class:`${s.value}-close-x`},[_||U(Pe,{class:`${s.value}-close-icon`},null)])})))}}}),sB=()=>{let e=q(!1);return ut(()=>{e.value=!0}),e},cB={type:{type:String},actionFn:Function,close:Function,autofocus:Boolean,prefixCls:String,buttonProps:Qt(),emitEvent:Boolean,quitOnNullishReturnValue:Boolean};function lB(e){return!!(e&&e.then)}var uB=u({compatConfig:{MODE:3},name:`ActionButton`,props:cB,setup(e,t){let{slots:n}=t,r=q(!1),i=q(),a=q(!1),o,s=sB();V(()=>{e.autofocus&&(o=setTimeout(()=>{var e;return((e=ae(i.value))?.focus)?.call(e)}))}),ut(()=>{clearTimeout(o)});let c=function(){var t,n=[...arguments];(t=e.close)==null||t.call(e,...n)},l=e=>{lB(e)&&(a.value=!0,e.then(function(){s.value||(a.value=!1),c(...arguments),r.value=!1},e=>(s.value||(a.value=!1),r.value=!1,Promise.reject(e))))},u=t=>{let{actionFn:n}=e;if(r.value)return;if(r.value=!0,!n){c();return}let i;if(e.emitEvent){if(i=n(t),e.quitOnNullishReturnValue&&!lB(i)){r.value=!1,c(t);return}}else if(n.length)i=n(e.close),r.value=!1;else if(i=n(),!i){c();return}l(i)};return()=>{let{type:t,prefixCls:r,buttonProps:o}=e;return U(Qb,Y(Y(Y({},fb(t)),{},{onClick:u,loading:a.value,prefixCls:r},o),{},{ref:i}),n)}}});function dB(e){return typeof e==`function`?e():e}var fB=u({name:`ConfirmDialog`,inheritAttrs:!1,props:`icon.onCancel.onOk.close.closable.zIndex.afterClose.visible.open.keyboard.centered.getContainer.maskStyle.okButtonProps.cancelButtonProps.okType.prefixCls.okCancel.width.mask.maskClosable.okText.cancelText.autoFocusButton.transitionName.maskTransitionName.type.title.content.direction.rootPrefixCls.bodyStyle.closeIcon.modalRender.focusTriggerAfterClose.wrapClassName.confirmPrefixCls.footer`.split(`.`),setup(e,t){let{attrs:n}=t,[r]=Kt(`Modal`);return()=>{let{icon:t,onCancel:i,onOk:a,close:o,okText:s,closable:c=!1,zIndex:l,afterClose:u,keyboard:d,centered:f,getContainer:p,maskStyle:m,okButtonProps:h,cancelButtonProps:g,okCancel:_,width:v=416,mask:y=!0,maskClosable:b=!1,type:x,open:S,title:C,content:w,direction:T,closeIcon:E,modalRender:D,focusTriggerAfterClose:O,rootPrefixCls:k,bodyStyle:A,wrapClassName:j,footer:M}=e,N=t;if(!t&&t!==null)switch(x){case`info`:N=U(mt,null,null);break;case`success`:N=U(qe,null,null);break;case`error`:N=U(tt,null,null);break;default:N=U(Wt,null,null)}let P=e.okType||`primary`,F=e.prefixCls||`ant-modal`,I=`${F}-confirm`,L=n.style||{},ee=_??x===`confirm`,te=e.autoFocusButton===null?!1:e.autoFocusButton||`ok`,ne=`${F}-confirm`,R=K(ne,`${ne}-${e.type}`,{[`${ne}-rtl`]:T===`rtl`},n.class),re=r.value,ie=ee&&U(uB,{actionFn:i,close:o,autofocus:te===`cancel`,buttonProps:g,prefixCls:`${k}-btn`},{default:()=>[dB(e.cancelText)||re.cancelText]});return U(oB,{prefixCls:F,class:R,wrapClassName:K({[`${ne}-centered`]:!!f},j),onCancel:e=>o?.({triggerCancel:!0},e),open:S,title:``,footer:``,transitionName:Xt(k,`zoom`,e.transitionName),maskTransitionName:Xt(k,`fade`,e.maskTransitionName),mask:y,maskClosable:b,maskStyle:m,style:L,bodyStyle:A,width:v,zIndex:l,afterClose:u,keyboard:d,centered:f,getContainer:p,closable:c,closeIcon:E,modalRender:D,focusTriggerAfterClose:O},{default:()=>[U(`div`,{class:`${I}-body-wrapper`},[U(`div`,{class:`${I}-body`},[dB(N),C===void 0?null:U(`span`,{class:`${I}-title`},[dB(C)]),U(`div`,{class:`${I}-content`},[dB(w)])]),M===void 0?U(`div`,{class:`${I}-btns`},[ie,U(uB,{type:P,actionFn:a,close:o,autofocus:te===`ok`,buttonProps:h,prefixCls:`${k}-btn`},{default:()=>[dB(s)||(ee?re.okText:re.justOkText)]})]):dB(M)])]})}}}),pB=[],mB=e=>{let t=document.createDocumentFragment(),n=Z(Z({},Br(e,[`parentContext`,`appContext`])),{close:a,open:!0}),r=null;function i(){r&&=(Ge(null,t),null);var n=[...arguments];let i=n.some(e=>e&&e.triggerCancel);e.onCancel&&i&&e.onCancel(()=>{},...n.slice(1));for(let e=0;e{typeof e.afterClose==`function`&&e.afterClose(),i.apply(this,t)}}),n.visible&&delete n.visible,o(n)}function o(e){n=typeof e==`function`?e(n):Z(Z({},n),e),r&&co(r,n,t)}let s=e=>{let t=bt,n=t.prefixCls,r=e.prefixCls||`${n}-modal`,i=t.iconPrefixCls,a=We();return U(Bt,Y(Y({},t),{},{prefixCls:n}),{default:()=>[U(fB,Y(Y({},e),{},{rootPrefixCls:n,prefixCls:r,iconPrefixCls:i,locale:a,cancelText:e.cancelText||a.cancelText}),null)]})};function c(n){let r=U(s,Z({},n));return r.appContext=e.parentContext||e.appContext||r.appContext,Ge(r,t),r}return r=c(n),pB.push(a),{destroy:a,update:o}};function hB(e){return Z(Z({},e),{type:`warning`})}function gB(e){return Z(Z({},e),{type:`info`})}function _B(e){return Z(Z({},e),{type:`success`})}function vB(e){return Z(Z({},e),{type:`error`})}function yB(e){return Z(Z({},e),{type:`confirm`})}var bB=u({name:`HookModal`,inheritAttrs:!1,props:Zn({config:Object,afterClose:Function,destroyAction:Function,open:Boolean},{config:{width:520,okType:`primary`}}),setup(e,t){let{expose:n}=t,r=J(()=>e.open),i=J(()=>e.config),{direction:a,getPrefixCls:o}=Ie(),s=o(`modal`),c=o(),l=()=>{var t,n;e?.afterClose(),(n=(t=i.value).afterClose)==null||n.call(t)},u=function(){e.destroyAction(...arguments)};n({destroy:u});let d=i.value.okCancel??i.value.type===`confirm`,[f]=Kt(`Modal`,Ye.Modal);return()=>U(fB,Y(Y({prefixCls:s,rootPrefixCls:c},i.value),{},{close:u,open:r.value,afterClose:l,okText:i.value.okText||(d?f?.value.okText:f?.value.justOkText),direction:i.value.direction||a.value,cancelText:i.value.cancelText||f?.value.cancelText}),null)}}),xB=0,SB=u({name:`ElementsHolder`,inheritAttrs:!1,setup(e,t){let{expose:n}=t,r=q([]);return n({addModal:e=>(r.value.push(e),r.value=r.value.slice(),()=>{r.value=r.value.filter(t=>t!==e)})}),()=>r.value.map(e=>e())}});function CB(){let e=q(null),t=q([]);G(t,()=>{t.value.length&&([...t.value].forEach(e=>{e()}),t.value=[])},{immediate:!0});let n=n=>function(r){xB+=1;let i=q(!0),a=q(null),o=q(ze(r)),s=q({});G(()=>r,e=>{u(Z(Z({},Ae(e)?e.value:e),s.value))});let c=function(){i.value=!1;var e=[...arguments];let t=e.some(e=>e&&e.triggerCancel);o.value.onCancel&&t&&o.value.onCancel(()=>{},...e.slice(1))},l;l=e.value?.addModal(()=>U(bB,{key:`modal-${xB}`,config:n(o.value),ref:a,open:i.value,destroyAction:c,afterClose:()=>{l?.()}},null)),l&&pB.push(l);let u=e=>{o.value=Z(Z({},o.value),e)};return{destroy:()=>{a.value?c():t.value=[...t.value,c]},update:e=>{s.value=e,a.value?u(e):t.value=[...t.value,()=>u(e)]}}},r=J(()=>({info:n(gB),success:n(_B),error:n(vB),warning:n(hB),confirm:n(yB)})),i=Symbol(`modalHolderKey`);return[r.value,()=>U(SB,{key:i,ref:e},null)]}function wB(e){return mB(hB(e))}oB.useModal=CB,oB.info=function(e){return mB(gB(e))},oB.success=function(e){return mB(_B(e))},oB.error=function(e){return mB(vB(e))},oB.warning=wB,oB.warn=wB,oB.confirm=function(e){return mB(yB(e))},oB.destroyAll=function(){for(;pB.length;){let e=pB.pop();e&&e()}},oB.install=function(e){return e.component(oB.name,oB),e};var TB=oB,EB=e=>{let{value:t,formatter:n,precision:r,decimalSeparator:i,groupSeparator:a=``,prefixCls:o}=e,s;if(typeof n==`function`)s=n({value:t});else{let e=String(t),n=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(!n)s=e;else{let e=n[1],t=n[2]||`0`,c=n[4]||``;t=t.replace(/\B(?=(\d{3})+(?!\d))/g,a),typeof r==`number`&&(c=c.padEnd(r,`0`).slice(0,r>0?r:0)),c&&=`${i}${c}`,s=[U(`span`,{key:`int`,class:`${o}-content-value-int`},[e,t]),c&&U(`span`,{key:`decimal`,class:`${o}-content-value-decimal`},[c])]}}return U(`span`,{class:`${o}-content-value`},[s])};EB.displayName=`StatisticNumber`;var DB=e=>{let{componentCls:t,marginXXS:n,padding:r,colorTextDescription:i,statisticTitleFontSize:a,colorTextHeading:o,statisticContentFontSize:s,statisticFontFamily:c}=e;return{[`${t}`]:Z(Z({},rn(e)),{[`${t}-title`]:{marginBottom:n,color:i,fontSize:a},[`${t}-skeleton`]:{paddingTop:r},[`${t}-content`]:{color:o,fontSize:s,fontFamily:c,[`${t}-content-value`]:{display:`inline-block`,direction:`ltr`},[`${t}-content-prefix, ${t}-content-suffix`]:{display:`inline-block`},[`${t}-content-prefix`]:{marginInlineEnd:n},[`${t}-content-suffix`]:{marginInlineStart:n}}})}},OB=v(`Statistic`,e=>{let{fontSizeHeading3:t,fontSize:n,fontFamily:r}=e;return[DB(B(e,{statisticTitleFontSize:n,statisticContentFontSize:t,statisticFontFamily:r}))]}),kB=()=>({prefixCls:String,decimalSeparator:String,groupSeparator:String,format:String,value:W([Number,String,Object]),valueStyle:{type:Object,default:void 0},valueRender:d(),formatter:nn(),precision:Number,prefix:pt(),suffix:pt(),title:pt(),loading:Q()}),AB=u({compatConfig:{MODE:3},name:`AStatistic`,inheritAttrs:!1,props:Zn(kB(),{decimalSeparator:`.`,groupSeparator:`,`,loading:!1}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`statistic`,e),[o,s]=OB(i);return()=>{let{value:t=0,valueStyle:c,valueRender:l}=e,u=i.value,d=e.title??n.title?.call(n),f=e.prefix??n.prefix?.call(n),p=e.suffix??n.suffix?.call(n),m=e.formatter??n.formatter,h=U(EB,Y({"data-for-update":Date.now()},Z(Z({},e),{prefixCls:u,value:t,formatter:m})),null);return l&&(h=l(h)),o(U(`div`,Y(Y({},r),{},{class:[u,{[`${u}-rtl`]:a.value===`rtl`},r.class,s.value]}),[d&&U(`div`,{class:`${u}-title`},[d]),U(wD,{paragraph:!1,loading:e.loading},{default:()=>[U(`div`,{style:c,class:`${u}-content`},[f&&U(`span`,{class:`${u}-content-prefix`},[f]),h,p&&U(`span`,{class:`${u}-content-suffix`},[p])])]})]))}}}),jB=[[`Y`,1e3*60*60*24*365],[`M`,1e3*60*60*24*30],[`D`,1e3*60*60*24],[`H`,1e3*60*60],[`m`,1e3*60],[`s`,1e3],[`S`,1]];function MB(e,t){let n=e,r=/\[[^\]]*]/g,i=(t.match(r)||[]).map(e=>e.slice(1,-1)),a=t.replace(r,`[]`),o=jB.reduce((e,t)=>{let[r,i]=t;if(e.includes(r)){let t=Math.floor(n/i);return n-=t*i,e.replace(RegExp(`${r}+`,`g`),e=>{let n=e.length;return t.toString().padStart(n,`0`)})}return e},a),s=0;return o.replace(r,()=>{let e=i[s];return s+=1,e})}function NB(e,t){let{format:n=``}=t,r=new Date(e).getTime();return MB(Math.max(r-Date.now(),0),n)}var PB=1e3/30;function FB(e){return new Date(e).getTime()}AB.Countdown=u({compatConfig:{MODE:3},name:`AStatisticCountdown`,props:Zn(Z(Z({},kB()),{value:W([Number,String,Object]),format:String,onFinish:Function,onChange:Function}),{format:`HH:mm:ss`}),setup(e,t){let{emit:n,slots:r}=t,i=H(),a=H(),o=()=>{let{value:t}=e;FB(t)>=Date.now()?s():c()},s=()=>{if(i.value)return;let t=FB(e.value);i.value=setInterval(()=>{a.value.$forceUpdate(),t>Date.now()&&n(`change`,t-Date.now()),o()},PB)},c=()=>{let{value:t}=e;i.value&&(clearInterval(i.value),i.value=void 0,FB(t){let{value:n,config:r}=t,{format:i}=e;return NB(n,Z(Z({},r),{format:i}))},u=e=>e;return V(()=>{o()}),O(()=>{o()}),ut(()=>{c()}),()=>{let t=e.value;return U(AB,Y({ref:a},Z(Z({},Br(e,[`onFinish`,`onChange`])),{value:t,valueRender:u,formatter:l})),r)}}}),AB.install=function(e){return e.component(AB.name,AB),e.component(AB.Countdown.name,AB.Countdown),e};var IB=AB.Countdown,LB=AB,RB={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`};function zB(e){for(var t=1;t{let{keyCode:t}=e;t===$.ENTER&&e.preventDefault()},c=e=>{let{keyCode:t}=e;t===$.ENTER&&r(`click`,e)},l=e=>{r(`click`,e)},u=()=>{o.value&&o.value.focus()};return V(()=>{e.autofocus&&u()}),a({focus:u,blur:()=>{o.value&&o.value.blur()}}),()=>{let{noStyle:t,disabled:r}=e,a=KB(e,[`noStyle`,`disabled`]),u={};return t||(u=Z({},qB)),r&&(u.pointerEvents=`none`),U(`div`,Y(Y(Y({role:`button`,tabindex:0,ref:o},a),i),{},{onClick:l,onKeydown:s,onKeyup:c,style:Z(Z({},u),i.style||{})}),[n.default?.call(n)])}}}),YB={small:8,middle:16,large:24},XB=()=>({prefixCls:String,size:{type:[String,Number,Array]},direction:f.oneOf(m(`horizontal`,`vertical`)).def(`horizontal`),align:f.oneOf(m(`start`,`end`,`center`,`baseline`)),wrap:Q()});function ZB(e){return typeof e==`string`?YB[e]:e||0}var QB=u({compatConfig:{MODE:3},name:`ASpace`,inheritAttrs:!1,props:XB(),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,space:a,direction:o}=X(`space`,e),[s,c]=qf(i),l=jA(),u=J(()=>e.size??a?.value?.size??`small`),d=H(),f=H();G(u,()=>{[d.value,f.value]=(Array.isArray(u.value)?u.value:[u.value,u.value]).map(e=>ZB(e))},{immediate:!0});let p=J(()=>e.align===void 0&&e.direction===`horizontal`?`center`:e.align),m=J(()=>K(i.value,c.value,`${i.value}-${e.direction}`,{[`${i.value}-rtl`]:o.value===`rtl`,[`${i.value}-align-${p.value}`]:p.value})),h=J(()=>o.value===`rtl`?`marginLeft`:`marginRight`),g=J(()=>{let t={};return l.value&&(t.columnGap=`${d.value}px`,t.rowGap=`${f.value}px`),Z(Z({},t),e.wrap&&{flexWrap:`wrap`,marginBottom:`${-f.value}px`})});return()=>{let{wrap:t,direction:a=`horizontal`}=e,o=n.default?.call(n),c=dt(o),u=c.length;if(u===0)return null;let p=n.split?.call(n),_=`${i.value}-item`,v=d.value,y=u-1;return U(`div`,Y(Y({},r),{},{class:[m.value,r.class],style:[g.value,r.style]}),[c.map((e,n)=>{let r=o.indexOf(e);r===-1&&(r=`$$space-${n}`);let i={};return l.value||(a===`vertical`?n{let{componentCls:t,antCls:n}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,padding:`${e.pageHeaderPaddingVertical}px ${e.pageHeaderPadding}px`,backgroundColor:e.colorBgContainer,[`&${t}-ghost`]:{backgroundColor:e.pageHeaderGhostBg},"&.has-footer":{paddingBottom:0},[`${t}-back`]:{marginRight:e.marginMD,fontSize:e.fontSizeLG,lineHeight:1,"&-button":Z(Z({},Lr(e)),{color:e.pageHeaderBackColor,cursor:`pointer`})},[`${n}-divider-vertical`]:{height:`14px`,margin:`0 ${e.marginSM}`,verticalAlign:`middle`},[`${n}-breadcrumb + &-heading`]:{marginTop:e.marginXS},[`${t}-heading`]:{display:`flex`,justifyContent:`space-between`,"&-left":{display:`flex`,alignItems:`center`,margin:`${e.marginXS/2}px 0`,overflow:`hidden`},"&-title":Z({marginRight:e.marginSM,marginBottom:0,color:e.colorTextHeading,fontWeight:600,fontSize:e.pageHeaderHeadingTitle,lineHeight:`${e.controlHeight}px`},xe),[`${n}-avatar`]:{marginRight:e.marginSM},"&-sub-title":Z({marginRight:e.marginSM,color:e.colorTextDescription,fontSize:e.pageHeaderHeadingSubTitle,lineHeight:e.lineHeight},xe),"&-extra":{margin:`${e.marginXS/2}px 0`,whiteSpace:`nowrap`,"> *":{marginLeft:e.marginSM,whiteSpace:`unset`},"> *:first-child":{marginLeft:0}}},[`${t}-content`]:{paddingTop:e.pageHeaderContentPaddingVertical},[`${t}-footer`]:{marginTop:e.marginMD,[`${n}-tabs`]:{[`> ${n}-tabs-nav`]:{margin:0,"&::before":{border:`none`}},[`${n}-tabs-tab`]:{paddingTop:e.paddingXS,paddingBottom:e.paddingXS,fontSize:e.pageHeaderTabFontSize}}},[`${t}-compact ${t}-heading`]:{flexWrap:`wrap`},[`&${e.componentCls}-rtl`]:{direction:`rtl`}})}},eV=v(`PageHeader`,e=>[$B(B(e,{pageHeaderPadding:e.paddingLG,pageHeaderPaddingVertical:e.paddingMD,pageHeaderPaddingBreadcrumb:e.paddingSM,pageHeaderContentPaddingVertical:e.paddingSM,pageHeaderBackColor:e.colorTextBase,pageHeaderGhostBg:`transparent`,pageHeaderHeadingTitle:e.fontSizeHeading4,pageHeaderHeadingSubTitle:e.fontSize,pageHeaderTabFontSize:e.fontSizeLG}))]),tV=a(u({compatConfig:{MODE:3},name:`APageHeader`,inheritAttrs:!1,props:{backIcon:pt(),prefixCls:String,title:pt(),subTitle:pt(),breadcrumb:f.object,tags:pt(),footer:pt(),extra:pt(),avatar:Qt(),ghost:{type:Boolean,default:void 0},onBack:Function},slots:Object,setup(e,t){let{emit:n,slots:r,attrs:i}=t,{prefixCls:a,direction:o,pageHeader:s}=X(`page-header`,e),[c,l]=eV(a),u=q(!1),d=sB(),f=e=>{let{width:t}=e;d.value||(u.value=t<768)},p=J(()=>e.ghost??s?.value?.ghost??!0),m=()=>e.backIcon??r.backIcon?.call(r)??(o.value===`rtl`?U(GB,null,null):U(VB,null,null)),h=t=>!t||!e.onBack?null:U(Ke,{componentName:`PageHeader`,children:e=>{let{back:r}=e;return U(`div`,{class:`${a.value}-back`},[U(JB,{onClick:e=>{n(`back`,e)},class:`${a.value}-back-button`,"aria-label":r},{default:()=>[t]})])}},null),g=()=>e.breadcrumb?U(NS,e.breadcrumb,null):r.breadcrumb?.call(r),_=()=>{let{avatar:t}=e,n=e.title??r.title?.call(r),i=e.subTitle??r.subTitle?.call(r),o=e.tags??r.tags?.call(r),s=e.extra??r.extra?.call(r),c=`${a.value}-heading`,l=n||i||o||s;if(!l)return null;let u=m(),d=h(u);return U(`div`,{class:c},[(d||t||l)&&U(`div`,{class:`${c}-left`},[d,t?U(My,t,null):r.avatar?.call(r),n&&U(`span`,{class:`${c}-title`,title:typeof n==`string`?n:void 0},[n]),i&&U(`span`,{class:`${c}-sub-title`,title:typeof i==`string`?i:void 0},[i]),o&&U(`span`,{class:`${c}-tags`},[o])]),s&&U(`span`,{class:`${c}-extra`},[U(QB,null,{default:()=>[s]})])])},v=()=>{let t=e.footer??dt(r.footer?.call(r));return be(t)?null:U(`div`,{class:`${a.value}-footer`},[t])},y=e=>U(`div`,{class:`${a.value}-content`},[e]);return()=>{let t=e.breadcrumb?.routes||r.breadcrumb,n=e.footer||r.footer,s=ce(r.default?.call(r)),d=K(a.value,{"has-breadcrumb":t,"has-footer":n,[`${a.value}-ghost`]:p.value,[`${a.value}-rtl`]:o.value===`rtl`,[`${a.value}-compact`]:u.value},i.class,l.value);return c(U(Qn,{onResize:f},{default:()=>[U(`div`,Y(Y({},i),{},{class:d}),[g(),_(),s.length?y(s):null,v()])]}))}}})),nV=e=>{let{componentCls:t,iconCls:n,zIndexPopup:r,colorText:i,colorWarning:a,marginXS:o,fontSize:s,fontWeightStrong:c,lineHeight:l}=e;return{[t]:{zIndex:r,[`${t}-inner-content`]:{color:i},[`${t}-message`]:{position:`relative`,marginBottom:o,color:i,fontSize:s,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon ${n}`]:{color:a,fontSize:s,flex:`none`,lineHeight:1,paddingTop:(Math.round(s*l)-s)/2},"&-title":{flex:`auto`,marginInlineStart:o},"&-title-only":{fontWeight:c}},[`${t}-description`]:{position:`relative`,marginInlineStart:s+o,marginBottom:o,color:i,fontSize:s},[`${t}-buttons`]:{textAlign:`end`,button:{marginInlineStart:o}}}}},rV=v(`Popconfirm`,e=>nV(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}}),iV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{var e;return((e=s.value)?.getPopupDomNode)?.call(e)}});let[c,l]=df(!1,{value:St(t,`open`)}),u=(e,n)=>{t.open===void 0&&l(e),i(`update:open`,e),i(`openChange`,e,n)},d=e=>{u(!1,e)},f=e=>t.onConfirm?.call(t,e),p=e=>{var n;u(!1,e),(n=t.onCancel)==null||n.call(t,e)},m=e=>{e.keyCode===$.ESC&&c&&u(!1,e)},h=e=>{let{disabled:n}=t;n||u(e)},{prefixCls:g,getPrefixCls:_}=X(`popconfirm`,t),v=J(()=>_()),y=J(()=>_(`btn`)),[b]=rV(g),[x]=Kt(`Popconfirm`,Ye.Popconfirm),S=()=>{let{okButtonProps:e,cancelButtonProps:n,title:i=r.title?.call(r),description:a=r.description?.call(r),cancelText:o=r.cancel?.call(r),okText:s=r.okText?.call(r),okType:c,icon:l=r.icon?.call(r)||U(Wt,null,null),showCancel:u=!0}=t,{cancelButton:m,okButton:h}=r,_=Z({onClick:p,size:`small`},n),v=Z(Z(Z({onClick:f},fb(c)),{size:`small`}),e);return U(`div`,{class:`${g.value}-inner-content`},[U(`div`,{class:`${g.value}-message`},[l&&U(`span`,{class:`${g.value}-message-icon`},[l]),U(`div`,{class:[`${g.value}-message-title`,{[`${g.value}-message-title-only`]:!!a}]},[i])]),a&&U(`div`,{class:`${g.value}-description`},[a]),U(`div`,{class:`${g.value}-buttons`},[u?m?m(_):U(Qb,_,{default:()=>[o||x.value.cancelText]}):null,h?h(v):U(uB,{buttonProps:Z(Z({size:`small`},fb(c)),e),actionFn:f,close:d,prefixCls:y.value,quitOnNullishReturnValue:!0,emitEvent:!0},{default:()=>[s||x.value.okText]})])])};return()=>{let{placement:e,overlayClassName:n,trigger:i=`click`}=t,a=Br(iV(t,[`placement`,`overlayClassName`,`trigger`]),[`title`,`content`,`cancelText`,`okText`,`onUpdate:open`,`onConfirm`,`onCancel`,`prefixCls`]),l=K(g.value,n);return b(U(Ay,Y(Y(Y({},a),o),{},{trigger:i,placement:e,onOpenChange:h,open:c.value,overlayClassName:l,transitionName:Xt(v.value,`zoom-big`,t.transitionName),ref:s,"data-popover-inject":!0}),{default:()=>[oo(r.default?.call(r)||[],{onKeydown:e=>{m(e)}},!1)],content:S}))}}})),oV=[`normal`,`exception`,`active`,`success`],sV=()=>({prefixCls:String,type:_(),percent:Number,format:d(),status:_(),showInfo:Q(),strokeWidth:Number,strokeLinecap:_(),strokeColor:nn(),trailColor:String,width:Number,success:Qt(),gapDegree:Number,gapPosition:_(),size:W([String,Number,Array]),steps:Number,successPercent:Number,title:String,progressStatus:_()});function cV(e){return!e||e<0?0:e>100?100:e}function lV(e){let{success:t,successPercent:n}=e,r=n;return t&&`progress`in t&&(pi(!1,`Progress`,"`success.progress` is deprecated. Please use `success.percent` instead."),r=t.progress),t&&`percent`in t&&(r=t.percent),r}function uV(e){let{percent:t,success:n,successPercent:r}=e,i=cV(lV({success:n,successPercent:r}));return[i,cV(cV(t)-i)]}function dV(e){let{success:t={},strokeColor:n}=e,{strokeColor:r}=t;return[r||ve.green,n||null]}var fV=(e,t,n)=>{let r=-1,i=-1;if(t===`step`){let t=n.steps,a=n.strokeWidth;typeof e==`string`||e===void 0?(r=e===`small`?2:14,i=a??8):typeof e==`number`?[r,i]=[e,e]:[r=14,i=8]=e,r*=t}else if(t===`line`){let t=n?.strokeWidth;typeof e==`string`||e===void 0?i=t||(e===`small`?6:8):typeof e==`number`?[r,i]=[e,e]:[r=-1,i=8]=e}else(t===`circle`||t===`dashboard`)&&(typeof e==`string`||e===void 0?[r,i]=e===`small`?[60,60]:[120,120]:typeof e==`number`?[r,i]=[e,e]:(r=e[0]??e[1]??120,i=e[0]??e[1]??120));return{width:r,height:i}},pV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iZ(Z({},sV()),{strokeColor:nn(),direction:_()}),hV=e=>{let t=[];return Object.keys(e).forEach(n=>{let r=parseFloat(n.replace(/%/g,``));isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((e,t)=>e.key-t.key),t.map(e=>{let{key:t,value:n}=e;return`${n} ${t}%`}).join(`, `)},gV=(e,t)=>{let{from:n=ve.blue,to:r=ve.blue,direction:i=t===`rtl`?`to left`:`to right`}=e,a=pV(e,[`from`,`to`,`direction`]);return Object.keys(a).length===0?{backgroundImage:`linear-gradient(${i}, ${n}, ${r})`}:{backgroundImage:`linear-gradient(${i}, ${hV(a)})`}},_V=u({compatConfig:{MODE:3},name:`ProgressLine`,inheritAttrs:!1,props:mV(),setup(e,t){let{slots:n,attrs:r}=t,i=J(()=>{let{strokeColor:t,direction:n}=e;return t&&typeof t!=`string`?gV(t,n):{backgroundColor:t}}),a=J(()=>e.strokeLinecap===`square`||e.strokeLinecap===`butt`?0:void 0),o=J(()=>e.trailColor?{backgroundColor:e.trailColor}:void 0),s=J(()=>e.size??[-1,e.strokeWidth||(e.size===`small`?6:8)]),c=J(()=>fV(s.value,`line`,{strokeWidth:e.strokeWidth})),l=J(()=>{let{percent:t}=e;return Z({width:`${cV(t)}%`,height:`${c.value.height}px`,borderRadius:a.value},i.value)}),u=J(()=>lV(e)),d=J(()=>{let{success:t}=e;return{width:`${cV(u.value)}%`,height:`${c.value.height}px`,borderRadius:a.value,backgroundColor:t?.strokeColor}}),f={width:c.value.width<0?`100%`:c.value.width,height:`${c.value.height}px`};return()=>U($e,null,[U(`div`,Y(Y({},r),{},{class:[`${e.prefixCls}-outer`,r.class],style:[r.style,f]}),[U(`div`,{class:`${e.prefixCls}-inner`,style:o.value},[U(`div`,{class:`${e.prefixCls}-bg`,style:l.value},null),u.value===void 0?null:U(`div`,{class:`${e.prefixCls}-success-bg`,style:d.value},null)])]),n.default?.call(n)])}}),vV={percent:0,prefixCls:`vc-progress`,strokeColor:`#2db7f5`,strokeLinecap:`round`,strokeWidth:1,trailColor:`#D9D9D9`,trailWidth:1},yV=e=>{let t=H(null);return O(()=>{let n=Date.now(),r=!1;e.value.forEach(e=>{let i=e?.$el||e;if(!i)return;r=!0;let a=i.style;a.transitionDuration=`.3s, .3s, .3s, .06s`,t.value&&n-t.value<100&&(a.transitionDuration=`0s, 0s`)}),r&&(t.value=Date.now())}),e},bV={gapDegree:Number,gapPosition:{type:String},percent:{type:[Array,Number]},prefixCls:String,strokeColor:{type:[Object,String,Array]},strokeLinecap:{type:String},strokeWidth:Number,trailColor:String,trailWidth:Number,transition:String},xV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=50-r/2,s=0,c=-o,l=0,u=-2*o;switch(a){case`left`:s=-o,c=0,l=2*o,u=0;break;case`right`:s=o,c=0,l=-2*o,u=0;break;case`bottom`:c=o,u=2*o;break;default:}let d=`M 50,50 m ${s},${c} + a ${o},${o} 0 1 1 ${l},${-u} + a ${o},${o} 0 1 1 ${-l},${u}`,f=Math.PI*2*o;return{pathString:d,pathStyle:{stroke:n,strokeDasharray:`${t/100*(f-i)}px ${f}px`,strokeDashoffset:`-${i/2+e/100*(f-i)}px`,transition:`stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s`}}}var EV=u({compatConfig:{MODE:3},name:`VCCircle`,props:Zn(bV,vV),setup(e){SV+=1;let t=H(SV),n=J(()=>wV(e.percent)),r=J(()=>wV(e.strokeColor)),[i,a]=CE();yV(a);let o=()=>{let{prefixCls:a,strokeWidth:o,strokeLinecap:s,gapDegree:c,gapPosition:l}=e,u=0;return n.value.map((e,n)=>{let d=r.value[n]||r.value[r.value.length-1],f=Object.prototype.toString.call(d)===`[object Object]`?`url(#${a}-gradient-${t.value})`:``,{pathString:p,pathStyle:m}=TV(u,e,d,o,c,l);u+=e;let h={key:n,d:p,stroke:f,"stroke-linecap":s,"stroke-width":o,opacity:e===0?0:1,"fill-opacity":`0`,class:`${a}-circle-path`,style:m};return U(`path`,Y({ref:i(n)},h),null)})};return()=>{let{prefixCls:n,strokeWidth:i,trailWidth:a,gapDegree:s,gapPosition:c,trailColor:l,strokeLinecap:u,strokeColor:d}=e,f=xV(e,[`prefixCls`,`strokeWidth`,`trailWidth`,`gapDegree`,`gapPosition`,`trailColor`,`strokeLinecap`,`strokeColor`]),{pathString:p,pathStyle:m}=TV(0,100,l,i,s,c);delete f.percent;let h=r.value.find(e=>Object.prototype.toString.call(e)===`[object Object]`),g={d:p,stroke:l,"stroke-linecap":u,"stroke-width":a||i,"fill-opacity":`0`,class:`${n}-circle-trail`,style:m};return U(`svg`,Y({class:`${n}-circle`,viewBox:`0 0 100 100`},f),[h&&U(`defs`,null,[U(`linearGradient`,{id:`${n}-gradient-${t.value}`,x1:`100%`,y1:`0%`,x2:`0%`,y2:`0%`},[Object.keys(h).sort((e,t)=>CV(e)-CV(t)).map((e,t)=>U(`stop`,{key:t,offset:e,"stop-color":h[e]},null))])]),U(`path`,g,null),o().reverse()])}}}),DV=()=>Z(Z({},sV()),{strokeColor:nn()}),OV=3,kV=e=>OV/e*100,AV=u({compatConfig:{MODE:3},name:`ProgressCircle`,inheritAttrs:!1,props:Zn(DV(),{trailColor:null}),setup(e,t){let{slots:n,attrs:r}=t,i=J(()=>e.width??120),a=J(()=>e.size??[i.value,i.value]),o=J(()=>fV(a.value,`circle`)),s=J(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type===`dashboard`)return 75}),c=J(()=>({width:`${o.value.width}px`,height:`${o.value.height}px`,fontSize:`${o.value.width*.15+6}px`})),l=J(()=>e.strokeWidth??Math.max(kV(o.value.width),6)),u=J(()=>e.gapPosition||e.type===`dashboard`&&`bottom`||void 0),d=J(()=>uV(e)),f=J(()=>Object.prototype.toString.call(e.strokeColor)===`[object Object]`),p=J(()=>dV({success:e.success,strokeColor:e.strokeColor})),m=J(()=>({[`${e.prefixCls}-inner`]:!0,[`${e.prefixCls}-circle-gradient`]:f.value}));return()=>{let t=U(EV,{percent:d.value,strokeWidth:l.value,trailWidth:l.value,strokeColor:p.value,strokeLinecap:e.strokeLinecap,trailColor:e.trailColor,prefixCls:e.prefixCls,gapDegree:s.value,gapPosition:u.value},null);return U(`div`,Y(Y({},r),{},{class:[m.value,r.class],style:[r.style,c.value]}),[o.value.width<=20?U(Ty,null,{default:()=>[U(`span`,null,[t])],title:n.default}):U($e,null,[t,n.default?.call(n)])])}}}),jV=u({compatConfig:{MODE:3},name:`Steps`,props:Z(Z({},sV()),{steps:Number,strokeColor:W(),trailColor:String}),setup(e,t){let{slots:n}=t,r=J(()=>Math.round(e.steps*((e.percent||0)/100))),i=J(()=>e.size??[e.size===`small`?2:14,e.strokeWidth||8]),a=J(()=>fV(i.value,`step`,{steps:e.steps,strokeWidth:e.strokeWidth||8})),o=J(()=>{let{steps:t,strokeColor:n,trailColor:i,prefixCls:o}=e,s=[];for(let e=0;eU(`div`,{class:`${e.prefixCls}-steps-outer`},[o.value,n.default?.call(n)])}}),MV=new N(`antProgressActive`,{"0%":{transform:`translateX(-100%) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(-100%) scaleX(0)`,opacity:.5},to:{transform:`translateX(0) scaleX(1)`,opacity:0}}),NV=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:Z(Z({},rn(e)),{display:`inline-block`,"&-rtl":{direction:`rtl`},"&-line":{position:`relative`,width:`100%`,fontSize:e.fontSize,marginInlineEnd:e.marginXS,marginBottom:e.marginXS},[`${t}-outer`]:{display:`inline-block`,width:`100%`},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${e.marginXS}px)`,paddingInlineEnd:`calc(2em + ${e.paddingXS}px)`}},[`${t}-inner`]:{position:`relative`,display:`inline-block`,width:`100%`,overflow:`hidden`,verticalAlign:`middle`,backgroundColor:e.progressRemainingColor,borderRadius:e.progressLineRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorInfo}},[`${t}-success-bg, ${t}-bg`]:{position:`relative`,backgroundColor:e.colorInfo,borderRadius:e.progressLineRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-success-bg`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:`inline-block`,width:`2em`,marginInlineStart:e.marginXS,color:e.progressInfoTextColor,lineHeight:1,whiteSpace:`nowrap`,textAlign:`start`,verticalAlign:`middle`,wordBreak:`normal`,[n]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:`absolute`,inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.progressLineRadius,opacity:0,animationName:MV,animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:`infinite`,content:`""`}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},PV=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.progressRemainingColor},[`&${t}-circle ${t}-inner`]:{position:`relative`,lineHeight:1,backgroundColor:`transparent`},[`&${t}-circle ${t}-text`]:{position:`absolute`,insetBlockStart:`50%`,insetInlineStart:0,width:`100%`,margin:0,padding:0,color:e.colorText,lineHeight:1,whiteSpace:`normal`,textAlign:`center`,transform:`translateY(-50%)`,[n]:{fontSize:`${e.fontSize/e.fontSizeSM}em`}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:`bottom`}}}},FV=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:`inline-block`,"&-outer":{display:`flex`,flexDirection:`row`,alignItems:`center`},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.progressRemainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.colorInfo}}}}}},IV=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},LV=v(`Progress`,e=>{let t=e.marginXXS/2,n=B(e,{progressLineRadius:100,progressInfoTextColor:e.colorText,progressDefaultColor:e.colorInfo,progressRemainingColor:e.colorFillSecondary,progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:`2.4s`});return[NV(n),PV(n),FV(n),IV(n)]}),RV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iArray.isArray(e.strokeColor)?e.strokeColor[0]:e.strokeColor),l=J(()=>{let{percent:t=0}=e,n=lV(e);return parseInt(n===void 0?t.toString():n.toString(),10)}),u=J(()=>{let{status:t}=e;return!oV.includes(t)&&l.value>=100?`success`:t||`normal`}),d=J(()=>{let{type:t,showInfo:n,size:r}=e,o=i.value;return{[o]:!0,[`${o}-inline-circle`]:t===`circle`&&fV(r,`circle`).width<=20,[`${o}-${t===`dashboard`&&`circle`||t}`]:!0,[`${o}-status-${u.value}`]:!0,[`${o}-show-info`]:n,[`${o}-${r}`]:r,[`${o}-rtl`]:a.value===`rtl`,[s.value]:!0}}),f=J(()=>typeof e.strokeColor==`string`||Array.isArray(e.strokeColor)?e.strokeColor:void 0),p=()=>{let{showInfo:t,format:r,type:a,percent:o,title:s}=e,c=lV(e);if(!t)return null;let l,d=r||n?.format||(e=>`${e}%`),f=a===`line`;return r||n?.format||u.value!==`exception`&&u.value!==`success`?l=d(cV(o),cV(c)):u.value===`exception`?l=U(f?tt:Pe,null,null):u.value===`success`&&(l=U(f?qe:Df,null,null)),U(`span`,{class:`${i.value}-text`,title:s===void 0&&typeof l==`string`?l:void 0},[l])};return()=>{let{type:t,steps:n,title:s}=e,{class:l}=r,m=RV(r,[`class`]),h=p(),g;return t===`line`?g=n?U(jV,Y(Y({},e),{},{strokeColor:f.value,prefixCls:i.value,steps:n}),{default:()=>[h]}):U(_V,Y(Y({},e),{},{strokeColor:c.value,prefixCls:i.value,direction:a.value}),{default:()=>[h]}):(t===`circle`||t===`dashboard`)&&(g=U(AV,Y(Y({},e),{},{prefixCls:i.value,strokeColor:c.value,progressStatus:u.value}),{default:()=>[h]})),o(U(`div`,Y(Y({role:`progressbar`},m),{},{class:[d.value,l],title:s}),[g]))}}}));function BV(e){let t=e.scrollX,n=`scrollLeft`;if(typeof t!=`number`){let r=e.document;t=r.documentElement[n],typeof t!=`number`&&(t=r.body[n])}return t}function VV(e){let t,n,r=e.ownerDocument,{body:i}=r,a=r&&r.documentElement,o=e.getBoundingClientRect();return t=o.left,n=o.top,t-=a.clientLeft||i.clientLeft||0,n-=a.clientTop||i.clientTop||0,{left:t,top:n}}function HV(e){let t=VV(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=BV(r),t.left}var UV={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z`}}]},name:`star`,theme:`filled`};function WV(e){for(var t=1;t{let{index:r}=e;n(`hover`,t,r)},i=t=>{let{index:r}=e;n(`click`,t,r)},a=t=>{let{index:r}=e;t.keyCode===13&&n(`click`,t,r)},o=J(()=>{let{prefixCls:t,index:n,value:r,allowHalf:i,focused:a}=e,o=n+1,s=t;return r===0&&n===0&&a?s+=` ${t}-focused`:i&&r+.5>=o&&r{let{disabled:t,prefixCls:n,characterRender:s,character:c,index:l,count:u,value:d}=e,f=typeof c==`function`?c({disabled:t,prefixCls:n,index:l,count:u,value:d}):c,p=U(`li`,{class:o.value},[U(`div`,{onClick:t?null:i,onKeydown:t?null:a,onMousemove:t?null:r,role:`radio`,"aria-checked":d>l?`true`:`false`,"aria-posinset":l+1,"aria-setsize":u,tabindex:t?-1:0},[U(`div`,{class:`${n}-first`},[f]),U(`div`,{class:`${n}-second`},[f])])]);return s&&(p=s(p,e)),p}}}),JV=e=>{let{componentCls:t}=e;return{[`${t}-star`]:{position:`relative`,display:`inline-block`,color:`inherit`,cursor:`pointer`,"&:not(:last-child)":{marginInlineEnd:e.marginXS},"> div":{transition:`all ${e.motionDurationMid}, outline 0s`,"&:hover":{transform:e.rateStarHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${e.lineWidth}px dashed ${e.rateStarColor}`,transform:e.rateStarHoverScale}},"&-first, &-second":{color:e.defaultColor,transition:`all ${e.motionDurationMid}`,userSelect:`none`,[e.iconCls]:{verticalAlign:`middle`}},"&-first":{position:`absolute`,top:0,insetInlineStart:0,width:`50%`,height:`100%`,overflow:`hidden`,opacity:0},[`&-half ${t}-star-first, &-half ${t}-star-second`]:{opacity:1},[`&-half ${t}-star-first, &-full ${t}-star-second`]:{color:`inherit`}}}},YV=e=>({[`&-rtl${e.componentCls}`]:{direction:`rtl`}}),XV=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z({},rn(e)),{display:`inline-block`,margin:0,padding:0,color:e.rateStarColor,fontSize:e.rateStarSize,lineHeight:`unset`,listStyle:`none`,outline:`none`,[`&-disabled${t} ${t}-star`]:{cursor:`default`,"&:hover":{transform:`scale(1)`}}}),JV(e)),{[`+ ${t}-text`]:{display:`inline-block`,marginInlineStart:e.marginXS,fontSize:e.fontSize}}),YV(e))}},ZV=v(`Rate`,e=>{let{colorFillContent:t}=e;return[XV(B(e,{rateStarColor:e[`yellow-6`],rateStarSize:e.controlHeightLG*.5,rateStarHoverScale:`scale(1.1)`,defaultColor:t}))]}),QV=a(u({compatConfig:{MODE:3},name:`ARate`,inheritAttrs:!1,props:Zn({prefixCls:String,count:Number,value:Number,allowHalf:{type:Boolean,default:void 0},allowClear:{type:Boolean,default:void 0},tooltips:Array,disabled:{type:Boolean,default:void 0},character:f.any,autofocus:{type:Boolean,default:void 0},tabindex:f.oneOfType([f.number,f.string]),direction:String,id:String,onChange:Function,onHoverChange:Function,"onUpdate:value":Function,onFocus:Function,onBlur:Function,onKeydown:Function},{value:0,count:5,allowHalf:!1,allowClear:!0,tabindex:0,direction:`ltr`}),setup(e,t){let{slots:n,attrs:r,emit:i,expose:a}=t,{prefixCls:o,direction:s}=X(`rate`,e),[c,l]=ZV(o),u=zf(),d=H(),[f,p]=CE(),m=Ne({value:e.value,focused:!1,cleanedValue:null,hoverValue:void 0});G(()=>e.value,()=>{m.value=e.value});let h=e=>ae(p.value.get(e)),g=(t,n)=>{let r=s.value===`rtl`,i=t+1;if(e.allowHalf){let e=h(t),a=HV(e),o=e.clientWidth;(r&&n-a>o/2||!r&&n-a{e.value===void 0&&(m.value=t),i(`update:value`,t),i(`change`,t),u.onFieldChange()},v=(e,t)=>{let n=g(t,e.pageX);n!==m.cleanedValue&&(m.hoverValue=n,m.cleanedValue=null),i(`hoverChange`,n)},y=()=>{m.hoverValue=void 0,m.cleanedValue=null,i(`hoverChange`,void 0)},b=(t,n)=>{let{allowClear:r}=e,i=g(n,t.pageX),a=!1;r&&(a=i===m.value),y(),_(a?0:i),m.cleanedValue=a?i:null},x=e=>{m.focused=!0,i(`focus`,e)},S=e=>{m.focused=!1,i(`blur`,e),u.onFieldBlur()},C=t=>{let{keyCode:n}=t,{count:r,allowHalf:a}=e,o=s.value===`rtl`;n===$.RIGHT&&m.value0&&!o||n===$.RIGHT&&m.value>0&&o?(a?m.value-=.5:--m.value,_(m.value),t.preventDefault()):n===$.LEFT&&m.value{e.disabled||d.value.focus()};a({focus:w,blur:()=>{e.disabled||d.value.blur()}}),V(()=>{let{autofocus:t,disabled:n}=e;t&&!n&&w()});let T=(t,n)=>{let{index:r}=n,{tooltips:i}=e;return i?U(Ty,{title:i[r]},{default:()=>[t]}):t};return()=>{let{count:t,allowHalf:i,disabled:a,tabindex:p,id:h=u.id.value}=e,{class:g,style:_}=r,w=[],E=a?`${o.value}-disabled`:``,D=e.character||n.character||(()=>U(KV,null,null));for(let e=0;eU(`svg`,{width:`252`,height:`294`},[U(`defs`,null,[U(`path`,{d:`M0 .387h251.772v251.772H0z`},null)]),U(`g`,{fill:`none`,"fill-rule":`evenodd`},[U(`g`,{transform:`translate(0 .012)`},[U(`mask`,{fill:`#fff`},null),U(`path`,{d:`M0 127.32v-2.095C0 56.279 55.892.387 124.838.387h2.096c68.946 0 124.838 55.892 124.838 124.838v2.096c0 68.946-55.892 124.838-124.838 124.838h-2.096C55.892 252.16 0 196.267 0 127.321`,fill:`#E4EBF7`,mask:`url(#b)`},null)]),U(`path`,{d:`M39.755 130.84a8.276 8.276 0 1 1-16.468-1.66 8.276 8.276 0 0 1 16.468 1.66`,fill:`#FFF`},null),U(`path`,{d:`M36.975 134.297l10.482 5.943M48.373 146.508l-12.648 10.788`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M39.875 159.352a5.667 5.667 0 1 1-11.277-1.136 5.667 5.667 0 0 1 11.277 1.136M57.588 143.247a5.708 5.708 0 1 1-11.358-1.145 5.708 5.708 0 0 1 11.358 1.145M99.018 26.875l29.82-.014a4.587 4.587 0 1 0-.003-9.175l-29.82.013a4.587 4.587 0 1 0 .003 9.176M110.424 45.211l29.82-.013a4.588 4.588 0 0 0-.004-9.175l-29.82.013a4.587 4.587 0 1 0 .004 9.175`,fill:`#FFF`},null),U(`path`,{d:`M112.798 26.861v-.002l15.784-.006a4.588 4.588 0 1 0 .003 9.175l-15.783.007v-.002a4.586 4.586 0 0 0-.004-9.172M184.523 135.668c-.553 5.485-5.447 9.483-10.931 8.93-5.485-.553-9.483-5.448-8.93-10.932.552-5.485 5.447-9.483 10.932-8.93 5.485.553 9.483 5.447 8.93 10.932`,fill:`#FFF`},null),U(`path`,{d:`M179.26 141.75l12.64 7.167M193.006 156.477l-15.255 13.011`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M184.668 170.057a6.835 6.835 0 1 1-13.6-1.372 6.835 6.835 0 0 1 13.6 1.372M203.34 153.325a6.885 6.885 0 1 1-13.7-1.382 6.885 6.885 0 0 1 13.7 1.382`,fill:`#FFF`},null),U(`path`,{d:`M151.931 192.324a2.222 2.222 0 1 1-4.444 0 2.222 2.222 0 0 1 4.444 0zM225.27 116.056a2.222 2.222 0 1 1-4.445 0 2.222 2.222 0 0 1 4.444 0zM216.38 151.08a2.223 2.223 0 1 1-4.446-.001 2.223 2.223 0 0 1 4.446 0zM176.917 107.636a2.223 2.223 0 1 1-4.445 0 2.223 2.223 0 0 1 4.445 0zM195.291 92.165a2.223 2.223 0 1 1-4.445 0 2.223 2.223 0 0 1 4.445 0zM202.058 180.711a2.223 2.223 0 1 1-4.446 0 2.223 2.223 0 0 1 4.446 0z`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{stroke:`#FFF`,"stroke-width":`2`,d:`M214.404 153.302l-1.912 20.184-10.928 5.99M173.661 174.792l-6.356 9.814h-11.36l-4.508 6.484M174.941 125.168v-15.804M220.824 117.25l-12.84 7.901-15.31-7.902V94.39`},null),U(`path`,{d:`M166.588 65.936h-3.951a4.756 4.756 0 0 1-4.743-4.742 4.756 4.756 0 0 1 4.743-4.743h3.951a4.756 4.756 0 0 1 4.743 4.743 4.756 4.756 0 0 1-4.743 4.742`,fill:`#FFF`},null),U(`path`,{d:`M174.823 30.03c0-16.281 13.198-29.48 29.48-29.48 16.28 0 29.48 13.199 29.48 29.48 0 16.28-13.2 29.48-29.48 29.48-16.282 0-29.48-13.2-29.48-29.48`,fill:`#1890FF`},null),U(`path`,{d:`M205.952 38.387c.5.5.785 1.142.785 1.928s-.286 1.465-.785 1.964c-.572.5-1.214.75-2 .75-.785 0-1.429-.285-1.929-.785-.572-.5-.82-1.143-.82-1.929s.248-1.428.82-1.928c.5-.5 1.144-.75 1.93-.75.785 0 1.462.25 1.999.75m4.285-19.463c1.428 1.249 2.143 2.963 2.143 5.142 0 1.712-.427 3.13-1.219 4.25-.067.096-.137.18-.218.265-.416.429-1.41 1.346-2.956 2.699a5.07 5.07 0 0 0-1.428 1.75 5.207 5.207 0 0 0-.536 2.357v.5h-4.107v-.5c0-1.357.215-2.536.714-3.5.464-.964 1.857-2.464 4.178-4.536l.43-.5c.643-.785.964-1.643.964-2.535 0-1.18-.358-2.108-1-2.785-.678-.68-1.643-1.001-2.858-1.001-1.536 0-2.642.464-3.357 1.43-.37.5-.621 1.135-.76 1.904a1.999 1.999 0 0 1-1.971 1.63h-.004c-1.277 0-2.257-1.183-1.98-2.43.337-1.518 1.02-2.78 2.073-3.784 1.536-1.5 3.607-2.25 6.25-2.25 2.32 0 4.214.607 5.642 1.894`,fill:`#FFF`},null),U(`path`,{d:`M52.04 76.131s21.81 5.36 27.307 15.945c5.575 10.74-6.352 9.26-15.73 4.935-10.86-5.008-24.7-11.822-11.577-20.88`,fill:`#FFB594`},null),U(`path`,{d:`M90.483 67.504l-.449 2.893c-.753.49-4.748-2.663-4.748-2.663l-1.645.748-1.346-5.684s6.815-4.589 8.917-5.018c2.452-.501 9.884.94 10.7 2.278 0 0 1.32.486-2.227.69-3.548.203-5.043.447-6.79 3.132-1.747 2.686-2.412 3.624-2.412 3.624`,fill:`#FFC6A0`},null),U(`path`,{d:`M128.055 111.367c-2.627-7.724-6.15-13.18-8.917-15.478-3.5-2.906-9.34-2.225-11.366-4.187-1.27-1.231-3.215-1.197-3.215-1.197s-14.98-3.158-16.828-3.479c-2.37-.41-2.124-.714-6.054-1.405-1.57-1.907-2.917-1.122-2.917-1.122l-7.11-1.383c-.853-1.472-2.423-1.023-2.423-1.023l-2.468-.897c-1.645 9.976-7.74 13.796-7.74 13.796 1.795 1.122 15.703 8.3 15.703 8.3l5.107 37.11s-3.321 5.694 1.346 9.109c0 0 19.883-3.743 34.921-.329 0 0 3.047-2.546.972-8.806.523-3.01 1.394-8.263 1.736-11.622.385.772 2.019 1.918 3.14 3.477 0 0 9.407-7.365 11.052-14.012-.832-.723-1.598-1.585-2.267-2.453-.567-.736-.358-2.056-.765-2.717-.669-1.084-1.804-1.378-1.907-1.682`,fill:`#FFF`},null),U(`path`,{d:`M101.09 289.998s4.295 2.041 7.354 1.021c2.821-.94 4.53.668 7.08 1.178 2.55.51 6.874 1.1 11.686-1.26-.103-5.51-6.889-3.98-11.96-6.713-2.563-1.38-3.784-4.722-3.598-8.799h-9.402s-1.392 10.52-1.16 14.573`,fill:`#CBD1D1`},null),U(`path`,{d:`M101.067 289.826s2.428 1.271 6.759.653c3.058-.437 3.712.481 7.423 1.031 3.712.55 10.724-.069 11.823-.894.413 1.1-.343 2.063-.343 2.063s-1.512.603-4.812.824c-2.03.136-5.8.291-7.607-.503-1.787-1.375-5.247-1.903-5.728-.241-3.918.95-7.355-.286-7.355-.286l-.16-2.647z`,fill:`#2B0849`},null),U(`path`,{d:`M108.341 276.044h3.094s-.103 6.702 4.536 8.558c-4.64.618-8.558-2.303-7.63-8.558`,fill:`#A4AABA`},null),U(`path`,{d:`M57.542 272.401s-2.107 7.416-4.485 12.306c-1.798 3.695-4.225 7.492 5.465 7.492 6.648 0 8.953-.48 7.423-6.599-1.53-6.12.266-13.199.266-13.199h-8.669z`,fill:`#CBD1D1`},null),U(`path`,{d:`M51.476 289.793s2.097 1.169 6.633 1.169c6.083 0 8.249-1.65 8.249-1.65s.602 1.114-.619 2.165c-.993.855-3.597 1.591-7.39 1.546-4.145-.048-5.832-.566-6.736-1.168-.825-.55-.687-1.58-.137-2.062`,fill:`#2B0849`},null),U(`path`,{d:`M58.419 274.304s.033 1.519-.314 2.93c-.349 1.42-1.078 3.104-1.13 4.139-.058 1.151 4.537 1.58 5.155.034.62-1.547 1.294-6.427 1.913-7.252.619-.825-4.903-2.119-5.624.15`,fill:`#A4AABA`},null),U(`path`,{d:`M99.66 278.514l13.378.092s1.298-54.52 1.853-64.403c.554-9.882 3.776-43.364 1.002-63.128l-12.547-.644-22.849.78s-.434 3.966-1.195 9.976c-.063.496-.682.843-.749 1.365-.075.585.423 1.354.32 1.966-2.364 14.08-6.377 33.104-8.744 46.677-.116.666-1.234 1.009-1.458 2.691-.04.302.211 1.525.112 1.795-6.873 18.744-10.949 47.842-14.277 61.885l14.607-.014s2.197-8.57 4.03-16.97c2.811-12.886 23.111-85.01 23.111-85.01l3.016-.521 1.043 46.35s-.224 1.234.337 2.02c.56.785-.56 1.123-.392 2.244l.392 1.794s-.449 7.178-.898 11.89c-.448 4.71-.092 39.165-.092 39.165`,fill:`#7BB2F9`},null),U(`path`,{d:`M76.085 221.626c1.153.094 4.038-2.019 6.955-4.935M106.36 225.142s2.774-1.11 6.103-3.883`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M107.275 222.1s2.773-1.11 6.102-3.884`,stroke:`#648BD8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M74.74 224.767s2.622-.591 6.505-3.365M86.03 151.634c-.27 3.106.3 8.525-4.336 9.123M103.625 149.88s.11 14.012-1.293 15.065c-2.219 1.664-2.99 1.944-2.99 1.944M99.79 150.438s.035 12.88-1.196 24.377M93.673 175.911s7.212-1.664 9.431-1.664M74.31 205.861a212.013 212.013 0 0 1-.979 4.56s-1.458 1.832-1.009 3.776c.449 1.944-.947 2.045-4.985 15.355-1.696 5.59-4.49 18.591-6.348 27.597l-.231 1.12M75.689 197.807a320.934 320.934 0 0 1-.882 4.754M82.591 152.233L81.395 162.7s-1.097.15-.5 2.244c.113 1.346-2.674 15.775-5.18 30.43M56.12 274.418h13.31`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M116.241 148.22s-17.047-3.104-35.893.2c.158 2.514-.003 4.15-.003 4.15s14.687-2.818 35.67-.312c.252-2.355.226-4.038.226-4.038`,fill:`#192064`},null),U(`path`,{d:`M106.322 151.165l.003-4.911a.81.81 0 0 0-.778-.815c-2.44-.091-5.066-.108-7.836-.014a.818.818 0 0 0-.789.815l-.003 4.906a.81.81 0 0 0 .831.813c2.385-.06 4.973-.064 7.73.017a.815.815 0 0 0 .842-.81`,fill:`#FFF`},null),U(`path`,{d:`M105.207 150.233l.002-3.076a.642.642 0 0 0-.619-.646 94.321 94.321 0 0 0-5.866-.01.65.65 0 0 0-.63.647v3.072a.64.64 0 0 0 .654.644 121.12 121.12 0 0 1 5.794.011c.362.01.665-.28.665-.642`,fill:`#192064`},null),U(`path`,{d:`M100.263 275.415h12.338M101.436 270.53c.006 3.387.042 5.79.111 6.506M101.451 264.548a915.75 915.75 0 0 0-.015 4.337M100.986 174.965l.898 44.642s.673 1.57-.225 2.692c-.897 1.122 2.468.673.898 2.243-1.57 1.57.897 1.122 0 3.365-.596 1.489-.994 21.1-1.096 35.146`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M46.876 83.427s-.516 6.045 7.223 5.552c11.2-.712 9.218-9.345 31.54-21.655-.786-2.708-2.447-4.744-2.447-4.744s-11.068 3.11-22.584 8.046c-6.766 2.9-13.395 6.352-13.732 12.801M104.46 91.057l.941-5.372-8.884-11.43-5.037 5.372-1.74 7.834a.321.321 0 0 0 .108.32c.965.8 6.5 5.013 14.347 3.544a.332.332 0 0 0 .264-.268`,fill:`#FFC6A0`},null),U(`path`,{d:`M93.942 79.387s-4.533-2.853-2.432-6.855c1.623-3.09 4.513 1.133 4.513 1.133s.52-3.642 3.121-3.642c.52-1.04 1.561-4.162 1.561-4.162s11.445 2.601 13.526 3.121c0 5.203-2.304 19.424-7.84 19.861-8.892.703-12.449-9.456-12.449-9.456`,fill:`#FFC6A0`},null),U(`path`,{d:`M113.874 73.446c2.601-2.081 3.47-9.722 3.47-9.722s-2.479-.49-6.64-2.05c-4.683-2.081-12.798-4.747-17.48.976-9.668 3.223-2.05 19.823-2.05 19.823l2.713-3.021s-3.935-3.287-2.08-6.243c2.17-3.462 3.92 1.073 3.92 1.073s.637-2.387 3.581-3.342c.355-.71 1.036-2.674 1.432-3.85a1.073 1.073 0 0 1 1.263-.704c2.4.558 8.677 2.019 11.356 2.662.522.125.871.615.82 1.15l-.305 3.248z`,fill:`#520038`},null),U(`path`,{d:`M104.977 76.064c-.103.61-.582 1.038-1.07.956-.489-.083-.801-.644-.698-1.254.103-.61.582-1.038 1.07-.956.488.082.8.644.698 1.254M112.132 77.694c-.103.61-.582 1.038-1.07.956-.488-.083-.8-.644-.698-1.254.103-.61.582-1.038 1.07-.956.488.082.8.643.698 1.254`,fill:`#552950`},null),U(`path`,{stroke:`#DB836E`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M110.13 74.84l-.896 1.61-.298 4.357h-2.228`},null),U(`path`,{d:`M110.846 74.481s1.79-.716 2.506.537`,stroke:`#5C2552`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M92.386 74.282s.477-1.114 1.113-.716c.637.398 1.274 1.433.558 1.99-.717.556.159 1.67.159 1.67`,stroke:`#DB836E`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M103.287 72.93s1.83 1.113 4.137.954`,stroke:`#5C2552`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M103.685 81.762s2.227 1.193 4.376 1.193M104.64 84.308s.954.398 1.511.318M94.693 81.205s2.308 7.4 10.424 7.639`,stroke:`#DB836E`,"stroke-width":`1.118`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M81.45 89.384s.45 5.647-4.935 12.787M69 82.654s-.726 9.282-8.204 14.206`,stroke:`#E4EBF7`,"stroke-width":`1.101`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M129.405 122.865s-5.272 7.403-9.422 10.768`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M119.306 107.329s.452 4.366-2.127 32.062`,stroke:`#E4EBF7`,"stroke-width":`1.101`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M150.028 151.232h-49.837a1.01 1.01 0 0 1-1.01-1.01v-31.688c0-.557.452-1.01 1.01-1.01h49.837c.558 0 1.01.453 1.01 1.01v31.688a1.01 1.01 0 0 1-1.01 1.01`,fill:`#F2D7AD`},null),U(`path`,{d:`M150.29 151.232h-19.863v-33.707h20.784v32.786a.92.92 0 0 1-.92.92`,fill:`#F4D19D`},null),U(`path`,{d:`M123.554 127.896H92.917a.518.518 0 0 1-.425-.816l6.38-9.113c.193-.277.51-.442.85-.442h31.092l-7.26 10.371z`,fill:`#F2D7AD`},null),U(`path`,{fill:`#CC9B6E`,d:`M123.689 128.447H99.25v-.519h24.169l7.183-10.26.424.298z`},null),U(`path`,{d:`M158.298 127.896h-18.669a2.073 2.073 0 0 1-1.659-.83l-7.156-9.541h19.965c.49 0 .95.23 1.244.622l6.69 8.92a.519.519 0 0 1-.415.83`,fill:`#F4D19D`},null),U(`path`,{fill:`#CC9B6E`,d:`M157.847 128.479h-19.384l-7.857-10.475.415-.31 7.7 10.266h19.126zM130.554 150.685l-.032-8.177.519-.002.032 8.177z`},null),U(`path`,{fill:`#CC9B6E`,d:`M130.511 139.783l-.08-21.414.519-.002.08 21.414zM111.876 140.932l-.498-.143 1.479-5.167.498.143zM108.437 141.06l-2.679-2.935 2.665-3.434.41.318-2.397 3.089 2.384 2.612zM116.607 141.06l-.383-.35 2.383-2.612-2.397-3.089.41-.318 2.665 3.434z`},null),U(`path`,{d:`M154.316 131.892l-3.114-1.96.038 3.514-1.043.092c-1.682.115-3.634.23-4.789.23-1.902 0-2.693 2.258 2.23 2.648l-2.645-.596s-2.168 1.317.504 2.3c0 0-1.58 1.217.561 2.58-.584 3.504 5.247 4.058 7.122 3.59 1.876-.47 4.233-2.359 4.487-5.16.28-3.085-.89-5.432-3.35-7.238`,fill:`#FFC6A0`},null),U(`path`,{d:`M153.686 133.577s-6.522.47-8.36.372c-1.836-.098-1.904 2.19 2.359 2.264 3.739.15 5.451-.044 5.451-.044`,stroke:`#DB836E`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M145.16 135.877c-1.85 1.346.561 2.355.561 2.355s3.478.898 6.73.617`,stroke:`#DB836E`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M151.89 141.71s-6.28.111-6.73-2.132c-.223-1.346.45-1.402.45-1.402M146.114 140.868s-1.103 3.16 5.44 3.533M151.202 129.932v3.477M52.838 89.286c3.533-.337 8.423-1.248 13.582-7.754`,stroke:`#DB836E`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M168.567 248.318a6.647 6.647 0 0 1-6.647-6.647v-66.466a6.647 6.647 0 1 1 13.294 0v66.466a6.647 6.647 0 0 1-6.647 6.647`,fill:`#5BA02E`},null),U(`path`,{d:`M176.543 247.653a6.647 6.647 0 0 1-6.646-6.647v-33.232a6.647 6.647 0 1 1 13.293 0v33.232a6.647 6.647 0 0 1-6.647 6.647`,fill:`#92C110`},null),U(`path`,{d:`M186.443 293.613H158.92a3.187 3.187 0 0 1-3.187-3.187v-46.134a3.187 3.187 0 0 1 3.187-3.187h27.524a3.187 3.187 0 0 1 3.187 3.187v46.134a3.187 3.187 0 0 1-3.187 3.187`,fill:`#F2D7AD`},null),U(`path`,{d:`M88.979 89.48s7.776 5.384 16.6 2.842`,stroke:`#E4EBF7`,"stroke-width":`1.101`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null)])]),iH=()=>U(`svg`,{width:`254`,height:`294`},[U(`defs`,null,[U(`path`,{d:`M0 .335h253.49v253.49H0z`},null),U(`path`,{d:`M0 293.665h253.49V.401H0z`},null)]),U(`g`,{fill:`none`,"fill-rule":`evenodd`},[U(`g`,{transform:`translate(0 .067)`},[U(`mask`,{fill:`#fff`},null),U(`path`,{d:`M0 128.134v-2.11C0 56.608 56.273.334 125.69.334h2.11c69.416 0 125.69 56.274 125.69 125.69v2.11c0 69.417-56.274 125.69-125.69 125.69h-2.11C56.273 253.824 0 197.551 0 128.134`,fill:`#E4EBF7`,mask:`url(#b)`},null)]),U(`path`,{d:`M39.989 132.108a8.332 8.332 0 1 1-16.581-1.671 8.332 8.332 0 0 1 16.58 1.671`,fill:`#FFF`},null),U(`path`,{d:`M37.19 135.59l10.553 5.983M48.665 147.884l-12.734 10.861`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M40.11 160.816a5.706 5.706 0 1 1-11.354-1.145 5.706 5.706 0 0 1 11.354 1.145M57.943 144.6a5.747 5.747 0 1 1-11.436-1.152 5.747 5.747 0 0 1 11.436 1.153M99.656 27.434l30.024-.013a4.619 4.619 0 1 0-.004-9.238l-30.024.013a4.62 4.62 0 0 0 .004 9.238M111.14 45.896l30.023-.013a4.62 4.62 0 1 0-.004-9.238l-30.024.013a4.619 4.619 0 1 0 .004 9.238`,fill:`#FFF`},null),U(`path`,{d:`M113.53 27.421v-.002l15.89-.007a4.619 4.619 0 1 0 .005 9.238l-15.892.007v-.002a4.618 4.618 0 0 0-.004-9.234M150.167 70.091h-3.979a4.789 4.789 0 0 1-4.774-4.775 4.788 4.788 0 0 1 4.774-4.774h3.979a4.789 4.789 0 0 1 4.775 4.774 4.789 4.789 0 0 1-4.775 4.775`,fill:`#FFF`},null),U(`path`,{d:`M171.687 30.234c0-16.392 13.289-29.68 29.681-29.68 16.392 0 29.68 13.288 29.68 29.68 0 16.393-13.288 29.681-29.68 29.681s-29.68-13.288-29.68-29.68`,fill:`#FF603B`},null),U(`path`,{d:`M203.557 19.435l-.676 15.035a1.514 1.514 0 0 1-3.026 0l-.675-15.035a2.19 2.19 0 1 1 4.377 0m-.264 19.378c.513.477.77 1.1.77 1.87s-.257 1.393-.77 1.907c-.55.476-1.21.733-1.943.733a2.545 2.545 0 0 1-1.87-.77c-.55-.514-.806-1.136-.806-1.87 0-.77.256-1.393.806-1.87.513-.513 1.137-.733 1.87-.733.77 0 1.43.22 1.943.733`,fill:`#FFF`},null),U(`path`,{d:`M119.3 133.275c4.426-.598 3.612-1.204 4.079-4.778.675-5.18-3.108-16.935-8.262-25.118-1.088-10.72-12.598-11.24-12.598-11.24s4.312 4.895 4.196 16.199c1.398 5.243.804 14.45.804 14.45s5.255 11.369 11.78 10.487`,fill:`#FFB594`},null),U(`path`,{d:`M100.944 91.61s1.463-.583 3.211.582c8.08 1.398 10.368 6.706 11.3 11.368 1.864 1.282 1.864 2.33 1.864 3.496.365.777 1.515 3.03 1.515 3.03s-7.225 1.748-10.954 6.758c-1.399-6.41-6.936-25.235-6.936-25.235`,fill:`#FFF`},null),U(`path`,{d:`M94.008 90.5l1.019-5.815-9.23-11.874-5.233 5.581-2.593 9.863s8.39 5.128 16.037 2.246`,fill:`#FFB594`},null),U(`path`,{d:`M82.931 78.216s-4.557-2.868-2.445-6.892c1.632-3.107 4.537 1.139 4.537 1.139s.524-3.662 3.139-3.662c.523-1.046 1.569-4.184 1.569-4.184s11.507 2.615 13.6 3.138c-.001 5.23-2.317 19.529-7.884 19.969-8.94.706-12.516-9.508-12.516-9.508`,fill:`#FFC6A0`},null),U(`path`,{d:`M102.971 72.243c2.616-2.093 3.489-9.775 3.489-9.775s-2.492-.492-6.676-2.062c-4.708-2.092-12.867-4.771-17.575.982-9.54 4.41-2.062 19.93-2.062 19.93l2.729-3.037s-3.956-3.304-2.092-6.277c2.183-3.48 3.943 1.08 3.943 1.08s.64-2.4 3.6-3.36c.356-.714 1.04-2.69 1.44-3.872a1.08 1.08 0 0 1 1.27-.707c2.41.56 8.723 2.03 11.417 2.676.524.126.876.619.825 1.156l-.308 3.266z`,fill:`#520038`},null),U(`path`,{d:`M101.22 76.514c-.104.613-.585 1.044-1.076.96-.49-.082-.805-.646-.702-1.26.104-.613.585-1.044 1.076-.961.491.083.805.647.702 1.26M94.26 75.074c-.104.613-.585 1.044-1.076.96-.49-.082-.805-.646-.702-1.26.104-.613.585-1.044 1.076-.96.491.082.805.646.702 1.26`,fill:`#552950`},null),U(`path`,{stroke:`#DB836E`,"stroke-width":`1.063`,"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M99.206 73.644l-.9 1.62-.3 4.38h-2.24`},null),U(`path`,{d:`M99.926 73.284s1.8-.72 2.52.54`,stroke:`#5C2552`,"stroke-width":`1.117`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M81.367 73.084s.48-1.12 1.12-.72c.64.4 1.28 1.44.56 2s.16 1.68.16 1.68`,stroke:`#DB836E`,"stroke-width":`1.117`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M92.326 71.724s1.84 1.12 4.16.96`,stroke:`#5C2552`,"stroke-width":`1.117`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M92.726 80.604s2.24 1.2 4.4 1.2M93.686 83.164s.96.4 1.52.32M83.687 80.044s1.786 6.547 9.262 7.954`,stroke:`#DB836E`,"stroke-width":`1.063`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M95.548 91.663s-1.068 2.821-8.298 2.105c-7.23-.717-10.29-5.044-10.29-5.044`,stroke:`#E4EBF7`,"stroke-width":`1.136`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M78.126 87.478s6.526 4.972 16.47 2.486c0 0 9.577 1.02 11.536 5.322 5.36 11.77.543 36.835 0 39.962 3.496 4.055-.466 8.483-.466 8.483-15.624-3.548-35.81-.6-35.81-.6-4.849-3.546-1.223-9.044-1.223-9.044L62.38 110.32c-2.485-15.227.833-19.803 3.549-20.743 3.03-1.049 8.04-1.282 8.04-1.282.496-.058 1.08-.076 1.37-.233 2.36-1.282 2.787-.583 2.787-.583`,fill:`#FFF`},null),U(`path`,{d:`M65.828 89.81s-6.875.465-7.59 8.156c-.466 8.857 3.03 10.954 3.03 10.954s6.075 22.102 16.796 22.957c8.39-2.176 4.758-6.702 4.661-11.42-.233-11.304-7.108-16.897-7.108-16.897s-4.212-13.75-9.789-13.75`,fill:`#FFC6A0`},null),U(`path`,{d:`M71.716 124.225s.855 11.264 9.828 6.486c4.765-2.536 7.581-13.828 9.789-22.568 1.456-5.768 2.58-12.197 2.58-12.197l-4.973-1.709s-2.408 5.516-7.769 12.275c-4.335 5.467-9.144 11.11-9.455 17.713`,fill:`#FFC6A0`},null),U(`path`,{d:`M108.463 105.191s1.747 2.724-2.331 30.535c2.376 2.216 1.053 6.012-.233 7.51`,stroke:`#E4EBF7`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M123.262 131.527s-.427 2.732-11.77 1.981c-15.187-1.006-25.326-3.25-25.326-3.25l.933-5.8s.723.215 9.71-.068c11.887-.373 18.714-6.07 24.964-1.022 4.039 3.263 1.489 8.16 1.489 8.16`,fill:`#FFC6A0`},null),U(`path`,{d:`M70.24 90.974s-5.593-4.739-11.054 2.68c-3.318 7.223.517 15.284 2.664 19.578-.31 3.729 2.33 4.311 2.33 4.311s.108.895 1.516 2.68c4.078-7.03 6.72-9.166 13.711-12.546-.328-.656-1.877-3.265-1.825-3.767.175-1.69-1.282-2.623-1.282-2.623s-.286-.156-1.165-2.738c-.788-2.313-2.036-5.177-4.895-7.575`,fill:`#FFF`},null),U(`path`,{d:`M90.232 288.027s4.855 2.308 8.313 1.155c3.188-1.063 5.12.755 8.002 1.331 2.881.577 7.769 1.243 13.207-1.424-.117-6.228-7.786-4.499-13.518-7.588-2.895-1.56-4.276-5.336-4.066-9.944H91.544s-1.573 11.89-1.312 16.47`,fill:`#CBD1D1`},null),U(`path`,{d:`M90.207 287.833s2.745 1.437 7.639.738c3.456-.494 3.223.66 7.418 1.282 4.195.621 13.092-.194 14.334-1.126.466 1.242-.388 2.33-.388 2.33s-1.709.682-5.438.932c-2.295.154-8.098.276-10.14-.621-2.02-1.554-4.894-1.515-6.06-.234-4.427 1.075-7.184-.31-7.184-.31l-.181-2.991z`,fill:`#2B0849`},null),U(`path`,{d:`M98.429 272.257h3.496s-.117 7.574 5.127 9.671c-5.244.7-9.672-2.602-8.623-9.671`,fill:`#A4AABA`},null),U(`path`,{d:`M44.425 272.046s-2.208 7.774-4.702 12.899c-1.884 3.874-4.428 7.854 5.729 7.854 6.97 0 9.385-.503 7.782-6.917-1.604-6.415.279-13.836.279-13.836h-9.088z`,fill:`#CBD1D1`},null),U(`path`,{d:`M38.066 290.277s2.198 1.225 6.954 1.225c6.376 0 8.646-1.73 8.646-1.73s.63 1.168-.649 2.27c-1.04.897-3.77 1.668-7.745 1.621-4.347-.05-6.115-.593-7.062-1.224-.864-.577-.72-1.657-.144-2.162`,fill:`#2B0849`},null),U(`path`,{d:`M45.344 274.041s.035 1.592-.329 3.07c-.365 1.49-1.13 3.255-1.184 4.34-.061 1.206 4.755 1.657 5.403.036.65-1.622 1.357-6.737 2.006-7.602.648-.865-5.14-2.222-5.896.156`,fill:`#A4AABA`},null),U(`path`,{d:`M89.476 277.57l13.899.095s1.349-56.643 1.925-66.909c.576-10.267 3.923-45.052 1.042-65.585l-13.037-.669-23.737.81s-.452 4.12-1.243 10.365c-.065.515-.708.874-.777 1.417-.078.608.439 1.407.332 2.044-2.455 14.627-5.797 32.736-8.256 46.837-.121.693-1.282 1.048-1.515 2.796-.042.314.22 1.584.116 1.865-7.14 19.473-12.202 52.601-15.66 67.19l15.176-.015s2.282-10.145 4.185-18.871c2.922-13.389 24.012-88.32 24.012-88.32l3.133-.954-.158 48.568s-.233 1.282.35 2.098c.583.815-.581 1.167-.408 2.331l.408 1.864s-.466 7.458-.932 12.352c-.467 4.895 1.145 40.69 1.145 40.69`,fill:`#7BB2F9`},null),U(`path`,{d:`M64.57 218.881c1.197.099 4.195-2.097 7.225-5.127M96.024 222.534s2.881-1.152 6.34-4.034`,stroke:`#648BD8`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M96.973 219.373s2.882-1.153 6.34-4.034`,stroke:`#648BD8`,"stroke-width":`1.032`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M63.172 222.144s2.724-.614 6.759-3.496M74.903 146.166c-.281 3.226.31 8.856-4.506 9.478M93.182 144.344s.115 14.557-1.344 15.65c-2.305 1.73-3.107 2.02-3.107 2.02M89.197 144.923s.269 13.144-1.01 25.088M83.525 170.71s6.81-1.051 9.116-1.051M46.026 270.045l-.892 4.538M46.937 263.289l-.815 4.157M62.725 202.503c-.33 1.618-.102 1.904-.449 3.438 0 0-2.756 1.903-2.29 3.923.466 2.02-.31 3.424-4.505 17.252-1.762 5.807-4.233 18.922-6.165 28.278-.03.144-.521 2.646-1.14 5.8M64.158 194.136c-.295 1.658-.6 3.31-.917 4.938M71.33 146.787l-1.244 10.877s-1.14.155-.519 2.33c.117 1.399-2.778 16.39-5.382 31.615M44.242 273.727H58.07`,stroke:`#648BD8`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M106.18 142.117c-3.028-.489-18.825-2.744-36.219.2a.625.625 0 0 0-.518.644c.063 1.307.044 2.343.015 2.995a.617.617 0 0 0 .716.636c3.303-.534 17.037-2.412 35.664-.266.347.04.66-.214.692-.56.124-1.347.16-2.425.17-3.029a.616.616 0 0 0-.52-.62`,fill:`#192064`},null),U(`path`,{d:`M96.398 145.264l.003-5.102a.843.843 0 0 0-.809-.847 114.104 114.104 0 0 0-8.141-.014.85.85 0 0 0-.82.847l-.003 5.097c0 .476.388.857.864.845 2.478-.064 5.166-.067 8.03.017a.848.848 0 0 0 .876-.843`,fill:`#FFF`},null),U(`path`,{d:`M95.239 144.296l.002-3.195a.667.667 0 0 0-.643-.672c-1.9-.061-3.941-.073-6.094-.01a.675.675 0 0 0-.654.672l-.002 3.192c0 .376.305.677.68.669 1.859-.042 3.874-.043 6.02.012.376.01.69-.291.691-.668`,fill:`#192064`},null),U(`path`,{d:`M90.102 273.522h12.819M91.216 269.761c.006 3.519-.072 5.55 0 6.292M90.923 263.474c-.009 1.599-.016 2.558-.016 4.505M90.44 170.404l.932 46.38s.7 1.631-.233 2.796c-.932 1.166 2.564.7.932 2.33-1.63 1.633.933 1.166 0 3.497-.618 1.546-1.031 21.921-1.138 36.513`,stroke:`#648BD8`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M73.736 98.665l2.214 4.312s2.098.816 1.865 2.68l.816 2.214M64.297 116.611c.233-.932 2.176-7.147 12.585-10.488M77.598 90.042s7.691 6.137 16.547 2.72`,stroke:`#E4EBF7`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M91.974 86.954s5.476-.816 7.574-4.545c1.297-.345.72 2.212-.33 3.671-.7.971-1.01 1.554-1.01 1.554s.194.31.155.816c-.053.697-.175.653-.272 1.048-.081.335.108.657 0 1.049-.046.17-.198.5-.382.878-.12.249-.072.687-.2.948-.231.469-1.562 1.87-2.622 2.855-3.826 3.554-5.018 1.644-6.001-.408-.894-1.865-.661-5.127-.874-6.875-.35-2.914-2.622-3.03-1.923-4.429.343-.685 2.87.69 3.263 1.748.757 2.04 2.952 1.807 2.622 1.69`,fill:`#FFC6A0`},null),U(`path`,{d:`M99.8 82.429c-.465.077-.35.272-.97 1.243-.622.971-4.817 2.932-6.39 3.224-2.589.48-2.278-1.56-4.254-2.855-1.69-1.107-3.562-.638-1.398 1.398.99.932.932 1.107 1.398 3.205.335 1.506-.64 3.67.7 5.593`,stroke:`#DB836E`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M79.543 108.673c-2.1 2.926-4.266 6.175-5.557 8.762`,stroke:`#E59788`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M87.72 124.768s-2.098-1.942-5.127-2.719c-3.03-.777-3.574-.155-5.516.078-1.942.233-3.885-.932-3.652.7.233 1.63 5.05 1.01 5.206 2.097.155 1.087-6.37 2.796-8.313 2.175-.777.777.466 1.864 2.02 2.175.233 1.554 2.253 1.554 2.253 1.554s.699 1.01 2.641 1.088c2.486 1.32 8.934-.7 10.954-1.554 2.02-.855-.466-5.594-.466-5.594`,fill:`#FFC6A0`},null),U(`path`,{d:`M73.425 122.826s.66 1.127 3.167 1.418c2.315.27 2.563.583 2.563.583s-2.545 2.894-9.07 2.272M72.416 129.274s3.826.097 4.933-.718M74.98 130.75s1.961.136 3.36-.505M77.232 131.916s1.748.019 2.914-.505M73.328 122.321s-.595-1.032 1.262-.427c1.671.544 2.833.055 5.128.155 1.389.061 3.067-.297 3.982.15 1.606.784 3.632 2.181 3.632 2.181s10.526 1.204 19.033-1.127M78.864 108.104s-8.39 2.758-13.168 12.12`,stroke:`#E59788`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M109.278 112.533s3.38-3.613 7.575-4.662`,stroke:`#E4EBF7`,"stroke-width":`1.085`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M107.375 123.006s9.697-2.745 11.445-.88`,stroke:`#E59788`,"stroke-width":`.774`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M194.605 83.656l3.971-3.886M187.166 90.933l3.736-3.655M191.752 84.207l-4.462-4.56M198.453 91.057l-4.133-4.225M129.256 163.074l3.718-3.718M122.291 170.039l3.498-3.498M126.561 163.626l-4.27-4.27M132.975 170.039l-3.955-3.955`,stroke:`#BFCDDD`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M190.156 211.779h-1.604a4.023 4.023 0 0 1-4.011-4.011V175.68a4.023 4.023 0 0 1 4.01-4.01h1.605a4.023 4.023 0 0 1 4.011 4.01v32.088a4.023 4.023 0 0 1-4.01 4.01`,fill:`#A3B4C6`},null),U(`path`,{d:`M237.824 212.977a4.813 4.813 0 0 1-4.813 4.813h-86.636a4.813 4.813 0 0 1 0-9.626h86.636a4.813 4.813 0 0 1 4.813 4.813`,fill:`#A3B4C6`},null),U(`mask`,{fill:`#fff`},null),U(`path`,{fill:`#A3B4C6`,mask:`url(#d)`,d:`M154.098 190.096h70.513v-84.617h-70.513z`},null),U(`path`,{d:`M224.928 190.096H153.78a3.219 3.219 0 0 1-3.208-3.209V167.92a3.219 3.219 0 0 1 3.208-3.21h71.148a3.219 3.219 0 0 1 3.209 3.21v18.967a3.219 3.219 0 0 1-3.21 3.209M224.928 130.832H153.78a3.218 3.218 0 0 1-3.208-3.208v-18.968a3.219 3.219 0 0 1 3.208-3.209h71.148a3.219 3.219 0 0 1 3.209 3.21v18.967a3.218 3.218 0 0 1-3.21 3.208`,fill:`#BFCDDD`,mask:`url(#d)`},null),U(`path`,{d:`M159.563 120.546a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M166.98 120.546a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M174.397 120.546a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M222.539 120.546h-22.461a.802.802 0 0 1-.802-.802v-3.208c0-.443.359-.803.802-.803h22.46c.444 0 .803.36.803.803v3.208c0 .443-.36.802-.802.802`,fill:`#FFF`,mask:`url(#d)`},null),U(`path`,{d:`M224.928 160.464H153.78a3.218 3.218 0 0 1-3.208-3.209v-18.967a3.219 3.219 0 0 1 3.208-3.209h71.148a3.219 3.219 0 0 1 3.209 3.209v18.967a3.218 3.218 0 0 1-3.21 3.209`,fill:`#BFCDDD`,mask:`url(#d)`},null),U(`path`,{d:`M173.455 130.832h49.301M164.984 130.832h6.089M155.952 130.832h6.75M173.837 160.613h49.3M165.365 160.613h6.089M155.57 160.613h6.751`,stroke:`#7C90A5`,"stroke-width":`1.124`,"stroke-linecap":`round`,"stroke-linejoin":`round`,mask:`url(#d)`},null),U(`path`,{d:`M159.563 151.038a2.407 2.407 0 1 1 0-4.814 2.407 2.407 0 0 1 0 4.814M166.98 151.038a2.407 2.407 0 1 1 0-4.814 2.407 2.407 0 0 1 0 4.814M174.397 151.038a2.407 2.407 0 1 1 .001-4.814 2.407 2.407 0 0 1 0 4.814M222.539 151.038h-22.461a.802.802 0 0 1-.802-.802v-3.209c0-.443.359-.802.802-.802h22.46c.444 0 .803.36.803.802v3.209c0 .443-.36.802-.802.802M159.563 179.987a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M166.98 179.987a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M174.397 179.987a2.407 2.407 0 1 1 0-4.813 2.407 2.407 0 0 1 0 4.813M222.539 179.987h-22.461a.802.802 0 0 1-.802-.802v-3.209c0-.443.359-.802.802-.802h22.46c.444 0 .803.36.803.802v3.209c0 .443-.36.802-.802.802`,fill:`#FFF`,mask:`url(#d)`},null),U(`path`,{d:`M203.04 221.108h-27.372a2.413 2.413 0 0 1-2.406-2.407v-11.448a2.414 2.414 0 0 1 2.406-2.407h27.372a2.414 2.414 0 0 1 2.407 2.407V218.7a2.413 2.413 0 0 1-2.407 2.407`,fill:`#BFCDDD`,mask:`url(#d)`},null),U(`path`,{d:`M177.259 207.217v11.52M201.05 207.217v11.52`,stroke:`#A3B4C6`,"stroke-width":`1.124`,"stroke-linecap":`round`,"stroke-linejoin":`round`,mask:`url(#d)`},null),U(`path`,{d:`M162.873 267.894a9.422 9.422 0 0 1-9.422-9.422v-14.82a9.423 9.423 0 0 1 18.845 0v14.82a9.423 9.423 0 0 1-9.423 9.422`,fill:`#5BA02E`,mask:`url(#d)`},null),U(`path`,{d:`M171.22 267.83a9.422 9.422 0 0 1-9.422-9.423v-3.438a9.423 9.423 0 0 1 18.845 0v3.438a9.423 9.423 0 0 1-9.422 9.423`,fill:`#92C110`,mask:`url(#d)`},null),U(`path`,{d:`M181.31 293.666h-27.712a3.209 3.209 0 0 1-3.209-3.21V269.79a3.209 3.209 0 0 1 3.209-3.21h27.711a3.209 3.209 0 0 1 3.209 3.21v20.668a3.209 3.209 0 0 1-3.209 3.209`,fill:`#F2D7AD`,mask:`url(#d)`},null)])]),aH=()=>U(`svg`,{width:`251`,height:`294`},[U(`g`,{fill:`none`,"fill-rule":`evenodd`},[U(`path`,{d:`M0 129.023v-2.084C0 58.364 55.591 2.774 124.165 2.774h2.085c68.574 0 124.165 55.59 124.165 124.165v2.084c0 68.575-55.59 124.166-124.165 124.166h-2.085C55.591 253.189 0 197.598 0 129.023`,fill:`#E4EBF7`},null),U(`path`,{d:`M41.417 132.92a8.231 8.231 0 1 1-16.38-1.65 8.231 8.231 0 0 1 16.38 1.65`,fill:`#FFF`},null),U(`path`,{d:`M38.652 136.36l10.425 5.91M49.989 148.505l-12.58 10.73`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M41.536 161.28a5.636 5.636 0 1 1-11.216-1.13 5.636 5.636 0 0 1 11.216 1.13M59.154 145.261a5.677 5.677 0 1 1-11.297-1.138 5.677 5.677 0 0 1 11.297 1.138M100.36 29.516l29.66-.013a4.562 4.562 0 1 0-.004-9.126l-29.66.013a4.563 4.563 0 0 0 .005 9.126M111.705 47.754l29.659-.013a4.563 4.563 0 1 0-.004-9.126l-29.66.013a4.563 4.563 0 1 0 .005 9.126`,fill:`#FFF`},null),U(`path`,{d:`M114.066 29.503V29.5l15.698-.007a4.563 4.563 0 1 0 .004 9.126l-15.698.007v-.002a4.562 4.562 0 0 0-.004-9.122M185.405 137.723c-.55 5.455-5.418 9.432-10.873 8.882-5.456-.55-9.432-5.418-8.882-10.873.55-5.455 5.418-9.432 10.873-8.882 5.455.55 9.432 5.418 8.882 10.873`,fill:`#FFF`},null),U(`path`,{d:`M180.17 143.772l12.572 7.129M193.841 158.42L178.67 171.36`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{d:`M185.55 171.926a6.798 6.798 0 1 1-13.528-1.363 6.798 6.798 0 0 1 13.527 1.363M204.12 155.285a6.848 6.848 0 1 1-13.627-1.375 6.848 6.848 0 0 1 13.626 1.375`,fill:`#FFF`},null),U(`path`,{d:`M152.988 194.074a2.21 2.21 0 1 1-4.42 0 2.21 2.21 0 0 1 4.42 0zM225.931 118.217a2.21 2.21 0 1 1-4.421 0 2.21 2.21 0 0 1 4.421 0zM217.09 153.051a2.21 2.21 0 1 1-4.421 0 2.21 2.21 0 0 1 4.42 0zM177.84 109.842a2.21 2.21 0 1 1-4.422 0 2.21 2.21 0 0 1 4.421 0zM196.114 94.454a2.21 2.21 0 1 1-4.421 0 2.21 2.21 0 0 1 4.421 0zM202.844 182.523a2.21 2.21 0 1 1-4.42 0 2.21 2.21 0 0 1 4.42 0z`,stroke:`#FFF`,"stroke-width":`2`},null),U(`path`,{stroke:`#FFF`,"stroke-width":`2`,d:`M215.125 155.262l-1.902 20.075-10.87 5.958M174.601 176.636l-6.322 9.761H156.98l-4.484 6.449M175.874 127.28V111.56M221.51 119.404l-12.77 7.859-15.228-7.86V96.668`},null),U(`path`,{d:`M180.68 29.32C180.68 13.128 193.806 0 210 0c16.193 0 29.32 13.127 29.32 29.32 0 16.194-13.127 29.322-29.32 29.322-16.193 0-29.32-13.128-29.32-29.321`,fill:`#A26EF4`},null),U(`path`,{d:`M221.45 41.706l-21.563-.125a1.744 1.744 0 0 1-1.734-1.754l.071-12.23a1.744 1.744 0 0 1 1.754-1.734l21.562.125c.964.006 1.74.791 1.735 1.755l-.071 12.229a1.744 1.744 0 0 1-1.754 1.734`,fill:`#FFF`},null),U(`path`,{d:`M215.106 29.192c-.015 2.577-2.049 4.654-4.543 4.64-2.494-.014-4.504-2.115-4.489-4.693l.04-6.925c.016-2.577 2.05-4.654 4.543-4.64 2.494.015 4.504 2.116 4.49 4.693l-.04 6.925zm-4.53-14.074a6.877 6.877 0 0 0-6.916 6.837l-.043 7.368a6.877 6.877 0 0 0 13.754.08l.042-7.368a6.878 6.878 0 0 0-6.837-6.917zM167.566 68.367h-3.93a4.73 4.73 0 0 1-4.717-4.717 4.73 4.73 0 0 1 4.717-4.717h3.93a4.73 4.73 0 0 1 4.717 4.717 4.73 4.73 0 0 1-4.717 4.717`,fill:`#FFF`},null),U(`path`,{d:`M168.214 248.838a6.611 6.611 0 0 1-6.61-6.611v-66.108a6.611 6.611 0 0 1 13.221 0v66.108a6.611 6.611 0 0 1-6.61 6.61`,fill:`#5BA02E`},null),U(`path`,{d:`M176.147 248.176a6.611 6.611 0 0 1-6.61-6.61v-33.054a6.611 6.611 0 1 1 13.221 0v33.053a6.611 6.611 0 0 1-6.61 6.611`,fill:`#92C110`},null),U(`path`,{d:`M185.994 293.89h-27.376a3.17 3.17 0 0 1-3.17-3.17v-45.887a3.17 3.17 0 0 1 3.17-3.17h27.376a3.17 3.17 0 0 1 3.17 3.17v45.886a3.17 3.17 0 0 1-3.17 3.17`,fill:`#F2D7AD`},null),U(`path`,{d:`M81.972 147.673s6.377-.927 17.566-1.28c11.729-.371 17.57 1.086 17.57 1.086s3.697-3.855.968-8.424c1.278-12.077 5.982-32.827.335-48.273-1.116-1.339-3.743-1.512-7.536-.62-1.337.315-7.147-.149-7.983-.1l-15.311-.347s-3.487-.17-8.035-.508c-1.512-.113-4.227-1.683-5.458-.338-.406.443-2.425 5.669-1.97 16.077l8.635 35.642s-3.141 3.61 1.219 7.085`,fill:`#FFF`},null),U(`path`,{d:`M75.768 73.325l-.9-6.397 11.982-6.52s7.302-.118 8.038 1.205c.737 1.324-5.616.993-5.616.993s-1.836 1.388-2.615 2.5c-1.654 2.363-.986 6.471-8.318 5.986-1.708.284-2.57 2.233-2.57 2.233`,fill:`#FFC6A0`},null),U(`path`,{d:`M52.44 77.672s14.217 9.406 24.973 14.444c1.061.497-2.094 16.183-11.892 11.811-7.436-3.318-20.162-8.44-21.482-14.496-.71-3.258 2.543-7.643 8.401-11.76M141.862 80.113s-6.693 2.999-13.844 6.876c-3.894 2.11-10.137 4.704-12.33 7.988-6.224 9.314 3.536 11.22 12.947 7.503 6.71-2.651 28.999-12.127 13.227-22.367`,fill:`#FFB594`},null),U(`path`,{d:`M76.166 66.36l3.06 3.881s-2.783 2.67-6.31 5.747c-7.103 6.195-12.803 14.296-15.995 16.44-3.966 2.662-9.754 3.314-12.177-.118-3.553-5.032.464-14.628 31.422-25.95`,fill:`#FFC6A0`},null),U(`path`,{d:`M64.674 85.116s-2.34 8.413-8.912 14.447c.652.548 18.586 10.51 22.144 10.056 5.238-.669 6.417-18.968 1.145-20.531-.702-.208-5.901-1.286-8.853-2.167-.87-.26-1.611-1.71-3.545-.936l-1.98-.869zM128.362 85.826s5.318 1.956 7.325 13.734c-.546.274-17.55 12.35-21.829 7.805-6.534-6.94-.766-17.393 4.275-18.61 4.646-1.121 5.03-1.37 10.23-2.929`,fill:`#FFF`},null),U(`path`,{d:`M78.18 94.656s.911 7.41-4.914 13.078`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M87.397 94.68s3.124 2.572 10.263 2.572c7.14 0 9.074-3.437 9.074-3.437`,stroke:`#E4EBF7`,"stroke-width":`.932`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M117.184 68.639l-6.781-6.177s-5.355-4.314-9.223-.893c-3.867 3.422 4.463 2.083 5.653 4.165 1.19 2.082.848 1.143-2.083.446-5.603-1.331-2.082.893 2.975 5.355 2.091 1.845 6.992.955 6.992.955l2.467-3.851z`,fill:`#FFC6A0`},null),U(`path`,{d:`M105.282 91.315l-.297-10.937-15.918-.027-.53 10.45c-.026.403.17.788.515.999 2.049 1.251 9.387 5.093 15.799.424.287-.21.443-.554.431-.91`,fill:`#FFB594`},null),U(`path`,{d:`M107.573 74.24c.817-1.147.982-9.118 1.015-11.928a1.046 1.046 0 0 0-.965-1.055l-4.62-.365c-7.71-1.044-17.071.624-18.253 6.346-5.482 5.813-.421 13.244-.421 13.244s1.963 3.566 4.305 6.791c.756 1.041.398-3.731 3.04-5.929 5.524-4.594 15.899-7.103 15.899-7.103`,fill:`#5C2552`},null),U(`path`,{d:`M88.426 83.206s2.685 6.202 11.602 6.522c7.82.28 8.973-7.008 7.434-17.505l-.909-5.483c-6.118-2.897-15.478.54-15.478.54s-.576 2.044-.19 5.504c-2.276 2.066-1.824 5.618-1.824 5.618s-.905-1.922-1.98-2.321c-.86-.32-1.897.089-2.322 1.98-1.04 4.632 3.667 5.145 3.667 5.145`,fill:`#FFC6A0`},null),U(`path`,{stroke:`#DB836E`,"stroke-width":`1.145`,"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M100.843 77.099l1.701-.928-1.015-4.324.674-1.406`},null),U(`path`,{d:`M105.546 74.092c-.022.713-.452 1.279-.96 1.263-.51-.016-.904-.607-.882-1.32.021-.713.452-1.278.96-1.263.51.016.904.607.882 1.32M97.592 74.349c-.022.713-.452 1.278-.961 1.263-.509-.016-.904-.607-.882-1.32.022-.713.452-1.279.961-1.263.51.016.904.606.882 1.32`,fill:`#552950`},null),U(`path`,{d:`M91.132 86.786s5.269 4.957 12.679 2.327`,stroke:`#DB836E`,"stroke-width":`1.145`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M99.776 81.903s-3.592.232-1.44-2.79c1.59-1.496 4.897-.46 4.897-.46s1.156 3.906-3.457 3.25`,fill:`#DB836E`},null),U(`path`,{d:`M102.88 70.6s2.483.84 3.402.715M93.883 71.975s2.492-1.144 4.778-1.073`,stroke:`#5C2552`,"stroke-width":`1.526`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M86.32 77.374s.961.879 1.458 2.106c-.377.48-1.033 1.152-.236 1.809M99.337 83.719s1.911.151 2.509-.254`,stroke:`#DB836E`,"stroke-width":`1.145`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M87.782 115.821l15.73-3.012M100.165 115.821l10.04-2.008`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M66.508 86.763s-1.598 8.83-6.697 14.078`,stroke:`#E4EBF7`,"stroke-width":`1.114`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M128.31 87.934s3.013 4.121 4.06 11.785`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M64.09 84.816s-6.03 9.912-13.607 9.903`,stroke:`#DB836E`,"stroke-width":`.795`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M112.366 65.909l-.142 5.32s5.993 4.472 11.945 9.202c4.482 3.562 8.888 7.455 10.985 8.662 4.804 2.766 8.9 3.355 11.076 1.808 4.071-2.894 4.373-9.878-8.136-15.263-4.271-1.838-16.144-6.36-25.728-9.73`,fill:`#FFC6A0`},null),U(`path`,{d:`M130.532 85.488s4.588 5.757 11.619 6.214`,stroke:`#DB836E`,"stroke-width":`.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M121.708 105.73s-.393 8.564-1.34 13.612`,stroke:`#E4EBF7`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M115.784 161.512s-3.57-1.488-2.678-7.14`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M101.52 290.246s4.326 2.057 7.408 1.03c2.842-.948 4.564.673 7.132 1.186 2.57.514 6.925 1.108 11.772-1.269-.104-5.551-6.939-4.01-12.048-6.763-2.582-1.39-3.812-4.757-3.625-8.863h-9.471s-1.402 10.596-1.169 14.68`,fill:`#CBD1D1`},null),U(`path`,{d:`M101.496 290.073s2.447 1.281 6.809.658c3.081-.44 3.74.485 7.479 1.039 3.739.554 10.802-.07 11.91-.9.415 1.108-.347 2.077-.347 2.077s-1.523.608-4.847.831c-2.045.137-5.843.293-7.663-.507-1.8-1.385-5.286-1.917-5.77-.243-3.947.958-7.41-.288-7.41-.288l-.16-2.667z`,fill:`#2B0849`},null),U(`path`,{d:`M108.824 276.19h3.116s-.103 6.751 4.57 8.62c-4.673.624-8.62-2.32-7.686-8.62`,fill:`#A4AABA`},null),U(`path`,{d:`M57.65 272.52s-2.122 7.47-4.518 12.396c-1.811 3.724-4.255 7.548 5.505 7.548 6.698 0 9.02-.483 7.479-6.648-1.541-6.164.268-13.296.268-13.296H57.65z`,fill:`#CBD1D1`},null),U(`path`,{d:`M51.54 290.04s2.111 1.178 6.682 1.178c6.128 0 8.31-1.662 8.31-1.662s.605 1.122-.624 2.18c-1 .862-3.624 1.603-7.444 1.559-4.177-.049-5.876-.57-6.786-1.177-.831-.554-.692-1.593-.138-2.078`,fill:`#2B0849`},null),U(`path`,{d:`M58.533 274.438s.034 1.529-.315 2.95c-.352 1.431-1.087 3.127-1.139 4.17-.058 1.16 4.57 1.592 5.194.035.623-1.559 1.303-6.475 1.927-7.306.622-.831-4.94-2.135-5.667.15`,fill:`#A4AABA`},null),U(`path`,{d:`M100.885 277.015l13.306.092s1.291-54.228 1.843-64.056c.552-9.828 3.756-43.13.997-62.788l-12.48-.64-22.725.776s-.433 3.944-1.19 9.921c-.062.493-.677.838-.744 1.358-.075.582.42 1.347.318 1.956-2.35 14.003-6.343 32.926-8.697 46.425-.116.663-1.227 1.004-1.45 2.677-.04.3.21 1.516.112 1.785-6.836 18.643-10.89 47.584-14.2 61.551l14.528-.014s2.185-8.524 4.008-16.878c2.796-12.817 22.987-84.553 22.987-84.553l3-.517 1.037 46.1s-.223 1.228.334 2.008c.558.782-.556 1.117-.39 2.233l.39 1.784s-.446 7.14-.892 11.826c-.446 4.685-.092 38.954-.092 38.954`,fill:`#7BB2F9`},null),U(`path`,{d:`M77.438 220.434c1.146.094 4.016-2.008 6.916-4.91M107.55 223.931s2.758-1.103 6.069-3.862`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M108.459 220.905s2.759-1.104 6.07-3.863`,stroke:`#648BD8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M76.099 223.557s2.608-.587 6.47-3.346M87.33 150.82c-.27 3.088.297 8.478-4.315 9.073M104.829 149.075s.11 13.936-1.286 14.983c-2.207 1.655-2.975 1.934-2.975 1.934M101.014 149.63s.035 12.81-1.19 24.245M94.93 174.965s7.174-1.655 9.38-1.655M75.671 204.754c-.316 1.55-.64 3.067-.973 4.535 0 0-1.45 1.822-1.003 3.756.446 1.934-.943 2.034-4.96 15.273-1.686 5.559-4.464 18.49-6.313 27.447-.078.38-4.018 18.06-4.093 18.423M77.043 196.743a313.269 313.269 0 0 1-.877 4.729M83.908 151.414l-1.19 10.413s-1.091.148-.496 2.23c.111 1.34-2.66 15.692-5.153 30.267M57.58 272.94h13.238`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null),U(`path`,{d:`M117.377 147.423s-16.955-3.087-35.7.199c.157 2.501-.002 4.128-.002 4.128s14.607-2.802 35.476-.31c.251-2.342.226-4.017.226-4.017`,fill:`#192064`},null),U(`path`,{d:`M107.511 150.353l.004-4.885a.807.807 0 0 0-.774-.81c-2.428-.092-5.04-.108-7.795-.014a.814.814 0 0 0-.784.81l-.003 4.88c0 .456.371.82.827.808a140.76 140.76 0 0 1 7.688.017.81.81 0 0 0 .837-.806`,fill:`#FFF`},null),U(`path`,{d:`M106.402 149.426l.002-3.06a.64.64 0 0 0-.616-.643 94.135 94.135 0 0 0-5.834-.009.647.647 0 0 0-.626.643l-.001 3.056c0 .36.291.648.651.64 1.78-.04 3.708-.041 5.762.012.36.009.662-.279.662-.64`,fill:`#192064`},null),U(`path`,{d:`M101.485 273.933h12.272M102.652 269.075c.006 3.368.04 5.759.11 6.47M102.667 263.125c-.009 1.53-.015 2.98-.016 4.313M102.204 174.024l.893 44.402s.669 1.561-.224 2.677c-.892 1.116 2.455.67.893 2.231-1.562 1.562.893 1.116 0 3.347-.592 1.48-.988 20.987-1.09 34.956`,stroke:`#648BD8`,"stroke-width":`1.051`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null)])]),oH=e=>{let{componentCls:t,lineHeightHeading3:n,iconCls:r,padding:i,paddingXL:a,paddingXS:o,paddingLG:s,marginXS:c,lineHeight:l}=e;return{[t]:{padding:`${s*2}px ${a}px`,"&-rtl":{direction:`rtl`}},[`${t} ${t}-image`]:{width:e.imageWidth,height:e.imageHeight,margin:`auto`},[`${t} ${t}-icon`]:{marginBottom:s,textAlign:`center`,[`& > ${r}`]:{fontSize:e.resultIconFontSize}},[`${t} ${t}-title`]:{color:e.colorTextHeading,fontSize:e.resultTitleFontSize,lineHeight:n,marginBlock:c,textAlign:`center`},[`${t} ${t}-subtitle`]:{color:e.colorTextDescription,fontSize:e.resultSubtitleFontSize,lineHeight:l,textAlign:`center`},[`${t} ${t}-content`]:{marginTop:s,padding:`${s}px ${i*2.5}px`,backgroundColor:e.colorFillAlter},[`${t} ${t}-extra`]:{margin:e.resultExtraMargin,textAlign:`center`,"& > *":{marginInlineEnd:o,"&:last-child":{marginInlineEnd:0}}}}},sH=e=>{let{componentCls:t,iconCls:n}=e;return{[`${t}-success ${t}-icon > ${n}`]:{color:e.resultSuccessIconColor},[`${t}-error ${t}-icon > ${n}`]:{color:e.resultErrorIconColor},[`${t}-info ${t}-icon > ${n}`]:{color:e.resultInfoIconColor},[`${t}-warning ${t}-icon > ${n}`]:{color:e.resultWarningIconColor}}},cH=e=>[oH(e),sH(e)],lH=e=>cH(e),uH=v(`Result`,e=>{let{paddingLG:t,fontSizeHeading3:n}=e,r=e.fontSize,i=`${t}px 0 0 0`,a=e.colorInfo,o=e.colorError,s=e.colorSuccess,c=e.colorWarning;return[lH(B(e,{resultTitleFontSize:n,resultSubtitleFontSize:r,resultIconFontSize:n*3,resultExtraMargin:i,resultInfoIconColor:a,resultErrorIconColor:o,resultSuccessIconColor:s,resultWarningIconColor:c}))]},{imageWidth:250,imageHeight:295}),dH={success:qe,error:tt,info:Wt,warning:nH},fH={404:rH,500:iH,403:aH},pH=Object.keys(fH),mH=()=>({prefixCls:String,icon:f.any,status:{type:[Number,String],default:`info`},title:f.any,subTitle:f.any,extra:f.any}),hH=(e,t)=>{let{status:n,icon:r}=t;if(pH.includes(`${n}`)){let t=fH[n];return U(`div`,{class:`${e}-icon ${e}-image`},[U(t,null,null)])}let i=dH[n],a=r||U(i,null,null);return U(`div`,{class:`${e}-icon`},[a])},gH=(e,t)=>t&&U(`div`,{class:`${e}-extra`},[t]),_H=u({compatConfig:{MODE:3},name:`AResult`,inheritAttrs:!1,props:mH(),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`result`,e),[o,s]=uH(i),c=J(()=>K(i.value,s.value,`${i.value}-${e.status}`,{[`${i.value}-rtl`]:a.value===`rtl`}));return()=>{let t=e.title??n.title?.call(n),a=e.subTitle??n.subTitle?.call(n),s=e.icon??n.icon?.call(n),l=e.extra??n.extra?.call(n),u=i.value;return o(U(`div`,Y(Y({},r),{},{class:[c.value,r.class]}),[hH(u,{status:e.status,icon:s}),U(`div`,{class:`${u}-title`},[t]),a&&U(`div`,{class:`${u}-subtitle`},[a]),gH(u,l),n.default&&U(`div`,{class:`${u}-content`},[n.default()])]))}}});_H.PRESENTED_IMAGE_403=fH[403],_H.PRESENTED_IMAGE_404=fH[404],_H.PRESENTED_IMAGE_500=fH[500],_H.install=function(e){return e.component(_H.name,_H),e};var vH=a(HA),yH=(e,t)=>{let{attrs:n}=t,{included:r,vertical:i,style:a,class:o}=n,{length:s,offset:c,reverse:l}=n;s<0&&(l=!l,s=Math.abs(s),c=100-c);let u=i?{[l?`top`:`bottom`]:`${c}%`,[l?`bottom`:`top`]:`auto`,height:`${s}%`}:{[l?`right`:`left`]:`${c}%`,[l?`left`:`right`]:`auto`,width:`${s}%`},d=Z(Z({},a),u);return r?U(`div`,{class:o,style:d},null):null};yH.inheritAttrs=!1;var bH=(t,n,r,i,a,o)=>{e(!r||i>0,`Slider`,"`Slider[step]` should be a positive number in order to make Slider[dots] work.");let s=Object.keys(n).map(parseFloat).sort((e,t)=>e-t);if(r&&i)for(let e=a;e<=o;e+=i)s.indexOf(e)===-1&&s.push(e);return s},xH=(e,t)=>{let{attrs:n}=t,{prefixCls:r,vertical:i,reverse:a,marks:o,dots:s,step:c,included:l,lowerBound:u,upperBound:d,max:f,min:p,dotStyle:m,activeDotStyle:h}=n,g=f-p,_=bH(i,o,s,c,p,f).map(e=>{let t=`${Math.abs(e-p)/g*100}%`,n=!l&&e===d||l&&e<=d&&e>=u,o=i?Z(Z({},m),{[a?`top`:`bottom`]:t}):Z(Z({},m),{[a?`right`:`left`]:t});return n&&(o=Z(Z({},o),h)),U(`span`,{class:K({[`${r}-dot`]:!0,[`${r}-dot-active`]:n,[`${r}-dot-reverse`]:a}),style:o,key:e},null)});return U(`div`,{class:`${r}-step`},[_])};xH.inheritAttrs=!1;var SH=(e,t)=>{let{attrs:n,slots:r}=t,{class:i,vertical:a,reverse:o,marks:s,included:c,upperBound:l,lowerBound:u,max:d,min:f,onClickLabel:p}=n,m=Object.keys(s),h=r.mark,g=d-f,_=m.map(parseFloat).sort((e,t)=>e-t).map(e=>{let t=typeof s[e]==`function`?s[e]():s[e],n=typeof t==`object`&&!Nt(t),r=n?t.label:t;if(!r&&r!==0)return null;h&&(r=h({point:e,label:r}));let d=!c&&e===l||c&&e<=l&&e>=u,m=K({[`${i}-text`]:!0,[`${i}-text-active`]:d}),_={marginBottom:`-50%`,[o?`top`:`bottom`]:`${(e-f)/g*100}%`},v={transform:`translateX(${o?`50%`:`-50%`})`,msTransform:`translateX(${o?`50%`:`-50%`})`,[o?`right`:`left`]:`${(e-f)/g*100}%`},y=a?_:v;return U(`span`,Y({class:m,style:n?Z(Z({},y),t.style):y,key:e,onMousedown:t=>p(t,e)},{[sr?`onTouchstartPassive`:`onTouchstart`]:t=>p(t,e)}),[r])});return U(`div`,{class:i},[_])};SH.inheritAttrs=!1;var CH=u({compatConfig:{MODE:3},name:`Handle`,inheritAttrs:!1,props:{prefixCls:String,vertical:{type:Boolean,default:void 0},offset:Number,disabled:{type:Boolean,default:void 0},min:Number,max:Number,value:Number,tabindex:f.oneOfType([f.number,f.string]),reverse:{type:Boolean,default:void 0},ariaLabel:String,ariaLabelledBy:String,ariaValueTextFormatter:Function,onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function}},setup(e,t){let{attrs:n,emit:r,expose:i}=t,a=q(!1),o=q(),s=()=>{document.activeElement===o.value&&(a.value=!0)},c=e=>{a.value=!1,r(`blur`,e)},l=()=>{a.value=!1},u=()=>{var e;(e=o.value)==null||e.focus()},d=()=>{var e;(e=o.value)==null||e.blur()},f=()=>{a.value=!0,u()},p=e=>{e.preventDefault(),u(),r(`mousedown`,e)};i({focus:u,blur:d,clickFocus:f,ref:o});let m=null;V(()=>{m=cr(document,`mouseup`,s)}),ut(()=>{m?.remove()});let h=J(()=>{let{vertical:t,offset:n,reverse:r}=e;return t?{[r?`top`:`bottom`]:`${n}%`,[r?`bottom`:`top`]:`auto`,transform:r?null:`translateY(+50%)`}:{[r?`right`:`left`]:`${n}%`,[r?`left`:`right`]:`auto`,transform:`translateX(${r?`+`:`-`}50%)`}});return()=>{let{prefixCls:t,disabled:r,min:i,max:s,value:u,tabindex:d,ariaLabel:f,ariaLabelledBy:m,ariaValueTextFormatter:g,onMouseenter:_,onMouseleave:v}=e,y=K(n.class,{[`${t}-handle-click-focused`]:a.value}),b={"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":u,"aria-disabled":!!r},x=[n.style,h.value],S=d||0;(r||d===null)&&(S=null);let C;return g&&(C=g(u)),U(`div`,Y(Y({},Z(Z(Z(Z({},n),{role:`slider`,tabindex:S}),b),{class:y,onBlur:c,onKeydown:l,onMousedown:p,onMouseenter:_,onMouseleave:v,ref:o,style:x})),{},{"aria-label":f,"aria-labelledby":m,"aria-valuetext":C}),null)}}});function wH(e,t){try{return Object.keys(t).some(n=>e.target===t[n].ref)}catch{return!1}}function TH(e,t){let{min:n,max:r}=t;return er}function EH(e){return e.touches.length>1||e.type.toLowerCase()===`touchend`&&e.touches.length>0}function DH(e,t){let{marks:n,step:r,min:i,max:a}=t,o=Object.keys(n).map(parseFloat);if(r!==null){let t=10**OH(r),n=Math.floor((a*t-i*t)/(r*t)),s=Math.min((e-i)/r,n),c=Math.round(s)*r+i;o.push(c)}let s=o.map(t=>Math.abs(e-t));return o[s.indexOf(Math.min(...s))]}function OH(e){let t=e.toString(),n=0;return t.indexOf(`.`)>=0&&(n=t.length-t.indexOf(`.`)-1),n}function kH(e,t){let n=1;return window.visualViewport&&(n=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(e?t.clientY:t.pageX)/n}function AH(e,t){let n=1;return window.visualViewport&&(n=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(e?t.touches[0].clientY:t.touches[0].pageX)/n}function jH(e,t){let n=t.getBoundingClientRect();return e?n.top+n.height*.5:window.scrollX+n.left+n.width*.5}function MH(e,t){let{max:n,min:r}=t;return e<=r?r:e>=n?n:e}function NH(e,t){let{step:n}=t,r=isFinite(DH(e,t))?DH(e,t):0;return n===null?r:parseFloat(r.toFixed(OH(n)))}function PH(e){e.stopPropagation(),e.preventDefault()}function FH(e,t,n){let r={increase:(e,t)=>e+t,decrease:(e,t)=>e-t},i=r[e](Object.keys(n.marks).indexOf(JSON.stringify(t)),1),a=Object.keys(n.marks)[i];return n.step?r[e](t,n.step):Object.keys(n.marks).length&&n.marks[a]?n.marks[a]:t}function IH(e,t,n){let r=`increase`,i=`decrease`,a=r;switch(e.keyCode){case $.UP:a=t&&n?i:r;break;case $.RIGHT:a=!t&&n?i:r;break;case $.DOWN:a=t&&n?r:i;break;case $.LEFT:a=!t&&n?r:i;break;case $.END:return(e,t)=>t.max;case $.HOME:return(e,t)=>t.min;case $.PAGE_UP:return(e,t)=>e+t.step*2;case $.PAGE_DOWN:return(e,t)=>e-t.step*2;default:return}return(e,t)=>FH(a,e,t)}var LH=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{this.document=this.sliderRef&&this.sliderRef.ownerDocument;let{autofocus:e,disabled:t}=this;e&&!t&&this.focus()})},beforeUnmount(){this.$nextTick(()=>{this.removeDocumentEvents()})},methods:{defaultHandle(e){var{index:t,directives:n,className:r,style:i}=e,a=LH(e,[`index`,`directives`,`className`,`style`]);return delete a.dragging,a.value===null?null:U(CH,Z(Z({},a),{class:r,style:i,key:t}),null)},onDown(e,t){let n=t,{draggableTrack:r,vertical:i}=this.$props,{bounds:a}=this.$data,o=r&&this.positionGetValue&&this.positionGetValue(n)||[],s=wH(e,this.handlesRefs);if(this.dragTrack=r&&a.length>=2&&!s&&!o.map((e,t)=>{let n=t?!0:e>=a[t];return t===o.length-1?e<=a[t]:n}).some(e=>!e),this.dragTrack)this.dragOffset=n,this.startBounds=[...a];else{if(!s)this.dragOffset=0;else{let t=jH(i,e.target);this.dragOffset=n-t,n=t}this.onStart(n)}},onMouseDown(e){if(e.button!==0)return;this.removeDocumentEvents();let t=this.$props.vertical,n=kH(t,e);this.onDown(e,n),this.addDocumentMouseEvents()},onTouchStart(e){if(EH(e))return;let t=this.vertical,n=AH(t,e);this.onDown(e,n),this.addDocumentTouchEvents(),PH(e)},onFocus(e){let{vertical:t}=this;if(wH(e,this.handlesRefs)&&!this.dragTrack){let n=jH(t,e.target);this.dragOffset=0,this.onStart(n),PH(e),this.$emit(`focus`,e)}},onBlur(e){this.dragTrack||this.onEnd(),this.$emit(`blur`,e)},onMouseUp(){this.handlesRefs[this.prevMovedHandleIndex]&&this.handlesRefs[this.prevMovedHandleIndex].clickFocus()},onMouseMove(e){if(!this.sliderRef){this.onEnd();return}let t=kH(this.vertical,e);this.onMove(e,t-this.dragOffset,this.dragTrack,this.startBounds)},onTouchMove(e){if(EH(e)||!this.sliderRef){this.onEnd();return}let t=AH(this.vertical,e);this.onMove(e,t-this.dragOffset,this.dragTrack,this.startBounds)},onKeyDown(e){this.sliderRef&&wH(e,this.handlesRefs)&&this.onKeyboard(e)},onClickMarkLabel(e,t){e.stopPropagation(),this.onChange({sValue:t}),this.setState({sValue:t},()=>this.onEnd(!0))},getSliderStart(){let e=this.sliderRef,{vertical:t,reverse:n}=this,r=e.getBoundingClientRect();return t?n?r.bottom:r.top:window.scrollX+(n?r.right:r.left)},getSliderLength(){let e=this.sliderRef;if(!e)return 0;let t=e.getBoundingClientRect();return this.vertical?t.height:t.width},addDocumentTouchEvents(){this.onTouchMoveListener=cr(this.document,`touchmove`,this.onTouchMove),this.onTouchUpListener=cr(this.document,`touchend`,this.onEnd)},addDocumentMouseEvents(){this.onMouseMoveListener=cr(this.document,`mousemove`,this.onMouseMove),this.onMouseUpListener=cr(this.document,`mouseup`,this.onEnd)},removeDocumentEvents(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()},focus(){var e;this.$props.disabled||(e=this.handlesRefs[0])==null||e.focus()},blur(){this.$props.disabled||Object.keys(this.handlesRefs).forEach(e=>{var t,n;(n=(t=this.handlesRefs[e])?.blur)==null||n.call(t)})},calcValue(e){let{vertical:t,min:n,max:r}=this,i=Math.abs(Math.max(e,0)/this.getSliderLength());return t?(1-i)*(r-n)+n:i*(r-n)+n},calcValueByPos(e){let t=(this.reverse?-1:1)*(e-this.getSliderStart());return this.trimAlignValue(this.calcValue(t))},calcOffset(e){let{min:t,max:n}=this,r=(e-t)/(n-t);return Math.max(0,r*100)},saveSlider(e){this.sliderRef=e},saveHandle(e,t){this.handlesRefs[e]=t}},render(){let{prefixCls:e,marks:t,dots:n,step:r,included:i,disabled:a,vertical:o,reverse:s,min:l,max:u,maximumTrackStyle:d,railStyle:f,dotStyle:p,activeDotStyle:m,id:h}=this,{class:g,style:_}=this.$attrs,{tracks:v,handles:y}=this.renderSlider(),b=K(e,g,{[`${e}-with-marks`]:Object.keys(t).length,[`${e}-disabled`]:a,[`${e}-vertical`]:o,[`${e}-horizontal`]:!o}),x={vertical:o,marks:t,included:i,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:u,min:l,reverse:s,class:`${e}-mark`,onClickLabel:a?RH:this.onClickMarkLabel},S={[sr?`onTouchstartPassive`:`onTouchstart`]:a?RH:this.onTouchStart};return U(`div`,Y(Y({id:h,ref:this.saveSlider,tabindex:`-1`,class:b},S),{},{onMousedown:a?RH:this.onMouseDown,onMouseup:a?RH:this.onMouseUp,onKeydown:a?RH:this.onKeyDown,onFocus:a?RH:this.onFocus,onBlur:a?RH:this.onBlur,style:_}),[U(`div`,{class:`${e}-rail`,style:Z(Z({},d),f)},null),v,U(xH,{prefixCls:e,vertical:o,reverse:s,marks:t,dots:n,step:r,included:i,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:u,min:l,dotStyle:p,activeDotStyle:m},null),y,U(SH,x,{mark:this.$slots.mark}),c(this)])}})}var BH=zH(u({compatConfig:{MODE:3},name:`Slider`,mixins:[cu],inheritAttrs:!1,props:{defaultValue:Number,value:Number,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:f.oneOfType([f.number,f.string]),reverse:{type:Boolean,default:void 0},min:Number,max:Number,ariaLabelForHandle:String,ariaLabelledByForHandle:String,ariaValueTextFormatterForHandle:String,startPoint:Number},emits:[`beforeChange`,`afterChange`,`change`],data(){let e=this.defaultValue===void 0?this.min:this.defaultValue,t=this.value===void 0?e:this.value;return{sValue:this.trimAlignValue(t),dragging:!1}},watch:{value:{handler(e){this.setChangeValue(e)},deep:!0},min(){let{sValue:e}=this;this.setChangeValue(e)},max(){let{sValue:e}=this;this.setChangeValue(e)}},methods:{setChangeValue(e){let t=e===void 0?this.sValue:e,n=this.trimAlignValue(t,this.$props);n!==this.sValue&&(this.setState({sValue:n}),TH(t,this.$props)&&this.$emit(`change`,n))},onChange(e){let t=!E(this,`value`),n=e.sValue>this.max?Z(Z({},e),{sValue:this.max}):e;t&&this.setState(n);let r=n.sValue;this.$emit(`change`,r)},onStart(e){this.setState({dragging:!0});let{sValue:t}=this;this.$emit(`beforeChange`,t);let n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e,n!==t&&(this.prevMovedHandleIndex=0,this.onChange({sValue:n}))},onEnd(e){let{dragging:t}=this;this.removeDocumentEvents(),(t||e)&&this.$emit(`afterChange`,this.sValue),this.setState({dragging:!1})},onMove(e,t){PH(e);let{sValue:n}=this,r=this.calcValueByPos(t);r!==n&&this.onChange({sValue:r})},onKeyboard(e){let{reverse:t,vertical:n}=this.$props,r=IH(e,n,t);if(r){PH(e);let{sValue:t}=this,n=r(t,this.$props),i=this.trimAlignValue(n);if(i===t)return;this.onChange({sValue:i}),this.$emit(`afterChange`,i),this.onEnd()}},getLowerBound(){let e=this.$props.startPoint||this.$props.min;return this.$data.sValue>e?e:this.$data.sValue},getUpperBound(){return this.$data.sValue1&&arguments[1]!==void 0?arguments[1]:{};if(e===null)return null;let n=Z(Z({},this.$props),t);return NH(MH(e,n),n)},getTrack(e){let{prefixCls:t,reverse:n,vertical:r,included:i,minimumTrackStyle:a,mergedTrackStyle:o,length:s,offset:c}=e;return U(yH,{class:`${t}-track`,vertical:r,included:i,offset:c,reverse:n,length:s,style:Z(Z({},a),o)},null)},renderSlider(){let{prefixCls:e,vertical:t,included:n,disabled:r,minimumTrackStyle:i,trackStyle:a,handleStyle:o,tabindex:s,ariaLabelForHandle:c,ariaLabelledByForHandle:l,ariaValueTextFormatterForHandle:u,min:d,max:f,startPoint:p,reverse:m,handle:h,defaultHandle:g}=this,_=h||g,{sValue:v,dragging:y}=this,b=this.calcOffset(v),x=_({class:`${e}-handle`,prefixCls:e,vertical:t,offset:b,value:v,dragging:y,disabled:r,min:d,max:f,reverse:m,index:0,tabindex:s,ariaLabel:c,ariaLabelledBy:l,ariaValueTextFormatter:u,style:o[0]||o,ref:e=>this.saveHandle(0,e),onFocus:this.onFocus,onBlur:this.onBlur}),S=p===void 0?0:this.calcOffset(p),C=a[0]||a;return{tracks:this.getTrack({prefixCls:e,reverse:m,vertical:t,included:n,offset:S,minimumTrackStyle:i,mergedTrackStyle:C,length:b-S}),handles:x}}}})),VH=e=>{let{value:t,handle:n,bounds:r,props:i}=e,{allowCross:a,pushable:o}=i,s=Number(o),c=MH(t,i),l=c;return!a&&n!=null&&r!==void 0&&(n>0&&c<=r[n-1]+s&&(l=r[n-1]+s),n=r[n+1]-s&&(l=r[n+1]-s)),NH(l,i)},HH={defaultValue:f.arrayOf(f.number),value:f.arrayOf(f.number),count:Number,pushable:oe(f.oneOfType([f.looseBool,f.number])),allowCross:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},reverse:{type:Boolean,default:void 0},tabindex:f.arrayOf(f.number),prefixCls:String,min:Number,max:Number,autofocus:{type:Boolean,default:void 0},ariaLabelGroupForHandles:Array,ariaLabelledByGroupForHandles:Array,ariaValueTextFormatterGroupForHandles:Array,draggableTrack:{type:Boolean,default:void 0}},UH=zH(u({compatConfig:{MODE:3},name:`Range`,mixins:[cu],inheritAttrs:!1,props:Zn(HH,{count:1,allowCross:!0,pushable:!1,tabindex:[],draggableTrack:!1,ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]}),emits:[`beforeChange`,`afterChange`,`change`],displayName:`Range`,data(){let{count:e,min:t,max:n}=this,r=Array(...Array(e+1)).map(()=>t),i=E(this,`defaultValue`)?this.defaultValue:r,{value:a}=this;a===void 0&&(a=i);let o=a.map((e,t)=>VH({value:e,handle:t,props:this.$props}));return{sHandle:null,recent:o[0]===n?0:o.length-1,bounds:o}},watch:{value:{handler(e){let{bounds:t}=this;this.setChangeValue(e||t)},deep:!0},min(){let{value:e}=this;this.setChangeValue(e||this.bounds)},max(){let{value:e}=this;this.setChangeValue(e||this.bounds)}},methods:{setChangeValue(e){let{bounds:t}=this,n=e.map((e,n)=>VH({value:e,handle:n,bounds:t,props:this.$props}));if(t.length===n.length){if(n.every((e,n)=>e===t[n]))return null}else n=e.map((e,t)=>VH({value:e,handle:t,props:this.$props}));if(this.setState({bounds:n}),e.some(e=>TH(e,this.$props))){let t=e.map(e=>MH(e,this.$props));this.$emit(`change`,t)}},onChange(e){if(!E(this,`value`))this.setState(e);else{let t={};[`sHandle`,`recent`].forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),Object.keys(t).length&&this.setState(t)}let t=Z(Z({},this.$data),e).bounds;this.$emit(`change`,t)},positionGetValue(e){let t=this.getValue(),n=this.calcValueByPos(e),r=this.getClosestBound(n),i=this.getBoundNeedMoving(n,r);if(n===t[i])return null;let a=[...t];return a[i]=n,a},onStart(e){let{bounds:t}=this;this.$emit(`beforeChange`,t);let n=this.calcValueByPos(e);this.startValue=n,this.startPosition=e;let r=this.getClosestBound(n);if(this.prevMovedHandleIndex=this.getBoundNeedMoving(n,r),this.setState({sHandle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex}),n===t[this.prevMovedHandleIndex])return;let i=[...t];i[this.prevMovedHandleIndex]=n,this.onChange({bounds:i})},onEnd(e){let{sHandle:t}=this;this.removeDocumentEvents(),t||(this.dragTrack=!1),(t!==null||e)&&this.$emit(`afterChange`,this.bounds),this.setState({sHandle:null})},onMove(e,t,n,r){PH(e);let{$data:i,$props:a}=this,o=a.max||100,s=a.min||0;if(n){let e=a.vertical?-t:t;e=a.reverse?-e:e;let n=o-Math.max(...r),c=s-Math.min(...r),l=Math.min(Math.max(e/(this.getSliderLength()/100),c),n),u=r.map(e=>Math.floor(Math.max(Math.min(e+l,o),s)));i.bounds.map((e,t)=>e===u[t]).some(e=>!e)&&this.onChange({bounds:u});return}let{bounds:c,sHandle:l}=this,u=this.calcValueByPos(t);u!==c[l]&&this.moveTo(u)},onKeyboard(e){let{reverse:t,vertical:n}=this.$props,r=IH(e,n,t);if(r){PH(e);let{bounds:t,sHandle:n}=this,i=t[n===null?this.recent:n],a=VH({value:r(i,this.$props),handle:n,bounds:t,props:this.$props});if(a===i)return;this.moveTo(a,!0)}},getClosestBound(e){let{bounds:t}=this,n=0;for(let r=1;r=t[r]&&(n=r);return Math.abs(t[n+1]-e)e-t),this.internalPointsCache={marks:e,step:t,points:a}}return this.internalPointsCache.points},moveTo(e,t){let n=[...this.bounds],{sHandle:r,recent:i}=this,a=r===null?i:r;n[a]=e;let o=a;this.$props.pushable===!1?this.$props.allowCross&&(n.sort((e,t)=>e-t),o=n.indexOf(e)):this.pushSurroundingHandles(n,o),this.onChange({recent:o,sHandle:o,bounds:n}),t&&(this.$emit(`afterChange`,n),this.setState({},()=>{this.handlesRefs[o].focus()}),this.onEnd())},pushSurroundingHandles(e,t){let n=e[t],{pushable:r}=this,i=Number(r),a=0;if(e[t+1]-n=r.length||i<0)return!1;let a=t+n,o=r[i],{pushable:s}=this,c=Number(s),l=n*(e[a]-o);return this.pushHandle(e,a,n,c-l)?(e[t]=o,!0):!1},trimAlignValue(e){let{sHandle:t,bounds:n}=this;return VH({value:e,handle:t,bounds:n,props:this.$props})},ensureValueNotConflict(e,t,n){let{allowCross:r,pushable:i}=n,a=this.$data||{},{bounds:o}=a;if(e=e===void 0?a.sHandle:e,i=Number(i),!r&&e!=null&&o!==void 0){if(e>0&&t<=o[e-1]+i)return o[e-1]+i;if(e=o[e+1]-i)return o[e+1]-i}return t},getTrack(e){let{bounds:t,prefixCls:n,reverse:r,vertical:i,included:a,offsets:o,trackStyle:s}=e;return t.slice(0,-1).map((e,t)=>{let c=t+1;return U(yH,{class:K({[`${n}-track`]:!0,[`${n}-track-${c}`]:!0}),vertical:i,reverse:r,included:a,offset:o[c-1],length:o[c]-o[c-1],style:s[t],key:c},null)})},renderSlider(){let{sHandle:e,bounds:t,prefixCls:n,vertical:r,included:i,disabled:a,min:o,max:s,reverse:c,handle:l,defaultHandle:u,trackStyle:d,handleStyle:f,tabindex:p,ariaLabelGroupForHandles:m,ariaLabelledByGroupForHandles:h,ariaValueTextFormatterGroupForHandles:g}=this,_=l||u,v=t.map(e=>this.calcOffset(e)),y=`${n}-handle`,b=t.map((t,i)=>{let l=p[i]||0;(a||p[i]===null)&&(l=null);let u=e===i;return _({class:K({[y]:!0,[`${y}-${i+1}`]:!0,[`${y}-dragging`]:u}),prefixCls:n,vertical:r,dragging:u,offset:v[i],value:t,index:i,tabindex:l,min:o,max:s,reverse:c,disabled:a,style:f[i],ref:e=>this.saveHandle(i,e),onFocus:this.onFocus,onBlur:this.onBlur,ariaLabel:m[i],ariaLabelledBy:h[i],ariaValueTextFormatter:g[i]})});return{tracks:this.getTrack({bounds:t,prefixCls:n,reverse:c,vertical:r,included:i,offsets:v,trackStyle:d}),handles:b}}}})),WH=u({compatConfig:{MODE:3},name:`SliderTooltip`,inheritAttrs:!1,props:Cy(),setup(e,t){let{attrs:n,slots:r}=t,i=H(null),a=H(null);function o(){ir.cancel(a.value),a.value=null}function s(){a.value=ir(()=>{var e;(e=i.value)==null||e.forcePopupAlign(),a.value=null})}let c=()=>{o(),e.open&&s()};return G([()=>e.open,()=>e.title],()=>{c()},{flush:`post`,immediate:!0}),ft(()=>{c()}),ut(()=>{o()}),()=>U(Ty,Y(Y({ref:i},e),n),r)}}),GH=e=>{let{componentCls:t,controlSize:n,dotSize:r,marginFull:i,marginPart:a,colorFillContentHover:o}=e;return{[t]:Z(Z({},rn(e)),{position:`relative`,height:n,margin:`${a}px ${i}px`,padding:0,cursor:`pointer`,touchAction:`none`,"&-vertical":{margin:`${i}px ${a}px`},[`${t}-rail`]:{position:`absolute`,backgroundColor:e.colorFillTertiary,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},[`${t}-track`]:{position:`absolute`,backgroundColor:e.colorPrimaryBorder,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},"&:hover":{[`${t}-rail`]:{backgroundColor:e.colorFillSecondary},[`${t}-track`]:{backgroundColor:e.colorPrimaryBorderHover},[`${t}-dot`]:{borderColor:o},[`${t}-handle::after`]:{boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorderHover}`},[`${t}-dot-active`]:{borderColor:e.colorPrimary}},[`${t}-handle`]:{position:`absolute`,width:e.handleSize,height:e.handleSize,outline:`none`,[`${t}-dragging`]:{zIndex:1},"&::before":{content:`""`,position:`absolute`,insetInlineStart:-e.handleLineWidth,insetBlockStart:-e.handleLineWidth,width:e.handleSize+e.handleLineWidth*2,height:e.handleSize+e.handleLineWidth*2,backgroundColor:`transparent`},"&::after":{content:`""`,position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:e.handleSize,height:e.handleSize,backgroundColor:e.colorBgElevated,boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorder}`,borderRadius:`50%`,cursor:`pointer`,transition:` + inset-inline-start ${e.motionDurationMid}, + inset-block-start ${e.motionDurationMid}, + width ${e.motionDurationMid}, + height ${e.motionDurationMid}, + box-shadow ${e.motionDurationMid} + `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),insetBlockStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),width:e.handleSizeHover+e.handleLineWidthHover*2,height:e.handleSizeHover+e.handleLineWidthHover*2},"&::after":{boxShadow:`0 0 0 ${e.handleLineWidthHover}px ${e.colorPrimary}`,width:e.handleSizeHover,height:e.handleSizeHover,insetInlineStart:(e.handleSize-e.handleSizeHover)/2,insetBlockStart:(e.handleSize-e.handleSizeHover)/2}}},[`${t}-mark`]:{position:`absolute`,fontSize:e.fontSize},[`${t}-mark-text`]:{position:`absolute`,display:`inline-block`,color:e.colorTextDescription,textAlign:`center`,wordBreak:`keep-all`,cursor:`pointer`,userSelect:`none`,"&-active":{color:e.colorText}},[`${t}-step`]:{position:`absolute`,background:`transparent`,pointerEvents:`none`},[`${t}-dot`]:{position:`absolute`,width:r,height:r,backgroundColor:e.colorBgElevated,border:`${e.handleLineWidth}px solid ${e.colorBorderSecondary}`,borderRadius:`50%`,cursor:`pointer`,transition:`border-color ${e.motionDurationSlow}`,"&-active":{borderColor:e.colorPrimaryBorder}},[`&${t}-disabled`]:{cursor:`not-allowed`,[`${t}-rail`]:{backgroundColor:`${e.colorFillSecondary} !important`},[`${t}-track`]:{backgroundColor:`${e.colorTextDisabled} !important`},[` + ${t}-dot + `]:{backgroundColor:e.colorBgElevated,borderColor:e.colorTextDisabled,boxShadow:`none`,cursor:`not-allowed`},[`${t}-handle::after`]:{backgroundColor:e.colorBgElevated,cursor:`not-allowed`,width:e.handleSize,height:e.handleSize,boxShadow:`0 0 0 ${e.handleLineWidth}px ${new we(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString()}`,insetInlineStart:0,insetBlockStart:0},[` + ${t}-mark-text, + ${t}-dot + `]:{cursor:`not-allowed !important`}}})}},KH=(e,t)=>{let{componentCls:n,railSize:r,handleSize:i,dotSize:a}=e,o=t?`paddingBlock`:`paddingInline`,s=t?`width`:`height`,c=t?`height`:`width`,l=t?`insetBlockStart`:`insetInlineStart`,u=t?`top`:`insetInlineStart`;return{[o]:r,[c]:r*3,[`${n}-rail`]:{[s]:`100%`,[c]:r},[`${n}-track`]:{[c]:r},[`${n}-handle`]:{[l]:(r*3-i)/2},[`${n}-mark`]:{insetInlineStart:0,top:0,[u]:i,[s]:`100%`},[`${n}-step`]:{insetInlineStart:0,top:0,[u]:r,[s]:`100%`,[c]:r},[`${n}-dot`]:{position:`absolute`,[l]:(r-a)/2}}},qH=e=>{let{componentCls:t,marginPartWithMark:n}=e;return{[`${t}-horizontal`]:Z(Z({},KH(e,!0)),{[`&${t}-with-marks`]:{marginBottom:n}})}},JH=e=>{let{componentCls:t}=e;return{[`${t}-vertical`]:Z(Z({},KH(e,!1)),{height:`100%`})}},YH=v(`Slider`,e=>{let t=B(e,{marginPart:(e.controlHeight-e.controlSize)/2,marginFull:e.controlSize/2,marginPartWithMark:e.controlHeightLG-e.controlSize});return[GH(t),qH(t),JH(t)]},e=>{let t=e.controlHeightLG/4;return{controlSize:t,railSize:4,handleSize:t,handleSizeHover:e.controlHeightSM/2,dotSize:8,handleLineWidth:e.lineWidth+1,handleLineWidthHover:e.lineWidth+3}}),XH=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);itypeof e==`number`?e.toString():``,QH=a(u({compatConfig:{MODE:3},name:`ASlider`,inheritAttrs:!1,props:{id:String,prefixCls:String,tooltipPrefixCls:String,range:W([Boolean,Object]),reverse:Q(),min:Number,max:Number,step:W([Object,Number]),marks:Qt(),dots:Q(),value:W([Array,Number]),defaultValue:W([Array,Number]),included:Q(),disabled:Q(),vertical:Q(),tipFormatter:W([Function,Object],()=>ZH),tooltipOpen:Q(),tooltipVisible:Q(),tooltipPlacement:_(),getTooltipPopupContainer:d(),autofocus:Q(),handleStyle:W([Array,Object]),trackStyle:W([Array,Object]),onChange:d(),onAfterChange:d(),onFocus:d(),onBlur:d(),"onUpdate:value":d()},slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i,expose:a}=t,{prefixCls:o,rootPrefixCls:s,direction:c,getPopupContainer:l,configProvider:u}=X(`slider`,e),[d,f]=YH(o),p=zf(),m=H(),h=H({}),g=(e,t)=>{h.value[e]=t},_=J(()=>e.tooltipPlacement?e.tooltipPlacement:e.vertical?c.value===`rtl`?`left`:`right`:`top`),v=()=>{var e;(e=m.value)==null||e.focus()},y=()=>{var e;(e=m.value)==null||e.blur()},b=e=>{i(`update:value`,e),i(`change`,e),p.onFieldChange()},x=e=>{i(`blur`,e)};a({focus:v,blur:y});let S=t=>{var{tooltipPrefixCls:n}=t,r=t.info,{value:i,dragging:a,index:c}=r,u=XH(r,[`value`,`dragging`,`index`]);let{tipFormatter:d,tooltipOpen:f=e.tooltipVisible,getTooltipPopupContainer:p}=e,m=d?h.value[c]||a:!1,v=f||f===void 0&&m;return U(WH,{prefixCls:n,title:d?d(i):``,open:v,placement:_.value,transitionName:`${s.value}-zoom-down`,key:c,overlayClassName:`${o.value}-tooltip`,getPopupContainer:p||l?.value},{default:()=>[U(CH,Y(Y({},u),{},{value:i,onMouseenter:()=>g(c,!0),onMouseleave:()=>g(c,!1)}),null)]})};return()=>{let{tooltipPrefixCls:t,range:i,id:a=p.id.value}=e,s=XH(e,[`tooltipPrefixCls`,`range`,`id`]),l=u.getPrefixCls(`tooltip`,t),h=K(n.class,{[`${o.value}-rtl`]:c.value===`rtl`},f.value);c.value===`rtl`&&!s.vertical&&(s.reverse=!s.reverse);let g;return typeof i==`object`&&(g=i.draggableTrack),d(i?U(UH,Y(Y(Y({},n),s),{},{step:s.step,draggableTrack:g,class:h,ref:m,handle:e=>S({tooltipPrefixCls:l,prefixCls:o.value,info:e}),prefixCls:o.value,onChange:b,onBlur:x}),{mark:r.mark}):U(BH,Y(Y(Y({},n),s),{},{id:a,step:s.step,class:h,ref:m,handle:e=>S({tooltipPrefixCls:l,prefixCls:o.value,info:e}),prefixCls:o.value,onChange:b,onBlur:x}),{mark:r.mark}))}}}));function $H(e){return typeof e==`string`}function eU(){}var tU=()=>({prefixCls:String,itemWidth:String,active:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},status:_(),iconPrefix:String,icon:f.any,adjustMarginRight:String,stepNumber:Number,stepIndex:Number,description:f.any,title:f.any,subTitle:f.any,progressDot:oe(f.oneOfType([f.looseBool,f.func])),tailContent:f.any,icons:f.shape({finish:f.any,error:f.any}).loose,onClick:d(),onStepClick:d(),stepIcon:d(),itemRender:d(),__legacy:Q()}),nU=u({compatConfig:{MODE:3},name:`Step`,inheritAttrs:!1,props:tU(),setup(e,t){let{slots:n,emit:r,attrs:i}=t,a=t=>{r(`click`,t),r(`stepClick`,e.stepIndex)},o=t=>{let{icon:r,title:i,description:a}=t,{prefixCls:o,stepNumber:s,status:c,iconPrefix:l,icons:u,progressDot:d=n.progressDot,stepIcon:f=n.stepIcon}=e,p,m=K(`${o}-icon`,`${l}icon`,{[`${l}icon-${r}`]:r&&$H(r),[`${l}icon-check`]:!r&&c===`finish`&&(u&&!u.finish||!u),[`${l}icon-cross`]:!r&&c===`error`&&(u&&!u.error||!u)}),h=U(`span`,{class:`${o}-icon-dot`},null);return p=d?typeof d==`function`?U(`span`,{class:`${o}-icon`},[d({iconDot:h,index:s-1,status:c,title:i,description:a,prefixCls:o})]):U(`span`,{class:`${o}-icon`},[h]):r&&!$H(r)?U(`span`,{class:`${o}-icon`},[r]):u&&u.finish&&c===`finish`?U(`span`,{class:`${o}-icon`},[u.finish]):u&&u.error&&c===`error`?U(`span`,{class:`${o}-icon`},[u.error]):r||c===`finish`||c===`error`?U(`span`,{class:m},null):U(`span`,{class:`${o}-icon`},[s]),f&&(p=f({index:s-1,status:c,title:i,description:a,node:p})),p};return()=>{let{prefixCls:t,itemWidth:r,active:s,status:c=`wait`,tailContent:l,adjustMarginRight:u,disabled:d,title:f=n.title?.call(n),description:p=n.description?.call(n),subTitle:m=n.subTitle?.call(n),icon:h=n.icon?.call(n),onClick:g,onStepClick:_}=e,v=c||`wait`,y=K(`${t}-item`,`${t}-item-${v}`,{[`${t}-item-custom`]:h,[`${t}-item-active`]:s,[`${t}-item-disabled`]:d===!0}),b={};r&&(b.width=r),u&&(b.marginRight=u);let x={onClick:g||eU};_&&!d&&(x.role=`button`,x.tabindex=0,x.onClick=a);let S=U(`div`,Y(Y({},Br(i,[`__legacy`])),{},{class:[y,i.class],style:[i.style,b]}),[U(`div`,Y(Y({},x),{},{class:`${t}-item-container`}),[U(`div`,{class:`${t}-item-tail`},[l]),U(`div`,{class:`${t}-item-icon`},[o({icon:h,title:f,description:p})]),U(`div`,{class:`${t}-item-content`},[U(`div`,{class:`${t}-item-title`},[f,m&&U(`div`,{title:typeof m==`string`?m:void 0,class:`${t}-item-subtitle`},[m])]),p&&U(`div`,{class:`${t}-item-description`},[p])])])]);return e.itemRender?e.itemRender(S):S}}}),rU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i[]),icons:f.shape({finish:f.any,error:f.any}).loose,stepIcon:d(),isInline:f.looseBool,itemRender:d()},emits:[`change`],setup(e,t){let{slots:n,emit:r}=t,i=t=>{let{current:n}=e;n!==t&&r(`change`,t)},a=(t,r,a)=>{let{prefixCls:o,iconPrefix:s,status:c,current:l,initial:u,icons:d,stepIcon:f=n.stepIcon,isInline:p,itemRender:m,progressDot:h=n.progressDot}=e,g=p||h,_=Z(Z({},t),{class:``}),v=u+r,y={active:v===l,stepNumber:v+1,stepIndex:v,key:v,prefixCls:o,iconPrefix:s,progressDot:g,stepIcon:f,icons:d,onStepClick:i};return c===`error`&&r===l-1&&(_.class=`${o}-next-error`),_.status||(v===l?_.status=c:vm(_,e)),U(nU,Y(Y(Y({},_),y),{},{__legacy:!1}),null))},o=(e,t)=>a(Z({},e.props),t,t=>ao(e,t));return()=>{let{prefixCls:t,direction:r,type:i,labelPlacement:s,iconPrefix:c,status:l,size:u,current:d,progressDot:f=n.progressDot,initial:p,icons:m,items:h,isInline:g,itemRender:_}=e,v=rU(e,[`prefixCls`,`direction`,`type`,`labelPlacement`,`iconPrefix`,`status`,`size`,`current`,`progressDot`,`initial`,`icons`,`items`,`isInline`,`itemRender`]),y=i===`navigation`,b=g||f,x=g?`horizontal`:r,S=g?void 0:u,C=b?`vertical`:s;return U(`div`,Y({class:K(t,`${t}-${r}`,{[`${t}-${S}`]:S,[`${t}-label-${C}`]:x===`horizontal`,[`${t}-dot`]:!!b,[`${t}-navigation`]:y,[`${t}-inline`]:g})},v),[h.filter(e=>e).map((e,t)=>a(e,t)),dt(n.default?.call(n)).map(o)])}}}),aU=e=>{let{componentCls:t,stepsIconCustomTop:n,stepsIconCustomSize:r,stepsIconCustomFontSize:i}=e;return{[`${t}-item-custom`]:{[`> ${t}-item-container > ${t}-item-icon`]:{height:`auto`,background:`none`,border:0,[`> ${t}-icon`]:{top:n,width:r,height:r,fontSize:i,lineHeight:`${r}px`}}},[`&:not(${t}-vertical)`]:{[`${t}-item-custom`]:{[`${t}-item-icon`]:{width:`auto`,background:`none`}}}}},oU=e=>{let{componentCls:t,stepsIconSize:n,lineHeight:r,stepsSmallIconSize:i}=e;return{[`&${t}-label-vertical`]:{[`${t}-item`]:{overflow:`visible`,"&-tail":{marginInlineStart:n/2+e.controlHeightLG,padding:`${e.paddingXXS}px ${e.paddingLG}px`},"&-content":{display:`block`,width:(n/2+e.controlHeightLG)*2,marginTop:e.marginSM,textAlign:`center`},"&-icon":{display:`inline-block`,marginInlineStart:e.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:`none`}},"&-subtitle":{display:`block`,marginBottom:e.marginXXS,marginInlineStart:0,lineHeight:r}},[`&${t}-small:not(${t}-dot)`]:{[`${t}-item`]:{"&-icon":{marginInlineStart:e.controlHeightLG+(n-i)/2}}}}}},sU=e=>{let{componentCls:t,stepsNavContentMaxWidth:n,stepsNavArrowColor:r,stepsNavActiveColor:i,motionDurationSlow:a}=e;return{[`&${t}-navigation`]:{paddingTop:e.paddingSM,[`&${t}-small`]:{[`${t}-item`]:{"&-container":{marginInlineStart:-e.marginSM}}},[`${t}-item`]:{overflow:`visible`,textAlign:`center`,"&-container":{display:`inline-block`,height:`100%`,marginInlineStart:-e.margin,paddingBottom:e.paddingSM,textAlign:`start`,transition:`opacity ${a}`,[`${t}-item-content`]:{maxWidth:n},[`${t}-item-title`]:Z(Z({maxWidth:`100%`,paddingInlineEnd:0},xe),{"&::after":{display:`none`}})},[`&:not(${t}-item-active)`]:{[`${t}-item-container[role='button']`]:{cursor:`pointer`,"&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:`none`}},"&::after":{position:`absolute`,top:`calc(50% - ${e.paddingSM/2}px)`,insetInlineStart:`100%`,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,borderTop:`${e.lineWidth}px ${e.lineType} ${r}`,borderBottom:`none`,borderInlineStart:`none`,borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${r}`,transform:`translateY(-50%) translateX(-50%) rotate(45deg)`,content:`""`},"&::before":{position:`absolute`,bottom:0,insetInlineStart:`50%`,display:`inline-block`,width:0,height:e.lineWidthBold,backgroundColor:i,transition:`width ${a}, inset-inline-start ${a}`,transitionTimingFunction:`ease-out`,content:`""`}},[`${t}-item${t}-item-active::before`]:{insetInlineStart:0,width:`100%`}},[`&${t}-navigation${t}-vertical`]:{[`> ${t}-item`]:{marginInlineEnd:0,"&::before":{display:`none`},[`&${t}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:`unset`,display:`block`,width:e.lineWidth*3,height:`calc(100% - ${e.marginLG}px)`},"&::after":{position:`relative`,insetInlineStart:`50%`,display:`block`,width:e.controlHeight*.25,height:e.controlHeight*.25,marginBottom:e.marginXS,textAlign:`center`,transform:`translateY(-50%) translateX(-50%) rotate(135deg)`},[`> ${t}-item-container > ${t}-item-tail`]:{visibility:`hidden`}}},[`&${t}-navigation${t}-horizontal`]:{[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{visibility:`hidden`}}}},cU=e=>{let{antCls:t,componentCls:n}=e;return{[`&${n}-with-progress`]:{[`${n}-item`]:{paddingTop:e.paddingXXS,[`&-process ${n}-item-container ${n}-item-icon ${n}-icon`]:{color:e.processIconColor}},[`&${n}-vertical > ${n}-item `]:{paddingInlineStart:e.paddingXXS,[`> ${n}-item-container > ${n}-item-tail`]:{top:e.marginXXS,insetInlineStart:e.stepsIconSize/2-e.lineWidth+e.paddingXXS}},[`&, &${n}-small`]:{[`&${n}-horizontal ${n}-item:first-child`]:{paddingBottom:e.paddingXXS,paddingInlineStart:e.paddingXXS}},[`&${n}-small${n}-vertical > ${n}-item > ${n}-item-container > ${n}-item-tail`]:{insetInlineStart:e.stepsSmallIconSize/2-e.lineWidth+e.paddingXXS},[`&${n}-label-vertical`]:{[`${n}-item ${n}-item-tail`]:{top:e.margin-2*e.lineWidth}},[`${n}-item-icon`]:{position:`relative`,[`${t}-progress`]:{position:`absolute`,insetBlockStart:(e.stepsIconSize-e.stepsProgressSize-e.lineWidth*2)/2,insetInlineStart:(e.stepsIconSize-e.stepsProgressSize-e.lineWidth*2)/2}}}}},lU=e=>{let{componentCls:t,descriptionWidth:n,lineHeight:r,stepsCurrentDotSize:i,stepsDotSize:a,motionDurationSlow:o}=e;return{[`&${t}-dot, &${t}-dot${t}-small`]:{[`${t}-item`]:{"&-title":{lineHeight:r},"&-tail":{top:Math.floor((e.stepsDotSize-e.lineWidth*3)/2),width:`100%`,marginTop:0,marginBottom:0,marginInline:`${n/2}px 0`,padding:0,"&::after":{width:`calc(100% - ${e.marginSM*2}px)`,height:e.lineWidth*3,marginInlineStart:e.marginSM}},"&-icon":{width:a,height:a,marginInlineStart:(e.descriptionWidth-a)/2,paddingInlineEnd:0,lineHeight:`${a}px`,background:`transparent`,border:0,[`${t}-icon-dot`]:{position:`relative`,float:`left`,width:`100%`,height:`100%`,borderRadius:100,transition:`all ${o}`,"&::after":{position:`absolute`,top:-e.marginSM,insetInlineStart:(a-e.controlHeightLG*1.5)/2,width:e.controlHeightLG*1.5,height:e.controlHeight,background:`transparent`,content:`""`}}},"&-content":{width:n},[`&-process ${t}-item-icon`]:{position:`relative`,top:(a-i)/2,width:i,height:i,lineHeight:`${i}px`,background:`none`,marginInlineStart:(e.descriptionWidth-i)/2},[`&-process ${t}-icon`]:{[`&:first-child ${t}-icon-dot`]:{insetInlineStart:0}}}},[`&${t}-vertical${t}-dot`]:{[`${t}-item-icon`]:{marginTop:(e.controlHeight-a)/2,marginInlineStart:0,background:`none`},[`${t}-item-process ${t}-item-icon`]:{marginTop:(e.controlHeight-i)/2,top:0,insetInlineStart:(a-i)/2,marginInlineStart:0},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:(e.controlHeight-a)/2,insetInlineStart:0,margin:0,padding:`${a+e.paddingXS}px 0 ${e.paddingXS}px`,"&::after":{marginInlineStart:(a-e.lineWidth)/2}},[`&${t}-small`]:{[`${t}-item-icon`]:{marginTop:(e.controlHeightSM-a)/2},[`${t}-item-process ${t}-item-icon`]:{marginTop:(e.controlHeightSM-i)/2},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:(e.controlHeightSM-a)/2}},[`${t}-item:first-child ${t}-icon-dot`]:{insetInlineStart:0},[`${t}-item-content`]:{width:`inherit`}}}},uU=e=>{let{componentCls:t}=e;return{[`&${t}-rtl`]:{direction:`rtl`,[`${t}-item`]:{"&-subtitle":{float:`left`}},[`&${t}-navigation`]:{[`${t}-item::after`]:{transform:`rotate(-45deg)`}},[`&${t}-vertical`]:{[`> ${t}-item`]:{"&::after":{transform:`rotate(225deg)`},[`${t}-item-icon`]:{float:`right`}}},[`&${t}-dot`]:{[`${t}-item-icon ${t}-icon-dot, &${t}-small ${t}-item-icon ${t}-icon-dot`]:{float:`right`}}}}},dU=e=>{let{componentCls:t,stepsSmallIconSize:n,fontSizeSM:r,fontSize:i,colorTextDescription:a}=e;return{[`&${t}-small`]:{[`&${t}-horizontal:not(${t}-label-vertical) ${t}-item`]:{paddingInlineStart:e.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${t}-item-icon`]:{width:n,height:n,marginTop:0,marginBottom:0,marginInline:`0 ${e.marginXS}px`,fontSize:r,lineHeight:`${n}px`,textAlign:`center`,borderRadius:n},[`${t}-item-title`]:{paddingInlineEnd:e.paddingSM,fontSize:i,lineHeight:`${n}px`,"&::after":{top:n/2}},[`${t}-item-description`]:{color:a,fontSize:i},[`${t}-item-tail`]:{top:n/2-e.paddingXXS},[`${t}-item-custom ${t}-item-icon`]:{width:`inherit`,height:`inherit`,lineHeight:`inherit`,background:`none`,border:0,borderRadius:0,[`> ${t}-icon`]:{fontSize:n,lineHeight:`${n}px`,transform:`none`}}}}},fU=e=>{let{componentCls:t,stepsSmallIconSize:n,stepsIconSize:r}=e;return{[`&${t}-vertical`]:{display:`flex`,flexDirection:`column`,[`> ${t}-item`]:{display:`block`,flex:`1 0 auto`,paddingInlineStart:0,overflow:`visible`,[`${t}-item-icon`]:{float:`left`,marginInlineEnd:e.margin},[`${t}-item-content`]:{display:`block`,minHeight:e.controlHeight*1.5,overflow:`hidden`},[`${t}-item-title`]:{lineHeight:`${r}px`},[`${t}-item-description`]:{paddingBottom:e.paddingSM}},[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{position:`absolute`,top:0,insetInlineStart:e.stepsIconSize/2-e.lineWidth,width:e.lineWidth,height:`100%`,padding:`${r+e.marginXXS*1.5}px 0 ${e.marginXXS*1.5}px`,"&::after":{width:e.lineWidth,height:`100%`}},[`> ${t}-item:not(:last-child) > ${t}-item-container > ${t}-item-tail`]:{display:`block`},[` > ${t}-item > ${t}-item-container > ${t}-item-content > ${t}-item-title`]:{"&::after":{display:`none`}},[`&${t}-small ${t}-item-container`]:{[`${t}-item-tail`]:{position:`absolute`,top:0,insetInlineStart:e.stepsSmallIconSize/2-e.lineWidth,padding:`${n+e.marginXXS*1.5}px 0 ${e.marginXXS*1.5}px`},[`${t}-item-title`]:{lineHeight:`${n}px`}}}}},pU=e=>{let{componentCls:t,inlineDotSize:n,inlineTitleColor:r,inlineTailColor:i}=e,a=e.paddingXS+e.lineWidth,o={[`${t}-item-container ${t}-item-content ${t}-item-title`]:{color:r}};return{[`&${t}-inline`]:{width:`auto`,display:`inline-flex`,[`${t}-item`]:{flex:`none`,"&-container":{padding:`${a}px ${e.paddingXXS}px 0`,margin:`0 ${e.marginXXS/2}px`,borderRadius:e.borderRadiusSM,cursor:`pointer`,transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:n,height:n,marginInlineStart:`calc(50% - ${n/2}px)`,[`> ${t}-icon`]:{top:0},[`${t}-icon-dot`]:{borderRadius:e.fontSizeSM/4}},"&-content":{width:`auto`,marginTop:e.marginXS-e.lineWidth},"&-title":{color:r,fontSize:e.fontSizeSM,lineHeight:e.lineHeightSM,fontWeight:`normal`,marginBottom:e.marginXXS/2},"&-description":{display:`none`},"&-tail":{marginInlineStart:0,top:a+n/2,transform:`translateY(-50%)`,"&:after":{width:`100%`,height:e.lineWidth,borderRadius:0,marginInlineStart:0,background:i}},[`&:first-child ${t}-item-tail`]:{width:`50%`,marginInlineStart:`50%`},[`&:last-child ${t}-item-tail`]:{display:`block`,width:`50%`},"&-wait":Z({[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:e.colorBorderBg,border:`${e.lineWidth}px ${e.lineType} ${i}`}},o),"&-finish":Z({[`${t}-item-tail::after`]:{backgroundColor:i},[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:i,border:`${e.lineWidth}px ${e.lineType} ${i}`}},o),"&-error":o,"&-active, &-process":Z({[`${t}-item-icon`]:{width:n,height:n,marginInlineStart:`calc(50% - ${n/2}px)`,top:0}},o),[`&:not(${t}-item-active) > ${t}-item-container[role='button']:hover`]:{[`${t}-item-title`]:{color:r}}}}}},mU;(function(e){e.wait=`wait`,e.process=`process`,e.finish=`finish`,e.error=`error`})(mU||={});var hU=(e,t)=>{let n=`${t.componentCls}-item`,r=`${e}IconColor`,i=`${e}TitleColor`,a=`${e}DescriptionColor`,o=`${e}TailColor`,s=`${e}IconBgColor`,c=`${e}IconBorderColor`,l=`${e}DotColor`;return{[`${n}-${e} ${n}-icon`]:{backgroundColor:t[s],borderColor:t[c],[`> ${t.componentCls}-icon`]:{color:t[r],[`${t.componentCls}-icon-dot`]:{background:t[l]}}},[`${n}-${e}${n}-custom ${n}-icon`]:{[`> ${t.componentCls}-icon`]:{color:t[l]}},[`${n}-${e} > ${n}-container > ${n}-content > ${n}-title`]:{color:t[i],"&::after":{backgroundColor:t[o]}},[`${n}-${e} > ${n}-container > ${n}-content > ${n}-description`]:{color:t[a]},[`${n}-${e} > ${n}-container > ${n}-tail::after`]:{backgroundColor:t[o]}}},gU=e=>{let{componentCls:t,motionDurationSlow:n}=e,r=`${t}-item`;return Z(Z(Z(Z(Z(Z({[r]:{position:`relative`,display:`inline-block`,flex:1,overflow:`hidden`,verticalAlign:`top`,"&:last-child":{flex:`none`,[`> ${r}-container > ${r}-tail, > ${r}-container > ${r}-content > ${r}-title::after`]:{display:`none`}}},[`${r}-container`]:{outline:`none`},[`${r}-icon, ${r}-content`]:{display:`inline-block`,verticalAlign:`top`},[`${r}-icon`]:{width:e.stepsIconSize,height:e.stepsIconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:e.marginXS,fontSize:e.stepsIconFontSize,fontFamily:e.fontFamily,lineHeight:`${e.stepsIconSize}px`,textAlign:`center`,borderRadius:e.stepsIconSize,border:`${e.lineWidth}px ${e.lineType} transparent`,transition:`background-color ${n}, border-color ${n}`,[`${t}-icon`]:{position:`relative`,top:e.stepsIconTop,color:e.colorPrimary,lineHeight:1}},[`${r}-tail`]:{position:`absolute`,top:e.stepsIconSize/2-e.paddingXXS,insetInlineStart:0,width:`100%`,"&::after":{display:`inline-block`,width:`100%`,height:e.lineWidth,background:e.colorSplit,borderRadius:e.lineWidth,transition:`background ${n}`,content:`""`}},[`${r}-title`]:{position:`relative`,display:`inline-block`,paddingInlineEnd:e.padding,color:e.colorText,fontSize:e.fontSizeLG,lineHeight:`${e.stepsTitleLineHeight}px`,"&::after":{position:`absolute`,top:e.stepsTitleLineHeight/2,insetInlineStart:`100%`,display:`block`,width:9999,height:e.lineWidth,background:e.processTailColor,content:`""`}},[`${r}-subtitle`]:{display:`inline`,marginInlineStart:e.marginXS,color:e.colorTextDescription,fontWeight:`normal`,fontSize:e.fontSize},[`${r}-description`]:{color:e.colorTextDescription,fontSize:e.fontSize}},hU(mU.wait,e)),hU(mU.process,e)),{[`${r}-process > ${r}-container > ${r}-title`]:{fontWeight:e.fontWeightStrong}}),hU(mU.finish,e)),hU(mU.error,e)),{[`${r}${t}-next-error > ${t}-item-title::after`]:{background:e.colorError},[`${r}-disabled`]:{cursor:`not-allowed`}})},_U=e=>{let{componentCls:t,motionDurationSlow:n}=e;return{[`& ${t}-item`]:{[`&:not(${t}-item-active)`]:{[`& > ${t}-item-container[role='button']`]:{cursor:`pointer`,[`${t}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${t}-icon`]:{transition:`color ${n}`}},"&:hover":{[`${t}-item`]:{"&-title, &-subtitle, &-description":{color:e.colorPrimary}}}},[`&:not(${t}-item-process)`]:{[`& > ${t}-item-container[role='button']:hover`]:{[`${t}-item`]:{"&-icon":{borderColor:e.colorPrimary,[`${t}-icon`]:{color:e.colorPrimary}}}}}}},[`&${t}-horizontal:not(${t}-label-vertical)`]:{[`${t}-item`]:{paddingInlineStart:e.padding,whiteSpace:`nowrap`,"&:first-child":{paddingInlineStart:0},[`&:last-child ${t}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:`none`},"&-description":{maxWidth:e.descriptionWidth,whiteSpace:`normal`}}}}},vU=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z({},rn(e)),{display:`flex`,width:`100%`,fontSize:0,textAlign:`initial`}),gU(e)),_U(e)),aU(e)),dU(e)),fU(e)),oU(e)),lU(e)),sU(e)),uU(e)),cU(e)),pU(e))}},yU=v(`Steps`,e=>{let{wireframe:t,colorTextDisabled:n,fontSizeHeading3:r,fontSize:i,controlHeight:a,controlHeightLG:o,colorTextLightSolid:s,colorText:c,colorPrimary:l,colorTextLabel:u,colorTextDescription:d,colorTextQuaternary:f,colorFillContent:p,controlItemBgActive:m,colorError:h,colorBgContainer:g,colorBorderSecondary:_}=e,v=e.controlHeight,y=e.colorSplit;return[vU(B(e,{processTailColor:y,stepsNavArrowColor:n,stepsIconSize:v,stepsIconCustomSize:v,stepsIconCustomTop:0,stepsIconCustomFontSize:o/2,stepsIconTop:-.5,stepsIconFontSize:i,stepsTitleLineHeight:a,stepsSmallIconSize:r,stepsDotSize:a/4,stepsCurrentDotSize:o/4,stepsNavContentMaxWidth:`auto`,processIconColor:s,processTitleColor:c,processDescriptionColor:c,processIconBgColor:l,processIconBorderColor:l,processDotColor:l,waitIconColor:t?n:u,waitTitleColor:d,waitDescriptionColor:d,waitTailColor:y,waitIconBgColor:t?g:p,waitIconBorderColor:t?n:`transparent`,waitDotColor:n,finishIconColor:l,finishTitleColor:c,finishDescriptionColor:d,finishTailColor:l,finishIconBgColor:t?g:m,finishIconBorderColor:t?l:m,finishDotColor:l,errorIconColor:s,errorTitleColor:h,errorDescriptionColor:h,errorTailColor:y,errorIconBgColor:h,errorIconBorderColor:h,errorDotColor:h,stepsNavActiveColor:l,stepsProgressSize:o,inlineDotSize:6,inlineTitleColor:f,inlineTailColor:_}))]},{descriptionWidth:140}),bU=u({compatConfig:{MODE:3},name:`ASteps`,inheritAttrs:!1,props:Zn({prefixCls:String,iconPrefix:String,current:Number,initial:Number,percent:Number,responsive:Q(),items:Ue(),labelPlacement:_(),status:_(),size:_(),direction:_(),progressDot:W([Boolean,Function]),type:_(),onChange:d(),"onUpdate:current":d()},{current:0,responsive:!0,labelPlacement:`horizontal`}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i}=t,{prefixCls:a,direction:o,configProvider:s}=X(`steps`,e),[c,l]=yU(a),[,u]=re(),d=Uv(),f=J(()=>e.responsive&&d.value.xs?`vertical`:e.direction),p=J(()=>s.getPrefixCls(``,e.iconPrefix)),m=e=>{i(`update:current`,e),i(`change`,e)},h=J(()=>e.type===`inline`),g=J(()=>h.value?void 0:e.percent),_=t=>{let{node:n,status:r}=t;if(r===`process`&&e.percent!==void 0){let t=e.size===`small`?u.value.controlHeight:u.value.controlHeightLG;return U(`div`,{class:`${a.value}-progress-icon`},[U(zV,{type:`circle`,percent:g.value,size:t,strokeWidth:4,format:()=>null},null),n])}return n},v=J(()=>({finish:U(Df,{class:`${a.value}-finish-icon`},null),error:U(Pe,{class:`${a.value}-error-icon`},null)}));return()=>{let t=K({[`${a.value}-rtl`]:o.value===`rtl`,[`${a.value}-with-progress`]:g.value!==void 0},n.class,l.value);return c(U(iU,Y(Y(Y({icons:v.value},n),Br(e,[`percent`,`responsive`])),{},{items:e.items,direction:f.value,prefixCls:a.value,iconPrefix:p.value,class:t,onChange:m,isInline:h.value,itemRender:h.value?(e,t)=>e.description?U(Ty,{title:e.description},{default:()=>[t]}):t:void 0}),Z({stepIcon:_},r)))}}}),xU=u(Z(Z({compatConfig:{MODE:3}},nU),{name:`AStep`,props:tU()})),SU=Z(bU,{Step:xU,install:e=>(e.component(bU.name,bU),e.component(xU.name,xU),e)}),CU=e=>{let{componentCls:t}=e,n=`${t}-inner`;return{[t]:{[`&${t}-small`]:{minWidth:e.switchMinWidthSM,height:e.switchHeightSM,lineHeight:`${e.switchHeightSM}px`,[`${t}-inner`]:{paddingInlineStart:e.switchInnerMarginMaxSM,paddingInlineEnd:e.switchInnerMarginMinSM,[`${n}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSizeSM+e.switchPadding*2}px - ${e.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSizeSM+e.switchPadding*2}px + ${e.switchInnerMarginMaxSM*2}px)`},[`${n}-unchecked`]:{marginTop:-e.switchHeightSM,marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:e.switchPinSizeSM,height:e.switchPinSizeSM},[`${t}-loading-icon`]:{top:(e.switchPinSizeSM-e.switchLoadingIconSize)/2,fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:e.switchInnerMarginMinSM,paddingInlineEnd:e.switchInnerMarginMaxSM,[`${n}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${n}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding*2}px + ${e.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSizeSM+e.switchPadding*2}px - ${e.switchInnerMarginMaxSM*2}px)`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding}px)`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${n}`]:{[`${n}-unchecked`]:{marginInlineStart:e.marginXXS/2,marginInlineEnd:-e.marginXXS/2}},[`&${t}-checked ${n}`]:{[`${n}-checked`]:{marginInlineStart:-e.marginXXS/2,marginInlineEnd:e.marginXXS/2}}}}}}},wU=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:`relative`,top:(e.switchPinSize-e.fontSize)/2,color:e.switchLoadingIconColor,verticalAlign:`top`},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}},TU=e=>{let{componentCls:t}=e,n=`${t}-handle`;return{[t]:{[n]:{position:`absolute`,top:e.switchPadding,insetInlineStart:e.switchPadding,width:e.switchPinSize,height:e.switchPinSize,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:e.colorWhite,borderRadius:e.switchPinSize/2,boxShadow:e.switchHandleShadow,transition:`all ${e.switchDuration} ease-in-out`,content:`""`}},[`&${t}-checked ${n}`]:{insetInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding}px)`},[`&:not(${t}-disabled):active`]:{[`${n}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${n}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},EU=e=>{let{componentCls:t}=e,n=`${t}-inner`;return{[t]:{[n]:{display:`block`,overflow:`hidden`,borderRadius:100,height:`100%`,paddingInlineStart:e.switchInnerMarginMax,paddingInlineEnd:e.switchInnerMarginMin,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${n}-checked, ${n}-unchecked`]:{display:`block`,color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:`none`},[`${n}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSize+e.switchPadding*2}px - ${e.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSize+e.switchPadding*2}px + ${e.switchInnerMarginMax*2}px)`},[`${n}-unchecked`]:{marginTop:-e.switchHeight,marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${n}`]:{paddingInlineStart:e.switchInnerMarginMin,paddingInlineEnd:e.switchInnerMarginMax,[`${n}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${n}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding*2}px + ${e.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSize+e.switchPadding*2}px - ${e.switchInnerMarginMax*2}px)`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${n}`]:{[`${n}-unchecked`]:{marginInlineStart:e.switchPadding*2,marginInlineEnd:-e.switchPadding*2}},[`&${t}-checked ${n}`]:{[`${n}-checked`]:{marginInlineStart:-e.switchPadding*2,marginInlineEnd:e.switchPadding*2}}}}}},DU=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z({},rn(e)),{position:`relative`,display:`inline-block`,boxSizing:`border-box`,minWidth:e.switchMinWidth,height:e.switchHeight,lineHeight:`${e.switchHeight}px`,verticalAlign:`middle`,background:e.colorTextQuaternary,border:`0`,borderRadius:100,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,userSelect:`none`,[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),de(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:`not-allowed`,opacity:e.switchDisabledOpacity,"*":{boxShadow:`none`,cursor:`not-allowed`}},[`&${t}-rtl`]:{direction:`rtl`}})}},OU=v(`Switch`,e=>{let t=e.fontSize*e.lineHeight,n=e.controlHeight/2,r=t-4,i=n-4,a=B(e,{switchMinWidth:r*2+8,switchHeight:t,switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchInnerMarginMin:r/2,switchInnerMarginMax:r+2+4,switchPadding:2,switchPinSize:r,switchBg:e.colorBgContainer,switchMinWidthSM:i*2+4,switchHeightSM:n,switchInnerMarginMinSM:i/2,switchInnerMarginMaxSM:i+2+4,switchPinSizeSM:i,switchHandleShadow:`0 2px 4px 0 ${new we(`#00230b`).setAlpha(.2).toRgbString()}`,switchLoadingIconSize:e.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:`-30%`});return[DU(a),EU(a),TU(a),wU(a),CU(a)]}),kU=m(`small`,`default`),AU=a(u({compatConfig:{MODE:3},name:`ASwitch`,__ANT_SWITCH:!0,inheritAttrs:!1,props:{id:String,prefixCls:String,size:f.oneOf(kU),disabled:{type:Boolean,default:void 0},checkedChildren:f.any,unCheckedChildren:f.any,tabindex:f.oneOfType([f.string,f.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:f.oneOfType([f.string,f.number,f.looseBool]),checkedValue:f.oneOfType([f.string,f.number,f.looseBool]).def(!0),unCheckedValue:f.oneOfType([f.string,f.number,f.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function},slots:Object,setup(t,n){let{attrs:r,slots:a,expose:o,emit:s}=n,c=zf(),l=at(),u=J(()=>t.disabled??l.value);i(()=>{e(!(`defaultChecked`in r),`Switch`,`'defaultChecked' is deprecated, please use 'v-model:checked'`),e(!(`value`in r),`Switch`,"`value` is not validate prop, do you mean `checked`?")});let d=H(t.checked===void 0?r.defaultChecked:t.checked),f=J(()=>d.value===t.checkedValue);G(()=>t.checked,()=>{d.value=t.checked});let{prefixCls:p,direction:m,size:h}=X(`switch`,t),[g,_]=OU(p),v=H(),y=()=>{var e;(e=v.value)==null||e.focus()};o({focus:y,blur:()=>{var e;(e=v.value)==null||e.blur()}}),V(()=>{z(()=>{t.autofocus&&!u.value&&v.value.focus()})});let b=(e,t)=>{u.value||(s(`update:checked`,e),s(`change`,e,t),c.onFieldChange())},x=e=>{s(`blur`,e)},S=e=>{y();let n=f.value?t.unCheckedValue:t.checkedValue;b(n,e),s(`click`,n,e)},C=e=>{e.keyCode===$.LEFT?b(t.unCheckedValue,e):e.keyCode===$.RIGHT&&b(t.checkedValue,e),s(`keydown`,e)},w=e=>{var t;(t=v.value)==null||t.blur(),s(`mouseup`,e)},T=J(()=>({[`${p.value}-small`]:h.value===`small`,[`${p.value}-loading`]:t.loading,[`${p.value}-checked`]:f.value,[`${p.value}-disabled`]:u.value,[p.value]:!0,[`${p.value}-rtl`]:m.value===`rtl`,[_.value]:!0}));return()=>g(U(db,null,{default:()=>[U(`button`,Y(Y(Y({},Br(t,[`prefixCls`,`checkedChildren`,`unCheckedChildren`,`checked`,`autofocus`,`checkedValue`,`unCheckedValue`,`id`,`onChange`,`onUpdate:checked`])),r),{},{id:t.id??c.id.value,onKeydown:C,onClick:S,onBlur:x,onMouseup:w,type:`button`,role:`switch`,"aria-checked":d.value,disabled:u.value||t.loading,class:[r.class,T.value],ref:v}),[U(`div`,{class:`${p.value}-handle`},[t.loading?U(qt,{class:`${p.value}-loading-icon`},null):null]),U(`span`,{class:`${p.value}-inner`},[U(`span`,{class:`${p.value}-inner-checked`},[on(a,t,`checkedChildren`)]),U(`span`,{class:`${p.value}-inner-unchecked`},[on(a,t,`unCheckedChildren`)])])])]}))}})),jU=Symbol(`TableContextProps`),MU=e=>{fe(jU,e)},NU=()=>g(jU,{}),PU=`RC_TABLE_KEY`;function FU(e){return e==null?[]:Array.isArray(e)?e:[e]}function IU(e,t){if(!t&&typeof t!=`number`)return e;let n=FU(t),r=e;for(let e=0;e{let{key:r,dataIndex:i}=e||{},a=r||FU(i).join(`-`)||PU;for(;n[a];)a=`${a}_next`;n[a]=!0,t.push(a)}),t}function RU(){let e={};function t(e,n){n&&Object.keys(n).forEach(r=>{let i=n[r];i&&typeof i==`object`?(e[r]=e[r]||{},t(e[r],i)):e[r]=i})}return[...arguments].forEach(n=>{t(e,n)}),e}function zU(e){return e!=null}var BU=Symbol(`SlotsContextProps`),VU=e=>{fe(BU,e)},HU=()=>g(BU,J(()=>({}))),UU=Symbol(`ContextProps`),WU=e=>{fe(UU,e)},GU=()=>g(UU,{onResizeColumn:()=>{}}),KU=`RC_TABLE_INTERNAL_COL_DEFINE`,qU=Symbol(`HoverContextProps`),JU=e=>{fe(qU,e)},YU=()=>g(qU,{startRow:q(-1),endRow:q(-1),onHover(){}}),XU=q(!1),ZU=()=>{V(()=>{XU.value=XU.value||OA(`position`,`sticky`)})},QU=()=>XU,$U=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i=n}function tW(e){return e&&typeof e==`object`&&!Array.isArray(e)&&!p(e)}var nW=u({name:`Cell`,props:[`prefixCls`,`record`,`index`,`renderIndex`,`dataIndex`,`customRender`,`component`,`colSpan`,`rowSpan`,`fixLeft`,`fixRight`,`firstFixLeft`,`lastFixLeft`,`firstFixRight`,`lastFixRight`,`appendNode`,`additionalProps`,`ellipsis`,`align`,`rowType`,`isSticky`,`column`,`cellType`,`transformCellText`],setup(e,t){let{slots:n}=t,r=HU(),{onHover:i,startRow:a,endRow:o}=YU(),s=J(()=>e.colSpan??e.additionalProps?.colSpan??e.additionalProps?.colspan),c=J(()=>e.rowSpan??e.additionalProps?.rowSpan??e.additionalProps?.rowspan),l=Wv(()=>{let{index:t}=e;return eW(t,c.value||1,a.value,o.value)}),u=QU(),d=(t,n)=>{var r;let{record:a,index:o,additionalProps:s}=e;a&&i(o,o+n-1),(r=s?.onMouseenter)==null||r.call(s,t)},f=t=>{var n;let{record:r,additionalProps:a}=e;r&&i(-1,-1),(n=a?.onMouseleave)==null||n.call(a,t)},m=e=>{let t=dt(e)[0];return p(t)?t.type===vt?t.children:Array.isArray(t.children)?m(t.children):void 0:t},h=q(null);return G([l,()=>e.prefixCls,h],()=>{let t=ae(h.value);t&&(l.value?rS(t,`${e.prefixCls}-cell-row-hover`):iS(t,`${e.prefixCls}-cell-row-hover`))}),()=>{let{prefixCls:t,record:i,index:a,renderIndex:o,dataIndex:l,customRender:g,component:_=`td`,fixLeft:v,fixRight:y,firstFixLeft:b,lastFixLeft:x,firstFixRight:S,lastFixRight:C,appendNode:w=n.appendNode?.call(n),additionalProps:T={},ellipsis:E,align:D,rowType:O,isSticky:k,column:A={},cellType:j}=e,M=`${t}-cell`,N,P,F=n.default?.call(n);if(zU(F)||j===`header`)P=F;else{let t=IU(i,l);if(P=t,g){let e=g({text:t,value:t,record:i,index:a,renderIndex:o,column:A.__originColumn__});tW(e)?(P=e.children,N=e.props):P=e}!(`RC_TABLE_INTERNAL_COL_DEFINE`in A)&&j===`body`&&r.value.bodyCell&&!A.slots?.customRender&&(P=ce(uo(r.value,`bodyCell`,{text:t,value:t,record:i,index:a,column:A.__originColumn__},()=>{let e=P===void 0?t:P;return[typeof e==`object`&&Nt(e)||typeof e!=`object`?e:null]}))),e.transformCellText&&(P=e.transformCellText({text:P,record:i,index:a,column:A.__originColumn__}))}typeof P==`object`&&!Array.isArray(P)&&!p(P)&&(P=null),E&&(x||S)&&(P=U(`span`,{class:`${M}-content`},[P])),Array.isArray(P)&&P.length===1&&(P=P[0]);let I=N||{},{colSpan:L,rowSpan:ee,style:te,class:ne}=I,R=$U(I,[`colSpan`,`rowSpan`,`style`,`class`]),re=(L===void 0?s.value:L)??1,ie=(ee===void 0?c.value:ee)??1;if(re===0||ie===0)return null;let ae={},oe=typeof v==`number`&&u.value,z=typeof y==`number`&&u.value;oe&&(ae.position=`sticky`,ae.left=`${v}px`),z&&(ae.position=`sticky`,ae.right=`${y}px`);let se={};D&&(se.textAlign=D);let B,V=E===!0?{showTitle:!0}:E;return V&&(V.showTitle||O===`header`)&&(typeof P==`string`||typeof P==`number`?B=P.toString():p(P)&&(B=m([P]))),U(_,Y(Y({},Z(Z(Z({title:B},R),T),{colSpan:re===1?null:re,rowSpan:ie===1?null:ie,class:K(M,{[`${M}-fix-left`]:oe&&u.value,[`${M}-fix-left-first`]:b&&u.value,[`${M}-fix-left-last`]:x&&u.value,[`${M}-fix-right`]:z&&u.value,[`${M}-fix-right-first`]:S&&u.value,[`${M}-fix-right-last`]:C&&u.value,[`${M}-ellipsis`]:E,[`${M}-with-append`]:w,[`${M}-fix-sticky`]:(oe||z)&&k&&u.value},T.class,ne),onMouseenter:e=>{d(e,ie)},onMouseleave:f,style:[T.style,se,ae,te]})),{},{ref:h}),{default:()=>[w,P,n.dragHandle?.call(n)]})}}});function rW(e,t,n,r,i){let a=n[e]||{},o=n[t]||{},s,c;a.fixed===`left`?s=r.left[e]:o.fixed===`right`&&(c=r.right[t]);let l=!1,u=!1,d=!1,f=!1,p=n[t+1],m=n[e-1];return i===`rtl`?s===void 0?c!==void 0&&(d=!(p&&p.fixed===`right`)):f=!(m&&m.fixed===`left`):s===void 0?c!==void 0&&(u=!(m&&m.fixed===`right`)):l=!(p&&p.fixed===`left`),{fixLeft:s,fixRight:c,lastFixLeft:l,firstFixRight:u,lastFixRight:d,firstFixLeft:f,isSticky:r.isSticky}}var iW={mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`},touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`}},aW=50,oW=u({compatConfig:{MODE:3},name:`DragHandle`,props:{prefixCls:String,width:{type:Number,required:!0},minWidth:{type:Number,default:aW},maxWidth:{type:Number,default:1/0},column:{type:Object,default:void 0}},setup(e){let t=0,n={remove:()=>{}},r={remove:()=>{}},i=()=>{n.remove(),r.remove()};y(()=>{i()}),S(()=>{pi(!isNaN(e.width),`Table`,`width must be a number when use resizable`)});let{onResizeColumn:a}=GU(),o=J(()=>typeof e.minWidth==`number`&&!isNaN(e.minWidth)?e.minWidth:aW),s=J(()=>typeof e.maxWidth==`number`&&!isNaN(e.maxWidth)?e.maxWidth:1/0),c=Zt(),l=0,u=q(!1),d,f=n=>{let r=0;r=n.touches?n.touches.length?n.touches[0].pageX:n.changedTouches[0].pageX:n.pageX;let i=t-r,c=Math.max(l-i,o.value);c=Math.min(c,s.value),ir.cancel(d),d=ir(()=>{a(c,e.column.__originColumn__)})},p=e=>{f(e)},m=e=>{u.value=!1,f(e),i()},h=(e,a)=>{u.value=!0,i(),l=c.vnode.el.parentNode.getBoundingClientRect().width,!(e instanceof MouseEvent&&e.which!==1)&&(e.stopPropagation&&e.stopPropagation(),t=e.touches?e.touches[0].pageX:e.pageX,n=cr(document.documentElement,a.move,p),r=cr(document.documentElement,a.stop,m))},g=e=>{e.stopPropagation(),e.preventDefault(),h(e,iW.mouse)},_=e=>{e.stopPropagation(),e.preventDefault(),h(e,iW.touch)},v=e=>{e.stopPropagation(),e.preventDefault()};return()=>{let{prefixCls:t}=e,n={[sr?`onTouchstartPassive`:`onTouchstart`]:e=>_(e)};return U(`div`,Y(Y({class:`${t}-resize-handle ${u.value?`dragging`:``}`,onMousedown:g},n),{},{onClick:v}),[U(`div`,{class:`${t}-resize-handle-line`},null)])}}}),sW=u({name:`HeaderRow`,props:[`cells`,`stickyOffsets`,`flattenColumns`,`rowComponent`,`cellComponent`,`index`,`customHeaderRow`],setup(e){let t=NU();return()=>{let{prefixCls:n,direction:r}=t,{cells:i,stickyOffsets:a,flattenColumns:o,rowComponent:s,cellComponent:c,customHeaderRow:l,index:u}=e,d;l&&(d=l(i.map(e=>e.column),u));let f=LU(i.map(e=>e.column));return U(s,d,{default:()=>[i.map((e,t)=>{let{column:i}=e,s=rW(e.colStart,e.colEnd,o,a,r),l;i&&i.customHeaderCell&&(l=e.column.customHeaderCell(i));let u=i;return U(nW,Y(Y(Y({},e),{},{cellType:`header`,ellipsis:i.ellipsis,align:i.align,component:c,prefixCls:n,key:f[t]},s),{},{additionalProps:l,rowType:`header`,column:i}),{default:()=>i.title,dragHandle:()=>u.resizable?U(oW,{prefixCls:n,width:u.width,minWidth:u.minWidth,maxWidth:u.maxWidth,column:u},null):null})})]})}}});function cW(e){let t=[];function n(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[i]=t[i]||[];let a=r;return e.filter(Boolean).map(e=>{let r={key:e.key,class:K(e.className,e.class),column:e,colStart:a},o=1,s=e.children;return s&&s.length>0&&(o=n(s,a,i+1).reduce((e,t)=>e+t,0),r.hasSubColumns=!0),`colSpan`in e&&({colSpan:o}=e),`rowSpan`in e&&(r.rowSpan=e.rowSpan),r.colSpan=o,r.colEnd=r.colStart+o-1,t[i].push(r),a+=o,o})}n(e,0);let r=t.length;for(let e=0;e{!(`rowSpan`in t)&&!t.hasSubColumns&&(t.rowSpan=r-e)});return t}var lW=u({name:`TableHeader`,inheritAttrs:!1,props:[`columns`,`flattenColumns`,`stickyOffsets`,`customHeaderRow`],setup(e){let t=NU(),n=J(()=>cW(e.columns));return()=>{let{prefixCls:r,getComponent:i}=t,{stickyOffsets:a,flattenColumns:o,customHeaderRow:s}=e,c=i([`header`,`wrapper`],`thead`),l=i([`header`,`row`],`tr`),u=i([`header`,`cell`],`th`);return U(c,{class:`${r}-thead`},{default:()=>[n.value.map((e,t)=>U(sW,{key:t,flattenColumns:o,cells:e,stickyOffsets:a,rowComponent:l,cellComponent:u,customHeaderRow:s,index:t},null))]})}}}),uW=Symbol(`ExpandedRowProps`),dW=e=>{fe(uW,e)},fW=()=>g(uW,{}),pW=u({name:`ExpandedRow`,inheritAttrs:!1,props:[`prefixCls`,`component`,`cellComponent`,`expanded`,`colSpan`,`isEmpty`],setup(e,t){let{slots:n,attrs:r}=t,i=NU(),{fixHeader:a,fixColumn:o,componentWidth:s,horizonScroll:c}=fW();return()=>{let{prefixCls:t,component:l,cellComponent:u,expanded:d,colSpan:f,isEmpty:p}=e;return U(l,{class:r.class,style:{display:d?null:`none`}},{default:()=>[U(nW,{component:u,prefixCls:t,colSpan:f},{default:()=>{let e=n.default?.call(n);return(p?c.value:o.value)&&(e=U(`div`,{style:{width:`${s.value-(a.value?i.scrollbarSize:0)}px`,position:`sticky`,left:0,overflow:`hidden`},class:`${t}-expanded-row-fixed`},[e])),e}})]})}}}),mW=u({name:`MeasureCell`,props:[`columnKey`],setup(e,t){let{emit:n}=t,r=H();return V(()=>{r.value&&n(`columnResize`,e.columnKey,r.value.offsetWidth)}),()=>U(Qn,{onResize:t=>{let{offsetWidth:r}=t;n(`columnResize`,e.columnKey,r)}},{default:()=>[U(`td`,{ref:r,style:{padding:0,border:0,height:0}},[U(`div`,{style:{height:0,overflow:`hidden`}},[en(`\xA0`)])])]})}}),hW=Symbol(`BodyContextProps`),gW=e=>{fe(hW,e)},_W=()=>g(hW,{}),vW=u({name:`BodyRow`,inheritAttrs:!1,props:[`record`,`index`,`renderIndex`,`recordKey`,`expandedKeys`,`rowComponent`,`cellComponent`,`customRow`,`rowExpandable`,`indent`,`rowKey`,`getRowKey`,`childrenColumnName`],setup(e,t){let{attrs:n}=t,r=NU(),i=_W(),a=q(!1),o=J(()=>e.expandedKeys&&e.expandedKeys.has(e.recordKey));S(()=>{o.value&&(a.value=!0)});let s=J(()=>i.expandableType===`row`&&(!e.rowExpandable||e.rowExpandable(e.record))),c=J(()=>i.expandableType===`nest`),l=J(()=>e.childrenColumnName&&e.record&&e.record[e.childrenColumnName]),u=J(()=>s.value||c.value),d=(e,t)=>{i.onTriggerExpand(e,t)},f=J(()=>e.customRow?.call(e,e.record,e.index)||{}),p=function(t){var n,r;i.expandRowByClick&&u.value&&d(e.record,t);var a=[...arguments].slice(1);(r=(n=f.value)?.onClick)==null||r.call(n,t,...a)},m=J(()=>{let{record:t,index:n,indent:r}=e,{rowClassName:a}=i;return typeof a==`string`?a:typeof a==`function`?a(t,n,r):``}),h=J(()=>LU(i.flattenColumns));return()=>{let{class:t,style:u}=n,{record:g,index:_,rowKey:v,indent:y=0,rowComponent:b,cellComponent:x}=e,{prefixCls:S,fixedInfoList:C,transformCellText:w}=r,{flattenColumns:T,expandedRowClassName:E,indentSize:D,expandIcon:O,expandedRowRender:k,expandIconColumnIndex:A}=i,j=U(b,Y(Y({},f.value),{},{"data-row-key":v,class:K(t,`${S}-row`,`${S}-row-level-${y}`,m.value,f.value.class),style:[u,f.value.style],onClick:p}),{default:()=>[T.map((t,n)=>{let{customRender:r,dataIndex:i,className:a}=t,s=h[n],u=C[n],f;t.customCell&&(f=t.customCell(g,_,t));let p=n===(A||0)&&c.value?U($e,null,[U(`span`,{style:{paddingLeft:`${D*y}px`},class:`${S}-row-indent indent-level-${y}`},null),O({prefixCls:S,expanded:o.value,expandable:l.value,record:g,onExpand:d})]):null;return U(nW,Y(Y({cellType:`body`,class:a,ellipsis:t.ellipsis,align:t.align,component:x,prefixCls:S,key:s,record:g,index:_,renderIndex:e.renderIndex,dataIndex:i,customRender:r},u),{},{additionalProps:f,column:t,transformCellText:w,appendNode:p}),null)})]}),M;if(s.value&&(a.value||o.value)){let e=k({record:g,index:_,indent:y+1,expanded:o.value}),t=E&&E(g,_,y);M=U(pW,{expanded:o.value,class:K(`${S}-expanded-row`,`${S}-expanded-row-level-${y+1}`,t),prefixCls:S,component:b,cellComponent:x,colSpan:T.length,isEmpty:!1},{default:()=>[e]})}return U($e,null,[j,M])}}});function yW(e,t,n,r,i,a){let o=[];o.push({record:e,indent:t,index:a});let s=i(e),c=r?.has(s);if(e&&Array.isArray(e[n])&&c)for(let a=0;a{let i=t.value,a=n.value,o=e.value;if(a?.size){let e=[];for(let t=0;t({record:e,indent:0,index:t}))})}var xW=Symbol(`ResizeContextProps`),SW=e=>{fe(xW,e)},CW=()=>g(xW,{onColumnResize:()=>{}}),wW=u({name:`TableBody`,props:[`data`,`getRowKey`,`measureColumnWidth`,`expandedKeys`,`customRow`,`rowExpandable`,`childrenColumnName`],setup(e,t){let{slots:n}=t,r=CW(),i=NU(),a=_W(),o=bW(St(e,`data`),St(e,`childrenColumnName`),St(e,`expandedKeys`),St(e,`getRowKey`)),s=q(-1),c=q(-1),l;return JU({startRow:s,endRow:c,onHover:(e,t)=>{clearTimeout(l),l=setTimeout(()=>{s.value=e,c.value=t},100)}}),()=>{let{data:t,getRowKey:s,measureColumnWidth:c,expandedKeys:l,customRow:u,rowExpandable:d,childrenColumnName:f}=e,{onColumnResize:p}=r,{prefixCls:m,getComponent:h}=i,{flattenColumns:g}=a,_=h([`body`,`wrapper`],`tbody`),v=h([`body`,`row`],`tr`),y=h([`body`,`cell`],`td`),b;b=t.length?o.value.map((e,t)=>{let{record:n,indent:r,index:i}=e,a=s(n,t);return U(vW,{key:a,rowKey:a,record:n,recordKey:a,index:t,renderIndex:i,rowComponent:v,cellComponent:y,expandedKeys:l,customRow:u,getRowKey:s,rowExpandable:d,childrenColumnName:f,indent:r},null)}):U(pW,{expanded:!0,class:`${m}-placeholder`,prefixCls:m,component:v,cellComponent:y,colSpan:g.length,isEmpty:!0},{default:()=>[n.emptyNode?.call(n)]});let x=LU(g);return U(_,{class:`${m}-tbody`},{default:()=>[c&&U(`tr`,{"aria-hidden":`true`,class:`${m}-measure-row`,style:{height:0,fontSize:0}},[x.map(e=>U(mW,{key:e,columnKey:e,onColumnResize:p},null))]),b]})}}}),TW={},EW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{fixed:n}=t,r=n===!0?`left`:n,i=t.children;return i&&i.length>0?[...e,...DW(i).map(e=>Z({fixed:r},e))]:[...e,Z(Z({},t),{fixed:r})]},[])}function OW(e){return e.map(e=>{let{fixed:t}=e,n=EW(e,[`fixed`]),r=t;return t===`left`?r=`right`:t===`right`&&(r=`left`),Z({fixed:r},n)})}function kW(e,t){let{prefixCls:n,columns:r,expandable:i,expandedKeys:a,getRowKey:o,onTriggerExpand:s,expandIcon:c,rowExpandable:l,expandIconColumnIndex:u,direction:d,expandRowByClick:f,expandColumnWidth:p,expandFixed:m}=e,h=HU(),g=J(()=>{if(i.value){let e=r.value.slice();if(!e.includes(TW)){let t=u.value||0;t>=0&&e.splice(t,0,TW)}let t=e.indexOf(TW);e=e.filter((e,n)=>e!==TW||n===t);let i=r.value[t],d;d=(m.value===`left`||m.value)&&!u.value?`left`:(m.value===`right`||m.value)&&u.value===r.value.length?`right`:i?i.fixed:null;let g=a.value,_=l.value,v=c.value,y=n.value,b=f.value,x={[KU]:{class:`${n.value}-expand-icon-col`,columnType:`EXPAND_COLUMN`},title:uo(h.value,`expandColumnTitle`,{},()=>[``]),fixed:d,class:`${n.value}-row-expand-icon-cell`,width:p.value,customRender:e=>{let{record:t,index:n}=e,r=o.value(t,n),i=g.has(r),a=!_||_(t),c=v({prefixCls:y,expanded:i,expandable:a,record:t,onExpand:s});return b?U(`span`,{onClick:e=>e.stopPropagation()},[c]):c}};return e.map(e=>e===TW?x:e)}return r.value.filter(e=>e!==TW)}),_=J(()=>{let e=g.value;return t.value&&(e=t.value(e)),e.length||(e=[{customRender:()=>null}]),e});return[_,J(()=>d.value===`rtl`?OW(DW(_.value)):DW(_.value))]}function AW(e){let t=q(e),n,r=q([]);function i(e){r.value.push(e),ir.cancel(n),n=ir(()=>{let e=r.value;r.value=[],e.forEach(e=>{t.value=e(t.value)})})}return ut(()=>{ir.cancel(n)}),[t,i]}function jW(e){let t=H(e||null),n=H();function r(){clearTimeout(n.value)}function i(e){t.value=e,r(),n.value=setTimeout(()=>{t.value=null,n.value=void 0},100)}function a(){return t.value}return ut(()=>{r()}),[i,a]}function MW(e,t,n){return J(()=>{let r=[],i=[],a=0,o=0,s=e.value,c=t.value,l=n.value;for(let e=0;e=0;--e){let r=t[e],a=n&&n[e],s=a&&a.RC_TABLE_INTERNAL_COL_DEFINE;if(r||s||o){let t=s||{},{columnType:n}=t,a=NW(t,[`columnType`]);i.unshift(U(`col`,Y({key:e,style:{width:typeof r==`number`?`${r}px`:r}},a),null)),o=!0}}return U(`colgroup`,null,[i])}function FW(e,t){let{slots:n}=t;return U(`div`,null,[n.default?.call(n)])}FW.displayName=`Panel`;var IW=0,LW=u({name:`TableSummary`,props:[`fixed`],setup(e,t){let{slots:n}=t,r=NU(),i=`table-summary-uni-key-${++IW}`,a=J(()=>e.fixed===``||e.fixed);return S(()=>{r.summaryCollect(i,a.value)}),ut(()=>{r.summaryCollect(i,!1)}),()=>n.default?.call(n)}}),RW=u({compatConfig:{MODE:3},name:`ATableSummaryRow`,setup(e,t){let{slots:n}=t;return()=>U(`tr`,null,[n.default?.call(n)])}}),zW=Symbol(`SummaryContextProps`),BW=e=>{fe(zW,e)},VW=()=>g(zW,{}),HW=u({name:`ATableSummaryCell`,props:[`index`,`colSpan`,`rowSpan`,`align`],setup(e,t){let{attrs:n,slots:r}=t,i=NU(),a=VW();return()=>{let{index:t,colSpan:o=1,rowSpan:s,align:c}=e,{prefixCls:l,direction:u}=i,{scrollColumnIndex:d,stickyOffsets:f,flattenColumns:p}=a,m=t+o-1+1===d?o+1:o,h=rW(t,t+m-1,p,f,u);return U(nW,Y({class:n.class,index:t,component:`td`,prefixCls:l,record:null,dataIndex:null,align:c,colSpan:m,rowSpan:s,customRender:()=>r.default?.call(r)},h),null)}}}),UW=u({name:`TableFooter`,inheritAttrs:!1,props:[`stickyOffsets`,`flattenColumns`],setup(e,t){let{slots:n}=t,r=NU();return BW(Ne({stickyOffsets:St(e,`stickyOffsets`),flattenColumns:St(e,`flattenColumns`),scrollColumnIndex:J(()=>{let t=e.flattenColumns.length-1;return e.flattenColumns[t]?.scrollbar?t:null})})),()=>{let{prefixCls:e}=r;return U(`tfoot`,{class:`${e}-summary`},[n.default?.call(n)])}}}),WW=LW;function GW(e){let{prefixCls:t,record:n,onExpand:r,expanded:i,expandable:a}=e,o=`${t}-row-expand-icon`;if(!a)return U(`span`,{class:[o,`${t}-row-spaced`]},null);let s=e=>{r(n,e),e.stopPropagation()};return U(`span`,{class:{[o]:!0,[`${t}-row-expanded`]:i,[`${t}-row-collapsed`]:!i},onClick:s},null)}function KW(e,t,n){let r=[];function i(e){(e||[]).forEach((e,a)=>{r.push(t(e,a)),i(e[n])})}return i(e),r}var qW=u({name:`StickyScrollBar`,inheritAttrs:!1,props:[`offsetScroll`,`container`,`scrollBodyRef`,`scrollBodySizeInfo`],emits:[`scroll`],setup(e,t){let{emit:n,expose:r}=t,i=NU(),a=q(0),o=q(0),s=q(0);S(()=>{a.value=e.scrollBodySizeInfo.scrollWidth||0,o.value=e.scrollBodySizeInfo.clientWidth||0,s.value=a.value&&o.value*(o.value/a.value)},{flush:`post`});let c=q(),[l,u]=AW({scrollLeft:0,isHiddenScrollBar:!0}),d=H({delta:0,x:0}),f=q(!1),p=()=>{f.value=!1},m=e=>{d.value={delta:e.pageX-l.value.scrollLeft,x:0},f.value=!0,e.preventDefault()},h=e=>{let{buttons:t}=e||(window==null?void 0:window.event);if(!f.value||t===0){f.value&&=!1;return}let r=d.value.x+e.pageX-d.value.x-d.value.delta;r<=0&&(r=0),r+s.value>=o.value&&(r=o.value-s.value),n(`scroll`,{scrollLeft:r/o.value*(a.value+2)}),d.value.x=e.pageX},g=()=>{if(!e.scrollBodyRef.value)return;let t=Au(e.scrollBodyRef.value).top,n=t+e.scrollBodyRef.value.offsetHeight,r=e.container===window?document.documentElement.scrollTop+window.innerHeight:Au(e.container).top+e.container.clientHeight;n-uu()<=r||t>=r-e.offsetScroll?u(e=>Z(Z({},e),{isHiddenScrollBar:!0})):u(e=>Z(Z({},e),{isHiddenScrollBar:!1}))};r({setScrollLeft:e=>{u(t=>Z(Z({},t),{scrollLeft:e/a.value*o.value||0}))}});let _=null,v=null,y=null,b=null;V(()=>{_=cr(document.body,`mouseup`,p,!1),v=cr(document.body,`mousemove`,h,!1),y=cr(window,`resize`,g,!1)}),ft(()=>{z(()=>{g()})}),V(()=>{setTimeout(()=>{G([s,f],()=>{g()},{immediate:!0,flush:`post`})})}),G(()=>e.container,()=>{b?.remove(),b=cr(e.container,`scroll`,g,!1)},{immediate:!0,flush:`post`}),ut(()=>{_?.remove(),v?.remove(),b?.remove(),y?.remove()}),G(()=>Z({},l.value),(t,n)=>{t.isHiddenScrollBar!==n?.isHiddenScrollBar&&!t.isHiddenScrollBar&&u(t=>{let n=e.scrollBodyRef.value;return n?Z(Z({},t),{scrollLeft:n.scrollLeft/n.scrollWidth*n.clientWidth}):t})},{immediate:!0});let x=uu();return()=>{if(a.value<=o.value||!s.value||l.value.isHiddenScrollBar)return null;let{prefixCls:t}=i;return U(`div`,{style:{height:`${x}px`,width:`${o.value}px`,bottom:`${e.offsetScroll}px`},class:`${t}-sticky-scroll`},[U(`div`,{onMousedown:m,ref:c,class:K(`${t}-sticky-scroll-bar`,{[`${t}-sticky-scroll-bar-active`]:f.value}),style:{width:`${s.value}px`,transform:`translate3d(${l.value.scrollLeft}px, 0, 0)`}},null)])}}}),JW=It()?window:null;function YW(e,t){return J(()=>{let{offsetHeader:n=0,offsetSummary:r=0,offsetScroll:i=0,getContainer:a=()=>JW}=typeof e.value==`object`?e.value:{},o=a()||JW,s=!!e.value;return{isSticky:s,stickyClassName:s?`${t.value}-sticky-holder`:``,offsetHeader:n,offsetSummary:r,offsetScroll:i,container:o}})}function XW(e,t){return J(()=>{let n=[],r=e.value,i=t.value;for(let e=0;ea.isSticky&&!e.fixHeader?0:a.scrollbarSize),s=H(),c=e=>{let{currentTarget:t,deltaX:n}=e;n&&(i(`scroll`,{currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())},l=H();V(()=>{z(()=>{l.value=cr(s.value,`wheel`,c)})}),ut(()=>{var e;(e=l.value)==null||e.remove()});let u=J(()=>e.flattenColumns.every(e=>e.width&&e.width!==0&&e.width!==`0px`)),d=H([]),f=H([]);S(()=>{let t=e.flattenColumns[e.flattenColumns.length-1],n={fixed:t?t.fixed:null,scrollbar:!0,customHeaderCell:()=>({class:`${a.prefixCls}-cell-scrollbar`})};d.value=o.value?[...e.columns,n]:e.columns,f.value=o.value?[...e.flattenColumns,n]:e.flattenColumns});let p=J(()=>{let{stickyOffsets:t,direction:n}=e,{right:r,left:i}=t;return Z(Z({},t),{left:n===`rtl`?[...i.map(e=>e+o.value),0]:i,right:n===`rtl`?r:[...r.map(e=>e+o.value),0],isSticky:a.isSticky})}),m=XW(St(e,`colWidths`),St(e,`columCount`));return()=>{let{noData:t,columCount:i,stickyTopOffset:c,stickyBottomOffset:l,stickyClassName:h,maxContentScroll:g}=e,{isSticky:_}=a;return U(`div`,{style:Z({overflow:`hidden`},_?{top:`${c}px`,bottom:`${l}px`}:{}),ref:s,class:K(n.class,{[h]:!!h})},[U(`table`,{style:{tableLayout:`fixed`,visibility:t||m.value?null:`hidden`}},[(!t||!g||u.value)&&U(PW,{colWidths:m.value?[...m.value,o.value]:[],columCount:i+1,columns:f.value},null),r.default?.call(r,Z(Z({},e),{stickyOffsets:p.value,columns:d.value,flattenColumns:f.value}))])])}}});function QW(e){return Ne(Pg([...arguments].slice(1).map(t=>[t,St(e,t)])))}var $W=[],eG={},tG=`rc-table-internal-hook`,nG=u({name:`VcTable`,inheritAttrs:!1,props:`prefixCls.data.columns.rowKey.tableLayout.scroll.rowClassName.title.footer.id.showHeader.components.customRow.customHeaderRow.direction.expandFixed.expandColumnWidth.expandedRowKeys.defaultExpandedRowKeys.expandedRowRender.expandRowByClick.expandIcon.onExpand.onExpandedRowsChange.onUpdate:expandedRowKeys.defaultExpandAllRows.indentSize.expandIconColumnIndex.expandedRowClassName.childrenColumnName.rowExpandable.sticky.transformColumns.internalHooks.internalRefs.canExpandable.onUpdateInternalRefs.transformCellText`.split(`.`),emits:[`expand`,`expandedRowsChange`,`updateInternalRefs`,`update:expandedRowKeys`],setup(e,t){let{attrs:n,slots:r,emit:i}=t,a=J(()=>e.data||$W),o=J(()=>!!a.value.length),s=J(()=>RU(e.components,{})),c=(e,t)=>IU(s.value,e)||t,l=J(()=>{let t=e.rowKey;return typeof t==`function`?t:e=>e&&e[t]}),u=J(()=>e.expandIcon||GW),d=J(()=>e.childrenColumnName||`children`),f=J(()=>e.expandedRowRender?`row`:e.canExpandable||a.value.some(e=>e&&typeof e==`object`&&e[d.value])?`nest`:!1),p=q([]);S(()=>{e.defaultExpandedRowKeys&&(p.value=e.defaultExpandedRowKeys),e.defaultExpandAllRows&&(p.value=KW(a.value,l.value,d.value))})();let m=J(()=>new Set(e.expandedRowKeys||p.value||[])),h=e=>{let t=l.value(e,a.value.indexOf(e)),n,r=m.value.has(t);r?(m.value.delete(t),n=[...m.value]):n=[...m.value,t],p.value=n,i(`expand`,!r,e),i(`update:expandedRowKeys`,n),i(`expandedRowsChange`,n)},g=H(0),[_,v]=kW(Z(Z({},Ft(e)),{expandable:J(()=>!!e.expandedRowRender),expandedKeys:m,getRowKey:l,onTriggerExpand:h,expandIcon:u}),J(()=>e.internalHooks===`rc-table-internal-hook`?e.transformColumns:null)),y=J(()=>({columns:_.value,flattenColumns:v.value})),b=H(),x=H(),C=H(),w=H({scrollWidth:0,clientWidth:0}),T=H(),[E,D]=ff(!1),[k,A]=ff(!1),[j,M]=AW(new Map),N=J(()=>LU(v.value)),P=J(()=>N.value.map(e=>j.value.get(e))),F=J(()=>v.value.length),I=MW(P,F,St(e,`direction`)),L=J(()=>e.scroll&&zU(e.scroll.y)),ee=J(()=>e.scroll&&zU(e.scroll.x)||!!e.expandFixed),te=J(()=>ee.value&&v.value.some(e=>{let{fixed:t}=e;return t})),ne=H(),R=YW(St(e,`sticky`),St(e,`prefixCls`)),re=Ne({}),ie=J(()=>{let e=Object.values(re)[0];return(L.value||R.value.isSticky)&&e}),ae=(e,t)=>{t?re[e]=t:delete re[e]},oe=H({}),se=H({}),B=H({});S(()=>{L.value&&(se.value={overflowY:`scroll`,maxHeight:xt(e.scroll.y)}),ee.value&&(oe.value={overflowX:`auto`},L.value||(se.value={overflowY:`hidden`}),B.value={width:e.scroll.x===!0?`auto`:xt(e.scroll.x),minWidth:`100%`})});let ce=(e,t)=>{fo(b.value)&&M(n=>{if(n.get(e)!==t){let r=new Map(n);return r.set(e,t),r}return n})},[le,ue]=jW(null);function de(e,t){if(!t)return;if(typeof t==`function`){t(e);return}let n=t.$el||t;n.scrollLeft!==e&&(n.scrollLeft=e)}let fe=t=>{let{currentTarget:n,scrollLeft:r}=t,i=e.direction===`rtl`,a=typeof r==`number`?r:n.scrollLeft,o=n||eG;if((!ue()||ue()===o)&&(le(o),de(a,x.value),de(a,C.value),de(a,T.value),de(a,ne.value?.setScrollLeft)),n){let{scrollWidth:e,clientWidth:t}=n;i?(D(-a0)):(D(a>0),A(a{ee.value&&C.value?fe({currentTarget:C.value}):(D(!1),A(!1))},me,he=e=>{e!==g.value&&(pe(),g.value=b.value?b.value.offsetWidth:e)},ge=e=>{let{width:t}=e;if(clearTimeout(me),g.value===0){he(t);return}me=setTimeout(()=>{he(t)},100)};G([ee,()=>e.data,()=>e.columns],()=>{ee.value&&pe()},{flush:`post`});let[_e,W]=ff(0);ZU(),V(()=>{z(()=>{pe(),W(fu(C.value).width),w.value={scrollWidth:C.value?.scrollWidth||0,clientWidth:C.value?.clientWidth||0}})}),O(()=>{z(()=>{let e=C.value?.scrollWidth||0,t=C.value?.clientWidth||0;(w.value.scrollWidth!==e||w.value.clientWidth!==t)&&(w.value={scrollWidth:e,clientWidth:t})})}),S(()=>{e.internalHooks===`rc-table-internal-hook`&&e.internalRefs&&e.onUpdateInternalRefs({body:C.value?C.value.$el||C.value:null})},{flush:`post`});let ve=J(()=>e.tableLayout?e.tableLayout:te.value?e.scroll.x===`max-content`?`auto`:`fixed`:L.value||R.value.isSticky||v.value.some(e=>{let{ellipsis:t}=e;return t})?`fixed`:`auto`),ye=()=>o.value?null:r.emptyText?.call(r)||`No Data`;MU(Ne(Z(Z({},Ft(QW(e,`prefixCls`,`direction`,`transformCellText`))),{getComponent:c,scrollbarSize:_e,fixedInfoList:J(()=>v.value.map((t,n)=>rW(n,n,v.value,I.value,e.direction))),isSticky:J(()=>R.value.isSticky),summaryCollect:ae}))),gW(Ne(Z(Z({},Ft(QW(e,`rowClassName`,`expandedRowClassName`,`expandRowByClick`,`expandedRowRender`,`expandIconColumnIndex`,`indentSize`))),{columns:_,flattenColumns:v,tableLayout:ve,expandIcon:u,expandableType:f,onTriggerExpand:h}))),SW({onColumnResize:ce}),dW({componentWidth:g,fixHeader:L,fixColumn:te,horizonScroll:ee});let be=()=>U(wW,{data:a.value,measureColumnWidth:L.value||ee.value||R.value.isSticky,expandedKeys:m.value,rowExpandable:e.rowExpandable,getRowKey:l.value,customRow:e.customRow,childrenColumnName:d.value},{emptyNode:ye}),xe=()=>U(PW,{colWidths:v.value.map(e=>{let{width:t}=e;return t}),columns:v.value},null);return()=>{let{prefixCls:t,scroll:i,tableLayout:o,direction:s,title:l=r.title,footer:u=r.footer,id:d,showHeader:f,customHeaderRow:p}=e,{isSticky:m,offsetHeader:h,offsetSummary:g,offsetScroll:S,stickyClassName:D,container:O}=R.value,A=c([`table`],`table`),j=c([`body`]),M=r.summary?.call(r,{pageData:a.value}),N=()=>null,re={colWidths:P.value,columCount:v.value.length,stickyOffsets:I.value,customHeaderRow:p,fixHeader:L.value,scroll:i};if(L.value||m){let e=()=>null;typeof j==`function`?(e=()=>j(a.value,{scrollbarSize:_e.value,ref:C,onScroll:fe}),re.colWidths=v.value.map((e,t)=>{let{width:n}=e,r=t===_.value.length-1?n-_e.value:n;return typeof r==`number`&&!Number.isNaN(r)?r:0})):e=()=>U(`div`,{style:Z(Z({},oe.value),se.value),onScroll:fe,ref:C,class:K(`${t}-body`)},[U(A,{style:Z(Z({},B.value),{tableLayout:ve.value})},{default:()=>[xe(),be(),!ie.value&&M&&U(UW,{stickyOffsets:I.value,flattenColumns:v.value},{default:()=>[M]})]})]);let n=Z(Z(Z({noData:!a.value.length,maxContentScroll:ee.value&&i.x===`max-content`},re),y.value),{direction:s,stickyClassName:D,onScroll:fe});N=()=>U($e,null,[f!==!1&&U(ZW,Y(Y({},n),{},{stickyTopOffset:h,class:`${t}-header`,ref:x}),{default:e=>U($e,null,[U(lW,e,null),ie.value===`top`&&U(UW,e,{default:()=>[M]})])}),e(),ie.value&&ie.value!==`top`&&U(ZW,Y(Y({},n),{},{stickyBottomOffset:g,class:`${t}-summary`,ref:T}),{default:e=>U(UW,e,{default:()=>[M]})}),m&&C.value&&U(qW,{ref:ne,offsetScroll:S,scrollBodyRef:C,onScroll:fe,container:O,scrollBodySizeInfo:w.value},null)])}else N=()=>U(`div`,{style:Z(Z({},oe.value),se.value),class:K(`${t}-content`),onScroll:fe,ref:C},[U(A,{style:Z(Z({},B.value),{tableLayout:ve.value})},{default:()=>[xe(),f!==!1&&U(lW,Y(Y({},re),y.value),null),be(),M&&U(UW,{stickyOffsets:I.value,flattenColumns:v.value},{default:()=>[M]})]})]);let ae=Bu(n,{aria:!0,data:!0}),z=()=>U(`div`,Y(Y({},ae),{},{class:K(t,{[`${t}-rtl`]:s===`rtl`,[`${t}-ping-left`]:E.value,[`${t}-ping-right`]:k.value,[`${t}-layout-fixed`]:o===`fixed`,[`${t}-fixed-header`]:L.value,[`${t}-fixed-column`]:te.value,[`${t}-scroll-horizontal`]:ee.value,[`${t}-has-fix-left`]:v.value[0]&&v.value[0].fixed,[`${t}-has-fix-right`]:v.value[F.value-1]&&v.value[F.value-1].fixed===`right`,[n.class]:n.class}),style:n.style,id:d,ref:b}),[l&&U(FW,{class:`${t}-title`},{default:()=>[l(a.value)]}),U(`div`,{class:`${t}-container`},[N()]),u&&U(FW,{class:`${t}-footer`},{default:()=>[u(a.value)]})]);return ee.value?U(Qn,{onResize:ge},{default:z}):z()}}});function rG(){let e=Z({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t{let r=n[t];r!==void 0&&(e[t]=r)})}return e}function iG(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&typeof t==`object`?t:{}).forEach(t=>{let r=e[t];typeof r!=`function`&&(n[t]=r)}),n}function aG(e,t,n){let r=J(()=>t.value&&typeof t.value==`object`?t.value:{}),i=J(()=>r.value.total||0),[a,o]=ff(()=>({current:`defaultCurrent`in r.value?r.value.defaultCurrent:1,pageSize:`defaultPageSize`in r.value?r.value.defaultPageSize:10})),s=J(()=>{let t=rG(a.value,r.value,{total:i.value>0?i.value:e.value}),n=Math.ceil((i.value||e.value)/t.pageSize);return t.current>n&&(t.current=n||1),t}),c=(e,n)=>{t.value!==!1&&o({current:e??1,pageSize:n||s.value.pageSize})},l=(e,i)=>{var a,o;t.value&&((o=(a=r.value).onChange)==null||o.call(a,e,i)),c(e,i),n(e,i||s.value.pageSize)};return[J(()=>t.value===!1?{}:Z(Z({},s.value),{onChange:l})),c]}function oG(e,t,n){let r=q({});G([e,t,n],()=>{let i=new Map,a=n.value,o=t.value;function s(e){e.forEach((e,t)=>{let n=a(e,t);i.set(n,e),e&&typeof e==`object`&&o in e&&s(e[o]||[])})}s(e.value),r.value={kvMap:i}},{deep:!0,immediate:!0});function i(e){return r.value.kvMap.get(e)}return[i]}var sG={},cG=`SELECT_ALL`,lG=`SELECT_INVERT`,uG=`SELECT_NONE`,dG=[];function fG(e,t){let n=[];return(t||[]).forEach(t=>{n.push(t),t&&typeof t==`object`&&e in t&&(n=[...n,...fG(e,t[e])])}),n}function pG(e,t){let n=J(()=>{let t=e.value||{},{checkStrictly:n=!0}=t;return Z(Z({},t),{checkStrictly:n})}),[r,i]=df(n.value.selectedRowKeys||n.value.defaultSelectedRowKeys||dG,{value:J(()=>n.value.selectedRowKeys)}),a=q(new Map),o=e=>{if(n.value.preserveSelectedRowKeys){let n=new Map;e.forEach(e=>{let r=t.getRecordByKey(e);!r&&a.value.has(e)&&(r=a.value.get(e)),n.set(e,r)}),a.value=n}};S(()=>{o(r.value)});let s=J(()=>n.value.checkStrictly?null:Hk(t.data.value,{externalGetKey:t.getRowKey.value,childrenPropName:t.childrenColumnName.value}).keyEntities),c=J(()=>fG(t.childrenColumnName.value,t.pageData.value)),l=J(()=>{let e=new Map,r=t.getRowKey.value,i=n.value.getCheckboxProps;return c.value.forEach((t,n)=>{let a=r(t,n),o=(i?i(t):null)||{};e.set(a,o)}),e}),{maxLevel:u,levelEntities:d}=hA(s),f=e=>!!l.value.get(t.getRowKey.value(e))?.disabled,p=J(()=>{if(n.value.checkStrictly)return[r.value||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=iA(r.value,!0,s.value,u.value,d.value,f);return[e||[],t]}),m=J(()=>p.value[0]),h=J(()=>p.value[1]),g=J(()=>{let e=n.value.type===`radio`?m.value.slice(0,1):m.value;return new Set(e)}),_=J(()=>n.value.type===`radio`?new Set:new Set(h.value)),[v,y]=ff(null),b=e=>{let r,s;o(e);let{preserveSelectedRowKeys:c,onChange:l}=n.value,{getRecordByKey:u}=t;c?(r=e,s=e.map(e=>a.value.get(e))):(r=[],s=[],e.forEach(e=>{let t=u(e);t!==void 0&&(r.push(e),s.push(t))})),i(r),l?.(r,s)},x=(e,r,i,a)=>{let{onSelect:o}=n.value,{getRecordByKey:s}=t||{};if(o){let t=i.map(e=>s(e));o(s(e),r,t,a)}b(i)},C=J(()=>{let{onSelectInvert:e,onSelectNone:r,selections:i,hideSelectAll:a}=n.value,{data:o,pageData:s,getRowKey:c,locale:u}=t;return!i||a?null:(i===!0?[cG,lG,uG]:i).map(t=>t===`SELECT_ALL`?{key:`all`,text:u.value.selectionAll,onSelect(){b(o.value.map((e,t)=>c.value(e,t)).filter(e=>!l.value.get(e)?.disabled||g.value.has(e)))}}:t===`SELECT_INVERT`?{key:`invert`,text:u.value.selectInvert,onSelect(){let t=new Set(g.value);s.value.forEach((e,n)=>{let r=c.value(e,n);l.value.get(r)?.disabled||(t.has(r)?t.delete(r):t.add(r))});let n=Array.from(t);e&&(pi(!1,`Table`,"`onSelectInvert` will be removed in future. Please use `onChange` instead."),e(n)),b(n)}}:t===`SELECT_NONE`?{key:`none`,text:u.value.selectNone,onSelect(){r?.(),b(Array.from(g.value).filter(e=>l.value.get(e)?.disabled))}}:t)}),w=J(()=>c.value.length);return[r=>{let{onSelectAll:i,onSelectMultiple:a,columnWidth:o,type:p,fixed:h,renderCell:S,hideSelectAll:T,checkStrictly:E}=n.value,{prefixCls:D,getRecordByKey:O,getRowKey:k,expandType:A,getPopupContainer:j}=t;if(!e.value)return r.filter(e=>e!==sG);let M=r.slice(),N=new Set(g.value),P=c.value.map(k.value).filter(e=>!l.value.get(e).disabled),F=P.every(e=>N.has(e)),I=P.some(e=>N.has(e)),L=()=>{let e=[];F?P.forEach(t=>{N.delete(t),e.push(t)}):P.forEach(t=>{N.has(t)||(N.add(t),e.push(t))});let t=Array.from(N);i?.(!F,t.map(e=>O(e)),e.map(e=>O(e))),b(t)},ee;if(p!==`radio`){let e;if(C.value){let t=U(wS,{getPopupContainer:j.value},{default:()=>[C.value.map((e,t)=>{let{key:n,text:r,onSelect:i}=e;return U(wS.Item,{key:n||t,onClick:()=>{i?.(P)}},{default:()=>[r]})})]});e=U(`div`,{class:`${D.value}-selection-extra`},[U(kP,{overlay:t,getPopupContainer:j.value},{default:()=>[U(`span`,null,[U(Cf,null,null)])]})])}let t=c.value.map((e,t)=>{let n=k.value(e,t),r=l.value.get(n)||{};return Z({checked:N.has(n)},r)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===w.value,r=n&&t.every(e=>{let{checked:t}=e;return t}),i=n&&t.some(e=>{let{checked:t}=e;return t});ee=!T&&U(`div`,{class:`${D.value}-selection`},[U(vN,{checked:n?r:!!w.value&&F,indeterminate:n?!r&&i:!F&&I,onChange:L,disabled:w.value===0||n,"aria-label":e?`Custom selection`:`Select all`,skipGroup:!0},null),e])}let te;te=p===`radio`?e=>{let{record:t,index:n}=e,r=k.value(t,n),i=N.has(r);return{node:U(ET,Y(Y({},l.value.get(r)),{},{checked:i,onClick:e=>e.stopPropagation(),onChange:e=>{N.has(r)||x(r,!0,[r],e.nativeEvent)}}),null),checked:i}}:e=>{let{record:t,index:n}=e,r=k.value(t,n),i=N.has(r),o=_.value.has(r),c=l.value.get(r),p;return A.value===`nest`?(p=o,pi(typeof c?.indeterminate!=`boolean`,`Table`,"set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.")):p=c?.indeterminate??o,{node:U(vN,Y(Y({},c),{},{indeterminate:p,checked:i,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,o=-1,c=-1;if(n&&E){let e=new Set([v.value,r]);P.some((t,n)=>{if(e.has(t))if(o===-1)o=n;else return c=n,!0;return!1})}if(c!==-1&&o!==c&&E){let e=P.slice(o,c+1),t=[];i?e.forEach(e=>{N.has(e)&&(t.push(e),N.delete(e))}):e.forEach(e=>{N.has(e)||(t.push(e),N.add(e))});let n=Array.from(N);a?.(!i,n.map(e=>O(e)),t.map(e=>O(e))),b(n)}else{let e=m.value;if(E){let n=i?wk(e,r):Tk(e,r);x(r,!i,n,t)}else{let{checkedKeys:n,halfCheckedKeys:a}=iA([...e,r],!0,s.value,u.value,d.value,f),o=n;if(i){let e=new Set(n);e.delete(r),o=iA(Array.from(e),{checked:!1,halfCheckedKeys:a},s.value,u.value,d.value,f).checkedKeys}x(r,!i,o,t)}}y(r)}}),null),checked:i}};let ne=e=>{let{record:t,index:n}=e,{node:r,checked:i}=te({record:t,index:n});return S?S(i,t,n,r):r};if(!M.includes(sG))if(M.findIndex(e=>e.RC_TABLE_INTERNAL_COL_DEFINE?.columnType===`EXPAND_COLUMN`)===0){let[e,...t]=M;M=[e,sG,...t]}else M=[sG,...M];let R=M.indexOf(sG);M=M.filter((e,t)=>e!==sG||t===R);let re=M[R-1],ie=M[R+1],ae=h;ae===void 0&&(ie?.fixed===void 0?re?.fixed!==void 0&&(ae=re.fixed):ae=ie.fixed),ae&&re&&re.RC_TABLE_INTERNAL_COL_DEFINE?.columnType===`EXPAND_COLUMN`&&re.fixed===void 0&&(re.fixed=ae);let oe={fixed:ae,width:o,className:`${D.value}-selection-column`,title:n.value.columnTitle||ee,customRender:ne,[KU]:{class:`${D.value}-selection-col`}};return M.map(e=>e===sG?oe:e)},g]}var mG={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z`}}]},name:`caret-down`,theme:`outlined`};function hG(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:[]),t=[];return e.forEach(e=>{if(!e)return;let n=e.key,r=e.props?.style||{},i=e.props?.class||``,a=e.props||{};for(let[e,t]of Object.entries(a))a[ue(e)]=t;let o=e.children||{},{default:s}=o,c=Z(Z(Z({},SG(o,[`default`])),a),{style:r,class:i});if(n&&(c.key=n),e.type?.__ANT_TABLE_COLUMN_GROUP)c.children=EG(typeof s==`function`?s():s);else{let t=e.children?.default;c.customRender=c.customRender||t}t.push(c)}),t}var DG=`ascend`,OG=`descend`;function kG(e){return typeof e.sorter==`object`&&typeof e.sorter.multiple==`number`&&e.sorter.multiple}function AG(e){return typeof e==`function`?e:e&&typeof e==`object`&&e.compare?e.compare:!1}function jG(e,t){return t?e[e.indexOf(t)+1]:e[0]}function MG(e,t,n){let r=[];function i(e,t){r.push({column:e,key:CG(e,t),multiplePriority:kG(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let o=wG(a,n);e.children?(`sortOrder`in e&&i(e,o),r=[...r,...MG(e.children,t,o)]):e.sorter&&(`sortOrder`in e?i(e,o):t&&e.defaultSortOrder&&r.push({column:e,key:CG(e,o),multiplePriority:kG(e),sortOrder:e.defaultSortOrder}))}),r}function NG(e,t,n,r,i,a,o,s){return(t||[]).map((t,c)=>{let l=wG(c,s),u=t;if(u.sorter){let s=u.sortDirections||i,c=u.showSorterTooltip===void 0?o:u.showSorterTooltip,d=CG(u,l),f=n.find(e=>{let{key:t}=e;return t===d}),p=f?f.sortOrder:null,m=jG(s,p),h=s.includes(DG)&&U(xG,{class:K(`${e}-column-sorter-up`,{active:p===DG}),role:`presentation`},null),g=s.includes(OG)&&U(_G,{role:`presentation`,class:K(`${e}-column-sorter-down`,{active:p===OG})},null),{cancelSort:_,triggerAsc:v,triggerDesc:y}=a||{},b=_;m===OG?b=y:m===DG&&(b=v);let x=typeof c==`object`?c:{title:b};u=Z(Z({},u),{className:K(u.className,{[`${e}-column-sort`]:p}),title:n=>{let r=U(`div`,{class:`${e}-column-sorters`},[U(`span`,{class:`${e}-column-title`},[TG(t.title,n)]),U(`span`,{class:K(`${e}-column-sorter`,{[`${e}-column-sorter-full`]:!!(h&&g)})},[U(`span`,{class:`${e}-column-sorter-inner`},[h,g])])]);return c?U(Ty,x,{default:()=>[r]}):r},customHeaderCell:n=>{let i=t.customHeaderCell&&t.customHeaderCell(n)||{},a=i.onClick,o=i.onKeydown;return i.onClick=e=>{r({column:t,key:d,sortOrder:m,multiplePriority:kG(t)}),a&&a(e)},i.onKeydown=e=>{e.keyCode===$.ENTER&&(r({column:t,key:d,sortOrder:m,multiplePriority:kG(t)}),o?.(e))},p&&(i[`aria-sort`]=p===`ascend`?`ascending`:`descending`),i.class=K(i.class,`${e}-column-has-sorters`),i.tabindex=0,i}})}return`children`in u&&(u=Z(Z({},u),{children:NG(e,u.children,n,r,i,a,o,l)})),u})}function PG(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function FG(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(PG);return t.length===0&&e.length?Z(Z({},PG(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function IG(e,t,n){let r=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),i=e.slice(),a=r.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return AG(t)&&n});return a.length?i.sort((e,t)=>{for(let n=0;n{let r=e[n];return r?Z(Z({},e),{[n]:IG(r,t,n)}):e}):i}function LG(e){let{prefixCls:t,mergedColumns:n,onSorterChange:r,sortDirections:i,tableLocale:a,showSorterTooltip:o}=e,[s,c]=ff(MG(n.value,!0)),l=J(()=>{let e=!0,t=MG(n.value,!1);if(!t.length)return s.value;let r=[];function i(t){e?r.push(t):r.push(Z(Z({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{a===null?(i(t),t.sortOrder&&(t.multiplePriority===!1?e=!1:a=!0)):(a&&t.multiplePriority!==!1||(e=!1),i(t))}),r}),u=J(()=>{let e=l.value.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}});function d(e){let t;t=e.multiplePriority===!1||!l.value.length||l.value[0].multiplePriority===!1?[e]:[...l.value.filter(t=>{let{key:n}=t;return n!==e.key}),e],c(t),r(FG(t),t)}return[e=>NG(t.value,e,l.value,d,i.value,a.value,o.value),l,u,J(()=>FG(l.value))]}var RG={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z`}}]},name:`filter`,theme:`filled`};function zG(e){for(var t=1;t{let{keyCode:t}=e;t===$.ENTER&&e.stopPropagation()},UG=(e,t)=>{let{slots:n}=t;return U(`div`,{onClick:e=>e.stopPropagation(),onKeydown:HG},[n.default?.call(n)])},WG=u({compatConfig:{MODE:3},name:`FilterSearch`,inheritAttrs:!1,props:{value:_(),onChange:d(),filterSearch:W([Boolean,Function]),tablePrefixCls:_(),locale:Qt()},setup(e){return()=>{let{value:t,onChange:n,filterSearch:r,tablePrefixCls:i,locale:a}=e;return r?U(`div`,{class:`${i}-filter-dropdown-search`},[U(hI,{placeholder:a.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,class:`${i}-filter-dropdown-search-input`},{prefix:()=>U(jf,null,null)})]):null}}}),GG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie.motion?e.motion:aS()),c=(t,n)=>{var r,i,a,c;n===`appear`?(i=(r=s.value)?.onAfterEnter)==null||i.call(r,t):n===`leave`&&((c=(a=s.value)?.onAfterLeave)==null||c.call(a,t)),o.value||e.onMotionEnd(),o.value=!0};return G(()=>e.motionNodes,()=>{e.motionNodes&&e.motionType===`hide`&&i.value&&z(()=>{i.value=!1})},{immediate:!0,flush:`post`}),V(()=>{e.motionNodes&&e.onMotionStart()}),ut(()=>{e.motionNodes&&c()}),()=>{let{motion:t,motionNodes:o,motionType:l,active:u,eventKey:d}=e,f=GG(e,[`motion`,`motionNodes`,`motionType`,`active`,`eventKey`]);return o?U(Re,Y(Y({},s.value),{},{appear:l===`show`,onAfterAppear:e=>c(e,`appear`),onAfterLeave:e=>c(e,`leave`)}),{default:()=>[Mt(U(`div`,{class:`${a.value.prefixCls}-treenode-motion`},[o.map(e=>{let t=GG(e.data,[]),{title:n,key:i,isStart:a,isEnd:o}=e;return delete t.children,U(Ck,Y(Y({},t),{},{title:n,active:u,data:e.data,key:i,eventKey:i,isStart:a,isEnd:o}),r)})]),[[ht,i.value]])]}):U(Ck,Y(Y({class:n.class,style:n.style},f),{},{active:u,eventKey:d}),r)}}});function qG(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function i(e,t){let n=new Map;e.forEach(e=>{n.set(e,!0)});let r=t.filter(e=>!n.has(e));return r.length===1?r[0]:null}return ne.key===n)+1],i=t.findIndex(e=>e.key===n);if(r){let e=t.findIndex(e=>e.key===r.key);return t.slice(i+1,e)}return t.slice(i+1)}var YG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{},QG=`RC_TREE_MOTION_${Math.random()}`,$G={key:QG},eK={key:QG,level:0,index:0,pos:`0`,node:$G,nodes:[$G]},tK={parent:null,children:[],pos:eK.pos,data:$G,title:null,key:QG,isStart:[],isEnd:[]};function nK(e,t,n,r){return t===!1||!n?e:e.slice(0,Math.ceil(n/r)+1)}function rK(e){let{key:t,pos:n}=e;return Lk(t,n)}function iK(e){let t=String(e.key),n=e;for(;n.parent;)n=n.parent,t=`${n.key} > ${t}`;return t}var aK=u({compatConfig:{MODE:3},name:`NodeList`,inheritAttrs:!1,props:_k,setup(e,t){let{expose:n,attrs:r}=t,i=H(),a=H(),{expandedKeys:o,flattenNodes:s}=mk();n({scrollTo:e=>{i.value.scrollTo(e)},getIndentWidth:()=>a.value.offsetWidth});let c=q(s.value),l=q([]),u=H(null);function d(){c.value=s.value,l.value=[],u.value=null,e.onListChangeEnd()}let f=dk();G([()=>o.value.slice(),s],(t,n)=>{let[r,i]=t,[a,o]=n,s=qG(a,r);if(s.key!==null){let{virtual:t,height:n,itemHeight:r}=e;if(s.add){let e=o.findIndex(e=>{let{key:t}=e;return t===s.key}),a=nK(JG(o,i,s.key),t,n,r),d=o.slice();d.splice(e+1,0,tK),c.value=d,l.value=a,u.value=`show`}else{let e=i.findIndex(e=>{let{key:t}=e;return t===s.key}),a=nK(JG(i,o,s.key),t,n,r),d=i.slice();d.splice(e+1,0,tK),c.value=d,l.value=a,u.value=`hide`}}else o!==i&&(c.value=i)}),G(()=>f.value.dragging,e=>{e||d()});let p=J(()=>e.motion===void 0?c.value:s.value),m=()=>{e.onActiveChange(null)};return()=>{let t=Z(Z({},e),r),{prefixCls:n,selectable:o,checkable:s,disabled:c,motion:f,height:h,itemHeight:g,virtual:_,focusable:v,activeItem:y,focused:b,tabindex:x,onKeydown:S,onFocus:C,onBlur:w,onListChangeStart:T,onListChangeEnd:E}=t,D=YG(t,[`prefixCls`,`selectable`,`checkable`,`disabled`,`motion`,`height`,`itemHeight`,`virtual`,`focusable`,`activeItem`,`focused`,`tabindex`,`onKeydown`,`onFocus`,`onBlur`,`onListChangeStart`,`onListChangeEnd`]);return U($e,null,[b&&y&&U(`span`,{style:XG,"aria-live":`assertive`},[iK(y)]),U(`div`,null,[U(`input`,{style:XG,disabled:v===!1||c,tabindex:v===!1?null:x,onKeydown:S,onFocus:C,onBlur:w,value:``,onChange:ZG,"aria-label":`for screen reader`},null)]),U(`div`,{class:`${n}-treenode`,"aria-hidden":!0,style:{position:`absolute`,pointerEvents:`none`,visibility:`hidden`,height:0,overflow:`hidden`}},[U(`div`,{class:`${n}-indent`},[U(`div`,{ref:a,class:`${n}-indent-unit`},null)])]),U(Ud,Y(Y({},Br(D,[`onActiveChange`])),{},{data:p.value,itemKey:rK,height:h,fullHeight:!1,virtual:_,itemHeight:g,prefixCls:`${n}-list`,ref:i,onVisibleChange:(e,t)=>{let n=new Set(e);t.filter(e=>!n.has(e)).some(e=>rK(e)===QG)&&d()}}),{default:e=>{let{pos:t}=e,n=YG(e.data,[]),{title:r,key:i,isStart:a,isEnd:o}=e,s=Lk(i,t);return delete n.key,delete n.children,U(KG,Y(Y({},n),{},{eventKey:s,title:r,active:!!y&&i===y.key,data:e.data,isStart:a,isEnd:o,motion:f,motionNodes:i===QG?l.value:null,motionType:u.value,onMotionStart:T,onMotionEnd:d,onMousemove:m}),null)}})])}}});function oK(e){let{dropPosition:t,dropLevelOffset:n,indent:r}=e,i={pointerEvents:`none`,position:`absolute`,right:0,backgroundColor:`red`,height:`2px`};switch(t){case-1:i.top=0,i.left=`${-n*r}px`;break;case 1:i.bottom=0,i.left=`${-n*r}px`;break;case 0:i.bottom=0,i.left=`${r}`;break}return U(`div`,{style:i},null)}var sK=10,cK=u({compatConfig:{MODE:3},name:`Tree`,inheritAttrs:!1,props:Zn(vk(),{prefixCls:`vc-tree`,showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,expandAction:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:oK,allowDrop:()=>!0}),setup(e,t){let{attrs:n,slots:r,expose:i}=t,a=q(!1),o={},s=q(),c=q([]),l=q([]),u=q([]),d=q([]),f=q([]),p=q([]),m={},h=Ne({draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),g=q([]);G([()=>e.treeData,()=>e.children],()=>{g.value=e.treeData===void 0?zk(Ht(e.children)):e.treeData.slice()},{immediate:!0,deep:!0});let _=q({}),v=q(!1),b=q(null),x=q(!1),C=J(()=>Rk(e.fieldNames)),w=q(),T=null,E=null,D=null,O=J(()=>({expandedKeysSet:k.value,selectedKeysSet:A.value,loadedKeysSet:j.value,loadingKeysSet:M.value,checkedKeysSet:N.value,halfCheckedKeysSet:P.value,dragOverNodeKey:h.dragOverNodeKey,dropPosition:h.dropPosition,keyEntities:_.value})),k=J(()=>new Set(p.value)),A=J(()=>new Set(c.value)),j=J(()=>new Set(d.value)),M=J(()=>new Set(f.value)),N=J(()=>new Set(l.value)),P=J(()=>new Set(u.value));S(()=>{if(g.value){let e=Hk(g.value,{fieldNames:C.value});_.value=Z({[QG]:eK},e.keyEntities)}});let F=!1;G([()=>e.expandedKeys,()=>e.autoExpandParent,_],(t,n)=>{let[r,i]=t,[a,o]=n,s=p.value;if(e.expandedKeys!==void 0||F&&i!==o)s=e.autoExpandParent||!F&&e.defaultExpandParent?Fk(e.expandedKeys,_.value):e.expandedKeys;else if(!F&&e.defaultExpandAll){let e=Z({},_.value);delete e[QG],s=Object.keys(e).map(t=>e[t].key)}else!F&&e.defaultExpandedKeys&&(s=e.autoExpandParent||e.defaultExpandParent?Fk(e.defaultExpandedKeys,_.value):e.defaultExpandedKeys);s&&(p.value=s),F=!0},{immediate:!0});let I=q([]);S(()=>{I.value=Bk(g.value,p.value,C.value)}),S(()=>{e.selectable&&(e.selectedKeys===void 0?!F&&e.defaultSelectedKeys&&(c.value=Nk(e.defaultSelectedKeys,e)):c.value=Nk(e.selectedKeys,e))});let{maxLevel:L,levelEntities:ee}=hA(_);S(()=>{if(e.checkable){let t;if(e.checkedKeys===void 0?!F&&e.defaultCheckedKeys?t=Pk(e.defaultCheckedKeys)||{}:g.value&&(t=Pk(e.checkedKeys)||{checkedKeys:l.value,halfCheckedKeys:u.value}):t=Pk(e.checkedKeys)||{},t){let{checkedKeys:n=[],halfCheckedKeys:r=[]}=t;if(!e.checkStrictly){let e=iA(n,!0,_.value,L.value,ee.value);({checkedKeys:n,halfCheckedKeys:r}=e)}l.value=n,u.value=r}}}),S(()=>{e.loadedKeys&&(d.value=e.loadedKeys)});let te=()=>{Z(h,{dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},ne=e=>{w.value.scrollTo(e)};G(()=>e.activeKey,()=>{e.activeKey!==void 0&&(b.value=e.activeKey)},{immediate:!0}),G(b,e=>{z(()=>{e!==null&&ne({key:e})})},{immediate:!0,flush:`post`});let R=t=>{e.expandedKeys===void 0&&(p.value=t)},re=()=>{h.draggingNodeKey!==null&&Z(h,{draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),T=null,D=null},ie=(t,n)=>{let{onDragend:r}=e;h.dragOverNodeKey=null,re(),r?.({event:t,node:n.eventData}),E=null},ae=e=>{ie(e,null,!0),window.removeEventListener(`dragend`,ae)},oe=(t,n)=>{let{onDragstart:r}=e,{eventKey:i,eventData:a}=n;E=n,T={x:t.clientX,y:t.clientY};let o=wk(p.value,i);h.draggingNodeKey=i,h.dragChildrenKeys=kk(i,_.value),s.value=w.value.getIndentWidth(),R(o),window.addEventListener(`dragend`,ae),r&&r({event:t,node:a})},se=(t,n)=>{let{onDragenter:r,onExpand:i,allowDrop:a,direction:c}=e,{pos:l,eventKey:u}=n;if(D!==u&&(D=u),!E){te();return}let{dropPosition:d,dropLevelOffset:f,dropTargetKey:m,dropContainerKey:g,dropTargetPos:v,dropAllowed:y,dragOverNodeKey:b}=Mk(t,E,n,s.value,T,a,I.value,_.value,k.value,c);if(h.dragChildrenKeys.indexOf(m)!==-1||!y){te();return}if(o||={},Object.keys(o).forEach(e=>{clearTimeout(o[e])}),E.eventKey!==n.eventKey&&(o[l]=window.setTimeout(()=>{if(h.draggingNodeKey===null)return;let e=p.value.slice(),r=_.value[n.eventKey];r&&(r.children||[]).length&&(e=Tk(p.value,n.eventKey)),R(e),i&&i(e,{node:n.eventData,expanded:!0,nativeEvent:t})},800)),E.eventKey===m&&f===0){te();return}Z(h,{dragOverNodeKey:b,dropPosition:d,dropLevelOffset:f,dropTargetKey:m,dropContainerKey:g,dropTargetPos:v,dropAllowed:y}),r&&r({event:t,node:n.eventData,expandedKeys:p.value})},B=(t,n)=>{let{onDragover:r,allowDrop:i,direction:a}=e;if(!E)return;let{dropPosition:o,dropLevelOffset:c,dropTargetKey:l,dropContainerKey:u,dropAllowed:d,dropTargetPos:f,dragOverNodeKey:p}=Mk(t,E,n,s.value,T,i,I.value,_.value,k.value,a);h.dragChildrenKeys.indexOf(l)!==-1||!d||(E.eventKey===l&&c===0?h.dropPosition===null&&h.dropLevelOffset===null&&h.dropTargetKey===null&&h.dropContainerKey===null&&h.dropTargetPos===null&&h.dropAllowed===!1&&h.dragOverNodeKey===null||te():o===h.dropPosition&&c===h.dropLevelOffset&&l===h.dropTargetKey&&u===h.dropContainerKey&&f===h.dropTargetPos&&d===h.dropAllowed&&p===h.dragOverNodeKey||Z(h,{dropPosition:o,dropLevelOffset:c,dropTargetKey:l,dropContainerKey:u,dropTargetPos:f,dropAllowed:d,dragOverNodeKey:p}),r&&r({event:t,node:n.eventData}))},V=(t,n)=>{D===n.eventKey&&!t.currentTarget.contains(t.relatedTarget)&&(te(),D=null);let{onDragleave:r}=e;r&&r({event:t,node:n.eventData})},ce=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{dragChildrenKeys:i,dropPosition:a,dropTargetKey:o,dropTargetPos:s,dropAllowed:c}=h;if(!c)return;let{onDrop:l}=e;if(h.dragOverNodeKey=null,re(),o===null)return;let u=Z(Z({},Uk(o,Ht(O.value))),{active:Se.value?.key===o,data:_.value[o].node});i.indexOf(o);let d=Ek(s),f={event:t,node:Wk(u),dragNode:E?E.eventData:null,dragNodesKeys:[E.eventKey].concat(i),dropToGap:a!==0,dropPosition:a+Number(d[d.length-1])};r||l?.(f),E=null},le=(e,t)=>{let{expanded:n,key:r}=t,i=I.value.filter(e=>e.key===r)[0],a=Wk(Z(Z({},Uk(r,O.value)),{data:i.data}));R(n?wk(p.value,r):Tk(p.value,r)),ve(e,a)},H=(t,n)=>{let{onClick:r,expandAction:i}=e;i===`click`&&le(t,n),r&&r(t,n)},ue=(t,n)=>{let{onDblclick:r,expandAction:i}=e;(i===`doubleclick`||i===`dblclick`)&&le(t,n),r&&r(t,n)},de=(t,n)=>{let r=c.value,{onSelect:i,multiple:a}=e,{selected:o}=n,s=n[C.value.key],l=!o;r=l?a?Tk(r,s):[s]:wk(r,s);let u=_.value,d=r.map(e=>{let t=u[e];return t?t.node:null}).filter(e=>e);e.selectedKeys===void 0&&(c.value=r),i&&i(r,{event:`select`,selected:l,node:n,selectedNodes:d,nativeEvent:t})},fe=(t,n,r)=>{let{checkStrictly:i,onCheck:a}=e,o=n[C.value.key],s,c={event:`check`,node:n,checked:r,nativeEvent:t},d=_.value;if(i){let t=r?Tk(l.value,o):wk(l.value,o);s={checked:t,halfChecked:wk(u.value,o)},c.checkedNodes=t.map(e=>d[e]).filter(e=>e).map(e=>e.node),e.checkedKeys===void 0&&(l.value=t)}else{let{checkedKeys:t,halfCheckedKeys:n}=iA([...l.value,o],!0,d,L.value,ee.value);if(!r){let e=new Set(t);e.delete(o),{checkedKeys:t,halfCheckedKeys:n}=iA(Array.from(e),{checked:!1,halfCheckedKeys:n},d,L.value,ee.value)}s=t,c.checkedNodes=[],c.checkedNodesPositions=[],c.halfCheckedKeys=n,t.forEach(e=>{let t=d[e];if(!t)return;let{node:n,pos:r}=t;c.checkedNodes.push(n),c.checkedNodesPositions.push({node:n,pos:r})}),e.checkedKeys===void 0&&(l.value=t,u.value=n)}a&&a(s,c)},pe=t=>{let n=t[C.value.key],r=new Promise((r,i)=>{let{loadData:a,onLoad:o}=e;if(!a||j.value.has(n)||M.value.has(n))return null;a(t).then(()=>{let i=Tk(d.value,n),a=wk(f.value,n);o&&o(i,{event:`load`,node:t}),e.loadedKeys===void 0&&(d.value=i),f.value=a,r()}).catch(t=>{let a=wk(f.value,n);if(f.value=a,m[n]=(m[n]||0)+1,m[n]>=sK){let t=Tk(d.value,n);e.loadedKeys===void 0&&(d.value=t),r()}i(t)}),f.value=Tk(f.value,n)});return r.catch(()=>{}),r},me=(t,n)=>{let{onMouseenter:r}=e;r&&r({event:t,node:n})},he=(t,n)=>{let{onMouseleave:r}=e;r&&r({event:t,node:n})},ge=(t,n)=>{let{onRightClick:r}=e;r&&(t.preventDefault(),r({event:t,node:n}))},_e=t=>{let{onFocus:n}=e;v.value=!0,n&&n(t)},W=t=>{let{onBlur:n}=e;v.value=!1,xe(null),n&&n(t)},ve=(t,n)=>{let r=p.value,{onExpand:i,loadData:a}=e,{expanded:o}=n,s=n[C.value.key];if(x.value)return;r.indexOf(s);let c=!o;if(r=c?Tk(r,s):wk(r,s),R(r),i&&i(r,{node:n,expanded:c,nativeEvent:t}),c&&a){let e=pe(n);e&&e.then(()=>{}).catch(e=>{let t=wk(p.value,s);R(t),Promise.reject(e)})}},ye=()=>{x.value=!0},be=()=>{setTimeout(()=>{x.value=!1})},xe=t=>{let{onActiveChange:n}=e;b.value!==t&&(e.activeKey!==void 0&&(b.value=t),t!==null&&ne({key:t}),n&&n(t))},Se=J(()=>b.value===null?null:I.value.find(e=>{let{key:t}=e;return t===b.value})||null),Ce=e=>{let t=I.value.findIndex(e=>{let{key:t}=e;return t===b.value});t===-1&&e<0&&(t=I.value.length),t=(t+e+I.value.length)%I.value.length;let n=I.value[t];if(n){let{key:e}=n;xe(e)}else xe(null)},we=J(()=>Wk(Z(Z({},Uk(b.value,O.value)),{data:Se.value.data,active:!0}))),Te=t=>{let{onKeydown:n,checkable:r,selectable:i}=e;switch(t.which){case $.UP:Ce(-1),t.preventDefault();break;case $.DOWN:Ce(1),t.preventDefault();break}let a=Se.value;if(a&&a.data){let e=a.data.isLeaf===!1||!!(a.data.children||[]).length,n=we.value;switch(t.which){case $.LEFT:e&&k.value.has(b.value)?ve({},n):a.parent&&xe(a.parent.key),t.preventDefault();break;case $.RIGHT:e&&!k.value.has(b.value)?ve({},n):a.children&&a.children.length&&xe(a.children[0].key),t.preventDefault();break;case $.ENTER:case $.SPACE:r&&!n.disabled&&n.checkable!==!1&&!n.disableCheckbox?fe({},n,!N.value.has(b.value)):!r&&i&&!n.disabled&&n.selectable!==!1&&de({},n);break}}n&&n(t)};return i({onNodeExpand:ve,scrollTo:ne,onKeydown:Te,selectedKeys:J(()=>c.value),checkedKeys:J(()=>l.value),halfCheckedKeys:J(()=>u.value),loadedKeys:J(()=>d.value),loadingKeys:J(()=>f.value),expandedKeys:J(()=>p.value)}),y(()=>{window.removeEventListener(`dragend`,ae),a.value=!0}),pk({expandedKeys:p,selectedKeys:c,loadedKeys:d,loadingKeys:f,checkedKeys:l,halfCheckedKeys:u,expandedKeysSet:k,selectedKeysSet:A,loadedKeysSet:j,loadingKeysSet:M,checkedKeysSet:N,halfCheckedKeysSet:P,flattenNodes:I}),()=>{let{draggingNodeKey:t,dropLevelOffset:i,dropContainerKey:a,dropTargetKey:o,dropPosition:c,dragOverNodeKey:l}=h,{prefixCls:u,showLine:d,focusable:f,tabindex:p=0,selectable:m,showIcon:g,icon:y=r.icon,switcherIcon:x,draggable:S,checkable:C,checkStrictly:T,disabled:E,motion:D,loadData:O,filterTreeNode:k,height:A,itemHeight:j,virtual:M,dropIndicatorRender:N,onContextmenu:P,onScroll:F,direction:I,rootClassName:L,rootStyle:ee}=e,{class:te,style:ne}=n,R=Bu(Z(Z({},e),n),{aria:!0,data:!0}),re;return re=S?typeof S==`object`?S:typeof S==`function`?{nodeDraggable:S}:{}:!1,U(uk,{value:{prefixCls:u,selectable:m,showIcon:g,icon:y,switcherIcon:x,draggable:re,draggingNodeKey:t,checkable:C,customCheckable:r.checkable,checkStrictly:T,disabled:E,keyEntities:_.value,dropLevelOffset:i,dropContainerKey:a,dropTargetKey:o,dropPosition:c,dragOverNodeKey:l,dragging:t!==null,indent:s.value,direction:I,dropIndicatorRender:N,loadData:O,filterTreeNode:k,onNodeClick:H,onNodeDoubleClick:ue,onNodeExpand:ve,onNodeSelect:de,onNodeCheck:fe,onNodeLoad:pe,onNodeMouseEnter:me,onNodeMouseLeave:he,onNodeContextMenu:ge,onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:B,onNodeDragLeave:V,onNodeDragEnd:ie,onNodeDrop:ce,slots:r}},{default:()=>[U(`div`,{role:`tree`,class:K(u,te,L,{[`${u}-show-line`]:d,[`${u}-focused`]:v.value,[`${u}-active-focused`]:b.value!==null}),style:ee},[U(aK,Y({ref:w,prefixCls:u,style:ne,disabled:E,selectable:m,checkable:!!C,motion:D,height:A,itemHeight:j,virtual:M,focusable:f,focused:v.value,tabindex:p,activeItem:Se.value,onFocus:_e,onBlur:W,onKeydown:Te,onActiveChange:xe,onListChangeStart:ye,onListChangeEnd:be,onContextmenu:P,onScroll:F},R),null)])]})}}}),lK=cK,uK={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z`}}]},name:`file`,theme:`outlined`};function dK(e){for(var t=1;t({[`.${e}-switcher-icon`]:{display:`inline-block`,fontSize:10,verticalAlign:`baseline`,svg:{transition:`transform ${t.motionDurationSlow}`}}}),AK=(e,t)=>({[`.${e}-drop-indicator`]:{position:`absolute`,zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:`none`,"&:after":{position:`absolute`,top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:`transparent`,border:`${t.lineWidthBold}px solid ${t.colorPrimary}`,borderRadius:`50%`,content:`""`}}}),jK=(e,t)=>{let{treeCls:n,treeNodeCls:r,treeNodePadding:i,treeTitleHeight:a}=t,o=(a-t.fontSizeLG)/2,s=t.paddingXS;return{[n]:Z(Z({},rn(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:`rotate(90deg)`}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Z({},I(t)),[`${n}-list-holder-inner`]:{alignItems:`flex-start`},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:`stretch`,[`${n}-node-content-wrapper`]:{flex:`auto`},[`${r}.dragging`]:{position:`relative`,"&:after":{position:`absolute`,top:0,insetInlineEnd:0,bottom:i,insetInlineStart:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:OK,animationDuration:t.motionDurationSlow,animationPlayState:`running`,animationFillMode:`forwards`,content:`""`,pointerEvents:`none`}}}},[`${r}`]:{display:`flex`,alignItems:`flex-start`,padding:`0 0 ${i}px 0`,outline:`none`,"&-rtl":{direction:`rtl`},"&-disabled":{[`${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:`not-allowed`,"&:hover":{background:`transparent`}}},[`&-active ${n}-node-content-wrapper`]:Z({},I(t)),[`&:not(${r}-disabled).filter-node ${n}-title`]:{color:`inherit`,fontWeight:500},"&-draggable":{[`${n}-draggable-icon`]:{width:a,lineHeight:`${a}px`,textAlign:`center`,visibility:`visible`,opacity:.2,transition:`opacity ${t.motionDurationSlow}`,[`${r}:hover &`]:{opacity:.45}},[`&${r}-disabled`]:{[`${n}-draggable-icon`]:{visibility:`hidden`}}}},[`${n}-indent`]:{alignSelf:`stretch`,whiteSpace:`nowrap`,userSelect:`none`,"&-unit":{display:`inline-block`,width:a}},[`${n}-draggable-icon`]:{visibility:`hidden`},[`${n}-switcher`]:Z(Z({},kK(e,t)),{position:`relative`,flex:`none`,alignSelf:`stretch`,width:a,margin:0,lineHeight:`${a}px`,textAlign:`center`,cursor:`pointer`,userSelect:`none`,"&-noop":{cursor:`default`},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:`rotate(-90deg)`}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:`relative`,zIndex:1,display:`inline-block`,width:`100%`,height:`100%`,"&:before":{position:`absolute`,top:0,insetInlineEnd:a/2,bottom:-i,marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:`""`},"&:after":{position:`absolute`,width:a/2*.8,height:a/2,borderBottom:`1px solid ${t.colorBorder}`,content:`""`}}}),[`${n}-checkbox`]:{top:`initial`,marginInlineEnd:s,marginBlockStart:o},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:`relative`,zIndex:`auto`,minHeight:a,margin:0,padding:`0 ${t.paddingXS/2}px`,color:`inherit`,lineHeight:`${a}px`,background:`transparent`,borderRadius:t.borderRadius,cursor:`pointer`,transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:t.controlItemBgHover},[`&${n}-node-selected`]:{backgroundColor:t.controlItemBgActive},[`${n}-iconEle`]:{display:`inline-block`,width:a,height:a,lineHeight:`${a}px`,textAlign:`center`,verticalAlign:`top`,"&:empty":{display:`none`}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:`transparent`},[`${n}-node-content-wrapper`]:Z({lineHeight:`${a}px`,userSelect:`none`},AK(e,t)),[`${r}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${t.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:`relative`,height:`100%`,"&:before":{position:`absolute`,top:0,insetInlineEnd:a/2,bottom:-i,borderInlineEnd:`1px solid ${t.colorBorder}`,content:`""`},"&-end":{"&:before":{display:`none`}}}},[`${n}-switcher`]:{background:`transparent`,"&-line-icon":{verticalAlign:`-0.15em`}}},[`${r}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:`auto !important`,bottom:`auto !important`,height:`${a/2}px !important`}}}}})}},MK=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:r}=e;return{[`${t}${t}-directory`]:{[n]:{position:`relative`,"&:before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:`background-color ${e.motionDurationMid}`,content:`""`,pointerEvents:`none`},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},[`${t}-switcher`]:{transition:`color ${e.motionDurationMid}`},[`${t}-node-content-wrapper`]:{borderRadius:0,userSelect:`none`,"&:hover":{background:`transparent`},[`&${t}-node-selected`]:{color:e.colorTextLightSolid,background:`transparent`}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:e.colorPrimary},[`${t}-switcher`]:{color:e.colorTextLightSolid},[`${t}-node-content-wrapper`]:{color:e.colorTextLightSolid,background:`transparent`}}}}}},NK=(e,t)=>{let n=`.${e}`,r=`${n}-treenode`,i=t.paddingXS/2,a=t.controlHeightSM,o=B(t,{treeCls:n,treeNodeCls:r,treeNodePadding:i,treeTitleHeight:a});return[jK(e,o),MK(o)]},PK=v(`Tree`,(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:tN(`${n}-checkbox`,e)},NK(n,e),$_(e)]}),FK=()=>{let e=vk();return Z(Z({},e),{showLine:W([Boolean,Object]),multiple:Q(),autoExpandParent:Q(),checkStrictly:Q(),checkable:Q(),disabled:Q(),defaultExpandAll:Q(),defaultExpandParent:Q(),defaultExpandedKeys:Ue(),expandedKeys:Ue(),checkedKeys:W([Array,Object]),defaultCheckedKeys:Ue(),selectedKeys:Ue(),defaultSelectedKeys:Ue(),selectable:Q(),loadedKeys:Ue(),draggable:Q(),showIcon:Q(),icon:d(),switcherIcon:f.any,prefixCls:String,replaceFields:Qt(),blockNode:Q(),openAnimation:f.any,onDoubleclick:e.onDblclick,"onUpdate:selectedKeys":d(),"onUpdate:checkedKeys":d(),"onUpdate:expandedKeys":d()})},IK=u({compatConfig:{MODE:3},name:`ATree`,inheritAttrs:!1,props:Zn(FK(),{checkable:!1,selectable:!0,showIcon:!1,blockNode:!1}),slots:Object,setup(e,t){let{attrs:n,expose:r,emit:i,slots:a}=t;e.treeData===void 0&&a.default;let{prefixCls:o,direction:s,virtual:c}=X(`tree`,e),[l,u]=PK(o),d=H();r({treeRef:d,onNodeExpand:function(){var e;(e=d.value)==null||e.onNodeExpand(...arguments)},scrollTo:e=>{var t;(t=d.value)==null||t.scrollTo(e)},selectedKeys:J(()=>d.value?.selectedKeys),checkedKeys:J(()=>d.value?.checkedKeys),halfCheckedKeys:J(()=>d.value?.halfCheckedKeys),loadedKeys:J(()=>d.value?.loadedKeys),loadingKeys:J(()=>d.value?.loadingKeys),expandedKeys:J(()=>d.value?.expandedKeys)}),S(()=>{pi(e.replaceFields===void 0,`Tree`,"`replaceFields` is deprecated, please use fieldNames instead")});let f=(e,t)=>{i(`update:checkedKeys`,e),i(`check`,e,t)},p=(e,t)=>{i(`update:expandedKeys`,e),i(`expand`,e,t)},m=(e,t)=>{i(`update:selectedKeys`,e),i(`select`,e,t)};return()=>{let{showIcon:t,showLine:r,switcherIcon:i=a.switcherIcon,icon:h=a.icon,blockNode:g,checkable:_,selectable:v,fieldNames:y=e.replaceFields,motion:b=e.openAnimation,itemHeight:x=28,onDoubleclick:S,onDblclick:C}=e,w=Z(Z(Z({},n),Br(e,[`onUpdate:checkedKeys`,`onUpdate:expandedKeys`,`onUpdate:selectedKeys`,`onDoubleclick`])),{showLine:!!r,dropIndicatorRender:DK,fieldNames:y,icon:h,itemHeight:x}),T=a.default?dt(a.default()):void 0;return l(U(lK,Y(Y({},w),{},{virtual:c.value,motion:b,ref:d,prefixCls:o.value,class:K({[`${o.value}-icon-hide`]:!t,[`${o.value}-block-node`]:g,[`${o.value}-unselectable`]:!v,[`${o.value}-rtl`]:s.value===`rtl`},n.class,u.value),direction:s.value,checkable:_,selectable:v,switcherIcon:e=>EK(o.value,i,e,a.leafIcon,r),onCheck:f,onExpand:p,onSelect:m,onDblclick:C||S,children:T}),Z(Z({},a),{checkable:()=>U(`span`,{class:`${o.value}-checkbox-inner`},null)})))}}}),LK={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z`}}]},name:`folder-open`,theme:`outlined`};function RK(e){for(var t=1;t{if(s===GK.End)return!1;if(c(e)){if(o.push(e),s===GK.None)s=GK.Start;else if(s===GK.Start)return s=GK.End,!1}else s===GK.Start&&o.push(e);return n.includes(e)}),o}function JK(e,t,n){let r=[...t],i=[];return KK(e,n,(e,t)=>{let n=r.indexOf(e);return n!==-1&&(i.push(t),r.splice(n,1)),!!r.length}),i}var YK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iZ(Z({},FK()),{expandAction:W([Boolean,String])});function ZK(e){let{isLeaf:t,expanded:n}=e;return U(t?pK:n?BK:WK,null,null)}var QK=u({compatConfig:{MODE:3},name:`ADirectoryTree`,inheritAttrs:!1,props:Zn(XK(),{showIcon:!0,expandAction:`click`}),slots:Object,setup(e,t){let{attrs:n,slots:r,emit:i,expose:a}=t,o=H(e.treeData||zk(dt(r.default?.call(r))));G(()=>e.treeData,()=>{o.value=e.treeData}),O(()=>{z(()=>{e.treeData===void 0&&r.default&&(o.value=zk(dt(r.default?.call(r))))})});let s=H(),c=H(),l=J(()=>Rk(e.fieldNames)),u=H();a({scrollTo:e=>{var t;(t=u.value)==null||t.scrollTo(e)},selectedKeys:J(()=>u.value?.selectedKeys),checkedKeys:J(()=>u.value?.checkedKeys),halfCheckedKeys:J(()=>u.value?.halfCheckedKeys),loadedKeys:J(()=>u.value?.loadedKeys),loadingKeys:J(()=>u.value?.loadingKeys),expandedKeys:J(()=>u.value?.expandedKeys)});let d=()=>{let{keyEntities:t}=Hk(o.value,{fieldNames:l.value}),n;return n=e.defaultExpandAll?Object.keys(t):e.defaultExpandParent?Fk(e.expandedKeys||e.defaultExpandedKeys||[],t):e.expandedKeys||e.defaultExpandedKeys,n},f=H(e.selectedKeys||e.defaultSelectedKeys||[]),p=H(d());G(()=>e.selectedKeys,()=>{e.selectedKeys!==void 0&&(f.value=e.selectedKeys)},{immediate:!0}),G(()=>e.expandedKeys,()=>{e.expandedKeys!==void 0&&(p.value=e.expandedKeys)},{immediate:!0});let m=Eg((e,t)=>{let{isLeaf:n}=t;n||e.shiftKey||e.metaKey||e.ctrlKey||u.value.onNodeExpand(e,t)},200,{leading:!0}),h=(t,n)=>{e.expandedKeys===void 0&&(p.value=t),i(`update:expandedKeys`,t),i(`expand`,t,n)},g=(t,n)=>{let{expandAction:r}=e;r===`click`&&m(t,n),i(`click`,t,n)},_=(t,n)=>{let{expandAction:r}=e;(r===`dblclick`||r===`doubleclick`)&&m(t,n),i(`doubleclick`,t,n),i(`dblclick`,t,n)},v=(t,n)=>{let{multiple:r}=e,{node:a,nativeEvent:u}=n,d=a[l.value.key],m=Z(Z({},n),{selected:!0}),h=u?.ctrlKey||u?.metaKey,g=u?.shiftKey,_;r&&h?(_=t,s.value=d,c.value=_,m.selectedNodes=JK(o.value,_,l.value)):r&&g?(_=Array.from(new Set([...c.value||[],...qK({treeData:o.value,expandedKeys:p.value,startKey:d,endKey:s.value,fieldNames:l.value})])),m.selectedNodes=JK(o.value,_,l.value)):(_=[d],s.value=d,c.value=_,m.selectedNodes=JK(o.value,_,l.value)),i(`update:selectedKeys`,_),i(`select`,_,m),e.selectedKeys===void 0&&(f.value=_)},y=(e,t)=>{i(`update:checkedKeys`,e),i(`check`,e,t)},{prefixCls:b,direction:x}=X(`tree`,e);return()=>{let t=K(`${b.value}-directory`,{[`${b.value}-directory-rtl`]:x.value===`rtl`},n.class),{icon:i=r.icon,blockNode:a=!0}=e,o=YK(e,[`icon`,`blockNode`]);return U(IK,Y(Y(Y({},n),{},{icon:i||ZK,ref:u,blockNode:a},o),{},{prefixCls:b.value,class:t,expandedKeys:p.value,selectedKeys:f.value,onSelect:v,onClick:g,onDblclick:_,onExpand:h,onCheck:y}),r)}}}),$K=Ck,eq=Z(IK,{DirectoryTree:QK,TreeNode:$K,install:e=>(e.component(IK.name,IK),e.component($K.name,$K),e.component(QK.name,QK),e)});function tq(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new Set;function i(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=r.has(e);if(br(!o,`Warning: There may be circular references`),o)return!1;if(e===t)return!0;if(n&&a>1)return!1;r.add(e);let s=a+1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ni(e[n],t[n],s))}return!1}return i(e,t)}var{SubMenu:nq,Item:rq}=wS;function iq(e){return e.some(e=>{let{children:t}=e;return t&&t.length>0})}function aq(e,t){return typeof t==`string`||typeof t==`number`?t?.toString().toLowerCase().includes(e.trim().toLowerCase()):!1}function oq(e){let{filters:t,prefixCls:n,filteredKeys:r,filterMultiple:i,searchValue:a,filterSearch:o}=e;return t.map((e,t)=>{let s=String(e.value);if(e.children)return U(nq,{key:s||t,title:e.text,popupClassName:`${n}-dropdown-submenu`},{default:()=>[oq({filters:e.children,prefixCls:n,filteredKeys:r,filterMultiple:i,searchValue:a,filterSearch:o})]});let c=i?vN:ET,l=U(rq,{key:e.value===void 0?t:s},{default:()=>[U(c,{checked:r.includes(s)},null),U(`span`,null,[e.text])]});return a.trim()?typeof o==`function`?o(a,e)?l:void 0:aq(a,e.text)?l:void 0:l})}var sq=u({name:`FilterDropdown`,props:[`tablePrefixCls`,`prefixCls`,`dropdownPrefixCls`,`column`,`filterState`,`filterMultiple`,`filterMode`,`filterSearch`,`columnKey`,`triggerFilter`,`locale`,`getPopupContainer`],setup(e,t){let{slots:n}=t,r=HU(),i=J(()=>e.filterMode??`menu`),a=J(()=>e.filterSearch??!1),o=J(()=>e.column.filterDropdownOpen||e.column.filterDropdownVisible),s=J(()=>e.column.onFilterDropdownOpenChange||e.column.onFilterDropdownVisibleChange),c=q(!1),l=J(()=>!!(e.filterState&&(e.filterState.filteredKeys?.length||e.filterState.forceFiltered))),u=J(()=>uq(e.column?.filters)),d=J(()=>{let{filterDropdown:t,slots:n={},customFilterDropdown:i}=e.column;return t||n.filterDropdown&&r.value[n.filterDropdown]||i&&r.value.customFilterDropdown}),f=J(()=>{let{filterIcon:t,slots:n={}}=e.column;return t||n.filterIcon&&r.value[n.filterIcon]||r.value.customFilterIcon}),p=e=>{var t;c.value=e,(t=s.value)==null||t.call(s,e)},m=J(()=>typeof o.value==`boolean`?o.value:c.value),h=J(()=>e.filterState?.filteredKeys),g=q([]),_=e=>{let{selectedKeys:t}=e;g.value=t},v=(t,n)=>{let{node:r,checked:i}=n;e.filterMultiple?_({selectedKeys:t}):_({selectedKeys:i&&r.key?[r.key]:[]})};G(h,()=>{c.value&&_({selectedKeys:h.value||[]})},{immediate:!0});let y=q([]),b=q(),x=e=>{b.value=setTimeout(()=>{y.value=e})},S=()=>{clearTimeout(b.value)};ut(()=>{clearTimeout(b.value)});let C=q(``),w=e=>{let{value:t}=e.target;C.value=t};G(c,()=>{c.value||(C.value=``)});let T=t=>{let{column:n,columnKey:r,filterState:i}=e,a=t&&t.length?t:null;if(a===null&&(!i||!i.filteredKeys)||tq(a,i?.filteredKeys,!0))return null;e.triggerFilter({column:n,key:r,filteredKeys:a})},E=()=>{p(!1),T(g.value)},D=function(){let{confirm:t,closeDropdown:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};t&&T([]),n&&p(!1),C.value=``,e.column.filterResetToDefaultFilteredValue?g.value=(e.column.defaultFilteredValue||[]).map(e=>String(e)):g.value=[]},O=function(){let{closeDropdown:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};e&&p(!1),T(g.value)},k=e=>{e&&h.value!==void 0&&(g.value=h.value||[]),p(e),!e&&!d.value&&E()},{direction:A}=X(``,e),j=e=>{if(e.target.checked){let e=u.value;g.value=e}else g.value=[]},M=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),r={title:e.text,key:e.value===void 0?t:n};return e.children&&(r.children=M({filters:e.children})),r})},N=e=>Z(Z({},e),{text:e.title,value:e.key,children:e.children?.map(e=>N(e))||[]}),P=J(()=>M({filters:e.column.filters})),F=J(()=>K({[`${e.dropdownPrefixCls}-menu-without-submenu`]:!iq(e.column.filters||[])})),I=()=>{let t=g.value,{column:n,locale:r,tablePrefixCls:o,filterMultiple:s,dropdownPrefixCls:c,getPopupContainer:l,prefixCls:d}=e;return(n.filters||[]).length===0?U(te,{image:te.PRESENTED_IMAGE_SIMPLE,description:r.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:`16px 0`}},null):i.value===`tree`?U($e,null,[U(WG,{filterSearch:a.value,value:C.value,onChange:w,tablePrefixCls:o,locale:r},null),U(`div`,{class:`${o}-filter-dropdown-tree`},[s?U(vN,{class:`${o}-filter-dropdown-checkall`,onChange:j,checked:t.length===u.value.length,indeterminate:t.length>0&&t.length[r.filterCheckall]}):null,U(eq,{checkable:!0,selectable:!1,blockNode:!0,multiple:s,checkStrictly:!s,class:`${c}-menu`,onCheck:v,checkedKeys:t,selectedKeys:t,showIcon:!1,treeData:P.value,autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:C.value.trim()?e=>typeof a.value==`function`?a.value(C.value,N(e)):aq(C.value,e.title):void 0},null)])]):U($e,null,[U(WG,{filterSearch:a.value,value:C.value,onChange:w,tablePrefixCls:o,locale:r},null),U(wS,{multiple:s,prefixCls:`${c}-menu`,class:F.value,onClick:S,onSelect:_,onDeselect:_,selectedKeys:t,getPopupContainer:l,openKeys:y.value,onOpenChange:x},{default:()=>oq({filters:n.filters||[],filterSearch:a.value,prefixCls:d,filteredKeys:g.value,filterMultiple:s,searchValue:C.value})})])},L=J(()=>{let t=g.value;return e.column.filterResetToDefaultFilteredValue?tq((e.column.defaultFilteredValue||[]).map(e=>String(e)),t,!0):t.length===0});return()=>{let{tablePrefixCls:t,prefixCls:r,column:i,dropdownPrefixCls:a,locale:o,getPopupContainer:s}=e,c;c=typeof d.value==`function`?d.value({prefixCls:`${a}-custom`,setSelectedKeys:e=>_({selectedKeys:e}),selectedKeys:g.value,confirm:O,clearFilters:D,filters:i.filters,visible:m.value,column:i.__originColumn__,close:()=>{p(!1)}}):d.value?d.value:U($e,null,[I(),U(`div`,{class:`${r}-dropdown-btns`},[U(Qb,{type:`link`,size:`small`,disabled:L.value,onClick:()=>D()},{default:()=>[o.filterReset]}),U(Qb,{type:`primary`,size:`small`,onClick:E},{default:()=>[o.filterConfirm]})])]);let u=U(UG,{class:`${r}-dropdown`},{default:()=>[c]}),h;return h=typeof f.value==`function`?f.value({filtered:l.value,column:i.__originColumn__}):f.value?f.value:U(VG,null,null),U(`div`,{class:`${r}-column`},[U(`span`,{class:`${t}-column-title`},[n.default?.call(n)]),U(kP,{overlay:u,trigger:[`click`],open:m.value,onOpenChange:k,getPopupContainer:s,placement:A.value===`rtl`?`bottomLeft`:`bottomRight`},{default:()=>[U(`span`,{role:`button`,tabindex:-1,class:K(`${r}-trigger`,{active:l.value}),onClick:e=>{e.stopPropagation()}},[h])]})])}}});function cq(e,t,n){let r=[];return(e||[]).forEach((e,i)=>{let a=wG(i,n),o=e.filterDropdown||e?.slots?.filterDropdown||e.customFilterDropdown;if(e.filters||o||`onFilter`in e)if(`filteredValue`in e){let t=e.filteredValue;o||(t=t?.map(String)??t),r.push({column:e,key:CG(e,a),filteredKeys:t,forceFiltered:e.filtered})}else r.push({column:e,key:CG(e,a),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered});`children`in e&&(r=[...r,...cq(e.children,t,a)])}),r}function lq(e,t,n,r,i,a,o,s){return n.map((n,c)=>{let l=wG(c,s),{filterMultiple:u=!0,filterMode:d,filterSearch:f}=n,p=n,m=n.filterDropdown||n?.slots?.filterDropdown||n.customFilterDropdown;if(p.filters||m){let s=CG(p,l),c=r.find(e=>{let{key:t}=e;return s===t});p=Z(Z({},p),{title:r=>U(sq,{tablePrefixCls:e,prefixCls:`${e}-filter`,dropdownPrefixCls:t,column:p,columnKey:s,filterState:c,filterMultiple:u,filterMode:d,filterSearch:f,triggerFilter:a,locale:i,getPopupContainer:o},{default:()=>[TG(n.title,r)]})})}return`children`in p&&(p=Z(Z({},p),{children:lq(e,t,p.children,r,i,a,o,l)})),p})}function uq(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:r}=e;t.push(n),r&&(t=[...t,...uq(r)])}),t}function dq(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:r,column:i}=e,a=i.filterDropdown||i?.slots?.filterDropdown||i.customFilterDropdown,{filters:o}=i;if(a)t[n]=r||null;else if(Array.isArray(r)){let e=uq(o);t[n]=e.filter(e=>r.includes(String(e)))}else t[n]=null}),t}function fq(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:r},filteredKeys:i}=t;return n&&i&&i.length?e.filter(e=>i.some(t=>{let i=uq(r),a=i.findIndex(e=>String(e)===String(t)),o=a===-1?t:i[a];return n(o,e)})):e},e)}function pq(e){return e.flatMap(e=>`children`in e?[e,...pq(e.children||[])]:[e])}function mq(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,locale:i,onFilterChange:a,getPopupContainer:o}=e,s=J(()=>pq(r.value)),[c,l]=ff(cq(s.value,!0)),u=J(()=>{let e=cq(s.value,!1);if(e.length===0)return e;let t=!0,n=!0;if(e.forEach(e=>{let{filteredKeys:r}=e;r===void 0?n=!1:t=!1}),t){let e=(s.value||[]).map((e,t)=>CG(e,wG(t)));return c.value.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=s.value[e.findIndex(e=>e===t.key)];return Z(Z({},t),{column:Z(Z({},t.column),n),forceFiltered:n.filtered})})}return pi(n,`Table`,"Columns should all contain `filteredValue` or not contain `filteredValue`."),e}),d=J(()=>dq(u.value)),f=e=>{let t=u.value.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),l(t),a(dq(t),t)};return[e=>lq(t.value,n.value,e,u.value,i.value,f,o.value),u,d]}function hq(e,t){return e.map(e=>{let n=Z({},e);return n.title=TG(n.title,t),`children`in n&&(n.children=hq(n.children,t)),n})}function gq(e){return[t=>hq(t,e.value)]}function _q(e){return function(t){let{prefixCls:n,onExpand:r,record:i,expanded:a,expandable:o}=t,s=`${n}-row-expand-icon`;return U(`button`,{type:`button`,onClick:e=>{r(i,e),e.stopPropagation()},class:K(s,{[`${s}-spaced`]:!o,[`${s}-expanded`]:o&&a,[`${s}-collapsed`]:o&&!a}),"aria-label":a?e.collapse:e.expand,"aria-expanded":a},null)}}function vq(e,t){let n=t.value;return e.map(e=>{if(e===sG||e===TW)return e;let r=Z({},e),{slots:i={}}=r;return r.__originColumn__=e,pi(!(`slots`in r),`Table`,"`column.slots` is deprecated. Please use `v-slot:headerCell` `v-slot:bodyCell` instead."),Object.keys(i).forEach(e=>{let t=i[e];r[e]===void 0&&n[t]&&(r[e]=n[t])}),t.value.headerCell&&!e.slots?.title&&(r.title=uo(t.value,`headerCell`,{title:e.title,column:e},()=>[e.title])),`children`in r&&Array.isArray(r.children)&&(r.children=vq(r.children,t)),r})}function yq(e){return[t=>vq(t,e)]}var bq=e=>{let{componentCls:t}=e,n=`${e.lineWidth}px ${e.lineType} ${e.tableBorderColor}`,r=(n,r,i)=>({[`&${t}-${n}`]:{[`> ${t}-container`]:{[`> ${t}-content, > ${t}-body`]:{"> table > tbody > tr > td":{[`> ${t}-expanded-row-fixed`]:{margin:`-${r}px -${i+e.lineWidth}px`}}}}}});return{[`${t}-wrapper`]:{[`${t}${t}-bordered`]:Z(Z(Z({[`> ${t}-title`]:{border:n,borderBottom:0},[`> ${t}-container`]:{borderInlineStart:n,[` + > ${t}-content, + > ${t}-header, + > ${t}-body, + > ${t}-summary + `]:{"> table":{"\n > thead > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:n},"> thead":{"> tr:not(:last-child) > th":{borderBottom:n},"> tr > th::before":{backgroundColor:`transparent !important`}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{[`> ${t}-cell-fix-right-first::after`]:{borderInlineEnd:n}},"> tbody > tr > td":{[`> ${t}-expanded-row-fixed`]:{margin:`-${e.tablePaddingVertical}px -${e.tablePaddingHorizontal+e.lineWidth}px`,"&::after":{position:`absolute`,top:0,insetInlineEnd:e.lineWidth,bottom:0,borderInlineEnd:n,content:`""`}}}}},[` + > ${t}-content, + > ${t}-header + `]:{"> table":{borderTop:n}}},[`&${t}-scroll-horizontal`]:{[`> ${t}-container > ${t}-body`]:{"> table > tbody":{[` + > tr${t}-expanded-row, + > tr${t}-placeholder + `]:{"> td":{borderInlineEnd:0}}}}}},r(`middle`,e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),r(`small`,e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{[`> ${t}-footer`]:{border:n,borderTop:0}}),[`${t}-cell`]:{[`${t}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${e.lineWidth}px 0 ${e.lineWidth}px ${e.tableHeaderBg}`}}}}},xq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-cell-ellipsis`]:Z(Z({},xe),{wordBreak:`keep-all`,[` + &${t}-cell-fix-left-last, + &${t}-cell-fix-right-first + `]:{overflow:`visible`,[`${t}-cell-content`]:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`}},[`${t}-column-title`]:{overflow:`hidden`,textOverflow:`ellipsis`,wordBreak:`keep-all`}})}}},Sq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-tbody > tr${t}-placeholder`]:{textAlign:`center`,color:e.colorTextDisabled,"&:hover > td":{background:e.colorBgContainer}}}}},Cq=e=>{let{componentCls:t,antCls:n,controlInteractiveSize:r,motionDurationSlow:i,lineWidth:a,paddingXS:o,lineType:s,tableBorderColor:c,tableExpandIconBg:l,tableExpandColumnWidth:u,borderRadius:d,fontSize:f,fontSizeSM:p,lineHeight:m,tablePaddingVertical:h,tablePaddingHorizontal:g,tableExpandedRowBg:_,paddingXXS:v}=e,y=r/2-a,b=y*2+a*3,x=`${a}px ${s} ${c}`,S=v-a;return{[`${t}-wrapper`]:{[`${t}-expand-icon-col`]:{width:u},[`${t}-row-expand-icon-cell`]:{textAlign:`center`,[`${t}-row-expand-icon`]:{display:`inline-flex`,float:`none`,verticalAlign:`sub`}},[`${t}-row-indent`]:{height:1,float:`left`},[`${t}-row-expand-icon`]:Z(Z({},Lr(e)),{position:`relative`,float:`left`,boxSizing:`border-box`,width:b,height:b,padding:0,color:`inherit`,lineHeight:`${b}px`,background:l,border:x,borderRadius:d,transform:`scale(${r/b})`,transition:`all ${i}`,userSelect:`none`,"&:focus, &:hover, &:active":{borderColor:`currentcolor`},"&::before, &::after":{position:`absolute`,background:`currentcolor`,transition:`transform ${i} ease-out`,content:`""`},"&::before":{top:y,insetInlineEnd:S,insetInlineStart:S,height:a},"&::after":{top:S,bottom:S,insetInlineStart:y,width:a,transform:`rotate(90deg)`},"&-collapsed::before":{transform:`rotate(-180deg)`},"&-collapsed::after":{transform:`rotate(0deg)`},"&-spaced":{"&::before, &::after":{display:`none`,content:`none`},background:`transparent`,border:0,visibility:`hidden`}}),[`${t}-row-indent + ${t}-row-expand-icon`]:{marginTop:(f*m-a*3)/2-Math.ceil((p*1.4-a*3)/2),marginInlineEnd:o},[`tr${t}-expanded-row`]:{"&, &:hover":{"> td":{background:_}},[`${n}-descriptions-view`]:{display:`flex`,table:{flex:`auto`,width:`auto`}}},[`${t}-expanded-row-fixed`]:{position:`relative`,margin:`-${h}px -${g}px`,padding:`${h}px ${g}px`}}}},wq=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:i,tableFilterDropdownSearchWidth:a,paddingXXS:o,paddingXS:s,colorText:c,lineWidth:l,lineType:u,tableBorderColor:d,tableHeaderIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:h,motionDurationSlow:g,colorTextDescription:_,colorPrimary:v,tableHeaderFilterActiveBg:y,colorTextDisabled:b,tableFilterDropdownBg:x,tableFilterDropdownHeight:S,controlItemBgHover:C,controlItemBgActive:w,boxShadowSecondary:T}=e,E=`${n}-dropdown`,D=`${t}-filter-dropdown`,O=`${n}-tree`,k=`${l}px ${u} ${d}`;return[{[`${t}-wrapper`]:{[`${t}-filter-column`]:{display:`flex`,justifyContent:`space-between`},[`${t}-filter-trigger`]:{position:`relative`,display:`flex`,alignItems:`center`,marginBlock:-o,marginInline:`${o}px ${-m/2}px`,padding:`0 ${o}px`,color:f,fontSize:p,borderRadius:h,cursor:`pointer`,transition:`all ${g}`,"&:hover":{color:_,background:y},"&.active":{color:v}}}},{[`${n}-dropdown`]:{[D]:Z(Z({},rn(e)),{minWidth:i,backgroundColor:x,borderRadius:h,boxShadow:T,[`${E}-menu`]:{maxHeight:S,overflowX:`hidden`,border:0,boxShadow:`none`,"&:empty::after":{display:`block`,padding:`${s}px 0`,color:b,fontSize:p,textAlign:`center`,content:`"Not Found"`}},[`${D}-tree`]:{paddingBlock:`${s}px 0`,paddingInline:s,[O]:{padding:0},[`${O}-treenode ${O}-node-content-wrapper:hover`]:{backgroundColor:C},[`${O}-treenode-checkbox-checked ${O}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:w}}},[`${D}-search`]:{padding:s,borderBottom:k,"&-input":{input:{minWidth:a},[r]:{color:b}}},[`${D}-checkall`]:{width:`100%`,marginBottom:o,marginInlineStart:o},[`${D}-btns`]:{display:`flex`,justifyContent:`space-between`,padding:`${s-l}px ${s}px`,overflow:`hidden`,backgroundColor:`inherit`,borderTop:k}})}},{[`${n}-dropdown ${D}, ${D}-submenu`]:{[`${n}-checkbox-wrapper + span`]:{paddingInlineStart:s,color:c},"> ul":{maxHeight:`calc(100vh - 130px)`,overflowX:`hidden`,overflowY:`auto`}}}]},Tq=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:i,zIndexTableFixed:a,tableBg:o,zIndexTableSticky:s}=e,c=r;return{[`${t}-wrapper`]:{[` + ${t}-cell-fix-left, + ${t}-cell-fix-right + `]:{position:`sticky !important`,zIndex:a,background:o},[` + ${t}-cell-fix-left-first::after, + ${t}-cell-fix-left-last::after + `]:{position:`absolute`,top:0,right:{_skip_check_:!0,value:0},bottom:-n,width:30,transform:`translateX(100%)`,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},[`${t}-cell-fix-left-all::after`]:{display:`none`},[` + ${t}-cell-fix-right-first::after, + ${t}-cell-fix-right-last::after + `]:{position:`absolute`,top:0,bottom:-n,left:{_skip_check_:!0,value:0},width:30,transform:`translateX(-100%)`,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},[`${t}-container`]:{"&::before, &::after":{position:`absolute`,top:0,bottom:0,zIndex:s+1,width:30,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},[`${t}-ping-left`]:{[`&:not(${t}-has-fix-left) ${t}-container`]:{position:`relative`,"&::before":{boxShadow:`inset 10px 0 8px -8px ${c}`}},[` + ${t}-cell-fix-left-first::after, + ${t}-cell-fix-left-last::after + `]:{boxShadow:`inset 10px 0 8px -8px ${c}`},[`${t}-cell-fix-left-last::before`]:{backgroundColor:`transparent !important`}},[`${t}-ping-right`]:{[`&:not(${t}-has-fix-right) ${t}-container`]:{position:`relative`,"&::after":{boxShadow:`inset -10px 0 8px -8px ${c}`}},[` + ${t}-cell-fix-right-first::after, + ${t}-cell-fix-right-last::after + `]:{boxShadow:`inset -10px 0 8px -8px ${c}`}}}}},Eq=e=>{let{componentCls:t,antCls:n}=e;return{[`${t}-wrapper`]:{[`${t}-pagination${n}-pagination`]:{margin:`${e.margin}px 0`},[`${t}-pagination`]:{display:`flex`,flexWrap:`wrap`,rowGap:e.paddingXS,"> *":{flex:`none`},"&-left":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-right":{justifyContent:`flex-end`}}}}},Dq=e=>{let{componentCls:t,tableRadius:n}=e;return{[`${t}-wrapper`]:{[t]:{[`${t}-title, ${t}-header`]:{borderRadius:`${n}px ${n}px 0 0`},[`${t}-title + ${t}-container`]:{borderStartStartRadius:0,borderStartEndRadius:0,table:{borderRadius:0,"> thead > tr:first-child":{"th:first-child":{borderRadius:0},"th:last-child":{borderRadius:0}}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:`0 0 ${n}px ${n}px`}}}}},Oq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper-rtl`]:{direction:`rtl`,table:{direction:`rtl`},[`${t}-pagination-left`]:{justifyContent:`flex-end`},[`${t}-pagination-right`]:{justifyContent:`flex-start`},[`${t}-row-expand-icon`]:{"&::after":{transform:`rotate(-90deg)`},"&-collapsed::before":{transform:`rotate(180deg)`},"&-collapsed::after":{transform:`rotate(0deg)`}}}}},kq=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:i,paddingXS:a,tableHeaderIconColor:o,tableHeaderIconColorHover:s}=e;return{[`${t}-wrapper`]:{[`${t}-selection-col`]:{width:e.tableSelectionColumnWidth},[`${t}-bordered ${t}-selection-col`]:{width:e.tableSelectionColumnWidth+a*2},[` + table tr th${t}-selection-column, + table tr td${t}-selection-column + `]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:`center`,[`${n}-radio-wrapper`]:{marginInlineEnd:0}},[`table tr th${t}-selection-column${t}-cell-fix-left`]:{zIndex:e.zIndexTableFixed+1},[`table tr th${t}-selection-column::after`]:{backgroundColor:`transparent !important`},[`${t}-selection`]:{position:`relative`,display:`inline-flex`,flexDirection:`column`},[`${t}-selection-extra`]:{position:`absolute`,top:0,zIndex:1,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,marginInlineStart:`100%`,paddingInlineStart:`${e.tablePaddingHorizontal/4}px`,[r]:{color:o,fontSize:i,verticalAlign:`baseline`,"&:hover":{color:s}}}}}},Aq=e=>{let{componentCls:t}=e,n=(n,r,i,a)=>({[`${t}${t}-${n}`]:{fontSize:a,[` + ${t}-title, + ${t}-footer, + ${t}-thead > tr > th, + ${t}-tbody > tr > td, + tfoot > tr > th, + tfoot > tr > td + `]:{padding:`${r}px ${i}px`},[`${t}-filter-trigger`]:{marginInlineEnd:`-${i/2}px`},[`${t}-expanded-row-fixed`]:{margin:`-${r}px -${i}px`},[`${t}-tbody`]:{[`${t}-wrapper:only-child ${t}`]:{marginBlock:`-${r}px`,marginInline:`${e.tableExpandColumnWidth-i}px -${i}px`}},[`${t}-selection-column`]:{paddingInlineStart:`${i/4}px`}}});return{[`${t}-wrapper`]:Z(Z({},n(`middle`,e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),n(`small`,e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},jq=e=>{let{componentCls:t}=e;return{[`${t}-wrapper ${t}-resize-handle`]:{position:`absolute`,top:0,height:`100% !important`,bottom:0,left:` auto !important`,right:` -8px`,cursor:`col-resize`,touchAction:`none`,userSelect:`auto`,width:`16px`,zIndex:1,"&-line":{display:`block`,width:`1px`,marginLeft:`7px`,height:`100% !important`,backgroundColor:e.colorPrimary,opacity:0},"&:hover &-line":{opacity:1}},[`${t}-wrapper ${t}-resize-handle.dragging`]:{overflow:`hidden`,[`${t}-resize-handle-line`]:{opacity:1},"&:before":{position:`absolute`,top:0,bottom:0,content:`" "`,width:`200vw`,transform:`translateX(-50%)`,opacity:0}}}},Mq=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,tableHeaderIconColor:i,tableHeaderIconColorHover:a}=e;return{[`${t}-wrapper`]:{[`${t}-thead th${t}-column-has-sorters`]:{outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:`transparent !important`}},"&:focus-visible":{color:e.colorPrimary},[` + &${t}-cell-fix-left:hover, + &${t}-cell-fix-right:hover + `]:{background:e.tableFixedHeaderSortActiveBg}},[`${t}-thead th${t}-column-sort`]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:`transparent !important`}},[`td${t}-column-sort`]:{background:e.tableBodySortBg},[`${t}-column-title`]:{position:`relative`,zIndex:1,flex:1},[`${t}-column-sorters`]:{display:`flex`,flex:`auto`,alignItems:`center`,justifyContent:`space-between`,"&::after":{position:`absolute`,inset:0,width:`100%`,height:`100%`,content:`""`}},[`${t}-column-sorter`]:{marginInlineStart:n,color:i,fontSize:0,transition:`color ${e.motionDurationSlow}`,"&-inner":{display:`inline-flex`,flexDirection:`column`,alignItems:`center`},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},[`${t}-column-sorter-up + ${t}-column-sorter-down`]:{marginTop:`-0.3em`}},[`${t}-column-sorters:hover ${t}-column-sorter`]:{color:a}}}},Nq=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:i,tableScrollThumbSize:a,tableScrollBg:o,zIndexTableSticky:s}=e,c=`${e.lineWidth}px ${e.lineType} ${e.tableBorderColor}`;return{[`${t}-wrapper`]:{[`${t}-sticky`]:{"&-holder":{position:`sticky`,zIndex:s,background:e.colorBgContainer},"&-scroll":{position:`sticky`,bottom:0,height:`${a}px !important`,zIndex:s,display:`flex`,alignItems:`center`,background:o,borderTop:c,opacity:n,"&:hover":{transformOrigin:`center bottom`},"&-bar":{height:a,backgroundColor:r,borderRadius:100,transition:`all ${e.motionDurationSlow}, transform none`,position:`absolute`,bottom:0,"&:hover, &-active":{backgroundColor:i}}}}}}},Pq=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r}=e,i=`${n}px ${e.lineType} ${r}`;return{[`${t}-wrapper`]:{[`${t}-summary`]:{position:`relative`,zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:i}}},[`div${t}-summary`]:{boxShadow:`0 -${n}px 0 ${r}`}}}},Fq=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:i,lineWidth:a,lineType:o,tableBorderColor:s,tableFontSize:c,tableBg:l,tableRadius:u,tableHeaderTextColor:d,motionDurationMid:f,tableHeaderBg:p,tableHeaderCellSplitColor:m,tableRowHoverBg:h,tableSelectedRowBg:g,tableSelectedRowHoverBg:_,tableFooterTextColor:v,tableFooterBg:y,paddingContentVerticalLG:b}=e,x=`${a}px ${o} ${s}`;return{[`${t}-wrapper`]:Z(Z({clear:`both`,maxWidth:`100%`},D()),{[t]:Z(Z({},rn(e)),{fontSize:c,background:l,borderRadius:`${u}px ${u}px 0 0`}),table:{width:`100%`,textAlign:`start`,borderRadius:`${u}px ${u}px 0 0`,borderCollapse:`separate`,borderSpacing:0},[` + ${t}-thead > tr > th, + ${t}-tbody > tr > td, + tfoot > tr > th, + tfoot > tr > td + `]:{position:`relative`,padding:`${b}px ${i}px`,overflowWrap:`break-word`},[`${t}-title`]:{padding:`${r}px ${i}px`},[`${t}-thead`]:{"\n > tr > th,\n > tr > td\n ":{position:`relative`,color:d,fontWeight:n,textAlign:`start`,background:p,borderBottom:x,transition:`background ${f} ease`,"&[colspan]:not([colspan='1'])":{textAlign:`center`},[`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]:{position:`absolute`,top:`50%`,insetInlineEnd:0,width:1,height:`1.6em`,backgroundColor:m,transform:`translateY(-50%)`,transition:`background-color ${f}`,content:`""`}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},[`${t}:not(${t}-bordered)`]:{[`${t}-tbody`]:{"> tr":{"> td":{borderTop:x,borderBottom:`transparent`},"&:last-child > td":{borderBottom:x},[`&:first-child > td, + &${t}-measure-row + tr > td`]:{borderTop:`none`,borderTopColor:`transparent`}}}},[`${t}${t}-bordered`]:{[`${t}-tbody`]:{"> tr":{"> td":{borderBottom:x}}}},[`${t}-tbody`]:{"> tr":{"> td":{transition:`background ${f}, border-color ${f}`,[` + > ${t}-wrapper:only-child, + > ${t}-expanded-row-fixed > ${t}-wrapper:only-child + `]:{[t]:{marginBlock:`-${r}px`,marginInline:`${e.tableExpandColumnWidth-i}px -${i}px`,[`${t}-tbody > tr:last-child > td`]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},[` + &${t}-row:hover > td, + > td${t}-cell-row-hover + `]:{background:h},[`&${t}-row-selected`]:{"> td":{background:g},"&:hover > td":{background:_}}}},[`${t}-footer`]:{padding:`${r}px ${i}px`,color:v,background:y}})}},Iq=v(`Table`,e=>{let{controlItemBgActive:t,controlItemBgActiveHover:n,colorTextPlaceholder:r,colorTextHeading:i,colorSplit:a,colorBorderSecondary:o,fontSize:s,padding:c,paddingXS:l,paddingSM:u,controlHeight:d,colorFillAlter:f,colorIcon:p,colorIconHover:m,opacityLoading:h,colorBgContainer:g,borderRadiusLG:_,colorFillContent:v,colorFillSecondary:y,controlInteractiveSize:b}=e,x=new we(p),S=new we(m),C=t,w=new we(y).onBackground(g).toHexString(),T=new we(v).onBackground(g).toHexString(),E=new we(f).onBackground(g).toHexString(),D=B(e,{tableFontSize:s,tableBg:g,tableRadius:_,tablePaddingVertical:c,tablePaddingHorizontal:c,tablePaddingVerticalMiddle:u,tablePaddingHorizontalMiddle:l,tablePaddingVerticalSmall:l,tablePaddingHorizontalSmall:l,tableBorderColor:o,tableHeaderTextColor:i,tableHeaderBg:E,tableFooterTextColor:i,tableFooterBg:E,tableHeaderCellSplitColor:o,tableHeaderSortBg:w,tableHeaderSortHoverBg:T,tableHeaderIconColor:x.clone().setAlpha(x.getAlpha()*h).toRgbString(),tableHeaderIconColorHover:S.clone().setAlpha(S.getAlpha()*h).toRgbString(),tableBodySortBg:E,tableFixedHeaderSortActiveBg:w,tableHeaderFilterActiveBg:v,tableFilterDropdownBg:g,tableRowHoverBg:E,tableSelectedRowBg:C,tableSelectedRowHoverBg:n,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:s,tableFontSizeSmall:s,tableSelectionColumnWidth:d,tableExpandIconBg:g,tableExpandColumnWidth:b+2*e.padding,tableExpandedRowBg:f,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:r,tableScrollThumbBgHover:i,tableScrollBg:a});return[Fq(D),Eq(D),Pq(D),Mq(D),wq(D),bq(D),Dq(D),Cq(D),Pq(D),Sq(D),kq(D),Tq(D),Nq(D),xq(D),Aq(D),jq(D),Oq(D)]}),Lq=[],Rq=()=>({prefixCls:_(),columns:Ue(),rowKey:W([String,Function]),tableLayout:_(),rowClassName:W([String,Function]),title:d(),footer:d(),id:_(),showHeader:Q(),components:Qt(),customRow:d(),customHeaderRow:d(),direction:_(),expandFixed:W([Boolean,String]),expandColumnWidth:Number,expandedRowKeys:Ue(),defaultExpandedRowKeys:Ue(),expandedRowRender:d(),expandRowByClick:Q(),expandIcon:d(),onExpand:d(),onExpandedRowsChange:d(),"onUpdate:expandedRowKeys":d(),defaultExpandAllRows:Q(),indentSize:Number,expandIconColumnIndex:Number,showExpandColumn:Q(),expandedRowClassName:d(),childrenColumnName:_(),rowExpandable:d(),sticky:W([Boolean,Object]),dropdownPrefixCls:String,dataSource:Ue(),pagination:W([Boolean,Object]),loading:W([Boolean,Object]),size:_(),bordered:Q(),locale:Qt(),onChange:d(),onResizeColumn:d(),rowSelection:Qt(),getPopupContainer:d(),scroll:Qt(),sortDirections:Ue(),showSorterTooltip:W([Boolean,Object],!0),transformCellText:d()}),zq=u({name:`InternalTable`,inheritAttrs:!1,props:Zn(Z(Z({},Rq()),{contextSlots:Qt()}),{rowKey:`key`}),setup(e,t){let{attrs:n,slots:r,expose:i,emit:a}=t;pi(!(typeof e.rowKey==`function`&&e.rowKey.length>1),`Table`,"`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected."),VU(J(()=>e.contextSlots)),WU({onResizeColumn:(e,t)=>{a(`resizeColumn`,e,t)}});let o=Uv(),s=J(()=>{let t=new Set(Object.keys(o.value).filter(e=>o.value[e]));return e.columns.filter(e=>!e.responsive||e.responsive.some(e=>t.has(e)))}),{size:c,renderEmpty:l,direction:u,prefixCls:d,configProvider:f}=X(`table`,e),[p,m]=Iq(d),h=J(()=>e.transformCellText||f.transformCellText?.value),[g]=Kt(`Table`,Ye.Table,St(e,`locale`)),_=J(()=>e.dataSource||Lq),v=J(()=>f.getPrefixCls(`dropdown`,e.dropdownPrefixCls)),y=J(()=>e.childrenColumnName||`children`),b=J(()=>_.value.some(e=>e?.[y.value])?`nest`:e.expandedRowRender?`row`:null),x=Ne({body:null}),C=e=>{Z(x,e)},w=J(()=>typeof e.rowKey==`function`?e.rowKey:t=>t?.[e.rowKey]),[T]=oG(_,y,w),E={},D=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{pagination:i,scroll:a,onChange:o}=e,s=Z(Z({},E),t);r&&(E.resetPagination(),s.pagination.current&&(s.pagination.current=1),i&&i.onChange&&i.onChange(1,s.pagination.pageSize)),a&&a.scrollToFirstRowOnChange!==!1&&x.body&&ii(0,{getContainer:()=>x.body}),o?.(s.pagination,s.filters,s.sorter,{currentDataSource:fq(IG(_.value,s.sorterStates,y.value),s.filterStates),action:n})},[O,k,A,j]=LG({prefixCls:d,mergedColumns:s,onSorterChange:(e,t)=>{D({sorter:e,sorterStates:t},`sort`,!1)},sortDirections:J(()=>e.sortDirections||[`ascend`,`descend`]),tableLocale:g,showSorterTooltip:St(e,`showSorterTooltip`)}),M=J(()=>IG(_.value,k.value,y.value)),[N,P,F]=mq({prefixCls:d,locale:g,dropdownPrefixCls:v,mergedColumns:s,onFilterChange:(e,t)=>{D({filters:e,filterStates:t},`filter`,!0)},getPopupContainer:St(e,`getPopupContainer`)}),I=J(()=>fq(M.value,P.value)),[L]=yq(St(e,`contextSlots`)),[ee]=gq(J(()=>{let e={},t=F.value;return Object.keys(t).forEach(n=>{t[n]!==null&&(e[n]=t[n])}),Z(Z({},A.value),{filters:e})})),[te,ne]=aG(J(()=>I.value.length),St(e,`pagination`),(e,t)=>{D({pagination:Z(Z({},E.pagination),{current:e,pageSize:t})},`paginate`)});S(()=>{E.sorter=j.value,E.sorterStates=k.value,E.filters=F.value,E.filterStates=P.value,E.pagination=e.pagination===!1?{}:iG(te.value,e.pagination),E.resetPagination=ne});let R=J(()=>{if(e.pagination===!1||!te.value.pageSize)return I.value;let{current:t=1,total:n,pageSize:r=10}=te.value;return pi(t>0,`Table`,"`current` should be positive number."),I.value.lengthr?I.value.slice((t-1)*r,t*r):I.value:I.value.slice((t-1)*r,t*r)});S(()=>{z(()=>{let{total:e,pageSize:t=10}=te.value;I.value.lengtht&&pi(!1,`Table`,"`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.")})},{flush:`post`});let re=J(()=>e.showExpandColumn===!1?-1:b.value===`nest`&&e.expandIconColumnIndex===void 0?+!!e.rowSelection:e.expandIconColumnIndex>0&&e.rowSelection?e.expandIconColumnIndex-1:e.expandIconColumnIndex),ie=H();G(()=>e.rowSelection,()=>{ie.value=e.rowSelection?Z({},e.rowSelection):e.rowSelection},{deep:!0,immediate:!0});let[ae,oe]=pG(ie,{prefixCls:d,data:I,pageData:R,getRowKey:w,getRecordByKey:T,expandType:b,childrenColumnName:y,locale:g,getPopupContainer:J(()=>e.getPopupContainer)}),se=(t,n,r)=>{let i,{rowClassName:a}=e;return i=K(typeof a==`function`?a(t,n,r):a),K({[`${d.value}-row-selected`]:oe.value.has(w.value(t,n))},i)};i({selectedKeySet:oe});let B=J(()=>typeof e.indentSize==`number`?e.indentSize:15),V=e=>ee(ae(N(O(L(e)))));return()=>{let{expandIcon:t=r.expandIcon||_q(g.value),pagination:i,loading:a,bordered:o}=e,f,v;if(i!==!1&&te.value?.total){let e;e=te.value.size?te.value.size:c.value===`small`||c.value===`middle`?`small`:void 0;let t=t=>U(_z,Y(Y({},te.value),{},{class:[`${d.value}-pagination ${d.value}-pagination-${t}`,te.value.class],size:e}),null),n=u.value===`rtl`?`left`:`right`,{position:r}=te.value;if(r!==null&&Array.isArray(r)){let e=r.find(e=>e.includes(`top`)),i=r.find(e=>e.includes(`bottom`)),a=r.every(e=>`${e}`==`none`);!e&&!i&&!a&&(v=t(n)),e&&(f=t(e.toLowerCase().replace(`top`,``))),i&&(v=t(i.toLowerCase().replace(`bottom`,``)))}else v=t(n)}let y;typeof a==`boolean`?y={spinning:a}:typeof a==`object`&&(y=Z({spinning:!0},a));let b=K(`${d.value}-wrapper`,{[`${d.value}-wrapper-rtl`]:u.value===`rtl`},n.class,m.value),S=Br(e,[`columns`]);return p(U(`div`,{class:b,style:n.style},[U(HR,Y({spinning:!1},y),{default:()=>[f,U(nG,Y(Y(Y({},n),S),{},{expandedRowKeys:e.expandedRowKeys,defaultExpandedRowKeys:e.defaultExpandedRowKeys,expandIconColumnIndex:re.value,indentSize:B.value,expandIcon:t,columns:s.value,direction:u.value,prefixCls:d.value,class:K({[`${d.value}-middle`]:c.value===`middle`,[`${d.value}-small`]:c.value===`small`,[`${d.value}-bordered`]:o,[`${d.value}-empty`]:_.value.length===0}),data:R.value,rowKey:w.value,rowClassName:se,internalHooks:tG,internalRefs:x,onUpdateInternalRefs:C,transformColumns:V,transformCellText:h.value}),Z(Z({},r),{emptyText:()=>r.emptyText?.call(r)||e.locale?.emptyText||l(`Table`)})),v]})]))}}}),Bq=u({name:`ATable`,inheritAttrs:!1,props:Zn(Rq(),{rowKey:`key`}),slots:Object,setup(e,t){let{attrs:n,slots:r,expose:i}=t,a=H();return i({table:a}),()=>{let t=e.columns||EG(r.default?.call(r));return U(zq,Y(Y(Y({ref:a},n),e),{},{columns:t||[],expandedRowRender:r.expandedRowRender||e.expandedRowRender,contextSlots:Z({},r)}),r)}}}),Vq=u({name:`ATableColumn`,slots:Object,render(){return null}}),Hq=u({name:`ATableColumnGroup`,slots:Object,__ANT_TABLE_COLUMN_GROUP:!0,render(){return null}}),Uq=RW,Wq=HW,Gq=Z(WW,{Cell:Wq,Row:Uq,name:`ATableSummary`}),Kq=Z(Bq,{SELECTION_ALL:cG,SELECTION_INVERT:lG,SELECTION_NONE:uG,SELECTION_COLUMN:sG,EXPAND_COLUMN:TW,Column:Vq,ColumnGroup:Hq,Summary:Gq,install:e=>(e.component(Gq.name,Gq),e.component(Wq.name,Wq),e.component(Uq.name,Uq),e.component(Bq.name,Bq),e.component(Vq.name,Vq),e.component(Hq.name,Hq),e)}),qq=u({compatConfig:{MODE:3},name:`Search`,inheritAttrs:!1,props:Zn({prefixCls:String,placeholder:String,value:String,handleClear:Function,disabled:{type:Boolean,default:void 0},onChange:Function},{placeholder:``}),emits:[`change`],setup(e,t){let{emit:n}=t,r=t=>{var r;n(`change`,t),t.target.value===``&&((r=e.handleClear)==null||r.call(e))};return()=>{let{placeholder:t,value:n,prefixCls:i,disabled:a}=e;return U(hI,{placeholder:t,class:i,value:n,onChange:r,disabled:a,allowClear:!0},{prefix:()=>U(jf,null,null)})}}});function Jq(){}var Yq=u({compatConfig:{MODE:3},name:`ListItem`,inheritAttrs:!1,props:{renderedText:f.any,renderedEl:f.any,item:f.any,checked:Q(),prefixCls:String,disabled:Q(),showRemove:Q(),onClick:Function,onRemove:Function},emits:[`click`,`remove`],setup(e,t){let{emit:n}=t;return()=>{let{renderedText:t,renderedEl:r,item:i,checked:a,disabled:o,prefixCls:s,showRemove:c}=e,l=K({[`${s}-content-item`]:!0,[`${s}-content-item-disabled`]:o||i.disabled}),u;return(typeof t==`string`||typeof t==`number`)&&(u=String(t)),U(Ke,{componentName:`Transfer`,defaultLocale:Ye.Transfer},{default:e=>{let t=U(`span`,{class:`${s}-content-item-text`},[r]);return c?U(`li`,{class:l,title:u},[t,U(JB,{disabled:o||i.disabled,class:`${s}-content-item-remove`,"aria-label":e.remove,onClick:()=>{n(`remove`,i)}},{default:()=>[U(sn,null,null)]})]):U(`li`,{class:l,title:u,onClick:o||i.disabled?Jq:()=>{n(`click`,i)}},[U(vN,{class:`${s}-checkbox`,checked:a,disabled:o||i.disabled},null),t])}})}}}),Xq={prefixCls:String,filteredRenderItems:f.array.def([]),selectedKeys:f.array,disabled:Q(),showRemove:Q(),pagination:f.any,onItemSelect:Function,onScroll:Function,onItemRemove:Function};function Zq(e){if(!e)return null;let t={pageSize:10,simple:!0,showSizeChanger:!1,showLessItems:!1};return typeof e==`object`?Z(Z({},t),e):t}var Qq=u({compatConfig:{MODE:3},name:`ListBody`,inheritAttrs:!1,props:Xq,emits:[`itemSelect`,`itemRemove`,`scroll`],setup(e,t){let{emit:n,expose:r}=t,i=H(1),a=t=>{let{selectedKeys:r}=e,i=r.indexOf(t.key)>=0;n(`itemSelect`,t.key,!i)},o=e=>{n(`itemRemove`,[e.key])},s=e=>{n(`scroll`,e)},c=J(()=>Zq(e.pagination));G([c,()=>e.filteredRenderItems],()=>{if(c.value){let t=Math.ceil(e.filteredRenderItems.length/c.value.pageSize);i.value=Math.min(i.value,t)}},{immediate:!0});let l=J(()=>{let{filteredRenderItems:t}=e,n=t;return c.value&&(n=t.slice((i.value-1)*c.value.pageSize,i.value*c.value.pageSize)),n}),u=e=>{i.value=e};return r({items:l}),()=>{let{prefixCls:t,filteredRenderItems:n,selectedKeys:r,disabled:d,showRemove:f}=e,p=null;c.value&&(p=U(_z,{simple:c.value.simple,showSizeChanger:c.value.showSizeChanger,showLessItems:c.value.showLessItems,size:`small`,disabled:d,class:`${t}-pagination`,total:n.length,pageSize:c.value.pageSize,current:i.value,onChange:u},null));let m=l.value.map(e=>{let{renderedEl:n,renderedText:i,item:s}=e,{disabled:c}=s,l=r.indexOf(s.key)>=0;return U(Yq,{disabled:d||c,key:s.key,item:s,renderedText:i,renderedEl:n,checked:l,prefixCls:t,onClick:a,onRemove:o,showRemove:f},null)});return U($e,null,[U(`ul`,{class:K(`${t}-content`,{[`${t}-content-show-remove`]:f}),onScroll:s},[m]),p])}}}),$q=e=>{let t=new Map;return e.forEach((e,n)=>{t.set(e,n)}),t},eJ=e=>{let t=new Map;return e.forEach((e,n)=>{let{disabled:r,key:i}=e;r&&t.set(i,n)}),t},tJ=()=>null;function nJ(e){return!!(e&&!Nt(e)&&Object.prototype.toString.call(e)===`[object Object]`)}function rJ(e){return e.filter(e=>!e.disabled).map(e=>e.key)}var iJ=u({compatConfig:{MODE:3},name:`TransferList`,inheritAttrs:!1,props:{prefixCls:String,dataSource:Ue([]),filter:String,filterOption:Function,checkedKeys:f.arrayOf(f.string),handleFilter:Function,handleClear:Function,renderItem:Function,showSearch:Q(!1),searchPlaceholder:String,notFoundContent:f.any,itemUnit:String,itemsUnit:String,renderList:f.any,disabled:Q(),direction:_(),showSelectAll:Q(),remove:String,selectAll:String,selectCurrent:String,selectInvert:String,removeAll:String,removeCurrent:String,selectAllLabel:f.any,showRemove:Q(),pagination:f.any,onItemSelect:Function,onItemSelectAll:Function,onItemRemove:Function,onScroll:Function},slots:Object,setup(e,t){let{attrs:n,slots:r}=t,i=H(``),a=H(),o=H(),s=(e,t)=>{let n=e?e(t):null,r=!!n&&dt(n).length>0;return r||(n=U(Qq,Y(Y({},t),{},{ref:o}),null)),{customize:r,bodyContent:n}},c=t=>{let{renderItem:n=tJ}=e,r=n(t),i=nJ(r);return{renderedText:i?r.value:r,renderedEl:i?r.label:r,item:t}},l=H([]),u=H([]);S(()=>{let t=[],n=[];e.dataSource.forEach(e=>{let r=c(e),{renderedText:a}=r;if(i.value&&i.value.trim()&&!_(a,e))return null;t.push(e),n.push(r)}),l.value=t,u.value=n});let d=J(()=>{let{checkedKeys:t}=e;if(t.length===0)return`none`;let n=$q(t);return l.value.every(e=>n.has(e.key)||!!e.disabled)?`all`:`part`}),f=J(()=>rJ(l.value)),p=(t,n)=>Array.from(new Set([...t,...e.checkedKeys])).filter(e=>n.indexOf(e)===-1),m=t=>{let{disabled:n,prefixCls:r}=t,i=d.value===`all`;return U(vN,{disabled:e.dataSource?.length===0||n,checked:i,indeterminate:d.value===`part`,class:`${r}-checkbox`,onChange:()=>{let t=f.value;e.onItemSelectAll(p(i?[]:t,i?e.checkedKeys:[]))}},null)},h=t=>{var n;let{target:{value:r}}=t;i.value=r,(n=e.handleFilter)==null||n.call(e,t)},g=t=>{var n;i.value=``,(n=e.handleClear)==null||n.call(e,t)},_=(t,n)=>{let{filterOption:r}=e;return r?r(i.value,n):t.includes(i.value)},v=(t,n)=>{let{itemsUnit:r,itemUnit:i,selectAllLabel:a}=e;if(a)return typeof a==`function`?a({selectedCount:t,totalCount:n}):a;let o=n>1?r:i;return U($e,null,[(t>0?`${t}/`:``)+n,en(` `),o])},y=J(()=>Array.isArray(e.notFoundContent)?e.notFoundContent[e.direction===`left`?0:1]:e.notFoundContent),b=(t,r,o,c,d,f)=>{let p=d?U(`div`,{class:`${t}-body-search-wrapper`},[U(qq,{prefixCls:`${t}-search`,onChange:h,handleClear:g,placeholder:r,value:i.value,disabled:f},null)]):null,m,{onEvents:_}=je(n),{bodyContent:v,customize:b}=s(c,Z(Z(Z({},e),{filteredItems:l.value,filteredRenderItems:u.value,selectedKeys:o}),_));return m=b?U(`div`,{class:`${t}-body-customize-wrapper`},[v]):l.value.length?v:U(`div`,{class:`${t}-body-not-found`},[y.value]),U(`div`,{class:d?`${t}-body ${t}-body-with-search`:`${t}-body`,ref:a},[p,m])};return()=>{let{prefixCls:t,checkedKeys:i,disabled:a,showSearch:s,searchPlaceholder:c,selectAll:u,selectCurrent:d,selectInvert:h,removeAll:g,removeCurrent:_,renderList:y,onItemSelectAll:x,onItemRemove:S,showSelectAll:C=!0,showRemove:w,pagination:T}=e,E=r.footer?.call(r,Z({},e)),D=K(t,{[`${t}-with-pagination`]:!!T,[`${t}-with-footer`]:!!E}),O=b(t,c,i,y,s,a),k=E?U(`div`,{class:`${t}-footer`},[E]):null,A=!w&&!T&&m({disabled:a,prefixCls:t}),j=null;j=w?U(wS,null,{default:()=>[T&&U(wS.Item,{key:`removeCurrent`,onClick:()=>{let e=rJ((o.value.items||[]).map(e=>e.item));S?.(e)}},{default:()=>[_]}),U(wS.Item,{key:`removeAll`,onClick:()=>{S?.(f.value)}},{default:()=>[g]})]}):U(wS,null,{default:()=>[U(wS.Item,{key:`selectAll`,onClick:()=>{let e=f.value;x(p(e,[]))}},{default:()=>[u]}),T&&U(wS.Item,{onClick:()=>{let e=rJ((o.value.items||[]).map(e=>e.item));x(p(e,[]))}},{default:()=>[d]}),U(wS.Item,{key:`selectInvert`,onClick:()=>{let e;e=T?rJ((o.value.items||[]).map(e=>e.item)):f.value;let t=new Set(i),n=[],r=[];e.forEach(e=>{t.has(e)?r.push(e):n.push(e)}),x(p(n,r))}},{default:()=>[h]})]});let M=U(kP,{class:`${t}-header-dropdown`,overlay:j,disabled:a},{default:()=>[U(Cf,null,null)]});return U(`div`,{class:D,style:n.style},[U(`div`,{class:`${t}-header`},[C?U($e,null,[A,M]):null,U(`span`,{class:`${t}-header-selected`},[U(`span`,null,[v(i.length,l.value.length)]),U(`span`,{class:`${t}-header-title`},[r.titleText?.call(r)])])]),O,k])}}});function aJ(){}var oJ=e=>{let{disabled:t,moveToLeft:n=aJ,moveToRight:r=aJ,leftArrowText:i=``,rightArrowText:a=``,leftActive:o,rightActive:s,class:c,style:l,direction:u,oneWay:d}=e;return U(`div`,{class:c,style:l},[U(Qb,{type:`primary`,size:`small`,disabled:t||!s,onClick:r,icon:U(u===`rtl`?wA:gx,null,null)},{default:()=>[a]}),!d&&U(Qb,{type:`primary`,size:`small`,disabled:t||!o,onClick:n,icon:U(u===`rtl`?gx:wA,null,null)},{default:()=>[i]})])};oJ.displayName=`Operation`,oJ.inheritAttrs=!1;var sJ=e=>{let{antCls:t,componentCls:n,listHeight:r,controlHeightLG:i,marginXXS:a,margin:o}=e,s=`${t}-table`,c=`${t}-input`;return{[`${n}-customize-list`]:{[`${n}-list`]:{flex:`1 1 50%`,width:`auto`,height:`auto`,minHeight:r},[`${s}-wrapper`]:{[`${s}-small`]:{border:0,borderRadius:0,[`${s}-selection-column`]:{width:i,minWidth:i}},[`${s}-pagination${s}-pagination`]:{margin:`${o}px 0 ${a}px`}},[`${c}[disabled]`]:{backgroundColor:`transparent`}}}},cJ=(e,t)=>{let{componentCls:n,colorBorder:r}=e;return{[`${n}-list`]:{borderColor:t,"&-search:not([disabled])":{borderColor:r}}}},lJ=e=>{let{componentCls:t}=e;return{[`${t}-status-error`]:Z({},cJ(e,e.colorError)),[`${t}-status-warning`]:Z({},cJ(e,e.colorWarning))}},uJ=e=>{let{componentCls:t,colorBorder:n,colorSplit:r,lineWidth:i,transferItemHeight:a,transferHeaderHeight:s,transferHeaderVerticalPadding:c,transferItemPaddingVertical:l,controlItemBgActive:u,controlItemBgActiveHover:d,colorTextDisabled:f,listHeight:p,listWidth:m,listWidthLG:h,fontSizeIcon:g,marginXS:_,paddingSM:v,lineType:y,iconCls:b,motionDurationSlow:x}=e;return{display:`flex`,flexDirection:`column`,width:m,height:p,border:`${i}px ${y} ${n}`,borderRadius:e.borderRadiusLG,"&-with-pagination":{width:h,height:`auto`},"&-search":{[`${b}-search`]:{color:f}},"&-header":{display:`flex`,flex:`none`,alignItems:`center`,height:s,padding:`${c-i}px ${v}px ${c}px`,color:e.colorText,background:e.colorBgContainer,borderBottom:`${i}px ${y} ${r}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,"> *:not(:last-child)":{marginInlineEnd:4},"> *":{flex:`none`},"&-title":Z(Z({},xe),{flex:`auto`,textAlign:`end`}),"&-dropdown":Z(Z({},o()),{fontSize:g,transform:`translateY(10%)`,cursor:`pointer`,"&[disabled]":{cursor:`not-allowed`}})},"&-body":{display:`flex`,flex:`auto`,flexDirection:`column`,overflow:`hidden`,fontSize:e.fontSize,"&-search-wrapper":{position:`relative`,flex:`none`,padding:v}},"&-content":{flex:`auto`,margin:0,padding:0,overflow:`auto`,listStyle:`none`,"&-item":{display:`flex`,alignItems:`center`,minHeight:a,padding:`${l}px ${v}px`,transition:`all ${x}`,"> *:not(:last-child)":{marginInlineEnd:_},"> *":{flex:`none`},"&-text":Z(Z({},xe),{flex:`auto`}),"&-remove":{position:`relative`,color:n,cursor:`pointer`,transition:`all ${x}`,"&:hover":{color:e.colorLinkHover},"&::after":{position:`absolute`,insert:`-${l}px -50%`,content:`""`}},[`&:not(${t}-list-content-item-disabled)`]:{"&:hover":{backgroundColor:e.controlItemBgHover,cursor:`pointer`},[`&${t}-list-content-item-checked:hover`]:{backgroundColor:d}},"&-checked":{backgroundColor:u},"&-disabled":{color:f,cursor:`not-allowed`}},[`&-show-remove ${t}-list-content-item:not(${t}-list-content-item-disabled):hover`]:{background:`transparent`,cursor:`default`}},"&-pagination":{padding:`${e.paddingXS}px 0`,textAlign:`end`,borderTop:`${i}px ${y} ${r}`},"&-body-not-found":{flex:`none`,width:`100%`,margin:`auto 0`,color:f,textAlign:`center`},"&-footer":{borderTop:`${i}px ${y} ${r}`},"&-checkbox":{lineHeight:1}}},dJ=e=>{let{antCls:t,iconCls:n,componentCls:r,transferHeaderHeight:i,marginXS:a,marginXXS:o,fontSizeIcon:s,fontSize:c,lineHeight:l}=e;return{[r]:Z(Z({},rn(e)),{position:`relative`,display:`flex`,alignItems:`stretch`,[`${r}-disabled`]:{[`${r}-list`]:{background:e.colorBgContainerDisabled}},[`${r}-list`]:uJ(e),[`${r}-operation`]:{display:`flex`,flex:`none`,flexDirection:`column`,alignSelf:`center`,margin:`0 ${a}px`,verticalAlign:`middle`,[`${t}-btn`]:{display:`block`,"&:first-child":{marginBottom:o},[n]:{fontSize:s}}},[`${t}-empty-image`]:{maxHeight:i/2-Math.round(c*l)}})}},fJ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},pJ=v(`Transfer`,e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeightLG:i,controlHeight:a}=e,o=Math.round(t*n),s=i,c=a,l=B(e,{transferItemHeight:c,transferHeaderHeight:s,transferHeaderVerticalPadding:Math.ceil((s-r-o)/2),transferItemPaddingVertical:(c-o)/2});return[dJ(l),sJ(l),lJ(l),fJ(l)]},{listWidth:180,listHeight:200,listWidthLG:250}),mJ=a(u({compatConfig:{MODE:3},name:`ATransfer`,inheritAttrs:!1,props:{id:String,prefixCls:String,dataSource:Ue([]),disabled:Q(),targetKeys:Ue(),selectedKeys:Ue(),render:d(),listStyle:W([Function,Object],()=>({})),operationStyle:Qt(void 0),titles:Ue(),operations:Ue(),showSearch:Q(!1),filterOption:d(),searchPlaceholder:String,notFoundContent:f.any,locale:Qt(),rowKey:d(),showSelectAll:Q(),selectAllLabels:Ue(),children:d(),oneWay:Q(),pagination:W([Object,Boolean]),status:_(),onChange:d(),onSelectChange:d(),onSearch:d(),onScroll:d(),"onUpdate:targetKeys":d(),"onUpdate:selectedKeys":d()},slots:Object,setup(e,t){let{emit:n,attrs:r,slots:i,expose:a}=t,{configProvider:o,prefixCls:s,direction:c}=X(`transfer`,e),[l,u]=pJ(s),d=H([]),f=H([]),p=zf(),m=Vf.useInject(),h=J(()=>Wf(m.status,e.status));G(()=>e.selectedKeys,()=>{d.value=e.selectedKeys?.filter(t=>e.targetKeys.indexOf(t)===-1)||[],f.value=e.selectedKeys?.filter(t=>e.targetKeys.indexOf(t)>-1)||[]},{immediate:!0});let g=(t,n)=>{let r={notFoundContent:n(`Transfer`)},a=on(i,e,`notFoundContent`);return a&&(r.notFoundContent=a),e.searchPlaceholder!==void 0&&(r.searchPlaceholder=e.searchPlaceholder),Z(Z(Z({},t),r),e.locale)},_=t=>{let{targetKeys:r=[],dataSource:i=[]}=e,a=t===`right`?d.value:f.value,o=eJ(i),s=a.filter(e=>!o.has(e)),c=$q(s),l=t===`right`?s.concat(r):r.filter(e=>!c.has(e)),u=t===`right`?`left`:`right`;t===`right`?d.value=[]:f.value=[],n(`update:targetKeys`,l),w(u,[]),n(`change`,l,t,s),p.onFieldChange()},v=()=>{_(`left`)},y=()=>{_(`right`)},b=(e,t)=>{w(e,t)},x=e=>b(`left`,e),C=e=>b(`right`,e),w=(t,r)=>{t===`left`?(e.selectedKeys||(d.value=r),n(`update:selectedKeys`,[...r,...f.value]),n(`selectChange`,r,Ht(f.value))):(e.selectedKeys||(f.value=r),n(`update:selectedKeys`,[...r,...d.value]),n(`selectChange`,Ht(d.value),r))},T=(e,t)=>{let r=t.target.value;n(`search`,e,r)},E=e=>{T(`left`,e)},D=e=>{T(`right`,e)},O=e=>{n(`search`,e,``)},k=()=>{O(`left`)},A=()=>{O(`right`)},j=(e,t,n)=>{let r=e===`left`?[...d.value]:[...f.value],i=r.indexOf(t);i>-1&&r.splice(i,1),n&&r.push(t),w(e,r)},M=(e,t)=>j(`left`,e,t),N=(e,t)=>j(`right`,e,t),P=t=>{let{targetKeys:r=[]}=e,i=r.filter(e=>!t.includes(e));n(`update:targetKeys`,i),n(`change`,i,`left`,[...t])},F=(e,t)=>{n(`scroll`,e,t)},I=e=>{F(`left`,e)},L=e=>{F(`right`,e)},ee=(e,t)=>typeof e==`function`?e({direction:t}):e,te=H([]),ne=H([]);S(()=>{let{dataSource:t,rowKey:n,targetKeys:r=[]}=e,i=[],a=Array(r.length),o=$q(r);t.forEach(e=>{n&&(e.key=n(e)),o.has(e.key)?a[o.get(e.key)]=e:i.push(e)}),te.value=i,ne.value=a}),a({handleSelectChange:w});let R=t=>{let{disabled:n,operations:a=[],showSearch:l,listStyle:_,operationStyle:b,filterOption:S,showSelectAll:w,selectAllLabels:T=[],oneWay:O,pagination:j,id:F=p.id.value}=e,{class:R,style:re}=r,ie=i.children,ae=!ie&&j,oe=o.renderEmpty,z=g(t,oe),{footer:se}=i,B=e.render||i.render,V=f.value.length>0,ce=d.value.length>0,le=K(s.value,R,{[`${s.value}-disabled`]:n,[`${s.value}-customize-list`]:!!ie,[`${s.value}-rtl`]:c.value===`rtl`},Uf(s.value,h.value,m.hasFeedback),u.value),H=e.titles,ue=(H&&H[0])??i.leftTitle?.call(i)??(z.titles||[``,``])[0],de=(H&&H[1])??i.rightTitle?.call(i)??(z.titles||[``,``])[1];return U(`div`,Y(Y({},r),{},{class:le,style:re,id:F}),[U(iJ,Y({key:`leftList`,prefixCls:`${s.value}-list`,dataSource:te.value,filterOption:S,style:ee(_,`left`),checkedKeys:d.value,handleFilter:E,handleClear:k,onItemSelect:M,onItemSelectAll:x,renderItem:B,showSearch:l,renderList:ie,onScroll:I,disabled:n,direction:c.value===`rtl`?`right`:`left`,showSelectAll:w,selectAllLabel:T[0]||i.leftSelectAllLabel,pagination:ae},z),{titleText:()=>ue,footer:se}),U(oJ,{key:`operation`,class:`${s.value}-operation`,rightActive:ce,rightArrowText:a[0],moveToRight:y,leftActive:V,leftArrowText:a[1],moveToLeft:v,style:b,disabled:n,direction:c.value,oneWay:O},null),U(iJ,Y({key:`rightList`,prefixCls:`${s.value}-list`,dataSource:ne.value,filterOption:S,style:ee(_,`right`),checkedKeys:f.value,handleFilter:D,handleClear:A,onItemSelect:N,onItemSelectAll:C,onItemRemove:P,renderItem:B,showSearch:l,renderList:ie,onScroll:L,disabled:n,direction:c.value===`rtl`?`left`:`right`,showSelectAll:w,selectAllLabel:T[1]||i.rightSelectAllLabel,showRemove:O,pagination:ae},z),{titleText:()=>de,footer:se})])};return()=>l(U(Ke,{componentName:`Transfer`,defaultLocale:Ye.Transfer,children:R},null))}}));function hJ(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function gJ(e){let{label:t,value:n,children:r}=e||{},i=n||`value`;return{_title:t?[t]:[`title`,`label`],value:i,key:i,children:r||`children`}}function _J(e){return e.disabled||e.disableCheckbox||e.checkable===!1}function vJ(e,t){let n=[];function r(e){e.forEach(e=>{n.push(e[t.value]);let i=e[t.children];i&&r(i)})}return r(e),n}function yJ(e){return e==null}var bJ=Symbol(`TreeSelectContextPropsKey`);function xJ(e){return fe(bJ,e)}function SJ(){return g(bJ,{})}var CJ={width:0,height:0,display:`flex`,overflow:`hidden`,opacity:0,border:0,padding:0,margin:0},wJ=u({compatConfig:{MODE:3},name:`OptionList`,inheritAttrs:!1,setup(e,t){let{slots:n,expose:r}=t,i=_d(),a=rd(),o=SJ(),s=H(),c=Wd(()=>o.treeData,[()=>i.open,()=>o.treeData],e=>e[0]),l=J(()=>{let{checkable:e,halfCheckedKeys:t,checkedKeys:n}=a;return e?{checked:n,halfChecked:t}:null});G(()=>i.open,()=>{z(()=>{var e;i.open&&!i.multiple&&a.checkedKeys.length&&((e=s.value)==null||e.scrollTo({key:a.checkedKeys[0]}))})},{immediate:!0,flush:`post`});let u=J(()=>String(i.searchValue).toLowerCase()),d=e=>u.value?String(e[a.treeNodeFilterProp]).toLowerCase().includes(u.value):!1,f=q(a.treeDefaultExpandedKeys),p=q(null);G(()=>i.searchValue,()=>{i.searchValue&&(p.value=vJ(Ht(o.treeData),Ht(o.fieldNames)))},{immediate:!0});let m=J(()=>a.treeExpandedKeys?a.treeExpandedKeys.slice():i.searchValue?p.value:f.value),h=e=>{var t;f.value=e,p.value=e,(t=a.onTreeExpand)==null||t.call(a,e)},g=e=>{e.preventDefault()},_=(e,t)=>{let{node:n}=t;var r,s;let{checkable:c,checkedKeys:l}=a;c&&_J(n)||((r=o.onSelect)==null||r.call(o,n.key,{selected:!l.includes(n.key)}),i.multiple||(s=i.toggleOpen)==null||s.call(i,!1))},v=H(null),y=J(()=>a.keyEntities[v.value]),b=e=>{v.value=e};return r({scrollTo:function(){var e,t=[...arguments];return((e=s.value)?.scrollTo)?.call(e,...t)},onKeydown:e=>{var t;let{which:n}=e;switch(n){case $.UP:case $.DOWN:case $.LEFT:case $.RIGHT:(t=s.value)==null||t.onKeydown(e);break;case $.ENTER:if(y.value){let{selectable:e,value:t}=y.value.node||{};e!==!1&&_(null,{node:{key:v.value},selected:!a.checkedKeys.includes(t)})}break;case $.ESC:i.toggleOpen(!1)}},onKeyup:()=>{}}),()=>{let{prefixCls:e,multiple:t,searchValue:r,open:u,notFoundContent:f=n.notFoundContent?.call(n)}=i,{listHeight:p,listItemHeight:x,virtual:S,dropdownMatchSelectWidth:C,treeExpandAction:w}=o,{checkable:T,treeDefaultExpandAll:E,treeIcon:D,showTreeIcon:O,switcherIcon:k,treeLine:A,loadData:j,treeLoadedKeys:M,treeMotion:N,onTreeLoad:P,checkedKeys:F}=a;if(c.value.length===0)return U(`div`,{role:`listbox`,class:`${e}-empty`,onMousedown:g},[f]);let I={fieldNames:o.fieldNames};return M&&(I.loadedKeys=M),m.value&&(I.expandedKeys=m.value),U(`div`,{onMousedown:g},[y.value&&u&&U(`span`,{style:CJ,"aria-live":`assertive`},[y.value.node.value]),U(cK,Y(Y({ref:s,focusable:!1,prefixCls:`${e}-tree`,treeData:c.value,height:p,itemHeight:x,virtual:S!==!1&&C!==!1,multiple:t,icon:D,showIcon:O,switcherIcon:k,showLine:A,loadData:r?null:j,motion:N,activeKey:v.value,checkable:T,checkStrictly:!0,checkedKeys:l.value,selectedKeys:T?[]:F,defaultExpandAll:E},I),{},{onActiveChange:b,onSelect:_,onCheck:_,onExpand:h,onLoad:P,filterTreeNode:d,expandAction:w}),Z(Z({},n),{checkable:a.customSlots.treeCheckable}))])}}}),TJ=`SHOW_ALL`,EJ=`SHOW_PARENT`,DJ=`SHOW_CHILD`;function OJ(e,t,n,r){let i=new Set(e);return t===`SHOW_CHILD`?e.filter(e=>{let t=n[e];return!(t&&t.children&&t.children.some(e=>{let{node:t}=e;return i.has(t[r.value])})&&t.children.every(e=>{let{node:t}=e;return _J(t)||i.has(t[r.value])}))}):t===`SHOW_PARENT`?e.filter(e=>{let t=n[e],r=t?t.parent:null;return!(r&&!_J(r.node)&&i.has(r.key))}):e}var kJ=()=>null;kJ.inheritAttrs=!1,kJ.displayName=`ATreeSelectNode`,kJ.isTreeSelectNode=!0;var AJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:[]).map(e=>{if(!jJ(e))return null;let n=e.children||{},r=e.key,i={};for(let[t,n]of Object.entries(e.props))i[ue(t)]=n;let{isLeaf:a,checkable:o,selectable:s,disabled:c,disableCheckbox:l}=i,u={isLeaf:a||a===``||void 0,checkable:o||o===``||void 0,selectable:s||s===``||void 0,disabled:c||c===``||void 0,disableCheckbox:l||l===``||void 0},d=Z(Z({},i),u),{title:f=n.title?.call(n,d),switcherIcon:p=n.switcherIcon?.call(n,d)}=i,m=AJ(i,[`title`,`switcherIcon`]),h=n.default?.call(n),g=Z(Z(Z({},m),{title:f,switcherIcon:p,key:r,isLeaf:a}),u),_=t(h);return _.length&&(g.children=_),g})}return t(e)}function NJ(e){if(!e)return e;let t=Z({},e);return`props`in t||Object.defineProperty(t,"props",{get(){return t}}),t}function PJ(e,t,n,r,i,a){let o=null,s=null;function c(){function e(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`0`,c=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return r.map((r,l)=>{let u=`${i}-${l}`,d=r[a.value],f=n.includes(d),p=e(r[a.children]||[],u,f),m=U(kJ,r,{default:()=>[p.map(e=>e.node)]});if(t===d&&(o=m),f){let e={pos:u,node:m,children:p};return c||s.push(e),e}return null}).filter(e=>e)}s||(s=[],e(r),s.sort((e,t)=>{let{node:{props:{value:r}}}=e,{node:{props:{value:i}}}=t;return n.indexOf(r)-n.indexOf(i)}))}Object.defineProperty(e,"triggerNode",{get(){return c(),o}}),Object.defineProperty(e,"allCheckedNodes",{get(){return c(),i?s:s.map(e=>{let{node:t}=e;return t})}})}function FJ(e,t){let{id:n,pId:r,rootPId:i}=t,a={},o=[];return e.map(e=>{let t=Z({},e),r=t[n];return a[r]=t,t.key=t.key||r,t}).forEach(e=>{let t=e[r],n=a[t];n&&(n.children=n.children||[],n.children.push(e)),(t===i||!n&&i===null)&&o.push(e)}),o}function IJ(e,t,n){let r=q();return G([n,e,t],()=>{let i=n.value;e.value?r.value=n.value?FJ(Ht(e.value),Z({id:`id`,pId:`pId`,rootPId:null},i===!0?{}:i)):Ht(e.value).slice():r.value=MJ(Ht(t.value))},{immediate:!0,deep:!0}),r}var LJ=(e=>{let t=q({valueLabels:new Map}),n=q();return G(e,()=>{n.value=Ht(e.value)},{immediate:!0}),[J(()=>{let{valueLabels:e}=t.value,r=new Map,i=n.value.map(t=>{let{value:n}=t,i=t.label??e.get(n);return r.set(n,i),Z(Z({},t),{label:i})});return t.value.valueLabels=r,i})]}),RJ=((e,t)=>{let n=q(new Map),r=q({});return S(()=>{let i=t.value,a=Hk(e.value,{fieldNames:i,initWrapper:e=>Z(Z({},e),{valueEntities:new Map}),processEntity:(e,t)=>{let n=e.node[i.value];t.valueEntities.set(n,e)}});n.value=a.valueEntities,r.value=a.keyEntities}),{valueEntities:n,keyEntities:r}}),zJ=((e,t,n,r,i,a)=>{let o=q([]),s=q([]);return S(()=>{let c=e.value.map(e=>{let{value:t}=e;return t}),l=t.value.map(e=>{let{value:t}=e;return t}),u=c.filter(e=>!r.value[e]);n.value&&({checkedKeys:c,halfCheckedKeys:l}=iA(c,!0,r.value,i.value,a.value)),o.value=Array.from(new Set([...u,...c])),s.value=l}),[o,s]}),BJ=((e,t,n)=>{let{treeNodeFilterProp:r,filterTreeNode:i,fieldNames:a}=n;return J(()=>{let{children:n}=a.value,o=t.value,s=r?.value;if(!o||i.value===!1)return e.value;let c;if(typeof i.value==`function`)c=i.value;else{let e=o.toUpperCase();c=(t,n)=>{let r=n[s];return String(r).toUpperCase().includes(e)}}function l(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=[];for(let i=0,a=e.length;ie.treeCheckable&&!e.treeCheckStrictly),s=J(()=>e.treeCheckable||e.treeCheckStrictly),c=J(()=>e.treeCheckStrictly||e.labelInValue),l=J(()=>s.value||e.multiple),u=J(()=>gJ(e.fieldNames)),[d,f]=df(``,{value:J(()=>e.searchValue===void 0?e.inputValue:e.searchValue),postState:e=>e||``}),p=t=>{var n;f(t),(n=e.onSearch)==null||n.call(e,t)},m=IJ(St(e,`treeData`),St(e,`children`),St(e,`treeDataSimpleMode`)),{keyEntities:h,valueEntities:g}=RJ(m,u),_=e=>{let t=[],n=[];return e.forEach(e=>{g.value.has(e)?n.push(e):t.push(e)}),{missingRawValues:t,existRawValues:n}},v=BJ(m,d,{fieldNames:u,treeNodeFilterProp:St(e,`treeNodeFilterProp`),filterTreeNode:St(e,`filterTreeNode`)}),y=t=>{if(t){if(e.treeNodeLabelProp)return t[e.treeNodeLabelProp];let{_title:n}=u.value;for(let e=0;ehJ(e).map(e=>HJ(e)?{value:e}:e),x=e=>b(e).map(e=>{let{label:t}=e,{value:n,halfChecked:r}=e,i,a=g.value.get(n);return a&&(t??=y(a.node),i=a.node.disabled),{label:t,value:n,halfChecked:r,disabled:i}}),[C,w]=df(e.defaultValue,{value:St(e,`value`)}),T=J(()=>b(C.value)),E=q([]),D=q([]);S(()=>{let e=[],t=[];T.value.forEach(n=>{n.halfChecked?t.push(n):e.push(n)}),E.value=e,D.value=t});let O=J(()=>E.value.map(e=>e.value)),{maxLevel:k,levelEntities:A}=hA(h),[j,M]=zJ(E,D,o,h,k,A),[N]=LJ(J(()=>{let t=OJ(j.value,e.showCheckedStrategy,h.value,u.value).map(e=>h.value[e]?.node?.[u.value.value]??e).map(e=>({value:e,label:E.value.find(t=>t.value===e)?.label})),n=x(t),r=n[0];return!l.value&&r&&yJ(r.value)&&yJ(r.label)?[]:n.map(e=>Z(Z({},e),{label:e.label??e.value}))})),P=(t,n,r)=>{let i=x(t);if(w(i),e.autoClearSearchValue&&f(``),e.onChange){let i=t;o.value&&(i=OJ(t,e.showCheckedStrategy,h.value,u.value).map(e=>{let t=g.value.get(e);return t?t.node[u.value.value]:e}));let{triggerValue:a,selected:d}=n||{triggerValue:void 0,selected:void 0},f=i;if(e.treeCheckStrictly){let e=D.value.filter(e=>!i.includes(e.value));f=[...f,...e]}let p=x(f),_={preValue:E.value,triggerValue:a},v=!0;(e.treeCheckStrictly||r===`selection`&&!d)&&(v=!1),PJ(_,a,t,m.value,v,u.value),s.value?_.checked=d:_.selected=d;let y=c.value?p:p.map(e=>e.value);e.onChange(l.value?y:y[0],c.value?null:p.map(e=>e.label),_)}},F=(t,n)=>{let{selected:r,source:i}=n;var a,s;let c=Ht(h.value),d=Ht(g.value),f=c[t]?.node,p=f?.[u.value.value]??t;if(!l.value)P([p],{selected:!0,triggerValue:p},`option`);else{let e=r?[...O.value,p]:j.value.filter(e=>e!==p);if(o.value){let{missingRawValues:t,existRawValues:n}=_(e),i=n.map(e=>d.get(e).key),a;r?{checkedKeys:a}=iA(i,!0,c,k.value,A.value):{checkedKeys:a}=iA(i,{checked:!1,halfCheckedKeys:M.value},c,k.value,A.value),e=[...t,...a.map(e=>c[e].node[u.value.value])]}P(e,{selected:r,triggerValue:p},i||`option`)}r||!l.value?(a=e.onSelect)==null||a.call(e,p,NJ(f)):(s=e.onDeselect)==null||s.call(e,p,NJ(f))},I=t=>{if(e.onDropdownVisibleChange){let n={};Object.defineProperty(n,"documentClickClose",{get(){return!1}}),e.onDropdownVisibleChange(t,n)}},L=(e,t)=>{let n=e.map(e=>e.value);if(t.type===`clear`){P(n,{},`selection`);return}t.values.length&&F(t.values[0].value,{selected:!1,source:`selection`})},{treeNodeFilterProp:ee,loadData:te,treeLoadedKeys:ne,onTreeLoad:R,treeDefaultExpandAll:re,treeExpandedKeys:ie,treeDefaultExpandedKeys:ae,onTreeExpand:oe,virtual:z,listHeight:se,listItemHeight:B,treeLine:V,treeIcon:ce,showTreeIcon:le,switcherIcon:ue,treeMotion:de,customSlots:fe,dropdownMatchSelectWidth:pe,treeExpandAction:me}=Ft(e);nd(yd({checkable:s,loadData:te,treeLoadedKeys:ne,onTreeLoad:R,checkedKeys:j,halfCheckedKeys:M,treeDefaultExpandAll:re,treeExpandedKeys:ie,treeDefaultExpandedKeys:ae,onTreeExpand:oe,treeIcon:ce,treeMotion:de,showTreeIcon:le,switcherIcon:ue,treeLine:V,treeNodeFilterProp:ee,keyEntities:h,customSlots:fe})),xJ(yd({virtual:z,listHeight:se,listItemHeight:B,treeData:v,fieldNames:u,onSelect:F,dropdownMatchSelectWidth:pe,treeExpandAction:me}));let he=H();return r({focus(){var e;(e=he.value)==null||e.focus()},blur(){var e;(e=he.value)==null||e.blur()},scrollTo(e){var t;(t=he.value)==null||t.scrollTo(e)}}),()=>{let t=Br(e,`id.prefixCls.customSlots.value.defaultValue.onChange.onSelect.onDeselect.searchValue.inputValue.onSearch.autoClearSearchValue.filterTreeNode.treeNodeFilterProp.showCheckedStrategy.treeNodeLabelProp.multiple.treeCheckable.treeCheckStrictly.labelInValue.fieldNames.treeDataSimpleMode.treeData.children.loadData.treeLoadedKeys.onTreeLoad.treeDefaultExpandAll.treeExpandedKeys.treeDefaultExpandedKeys.onTreeExpand.virtual.listHeight.listItemHeight.onDropdownVisibleChange.treeLine.treeIcon.showTreeIcon.switcherIcon.treeMotion`.split(`.`));return U(Ed,Y(Y(Y({ref:he},n),t),{},{id:a,prefixCls:e.prefixCls,mode:l.value?`multiple`:void 0,displayValues:N.value,onDisplayValuesChange:L,searchValue:d.value,onSearch:p,OptionList:wJ,emptyOptions:!m.value.length,onDropdownVisibleChange:I,tagRender:e.tagRender||i.tagRender,dropdownMatchSelectWidth:e.dropdownMatchSelectWidth??!0}),i)}}}),WJ=e=>{let{componentCls:t,treePrefixCls:n,colorBgElevated:r}=e,i=`.${n}`;return[{[`${t}-dropdown`]:[{padding:`${e.paddingXS}px ${e.paddingXS/2}px`},NK(n,B(e,{colorBgContainer:r})),{[i]:{borderRadius:0,"&-list-holder-inner":{alignItems:`stretch`,[`${i}-treenode`]:{[`${i}-node-content-wrapper`]:{flex:`auto`}}}}},tN(`${n}-checkbox`,e),{"&-rtl":{direction:`rtl`,[`${i}-switcher${i}-switcher_close`]:{[`${i}-switcher-icon svg`]:{transform:`rotate(90deg)`}}}}]}]};function GJ(e,t){return v(`TreeSelect`,e=>[WJ(B(e,{treePrefixCls:t.value}))])(e)}var KJ=(e,t,n)=>n===void 0?`${e}-${t}`:n;function qJ(){return Z(Z({},Br(VJ(),[`showTreeIcon`,`treeMotion`,`inputIcon`,`getInputElement`,`treeLine`,`customSlots`])),{suffixIcon:f.any,size:_(),bordered:Q(),treeLine:W([Boolean,Object]),replaceFields:Qt(),placement:_(),status:_(),popupClassName:String,dropdownClassName:String,"onUpdate:value":d(),"onUpdate:treeExpandedKeys":d(),"onUpdate:searchValue":d()})}var JJ=u({compatConfig:{MODE:3},name:`ATreeSelect`,inheritAttrs:!1,props:Zn(qJ(),{choiceTransitionName:``,listHeight:256,treeIcon:!1,listItemHeight:26,bordered:!0}),slots:Object,setup(e,t){let{attrs:n,slots:r,expose:i,emit:a}=t;e.treeData===void 0&&r.default,pi(e.multiple!==!1||!e.treeCheckable,`TreeSelect`,"`multiple` will always be `true` when `treeCheckable` is true"),pi(e.replaceFields===void 0,`TreeSelect`,"`replaceFields` is deprecated, please use fieldNames instead"),pi(!e.dropdownClassName,`TreeSelect`,"`dropdownClassName` is deprecated. Please use `popupClassName` instead.");let o=zf(),s=Vf.useInject(),c=J(()=>Wf(s.status,e.status)),{prefixCls:l,renderEmpty:u,direction:d,virtual:f,dropdownMatchSelectWidth:p,size:m,getPopupContainer:h,getPrefixCls:g,disabled:_}=X(`select`,e),{compactSize:v,compactItemClassnames:y}=u_(l,d),b=J(()=>v.value||m.value),x=at(),S=J(()=>_.value??x.value),C=J(()=>g()),w=J(()=>e.placement===void 0?d.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement),T=J(()=>KJ(C.value,me(w.value),e.transitionName)),E=J(()=>KJ(C.value,``,e.choiceTransitionName)),D=J(()=>g(`select-tree`,e.prefixCls)),O=J(()=>g(`tree-select`,e.prefixCls)),[k,A]=gv(l),[j]=GJ(O,D),M=J(()=>K(e.popupClassName||e.dropdownClassName,`${O.value}-dropdown`,{[`${O.value}-dropdown-rtl`]:d.value===`rtl`},A.value)),N=J(()=>!!(e.treeCheckable||e.multiple)),P=J(()=>e.showArrow===void 0?e.loading||!N.value:e.showArrow),F=H();i({focus(){var e,t;(t=(e=F.value).focus)==null||t.call(e)},blur(){var e,t;(t=(e=F.value).blur)==null||t.call(e)}});let I=function(){var e=[...arguments];a(`update:value`,e[0]),a(`change`,...e),o.onFieldChange()},L=e=>{a(`update:treeExpandedKeys`,e),a(`treeExpand`,e)},ee=e=>{a(`update:searchValue`,e),a(`search`,e)},te=e=>{a(`blur`,e),o.onFieldBlur()};return()=>{let{notFoundContent:t=r.notFoundContent?.call(r),prefixCls:i,bordered:a,listHeight:m,listItemHeight:g,multiple:_,treeIcon:v,treeLine:x,showArrow:C,switcherIcon:ne=r.switcherIcon?.call(r),fieldNames:R=e.replaceFields,id:re=o.id.value,placeholder:ie=r.placeholder?.call(r)}=e,{isFormItemInput:ae,hasFeedback:oe,feedbackIcon:z}=s,{suffixIcon:se,removeIcon:B,clearIcon:V}=Mf(Z(Z({},e),{multiple:N.value,showArrow:P.value,hasFeedback:oe,feedbackIcon:z,prefixCls:l.value}),r),le;le=t===void 0?u(`Select`):t;let H=Br(e,[`suffixIcon`,`itemIcon`,`removeIcon`,`clearIcon`,`switcherIcon`,`bordered`,`status`,`onUpdate:value`,`onUpdate:treeExpandedKeys`,`onUpdate:searchValue`]),ue=K(!i&&O.value,{[`${l.value}-lg`]:b.value===`large`,[`${l.value}-sm`]:b.value===`small`,[`${l.value}-rtl`]:d.value===`rtl`,[`${l.value}-borderless`]:!a,[`${l.value}-in-form-item`]:ae},Uf(l.value,c.value,oe),y.value,n.class,A.value),de={};return e.treeData===void 0&&r.default&&(de.children=ce(r.default())),k(j(U(UJ,Y(Y(Y(Y({},n),H),{},{disabled:S.value,virtual:f.value,dropdownMatchSelectWidth:p.value,id:re,fieldNames:R,ref:F,prefixCls:l.value,class:ue,listHeight:m,listItemHeight:g,treeLine:!!x,inputIcon:se,multiple:_,removeIcon:B,clearIcon:V,switcherIcon:e=>EK(D.value,ne,e,r.leafIcon,x),showTreeIcon:v,notFoundContent:le,getPopupContainer:h?.value,treeMotion:null,dropdownClassName:M.value,choiceTransitionName:E.value,onChange:I,onBlur:te,onSearch:ee,onTreeExpand:L},de),{},{transitionName:T.value,customSlots:Z(Z({},r),{treeCheckable:()=>U(`span`,{class:`${l.value}-tree-checkbox-inner`},null)}),maxTagPlaceholder:e.maxTagPlaceholder||r.maxTagPlaceholder,placement:w.value,showArrow:oe||C,placeholder:ie}),Z(Z({},r),{treeCheckable:()=>U(`span`,{class:`${l.value}-tree-checkbox-inner`},null)}))))}}}),YJ=kJ,XJ=Z(JJ,{TreeNode:kJ,SHOW_ALL:TJ,SHOW_PARENT:EJ,SHOW_CHILD:DJ,install:e=>(e.component(JJ.name,JJ),e.component(YJ.displayName,YJ),e)}),ZJ=()=>({format:String,showNow:Q(),showHour:Q(),showMinute:Q(),showSecond:Q(),use12Hours:Q(),hourStep:Number,minuteStep:Number,secondStep:Number,hideDisabledOptions:Q(),popupClassName:String,status:_()});function QJ(e){let{TimePicker:t,RangePicker:n}=rP(e,Z(Z({},ZJ()),{order:{type:Boolean,default:!0}}));return{TimePicker:u({name:`ATimePicker`,inheritAttrs:!1,props:Z(Z(Z(Z({},UN()),WN()),ZJ()),{addon:{type:Function}}),slots:Object,setup(e,n){let{slots:r,expose:i,emit:a,attrs:o}=n,s=e,c=zf();pi(!(r.addon||s.addon),`TimePicker`,"`addon` is deprecated. Please use `v-slot:renderExtraFooter` instead.");let l=H();i({focus:()=>{var e;(e=l.value)==null||e.focus()},blur:()=>{var e;(e=l.value)==null||e.blur()}});let u=(e,t)=>{a(`update:value`,e),a(`change`,e,t),c.onFieldChange()},d=e=>{a(`update:open`,e),a(`openChange`,e)},f=e=>{a(`focus`,e)},p=e=>{a(`blur`,e),c.onFieldBlur()},m=e=>{a(`ok`,e)};return()=>{let{id:e=c.id.value}=s;return U(t,Y(Y(Y({},o),Br(s,[`onUpdate:value`,`onUpdate:open`])),{},{id:e,dropdownClassName:s.popupClassName,mode:void 0,ref:l,renderExtraFooter:s.addon||r.addon||s.renderExtraFooter||r.renderExtraFooter,onChange:u,onOpenChange:d,onFocus:f,onBlur:p,onOk:m}),r)}}}),TimeRangePicker:u({name:`ATimeRangePicker`,inheritAttrs:!1,props:Z(Z(Z(Z({},UN()),GN()),ZJ()),{order:{type:Boolean,default:!0}}),slots:Object,setup(e,t){let{slots:r,expose:i,emit:a,attrs:o}=t,s=e,c=H(),l=zf();i({focus:()=>{var e;(e=c.value)==null||e.focus()},blur:()=>{var e;(e=c.value)==null||e.blur()}});let u=(e,t)=>{a(`update:value`,e),a(`change`,e,t),l.onFieldChange()},d=e=>{a(`update:open`,e),a(`openChange`,e)},f=e=>{a(`focus`,e)},p=e=>{a(`blur`,e),l.onFieldBlur()},m=(e,t)=>{a(`panelChange`,e,t)},h=e=>{a(`ok`,e)},g=(e,t,n)=>{a(`calendarChange`,e,t,n)};return()=>{let{id:e=l.id.value}=s;return U(n,Y(Y(Y({},o),Br(s,[`onUpdate:open`,`onUpdate:value`])),{},{id:e,dropdownClassName:s.popupClassName,picker:`time`,mode:void 0,ref:c,onChange:u,onOpenChange:d,onFocus:f,onBlur:p,onPanelChange:m,onOk:h,onCalendarChange:g}),r)}}})}}var{TimePicker:$J,TimeRangePicker:eY}=QJ(nC),tY=Z($J,{TimePicker:$J,TimeRangePicker:eY,install:e=>(e.component($J.name,$J),e.component(eY.name,eY),e)}),nY=u({compatConfig:{MODE:3},name:`ATimelineItem`,props:Zn({prefixCls:String,color:String,dot:f.any,pending:Q(),position:f.oneOf(m(`left`,`right`,``)).def(``),label:f.any},{color:`blue`,pending:!1}),slots:Object,setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`timeline`,e),i=J(()=>({[`${r.value}-item`]:!0,[`${r.value}-item-pending`]:e.pending})),a=J(()=>/blue|red|green|gray/.test(e.color||``)?void 0:e.color||`blue`),o=J(()=>({[`${r.value}-item-head`]:!0,[`${r.value}-item-head-${e.color||`blue`}`]:!a.value}));return()=>{let{label:t=n.label?.call(n),dot:s=n.dot?.call(n)}=e;return U(`li`,{class:i.value},[t&&U(`div`,{class:`${r.value}-item-label`},[t]),U(`div`,{class:`${r.value}-item-tail`},null),U(`div`,{class:[o.value,!!s&&`${r.value}-item-head-custom`],style:{borderColor:a.value,color:a.value}},[s]),U(`div`,{class:`${r.value}-item-content`},[n.default?.call(n)])])}}}),rY=e=>{let{componentCls:t}=e;return{[t]:Z(Z({},rn(e)),{margin:0,padding:0,listStyle:`none`,[`${t}-item`]:{position:`relative`,margin:0,paddingBottom:e.timeLineItemPaddingBottom,fontSize:e.fontSize,listStyle:`none`,"&-tail":{position:`absolute`,insetBlockStart:e.timeLineItemHeadSize,insetInlineStart:(e.timeLineItemHeadSize-e.timeLineItemTailWidth)/2,height:`calc(100% - ${e.timeLineItemHeadSize}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px ${e.lineType} ${e.colorSplit}`},"&-pending":{[`${t}-item-head`]:{fontSize:e.fontSizeSM,backgroundColor:`transparent`},[`${t}-item-tail`]:{display:`none`}},"&-head":{position:`absolute`,width:e.timeLineItemHeadSize,height:e.timeLineItemHeadSize,backgroundColor:e.colorBgContainer,border:`${e.timeLineHeadBorderWidth}px ${e.lineType} transparent`,borderRadius:`50%`,"&-blue":{color:e.colorPrimary,borderColor:e.colorPrimary},"&-red":{color:e.colorError,borderColor:e.colorError},"&-green":{color:e.colorSuccess,borderColor:e.colorSuccess},"&-gray":{color:e.colorTextDisabled,borderColor:e.colorTextDisabled}},"&-head-custom":{position:`absolute`,insetBlockStart:e.timeLineItemHeadSize/2,insetInlineStart:e.timeLineItemHeadSize/2,width:`auto`,height:`auto`,marginBlockStart:0,paddingBlock:e.timeLineItemCustomHeadPaddingVertical,lineHeight:1,textAlign:`center`,border:0,borderRadius:0,transform:`translate(-50%, -50%)`},"&-content":{position:`relative`,insetBlockStart:-(e.fontSize*e.lineHeight-e.fontSize)+e.lineWidth,marginInlineStart:e.margin+e.timeLineItemHeadSize,marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:`break-word`},"&-last":{[`> ${t}-item-tail`]:{display:`none`},[`> ${t}-item-content`]:{minHeight:e.controlHeightLG*1.2}}},[`&${t}-alternate, + &${t}-right, + &${t}-label`]:{[`${t}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:`50%`},"&-head":{marginInlineStart:`-${e.marginXXS}px`,"&-custom":{marginInlineStart:e.timeLineItemTailWidth/2}},"&-left":{[`${t}-item-content`]:{insetInlineStart:`calc(50% - ${e.marginXXS}px)`,width:`calc(50% - ${e.marginSM}px)`,textAlign:`start`}},"&-right":{[`${t}-item-content`]:{width:`calc(50% - ${e.marginSM}px)`,margin:0,textAlign:`end`}}}},[`&${t}-right`]:{[`${t}-item-right`]:{[`${t}-item-tail, + ${t}-item-head, + ${t}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(e.timeLineItemHeadSize+e.timeLineItemTailWidth)/2}px)`},[`${t}-item-content`]:{width:`calc(100% - ${e.timeLineItemHeadSize+e.marginXS}px)`}}},[`&${t}-pending + ${t}-item-last + ${t}-item-tail`]:{display:`block`,height:`calc(100% - ${e.margin}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px dotted ${e.colorSplit}`},[`&${t}-reverse + ${t}-item-last + ${t}-item-tail`]:{display:`none`},[`&${t}-reverse ${t}-item-pending`]:{[`${t}-item-tail`]:{insetBlockStart:e.margin,display:`block`,height:`calc(100% - ${e.margin}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px dotted ${e.colorSplit}`},[`${t}-item-content`]:{minHeight:e.controlHeightLG*1.2}},[`&${t}-label`]:{[`${t}-item-label`]:{position:`absolute`,insetBlockStart:-(e.fontSize*e.lineHeight-e.fontSize)+e.timeLineItemTailWidth,width:`calc(50% - ${e.marginSM}px)`,textAlign:`end`},[`${t}-item-right`]:{[`${t}-item-label`]:{insetInlineStart:`calc(50% + ${e.marginSM}px)`,width:`calc(50% - ${e.marginSM}px)`,textAlign:`start`}}},"&-rtl":{direction:`rtl`,[`${t}-item-head-custom`]:{transform:`translate(50%, -50%)`}}})}},iY=v(`Timeline`,e=>[rY(B(e,{timeLineItemPaddingBottom:e.padding*1.25,timeLineItemHeadSize:10,timeLineItemCustomHeadPaddingVertical:e.paddingXXS,timeLinePaddingInlineEnd:2,timeLineItemTailWidth:e.lineWidthBold,timeLineHeadBorderWidth:e.wireframe?e.lineWidthBold:e.lineWidth*3}))]),aY=u({compatConfig:{MODE:3},name:`ATimeline`,inheritAttrs:!1,props:Zn({prefixCls:String,pending:f.any,pendingDot:f.any,reverse:Q(),mode:f.oneOf(m(`left`,`alternate`,`right`,``))},{reverse:!1,mode:``}),slots:Object,setup(e,t){let{slots:n,attrs:r}=t,{prefixCls:i,direction:a}=X(`timeline`,e),[o,s]=iY(i),c=(t,n)=>{let r=t.props||{};return e.mode===`alternate`?r.position===`right`?`${i.value}-item-right`:r.position===`left`||n%2==0?`${i.value}-item-left`:`${i.value}-item-right`:e.mode===`left`?`${i.value}-item-left`:e.mode===`right`||r.position===`right`?`${i.value}-item-right`:``};return()=>{let{pending:t=n.pending?.call(n),pendingDot:l=n.pendingDot?.call(n),reverse:u,mode:d}=e,f=typeof t==`boolean`?null:t,p=dt(n.default?.call(n)),m=t?U(nY,{pending:!!t,dot:l||U(qt,null,null)},{default:()=>[f]}):null;m&&p.push(m);let h=u?p.reverse():p,g=h.length,_=`${i.value}-item-last`,v=h.map((e,n)=>{let r=n===g-2?_:``,i=n===g-1?_:``;return it(e,{class:K([!u&&t?r:i,c(e,n)])})}),y=h.some(e=>!!(e.props?.label||e.children?.label)),b=K(i.value,{[`${i.value}-pending`]:!!t,[`${i.value}-reverse`]:!!u,[`${i.value}-${d}`]:!!d&&!y,[`${i.value}-label`]:y,[`${i.value}-rtl`]:a.value===`rtl`},r.class,s.value);return o(U(`ul`,Y(Y({},r),{},{class:b}),[v]))}}});aY.Item=nY,aY.install=function(e){return e.component(aY.name,aY),e.component(nY.name,nY),e};var oY=aY,sY={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z`}}]},name:`enter`,theme:`outlined`};function cY(e){for(var t=1;t{let{sizeMarginHeadingVerticalEnd:i,fontWeightStrong:a}=r;return{marginBottom:i,color:n,fontWeight:a,fontSize:e,lineHeight:t}},fY=e=>{let t=[1,2,3,4,5],n={};return t.forEach(t=>{n[` + h${t}&, + div&-h${t}, + div&-h${t} > textarea, + h${t} + `]=dY(e[`fontSizeHeading${t}`],e[`lineHeightHeading${t}`],e.colorTextHeading,e)}),n},pY=e=>{let{componentCls:t}=e;return{"a&, a":Z(Z({},Lr(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,"&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:`none`}}})}},mY=()=>({code:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.2em 0.1em`,fontSize:`85%`,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3},kbd:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.15em 0.1em`,fontSize:`90%`,background:`rgba(150, 150, 150, 0.06)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:w[2]},"u, ins":{textDecoration:`underline`,textDecorationSkipInk:`auto`},"s, del":{textDecoration:`line-through`},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:`0 1em`,padding:0,li:{marginInline:`20px 0`,marginBlock:0,paddingInline:`4px 0`,paddingBlock:0}},ul:{listStyleType:`circle`,ul:{listStyleType:`disc`}},ol:{listStyleType:`decimal`},"pre, blockquote":{margin:`1em 0`},pre:{padding:`0.4em 0.6em`,whiteSpace:`pre-wrap`,wordWrap:`break-word`,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3,code:{display:`inline`,margin:0,padding:0,fontSize:`inherit`,fontFamily:`inherit`,background:`transparent`,border:0}},blockquote:{paddingInline:`0.6em 0`,paddingBlock:0,borderInlineStart:`4px solid rgba(100, 100, 100, 0.2)`,opacity:.85}}),hY=e=>{let{componentCls:t}=e,n=qT(e).inputPaddingVertical+1;return{"&-edit-content":{position:`relative`,"div&":{insetInlineStart:-e.paddingSM,marginTop:-n,marginBottom:`calc(1em - ${n}px)`},[`${t}-edit-content-confirm`]:{position:`absolute`,insetInlineEnd:e.marginXS+2,insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:`normal`,fontSize:e.fontSize,fontStyle:`normal`,pointerEvents:`none`},textarea:{margin:`0!important`,MozTransition:`none`,height:`1em`}}}},gY=e=>({"&-copy-success":{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}}}),_Y=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:`inline-block`,maxWidth:`100%`},"&-single-line":{whiteSpace:`nowrap`},"&-ellipsis-single-line":{overflow:`hidden`,textOverflow:`ellipsis`,"a&, span&":{verticalAlign:`bottom`}},"&-ellipsis-multiple-line":{display:`-webkit-box`,overflow:`hidden`,WebkitLineClamp:3,WebkitBoxOrient:`vertical`}}),vY=e=>{let{componentCls:t,sizeMarginHeadingVerticalStart:n}=e;return{[t]:Z(Z(Z(Z(Z(Z(Z(Z(Z({color:e.colorText,wordBreak:`break-word`,lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccess},[`&${t}-warning`]:{color:e.colorWarning},[`&${t}-danger`]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,userSelect:`none`},"\n div&,\n p\n ":{marginBottom:`1em`}},fY(e)),{[` + & + h1${t}, + & + h2${t}, + & + h3${t}, + & + h4${t}, + & + h5${t} + `]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),mY()),pY(e)),{[` + ${t}-expand, + ${t}-edit, + ${t}-copy + `]:Z(Z({},Lr(e)),{marginInlineStart:e.marginXXS})}),hY(e)),gY(e)),_Y()),{"&-rtl":{direction:`rtl`}})}},yY=v(`Typography`,e=>[vY(e)],{sizeMarginHeadingVerticalStart:`1.2em`,sizeMarginHeadingVerticalEnd:`0.5em`}),bY=u({compatConfig:{MODE:3},name:`Editable`,inheritAttrs:!1,props:{prefixCls:String,value:String,maxlength:Number,autoSize:{type:[Boolean,Object]},onSave:Function,onCancel:Function,onEnd:Function,onChange:Function,originContent:String,direction:String,component:String},setup(e,t){let{emit:n,slots:r,attrs:i}=t,{prefixCls:a}=Ft(e),o=Ne({current:e.value||``,lastKeyCode:void 0,inComposition:!1,cancelFlag:!1});G(()=>e.value,e=>{o.current=e});let s=H();V(()=>{if(s.value){let e=s.value?.resizableTextArea?.textArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}});function c(e){s.value=e}function l(e){let{target:{value:t}}=e;o.current=t.replace(/[\r\n]/g,``),n(`change`,o.current)}function u(){o.inComposition=!0}function d(){o.inComposition=!1}function f(e){let{keyCode:t}=e;t===$.ENTER&&e.preventDefault(),!o.inComposition&&(o.lastKeyCode=t)}function p(t){let{keyCode:r,ctrlKey:i,altKey:a,metaKey:s,shiftKey:c}=t;o.lastKeyCode===r&&!o.inComposition&&!i&&!a&&!s&&!c&&(r===$.ENTER?(h(),n(`end`)):r===$.ESC&&(o.current=e.originContent,n(`cancel`)))}function m(){h()}function h(){n(`save`,o.current.trim())}let[g,_]=yY(a);return()=>{let t=K({[`${a.value}`]:!0,[`${a.value}-edit-content`]:!0,[`${a.value}-rtl`]:e.direction===`rtl`,[e.component?`${a.value}-${e.component}`:``]:!0},i.class,_.value);return g(U(`div`,Y(Y({},i),{},{class:t}),[U(nI,{ref:c,maxlength:e.maxlength,value:o.current,onChange:l,onKeydown:f,onKeyup:p,onCompositionstart:u,onCompositionend:d,onBlur:m,rows:1,autoSize:e.autoSize===void 0||e.autoSize},null),r.enterIcon?r.enterIcon({className:`${e.prefixCls}-edit-content-confirm`}):U(uY,{class:`${e.prefixCls}-edit-content-confirm`},null)]))}}}),xY=3,SY=8,CY,wY={padding:0,margin:0,display:`inline`,lineHeight:`inherit`};function TY(e,t){e.setAttribute(`aria-hidden`,`true`);let n=ju(window.getComputedStyle(t));e.setAttribute(`style`,n),e.style.position=`fixed`,e.style.left=`0`,e.style.height=`auto`,e.style.minHeight=`auto`,e.style.maxHeight=`auto`,e.style.paddingTop=`0`,e.style.paddingBottom=`0`,e.style.borderTopWidth=`0`,e.style.borderBottomWidth=`0`,e.style.top=`-999999px`,e.style.zIndex=`-1000`,e.style.textOverflow=`clip`,e.style.whiteSpace=`normal`,e.style.webkitLineClamp=`none`}function EY(e){let t=document.createElement(`div`);TY(t,e),t.appendChild(document.createTextNode(`text`)),document.body.appendChild(t);let n=t.getBoundingClientRect().height;return document.body.removeChild(t),n}var DY=((e,t,n,r,i)=>{CY||(CY=document.createElement(`div`),CY.setAttribute(`aria-hidden`,`true`),document.body.appendChild(CY));let{rows:a,suffix:o=``}=t,s=EY(e),c=Math.round(s*a*100)/100;TY(CY,e);let l=Rt({render(){return U(`div`,{style:wY},[U(`span`,{style:wY},[n,o]),U(`span`,{style:wY},[r])])}});l.mount(CY);function u(){return Math.round(CY.getBoundingClientRect().height*100)/100-.1<=c}if(u())return l.unmount(),{content:n,text:CY.innerHTML,ellipsis:!1};let d=Array.prototype.slice.apply(CY.childNodes[0].childNodes[0].cloneNode(!0).childNodes).filter(e=>{let{nodeType:t,data:n}=e;return t!==SY&&n!==``}),f=Array.prototype.slice.apply(CY.childNodes[0].childNodes[1].cloneNode(!0).childNodes);l.unmount();let p=[];CY.innerHTML=``;let m=document.createElement(`span`);CY.appendChild(m);let h=document.createTextNode(i+o);m.appendChild(h),f.forEach(e=>{CY.appendChild(e)});function g(e){m.insertBefore(e,h)}function _(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.length,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=Math.floor((n+r)/2);if(e.textContent=t.slice(0,a),n>=r-1)for(let i=r;i>=n;--i){let n=t.slice(0,i);if(e.textContent=n,u()||!n)return i===t.length?{finished:!1,vNode:t}:{finished:!0,vNode:n}}return u()?_(e,t,a,r,a):_(e,t,n,a,i)}function v(e){if(e.nodeType===xY){let t=e.textContent||``,n=document.createTextNode(t);return g(n),_(n,t)}return{finished:!1,vNode:null}}return d.some(e=>{let{finished:t,vNode:n}=v(e);return n&&p.push(n),t}),{content:p,text:CY.innerHTML,ellipsis:!0}}),OY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let t=Z(Z({},e),r),{prefixCls:c,direction:l,component:u=`article`}=t,d=OY(t,[`prefixCls`,`direction`,`component`]);return o(U(u,Y(Y({},d),{},{class:K(i.value,{[`${i.value}-rtl`]:a.value===`rtl`},r.class,s.value)}),{default:()=>[n.default?.call(n)]}))}}}),AY=()=>{let e=document.getSelection();if(!e.rangeCount)return function(){};let t=document.activeElement,n=[];for(let t=0;t({editable:{type:[Boolean,Object],default:void 0},copyable:{type:[Boolean,Object],default:void 0},prefixCls:String,component:String,type:String,disabled:{type:Boolean,default:void 0},ellipsis:{type:[Boolean,Object],default:void 0},code:{type:Boolean,default:void 0},mark:{type:Boolean,default:void 0},underline:{type:Boolean,default:void 0},delete:{type:Boolean,default:void 0},strong:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},content:String,"onUpdate:content":Function}),WY=u({compatConfig:{MODE:3},name:`TypographyBase`,inheritAttrs:!1,props:UY(),setup(t,n){let{slots:r,attrs:i,emit:a}=n,{prefixCls:o,direction:s}=X(`typography`,t),c=Ne({copied:!1,ellipsisText:``,ellipsisContent:null,isEllipsis:!1,expanded:!1,clientRendered:!1,expandStr:``,copyStr:``,copiedStr:``,editStr:``,copyId:void 0,rafId:void 0,prevProps:void 0,originContent:``}),l=H(),u=H(),d=J(()=>{let e=t.ellipsis;return e?Z({rows:1,expandable:!1},typeof e==`object`?e:null):{}});V(()=>{c.clientRendered=!0,E()}),ut(()=>{clearTimeout(c.copyId),ir.cancel(c.rafId)}),G([()=>d.value.rows,()=>t.content],()=>{z(()=>{w()})},{flush:`post`,deep:!0}),S(()=>{t.content===void 0&&(e(!t.editable,`Typography`,"When `editable` is enabled, please use `content` instead of children"),e(!t.ellipsis,`Typography`,"When `ellipsis` is enabled, please use `content` instead of children"))});function f(){return t.ellipsis||t.editable?t.content:ae(l.value)?.innerText}function p(e){let{onExpand:t}=d.value;c.expanded=!0,t?.(e)}function m(e){e.preventDefault(),c.originContent=t.content,C(!0)}function h(e){g(e),C(!1)}function g(e){let{onChange:n}=y.value;e!==t.content&&(a(`update:content`,e),n?.(e))}function _(){var e,t;(t=(e=y.value).onCancel)==null||t.call(e),C(!1)}function v(e){e.preventDefault(),e.stopPropagation();let{copyable:n}=t,r=Z({},typeof n==`object`?n:null);r.text===void 0&&(r.text=f()),PY(r.text||``),c.copied=!0,z(()=>{r.onCopy&&r.onCopy(e),c.copyId=setTimeout(()=>{c.copied=!1},3e3)})}let y=J(()=>{let e=t.editable;return e?Z({},typeof e==`object`?e:null):{editing:!1}}),[b,x]=df(!1,{value:J(()=>y.value.editing)});function C(e){let{onStart:t}=y.value;e&&t&&t(),x(e)}G(b,e=>{var t;e||(t=u.value)==null||t.focus()},{flush:`post`});function w(e){if(e){let{width:t,height:n}=e;if(!t||!n)return}ir.cancel(c.rafId),c.rafId=ir(()=>{E()})}let T=J(()=>{let{rows:e,expandable:n,suffix:r,onEllipsis:i,tooltip:a}=d.value;return r||a||t.editable||t.copyable||n||i?!1:e===1?VY:BY}),E=()=>{let{ellipsisText:e,isEllipsis:n}=c,{rows:r,suffix:i,onEllipsis:a}=d.value;if(!r||r<0||!ae(l.value)||c.expanded||t.content===void 0||T.value)return;let{content:o,text:s,ellipsis:u}=DY(ae(l.value),{rows:r,suffix:i},t.content,M(!0),HY);(e!==s||c.isEllipsis!==u)&&(c.ellipsisText=s,c.ellipsisContent=o,c.isEllipsis=u,n!==u&&a&&a(u))};function D(e,t){let{mark:n,code:r,underline:i,delete:a,strong:o,keyboard:s}=e,c=t;function l(e,t){if(!e)return;let n=function(){return c}();c=U(t,null,{default:()=>[n]})}return l(o,`strong`),l(i,`u`),l(a,`del`),l(r,`code`),l(n,`mark`),l(s,`kbd`),c}function O(e){let{expandable:t,symbol:n}=d.value;if(!t||!e&&(c.expanded||!c.isEllipsis))return null;let i=(r.ellipsisSymbol?r.ellipsisSymbol():n)||c.expandStr;return U(`a`,{key:`expand`,class:`${o.value}-expand`,onClick:p,"aria-label":c.expandStr},[i])}function k(){if(!t.editable)return;let{tooltip:e,triggerType:n=[`icon`]}=t.editable,i=r.editableIcon?r.editableIcon():U(ln,{role:`button`},null),a=r.editableTooltip?r.editableTooltip():c.editStr,s=typeof a==`string`?a:``;return n.indexOf(`icon`)===-1?null:U(Ty,{key:`edit`,title:e===!1?``:a},{default:()=>[U(JB,{ref:u,class:`${o.value}-edit`,onClick:m,"aria-label":s},{default:()=>[i]})]})}function A(){if(!t.copyable)return;let{tooltip:e}=t.copyable,n=c.copied?c.copiedStr:c.copyStr,i=r.copyableTooltip?r.copyableTooltip({copied:c.copied}):n,a=typeof i==`string`?i:``,s=c.copied?U(Df,null,null):U(RY,null,null),l=r.copyableIcon?r.copyableIcon({copied:!!c.copied}):s;return U(Ty,{key:`copy`,title:e===!1?``:i},{default:()=>[U(JB,{class:[`${o.value}-copy`,{[`${o.value}-copy-success`]:c.copied}],onClick:v,"aria-label":a},{default:()=>[l]})]})}function j(){let{class:e,style:n}=i,{maxlength:a,autoSize:l,onEnd:u}=y.value;return U(bY,{class:e,style:n,prefixCls:o.value,value:t.content,originContent:c.originContent,maxlength:a,autoSize:l,onSave:h,onChange:g,onCancel:_,onEnd:u,direction:s.value,component:t.component},{enterIcon:r.editableEnterIcon})}function M(e){return[O(e),k(),A()].filter(e=>e)}return()=>{let{triggerType:e=[`icon`]}=y.value,n=t.ellipsis||t.editable?t.content===void 0?r.default?.call(r):t.content:r.default?r.default():t.content;return b.value?j():U(Ke,{componentName:`Text`,children:a=>{let u=Z(Z({},t),i),{type:f,disabled:p,content:h,class:g,style:_}=u,v=zY(u,[`type`,`disabled`,`content`,`class`,`style`]),{rows:y,suffix:b,tooltip:x}=d.value,{edit:S,copy:C,copied:E,expand:O}=a;c.editStr=S,c.copyStr=C,c.copiedStr=E,c.expandStr=O;let k=Br(v,[`prefixCls`,`editable`,`copyable`,`ellipsis`,`mark`,`code`,`delete`,`underline`,`strong`,`keyboard`,`onUpdate:content`]),A=T.value,j=y===1&&A,N=y&&y>1&&A,P=n;if(y&&c.isEllipsis&&!c.expanded&&!A){let{title:e}=v,t=e||``;!e&&(typeof n==`string`||typeof n==`number`)&&(t=String(n)),t=t?.slice(String(c.ellipsisContent||``).length),P=U($e,null,[Ht(c.ellipsisContent),U(`span`,{title:t,"aria-hidden":`true`},[HY]),b])}else P=U($e,null,[n,b]);P=D(t,P);let F=x&&y&&c.isEllipsis&&!c.expanded&&!A,I=r.ellipsisTooltip?r.ellipsisTooltip():x;return U(Qn,{onResize:w,disabled:!y},{default:()=>[U(kY,Y({ref:l,class:[{[`${o.value}-${f}`]:f,[`${o.value}-disabled`]:p,[`${o.value}-ellipsis`]:y,[`${o.value}-single-line`]:y===1&&!c.isEllipsis,[`${o.value}-ellipsis-single-line`]:j,[`${o.value}-ellipsis-multiple-line`]:N},g],style:Z(Z({},_),{WebkitLineClamp:N?y:void 0}),"aria-label":void 0,direction:s.value,onClick:e.indexOf(`text`)===-1?()=>{}:m},k),{default:()=>[F?U(Ty,{title:x===!0?n:I},{default:()=>[U(`span`,null,[P])]}):P,M()]})]})}},null)}}}),GY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iBr(Z(Z({},UY()),{ellipsis:{type:Boolean,default:void 0}}),[`component`]),qY=(t,n)=>{let{slots:r,attrs:i}=n,a=Z(Z({},t),i),{ellipsis:o,rel:s}=a,c=GY(a,[`ellipsis`,`rel`]);e(typeof o!=`object`,`Typography.Link`,"`ellipsis` only supports boolean value.");let l=Z(Z({},c),{rel:s===void 0&&c.target===`_blank`?`noopener noreferrer`:s,ellipsis:!!o,component:`a`});return delete l.navigate,U(WY,l,r)};qY.displayName=`ATypographyLink`,qY.inheritAttrs=!1,qY.props=KY();var JY=()=>Br(UY(),[`component`]),YY=(e,t)=>{let{slots:n,attrs:r}=t;return U(WY,Z(Z(Z({},e),{component:`div`}),r),n)};YY.displayName=`ATypographyParagraph`,YY.inheritAttrs=!1,YY.props=JY();var XY=()=>Z(Z({},Br(UY(),[`component`])),{ellipsis:{type:[Boolean,Object],default:void 0}}),ZY=(t,n)=>{let{slots:r,attrs:i}=n,{ellipsis:a}=t;return e(typeof a!=`object`||!a||!(`expandable`in a)&&!(`rows`in a),`Typography.Text`,"`ellipsis` do not support `expandable` or `rows` props."),U(WY,Z(Z(Z({},t),{ellipsis:a&&typeof a==`object`?Br(a,[`expandable`,`rows`]):a,component:`span`}),i),r)};ZY.displayName=`ATypographyText`,ZY.inheritAttrs=!1,ZY.props=XY();var QY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iZ(Z({},Br(UY(),[`component`,`strong`])),{level:Number}),tX=(t,n)=>{let{slots:r,attrs:i}=n,{level:a=1}=t,o=QY(t,[`level`]),s;return $Y.includes(a)?s=`h${a}`:(e(!1,`Typography`,"Title only accept `1 | 2 | 3 | 4 | 5` as `level` value."),s=`h1`),U(WY,Z(Z(Z({},o),{component:s}),i),r)};tX.displayName=`ATypographyTitle`,tX.inheritAttrs=!1,tX.props=eX(),kY.Text=ZY,kY.Title=tX,kY.Paragraph=YY,kY.Link=qY,kY.Base=WY,kY.install=function(e){return e.component(kY.name,kY),e.component(kY.Text.displayName,ZY),e.component(kY.Title.displayName,tX),e.component(kY.Paragraph.displayName,YY),e.component(kY.Link.displayName,qY),e};var nX=kY;function rX(e,t){let n=`cannot ${e.method} ${e.action} ${t.status}'`,r=Error(n);return r.status=t.status,r.method=e.method,r.url=e.action,r}function iX(e){let t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function aX(e){let t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});let n=new FormData;e.data&&Object.keys(e.data).forEach(t=>{let r=e.data[t];if(Array.isArray(r)){r.forEach(e=>{n.append(`${t}[]`,e)});return}n.append(t,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(rX(e,t),iX(t)):e.onSuccess(iX(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&`withCredentials`in t&&(t.withCredentials=!0);let r=e.headers||{};return r[`X-Requested-With`]!==null&&t.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),Object.keys(r).forEach(e=>{r[e]!==null&&t.setRequestHeader(e,r[e])}),t.send(n),{abort(){t.abort()}}}var oX=+new Date,sX=0;function cX(){return`vc-upload-${oX}-${++sX}`}var lX=((e,t)=>{if(e&&t){let n=Array.isArray(t)?t:t.split(`,`),r=e.name||``,i=e.type||``,a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if(t.charAt(0)===`.`){let e=r.toLowerCase(),n=t.toLowerCase(),i=[n];return(n===`.jpg`||n===`.jpeg`)&&(i=[`.jpg`,`.jpeg`]),i.some(t=>e.endsWith(t))}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,``):i===t?!0:/^\w+$/.test(t)?(`${t}`,!0):!1})}return!0});function uX(e,t){let n=e.createReader(),r=[];function i(){n.readEntries(e=>{let n=Array.prototype.slice.apply(e);r=r.concat(n),n.length?i():t(r)})}i()}var dX=(e,t,n)=>{let r=(e,i)=>{e.path=i||``,e.isFile?e.file(r=>{n(r)&&(e.fullPath&&!r.webkitRelativePath&&(Object.defineProperties(r,{webkitRelativePath:{writable:!0}}),r.webkitRelativePath=e.fullPath.replace(/^\//,``),Object.defineProperties(r,{webkitRelativePath:{writable:!1}})),t([r]))}):e.isDirectory&&uX(e,t=>{t.forEach(t=>{r(t,`${i}${e.name}/`)})})};e.forEach(e=>{r(e.webkitGetAsEntry())})},fX=()=>({capture:[Boolean,String],multipart:{type:Boolean,default:void 0},name:String,disabled:{type:Boolean,default:void 0},componentTag:String,action:[String,Function],method:String,directory:{type:Boolean,default:void 0},data:[Object,Function],headers:Object,accept:String,multiple:{type:Boolean,default:void 0},onBatchStart:Function,onReject:Function,onStart:Function,onError:Function,onSuccess:Function,onProgress:Function,beforeUpload:Function,customRequest:Function,withCredentials:{type:Boolean,default:void 0},openFileDialogOnClick:{type:Boolean,default:void 0},prefixCls:String,id:String,onMouseenter:Function,onMouseleave:Function,onClick:Function}),pX=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},mX=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ipX(this,void 0,void 0,function*(){let{beforeUpload:r}=e,i=t;if(r){try{i=yield r(t,n)}catch{i=!1}if(i===!1)return{origin:t,parsedFile:null,action:null,data:null}}let{action:a}=e,o;o=typeof a==`function`?yield a(t):a;let{data:s}=e,c;c=typeof s==`function`?yield s(t):s;let l=(typeof i==`object`||typeof i==`string`)&&i?i:t,u;u=l instanceof File?l:new File([l],t.name,{type:t.type});let d=u;return d.uid=t.uid,{origin:t,data:c,parsedFile:d,action:o}}),u=t=>{let{data:n,origin:r,action:i,parsedFile:a}=t;if(!c)return;let{onStart:s,customRequest:l,name:u,headers:d,withCredentials:f,method:p}=e,{uid:m}=r,h=l||aX,g={action:i,filename:u,data:n,file:a,headers:d,withCredentials:f,method:p||`post`,onProgress:t=>{let{onProgress:n}=e;n?.(t,a)},onSuccess:(t,n)=>{let{onSuccess:r}=e;r?.(t,a,n),delete o[m]},onError:(t,n)=>{let{onError:r}=e;r?.(t,n,a),delete o[m]}};s(r),o[m]=h(g)},d=()=>{a.value=cX()},f=e=>{if(e){let t=e.uid?e.uid:e;o[t]&&o[t].abort&&o[t].abort(),delete o[t]}else Object.keys(o).forEach(e=>{o[e]&&o[e].abort&&o[e].abort(),delete o[e]})};V(()=>{c=!0}),ut(()=>{c=!1,f()});let p=t=>{let n=[...t],r=n.map(e=>(e.uid=cX(),l(e,n)));Promise.all(r).then(t=>{let{onBatchStart:n}=e;n?.(t.map(e=>{let{origin:t,parsedFile:n}=e;return{file:t,parsedFile:n}})),t.filter(e=>e.parsedFile!==null).forEach(e=>{u(e)})})},m=t=>{let{accept:n,directory:r}=e,{files:i}=t.target,a=[...i].filter(e=>!r||lX(e,n));p(a),d()},h=t=>{let n=s.value;if(!n)return;let{onClick:r}=e;n.click(),r&&r(t)},g=e=>{e.key===`Enter`&&h(e)},_=t=>{let{multiple:n}=e;if(t.preventDefault(),t.type!==`dragover`)if(e.directory)dX(Array.prototype.slice.call(t.dataTransfer.items),p,t=>lX(t,e.accept));else{let r=t_(Array.prototype.slice.call(t.dataTransfer.files),t=>lX(t,e.accept)),i=r[0],a=r[1];n===!1&&(i=i.slice(0,1)),p(i),a.length&&e.onReject&&e.onReject(a)}};return i({abort:f}),()=>{let{componentTag:t,prefixCls:i,disabled:o,id:c,multiple:l,accept:u,capture:d,directory:f,openFileDialogOnClick:p,onMouseenter:v,onMouseleave:y}=e,b=mX(e,[`componentTag`,`prefixCls`,`disabled`,`id`,`multiple`,`accept`,`capture`,`directory`,`openFileDialogOnClick`,`onMouseenter`,`onMouseleave`]),x={[i]:!0,[`${i}-disabled`]:o,[r.class]:!!r.class},S=f?{directory:`directory`,webkitdirectory:`webkitdirectory`}:{};return U(t,Y(Y({},o?{}:{onClick:p?h:()=>{},onKeydown:p?g:()=>{},onMouseenter:v,onMouseleave:y,onDrop:_,onDragover:_,tabindex:`0`}),{},{class:x,role:`button`,style:r.style}),{default:()=>[U(`input`,Y(Y(Y({},Bu(b,{aria:!0,data:!0})),{},{id:c,type:`file`,ref:s,onClick:e=>e.stopPropagation(),onCancel:e=>e.stopPropagation(),key:a.value,style:{display:`none`},accept:u},S),{},{multiple:l,onChange:m},d==null?{}:{capture:d}),null),n.default?.call(n)]})}}});function gX(){}var _X=u({compatConfig:{MODE:3},name:`Upload`,inheritAttrs:!1,props:Zn(fX(),{componentTag:`span`,prefixCls:`rc-upload`,data:{},headers:{},name:`file`,multipart:!1,onStart:gX,onError:gX,onSuccess:gX,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0}),setup(e,t){let{slots:n,attrs:r,expose:i}=t,a=H();return i({abort:e=>{var t;(t=a.value)==null||t.abort(e)}}),()=>U(hX,Y(Y(Y({},e),r),{},{ref:a}),n)}}),vX={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z`}}]},name:`paper-clip`,theme:`outlined`};function yX(e){for(var t=1;t{let{uid:n}=t;return n===e.uid});return r===-1?n.push(e):n[r]=e,n}function PX(e,t){let n=e.uid===void 0?`name`:`uid`;return t.filter(t=>t[n]===e[n])[0]}function FX(e,t){let n=e.uid===void 0?`name`:`uid`,r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}var IX=function(){let e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:``).split(`/`),t=e[e.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(t)||[``])[0]},LX=e=>e.indexOf(`image/`)===0,RX=e=>{if(e.type&&!e.thumbUrl)return LX(e.type);let t=e.thumbUrl||e.url||``,n=IX(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(n)?!0:!(/^data:/.test(t)||n)},zX=200;function BX(e){return new Promise(t=>{if(!e.type||!LX(e.type)){t(``);return}let n=document.createElement(`canvas`);n.width=zX,n.height=zX,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${zX}px; height: ${zX}px; z-index: 9999; display: none;`,document.body.appendChild(n);let r=n.getContext(`2d`),i=new Image;if(i.onload=()=>{let{width:e,height:a}=i,o=zX,s=zX,c=0,l=0;e>a?(s=zX/e*a,l=-(s-o)/2):(o=zX/a*e,c=-(o-s)/2),r.drawImage(i,c,l,o,s);let u=n.toDataURL();document.body.removeChild(n),t(u)},i.crossOrigin=`anonymous`,e.type.startsWith(`image/svg+xml`)){let t=new FileReader;t.addEventListener(`load`,()=>{t.result&&(i.src=t.result)}),t.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var VX={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`download`,theme:`outlined`};function HX(e){for(var t=1;t{a.value=setTimeout(()=>{i.value=!0},300)}),ut(()=>{clearTimeout(a.value)});let o=q(e.file?.status);G(()=>e.file?.status,e=>{e!==`removed`&&(o.value=e)});let{rootPrefixCls:s}=X(`upload`,e),c=J(()=>ge(`${s.value}-fade`));return()=>{let{prefixCls:t,locale:a,listType:s,file:l,items:u,progress:d,iconRender:f=n.iconRender,actionIconRender:p=n.actionIconRender,itemRender:m=n.itemRender,isImgUrl:h,showPreviewIcon:g,showRemoveIcon:_,showDownloadIcon:v,previewIcon:y=n.previewIcon,removeIcon:b=n.removeIcon,downloadIcon:x=n.downloadIcon,onPreview:S,onDownload:C,onClose:w}=e,{class:T,style:E}=r,D=f({file:l}),O=U(`div`,{class:`${t}-text-icon`},[D]);if(s===`picture`||s===`picture-card`)if(o.value===`uploading`||!l.thumbUrl&&!l.url)O=U(`div`,{class:{[`${t}-list-item-thumbnail`]:!0,[`${t}-list-item-file`]:o.value!==`uploading`}},[D]);else{let e=h?.(l)?U(`img`,{src:l.thumbUrl||l.url,alt:l.name,class:`${t}-list-item-image`,crossorigin:l.crossOrigin},null):D;O=U(`a`,{class:{[`${t}-list-item-thumbnail`]:!0,[`${t}-list-item-file`]:h&&!h(l)},onClick:e=>S(l,e),href:l.url||l.thumbUrl,target:`_blank`,rel:`noopener noreferrer`},[e])}let k={[`${t}-list-item`]:!0,[`${t}-list-item-${o.value}`]:!0},A=typeof l.linkProps==`string`?JSON.parse(l.linkProps):l.linkProps,j=_?p({customIcon:b?b({file:l}):U(sn,null,null),callback:()=>w(l),prefixCls:t,title:a.removeFile}):null,M=v&&o.value===`done`?p({customIcon:x?x({file:l}):U(WX,null,null),callback:()=>C(l),prefixCls:t,title:a.downloadFile}):null,N=s!==`picture-card`&&U(`span`,{key:`download-delete`,class:[`${t}-list-item-actions`,{picture:s===`picture`}]},[M,j]),P=`${t}-list-item-name`,F=l.url?[U(`a`,Y(Y({key:`view`,target:`_blank`,rel:`noopener noreferrer`,class:P,title:l.name},A),{},{href:l.url,onClick:e=>S(l,e)}),[l.name]),N]:[U(`span`,{key:`view`,class:P,onClick:e=>S(l,e),title:l.name},[l.name]),N],I=g?U(`a`,{href:l.url||l.thumbUrl,target:`_blank`,rel:`noopener noreferrer`,style:l.url||l.thumbUrl?void 0:{pointerEvents:`none`,opacity:.5},onClick:e=>S(l,e),title:a.previewFile},[y?y({file:l}):U(oI,null,null)]):null,L=s===`picture-card`&&o.value!==`uploading`&&U(`span`,{class:`${t}-list-item-actions`},[I,o.value===`done`&&M,j]),ee=U(`div`,{class:k},[O,F,L,i.value&&U(Re,c.value,{default:()=>[Mt(U(`div`,{class:`${t}-list-item-progress`},[`percent`in l?U(zV,Y(Y({},d),{},{type:`line`,percent:l.percent}),null):null]),[[ht,o.value===`uploading`]])]})]),te={[`${t}-list-item-container`]:!0,[`${T}`]:!!T},ne=l.response&&typeof l.response==`string`?l.response:l.error?.statusText||l.error?.message||a.uploadError,R=o.value===`error`?U(Ty,{title:ne,getPopupContainer:e=>e.parentNode},{default:()=>[ee]}):ee;return U(`div`,{class:te,style:E},[m?m({originNode:R,file:l,fileList:u,actions:{download:C.bind(null,l),preview:S.bind(null,l),remove:w.bind(null,l)}}):R])}}}),KX=(e,t)=>{let{slots:n}=t;return dt(n.default?.call(n))[0]},qX=u({compatConfig:{MODE:3},name:`AUploadList`,props:Zn(jX(),{listType:`text`,progress:{strokeWidth:2,showInfo:!1},showRemoveIcon:!0,showDownloadIcon:!1,showPreviewIcon:!0,previewFile:BX,isImageUrl:RX,items:[],appendActionVisible:!0}),setup(e,t){let{slots:n,expose:r}=t,i=q(!1);V(()=>{i.value});let a=q([]);G(()=>e.items,function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.value=e.slice()},{immediate:!0,deep:!0}),S(()=>{if(e.listType!==`picture`&&e.listType!==`picture-card`)return;let t=!1;(e.items||[]).forEach((n,r)=>{typeof document>`u`||typeof window>`u`||!window.FileReader||!window.File||!(n.originFileObj instanceof File||n.originFileObj instanceof Blob)||n.thumbUrl!==void 0||(n.thumbUrl=``,e.previewFile&&e.previewFile(n.originFileObj).then(e=>{let i=e||``;i!==n.thumbUrl&&(a.value[r].thumbUrl=i,t=!0)}))}),t&&st(a)});let o=(t,n)=>{if(e.onPreview)return n?.preventDefault(),e.onPreview(t)},s=t=>{typeof e.onDownload==`function`?e.onDownload(t):t.url&&window.open(t.url)},c=t=>{var n;(n=e.onRemove)==null||n.call(e,t)},u=t=>{let{file:r}=t,i=e.iconRender||n.iconRender;if(i)return i({file:r,listType:e.listType});let a=r.status===`uploading`,o=e.isImageUrl&&e.isImageUrl(r)?U(TX,null,null):U(kX,null,null),s=U(a?qt:xX,null,null);return e.listType===`picture`?s=a?U(qt,null,null):o:e.listType===`picture-card`&&(s=a?e.locale.uploading:o),s},d=e=>{let{customIcon:t,callback:n,prefixCls:r,title:i}=e,a={type:`text`,size:`small`,title:i,onClick:()=>{n()},class:`${r}-list-item-action`};return Nt(t)?U(Qb,a,{icon:()=>t}):U(Qb,a,{default:()=>[U(`span`,null,[t])]})};r({handlePreview:o,handleDownload:s});let{prefixCls:f,rootPrefixCls:p}=X(`upload`,e),m=J(()=>({[`${f.value}-list`]:!0,[`${f.value}-list-${e.listType}`]:!0})),h=J(()=>{let t=Z({},aS(`${p.value}-motion-collapse`));delete t.onAfterAppear,delete t.onAfterEnter,delete t.onAfterLeave;let n=Z(Z({},l(`${f.value}-${e.listType===`picture-card`?`animate-inline`:`animate`}`)),{class:m.value,appear:i.value});return e.listType===`picture-card`?n:Z(Z({},t),n)});return()=>{let{listType:t,locale:r,isImageUrl:i,showPreviewIcon:l,showRemoveIcon:p,showDownloadIcon:m,removeIcon:g,previewIcon:_,downloadIcon:v,progress:y,appendAction:b,itemRender:x,appendActionVisible:S}=e,C=b?.(),w=a.value;return U(Tt,Y(Y({},h.value),{},{tag:`div`}),{default:()=>[w.map(e=>{let{uid:a}=e;return U(GX,{key:a,locale:r,prefixCls:f.value,file:e,items:w,progress:y,listType:t,isImgUrl:i,showPreviewIcon:l,showRemoveIcon:p,showDownloadIcon:m,onPreview:o,onDownload:s,onClose:c,removeIcon:g,previewIcon:_,downloadIcon:v,itemRender:x},Z(Z({},n),{iconRender:u,actionIconRender:d}))}),b?Mt(U(KX,{key:`__ant_upload_appendAction`},{default:()=>C}),[[ht,!!S]]):null]})}}}),JX=e=>{let{componentCls:t,iconCls:n}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:`relative`,width:`100%`,height:`100%`,textAlign:`center`,background:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:`pointer`,transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:`${e.padding}px 0`},[`${t}-btn`]:{display:`table`,width:`100%`,height:`100%`,outline:`none`},[`${t}-drag-container`]:{display:`table-cell`,verticalAlign:`middle`},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${e.marginXXS}px`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{cursor:`not-allowed`,[`p${t}-drag-icon ${n}, + p${t}-text, + p${t}-hint + `]:{color:e.colorTextDisabled}}}}}},YX=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSize:i,lineHeight:a}=e,o=`${t}-list-item`,s=`${o}-actions`,c=`${o}-action`,l=Math.round(i*a);return{[`${t}-wrapper`]:{[`${t}-list`]:Z(Z({},D()),{lineHeight:e.lineHeight,[o]:{position:`relative`,height:e.lineHeight*i,marginTop:e.marginXS,fontSize:i,display:`flex`,alignItems:`center`,transition:`background-color ${e.motionDurationSlow}`,"&:hover":{backgroundColor:e.controlItemBgHover},[`${o}-name`]:Z(Z({},xe),{padding:`0 ${e.paddingXS}px`,lineHeight:a,flex:`auto`,transition:`all ${e.motionDurationSlow}`}),[s]:{[c]:{opacity:0},[`${c}${n}-btn-sm`]:{height:l,border:0,lineHeight:1,"> span":{transform:`scale(1)`}},[` + ${c}:focus, + &.picture ${c} + `]:{opacity:1},[r]:{color:e.colorTextDescription,transition:`all ${e.motionDurationSlow}`},[`&:hover ${r}`]:{color:e.colorText}},[`${t}-icon ${r}`]:{color:e.colorTextDescription,fontSize:i},[`${o}-progress`]:{position:`absolute`,bottom:-e.uploadProgressOffset,width:`100%`,paddingInlineStart:i+e.paddingXS,fontSize:i,lineHeight:0,pointerEvents:`none`,"> div":{margin:0}}},[`${o}:hover ${c}`]:{opacity:1,color:e.colorText},[`${o}-error`]:{color:e.colorError,[`${o}-name, ${t}-icon ${r}`]:{color:e.colorError},[s]:{[`${r}, ${r}:hover`]:{color:e.colorError},[c]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:`table`,width:0,height:0,content:`""`}}})}}},XX=new N(`uploadAnimateInlineIn`,{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),ZX=new N(`uploadAnimateInlineOut`,{to:{width:0,height:0,margin:0,padding:0,opacity:0}}),QX=e=>{let{componentCls:t}=e,n=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${n}-appear, ${n}-enter, ${n}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:`forwards`},[`${n}-appear, ${n}-enter`]:{animationName:XX},[`${n}-leave`]:{animationName:ZX}}},XX,ZX]},$X=e=>{let{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:i}=e,a=`${t}-list`,o=`${a}-item`;return{[`${t}-wrapper`]:{[`${a}${a}-picture, ${a}${a}-picture-card`]:{[o]:{position:`relative`,height:r+e.lineWidth*2+e.paddingXS*2,padding:e.paddingXS,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:`transparent`},[`${o}-thumbnail`]:Z(Z({},xe),{width:r,height:r,lineHeight:`${r+e.paddingSM}px`,textAlign:`center`,flex:`none`,[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:`block`,width:`100%`,height:`100%`,overflow:`hidden`}}),[`${o}-progress`]:{bottom:i,width:`calc(100% - ${e.paddingSM*2}px)`,marginTop:0,paddingInlineStart:r+e.paddingXS}},[`${o}-error`]:{borderColor:e.colorError,[`${o}-thumbnail ${n}`]:{"svg path[fill='#e6f7ff']":{fill:e.colorErrorBg},"svg path[fill='#1890ff']":{fill:e.colorError}}},[`${o}-uploading`]:{borderStyle:`dashed`,[`${o}-name`]:{marginBottom:i}}}}}},eZ=e=>{let{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:i}=e,a=`${t}-list`,o=`${a}-item`,s=e.uploadPicCardSize;return{[`${t}-wrapper${t}-picture-card-wrapper`]:Z(Z({},D()),{display:`inline-block`,width:`100%`,[`${t}${t}-select`]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:`center`,verticalAlign:`top`,backgroundColor:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:`pointer`,transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,textAlign:`center`},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${a}${a}-picture-card`]:{[`${a}-item-container`]:{display:`inline-block`,width:s,height:s,marginBlock:`0 ${e.marginXS}px`,marginInline:`0 ${e.marginXS}px`,verticalAlign:`top`},"&::after":{display:`none`},[o]:{height:`100%`,margin:0,"&::before":{position:`absolute`,zIndex:1,width:`calc(100% - ${e.paddingXS*2}px)`,height:`calc(100% - ${e.paddingXS*2}px)`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:`" "`}},[`${o}:hover`]:{[`&::before, ${o}-actions`]:{opacity:1}},[`${o}-actions`]:{position:`absolute`,insetInlineStart:0,zIndex:10,width:`100%`,whiteSpace:`nowrap`,textAlign:`center`,opacity:0,transition:`all ${e.motionDurationSlow}`,[`${n}-eye, ${n}-download, ${n}-delete`]:{zIndex:10,width:r,margin:`0 ${e.marginXXS}px`,fontSize:r,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`}},[`${o}-actions, ${o}-actions:hover`]:{[`${n}-eye, ${n}-download, ${n}-delete`]:{color:new we(i).setAlpha(.65).toRgbString(),"&:hover":{color:i}}},[`${o}-thumbnail, ${o}-thumbnail img`]:{position:`static`,display:`block`,width:`100%`,height:`100%`,objectFit:`contain`},[`${o}-name`]:{display:`none`,textAlign:`center`},[`${o}-file + ${o}-name`]:{position:`absolute`,bottom:e.margin,display:`block`,width:`calc(100% - ${e.paddingXS*2}px)`},[`${o}-uploading`]:{[`&${o}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:`none`}},[`${o}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${e.paddingXS*2}px)`,paddingInlineStart:0}}})}},tZ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},nZ=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Z(Z({},rn(e)),{[t]:{outline:0,"input[type='file']":{cursor:`pointer`}},[`${t}-select`]:{display:`inline-block`},[`${t}-disabled`]:{color:n,cursor:`not-allowed`}})}},rZ=v(`Upload`,e=>{let{fontSizeHeading3:t,fontSize:n,lineHeight:r,lineWidth:i,controlHeightLG:a}=e,o=Math.round(n*r),s=B(e,{uploadThumbnailSize:t*2,uploadProgressOffset:o/2+i,uploadPicCardSize:a*2.55});return[nZ(s),JX(s),$X(s),eZ(s),YX(s),QX(s),tZ(s),$_(s)]}),iZ=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},aZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ic.value??d.value),[p,m]=df(e.defaultFileList||[],{value:St(e,`fileList`),postState:e=>{let t=Date.now();return(e??[]).map((e,n)=>(!e.uid&&!Object.isFrozen(e)&&(e.uid=`__AUTO__${t}_${n}__`),e))}}),h=H(`drop`),g=H(null);V(()=>{pi(e.fileList!==void 0||r.value===void 0,`Upload`,"`value` is not a valid prop, do you mean `fileList`?"),pi(e.transformFile===void 0,`Upload`,"`transformFile` is deprecated. Please use `beforeUpload` directly."),pi(e.remove===void 0,`Upload`,"`remove` props is deprecated. Please use `remove` event.")});let _=(t,n,r)=>{var i,o;let s=[...n];e.maxCount===1?s=s.slice(-1):e.maxCount&&(s=s.slice(0,e.maxCount)),m(s);let c={file:t,fileList:s};r&&(c.event=r),(i=e[`onUpdate:fileList`])==null||i.call(e,c.fileList),(o=e.onChange)==null||o.call(e,c),a.onFieldChange()},v=(t,n)=>iZ(this,void 0,void 0,function*(){let{beforeUpload:r,transformFile:i}=e,a=t;if(r){let e=yield r(t,n);if(e===!1)return!1;if(delete t[oZ],e===oZ)return Object.defineProperty(t,oZ,{value:!0,configurable:!0}),!1;typeof e==`object`&&e&&(a=e)}return i&&(a=yield i(a)),a}),y=e=>{let t=e.filter(e=>!e.file[oZ]);if(!t.length)return;let n=t.map(e=>MX(e.file)),r=[...p.value];n.forEach(e=>{r=NX(e,r)}),n.forEach((e,n)=>{let i=e;if(t[n].parsedFile)e.status=`uploading`;else{let{originFileObj:t}=e,n;try{n=new File([t],t.name,{type:t.type})}catch{n=new Blob([t],{type:t.type}),n.name=t.name,n.lastModifiedDate=new Date,n.lastModified=new Date().getTime()}n.uid=e.uid,i=n}_(i,r)})},b=(e,t,n)=>{try{typeof e==`string`&&(e=JSON.parse(e))}catch{}if(!PX(t,p.value))return;let r=MX(t);r.status=`done`,r.percent=100,r.response=e,r.xhr=n;let i=NX(r,p.value);_(r,i)},x=(e,t)=>{if(!PX(t,p.value))return;let n=MX(t);n.status=`uploading`,n.percent=e.percent;let r=NX(n,p.value);_(n,r,e)},S=(e,t,n)=>{if(!PX(n,p.value))return;let r=MX(n);r.error=e,r.response=t,r.status=`error`;let i=NX(r,p.value);_(r,i)},C=t=>{let n,r=e.onRemove||e.remove;Promise.resolve(typeof r==`function`?r(t):r).then(e=>{var r,i;if(e===!1)return;let a=FX(t,p.value);a&&(n=Z(Z({},t),{status:`removed`}),(r=p.value)==null||r.forEach(e=>{let t=n.uid===void 0?`name`:`uid`;e[t]===n[t]&&!Object.isFrozen(e)&&(e.status=`removed`)}),(i=g.value)==null||i.abort(n),_(n,a))})},w=t=>{var n;h.value=t.type,t.type===`drop`&&((n=e.onDrop)==null||n.call(e,t))};i({onBatchStart:y,onSuccess:b,onProgress:x,onError:S,fileList:p,upload:g});let[T]=Kt(`Upload`,Ye.Upload,J(()=>e.locale)),E=(t,r)=>{let{removeIcon:i,previewIcon:a,downloadIcon:s,previewFile:c,onPreview:l,onDownload:u,isImageUrl:d,progress:m,itemRender:h,iconRender:g,showUploadList:_}=e,{showDownloadIcon:v,showPreviewIcon:y,showRemoveIcon:b}=typeof _==`boolean`?{}:_;return _?U(qX,{prefixCls:o.value,listType:e.listType,items:p.value,previewFile:c,onPreview:l,onDownload:u,onRemove:C,showRemoveIcon:!f.value&&b,showPreviewIcon:y,showDownloadIcon:v,removeIcon:i,previewIcon:a,downloadIcon:s,iconRender:g,locale:T.value,isImageUrl:d,progress:m,itemRender:h,appendActionVisible:r,appendAction:t},Z({},n)):t?.()};return()=>{let{listType:t,type:i}=e,{class:c,style:d}=r,m=aZ(r,[`class`,`style`]),_=Z(Z(Z({onBatchStart:y,onError:S,onProgress:x,onSuccess:b},m),e),{id:e.id??a.id.value,prefixCls:o.value,beforeUpload:v,onChange:void 0,disabled:f.value});delete _.remove,(!n.default||f.value)&&delete _.id;let C={[`${o.value}-rtl`]:s.value===`rtl`};if(i===`drag`){let e=K(o.value,{[`${o.value}-drag`]:!0,[`${o.value}-drag-uploading`]:p.value.some(e=>e.status===`uploading`),[`${o.value}-drag-hover`]:h.value===`dragover`,[`${o.value}-disabled`]:f.value,[`${o.value}-rtl`]:s.value===`rtl`},r.class,u.value);return l(U(`span`,Y(Y({},r),{},{class:K(`${o.value}-wrapper`,C,c,u.value)}),[U(`div`,{class:e,onDrop:w,onDragover:w,onDragleave:w,style:r.style},[U(_X,Y(Y({},_),{},{ref:g,class:`${o.value}-btn`}),Y({default:()=>[U(`div`,{class:`${o.value}-drag-container`},[n.default?.call(n)])]},n))]),E()]))}let T=K(o.value,{[`${o.value}-select`]:!0,[`${o.value}-select-${t}`]:!0,[`${o.value}-disabled`]:f.value,[`${o.value}-rtl`]:s.value===`rtl`}),D=ce(n.default?.call(n)),O=e=>U(`div`,{class:T,style:e},[U(_X,Y(Y({},_),{},{ref:g}),n)]);return l(t===`picture-card`?U(`span`,Y(Y({},r),{},{class:K(`${o.value}-wrapper`,`${o.value}-picture-card-wrapper`,C,r.class,u.value)}),[E(O,!!(D&&D.length))]):U(`span`,Y(Y({},r),{},{class:K(`${o.value}-wrapper`,C,r.class,u.value)}),[O(D&&D.length?void 0:{display:`none`}),E()]))}}}),cZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{height:t}=e,i=cZ(e,[`height`]),{style:a}=r,o=cZ(r,[`style`]);return U(sZ,Z(Z(Z({},i),o),{type:`drag`,style:Z(Z({},a),{height:typeof t==`number`?`${t}px`:t})}),n)}}}),uZ=lZ,dZ=Z(sZ,{Dragger:lZ,LIST_IGNORE:oZ,install(e){return e.component(sZ.name,sZ),e.component(lZ.name,lZ),e}});function fZ(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function pZ(e){return Object.keys(e).map(t=>`${fZ(t)}: ${e[t]};`).join(` `)}function mZ(){return window.devicePixelRatio||1}function hZ(e,t,n,r){e.translate(t,n),e.rotate(Math.PI/180*Number(r)),e.translate(-t,-n)}var gZ=(e,t)=>{let n=!1;return e.removedNodes.length&&(n=Array.from(e.removedNodes).some(e=>e===t)),e.type===`attributes`&&e.target===t&&(n=!0),n},_Z=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i2&&arguments[2]!==void 0?arguments[2]:{},{window:r=$w}=n,i=_Z(n,[`window`]),a,o=Zw(()=>r&&`MutationObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=G(()=>Yw(e),e=>{s(),o.value&&r&&e&&(a=new MutationObserver(t),a.observe(e,i))},{immediate:!0}),l=()=>{s(),c()};return qw(l),{isSupported:o,stop:l}}var yZ=2,bZ=3,xZ=a(u({name:`AWatermark`,inheritAttrs:!1,props:Zn({zIndex:Number,rotate:Number,width:Number,height:Number,image:String,content:W([String,Array]),font:Qt(),rootClassName:String,gap:Ue(),offset:Ue()},{zIndex:9,rotate:-22,font:{},gap:[100,100]}),setup(e,t){let{slots:n,attrs:r}=t,[,i]=re(),a=q(),o=q(),s=q(!1),c=J(()=>e.gap?.[0]??100),l=J(()=>e.gap?.[1]??100),u=J(()=>c.value/2),d=J(()=>l.value/2),f=J(()=>e.offset?.[0]??u.value),p=J(()=>e.offset?.[1]??d.value),m=J(()=>e.font?.fontSize??i.value.fontSizeLG),h=J(()=>e.font?.fontWeight??`normal`),g=J(()=>e.font?.fontStyle??`normal`),_=J(()=>e.font?.fontFamily??`sans-serif`),v=J(()=>e.font?.color??i.value.colorFill),y=J(()=>{let t={zIndex:e.zIndex??9,position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,pointerEvents:`none`,backgroundRepeat:`repeat`},n=f.value-u.value,r=p.value-d.value;return n>0&&(t.left=`${n}px`,t.width=`calc(100% - ${n}px)`,n=0),r>0&&(t.top=`${r}px`,t.height=`calc(100% - ${r}px)`,r=0),t.backgroundPosition=`${n}px ${r}px`,t}),b=()=>{o.value&&=(o.value.remove(),void 0)},x=(e,t)=>{var n;a.value&&o.value&&(s.value=!0,o.value.setAttribute(`style`,pZ(Z(Z({},y.value),{backgroundImage:`url('${e}')`,backgroundSize:`${(c.value+t)*yZ}px`}))),(n=a.value)==null||n.append(o.value),setTimeout(()=>{s.value=!1}))},S=t=>{let n=120,r=64,i=e.content,a=e.image,o=e.width,s=e.height;if(!a&&t.measureText){t.font=`${Number(m.value)}px ${_.value}`;let e=Array.isArray(i)?i:[i],a=e.map(e=>t.measureText(e).width);n=Math.ceil(Math.max(...a)),r=Number(m.value)*e.length+(e.length-1)*bZ}return[o??n,s??r]},C=(t,n,r,i,a)=>{let o=mZ(),s=e.content,c=Number(m.value)*o;t.font=`${g.value} normal ${h.value} ${c}px/${a}px ${_.value}`,t.fillStyle=v.value,t.textAlign=`center`,t.textBaseline=`top`,t.translate(i/2,0),(Array.isArray(s)?s:[s])?.forEach((e,i)=>{t.fillText(e??``,n,r+i*(c+bZ*o))})},w=()=>{let t=document.createElement(`canvas`),n=t.getContext(`2d`),r=e.image,i=e.rotate??-22;if(n){o.value||=document.createElement(`div`);let e=mZ(),[a,s]=S(n),u=(c.value+a)*e,d=(l.value+s)*e;t.setAttribute(`width`,`${u*yZ}px`),t.setAttribute(`height`,`${d*yZ}px`);let f=c.value*e/2,p=l.value*e/2,m=a*e,h=s*e,g=(m+c.value*e)/2,_=(h+l.value*e)/2,v=f+u,y=p+d,b=g+u,w=_+d;if(n.save(),hZ(n,g,_,i),r){let e=new Image;e.onload=()=>{n.drawImage(e,f,p,m,h),n.restore(),hZ(n,b,w,i),n.drawImage(e,v,y,m,h),x(t.toDataURL(),a)},e.crossOrigin=`anonymous`,e.referrerPolicy=`no-referrer`,e.src=r}else C(n,f,p,m,h),n.restore(),hZ(n,b,w,i),C(n,v,y,m,h),x(t.toDataURL(),a)}};return V(()=>{w()}),G(()=>[e,i.value.colorFill,i.value.fontSizeLG],()=>{w()},{deep:!0,flush:`post`}),ut(()=>{b()}),vZ(a,e=>{s.value||e.forEach(e=>{gZ(e,o.value)&&(b(),w())})},{attributes:!0,subtree:!0,childList:!0,attributeFilter:[`style`,`class`]}),()=>U(`div`,Y(Y({},r),{},{ref:a,class:[r.class,e.rootClassName],style:[{position:`relative`},r.style]}),[n.default?.call(n)])}}));function SZ(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:`not-allowed`}}}function CZ(e){return{backgroundColor:e.bgColorSelected,boxShadow:e.boxShadow}}var wZ=Z({overflow:`hidden`},xe),TZ=e=>{let{componentCls:t}=e;return{[t]:Z(Z(Z(Z(Z({},rn(e)),{display:`inline-block`,padding:e.segmentedContainerPadding,color:e.labelColor,backgroundColor:e.bgColor,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`${t}-group`]:{position:`relative`,display:`flex`,alignItems:`stretch`,justifyItems:`flex-start`,width:`100%`},[`&${t}-rtl`]:{direction:`rtl`},[`&${t}-block`]:{display:`flex`},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:`relative`,textAlign:`center`,cursor:`pointer`,transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,"&-selected":Z(Z({},CZ(e)),{color:e.labelColorHover}),"&::after":{content:`""`,position:`absolute`,width:`100%`,height:`100%`,top:0,insetInlineStart:0,borderRadius:`inherit`,transition:`background-color ${e.motionDurationMid}`,pointerEvents:`none`},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.labelColorHover,"&::after":{backgroundColor:e.bgColorHover}},"&-label":Z({minHeight:e.controlHeight-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeight-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`},wZ),"&-icon + *":{marginInlineStart:e.marginSM/2},"&-input":{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:`none`}},[`${t}-thumb`]:Z(Z({},CZ(e)),{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:`100%`,padding:`${e.paddingXXS}px 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:`transparent`}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:e.controlHeightLG-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightLG-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:e.controlHeightSM-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightSM-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontalSM}px`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),SZ(`&-disabled ${t}-item`,e)),SZ(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:`transform, width`}})}},EZ=v(`Segmented`,e=>{let{lineWidthBold:t,lineWidth:n,colorTextLabel:r,colorText:i,colorFillSecondary:a,colorBgLayout:o,colorBgElevated:s}=e;return[TZ(B(e,{segmentedPaddingHorizontal:e.controlPaddingHorizontal-n,segmentedPaddingHorizontalSM:e.controlPaddingHorizontalSM-n,segmentedContainerPadding:t,labelColor:r,labelColorHover:i,bgColor:o,bgColorHover:a,bgColorSelected:s}))]}),DZ=e=>e?{left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth}:null,OZ=e=>e===void 0?void 0:`${e}px`,kZ=u({props:{value:nn(),getValueIndex:nn(),prefixCls:nn(),motionName:nn(),onMotionStart:nn(),onMotionEnd:nn(),direction:nn(),containerRef:nn()},emits:[`motionStart`,`motionEnd`],setup(e,t){let{emit:n}=t,r=H(),i=t=>{let n=e.getValueIndex(t),r=e.containerRef.value?.querySelectorAll(`.${e.prefixCls}-item`)[n];return r?.offsetParent&&r},a=H(null),o=H(null);G(()=>e.value,(e,t)=>{let r=i(t),s=i(e),c=DZ(r),l=DZ(s);a.value=c,o.value=l,n(r&&s?`motionStart`:`motionEnd`)},{flush:`post`});let s=J(()=>e.direction===`rtl`?OZ(-a.value?.right):OZ(a.value?.left)),c=J(()=>e.direction===`rtl`?OZ(-o.value?.right):OZ(o.value?.left)),l,u=e=>{clearTimeout(l),z(()=>{e&&(e.style.transform=`translateX(var(--thumb-start-left))`,e.style.width=`var(--thumb-start-width)`)})},d=t=>{l=setTimeout(()=>{t&&(rS(t,`${e.motionName}-appear-active`),t.style.transform=`translateX(var(--thumb-active-left))`,t.style.width=`var(--thumb-active-width)`)})},f=t=>{a.value=null,o.value=null,t&&(t.style.transform=null,t.style.width=null,iS(t,`${e.motionName}-appear-active`)),n(`motionEnd`)},p=J(()=>({"--thumb-start-left":s.value,"--thumb-start-width":OZ(a.value?.width),"--thumb-active-left":c.value,"--thumb-active-width":OZ(o.value?.width)}));return ut(()=>{clearTimeout(l)}),()=>{let t={ref:r,style:p.value,class:[`${e.prefixCls}-thumb`]};return U(Re,{appear:!0,onBeforeEnter:u,onEnter:d,onAfterEnter:f},{default:()=>[!a.value||!o.value?null:U(`div`,t,null)]})}}});function AZ(e){return e.map(e=>typeof e==`object`&&e?e:{label:e?.toString(),title:e?.toString(),value:e})}var jZ=()=>({prefixCls:String,options:Ue(),block:Q(),disabled:Q(),size:_(),value:Z(Z({},W([String,Number])),{required:!0}),motionName:String,onChange:d(),"onUpdate:value":d()}),MZ=(e,t)=>{let{slots:n,emit:r}=t,{value:i,disabled:a,payload:o,title:s,prefixCls:c,label:l=n.label,checked:u,className:d}=e,f=e=>{a||r(`change`,e,i)};return U(`label`,{class:K({[`${c}-item-disabled`]:a},d)},[U(`input`,{class:`${c}-item-input`,type:`radio`,disabled:a,checked:u,onChange:f},null),U(`div`,{class:`${c}-item-label`,title:typeof s==`string`?s:``},[typeof l==`function`?l({value:i,disabled:a,payload:o,title:s}):l??i])])};MZ.inheritAttrs=!1;var NZ=a(u({name:`ASegmented`,inheritAttrs:!1,props:Zn(jZ(),{options:[],motionName:`thumb-motion`}),slots:Object,setup(e,t){let{emit:n,slots:r,attrs:i}=t,{prefixCls:a,direction:o,size:s}=X(`segmented`,e),[c,l]=EZ(a),u=q(),d=q(!1),f=J(()=>AZ(e.options)),p=(t,r)=>{e.disabled||(n(`update:value`,r),n(`change`,r))};return()=>{let t=a.value;return c(U(`div`,Y(Y({},i),{},{class:K(t,{[l.value]:!0,[`${t}-block`]:e.block,[`${t}-disabled`]:e.disabled,[`${t}-lg`]:s.value==`large`,[`${t}-sm`]:s.value==`small`,[`${t}-rtl`]:o.value===`rtl`},i.class),ref:u}),[U(`div`,{class:`${t}-group`},[U(kZ,{containerRef:u,prefixCls:t,value:e.value,motionName:`${t}-${e.motionName}`,direction:o.value,getValueIndex:e=>f.value.findIndex(t=>t.value===e),onMotionStart:()=>{d.value=!0},onMotionEnd:()=>{d.value=!1}},null),f.value.map(n=>U(MZ,Y(Y({key:n.value,prefixCls:t,checked:n.value===e.value,onChange:p},n),{},{className:K(n.className,`${t}-item`,{[`${t}-item-selected`]:n.value===e.value&&!d.value}),disabled:!!e.disabled||!!n.disabled}),r))])]))}}})),PZ=e=>{let{componentCls:t}=e;return{[t]:Z(Z({},rn(e)),{display:`flex`,justifyContent:`center`,alignItems:`center`,padding:e.paddingSM,backgroundColor:e.colorWhite,borderRadius:e.borderRadiusLG,border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,position:`relative`,width:`100%`,height:`100%`,overflow:`hidden`,[`& > ${t}-mask`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:10,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`,color:e.colorText,lineHeight:e.lineHeight,background:e.QRCodeMaskBackgroundColor,textAlign:`center`,[`& > ${t}-expired , & > ${t}-scanned`]:{color:e.QRCodeTextColor}},"&-icon":{marginBlockEnd:e.marginXS,fontSize:e.controlHeight}}),[`${t}-borderless`]:{borderColor:`transparent`}}},FZ=v(`QRCode`,e=>PZ(B(e,{QRCodeTextColor:`rgba(0, 0, 0, 0.88)`,QRCodeMaskBackgroundColor:`rgba(255, 255, 255, 0.96)`}))),IZ={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z`}}]},name:`appstore`,theme:`outlined`};function LZ(e){for(var t=1;t({size:{type:Number,default:160},value:{type:String,required:!0},type:_(`canvas`),color:String,bgColor:String,includeMargin:Boolean,imageSettings:Qt()}),dQ=()=>Z(Z({},uQ()),{errorLevel:_(`M`),icon:String,iconSize:{type:Number,default:40},status:_(`active`),bordered:{type:Boolean,default:!0}}),fQ;(function(e){class t{static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:40,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(!(t.MIN_VERSION<=o&&o<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=o;;u++){let n=t.getNumDataCodewords(u,r)*8,i=a.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.lengthm[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],et.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;ne+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.lengtht.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}class a{static makeBytes(e){let t=[];for(let r of e)n(r,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let r=0;r=1<1&&arguments[1]!==void 0?arguments[1]:0,n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function wQ(e,t){return e.slice().map((e,n)=>n=t.y+t.h?e:e.map((e,n)=>n=t.x+t.w?e:!1))}function TQ(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*SQ),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);d={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}return{x:l,y:u,h:c,w:s,excavation:d}}function EQ(e,t){return t==null?e?bQ:xQ:Math.floor(t)}var DQ=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),OQ=u({name:`QRCodeCanvas`,inheritAttrs:!1,props:Z(Z({},uQ()),{level:String,bgColor:String,fgColor:String,marginSize:Number}),setup(e,t){let{attrs:n,expose:r}=t,i=J(()=>e.imageSettings?.src),a=q(null),o=q(null),s=q(!1);return r({toDataURL:(e,t)=>a.value?.toDataURL(e,t)}),S(()=>{let{value:t,size:n=hQ,level:r=gQ,bgColor:i=_Q,fgColor:c=vQ,includeMargin:l=yQ,marginSize:u,imageSettings:d}=e;if(a.value!=null){let e=a.value,f=e.getContext(`2d`);if(!f)return;let p=pQ.QrCode.encodeText(t,mQ[r]).getModules(),m=EQ(l,u),h=p.length+m*2,g=TQ(p,n,m,d),_=o.value,v=s.value&&g!=null&&_!==null&&_.complete&&_.naturalHeight!==0&&_.naturalWidth!==0;v&&g.excavation!=null&&(p=wQ(p,g.excavation));let y=window.devicePixelRatio||1;e.height=e.width=n*y;let b=n/h*y;f.scale(b,b),f.fillStyle=i,f.fillRect(0,0,h,h),f.fillStyle=c,DQ?f.fill(new Path2D(CQ(p,m))):p.forEach(function(e,t){e.forEach(function(e,n){e&&f.fillRect(n+m,t+m,1,1)})}),v&&f.drawImage(_,g.x+m,g.y+m,g.w,g.h)}},{flush:`post`}),G(i,()=>{s.value=!1}),()=>{let t=e.size??hQ,r={height:`${t}px`,width:`${t}px`},c=null;return i.value!=null&&(c=U(`img`,{src:i.value,key:i.value,style:{display:`none`},onLoad:()=>{s.value=!0},ref:o},null)),U($e,null,[U(`canvas`,Y(Y({},n),{},{style:[r,n.style],ref:a}),null),c])}}}),kQ=u({name:`QRCodeSVG`,inheritAttrs:!1,props:Z(Z({},uQ()),{color:String,level:String,bgColor:String,fgColor:String,marginSize:Number,title:String}),setup(e){let t=null,n=null,r=null,i=null,a=null,o=null;return S(()=>{let{value:s,size:c=hQ,level:l=gQ,includeMargin:u=yQ,marginSize:d,imageSettings:f}=e;t=pQ.QrCode.encodeText(s,mQ[l]).getModules(),n=EQ(u,d),r=t.length+n*2,i=TQ(t,c,n,f),f!=null&&i!=null&&(i.excavation!=null&&(t=wQ(t,i.excavation)),o=U(`image`,{"xlink:href":f.src,height:i.h,width:i.w,x:i.x+n,y:i.y+n,preserveAspectRatio:`none`},null)),a=CQ(t,n)}),()=>{let t=e.bgColor&&_Q,n=e.fgColor&&vQ;return U(`svg`,{height:e.size,width:e.size,viewBox:`0 0 ${r} ${r}`},[!!e.title&&U(`title`,null,[e.title]),U(`path`,{fill:t,d:`M0,0 h${r}v${r}H0z`,"shape-rendering":`crispEdges`},null),U(`path`,{fill:n,d:a,"shape-rendering":`crispEdges`},null),o])}}}),AQ=a(u({name:`AQrcode`,inheritAttrs:!1,props:dQ(),emits:[`refresh`],setup(e,t){let{emit:n,attrs:r,expose:i}=t,[a]=Kt(`QRCode`),{prefixCls:o}=X(`qrcode`,e),[s,c]=FZ(o),[,l]=re(),u=H();i({toDataURL:(e,t)=>u.value?.toDataURL(e,t)});let d=J(()=>{let{value:t,icon:n=``,size:r=160,iconSize:i=40,color:a=l.value.colorText,bgColor:o=`transparent`,errorLevel:s=`M`}=e,c={src:n,x:void 0,y:void 0,height:i,width:i,excavate:!0};return{value:t,size:r-(l.value.paddingSM+l.value.lineWidth)*2,level:s,bgColor:o,fgColor:a,imageSettings:n?c:void 0}});return()=>{let t=o.value;return s(U(`div`,Y(Y({},r),{},{style:[r.style,{width:`${e.size}px`,height:`${e.size}px`,backgroundColor:d.value.bgColor}],class:[c.value,t,{[`${t}-borderless`]:!e.bordered}]}),[e.status!==`active`&&U(`div`,{class:`${t}-mask`},[e.status===`loading`&&U(HR,null,null),e.status===`expired`&&U($e,null,[U(`p`,{class:`${t}-expired`},[a.value.expired]),U(Qb,{type:`link`,onClick:e=>n(`refresh`,e)},{default:()=>[a.value.refresh],icon:()=>U(un,null,null)})]),e.status===`scanned`&&U(`p`,{class:`${t}-scanned`},[a.value.scanned])]),e.type===`canvas`?U(OQ,Y({ref:u},d.value),null):U(kQ,d.value,null)]))}}}));function jQ(e){let t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:r,right:i,bottom:a,left:o}=e.getBoundingClientRect();return r>=0&&o>=0&&i<=t&&a<=n}function MQ(e,t,n,r){let[i,a]=ff(void 0);S(()=>{let t=typeof e.value==`function`?e.value():e.value;a(t||null)},{flush:`post`});let[o,s]=ff(null),c=()=>{if(!t.value){s(null);return}if(i.value){!jQ(i.value)&&t.value&&i.value.scrollIntoView(r.value);let{left:e,top:n,width:a,height:c}=i.value.getBoundingClientRect(),l={left:e,top:n,width:a,height:c,radius:0};JSON.stringify(o.value)!==JSON.stringify(l)&&s(l)}else s(null)};return V(()=>{G([t,i],()=>{c()},{flush:`post`,immediate:!0}),window.addEventListener(`resize`,c)}),ut(()=>{window.removeEventListener(`resize`,c)}),[J(()=>{if(!o.value)return o.value;let e=n.value?.offset||6,t=n.value?.radius||2;return{left:o.value.left-e,top:o.value.top-e,width:o.value.width+e*2,height:o.value.height+e*2,radius:t}}),i]}var NQ=()=>({arrow:W([Boolean,Object]),target:W([String,Function,Object]),title:W([String,Object]),description:W([String,Object]),placement:_(),mask:W([Object,Boolean],!0),className:{type:String},style:Qt(),scrollIntoViewOptions:W([Boolean,Object])}),PQ=()=>Z(Z({},NQ()),{prefixCls:{type:String},total:{type:Number},current:{type:Number},onClose:d(),onFinish:d(),renderPanel:d(),onPrev:d(),onNext:d()}),FQ=u({name:`DefaultPanel`,inheritAttrs:!1,props:PQ(),setup(e,t){let{attrs:n}=t;return()=>{let{prefixCls:t,current:r,total:i,title:a,description:o,onClose:s,onPrev:c,onNext:l,onFinish:u}=e;return U(`div`,Y(Y({},n),{},{class:K(`${t}-content`,n.class)}),[U(`div`,{class:`${t}-inner`},[U(`button`,{type:`button`,onClick:s,"aria-label":`Close`,class:`${t}-close`},[U(`span`,{class:`${t}-close-x`},[en(`×`)])]),U(`div`,{class:`${t}-header`},[U(`div`,{class:`${t}-title`},[a])]),U(`div`,{class:`${t}-description`},[o]),U(`div`,{class:`${t}-footer`},[U(`div`,{class:`${t}-sliders`},[i>1?[...Array.from({length:i}).keys()].map((e,t)=>U(`span`,{key:e,class:t===r?`active`:``},null)):null]),U(`div`,{class:`${t}-buttons`},[r===0?null:U(`button`,{class:`${t}-prev-btn`,onClick:c},[en(`Prev`)]),r===i-1?U(`button`,{class:`${t}-finish-btn`,onClick:u},[en(`Finish`)]):U(`button`,{class:`${t}-next-btn`,onClick:l},[en(`Next`)])])])])])}}}),IQ=u({name:`TourStep`,inheritAttrs:!1,props:PQ(),setup(e,t){let{attrs:n}=t;return()=>{let{current:t,renderPanel:r}=e;return U($e,null,[typeof r==`function`?r(Z(Z({},n),e),t):U(FQ,Y(Y({},n),e),null)])}}}),LQ=0,RQ=It();function zQ(){let e;return RQ?(e=LQ,LQ+=1):e=`TEST_OR_SSR`,e}function BQ(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H(``),t=`vc_unique_${zQ()}`;return e.value||t}var VQ={fill:`transparent`,"pointer-events":`auto`},HQ=u({name:`TourMask`,props:{prefixCls:{type:String},pos:Qt(),rootClassName:{type:String},showMask:Q(),fill:{type:String,default:`rgba(0,0,0,0.5)`},open:Q(),animated:W([Boolean,Object]),zIndex:{type:Number}},setup(e,t){let{attrs:n}=t,r=BQ();return()=>{let{prefixCls:t,open:i,rootClassName:a,pos:o,showMask:s,fill:c,animated:l,zIndex:u}=e,d=`${t}-mask-${r}`,f=typeof l==`object`?l?.placeholder:l;return U(bu,{visible:i,autoLock:!0},{default:()=>i&&U(`div`,Y(Y({},n),{},{class:K(`${t}-mask`,a,n.class),style:[{position:`fixed`,left:0,right:0,top:0,bottom:0,zIndex:u,pointerEvents:`none`},n.style]}),[s?U(`svg`,{style:{width:`100%`,height:`100%`}},[U(`defs`,null,[U(`mask`,{id:d},[U(`rect`,{x:`0`,y:`0`,width:`100vw`,height:`100vh`,fill:`white`},null),o&&U(`rect`,{x:o.left,y:o.top,rx:o.radius,width:o.width,height:o.height,fill:`black`,class:f?`${t}-placeholder-animated`:``},null)])]),U(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:c,mask:`url(#${d})`},null),o&&U($e,null,[U(`rect`,Y(Y({},VQ),{},{x:`0`,y:`0`,width:`100%`,height:o.top}),null),U(`rect`,Y(Y({},VQ),{},{x:`0`,y:`0`,width:o.left,height:`100%`}),null),U(`rect`,Y(Y({},VQ),{},{x:`0`,y:o.top+o.height,width:`100%`,height:`calc(100vh - ${o.top+o.height}px)`}),null),U(`rect`,Y(Y({},VQ),{},{x:o.left+o.width,y:`0`,width:`calc(100vw - ${o.left+o.width}px)`,height:`100%`}),null)])]):null])})}}}),UQ=[0,0],WQ={left:{points:[`cr`,`cl`],offset:[-8,0]},right:{points:[`cl`,`cr`],offset:[8,0]},top:{points:[`bc`,`tc`],offset:[0,-8]},bottom:{points:[`tc`,`bc`],offset:[0,8]},topLeft:{points:[`bl`,`tl`],offset:[0,-8]},leftTop:{points:[`tr`,`tl`],offset:[-8,0]},topRight:{points:[`br`,`tr`],offset:[0,-8]},rightTop:{points:[`tl`,`tr`],offset:[8,0]},bottomRight:{points:[`tr`,`br`],offset:[0,8]},rightBottom:{points:[`bl`,`br`],offset:[8,0]},bottomLeft:{points:[`tl`,`bl`],offset:[0,8]},leftBottom:{points:[`br`,`bl`],offset:[-8,0]}};function GQ(){let e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t={};return Object.keys(WQ).forEach(n=>{t[n]=Z(Z({},WQ[n]),{autoArrow:e,targetOffset:UQ})}),t}GQ();var KQ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{builtinPlacements:e,popupAlign:t}=Di();return{builtinPlacements:e,popupAlign:t,steps:Ue(),open:Q(),defaultCurrent:{type:Number},current:{type:Number},onChange:d(),onClose:d(),onFinish:d(),mask:W([Boolean,Object],!0),arrow:W([Boolean,Object],!0),rootClassName:{type:String},placement:_(`bottom`),prefixCls:{type:String,default:`rc-tour`},renderPanel:d(),gap:Qt(),animated:W([Boolean,Object]),scrollIntoViewOptions:W([Boolean,Object],!0),zIndex:{type:Number,default:1001}}},YQ=u({name:`Tour`,inheritAttrs:!1,props:Zn(JQ(),{}),setup(e){let{defaultCurrent:t,placement:n,mask:r,scrollIntoViewOptions:i,open:a,gap:o,arrow:s}=Ft(e),c=H(),[l,u]=df(0,{value:J(()=>e.current),defaultValue:t.value}),[d,f]=df(void 0,{value:J(()=>e.open),postState:t=>l.value<0||l.value>=e.steps.length?!1:t??!0}),p=q(d.value);S(()=>{d.value&&!p.value&&u(0),p.value=d.value});let m=J(()=>e.steps[l.value]||{}),h=J(()=>m.value.placement??n.value),g=J(()=>d.value&&(m.value.mask??r.value)),_=J(()=>m.value.scrollIntoViewOptions??i.value),[v,y]=MQ(J(()=>m.value.target),a,o,_),b=J(()=>y.value?m.value.arrow===void 0?s.value:m.value.arrow:!1),x=J(()=>typeof b.value==`object`&&b.value.pointAtCenter);G(x,()=>{var e;(e=c.value)==null||e.forcePopupAlign()}),G(l,()=>{var e;(e=c.value)==null||e.forcePopupAlign()});let C=t=>{var n;u(t),(n=e.onChange)==null||n.call(e,t)};return()=>{let{prefixCls:t,steps:n,onClose:r,onFinish:i,rootClassName:a,renderPanel:o,animated:s,zIndex:u}=e,p=KQ(e,[`prefixCls`,`steps`,`onClose`,`onFinish`,`rootClassName`,`renderPanel`,`animated`,`zIndex`]);if(y.value===void 0)return null;let _=()=>{f(!1),r?.(l.value)},S=typeof g.value==`boolean`?g.value:!!g.value,w=typeof g.value==`boolean`?void 0:g.value,T=()=>y.value||document.body,E=()=>U(IQ,Y({arrow:b.value,key:`content`,prefixCls:t,total:n.length,renderPanel:o,onPrev:()=>{C(l.value-1)},onNext:()=>{C(l.value+1)},onClose:_,current:l.value,onFinish:()=>{_(),i?.()}},m.value),null),D=J(()=>{let e=v.value||qQ,t={};return Object.keys(e).forEach(n=>{typeof e[n]==`number`?t[n]=`${e[n]}px`:t[n]=e[n]}),t});return d.value?U($e,null,[U(HQ,{zIndex:u,prefixCls:t,pos:v.value,showMask:S,style:w?.style,fill:w?.color,open:d.value,animated:s,rootClassName:a},null),U(Su,Y(Y({},p),{},{arrow:!!p.arrow,builtinPlacements:m.value.target?p.builtinPlacements??GQ(x.value):void 0,ref:c,popupStyle:m.value.target?m.value.style:Z(Z({},m.value.style),{position:`fixed`,left:qQ.left,top:qQ.top,transform:`translate(-50%, -50%)`}),popupPlacement:h.value,popupVisible:d.value,popupClassName:K(a,m.value.className),prefixCls:t,popup:E,forceRender:!1,destroyPopupOnHide:!0,zIndex:u,mask:!1,getTriggerDOMNode:T}),{default:()=>[U(bu,{visible:d.value,autoLock:!0},{default:()=>[U(`div`,{class:K(a,`${t}-target-placeholder`),style:Z(Z({},D.value),{position:`fixed`,pointerEvents:`none`})},null)]})]})]):null}}}),XQ=()=>Z(Z({},JQ()),{steps:{type:Array},prefixCls:{type:String},current:{type:Number},type:{type:String},"onUpdate:current":Function}),ZQ=u({name:`ATourPanel`,inheritAttrs:!1,props:Z(Z({},PQ()),{cover:{type:Object},nextButtonProps:{type:Object},prevButtonProps:{type:Object},current:{type:Number},type:{type:String}}),setup(e,t){let{attrs:n,slots:r}=t,{current:i,total:a}=Ft(e),o=J(()=>i.value===a.value-1),s=t=>{var n;let r=e.prevButtonProps;(n=e.onPrev)==null||n.call(e,t),typeof r?.onClick==`function`&&r?.onClick()},c=t=>{var n,r;let i=e.nextButtonProps;o.value?(n=e.onFinish)==null||n.call(e,t):(r=e.onNext)==null||r.call(e,t),typeof i?.onClick==`function`&&i?.onClick()};return()=>{let{prefixCls:t,title:l,onClose:u,cover:d,description:f,type:p,arrow:m}=e,h=e.prevButtonProps,g=e.nextButtonProps,_;l&&(_=U(`div`,{class:`${t}-header`},[U(`div`,{class:`${t}-title`},[l])]));let v;f&&(v=U(`div`,{class:`${t}-description`},[f]));let y;d&&(y=U(`div`,{class:`${t}-cover`},[d]));let b;b=r.indicatorsRender?r.indicatorsRender({current:i.value,total:a}):[...Array.from({length:a.value}).keys()].map((e,n)=>U(`span`,{key:e,class:K(n===i.value&&`${t}-indicator-active`,`${t}-indicator`)},null));let x=p===`primary`?`default`:`primary`,S={type:`default`,ghost:p===`primary`};return U(gt,{componentName:`Tour`,defaultLocale:Ye.Tour},{default:e=>U(`div`,Y(Y({},n),{},{class:K(p===`primary`?`${t}-primary`:``,n.class,`${t}-content`)}),[m&&U(`div`,{class:`${t}-arrow`,key:`arrow`},null),U(`div`,{class:`${t}-inner`},[U(Pe,{class:`${t}-close`,onClick:u},null),y,_,v,U(`div`,{class:`${t}-footer`},[a.value>1&&U(`div`,{class:`${t}-indicators`},[b]),U(`div`,{class:`${t}-buttons`},[i.value===0?null:U(Qb,Y(Y(Y({},S),h),{},{onClick:s,size:`small`,class:K(`${t}-prev-btn`,h?.className)}),{default:()=>[Vt(h?.children)?h.children():h?.children??e.Previous]}),U(Qb,Y(Y({type:x},g),{},{onClick:c,size:`small`,class:K(`${t}-next-btn`,g?.className)}),{default:()=>[Vt(g?.children)?g?.children():o.value?e.Finish:e.Next]})])])])])})}}}),QQ=e=>{let{defaultType:t,steps:n,current:r,defaultCurrent:i}=e,a=H(i?.value);G(J(()=>r?.value),e=>{a.value=e??i?.value},{immediate:!0});let o=e=>{a.value=e},s=J(()=>typeof a.value==`number`?n&&n.value?.[a.value]?.type:t?.value);return{currentMergedType:J(()=>s.value??t?.value),updateInnerCurrent:o}},$Q=e=>{let{componentCls:t,lineHeight:n,padding:r,paddingXS:i,borderRadius:a,borderRadiusXS:o,colorPrimary:s,colorText:c,colorFill:l,indicatorHeight:u,indicatorWidth:d,boxShadowTertiary:f,tourZIndexPopup:p,fontSize:m,colorBgContainer:h,fontWeightStrong:g,marginXS:_,colorTextLightSolid:v,tourBorderRadius:y,colorWhite:b,colorBgTextHover:x,tourCloseSize:S,motionDurationSlow:C,antCls:w}=e;return[{[t]:Z(Z({},rn(e)),{color:c,position:`absolute`,zIndex:p,display:`block`,visibility:`visible`,fontSize:m,lineHeight:n,width:520,"--antd-arrow-background-color":h,"&-pure":{maxWidth:`100%`,position:`relative`},[`&${t}-hidden`]:{display:`none`},[`${t}-content`]:{position:`relative`},[`${t}-inner`]:{textAlign:`start`,textDecoration:`none`,borderRadius:y,boxShadow:f,position:`relative`,backgroundColor:h,border:`none`,backgroundClip:`padding-box`,[`${t}-close`]:{position:`absolute`,top:r,insetInlineEnd:r,color:e.colorIcon,outline:`none`,width:S,height:S,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:`flex`,alignItems:`center`,justifyContent:`center`,"&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?`transparent`:e.colorFillContent}},[`${t}-cover`]:{textAlign:`center`,padding:`${r+S+i}px ${r}px 0`,img:{width:`100%`}},[`${t}-header`]:{padding:`${r}px ${r}px ${i}px`,[`${t}-title`]:{lineHeight:n,fontSize:m,fontWeight:g}},[`${t}-description`]:{padding:`0 ${r}px`,lineHeight:n,wordWrap:`break-word`},[`${t}-footer`]:{padding:`${i}px ${r}px ${r}px`,textAlign:`end`,borderRadius:`0 0 ${o}px ${o}px`,display:`flex`,[`${t}-indicators`]:{display:`inline-block`,[`${t}-indicator`]:{width:d,height:u,display:`inline-block`,borderRadius:`50%`,background:l,"&:not(:last-child)":{marginInlineEnd:u},"&-active":{background:s}}},[`${t}-buttons`]:{marginInlineStart:`auto`,[`${w}-btn`]:{marginInlineStart:_}}}},[`${t}-primary, &${t}-primary`]:{"--antd-arrow-background-color":s,[`${t}-inner`]:{color:v,textAlign:`start`,textDecoration:`none`,backgroundColor:s,borderRadius:a,boxShadow:f,[`${t}-close`]:{color:v},[`${t}-indicators`]:{[`${t}-indicator`]:{background:new we(v).setAlpha(.15).toRgbString(),"&-active":{background:v}}},[`${t}-prev-btn`]:{color:v,borderColor:new we(v).setAlpha(.15).toRgbString(),backgroundColor:s,"&:hover":{backgroundColor:new we(v).setAlpha(.15).toRgbString(),borderColor:`transparent`}},[`${t}-next-btn`]:{color:s,borderColor:`transparent`,background:b,"&:hover":{background:new we(x).onBackground(b).toRgbString()}}}}}),[`${t}-mask`]:{[`${t}-placeholder-animated`]:{transition:`all ${C}`}},[[`&-placement-left`,`&-placement-leftTop`,`&-placement-leftBottom`,`&-placement-right`,`&-placement-rightTop`,`&-placement-rightBottom`].join(`,`)]:{[`${t}-inner`]:{borderRadius:Math.min(y,8)}}},yy(e,{colorBg:`var(--antd-arrow-background-color)`,contentRadius:y,limitVerticalRadius:!0})]},e$=v(`Tour`,e=>{let{borderRadiusLG:t,fontSize:n,lineHeight:r}=e;return[$Q(B(e,{tourZIndexPopup:e.zIndexPopupBase+70,indicatorWidth:6,indicatorHeight:6,tourBorderRadius:t,tourCloseSize:n*r}))]}),t$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{steps:t,current:a,type:o,rootClassName:s}=e,c=t$(e,[`steps`,`current`,`type`,`rootClassName`]),h=K({[`${l.value}-primary`]:p.value===`primary`,[`${l.value}-rtl`]:u.value===`rtl`},f.value,s),g=(e,t)=>U(ZQ,Y(Y({},e),{},{type:o,current:t}),{indicatorsRender:i.indicatorsRender}),_=e=>{m(e),r(`update:current`,e),r(`change`,e)},v=J(()=>uy({arrowPointAtCenter:!0,autoAdjustOverflow:!0}));return d(U(YQ,Y(Y(Y({},n),c),{},{rootClassName:h,prefixCls:l.value,current:a,defaultCurrent:e.defaultCurrent,animated:!0,renderPanel:g,onChange:_,steps:t,builtinPlacements:v.value}),null))}}})),r$=Symbol(`appConfigContext`),i$=e=>fe(r$,e),a$=()=>g(r$,{}),o$=Symbol(`appContext`),s$=e=>fe(o$,e),c$=Ne({message:{},notification:{},modal:{}}),l$=()=>g(o$,c$),u$=e=>{let{componentCls:t,colorText:n,fontSize:r,lineHeight:i,fontFamily:a}=e;return{[t]:{color:n,fontSize:r,lineHeight:i,fontFamily:a}}},d$=v(`App`,e=>[u$(e)]),f$=()=>({rootClassName:String,message:Qt(),notification:Qt()}),p$=()=>l$(),m$=u({name:`AApp`,props:Zn(f$(),{}),setup(e,t){let{slots:n}=t,{prefixCls:r}=X(`app`,e),[i,a]=d$(r),o=J(()=>K(a.value,r.value,e.rootClassName)),s=a$(),c=J(()=>({message:Z(Z({},s.message),e.message),notification:Z(Z({},s.notification),e.notification)}));i$(c.value);let[l,u]=wt(c.value.message),[d,f]=ot(c.value.notification),[p,m]=CB();return s$(J(()=>({message:l,notification:d,modal:p})).value),()=>i(U(`div`,{class:o.value},[m(),u(),f(),n.default?.call(n)]))}});m$.useApp=p$,m$.install=function(e){e.component(m$.name,m$)};var h$=[`wrap`,`nowrap`,`wrap-reverse`],g$=[`flex-start`,`flex-end`,`start`,`end`,`center`,`space-between`,`space-around`,`space-evenly`,`stretch`,`normal`,`left`,`right`],_$=[`center`,`start`,`end`,`flex-start`,`flex-end`,`self-start`,`self-end`,`baseline`,`normal`,`stretch`],v$=(e,t)=>{let n={};return h$.forEach(r=>{n[`${e}-wrap-${r}`]=t.wrap===r}),n},y$=(e,t)=>{let n={};return _$.forEach(r=>{n[`${e}-align-${r}`]=t.align===r}),n[`${e}-align-stretch`]=!t.align&&!!t.vertical,n},b$=(e,t)=>{let n={};return g$.forEach(r=>{n[`${e}-justify-${r}`]=t.justify===r}),n};function x$(e,t){return K(Z(Z(Z({},v$(e,t)),y$(e,t)),b$(e,t)))}var S$=e=>{let{componentCls:t}=e;return{[t]:{display:`flex`,"&-vertical":{flexDirection:`column`},"&-rtl":{direction:`rtl`},"&:empty":{display:`none`}}}},C$=e=>{let{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}},w$=e=>{let{componentCls:t}=e,n={};return h$.forEach(e=>{n[`${t}-wrap-${e}`]={flexWrap:e}}),n},T$=e=>{let{componentCls:t}=e,n={};return _$.forEach(e=>{n[`${t}-align-${e}`]={alignItems:e}}),n},E$=e=>{let{componentCls:t}=e,n={};return g$.forEach(e=>{n[`${t}-justify-${e}`]={justifyContent:e}}),n},D$=v(`Flex`,e=>{let t=B(e,{flexGapSM:e.paddingXS,flexGap:e.padding,flexGapLG:e.paddingLG});return[S$(t),C$(t),w$(t),T$(t),E$(t)]});function O$(e){return[`small`,`middle`,`large`].includes(e)}var k$=()=>({prefixCls:_(),vertical:Q(),wrap:_(),justify:_(),align:_(),flex:W([Number,String]),gap:W([Number,String]),component:nn()}),A$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i[o.value,c.value,x$(o.value,e),{[`${o.value}-rtl`]:a.value===`rtl`,[`${o.value}-gap-${e.gap}`]:O$(e.gap),[`${o.value}-vertical`]:e.vertical??i?.value.vertical}]);return()=>{let{flex:t,gap:i,component:a=`div`}=e,o=A$(e,[`flex`,`gap`,`component`]),c={};return t&&(c.flex=t),i&&!O$(i)&&(c.gap=`${i}px`),s(U(a,Y({class:[r.class,l.value],style:[r.style,c]},Br(o,[`justify`,`wrap`,`align`,`vertical`])),{default:()=>[n.default?.call(n)]}))}}})),M$=yn({Affix:()=>Gr,Alert:()=>zv,Anchor:()=>vi,AnchorLink:()=>fi,App:()=>m$,AutoComplete:()=>kv,AutoCompleteOptGroup:()=>Dv,AutoCompleteOption:()=>Ev,Avatar:()=>My,AvatarGroup:()=>jy,BackTop:()=>yF,Badge:()=>Xy,BadgeRibbon:()=>qy,Breadcrumb:()=>NS,BreadcrumbItem:()=>Sx,BreadcrumbSeparator:()=>MS,Button:()=>Qb,ButtonGroup:()=>qb,Calendar:()=>oE,Card:()=>FD,CardGrid:()=>PD,CardMeta:()=>ND,Carousel:()=>$O,Cascader:()=>lN,CheckableTag:()=>kN,Checkbox:()=>vN,CheckboxGroup:()=>_N,Col:()=>bN,Collapse:()=>qD,CollapsePanel:()=>KD,Comment:()=>CN,Compact:()=>m_,ConfigProvider:()=>Bt,DatePicker:()=>dP,Descriptions:()=>TP,DescriptionsItem:()=>vP,DirectoryTree:()=>QK,Divider:()=>OP,Drawer:()=>qP,Dropdown:()=>kP,DropdownButton:()=>fx,Empty:()=>te,Flex:()=>j$,FloatButton:()=>bF,FloatButtonGroup:()=>mF,Form:()=>QM,FormItem:()=>UM,FormItemRest:()=>Bf,Grid:()=>yN,Image:()=>EL,ImagePreviewGroup:()=>TL,Input:()=>hI,InputGroup:()=>LF,InputNumber:()=>aR,InputPassword:()=>mI,InputSearch:()=>zF,Layout:()=>kR,LayoutContent:()=>OR,LayoutFooter:()=>ER,LayoutHeader:()=>TR,LayoutSider:()=>DR,List:()=>Ez,ListItem:()=>xz,ListItemMeta:()=>vz,LocaleProvider:()=>Lt,Mentions:()=>rB,MentionsOption:()=>nB,Menu:()=>wS,MenuDivider:()=>sS,MenuItem:()=>Kx,MenuItemGroup:()=>oS,Modal:()=>TB,MonthPicker:()=>oP,PageHeader:()=>tV,Pagination:()=>_z,Popconfirm:()=>aV,Popover:()=>Ay,Progress:()=>zV,QRCode:()=>AQ,QuarterPicker:()=>lP,Radio:()=>ET,RadioButton:()=>TT,RadioGroup:()=>wT,RangePicker:()=>uP,Rate:()=>QV,Result:()=>_H,Row:()=>vH,Segmented:()=>NZ,Select:()=>yv,SelectOptGroup:()=>xv,SelectOption:()=>bv,Skeleton:()=>AD,SkeletonAvatar:()=>kD,SkeletonButton:()=>TD,SkeletonImage:()=>OD,SkeletonInput:()=>ED,SkeletonTitle:()=>tD,Slider:()=>QH,Space:()=>QB,Spin:()=>HR,Statistic:()=>LB,StatisticCountdown:()=>IB,Step:()=>xU,Steps:()=>SU,SubMenu:()=>tS,Switch:()=>AU,TabPane:()=>UE,Table:()=>Kq,TableColumn:()=>Vq,TableColumnGroup:()=>Hq,TableSummary:()=>Gq,TableSummaryCell:()=>Wq,TableSummaryRow:()=>Uq,Tabs:()=>GE,Tag:()=>AN,Textarea:()=>nI,TimePicker:()=>tY,TimeRangePicker:()=>eY,Timeline:()=>oY,TimelineItem:()=>nY,Tooltip:()=>Ty,Tour:()=>n$,Transfer:()=>mJ,Tree:()=>eq,TreeNode:()=>$K,TreeSelect:()=>XJ,TreeSelectNode:()=>YJ,Typography:()=>nX,TypographyLink:()=>qY,TypographyParagraph:()=>YY,TypographyText:()=>ZY,TypographyTitle:()=>tX,Upload:()=>dZ,UploadDragger:()=>uZ,Watermark:()=>xZ,WeekPicker:()=>aP,message:()=>Le,notification:()=>Pt}),N$={version:x,install:function(e){return Object.keys(M$).forEach(t=>{let n=M$[t];n.install&&e.use(n)}),e.use(Fr.StyleProvider),e.config.globalProperties.$message=Le,e.config.globalProperties.$notification=Pt,e.config.globalProperties.$info=TB.info,e.config.globalProperties.$success=TB.success,e.config.globalProperties.$error=TB.error,e.config.globalProperties.$warning=TB.warning,e.config.globalProperties.$confirm=TB.confirm,e.config.globalProperties.$destroyAll=TB.destroyAll,e}},P$=typeof document<`u`;function F$(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function I$(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&F$(e.default)}var L$=Object.assign;function R$(e,t){let n={};for(let r in t){let i=t[r];n[r]=B$(i)?i.map(e):e(i)}return n}var z$=()=>{},B$=Array.isArray;function V$(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var H$=/#/g,U$=/&/g,W$=/\//g,G$=/=/g,K$=/\?/g,q$=/\+/g,J$=/%5B/g,Y$=/%5D/g,X$=/%5E/g,Z$=/%60/g,Q$=/%7B/g,$$=/%7C/g,e1=/%7D/g,t1=/%20/g;function n1(e){return e==null?``:encodeURI(``+e).replace($$,`|`).replace(J$,`[`).replace(Y$,`]`)}function r1(e){return n1(e).replace(Q$,`{`).replace(e1,`}`).replace(X$,`^`)}function i1(e){return n1(e).replace(q$,`%2B`).replace(t1,`+`).replace(H$,`%23`).replace(U$,`%26`).replace(Z$,"`").replace(Q$,`{`).replace(e1,`}`).replace(X$,`^`)}function a1(e){return i1(e).replace(G$,`%3D`)}function o1(e){return n1(e).replace(H$,`%23`).replace(K$,`%3F`)}function s1(e){return o1(e).replace(W$,`%2F`)}function c1(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var l1=/\/$/,u1=e=>e.replace(l1,``);function d1(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=y1(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:c1(o)}}function f1(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function p1(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function m1(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&h1(t.matched[r],n.matched[i])&&g1(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function h1(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function g1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!_1(e[n],t[n]))return!1;return!0}function _1(e,t){return B$(e)?v1(e,t):B$(t)?v1(t,e):e?.valueOf()===t?.valueOf()}function v1(e,t){return B$(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function y1(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var b1={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},x1=function(e){return e.pop=`pop`,e.push=`push`,e}({}),S1=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function C1(e){if(!e)if(P$){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),u1(e)}var w1=/^[^#]+#/;function T1(e,t){return e.replace(w1,`#`)+t}function E1(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var D1=()=>({left:window.scrollX,top:window.scrollY});function O1(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=E1(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function k1(e,t){return(history.state?history.state.position-t:-1)+e}var A1=new Map;function j1(e,t){A1.set(e,t)}function M1(e){let t=A1.get(e);return A1.delete(e),t}function N1(e){return typeof e==`string`||e&&typeof e==`object`}function P1(e){return typeof e==`string`||typeof e==`symbol`}var F1=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),I1=Symbol(``);F1.MATCHER_NOT_FOUND,F1.NAVIGATION_GUARD_REDIRECT,F1.NAVIGATION_ABORTED,F1.NAVIGATION_CANCELLED,F1.NAVIGATION_DUPLICATED;function L1(e,t){return L$(Error(),{type:e,[I1]:!0},t)}function R1(e,t){return e instanceof Error&&I1 in e&&(t==null||!!(e.type&t))}function z1(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;ee&&i1(e)):[r&&i1(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function V1(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=B$(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var H1=Symbol(``),U1=Symbol(``),W1=Symbol(``),G1=Symbol(``),K1=Symbol(``);function q1(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function J1(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(L1(F1.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):N1(e)?c(L1(F1.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Y1(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(F$(s)){let c=(s.__vccOpts||s)[t];c&&a.push(J1(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=I$(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&J1(c,n,r,o,e,i)()}))}}return a}function X1(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oh1(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>h1(e,s))||i.push(s))}return[n,r,i]}var Z1=()=>location.protocol+`//`+location.host;function Q1(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),p1(n,``)}return p1(n,e)+r+i}function $1(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Q1(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:x1.pop,direction:u?u>0?S1.forward:S1.back:S1.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(L$({},e.state,{scroll:D1()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function e0(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?D1():null}}function t0(e){let{history:t,location:n}=window,r={value:Q1(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Z1()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,L$({},t.state,e0(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=L$({},i.value,t.state,{forward:e,scroll:D1()});a(o.current,o,!0),a(e,L$({},e0(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function n0(e){e=C1(e);let t=t0(e),n=$1(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=L$({location:``,base:e,go:r,createHref:T1.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function r0(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),n0(e)}var i0=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),a0=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(a0||{}),o0={type:i0.Static,value:``},s0=/[a-zA-Z0-9_]/;function c0(e){if(!e)return[[]];if(e===`/`)return[[o0]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=a0.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===a0.Static?a.push({type:i0.Static,value:l}):n===a0.Param||n===a0.ParamRegExp||n===a0.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:i0.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;st.length?t.length===1&&t[0]===d0.Static+d0.Segment?1:-1:0}function h0(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}var _0={strict:!1,end:!0,sensitive:!1};function v0(e,t,n){let r=L$(p0(c0(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function y0(e,t){let n=[],r=new Map;t=V$(_0,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=x0(e);s.aliasOf=r&&r.record;let l=V$(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(x0(L$({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=v0(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!C0(d)&&o(e.name)),D0(d)&&c(d),s.children){let e=s.children;for(let t=0;t{o(f)}:z$}function o(e){if(P1(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=T0(e,n);n.splice(t,0,e),e.record.name&&!C0(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw L1(F1.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=L$(b0(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&b0(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw L1(F1.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=L$({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:w0(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function b0(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function x0(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:S0(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function S0(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function C0(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function w0(e){return e.reduce((e,t)=>L$(e,t.meta),{})}function T0(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;h0(e,t[i])<0?r=i:n=i+1}let i=E0(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function E0(e){let t=e;for(;t=t.parent;)if(D0(t)&&h0(e,t)===0)return t}function D0({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function O0(e){let t=g(W1),n=g(G1),r=J(()=>{let n=ze(e.to);return t.resolve(n)}),i=J(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(h1.bind(null,i));if(o>-1)return o;let s=N0(e[t-2]);return t>1&&N0(i)===s&&a[a.length-1].path!==s?a.findIndex(h1.bind(null,e[t-2])):o}),a=J(()=>i.value>-1&&M0(n.params,r.value.params)),o=J(()=>i.value>-1&&i.value===n.matched.length-1&&g1(n.params,r.value.params));function s(n={}){if(j0(n)){let n=t[ze(e.replace)?`replace`:`push`](ze(e.to)).catch(z$);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:J(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function k0(e){return e.length===1?e[0]:e}var A0=u({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:O0,setup(e,{slots:t}){let n=Ne(O0(e)),{options:r}=g(W1),i=J(()=>({[P0(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[P0(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&k0(t.default(n));return e.custom?r:_e(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function j0(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function M0(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!B$(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function N0(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var P0=(e,t,n)=>e??t??n,F0=u({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=g(K1),i=J(()=>e.route||r.value),a=g(U1,0),o=J(()=>{let e=ze(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=J(()=>i.value.matched[o.value]);fe(U1,J(()=>o.value+1)),fe(H1,s),fe(K1,i);let c=H();return G(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!h1(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return I0(n.default,{Component:l,route:r});let u=o.props[a],d=_e(l,L$({},u?u===!0?r.params:typeof u==`function`?u(r):u:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:c}));return I0(n.default,{Component:d,route:r})||d}}});function I0(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var L0=F0;function R0(e){let n=y0(e.routes,e),r=e.parseQuery||z1,i=e.stringifyQuery||B1,a=e.history,o=q1(),s=q1(),c=q1(),l=q(b1),u=b1;P$&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=R$.bind(null,e=>``+e),f=R$.bind(null,s1),p=R$.bind(null,c1);function m(e,t){let r,i;return P1(e)?(r=n.getRecordMatcher(e),i=t):i=e,n.addRoute(i,r)}function h(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)}function g(){return n.getRoutes().map(e=>e.record)}function _(e){return!!n.getRecordMatcher(e)}function v(e,t){if(t=L$({},t||l.value),typeof e==`string`){let i=d1(r,e,t.path),o=n.resolve({path:i.path},t),s=a.createHref(i.fullPath);return L$(i,o,{params:p(o.params),hash:c1(i.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=L$({},e,{path:d1(r,e.path,t.path).path});else{let n=L$({},e.params);for(let e in n)n[e]??delete n[e];o=L$({},e,{params:f(n)}),t.params=f(t.params)}let s=n.resolve(o,t),c=e.hash||``;s.params=d(p(s.params));let u=f1(i,L$({},e,{hash:r1(c),path:s.path})),m=a.createHref(u);return L$({fullPath:u,hash:c,query:i===B1?V1(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function y(e){return typeof e==`string`?d1(r,e,l.value.path):L$({},e)}function b(e,t){if(u!==e)return L1(F1.NAVIGATION_CANCELLED,{from:t,to:e})}function x(e){return w(e)}function S(e){return x(L$(y(e),{replace:!0}))}function C(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=y(i):{path:i},i.params={}),L$({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function w(e,t){let n=u=v(e),r=l.value,a=e.state,o=e.force,s=e.replace===!0,c=C(n,r);if(c)return w(L$(y(c),{state:typeof c==`object`?L$({},a,c.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&m1(i,r,n)&&(f=L1(F1.NAVIGATION_DUPLICATED,{to:d,from:r}),ee(r,r,!0,!1)),(f?Promise.resolve(f):D(d,r)).catch(e=>R1(e)?R1(e,F1.NAVIGATION_GUARD_REDIRECT)?e:L(e):F(e,d,r)).then(e=>{if(e){if(R1(e,F1.NAVIGATION_GUARD_REDIRECT))return w(L$({replace:s},y(e.to),{state:typeof e.to==`object`?L$({},a,e.to.state):a,force:o}),t||d)}else e=k(d,r,!0,s,a);return O(d,r,e),e})}function T(e,t){let n=b(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=R.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function D(e,t){let n,[r,i,a]=X1(e,t);n=Y1(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(J1(r,e,t))});let c=T.bind(null,e,t);return n.push(c),ie(n).then(()=>{n=[];for(let r of o.list())n.push(J1(r,e,t));return n.push(c),ie(n)}).then(()=>{n=Y1(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(J1(r,e,t))});return n.push(c),ie(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(B$(r.beforeEnter))for(let i of r.beforeEnter)n.push(J1(i,e,t));else n.push(J1(r.beforeEnter,e,t));return n.push(c),ie(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Y1(a,`beforeRouteEnter`,e,t,E),n.push(c),ie(n))).then(()=>{n=[];for(let r of s.list())n.push(J1(r,e,t));return n.push(c),ie(n)}).catch(e=>R1(e,F1.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function O(e,t,n){c.list().forEach(r=>E(()=>r(e,t,n)))}function k(e,t,n,r,i){let o=b(e,t);if(o)return o;let s=t===b1,c=P$?history.state:{};n&&(r||s?a.replace(e.fullPath,L$({scroll:s&&c&&c.scroll},i)):a.push(e.fullPath,i)),l.value=e,ee(e,t,n,s),L()}let A;function j(){A||=a.listen((e,t,n)=>{if(!re.listening)return;let r=v(e),i=C(r,re.currentRoute.value);if(i){w(L$(i,{replace:!0,force:!0}),r).catch(z$);return}u=r;let o=l.value;P$&&j1(k1(o.fullPath,n.delta),D1()),D(r,o).catch(e=>R1(e,F1.NAVIGATION_ABORTED|F1.NAVIGATION_CANCELLED)?e:R1(e,F1.NAVIGATION_GUARD_REDIRECT)?(w(L$(y(e.to),{force:!0}),r).then(e=>{R1(e,F1.NAVIGATION_ABORTED|F1.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===x1.pop&&a.go(-1,!1)}).catch(z$),Promise.reject()):(n.delta&&a.go(-n.delta,!1),F(e,r,o))).then(e=>{e||=k(r,o,!1),e&&(n.delta&&!R1(e,F1.NAVIGATION_CANCELLED)?a.go(-n.delta,!1):n.type===x1.pop&&R1(e,F1.NAVIGATION_ABORTED|F1.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),O(r,o,e)}).catch(z$)})}let M=q1(),N=q1(),P;function F(e,t,n){L(e);let r=N.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function I(){return P&&l.value!==b1?Promise.resolve():new Promise((e,t)=>{M.add([e,t])})}function L(e){return P||(P=!e,j(),M.list().forEach(([t,n])=>e?n(e):t()),M.reset()),e}function ee(t,n,r,i){let{scrollBehavior:a}=e;if(!P$||!a)return Promise.resolve();let o=!r&&M1(k1(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return z().then(()=>a(t,n,o)).then(e=>e&&O1(e)).catch(e=>F(e,t,n))}let te=e=>a.go(e),ne,R=new Set,re={currentRoute:l,listening:!0,addRoute:m,removeRoute:h,clearRoutes:n.clearRoutes,hasRoute:_,getRoutes:g,resolve:v,options:e,push:x,replace:S,go:te,back:()=>te(-1),forward:()=>te(1),beforeEach:o.add,beforeResolve:s.add,afterEach:c.add,onError:N.add,isReady:I,install(e){e.component(`RouterLink`,A0),e.component(`RouterView`,L0),e.config.globalProperties.$router=re,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>ze(l)}),P$&&!ne&&l.value===b1&&(ne=!0,x(a.location).catch(e=>{}));let n={};for(let e in b1)Object.defineProperty(n,e,{get:()=>l.value[e],enumerable:!0});e.provide(W1,re),e.provide(G1,t(n)),e.provide(K1,l);let r=e.unmount;R.add(e),e.unmount=function(){R.delete(e),R.size<1&&(u=b1,A&&A(),A=null,l.value=b1,ne=!1,P=!1),r()}}};function ie(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return re}function z0(){return g(W1)}function B0(e){return g(G1)}var V0=u({__name:`App`,setup(e){let t=z0(),n=B0(),r=H(!1),i=H([String(n.name)]);G(()=>n.name,e=>{i.value=[String(e)]});let a=[{key:`Dashboard`,icon:qZ,label:`仪表盘`},{key:`Settings`,icon:UZ,label:`系统设置`},{key:`Configs`,icon:aQ,label:`品牌配置`},{key:`SysCategories`,icon:zZ,label:`默认分类`},{key:`Personas`,icon:lQ,label:`AI 性格`},{key:`Avatars`,icon:ZZ,label:`AI 形象`},{key:`Stickers`,icon:tQ,label:`表情包库`},{key:`Users`,icon:dn,label:`用户管理`}];return(e,n)=>{let o=s(`a-menu-item`),c=s(`a-menu`),l=s(`a-layout-sider`),u=s(`router-view`),d=s(`a-layout-content`),f=s(`a-layout`);return L(),Jt(f,{style:{"min-height":`100vh`}},{default:P(()=>[U(l,{collapsed:r.value,"onUpdate:collapsed":n[2]||=e=>r.value=e,collapsible:``,theme:`light`,width:200,style:{"border-right":`1px solid #f0f0f0`}},{default:P(()=>[n[3]||=Fe(`div`,{style:{padding:`18px 20px`,"font-size":`16px`,"font-weight":`700`,"white-space":`nowrap`,overflow:`hidden`}},[Fe(`span`,{style:{color:`#00B386`,"margin-right":`6px`}},`🐱`),en(`喵记账 Admin `)],-1),U(c,{selectedKeys:i.value,"onUpdate:selectedKeys":n[0]||=e=>i.value=e,mode:`inline`,style:{borderRight:0},onClick:n[1]||=({key:e})=>ze(t).push({name:e})},{default:P(()=>[(L(),He($e,null,an(a,e=>U(o,{key:e.key},{default:P(()=>[(L(),Jt(T(e.icon))),Fe(`span`,null,Et(e.label),1)]),_:2},1024)),64))]),_:1},8,[`selectedKeys`]),n[4]||=Fe(`div`,{style:{position:`absolute`,bottom:`16px`,left:`20px`,"font-size":`11px`,color:`#bbb`}},`v20260718-1630`,-1)]),_:1},8,[`collapsed`]),U(f,null,{default:P(()=>[U(d,{style:{margin:`18px 20px`,padding:`20px`,background:`#fff`,"border-radius":`10px`,"min-height":`360px`}},{default:P(()=>[U(u)]),_:1})]),_:1})]),_:1})}}}),H0=`modulepreload`,U0=function(e){return`/`+e},W0={},G0=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=U0(t,n),t=s(t),t in W0)return;W0[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:H0,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},K0=R0({history:r0(),routes:[{path:`/`,redirect:`/dashboard`},{path:`/dashboard`,name:`Dashboard`,component:()=>G0(()=>import(`./Dashboard-CQIRtW2A.js`),__vite__mapDeps([0,1,2,3]))},{path:`/settings`,name:`Settings`,component:()=>G0(()=>import(`./Settings-EMIo5EVq.js`),__vite__mapDeps([4,1,3]))},{path:`/configs`,name:`Configs`,component:()=>G0(()=>import(`./Configs-CBb0vA8L.js`),__vite__mapDeps([5,1,3]))},{path:`/categories`,name:`SysCategories`,component:()=>G0(()=>import(`./SysCategories-BGspm7GG.js`),__vite__mapDeps([6,1,7,3]))},{path:`/personas`,name:`Personas`,component:()=>G0(()=>import(`./Personas-CyY-EFRT.js`),__vite__mapDeps([8,1,7,3]))},{path:`/avatars`,name:`Avatars`,component:()=>G0(()=>import(`./Avatars-MuMOZ3tF.js`),__vite__mapDeps([9,1,7,3]))},{path:`/stickers`,name:`Stickers`,component:()=>G0(()=>import(`./Stickers-5pBxfoSQ.js`),__vite__mapDeps([10,1,7,3]))},{path:`/users`,name:`Users`,component:()=>G0(()=>import(`./Users-B1R9gLaP.js`),__vite__mapDeps([11,1,12,3]))}]}),q0=Rt(V0);q0.use(K0),q0.use(N$),q0.mount(`#app`);export{yn as t}; \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/favicon.svg b/backend/MiaoJiZhang.Api/wwwroot/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backend/MiaoJiZhang.Api/wwwroot/icons.svg b/backend/MiaoJiZhang.Api/wwwroot/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/MiaoJiZhang.Api/wwwroot/index.html b/backend/MiaoJiZhang.Api/wwwroot/index.html new file mode 100644 index 0000000..332826c --- /dev/null +++ b/backend/MiaoJiZhang.Api/wwwroot/index.html @@ -0,0 +1,18 @@ + + + + + + + admin-web + + + + + + + + +
+ + diff --git a/backend/MiaoJiZhang.Domain/Entities/AdminContent.cs b/backend/MiaoJiZhang.Domain/Entities/AdminContent.cs new file mode 100644 index 0000000..3cf6dad --- /dev/null +++ b/backend/MiaoJiZhang.Domain/Entities/AdminContent.cs @@ -0,0 +1,57 @@ +namespace MiaoJiZhang.Domain.Entities; + +/// +/// 后台可配置内容(决策:App 名称等品牌位后台配置;性格 Prompt/文案/表情包后台管理)。 +/// 统一 key-value + 版本号,客户端按版本增量拉取。 +/// +public class AppConfig +{ + public long Id { get; set; } + /// 如 brand.app_name / brand.logo_url / llm.model / limit.daily_ai_messages + public string Key { get; set; } = null!; + public string Value { get; set; } = null!; + public int Version { get; set; } + public DateTime UpdatedAt { get; set; } +} + +/// AI 性格库(后台管理,Prompt 可调不发版) +public class AiPersona +{ + public long Id { get; set; } + /// 如 sassy_cat / gentle / strict / meme + public string Key { get; set; } = null!; + public string Name { get; set; } = null!; + public string Description { get; set; } = null!; + public string SampleLine { get; set; } = null!; + /// 系统提示词模板,支持 {avatar_tic} 等占位符 + public string PromptTemplate { get; set; } = null!; + public int Version { get; set; } + public bool IsEnabled { get; set; } = true; +} + +/// AI 形象库(后台管理;口癖跟随形象——决策 20) +public class AiAvatar +{ + public long Id { get; set; } + /// cat / dog / robot ... + public string Key { get; set; } = null!; + public string DefaultName { get; set; } = null!; + /// 口癖后缀,如 喵 / 汪 / 空字符串 + public string SpeechTic { get; set; } = ""; + public string? ImageUrl { get; set; } + public bool IsEnabled { get; set; } = true; +} + +/// 表情包库(后台管理) +public class Sticker +{ + public long Id { get; set; } + public string Key { get; set; } = null!; + public string Label { get; set; } = null!; + public string? ImageUrl { get; set; } + /// 分组:ai_exclusive / classic ... + public string GroupKey { get; set; } = "classic"; + /// 触发场景标签,逗号分隔:over_budget,salary,forgive + public string? TriggerTags { get; set; } + public bool IsEnabled { get; set; } = true; +} diff --git a/backend/MiaoJiZhang.Domain/Entities/Ledger.cs b/backend/MiaoJiZhang.Domain/Entities/Ledger.cs new file mode 100644 index 0000000..9c331e5 --- /dev/null +++ b/backend/MiaoJiZhang.Domain/Entities/Ledger.cs @@ -0,0 +1,92 @@ +using MiaoJiZhang.Domain.Enums; + +namespace MiaoJiZhang.Domain.Entities; + +/// 账本(支持多账本/共享账本) +public class Ledger +{ + public long Id { get; set; } + public long OwnerId { get; set; } + public User Owner { get; set; } = null!; + public string Name { get; set; } = null!; + public string IconKey { get; set; } = "wallet"; + public bool IsDefault { get; set; } + public DateTime CreatedAt { get; set; } + + public List Transactions { get; set; } = []; + public List Budgets { get; set; } = []; +} + +/// 分类(系统默认分类 UserId 为 null;用户自定义分类挂 UserId) +public class Category +{ + public long Id { get; set; } + /// null = 系统默认分类(后台可管理) + public long? UserId { get; set; } + public TransactionType Type { get; set; } + public string Name { get; set; } = null!; + public string IconKey { get; set; } = "tag"; + public string ColorKey { get; set; } = "mint"; + public int SortOrder { get; set; } + public bool IsDeleted { get; set; } +} + +/// 账单 +public class Transaction +{ + public long Id { get; set; } + public long LedgerId { get; set; } + public Ledger Ledger { get; set; } = null!; + public long UserId { get; set; } + public long CategoryId { get; set; } + public Category Category { get; set; } = null!; + + public TransactionType Type { get; set; } + public decimal Amount { get; set; } + public string? Note { get; set; } + public string? PaymentMethod { get; set; } + public DateTime OccurredAt { get; set; } + + // ---- AI 来源追溯(决策:可核对、可撤销) ---- + public TransactionSource Source { get; set; } = TransactionSource.Manual; + /// AI 记账时用户的原话(追溯用) + public string? SourceText { get; set; } + /// 关联的聊天消息 Id(追溯用) + public long? SourceChatMessageId { get; set; } + public string? ClientRequestId { get; set; } + + // ---- 软删除(决策:直接入账 + 可撤销) ---- + public bool IsDeleted { get; set; } + public DateTime? DeletedAt { get; set; } + + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } +} + +/// 预算(CategoryId 为 null 表示总预算) +public class Budget +{ + public long Id { get; set; } + public long LedgerId { get; set; } + public Ledger Ledger { get; set; } = null!; + public long UserId { get; set; } + /// null = 月度总预算 + public long? CategoryId { get; set; } + /// 格式 yyyyMM;0 表示长期生效模板 + public int Period { get; set; } + public decimal Amount { get; set; } +} + +/// AI 聊天消息 +public class ChatMessage +{ + public long Id { get; set; } + public long UserId { get; set; } + public ChatRole Role { get; set; } + public ChatMessageType Type { get; set; } + /// 文本内容 / 表情包 key / 卡片 JSON + public string Content { get; set; } = null!; + /// 该消息产生的账单 Id(BillCard 类型) + public long? TransactionId { get; set; } + public DateTime CreatedAt { get; set; } +} diff --git a/backend/MiaoJiZhang.Domain/Entities/User.cs b/backend/MiaoJiZhang.Domain/Entities/User.cs new file mode 100644 index 0000000..b030714 --- /dev/null +++ b/backend/MiaoJiZhang.Domain/Entities/User.cs @@ -0,0 +1,77 @@ +using MiaoJiZhang.Domain.Enums; + +namespace MiaoJiZhang.Domain.Entities; + +/// +/// 用户。当前仅用户名+密码注册登录; +/// Email/Phone/微信等字段为预留(决策 2026-07-18),暂不启用。 +/// +public class User +{ + public long Id { get; set; } + public string Username { get; set; } = null!; + public string PasswordHash { get; set; } = null!; + public string? Nickname { get; set; } + public string? AvatarUrl { get; set; } + + // ---- 预留:快捷登录(暂不启用,仅建表占位) ---- + public string? Email { get; set; } + public bool EmailVerified { get; set; } + public string? Phone { get; set; } + public bool PhoneVerified { get; set; } + public string? WeChatOpenId { get; set; } + public string? WeChatUnionId { get; set; } + public string? AppleUserId { get; set; } + + // ---- 模式与 AI 伙伴设置 ---- + public AppMode AppMode { get; set; } = AppMode.Normal; + public AiCompanionSetting? AiCompanion { get; set; } + + public bool IsBanned { get; set; } + public int AuthVersion { get; set; } + public int AiChatLimit { get; set; } = 50; + public AiQuotaPeriod AiChatPeriod { get; set; } = AiQuotaPeriod.Day; + public int AiChatUsed { get; set; } + public DateTime AiChatWindowStartedAt { get; set; } + public DateTime? AccountClosureRequestedAt { get; set; } + public DateTime? AccountClosureScheduledAt { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime? LastLoginAt { get; set; } + + public List Ledgers { get; set; } = []; + public List FeaturePermissions { get; set; } = []; +} + +/// AI 伙伴设置(形象/昵称/性格/滑杆),1:1 User +public class UserFeaturePermission +{ + public long Id { get; set; } + public long UserId { get; set; } + public User User { get; set; } = null!; + public string PermissionKey { get; set; } = null!; + public bool IsEnabled { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } +} + +public class AiCompanionSetting +{ + public long Id { get; set; } + public long UserId { get; set; } + public User User { get; set; } = null!; + + /// 形象 key:cat / dog / robot(后台形象库可扩展) + public string AvatarKey { get; set; } = "cat"; + /// 用户给 AI 起的名字;空则用形象默认名 + public string? CustomName { get; set; } + /// 性格 key,对应后台性格库 + public string PersonaKey { get; set; } = "sassy_cat"; + + /// 吐槽力度 0-100 + public int RoastLevel { get; set; } = 60; + /// 表情包频率 0-100 + public int StickerFrequency { get; set; } = 70; + /// 主动提醒频率 0-100(映射:关/每周/每天/实时) + public int ProactiveLevel { get; set; } = 40; +} + diff --git a/backend/MiaoJiZhang.Domain/Enums/Enums.cs b/backend/MiaoJiZhang.Domain/Enums/Enums.cs new file mode 100644 index 0000000..bd9d346 --- /dev/null +++ b/backend/MiaoJiZhang.Domain/Enums/Enums.cs @@ -0,0 +1,76 @@ +namespace MiaoJiZhang.Domain.Enums; + +public enum AiQuotaPeriod +{ + Day = 0, + Week = 1, + Month = 2, +} + +/// App 模式(决策:双模式) +public enum AppMode +{ + /// 普通记账模式 + Normal = 0, + /// 全 AI 模式 + AiFirst = 1, +} + +/// 账单类型 +public enum TransactionType +{ + Expense = 0, + Income = 1, + Transfer = 2, +} + +/// 账单来源(决策:AI 记账可追溯) +public enum TransactionSource +{ + Manual = 0, + AiChat = 1, + Voice = 2, + ReceiptOcr = 3, + Screenshot = 4, + Accessibility = 5, + Notification = 6, + RecognitionAi = 7, + LocalOcr = 8, +} + +public static class TransactionSourceRules +{ + public static readonly TransactionSource[] AiAssisted = + [ + TransactionSource.AiChat, + TransactionSource.Voice, + TransactionSource.ReceiptOcr, + TransactionSource.Screenshot, + TransactionSource.RecognitionAi, + ]; + + public static bool IsAiAssisted(this TransactionSource source) => + source is TransactionSource.AiChat + or TransactionSource.Voice + or TransactionSource.ReceiptOcr + or TransactionSource.Screenshot + or TransactionSource.RecognitionAi; +} + +/// 聊天消息角色 +public enum ChatRole +{ + User = 0, + Assistant = 1, + System = 2, +} + +/// 聊天消息类型 +public enum ChatMessageType +{ + Text = 0, + Sticker = 1, + BillCard = 2, + ReportCard = 3, + ContextBoundary = 4, +} diff --git a/backend/MiaoJiZhang.Domain/MiaoJiZhang.Domain.csproj b/backend/MiaoJiZhang.Domain/MiaoJiZhang.Domain.csproj new file mode 100644 index 0000000..cdc91ea --- /dev/null +++ b/backend/MiaoJiZhang.Domain/MiaoJiZhang.Domain.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/backend/MiaoJiZhang.Infrastructure/MiaoJiZhang.Infrastructure.csproj b/backend/MiaoJiZhang.Infrastructure/MiaoJiZhang.Infrastructure.csproj new file mode 100644 index 0000000..0c70312 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/MiaoJiZhang.Infrastructure.csproj @@ -0,0 +1,21 @@ + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + net9.0 + enable + enable + + + diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/AppDbContext.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/AppDbContext.cs new file mode 100644 index 0000000..8b0d733 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/AppDbContext.cs @@ -0,0 +1,100 @@ +using MiaoJiZhang.Domain.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace MiaoJiZhang.Infrastructure.Persistence; + +public class AppDbContext(DbContextOptions options) : DbContext(options) +{ + public DbSet Users => Set(); + public DbSet UserFeaturePermissions => Set(); + public DbSet AiCompanionSettings => Set(); + public DbSet Ledgers => Set(); + public DbSet Categories => Set(); + public DbSet Transactions => Set(); + public DbSet Budgets => Set(); + public DbSet ChatMessages => Set(); + public DbSet AppConfigs => Set(); + public DbSet AiPersonas => Set(); + public DbSet AiAvatars => Set(); + public DbSet Stickers => Set(); + + protected override void OnModelCreating(ModelBuilder b) + { + b.Entity(e => + { + e.HasIndex(x => x.Username).IsUnique(); + e.Property(x => x.Username).HasMaxLength(32); + e.Property(x => x.Nickname).HasMaxLength(32); + // 预留字段索引(唯一但允许 null) + e.HasIndex(x => x.Email).IsUnique(); + e.HasIndex(x => x.Phone).IsUnique(); + e.HasIndex(x => x.WeChatOpenId).IsUnique(); + e.HasIndex(x => x.AccountClosureScheduledAt); + e.HasOne(x => x.AiCompanion).WithOne(x => x.User) + .HasForeignKey(x => x.UserId); + }); + + b.Entity(e => + { + e.Property(x => x.PermissionKey).HasMaxLength(32); + e.HasIndex(x => new { x.UserId, x.PermissionKey }).IsUnique(); + e.HasOne(x => x.User).WithMany(x => x.FeaturePermissions) + .HasForeignKey(x => x.UserId).OnDelete(DeleteBehavior.Cascade); + }); + + b.Entity(e => + { + e.Property(x => x.Amount).HasPrecision(12, 2); + e.HasIndex(x => new { x.LedgerId, x.OccurredAt }); + e.HasIndex(x => new { x.UserId, x.IsDeleted }); + e.Property(x => x.ClientRequestId).HasMaxLength(64); + e.HasIndex(x => new { x.UserId, x.ClientRequestId }).IsUnique(); + e.HasQueryFilter(x => !x.IsDeleted); // 软删除全局过滤 + }); + + b.Entity(e => e.Property(x => x.ColorKey).HasMaxLength(32)); + + b.Entity(e => + { + e.Property(x => x.Amount).HasPrecision(12, 2); + e.HasIndex(x => new { x.LedgerId, x.Period, x.CategoryId }).IsUnique(); + }); + + b.Entity(e => e.HasIndex(x => new { x.UserId, x.CreatedAt })); + b.Entity(e => e.HasIndex(x => x.Key).IsUnique()); + b.Entity(e => e.HasIndex(x => x.Key).IsUnique()); + b.Entity(e => e.HasIndex(x => x.Key).IsUnique()); + b.Entity(e => e.HasIndex(x => x.Key).IsUnique()); + + // MySQL DATETIME has no timezone metadata. Preserve stored UTC wall-clock + // values and restore DateTimeKind.Utc whenever EF materializes them. + var utcDateTimeConverter = new ValueConverter( + value => value.Kind == DateTimeKind.Local + ? value.ToUniversalTime() + : DateTime.SpecifyKind(value, DateTimeKind.Utc), + value => DateTime.SpecifyKind(value, DateTimeKind.Utc)); + var nullableUtcDateTimeConverter = new ValueConverter( + value => value.HasValue + ? value.Value.Kind == DateTimeKind.Local + ? value.Value.ToUniversalTime() + : DateTime.SpecifyKind(value.Value, DateTimeKind.Utc) + : value, + value => value.HasValue + ? DateTime.SpecifyKind(value.Value, DateTimeKind.Utc) + : value); + + foreach (var property in b.Model.GetEntityTypes().SelectMany(entity => entity.GetProperties())) + { + if (property.ClrType == typeof(DateTime)) + { + property.SetValueConverter(utcDateTimeConverter); + } + else if (property.ClrType == typeof(DateTime?)) + { + property.SetValueConverter(nullableUtcDateTimeConverter); + } + } + } +} + diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/DbSeeder.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/DbSeeder.cs new file mode 100644 index 0000000..5648ad7 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/DbSeeder.cs @@ -0,0 +1,128 @@ +using MiaoJiZhang.Domain.Entities; +using MiaoJiZhang.Domain.Enums; +using Microsoft.EntityFrameworkCore; + +namespace MiaoJiZhang.Infrastructure.Persistence; + +/// 启动种子:默认分类、AI 形象/性格、品牌配置 +public static class DbSeeder +{ + public static async Task SeedAsync(AppDbContext db) + { + if (!await db.AiAvatars.AnyAsync()) + { + db.AiAvatars.AddRange( + new AiAvatar { Key = "cat", DefaultName = "小账喵", SpeechTic = "喵" }, + new AiAvatar { Key = "dog", DefaultName = "阿福汪", SpeechTic = "汪" }, + new AiAvatar { Key = "robot", DefaultName = "账小智", SpeechTic = "" }); + } + + if (!await db.AiPersonas.AnyAsync()) + { + db.AiPersonas.AddRange( + new AiPersona { Key = "sassy_cat", Name = "毒舌猫娘", Description = "嘴上嫌弃,心里关心,乱花钱会被吐槽", SampleLine = "又点外卖?你的钱包已经瘦成纸片了{tic}!", PromptTemplate = "你是用户的记账助手,性格毒舌但关心用户。回复末尾口癖:{tic}。", Version = 1 }, + new AiPersona { Key = "gentle", Name = "温柔小暖", Description = "永远鼓励你,温柔提醒不施压", SampleLine = "记好啦,偶尔犒劳自己也是应该的呀", PromptTemplate = "你是用户的记账助手,性格温柔鼓励。口癖:{tic}。", Version = 1 }, + new AiPersona { Key = "strict", Name = "严格管家", Description = "专业理性,盯紧预算,数据说话", SampleLine = "本笔支出使餐饮预算达到 87%,请注意。", PromptTemplate = "你是用户的记账管家,专业理性,用数据说话,不用口癖。", Version = 1 }, + new AiPersona { Key = "meme", Name = "沙雕损友", Description = "玩梗高手,表情包狂魔,快乐记账", SampleLine = "家人们谁懂啊,他又双叒叕买奶茶了", PromptTemplate = "你是用户的记账损友,爱玩梗爱发表情包。口癖:{tic}。", Version = 1 }); + } + + if (!await db.Categories.AnyAsync(c => c.UserId == null)) + { + string[,] expense = + { + { "餐饮", "food", "coral" }, + { "饮品", "cup", "cyan" }, + { "购物", "cart", "blue" }, + { "交通", "metro", "teal" }, + { "住房", "house", "sand" }, + { "娱乐", "game", "violet" }, + { "医疗", "pill", "red" }, + { "学习", "book", "indigo" }, + { "服饰", "shirt", "plum" }, + { "人情", "gift", "rose" }, + { "旅行", "plane", "sky" }, + { "其他", "tag", "graphite" }, + }; + for (var i = 0; i < expense.GetLength(0); i++) + db.Categories.Add(new Category + { + Type = TransactionType.Expense, + Name = expense[i, 0], + IconKey = expense[i, 1], + ColorKey = expense[i, 2], + SortOrder = i, + }); + + string[,] income = + { + { "工资", "money", "mint" }, + { "兼职", "briefcase", "forest" }, + { "理财", "chart", "navy" }, + { "红包", "gift", "orange" }, + { "报销", "card", "amber" }, + { "奖金", "sparkle", "aqua" }, + { "其他", "tag", "lime" }, + }; + for (var i = 0; i < income.GetLength(0); i++) + db.Categories.Add(new Category + { + Type = TransactionType.Income, + Name = income[i, 0], + IconKey = income[i, 1], + ColorKey = income[i, 2], + SortOrder = i, + }); + } + + if (!await db.Stickers.AnyAsync()) + { + db.Stickers.AddRange( + new Sticker { Key = "salary", Label = "发工资啦", GroupKey = "ai_exclusive", TriggerTags = "salary" }, + new Sticker { Key = "forgive", Label = "求原谅", GroupKey = "ai_exclusive", TriggerTags = "forgive" }, + new Sticker { Key = "fire", Label = "剁手警告", GroupKey = "ai_exclusive", TriggerTags = "over_budget" }, + new Sticker { Key = "empty_wallet", Label = "钱包空空", GroupKey = "ai_exclusive" }, + new Sticker { Key = "angry", Label = "生气", GroupKey = "ai_exclusive" }, + new Sticker { Key = "happy", Label = "开心", GroupKey = "ai_exclusive" }, + new Sticker { Key = "treat", Label = "犒劳自己", GroupKey = "classic" }, + new Sticker { Key = "shopping_joy", Label = "购物狂喜", GroupKey = "classic" }); + } + + if (!await db.AppConfigs.AnyAsync()) + { + var now = DateTime.UtcNow; + db.AppConfigs.AddRange( + new AppConfig { Key = "brand.app_name", Value = "记之", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "brand.slogan", Value = "会聊天的记账本 · 让 AI 帮你管钱", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "brand.logo_url", Value = "", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "llm.protocol", Value = "chat_completions", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "llm.base_url", Value = "https://api.openai.com/v1", Version = 1, UpdatedAt = now }, + + new AppConfig { Key = "llm.model", Value = "gpt-4o-mini", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "llm.max_tokens", Value = "1024", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "llm.temperature", Value = "0.8", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "limit.daily_ai_messages", Value = "200", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "limit.daily_ai_messages_per_user", Value = "50", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "limit.max_monthly_budget", Value = "99999999", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "feature.ocr_enabled", Value = "true", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "feature.voice_enabled", Value = "true", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "feature.ai_auto_book", Value = "true", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "feature.sticker_enabled", Value = "true", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "system.default_ledger_name", Value = "日常账本", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "system.max_ledgers_per_user", Value = "10", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "feature.screenshot_bookkeeping_enabled", Value = "true", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "permission.default.ai_enabled", Value = "true", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "quota.default_ai_chat_limit", Value = "50", Version = 1, UpdatedAt = now }, + new AppConfig { Key = "quota.default_ai_chat_period", Value = "day", Version = 1, UpdatedAt = now }); + } + + var appName = await db.AppConfigs.FirstOrDefaultAsync(config => config.Key == "brand.app_name"); + if (appName?.Value is "喵记账" or "喵记") + { + appName.Value = "记之"; + appName.Version++; + appName.UpdatedAt = DateTime.UtcNow; + } + + await db.SaveChangesAsync(); + } +} diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260720063643_InitialBaseline.Designer.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260720063643_InitialBaseline.Designer.cs new file mode 100644 index 0000000..8d0a3a3 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260720063643_InitialBaseline.Designer.cs @@ -0,0 +1,548 @@ +// +using System; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260720063643_InitialBaseline")] + partial class InitialBaseline + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiAvatar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DefaultName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ImageUrl") + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("SpeechTic") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("AiAvatars"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiCompanionSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AvatarKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CustomName") + .HasColumnType("longtext"); + + b.Property("PersonaKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ProactiveLevel") + .HasColumnType("int"); + + b.Property("RoastLevel") + .HasColumnType("int"); + + b.Property("StickerFrequency") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("AiCompanionSettings"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiPersona", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PromptTemplate") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SampleLine") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("AiPersonas"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AppConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("AppConfigs"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Budget", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasPrecision(12, 2) + .HasColumnType("decimal(12,2)"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("LedgerId") + .HasColumnType("bigint"); + + b.Property("Period") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LedgerId", "Period", "CategoryId") + .IsUnique(); + + b.ToTable("Budgets"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("IconKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.ChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Role") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "CreatedAt"); + + b.ToTable("ChatMessages"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("IconKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OwnerId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("Ledgers"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Sticker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("GroupKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ImageUrl") + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Label") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TriggerTags") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("Stickers"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasPrecision(12, 2) + .HasColumnType("decimal(12,2)"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LedgerId") + .HasColumnType("bigint"); + + b.Property("Note") + .HasColumnType("longtext"); + + b.Property("OccurredAt") + .HasColumnType("datetime(6)"); + + b.Property("PaymentMethod") + .HasColumnType("longtext"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("SourceChatMessageId") + .HasColumnType("bigint"); + + b.Property("SourceText") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("LedgerId", "OccurredAt"); + + b.HasIndex("UserId", "IsDeleted"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AppMode") + .HasColumnType("int"); + + b.Property("AppleUserId") + .HasColumnType("longtext"); + + b.Property("AvatarUrl") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Email") + .HasColumnType("varchar(255)"); + + b.Property("EmailVerified") + .HasColumnType("tinyint(1)"); + + b.Property("IsBanned") + .HasColumnType("tinyint(1)"); + + b.Property("LastLoginAt") + .HasColumnType("datetime(6)"); + + b.Property("Nickname") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Phone") + .HasColumnType("varchar(255)"); + + b.Property("PhoneVerified") + .HasColumnType("tinyint(1)"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("WeChatOpenId") + .HasColumnType("varchar(255)"); + + b.Property("WeChatUnionId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.HasIndex("Phone") + .IsUnique(); + + b.HasIndex("Username") + .IsUnique(); + + b.HasIndex("WeChatOpenId") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiCompanionSetting", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.User", "User") + .WithOne("AiCompanion") + .HasForeignKey("MiaoJiZhang.Domain.Entities.AiCompanionSetting", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Budget", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.Ledger", "Ledger") + .WithMany("Budgets") + .HasForeignKey("LedgerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ledger"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.User", "Owner") + .WithMany("Ledgers") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Transaction", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("MiaoJiZhang.Domain.Entities.Ledger", "Ledger") + .WithMany("Transactions") + .HasForeignKey("LedgerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Ledger"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b => + { + b.Navigation("Budgets"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.User", b => + { + b.Navigation("AiCompanion"); + + b.Navigation("Ledgers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260720063643_InitialBaseline.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260720063643_InitialBaseline.cs new file mode 100644 index 0000000..b0e6a75 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260720063643_InitialBaseline.cs @@ -0,0 +1,431 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations +{ + /// + public partial class InitialBaseline : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AiAvatars", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultName = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SpeechTic = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ImageUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AiAvatars", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AiPersonas", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SampleLine = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + PromptTemplate = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Version = table.Column(type: "int", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AiPersonas", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppConfigs", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Version = table.Column(type: "int", nullable: false), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppConfigs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Categories", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(type: "bigint", nullable: true), + Type = table.Column(type: "int", nullable: false), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IconKey = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SortOrder = table.Column(type: "int", nullable: false), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Categories", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ChatMessages", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(type: "bigint", nullable: false), + Role = table.Column(type: "int", nullable: false), + Type = table.Column(type: "int", nullable: false), + Content = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TransactionId = table.Column(type: "bigint", nullable: true), + CreatedAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ChatMessages", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Stickers", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Label = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ImageUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + GroupKey = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TriggerTags = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Stickers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Username = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + PasswordHash = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Nickname = table.Column(type: "varchar(32)", maxLength: 32, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EmailVerified = table.Column(type: "tinyint(1)", nullable: false), + Phone = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneVerified = table.Column(type: "tinyint(1)", nullable: false), + WeChatOpenId = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + WeChatUnionId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AppleUserId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AppMode = table.Column(type: "int", nullable: false), + IsBanned = table.Column(type: "tinyint(1)", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + LastLoginAt = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AiCompanionSettings", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(type: "bigint", nullable: false), + AvatarKey = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CustomName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PersonaKey = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + RoastLevel = table.Column(type: "int", nullable: false), + StickerFrequency = table.Column(type: "int", nullable: false), + ProactiveLevel = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AiCompanionSettings", x => x.Id); + table.ForeignKey( + name: "FK_AiCompanionSettings_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Ledgers", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + OwnerId = table.Column(type: "bigint", nullable: false), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IconKey = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDefault = table.Column(type: "tinyint(1)", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Ledgers", x => x.Id); + table.ForeignKey( + name: "FK_Ledgers_Users_OwnerId", + column: x => x.OwnerId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Budgets", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + LedgerId = table.Column(type: "bigint", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + CategoryId = table.Column(type: "bigint", nullable: true), + Period = table.Column(type: "int", nullable: false), + Amount = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Budgets", x => x.Id); + table.ForeignKey( + name: "FK_Budgets_Ledgers_LedgerId", + column: x => x.LedgerId, + principalTable: "Ledgers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Transactions", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + LedgerId = table.Column(type: "bigint", nullable: false), + UserId = table.Column(type: "bigint", nullable: false), + CategoryId = table.Column(type: "bigint", nullable: false), + Type = table.Column(type: "int", nullable: false), + Amount = table.Column(type: "decimal(12,2)", precision: 12, scale: 2, nullable: false), + Note = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PaymentMethod = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OccurredAt = table.Column(type: "datetime(6)", nullable: false), + Source = table.Column(type: "int", nullable: false), + SourceText = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SourceChatMessageId = table.Column(type: "bigint", nullable: true), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + DeletedAt = table.Column(type: "datetime(6)", nullable: true), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Transactions", x => x.Id); + table.ForeignKey( + name: "FK_Transactions_Categories_CategoryId", + column: x => x.CategoryId, + principalTable: "Categories", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Transactions_Ledgers_LedgerId", + column: x => x.LedgerId, + principalTable: "Ledgers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AiAvatars_Key", + table: "AiAvatars", + column: "Key", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AiCompanionSettings_UserId", + table: "AiCompanionSettings", + column: "UserId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AiPersonas_Key", + table: "AiPersonas", + column: "Key", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AppConfigs_Key", + table: "AppConfigs", + column: "Key", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Budgets_LedgerId_Period_CategoryId", + table: "Budgets", + columns: new[] { "LedgerId", "Period", "CategoryId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ChatMessages_UserId_CreatedAt", + table: "ChatMessages", + columns: new[] { "UserId", "CreatedAt" }); + + migrationBuilder.CreateIndex( + name: "IX_Ledgers_OwnerId", + table: "Ledgers", + column: "OwnerId"); + + migrationBuilder.CreateIndex( + name: "IX_Stickers_Key", + table: "Stickers", + column: "Key", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_CategoryId", + table: "Transactions", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_LedgerId_OccurredAt", + table: "Transactions", + columns: new[] { "LedgerId", "OccurredAt" }); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_UserId_IsDeleted", + table: "Transactions", + columns: new[] { "UserId", "IsDeleted" }); + + migrationBuilder.CreateIndex( + name: "IX_Users_Email", + table: "Users", + column: "Email", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Users_Phone", + table: "Users", + column: "Phone", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Users_Username", + table: "Users", + column: "Username", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Users_WeChatOpenId", + table: "Users", + column: "WeChatOpenId", + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AiAvatars"); + + migrationBuilder.DropTable( + name: "AiCompanionSettings"); + + migrationBuilder.DropTable( + name: "AiPersonas"); + + migrationBuilder.DropTable( + name: "AppConfigs"); + + migrationBuilder.DropTable( + name: "Budgets"); + + migrationBuilder.DropTable( + name: "ChatMessages"); + + migrationBuilder.DropTable( + name: "Stickers"); + + migrationBuilder.DropTable( + name: "Transactions"); + + migrationBuilder.DropTable( + name: "Categories"); + + migrationBuilder.DropTable( + name: "Ledgers"); + + migrationBuilder.DropTable( + name: "Users"); + } + } +} diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721120000_AccountClosureAndCategoryIcons.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721120000_AccountClosureAndCategoryIcons.cs new file mode 100644 index 0000000..69a56dc --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721120000_AccountClosureAndCategoryIcons.cs @@ -0,0 +1,68 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations; + +[DbContext(typeof(AppDbContext))] +[Migration("20260721120000_AccountClosureAndCategoryIcons")] +public partial class AccountClosureAndCategoryIcons : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AccountClosureRequestedAt", + table: "Users", + type: "datetime(6)", + nullable: true); + + migrationBuilder.AddColumn( + name: "AccountClosureScheduledAt", + table: "Users", + type: "datetime(6)", + nullable: true); + + migrationBuilder.AddColumn( + name: "AuthVersion", + table: "Users", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateIndex( + name: "IX_Users_AccountClosureScheduledAt", + table: "Users", + column: "AccountClosureScheduledAt"); + + migrationBuilder.Sql( + "UPDATE Categories SET IconKey = 'cart' WHERE IconKey = 'shopping';"); + migrationBuilder.Sql( + "UPDATE Categories SET IconKey = 'metro' WHERE IconKey = 'transport';"); + migrationBuilder.Sql( + "UPDATE Categories SET IconKey = 'house' WHERE IconKey = 'home';"); + migrationBuilder.Sql( + "UPDATE Categories SET IconKey = 'money' WHERE IconKey = 'salary';"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Users_AccountClosureScheduledAt", + table: "Users"); + + migrationBuilder.DropColumn( + name: "AccountClosureRequestedAt", + table: "Users"); + + migrationBuilder.DropColumn( + name: "AccountClosureScheduledAt", + table: "Users"); + + migrationBuilder.DropColumn( + name: "AuthVersion", + table: "Users"); + } +} + diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721173000_CategoryColors.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721173000_CategoryColors.cs new file mode 100644 index 0000000..3db17c7 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721173000_CategoryColors.cs @@ -0,0 +1,50 @@ +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations; + +[DbContext(typeof(AppDbContext))] +[Migration("20260721173000_CategoryColors")] +public partial class CategoryColors : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ColorKey", + table: "Categories", + type: "varchar(32)", + maxLength: 32, + nullable: false, + defaultValue: "mint"); + + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'coral' WHERE UserId IS NULL AND Type = 0 AND Name = '餐饮';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'cyan' WHERE UserId IS NULL AND Type = 0 AND Name = '饮品';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'blue' WHERE UserId IS NULL AND Type = 0 AND Name = '购物';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'teal' WHERE UserId IS NULL AND Type = 0 AND Name = '交通';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'sand' WHERE UserId IS NULL AND Type = 0 AND Name = '住房';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'violet' WHERE UserId IS NULL AND Type = 0 AND Name = '娱乐';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'red' WHERE UserId IS NULL AND Type = 0 AND Name = '医疗';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'indigo' WHERE UserId IS NULL AND Type = 0 AND Name = '学习';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'plum' WHERE UserId IS NULL AND Type = 0 AND Name = '服饰';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'rose' WHERE UserId IS NULL AND Type = 0 AND Name = '人情';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'sky' WHERE UserId IS NULL AND Type = 0 AND Name = '旅行';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'graphite' WHERE UserId IS NULL AND Type = 0 AND Name = '其他';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'mint' WHERE UserId IS NULL AND Type = 1 AND Name = '工资';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'forest' WHERE UserId IS NULL AND Type = 1 AND Name = '兼职';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'navy' WHERE UserId IS NULL AND Type = 1 AND Name = '理财';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'orange' WHERE UserId IS NULL AND Type = 1 AND Name = '红包';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'amber' WHERE UserId IS NULL AND Type = 1 AND Name = '报销';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'aqua' WHERE UserId IS NULL AND Type = 1 AND Name = '奖金';"); + migrationBuilder.Sql("UPDATE Categories SET ColorKey = 'lime' WHERE UserId IS NULL AND Type = 1 AND Name = '其他';"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ColorKey", + table: "Categories"); + } +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721200000_AiPermissionsAndRecognitionIdempotency.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721200000_AiPermissionsAndRecognitionIdempotency.cs new file mode 100644 index 0000000..d8a297c --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260721200000_AiPermissionsAndRecognitionIdempotency.cs @@ -0,0 +1,90 @@ +using System; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations; + +[DbContext(typeof(AppDbContext))] +[Migration("20260721200000_AiPermissionsAndRecognitionIdempotency")] +public partial class AiPermissionsAndRecognitionIdempotency : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ClientRequestId", + table: "Transactions", + type: "varchar(64)", + maxLength: 64, + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserFeaturePermissions", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(type: "bigint", nullable: false), + PermissionKey = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false), + }, + constraints: table => + { + table.PrimaryKey("PK_UserFeaturePermissions", x => x.Id); + table.ForeignKey( + name: "FK_UserFeaturePermissions_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_UserId_ClientRequestId", + table: "Transactions", + columns: new[] { "UserId", "ClientRequestId" }, + unique: true); + migrationBuilder.CreateIndex( + name: "IX_UserFeaturePermissions_UserId_PermissionKey", + table: "UserFeaturePermissions", + columns: new[] { "UserId", "PermissionKey" }, + unique: true); + + migrationBuilder.Sql(""" + INSERT INTO UserFeaturePermissions + (UserId, PermissionKey, IsEnabled, CreatedAt, UpdatedAt) + SELECT Id, 'ai', TRUE, UTC_TIMESTAMP(6), UTC_TIMESTAMP(6) + FROM Users + WHERE NOT EXISTS ( + SELECT 1 FROM UserFeaturePermissions p + WHERE p.UserId = Users.Id AND p.PermissionKey = 'ai' + ); + """); + migrationBuilder.Sql(""" + INSERT INTO AppConfigs (`Key`, Value, Version, UpdatedAt) + SELECT 'permission.default.ai_enabled', 'true', 1, UTC_TIMESTAMP(6) + WHERE NOT EXISTS ( + SELECT 1 FROM AppConfigs + WHERE `Key` = 'permission.default.ai_enabled' + ); + """); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable(name: "UserFeaturePermissions"); + migrationBuilder.DropIndex( + name: "IX_Transactions_UserId_ClientRequestId", + table: "Transactions"); + migrationBuilder.DropColumn(name: "ClientRequestId", table: "Transactions"); + migrationBuilder.Sql( + "DELETE FROM AppConfigs WHERE `Key` = 'permission.default.ai_enabled';"); + } +} diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260722030000_AiChatQuotas.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260722030000_AiChatQuotas.cs new file mode 100644 index 0000000..c20f0f0 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260722030000_AiChatQuotas.cs @@ -0,0 +1,75 @@ +using System; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations; + +[DbContext(typeof(AppDbContext))] +[Migration("20260722030000_AiChatQuotas")] +public partial class AiChatQuotas : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AiChatLimit", + table: "Users", + type: "int", + nullable: false, + defaultValue: 50); + + migrationBuilder.AddColumn( + name: "AiChatPeriod", + table: "Users", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "AiChatUsed", + table: "Users", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "AiChatWindowStartedAt", + table: "Users", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1970, 1, 1)); + + migrationBuilder.Sql(""" + UPDATE Users + SET AiChatWindowStartedAt = + CONVERT_TZ(DATE(CONVERT_TZ(UTC_TIMESTAMP(6), '+00:00', '+08:00')), '+08:00', '+00:00'); + """); + migrationBuilder.Sql(""" + INSERT INTO AppConfigs (`Key`, Value, Version, UpdatedAt) + SELECT 'quota.default_ai_chat_limit', '50', 1, UTC_TIMESTAMP(6) + WHERE NOT EXISTS ( + SELECT 1 FROM AppConfigs + WHERE `Key` = 'quota.default_ai_chat_limit' + ); + """); + migrationBuilder.Sql(""" + INSERT INTO AppConfigs (`Key`, Value, Version, UpdatedAt) + SELECT 'quota.default_ai_chat_period', 'day', 1, UTC_TIMESTAMP(6) + WHERE NOT EXISTS ( + SELECT 1 FROM AppConfigs + WHERE `Key` = 'quota.default_ai_chat_period' + ); + """); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn(name: "AiChatLimit", table: "Users"); + migrationBuilder.DropColumn(name: "AiChatPeriod", table: "Users"); + migrationBuilder.DropColumn(name: "AiChatUsed", table: "Users"); + migrationBuilder.DropColumn(name: "AiChatWindowStartedAt", table: "Users"); + migrationBuilder.Sql( + "DELETE FROM AppConfigs WHERE `Key` IN ('quota.default_ai_chat_limit', 'quota.default_ai_chat_period');"); + } +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260722040000_RepairRecognitionTimestamps.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260722040000_RepairRecognitionTimestamps.cs new file mode 100644 index 0000000..13163a1 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/20260722040000_RepairRecognitionTimestamps.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations; + +[DbContext(typeof(AppDbContext))] +[Migration("20260722040000_RepairRecognitionTimestamps")] +public partial class RepairRecognitionTimestamps : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql(""" + UPDATE Transactions + SET OccurredAt = CreatedAt + WHERE Source IN (5, 6, 7) + AND OccurredAt < '2000-01-01 00:00:00'; + """); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + } +} \ No newline at end of file diff --git a/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs new file mode 100644 index 0000000..de04e74 --- /dev/null +++ b/backend/MiaoJiZhang.Infrastructure/Persistence/Migrations/AppDbContextModelSnapshot.cs @@ -0,0 +1,627 @@ +// +using System; +using MiaoJiZhang.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace MiaoJiZhang.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(AppDbContext))] + partial class AppDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiAvatar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DefaultName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ImageUrl") + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("SpeechTic") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("AiAvatars"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiCompanionSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AvatarKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CustomName") + .HasColumnType("longtext"); + + b.Property("PersonaKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ProactiveLevel") + .HasColumnType("int"); + + b.Property("RoastLevel") + .HasColumnType("int"); + + b.Property("StickerFrequency") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("AiCompanionSettings"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiPersona", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PromptTemplate") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SampleLine") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("AiPersonas"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AppConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("AppConfigs"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Budget", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasPrecision(12, 2) + .HasColumnType("decimal(12,2)"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("LedgerId") + .HasColumnType("bigint"); + + b.Property("Period") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LedgerId", "Period", "CategoryId") + .IsUnique(); + + b.ToTable("Budgets"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ColorKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("IconKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.ChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Role") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "CreatedAt"); + + b.ToTable("ChatMessages"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("IconKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OwnerId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("Ledgers"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Sticker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("GroupKey") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ImageUrl") + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Label") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TriggerTags") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("Stickers"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasPrecision(12, 2) + .HasColumnType("decimal(12,2)"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("ClientRequestId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LedgerId") + .HasColumnType("bigint"); + + b.Property("Note") + .HasColumnType("longtext"); + + b.Property("OccurredAt") + .HasColumnType("datetime(6)"); + + b.Property("PaymentMethod") + .HasColumnType("longtext"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("SourceChatMessageId") + .HasColumnType("bigint"); + + b.Property("SourceText") + .HasColumnType("longtext"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("LedgerId", "OccurredAt"); + + b.HasIndex("UserId", "IsDeleted"); + + b.HasIndex("UserId", "ClientRequestId") + .IsUnique(); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.UserFeaturePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("PermissionKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "PermissionKey") + .IsUnique(); + + b.ToTable("UserFeaturePermissions"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AppMode") + .HasColumnType("int"); + + b.Property("AiChatLimit") + .HasColumnType("int"); + + b.Property("AiChatPeriod") + .HasColumnType("int"); + + b.Property("AiChatUsed") + .HasColumnType("int"); + + b.Property("AiChatWindowStartedAt") + .HasColumnType("datetime(6)"); + + b.Property("AccountClosureRequestedAt") + .HasColumnType("datetime(6)"); + + b.Property("AccountClosureScheduledAt") + .HasColumnType("datetime(6)"); + + b.Property("AppleUserId") + .HasColumnType("longtext"); + + b.Property("AvatarUrl") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Email") + .HasColumnType("varchar(255)"); + + b.Property("EmailVerified") + .HasColumnType("tinyint(1)"); + + b.Property("AuthVersion") + .HasColumnType("int"); + + b.Property("IsBanned") + .HasColumnType("tinyint(1)"); + + b.Property("LastLoginAt") + .HasColumnType("datetime(6)"); + + b.Property("Nickname") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Phone") + .HasColumnType("varchar(255)"); + + b.Property("PhoneVerified") + .HasColumnType("tinyint(1)"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("WeChatOpenId") + .HasColumnType("varchar(255)"); + + b.Property("WeChatUnionId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("AccountClosureScheduledAt"); + + b.HasIndex("Email") + .IsUnique(); + + b.HasIndex("Phone") + .IsUnique(); + + b.HasIndex("Username") + .IsUnique(); + + b.HasIndex("WeChatOpenId") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiCompanionSetting", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.User", "User") + .WithOne("AiCompanion") + .HasForeignKey("MiaoJiZhang.Domain.Entities.AiCompanionSetting", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Budget", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.Ledger", "Ledger") + .WithMany("Budgets") + .HasForeignKey("LedgerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ledger"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.User", "Owner") + .WithMany("Ledgers") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Transaction", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("MiaoJiZhang.Domain.Entities.Ledger", "Ledger") + .WithMany("Transactions") + .HasForeignKey("LedgerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Ledger"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.UserFeaturePermission", b => + { + b.HasOne("MiaoJiZhang.Domain.Entities.User", "User") + .WithMany("FeaturePermissions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b => + { + b.Navigation("Budgets"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("MiaoJiZhang.Domain.Entities.User", b => + { + b.Navigation("AiCompanion"); + + b.Navigation("FeaturePermissions"); + + b.Navigation("Ledgers"); + }); +#pragma warning restore 612, 618 + } + } +} + diff --git a/backend/MiaoJiZhang.sln b/backend/MiaoJiZhang.sln new file mode 100644 index 0000000..e8eccaf --- /dev/null +++ b/backend/MiaoJiZhang.sln @@ -0,0 +1,76 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiaoJiZhang.Api", "MiaoJiZhang.Api\MiaoJiZhang.Api.csproj", "{CC2CC5BF-2454-4C17-A7F7-8B0268204817}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiaoJiZhang.Domain", "MiaoJiZhang.Domain\MiaoJiZhang.Domain.csproj", "{9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiaoJiZhang.Infrastructure", "MiaoJiZhang.Infrastructure\MiaoJiZhang.Infrastructure.csproj", "{306C9DCD-9A9E-453F-BA9A-BA769C1D027D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiaoJiZhang.Api.Tests", "MiaoJiZhang.Api.Tests\MiaoJiZhang.Api.Tests.csproj", "{BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Debug|x64.Build.0 = Debug|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Debug|x86.ActiveCfg = Debug|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Debug|x86.Build.0 = Debug|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Release|Any CPU.Build.0 = Release|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Release|x64.ActiveCfg = Release|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Release|x64.Build.0 = Release|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Release|x86.ActiveCfg = Release|Any CPU + {CC2CC5BF-2454-4C17-A7F7-8B0268204817}.Release|x86.Build.0 = Release|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Debug|x64.ActiveCfg = Debug|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Debug|x64.Build.0 = Debug|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Debug|x86.ActiveCfg = Debug|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Debug|x86.Build.0 = Debug|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Release|Any CPU.Build.0 = Release|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Release|x64.ActiveCfg = Release|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Release|x64.Build.0 = Release|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Release|x86.ActiveCfg = Release|Any CPU + {9F7FCEA7-6B33-4FF3-8AF6-3C424AC56F99}.Release|x86.Build.0 = Release|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Debug|x64.ActiveCfg = Debug|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Debug|x64.Build.0 = Debug|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Debug|x86.ActiveCfg = Debug|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Debug|x86.Build.0 = Debug|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Release|Any CPU.Build.0 = Release|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Release|x64.ActiveCfg = Release|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Release|x64.Build.0 = Release|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Release|x86.ActiveCfg = Release|Any CPU + {306C9DCD-9A9E-453F-BA9A-BA769C1D027D}.Release|x86.Build.0 = Release|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Debug|x64.ActiveCfg = Debug|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Debug|x64.Build.0 = Debug|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Debug|x86.ActiveCfg = Debug|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Debug|x86.Build.0 = Debug|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Release|Any CPU.Build.0 = Release|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Release|x64.ActiveCfg = Release|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Release|x64.Build.0 = Release|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Release|x86.ActiveCfg = Release|Any CPU + {BC2E02BA-E6DA-4771-9AF5-A4F257EC76FE}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/design/jizhi-color-concepts-preview.png b/design/jizhi-color-concepts-preview.png new file mode 100644 index 0000000..88cd8e3 Binary files /dev/null and b/design/jizhi-color-concepts-preview.png differ diff --git a/design/jizhi-color-concepts.html b/design/jizhi-color-concepts.html new file mode 100644 index 0000000..25658a9 --- /dev/null +++ b/design/jizhi-color-concepts.html @@ -0,0 +1,488 @@ + + + + + + 记之 · 纯色配色提案 + + + +
+
+
+
COLOR STUDY · FLAT
+

记之纯色提案

+

所有方案只保留一个品牌主色,不使用渐变、发光或半透明背景。页面结构保持一致,只比较大面积底色、主按钮和状态色是否舒服。

+
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/design/jizhi-green-ui-concepts.html b/design/jizhi-green-ui-concepts.html new file mode 100644 index 0000000..a5b3351 --- /dev/null +++ b/design/jizhi-green-ui-concepts.html @@ -0,0 +1,27 @@ + + + + +记之 · 克制青绿六页面 + +
JIZHI UI STUDY · 02

克制青绿 · 六页面

白色承载内容,青绿只负责品牌与操作,红色只提示支出,低饱和蓝只标识 AI。界面不依赖装饰性效果,让账本信息成为视觉中心。

+
SCREEN 01

首页 · 明细

结余、预算和今日账单
主视觉
9:41◢ ▰
记之
日常账本
•••
七月结余
¥ 4,286.50
收入¥ 8,640支出¥ 4,353共计48 笔
语音记账
拍照识别
截屏记账
问一问
本月预算
已使用 63%,当前节奏正常
¥ 1,847
今天全部明细
午餐餐饮 · 12:26
- ¥28
地铁交通 · 08:41
- ¥4
稿费到账兼职 · 07:30
+ ¥680
+
SCREEN 02

AI 聊天

蓝色仅标识 AI 身份与状态
9:41◢ ▰
小记
已连接 · 日常账本
•••
今天 14:28
今天兼职赚了 680 元,午饭花了 28。
● 正在核对账本分类
已识别到 2 笔:兼职收入 680 元、餐饮支出 28 元。
✦ AI 入账结果已记录
兼职收入今天 14:28
+ ¥680
午饭餐饮 · 14:28
- ¥28
本月收入是 8,640 元,结余 4,286.50 元。
说说今天的收入或支出...
+
SCREEN 03

记一笔

纯色切换、分类和确认操作
9:41◢ ▰
记一笔
日常账本
支出
收入
金额¥ 28.00
选择分类
餐饮
购物
交通
居住
人情
账单
娱乐
•••
其他
备注园区食堂
支付方式微信支付
时间今天 12:26
+
SCREEN 04

统计 · 月报

业务图表青绿,AI 摘要蓝灰
9:41◢ ▰
统计
六月2026 年 7 月八月
收入¥8,640
支出¥4,353
结余¥4,286
支出分类共 48 笔
餐饮
¥1,420
购物
¥986
交通
¥628
居住
¥480
预算进度63%
本月预算 ¥6,200,剩余 ¥1,847
✦ 小记月报
这个月花得更稳了,结余比上月多 12%

餐饮支出下降 186 元,交通预算仍有 372 元可用。以上金额均来自当前账本。

+
SCREEN 05

我的

账号、账本和数据入口
9:41◢ ▰
我的
南浔
已连续记账 26 天
日常账本
切换
本月结余¥4,286
本月账单48 笔
预算管理

本月剩余 ¥1,847

分类管理

自定义图标与排序

AI
AI 伙伴

小记 · 理性陪伴

账本管理

新建、重命名和切换

账号与数据

导出、密码与账号管理

+
SCREEN 06

截屏识别确认

多账单、时间和分类确认
9:41◢ ▰
确认识别结果
2 笔
图片解析完成

请核对金额、分类和原始交易时间

第 2 笔只识别到日期,已使用当前时间,可点击时间重新选择。
账单 1识别可信
午餐
美团支付 · 餐饮
- ¥32.80
餐饮7月18日 12:36修改
账单 2需核对时间
生活用品
支付宝 · 购物
- ¥86.50
购物今天 14:41修改
+
\ No newline at end of file diff --git a/design/jizhi-theme-studio.html b/design/jizhi-theme-studio.html new file mode 100644 index 0000000..0473353 --- /dev/null +++ b/design/jizhi-theme-studio.html @@ -0,0 +1,124 @@ + + + + +记之 · 高保真配色实验室 + + + + +
色板已复制
JIZHI THEME STUDIO · LIVE

记之 · 高保真配色实验室

保持当前 App 的页面结构,只调整颜色。使用左侧面板实时修改品牌色、AI 色、背景、卡片、文字和语义色,六个页面会同步预览。全稿只使用纯色。

+
SCREEN 01

首页 · 明细

结余、预算和今日账单
主视觉
9:41◢ ▰
记之
日常账本
•••
七月结余
¥ 4,286.50
收入¥ 8,640支出¥ 4,353共计48 笔
语音记账
拍照识别
截屏记账
问一问
本月预算
已使用 63%,当前节奏正常
¥ 1,847
今天全部明细
午餐餐饮 · 12:26
- ¥28
地铁交通 · 08:41
- ¥4
稿费到账兼职 · 07:30
+ ¥680
+
SCREEN 02

AI 聊天

AI 色仅标识 AI 身份与状态
9:41◢ ▰
小记
已连接 · 日常账本
•••
今天 14:28
今天兼职赚了 680 元,午饭花了 28。
● 正在核对账本分类
已识别到 2 笔:兼职收入 680 元、餐饮支出 28 元。
✦ AI 入账结果已记录
兼职收入今天 14:28
+ ¥680
午饭餐饮 · 14:28
- ¥28
本月收入是 8,640 元,结余 4,286.50 元。
说说今天的收入或支出...
+
SCREEN 03

记一笔

纯色切换、分类和确认操作
9:41◢ ▰
记一笔
日常账本
支出
收入
金额¥ 28.00
选择分类
餐饮
购物
交通
居住
人情
账单
娱乐
•••
其他
备注园区食堂
支付方式微信支付
时间今天 12:26
+
SCREEN 04

统计 · 月报

业务图表使用品牌色,AI 摘要使用 AI 色
9:41◢ ▰
统计
六月2026 年 7 月八月
收入¥8,640
支出¥4,353
结余¥4,286
支出分类共 48 笔
餐饮
¥1,420
购物
¥986
交通
¥628
居住
¥480
预算进度63%
本月预算 ¥6,200,剩余 ¥1,847
✦ 小记月报
这个月花得更稳了,结余比上月多 12%

餐饮支出下降 186 元,交通预算仍有 372 元可用。以上金额均来自当前账本。

+
SCREEN 05

我的

账号、账本和数据入口
9:41◢ ▰
我的
南浔
已连续记账 26 天
日常账本
切换
本月结余¥4,286
本月账单48 笔
预算管理

本月剩余 ¥1,847

分类管理

自定义图标与排序

AI
AI 伙伴

小记 · 理性陪伴

账本管理

新建、重命名和切换

账号与数据

导出、密码与账号管理

+
SCREEN 06

截屏识别确认

多账单、时间和分类确认
9:41◢ ▰
确认识别结果
2 笔
图片解析完成

请核对金额、分类和原始交易时间

第 2 笔只识别到日期,已使用当前时间,可点击时间重新选择。
账单 1识别可信
午餐
美团支付 · 餐饮
- ¥32.80
餐饮7月18日 12:36修改
账单 2需核对时间
生活用品
支付宝 · 购物
- ¥86.50
购物今天 14:41修改
+
diff --git a/design/miaoji-latest.png b/design/miaoji-latest.png new file mode 100644 index 0000000..3e73459 Binary files /dev/null and b/design/miaoji-latest.png differ diff --git a/design/ui-mockup.html b/design/ui-mockup.html new file mode 100644 index 0000000..b213882 --- /dev/null +++ b/design/ui-mockup.html @@ -0,0 +1,1918 @@ + + + + + +AI 记账 · 高保真 UI 稿 v0.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

AI 记账 APP · 高保真 UI 稿 v0.5 清新简约

+

主色 薄荷绿 #00B386 · AI 专属色 靛蓝 #5B6BF5 · 全套 SVG 线性图标 · Flutter + .NET

+ + + +
+ + +
+
+
9:41
+
+
+
+
+
日常账本
+
+ + +
+
+
+
7月结余
+
¥ 4,286.50
+
+
收入¥ 12,800.00
+
支出¥ 8,513.50
+
预算剩余¥ 1,900.00
+
+
+ 本月预算 +
+ 62% +
+
+
+ +
+
+
+
小账喵
+
"今天的奶茶已入账,这周第 3 杯了,克制一点喵"
+
+
去聊天
+
+ +
最近账单全部 ›
+
+
今天 · 7月17日支出 ¥86.50
+
+
+
一点点奶茶
14:32 AI
+
-18.00
+
+
+
+
午餐 · 兰州拉面
12:05 AI
+
-26.00
+
+
+
+
地铁通勤
08:47
+
-42.50
+
+
+
+
+
昨天 · 7月16日收 ¥500.00 · 支 ¥128.00
+
+
+
兼职收入
20:14
+
+500.00
+
+
+
+
超市采购
19:02
+
-128.00
+
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+
+
+
P1 · 首页(账单明细)
+
+ + +
+
+
9:41
+
+ +
支出收入转账
+
+
+
餐饮
+
饮品
+
购物
+
交通
+
住房
+
娱乐
+
医疗
+
学习
+
服饰
+
人情
+
旅行
+
设置
+
+
+
+
+
餐饮
+
26.00
+
+
+ 午餐拉面 + 今天 12:05 + 微信支付 +
+
+
1
2
3
+
4
5
6
+
7
8
9
完成
+
再记
0
.
+
+
+
+
+
+
P2 · 手动记账
+
+ + +
+
+
9:41
+
+ +
自定义
+
+
+ + 2026年7月 + +
+
+
+
总支出¥8,513
+
+
餐饮34%
+
购物21%
+
住房16%
+
交通13%
+
娱乐9%
+
其他7%
+
+
+
+
+
+
每日支出趋势
+
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
+
+
+
+
+
+
餐饮 ¥2,894.50
+
+
+
+
购物 ¥1,788.00
+
+
+
+
小账喵的分析
+ 本月餐饮支出比上月高 23%,主要是奶茶(12 杯 ¥216)。按当前节奏预算将在 7月28日 用完,建议每日控制在 ¥130 以内。 +
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+
+
+
P3 · 统计 + AI 分析
+
+
+ + + +
+ + +
+
+
9:41
+
+
+ +
+
+
+
小账喵 毒舌猫娘
+
在线 · 已陪你记账 128 天
+
+
+ +
+
+
今天 14:31
+ +
+
+
刚买了杯一点点,18块
+
+ +
+
+
记好了!不过这是你这周第 3 杯奶茶了……钱包在哭泣哦
+
+ +
+
+
+
AI 已自动记账
+
+
+
+
-¥18.00
+
饮品 · 一点点奶茶 · 微信支付
+
+
+
修改确认无误
+
+
+ +
+
+
+ + 求原谅… +
+
+ +
+
+
+ + 卖萌也没用! +
+
+ +
+
+
哼,看在你都记账的份上原谅你~
本周饮品预算还剩 ¥22,省着点
+
+
+
+ 拍小票 + 语音记账 + 本月花了多少 +
+
+ +
和小账喵说点什么…
+ + +
+
+
+
+
P4 · AI 聊天记账(表情包互动)
+
+ + +
+
+
9:41
+
+ +
+
+
+
小账喵
+
点击更换头像和昵称
+
+
+
+
+ +
毒舌猫娘
+
嘴上嫌弃,心里关心,乱花钱会被吐槽
+
"又点外卖?你的钱包已经瘦成纸片了喵!"
+
+
+ +
温柔小暖
+
永远鼓励你,温柔提醒不施压
+
"记好啦,偶尔犒劳自己也是应该的呀"
+
+
+ +
严格管家
+
专业理性,盯紧预算,数据说话
+
"本笔支出使餐饮预算达到 87%,请注意。"
+
+
+ +
沙雕损友
+
玩梗高手,表情包狂魔,快乐记账
+
"家人们谁懂啊,他又双叒叕买奶茶了"
+
+
+
+
+
吐槽力度较犀利
+
+
+
表情包频率经常发
+
+
+
主动提醒(预算 / 账单)每天一次
+
+
+
保存设置
+
+
+
+
+
P5 · AI 性格设置
+
+ + +
+
+
9:41
+
+
+
+
+
+
南巡 PRO
+
已连续记账 128 天 · 超过 92% 的用户
+
+
+
+
App 模式
+
选择你喜欢的使用方式,可随时切换
+
+
+
+ +
普通记账模式
+
经典账本界面
手动记账 + AI 辅助
+
+
+
+ +
全 AI 模式
+
聊天即记账
对话作为主界面
+
+
+
+
+
AI 性格设置毒舌猫娘
+
预算管理¥5,000/月
+
账本管理3 个账本
+
分类管理
+
+
+
数据导出
+
云同步已开启
+
通用设置
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+
+
+
P6 · 我的(模式切换)
+
+
+ + + +
+
+
+
9:41
+
+
+
+
+
+
小账喵 毒舌猫娘
+
全 AI 模式 · 说句话就能记账
+
+
切换模式
+
+
+
今日支出
¥86.50
+
本月结余
¥4,286
+
预算剩余
62%
+
+
+
+
今天 19:02
+ +
+
+
晚上好~今天已经花了 ¥86.5,晚饭想吃什么?先跟我报备
+
+ +
+
+
晚饭和同事吃了火锅AA,人均88,微信付的
+
+ +
+
+
+
AI 已自动记账
+
+
+
+
-¥88.00
+
餐饮 · 火锅聚餐 (AA) · 微信支付
+
+
+
今日餐饮 ¥114 / 预算 ¥130
+
+
+ +
+
+
+ + 今日预算亮红灯! +
+
+ +
+
+
知道啦,这个月我花最多的是什么?
+
+ +
+
+
餐饮 ¥2,894(占 34%)!其中奶茶就有 ¥216……
要不要我生成本月报告?
+
+ +
+
+
+
+
+
+ 生成月报 + 拍小票 + 查明细 + 调预算 +
+
+ +
说句话,记一笔…
+ + +
+
+
+
+
P7 · 全 AI 模式主界面(浅色渐变玻璃)
+
+
+ + + + + +
+ + +
+
+
9:41
+
+
+ +
喵记账
+
会聊天的记账本 · 让 AI 帮你管钱
+
+
微信一键登录
+
+
手机号登录
+
+
先逛逛,游客模式 ›
+
+
已阅读并同意 《用户协议》《隐私政策》
+
+
+
+
+
P8 · 启动 / 登录
+
+ + +
+
+
9:41
+
+
+
+
你想怎么用它?
+
两种完全不同的体验,以后随时可以在「我的」里切换
+
+
+
+
普通记账模式
+
经典账本界面,手动记账、报表统计一应俱全,AI 助手随叫随到
+
+
+
+
+
+
+
+
+
+
+
+
+
全 AI 模式
+
没有复杂界面,打开就是和 AI 聊天,说句话就完成记账、查账、看报告
+
+
今天花了多少呀?
+
午饭 26,奶茶 18
+
记好啦,共 ¥44 ✓
+
+
+
+
继续
+
+
+
+
+
+
P9 · 引导 · 选择模式
+
+ + +
+
+
9:41
+
+
+
+
认识你的 AI 伙伴
+
选形象、起名字、挑性格 —— 之后它就是你的专属记账搭子
+
+
+
+
+ 阿福汪 +
+
+
+ +
+ 小账喵 +
+
+
+ 账小智 +
+
+
+
小账喵换一个
+
+
+
+ +
毒舌猫娘
+
乱花钱会被无情吐槽
+
+
+ +
温柔小暖
+
永远鼓励,温柔提醒
+
+
+ +
严格管家
+
理性专业,数据说话
+
+
+ +
沙雕损友
+
玩梗高手,快乐记账
+
+
+
+
开始记账之旅
+
+
+
+
+
+
P10 · 引导 · 选择 AI 性格
+
+
+ + + +
+ + +
+
+
9:41
+
+ +
+
+
+
+
-¥18.00
+
支出 · 已入账
+
+
分类饮品
+
时间2026年7月17日 14:32
+
账本日常账本
+
支付方式微信支付
+
备注一点点奶茶
+
+ 来源 AI 聊天记账 +
你说:"刚买了杯一点点,18块"
小账喵识别:饮品 · ¥18.00 · 微信支付
+
+
+
+
编辑
+
删除
+
+
+
+
+
+
P11 · 账单详情(含 AI 来源追溯)
+
+ + +
+
+
9:41
+
+ +
+
+
+
总预算剩余62%
+
+
本月总预算¥5,000.00
+
已使用¥3,100.00
+
剩余可用¥1,900.00
+
日均可用¥135.70
+
+
+
+
+
+
+
+
餐饮¥1,395 / ¥1,600
+
+
+
+
饮品¥216 / ¥300
+
+
+
+
购物¥688 / ¥1,500
+
+
+
+
交通¥412 / ¥600
+
+
+
添加分类预算
+
+
让小账喵帮你定预算
+ 根据近 3 个月的消费习惯,AI 可以一键生成更合理的分类预算方案。 +
生成方案 ›
+
+
+
+
+
+
P12 · 预算管理(AI 一键定预算)
+
+ + +
+
+
9:41
+
+ +
+
+
小账喵 · 月度报告
+
7月,你一共花了 ¥8,513
+
比上月多 12% · 全国同龄用户中排勤俭榜前 44%
+
+
收入
¥12,800
+
支出
¥8,513
+
结余
¥4,286
+
笔数
142
+
+
+
+
+
+
+
最烧钱的一天:7月16日
单日支出 ¥486,一半花在了「海底捞聚餐」
+
+
+
+
奶茶自由指数:偏高
12 杯 · ¥216,比上月多 4 杯,最爱「一点点」
+
+
+
+
进步的地方
打车支出比上月省了 ¥180,通勤改坐地铁了,好评
+
+
+
+
AI 记账占比 68%
96 笔账是聊天记的,你已经离不开我了吧
+
+
+
+
毒舌点评
+
"收入 1.28 万,奶茶 216——你不是在喝奶茶,你是在给奶茶店打工。下个月饮品预算我给你砍到 ¥150,有意见吗?没有,那就这么定了喵。"
+
+
+
生成分享图
+
+
+
+
+
P13 · AI 月度报告
+
+ + +
+
+
9:41
+
+
+ +
+
+
+
小账喵 毒舌猫娘
+
在线
+
+
+ +
+
+
+
+
这个月工资到账了吗?记得跟我说一声
+
+
+
+
+ + 发工资啦! +
+
+
+
+
哦?多少?直接报数,我帮你记收入
+
+
+
+ +
和小账喵说点什么…
+ + +
+
+
小账喵专属经典表情最近使用
+
+
发工资啦
+
求原谅
+
剁手警告
+
生气喵
+
开心喵
+
犒劳自己
+
购物狂喜
+
钱包空空
+
+
+
+
+
+
P14 · 表情包面板(用户侧发送)
+
+
+ + + + + +
+ + +
+
+
9:41
+
+
+ +
+
+
+
小账喵 毒舌猫娘
+
在线
+
+
+
+
+
+
+
今天想记点什么?
+
+
+
+
+
正在聆听…
+
直接说,比如"打车去机场花了 45"
+
"昨天晚上和朋友吃烧烤,人均六十八,我用支付宝付的…"
+
+ + + + + +
+
+
松开发送 · 上滑取消
+
+
+
+
+
+
P15 · 语音记账(识别中)
+
+ + +
+
+
9:41
+
+ +
+
+
+ + + + +
+
+
识别完成
+
+
+
+
商户永辉超市(软件园店)98%
+
金额¥128.60 99%
+
时间今天 19:02 95%
+
AI 分类购物 · 超市采购 辅助判断
+
支付方式微信支付
+
+
+
小账喵
+ 识别到 14 件商品,其中零食占 ¥46……要不要我把零食单独拆一笔记「饮品零食」? +
+ 拆分记账 + 不用,记一笔 +
+
+
+
手动修改
+
确认入账
+
+
+
+
+
+
P16 · 拍小票 OCR 确认
+
+ + +
+
+
9:41
+
+
+
+
+
日常账本
+
+
+
7月结余
+
¥ 4,286.50
+
+
+
+
+
+
切换账本
+
+
+
日常账本
默认 · 本月 142 笔 · ¥8,513.50
+
+
+
+
+
云南旅行
2026.05 · 38 笔 · ¥6,208.00
+
+
+
+
带娃开销
与家人共享 · 261 笔 · ¥23,180.00
+
+
新建账本
+
+
+
+
+
+
P17 · 多账本切换弹层
+
+ + +
+
+
9:41
+
+ +
支出收入
+
+
长按拖动排序 · 左滑或点删除移除分类
+
+
餐饮
+
饮品
+
购物
+
交通
+
办公
+
+
自定义分类
+
+
提示
+ AI 聊天记账会自动匹配到这里的分类;删除分类后,历史账单会归入「其他」。 +
+
+
+
+
+
P18 · 分类管理
+
+
+ + + + + +
+ + +
+
+
9:41
+
+
+ +
+ 全部时间 + 分类 + 金额区间 + 仅 AI 记账 +
+
找到 12 笔 · 共 ¥216.00 · 试试问小账喵:"我这个月奶茶花了多少"
+
+
7月17日¥18.00
+
+
+
一点点奶茶
14:32 AI
+
-18.00
+
+
+
+
+
7月15日¥37.00
+
+
+
喜茶 · 多肉葡萄(奶茶
15:20 AI
+
-19.00
+
+
+
+
蜜雪冰城(奶茶
11:02
+
-8.00
+
+
+
搜索历史
+
+ 打车超市> ¥100上月餐饮 +
+
+
+
+
+
P19 · 搜索(筛选 + 高亮 + AI 引导)
+
+ + +
+
+
9:41
+
+
+
+
+
日常账本
+
+
+
+
7月结余
+
¥ 0.00
+
+
收入¥ 0.00
+
支出¥ 0.00
+
预算未设置
+
+
+
+
+
+ +
等你记第一笔!
+
+
还没有账单
+
跟我说句话就能记账,比如
"早饭包子豆浆 6 块" · "打车 45"
+
+
和小账喵聊聊
+
手动记一笔
+
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+
+
+
P20 · 空状态(新用户首页)
+
+ + +
+
+
9:41
+
+ +
支出收入转账
+
+
+
工资
+
兼职
+
理财
+
红包
+
报销
+
二手
+
奖金
+
自定义
+
+
转账(tab 三)示例
+
+
+
+
微信零钱
+
余额 ¥328.50
+
+
+
+
+
招行储蓄卡
+
尾号 6688
+
+
+
+
+
+
工资
+
+12,800
+
+
+ 7月工资 + 今天 10:00 + 招行储蓄卡 +
+
+
1
2
3
+
4
5
6
+
7
8
9
完成
+
再记
0
.
+
+
+
+
+
+
P21 · 收入记账 + 转账示例
+
+ + +
+
+
9:41
+
+
+
21:30
+
7月17日 星期五
+
+
+
喵记账现在
+
小账喵:今日小结出炉
+
今天花了 ¥86.5,比昨天省 ¥41.5。餐饮预算还剩 ¥16,明天悠着点喵~
+
+
+
+
喵记账2小时前
+
⚠️ 饮品预算告急
+
本周饮品预算已用 93%。是谁下午又点了奶茶?是你喵。
+
+
+
+
喵记账昨天
+
7月月报已生成
+
这个月你最烧钱的一天、最离不开的店……点开看看你的消费画像。
+
+
+
+
+
+
+
小账喵有话说
+
检测到支付宝账单:星巴克 ¥32,要帮你记上吗?
+
+ 记上 +
+
↑ 应用内横幅(AI 主动提醒 / 账单导入建议)
+
+
+
+
+
P22 · 推送通知 + 应用内横幅
+
+ + +
+
+
9:41
+
+
+
+
+
+
小账喵 毒舌猫娘
+
全 AI 模式
+
+
切换模式
+
+
+
+
+
+
你好呀,我是小账喵
+
从现在开始,这个对话就是你的账本。
记账、查账、预算、月报,一句话的事。
+
+
"早饭包子豆浆 6 块" —— 试试直接记一笔
+
按住底部麦克风,用说的也行
+
"帮我定个每月 5000 的预算"
+
+
+
+
+
别光看教程呀,先记一笔试试?我很快的喵
+
+
+
+ +
说句话,记一笔…
+ + +
+
+
+
+
P23 · 全 AI 模式首次欢迎页
+
+ + +
+
+
9:41
+
+
+
+
+
日常账本
+
+
+
+ + 当前离线 · 手动记账可用,AI 功能恢复联网后可用 · 本地已存 2 笔待同步 +
+
+
+
7月结余
+
¥ 4,286.50
+
+
收入¥ 12,800.00
+
支出¥ 8,513.50
+
预算剩余¥ 1,900.00
+
+
+
+
+
+
+
小账喵 · 离线中
+
联网后我就回来~期间账单我都帮你存好了
+
+
不可用
+
+
最近账单
+
+
今天 · 7月17日支出 ¥54.00
+
+
+
晚饭 · 面馆
19:20 · 待同步 ↑
+
-28.00
+
+
+
+
咖啡
15:02 · 待同步 ↑
+
-26.00
+
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+
+
+
P24 · 离线状态(AI 置灰 + 待同步)
+
+
+ +

+ v0.5 · 清新简约风 · 24 个界面 · 后续以 Flutter 实现 +

+ + diff --git a/design/ux-prototype.html b/design/ux-prototype.html new file mode 100644 index 0000000..8efbccc --- /dev/null +++ b/design/ux-prototype.html @@ -0,0 +1,1015 @@ + + + + + +喵记账 · 可交互 UX 原型 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
9:41
●●●
+ + +
+
+ +
喵记账
+
会聊天的记账本 · 让 AI 帮你管钱
+
+
微信一键登录
+
+
手机号登录
+
+
先逛逛,游客模式 ›
+
+
+ + +
+
+
+
你想怎么用它?
+
两种完全不同的体验,之后随时可以切换
+
+
+
+
普通记账模式
+
经典账本界面,手动记账、报表统计一应俱全,AI 助手随叫随到
+
+
+
+
+
+
+
+
+
+
+
+
+
全 AI 模式
+
没有复杂界面,打开就是和 AI 聊天,说句话就完成记账、查账、看报告
+
+
今天花了多少呀?
+
午饭 26,奶茶 18
+
记好啦,共 ¥44 ✓
+
+
+
+
继续
+
+
+ + +
+
+
+
认识你的 AI 伙伴
+
选形象、挑性格 —— 它就是你的专属记账搭子
+
+
+
阿福汪
+
小账喵
+
账小智
+
+
+
毒舌猫娘
乱花钱会被无情吐槽
+
温柔小暖
永远鼓励,温柔提醒
+
严格管家
理性专业,数据说话
+
沙雕损友
玩梗高手,快乐记账
+
+
+
开始记账之旅
+
+
+ + +
+
+
+
日常账本
+
+
+
7月结余
+
¥ 4,286.50
+
+
收入¥ 12,800.00
+
支出¥ 8,513.50
+
预算剩余¥ 1,900.00
+
+
+
+
+
+
小账喵
+
"今天的奶茶已入账,这周第 3 杯了,克制一点喵"
+
+
去聊天
+
+
最近账单
+
+
今天 · 7月17日支出 ¥86.50
+
+
+
+
一点点奶茶
14:32 ✦ AI
+
-18.00
+
+
+
+
午餐 · 兰州拉面
12:05 ✦ AI
+
-26.00
+
+
+
+
地铁通勤
08:47
+
-42.50
+
+
+
+
+
昨天 · 7月16日收 ¥500.00 · 支 ¥128.00
+
兼职收入
20:14
+500.00
+
超市采购
19:02
-128.00
+
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+ + +
+ +
+
+
+
7月总支出¥8,513
+
+
餐饮34%
+
购物21%
+
住房16%
+
交通13%
+
娱乐9%
+
其他7%
+
+
+
+
+
小账喵的分析
+ 本月餐饮支出比上月高 23%,主要是奶茶(12 杯 ¥216)。按当前节奏预算将在 7月28日 用完,建议每日控制在 ¥130 以内。 +
和它聊聊 ›
+
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+ + +
+ +
支出收入转账
+
+
+
餐饮
+
饮品
+
购物
+
交通
+
住房
+
娱乐
+
人情
+
学习
+
+
+
+
+
餐饮
+
0
+
+
+
1
2
3
+
4
5
6
+
7
8
9
完成
+
再记
0
.
+
+
+
+ + +
+
+ +
+
+
小账喵 毒舌猫娘
+
● 在线 · 已陪你记账 128 天
+
+ +
+
+
今天 14:31
+
+
+ 💬 刚买了杯一点点,18块 + 💬 昨晚烧烤人均68 + 📊 花最多的是什么 + 📷 拍小票 +
+
+ + + + +
+
+
+
发工资啦
+
求原谅
+
剁手警告
+
钱包空空
+
+
+
+ + +
+
+
+
+
南巡
已连续记账 128 天 · 超过 92% 的用户
+
+
+
App 模式
+
选择你喜欢的使用方式,可随时切换
+
+
+
+ +
普通记账模式
经典账本界面
+
+
+
+ +
全 AI 模式
对话作为主界面
+
+
+
+
+
AI 性格设置毒舌猫娘
+
预算管理¥5,000/月
+
账本管理3 个账本
+
分类管理
+
+
+
+
明细
+
统计
+
+
小账喵
+
我的
+
+
+ + +
+ +
+
+
+
小账喵
+
+
+
毒舌猫娘
乱花钱会被无情吐槽
+
温柔小暖
永远鼓励,温柔提醒
+
严格管家
理性专业,数据说话
+
沙雕损友
玩梗高手,快乐记账
+
+
+
+
吐槽力度较犀利
+
+
+
表情包频率经常发
+
+
+
+
保存设置
+
+
+
+ + +
+
+
+
+
+
小账喵 毒舌猫娘
+
全 AI 模式 · 说句话就能记账
+
+
切换模式
+
+
+
今日支出
¥86.50
+
本月结余
¥4,286
+
预算剩余
62%
+
+
+
+
今天 19:02
+
+
+ 💬 火锅AA人均88 + 📊 花最多的是什么 + 📈 生成月报 + 📷 拍小票 +
+
+ + + + +
+
+
+
发工资啦
+
求原谅
+
剁手警告
+
钱包空空
+
+
+
+ +
+
+
+ +

+ 可交互原型 · 从登录开始点一遍:登录 → 选模式 → 选 AI 伙伴 → 主界面
+ 试试:聊天里输入「打车花了45」→ AI 直接入账(首页数字立即变化),卡片上可「撤销」回滚
+ 换形象后口癖会变(猫=喵 / 狗=汪 / 机器人=无)· 表情按钮可互发表情包 · 「我的」里可切全 AI 模式 +

+ + + + diff --git a/docs/DESIGN.md b/docs/DESIGN.md new file mode 100644 index 0000000..e5a0ac5 --- /dev/null +++ b/docs/DESIGN.md @@ -0,0 +1,147 @@ +# 喵记账 · AI 记账 APP 设计文档 + +> 状态:UI/UX 设计阶段 · 更新于 2026-07-18 + +## 1. 产品概述 + +会聊天的 AI 记账本。基础功能对齐市面主流记账 App(随手记/鲨鱼记账等),差异化是 **AI 聊天记账助手**:可设置性格、会发/回表情包、能从聊天内容自动记账。 + +**技术栈**:Flutter(客户端) + .NET(后端) + +## 2. 双模式设计(核心产品决策) + +| | 普通记账模式 | 全 AI 模式 | +|---|---|---| +| 定位 | 经典账本界面,AI 是辅助 | 对话即 App,AI 是主界面 | +| 主界面 | 明细/统计/记一笔/聊天/我的 五 tab | 聊天流 + 顶部迷你数据条 | +| 记账方式 | 手动键盘记账 + AI 聊天记账 | 以 AI 聊天/语音/拍小票为主 | +| 视觉 | 白底卡片 | 浅色渐变 + 玻璃拟态 | +| 切换入口 | 「我的」页模式卡片;首次启动引导中二选一 | 顶栏「切换模式」按钮 | + +## 3. AI 助手设定 + +- **形象**:三选一 —— 小账喵(猫,默认)/ 阿福汪(狗)/ 账小智(机器人),可改昵称 +- **性格**(4 预设):毒舌猫娘 / 温柔小暖 / 严格管家 / 沙雕损友 +- **微调滑杆**:吐槽力度、表情包频率、主动提醒频率 +- **能力**: + - 聊天内容 → 自动记账(生成账单卡片,可修改/确认) + - 发表情包 + 回复用户表情包(专属表情包体系,见 P14) + - 消费分析、预算提醒、AI 月报、AI 一键定预算 + - 语音记账、拍小票 OCR(识别后进确认页) + +## 4. 设计规范(v0.4) + +### 4.1 颜色 +| 用途 | 色值 | +|---|---| +| 主色(记账/金额收入/成功) | `#00B386` 薄荷绿,深色 `#009973`,浅底 `#E6F7F1` | +| AI 专属色(一切 AI 元素) | `#5B6BF5` 靛蓝,浅底 `#EEF0FE` | +| 警示/超支 | `#F0642D`,过渡橙 `#F5A623` | +| 文字 | 主 `#191F26` / 次 `#5E6772` / 弱 `#9AA3AD` | +| 背景/卡片/分割线 | `#F6F7F9` / `#FFFFFF` / `#EEF0F3` | + +**规则**:凡是 AI 产生的内容(AI 记账标记、AI 卡片、AI 分析、性格设置)一律用靛蓝,与功能主色薄荷绿严格区分,让用户一眼识别「这是 AI 做的」。 + +### 4.2 其他 +- 图标:全套自绘 SVG 线性图标,stroke 1.7px,圆头 +- 圆角:卡片 14px,大卡 18px,按钮 13-14px +- 卡片:白底 + 0.5px 细边框(#EEF0F3),不用重阴影 +- 数字:`font-variant-numeric: tabular-nums` +- AI 记的账在列表中带「✦AI」徽标;账单详情页可追溯用户原话 + +## 5. 页面清单(design/ui-mockup.html,24 屏) + +| # | 页面 | 要点 | +|---|---|---| +| P1 | 首页(明细) | 渐变余额卡、预算进度、AI 入口条、账单流水 | +| P2 | 手动记账 | 分类宫格 + 键盘 + 备注/时间/支付方式 | +| P3 | 统计 | 环形图/趋势柱状/分类排行 + AI 分析卡 | +| P4 | AI 聊天记账 | 账单卡片(修改/确认)、表情包互动 | +| P5 | AI 性格设置 | 4 性格卡 + 3 滑杆微调 | +| P6 | 我的 | 模式切换卡、各管理入口 | +| P7 | 全 AI 模式主界面 | 玻璃拟态、迷你数据条、对话即 App | +| P8 | 启动/登录 | 微信/手机号/游客 | +| P9 | 引导·选模式 | 双模式二选一 + 迷你预览 | +| P10 | 引导·选 AI 伙伴 | 形象三选一 + 起名 + 性格四选一 | +| P11 | 账单详情 | AI 来源追溯(用户原话 + 识别结果) | +| P12 | 预算管理 | 总预算环 + 分类预算 + AI 一键定预算 | +| P13 | AI 月报 | 数据总览 + 亮点条目 + 性格化点评 + 分享 | +| P14 | 表情包面板 | 用户侧发送,「小账喵专属」分组 | +| P15 | 语音记账 | 按住说话、实时转写、波形动画 | +| P16 | 拍小票 OCR | 扫描动画、字段置信度、AI 拆分建议 | +| P17 | 多账本切换 | 底部弹层、共享账本 | +| P18 | 分类管理 | 拖动排序、删除归入「其他」 | +| P19 | 搜索 | 关键词高亮、时间/分类/金额/仅AI筛选、AI 引导语 | +| P20 | 空状态首页 | 新用户零账单,AI 引导记第一笔(双按钮) | +| P21 | 收入/转账记账 | 收入分类宫格、账户间转账示例 | +| P22 | 通知样式 | 锁屏推送 ×3(日结/预算告急/月报)+ 应用内横幅 | +| P23 | 全 AI 模式欢迎页 | 首次进入的教学卡(3 个可点示例)+ AI 开场白 | +| P24 | 离线状态 | 顶部离线条、AI 入口/tab 置灰、账单「待同步」标记 | + +## 6. 决策记录 + +| 日期 | 决策 | 原因 | +|---|---|---| +| 07-17 | 风格从紫色系改为清新简约(薄荷绿) | 用户反馈 v0.1 不好看;选定清新简约方向 | +| 07-17 | 图标从 emoji 全部改为自绘 SVG 线性 | emoji 观感廉价、跨平台不一致 | +| 07-17 | AI 用独立靛蓝色 | AI 内容与普通功能需要视觉区分 | +| 07-17 | 全 AI 模式从暗色改为浅色玻璃拟态 | 与整体清新风统一 | +| 07-17 | 首次启动即引导选模式+选性格 | 双模式是核心卖点,前置建立 AI 人设 | +| 07-17 | 账单详情保留 AI 来源追溯 | AI 记账的信任基础:可核对、可修改 | +| 07-18 | **AI 记账采用「直接入账 + 可撤销」** | 减少确认摩擦;卡片带撤销按钮,撤销后账目回滚。后端按此设计:写入即生效,保留撤销窗口/软删除 | +| 07-18 | **App 名称由管理员后台配置** | 不硬编码「喵记账」;后端出配置接口,客户端启动时拉取(名称/Logo 等品牌位) | +| 07-18 | **口癖跟随 AI 形象** | 猫=喵 / 狗=汪 / 机器人=无口癖;性格决定语气内容,形象决定口癖后缀,两者正交组合 | +| 07-18 | **离线策略:手动记账可用,AI 需联网** | 离线时 AI 入口/tab 置灰、顶部提示条、本地账单标「待同步」,联网后自动同步(见 P24) | + +## 7. 待定 / 待办 + +- [x] AI 记账入账策略 → 直接入账 + 可撤销(07-18 定) +- [x] App 名称 → 管理员后台可配置(07-18 定) +- [x] 口癖跟随形象 → 需要(07-18 定) +- [x] 离线边界 → 手动可用/AI 置灰(07-18 定) +- [ ] 用户确认 v0.5 UI 稿(24 屏) +- [ ] UX 原型确认(含直接入账+撤销的新交互) +- [ ] AI 形象是否需要正式插画(当前为线性图标风格) +- [ ] Flutter + .NET 项目骨架搭建 +- [ ] AI 对话后端方案(LLM 选型、表情包触发策略、记账意图识别) +- [x] 管理后台范围 → 见第 8 节(07-18 定) + +## 8. 管理后台范围(07-18 方案) + +原则:**内容运营进后台(改文案不发版),核心逻辑进代码,用户数据只读聚合**。 + +### P0 · MVP 必须 +| 模块 | 内容 | +|---|---| +| 品牌配置 | App 名称、Logo、Slogan、主题色(决策 19;客户端启动拉取+缓存兜底) | +| AI 人设管理 | 形象库(含口癖规则)、性格库(名称/描述/示例台词)、性格 Prompt 模板 | +| 表情包库 | 分组、素材、触发场景标签(超支/发工资/求原谅…) | +| 用户管理 | 列表、封禁、注销申请(合规) | +| 系统配置 | LLM 模型参数、API Key、限流阈值(AI 成本阀门) | + +### P1 · 上线后 1 个月 +- 文案库:推送模板/空状态引导/快捷短语,按性格×形象配置 +- 默认分类管理(新用户初始分类) +- 数据看板:DAU、记账笔数、AI 记账占比、撤销率/修改率(=AI 准确率)、token 成本 +- 意图识别失败样本池(脱敏),用于调 Prompt + +### P2 · 增长期 +- 运营位(公告/Banner)、A/B 实验、月报亮点规则配置、UGC 审核队列 + +### 不进后台(红线) +- 用户账单明细查看/修改(只有聚合统计) +- 记账核心逻辑(分类匹配、金额解析在代码,后台只喂 Prompt) +- 单用户 AI 对话记录检索(只进脱敏样本池) + +### 技术形态 +- .NET 同一解决方案内加 Admin Web 项目(ASP.NET Core / Blazor),不另起技术栈 +- 配置数据统一 `AppConfig`/`ContentResource` 表 + 版本号,客户端 ETag/版本增量拉取 +- Prompt/表情包/文案改动需保留历史版本,支持回滚 + +## 9. 文件说明 + +| 文件 | 用途 | +|---|---| +| `design/ui-mockup.html` | 静态高保真 UI 稿(18 屏平铺展示) | +| `design/ux-prototype.html` | 可交互 UX 原型(单手机框、可点击流转) | +| `docs/DESIGN.md` | 本文档 | diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md new file mode 100644 index 0000000..b901be4 --- /dev/null +++ b/docs/DEVELOPER.md @@ -0,0 +1,134 @@ +# 喵记账 · 开发手册 + +> 最后更新:2026-07-18 + +## 版本号规范 + +三端统一版本号格式:`YYYYMMDD-HHMM`(年月日-时分)。**每次构建必须更新版本号**。 + +### 后端版本号 +- 文件:`backend/MiaoJiZhang.Api/Program.cs` +- 变量:`apiVersion = "20260718-1600"`(修改此行即可) +- 显示位置: + - `GET /api/ping` 返回 JSON `{ "version": "...", "built": "..." }` + - `GET /api/version` 同上 +- 更新方法:修改 `apiVersion` 字符串,重启后端 + +### Flutter App 版本号 +- 文件:`frontend/lib/shared/version.dart` +- 变量:通过 `--dart-define=APP_VERSION=xxx` 构建时注入,默认 `"dev"` +- 显示位置: + - 启动页(SplashPage)Logo 下方 + - 登录页底部 + - 「我的」页底部 +- 构建命令: + ```bash + flutter clean + flutter build apk --release --dart-define=APP_VERSION=20260718-1600 + ``` + ⚠️ **必须加 `--dart-define`,否则 App 显示 `vdev`** + +### Admin Web 版本号 +- 文件:`admin-web/src/App.vue` +- 变量:侧边栏底部的硬编码版本文字 `
v20260718-1600
` +- 更新方法:修改 `
` 内的版本号,重新构建部署 + ```bash + cd admin-web && npm run build + cp dist/index.html ../backend/MiaoJiZhang.Api/wwwroot/ + cp -r dist/assets ../backend/MiaoJiZhang.Api/wwwroot/ + ``` + +--- + +## 构建与部署 + +### 1. 后端 +```bash +cd backend +dotnet build +# 重启 +powershell -Command "Get-Process dotnet | Stop-Process -Force" +dotnet run --project MiaoJiZhang.Api +``` + +### 2. Admin Web +```bash +cd admin-web +npm run build +cp dist/index.html ../backend/MiaoJiZhang.Api/wwwroot/ +cp -r dist/assets ../backend/MiaoJiZhang.Api/wwwroot/ +``` +浏览器打开 `http://localhost:5000/` 或 `http://{电脑IP}:5000/`。如界面未更新请 **Ctrl+Shift+R** 强制刷新。 + +### 3. Flutter APK +```bash +cd frontend +flutter clean +flutter pub get +flutter build apk --release --dart-define=APP_VERSION=20260718-1600 +adb install -r build/app/outputs/flutter-apk/app-release.apk +``` + +--- + +## 项目结构 + +``` +jizhang/ +├── backend/ +│ └── MiaoJiZhang.sln +│ ├── MiaoJiZhang.Api/ # Web API 控制器、JWT、配置 +│ │ ├── Program.cs # ★ 启动入口 + 版本号 +│ │ ├── Controllers/ +│ │ │ ├── AuthController.cs +│ │ │ ├── ChatController.cs # ★ AI 聊天(LLM only) +│ │ │ ├── AdminController.cs +│ │ │ ├── UsersController.cs +│ │ │ ├── TransactionsController.cs +│ │ │ └── ... +│ │ ├── Services/ +│ │ │ ├── OpenAiVisionClient.cs # LLM 客户端 +│ │ │ ├── AiServices.cs # 规则版(已废弃) +│ │ │ └── ... +│ │ └── wwwroot/ # Admin Web 发布目标 +│ ├── MiaoJiZhang.Domain/ # 实体 + 枚举 +│ └── MiaoJiZhang.Infrastructure/ # EF Core + MySQL +├── frontend/ +│ └── lib/ +│ ├── main.dart +│ ├── app/app.dart # 路由 +│ ├── shared/ +│ │ ├── version.dart # ★ App 版本号 +│ │ ├── api/ # API 客户端 +│ │ ├── theme/ # 设计规范色 +│ │ └── widgets/ # 图标/组件 +│ └── features/ # 业务页面 +├── admin-web/ # Vue3 + Ant Design 后台 +│ └── src/ +│ ├── App.vue # ★ 侧边栏版本号 +│ └── views/ # 管理页面 +├── docs/ # 项目说明、设计规范、开发说明 +└── design/ # UI 稿、UX 原型、配色探索 +``` + +--- + +## 验证构建是否生效 + +1. **后端**:浏览器访问 `http://localhost:5000/api/ping`,看返回的 `version` 字段 +2. **Admin Web**:打开 `http://localhost:5000/`,看左下角版本号,对不上就 Ctrl+Shift+R +3. **App**:打开 App 看启动页 Logo 下方的版本号,或登录页/我的页底部 + +**版本号对不上 = 没构建进去 = 代码没生效。不要继续测试其他功能,先排查构建问题。** + +--- + +## 常见错误 + +| 现象 | 原因 | 解决 | +|------|------|------| +| 修改了代码但 App 不变 | 没有 clean 构建,或没加 dart-define | `flutter clean && flutter build apk --release --dart-define=APP_VERSION=...` | +| 修改了代码但后台不变 | 后端还在跑旧进程 | 先 `Stop-Process -Name dotnet -Force` 再 `dotnet run` | +| Admin Web 界面不变 | 浏览器缓存 | Ctrl+Shift+R 强制刷新,或用无痕模式打开 | +| Windows 文件路径错误 | 中文路径编码 | 用 python3 读文件时加 `encoding='utf-8'` | +| sed 破坏代码 | git-bash 的 sed 不兼容 | 禁止用 sed 改 dart/vue 源码,用 Write/Edit 工具 | diff --git a/docs/PROJECT.md b/docs/PROJECT.md new file mode 100644 index 0000000..d1b230b --- /dev/null +++ b/docs/PROJECT.md @@ -0,0 +1,134 @@ +# 喵记账 · 项目骨架 + +> Flutter 客户端 + .NET 9 后端 · 搭建于 2026-07-18 + +## 目录结构 + +``` +jizhang/ +├── docs/ # 项目说明、设计规范、开发说明 +│ ├── PROJECT.md # 本文档 +│ ├── DESIGN.md # 设计文档(规范 + 决策 + 后台方案) +│ ├── DEVELOPER.md # 开发交接与构建说明 +│ └── app-client-integration.md +├── design/ # 静态 UI 稿、可交互原型、配色探索 +│ ├── ui-mockup.html # 静态 UI 稿(24 屏) +│ └── ux-prototype.html # 可交互 UX 原型 +├── backend/ # .NET 解决方案 +│ └── MiaoJiZhang.sln +│ ├── MiaoJiZhang.Api/ # Web API(控制器、JWT、Program) +│ │ ├── Controllers/AuthController.cs # /api/auth/register|login +│ │ ├── Services/JwtService.cs +│ │ ├── Contracts/AuthContracts.cs +│ │ ├── Program.cs # 启动 + 自动建库 + 种子 +│ │ └── appsettings.json # 连接串 + JWT 配置 +│ ├── MiaoJiZhang.Domain/ # 领域层(实体 + 枚举) +│ │ ├── Entities/User.cs # ★ 含 email/phone/wechat 预留字段 +│ │ ├── Entities/Ledger.cs # 账本/分类/账单/预算/聊天 +│ │ ├── Entities/AdminContent.cs # AppConfig/AiPersona/AiAvatar/Sticker +│ │ └── Enums/Enums.cs +│ └── MiaoJiZhang.Infrastructure/ # EF Core + MySQL +│ └── Persistence/ +│ ├── AppDbContext.cs # ★ 账单软删除全局过滤 +│ └── DbSeeder.cs # 默认分类/形象/性格/品牌配置 +└── frontend/ # Flutter 客户端 + └── lib/ + ├── main.dart + ├── app/app.dart # 路由(go_router) + ├── shared/theme/app_theme.dart # v0.5 设计规范色 + └── features/ + ├── auth/pages/ # login_page / register_page + ├── onboarding/pages/ # 选模式 + 选 AI 伙伴 + ├── home/pages/main_shell.dart # TabBar 壳(5 tab) + └── ai_mode/pages/ai_mode_page.dart # 全 AI 模式主界面 +``` + +## 运行 + +### 后端 +1. 本地装 MySQL,建库:`CREATE DATABASE miaoji;` +2. 改 `backend/MiaoJiZhang.Api/appsettings.json` 里的连接串(`your_password`) +3. 改 `Jwt:Secret` 为 ≥32 字符的随机串 +4. `cd backend && dotnet run --project MiaoJiZhang.Api` + - 开发期 `Program.cs` 会 `EnsureCreated` 建表 + 跑种子数据 + - OpenAPI 文档:`http://localhost:5000/openapi/v1.json` +5. 测试注册: + ```bash + curl -X POST http://localhost:5000/api/auth/register \ + -H "Content-Type: application/json" \ + -d '{"username":"demo","password":"123456"}' + ``` + +### 前端 +```bash +cd frontend +flutter pub get +flutter run +``` +当前路由:`/login → /register → /onboarding → /home 或 /ai-mode` + +## 已落地的设计决策(代码层) + +| 决策 | 落地位置 | +|---|---| +| 仅用户名密码,预留 email/phone/wechat 字段 | `User.cs`(字段+唯一索引齐全,控制器不开放) | +| App 名称后台可配 | `AppConfig.brand.app_name` + `DbSeeder` 初始化 | +| 口癖跟随形象 | `AiAvatar.SpeechTic` + `AiPersona.PromptTemplate` 的 `{tic}` 占位 | +| AI 记账直接入账+可撤销 | `Transaction.IsDeleted/DeletedAt` + `AppDbContext` 软删除全局过滤 | +| AI 来源追溯 | `Transaction.Source/SourceText/SourceChatMessageId` | +| 后台可调性格 Prompt 不发版 | `AiPersona.PromptTemplate` 存库 | +| 限流阈值后台可配 | `AppConfig.limit.daily_ai_messages` | +| 离线边界 | 前端 `shared_preferences`/`secure_storage` 已装;后端软删除保证撤销幂等 | + +## 下一步 TODO(按优先级) + +1. ~~前端接通注册登录 API~~ ✅ +2. ~~前端 onboarding 落库~~ ✅ +3. ~~后端业务控制器~~ ✅ +4. ~~五个 tab 真实页面~~ ✅ +5. ~~预算模块~~ ✅(GET/PUT /api/budgets + BudgetPage,总预算环+分类进度+超支变色) +6. ~~表情包系统~~ ✅(Sticker 种子 + GET /api/stickers + 聊天表情包面板,AI 会回表情包) +7. ~~AI 月报~~ ✅(GET /api/reports/monthly + ReportPage,含性格化点评) +8. ~~搜索~~ ✅(GET /api/search + SearchPage,可搜 AI 记账原话,仅AI筛选) +9. ~~性格设置页~~ ✅(PUT /api/users/me/companion + CompanionPage,形象/性格/三滑杆) +10. ~~分类管理~~ ✅(POST/DELETE /api/categories + CategoryManagePage,自定义分类增删) +11. ~~语音/OCR 流程~~ ✅(POST /api/parse + ParseSheet 确认入账;ASR/OCR SDK 接入后自动填充文本) +12. ~~LLM 接入层~~ ✅(ILlmClient 抽象 + NullLlmClient 回退规则版;对接真实 LLM 时实现该接口即可) + +## 遗留(需要外部资源/发布前处理) + +- ASR(语音转文字)与拍照 OCR 的 SDK 选型接入(ParseSheet 已留好入口,接入后把识别文本传入即可) +- 真实 LLM 对接(实现 ILlmClient;性格 Prompt 已在 AiPersona 表可后台调) +- SVG 图标(category_icon.dart / stickerStyle 集中管理,直接替换映射即可) +- Admin Web 后台(`docs/DESIGN.md` 第 8 节;实体 AppConfig/AiPersona/AiAvatar/Sticker 已建好) +- EF Migration 替代 EnsureCreated;Jwt Secret 换生产值;baseUrl 环境化 + +## 已完成的接口清单 + +| 接口 | 说明 | +|---|---| +| POST /api/auth/register, /login | 用户名密码注册登录,JWT | +| GET /api/users/me | 用户资料 + AI 伙伴 + onboardingDone | +| POST /api/users/me/onboarding | 引导落库(模式/形象/性格) | +| PUT /api/users/me/mode | 双模式切换 | +| GET /api/ledgers | 账本列表 | +| GET /api/categories?type= | 分类(系统+自定义) | +| POST /api/transactions | 手动记账 | +| DELETE /api/transactions/{id} | 撤销/删除(软删除) | +| GET /api/transactions/month | 月账单按日分组(首页) | +| GET /api/transactions/stats | 月统计:分类占比+每日趋势 | +| GET /api/chat/messages | 聊天历史 | +| POST /api/chat/messages | 发消息 → 意图识别 → 记账/查询/闲聊,AI 记账直接入账并返回账单卡片;表情包消息 AI 回文案+表情包 | +| GET/PUT /api/budgets | 预算查询(含已用)与设置(Amount<=0 删除) | +| GET /api/stickers | 表情包列表(后台可配) | +| GET /api/reports/monthly | AI 月报(数据+亮点+性格化点评) | +| GET /api/search | 账单搜索(关键词/金额区间/仅AI,可搜原话) | +| PUT /api/users/me/companion | AI 伙伴设置(形象/性格/滑杆) | +| POST /api/categories, DELETE /api/categories/{id} | 自定义分类增删 | +| POST /api/parse | 语音/OCR 文本 → 账单草稿(确认后走 POST /api/transactions) | + +## 技术债 / 注意 + +- 后端用 `EnsureCreated` 跳过 Migration,便于快速起盘;正式环境前要切到 `dotnet ef migrations add Init` +- `appsettings.json` 的 `Jwt:Secret` 是占位值,**生产必须换** +- 前端 `main_shell.dart` 的 5 个 branch 暂用 `Placeholder()`,下一步逐个填真实页面 diff --git a/docs/app-client-integration.md b/docs/app-client-integration.md new file mode 100644 index 0000000..3f5f486 --- /dev/null +++ b/docs/app-client-integration.md @@ -0,0 +1,281 @@ +# App 客户端对接文档 + +本文面向 Android、iOS、Windows、macOS、Linux 等客户端,用于对接 VersionFlow 的公开检查更新接口。 + +## 1. 接口概览 + +客户端不需要登录后台,也不需要 JWT。每个 App 在后台创建后会生成一个公开标识 `AppKey`,客户端使用它检查是否有新版本。 + +接口地址: + +```http +GET /api/client/v1/update +``` + +本地 Docker 环境示例: + +```http +GET http://localhost:8080/api/client/v1/update?appKey={appKey}&platform=android&channel=stable¤tBuild=100 +``` + +生产环境请替换为你的正式域名: + +```http +GET https://your-domain.com/api/client/v1/update?appKey={appKey}&platform=android&channel=stable¤tBuild=100 +``` + +## 2. 请求参数 + +| 参数 | 类型 | 必填 | 说明 | +| --- | --- | --- | --- | +| `appKey` | string | 是 | 后台应用详情页中的 AppKey。它是公开客户端标识,不是密钥。 | +| `platform` | string | 是 | 平台键,例如 `android`、`ios`、`windows`、`macos`、`linux`。 | +| `channel` | string | 否 | 发布渠道,默认 `stable`。可使用 `beta` 或后台自定义渠道。 | +| `currentBuild` | number | 否 | 当前客户端整数构建号,默认 `0`。必须大于等于 0。 | + +注意:版本新旧只比较 `buildNumber/currentBuild`,不要用 `versionName` 做大小判断。 + +## 3. 成功响应 + +无可用更新: + +```json +{ + "hasUpdate": false, + "forceUpdate": false, + "release": null +} +``` + +有可用更新: + +```json +{ + "hasUpdate": true, + "forceUpdate": false, + "release": { + "id": "2f0f4c1a-7c8f-4d5b-90fa-5cb0b2f3e1a1", + "versionName": "2.4.0", + "buildNumber": 240, + "downloadUrl": "https://downloads.example.com/app-2.4.0.apk", + "releaseNotes": "- 新增功能\n- 修复问题", + "sha256": "可选的 64 位 SHA-256", + "fileSize": 104857600, + "publishedAt": "2026-07-20T05:00:00+00:00" + } +} +``` + +字段说明: + +| 字段 | 说明 | +| --- | --- | +| `hasUpdate` | 是否存在比 `currentBuild` 更高的已生效版本。 | +| `forceUpdate` | 是否必须升级。后台版本标记强制更新,或当前构建号低于 `minimumSupportedBuild` 时为 `true`。 | +| `release.versionName` | 展示版本号,例如 `2.4.0`。仅用于显示。 | +| `release.buildNumber` | 目标版本整数构建号,用于比较版本新旧。 | +| `release.downloadUrl` | 安装包下载外链,系统不上传、不代理安装包。 | +| `release.releaseNotes` | Markdown 更新说明。App 内展示时建议做安全渲染或纯文本展示。 | +| `release.sha256` | 可选校验值。客户端下载后可用它校验安装包完整性。 | +| `release.fileSize` | 可选文件大小,单位字节。 | +| `release.publishedAt` | 发布时间,UTC 时间。 | + +## 4. 错误响应 + +| HTTP 状态码 | 场景 | +| --- | --- | +| `400` | 参数无效,例如缺少 `appKey`、`platform` 为空、`currentBuild` 为负数。 | +| `404` | AppKey 不存在、App 已停用、平台不存在/停用、渠道不存在/停用。 | +| `429` | 触发 IP/AppKey 限流。客户端应稍后重试。 | +| `500` | 服务端异常。客户端应降级为“不提示更新”,并记录日志。 | + +错误响应使用 ASP.NET Core 标准 ProblemDetails 结构,常见格式如下: + +```json +{ + "type": "https://tools.ietf.org/html/rfc9110#section-15.5.5", + "title": "Application not found", + "status": 404 +} +``` + +## 5. 版本选择规则 + +服务端会在指定 `appKey + platform + channel` 下选择已经生效、未归档且构建号最高的版本。 + +规则如下: + +1. App 停用时,客户端接口返回 `404`。 +2. 草稿、归档版本不会返回给客户端。 +3. 定时发布版本在到达 `scheduledAt` 之前不可见,到期后可被选中。 +4. 当前客户端 `currentBuild >= 最新 buildNumber` 时,返回 `hasUpdate=false`。 +5. 存在更新且版本标记了 `forceUpdate=true` 时,返回 `forceUpdate=true`。 +6. 存在更新且 `currentBuild < minimumSupportedBuild` 时,返回 `forceUpdate=true`。 +7. `stable`、`beta` 和自定义渠道互相隔离,不会串用版本。 +8. Android、iOS、Windows、macOS、Linux 等平台互相隔离,不会串用版本。 + +## 6. App 端推荐流程 + +启动后或进入设置页时检查更新即可,不建议每次前后台切换都请求。 + +推荐流程: + +1. 读取当前客户端构建号 `currentBuild`。 +2. 根据当前包的平台和渠道组装请求。 +3. 请求失败时静默降级,不阻塞 App 启动。 +4. `hasUpdate=false` 时不提示。 +5. `hasUpdate=true && forceUpdate=false` 时显示可取消的更新弹窗。 +6. `hasUpdate=true && forceUpdate=true` 时显示不可取消的强制更新弹窗。 +7. 用户确认后打开 `downloadUrl`,或进入系统下载流程。 +8. 如果返回了 `sha256`,下载安装包后做完整性校验。 + +## 7. JavaScript/TypeScript 示例 + +```ts +type UpdateResponse = { + hasUpdate: boolean + forceUpdate: boolean + release: null | { + id: string + versionName: string + buildNumber: number + downloadUrl: string + releaseNotes: string + sha256?: string | null + fileSize?: number | null + publishedAt: string + } +} + +export async function checkUpdate() { + const baseUrl = 'https://your-domain.com' + const params = new URLSearchParams({ + appKey: 'replace-with-app-key', + platform: 'android', + channel: 'stable', + currentBuild: String(100), + }) + + const response = await fetch(`${baseUrl}/api/client/v1/update?${params}`) + if (response.status === 404) return null + if (response.status === 429) throw new Error('检查更新过于频繁,请稍后再试') + if (!response.ok) throw new Error(`检查更新失败:${response.status}`) + + const result = (await response.json()) as UpdateResponse + if (!result.hasUpdate || !result.release) return null + + return result +} +``` + +## 8. Android Kotlin 示例 + +```kotlin +data class UpdateResponse( + val hasUpdate: Boolean, + val forceUpdate: Boolean, + val release: ReleaseInfo? +) + +data class ReleaseInfo( + val id: String, + val versionName: String, + val buildNumber: Long, + val downloadUrl: String, + val releaseNotes: String, + val sha256: String?, + val fileSize: Long?, + val publishedAt: String +) + +// 使用 OkHttp / Retrofit 均可,示例只展示 URL 组装 +val url = HttpUrl.Builder() + .scheme("https") + .host("your-domain.com") + .addPathSegments("api/client/v1/update") + .addQueryParameter("appKey", "replace-with-app-key") + .addQueryParameter("platform", "android") + .addQueryParameter("channel", "stable") + .addQueryParameter("currentBuild", BuildConfig.VERSION_CODE.toString()) + .build() +``` + +## 9. iOS Swift 示例 + +```swift +struct UpdateResponse: Decodable { + let hasUpdate: Bool + let forceUpdate: Bool + let release: ReleaseInfo? +} + +struct ReleaseInfo: Decodable { + let id: String + let versionName: String + let buildNumber: Int64 + let downloadUrl: String + let releaseNotes: String + let sha256: String? + let fileSize: Int64? + let publishedAt: String +} + +var components = URLComponents(string: "https://your-domain.com/api/client/v1/update")! +components.queryItems = [ + URLQueryItem(name: "appKey", value: "replace-with-app-key"), + URLQueryItem(name: "platform", value: "ios"), + URLQueryItem(name: "channel", value: "stable"), + URLQueryItem(name: "currentBuild", value: "100") +] + +let (data, response) = try await URLSession.shared.data(from: components.url!) +let http = response as! HTTPURLResponse +if http.statusCode == 200 { + let result = try JSONDecoder().decode(UpdateResponse.self, from: data) + // 根据 result.hasUpdate / result.forceUpdate 展示更新弹窗 +} +``` + +## 10. 后台发布注意事项 + +为了让客户端能正确收到更新,后台发布版本时请确认: + +1. App 处于启用状态。 +2. 平台和渠道处于启用状态。 +3. `buildNumber` 大于线上客户端的 `currentBuild`。 +4. 版本状态是已发布,或定时发布时间已经到期。 +5. `downloadUrl` 是可公开访问的 HTTP/HTTPS 绝对地址。 +6. 强制更新策略按需设置:`forceUpdate` 或 `minimumSupportedBuild`。 + +## 11. 本地调试 + +启动服务: + +```bash +docker compose up -d +``` + +访问后台: + +```text +http://localhost:8080/ +``` + +默认管理员: + +```text +用户名:admin +密码:Admin123!@# +``` + +检查更新示例: + +```bash +curl "http://localhost:8080/api/client/v1/update?appKey=replace-with-app-key&platform=android&channel=stable¤tBuild=0" +``` + +停止服务: + +```bash +docker compose down +``` \ No newline at end of file diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..a5d4cc2 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release +**/*.p12 diff --git a/frontend/.metadata b/frontend/.metadata new file mode 100644 index 0000000..9470a44 --- /dev/null +++ b/frontend/.metadata @@ -0,0 +1,33 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "44a626f4f0027bc38a46dc68aed5964b05a83c18" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 44a626f4f0027bc38a46dc68aed5964b05a83c18 + base_revision: 44a626f4f0027bc38a46dc68aed5964b05a83c18 + - platform: android + create_revision: 44a626f4f0027bc38a46dc68aed5964b05a83c18 + base_revision: 44a626f4f0027bc38a46dc68aed5964b05a83c18 + - platform: ios + create_revision: 44a626f4f0027bc38a46dc68aed5964b05a83c18 + base_revision: 44a626f4f0027bc38a46dc68aed5964b05a83c18 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/frontend/analysis_options.yaml b/frontend/analysis_options.yaml new file mode 100644 index 0000000..d4e0f0c --- /dev/null +++ b/frontend/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/frontend/android/.gitignore b/frontend/android/.gitignore new file mode 100644 index 0000000..ed2ce53 --- /dev/null +++ b/frontend/android/.gitignore @@ -0,0 +1,11 @@ +/.gradle +/captures/ +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/frontend/android/app/build.gradle.kts b/frontend/android/app/build.gradle.kts new file mode 100644 index 0000000..050a1d3 --- /dev/null +++ b/frontend/android/app/build.gradle.kts @@ -0,0 +1,167 @@ +import java.io.FileInputStream +import java.util.Base64 +import java.util.Properties + +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +val keystorePropertiesFile = rootProject.file("key.properties") +val keystoreProperties = Properties().apply { + if (keystorePropertiesFile.exists()) { + load(FileInputStream(keystorePropertiesFile)) + } +} +val releaseSigningKeys = listOf( + "storePassword", + "keyPassword", + "keyAlias", + "storeFile", +) +val releaseSigningConfigured = keystorePropertiesFile.exists() && + releaseSigningKeys.all { !keystoreProperties.getProperty(it).isNullOrBlank() } + +android { + namespace = "com.nx.miaoji" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + applicationId = "com.nx.miaoji" + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + signingConfigs { + if (releaseSigningConfigured) { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = file(keystoreProperties["storeFile"] as String) + storePassword = keystoreProperties["storePassword"] as String + storeType = keystoreProperties.getProperty("storeType", "PKCS12") + } + } + } + + flavorDimensions += "environment" + productFlavors { + create("internal") { + dimension = "environment" + applicationIdSuffix = ".internal" + versionNameSuffix = "-internal" + signingConfig = signingConfigs.getByName("debug") + } + create("production") { + dimension = "environment" + if (releaseSigningConfigured) { + signingConfig = signingConfigs.getByName("release") + } + } + } + + buildTypes { + release {} + } +} + +val dartDefines = (project.findProperty("dart-defines") as? String) + .orEmpty() + .split(',') + .mapNotNull { encoded -> + runCatching { + String(Base64.getDecoder().decode(encoded), Charsets.UTF_8) + }.getOrNull() + } + .mapNotNull { define -> + val separator = define.indexOf('=') + if (separator <= 0) null + else define.substring(0, separator) to define.substring(separator + 1) + } + .toMap() + +val internalReleaseRequested = gradle.startParameter.taskNames.any { requestedTask -> + val taskName = requestedTask.substringAfterLast(':') + taskName.contains("InternalRelease", ignoreCase = true) +} +if (internalReleaseRequested) { + val expectedApiUrl = "https://lt.frp-say.com:38012" + if (dartDefines["INTERNAL_BUILD"] != "true") { + throw GradleException( + "Internal release requires --dart-define=INTERNAL_BUILD=true", + ) + } + if (dartDefines["API_BASE_URL"] != expectedApiUrl) { + throw GradleException( + "Internal release requires --dart-define=API_BASE_URL=$expectedApiUrl", + ) + } + if (dartDefines["APP_VERSION"].isNullOrBlank()) { + throw GradleException( + "Internal release requires --dart-define=APP_VERSION=", + ) + } +} +val productionReleaseRequested = gradle.startParameter.taskNames.any { requestedTask -> + val taskName = requestedTask.substringAfterLast(':') + taskName.contains("ProductionRelease", ignoreCase = true) || + taskName.equals("assembleRelease", ignoreCase = true) || + taskName.equals("bundleRelease", ignoreCase = true) +} +if (productionReleaseRequested && !releaseSigningConfigured) { + throw GradleException( + "Production release signing is not configured. " + + "Create frontend/android/key.properties before building productionRelease.", + ) +} + +if (releaseSigningConfigured) { + val releaseStore = file(keystoreProperties["storeFile"] as String) + if (!releaseStore.isFile) { + throw GradleException("Configured production release keystore does not exist: $releaseStore") + } +} +val stripIntegrationTestFromReleaseRegistrant = tasks.register( + "stripIntegrationTestFromReleaseRegistrant", +) { + doLast { + val registrant = file( + "src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java", + ) + if (!registrant.isFile) return@doLast + val integrationTestRegistration = Regex( + """(?ms)^\s*try \{\r?\n\s*flutterEngine\.getPlugins\(\)\.add\(new dev\.flutter\.plugins\.integration_test\.IntegrationTestPlugin\(\)\);\r?\n\s*\} catch \(Exception e\) \{\r?\n\s*Log\.e\(TAG, "Error registering plugin integration_test,[^\r\n]*\);\r?\n\s*\}\r?\n?""", + ) + val source = registrant.readText() + val sanitized = source.replace(integrationTestRegistration, "") + if (sanitized != source) registrant.writeText(sanitized) + } +} + +tasks.matching { + it.name.matches(Regex("compile.*ReleaseJavaWithJavac")) +}.configureEach { + dependsOn(stripIntegrationTestFromReleaseRegistrant) +} +flutter { + source = "../.." +} + +dependencies { + implementation("com.google.mlkit:text-recognition-chinese:16.0.1") + testImplementation("junit:junit:4.13.2") +} diff --git a/frontend/android/app/src/debug/AndroidManifest.xml b/frontend/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..8ffe024 --- /dev/null +++ b/frontend/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/frontend/android/app/src/internal/AndroidManifest.xml b/frontend/android/app/src/internal/AndroidManifest.xml new file mode 100644 index 0000000..d4372fc --- /dev/null +++ b/frontend/android/app/src/internal/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/android/app/src/internal/res/raw/sakura_frp_test_ca.pem b/frontend/android/app/src/internal/res/raw/sakura_frp_test_ca.pem new file mode 100644 index 0000000..5597592 --- /dev/null +++ b/frontend/android/app/src/internal/res/raw/sakura_frp_test_ca.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDOzCCAiOgAwIBAgIELZVPvzANBgkqhkiG9w0BAQsFADBQMQswCQYDVQQGEwJD +TjEtMCsGA1UEAxMkU2FrdXJhRnJwIEF1dG9tYXRpYyBUTFMgc24uNzY0NzU5OTk5 +MRIwEAYDVQQFEwk3NjQ3NTk5OTkwHhcNMjYwNzIwMDQ0NDM4WhcNMjcwNzIwMDQ0 +NDM4WjBQMQswCQYDVQQGEwJDTjEtMCsGA1UEAxMkU2FrdXJhRnJwIEF1dG9tYXRp +YyBUTFMgc24uNzY0NzU5OTk5MRIwEAYDVQQFEwk3NjQ3NTk5OTkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0poNmZC+UWeDWGRjHot86lnA3J5Ueujml +GvapcAWUoQBNs1p+tlVedz1Dwo/Hq1u7tHdp3WBDax5naKLFKIz0kQIbCWxDrDTH +YNVQ9O7MHcf8dcDeayvo6q9z7PzhVXH/CJTlWx2634RGYbaU5jBjWX4fPFHyXJe0 +57zQqSIYrxZFozEd9NewELavkjCydI8atSFQNEDtlHziiXXLKlvUk7Sk6Drc2AxU +ZYk0/mz6GFbBIeIKLUeDlvoocHQvzC3kK+pn1Ggq+ky2DViGPkzekh8HYiOo+/Wv +VRXP9LHp17AsmvsQQM4y2NzSkX/la4R1pgq5OwHw6pHHCeWwvBWTAgMBAAGjHTAb +MBkGA1UdEQQSMBCCDmx0LmZycC1zYXkuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBg +I4grSvEqI2RRXlwbRjKlBnlBWgiw51sEuM7Sjq6P8t2IoaGJ5/F3PeT0XWwyTopg +hV5hNPU+wOKtVilyNqepljrPQ5XAm3uWp68aIHBuCxh3XOfjetPBPXoisY67AUHH +9gilTg24GjZ7koJGfiS0iHmfLtf1rEDUgCl27pX9e2NzMRr9aVAsRkdp6D3esXZL +e2aUTgBWRg45PU+26dd/JN738F85nqwdRc16MeTMDDbqyIVmcUnZZVPeGXAmTotk +b9pHfmaT3h3YqPDv/rWa9w+AMdc2mBIckPQ3ZV4H95xHEOR56uFQwkfiPQABlBKO +2oBDbJB1yhK++6XkhmLj +-----END CERTIFICATE----- diff --git a/frontend/android/app/src/internal/res/values/strings.xml b/frontend/android/app/src/internal/res/values/strings.xml new file mode 100644 index 0000000..3fe87be --- /dev/null +++ b/frontend/android/app/src/internal/res/values/strings.xml @@ -0,0 +1,4 @@ + + + 记之·内测 + \ No newline at end of file diff --git a/frontend/android/app/src/internal/res/xml/network_security_config_internal.xml b/frontend/android/app/src/internal/res/xml/network_security_config_internal.xml new file mode 100644 index 0000000..f0fbbfd --- /dev/null +++ b/frontend/android/app/src/internal/res/xml/network_security_config_internal.xml @@ -0,0 +1,15 @@ + + + + + + + + + lt.frp-say.com + + + + + + \ No newline at end of file diff --git a/frontend/android/app/src/internal/res/xml/update_file_paths.xml b/frontend/android/app/src/internal/res/xml/update_file_paths.xml new file mode 100644 index 0000000..b9d96c6 --- /dev/null +++ b/frontend/android/app/src/internal/res/xml/update_file_paths.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/android/app/src/main/AndroidManifest.xml b/frontend/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..dcccc53 --- /dev/null +++ b/frontend/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/AiProgressNotifier.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/AiProgressNotifier.kt new file mode 100644 index 0000000..1e16b38 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/AiProgressNotifier.kt @@ -0,0 +1,190 @@ +package com.nx.miaoji + +import android.Manifest +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import android.content.pm.PackageManager +import android.os.Build +import androidx.core.content.ContextCompat +import java.util.Locale + +object AiProgressNotifier { + private const val CHANNEL_ID = "ai_screenshot_progress" + private const val NOTIFICATION_ID = 2101 + + fun start(context: Context) { + show( + context = context, + title = "截图已获取", + text = "AI 正在分析账单内容", + progress = 20, + indeterminate = true, + ongoing = true, + requestPromotion = true, + ) + } + + fun update(context: Context, count: Int) { + val text = if (count > 0) { + "识别到 ${count} 笔,等待确认" + } else { + "未识别到明确账单,可手动补充" + } + show( + context = context, + title = "AI 分析完成", + text = text, + progress = 75, + indeterminate = false, + ongoing = true, + requestPromotion = true, + ) + } + + fun finish(context: Context, count: Int, total: Double) { + val totalText = String.format(Locale.CHINA, "%.2f", total) + show( + context = context, + title = "入账完成", + text = "已保存 ${count} 笔,共 ¥$totalText", + progress = 100, + indeterminate = false, + ongoing = false, + requestPromotion = false, + ) + } + + fun fail(context: Context, message: String) { + show( + context = context, + title = "截屏记账未完成", + text = message.take(80), + progress = 0, + indeterminate = false, + ongoing = false, + requestPromotion = false, + ) + } + + private fun show( + context: Context, + title: String, + text: String, + progress: Int, + indeterminate: Boolean, + ongoing: Boolean, + requestPromotion: Boolean, + ) { + if (!canNotify(context)) return + + val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager + ensureChannel(manager) + + val openIntent = Intent(context, MainActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) + } + val pendingIntent = PendingIntent.getActivity( + context, + NOTIFICATION_ID, + openIntent, + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE, + ) + + @Suppress("DEPRECATION") + val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + Notification.Builder(context, CHANNEL_ID) + } else { + Notification.Builder(context) + } + builder.setSmallIcon(android.R.drawable.ic_menu_camera) + .setContentTitle(title) + .setContentText(text) + .setContentIntent(pendingIntent) + .setCategory(Notification.CATEGORY_PROGRESS) + .setOnlyAlertOnce(true) + .setOngoing(ongoing) + .setAutoCancel(!ongoing) + .setShowWhen(false) + + val liveStyleApplied = + Build.VERSION.SDK_INT >= 36 && + ongoing && + applyAndroid16ProgressStyle( + builder, + progress, + indeterminate, + requestPromotion, + ) + if (!liveStyleApplied) { + builder.setProgress(100, progress, indeterminate) + } + + manager.notify(NOTIFICATION_ID, builder.build()) + } + + private fun applyAndroid16ProgressStyle( + builder: Notification.Builder, + progress: Int, + indeterminate: Boolean, + requestPromotion: Boolean, + ): Boolean { + return try { + val styleClass = Class.forName("android.app.Notification\$ProgressStyle") + val style = styleClass.getDeclaredConstructor().newInstance() as Notification.Style + styleClass.getMethod( + "setProgress", + Int::class.javaPrimitiveType, + ).invoke(style, progress) + styleClass.getMethod( + "setProgressIndeterminate", + Boolean::class.javaPrimitiveType, + ).invoke(style, indeterminate) + builder.setStyle(style) + + if (requestPromotion) { + Notification.Builder::class.java.getMethod( + "setRequestPromotedOngoing", + Boolean::class.javaPrimitiveType, + ).invoke(builder, true) + } + true + } catch (_: ReflectiveOperationException) { + false + } + } + + private fun ensureChannel(manager: NotificationManager) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return + if (manager.getNotificationChannel(CHANNEL_ID) != null) return + + val channel = NotificationChannel( + CHANNEL_ID, + "AI 截屏识别进度", + NotificationManager.IMPORTANCE_DEFAULT, + ).apply { + description = "显示用户主动发起的截屏记账识别和入账进度" + setSound(null, null) + enableVibration(false) + } + manager.createNotificationChannel(channel) + } + + private fun canNotify(context: Context): Boolean { + if ( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && + ContextCompat.checkSelfPermission( + context, + Manifest.permission.POST_NOTIFICATIONS, + ) != PackageManager.PERMISSION_GRANTED + ) { + return false + } + val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager + return Build.VERSION.SDK_INT < Build.VERSION_CODES.N || + manager.areNotificationsEnabled() + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/BackgroundAiRecognizer.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/BackgroundAiRecognizer.kt new file mode 100644 index 0000000..2ce441d --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/BackgroundAiRecognizer.kt @@ -0,0 +1,112 @@ +package com.nx.miaoji + +import android.content.Context +import android.util.Log +import org.json.JSONObject +import java.io.ByteArrayOutputStream +import java.net.HttpURLConnection +import java.net.URL +import java.time.Instant +import java.util.UUID +import java.util.concurrent.Executors + +object BackgroundAiRecognizer { + private val executor = Executors.newSingleThreadExecutor() + + fun analyze( + context: Context, + packageName: String, + image: ByteArray, + flowSessionId: String? = null, + ) { + val appContext = context.applicationContext + executor.execute { + try { + val settings = RecognitionSettings.snapshot(appContext) + val token = RecognitionSettings.runtimeToken(appContext) + val baseUrl = settings.baseUrl?.trimEnd('/') + if (!settings.aiScreenshot || !settings.aiAllowed || !settings.hasAccount || + token.isNullOrBlank() || baseUrl.isNullOrBlank() + ) { + return@execute + } + val response = upload("$baseUrl/api/parse/image?source=screenshot", token, image) + if (response.first == HttpURLConnection.HTTP_FORBIDDEN && + response.second.contains("AI_PERMISSION_DENIED") + ) { + RecognitionSettings.disableRuntimeAi(appContext) + return@execute + } + if (response.first !in 200..299) { + Log.w(TAG, "Background AI parse failed status=${response.first}") + return@execute + } + val root = JSONObject(response.second) + val items = root.optJSONArray("items") ?: return@execute + for (index in 0 until minOf(items.length(), 10)) { + val item = items.optJSONObject(index) ?: continue + val type = item.optString("type").lowercase() + val amount = item.optDouble("amount", 0.0) + if (type !in setOf("income", "expense") || amount <= 0) continue + val occurredAt = runCatching { + Instant.parse(item.optString("occurredAt")).toEpochMilli() + }.getOrElse { System.currentTimeMillis() } + val note = item.optString("note").takeIf { it.isNotBlank() } + RecognitionCoordinator.get(appContext).submit( + PaymentSignal( + packageName = packageName, + channel = "recognition_ai", + amountCents = kotlin.math.round(amount * 100).toLong(), + type = type, + merchant = note, + orderId = null, + occurredAtEpochMs = occurredAt, + knownTemplate = false, + sourceEventId = "ai:" + (flowSessionId ?: UUID.randomUUID().toString()), + sourceText = "AI 截图补全 · " + PaymentParser.appName(packageName), + flowSessionId = flowSessionId, + evidenceConfidence = "confirm", + ), + ) + break + } + } catch (error: Exception) { + Log.w(TAG, "Background AI parse unavailable", error) + } finally { + image.fill(0) + } + } + } + + private fun upload( + endpoint: String, + token: String, + image: ByteArray, + ): Pair { + val boundary = "----Jizhi${UUID.randomUUID()}" + val connection = URL(endpoint).openConnection() as HttpURLConnection + connection.connectTimeout = 10_000 + connection.readTimeout = 120_000 + connection.requestMethod = "POST" + connection.doOutput = true + connection.setRequestProperty("Authorization", "Bearer $token") + connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=$boundary") + connection.outputStream.use { output -> + output.write("--$boundary\r\n".toByteArray()) + output.write( + "Content-Disposition: form-data; name=\"file\"; filename=\"recognition.png\"\r\n" + .toByteArray(), + ) + output.write("Content-Type: image/png\r\n\r\n".toByteArray()) + output.write(image) + output.write("\r\n--$boundary--\r\n".toByteArray()) + } + val code = connection.responseCode + val stream = if (code in 200..299) connection.inputStream else connection.errorStream + val body = stream?.bufferedReader(Charsets.UTF_8)?.use { it.readText() }.orEmpty() + connection.disconnect() + return code to body + } + + private const val TAG = "JizhiRecognition" +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/LocalPaymentOcr.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/LocalPaymentOcr.kt new file mode 100644 index 0000000..cd36f4b --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/LocalPaymentOcr.kt @@ -0,0 +1,483 @@ +package com.nx.miaoji + +import android.content.Context +import android.graphics.Bitmap +import android.graphics.Rect +import android.util.Log +import com.google.mlkit.common.MlKitException +import com.google.mlkit.common.sdkinternal.MlKitContext +import com.google.mlkit.vision.common.InputImage +import com.google.mlkit.vision.text.Text +import com.google.mlkit.vision.text.TextRecognition +import com.google.mlkit.vision.text.TextRecognizer +import com.google.mlkit.vision.text.chinese.ChineseTextRecognizerOptions +import java.util.concurrent.Executors +import java.util.concurrent.ScheduledFuture +import java.util.concurrent.TimeUnit +import kotlin.math.abs +import kotlin.math.roundToLong + +data class LocalOcrOutcome( + val signal: PaymentSignal?, + val sawSuccess: Boolean, + val amountCandidateCount: Int, + val reason: String, + val latencyMs: Long, + val statusStrength: String = "none", + val expectedAmountMatched: Boolean? = null, + val resultTransitionObserved: Boolean = false, + val redactedPreview: List = emptyList(), +) + +object OcrEvidenceEvaluator { + fun qualifiesWeakAuto( + trustedFlow: Boolean, + freshScreenshot: Boolean, + uniqueAmount: Boolean, + expectedAmountMatched: Boolean, + resultTransitionObserved: Boolean, + directionKnown: Boolean, + ): Boolean = trustedFlow && + freshScreenshot && + uniqueAmount && + expectedAmountMatched && + resultTransitionObserved && + directionKnown +} + +object OcrDiagnosticRedactor { + private val relevantLine = Regex( + """支付|付款|转账|收款|红包|领取|退回|退款|存入|到账|完成|成功|失败|等待|处理|金额|实付|交易|返回|继续|[¥¥]|[0-9]+[.][0-9]{1,2}""", + ) + private val labelledIdentity = Regex( + """(转账给|付款给|收款方|付款方|交易对象|对方|商户)[:: ]*[^,,]{1,40}""", + ) + private val orderValue = Regex( + """(订单号|交易单号|转账单号|商户单号|交易号)[:: ]*[A-Za-z0-9_-]{6,64}""", + RegexOption.IGNORE_CASE, + ) + private val phone = Regex("""(?): List = lines + .asSequence() + .map(String::trim) + .filter(String::isNotEmpty) + .map(::redactSensitive) + .map { line -> if (relevantLine.containsMatchIn(line)) line.take(MAX_LINE_CHARS) else HIDDEN } + .distinct() + .take(MAX_LINES) + .toList() + + private fun redactSensitive(value: String): String { + var redacted = url.replace(value, "[链接已隐藏]") + redacted = orderValue.replace(redacted) { match -> + match.groupValues[1] + ":******" + } + redacted = labelledIdentity.replace(redacted) { match -> + match.groupValues[1] + ":已隐藏" + } + redacted = phone.replace(redacted, "1**********") + return longNumber.replace(redacted) { match -> + "******" + match.value.takeLast(2) + } + } + + private const val MAX_LINES = 12 + private const val MAX_LINE_CHARS = 60 + private const val HIDDEN = "[其他文字已隐藏]" +} +object LocalPaymentOcr { + private val callbackExecutor = Executors.newSingleThreadExecutor() + private val closeScheduler = Executors.newSingleThreadScheduledExecutor() + private var recognizer: TextRecognizer? = null + private var closeFuture: ScheduledFuture<*>? = null + + fun analyze( + context: Context, + bitmap: Bitmap, + packageName: String, + flowSessionId: String, + trustedFlow: Boolean, + capturedAt: Long, + expectedAmountCents: Long?, + expectedType: String?, + resultTransitionObserved: Boolean, + submittedFlow: Boolean, + flowKind: String, + diagnosticPreviewEnabled: Boolean, + callback: (LocalOcrOutcome) -> Unit, + ) { + val startedAt = System.currentTimeMillis() + val client = getRecognizer(context) + client.process(InputImage.fromBitmap(bitmap, 0)) + .addOnSuccessListener(callbackExecutor) { result -> + val outcome = runCatching { + parse( + result = result, + packageName = packageName, + flowSessionId = flowSessionId, + trustedFlow = trustedFlow, + capturedAt = capturedAt, + expectedAmountCents = expectedAmountCents, + expectedType = expectedType, + resultTransitionObserved = resultTransitionObserved, + submittedFlow = submittedFlow, + flowKind = flowKind, + diagnosticPreviewEnabled = diagnosticPreviewEnabled, + startedAt = startedAt, + ) + }.getOrElse { + LocalOcrOutcome( + signal = null, + sawSuccess = false, + amountCandidateCount = 0, + reason = "ocr_parse_failed", + latencyMs = System.currentTimeMillis() - startedAt, + ) + } + runCatching { callback(outcome) } + scheduleClose() + } + .addOnFailureListener(callbackExecutor) { error -> + Log.e( + TAG, + "Local OCR task failed: " + + (error as? MlKitException)?.errorCode.orEmptyCode(), + error, + ) + runCatching { + callback( + LocalOcrOutcome( + signal = null, + sawSuccess = false, + amountCandidateCount = 0, + reason = taskFailureReason(error), + latencyMs = System.currentTimeMillis() - startedAt, + ), + ) + } + scheduleClose() + } + } + + @Synchronized + fun initialize(context: Context) { + MlKitContext.initializeIfNeeded(context.applicationContext) + } + + @Synchronized + private fun getRecognizer(context: Context): TextRecognizer { + initialize(context) + closeFuture?.cancel(false) + closeFuture = null + return recognizer ?: TextRecognition.getClient( + ChineseTextRecognizerOptions.Builder().build(), + ).also { recognizer = it } + } + + @Synchronized + private fun scheduleClose() { + closeFuture?.cancel(false) + closeFuture = closeScheduler.schedule( + { + synchronized(this) { + recognizer?.close() + recognizer = null + closeFuture = null + } + }, + OCR_IDLE_CLOSE_SECONDS, + TimeUnit.SECONDS, + ) + } + + private fun parse( + result: Text, + packageName: String, + flowSessionId: String, + trustedFlow: Boolean, + capturedAt: Long, + expectedAmountCents: Long?, + expectedType: String?, + resultTransitionObserved: Boolean, + submittedFlow: Boolean, + flowKind: String, + diagnosticPreviewEnabled: Boolean, + startedAt: Long, + ): LocalOcrOutcome { + val lines = result.textBlocks + .flatMap { block -> block.lines } + .map { VisualLine(it.text.trim(), it.boundingBox) } + .filter { it.text.isNotBlank() } + .sortedWith(compareBy({ it.bounds?.top ?: Int.MAX_VALUE }, { it.bounds?.left ?: 0 })) + + val allText = lines.joinToString(System.lineSeparator(), transform = VisualLine::text) + val preview = if (diagnosticPreviewEnabled) { + OcrDiagnosticRedactor.redact(lines.map(VisualLine::text)) + } else { + emptyList() + } + if (lines.isEmpty()) { + return outcome( + signal = null, + sawSuccess = false, + amountCount = 0, + reason = "no_text", + startedAt = startedAt, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + if (PaymentParser.isHistoryPageText(allText)) { + return outcome( + null, + false, + 0, + "history_page", + startedAt, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + if (PaymentParser.containsBlockedStatus(allText)) { + return outcome( + null, + false, + 0, + "blocked_status", + startedAt, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + if (flowKind != "red_packet_send" && PaymentParser.isPendingRedPacketSurface(allText)) { + return outcome( + null, + false, + 0, + "red_packet_not_settled", + startedAt, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + if (PaymentParser.isPaymentInputPage(allText)) { + return outcome( + null, + false, + 0, + "payment_input_page", + startedAt, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + + val detectedStatus = PaymentParser.detectStatus(allText, expectedType) + val redPacketSentSurface = flowKind == "red_packet_send" && + PaymentParser.hasRedPacketSentSurface(allText) + val status = if (detectedStatus.strength == PaymentStatusStrength.NONE && + redPacketSentSurface + ) { + PaymentStatusEvidence(PaymentStatusStrength.WEAK, "expense") + } else { + detectedStatus + } + if (status.strength == PaymentStatusStrength.NONE) { + return outcome( + null, + false, + 0, + "no_success_status", + startedAt, + statusStrength = status.strength.wireValue, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + val direction = status.direction + ?: return outcome( + null, + true, + 0, + "direction_unknown", + startedAt, + statusStrength = status.strength.wireValue, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + + val amountCandidates = collectAmounts(lines) + .filter { it.amount.isFinite() && it.amount > 0 && it.amount <= MAX_AMOUNT } + val statusIndex = lines.indexOfFirst { + PaymentParser.detectStatus(it.text, expectedType).strength != PaymentStatusStrength.NONE + } + val statusBounds = lines.getOrNull(statusIndex)?.bounds + val ranked = amountCandidates.sortedWith( + compareBy( + { candidate -> verticalDistance(statusBounds, candidate.bounds) }, + { candidate -> -(candidate.bounds?.height() ?: 0) }, + ), + ) + val distinctCents = ranked.map { (it.amount * 100).roundToLong() }.distinct() + val expectedCandidate = expectedAmountCents?.let { expected -> + ranked.firstOrNull { (it.amount * 100).roundToLong() == expected } + } + val resultSelectedCents = (expectedCandidate ?: ranked.firstOrNull()) + ?.let { (it.amount * 100).roundToLong() } + val canUseExpectedAmount = resultSelectedCents == null && + expectedAmountCents != null && + submittedFlow && + resultTransitionObserved && + expectedType == direction + if (resultSelectedCents == null && !canUseExpectedAmount) { + return outcome( + null, + true, + 0, + if (expectedAmountCents == null) "expected_amount_missing" else "missing_amount", + startedAt, + statusStrength = status.strength.wireValue, + expectedAmountMatched = expectedAmountCents?.let { false }, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + + val selectedCents = resultSelectedCents ?: expectedAmountCents!! + val amountSource = if (resultSelectedCents == null) "expected" else "result" + val expectedMatched = expectedAmountCents?.let { it == selectedCents } + val fresh = System.currentTimeMillis() - capturedAt <= MAX_SCREENSHOT_AGE_MS + val resultAmountSafe = distinctCents.size == 1 && + (expectedAmountCents == null || expectedMatched == true) + val highConfidence = when { + amountSource == "expected" -> trustedFlow && fresh && submittedFlow && + resultTransitionObserved && expectedType == direction + status.strength == PaymentStatusStrength.STRONG -> trustedFlow && fresh && + submittedFlow && resultTransitionObserved && resultAmountSafe + status.strength == PaymentStatusStrength.WEAK -> OcrEvidenceEvaluator.qualifiesWeakAuto( + trustedFlow = trustedFlow && submittedFlow, + freshScreenshot = fresh, + uniqueAmount = distinctCents.size == 1, + expectedAmountMatched = expectedMatched == true, + resultTransitionObserved = resultTransitionObserved, + directionKnown = expectedType != null && direction == expectedType, + ) + else -> false + } + val merchant = PaymentParser.extractMerchant(allText) + val orderId = PaymentParser.extractOrderId(allText) + val kind = if (flowKind.isNotBlank()) flowKind else PaymentParser.recognitionKind(allText, direction) + val signal = PaymentSignal( + packageName = packageName, + channel = "local_ocr", + amountCents = selectedCents, + type = direction, + merchant = merchant, + orderId = orderId, + occurredAtEpochMs = capturedAt, + knownTemplate = true, + sourceEventId = "ocr:" + packageName + ":" + flowSessionId, + sourceText = "本地 OCR · " + PaymentParser.appName(packageName), + flowSessionId = flowSessionId, + evidenceConfidence = if (highConfidence) "high" else "confirm", + recognitionKind = kind, + categoryHint = PaymentParser.categoryHint(kind, direction), + amountSource = amountSource, + resultFingerprint = PaymentParser.resultFingerprint( + packageName, + kind, + direction, + selectedCents, + merchant, + orderId, + PaymentParser.sha256(allText), + ), + ) + val reason = when { + highConfidence && amountSource == "expected" -> "expected_amount_fallback" + highConfidence && status.strength == PaymentStatusStrength.WEAK -> + "combined_high_confidence" + highConfidence -> "high_confidence" + status.strength == PaymentStatusStrength.WEAK -> "weak_status_confirm" + else -> "ambiguous_or_unarmed" + } + return outcome( + signal = signal, + sawSuccess = true, + amountCount = distinctCents.size, + reason = reason, + startedAt = startedAt, + statusStrength = status.strength.wireValue, + expectedAmountMatched = expectedMatched, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = preview, + ) + } + private fun collectAmounts(lines: List): List { + val candidates = mutableListOf() + lines.forEachIndexed { index, line -> + PaymentParser.parseAmountCandidate(line.text)?.let { + candidates += AmountCandidate(it, line.bounds) + } + if (line.text.trim() in setOf("¥", "¥") && index + 1 < lines.size) { + val next = lines[index + 1] + val amount = next.text.trim().toDoubleOrNull() + if (amount != null) candidates += AmountCandidate(amount, next.bounds) + } + } + return candidates.distinctBy { (it.amount * 100).roundToLong() to it.bounds } + } + + private fun verticalDistance(status: Rect?, amount: Rect?): Int { + if (status == null || amount == null) return Int.MAX_VALUE / 2 + return abs(status.centerY() - amount.centerY()) + } + + private fun outcome( + signal: PaymentSignal?, + sawSuccess: Boolean, + amountCount: Int, + reason: String, + startedAt: Long, + statusStrength: String = "none", + expectedAmountMatched: Boolean? = null, + resultTransitionObserved: Boolean = false, + redactedPreview: List = emptyList(), + ) = LocalOcrOutcome( + signal = signal, + sawSuccess = sawSuccess, + amountCandidateCount = amountCount, + reason = reason, + latencyMs = System.currentTimeMillis() - startedAt, + statusStrength = statusStrength, + expectedAmountMatched = expectedAmountMatched, + resultTransitionObserved = resultTransitionObserved, + redactedPreview = redactedPreview, + ) + + private fun taskFailureReason(error: Exception): String { + val code = (error as? MlKitException)?.errorCode ?: return "ocr_failed" + return when (code) { + MlKitException.NOT_FOUND, + MlKitException.FAILED_PRECONDITION, + MlKitException.MODEL_INCOMPATIBLE_WITH_TFLITE, + MlKitException.MODEL_HASH_MISMATCH, + -> "ocr_model_unavailable" + MlKitException.UNAVAILABLE -> "ocr_unavailable" + else -> "ocr_failed" + } + } + + private fun Int?.orEmptyCode(): String = this?.let { "code=$it" } ?: "non_mlkit_error" + + private data class VisualLine(val text: String, val bounds: Rect?) + private data class AmountCandidate(val amount: Double, val bounds: Rect?) + + private const val TAG = "JizhiRecognition" + private const val OCR_IDLE_CLOSE_SECONDS = 60L + private const val MAX_SCREENSHOT_AGE_MS = 3_000L + private const val MAX_AMOUNT = 100_000_000.0 +} \ No newline at end of file diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/MainActivity.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/MainActivity.kt new file mode 100644 index 0000000..c72f959 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/MainActivity.kt @@ -0,0 +1,864 @@ +package com.nx.miaoji + +import android.Manifest +import android.app.StatusBarManager +import android.app.UiModeManager +import android.content.BroadcastReceiver +import android.content.ComponentName +import android.content.Context +import android.content.Intent +import android.content.IntentFilter +import android.content.pm.PackageManager +import android.graphics.drawable.Icon +import android.net.Uri +import android.os.Build +import android.os.PowerManager +import android.os.Bundle +import android.os.Environment +import android.os.Handler +import android.provider.Settings +import android.speech.RecognitionListener +import android.speech.RecognizerIntent +import android.speech.SpeechRecognizer +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import androidx.lifecycle.Lifecycle +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import java.io.File +import java.util.UUID + +class MainActivity : FlutterActivity() { + companion object { + const val CHANNEL = "com.miaoji/screenshot" + const val AUDIO_PERMISSION_REQUEST = 1002 + const val NOTIFICATION_PERMISSION_REQUEST = 1003 + + const val EXTRA_ACTION = "action" + const val ACTION_SCREENSHOT_SHORTCUT = "screenshot" + const val ACTION_SCREENSHOT_RESULT = "screenshot_result" + const val ACTION_SCREENSHOT_ERROR = "screenshot_error" + const val ACTION_RECOGNITION_CONFIRM = "recognition_confirm" + const val ACTION_RECOGNITION_UNDO = "recognition_undo" + const val ACTION_RECOGNITION_EDIT = "recognition_edit" + const val EXTRA_SCREENSHOT_PATH = "screenshotPath" + const val EXTRA_SCREENSHOT_ERROR = "screenshotError" + const val EXTRA_SCREENSHOT_SESSION_ID = "screenshotSessionId" + const val EXTRA_TRANSACTION_ID = "transactionId" + } + + private val handler by lazy { Handler(mainLooper) } + private var channel: MethodChannel? = null + private var pendingCaptureResult: MethodChannel.Result? = null + private var shortcutQueued = false + private var shortcutScheduled = false + private var pendingUiScreenshotPath: String? = null + private var pendingUiScreenshotError: String? = null + private var lastScreenshotSessionId: String? = null + private var pendingNotificationStart = false + private var pendingNotificationPermissionResult: MethodChannel.Result? = null + private var pendingProgressCount: Int? = null + private var pendingRecognitionAction: Map? = null + private var recognitionReceiverRegistered = false + private var updateInstallBridge: UpdateInstallBridge? = null + + private var pendingSpeechResult: MethodChannel.Result? = null + private var speechRecognizer: SpeechRecognizer? = null + private var streamingSpeech = false + + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + updateInstallBridge = UpdateInstallBridge(this).also { it.register(flutterEngine) } + channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) + channel?.setMethodCallHandler { call, result -> + when (call.method) { + "captureScreenshot" -> captureFromFlutter(result) + "cleanupStaleScreenshots" -> cleanupStaleScreenshots(result) + "startAiProgress" -> startAiProgress(result) + "updateAiProgress" -> { + val count = call.intArgument("count") + pendingProgressCount = count + AiProgressNotifier.update(this, count) + result.success(true) + } + "finishAiProgress" -> { + pendingProgressCount = null + AiProgressNotifier.finish( + this, + call.intArgument("count"), + call.doubleArgument("total"), + ) + result.success(true) + } + "failAiProgress" -> { + pendingProgressCount = null + AiProgressNotifier.fail( + this, + call.argument("message") ?: "识别失败,请重试", + ) + result.success(true) + } + "recognizeSpeech" -> startSpeechRecognition(result) + "startSpeechRecognition" -> startStreamingSpeechRecognition(result) + "stopSpeechRecognition" -> { + speechRecognizer?.stopListening() + result.success(true) + } + "cancelSpeechRecognition" -> { + cancelSpeechRecognition() + result.success(true) + } + "isAccessibilityEnabled" -> result.success(isAccessibilityServiceEnabled()) + "getRecognitionStatus" -> { + result.success(recognitionStatus()) + } + "setRecognitionToggle" -> { + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_SET_TOGGLE, + extras = Bundle().apply { + putString("key", call.argument("key")) + putBoolean("enabled", call.argument("enabled") == true) + }, + ) + result.success(response?.getBoolean("success") == true) + } + "clearRecognitionDiagnostic" -> { + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_CLEAR_DIAGNOSTIC, + ) + result.success(response?.getBoolean("success") == true) + } + "configureRecognitionContext" -> { + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_SET_RUNTIME, + extras = Bundle().apply { + putBoolean("aiAllowed", call.argument("aiAllowed") == true) + putBoolean("hasAccount", call.argument("hasAccount") == true) + putString("baseUrl", call.argument("baseUrl")) + putString("token", call.argument("token")) + }, + ) + result.success(response?.getBoolean("success") == true) + } + "drainRecognitionCandidates" -> { + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_DRAIN, + ) + result.success(response?.getStringArrayList("candidates") ?: arrayListOf()) + } + "ackRecognitionCandidate" -> acknowledgeRecognition(call, result) + "openAccessibilitySettings" -> { + startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)) + result.success(true) + } + "openNotificationAccessSettings" -> { + startActivity(Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS)) + result.success(true) + } + "openBatteryOptimizationSettings" -> { + openBatteryOptimizationSettings() + result.success(true) + } + "openBackgroundStartupSettings" -> { + openBackgroundStartupSettings() + result.success(true) + } + "requestNotificationPermission" -> requestNotificationPermission(result) + "setThemeMode" -> { + setNativeThemeMode(call.argument("mode")) + result.success(true) + } + "openQuickSettings" -> openQuickSettings(result) + else -> result.notImplemented() + } + } + registerRecognitionReceiver() + handleIncomingIntent(intent) + } + + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + setIntent(intent) + handleIncomingIntent(intent) + } + + override fun onResume() { + super.onResume() + updateInstallBridge?.onResume() + scheduleShortcutIfNeeded() + dispatchPendingScreenshot() + dispatchPendingRecognitionAction() + } + + private fun handleIncomingIntent(incoming: Intent?) { + when (incoming?.getStringExtra(EXTRA_ACTION)) { + ACTION_SCREENSHOT_SHORTCUT -> { + shortcutQueued = true + scheduleShortcutIfNeeded() + } + ACTION_SCREENSHOT_RESULT -> { + val path = incoming.getStringExtra(EXTRA_SCREENSHOT_PATH) + val sessionId = + incoming.getStringExtra(EXTRA_SCREENSHOT_SESSION_ID) ?: path + if (!path.isNullOrBlank()) { + if (sessionId == lastScreenshotSessionId) { + incoming.removeExtra(EXTRA_ACTION) + return + } + if (!ScreenshotResultDispatcher.isValidImage(path)) { + File(path).delete() + finishScreenshotError("截屏图片无效,请重新截取") + incoming.removeExtra(EXTRA_ACTION) + return + } + lastScreenshotSessionId = sessionId + val callback = pendingCaptureResult + pendingCaptureResult = null + if (callback != null) { + callback.success(path) + } else { + pendingUiScreenshotPath = path + pendingUiScreenshotError = null + dispatchPendingScreenshot() + } + } + } + ACTION_SCREENSHOT_ERROR -> { + val message = + incoming.getStringExtra(EXTRA_SCREENSHOT_ERROR) ?: "截屏失败,请重试" + if (pendingCaptureResult != null) { + finishScreenshotError(message) + } else { + pendingUiScreenshotError = message + pendingUiScreenshotPath = null + dispatchPendingScreenshot() + } + } + ACTION_RECOGNITION_CONFIRM, + ACTION_RECOGNITION_UNDO, + ACTION_RECOGNITION_EDIT -> { + pendingRecognitionAction = mapOf( + "action" to incoming.getStringExtra(EXTRA_ACTION), + "candidateId" to incoming.getStringExtra( + RecognitionCoordinator.EXTRA_CANDIDATE_ID, + ), + "transactionId" to incoming.getLongExtra( + EXTRA_TRANSACTION_ID, + Long.MIN_VALUE, + ).takeIf { it != Long.MIN_VALUE }, + ) + dispatchPendingRecognitionAction() + } + } + incoming?.removeExtra(EXTRA_ACTION) + incoming?.removeExtra(EXTRA_SCREENSHOT_SESSION_ID) + } + + private fun scheduleShortcutIfNeeded() { + if (!shortcutQueued || shortcutScheduled) return + if (!lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) return + + shortcutScheduled = true + handler.postDelayed({ + shortcutScheduled = false + if (!shortcutQueued) return@postDelayed + shortcutQueued = false + + if ( + Build.VERSION.SDK_INT < Build.VERSION_CODES.R || + !isAccessibilityServiceEnabled() + ) { + startActivity( + Intent(this, ProjectionConsentActivity::class.java), + ) + return@postDelayed + } + + moveTaskToBack(true) + val requestId = UUID.randomUUID().toString() + val accepted = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_REQUEST_SCREENSHOT, + extras = Bundle().apply { + putString("requestId", requestId) + putBoolean("showResult", true) + putLong("delayMs", 500L) + }, + ) + ?.getBoolean("accepted") == true + if (!accepted) { + startActivity( + Intent(this, ProjectionConsentActivity::class.java), + ) + } + }, 180L) + } + + private fun captureFromFlutter(result: MethodChannel.Result) { + if (pendingCaptureResult != null) { + result.error("BUSY", "截屏正在处理中", null) + return + } + pendingCaptureResult = result + val requestId = UUID.randomUUID().toString() + val accepted = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && + RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_REQUEST_SCREENSHOT, + extras = Bundle().apply { + putString("requestId", requestId) + putBoolean("showResult", false) + }, + )?.getBoolean("accepted") == true + if (!accepted) { + try { + startActivity( + Intent( + this, + ProjectionConsentActivity::class.java, + ).putExtra( + ProjectionConsentActivity.EXTRA_RETURN_ERROR_TO_APP, + true, + ), + ) + } catch (e: Exception) { + finishScreenshotError( + e.message ?: "无法申请系统截屏授权,请稍后重试", + ) + } + } else { + pollScreenshotResult(requestId, System.currentTimeMillis()) + } + } + + private fun pollScreenshotResult(requestId: String, startedAt: Long) { + if (pendingCaptureResult == null) return + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_SCREENSHOT_RESULT, + arg = requestId, + ) + if (response?.getBoolean("ready") == true) { + val path = response.getString("path") + val error = response.getString("error") + when { + !path.isNullOrBlank() && ScreenshotResultDispatcher.isValidImage(path) -> { + pendingCaptureResult?.success(path) + pendingCaptureResult = null + } + !path.isNullOrBlank() -> { + File(path).delete() + finishScreenshotError("截屏图片无效,请重新截取") + } + else -> finishScreenshotError(error ?: "截屏失败,请重试") + } + return + } + if (System.currentTimeMillis() - startedAt > 12_000L) { + finishScreenshotError("截屏服务响应超时,请重试") + return + } + handler.postDelayed({ pollScreenshotResult(requestId, startedAt) }, 120L) + } + + private fun dispatchPendingScreenshot() { + if (!lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) return + handler.removeCallbacks(dispatchScreenshotRunnable) + handler.postDelayed(dispatchScreenshotRunnable, 700L) + } + + private val dispatchScreenshotRunnable = Runnable { + val path = pendingUiScreenshotPath + val error = pendingUiScreenshotError + when { + path != null -> { + pendingUiScreenshotPath = null + channel?.invokeMethod("onScreenshotReady", path) + } + error != null -> { + pendingUiScreenshotError = null + channel?.invokeMethod("onScreenshotError", error) + } + } + } + + private fun finishScreenshotError(message: String) { + val callback = pendingCaptureResult + pendingCaptureResult = null + if (callback != null) { + callback.error("SCREENSHOT_ERROR", message, null) + } else { + pendingUiScreenshotError = message + dispatchPendingScreenshot() + } + } + + private fun openBatteryOptimizationSettings() { + runCatching { + startActivity(Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS)) + }.onFailure { + startActivity( + Intent( + Settings.ACTION_APPLICATION_DETAILS_SETTINGS, + Uri.parse("package:$packageName"), + ), + ) + } + } + + private fun openBackgroundStartupSettings() { + val candidates = if (Build.MANUFACTURER.equals("vivo", ignoreCase = true)) { + listOf( + Intent().setComponent( + ComponentName( + "com.vivo.permissionmanager", + "com.vivo.permissionmanager.activity.BgStartUpManagerActivity", + ), + ), + Intent().setComponent( + ComponentName( + "com.iqoo.secure", + "com.iqoo.secure.ui.phoneoptimize.BgStartUpManager", + ), + ), + ) + } else { + emptyList() + } + val target = candidates.firstOrNull { + it.resolveActivity(packageManager) != null + } ?: Intent( + Settings.ACTION_APPLICATION_DETAILS_SETTINGS, + Uri.parse("package:$packageName"), + ) + startActivity(target) + } + + private fun requestNotificationPermission(result: MethodChannel.Result) { + if ( + Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || + ContextCompat.checkSelfPermission( + this, + Manifest.permission.POST_NOTIFICATIONS, + ) == PackageManager.PERMISSION_GRANTED + ) { + result.success(true) + return + } + pendingNotificationPermissionResult = result + ActivityCompat.requestPermissions( + this, + arrayOf(Manifest.permission.POST_NOTIFICATIONS), + NOTIFICATION_PERMISSION_REQUEST, + ) + } + + private fun startAiProgress(result: MethodChannel.Result) { + if ( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && + ContextCompat.checkSelfPermission( + this, + Manifest.permission.POST_NOTIFICATIONS, + ) != PackageManager.PERMISSION_GRANTED + ) { + pendingNotificationStart = true + ActivityCompat.requestPermissions( + this, + arrayOf(Manifest.permission.POST_NOTIFICATIONS), + NOTIFICATION_PERMISSION_REQUEST, + ) + result.success(false) + return + } + + AiProgressNotifier.start(this) + result.success(true) + } + + private fun MethodCall.intArgument(name: String): Int { + return (argument(name))?.toInt() ?: 0 + } + + private fun MethodCall.doubleArgument(name: String): Double { + return (argument(name))?.toDouble() ?: 0.0 + } + + private fun startSpeechRecognition(result: MethodChannel.Result) { + if (pendingSpeechResult != null || speechRecognizer != null) { + result.error("BUSY", "语音识别正在进行中", null) + return + } + pendingSpeechResult = result + streamingSpeech = false + requestSpeechPermissionOrBegin() + } + + private fun startStreamingSpeechRecognition(result: MethodChannel.Result) { + if (pendingSpeechResult != null || speechRecognizer != null) { + result.error("BUSY", "语音识别正在进行中", null) + return + } + streamingSpeech = true + result.success(true) + requestSpeechPermissionOrBegin() + } + + private fun requestSpeechPermissionOrBegin() { + if (ContextCompat.checkSelfPermission( + this, + Manifest.permission.RECORD_AUDIO, + ) != PackageManager.PERMISSION_GRANTED + ) { + ActivityCompat.requestPermissions( + this, + arrayOf(Manifest.permission.RECORD_AUDIO), + AUDIO_PERMISSION_REQUEST, + ) + return + } + beginSpeechRecognition() + } + + private fun beginSpeechRecognition() { + try { + val onDeviceAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && + SpeechRecognizer.isOnDeviceRecognitionAvailable(this) + if (!onDeviceAvailable && !SpeechRecognizer.isRecognitionAvailable(this)) { + finishSpeechError("UNAVAILABLE", "手机没有可用的语音识别服务") + return + } + + speechRecognizer?.destroy() + speechRecognizer = if (onDeviceAvailable) { + SpeechRecognizer.createOnDeviceSpeechRecognizer(this) + } else { + SpeechRecognizer.createSpeechRecognizer(this) + } + speechRecognizer?.setRecognitionListener(object : RecognitionListener { + override fun onReadyForSpeech(params: Bundle?) { + emitSpeechEvent("ready") + } + + override fun onBeginningOfSpeech() { + emitSpeechEvent("speaking") + } + + override fun onRmsChanged(rmsdB: Float) { + emitSpeechEvent("rms", rms = rmsdB.coerceIn(-2f, 12f)) + } + + override fun onBufferReceived(buffer: ByteArray?) {} + + override fun onEndOfSpeech() { + emitSpeechEvent("processing") + } + + override fun onPartialResults(partialResults: Bundle?) { + val text = partialResults + ?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION) + ?.firstOrNull() + ?.trim() + if (!text.isNullOrEmpty()) emitSpeechEvent("partial", text) + } + + override fun onEvent(eventType: Int, params: Bundle?) {} + + override fun onError(error: Int) { + if ( + error == SpeechRecognizer.ERROR_NO_MATCH || + error == SpeechRecognizer.ERROR_SPEECH_TIMEOUT + ) { + finishSpeechSuccess(null) + } else { + finishSpeechError("SPEECH_$error", speechErrorMessage(error)) + } + } + + override fun onResults(results: Bundle?) { + val text = results + ?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION) + ?.firstOrNull() + ?.trim() + finishSpeechSuccess(text) + } + }) + + val recognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { + putExtra( + RecognizerIntent.EXTRA_LANGUAGE_MODEL, + RecognizerIntent.LANGUAGE_MODEL_FREE_FORM, + ) + putExtra(RecognizerIntent.EXTRA_LANGUAGE, "zh-CN") + putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "zh-CN") + putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true) + putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3) + putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, packageName) + } + speechRecognizer?.startListening(recognizerIntent) + } catch (e: Exception) { + finishSpeechError("ERROR", e.message ?: "语音识别启动失败") + } + } + + private fun speechErrorMessage(error: Int): String = when (error) { + SpeechRecognizer.ERROR_AUDIO -> "录音失败,请重试" + SpeechRecognizer.ERROR_CLIENT -> "语音识别客户端异常" + SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS -> "没有录音权限" + SpeechRecognizer.ERROR_NETWORK, + SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "语音识别网络不可用" + SpeechRecognizer.ERROR_RECOGNIZER_BUSY -> "语音识别服务忙,请稍后重试" + SpeechRecognizer.ERROR_SERVER -> "语音识别服务异常" + else -> "语音识别失败($error)" + } + + private fun finishSpeechSuccess(text: String?) { + val callback = pendingSpeechResult + pendingSpeechResult = null + if (streamingSpeech) emitSpeechEvent("final", text) + streamingSpeech = false + speechRecognizer?.destroy() + speechRecognizer = null + callback?.success(text) + } + + private fun finishSpeechError(code: String, message: String) { + val callback = pendingSpeechResult + pendingSpeechResult = null + if (streamingSpeech) emitSpeechEvent("error", message) + streamingSpeech = false + speechRecognizer?.destroy() + speechRecognizer = null + callback?.error(code, message, null) + } + + private fun cancelSpeechRecognition() { + speechRecognizer?.cancel() + speechRecognizer?.destroy() + speechRecognizer = null + pendingSpeechResult?.success(null) + pendingSpeechResult = null + if (streamingSpeech) emitSpeechEvent("cancelled") + streamingSpeech = false + } + + private fun emitSpeechEvent(type: String, text: String? = null, rms: Float? = null) { + if (!streamingSpeech) return + val payload = mutableMapOf("type" to type) + if (text != null) payload["text"] = text + if (rms != null) payload["rms"] = rms + channel?.invokeMethod("onSpeechEvent", payload) + } + + override fun onRequestPermissionsResult( + requestCode: Int, + permissions: Array, + grantResults: IntArray, + ) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + when (requestCode) { + AUDIO_PERMISSION_REQUEST -> { + if (grantResults.firstOrNull() == PackageManager.PERMISSION_GRANTED) { + beginSpeechRecognition() + } else { + finishSpeechError( + "PERMISSION_DENIED", + "需要录音权限才能使用语音记账", + ) + } + } + NOTIFICATION_PERMISSION_REQUEST -> { + val granted = + grantResults.firstOrNull() == PackageManager.PERMISSION_GRANTED + pendingNotificationPermissionResult?.success(granted) + pendingNotificationPermissionResult = null + if (pendingNotificationStart && granted) { + AiProgressNotifier.start(this) + pendingProgressCount?.let { AiProgressNotifier.update(this, it) } + } + pendingNotificationStart = false + } + } + } + + private fun openQuickSettings(result: MethodChannel.Result) { + try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + val manager = getSystemService(StatusBarManager::class.java) + manager.requestAddTileService( + ComponentName(this, ScreenshotTileService::class.java), + "截屏记账", + Icon.createWithResource(this, android.R.drawable.ic_menu_camera), + mainExecutor, + ) { resultCode -> + result.success(resultCode == 1 || resultCode == 2) + } + } else { + startActivity(Intent("android.settings.QUICK_SETTINGS")) + result.success(true) + } + } catch (e: Exception) { + result.error("ERROR", e.message, null) + } + } + + private fun cleanupStaleScreenshots(result: MethodChannel.Result) { + try { + val cutoff = System.currentTimeMillis() - 24L * 60L * 60L * 1000L + var deleted = 0 + val directories = listOfNotNull( + getExternalFilesDir(Environment.DIRECTORY_PICTURES), + filesDir, + ).distinctBy(File::getAbsolutePath) + directories.forEach { directory -> + directory.listFiles()?.forEach { file -> + val isMiaojiScreenshot = + file.name.startsWith("miaoji_screenshot_") || + file.name.startsWith("miaoji_projection_") + if (isMiaojiScreenshot && file.lastModified() < cutoff && file.delete()) { + deleted += 1 + } + } + } + result.success(deleted) + } catch (error: Exception) { + result.error("CLEANUP_ERROR", error.message, null) + } + } + + private fun setNativeThemeMode(mode: String?) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return + val manager = getSystemService(UiModeManager::class.java) + manager.setApplicationNightMode( + when (mode) { + "dark" -> UiModeManager.MODE_NIGHT_YES + "light" -> UiModeManager.MODE_NIGHT_NO + else -> UiModeManager.MODE_NIGHT_AUTO + }, + ) + } + private fun recognitionStatus(): Map { + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_STATUS, + ) + val enabledListeners = Settings.Secure.getString( + contentResolver, + "enabled_notification_listeners", + ).orEmpty() + val notificationAuthorized = enabledListeners + .split(':') + .mapNotNull(ComponentName::unflattenFromString) + .any { it == ComponentName(this, PaymentNotificationListenerService::class.java) } + return mapOf( + "accessibilityAuthorized" to isAccessibilityEnabledInSystem(), + "accessibilityConnected" to (response?.getBoolean("accessibilityConnected") == true), + "notificationAuthorized" to notificationAuthorized, + "notificationConnected" to (response?.getBoolean("notificationConnected") == true), + "postNotificationsGranted" to ( + Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || + ContextCompat.checkSelfPermission( + this, + Manifest.permission.POST_NOTIFICATIONS, + ) == PackageManager.PERMISSION_GRANTED + ), + "batteryOptimizationIgnored" to ( + Build.VERSION.SDK_INT < Build.VERSION_CODES.M || + getSystemService(PowerManager::class.java) + .isIgnoringBatteryOptimizations(packageName) + ), + "manufacturer" to Build.MANUFACTURER.orEmpty(), + "settings" to response?.getString("settings"), + "latestStatus" to response?.getString("latestStatus"), + "latestDiagnostic" to response?.getString("latestDiagnostic"), + ) + } + + private fun acknowledgeRecognition(call: MethodCall, result: MethodChannel.Result) { + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_ACK, + extras = Bundle().apply { + putString("id", call.argument("id")) + putString("state", call.argument("state")) + call.argument("transactionId")?.let { + putLong("transactionId", it.toLong()) + } + }, + ) + result.success(response?.getBoolean("success") == true) + } + + private fun registerRecognitionReceiver() { + if (recognitionReceiverRegistered) return + val filter = IntentFilter(RecognitionCoordinator.ACTION_READY) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + registerReceiver(recognitionReceiver, filter, Context.RECEIVER_NOT_EXPORTED) + } else { + @Suppress("DEPRECATION") + registerReceiver(recognitionReceiver, filter) + } + recognitionReceiverRegistered = true + } + + private val recognitionReceiver = object : BroadcastReceiver() { + override fun onReceive(context: Context?, intent: Intent?) { + pendingRecognitionAction = mapOf( + "action" to "ready", + "candidateId" to intent?.getStringExtra( + RecognitionCoordinator.EXTRA_CANDIDATE_ID, + ), + ) + dispatchPendingRecognitionAction() + } + } + + private fun dispatchPendingRecognitionAction() { + if (!lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) return + val action = pendingRecognitionAction ?: return + pendingRecognitionAction = null + channel?.invokeMethod("onRecognitionAction", action) + } + + private fun isAccessibilityServiceEnabled(): Boolean { + if (!isAccessibilityEnabledInSystem()) return false + val response = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_STATUS, + ) + return response?.getBoolean("accessibilityConnected") == true + } + + private fun isAccessibilityEnabledInSystem(): Boolean { + val expected = ComponentName(this, ScreenshotAccessibilityService::class.java) + val enabled = Settings.Secure.getString( + contentResolver, + Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, + ) ?: return false + val enabledInSystem = enabled + .split(':') + .mapNotNull { ComponentName.unflattenFromString(it) } + .any { it == expected } + return enabledInSystem + } + + override fun onDestroy() { + handler.removeCallbacksAndMessages(null) + if (recognitionReceiverRegistered) { + unregisterReceiver(recognitionReceiver) + recognitionReceiverRegistered = false + } + speechRecognizer?.destroy() + speechRecognizer = null + pendingSpeechResult = null + streamingSpeech = false + updateInstallBridge?.dispose() + updateInstallBridge = null + super.onDestroy() + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/NativeCrypto.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/NativeCrypto.kt new file mode 100644 index 0000000..d54e9e7 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/NativeCrypto.kt @@ -0,0 +1,54 @@ +package com.nx.miaoji + +import android.security.keystore.KeyGenParameterSpec +import android.security.keystore.KeyProperties +import android.util.Base64 +import java.security.KeyStore +import javax.crypto.Cipher +import javax.crypto.KeyGenerator +import javax.crypto.SecretKey +import javax.crypto.spec.GCMParameterSpec + +object NativeCrypto { + private const val ALIAS = "jizhi_recognition_queue" + private const val TRANSFORMATION = "AES/GCM/NoPadding" + + fun encrypt(value: ByteArray): String? = runCatching { + val cipher = Cipher.getInstance(TRANSFORMATION) + cipher.init(Cipher.ENCRYPT_MODE, key()) + val encrypted = cipher.doFinal(value) + val payload = ByteArray(1 + cipher.iv.size + encrypted.size) + payload[0] = cipher.iv.size.toByte() + cipher.iv.copyInto(payload, 1) + encrypted.copyInto(payload, 1 + cipher.iv.size) + Base64.encodeToString(payload, Base64.NO_WRAP) + }.getOrNull() + + fun decrypt(encoded: String): ByteArray? = runCatching { + val payload = Base64.decode(encoded, Base64.NO_WRAP) + val ivSize = payload[0].toInt() + require(ivSize in 12..16 && payload.size > ivSize + 1) + val iv = payload.copyOfRange(1, 1 + ivSize) + val encrypted = payload.copyOfRange(1 + ivSize, payload.size) + val cipher = Cipher.getInstance(TRANSFORMATION) + cipher.init(Cipher.DECRYPT_MODE, key(), GCMParameterSpec(128, iv)) + cipher.doFinal(encrypted) + }.getOrNull() + + private fun key(): SecretKey { + val store = KeyStore.getInstance("AndroidKeyStore").apply { load(null) } + (store.getKey(ALIAS, null) as? SecretKey)?.let { return it } + val generator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore") + generator.init( + KeyGenParameterSpec.Builder( + ALIAS, + KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT, + ) + .setBlockModes(KeyProperties.BLOCK_MODE_GCM) + .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) + .setKeySize(256) + .build(), + ) + return generator.generateKey() + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/OneShotProjectionService.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/OneShotProjectionService.kt new file mode 100644 index 0000000..19a6063 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/OneShotProjectionService.kt @@ -0,0 +1,289 @@ +package com.nx.miaoji + +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.Service +import android.content.Intent +import android.content.pm.ServiceInfo +import android.graphics.Bitmap +import android.graphics.PixelFormat +import android.hardware.display.DisplayManager +import android.hardware.display.VirtualDisplay +import android.media.ImageReader +import android.media.projection.MediaProjection +import android.media.projection.MediaProjectionManager +import android.os.Build +import android.os.Environment +import android.os.Handler +import android.os.IBinder +import android.os.Looper +import android.util.Log +import java.io.File +import java.io.FileOutputStream + +class OneShotProjectionService : Service() { + private val handler = Handler(Looper.getMainLooper()) + private var mediaProjection: MediaProjection? = null + private var virtualDisplay: VirtualDisplay? = null + private var imageReader: ImageReader? = null + private var completed = false + private var sessionId = "" + + override fun onBind(intent: Intent?): IBinder? = null + + override fun onCreate() { + super.onCreate() + createNotificationChannel() + val notification = buildNotification() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + startForeground( + NOTIFICATION_ID, + notification, + ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION, + ) + } else { + startForeground(NOTIFICATION_ID, notification) + } + } + + override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { + if (completed || mediaProjection != null) return START_NOT_STICKY + sessionId = intent?.getStringExtra(EXTRA_SESSION_ID) + ?: ScreenshotResultDispatcher.newSessionId() + + val resultCode = intent?.getIntExtra(EXTRA_RESULT_CODE, Int.MIN_VALUE) + ?: Int.MIN_VALUE + @Suppress("DEPRECATION") + val resultData = intent?.getParcelableExtra(EXTRA_RESULT_DATA) + if (resultCode != android.app.Activity.RESULT_OK || resultData == null) { + fail("截屏授权数据无效,请重新授权") + return START_NOT_STICKY + } + + handler.postDelayed( + { startCapture(resultCode, resultData) }, + SOURCE_APP_RESTORE_DELAY_MS, + ) + handler.postDelayed( + { fail("截屏等待超时,请重试") }, + CAPTURE_TIMEOUT_MS, + ) + return START_NOT_STICKY + } + + private fun startCapture(resultCode: Int, resultData: Intent) { + if (completed) return + try { + val manager = getSystemService(MediaProjectionManager::class.java) + mediaProjection = manager.getMediaProjection(resultCode, resultData) + mediaProjection?.registerCallback( + object : MediaProjection.Callback() { + override fun onStop() { + if (!completed) fail("系统已停止截屏会话,请重试") + } + }, + handler, + ) + + val metrics = resources.displayMetrics + val width = metrics.widthPixels + val height = metrics.heightPixels + imageReader = ImageReader.newInstance( + width, + height, + PixelFormat.RGBA_8888, + 2, + ).also { reader -> + reader.setOnImageAvailableListener( + { available -> consumeImage(available, width, height) }, + handler, + ) + } + + virtualDisplay = mediaProjection?.createVirtualDisplay( + "MiaoJiOneShotCapture", + width, + height, + metrics.densityDpi, + DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR, + imageReader?.surface, + null, + handler, + ) + if (virtualDisplay == null) { + fail("系统无法创建截屏画面,请重试") + } + } catch (e: SecurityException) { + Log.e(TAG, "Projection permission rejected", e) + fail("截屏授权已失效,请重新授权") + } catch (e: Exception) { + Log.e(TAG, "Unable to start projection capture", e) + fail("系统截屏失败,请重试") + } + } + + private fun consumeImage(reader: ImageReader, width: Int, height: Int) { + if (completed) return + val image = reader.acquireLatestImage() ?: return + var paddedBitmap: Bitmap? = null + var bitmap: Bitmap? = null + try { + val plane = image.planes.first() + val rowPadding = plane.rowStride - plane.pixelStride * width + paddedBitmap = Bitmap.createBitmap( + width + rowPadding / plane.pixelStride, + height, + Bitmap.Config.ARGB_8888, + ) + paddedBitmap.copyPixelsFromBuffer(plane.buffer) + bitmap = Bitmap.createBitmap(paddedBitmap, 0, 0, width, height) + if (isLikelySecureFrame(bitmap)) { + fail("当前页面禁止截屏,无法识别") + return + } + val path = saveBitmap(bitmap) + complete(path) + } catch (e: Exception) { + Log.e(TAG, "Unable to consume projection image", e) + fail("截屏图片生成失败,请重试") + } finally { + bitmap?.recycle() + paddedBitmap?.recycle() + image.close() + } + } + + private fun isLikelySecureFrame(bitmap: Bitmap): Boolean { + val startX = bitmap.width / 10 + val endX = bitmap.width - startX + val startY = bitmap.height / 10 + val endY = bitmap.height - startY + val stepX = maxOf(1, (endX - startX) / 24) + val stepY = maxOf(1, (endY - startY) / 24) + var samples = 0 + var blankPixels = 0 + for (y in startY until endY step stepY) { + for (x in startX until endX step stepX) { + val color = bitmap.getPixel(x, y) + val alpha = color ushr 24 and 0xff + val red = color ushr 16 and 0xff + val green = color ushr 8 and 0xff + val blue = color and 0xff + if (alpha == 0 || (red <= 4 && green <= 4 && blue <= 4)) { + blankPixels++ + } + samples++ + } + } + return samples > 0 && blankPixels * 100 / samples >= 98 + } + + private fun saveBitmap(bitmap: Bitmap): String { + val directory = getExternalFilesDir(Environment.DIRECTORY_PICTURES) + ?: filesDir + if (!directory.exists() && !directory.mkdirs()) { + throw IllegalStateException("无法创建截屏目录") + } + val file = File(directory, "miaoji_projection_${sessionId}.png") + FileOutputStream(file).use { output -> + if (!bitmap.compress(Bitmap.CompressFormat.PNG, 100, output)) { + throw IllegalStateException("无法写入截屏文件") + } + } + return file.absolutePath + } + + private fun complete(path: String) { + if (!markCompleted()) return + Log.i(TAG, "One-shot projection screenshot saved") + if (!ScreenshotResultDispatcher.openResult(this, path, sessionId)) { + File(path).delete() + } + releaseResources() + } + + private fun fail(message: String) { + if (!markCompleted()) return + Log.w(TAG, message) + ScreenshotResultDispatcher.notifyFailure(this, message) + releaseResources() + } + + private fun markCompleted(): Boolean { + if (completed) return false + completed = true + handler.removeCallbacksAndMessages(null) + return true + } + + private fun releaseResources() { + virtualDisplay?.release() + virtualDisplay = null + imageReader?.close() + imageReader = null + try { + mediaProjection?.stop() + } catch (_: Exception) { + } + mediaProjection = null + stopForeground(STOP_FOREGROUND_REMOVE) + stopSelf() + } + + override fun onDestroy() { + if (!completed) { + completed = true + handler.removeCallbacksAndMessages(null) + virtualDisplay?.release() + imageReader?.close() + try { + mediaProjection?.stop() + } catch (_: Exception) { + } + } + super.onDestroy() + } + + private fun createNotificationChannel() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return + val manager = getSystemService(NotificationManager::class.java) + manager.createNotificationChannel( + NotificationChannel( + CHANNEL_ID, + "一次性截屏", + NotificationManager.IMPORTANCE_LOW, + ).apply { + description = "仅在用户授权后截取一帧,完成后立即关闭" + setShowBadge(false) + }, + ) + } + + private fun buildNotification(): Notification { + val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + Notification.Builder(this, CHANNEL_ID) + } else { + @Suppress("DEPRECATION") + Notification.Builder(this) + } + return builder + .setSmallIcon(R.mipmap.ic_launcher) + .setContentTitle("正在获取截图") + .setContentText("完成后会立即停止系统投屏") + .setOngoing(true) + .setCategory(Notification.CATEGORY_PROGRESS) + .build() + } + + companion object { + const val EXTRA_RESULT_CODE = "resultCode" + const val EXTRA_RESULT_DATA = "resultData" + const val EXTRA_SESSION_ID = "sessionId" + private const val TAG = "MiaoJiProjection" + private const val CHANNEL_ID = "miaoji_one_shot_projection" + private const val NOTIFICATION_ID = 4312 + private const val SOURCE_APP_RESTORE_DELAY_MS = 900L + private const val CAPTURE_TIMEOUT_MS = 7_000L + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentNotificationListenerService.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentNotificationListenerService.kt new file mode 100644 index 0000000..30b84ae --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentNotificationListenerService.kt @@ -0,0 +1,40 @@ +package com.nx.miaoji + +import android.service.notification.NotificationListenerService +import android.service.notification.StatusBarNotification +import android.util.Log + +class PaymentNotificationListenerService : NotificationListenerService() { + override fun onListenerConnected() { + super.onListenerConnected() + isConnected = true + Log.i(TAG, "Notification recognition listener connected") + } + + override fun onListenerDisconnected() { + isConnected = false + requestRebind( + android.content.ComponentName(this, PaymentNotificationListenerService::class.java), + ) + super.onListenerDisconnected() + } + + override fun onNotificationPosted(sbn: StatusBarNotification?) { + val notification = sbn ?: return + if (!RecognitionSettings.snapshot(this).notificationEvents) return + if (notification.packageName !in PaymentParser.supportedPackages) return + PaymentParser.fromNotification(notification)?.let { + RecognitionCoordinator.get(this).submit(it) + } + } + + override fun onNotificationRemoved(sbn: StatusBarNotification?) = Unit + + companion object { + private const val TAG = "JizhiRecognition" + + @Volatile + var isConnected: Boolean = false + private set + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentParser.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentParser.kt new file mode 100644 index 0000000..52e320f --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentParser.kt @@ -0,0 +1,541 @@ +package com.nx.miaoji + +import android.app.Notification +import android.service.notification.StatusBarNotification +import java.security.MessageDigest +import kotlin.math.roundToLong + +data class PaymentSignal( + val packageName: String, + val channel: String, + val amountCents: Long, + val type: String, + val merchant: String?, + val orderId: String?, + val occurredAtEpochMs: Long, + val knownTemplate: Boolean, + val sourceEventId: String, + val sourceText: String?, + val flowSessionId: String? = null, + val evidenceConfidence: String = "confirm", + val recognitionKind: String = "payment", + val categoryHint: String? = null, + val amountSource: String = "result", + val resultFingerprint: String? = null, +) + +enum class PaymentStatusStrength(val wireValue: String) { + STRONG("strong"), + WEAK("weak"), + NONE("none"), +} + +data class PaymentStatusEvidence( + val strength: PaymentStatusStrength, + val direction: String?, +) + +object PaymentParser { + const val WECHAT = "com.tencent.mm" + const val ALIPAY = "com.eg.android.AlipayGphone" + val supportedPackages = setOf(WECHAT, ALIPAY) + + private val amountPatterns = listOf( + Regex("""(?:实付|付款金额|支付金额|收款金额|到账金额|交易金额|金额)[::\s]*[¥¥]?\s*([0-9]+(?:\.[0-9]{1,2})?)"""), + Regex("""[¥¥]\s*([0-9]+(?:\.[0-9]{1,2})?)"""), + Regex("""([0-9]+(?:\.[0-9]{1,2})?)\s*元"""), + ) + private val orderPattern = Regex( + """(?:交易单号|订单号|商户单号|转账单号|交易号)[::\s]*([A-Za-z0-9_-]{6,64})""", + RegexOption.IGNORE_CASE, + ) + private val merchantPattern = Regex( + """(?:商户|收款方|付款给|交易对象|对方)[::\s]*([^\n,,]{2,40})""", + ) + private val refundWords = listOf("退款成功", "退款已到账", "退款到账成功") + private val incomeWords = listOf( + "收款成功", "成功收款", "收款到账", "收款已到账", "收款完成", "已收款", + "收钱成功", "转账到账", "转账已到账", "到账成功", "已到账", + ) + private val expenseWords = listOf( + "支付成功", "成功支付", "付款成功", "成功付款", "支付已完成", "付款已完成", + "支付完成", "付款完成", "消费成功", "扫码支付成功", "转账成功", "成功转账", + "转账已成功", "转账完成", "转账已完成", "已转账", + ) + private val blockedWords = listOf( + "支付失败", "付款失败", "转账失败", "交易失败", "处理中", "支付处理中", + "等待收款", "等待对方收款", "待收款", "交易关闭", "已关闭", "已撤销", + "已取消", "未完成", + ) + private val historyTitles = setOf( + "账单", "账单详情", "交易详情", "交易记录", "全部账单", "收支明细", + "订单详情", "支付详情", "付款详情", "收款详情", "转账详情", + ) + private val paymentContextWords = listOf( + "确认支付", "立即支付", "确认付款", "立即付款", "确认转账", "继续付款", + "收款方", "付款方", "付款给", "转账给", "支付金额", "付款金额", "实付", + "收银台", "支付方式", "输入支付密码", + ) + private val paymentActionWords = listOf( + "确认支付", "立即支付", "确认付款", "立即付款", "确认转账", "继续付款", + "支付", "付款", "转账", + ) + private val weakCompletionWords = setOf( + "完成", "已完成", "操作完成", "交易完成", "转账完成", "支付完成", "付款完成", "收款完成", + ) + private val expenseContextWords = listOf( + "确认支付", "立即支付", "确认付款", "立即付款", "确认转账", "继续付款", + "付款给", "转账给", "收款方", "付款金额", "支付金额", "实付", "输入支付密码", + ) + private val incomeContextWords = listOf( + "收款金额", "收钱", "收款到账", "退款到账", + ) + private val paymentInputWords = listOf( + "输入支付密码", "请输入支付密码", "确认转账", "确认支付", "确认付款", + "立即支付", "立即付款", "继续付款", + ) + private val redPacketSendContextWords = listOf( + "发红包", "塞钱进红包", "红包金额", "发送红包", "普通红包", "拼手气红包", + "红包个数", "确认发送", "立即发送", + ) + private val redPacketSendActionWords = listOf( + "塞钱进红包", "发红包", "发送红包", "确认发送", "立即发送", + ) + private val redPacketSendSuccessWords = listOf( + "红包发送成功", "红包已发送", "已发出红包", "红包已发出", + ) + private val redPacketReceiveSuccessWords = listOf( + "红包领取成功", "领取红包成功", "红包已到账", "已存入零钱", "已存入余额", + "红包已存入零钱", "红包已存入余额", + ) + private val redPacketRefundSuccessWords = listOf( + "红包退款到账", "红包退回到账", "红包退还到账", "红包已退回到账", + ) + private val redPacketPendingWords = listOf( + "领取红包", "查看红包", "红包已被领完", "红包已过期", "已领取", "待领取", + ) + private val redPacketSentSurfaceWords = listOf( + "红包已发送", "红包发送成功", "恭喜发财,大吉大利", "恭喜发财大吉大利", + ) + + fun fromAccessibility( + packageName: String, + text: String, + eventTime: Long, + windowId: Int, + flowSessionId: String? = null, + trustedFlow: Boolean = false, + expectedAmountCents: Long? = null, + expectedType: String? = null, + resultTransitionObserved: Boolean = false, + submittedFlow: Boolean = false, + flowKind: String? = null, + ): PaymentSignal? { + if (packageName !in supportedPackages || + containsBlockedStatus(text) || + isHistoryPageText(text) || + isPaymentInputPage(text) + ) return null + val eventId = flowSessionId?.let { "a:" + packageName + ":" + it } + ?: "a:" + windowId + ":" + sha256(normalize(text)) + ":" + (eventTime / 10_000L) + val status = detectStatus(text, expectedType) + val parsed = if (status.strength != PaymentStatusStrength.WEAK) { + parse( + packageName = packageName, + channel = "accessibility", + text = text, + occurredAt = System.currentTimeMillis(), + sourceEventId = eventId, + flowSessionId = flowSessionId, + evidenceConfidence = "confirm", + ) + } else { + null + } + if (parsed != null) { + val uniqueResultAmount = uniqueAmountCents(text) + val standaloneRedPacketIncome = parsed.recognitionKind in setOf( + "red_packet_receive", + "red_packet_refund", + ) + val expectedMatches = expectedAmountCents == null || + uniqueResultAmount == expectedAmountCents + val evidenceHigh = when { + standaloneRedPacketIncome -> uniqueResultAmount == parsed.amountCents + submittedFlow -> trustedFlow && resultTransitionObserved && + uniqueResultAmount == parsed.amountCents && expectedMatches + else -> false + } + return parsed.copy( + evidenceConfidence = if (evidenceHigh) "high" else "confirm", + ) + } + + val redPacketSentSurface = flowKind == "red_packet_send" && + hasRedPacketSentSurface(text) + if (status.strength == PaymentStatusStrength.NONE && !redPacketSentSurface) return null + val direction = status.direction ?: if (redPacketSentSurface) "expense" else return null + val resultAmount = uniqueAmountCents(text) + val canUseExpectedAmount = resultAmount == null && + expectedAmountCents != null && + submittedFlow && + resultTransitionObserved && + expectedType == direction + val amountCents = resultAmount ?: expectedAmountCents?.takeIf { canUseExpectedAmount } + ?: return null + val expectedMatched = expectedAmountCents != null && amountCents == expectedAmountCents + val evidenceHigh = trustedFlow && submittedFlow && resultTransitionObserved && + expectedMatched && expectedType == direction + val kind = flowKind ?: recognitionKind(text, direction) + val merchant = extractMerchant(text) + val orderId = extractOrderId(text) + return PaymentSignal( + packageName = packageName, + channel = "accessibility", + amountCents = amountCents, + type = direction, + merchant = merchant, + orderId = orderId, + occurredAtEpochMs = System.currentTimeMillis(), + knownTemplate = true, + sourceEventId = eventId, + sourceText = buildSummary(packageName, merchant, orderId, kind), + flowSessionId = flowSessionId, + evidenceConfidence = if (evidenceHigh) "high" else "confirm", + recognitionKind = kind, + categoryHint = categoryHint(kind, direction), + amountSource = if (resultAmount == null) "expected" else "result", + resultFingerprint = resultFingerprint( + packageName, + kind, + direction, + amountCents, + merchant, + orderId, + sha256(normalize(text)), + ), + ) + } + fun fromNotification(notification: StatusBarNotification): PaymentSignal? { + val extras = notification.notification.extras + val parts = listOfNotNull( + extras.getCharSequence(Notification.EXTRA_TITLE)?.toString(), + extras.getCharSequence(Notification.EXTRA_TEXT)?.toString(), + extras.getCharSequence(Notification.EXTRA_BIG_TEXT)?.toString(), + extras.getCharSequence(Notification.EXTRA_SUB_TEXT)?.toString(), + ).filter { it.isNotBlank() } + if (parts.isEmpty()) return null + return parse( + packageName = notification.packageName, + channel = "notification", + text = parts.distinct().joinToString("\n"), + occurredAt = validEpoch(notification.postTime), + sourceEventId = "n:" + notification.key, + flowSessionId = null, + evidenceConfidence = "confirm", + ) + } + + fun mayBePaymentPage(text: String): Boolean { + val normalized = normalize(text) + return !isHistoryPage(normalized) && + !containsBlockedStatus(normalized) && + detectDirection(normalized) != null + } + + fun detectDirection(value: String): String? = detectStatus(value).direction + + fun detectStatus( + value: String, + fallbackDirection: String? = null, + ): PaymentStatusEvidence { + paymentLines(normalize(value)).firstNotNullOfOrNull { line -> + val compact = compactStatusLine(line) + when { + compact.length > MAX_SUCCESS_HEADING_CHARS -> null + redPacketRefundSuccessWords.any { compactStatusLine(it) in compact } -> "income" + redPacketReceiveSuccessWords.any { compactStatusLine(it) in compact } -> "income" + redPacketSendSuccessWords.any { compactStatusLine(it) in compact } -> "expense" + refundWords.any(compact::contains) -> "income" + incomeWords.any(compact::contains) -> "income" + expenseWords.any(compact::contains) -> "expense" + else -> null + } + }?.let { return PaymentStatusEvidence(PaymentStatusStrength.STRONG, it) } + val weak = paymentLines(normalize(value)) + .map(::compactStatusLine) + .any(weakCompletionWords::contains) + return if (weak) { + PaymentStatusEvidence(PaymentStatusStrength.WEAK, fallbackDirection) + } else { + PaymentStatusEvidence(PaymentStatusStrength.NONE, null) + } + } + + fun containsBlockedStatus(value: String): Boolean { + val normalized = normalize(value) + return blockedWords.any(normalized::contains) + } + + fun isHistoryPageText(value: String): Boolean = isHistoryPage(normalize(value)) + + fun hasPaymentContext(value: String): Boolean { + val normalized = normalize(value) + return paymentContextWords.any(normalized::contains) || + redPacketSendContextWords.any(normalized::contains) || + amountPatterns.any { it.containsMatchIn(normalized) } + } + + fun hasPaymentAction(value: String): Boolean { + val normalized = normalize(value) + return paymentActionWords.any(normalized::contains) || + redPacketSendActionWords.any(normalized::contains) + } + + fun inferContextDirection(value: String): String? { + val normalized = normalize(value) + if (redPacketSendContextWords.any(normalized::contains)) return "expense" + val expense = expenseContextWords.any(normalized::contains) + val income = incomeContextWords.any(normalized::contains) + return when { + expense && !income -> "expense" + income && !expense -> "income" + else -> null + } + } + + fun uniqueAmountCents(value: String): Long? { + val normalized = normalize(value) + val cents = buildList { + amountPatterns.forEach { pattern -> + pattern.findAll(normalized).forEach { match -> + match.groupValues.getOrNull(1)?.toDoubleOrNull()?.let { amount -> + if (amount.isFinite() && amount > 0 && amount <= 100_000_000) { + add((amount * 100).roundToLong()) + } + } + } + } + paymentLines(normalized).forEach { line -> + parseAmountCandidate(line)?.let { amount -> + if (amount.isFinite() && amount > 0 && amount <= 100_000_000) { + add((amount * 100).roundToLong()) + } + } + } + }.distinct() + return cents.singleOrNull() + } + + fun isPaymentInputPage(value: String): Boolean { + val normalized = normalize(value) + return paymentInputWords.any(normalized::contains) || + redPacketSendActionWords.any(normalized::contains) + } + + fun detectFlowKind(value: String): String? { + val normalized = normalize(value) + return when { + redPacketSendContextWords.any(normalized::contains) -> "red_packet_send" + "转账" in normalized -> "transfer" + paymentContextWords.any(normalized::contains) -> "payment" + else -> null + } + } + + fun recognitionKind(value: String, type: String): String { + val normalized = normalize(value) + return when { + redPacketRefundSuccessWords.any(normalized::contains) -> "red_packet_refund" + redPacketReceiveSuccessWords.any(normalized::contains) -> "red_packet_receive" + redPacketSendSuccessWords.any(normalized::contains) -> "red_packet_send" + "转账" in normalized -> "transfer" + else -> "payment" + } + } + + fun categoryHint(kind: String, type: String): String? = when { + kind == "red_packet_send" && type == "expense" -> "人情" + kind in setOf("red_packet_receive", "red_packet_refund") && type == "income" -> "红包" + else -> null + } + + fun hasRedPacketSentSurface(value: String): Boolean { + val normalized = compactStatusLine(normalize(value)) + return redPacketSentSurfaceWords.any { compactStatusLine(it) in normalized } + } + + fun isPendingRedPacketSurface(value: String): Boolean { + val normalized = normalize(value) + return redPacketPendingWords.any(normalized::contains) && + redPacketReceiveSuccessWords.none(normalized::contains) && + redPacketRefundSuccessWords.none(normalized::contains) + } + + fun isResultSurface(value: String, flowKind: String? = null): Boolean = + detectStatus(value).strength != PaymentStatusStrength.NONE || + (flowKind == "red_packet_send" && hasRedPacketSentSurface(value)) + + fun resultFingerprint( + packageName: String, + kind: String, + type: String, + amountCents: Long, + merchant: String?, + orderId: String?, + pageSignature: String? = null, + ): String = sha256( + listOf( + packageName, + kind, + type, + amountCents.toString(), + merchant?.trim()?.lowercase().orEmpty(), + orderId.orEmpty(), + pageSignature.orEmpty(), + ).joinToString("|"), + ) + + fun parseAmountCandidate(value: String): Double? { + val normalized = normalize(value) + amountPatterns.firstNotNullOfOrNull { pattern -> + pattern.find(normalized)?.groupValues?.getOrNull(1)?.toDoubleOrNull() + }?.let { return it } + val match = STANDALONE_AMOUNT.matchEntire(normalized) ?: return null + val number = match.groupValues[2] + val hasCurrencyOrUnit = match.groupValues[1].isNotEmpty() || + match.groupValues[3].isNotEmpty() + return if (!hasCurrencyOrUnit && !number.contains('.')) null else number.toDoubleOrNull() + } + + fun extractOrderId(value: String): String? = + orderPattern.find(normalize(value))?.groupValues?.getOrNull(1) + + fun extractMerchant(value: String): String? = + merchantPattern.find(normalize(value))?.groupValues?.getOrNull(1)?.trim() + + fun paymentFingerprint(signal: PaymentSignal): String = sha256( + listOf( + signal.packageName, + signal.type, + signal.amountCents.toString(), + signal.merchant?.trim()?.lowercase().orEmpty(), + signal.orderId.orEmpty(), + signal.flowSessionId.orEmpty(), + ).joinToString("|"), + ) + + fun appName(packageName: String): String = when (packageName) { + WECHAT -> "微信" + ALIPAY -> "支付宝" + else -> "支付应用" + } + + private fun parse( + packageName: String, + channel: String, + text: String, + occurredAt: Long, + sourceEventId: String, + flowSessionId: String?, + evidenceConfidence: String, + ): PaymentSignal? { + if (packageName !in supportedPackages) return null + val normalized = normalize(text) + if (containsBlockedStatus(normalized) || isHistoryPage(normalized)) return null + val type = detectDirection(normalized) ?: return null + val amount = extractAmount(normalized) ?: return null + if (!amount.isFinite() || amount <= 0 || amount > 100_000_000) return null + + val orderId = extractOrderId(normalized) + val merchant = extractMerchant(normalized) + val kind = recognitionKind(normalized, type) + return PaymentSignal( + packageName = packageName, + channel = channel, + amountCents = (amount * 100).roundToLong(), + type = type, + merchant = merchant, + orderId = orderId, + occurredAtEpochMs = occurredAt, + knownTemplate = true, + sourceEventId = sourceEventId, + sourceText = buildSummary(packageName, merchant, orderId, kind), + flowSessionId = flowSessionId, + evidenceConfidence = evidenceConfidence, + recognitionKind = kind, + categoryHint = categoryHint(kind, type), + amountSource = "result", + resultFingerprint = resultFingerprint( + packageName, + kind, + type, + (amount * 100).roundToLong(), + merchant, + orderId, + sha256(normalized), + ), + ) + } + + private fun buildSummary( + packageName: String, + merchant: String?, + orderId: String?, + kind: String, + ): String = buildString { + append(appName(packageName)) + when (kind) { + "red_packet_send" -> append(" · 发红包") + "red_packet_receive" -> append(" · 红包到账") + "red_packet_refund" -> append(" · 红包退回") + } + merchant?.let { append(" · ").append(it.take(32)) } + orderId?.let { append(" · 单号尾号 ").append(it.takeLast(6)) } + } + + fun sha256(value: String): String = MessageDigest.getInstance("SHA-256") + .digest(value.toByteArray(Charsets.UTF_8)) + .joinToString("") { "%02x".format(it) } + + private fun extractAmount(value: String): Double? { + amountPatterns.firstNotNullOfOrNull { pattern -> + pattern.find(value)?.groupValues?.getOrNull(1)?.toDoubleOrNull() + }?.let { return it } + return paymentLines(value).firstNotNullOfOrNull(::parseAmountCandidate) + } + + private fun paymentLines(value: String): List = value + .lineSequence() + .map(String::trim) + .filter(String::isNotEmpty) + .take(MAX_PAYMENT_SCAN_LINES) + .toList() + + private fun isHistoryPage(value: String): Boolean = paymentLines(value) + .take(MAX_HISTORY_TITLE_LINES) + .any(historyTitles::contains) + + private fun validEpoch(value: Long): Long { + val now = System.currentTimeMillis() + return value.takeIf { it in (now - MAX_EVENT_AGE_MS)..(now + MAX_FUTURE_MS) } ?: now + } + + private fun normalize(value: String): String = value + .replace(' ', ' ') + .replace(Regex("""[ ]+"""), " ") + .replace(Regex("""\n{2,}"""), "\n") + .trim() + + private fun compactStatusLine(value: String): String = value.replace(STATUS_DECORATION, "") + + private const val MAX_EVENT_AGE_MS = 24L * 60L * 60L * 1000L + private const val MAX_FUTURE_MS = 5L * 60L * 1000L + private val STATUS_DECORATION = Regex("""[\s::,,。!!·]""") + private val STANDALONE_AMOUNT = Regex( + """^\s*([¥¥]?)\s*([0-9]{1,8}(?:\.[0-9]{1,2})?)\s*(元?)\s*$""", + ) + private const val MAX_SUCCESS_HEADING_CHARS = 48 + private const val MAX_PAYMENT_SCAN_LINES = 48 + private const val MAX_HISTORY_TITLE_LINES = 3 +} \ No newline at end of file diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/ProjectionConsentActivity.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ProjectionConsentActivity.kt new file mode 100644 index 0000000..6054f13 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ProjectionConsentActivity.kt @@ -0,0 +1,108 @@ +package com.nx.miaoji + +import android.app.Activity +import android.content.Intent +import android.media.projection.MediaProjectionManager +import android.os.Bundle +import android.util.Log +import androidx.core.content.ContextCompat +import java.util.UUID + +class ProjectionConsentActivity : Activity() { + private var permissionRequested = false + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + if (intent.getBooleanExtra(EXTRA_ACCESSIBILITY_CAPTURE, false)) { + val accepted = RecognitionBridge.call( + this, + RecognitionBridgeProvider.METHOD_REQUEST_SCREENSHOT, + extras = Bundle().apply { + putString("requestId", UUID.randomUUID().toString()) + putBoolean("showResult", true) + putBoolean("preferExternalSource", true) + putLong("delayMs", SOURCE_APP_RESTORE_DELAY_MS) + }, + ) + ?.getBoolean("accepted") == true + finish() + if (!accepted) { + reportError("无障碍服务未连接,本次请重新点击磁贴并授权截屏") + } + return + } + + permissionRequested = savedInstanceState?.getBoolean(STATE_PERMISSION_REQUESTED) + ?: false + if (!permissionRequested) { + permissionRequested = true + requestProjectionPermission() + } + } + + override fun onSaveInstanceState(outState: Bundle) { + outState.putBoolean(STATE_PERMISSION_REQUESTED, permissionRequested) + super.onSaveInstanceState(outState) + } + + @Suppress("DEPRECATION") + private fun requestProjectionPermission() { + try { + val manager = getSystemService(MediaProjectionManager::class.java) + startActivityForResult( + manager.createScreenCaptureIntent(), + REQUEST_MEDIA_PROJECTION, + ) + } catch (e: Exception) { + Log.e(TAG, "Unable to request projection permission", e) + finish() + reportError("无法申请系统截屏授权,请稍后重试") + } + } + + @Deprecated("Deprecated in Android, retained for broad device compatibility") + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + if (requestCode != REQUEST_MEDIA_PROJECTION) return + + if (resultCode != RESULT_OK || data == null) { + finish() + reportError("已取消截屏授权,本次没有截取任何内容") + return + } + + val sessionId = ScreenshotResultDispatcher.newSessionId() + val serviceIntent = Intent(this, OneShotProjectionService::class.java).apply { + putExtra(OneShotProjectionService.EXTRA_RESULT_CODE, resultCode) + putExtra(OneShotProjectionService.EXTRA_RESULT_DATA, data) + putExtra(OneShotProjectionService.EXTRA_SESSION_ID, sessionId) + } + try { + ContextCompat.startForegroundService(this, serviceIntent) + moveTaskToBack(true) + finish() + } catch (e: Exception) { + Log.e(TAG, "Unable to start one-shot projection", e) + finish() + reportError("系统未能启动一次性截屏,请重试") + } + } + + private fun reportError(message: String) { + if (intent.getBooleanExtra(EXTRA_RETURN_ERROR_TO_APP, false)) { + startActivity(ScreenshotResultDispatcher.errorIntent(this, message)) + } else { + ScreenshotResultDispatcher.notifyFailure(this, message) + } + } + + companion object { + const val EXTRA_ACCESSIBILITY_CAPTURE = "accessibilityCapture" + const val EXTRA_RETURN_ERROR_TO_APP = "returnErrorToApp" + private const val TAG = "MiaoJiProjection" + private const val REQUEST_MEDIA_PROJECTION = 2001 + private const val STATE_PERMISSION_REQUESTED = "permissionRequested" + private const val SOURCE_APP_RESTORE_DELAY_MS = 500L + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionBridgeProvider.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionBridgeProvider.kt new file mode 100644 index 0000000..a0afe22 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionBridgeProvider.kt @@ -0,0 +1,146 @@ +package com.nx.miaoji + +import android.content.ContentProvider +import android.content.ContentValues +import android.content.Context +import android.database.Cursor +import android.net.Uri +import android.os.Bundle +import android.os.ParcelFileDescriptor +import java.util.concurrent.ConcurrentHashMap + +class RecognitionBridgeProvider : ContentProvider() { + private val captureResults = ConcurrentHashMap() + + override fun onCreate(): Boolean { + context?.let(RecognitionCoordinator::get) + return true + } + + override fun call(method: String, arg: String?, extras: Bundle?): Bundle { + val appContext = requireNotNull(context).applicationContext + return when (method) { + METHOD_STATUS -> Bundle().apply { + putBoolean("accessibilityConnected", ScreenshotAccessibilityService.isConnected) + putBoolean("notificationConnected", PaymentNotificationListenerService.isConnected) + putString("settings", RecognitionSettings.statusJson(appContext)) + putString("latestStatus", RecognitionCoordinator.get(appContext).latestStatus()) + putString("latestDiagnostic", RecognitionDiagnostics.latest(appContext)) + } + METHOD_SET_TOGGLE -> Bundle().apply { + putBoolean( + "success", + RecognitionSettings.setToggle( + appContext, + extras?.getString("key").orEmpty(), + extras?.getBoolean("enabled") ?: false, + ), + ) + } + METHOD_CLEAR_DIAGNOSTIC -> Bundle().apply { + RecognitionDiagnostics.clear(appContext) + putBoolean("success", true) + } + METHOD_SET_RUNTIME -> Bundle().apply { + RecognitionSettings.setRuntime( + appContext, + aiAllowed = extras?.getBoolean("aiAllowed") ?: false, + hasAccount = extras?.getBoolean("hasAccount") ?: false, + baseUrl = extras?.getString("baseUrl"), + token = extras?.getString("token"), + ) + putBoolean("success", true) + } + METHOD_REQUEST_SCREENSHOT -> requestScreenshot(extras) + METHOD_SCREENSHOT_RESULT -> takeScreenshotResult(arg) + METHOD_DRAIN -> Bundle().apply { + putStringArrayList( + "candidates", + ArrayList( + RecognitionCoordinator.get(appContext) + .drainReady() + .map(StoredCandidate::json), + ), + ) + } + METHOD_ACK -> Bundle().apply { + val candidate = RecognitionCoordinator.get(appContext).acknowledge( + extras?.getString("id").orEmpty(), + extras?.getString("state").orEmpty(), + extras?.getLong("transactionId")?.takeIf { + extras.containsKey("transactionId") + }, + ) + putBoolean("success", candidate != null) + } + else -> super.call(method, arg, extras) ?: Bundle() + } + } + + private fun requestScreenshot(extras: Bundle?): Bundle { + val requestId = extras?.getString("requestId").orEmpty() + if (requestId.isBlank()) return Bundle().apply { putBoolean("accepted", false) } + val showResult = extras?.getBoolean("showResult") ?: false + val accepted = ScreenshotAccessibilityService.requestScreenshot( + showResult = showResult, + delayMs = extras?.getLong("delayMs") ?: 0L, + preferExternalSource = extras?.getBoolean("preferExternalSource") ?: false, + ) { result -> + captureResults[requestId] = result.fold( + onSuccess = { CaptureResult(path = it, error = null) }, + onFailure = { CaptureResult(path = null, error = it.message ?: "截屏失败,请重试") }, + ) + } + return Bundle().apply { putBoolean("accepted", accepted) } + } + + private fun takeScreenshotResult(requestId: String?): Bundle { + val result = requestId?.let(captureResults::remove) + return Bundle().apply { + putBoolean("ready", result != null) + result?.path?.let { putString("path", it) } + result?.error?.let { putString("error", it) } + } + } + + override fun query( + uri: Uri, + projection: Array?, + selection: String?, + selectionArgs: Array?, + sortOrder: String?, + ): Cursor? = null + + override fun getType(uri: Uri): String? = null + override fun insert(uri: Uri, values: ContentValues?): Uri? = null + override fun delete(uri: Uri, selection: String?, selectionArgs: Array?): Int = 0 + override fun update( + uri: Uri, + values: ContentValues?, + selection: String?, + selectionArgs: Array?, + ): Int = 0 + + private data class CaptureResult(val path: String?, val error: String?) + + companion object { + const val METHOD_STATUS = "status" + const val METHOD_SET_TOGGLE = "setToggle" + const val METHOD_SET_RUNTIME = "setRuntime" + const val METHOD_CLEAR_DIAGNOSTIC = "clearDiagnostic" + const val METHOD_REQUEST_SCREENSHOT = "requestScreenshot" + const val METHOD_SCREENSHOT_RESULT = "screenshotResult" + const val METHOD_DRAIN = "drain" + const val METHOD_ACK = "ack" + } +} + +object RecognitionBridge { + fun call(context: Context, method: String, arg: String? = null, extras: Bundle? = null): Bundle? = + context.contentResolver.call( + Uri.parse("content://${context.packageName}.recognition.bridge"), + method, + arg, + extras, + ) +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionCoordinator.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionCoordinator.kt new file mode 100644 index 0000000..99e9d77 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionCoordinator.kt @@ -0,0 +1,60 @@ +package com.nx.miaoji + +import android.content.Context +import android.content.Intent +import android.os.Handler +import android.os.HandlerThread +import android.util.Log + +class RecognitionCoordinator private constructor(private val context: Context) { + private val store = RecognitionStore(context) + private val thread = HandlerThread("jizhi-recognition").apply { start() } + private val handler = Handler(thread.looper) + + fun submit(signal: PaymentSignal) { + handler.post { + runCatching { + val id = store.upsert(signal) + handler.postDelayed({ finalize(id) }, 1_650L) + }.onFailure { Log.e(TAG, "Unable to store recognition signal", it) } + } + } + + fun drainReady(): List = store.ready() + + fun acknowledge(id: String, state: String, transactionId: Long?): StoredCandidate? { + val candidate = store.acknowledge(id, state, transactionId) + if (candidate != null && state == "imported") { + RecognitionNotifier.showImported(context, candidate) + } + return candidate + } + + fun latestStatus(): String? = store.latestStatus() + + private fun finalize(id: String) { + val candidate = store.finalizeCandidate(id) ?: return + context.sendBroadcast( + Intent(ACTION_READY) + .setPackage(context.packageName) + .putExtra(EXTRA_CANDIDATE_ID, id), + ) + RecognitionNotifier.showReady(context, candidate) + } + + companion object { + const val ACTION_READY = "com.nx.miaoji.RECOGNITION_READY" + const val EXTRA_CANDIDATE_ID = "candidateId" + private const val TAG = "JizhiRecognition" + + @Volatile + private var instance: RecognitionCoordinator? = null + + fun get(context: Context): RecognitionCoordinator = + instance ?: synchronized(this) { + instance ?: RecognitionCoordinator(context.applicationContext).also { + instance = it + } + } + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionDiagnostics.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionDiagnostics.kt new file mode 100644 index 0000000..3a41652 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionDiagnostics.kt @@ -0,0 +1,109 @@ +package com.nx.miaoji + +import android.content.Context +import org.json.JSONArray +import org.json.JSONObject + +object RecognitionDiagnostics { + private const val PREFS = "recognition_diagnostics" + private const val KEY_LATEST = "latest" + private const val STALE_OPERATION_MS = 20_000L + + @Synchronized + fun record( + context: Context, + packageName: String?, + stage: String, + result: String, + nodeCount: Int = 0, + ocrMs: Long? = null, + amountCandidates: Int? = null, + reason: String? = null, + statusStrength: String? = null, + expectedAmountMatched: Boolean? = null, + resultTransitionObserved: Boolean? = null, + recognitionKind: String? = null, + amountSource: String? = null, + resultFingerprint: String? = null, + ocrPreview: List = emptyList(), + previewExpiresAt: Long? = null, + ) { + val payload = JSONObject() + .put("at", System.currentTimeMillis()) + .put("appName", packageName?.let(PaymentParser::appName) ?: "支付应用") + .put("stage", stage) + .put("result", result) + .put("nodeCount", nodeCount) + ocrMs?.let { payload.put("ocrMs", it) } + amountCandidates?.let { payload.put("amountCandidates", it) } + reason?.take(80)?.let { payload.put("reason", it) } + statusStrength?.let { payload.put("statusStrength", it) } + expectedAmountMatched?.let { payload.put("expectedAmountMatched", it) } + resultTransitionObserved?.let { payload.put("resultTransitionObserved", it) } + recognitionKind?.let { payload.put("recognitionKind", it) } + amountSource?.let { payload.put("amountSource", it) } + resultFingerprint?.let { payload.put("resultFingerprint", it.take(16)) } + if (ocrPreview.isNotEmpty() && previewExpiresAt != null && + previewExpiresAt > System.currentTimeMillis() + ) { + payload.put("ocrPreview", JSONArray(ocrPreview.take(12))) + payload.put("previewExpiresAt", previewExpiresAt) + } + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + .edit() + .putString(KEY_LATEST, payload.toString()) + .apply() + } + + @Synchronized + fun latest(context: Context): String? { + val preferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + val raw = preferences.getString(KEY_LATEST, null) ?: return null + val normalized = runCatching { + val payload = JSONObject(raw) + val now = System.currentTimeMillis() + var changed = false + val startedAt = payload.optLong("at") + if (payload.optString("result") == "started" && + now - startedAt > STALE_OPERATION_MS + ) { + payload + .put("result", "failed") + .put("reason", "operation_interrupted") + changed = true + } + val previewExpiresAt = payload.optLong("previewExpiresAt") + if (previewExpiresAt > 0L && previewExpiresAt <= now) { + payload.remove("ocrPreview") + payload.remove("previewExpiresAt") + changed = true + } + if (changed) payload.toString() else raw + }.getOrDefault(raw) + if (normalized != raw) { + preferences.edit().putString(KEY_LATEST, normalized).apply() + } + return normalized + } + + @Synchronized + fun clearPreview(context: Context) { + val preferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + val raw = preferences.getString(KEY_LATEST, null) ?: return + val updated = runCatching { + JSONObject(raw) + .apply { + remove("ocrPreview") + remove("previewExpiresAt") + } + .toString() + }.getOrNull() ?: return + preferences.edit().putString(KEY_LATEST, updated).apply() + } + fun clear(context: Context) { + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + .edit() + .remove(KEY_LATEST) + .apply() + } +} \ No newline at end of file diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionNotifier.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionNotifier.kt new file mode 100644 index 0000000..e2e4295 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionNotifier.kt @@ -0,0 +1,108 @@ +package com.nx.miaoji + +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import android.os.Build +import org.json.JSONObject +import kotlin.math.absoluteValue + +object RecognitionNotifier { + private const val CHANNEL_ID = "smart_recognition" + + fun showReady(context: Context, candidate: StoredCandidate) { + val payload = JSONObject(candidate.json) + val auto = payload.optString("confidence") == "auto" + val title = if (auto) "识别到一笔账单" else "发现可能的账单" + val text = "${payload.optString("appName")} · ¥${String.format("%.2f", payload.optDouble("amount"))}" + val intent = Intent(context, MainActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP) + putExtra(MainActivity.EXTRA_ACTION, MainActivity.ACTION_RECOGNITION_CONFIRM) + putExtra(RecognitionCoordinator.EXTRA_CANDIDATE_ID, candidate.id) + } + notify( + context, + candidate.id.hashCode(), + Notification.Builder(context, ensureChannel(context)) + .setSmallIcon(R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(text) + .setAutoCancel(true) + .setContentIntent(pendingActivity(context, candidate.id.hashCode(), intent)) + .setCategory(Notification.CATEGORY_STATUS) + .build(), + ) + } + + fun showImported(context: Context, candidate: StoredCandidate) { + val payload = JSONObject(candidate.json) + val text = "已记录${if (payload.optString("type") == "income") "收入" else "支出"} ¥${ + String.format("%.2f", payload.optDouble("amount")) + }" + val openIntent = actionIntent(context, candidate, MainActivity.ACTION_RECOGNITION_EDIT) + val undoIntent = actionIntent(context, candidate, MainActivity.ACTION_RECOGNITION_UNDO) + val notification = Notification.Builder(context, ensureChannel(context)) + .setSmallIcon(R.mipmap.ic_launcher) + .setContentTitle("智能识别已入账") + .setContentText(text) + .setAutoCancel(true) + .setContentIntent(pendingActivity(context, candidate.id.hashCode(), openIntent)) + .addAction( + Notification.Action.Builder( + null, + "撤销", + pendingActivity(context, candidate.id.hashCode() xor 0x3301, undoIntent), + ).build(), + ) + .addAction( + Notification.Action.Builder( + null, + "编辑", + pendingActivity(context, candidate.id.hashCode() xor 0x3302, openIntent), + ).build(), + ) + .build() + notify(context, candidate.id.hashCode(), notification) + } + + private fun actionIntent(context: Context, candidate: StoredCandidate, action: String) = + Intent(context, MainActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP) + putExtra(MainActivity.EXTRA_ACTION, action) + putExtra(RecognitionCoordinator.EXTRA_CANDIDATE_ID, candidate.id) + candidate.transactionId?.let { putExtra(MainActivity.EXTRA_TRANSACTION_ID, it) } + } + + private fun pendingActivity(context: Context, requestCode: Int, intent: Intent): PendingIntent = + PendingIntent.getActivity( + context, + requestCode.absoluteValue, + intent, + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE, + ) + + private fun ensureChannel(context: Context): String { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + context.getSystemService(NotificationManager::class.java).createNotificationChannel( + NotificationChannel( + CHANNEL_ID, + "智能识别记账", + NotificationManager.IMPORTANCE_DEFAULT, + ).apply { + description = "微信、支付宝账单识别结果与确认提醒" + }, + ) + } + return CHANNEL_ID + } + + private fun notify(context: Context, id: Int, notification: Notification) { + runCatching { + context.getSystemService(NotificationManager::class.java) + .notify(id.absoluteValue, notification) + } + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionSettings.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionSettings.kt new file mode 100644 index 0000000..11bb86c --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionSettings.kt @@ -0,0 +1,115 @@ +package com.nx.miaoji + +import android.content.Context +import org.json.JSONObject + +object RecognitionSettings { + const val KEY_ACCESSIBILITY_EVENTS = "accessibility_events" + const val KEY_NOTIFICATION_EVENTS = "notification_events" + const val KEY_AI_SCREENSHOT = "ai_screenshot" + const val KEY_OCR_DIAGNOSTIC_PREVIEW = "ocr_diagnostic_preview" + + data class Snapshot( + val accessibilityEvents: Boolean, + val notificationEvents: Boolean, + val aiScreenshot: Boolean, + val ocrDiagnosticPreview: Boolean, + val ocrDiagnosticPreviewExpiresAt: Long?, + val aiAllowed: Boolean, + val hasAccount: Boolean, + val baseUrl: String?, + ) + + private const val PREFS = "recognition_settings" + private const val KEY_AI_ALLOWED = "runtime_ai_allowed" + private const val KEY_HAS_ACCOUNT = "runtime_has_account" + private const val KEY_BASE_URL = "runtime_base_url" + private const val KEY_TOKEN = "runtime_token" + private const val KEY_OCR_DIAGNOSTIC_PREVIEW_UNTIL = "ocr_diagnostic_preview_until" + private const val OCR_DIAGNOSTIC_PREVIEW_MS = 10L * 60L * 1000L + + fun snapshot(context: Context): Snapshot { + val prefs = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + val previewExpiresAt = prefs.getLong(KEY_OCR_DIAGNOSTIC_PREVIEW_UNTIL, 0L) + .takeIf { it > System.currentTimeMillis() } + return Snapshot( + accessibilityEvents = prefs.getBoolean(KEY_ACCESSIBILITY_EVENTS, false), + notificationEvents = prefs.getBoolean(KEY_NOTIFICATION_EVENTS, false), + aiScreenshot = prefs.getBoolean(KEY_AI_SCREENSHOT, false), + ocrDiagnosticPreview = previewExpiresAt != null, + ocrDiagnosticPreviewExpiresAt = previewExpiresAt, + aiAllowed = prefs.getBoolean(KEY_AI_ALLOWED, false), + hasAccount = prefs.getBoolean(KEY_HAS_ACCOUNT, false), + baseUrl = prefs.getString(KEY_BASE_URL, null), + ) + } + + fun setToggle(context: Context, key: String, enabled: Boolean): Boolean { + val prefs = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + if (key == KEY_OCR_DIAGNOSTIC_PREVIEW) { + val editor = prefs.edit() + if (enabled) { + editor.putLong( + KEY_OCR_DIAGNOSTIC_PREVIEW_UNTIL, + System.currentTimeMillis() + OCR_DIAGNOSTIC_PREVIEW_MS, + ) + } else { + editor.remove(KEY_OCR_DIAGNOSTIC_PREVIEW_UNTIL) + } + editor.apply() + if (!enabled) RecognitionDiagnostics.clearPreview(context) + return true + } + if (key !in setOf(KEY_ACCESSIBILITY_EVENTS, KEY_NOTIFICATION_EVENTS, KEY_AI_SCREENSHOT)) { + return false + } + prefs.edit().putBoolean(key, enabled).apply() + return true + } + + fun setRuntime( + context: Context, + aiAllowed: Boolean, + hasAccount: Boolean, + baseUrl: String?, + token: String?, + ) { + val editor = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit() + .putBoolean(KEY_AI_ALLOWED, aiAllowed) + .putBoolean(KEY_HAS_ACCOUNT, hasAccount) + if (baseUrl.isNullOrBlank()) editor.remove(KEY_BASE_URL) else editor.putString(KEY_BASE_URL, baseUrl) + if (token.isNullOrBlank()) { + editor.remove(KEY_TOKEN) + } else { + val encrypted = NativeCrypto.encrypt(token.toByteArray(Charsets.UTF_8)) + if (encrypted != null) editor.putString(KEY_TOKEN, encrypted) + } + editor.apply() + } + + fun disableRuntimeAi(context: Context) { + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + .edit() + .putBoolean(KEY_AI_ALLOWED, false) + .apply() + } + + fun runtimeToken(context: Context): String? { + val encoded = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + .getString(KEY_TOKEN, null) ?: return null + return NativeCrypto.decrypt(encoded)?.toString(Charsets.UTF_8) + } + + fun statusJson(context: Context): String { + val snapshot = snapshot(context) + return JSONObject() + .put("accessibilityEvents", snapshot.accessibilityEvents) + .put("notificationEvents", snapshot.notificationEvents) + .put("aiScreenshot", snapshot.aiScreenshot) + .put("ocrDiagnosticPreview", snapshot.ocrDiagnosticPreview) + .put("ocrDiagnosticPreviewExpiresAt", snapshot.ocrDiagnosticPreviewExpiresAt) + .put("aiAllowed", snapshot.aiAllowed) + .put("hasAccount", snapshot.hasAccount) + .toString() + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionStore.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionStore.kt new file mode 100644 index 0000000..8aac495 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionStore.kt @@ -0,0 +1,428 @@ +package com.nx.miaoji + +import android.content.ContentValues +import android.content.Context +import android.database.Cursor +import android.database.sqlite.SQLiteDatabase +import android.database.sqlite.SQLiteOpenHelper +import org.json.JSONObject +import java.util.UUID +import kotlin.math.abs + +data class StoredCandidate( + val id: String, + val clientRequestId: String, + val state: String, + val transactionId: Long?, + val json: String, +) + +class RecognitionStore(context: Context) : + SQLiteOpenHelper(context, "recognition_queue.db", null, 2) { + override fun onCreate(db: SQLiteDatabase) { + db.execSQL( + """ + CREATE TABLE candidates ( + id TEXT PRIMARY KEY, + client_request_id TEXT NOT NULL UNIQUE, + package_name TEXT NOT NULL, + amount_cents INTEGER NOT NULL, + direction TEXT NOT NULL, + merchant_hash TEXT NOT NULL, + strong_key TEXT, + channel_mask INTEGER NOT NULL, + known_template INTEGER NOT NULL, + occurred_at INTEGER NOT NULL, + payload_encrypted TEXT NOT NULL, + state TEXT NOT NULL, + high_confidence INTEGER NOT NULL, + available_at INTEGER NOT NULL, + first_seen INTEGER NOT NULL, + updated_at INTEGER NOT NULL, + transaction_id INTEGER + ) + """.trimIndent(), + ) + db.execSQL( + """ + CREATE TABLE evidence ( + source_hash TEXT PRIMARY KEY, + candidate_id TEXT NOT NULL, + channel INTEGER NOT NULL, + created_at INTEGER NOT NULL + ) + """.trimIndent(), + ) + db.execSQL( + "CREATE INDEX ix_recognition_merge ON candidates " + + "(package_name, amount_cents, direction, merchant_hash, occurred_at)", + ) + db.execSQL( + "CREATE UNIQUE INDEX ux_recognition_strong ON candidates(strong_key) " + + "WHERE strong_key IS NOT NULL", + ) + db.execSQL( + "CREATE INDEX ix_recognition_state ON candidates(state, available_at)", + ) + } + + override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) { + if (oldVersion < 2) { + db.execSQL( + "CREATE INDEX IF NOT EXISTS ix_recognition_state " + + "ON candidates(state, available_at)", + ) + } + } + + @Synchronized + fun upsert(signal: PaymentSignal): String { + val now = System.currentTimeMillis() + val channelBit = channelBit(signal.channel) + val sourceHash = PaymentParser.sha256(signal.sourceEventId) + writableDatabase.beginTransaction() + try { + writableDatabase.rawQuery( + "SELECT candidate_id FROM evidence WHERE source_hash = ?", + arrayOf(sourceHash), + ).use { cursor -> + if (cursor.moveToFirst()) { + writableDatabase.setTransactionSuccessful() + return cursor.getString(0) + } + } + + val merchantHash = PaymentParser.sha256( + signal.merchant?.trim()?.lowercase().orEmpty(), + ) + val orderStrongKey = signal.orderId?.takeIf { it.isNotBlank() }?.let { + PaymentParser.sha256("${signal.packageName}|$it") + } + val flowStrongKey = signal.flowSessionId?.takeIf { it.isNotBlank() }?.let { + PaymentParser.sha256("${signal.packageName}|flow|$it") + } + val strongKey = orderStrongKey ?: flowStrongKey + val signalHigh = signal.channel in setOf("accessibility", "local_ocr") && + signal.evidenceConfidence == "high" + val existing = findMergeCandidate(signal, channelBit, merchantHash, strongKey, now) + val id: String + if (existing != null) { + id = existing.id + val mergedMask = existing.channelMask or channelBit + val hasNonAiEvidence = mergedMask and channelBit("recognition_ai").inv() != 0 + val high = hasNonAiEvidence && + (signalHigh || + (mergedMask and ACCESSIBILITY_NOTIFICATION_MASK) == + ACCESSIBILITY_NOTIFICATION_MASK || + existing.highConfidence) + val mergedPayload = mergePayload(existing.payload, signal) + writableDatabase.update( + "candidates", + ContentValues().apply { + put("channel_mask", mergedMask) + put("known_template", if (existing.knownTemplate || signal.knownTemplate) 1 else 0) + put("high_confidence", if (high) 1 else 0) + put("payload_encrypted", encryptPayload(mergedPayload)) + put("updated_at", now) + put("available_at", now + MERGE_DELAY_MS) + }, + "id = ?", + arrayOf(id), + ) + } else { + id = UUID.randomUUID().toString() + val payload = signalToJson(signal) + val high = signalHigh + writableDatabase.insertOrThrow( + "candidates", + null, + ContentValues().apply { + put("id", id) + put("client_request_id", "recognition-$id") + put("package_name", signal.packageName) + put("amount_cents", signal.amountCents) + put("direction", signal.type) + put("merchant_hash", merchantHash) + put("strong_key", strongKey) + put("channel_mask", channelBit) + put("known_template", if (signal.knownTemplate) 1 else 0) + put("occurred_at", signal.occurredAtEpochMs) + put("payload_encrypted", encryptPayload(payload)) + put("state", "pending_merge") + put("high_confidence", if (high) 1 else 0) + put("available_at", now + MERGE_DELAY_MS) + put("first_seen", now) + put("updated_at", now) + }, + ) + } + writableDatabase.insertOrThrow( + "evidence", + null, + ContentValues().apply { + put("source_hash", sourceHash) + put("candidate_id", id) + put("channel", channelBit) + put("created_at", now) + }, + ) + writableDatabase.setTransactionSuccessful() + return id + } finally { + writableDatabase.endTransaction() + } + } + + @Synchronized + fun finalizeCandidate(id: String): StoredCandidate? { + val now = System.currentTimeMillis() + writableDatabase.beginTransaction() + try { + writableDatabase.execSQL( + """ + UPDATE candidates + SET state = CASE WHEN high_confidence = 1 + THEN 'auto_ready' ELSE 'pending_confirm' END, + updated_at = ? + WHERE id = ? AND state = 'pending_merge' AND available_at <= ? + """.trimIndent(), + arrayOf(now, id, now), + ) + val result = loadById(id) + writableDatabase.setTransactionSuccessful() + return result?.takeIf { it.state == "auto_ready" || it.state == "pending_confirm" } + } finally { + writableDatabase.endTransaction() + } + } + + @Synchronized + fun ready(): List { + val now = System.currentTimeMillis() + writableDatabase.execSQL( + """ + UPDATE candidates + SET state = CASE WHEN high_confidence = 1 + THEN 'auto_ready' ELSE 'pending_confirm' END, + updated_at = ? + WHERE state = 'pending_merge' AND available_at <= ? + """.trimIndent(), + arrayOf(now, now), + ) + expireOld(now) + return readableDatabase.rawQuery( + """ + SELECT * FROM candidates + WHERE state IN ('auto_ready', 'pending_confirm') + ORDER BY occurred_at, first_seen + """.trimIndent(), + null, + ).use { cursor -> + buildList { + while (cursor.moveToNext()) decode(cursor)?.let(::add) + } + } + } + + @Synchronized + fun acknowledge(id: String, state: String, transactionId: Long?): StoredCandidate? { + if (state !in setOf("imported", "undone", "expired")) return null + writableDatabase.update( + "candidates", + ContentValues().apply { + put("state", state) + put("updated_at", System.currentTimeMillis()) + if (transactionId == null) putNull("transaction_id") else put("transaction_id", transactionId) + }, + "id = ?", + arrayOf(id), + ) + return loadById(id) + } + + @Synchronized + fun latestStatus(): String? = readableDatabase.rawQuery( + "SELECT state, updated_at FROM candidates ORDER BY updated_at DESC LIMIT 1", + null, + ).use { cursor -> + if (!cursor.moveToFirst()) null + else JSONObject() + .put("state", cursor.getString(0)) + .put("updatedAt", cursor.getLong(1)) + .toString() + } + + private fun findMergeCandidate( + signal: PaymentSignal, + channelBit: Int, + merchantHash: String, + strongKey: String?, + now: Long, + ): CandidateRow? { + if (strongKey != null) { + readableDatabase.rawQuery( + "SELECT * FROM candidates WHERE strong_key = ? AND state NOT IN ('undone','expired') LIMIT 1", + arrayOf(strongKey), + ).use { cursor -> + if (cursor.moveToFirst()) return row(cursor) + } + } + if (signal.channel == "local_ocr" && signal.flowSessionId != null) return null + val since = signal.occurredAtEpochMs - NO_ORDER_WINDOW_MS + val until = signal.occurredAtEpochMs + NO_ORDER_WINDOW_MS + readableDatabase.rawQuery( + """ + SELECT * FROM candidates + WHERE package_name = ? AND amount_cents = ? AND direction = ? + AND merchant_hash = ? AND occurred_at BETWEEN ? AND ? + AND state IN ('pending_merge','auto_ready','pending_confirm','imported') + ORDER BY ABS(occurred_at - ?) LIMIT 4 + """.trimIndent(), + arrayOf( + signal.packageName, + signal.amountCents.toString(), + signal.type, + merchantHash, + since.toString(), + until.toString(), + signal.occurredAtEpochMs.toString(), + ), + ).use { cursor -> + while (cursor.moveToNext()) { + val candidate = row(cursor) + val hasSameChannel = candidate.channelMask and channelBit != 0 + if (!hasSameChannel || now - candidate.updatedAt <= SAME_CHANNEL_DEBOUNCE_MS) { + return candidate + } + } + } + return null + } + + private fun loadById(id: String): StoredCandidate? = readableDatabase.rawQuery( + "SELECT * FROM candidates WHERE id = ? LIMIT 1", + arrayOf(id), + ).use { cursor -> if (cursor.moveToFirst()) decode(cursor) else null } + + private fun decode(cursor: Cursor): StoredCandidate? { + val payload = decryptPayload(cursor.getString(cursor.getColumnIndexOrThrow("payload_encrypted"))) + ?: return null + payload + .put("id", cursor.getString(cursor.getColumnIndexOrThrow("id"))) + .put("clientRequestId", cursor.getString(cursor.getColumnIndexOrThrow("client_request_id"))) + .put("state", cursor.getString(cursor.getColumnIndexOrThrow("state"))) + .put("confidence", if (cursor.getInt(cursor.getColumnIndexOrThrow("high_confidence")) == 1) "auto" else "confirm") + .put("source", sourceFromMask(cursor.getInt(cursor.getColumnIndexOrThrow("channel_mask")))) + val txIndex = cursor.getColumnIndexOrThrow("transaction_id") + val txId = if (cursor.isNull(txIndex)) null else cursor.getLong(txIndex) + if (txId != null) payload.put("transactionId", txId) + return StoredCandidate( + id = payload.getString("id"), + clientRequestId = payload.getString("clientRequestId"), + state = payload.getString("state"), + transactionId = txId, + json = payload.toString(), + ) + } + + private fun row(cursor: Cursor): CandidateRow { + val payload = decryptPayload(cursor.getString(cursor.getColumnIndexOrThrow("payload_encrypted"))) + ?: JSONObject() + return CandidateRow( + id = cursor.getString(cursor.getColumnIndexOrThrow("id")), + channelMask = cursor.getInt(cursor.getColumnIndexOrThrow("channel_mask")), + knownTemplate = cursor.getInt(cursor.getColumnIndexOrThrow("known_template")) == 1, + highConfidence = cursor.getInt(cursor.getColumnIndexOrThrow("high_confidence")) == 1, + updatedAt = cursor.getLong(cursor.getColumnIndexOrThrow("updated_at")), + payload = payload, + ) + } + + private fun signalToJson(signal: PaymentSignal): JSONObject = JSONObject() + .put("packageName", signal.packageName) + .put("appName", PaymentParser.appName(signal.packageName)) + .put("type", signal.type) + .put("amount", signal.amountCents / 100.0) + .put("merchant", signal.merchant) + .put("orderId", signal.orderId) + .put("occurredAtEpochMs", signal.occurredAtEpochMs) + .put("sourceText", signal.sourceText) + .put("flowSessionId", signal.flowSessionId) + .put("evidenceConfidence", signal.evidenceConfidence) + .put("recognitionKind", signal.recognitionKind) + .put("categoryHint", signal.categoryHint) + .put("amountSource", signal.amountSource) + .put("resultFingerprint", signal.resultFingerprint) + .put( + "note", + signal.merchant?.take(40) ?: when (signal.recognitionKind) { + "red_packet_send" -> "发红包" + "red_packet_receive" -> "红包到账" + "red_packet_refund" -> "红包退回" + else -> PaymentParser.appName(signal.packageName) + }, + ) + + private fun mergePayload(existing: JSONObject, signal: PaymentSignal): JSONObject { + if (existing.isNull("merchant") && signal.merchant != null) existing.put("merchant", signal.merchant) + if (existing.isNull("orderId") && signal.orderId != null) existing.put("orderId", signal.orderId) + if (existing.isNull("sourceText") && signal.sourceText != null) existing.put("sourceText", signal.sourceText) + if (existing.optString("recognitionKind").isBlank()) existing.put("recognitionKind", signal.recognitionKind) + if (existing.isNull("categoryHint") && signal.categoryHint != null) existing.put("categoryHint", signal.categoryHint) + if (existing.optString("amountSource").isBlank()) existing.put("amountSource", signal.amountSource) + if (existing.isNull("resultFingerprint") && signal.resultFingerprint != null) { + existing.put("resultFingerprint", signal.resultFingerprint) + } + if (existing.optString("note").isBlank() && signal.merchant != null) existing.put("note", signal.merchant.take(40)) + existing.put("occurredAtEpochMs", minOf(existing.optLong("occurredAtEpochMs"), signal.occurredAtEpochMs)) + return existing + } + + private fun encryptPayload(payload: JSONObject): String = + NativeCrypto.encrypt(payload.toString().toByteArray(Charsets.UTF_8)) + ?: throw IllegalStateException("无法加密识别候选") + + private fun decryptPayload(value: String): JSONObject? = + NativeCrypto.decrypt(value)?.toString(Charsets.UTF_8)?.let(::JSONObject) + + private fun expireOld(now: Long) { + writableDatabase.execSQL( + "UPDATE candidates SET state = 'expired', updated_at = ? " + + "WHERE state NOT IN ('imported','undone','expired') AND first_seen < ?", + arrayOf(now, now - EXPIRE_MS), + ) + writableDatabase.delete("evidence", "created_at < ?", arrayOf((now - EXPIRE_MS).toString())) + } + + private fun channelBit(channel: String): Int = when (channel) { + "accessibility" -> 1 + "notification" -> 2 + "recognition_ai" -> 4 + "local_ocr" -> 8 + else -> 0 + } + + private fun sourceFromMask(mask: Int): String = when { + mask and 8 != 0 -> "local_ocr" + mask and 4 != 0 -> "recognition_ai" + mask and 1 != 0 -> "accessibility" + else -> "notification" + } + + private data class CandidateRow( + val id: String, + val channelMask: Int, + val knownTemplate: Boolean, + val highConfidence: Boolean, + val updatedAt: Long, + val payload: JSONObject, + ) + + companion object { + private const val ACCESSIBILITY_NOTIFICATION_MASK = 3 + private const val MERGE_DELAY_MS = 1_500L + private const val NO_ORDER_WINDOW_MS = 90_000L + private const val SAME_CHANNEL_DEBOUNCE_MS = 10_000L + private const val EXPIRE_MS = 7L * 24L * 60L * 60L * 1000L + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotAccessibilityService.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotAccessibilityService.kt new file mode 100644 index 0000000..1632782 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotAccessibilityService.kt @@ -0,0 +1,1013 @@ +package com.nx.miaoji + +import android.accessibilityservice.AccessibilityService +import android.accessibilityservice.AccessibilityServiceInfo +import android.content.Intent +import android.graphics.Bitmap +import android.os.Build +import android.os.Environment +import android.os.Handler +import android.os.Looper +import android.util.Log +import android.view.Display +import android.view.accessibility.AccessibilityEvent +import android.view.accessibility.AccessibilityNodeInfo +import java.io.ByteArrayOutputStream +import java.io.File +import java.io.FileOutputStream +import java.util.ArrayDeque +import java.util.UUID + +class ScreenshotAccessibilityService : AccessibilityService() { + private val handler = Handler(Looper.getMainLooper()) + private var captureInProgress = false + private var lastWindowId = -1 + private var lastPackageName: String? = null + private var lastExternalWindowId = -1 + private var lastExternalPackageName: String? = null + private var pendingRetry: CaptureRequest? = null + private var retryTimeout: Runnable? = null + private var lastVisualCaptureAt = 0L + private var paymentFlow: PaymentFlow? = null + private var pendingVisualCapture: Runnable? = null + private var ocrInProgress = false + private var visualOperationId: String? = null + private var visualTimeout: Runnable? = null + + private data class CollectedPage(val text: String, val nodeCount: Int) + + private data class PaymentFlow( + val id: String, + val packageName: String, + val startedAt: Long, + var lastTouchedAt: Long, + var windowId: Int, + var trusted: Boolean, + var kind: String, + var originWindowId: Int = windowId, + var originPageHash: String? = null, + var expectedAmountCents: Long? = null, + var expectedType: String? = null, + var committedAt: Long? = null, + var resultTransitionObserved: Boolean = false, + var resultPageHash: String? = null, + var resultFingerprint: String? = null, + var completed: Boolean = false, + var retryCount: Int = 0, + var probeCount: Int = 0, + ) + + private data class CaptureRequest( + val showResult: Boolean, + val callback: ((Result) -> Unit)?, + val sessionId: String, + val sourcePackage: String?, + val sourceWindowId: Int, + val retryCount: Int = 0, + ) + + override fun onServiceConnected() { + super.onServiceConnected() + serviceInfo = serviceInfo.apply { + flags = flags or + AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS or + AccessibilityServiceInfo.FLAG_REPORT_VIEW_IDS + } + activeInstance = this + isConnected = true + Log.i(TAG, "Accessibility recognition service connected") + } + + override fun onAccessibilityEvent(event: AccessibilityEvent?) { + val currentEvent = event ?: return + val packageName = currentEvent.packageName?.toString() + if (!packageName.isNullOrBlank()) lastPackageName = packageName + if (currentEvent.windowId >= 0) lastWindowId = currentEvent.windowId + if (isExternalWindow(packageName, currentEvent.className?.toString()) && + currentEvent.windowId >= 0 + ) { + lastExternalPackageName = packageName + lastExternalWindowId = currentEvent.windowId + } + retryPrivacyCaptureIfReady(packageName, currentEvent.windowId) + + val recognizedPackage = packageName ?: return + if (recognizedPackage !in PaymentParser.supportedPackages) return + if (!RecognitionSettings.snapshot(this).accessibilityEvents) return + if (currentEvent.eventType !in RECOGNITION_EVENT_TYPES) return + + val now = System.currentTimeMillis() + expirePaymentFlow(now) + val root = rootInActiveWindow ?: currentEvent.source + val page = root?.let(::collectText) ?: CollectedPage("", 0) + val eventText = buildString { + currentEvent.text.map(CharSequence::toString) + .filter(String::isNotBlank) + .forEach { append(it).append('\n') } + currentEvent.contentDescription?.toString()?.let(::append) + }.trim() + val combined = listOf(page.text, eventText) + .filter(String::isNotBlank) + .joinToString("\n") + + if (PaymentParser.isHistoryPageText(combined)) { + paymentFlow = null + RecognitionDiagnostics.record( + this, + recognizedPackage, + stage = "event", + result = "ignored", + nodeCount = page.nodeCount, + reason = "history_page", + ) + return + } + if (PaymentParser.containsBlockedStatus(combined)) { + paymentFlow = null + RecognitionDiagnostics.record( + this, + recognizedPackage, + stage = "event", + result = "ignored", + nodeCount = page.nodeCount, + reason = "blocked_status", + ) + return + } + + val existingFlow = paymentFlow + val status = PaymentParser.detectStatus(combined, existingFlow?.expectedType) + val clickedPaymentAction = + currentEvent.eventType == AccessibilityEvent.TYPE_VIEW_CLICKED && + PaymentParser.hasPaymentAction(eventText.ifBlank { combined }) + val inferredKind = PaymentParser.detectFlowKind(combined) + ?: existingFlow?.kind + ?: "payment" + val resultSurface = status.strength != PaymentStatusStrength.NONE || + (existingFlow?.kind == "red_packet_send" && + PaymentParser.hasRedPacketSentSurface(combined)) + if (existingFlow?.completed == true && resultSurface) { + val currentKind = if (existingFlow.kind == "red_packet_send" && + PaymentParser.hasRedPacketSentSurface(combined) + ) { + "red_packet_send" + } else { + PaymentParser.recognitionKind( + combined, + status.direction ?: existingFlow.expectedType ?: "expense", + ) + } + val sameOutgoingResult = + currentKind in setOf("payment", "transfer") && + existingFlow.kind in setOf("payment", "transfer") + if (currentKind == existingFlow.kind || sameOutgoingResult) { + RecognitionDiagnostics.record( + this, + recognizedPackage, + stage = "event", + result = "ignored", + nodeCount = page.nodeCount, + reason = "duplicate_result_surface", + recognitionKind = currentKind, + resultFingerprint = existingFlow.resultFingerprint, + ) + return + } + } + + val hasContext = PaymentParser.hasPaymentContext(combined) + val inputContext = hasContext && !resultSurface && + (PaymentParser.isPaymentInputPage(combined) || + PaymentParser.detectFlowKind(combined) != null) + val armedFlow = when { + clickedPaymentAction -> armPaymentFlow( + recognizedPackage, + currentEvent.windowId, + now, + forceNew = existingFlow == null || existingFlow.completed || + existingFlow.packageName != recognizedPackage, + kind = inferredKind, + ) + inputContext -> armPaymentFlow( + recognizedPackage, + currentEvent.windowId, + now, + forceNew = existingFlow?.completed == true || + existingFlow?.packageName != recognizedPackage, + kind = inferredKind, + ) + else -> existingFlow?.takeIf { !it.completed } + } + if (armedFlow != null) { + updateFlowEvidence(armedFlow, combined) + if (clickedPaymentAction) { + armedFlow.committedAt = armedFlow.committedAt ?: now + armedFlow.expectedType = armedFlow.expectedType ?: "expense" + armedFlow.kind = inferredKind + armedFlow.trusted = true + } + updateResultTransition(armedFlow, currentEvent, combined, now) + } + + val directFlow = paymentFlow?.takeIf { !it.completed } + val directSignal = if (combined.isBlank()) null else PaymentParser.fromAccessibility( + packageName = recognizedPackage, + text = combined, + eventTime = currentEvent.eventTime, + windowId = currentEvent.windowId, + flowSessionId = directFlow?.id, + trustedFlow = directFlow?.trusted == true, + expectedAmountCents = directFlow?.expectedAmountCents, + expectedType = directFlow?.expectedType, + resultTransitionObserved = directFlow?.resultTransitionObserved == true, + submittedFlow = directFlow?.committedAt != null, + flowKind = directFlow?.kind, + ) + if (directSignal != null) { + val flow = directFlow ?: armPaymentFlow( + recognizedPackage, + currentEvent.windowId, + now, + forceNew = true, + trusted = directSignal.evidenceConfidence == "high", + kind = directSignal.recognitionKind, + ).apply { + resultTransitionObserved = true + } + submitOnce( + directSignal.copy(flowSessionId = flow.id), + flow, + page.nodeCount, + "tree", + ) + return + } + + val majorWindowChange = currentEvent.eventType in MAJOR_WINDOW_EVENTS + val flow = paymentFlow?.takeIf { !it.completed } ?: return + val shouldProbe = flow.committedAt != null && + (majorWindowChange || + currentEvent.eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED || + clickedPaymentAction) + if (!shouldProbe) return + + scheduleVisualRecognition( + flow, + reason = when { + clickedPaymentAction -> "payment_action" + majorWindowChange -> "window_change" + else -> "content_change" + }, + nodeCount = page.nodeCount, + ) + } + override fun onInterrupt() = Unit + + override fun onUnbind(intent: Intent?): Boolean { + disconnect() + Log.i(TAG, "Accessibility recognition service unbound") + return super.onUnbind(intent) + } + + override fun onDestroy() { + disconnect() + super.onDestroy() + } + + private fun disconnect() { + if (activeInstance === this) activeInstance = null + isConnected = false + pendingRetry = null + retryTimeout = null + pendingVisualCapture = null + visualTimeout?.let(handler::removeCallbacks) + visualTimeout = null + visualOperationId = null + captureInProgress = false + ocrInProgress = false + paymentFlow = null + handler.removeCallbacksAndMessages(null) + } + + private fun collectText(root: AccessibilityNodeInfo): CollectedPage { + val queue = ArrayDeque() + val values = LinkedHashSet() + queue.add(root) + var visited = 0 + while (queue.isNotEmpty() && visited < MAX_TREE_NODES) { + val node = queue.removeFirst() + visited += 1 + node.text?.toString()?.trim()?.takeIf { it.isNotBlank() }?.let(values::add) + node.contentDescription?.toString()?.trim()?.takeIf { it.isNotBlank() }?.let(values::add) + for (index in 0 until minOf(node.childCount, MAX_CHILDREN_PER_NODE)) { + node.getChild(index)?.let(queue::add) + } + } + return CollectedPage(values.joinToString("\n").take(MAX_TEXT_CHARS), visited) + } + + private fun armPaymentFlow( + packageName: String, + windowId: Int, + now: Long, + forceNew: Boolean, + trusted: Boolean = true, + kind: String = "payment", + ): PaymentFlow { + val existing = paymentFlow + if (!forceNew && existing != null && !existing.completed && + existing.packageName == packageName && + now - existing.startedAt <= PAYMENT_FLOW_TTL_MS + ) { + existing.lastTouchedAt = now + if (windowId >= 0) existing.windowId = windowId + existing.trusted = existing.trusted || trusted + if (existing.kind == "payment" && kind != "payment") existing.kind = kind + return existing + } + return PaymentFlow( + id = UUID.randomUUID().toString(), + packageName = packageName, + startedAt = now, + lastTouchedAt = now, + windowId = windowId, + trusted = trusted, + kind = kind, + ).also { paymentFlow = it } + } + + private fun updateFlowEvidence(flow: PaymentFlow, text: String) { + if (text.isBlank() || flow.completed || flow.resultTransitionObserved) return + if (PaymentParser.detectStatus(text).strength != PaymentStatusStrength.NONE) return + val pageHash = PaymentParser.sha256(text) + flow.originPageHash = flow.originPageHash ?: pageHash + flow.expectedAmountCents = flow.expectedAmountCents + ?: PaymentParser.uniqueAmountCents(text) + flow.expectedType = flow.expectedType + ?: PaymentParser.inferContextDirection(text) + PaymentParser.detectFlowKind(text)?.let { detected -> + if (flow.kind == "payment" || detected == "red_packet_send") { + flow.kind = detected + } + } + } + + private fun updateResultTransition( + flow: PaymentFlow, + event: AccessibilityEvent, + text: String, + now: Long, + ) { + if (flow.completed || flow.resultTransitionObserved) return + val referenceAt = flow.committedAt ?: flow.startedAt + if (now - referenceAt < MIN_RESULT_TRANSITION_DELAY_MS) return + val currentHash = text.takeIf(String::isNotBlank)?.let(PaymentParser::sha256) + val windowChanged = event.windowId >= 0 && flow.originWindowId >= 0 && + event.windowId != flow.originWindowId + val pageChanged = currentHash != null && flow.originPageHash != null && + currentHash != flow.originPageHash + val majorWindowChange = event.eventType in MAJOR_WINDOW_EVENTS + val completedStateVisible = PaymentParser.isResultSurface(text, flow.kind) + if ((majorWindowChange && (windowChanged || pageChanged)) || + (pageChanged && completedStateVisible) + ) { + flow.resultTransitionObserved = true + flow.resultPageHash = currentHash + if (event.windowId >= 0) flow.windowId = event.windowId + } + } + + private fun expirePaymentFlow(now: Long) { + val flow = paymentFlow ?: return + if (now - flow.startedAt > PAYMENT_FLOW_TTL_MS) { + paymentFlow = null + pendingVisualCapture?.let(handler::removeCallbacks) + pendingVisualCapture = null + } + } + + private fun submitOnce( + signal: PaymentSignal, + flow: PaymentFlow, + nodeCount: Int, + stage: String, + recordDiagnostic: Boolean = true, + ) { + if (flow.completed) return + flow.completed = true + flow.resultFingerprint = signal.resultFingerprint + RecognitionCoordinator.get(this).submit(signal) + if (recordDiagnostic) { + RecognitionDiagnostics.record( + this, + signal.packageName, + stage = stage, + result = if (signal.evidenceConfidence == "high") "auto_ready" else "confirm", + nodeCount = nodeCount, + amountCandidates = 1, + reason = "success", + expectedAmountMatched = flow.expectedAmountCents?.let { + it == signal.amountCents + }, + resultTransitionObserved = flow.resultTransitionObserved, + recognitionKind = signal.recognitionKind, + amountSource = signal.amountSource, + resultFingerprint = signal.resultFingerprint, + ) + } + } + + private fun scheduleVisualRecognition( + flow: PaymentFlow, + reason: String, + nodeCount: Int, + delayMs: Long = VISUAL_STABILITY_DELAY_MS, + ) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R || + flow.completed || + flow.probeCount >= MAX_VISUAL_PROBES || + ocrInProgress + ) return + val now = System.currentTimeMillis() + val throttleWait = ( + VISUAL_CAPTURE_THROTTLE_MS - (now - lastVisualCaptureAt) + ).coerceAtLeast(0L) + pendingVisualCapture?.let(handler::removeCallbacks) + pendingVisualCapture = Runnable { + pendingVisualCapture = null + val current = paymentFlow + if (current?.id != flow.id || current.completed || + lastPackageName != flow.packageName + ) return@Runnable + captureForLocalOcr(current, reason, nodeCount) + }.also { handler.postDelayed(it, maxOf(delayMs, throttleWait)) } + } + + private fun captureForLocalOcr(flow: PaymentFlow, reason: String, nodeCount: Int) { + if (captureInProgress || ocrInProgress) return + val operationId = UUID.randomUUID().toString() + visualOperationId = operationId + captureInProgress = true + flow.probeCount += 1 + lastVisualCaptureAt = System.currentTimeMillis() + RecognitionDiagnostics.record( + this, + flow.packageName, + stage = "capture", + result = "started", + nodeCount = nodeCount, + reason = reason, + ) + visualTimeout = Runnable { + if (visualOperationId != operationId) return@Runnable + visualOperationId = null + visualTimeout = null + captureInProgress = false + handleVisualFailure(flow, nodeCount, "capture_timeout") + }.also { handler.postDelayed(it, CAPTURE_CALLBACK_TIMEOUT_MS) } + + val resolvedWindowId = resolveAccessibilityWindowId(flow) + var captureMode = if ( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + resolvedWindowId >= 0 + ) { + "window" + } else { + "display" + } + var displayFallbackScheduled = false + lateinit var callback: TakeScreenshotCallback + + fun failCapture(startFailure: Boolean = false) { + if (captureMode == "window" && !displayFallbackScheduled) { + displayFallbackScheduled = true + captureMode = "display" + RecognitionDiagnostics.record( + this, + flow.packageName, + stage = "capture", + result = "started", + nodeCount = nodeCount, + reason = "window_fallback", + ) + handler.postDelayed( + { + if (visualOperationId != operationId) return@postDelayed + runCatching { + takeScreenshot(Display.DEFAULT_DISPLAY, mainExecutor, callback) + }.onFailure { + if (finishVisualOperation(operationId)) { + captureInProgress = false + handleVisualFailure( + flow, + nodeCount, + "display_capture_start_failed", + ) + } + } + }, + WINDOW_CAPTURE_FALLBACK_DELAY_MS, + ) + return + } + if (finishVisualOperation(operationId)) { + captureInProgress = false + handleVisualFailure( + flow, + nodeCount, + if (startFailure) "capture_start_failed" else "capture_failed", + ) + } + } + + callback = object : TakeScreenshotCallback { + override fun onSuccess(screenshot: ScreenshotResult) { + if (visualOperationId != operationId) { + screenshot.hardwareBuffer.close() + return + } + cancelVisualTimeout() + val bitmap = try { + copyBitmap(screenshot) + } catch (error: Exception) { + finishVisualOperation(operationId) + captureInProgress = false + handleVisualFailure(flow, nodeCount, "invalid_bitmap") + return + } + captureInProgress = false + ocrInProgress = true + val capturedAt = System.currentTimeMillis() + visualTimeout = Runnable { + if (visualOperationId != operationId) return@Runnable + visualOperationId = null + visualTimeout = null + ocrInProgress = false + RecognitionDiagnostics.record( + this@ScreenshotAccessibilityService, + flow.packageName, + stage = "ocr", + result = "failed", + nodeCount = nodeCount, + reason = "ocr_timeout", + ) + handler.postDelayed( + { if (!bitmap.isRecycled) bitmap.recycle() }, + STALE_BITMAP_RELEASE_DELAY_MS, + ) + }.also { handler.postDelayed(it, OCR_CALLBACK_TIMEOUT_MS) } + + val recognitionSettings = RecognitionSettings.snapshot( + this@ScreenshotAccessibilityService, + ) + val visualTransitionObserved = flow.resultTransitionObserved || + flow.committedAt?.let { + capturedAt - it >= VISUAL_STABILITY_DELAY_MS + } == true + runCatching { + LocalPaymentOcr.analyze( + context = this@ScreenshotAccessibilityService, + bitmap = bitmap, + packageName = flow.packageName, + flowSessionId = flow.id, + trustedFlow = flow.trusted, + capturedAt = capturedAt, + expectedAmountCents = flow.expectedAmountCents, + expectedType = flow.expectedType, + resultTransitionObserved = visualTransitionObserved, + submittedFlow = flow.committedAt != null, + flowKind = flow.kind, + diagnosticPreviewEnabled = recognitionSettings.ocrDiagnosticPreview, + ) { outcome -> + handler.post { + if (!finishVisualOperation(operationId)) { + if (!bitmap.isRecycled) bitmap.recycle() + return@post + } + ocrInProgress = false + handleOcrOutcome(flow, bitmap, outcome, nodeCount) + } + } + }.onFailure { error -> + Log.e( + TAG, + "Unable to initialize or start local OCR: " + + error.javaClass.simpleName, + error, + ) + if (finishVisualOperation(operationId)) { + ocrInProgress = false + if (!bitmap.isRecycled) bitmap.recycle() + RecognitionDiagnostics.record( + this@ScreenshotAccessibilityService, + flow.packageName, + stage = "ocr", + result = "failed", + nodeCount = nodeCount, + reason = if (error is IllegalStateException) { + "ocr_init_failed" + } else { + "ocr_start_failed" + }, + ) + } + } + } + + override fun onFailure(errorCode: Int) { + if (visualOperationId != operationId) return + val failureReason = screenshotDiagnosticReason(errorCode) + Log.w( + TAG, + "Visual screenshot failed: mode=$captureMode " + + "windowId=$resolvedWindowId code=$errorCode reason=$failureReason", + ) + if (captureMode == "window" && shouldFallbackToDisplay(errorCode)) { + failCapture() + return + } + if (!finishVisualOperation(operationId)) return + captureInProgress = false + handleVisualFailure(flow, nodeCount, failureReason) + } + } + runCatching { + if (captureMode == "window") { + takeScreenshotOfWindow(resolvedWindowId, mainExecutor, callback) + } else { + takeScreenshot(Display.DEFAULT_DISPLAY, mainExecutor, callback) + } + }.onFailure { + Log.w(TAG, "Unable to start visual screenshot: mode=$captureMode", it) + failCapture(startFailure = true) + } + } + + private fun resolveAccessibilityWindowId(flow: PaymentFlow): Int { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) return -1 + return runCatching { + val currentWindows = windows.orEmpty() + currentWindows.firstOrNull { it.id == flow.windowId && it.isActive }?.id + ?: currentWindows.firstOrNull { window -> + window.isActive && + window.root?.packageName?.toString() == flow.packageName + }?.id + ?: -1 + }.getOrDefault(-1) + } + + private fun cancelVisualTimeout() { + visualTimeout?.let(handler::removeCallbacks) + visualTimeout = null + } + + private fun finishVisualOperation(operationId: String): Boolean { + if (visualOperationId != operationId) return false + visualOperationId = null + cancelVisualTimeout() + return true + } + private fun handleOcrOutcome( + flow: PaymentFlow, + bitmap: Bitmap, + outcome: LocalOcrOutcome, + nodeCount: Int, + ) { + try { + RecognitionDiagnostics.record( + this, + flow.packageName, + stage = "ocr", + result = if (outcome.signal != null) "matched" else "rejected", + nodeCount = nodeCount, + ocrMs = outcome.latencyMs, + amountCandidates = outcome.amountCandidateCount, + reason = outcome.reason, + statusStrength = outcome.statusStrength, + expectedAmountMatched = outcome.expectedAmountMatched, + resultTransitionObserved = outcome.resultTransitionObserved, + recognitionKind = outcome.signal?.recognitionKind ?: flow.kind, + amountSource = outcome.signal?.amountSource, + resultFingerprint = outcome.signal?.resultFingerprint, + ocrPreview = outcome.redactedPreview, + previewExpiresAt = RecognitionSettings.snapshot(this) + .ocrDiagnosticPreviewExpiresAt, + ) + val signal = outcome.signal + if (signal != null) { + submitOnce( + signal, + flow, + nodeCount, + "local_ocr", + recordDiagnostic = false, + ) + return + } + val retryable = outcome.reason in setOf("no_text", "missing_amount") + if (retryable && flow.retryCount < MAX_VISUAL_RETRIES) { + flow.retryCount += 1 + scheduleVisualRecognition( + flow, + reason = "ocr_retry", + nodeCount = nodeCount, + delayMs = VISUAL_RETRY_DELAY_MS, + ) + return + } + if (outcome.sawSuccess) maybeUseAiFallback(flow, bitmap) + } finally { + bitmap.recycle() + } + } + + private fun maybeUseAiFallback(flow: PaymentFlow, bitmap: Bitmap) { + val settings = RecognitionSettings.snapshot(this) + if (!settings.aiScreenshot || !settings.aiAllowed || !settings.hasAccount) return + runCatching { + val bytes = bitmapToBytes(bitmap) + BackgroundAiRecognizer.analyze(this, flow.packageName, bytes, flow.id) + }.onFailure { + RecognitionDiagnostics.record( + this, + flow.packageName, + stage = "ai_fallback", + result = "failed", + reason = "image_encode_failed", + ) + } + } + + private fun handleVisualFailure(flow: PaymentFlow, nodeCount: Int, reason: String) { + RecognitionDiagnostics.record( + this, + flow.packageName, + stage = "capture", + result = "failed", + nodeCount = nodeCount, + reason = reason, + ) + if (reason == "interval_short" && flow.retryCount < MAX_VISUAL_RETRIES) { + flow.retryCount += 1 + scheduleVisualRecognition( + flow, + reason = "capture_retry", + nodeCount = nodeCount, + delayMs = VISUAL_RETRY_DELAY_MS, + ) + } + } + + private fun shouldFallbackToDisplay(errorCode: Int): Boolean = + errorCode == ERROR_TAKE_SCREENSHOT_INTERNAL_ERROR || + (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + errorCode == ERROR_TAKE_SCREENSHOT_INVALID_WINDOW) + + private fun screenshotDiagnosticReason(errorCode: Int): String = when { + Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + errorCode == ERROR_TAKE_SCREENSHOT_SECURE_WINDOW -> "secure_window" + Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + errorCode == ERROR_TAKE_SCREENSHOT_INVALID_WINDOW -> "invalid_window" + errorCode == ERROR_TAKE_SCREENSHOT_INTERNAL_ERROR -> "internal_error" + errorCode == ERROR_TAKE_SCREENSHOT_INTERVAL_TIME_SHORT -> "interval_short" + errorCode == ERROR_TAKE_SCREENSHOT_NO_ACCESSIBILITY_ACCESS -> "accessibility_unavailable" + errorCode == ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY -> "invalid_display" + else -> "capture_failed_$errorCode" + } + private fun capture( + showResult: Boolean, + callback: ((Result) -> Unit)?, + preferExternalSource: Boolean, + ) { + val sourcePackage = if (preferExternalSource) { + lastExternalPackageName ?: lastPackageName + } else { + lastPackageName + } + val sourceWindowId = if (preferExternalSource && lastExternalWindowId >= 0) { + lastExternalWindowId + } else { + lastWindowId + } + performCapture( + CaptureRequest( + showResult = showResult, + callback = callback, + sessionId = ScreenshotResultDispatcher.newSessionId(), + sourcePackage = sourcePackage, + sourceWindowId = sourceWindowId, + ), + ) + } + + private fun isExternalWindow(packageName: String?, className: String?): Boolean { + if (packageName.isNullOrBlank()) return false + if (packageName.contains("systemui", ignoreCase = true)) return false + return className != ProjectionConsentActivity::class.java.name + } + + private fun performCapture(request: CaptureRequest) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + reportFailure(request, "Android 11 以下请使用系统截图后分享或上传图片") + return + } + if (captureInProgress || pendingRetry != null) { + reportFailure(request, "截屏正在处理中,请稍后再试") + return + } + + captureInProgress = true + val screenshotCallback = object : TakeScreenshotCallback { + override fun onSuccess(screenshot: ScreenshotResult) { + try { + val path = saveScreenshot(screenshot, request.sessionId) + if (!ScreenshotResultDispatcher.isValidImage(path)) { + File(path).delete() + throw IllegalStateException("截屏图片无效") + } + request.callback?.invoke(Result.success(path)) + if (request.showResult) { + ScreenshotResultDispatcher.openResult( + this@ScreenshotAccessibilityService, + path, + request.sessionId, + ) + } + } catch (error: Exception) { + Log.e(TAG, "Failed to save accessibility screenshot", error) + reportFailure(request, "截屏保存失败,请重试") + } finally { + captureInProgress = false + } + } + + override fun onFailure(errorCode: Int) { + captureInProgress = false + if (shouldWaitForPrivacyPermission(errorCode, request)) { + queuePrivacyRetry(request) + } else { + reportFailure(request, screenshotErrorMessage(errorCode)) + } + } + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + request.sourceWindowId >= 0 + ) { + takeScreenshotOfWindow(request.sourceWindowId, mainExecutor, screenshotCallback) + } else { + takeScreenshot(Display.DEFAULT_DISPLAY, mainExecutor, screenshotCallback) + } + } + + private fun retryPrivacyCaptureIfReady(packageName: String?, windowId: Int) { + val retry = pendingRetry ?: return + if (packageName != retry.sourcePackage || windowId < 0) return + pendingRetry = null + retryTimeout?.let(handler::removeCallbacks) + retryTimeout = null + handler.postDelayed( + { performCapture(retry.copy(sourceWindowId = windowId)) }, + PRIVACY_RETRY_DELAY_MS, + ) + } + + private fun queuePrivacyRetry(request: CaptureRequest) { + val retry = request.copy(retryCount = request.retryCount + 1) + pendingRetry = retry + ScreenshotResultDispatcher.notifyFailure( + this, + "如系统要求隐私截屏授权,请授权后返回原页面,将自动重试一次", + ) + retryTimeout?.let(handler::removeCallbacks) + retryTimeout = Runnable { + if (pendingRetry != retry) return@Runnable + pendingRetry = null + retryTimeout = null + reportFailure(retry, "未取得当前页面截屏权限,请使用系统截图后从相册导入") + }.also { handler.postDelayed(it, PRIVACY_RETRY_TIMEOUT_MS) } + } + + private fun shouldWaitForPrivacyPermission( + errorCode: Int, + request: CaptureRequest, + ): Boolean { + if (request.retryCount > 0 || request.sourcePackage.isNullOrBlank()) return false + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + errorCode == ERROR_TAKE_SCREENSHOT_SECURE_WINDOW + ) return false + return errorCode != ERROR_TAKE_SCREENSHOT_INTERVAL_TIME_SHORT && + errorCode != ERROR_TAKE_SCREENSHOT_NO_ACCESSIBILITY_ACCESS + } + + private fun saveScreenshot(screenshot: ScreenshotResult, sessionId: String): String { + val bitmap = copyBitmap(screenshot) + try { + val directory = getExternalFilesDir(Environment.DIRECTORY_PICTURES) ?: filesDir + if (!directory.exists() && !directory.mkdirs()) { + throw IllegalStateException("无法创建截屏目录") + } + val file = File(directory, "miaoji_screenshot_$sessionId.png") + FileOutputStream(file).use { output -> + check(bitmap.compress(Bitmap.CompressFormat.PNG, 100, output)) { + "无法写入截屏文件" + } + } + return file.absolutePath + } finally { + bitmap.recycle() + } + } + + private fun bitmapToBytes(bitmap: Bitmap): ByteArray = + ByteArrayOutputStream().use { output -> + check(bitmap.compress(Bitmap.CompressFormat.PNG, 92, output)) { + "无法编码截屏" + } + output.toByteArray() + } + + private fun copyBitmap(screenshot: ScreenshotResult): Bitmap { + val buffer = screenshot.hardwareBuffer + var source: Bitmap? = null + try { + source = Bitmap.wrapHardwareBuffer(buffer, screenshot.colorSpace) + ?: throw IllegalStateException("无法读取截屏数据") + return source.copy(Bitmap.Config.ARGB_8888, false) + ?: throw IllegalStateException("无法转换截屏数据") + } finally { + source?.recycle() + buffer.close() + } + } + + private fun screenshotErrorMessage(errorCode: Int): String { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + errorCode == ERROR_TAKE_SCREENSHOT_SECURE_WINDOW + ) return "当前页面禁止截屏,无法识别" + return when (errorCode) { + ERROR_TAKE_SCREENSHOT_INTERVAL_TIME_SHORT -> "截屏触发过于频繁,请稍后再试" + ERROR_TAKE_SCREENSHOT_NO_ACCESSIBILITY_ACCESS -> "无障碍服务没有截屏权限,请重新开启服务" + ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY -> "当前屏幕暂时无法截取" + else -> "系统截屏失败,请重试" + } + } + + private fun reportFailure(request: CaptureRequest, message: String) { + request.callback?.invoke(Result.failure(IllegalStateException(message))) + if (request.showResult) ScreenshotResultDispatcher.notifyFailure(this, message) + } + + companion object { + private const val TAG = "JizhiRecognition" + private const val PRIVACY_RETRY_DELAY_MS = 250L + private const val PRIVACY_RETRY_TIMEOUT_MS = 8_000L + private const val CONTENT_DEBOUNCE_MS = 2_000L + private const val PAYMENT_FLOW_TTL_MS = 90_000L + private const val MIN_RESULT_TRANSITION_DELAY_MS = 250L + private const val VISUAL_STABILITY_DELAY_MS = 700L + private const val VISUAL_RETRY_DELAY_MS = 850L + private const val VISUAL_CAPTURE_THROTTLE_MS = 2_500L + private const val CAPTURE_CALLBACK_TIMEOUT_MS = 6_000L + private const val OCR_CALLBACK_TIMEOUT_MS = 12_000L + private const val STALE_BITMAP_RELEASE_DELAY_MS = 60_000L + private const val WINDOW_CAPTURE_FALLBACK_DELAY_MS = 450L + private const val MAX_VISUAL_RETRIES = 1 + private const val MAX_VISUAL_PROBES = 4 + private const val MAX_TREE_NODES = 160 + private const val MAX_CHILDREN_PER_NODE = 40 + private const val MAX_TEXT_CHARS = 8_000 + private val MAJOR_WINDOW_EVENTS = setOf( + AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, + AccessibilityEvent.TYPE_WINDOWS_CHANGED, + ) + private val RECOGNITION_EVENT_TYPES = setOf( + AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, + AccessibilityEvent.TYPE_WINDOWS_CHANGED, + AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED, + AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED, + AccessibilityEvent.TYPE_VIEW_CLICKED, + ) + + @Volatile + private var activeInstance: ScreenshotAccessibilityService? = null + + @Volatile + var isConnected = false + private set + + fun requestScreenshot( + showResult: Boolean, + delayMs: Long = 0L, + preferExternalSource: Boolean = false, + callback: ((Result) -> Unit)? = null, + ): Boolean { + val service = activeInstance ?: return false + service.handler.postDelayed( + { service.capture(showResult, callback, preferExternalSource) }, + delayMs, + ) + return true + } + } +} + diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotResultDispatcher.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotResultDispatcher.kt new file mode 100644 index 0000000..95136c8 --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotResultDispatcher.kt @@ -0,0 +1,73 @@ +package com.nx.miaoji + +import android.content.Context +import android.content.Intent +import android.graphics.BitmapFactory +import android.os.Handler +import android.os.Looper +import android.widget.Toast +import java.io.File +import java.util.UUID + +object ScreenshotResultDispatcher { + fun newSessionId(): String = UUID.randomUUID().toString() + + fun isValidImage(path: String): Boolean { + val file = File(path) + if (!file.isFile || file.length() < MIN_IMAGE_BYTES) return false + val options = BitmapFactory.Options().apply { + inJustDecodeBounds = true + } + BitmapFactory.decodeFile(path, options) + return options.outWidth > 0 && options.outHeight > 0 + } + + fun openResult( + context: Context, + path: String, + sessionId: String, + ): Boolean { + if (!isValidImage(path)) { + File(path).delete() + notifyFailure(context, "截屏图片无效,请重新截取") + return false + } + return try { + context.startActivity(Intent(context, MainActivity::class.java).apply { + addFlags( + Intent.FLAG_ACTIVITY_NEW_TASK or + Intent.FLAG_ACTIVITY_CLEAR_TOP or + Intent.FLAG_ACTIVITY_SINGLE_TOP, + ) + putExtra(MainActivity.EXTRA_ACTION, MainActivity.ACTION_SCREENSHOT_RESULT) + putExtra(MainActivity.EXTRA_SCREENSHOT_PATH, path) + putExtra(MainActivity.EXTRA_SCREENSHOT_SESSION_ID, sessionId) + }) + true + } catch (_: Exception) { + File(path).delete() + notifyFailure(context, "\u622A\u56FE\u5DF2\u5B8C\u6210\uFF0C\u4F46\u7CFB\u7EDF\u963B\u6B62\u6253\u5F00\u8BC6\u522B\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5") + false + } + } + + fun notifyFailure(context: Context, message: String) { + Handler(Looper.getMainLooper()).post { + Toast.makeText(context.applicationContext, message, Toast.LENGTH_LONG).show() + } + } + + fun errorIntent(context: Context, message: String): Intent { + return Intent(context, MainActivity::class.java).apply { + addFlags( + Intent.FLAG_ACTIVITY_NEW_TASK or + Intent.FLAG_ACTIVITY_CLEAR_TOP or + Intent.FLAG_ACTIVITY_SINGLE_TOP, + ) + putExtra(MainActivity.EXTRA_ACTION, MainActivity.ACTION_SCREENSHOT_ERROR) + putExtra(MainActivity.EXTRA_SCREENSHOT_ERROR, message) + } + } + + private const val MIN_IMAGE_BYTES = 1024L +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotTileService.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotTileService.kt new file mode 100644 index 0000000..b2e8a5c --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotTileService.kt @@ -0,0 +1,49 @@ +package com.nx.miaoji + +import android.app.PendingIntent +import android.content.Intent +import android.os.Build +import android.service.quicksettings.TileService +import android.util.Log + +class ScreenshotTileService : TileService() { + override fun onClick() { + super.onClick() + val accessibilityCapture = ScreenshotAccessibilityService.isConnected + Log.i(TAG, "Tile clicked accessibilityConnected=$accessibilityCapture") + + val intent = Intent(this, ProjectionConsentActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + putExtra( + ProjectionConsentActivity.EXTRA_ACCESSIBILITY_CAPTURE, + accessibilityCapture, + ) + } + + try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + val pendingIntent = PendingIntent.getActivity( + this, + 1001, + intent, + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE, + ) + startActivityAndCollapse(pendingIntent) + } else { + @Suppress("DEPRECATION") + startActivityAndCollapse(intent) + } + } catch (e: Exception) { + Log.e(TAG, "Unable to launch screenshot flow", e) + try { + startActivity(intent) + } catch (fallback: Exception) { + Log.e(TAG, "Unable to launch screenshot fallback", fallback) + } + } + } + + companion object { + private const val TAG = "MiaoJiScreenshot" + } +} diff --git a/frontend/android/app/src/main/kotlin/com/nx/miaoji/UpdateInstallBridge.kt b/frontend/android/app/src/main/kotlin/com/nx/miaoji/UpdateInstallBridge.kt new file mode 100644 index 0000000..95a0eda --- /dev/null +++ b/frontend/android/app/src/main/kotlin/com/nx/miaoji/UpdateInstallBridge.kt @@ -0,0 +1,234 @@ +package com.nx.miaoji + +import android.content.Intent +import android.content.pm.PackageInfo +import android.content.pm.PackageManager +import android.net.Uri +import android.os.Build +import android.provider.Settings +import androidx.core.content.FileProvider +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import java.io.File +import java.security.MessageDigest + +class UpdateInstallBridge(private val activity: MainActivity) : MethodChannel.MethodCallHandler { + companion object { + private const val CHANNEL = "com.nx.miaoji/update" + private const val APK_MIME = "application/vnd.android.package-archive" + private const val CLEANUP_DELAY_MS = 10L * 60L * 1000L + } + + private data class PendingInstall(val path: String, val expectedBuild: Long) + private data class Inspection(val valid: Boolean, val message: String) + + private var pendingInstall: PendingInstall? = null + private var returningFromPermissionSettings = false + + fun register(engine: FlutterEngine) { + MethodChannel(engine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler(this) + } + + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { + when (call.method) { + "inspectApk" -> { + val path = call.argument("path").orEmpty() + val expectedBuild = call.numberArgument("expectedBuild") + val inspection = inspect(path, expectedBuild) + result.success( + mapOf( + "valid" to inspection.valid, + "message" to inspection.message, + ), + ) + } + "installApk" -> install(call, result) + else -> result.notImplemented() + } + } + + fun onResume() { + if (!returningFromPermissionSettings) return + returningFromPermissionSettings = false + val pending = pendingInstall ?: return + if (canInstallPackages()) { + pendingInstall = null + launchInstaller(File(pending.path)) + } + } + + fun dispose() { + pendingInstall = null + } + + private fun install(call: MethodCall, result: MethodChannel.Result) { + if (!isInternalPackage()) { + result.success(mapOf("status" to "unsupported")) + return + } + val path = call.argument("path").orEmpty() + val expectedBuild = call.numberArgument("expectedBuild") + val inspection = inspect(path, expectedBuild) + if (!inspection.valid) { + result.error("INVALID_APK", inspection.message, null) + return + } + if (!canInstallPackages()) { + pendingInstall = PendingInstall(path, expectedBuild) + returningFromPermissionSettings = true + try { + activity.startActivity( + Intent( + Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, + Uri.parse("package:${activity.packageName}"), + ), + ) + result.success(mapOf("status" to "permission_requested")) + } catch (error: Exception) { + pendingInstall = null + returningFromPermissionSettings = false + result.error("PERMISSION_ERROR", error.message, null) + } + return + } + if (launchInstaller(File(path))) { + result.success(mapOf("status" to "launched")) + } else { + result.success(mapOf("status" to "unsupported")) + } + } + + private fun inspect(path: String, expectedBuild: Long): Inspection { + if (!isInternalPackage()) { + return Inspection(false, "正式版不支持应用内安装") + } + val current = currentPackageInfo() + ?: return Inspection(false, "无法读取当前应用信息") + if (expectedBuild <= versionCode(current)) { + return Inspection(false, "目标版本号必须高于当前版本") + } + val file = File(path) + if (!file.isFile || file.length() <= 0L) { + return Inspection(false, "更新包文件不存在或为空") + } + val updateRoot = File(activity.cacheDir, "updates").canonicalFile + val canonical = file.canonicalFile + if (!canonical.path.startsWith(updateRoot.path + File.separator)) { + return Inspection(false, "更新包不在应用私有目录中") + } + val archive = packageArchiveInfo(canonical.path) + ?: return Inspection(false, "无法读取更新包信息") + if (archive.packageName != activity.packageName) { + return Inspection(false, "更新包包名与当前内测版不一致") + } + if (versionCode(archive) != expectedBuild) { + return Inspection(false, "更新包版本号与发布记录不一致") + } + val currentSigners = signerDigests(current) + val archiveSigners = signerDigests(archive) + if (currentSigners.isEmpty() || currentSigners != archiveSigners) { + return Inspection(false, "更新包签名与当前应用不一致") + } + return Inspection(true, "校验通过") + } + + private fun packageArchiveInfo(path: String): PackageInfo? { + val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + PackageManager.GET_SIGNING_CERTIFICATES + } else { + @Suppress("DEPRECATION") + PackageManager.GET_SIGNATURES + } + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + activity.packageManager.getPackageArchiveInfo( + path, + PackageManager.PackageInfoFlags.of(flags.toLong()), + ) + } else { + @Suppress("DEPRECATION") + activity.packageManager.getPackageArchiveInfo(path, flags) + } + } + + private fun currentPackageInfo(): PackageInfo? { + val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + PackageManager.GET_SIGNING_CERTIFICATES + } else { + @Suppress("DEPRECATION") + PackageManager.GET_SIGNATURES + } + return try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + activity.packageManager.getPackageInfo( + activity.packageName, + PackageManager.PackageInfoFlags.of(flags.toLong()), + ) + } else { + @Suppress("DEPRECATION") + activity.packageManager.getPackageInfo(activity.packageName, flags) + } + } catch (_: PackageManager.NameNotFoundException) { + null + } + } + + private fun signerDigests(info: PackageInfo): Set { + val signatures = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + val signingInfo = info.signingInfo ?: return emptySet() + if (signingInfo.hasMultipleSigners()) { + signingInfo.apkContentsSigners + } else { + signingInfo.signingCertificateHistory + } + } else { + @Suppress("DEPRECATION") + info.signatures ?: emptyArray() + } + return signatures + .map { signature -> + MessageDigest.getInstance("SHA-256") + .digest(signature.toByteArray()) + .joinToString("") { byte -> "%02x".format(byte) } + } + .toSet() + } + + private fun versionCode(info: PackageInfo): Long = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + info.longVersionCode + } else { + @Suppress("DEPRECATION") + info.versionCode.toLong() + } + + private fun isInternalPackage(): Boolean = + activity.packageName == "com.nx.miaoji.internal" + + private fun canInstallPackages(): Boolean = + Build.VERSION.SDK_INT < Build.VERSION_CODES.O || + activity.packageManager.canRequestPackageInstalls() + + private fun launchInstaller(file: File): Boolean { + return try { + val uri = FileProvider.getUriForFile( + activity, + "${activity.packageName}.update.files", + file, + ) + val intent = Intent(Intent.ACTION_VIEW).apply { + setDataAndType(uri, APK_MIME) + addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + } + activity.startActivity(intent) + activity.window.decorView.postDelayed({ file.delete() }, CLEANUP_DELAY_MS) + true + } catch (_: Exception) { + false + } + } + + private fun MethodCall.numberArgument(name: String): Long = + (argument(name))?.toLong() ?: -1L +} \ No newline at end of file diff --git a/frontend/android/app/src/main/res/drawable-hdpi/jizhi_launch_icon.png b/frontend/android/app/src/main/res/drawable-hdpi/jizhi_launch_icon.png new file mode 100644 index 0000000..a5772e1 Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-hdpi/jizhi_launch_icon.png differ diff --git a/frontend/android/app/src/main/res/drawable-mdpi/jizhi_launch_icon.png b/frontend/android/app/src/main/res/drawable-mdpi/jizhi_launch_icon.png new file mode 100644 index 0000000..81b8573 Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-mdpi/jizhi_launch_icon.png differ diff --git a/frontend/android/app/src/main/res/drawable-night-v21/launch_background.xml b/frontend/android/app/src/main/res/drawable-night-v21/launch_background.xml new file mode 100644 index 0000000..3ef222d --- /dev/null +++ b/frontend/android/app/src/main/res/drawable-night-v21/launch_background.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/frontend/android/app/src/main/res/drawable-night/launch_background.xml b/frontend/android/app/src/main/res/drawable-night/launch_background.xml new file mode 100644 index 0000000..3ef222d --- /dev/null +++ b/frontend/android/app/src/main/res/drawable-night/launch_background.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_foreground.png b/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_foreground.png new file mode 100644 index 0000000..0ea7666 Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_foreground.png differ diff --git a/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_icon.png b/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_icon.png new file mode 100644 index 0000000..eeedf8c Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_icon.png differ diff --git a/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_monochrome.png b/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_monochrome.png new file mode 100644 index 0000000..285759b Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-nodpi/jizhi_app_monochrome.png differ diff --git a/frontend/android/app/src/main/res/drawable-v21/launch_background.xml b/frontend/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..dfbc285 --- /dev/null +++ b/frontend/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/frontend/android/app/src/main/res/drawable-xhdpi/jizhi_launch_icon.png b/frontend/android/app/src/main/res/drawable-xhdpi/jizhi_launch_icon.png new file mode 100644 index 0000000..692c1a1 Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-xhdpi/jizhi_launch_icon.png differ diff --git a/frontend/android/app/src/main/res/drawable-xxhdpi/jizhi_launch_icon.png b/frontend/android/app/src/main/res/drawable-xxhdpi/jizhi_launch_icon.png new file mode 100644 index 0000000..b94460c Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-xxhdpi/jizhi_launch_icon.png differ diff --git a/frontend/android/app/src/main/res/drawable-xxxhdpi/jizhi_launch_icon.png b/frontend/android/app/src/main/res/drawable-xxxhdpi/jizhi_launch_icon.png new file mode 100644 index 0000000..5e357c7 Binary files /dev/null and b/frontend/android/app/src/main/res/drawable-xxxhdpi/jizhi_launch_icon.png differ diff --git a/frontend/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/frontend/android/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..8f5166c --- /dev/null +++ b/frontend/android/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,5 @@ + + + diff --git a/frontend/android/app/src/main/res/drawable/ic_launcher_monochrome.xml b/frontend/android/app/src/main/res/drawable/ic_launcher_monochrome.xml new file mode 100644 index 0000000..efade6f --- /dev/null +++ b/frontend/android/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -0,0 +1,5 @@ + + + diff --git a/frontend/android/app/src/main/res/drawable/launch_background.xml b/frontend/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..dfbc285 --- /dev/null +++ b/frontend/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/frontend/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/frontend/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..08c8806 --- /dev/null +++ b/frontend/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/frontend/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..08c8806 --- /dev/null +++ b/frontend/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/frontend/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml new file mode 100644 index 0000000..d159bc7 --- /dev/null +++ b/frontend/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/frontend/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher_round.xml b/frontend/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher_round.xml new file mode 100644 index 0000000..eb38fd1 --- /dev/null +++ b/frontend/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher_round.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..60b6b6f Binary files /dev/null and b/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..5b80de8 Binary files /dev/null and b/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..8905ea5 Binary files /dev/null and b/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..631bd86 Binary files /dev/null and b/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/frontend/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/frontend/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..d4b0937 Binary files /dev/null and b/frontend/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/frontend/android/app/src/main/res/values-night-v31/styles.xml b/frontend/android/app/src/main/res/values-night-v31/styles.xml new file mode 100644 index 0000000..f89b807 --- /dev/null +++ b/frontend/android/app/src/main/res/values-night-v31/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/frontend/android/app/src/main/res/values-night/styles.xml b/frontend/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..360a160 --- /dev/null +++ b/frontend/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/frontend/android/app/src/main/res/values-v31/styles.xml b/frontend/android/app/src/main/res/values-v31/styles.xml new file mode 100644 index 0000000..5ff1a1b --- /dev/null +++ b/frontend/android/app/src/main/res/values-v31/styles.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/frontend/android/app/src/main/res/values/colors.xml b/frontend/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..659ffe6 --- /dev/null +++ b/frontend/android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + diff --git a/frontend/android/app/src/main/res/values/strings.xml b/frontend/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..95c38d8 --- /dev/null +++ b/frontend/android/app/src/main/res/values/strings.xml @@ -0,0 +1,7 @@ + + + 记之 + 截屏记账 + 记之通知识别 + 用于用户主动开启的微信、支付宝账单识别,以及截屏记账磁贴的免授权截图。仅在支持的支付应用中读取当前页面可见文字,不记录完整控件树,不监听或拦截按键。 + diff --git a/frontend/android/app/src/main/res/values/styles.xml b/frontend/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cd4f3da --- /dev/null +++ b/frontend/android/app/src/main/res/values/styles.xml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/frontend/android/app/src/main/res/xml/accessibility_service_config.xml b/frontend/android/app/src/main/res/xml/accessibility_service_config.xml new file mode 100644 index 0000000..e96822b --- /dev/null +++ b/frontend/android/app/src/main/res/xml/accessibility_service_config.xml @@ -0,0 +1,10 @@ + + diff --git a/frontend/android/app/src/main/res/xml/network_security_config.xml b/frontend/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..7ab50ef --- /dev/null +++ b/frontend/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/frontend/android/app/src/profile/AndroidManifest.xml b/frontend/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..8ffe024 --- /dev/null +++ b/frontend/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/frontend/android/app/src/test/kotlin/com/nx/miaoji/PaymentParserTest.kt b/frontend/android/app/src/test/kotlin/com/nx/miaoji/PaymentParserTest.kt new file mode 100644 index 0000000..054306b --- /dev/null +++ b/frontend/android/app/src/test/kotlin/com/nx/miaoji/PaymentParserTest.kt @@ -0,0 +1,257 @@ +package com.nx.miaoji + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class PaymentParserTest { + @Test + fun explicitSuccessStatusesKeepDirection() { + assertEquals("expense", PaymentParser.detectDirection("扫码支付成功")) + assertEquals("expense", PaymentParser.detectDirection("转账已完成")) + assertEquals("income", PaymentParser.detectDirection("收款已到账")) + assertEquals("income", PaymentParser.detectDirection("退款成功")) + } + + @Test + fun blockedAndHistoryPagesNeverBecomePaymentSuccess() { + assertNull(PaymentParser.detectDirection("支付处理中")) + assertTrue(PaymentParser.containsBlockedStatus("等待对方收款")) + assertTrue(PaymentParser.isHistoryPageText("账单详情\n支付成功\n¥88.00")) + assertFalse(PaymentParser.isHistoryPageText("支付成功\n¥88.00")) + } + + @Test + fun amountsRequireCurrencyUnitOrDecimalForBareValues() { + assertEquals(88.0, PaymentParser.parseAmountCandidate("¥88.00")!!, 0.001) + assertEquals(12.5, PaymentParser.parseAmountCandidate("实付:12.50")!!, 0.001) + assertEquals(9.9, PaymentParser.parseAmountCandidate("9.90")!!, 0.001) + assertNull(PaymentParser.parseAmountCandidate("100")) + } + + @Test + fun paymentFlowContextIsSeparateFromSuccess() { + assertTrue(PaymentParser.hasPaymentAction("确认转账")) + assertTrue(PaymentParser.hasPaymentContext("收款方:张三\n付款金额 ¥20")) + assertNull(PaymentParser.detectDirection("确认转账\n付款金额 ¥20")) + } + + @Test + fun spacedAndWeakCompletionStatusesAreClassified() { + val strong = PaymentParser.detectStatus("转 账 成 功") + assertEquals(PaymentStatusStrength.STRONG, strong.strength) + assertEquals("expense", strong.direction) + + val weak = PaymentParser.detectStatus("完成", fallbackDirection = "expense") + assertEquals(PaymentStatusStrength.WEAK, weak.strength) + assertEquals("expense", weak.direction) + } + + @Test + fun weakCompletionNeedsFullCombinedEvidenceForAutomaticImport() { + assertTrue( + OcrEvidenceEvaluator.qualifiesWeakAuto( + trustedFlow = true, + freshScreenshot = true, + uniqueAmount = true, + expectedAmountMatched = true, + resultTransitionObserved = true, + directionKnown = true, + ), + ) + assertFalse( + OcrEvidenceEvaluator.qualifiesWeakAuto( + trustedFlow = true, + freshScreenshot = true, + uniqueAmount = true, + expectedAmountMatched = false, + resultTransitionObserved = true, + directionKnown = true, + ), + ) + assertFalse( + OcrEvidenceEvaluator.qualifiesWeakAuto( + trustedFlow = true, + freshScreenshot = true, + uniqueAmount = true, + expectedAmountMatched = true, + resultTransitionObserved = false, + directionKnown = true, + ), + ) + } + + @Test + fun weakUiTreeSignalFallsBackToConfirmationWhenEvidenceIsIncomplete() { + val automatic = PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "完成\n¥20.00", + eventTime = 1L, + windowId = 7, + flowSessionId = "flow-a", + trustedFlow = true, + expectedAmountCents = 2_000L, + expectedType = "expense", + resultTransitionObserved = true, + submittedFlow = true, + ) + assertEquals("high", automatic?.evidenceConfidence) + + val confirmation = PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "完成\n¥20.00", + eventTime = 1L, + windowId = 7, + flowSessionId = "flow-b", + trustedFlow = true, + expectedAmountCents = 3_000L, + expectedType = "expense", + resultTransitionObserved = true, + ) + assertEquals("confirm", confirmation?.evidenceConfidence) + } + + @Test + fun paymentInputAndAmbiguousAmountsAreRejected() { + assertTrue(PaymentParser.isPaymentInputPage("请输入支付密码\n确认转账")) + assertEquals(2_000L, PaymentParser.uniqueAmountCents("付款金额 ¥20.00\n¥20.00")) + assertNull(PaymentParser.uniqueAmountCents("¥20.00\n优惠 ¥2.00")) + } + + @Test + fun diagnosticPreviewMasksSensitiveValuesAndLimitsLines() { + val preview = OcrDiagnosticRedactor.redact( + listOf( + "转账成功", + "转账给:丁伊文", + "付款金额 ¥20.00", + "手机号 13607268374", + "订单号:202607221234567890", + ) + List(20) { "其他文字 $it" }, + ) + val joined = preview.joinToString("\n") + assertTrue(preview.size <= 12) + assertTrue(joined.contains("转账成功")) + assertTrue(joined.contains("¥20.00")) + assertFalse(joined.contains("丁伊文")) + assertFalse(joined.contains("13607268374")) + assertFalse(joined.contains("202607221234567890")) + } + @Test + fun paymentResultWithoutAmountUsesSubmittedFlowAmount() { + val signal = PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "支付成功", + eventTime = 1L, + windowId = 8, + flowSessionId = "payment-flow", + trustedFlow = true, + expectedAmountCents = 1_880L, + expectedType = "expense", + resultTransitionObserved = true, + submittedFlow = true, + flowKind = "payment", + ) + + assertEquals(1_880L, signal?.amountCents) + assertEquals("expense", signal?.type) + assertEquals("expected", signal?.amountSource) + assertEquals("high", signal?.evidenceConfidence) + } + + @Test + fun paymentAmountFallbackRequiresSubmissionAndTransition() { + val signal = PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "支付成功", + eventTime = 1L, + windowId = 8, + flowSessionId = "payment-flow", + trustedFlow = true, + expectedAmountCents = 1_880L, + expectedType = "expense", + resultTransitionObserved = true, + submittedFlow = false, + flowKind = "payment", + ) + + assertNull(signal) + } + + @Test + fun redPacketLifecycleUsesCorrectDirectionAndCategory() { + val sent = PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "红包已发送", + eventTime = 1L, + windowId = 9, + flowSessionId = "red-packet-flow", + trustedFlow = true, + expectedAmountCents = 2_000L, + expectedType = "expense", + resultTransitionObserved = true, + submittedFlow = true, + flowKind = "red_packet_send", + ) + val received = PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "红包已存入零钱\n¥8.88", + eventTime = 2L, + windowId = 10, + ) + val refunded = PaymentParser.fromAccessibility( + packageName = PaymentParser.ALIPAY, + text = "红包退回到账\n到账金额 6.66", + eventTime = 3L, + windowId = 11, + ) + + assertEquals("red_packet_send", sent?.recognitionKind) + assertEquals("expense", sent?.type) + assertEquals("人情", sent?.categoryHint) + assertEquals("expected", sent?.amountSource) + assertEquals("high", sent?.evidenceConfidence) + + assertEquals("red_packet_receive", received?.recognitionKind) + assertEquals("income", received?.type) + assertEquals("红包", received?.categoryHint) + assertEquals("high", received?.evidenceConfidence) + + assertEquals("red_packet_refund", refunded?.recognitionKind) + assertEquals("income", refunded?.type) + assertEquals("红包", refunded?.categoryHint) + } + + @Test + fun ordinaryAndUnsettledRedPacketSurfacesAreIgnored() { + assertNull( + PaymentParser.fromAccessibility( + packageName = PaymentParser.WECHAT, + text = "领取红包\n¥8.88", + eventTime = 1L, + windowId = 12, + ), + ) + assertNull(PaymentParser.detectDirection("恭喜发财,点击领取红包")) + assertTrue(PaymentParser.isPendingRedPacketSurface("红包已被领完")) + } + + @Test + fun diagnosticPreviewKeepsRedPacketStateButMasksIdentity() { + val preview = OcrDiagnosticRedactor.redact( + listOf( + "红包已存入零钱", + "红包金额 ¥18.88", + "收款方:丁伊文", + "订单号:202607221234567890", + ), + ).joinToString("\n") + + assertTrue(preview.contains("红包已存入零钱")) + assertTrue(preview.contains("¥18.88")) + assertFalse(preview.contains("丁伊文")) + assertFalse(preview.contains("202607221234567890")) + } +} diff --git a/frontend/android/build.gradle.kts b/frontend/android/build.gradle.kts new file mode 100644 index 0000000..1f88145 --- /dev/null +++ b/frontend/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/frontend/android/gradle.properties b/frontend/android/gradle.properties new file mode 100644 index 0000000..e76c87b --- /dev/null +++ b/frontend/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx2G -XX:MaxMetaspaceSize=768m -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/frontend/android/gradle/wrapper/gradle-wrapper.jar b/frontend/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..13372ae Binary files /dev/null and b/frontend/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/frontend/android/gradle/wrapper/gradle-wrapper.properties b/frontend/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..db3f453 --- /dev/null +++ b/frontend/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/frontend/android/gradlew b/frontend/android/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/frontend/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/frontend/android/gradlew.bat b/frontend/android/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/frontend/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/frontend/android/key.properties.example b/frontend/android/key.properties.example new file mode 100644 index 0000000..74de48c --- /dev/null +++ b/frontend/android/key.properties.example @@ -0,0 +1,5 @@ +storePassword=replace-me +keyPassword=replace-me +keyAlias=miaoji-release +storeFile=C:/Users/your-name/.android/keystores/miaoji-release.p12 +storeType=PKCS12 \ No newline at end of file diff --git a/frontend/android/settings.gradle.kts b/frontend/android/settings.gradle.kts new file mode 100644 index 0000000..4dcef4b --- /dev/null +++ b/frontend/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/frontend/assets/branding/jizhi-app-icon-1024.png b/frontend/assets/branding/jizhi-app-icon-1024.png new file mode 100644 index 0000000..fbb3973 Binary files /dev/null and b/frontend/assets/branding/jizhi-app-icon-1024.png differ diff --git a/frontend/assets/branding/jizhi-app-icon-centered.png b/frontend/assets/branding/jizhi-app-icon-centered.png new file mode 100644 index 0000000..eeedf8c Binary files /dev/null and b/frontend/assets/branding/jizhi-app-icon-centered.png differ diff --git a/frontend/assets/branding/jizhi-icon-source.png b/frontend/assets/branding/jizhi-icon-source.png new file mode 100644 index 0000000..fc45d04 Binary files /dev/null and b/frontend/assets/branding/jizhi-icon-source.png differ diff --git a/frontend/assets/icons/i-baby.svg b/frontend/assets/icons/i-baby.svg new file mode 100644 index 0000000..998cbb4 --- /dev/null +++ b/frontend/assets/icons/i-baby.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-beauty.svg b/frontend/assets/icons/i-beauty.svg new file mode 100644 index 0000000..04bbc62 --- /dev/null +++ b/frontend/assets/icons/i-beauty.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-bell.svg b/frontend/assets/icons/i-bell.svg new file mode 100644 index 0000000..1c96a11 --- /dev/null +++ b/frontend/assets/icons/i-bell.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-book.svg b/frontend/assets/icons/i-book.svg new file mode 100644 index 0000000..a1d033c --- /dev/null +++ b/frontend/assets/icons/i-book.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-briefcase.svg b/frontend/assets/icons/i-briefcase.svg new file mode 100644 index 0000000..641ef65 --- /dev/null +++ b/frontend/assets/icons/i-briefcase.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-camera.svg b/frontend/assets/icons/i-camera.svg new file mode 100644 index 0000000..ac0735c --- /dev/null +++ b/frontend/assets/icons/i-camera.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-car.svg b/frontend/assets/icons/i-car.svg new file mode 100644 index 0000000..d294b45 --- /dev/null +++ b/frontend/assets/icons/i-car.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-card.svg b/frontend/assets/icons/i-card.svg new file mode 100644 index 0000000..b693e35 --- /dev/null +++ b/frontend/assets/icons/i-card.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-cart.svg b/frontend/assets/icons/i-cart.svg new file mode 100644 index 0000000..733ea66 --- /dev/null +++ b/frontend/assets/icons/i-cart.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-cat.svg b/frontend/assets/icons/i-cat.svg new file mode 100644 index 0000000..6572c94 --- /dev/null +++ b/frontend/assets/icons/i-cat.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-chart.svg b/frontend/assets/icons/i-chart.svg new file mode 100644 index 0000000..972f159 --- /dev/null +++ b/frontend/assets/icons/i-chart.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-chat.svg b/frontend/assets/icons/i-chat.svg new file mode 100644 index 0000000..0fcdf4e --- /dev/null +++ b/frontend/assets/icons/i-chat.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-check.svg b/frontend/assets/icons/i-check.svg new file mode 100644 index 0000000..e152ede --- /dev/null +++ b/frontend/assets/icons/i-check.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-chev-d.svg b/frontend/assets/icons/i-chev-d.svg new file mode 100644 index 0000000..a6d39ef --- /dev/null +++ b/frontend/assets/icons/i-chev-d.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-chev-r.svg b/frontend/assets/icons/i-chev-r.svg new file mode 100644 index 0000000..a017e08 --- /dev/null +++ b/frontend/assets/icons/i-chev-r.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-close.svg b/frontend/assets/icons/i-close.svg new file mode 100644 index 0000000..ae76405 --- /dev/null +++ b/frontend/assets/icons/i-close.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-cloud.svg b/frontend/assets/icons/i-cloud.svg new file mode 100644 index 0000000..4d45925 --- /dev/null +++ b/frontend/assets/icons/i-cloud.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-cup.svg b/frontend/assets/icons/i-cup.svg new file mode 100644 index 0000000..7d82eac --- /dev/null +++ b/frontend/assets/icons/i-cup.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-dog.svg b/frontend/assets/icons/i-dog.svg new file mode 100644 index 0000000..5595cc4 --- /dev/null +++ b/frontend/assets/icons/i-dog.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-drag.svg b/frontend/assets/icons/i-drag.svg new file mode 100644 index 0000000..3cf179d --- /dev/null +++ b/frontend/assets/icons/i-drag.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-edit.svg b/frontend/assets/icons/i-edit.svg new file mode 100644 index 0000000..f9f7d4a --- /dev/null +++ b/frontend/assets/icons/i-edit.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-export.svg b/frontend/assets/icons/i-export.svg new file mode 100644 index 0000000..8959738 --- /dev/null +++ b/frontend/assets/icons/i-export.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-eye.svg b/frontend/assets/icons/i-eye.svg new file mode 100644 index 0000000..5d83b7e --- /dev/null +++ b/frontend/assets/icons/i-eye.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-fire.svg b/frontend/assets/icons/i-fire.svg new file mode 100644 index 0000000..8866310 --- /dev/null +++ b/frontend/assets/icons/i-fire.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-food.svg b/frontend/assets/icons/i-food.svg new file mode 100644 index 0000000..0161945 --- /dev/null +++ b/frontend/assets/icons/i-food.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-game.svg b/frontend/assets/icons/i-game.svg new file mode 100644 index 0000000..6bb261a --- /dev/null +++ b/frontend/assets/icons/i-game.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-gear.svg b/frontend/assets/icons/i-gear.svg new file mode 100644 index 0000000..63e06da --- /dev/null +++ b/frontend/assets/icons/i-gear.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-gift.svg b/frontend/assets/icons/i-gift.svg new file mode 100644 index 0000000..d4c90e5 --- /dev/null +++ b/frontend/assets/icons/i-gift.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-home.svg b/frontend/assets/icons/i-home.svg new file mode 100644 index 0000000..edd4b0d --- /dev/null +++ b/frontend/assets/icons/i-home.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-house.svg b/frontend/assets/icons/i-house.svg new file mode 100644 index 0000000..6b35bee --- /dev/null +++ b/frontend/assets/icons/i-house.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-interest.svg b/frontend/assets/icons/i-interest.svg new file mode 100644 index 0000000..7629f03 --- /dev/null +++ b/frontend/assets/icons/i-interest.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-metro.svg b/frontend/assets/icons/i-metro.svg new file mode 100644 index 0000000..ff0ecd4 --- /dev/null +++ b/frontend/assets/icons/i-metro.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-mic.svg b/frontend/assets/icons/i-mic.svg new file mode 100644 index 0000000..1374661 --- /dev/null +++ b/frontend/assets/icons/i-mic.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-money.svg b/frontend/assets/icons/i-money.svg new file mode 100644 index 0000000..df97bf3 --- /dev/null +++ b/frontend/assets/icons/i-money.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-offline.svg b/frontend/assets/icons/i-offline.svg new file mode 100644 index 0000000..9122288 --- /dev/null +++ b/frontend/assets/icons/i-offline.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-pet.svg b/frontend/assets/icons/i-pet.svg new file mode 100644 index 0000000..40fb73c --- /dev/null +++ b/frontend/assets/icons/i-pet.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-phone.svg b/frontend/assets/icons/i-phone.svg new file mode 100644 index 0000000..e278d1e --- /dev/null +++ b/frontend/assets/icons/i-phone.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-pill.svg b/frontend/assets/icons/i-pill.svg new file mode 100644 index 0000000..9f276a8 --- /dev/null +++ b/frontend/assets/icons/i-pill.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-plane.svg b/frontend/assets/icons/i-plane.svg new file mode 100644 index 0000000..f9238ef --- /dev/null +++ b/frontend/assets/icons/i-plane.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-plus.svg b/frontend/assets/icons/i-plus.svg new file mode 100644 index 0000000..babef5d --- /dev/null +++ b/frontend/assets/icons/i-plus.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-receipt.svg b/frontend/assets/icons/i-receipt.svg new file mode 100644 index 0000000..c9adf10 --- /dev/null +++ b/frontend/assets/icons/i-receipt.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-refund.svg b/frontend/assets/icons/i-refund.svg new file mode 100644 index 0000000..84124dc --- /dev/null +++ b/frontend/assets/icons/i-refund.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-rent.svg b/frontend/assets/icons/i-rent.svg new file mode 100644 index 0000000..44b7a2f --- /dev/null +++ b/frontend/assets/icons/i-rent.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-robot.svg b/frontend/assets/icons/i-robot.svg new file mode 100644 index 0000000..87de172 --- /dev/null +++ b/frontend/assets/icons/i-robot.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-scan.svg b/frontend/assets/icons/i-scan.svg new file mode 100644 index 0000000..92d01d4 --- /dev/null +++ b/frontend/assets/icons/i-scan.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-search.svg b/frontend/assets/icons/i-search.svg new file mode 100644 index 0000000..e0c5f0d --- /dev/null +++ b/frontend/assets/icons/i-search.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-shield.svg b/frontend/assets/icons/i-shield.svg new file mode 100644 index 0000000..cd66676 --- /dev/null +++ b/frontend/assets/icons/i-shield.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-shirt.svg b/frontend/assets/icons/i-shirt.svg new file mode 100644 index 0000000..61af09f --- /dev/null +++ b/frontend/assets/icons/i-shirt.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-smile.svg b/frontend/assets/icons/i-smile.svg new file mode 100644 index 0000000..d4270b0 --- /dev/null +++ b/frontend/assets/icons/i-smile.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-sparkle.svg b/frontend/assets/icons/i-sparkle.svg new file mode 100644 index 0000000..bcf7e9f --- /dev/null +++ b/frontend/assets/icons/i-sparkle.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-sport.svg b/frontend/assets/icons/i-sport.svg new file mode 100644 index 0000000..dc59458 --- /dev/null +++ b/frontend/assets/icons/i-sport.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-swap.svg b/frontend/assets/icons/i-swap.svg new file mode 100644 index 0000000..f74fee7 --- /dev/null +++ b/frontend/assets/icons/i-swap.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-tag.svg b/frontend/assets/icons/i-tag.svg new file mode 100644 index 0000000..ae1bb8e --- /dev/null +++ b/frontend/assets/icons/i-tag.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-target.svg b/frontend/assets/icons/i-target.svg new file mode 100644 index 0000000..8b27b93 --- /dev/null +++ b/frontend/assets/icons/i-target.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-tax.svg b/frontend/assets/icons/i-tax.svg new file mode 100644 index 0000000..33c60e8 --- /dev/null +++ b/frontend/assets/icons/i-tax.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-trash.svg b/frontend/assets/icons/i-trash.svg new file mode 100644 index 0000000..44c65cc --- /dev/null +++ b/frontend/assets/icons/i-trash.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-user.svg b/frontend/assets/icons/i-user.svg new file mode 100644 index 0000000..2d754b7 --- /dev/null +++ b/frontend/assets/icons/i-user.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-wallet.svg b/frontend/assets/icons/i-wallet.svg new file mode 100644 index 0000000..9cfac21 --- /dev/null +++ b/frontend/assets/icons/i-wallet.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-wave.svg b/frontend/assets/icons/i-wave.svg new file mode 100644 index 0000000..e20f46b --- /dev/null +++ b/frontend/assets/icons/i-wave.svg @@ -0,0 +1 @@ + diff --git a/frontend/assets/icons/i-wifi.svg b/frontend/assets/icons/i-wifi.svg new file mode 100644 index 0000000..f8cbf37 --- /dev/null +++ b/frontend/assets/icons/i-wifi.svg @@ -0,0 +1 @@ + diff --git a/frontend/integration_test/sse_test.dart b/frontend/integration_test/sse_test.dart new file mode 100644 index 0000000..d5d9759 --- /dev/null +++ b/frontend/integration_test/sse_test.dart @@ -0,0 +1,59 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + const enabled = bool.fromEnvironment('RUN_LIVE_SSE_TEST'); + const baseUrl = String.fromEnvironment('LIVE_API_BASE_URL'); + const username = String.fromEnvironment('LIVE_TEST_USERNAME'); + const password = String.fromEnvironment('LIVE_TEST_PASSWORD'); + + test('live SSE streams to completion when explicitly enabled', () async { + if (!enabled) return; + expect(baseUrl, isNotEmpty, reason: 'LIVE_API_BASE_URL is required'); + expect(username, isNotEmpty, reason: 'LIVE_TEST_USERNAME is required'); + expect(password, isNotEmpty, reason: 'LIVE_TEST_PASSWORD is required'); + + final dio = Dio( + BaseOptions( + baseUrl: baseUrl, + connectTimeout: const Duration(seconds: 10), + ), + ); + final login = await dio.post>( + '/api/auth/login', + data: {'username': username, 'password': password}, + ); + final token = login.data!['token'] as String; + + final client = HttpClient() + ..connectionTimeout = const Duration(seconds: 10); + addTearDown(() => client.close(force: true)); + + final request = await client.postUrl( + Uri.parse('$baseUrl/api/chat/messages/stream'), + ); + request.headers.set('content-type', 'application/json; charset=utf-8'); + request.headers.set('authorization', 'Bearer $token'); + request.add(utf8.encode(jsonEncode({'content': '你好'}))); + + final response = await request.close(); + expect(response.statusCode, HttpStatus.ok); + + var completed = false; + await for (final line + in response.transform(utf8.decoder).transform(const LineSplitter())) { + if (!line.startsWith('data: ')) continue; + final event = jsonDecode(line.substring(6)); + if (event is Map && event['done'] == true) { + completed = true; + } + } + expect(completed, isTrue); + }); +} diff --git a/frontend/ios/.gitignore b/frontend/ios/.gitignore new file mode 100644 index 0000000..ad322bc --- /dev/null +++ b/frontend/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/frontend/ios/Flutter/AppFrameworkInfo.plist b/frontend/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..256cf28 --- /dev/null +++ b/frontend/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/frontend/ios/Flutter/Debug.xcconfig b/frontend/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..0b2d479 --- /dev/null +++ b/frontend/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/frontend/ios/Flutter/Release.xcconfig b/frontend/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..0b2d479 --- /dev/null +++ b/frontend/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/frontend/ios/Runner.xcodeproj/project.pbxproj b/frontend/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a76fd54 --- /dev/null +++ b/frontend/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,620 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nx.miaoji; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.nx.miaoji.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.nx.miaoji.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.nx.miaoji.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nx.miaoji; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nx.miaoji; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/frontend/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/frontend/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c4b79bd --- /dev/null +++ b/frontend/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/frontend/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frontend/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/frontend/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/frontend/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/frontend/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..af0309c --- /dev/null +++ b/frontend/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/frontend/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/frontend/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..bbabc4e --- /dev/null +++ b/frontend/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/ios/Runner.xcworkspace/contents.xcworkspacedata b/frontend/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..59c6d39 --- /dev/null +++ b/frontend/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/frontend/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frontend/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/frontend/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/frontend/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/frontend/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..af0309c --- /dev/null +++ b/frontend/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/frontend/ios/Runner/AppDelegate.swift b/frontend/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..ed1c097 --- /dev/null +++ b/frontend/ios/Runner/AppDelegate.swift @@ -0,0 +1,16 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } +} diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1950fd8 --- /dev/null +++ b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..eeedf8c Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..e3738ef Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..abf16eb Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..59b575c Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..9ae8504 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..1a20ffc Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..77c6a38 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..abf16eb Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..8fe2455 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..2ff101a Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..2ff101a Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..28389b6 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..6330b1e Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..e83b11f Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..6c4a6ba Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..d08a4de --- /dev/null +++ b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..8905ea5 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..d4b0937 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..a0a40d1 Binary files /dev/null and b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..65a94b5 --- /dev/null +++ b/frontend/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/frontend/ios/Runner/Base.lproj/LaunchScreen.storyboard b/frontend/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..a92deda --- /dev/null +++ b/frontend/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/ios/Runner/Base.lproj/Main.storyboard b/frontend/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bbb83ca --- /dev/null +++ b/frontend/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/ios/Runner/Info.plist b/frontend/ios/Runner/Info.plist new file mode 100644 index 0000000..e5f674d --- /dev/null +++ b/frontend/ios/Runner/Info.plist @@ -0,0 +1,70 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + 记之 + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + 记之 + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/frontend/ios/Runner/Runner-Bridging-Header.h b/frontend/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..fae207f --- /dev/null +++ b/frontend/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/frontend/ios/Runner/SceneDelegate.swift b/frontend/ios/Runner/SceneDelegate.swift new file mode 100644 index 0000000..b79be9b --- /dev/null +++ b/frontend/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/frontend/ios/RunnerTests/RunnerTests.swift b/frontend/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..4d206de --- /dev/null +++ b/frontend/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/frontend/lib/app/app.dart b/frontend/lib/app/app.dart new file mode 100644 index 0000000..d086496 --- /dev/null +++ b/frontend/lib/app/app.dart @@ -0,0 +1,260 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/features/add/screenshot_parse_sheet.dart'; +import 'package:miaoji_zhang/features/ai_mode/pages/ai_mode_page.dart'; +import 'package:miaoji_zhang/features/auth/pages/login_page.dart'; +import 'package:miaoji_zhang/features/auth/pages/register_page.dart'; +import 'package:miaoji_zhang/features/auth/pages/splash_page.dart'; +import 'package:miaoji_zhang/features/chat/chat_page.dart'; +import 'package:miaoji_zhang/features/home/pages/home_page.dart'; +import 'package:miaoji_zhang/features/home/pages/main_shell.dart'; +import 'package:miaoji_zhang/features/home/pages/search_page.dart'; +import 'package:miaoji_zhang/features/onboarding/pages/onboarding_page.dart'; +import 'package:miaoji_zhang/features/settings/account_data_page.dart'; +import 'package:miaoji_zhang/features/settings/appearance_page.dart'; +import 'package:miaoji_zhang/features/settings/budget_page.dart'; +import 'package:miaoji_zhang/features/settings/category_manage_page.dart'; +import 'package:miaoji_zhang/features/settings/companion_page.dart'; +import 'package:miaoji_zhang/features/settings/me_page.dart'; +import 'package:miaoji_zhang/features/settings/recycle_bin_page.dart'; +import 'package:miaoji_zhang/features/settings/legal_document_page.dart'; +import 'package:miaoji_zhang/features/settings/screenshot_settings_page.dart'; +import 'package:miaoji_zhang/features/settings/sync_conflicts_page.dart'; +import 'package:miaoji_zhang/features/stats/report_page.dart'; +import 'package:miaoji_zhang/features/stats/stats_page.dart'; +import 'package:miaoji_zhang/features/add/add_page.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/recognition_import_service.dart'; +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; +import 'package:miaoji_zhang/shared/services/sync_service.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/theme/theme_store.dart'; +import 'package:miaoji_zhang/shared/update/update_coordinator.dart'; +import 'package:provider/provider.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; + +final _rootNavigatorKey = GlobalKey(); + +final router = GoRouter( + navigatorKey: _rootNavigatorKey, + initialLocation: '/splash', + refreshListenable: SessionStore.instance, + redirect: (_, state) { + final aiOnly = + state.matchedLocation == '/chat' || + state.matchedLocation == '/ai-mode' || + state.matchedLocation == '/companion'; + if (aiOnly && + SessionStore.instance.isAccount && + !SessionStore.instance.aiEnabled) { + return '/home'; + } + return null; + }, + routes: [ + GoRoute(path: '/splash', builder: (_, __) => const SplashPage()), + GoRoute( + path: '/login', + builder: (_, state) => + LoginPage(notice: state.uri.queryParameters['notice']), + ), + GoRoute(path: '/register', builder: (_, __) => const RegisterPage()), + GoRoute(path: '/onboarding', builder: (_, __) => const OnboardingPage()), + GoRoute(path: '/add', builder: (_, __) => const AddPage()), + GoRoute(path: '/budget', builder: (_, __) => const BudgetPage()), + GoRoute(path: '/account-data', builder: (_, __) => const AccountDataPage()), + GoRoute(path: '/appearance', builder: (_, __) => const AppearancePage()), + GoRoute(path: '/recycle-bin', builder: (_, __) => const RecycleBinPage()), + GoRoute( + path: '/sync-conflicts', + builder: (_, __) => const SyncConflictsPage(), + ), + GoRoute(path: '/companion', builder: (_, __) => const CompanionPage()), + GoRoute( + path: '/categories', + builder: (_, __) => const CategoryManagePage(), + ), + GoRoute(path: '/report', builder: (_, __) => const ReportPage()), + GoRoute( + path: '/legal/:kind', + builder: (_, state) => LegalDocumentPage( + kind: LegalDocumentKind.fromKey(state.pathParameters['kind']), + ), + ), + GoRoute(path: '/search', builder: (_, __) => const SearchPage()), + GoRoute( + path: '/screenshot-settings', + builder: (_, __) => const ScreenshotSettingsPage(), + ), + StatefulShellRoute.indexedStack( + builder: (_, __, shell) => MainShell(shell: shell), + branches: [ + StatefulShellBranch( + routes: [ + GoRoute(path: '/home', builder: (_, __) => const HomePage()), + ], + ), + StatefulShellBranch( + routes: [ + GoRoute(path: '/stats', builder: (_, __) => const StatsPage()), + ], + ), + StatefulShellBranch( + routes: [ + GoRoute(path: '/chat', builder: (_, __) => const ChatTabPage()), + ], + ), + StatefulShellBranch( + routes: [GoRoute(path: '/me', builder: (_, __) => const MePage())], + ), + ], + ), + GoRoute(path: '/ai-mode', builder: (_, __) => const AiModePage()), + ], +); + +class MiaoJiApp extends StatefulWidget { + const MiaoJiApp({super.key}); + + @override + State createState() => _MiaoJiAppState(); +} + +class _MiaoJiAppState extends State with WidgetsBindingObserver { + bool _showingScreenshotSheet = false; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + UpdateCoordinator.instance.bindNavigator(_rootNavigatorKey); + ApiClient.sessionExpired.addListener(_handleSessionExpired); + unawaited(_bootstrap()); + ScreenshotChannel.onScreenshotReady( + _handleScreenshotReady, + onError: _handleScreenshotError, + ); + ScreenshotChannel.onRecognitionAction(_handleRecognitionAction); + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); + ApiClient.sessionExpired.removeListener(_handleSessionExpired); + super.dispose(); + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) { + _resumeServices(); + } + } + + Future _bootstrap() async { + await _runSafely(ScreenshotChannel.cleanupStaleScreenshots); + if (SessionStore.instance.hasSession) { + await _runSafely(CurrentLedgerStore.instance.loadCached); + } + await _runSafely(RecognitionImportService.configureNativeContext); + await _runSafely(RecognitionImportService.importAutomatic); + if (mounted) setState(() {}); + unawaited(_refreshRemoteState()); + } + + Future _resumeServices() async { + await _runSafely(RecognitionImportService.configureNativeContext); + await _runSafely(RecognitionImportService.importAutomatic); + unawaited(_refreshRemoteState()); + } + + Future _refreshRemoteState() async { + await Future.wait([ + _runSafely(PublicConfigApi.init), + _refreshAccountData(), + _runSafely(SyncService.instance.run), + ]); + if (mounted) setState(() {}); + } + + Future _refreshAccountData() async { + final session = SessionStore.instance; + if (!session.isAccount || session.shouldUseLocalOnly) return; + await _runSafely(AuthApi.me); + await _runSafely( + () => CurrentLedgerStore.instance.ensureLoaded(force: true), + ); + } + + Future _runSafely(Future Function() operation) async { + try { + await operation(); + } catch (_) { + // Optional startup and refresh work is isolated from the local app shell. + } + } + + Future _handleRecognitionAction(Map action) async { + await Future.delayed(const Duration(milliseconds: 180)); + final context = _rootNavigatorKey.currentContext; + if (!mounted || context == null || !context.mounted) return; + await RecognitionImportService.handleAction(context, action); + } + + void _handleSessionExpired() { + final context = _rootNavigatorKey.currentContext; + if (context != null && context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('云同步登录已过期,本地记账仍可使用;重新登录后可继续同步')), + ); + } + } + + void _handleScreenshotError(String message) { + final context = _rootNavigatorKey.currentContext; + if (!mounted || context == null || !context.mounted) return; + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); + if (message.contains('无障碍服务')) { + router.push('/screenshot-settings'); + } + } + + Future _handleScreenshotReady(String path) async { + if (_showingScreenshotSheet) return; + await Future.delayed(const Duration(milliseconds: 150)); + final context = _rootNavigatorKey.currentContext; + if (!mounted || context == null || !context.mounted) return; + + _showingScreenshotSheet = true; + try { + await ScreenshotParseSheet.show(context, path); + } finally { + _showingScreenshotSheet = false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: ThemeStore.instance, + builder: (context, _) => ChangeNotifierProvider.value( + value: CurrentLedgerStore.instance, + child: MaterialApp.router( + title: PublicConfigApi.appName, + theme: AppTheme.light, + darkTheme: AppTheme.dark, + themeMode: ThemeStore.instance.themeMode, + routerConfig: router, + debugShowCheckedModeBanner: false, + ), + ), + ); + } +} diff --git a/frontend/lib/features/add/add_page.dart b/frontend/lib/features/add/add_page.dart new file mode 100644 index 0000000..8af1874 --- /dev/null +++ b/frontend/lib/features/add/add_page.dart @@ -0,0 +1,559 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +class AddPage extends StatefulWidget { + const AddPage({super.key}); + + @override + State createState() => _AddPageState(); +} + +class _AddPageState extends State { + final _noteCtrl = TextEditingController(); + String _tab = 'expense'; + final Map> _categoriesByType = { + 'expense': [], + 'income': [], + }; + final Map _selectedByType = { + 'expense': null, + 'income': null, + }; + String _amount = '0'; + String? _paymentMethod; + DateTime _occurredAt = ShanghaiTime.now; + bool _saving = false; + bool _loadingCategories = true; + List get _categories => + _categoriesByType[_tab] ?? const []; + + CategoryItem? get _selected => _selectedByType[_tab]; + + Color get _activeColor => _tab == 'income' ? AppTheme.primary : AppTheme.red; + + @override + void initState() { + super.initState(); + _loadCategories(); + } + + @override + void dispose() { + _noteCtrl.dispose(); + super.dispose(); + } + + Future _loadCategories() async { + setState(() => _loadingCategories = true); + try { + final results = await Future.wait([ + TxApi.categories('expense'), + TxApi.categories('income'), + ]); + if (!mounted) return; + setState(() { + _categoriesByType['expense'] = results[0]; + _categoriesByType['income'] = results[1]; + if (_selectedByType['expense'] == null && results[0].isNotEmpty) { + _selectedByType['expense'] = results[0].first; + } + if (_selectedByType['income'] == null && results[1].isNotEmpty) { + _selectedByType['income'] = results[1].first; + } + }); + } catch (error) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } finally { + if (mounted) setState(() => _loadingCategories = false); + } + } + + void _switchTab(String tab) { + if (_tab == tab) return; + setState(() => _tab = tab); + } + + void _pressKey(String key) { + setState(() { + if (key == 'delete') { + _amount = _amount.length > 1 + ? _amount.substring(0, _amount.length - 1) + : '0'; + return; + } + if (key == '.') { + if (!_amount.contains('.')) _amount += '.'; + return; + } + if (_amount.contains('.') && _amount.split('.')[1].length >= 2) return; + _amount = _amount == '0' ? key : '$_amount$key'; + if (_amount.length > 9) _amount = _amount.substring(0, 9); + }); + } + + Future _save() async { + final amount = double.tryParse(_amount) ?? 0; + if (amount <= 0) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('请输入金额'))); + return; + } + if (_selected == null) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('请选择分类'))); + return; + } + + setState(() => _saving = true); + try { + await TxApi.create( + categoryId: _selected!.id, + type: _tab, + amount: amount, + note: _noteCtrl.text.trim().isEmpty ? null : _noteCtrl.text.trim(), + paymentMethod: _paymentMethod, + occurredAt: _occurredAt, + ); + TransactionEvents.notifyChanged(); + if (mounted) context.pop(amount); + } catch (error) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } finally { + if (mounted) setState(() => _saving = false); + } + } + + Future _editNote() async { + final value = await showJzTextInputSheet( + context, + title: '备注', + label: '备注内容', + initialValue: _noteCtrl.text, + maxLength: 40, + ); + if (value != null) setState(() => _noteCtrl.text = value); + } + + Future _pickOccurredAt() async { + final value = await showJzDateTimeSheet( + context, + initial: _occurredAt, + firstDate: DateTime(2000), + lastDate: ShanghaiTime.now.add(const Duration(days: 1)), + title: '选择发生时间', + ); + if (value != null && mounted) setState(() => _occurredAt = value); + } + + Future _pickPaymentMethod() async { + const methods = ['微信支付', '支付宝', '银行卡', '现金', '其他']; + final options = [ + ...methods.map((method) => JzOption(value: method, label: method)), + if (_paymentMethod != null) const JzOption(value: '', label: '清除支付方式'), + ]; + final value = await showJzOptionSheet( + context, + title: '支付方式', + options: options, + selected: _paymentMethod, + ); + if (value != null) { + setState(() => _paymentMethod = value.isEmpty ? null : value); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('记一笔'), + leading: IconButton( + icon: AppIcons.icon( + AppIcons.close, + size: 20, + color: context.jz.text2, + ), + onPressed: () => context.pop(), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + final compact = constraints.maxHeight < 650; + return Column( + children: [ + _buildTypeSelector(), + SizedBox(height: 4), + Expanded( + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 260), + switchInCurve: Curves.easeOutCubic, + switchOutCurve: Curves.easeInCubic, + transitionBuilder: (child, animation) { + final offset = _tab == 'expense' + ? const Offset(-0.04, 0) + : const Offset(0.04, 0); + return FadeTransition( + opacity: animation, + child: SlideTransition( + position: Tween( + begin: offset, + end: Offset.zero, + ).animate(animation), + child: child, + ), + ); + }, + child: _loadingCategories + ? Center( + key: ValueKey('loading'), + child: CircularProgressIndicator( + strokeWidth: 2, + color: AppTheme.primary, + ), + ) + : _buildCategoryGrid(key: ValueKey(_tab)), + ), + ), + _buildAmountKeyboard(compact), + ], + ); + }, + ), + ), + ); + } + + Widget _buildTypeSelector() { + return Container( + width: 220, + height: 38, + margin: const EdgeInsets.only(top: 4), + padding: const EdgeInsets.all(3), + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(10), + ), + child: LayoutBuilder( + builder: (context, constraints) => Stack( + children: [ + AnimatedAlign( + duration: const Duration(milliseconds: 260), + curve: Curves.easeOutCubic, + alignment: _tab == 'expense' + ? Alignment.centerLeft + : Alignment.centerRight, + child: Container( + width: constraints.maxWidth / 2, + height: constraints.maxHeight, + decoration: BoxDecoration( + color: _activeColor, + borderRadius: BorderRadius.circular(7), + ), + ), + ), + Row( + children: [_segment('支出', 'expense'), _segment('收入', 'income')], + ), + ], + ), + ), + ); + } + + Widget _segment(String label, String value) { + final selected = _tab == value; + return Expanded( + child: InkWell( + borderRadius: BorderRadius.circular(7), + onTap: () => _switchTab(value), + child: Center( + child: AnimatedDefaultTextStyle( + duration: const Duration(milliseconds: 260), + curve: Curves.easeOutCubic, + style: TextStyle( + fontSize: 13, + fontWeight: selected ? FontWeight.w700 : FontWeight.w500, + color: selected ? Colors.white : context.jz.text2, + ), + child: Text(label), + ), + ), + ), + ); + } + + Widget _buildCategoryGrid({required Key key}) { + return GridView.builder( + key: key, + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 4, + childAspectRatio: 0.92, + ), + itemCount: _categories.length, + itemBuilder: (context, index) { + final category = _categories[index]; + final selected = category.id == _selected?.id; + return InkWell( + borderRadius: BorderRadius.circular(16), + onTap: () => setState(() => _selectedByType[_tab] = category), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AnimatedContainer( + duration: const Duration(milliseconds: 160), + width: 48, + height: 48, + decoration: BoxDecoration( + color: selected ? _activeColor : context.jz.card, + borderRadius: BorderRadius.circular(15), + border: Border.all( + color: selected ? _activeColor : context.jz.line, + width: selected ? 1 : 0.5, + ), + ), + child: Center( + child: AppIcons.byKey( + category.iconKey, + size: 21, + color: selected ? Colors.white : context.jz.text2, + ), + ), + ), + SizedBox(height: 5), + Text( + category.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11, + color: selected ? _activeColor : context.jz.text2, + fontWeight: selected ? FontWeight.w600 : null, + ), + ), + ], + ), + ); + }, + ); + } + + Widget _buildAmountKeyboard(bool compact) { + const keys = [ + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '.', + '0', + 'delete', + ]; + final dateLabel = + '${_occurredAt.month}/${_occurredAt.day} ' + '${_occurredAt.hour.toString().padLeft(2, '0')}:' + '${_occurredAt.minute.toString().padLeft(2, '0')}'; + + return Container( + padding: EdgeInsets.fromLTRB(16, compact ? 7 : 10, 16, 10), + decoration: BoxDecoration( + color: context.jz.card, + border: Border(top: BorderSide(color: context.jz.line, width: 0.5)), + ), + child: Column( + children: [ + Row( + children: [ + if (_selected != null) ...[ + CategoryIconBox( + iconKey: _selected!.iconKey, + colorKey: _selected!.colorKey, + size: 30, + ), + SizedBox(width: 8), + Text( + _selected!.name, + style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600), + ), + ], + Spacer(), + AnimatedDefaultTextStyle( + duration: const Duration(milliseconds: 260), + curve: Curves.easeOutCubic, + style: TextStyle( + fontSize: compact ? 25 : 28, + fontWeight: FontWeight.w800, + color: _activeColor, + ), + child: Text('¥ $_amount'), + ), + ], + ), + SizedBox(height: 7), + SizedBox( + height: 34, + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + _metaChip( + icon: Icons.edit_note_rounded, + label: _noteCtrl.text.isEmpty ? '备注' : _noteCtrl.text, + onTap: _editNote, + ), + _metaChip( + icon: Icons.schedule_rounded, + label: dateLabel, + onTap: _pickOccurredAt, + ), + _metaChip( + icon: Icons.account_balance_wallet_outlined, + label: _paymentMethod ?? '支付方式', + onTap: _pickPaymentMethod, + ), + ], + ), + ), + SizedBox(height: 8), + SizedBox( + height: compact ? 172 : 196, + child: Row( + children: [ + Expanded( + child: GridView.count( + physics: const NeverScrollableScrollPhysics(), + crossAxisCount: 3, + mainAxisSpacing: 6, + crossAxisSpacing: 6, + childAspectRatio: compact ? 2.15 : 2.0, + children: keys.map(_buildKey).toList(), + ), + ), + SizedBox(width: 7), + SizedBox( + width: 74, + child: AnimatedContainer( + duration: const Duration(milliseconds: 260), + curve: Curves.easeOutCubic, + decoration: BoxDecoration( + color: _saving ? context.jz.line : _activeColor, + borderRadius: BorderRadius.circular(11), + ), + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(11), + child: InkWell( + borderRadius: BorderRadius.circular(11), + onTap: _saving ? null : _save, + child: Center( + child: _saving + ? SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.check_rounded, + color: Colors.white, + size: 24, + ), + SizedBox(height: 4), + Text( + '完成', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget _metaChip({ + required IconData icon, + required String label, + required VoidCallback onTap, + }) { + return Padding( + padding: const EdgeInsets.only(right: 7), + child: ActionChip( + avatar: Icon(icon, size: 15, color: context.jz.text2), + label: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 105), + child: Text( + label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 11, color: context.jz.text2), + ), + ), + side: BorderSide.none, + backgroundColor: context.jz.background, + onPressed: onTap, + ), + ); + } + + Widget _buildKey(String key) { + return Material( + color: context.jz.background, + borderRadius: BorderRadius.circular(9), + child: InkWell( + borderRadius: BorderRadius.circular(9), + onTap: () => _pressKey(key), + child: Center( + child: key == 'delete' + ? Icon( + Icons.backspace_outlined, + size: 18, + color: context.jz.text2, + ) + : Text( + key, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600), + ), + ), + ), + ); + } +} diff --git a/frontend/lib/features/add/parse_sheet.dart b/frontend/lib/features/add/parse_sheet.dart new file mode 100644 index 0000000..58d3a79 --- /dev/null +++ b/frontend/lib/features/add/parse_sheet.dart @@ -0,0 +1,276 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; + +Future showParseSheet( + BuildContext context, { + required String source, + String? initialText, +}) { + return showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (_) => _ParseSheet(source: source, initialText: initialText), + ); +} + +class _ParseSheet extends StatefulWidget { + final String source; + final String? initialText; + const _ParseSheet({required this.source, this.initialText}); + + @override + State<_ParseSheet> createState() => _ParseSheetState(); +} + +class _ParseSheetState extends State<_ParseSheet> { + late final TextEditingController _input; + ParsedDraft? _draft; + bool _parsing = false; + bool _saving = false; + + bool get isVoice => widget.source == 'voice'; + + @override + void initState() { + super.initState(); + _input = TextEditingController(text: widget.initialText ?? ''); + if ((widget.initialText ?? '').trim().isNotEmpty) { + WidgetsBinding.instance.addPostFrameCallback((_) => _parse()); + } + } + + @override + void dispose() { + _input.dispose(); + super.dispose(); + } + + Future _parse() async { + final text = _input.text.trim(); + if (text.isEmpty) return; + setState(() => _parsing = true); + try { + final d = await ParseApi.parse(text, source: widget.source); + if (mounted) setState(() => _draft = d); + } catch (e) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } + } finally { + if (mounted) setState(() => _parsing = false); + } + } + + Future _confirm() async { + final d = _draft; + if (d == null || d.amount <= 0) return; + setState(() => _saving = true); + try { + await ParseApi.confirm(d, widget.source, _input.text.trim()); + TransactionEvents.notifyChanged(); + if (mounted) Navigator.pop(context, true); + } catch (e) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } + } finally { + if (mounted) setState(() => _saving = false); + } + } + + @override + Widget build(BuildContext context) { + final d = _draft; + return Container( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom, + ), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(22)), + ), + child: Padding( + padding: const EdgeInsets.fromLTRB(22, 22, 22, 30), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Column( + children: [ + Text( + isVoice ? '语音记账' : '文字识别', + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + SizedBox(height: 4), + Text( + isVoice + ? '识别到的语音会自动填到这里,你也可以手动补充或修改。' + : '把识别到的文字贴进来,AI 会先帮你解析成账单草稿。', + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + textAlign: TextAlign.center, + ), + ], + ), + ), + SizedBox(height: 14), + TextField( + controller: _input, + maxLines: 2, + decoration: InputDecoration( + hintText: isVoice + ? '例如:昨天晚上和朋友吃烧烤 88 支付宝付的' + : '例如:永辉超市 合计 128.60 微信支付', + ), + onChanged: (_) { + if (_draft != null) setState(() => _draft = null); + }, + ), + SizedBox(height: 12), + if (d == null) + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: AppTheme.ai), + onPressed: _parsing ? null : _parse, + child: _parsing + ? SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : Text('开始识别'), + ), + ) + else ...[ + Container( + padding: const EdgeInsets.all(13), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(13), + ), + child: Row( + children: [ + CategoryIconBox(iconKey: d.categoryIcon, size: 38), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '¥${d.amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + color: d.type == 'income' + ? AppTheme.primary + : AppTheme.red, + ), + ), + SizedBox(height: 3), + Row( + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 2, + ), + decoration: BoxDecoration( + color: + (d.type == 'income' + ? AppTheme.primary + : AppTheme.red) + .withValues(alpha: 0.1), + borderRadius: BorderRadius.circular(5), + ), + child: Text( + d.type == 'income' ? '收入' : '支出', + style: TextStyle( + fontSize: 9.5, + fontWeight: FontWeight.w700, + color: d.type == 'income' + ? AppTheme.primary + : AppTheme.red, + ), + ), + ), + SizedBox(width: 6), + Flexible( + child: Text( + d.categoryName + + (d.paymentMethod == null + ? '' + : ' · ' + d.paymentMethod!), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11, + color: context.jz.text2, + ), + ), + ), + ], + ), + if (!d.matched) + Text( + '没有识别出有效金额,请修改后重新识别。', + style: TextStyle( + fontSize: 10.5, + color: AppTheme.red, + ), + ), + ], + ), + ), + ], + ), + ), + SizedBox(height: 12), + Row( + children: [ + Expanded( + child: OutlinedButton( + onPressed: () => setState(() => _draft = null), + child: Text( + '重新识别', + style: TextStyle(color: context.jz.text2), + ), + ), + ), + SizedBox(width: 10), + Expanded( + child: ElevatedButton( + onPressed: (!d.matched || _saving) ? null : _confirm, + child: _saving + ? SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : Text('确认入账'), + ), + ), + ], + ), + ], + ], + ), + ), + ); + } +} diff --git a/frontend/lib/features/add/screenshot_parse_sheet.dart b/frontend/lib/features/add/screenshot_parse_sheet.dart new file mode 100644 index 0000000..5f1cfca --- /dev/null +++ b/frontend/lib/features/add/screenshot_parse_sheet.dart @@ -0,0 +1,1021 @@ +import 'dart:io'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +class ScreenshotParseSheet extends StatefulWidget { + final String imagePath; + + const ScreenshotParseSheet({super.key, required this.imagePath}); + + @override + State createState() => _ScreenshotParseSheetState(); + + static Future show(BuildContext context, String imagePath) { + return showModalBottomSheet( + context: context, + isScrollControlled: true, + useSafeArea: true, + backgroundColor: Colors.transparent, + builder: (_) => ScreenshotParseSheet(imagePath: imagePath), + ); + } +} + +class _ScreenshotParseSheetState extends State { + List _expenseCategories = []; + List _incomeCategories = []; + final List<_ScreenshotDraft> _drafts = []; + bool _parsing = true; + bool _saving = false; + String? _error; + Uint8List? _imageBytes; + bool _imageCleaned = false; + + @override + void initState() { + super.initState(); + _initialize(); + } + + @override + void dispose() { + for (final draft in _drafts) { + draft.dispose(); + } + _cleanupImage(); + super.dispose(); + } + + Future _initialize() async { + try { + final groups = await Future.wait>([ + TxApi.categories('expense'), + TxApi.categories('income'), + ]); + _expenseCategories = groups[0]; + _incomeCategories = groups[1]; + } catch (e) { + _error = '分类加载失败:${apiErrorMessage(e)}'; + } + await _parseImage(); + } + + Future _parseImage() async { + try { + SessionStore.instance.requireOnline('截屏和图片 AI 识别需要登录并连接网络'); + await ScreenshotChannel.startAiProgress(); + final bytes = await File(widget.imagePath).readAsBytes(); + if (mounted) setState(() => _imageBytes = bytes); + final formData = FormData.fromMap({ + 'file': MultipartFile.fromBytes(bytes, filename: 'screenshot.png'), + }); + final response = await ApiClient.instance.dio.post( + '/api/parse/image', + data: formData, + queryParameters: const {'source': 'screenshot'}, + ); + if (!mounted) return; + + final data = Map.from(response.data as Map); + final rawItems = data['items'] is List + ? List.from(data['items'] as List) + : []; + if (rawItems.isEmpty && data['matched'] == true) { + rawItems.add(data); + } + + for (final raw in rawItems.take(20)) { + if (raw is! Map) continue; + _drafts.add(_draftFromJson(Map.from(raw))); + } + await ScreenshotChannel.updateAiProgress(_drafts.length); + if (_drafts.isEmpty) { + _drafts.add(_emptyDraft()); + _error ??= 'AI 没有确认到有效账单,请手动补充'; + } + + setState(() => _parsing = false); + } catch (e) { + final message = apiErrorMessage(e); + await ScreenshotChannel.failAiProgress(message); + if (!mounted) return; + _drafts.add(_emptyDraft()); + setState(() { + _parsing = false; + _error = message; + }); + } finally { + _cleanupImage(); + } + } + + void _cleanupImage() { + if (_imageCleaned) return; + _imageCleaned = true; + try { + final file = File(widget.imagePath); + if (file.existsSync()) file.deleteSync(); + } catch (_) { + // Startup cleanup retries files that the OS still has open. + } + } + + _ScreenshotDraft _draftFromJson(Map json) { + final type = switch (json['type']?.toString().toLowerCase()) { + 'income' => 'income', + 'expense' => 'expense', + _ => 'unknown', + }; + final categoryId = (json['categoryId'] as num?)?.toInt(); + final categoryName = json['categoryName']?.toString() ?? '其他'; + final categoryIcon = json['categoryIcon']?.toString() ?? 'tag'; + final categories = _categoriesFor(type); + final exists = categories.any((category) => category.id == categoryId); + if (type != 'unknown' && !exists && categoryId != null) { + categories.add( + CategoryItem.fromJson({ + 'id': categoryId, + 'name': categoryName, + 'iconKey': categoryIcon, + 'type': type, + 'sortOrder': 999, + 'isCustom': false, + }), + ); + } + + final fallbackId = categories.isEmpty ? null : categories.first.id; + final amount = (json['amount'] as num?)?.toDouble() ?? 0; + final parsedOccurredAt = DateTime.tryParse( + json['occurredAt']?.toString() ?? '', + ); + return _ScreenshotDraft( + type: type, + categoryId: type == 'unknown' + ? null + : (exists || categoryId != null ? categoryId : fallbackId), + included: type != 'unknown', + amount: amount > 0 ? amount.toStringAsFixed(2) : '', + note: json['note']?.toString() ?? '', + paymentMethod: json['paymentMethod']?.toString() ?? '', + occurredAt: parsedOccurredAt == null + ? ShanghaiTime.now + : ShanghaiTime.toCivil(parsedOccurredAt), + ); + } + + _ScreenshotDraft _emptyDraft() { + final categoryId = _expenseCategories.isEmpty + ? null + : _expenseCategories.first.id; + return _ScreenshotDraft( + type: 'expense', + categoryId: categoryId, + amount: '', + note: '', + paymentMethod: '', + occurredAt: ShanghaiTime.now, + ); + } + + List _categoriesFor(String type) { + return switch (type) { + 'income' => _incomeCategories, + 'expense' => _expenseCategories, + _ => [], + }; + } + + void _addDraft() { + setState(() => _drafts.add(_emptyDraft())); + } + + void _changeType(_ScreenshotDraft draft, String type) { + if (draft.type == type) return; + final categories = _categoriesFor(type); + setState(() { + draft.type = type; + draft.included = true; + draft.categoryId = categories.isEmpty ? null : categories.first.id; + }); + } + + Future _pickOccurredAt(_ScreenshotDraft draft) async { + FocusScope.of(context).unfocus(); + final value = await showJzDateTimeSheet( + context, + initial: draft.occurredAt, + firstDate: DateTime(2000), + lastDate: ShanghaiTime.now.add(const Duration(days: 1)), + title: '选择账单时间', + ); + if (value != null && mounted) { + setState(() => draft.occurredAt = value); + } + } + + Future _selectCategory(_ScreenshotDraft draft, int billIndex) async { + final categories = _categoriesFor(draft.type); + if (categories.isEmpty) { + _showMessage('当前收支类型暂无可选分类'); + return; + } + FocusScope.of(context).unfocus(); + final selected = await showModalBottomSheet( + context: context, + useSafeArea: true, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => FractionallySizedBox( + heightFactor: 0.62, + child: Material( + color: context.jz.background, + borderRadius: const BorderRadius.vertical(top: Radius.circular(24)), + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + const _SheetHandle(), + Padding( + padding: const EdgeInsets.fromLTRB(18, 5, 12, 12), + child: Row( + children: [ + Expanded( + child: Text( + '第 ${billIndex + 1} 笔 · 选择分类', + style: TextStyle( + fontSize: 17, + fontWeight: FontWeight.w800, + ), + ), + ), + IconButton( + tooltip: '关闭', + onPressed: () => Navigator.pop(sheetContext), + icon: Icon(Icons.close_rounded), + ), + ], + ), + ), + Expanded( + child: GridView.builder( + padding: const EdgeInsets.fromLTRB(16, 2, 16, 20), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 4, + mainAxisSpacing: 10, + crossAxisSpacing: 10, + childAspectRatio: 0.86, + ), + itemCount: categories.length, + itemBuilder: (_, index) { + final category = categories[index]; + return _CategoryChoice( + category: category, + selected: category.id == draft.categoryId, + onTap: () => Navigator.pop(sheetContext, category.id), + ); + }, + ), + ), + ], + ), + ), + ), + ); + if (selected != null && mounted) { + setState(() => draft.categoryId = selected); + } + } + + Future _confirm() async { + final selected = _drafts + .where((draft) => draft.included && !draft.saved) + .toList(); + if (selected.isEmpty) { + _showMessage('请至少选择一笔尚未保存的账单'); + return; + } + + for (var index = 0; index < selected.length; index++) { + final draft = selected[index]; + if (draft.type != 'income' && draft.type != 'expense') { + _showMessage('第 ${_drafts.indexOf(draft) + 1} 笔请先确认收入或支出'); + return; + } + if ((double.tryParse(draft.amountController.text) ?? 0) <= 0) { + _showMessage('第 ${_drafts.indexOf(draft) + 1} 笔金额无效'); + return; + } + if (draft.categoryId == null) { + _showMessage('第 ${_drafts.indexOf(draft) + 1} 笔还没有选择分类'); + return; + } + } + + final selectedCount = selected.length; + final selectedTotal = selected.fold( + 0, + (sum, draft) => sum + (double.tryParse(draft.amountController.text) ?? 0), + ); + + setState(() => _saving = true); + var savedAny = false; + try { + for (final draft in selected) { + final note = draft.noteController.text.trim(); + final payment = draft.paymentController.text.trim(); + await TxApi.create( + categoryId: draft.categoryId!, + type: draft.type, + amount: double.parse(draft.amountController.text), + note: note.isEmpty ? null : note, + paymentMethod: payment.isEmpty ? null : payment, + source: 'screenshot', + sourceText: '截屏识别', + occurredAt: draft.occurredAt, + ); + draft.saved = true; + savedAny = true; + if (mounted) setState(() {}); + } + + if (savedAny) TransactionEvents.notifyChanged(); + await ScreenshotChannel.finishAiProgress(selectedCount, selectedTotal); + if (!mounted) return; + Navigator.pop(context, true); + } catch (e) { + if (savedAny) TransactionEvents.notifyChanged(); + final next = _drafts.indexWhere( + (draft) => draft.included && !draft.saved, + ); + final prefix = next >= 0 ? '第 ${next + 1} 笔保存失败:' : '保存失败:'; + final message = '$prefix${apiErrorMessage(e)}'; + await ScreenshotChannel.failAiProgress(message); + if (!mounted) return; + _showMessage(message); + } finally { + if (mounted) setState(() => _saving = false); + } + } + + void _showMessage(String message) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); + } + + int get _selectedCount { + return _drafts.where((draft) => draft.included && !draft.saved).length; + } + + double get _selectedTotal { + return _drafts.where((draft) => draft.included && !draft.saved).fold(0, ( + sum, + draft, + ) { + return sum + (double.tryParse(draft.amountController.text) ?? 0); + }); + } + + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.94, + child: Material( + color: context.jz.background, + borderRadius: const BorderRadius.vertical(top: Radius.circular(24)), + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + _buildHeader(), + if (_parsing) + Expanded( + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + CircularProgressIndicator( + color: AppTheme.ai, + strokeWidth: 2.5, + ), + SizedBox(height: 14), + Text( + 'AI 正在逐笔分析截图...', + style: TextStyle(color: context.jz.text2, fontSize: 13), + ), + ], + ), + ), + ) + else ...[ + if (_error != null) _buildError(), + Expanded( + child: ListView.separated( + padding: const EdgeInsets.fromLTRB(14, 10, 14, 18), + keyboardDismissBehavior: + ScrollViewKeyboardDismissBehavior.onDrag, + itemCount: _drafts.length + 1, + separatorBuilder: (_, _) => SizedBox(height: 10), + itemBuilder: (context, index) { + if (index == _drafts.length) { + return OutlinedButton.icon( + onPressed: _saving ? null : _addDraft, + icon: Icon(Icons.add, size: 18), + label: Text('手动补一笔'), + ); + } + return _buildDraftCard(_drafts[index], index); + }, + ), + ), + _buildFooter(), + ], + ], + ), + ), + ); + } + + Widget _buildHeader() { + return Container( + padding: const EdgeInsets.fromLTRB(16, 10, 16, 14), + child: Column( + children: [ + Container( + width: 38, + height: 5, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(3), + ), + ), + SizedBox(height: 11), + Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(11), + child: _imageBytes == null + ? Container( + width: 54, + height: 76, + color: context.jz.background, + child: Icon(Icons.broken_image_outlined), + ) + : Image.memory( + _imageBytes!, + width: 54, + height: 76, + fit: BoxFit.cover, + ), + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '截屏记账', + style: TextStyle( + fontSize: 17, + fontWeight: FontWeight.w800, + ), + ), + SizedBox(height: 5), + Text( + _parsing + ? '正在识别交易明细' + : '识别到 ${_drafts.length} 笔,可逐笔修改或取消', + style: TextStyle(color: context.jz.text2, fontSize: 12), + ), + if (!_parsing) ...[ + SizedBox(height: 8), + Text( + '已选 $_selectedCount 笔 · 合计 ¥${_selectedTotal.toStringAsFixed(2)}', + style: TextStyle( + color: AppTheme.ai, + fontSize: 12, + fontWeight: FontWeight.w700, + ), + ), + ], + ], + ), + ), + IconButton( + onPressed: _saving ? null : () => Navigator.pop(context, false), + icon: Icon(Icons.close), + tooltip: '关闭', + ), + ], + ), + ], + ), + ); + } + + Widget _buildError() { + return Container( + width: double.infinity, + margin: const EdgeInsets.fromLTRB(14, 10, 14, 0), + padding: const EdgeInsets.all(11), + decoration: BoxDecoration( + color: context.jz.expenseBackground, + borderRadius: BorderRadius.circular(10), + ), + child: Text( + _error!, + style: TextStyle(color: AppTheme.red, fontSize: 11, height: 1.4), + ), + ); + } + + Widget _buildDraftCard(_ScreenshotDraft draft, int index) { + final categories = _categoriesFor(draft.type); + final selectedCategory = categories + .where((category) => category.id == draft.categoryId) + .firstOrNull; + final disabled = + draft.saved || (!draft.included && draft.type != 'unknown'); + + return AnimatedOpacity( + opacity: disabled ? 0.62 : 1, + duration: const Duration(milliseconds: 180), + child: Card( + margin: EdgeInsets.zero, + + child: Padding( + padding: const EdgeInsets.fromLTRB(12, 11, 12, 13), + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: draft.included, + onChanged: draft.saved || _saving + ? null + : (value) { + setState(() => draft.included = value ?? false); + }, + ), + Expanded( + child: Text( + '第 ${index + 1} 笔', + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w800, + ), + ), + ), + if (draft.saved) + const _DraftStateChip(label: '已入账', color: AppTheme.primary) + else + _DraftStateChip( + label: switch (draft.type) { + 'income' => '收入', + 'expense' => '支出', + _ => '待确认', + }, + color: draft.type == 'unknown' + ? context.jz.text3 + : (draft.type == 'income' + ? AppTheme.primary + : AppTheme.red), + ), + ], + ), + IgnorePointer( + ignoring: disabled || _saving, + child: Column( + children: [ + TextField( + controller: draft.amountController, + keyboardType: const TextInputType.numberWithOptions( + decimal: true, + ), + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'^\d{0,9}(\.\d{0,2})?'), + ), + ], + onChanged: (_) => setState(() {}), + decoration: InputDecoration( + labelText: '金额', + prefixText: '¥ ', + ), + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w800, + ), + ), + SizedBox(height: 10), + Row( + children: [ + Expanded( + child: _TypeButton( + label: '支出', + selected: draft.type == 'expense', + color: AppTheme.red, + onTap: () => _changeType(draft, 'expense'), + ), + ), + SizedBox(width: 8), + Expanded( + child: _TypeButton( + label: '收入', + selected: draft.type == 'income', + color: AppTheme.primary, + onTap: () => _changeType(draft, 'income'), + ), + ), + ], + ), + SizedBox(height: 10), + _CategoryField( + category: selectedCategory, + enabled: categories.isNotEmpty, + onTap: () => _selectCategory(draft, index), + ), + SizedBox(height: 10), + _DateTimeField( + value: draft.occurredAt, + onTap: () => _pickOccurredAt(draft), + ), + SizedBox(height: 10), + Row( + children: [ + Expanded( + child: TextField( + controller: draft.noteController, + decoration: InputDecoration( + labelText: '备注', + hintText: '商户或商品', + ), + ), + ), + SizedBox(width: 8), + Expanded( + child: TextField( + controller: draft.paymentController, + decoration: InputDecoration( + labelText: '支付方式', + hintText: '微信/支付宝', + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + Widget _buildFooter() { + return Container( + padding: EdgeInsets.fromLTRB( + 16, + 11, + 16, + MediaQuery.paddingOf(context).bottom + 11, + ), + decoration: BoxDecoration( + color: context.jz.card, + border: Border(top: BorderSide(color: context.jz.line)), + ), + child: SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: _saving || _selectedCount == 0 ? null : _confirm, + child: _saving + ? SizedBox( + width: 19, + height: 19, + child: CircularProgressIndicator(strokeWidth: 2), + ) + : Text('确认入账($_selectedCount 笔)'), + ), + ), + ); + } +} + +class _ScreenshotDraft { + String type; + int? categoryId; + bool included; + bool saved = false; + DateTime occurredAt; + final TextEditingController amountController; + final TextEditingController noteController; + final TextEditingController paymentController; + + _ScreenshotDraft({ + required this.type, + required this.categoryId, + bool included = true, + required String amount, + required String note, + required String paymentMethod, + required this.occurredAt, + }) : included = included, + amountController = TextEditingController(text: amount), + noteController = TextEditingController(text: note), + paymentController = TextEditingController(text: paymentMethod); + + void dispose() { + amountController.dispose(); + noteController.dispose(); + paymentController.dispose(); + } +} + +class _DraftStateChip extends StatelessWidget { + final String label; + final Color color; + + const _DraftStateChip({required this.label, required this.color}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 4), + decoration: BoxDecoration( + color: color.withValues(alpha: 0.1), + borderRadius: BorderRadius.circular(20), + ), + child: Text( + label, + style: TextStyle( + color: color, + fontSize: 10, + fontWeight: FontWeight.w700, + ), + ), + ); + } +} + +class _TypeButton extends StatelessWidget { + final String label; + final bool selected; + final Color color; + final VoidCallback onTap; + + const _TypeButton({ + required this.label, + required this.selected, + required this.color, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Material( + color: selected ? color.withValues(alpha: 0.1) : context.jz.background, + borderRadius: BorderRadius.circular(9), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(9), + child: Container( + height: 38, + alignment: Alignment.center, + decoration: BoxDecoration( + border: Border.all(color: selected ? color : context.jz.line), + borderRadius: BorderRadius.circular(9), + ), + child: Text( + label, + style: TextStyle( + color: selected ? color : context.jz.text2, + fontWeight: FontWeight.w700, + fontSize: 12, + ), + ), + ), + ), + ); + } +} + +class _SheetHandle extends StatelessWidget { + const _SheetHandle(); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 10, bottom: 8), + child: Container( + width: 38, + height: 4, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(2), + ), + ), + ); + } +} + +class _CategoryField extends StatelessWidget { + final CategoryItem? category; + final bool enabled; + final VoidCallback onTap; + + const _CategoryField({ + required this.category, + required this.enabled, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Material( + color: context.jz.background, + borderRadius: BorderRadius.circular(12), + child: InkWell( + onTap: enabled ? onTap : null, + borderRadius: BorderRadius.circular(12), + child: Container( + height: 54, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + border: Border.all(color: context.jz.line), + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + if (category != null) + CategoryIconBox( + iconKey: category!.iconKey, + colorKey: category!.colorKey, + size: 30, + ) + else + Icon(Icons.category_outlined, color: context.jz.text3), + SizedBox(width: 10), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '分类', + style: TextStyle(fontSize: 10, color: context.jz.text3), + ), + Text( + category?.name ?? '请选择分类', + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + ), + Icon(Icons.keyboard_arrow_right_rounded, color: context.jz.text3), + ], + ), + ), + ), + ); + } +} + +class _DateTimeField extends StatelessWidget { + final DateTime value; + final VoidCallback onTap; + + const _DateTimeField({required this.value, required this.onTap}); + + @override + Widget build(BuildContext context) { + final text = + '${value.year}-${value.month.toString().padLeft(2, '0')}-' + '${value.day.toString().padLeft(2, '0')} ' + '${value.hour.toString().padLeft(2, '0')}:' + '${value.minute.toString().padLeft(2, '0')}'; + return Material( + color: context.jz.background, + borderRadius: BorderRadius.circular(12), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(12), + child: Container( + height: 50, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + border: Border.all(color: context.jz.line), + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + Icon(Icons.schedule_rounded, size: 20, color: AppTheme.ai), + SizedBox(width: 10), + Text( + '账单时间', + style: TextStyle(fontSize: 12, color: context.jz.text2), + ), + Spacer(), + Text( + text, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w700), + ), + SizedBox(width: 3), + Icon( + Icons.keyboard_arrow_right_rounded, + size: 20, + color: context.jz.text3, + ), + ], + ), + ), + ), + ); + } +} + +class _CategoryChoice extends StatelessWidget { + final CategoryItem category; + final bool selected; + final VoidCallback onTap; + + const _CategoryChoice({ + required this.category, + required this.selected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Material( + color: selected ? context.jz.aiBackground : context.jz.card, + borderRadius: BorderRadius.circular(14), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(14), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 9), + decoration: BoxDecoration( + border: Border.all( + color: selected ? AppTheme.ai : context.jz.line, + width: selected ? 1.4 : 0.8, + ), + borderRadius: BorderRadius.circular(14), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + CategoryIconBox( + iconKey: category.iconKey, + colorKey: category.colorKey, + size: 38, + ), + if (selected) + Positioned( + right: -4, + top: -4, + child: CircleAvatar( + radius: 8, + backgroundColor: AppTheme.ai, + child: Icon(Icons.check, size: 11, color: Colors.white), + ), + ), + ], + ), + SizedBox(height: 7), + Text( + category.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11, + color: selected ? AppTheme.ai : context.jz.text, + fontWeight: selected ? FontWeight.w800 : FontWeight.w600, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/frontend/lib/features/ai_mode/pages/ai_mode_page.dart b/frontend/lib/features/ai_mode/pages/ai_mode_page.dart new file mode 100644 index 0000000..e7ec3c5 --- /dev/null +++ b/frontend/lib/features/ai_mode/pages/ai_mode_page.dart @@ -0,0 +1,570 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/features/chat/chat_page.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +class AiModePage extends StatefulWidget { + const AiModePage({super.key}); + + @override + State createState() => _AiModePageState(); +} + +class _AiModePageState extends State { + MonthSummary? _summary; + BudgetsData? _budgets; + String? _summaryError; + String? _budgetError; + bool _summaryLoading = true; + bool _budgetLoading = true; + int _loadRevision = 0; + final _chatController = ChatPageController(); + + @override + void initState() { + super.initState(); + CurrentLedgerStore.instance.addListener(_load); + TransactionEvents.revision.addListener(_load); + _load(); + } + + @override + void dispose() { + CurrentLedgerStore.instance.removeListener(_load); + TransactionEvents.revision.removeListener(_load); + super.dispose(); + } + + Future _load() async { + final revision = ++_loadRevision; + if (mounted) { + setState(() { + _summaryLoading = true; + _budgetLoading = true; + _summaryError = null; + _budgetError = null; + }); + } + final now = ShanghaiTime.now; + await Future.wait([ + () async { + try { + final summary = await TxApi.month(now.year, now.month); + if (!mounted || revision != _loadRevision) return; + setState(() => _summary = summary); + } catch (error) { + if (!mounted || revision != _loadRevision) return; + setState(() => _summaryError = apiErrorMessage(error)); + } finally { + if (mounted && revision == _loadRevision) { + setState(() => _summaryLoading = false); + } + } + }(), + () async { + try { + final budgets = await BudgetApi.get(now.year, now.month); + if (!mounted || revision != _loadRevision) return; + setState(() => _budgets = budgets); + } catch (error) { + if (!mounted || revision != _loadRevision) return; + setState(() => _budgetError = apiErrorMessage(error)); + } finally { + if (mounted && revision == _loadRevision) { + setState(() => _budgetLoading = false); + } + } + }(), + ]); + } + + Future _openBudget() async { + await context.push('/budget'); + await _load(); + } + + Future _switchToNormal() async { + try { + await AuthApi.switchMode('normal'); + if (mounted) context.go('/home'); + } catch (error) { + if (!mounted) return; + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } + + Widget _summarySection(MonthSummary? summary, double todayExpense) { + if (_summaryLoading && summary == null) { + return const _AiLoadCard(message: '正在加载本月收支', loading: true); + } + if (_summaryError != null && summary == null) { + return _AiLoadCard(message: _summaryError!, onRetry: _load); + } + return Column( + children: [ + if (_summaryError != null) + _AiRefreshNotice(message: _summaryError!, onRetry: _load), + Row( + children: [ + _MiniCard( + label: '今日支出', + value: '¥${todayExpense.toStringAsFixed(2)}', + color: AppTheme.red, + ), + SizedBox(width: 8), + _MiniCard( + label: '本月结余', + value: '¥${summary!.balance.toStringAsFixed(0)}', + color: AppTheme.primary, + ), + SizedBox(width: 8), + _MiniCard( + label: '本月支出', + value: '¥${summary.expense.toStringAsFixed(0)}', + color: context.jz.text, + ), + ], + ), + ], + ); + } + + Widget _budgetSection() { + if (_budgetLoading && _budgets == null) { + return const _AiLoadCard(message: '正在加载本月预算', loading: true); + } + if (_budgetError != null && _budgets == null) { + return _AiLoadCard(message: _budgetError!, onRetry: _load); + } + return Column( + children: [ + if (_budgetError != null) + _AiRefreshNotice(message: _budgetError!, onRetry: _load), + AiBudgetStrip(data: _budgets!, onTap: _openBudget), + ], + ); + } + + @override + Widget build(BuildContext context) { + final s = _summary; + final today = ShanghaiTime.now.day; + final todayExpense = + s?.days + .where((d) => d.date.day == today) + .fold(0, (sum, d) => sum + d.expense) ?? + 0; + + return Scaffold( + body: Container( + decoration: BoxDecoration(color: context.jz.background), + child: SafeArea( + bottom: false, + child: Column( + children: [ + ValueListenableBuilder( + valueListenable: PublicConfigApi.companionNotifier, + builder: (_, companion, __) { + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, + ), + child: Row( + children: [ + CircleAvatar( + radius: 22, + backgroundColor: AppTheme.ai, + child: AppIcons.icon( + AppIcons.keyMap[companion.avatarKey] ?? + AppIcons.cat, + size: 24, + color: Colors.white, + ), + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + companion.name, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.w700, + ), + ), + Text( + '全 AI 模式 · 说句话就能记账', + style: TextStyle( + fontSize: 10, + color: context.jz.text3, + ), + ), + ], + ), + ), + IconButton( + tooltip: '清理上下文', + onPressed: _chatController.clearContext, + icon: Icon( + Icons.restart_alt_rounded, + size: 21, + color: context.jz.text2, + ), + ), + GestureDetector( + onTap: _switchToNormal, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 11, + vertical: 5, + ), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: AppTheme.ai.withValues(alpha: 0.35), + ), + ), + child: Text( + '切换模式', + style: TextStyle( + fontSize: 10.5, + color: AppTheme.ai, + ), + ), + ), + ), + ], + ), + ); + }, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: _summarySection(s, todayExpense), + ), + SizedBox(height: 8), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: _budgetSection(), + ), + SizedBox(height: 8), + Expanded( + child: ChatPage(aiMode: true, controller: _chatController), + ), + ], + ), + ), + ), + ); + } +} + +class _AiLoadCard extends StatelessWidget { + final String message; + final bool loading; + final Future Function()? onRetry; + const _AiLoadCard({ + required this.message, + this.loading = false, + this.onRetry, + }); + + @override + Widget build(BuildContext context) { + return Container( + constraints: const BoxConstraints(minHeight: 58), + padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 10), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: loading + ? context.jz.line + : AppTheme.red.withValues(alpha: 0.22), + ), + ), + child: Row( + children: [ + if (loading) + SizedBox( + width: 17, + height: 17, + child: CircularProgressIndicator( + strokeWidth: 2, + color: AppTheme.primary, + ), + ) + else + Icon(Icons.cloud_off_rounded, size: 18, color: AppTheme.red), + SizedBox(width: 10), + Expanded( + child: Text( + message, + style: TextStyle(fontSize: 11.5, color: context.jz.text2), + ), + ), + if (!loading && onRetry != null) + TextButton(onPressed: onRetry, child: Text('重试')), + ], + ), + ); + } +} + +class _AiRefreshNotice extends StatelessWidget { + final String message; + final Future Function() onRetry; + const _AiRefreshNotice({required this.message, required this.onRetry}); + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.only(bottom: 7), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7), + decoration: BoxDecoration( + color: context.jz.warningBackground, + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Icon(Icons.info_outline_rounded, size: 15, color: AppTheme.orange), + SizedBox(width: 7), + Expanded( + child: Text( + '刷新失败,当前显示上次数据:' + message, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 10.5, color: context.jz.text2), + ), + ), + TextButton( + onPressed: onRetry, + style: TextButton.styleFrom( + minimumSize: const Size(0, 30), + padding: const EdgeInsets.symmetric(horizontal: 7), + ), + child: Text('重试', style: TextStyle(fontSize: 10.5)), + ), + ], + ), + ); + } +} + +class AiBudgetStrip extends StatelessWidget { + final BudgetsData? data; + final VoidCallback onTap; + const AiBudgetStrip({super.key, required this.data, required this.onTap}); + + @override + Widget build(BuildContext context) { + final total = data?.total; + final categories = data?.categories ?? const []; + final amount = + total?.amount ?? + categories.fold(0, (sum, item) => sum + item.amount); + final spent = + total?.spent ?? + categories.fold(0, (sum, item) => sum + item.spent); + final hasBudget = amount > 0; + final ratio = hasBudget ? (spent / amount).clamp(0.0, 1.0) : 0.0; + final over = hasBudget && spent > amount; + + return Semantics( + button: true, + label: hasBudget ? '查看本月预算' : '设置本月预算', + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(14), + child: Container( + padding: const EdgeInsets.fromLTRB(13, 10, 13, 9), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line), + ), + child: hasBudget + ? Column( + children: [ + Row( + children: [ + AppIcons.icon( + AppIcons.target, + size: 16, + color: over ? AppTheme.red : AppTheme.primary, + ), + SizedBox(width: 7), + Text( + '本月预算', + style: TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w700, + ), + ), + Spacer(), + Text( + over + ? '已超 ¥${(spent - amount).toStringAsFixed(0)}' + : '剩余 ¥${(amount - spent).toStringAsFixed(0)}', + style: TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w700, + color: over ? AppTheme.red : AppTheme.primaryDeep, + ), + ), + SizedBox(width: 3), + Icon( + Icons.chevron_right_rounded, + size: 17, + color: context.jz.text3, + ), + ], + ), + SizedBox(height: 7), + ClipRRect( + borderRadius: BorderRadius.circular(3), + child: LinearProgressIndicator( + value: ratio, + minHeight: 5, + backgroundColor: context.jz.line, + color: over + ? AppTheme.red + : ratio > 0.8 + ? AppTheme.orange + : AppTheme.primary, + ), + ), + SizedBox(height: 5), + Row( + children: [ + Text( + '已用 ¥${spent.toStringAsFixed(0)}', + style: TextStyle( + fontSize: 9.5, + color: context.jz.text3, + ), + ), + Spacer(), + Text( + '总额 ¥${amount.toStringAsFixed(0)}', + style: TextStyle( + fontSize: 9.5, + color: context.jz.text3, + ), + ), + ], + ), + ], + ) + : Row( + children: [ + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + color: context.jz.primaryBackground, + borderRadius: BorderRadius.circular(9), + ), + child: Center( + child: AppIcons.icon( + AppIcons.target, + size: 16, + color: AppTheme.primary, + ), + ), + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '本月还没设置预算', + style: TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 2), + Text( + '设个上限,让 AI 帮你一起盯住', + style: TextStyle( + fontSize: 9.5, + color: context.jz.text3, + ), + ), + ], + ), + ), + Text( + '去设置', + style: TextStyle( + fontSize: 11, + color: AppTheme.primaryDeep, + fontWeight: FontWeight.w700, + ), + ), + Icon( + Icons.chevron_right_rounded, + size: 17, + color: AppTheme.primary, + ), + ], + ), + ), + ), + ); + } +} + +class _MiniCard extends StatelessWidget { + final String label, value; + final Color color; + const _MiniCard({ + required this.label, + required this.value, + required this.color, + }); + + @override + Widget build(BuildContext context) { + return Expanded( + child: Container( + padding: const EdgeInsets.all(9), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: context.jz.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: TextStyle(fontSize: 9, color: context.jz.text3)), + SizedBox(height: 2), + Text( + value, + style: TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w700, + color: color, + ), + ), + ], + ), + ), + ); + } +} diff --git a/frontend/lib/features/ai_mode/pages/ai_welcome_page.dart b/frontend/lib/features/ai_mode/pages/ai_welcome_page.dart new file mode 100644 index 0000000..b3149c0 --- /dev/null +++ b/frontend/lib/features/ai_mode/pages/ai_welcome_page.dart @@ -0,0 +1,135 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +class AiWelcomePage extends StatelessWidget { + final void Function(String) onSend; + final String? companionName; + final String? companionAvatarKey; + const AiWelcomePage({ + super.key, + required this.onSend, + this.companionName, + this.companionAvatarKey, + }); + + static const _cards = [ + ('"早餐包子豆浆 6 块"', '直接说花了多少钱,我帮你记账', AppIcons.food), + ('"这个月花最多的是什么"', '问我查账、看报告、定预算', AppIcons.chart), + ('"按住说话"', '语音记账、拍小票,都能识别', AppIcons.mic), + ]; + + @override + Widget build(BuildContext context) { + final name = companionName ?? '小账喵'; + final avatar = AppIcons.avatarAsset(companionAvatarKey ?? 'cat'); + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + Spacer(flex: 2), + Container( + width: 88, + height: 88, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: context.jz.aiBackground, + boxShadow: [ + BoxShadow( + color: AppTheme.ai.withValues(alpha: 0.15), + blurRadius: 24, + ), + ], + ), + child: Center( + child: AppIcons.icon(avatar, size: 44, color: AppTheme.ai), + ), + ), + SizedBox(height: 18), + Text( + '嗨!我是$name', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w800), + ), + SizedBox(height: 8), + Text( + '不用翻菜单,不用点按钮\n说句话就能记账,试试看?', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.5, + color: context.jz.text2, + height: 1.7, + ), + ), + SizedBox(height: 22), + ..._cards.asMap().entries.map( + (e) => GestureDetector( + onTap: () => onSend(e.value.$1.replaceAll('"', '')), + child: Container( + margin: const EdgeInsets.only(bottom: 10), + padding: const EdgeInsets.symmetric( + horizontal: 14, + vertical: 13, + ), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.75), + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: Colors.white.withValues(alpha: 0.9), + ), + ), + child: Row( + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: AppIcons.icon( + e.value.$3, + size: 18, + color: AppTheme.ai, + ), + ), + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + e.value.$1, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w600, + ), + ), + SizedBox(height: 3), + Text( + e.value.$2, + style: TextStyle( + fontSize: 10.5, + color: context.jz.text2, + ), + ), + ], + ), + ), + AppIcons.icon( + AppIcons.chevronRight, + size: 14, + color: context.jz.text3, + ), + ], + ), + ), + ), + ), + Spacer(flex: 3), + ], + ), + ); + } +} diff --git a/frontend/lib/features/auth/pages/login_page.dart b/frontend/lib/features/auth/pages/login_page.dart new file mode 100644 index 0000000..80de33b --- /dev/null +++ b/frontend/lib/features/auth/pages/login_page.dart @@ -0,0 +1,228 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/guest_merge_service.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/version.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/brand_logo.dart'; + +class LoginPage extends StatefulWidget { + final String? notice; + + const LoginPage({super.key, this.notice}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + final _user = TextEditingController(); + final _pass = TextEditingController(); + bool _loading = false; + + @override + void initState() { + super.initState(); + PublicConfigApi.init().ignore(); + if (widget.notice case final notice? when notice.isNotEmpty) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(notice))); + } + }); + } + } + + @override + void dispose() { + _user.dispose(); + _pass.dispose(); + super.dispose(); + } + + Future _login() async { + if (_user.text.trim().isEmpty || _pass.text.isEmpty) { + _showMessage('请输入用户名和密码'); + return; + } + final guestSnapshot = SessionStore.instance.isGuest + ? LocalDatabase.instance.guestSnapshot() + : null; + setState(() => _loading = true); + try { + final closureCancelled = await AuthApi.login( + _user.text.trim(), + _pass.text, + ); + final profile = await AuthApi.me(); + await CurrentLedgerStore.instance.ensureLoaded(force: true); + if (!mounted) return; + if (guestSnapshot?['hasData'] == true) { + final shouldMerge = await showJzConfirmSheet( + context, + title: '发现游客数据', + message: '是否将本机游客账单、分类和预算导入当前账号?数据会放入独立的“游客数据”账本,原游客数据仍保留在本机。', + confirmLabel: '导入数据', + ); + if (shouldMerge) { + try { + final result = await GuestMergeService.merge(guestSnapshot!); + if (mounted) { + _showMessage('已导入 ${result.transactionCount} 笔游客账单'); + } + } catch (error) { + if (mounted) { + _showMessage('游客数据暂未导入:${apiErrorMessage(error)}'); + } + } + } + } + if (!mounted) return; + if (closureCancelled) _showMessage('已取消账号注销,欢迎回来'); + final destination = !profile.onboardingDone + ? '/onboarding' + : profile.appMode == 'ai' + ? '/ai-mode' + : '/home'; + context.go(destination); + } catch (error) { + if (mounted) _showMessage(apiErrorMessage(error)); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + Future _startGuest() async { + setState(() => _loading = true); + try { + await SessionStore.instance.startGuest(); + await CurrentLedgerStore.instance.ensureLoaded(force: true); + if (mounted) context.go('/home'); + } catch (error) { + if (mounted) _showMessage(apiErrorMessage(error)); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + void _showMessage(String message) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SafeArea( + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 28), + children: [ + SizedBox(height: 48), + Center( + child: Column( + children: [ + const BrandLogo(size: 82), + SizedBox(height: 16), + Text( + PublicConfigApi.appName, + style: TextStyle( + fontSize: 26, + fontWeight: FontWeight.w800, + letterSpacing: 1, + ), + ), + SizedBox(height: 8), + Text( + PublicConfigApi.slogan, + style: TextStyle(fontSize: 13, color: context.jz.text2), + ), + SizedBox(height: 48), + ], + ), + ), + TextField( + controller: _user, + textInputAction: TextInputAction.next, + decoration: InputDecoration(labelText: '用户名', hintText: '请输入用户名'), + ), + SizedBox(height: 12), + TextField( + controller: _pass, + obscureText: true, + decoration: InputDecoration(labelText: '密码', hintText: '请输入密码'), + onSubmitted: (_) => _loading ? null : _login(), + ), + SizedBox(height: 22), + JzActionButton( + label: '登录', + loading: _loading, + onPressed: _loading ? null : _login, + ), + SizedBox(height: 10), + JzActionButton( + label: '游客模式', + secondary: true, + onPressed: _loading ? null : _startGuest, + ), + SizedBox(height: 7), + Text( + '游客数据仅保存在本机;AI、语音解析和图片识别需登录联网', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + height: 1.45, + ), + ), + SizedBox(height: 8), + Center( + child: TextButton( + onPressed: _loading ? null : () => context.go('/register'), + child: Text('没有账号?去注册'), + ), + ), + const LoginLegalLinks(), + SizedBox(height: 20), + Center( + child: Text( + AppVersion.display, + style: TextStyle(fontSize: 10, color: context.jz.text3), + ), + ), + ], + ), + ), + ); + } +} + +class LoginLegalLinks extends StatelessWidget { + const LoginLegalLinks({super.key}); + + @override + Widget build(BuildContext context) { + return Wrap( + alignment: WrapAlignment.center, + spacing: 2, + runSpacing: 0, + children: [ + _link(context, '用户协议', 'terms'), + _link(context, '隐私政策', 'privacy'), + ], + ); + } + + Widget _link(BuildContext context, String label, String kind) => TextButton( + onPressed: () => context.push('/legal/$kind'), + child: Text(label, style: TextStyle(fontSize: 11.5)), + ); +} diff --git a/frontend/lib/features/auth/pages/register_page.dart b/frontend/lib/features/auth/pages/register_page.dart new file mode 100644 index 0000000..cbf43c1 --- /dev/null +++ b/frontend/lib/features/auth/pages/register_page.dart @@ -0,0 +1,178 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; + +class RegisterPage extends StatefulWidget { + const RegisterPage({super.key}); + + @override + State createState() => _RegisterPageState(); +} + +class _RegisterPageState extends State { + final _user = TextEditingController(); + final _pass = TextEditingController(); + bool _loading = false; + bool _agreed = false; + + @override + void dispose() { + _user.dispose(); + _pass.dispose(); + super.dispose(); + } + + Future _register() async { + final username = _user.text.trim(); + if (username.length < 3 || username.length > 32) { + _message('用户名长度需在 3-32 之间'); + return; + } + if (_pass.text.length < 6) { + _message('密码至少 6 位'); + return; + } + if (!_agreed) { + _message('请先单独勾选同意用户协议与隐私政策'); + return; + } + setState(() => _loading = true); + try { + await AuthApi.register(username, _pass.text, agreedToTerms: _agreed); + if (!mounted) return; + context.go('/onboarding'); + } catch (error) { + if (!mounted) return; + _message(apiErrorMessage(error)); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + void _message(String message) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('注册')), + body: SafeArea( + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 28), + children: [ + SizedBox(height: 32), + TextField( + controller: _user, + decoration: InputDecoration(hintText: '用户名(3-32 位)'), + ), + SizedBox(height: 12), + TextField( + controller: _pass, + obscureText: true, + decoration: InputDecoration(hintText: '密码(至少 6 位)'), + ), + SizedBox(height: 18), + Semantics( + checked: _agreed, + button: true, + label: '同意用户协议与隐私政策', + child: InkWell( + onTap: () => setState(() => _agreed = !_agreed), + borderRadius: BorderRadius.circular(12), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 7), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AnimatedContainer( + duration: const Duration(milliseconds: 160), + width: 21, + height: 21, + decoration: BoxDecoration( + color: _agreed ? AppTheme.primary : Colors.white, + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: _agreed + ? AppTheme.primary + : context.jz.text3, + ), + ), + child: _agreed + ? Icon( + Icons.check_rounded, + size: 15, + color: Colors.white, + ) + : null, + ), + SizedBox(width: 10), + Expanded( + child: Text( + '我已阅读并单独同意以下用户协议与隐私政策', + style: TextStyle( + fontSize: 12.5, + height: 1.5, + color: context.jz.text2, + ), + ), + ), + ], + ), + ), + ), + ), + Wrap( + spacing: 2, + runSpacing: 0, + children: [ + _legalLink('《用户协议》', 'terms'), + _legalLink('《隐私政策》', 'privacy'), + _legalLink('权限用途', 'permissions'), + _legalLink('第三方 SDK 清单', 'sdk'), + ], + ), + SizedBox(height: 18), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: _loading ? null : _register, + child: _loading + ? SizedBox( + height: 20, + width: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : Text('注册'), + ), + ), + SizedBox(height: 14), + TextButton( + onPressed: () => context.go('/login'), + child: Text( + '已有账号?去登录', + style: TextStyle(color: context.jz.text2), + ), + ), + ], + ), + ), + ); + } + + Widget _legalLink(String label, String kind) => TextButton( + onPressed: () => context.push('/legal/' + kind), + style: TextButton.styleFrom( + padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), + minimumSize: const Size(0, 34), + ), + child: Text(label, style: TextStyle(fontSize: 11.5)), + ); +} diff --git a/frontend/lib/features/auth/pages/splash_page.dart b/frontend/lib/features/auth/pages/splash_page.dart new file mode 100644 index 0000000..6e408cd --- /dev/null +++ b/frontend/lib/features/auth/pages/splash_page.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/update/update_coordinator.dart'; +import 'package:miaoji_zhang/shared/version.dart'; +import 'package:miaoji_zhang/shared/widgets/brand_logo.dart'; + +class SplashPage extends StatefulWidget { + const SplashPage({super.key}); + + @override + State createState() => _SplashPageState(); +} + +class _SplashPageState extends State { + @override + void initState() { + super.initState(); + _bootstrap(); + } + + void _finishStartup(String location) { + if (!mounted) return; + context.go(location); + UpdateCoordinator.instance.scheduleStartupCheck(); + } + + Future _bootstrap() async { + final session = SessionStore.instance; + if (session.hasSession) { + try { + await CurrentLedgerStore.instance.loadCached(force: true); + } catch (_) { + // A damaged local cache must not leave the app trapped on the splash page. + } + } + if (!mounted) return; + if (!session.hasSession) { + _finishStartup('/login'); + return; + } + + if (!session.onboardingDone && !session.shouldUseLocalOnly) { + _finishStartup('/onboarding'); + } else if (session.appMode == 'ai' && !session.shouldUseLocalOnly) { + _finishStartup('/ai-mode'); + } else { + _finishStartup('/home'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const BrandLogo(size: 90), + SizedBox(height: 24), + CircularProgressIndicator(strokeWidth: 2, color: AppTheme.primary), + SizedBox(height: 16), + Text( + AppVersion.display, + style: TextStyle(fontSize: 10, color: context.jz.text3), + ), + ], + ), + ), + ); + } +} diff --git a/frontend/lib/features/chat/chat_page.dart b/frontend/lib/features/chat/chat_page.dart new file mode 100644 index 0000000..1016683 --- /dev/null +++ b/frontend/lib/features/chat/chat_page.dart @@ -0,0 +1,1347 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:miaoji_zhang/features/add/screenshot_parse_sheet.dart'; +import 'package:miaoji_zhang/features/ai_mode/pages/ai_welcome_page.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/ai_access_gate.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/async_error_view.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +const stickerStyle = { + 'salary': (AppIcons.money, AppTheme.primary), + 'forgive': (AppIcons.smile, AppTheme.orange), + 'fire': (AppIcons.fire, AppTheme.red), + 'empty_wallet': (AppIcons.wallet, AppTheme.text3), + 'angry': (AppIcons.close, AppTheme.red), + 'happy': (AppIcons.check, AppTheme.primary), + 'treat': (AppIcons.gift, AppTheme.orange), + 'shopping_joy': (AppIcons.cart, AppTheme.primaryDeep), +}; + +const stickerLabels = { + 'salary': '发工资啦', + 'forgive': '求原谅', + 'fire': '剁手警告', + 'empty_wallet': '钱包空空', + 'angry': '生气', + 'happy': '开心', + 'treat': '犒劳自己', + 'shopping_joy': '购物狂喜', +}; + +enum _ComposerPanel { none, stickers, voice } + +class ChatPageController { + Future Function()? _clearContext; + + Future clearContext() => _clearContext?.call() ?? Future.value(); +} + +class ChatPage extends StatefulWidget { + final bool aiMode; + final ChatPageController? controller; + const ChatPage({super.key, this.aiMode = false, this.controller}); + + @override + State createState() => _ChatPageState(); +} + +class _ChatPageState extends State { + final _msgs = []; + final _ctrl = TextEditingController(); + final _sc = ScrollController(); + final _picker = ImagePicker(); + + bool _sending = false; + bool _voiceHolding = false; + bool _voiceProcessing = false; + bool _voiceCancel = false; + bool _stickersLoading = false; + _ComposerPanel _composerPanel = _ComposerPanel.none; + bool get _voiceMode => _composerPanel == _ComposerPanel.voice; + bool get _stkOpen => _composerPanel == _ComposerPanel.stickers; + bool _loaded = false; + bool _userNearBottom = true; + String? _loadError; + String _voiceText = ''; + double _voiceRms = 0; + int _speechSession = 0; + OverlayEntry? _voiceOverlay; + final _inputFocus = FocusNode(); + List _stk = []; + + static const _q = ['刚买了杯奶茶 18 块', '打车花了 45', '这个月花最多的是什么']; + + @override + void initState() { + super.initState(); + widget.controller?._clearContext = clearContext; + _ctrl.addListener(_onInputChanged); + _sc.addListener(_trackScrollPosition); + _inputFocus.addListener(_onInputFocusChanged); + _hist(); + _stkLoad(); + } + + @override + void dispose() { + if (widget.controller?._clearContext == clearContext) { + widget.controller?._clearContext = null; + } + _speechSession++; + _voiceOverlay?.remove(); + _ctrl.removeListener(_onInputChanged); + _inputFocus.removeListener(_onInputFocusChanged); + _ctrl.dispose(); + _inputFocus.dispose(); + _sc.removeListener(_trackScrollPosition); + _sc.dispose(); + super.dispose(); + } + + @override + void didUpdateWidget(covariant ChatPage oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.controller?._clearContext == clearContext) { + oldWidget.controller?._clearContext = null; + } + widget.controller?._clearContext = clearContext; + } + + void _trackScrollPosition() { + if (!_sc.hasClients) return; + _userNearBottom = _sc.position.maxScrollExtent - _sc.position.pixels <= 80; + } + + void _onInputChanged() { + if (mounted) setState(() {}); + } + + void _onInputFocusChanged() { + if (_inputFocus.hasFocus && _stkOpen && mounted) { + setState(() => _composerPanel = _ComposerPanel.none); + } + } + + void _closeComposerPanel() { + if (mounted) setState(() => _composerPanel = _ComposerPanel.none); + } + + Future clearContext() async { + if (_sending || _voiceHolding || _voiceProcessing) return; + _inputFocus.unfocus(); + _closeComposerPanel(); + final confirmed = await showModalBottomSheet( + context: context, + useSafeArea: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => Material( + color: context.jz.card, + borderRadius: const BorderRadius.vertical(top: Radius.circular(24)), + clipBehavior: Clip.antiAlias, + child: Padding( + padding: const EdgeInsets.fromLTRB(20, 10, 20, 18), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 38, + height: 4, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(2), + ), + ), + SizedBox(height: 22), + Container( + width: 52, + height: 52, + decoration: BoxDecoration( + color: context.jz.aiBackground, + shape: BoxShape.circle, + ), + child: Icon( + Icons.restart_alt_rounded, + color: AppTheme.ai, + size: 27, + ), + ), + SizedBox(height: 13), + Text( + '开始新会话?', + style: TextStyle(fontSize: 18, fontWeight: FontWeight.w800), + ), + SizedBox(height: 7), + Text( + 'AI 将不再使用当前聊天作为上下文,历史账单和聊天记录都不会被删除。', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.5, + height: 1.5, + color: context.jz.text2, + ), + ), + SizedBox(height: 22), + Row( + children: [ + Expanded( + child: Material( + color: context.jz.background, + borderRadius: BorderRadius.circular(13), + child: InkWell( + onTap: () => Navigator.pop(sheetContext, false), + borderRadius: BorderRadius.circular(13), + child: SizedBox( + height: 46, + child: Center( + child: Text( + '继续当前会话', + style: TextStyle(fontWeight: FontWeight.w700), + ), + ), + ), + ), + ), + ), + SizedBox(width: 10), + Expanded( + child: Material( + color: AppTheme.ai, + borderRadius: BorderRadius.circular(13), + child: InkWell( + onTap: () => Navigator.pop(sheetContext, true), + borderRadius: BorderRadius.circular(13), + child: SizedBox( + height: 46, + child: Center( + child: Text( + '开始新会话', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.w800, + ), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ); + if (confirmed != true) return; + try { + await ChatApi.clearContext(); + if (!mounted) return; + setState(() => _msgs.clear()); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('已清理上下文,开始新会话'))); + } catch (e) { + if (!mounted) return; + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } + } + + Future _hist() async { + if (mounted) { + setState(() { + _loaded = false; + _loadError = null; + }); + } + try { + final l = await ChatApi.history(); + if (mounted) { + setState(() { + _msgs + ..clear() + ..addAll(l); + _loaded = true; + }); + _scroll(initial: true); + } + } catch (error) { + if (mounted) { + setState(() { + _loaded = true; + _loadError = apiErrorMessage(error); + }); + } + } + } + + Future _stkLoad() async { + if (_stickersLoading) return; + _stickersLoading = true; + try { + final l = await StickerApi.list(); + if (mounted) setState(() => _stk = l); + } finally { + _stickersLoading = false; + } + } + + Future _send([String? preset, String type = 'text']) async { + final text = (preset ?? _ctrl.text).trim(); + if (text.isEmpty || _sending) return; + + final now = ShanghaiTime.now; + final userId = -now.millisecondsSinceEpoch; + final userMsg = ChatMsg.fromJson({ + 'id': userId, + 'role': 'user', + 'type': type, + 'content': text, + 'transaction': null, + 'createdAt': now.toIso8601String(), + }); + + final assistantId = userId - 1; + final pendingAssistant = ChatMsg.fromJson({ + 'id': assistantId, + 'role': 'assistant', + 'type': 'text', + 'content': '', + 'transaction': null, + 'createdAt': now.toIso8601String(), + }); + + setState(() { + _ctrl.clear(); + _sending = true; + _composerPanel = _ComposerPanel.none; + _msgs.add(userMsg); + if (type == 'text') _msgs.add(pendingAssistant); + }); + _scroll(); + + if (type == 'text') { + await ChatApi.sendStream( + text, + onToken: (fullText) { + if (!mounted) return; + setState(() { + final idx = _msgs.indexWhere((m) => m.id == assistantId); + if (idx >= 0) { + _msgs[idx] = ChatMsg.fromJson({ + 'id': assistantId, + 'role': 'assistant', + 'type': 'text', + 'content': fullText, + 'transaction': null, + 'createdAt': ShanghaiTime.now.toIso8601String(), + }); + } + }); + _scroll(streaming: true); + }, + onDone: (msgs) { + if (!mounted) return; + if (msgs.any((message) => message.type == 'bill_card')) { + TransactionEvents.notifyChanged(); + } + setState(() { + _msgs.removeWhere((m) => m.id == assistantId); + _msgs.addAll(msgs); + _sending = false; + }); + _scroll(); + }, + onError: (err) { + if (!mounted) return; + setState(() { + _msgs.removeWhere((m) => m.id == assistantId); + _sending = false; + }); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('发送失败:$err'))); + }, + ); + return; + } + + try { + final r = await ChatApi.send(text, type: type); + if (!mounted) return; + setState(() { + _msgs.removeWhere((m) => m.id == userId); + _msgs.addAll(r); + _sending = false; + }); + if (r.any((message) => message.type == 'bill_card')) { + TransactionEvents.notifyChanged(); + } + } catch (_) { + if (mounted) { + setState(() => _sending = false); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('发送失败'))); + } + } + _scroll(); + } + + Future _undo(TxItem tx) async { + try { + await TxApi.delete(tx.id); + TransactionEvents.notifyChanged(); + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('已撤销'))); + setState(() {}); + } + } catch (_) {} + } + + void _toggleVoiceMode() { + if (SessionStore.instance.shouldUseLocalOnly) { + _showVoiceError('聊天语音输入需要登录并连接网络'); + return; + } + if (!PublicConfigApi.voiceEnabled) return; + if (_voiceHolding || _voiceProcessing) return; + final openingVoice = !_voiceMode; + setState( + () => _composerPanel = openingVoice + ? _ComposerPanel.voice + : _ComposerPanel.none, + ); + if (openingVoice) { + _inputFocus.unfocus(); + SystemChannels.textInput.invokeMethod('TextInput.hide'); + } else { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) _inputFocus.requestFocus(); + }); + } + } + + Future _startVoiceHold() async { + if (!_voiceMode || _voiceHolding || _voiceProcessing) return; + final session = ++_speechSession; + setState(() { + _voiceHolding = true; + _voiceProcessing = false; + _voiceCancel = false; + _voiceText = ''; + _voiceRms = 0; + }); + _showVoiceOverlay(); + try { + await ScreenshotChannel.startSpeechRecognition(_handleSpeechEvent); + } catch (e) { + if (!mounted || session != _speechSession) return; + _finishVoiceUi(); + _showVoiceError(e.toString()); + } + } + + void _handleSpeechEvent(SpeechEvent event) { + if (!mounted) return; + if (event.text != null && event.text!.trim().isNotEmpty) { + _voiceText = event.text!.trim(); + } + _voiceRms = event.rms; + if (event.type == 'processing') { + _voiceHolding = false; + _voiceProcessing = true; + } else if (event.type == 'final') { + final recognized = _voiceText; + _finishVoiceUi(); + if (recognized.isNotEmpty) { + _ctrl + ..text = recognized + ..selection = TextSelection.collapsed(offset: recognized.length); + setState(() => _composerPanel = _ComposerPanel.none); + _inputFocus.requestFocus(); + } else { + _showVoiceError('未识别到语音,请重试'); + } + return; + } else if (event.type == 'error') { + final message = event.text?.trim(); + _finishVoiceUi(); + _showVoiceError( + message == null || message.isEmpty ? '语音识别失败,请重试' : message, + ); + return; + } else if (event.type == 'cancelled') { + _finishVoiceUi(); + return; + } + if (mounted) setState(() {}); + _voiceOverlay?.markNeedsBuild(); + } + + void _updateVoiceCancel(LongPressMoveUpdateDetails details) { + if (!_voiceHolding) return; + final shouldCancel = details.offsetFromOrigin.dy < -70; + if (_voiceCancel == shouldCancel) return; + setState(() => _voiceCancel = shouldCancel); + _voiceOverlay?.markNeedsBuild(); + } + + Future _endVoiceHold() async { + if (!_voiceHolding) return; + final session = _speechSession; + if (_voiceCancel) { + ++_speechSession; + await ScreenshotChannel.cancelSpeechRecognition(); + _finishVoiceUi(); + return; + } + setState(() { + _voiceHolding = false; + _voiceProcessing = true; + }); + _voiceOverlay?.markNeedsBuild(); + await ScreenshotChannel.stopSpeechRecognition(); + Future.delayed(const Duration(seconds: 8), () async { + if (!mounted || session != _speechSession || !_voiceProcessing) return; + ++_speechSession; + await ScreenshotChannel.cancelSpeechRecognition(); + _finishVoiceUi(); + _showVoiceError('语音识别超时,请重试'); + }); + } + + void _showVoiceOverlay() { + _voiceOverlay?.remove(); + _voiceOverlay = OverlayEntry( + builder: (context) { + final cancelling = _voiceCancel; + final processing = _voiceProcessing; + final amplitude = (_voiceRms.abs() / 12).clamp(0.0, 1.0); + return Positioned.fill( + child: Material( + color: const Color(0xD9181A1F), + child: SafeArea( + child: Column( + children: [ + Spacer(), + AnimatedContainer( + duration: const Duration(milliseconds: 100), + width: 92 + amplitude * 24, + height: 92 + amplitude * 24, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: cancelling + ? AppTheme.red + : processing + ? AppTheme.ai + : AppTheme.primary, + boxShadow: [ + BoxShadow( + color: (cancelling ? AppTheme.red : AppTheme.primary) + .withValues(alpha: 0.35), + blurRadius: 30, + spreadRadius: 8 + amplitude * 10, + ), + ], + ), + child: Icon( + cancelling + ? Icons.close_rounded + : processing + ? Icons.more_horiz_rounded + : Icons.mic_rounded, + size: 42, + color: Colors.white, + ), + ), + SizedBox(height: 30), + Text( + cancelling + ? '松开取消' + : processing + ? '正在识别…' + : _voiceText.isEmpty + ? '正在听,松开发送到输入框' + : _voiceText, + textAlign: TextAlign.center, + maxLines: 3, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.white, + fontSize: 17, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 10), + if (!processing) + Text( + cancelling ? '移回按钮区域可继续' : '上滑可取消', + style: TextStyle(color: context.jz.text3, fontSize: 13), + ), + Spacer(), + SizedBox(height: 96), + ], + ), + ), + ), + ); + }, + ); + Overlay.of(context).insert(_voiceOverlay!); + } + + void _finishVoiceUi() { + _speechSession++; + _voiceOverlay?.remove(); + _voiceOverlay = null; + if (mounted) { + setState(() { + _voiceHolding = false; + _voiceProcessing = false; + _voiceCancel = false; + _voiceRms = 0; + }); + } + } + + void _showVoiceError(String raw) { + if (!mounted) return; + final message = raw + .replaceFirst('Exception: ', '') + .replaceFirst('PlatformException(', '') + .trim(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text(message.isEmpty ? '语音识别不可用' : message)), + ); + } + + Future _pickAndParseImage(ImageSource source) async { + if (SessionStore.instance.shouldUseLocalOnly) { + _showVoiceError('图片 AI 识别需要登录并连接网络'); + return; + } + if (!PublicConfigApi.imageEnabled) { + _showVoiceError('图片识别功能当前已关闭'); + return; + } + try { + final file = await _picker.pickImage( + source: source, + imageQuality: 90, + maxWidth: 1800, + ); + if (file == null || !mounted) return; + await ScreenshotParseSheet.show(context, file.path); + } catch (e) { + if (!mounted) return; + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } + } + + void _scroll({bool initial = false, bool streaming = false}) { + if (!initial && !_userNearBottom) return; + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!_sc.hasClients) return; + final target = _sc.position.maxScrollExtent; + if (initial || streaming) { + _sc.jumpTo(target); + } else { + _sc.animateTo( + target, + duration: const Duration(milliseconds: 180), + curve: Curves.easeOut, + ); + } + }); + } + + Future _openAttachment() async { + if (SessionStore.instance.shouldUseLocalOnly) { + _showVoiceError('图片 AI 识别需要登录并连接网络'); + return; + } + if (!PublicConfigApi.imageEnabled) { + _showVoiceError('图片识别功能当前已关闭'); + return; + } + + final source = await showJzOptionSheet( + context, + title: '添加聊天附件', + subtitle: '拍摄账单或从相册选择图片,确认后进入识别页面。', + options: const [ + JzOption( + value: ImageSource.camera, + label: '拍照', + subtitle: '打开相机拍摄账单或支付凭证', + leading: Icon(Icons.camera_alt_rounded, color: AppTheme.ai), + ), + JzOption( + value: ImageSource.gallery, + label: '从相册选择', + subtitle: '导入已有截图或账单图片', + leading: Icon(Icons.photo_library_outlined, color: AppTheme.ai), + ), + ], + ); + if (source != null && mounted) { + await _pickAndParseImage(source); + } + } + + List _buildStickerGrid() { + return _stk.map((s) { + final (asset, col) = + stickerStyle[s.key] ?? (AppIcons.tag, context.jz.text3); + return GestureDetector( + onTap: () => _send(s.key, 'sticker'), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: context.jz.background, + borderRadius: BorderRadius.circular(12), + ), + child: Center(child: AppIcons.icon(asset, size: 28, color: col)), + ), + SizedBox(height: 3), + SizedBox( + height: 18, + child: Center( + child: Text( + stickerLabels[s.key] ?? s.label.trim(), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 10.5, color: context.jz.text2), + ), + ), + ), + ], + ), + ); + }).toList(); + } + + Widget _inputBar(BuildContext context) { + final sendEnabled = _ctrl.text.trim().isNotEmpty && !_sending; + final accent = widget.aiMode ? AppTheme.ai : AppTheme.primary; + return Container( + color: context.jz.card, + padding: EdgeInsets.only( + left: 10, + right: 10, + top: 7, + bottom: 7 + MediaQuery.of(context).padding.bottom, + ), + child: Row( + children: [ + if (PublicConfigApi.voiceEnabled) ...[ + SizedBox( + width: 38, + height: 42, + child: IconButton( + tooltip: _voiceMode ? '切换键盘' : '切换语音', + onPressed: _toggleVoiceMode, + icon: _voiceMode + ? Icon( + Icons.keyboard_alt_outlined, + size: 23, + color: context.jz.text2, + ) + : AppIcons.icon( + AppIcons.mic, + size: 22, + color: context.jz.text2, + ), + padding: EdgeInsets.zero, + ), + ), + SizedBox(width: 5), + ], + Expanded( + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 180), + transitionBuilder: (child, animation) => FadeTransition( + opacity: animation, + child: ScaleTransition( + scale: Tween(begin: 0.97, end: 1).animate(animation), + child: child, + ), + ), + child: _voiceMode + ? GestureDetector( + key: const ValueKey('voice-input'), + behavior: HitTestBehavior.opaque, + onLongPressStart: (_) => _startVoiceHold(), + onLongPressMoveUpdate: _updateVoiceCancel, + onLongPressEnd: (_) => _endVoiceHold(), + child: Container( + height: 42, + alignment: Alignment.center, + decoration: BoxDecoration( + color: context.jz.background, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: context.jz.line), + ), + child: Text( + _voiceProcessing + ? '正在识别…' + : _voiceHolding + ? '松开结束' + : '按住 说话', + style: TextStyle( + fontSize: 14, + color: _voiceHolding ? accent : context.jz.text, + fontWeight: FontWeight.w600, + ), + ), + ), + ) + : TextField( + key: const ValueKey('keyboard-input'), + controller: _ctrl, + focusNode: _inputFocus, + onTap: _closeComposerPanel, + textInputAction: TextInputAction.send, + onSubmitted: sendEnabled ? (_) => _send() : null, + decoration: InputDecoration( + hintText: '说句话记一笔,比如:打车花了45', + isDense: true, + contentPadding: EdgeInsets.symmetric( + horizontal: 12, + vertical: 11, + ), + ), + ), + ), + ), + if (PublicConfigApi.stickersEnabled) ...[ + SizedBox(width: 5), + SizedBox( + width: 36, + height: 42, + child: IconButton( + tooltip: '表情包', + onPressed: () async { + if (_stkOpen) { + _closeComposerPanel(); + return; + } + _inputFocus.unfocus(); + await SystemChannels.textInput.invokeMethod( + 'TextInput.hide', + ); + await Future.delayed(const Duration(milliseconds: 120)); + if (!mounted) return; + setState(() => _composerPanel = _ComposerPanel.stickers); + _stkLoad(); + }, + icon: AppIcons.icon( + AppIcons.smile, + size: 21, + color: _stkOpen ? accent : context.jz.text2, + ), + padding: EdgeInsets.zero, + ), + ), + SizedBox(width: 6), + ], + SizedBox( + width: 50, + height: 38, + child: FilledButton( + onPressed: sendEnabled ? _send : null, + style: FilledButton.styleFrom( + padding: EdgeInsets.zero, + backgroundColor: accent, + disabledBackgroundColor: context.jz.line, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(11), + ), + ), + child: Text( + '发送', + style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w700), + ), + ), + ), + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + if (!_loaded) { + return Center( + child: CircularProgressIndicator(color: AppTheme.ai, strokeWidth: 2), + ); + } + if (_loadError case final error? when _msgs.isEmpty) { + return AsyncErrorView(message: error, onRetry: _hist); + } + if (widget.aiMode && _msgs.isEmpty) { + return ValueListenableBuilder( + valueListenable: PublicConfigApi.companionNotifier, + builder: (_, companion, __) { + return AiWelcomePage( + onSend: _send, + companionName: companion.name, + companionAvatarKey: companion.avatarKey, + ); + }, + ); + } + + return PopScope( + canPop: _composerPanel == _ComposerPanel.none, + onPopInvokedWithResult: (didPop, _) { + if (!didPop) _closeComposerPanel(); + }, + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: _sc, + padding: const EdgeInsets.all(14), + itemCount: _msgs.length, + itemBuilder: (c, i) => _Row(m: _msgs[i], undo: _undo), + ), + ), + SizedBox( + height: 40, + child: ListView( + scrollDirection: Axis.horizontal, + padding: const EdgeInsets.symmetric(horizontal: 12), + children: [ + ..._q.map( + (p) => Padding( + padding: const EdgeInsets.only(right: 8), + child: ActionChip( + label: Text( + p, + style: TextStyle(fontSize: 11, color: context.jz.text2), + ), + backgroundColor: context.jz.background, + side: BorderSide.none, + onPressed: () => _send(p), + ), + ), + ), + if (PublicConfigApi.imageEnabled) + Padding( + padding: const EdgeInsets.only(right: 8), + child: ActionChip( + avatar: AppIcons.icon( + AppIcons.camera, + size: 16, + color: AppTheme.ai, + ), + label: Text( + '附件', + style: TextStyle(fontSize: 11, color: context.jz.text2), + ), + backgroundColor: context.jz.background, + side: BorderSide.none, + onPressed: _openAttachment, + ), + ), + ], + ), + ), + _inputBar(context), + AnimatedSize( + duration: const Duration(milliseconds: 180), + curve: Curves.easeOutCubic, + child: _stkOpen && PublicConfigApi.stickersEnabled + ? Container( + color: context.jz.card, + padding: EdgeInsets.only( + left: 14, + right: 14, + top: 10, + bottom: 14 + MediaQuery.of(context).padding.bottom, + ), + child: GridView.count( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + crossAxisCount: 4, + mainAxisSpacing: 8, + crossAxisSpacing: 8, + childAspectRatio: 0.78, + children: _buildStickerGrid(), + ), + ) + : const SizedBox.shrink(), + ), + ], + ), + ); + } +} + +class _Row extends StatelessWidget { + final ChatMsg m; + final void Function(TxItem) undo; + const _Row({required this.m, required this.undo}); + + @override + Widget build(BuildContext context) { + final isMe = m.role == 'user'; + Widget bubble; + + if (m.type == 'bill_card' && m.transaction != null) { + bubble = _Bill(t: m.transaction!, u: undo); + } else if (m.type == 'bill_card') { + bubble = const _DeletedBill(); + } else if (m.type == 'sticker') { + final (asset, color) = + stickerStyle[m.content] ?? (AppIcons.tag, context.jz.text3); + bubble = Container( + width: 96, + padding: const EdgeInsets.symmetric(vertical: 13), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Center(child: AppIcons.icon(asset, size: 46, color: color)), + ); + } else if (!isMe && m.content.isEmpty) { + bubble = Container( + constraints: const BoxConstraints(maxWidth: 170), + padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 11), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(3), + topRight: Radius.circular(15), + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + ), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 16, + height: 16, + child: CircularProgressIndicator( + strokeWidth: 2, + color: AppTheme.ai, + ), + ), + SizedBox(width: 8), + Text( + '正在回复…', + style: TextStyle(fontSize: 12, color: context.jz.text2), + ), + ], + ), + ); + } else { + bubble = Container( + constraints: const BoxConstraints(maxWidth: 270), + padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 9), + decoration: BoxDecoration( + color: isMe ? AppTheme.primary : context.jz.card, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(isMe ? 15 : 3), + topRight: Radius.circular(isMe ? 3 : 15), + bottomLeft: const Radius.circular(15), + bottomRight: const Radius.circular(15), + ), + border: isMe ? null : Border.all(color: context.jz.line, width: 0.5), + ), + child: Text( + m.content, + style: TextStyle( + fontSize: 13, + height: 1.5, + color: isMe ? Colors.white : context.jz.text, + ), + ), + ); + } + + return Padding( + padding: const EdgeInsets.only(bottom: 11), + child: Row( + mainAxisAlignment: isMe + ? MainAxisAlignment.end + : MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (!isMe) ...[ + CircleAvatar( + radius: 16, + backgroundColor: AppTheme.ai, + child: AppIcons.icon( + AppIcons.keyMap[PublicConfigApi.companionAvatarKey] ?? + AppIcons.cat, + size: 17, + color: Colors.white, + ), + ), + SizedBox(width: 8), + ], + bubble, + if (isMe) ...[ + SizedBox(width: 8), + CircleAvatar( + radius: 16, + backgroundColor: context.jz.line, + child: AppIcons.icon( + AppIcons.user, + size: 17, + color: context.jz.text2, + ), + ), + ], + ], + ), + ); + } +} + +class _DeletedBill extends StatelessWidget { + const _DeletedBill(); + + @override + Widget build(BuildContext context) { + return Container( + width: 230, + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 13), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Row( + children: [ + Icon(Icons.delete_outline, size: 20, color: context.jz.text3), + SizedBox(width: 9), + Expanded( + child: Text( + '账单已永久删除', + style: TextStyle(fontSize: 12, color: context.jz.text3), + ), + ), + ], + ), + ); + } +} + +class _Bill extends StatelessWidget { + final TxItem t; + final void Function(TxItem) u; + const _Bill({required this.t, required this.u}); + + @override + Widget build(BuildContext context) { + return Container( + width: 230, + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 7), + decoration: BoxDecoration( + color: t.isIncome ? AppTheme.primary : AppTheme.ai, + borderRadius: const BorderRadius.vertical( + top: Radius.circular(13), + ), + ), + child: Text( + t.isIncome ? 'AI 已记录收入' : 'AI 已记录支出', + style: TextStyle( + fontSize: 10.5, + color: Colors.white, + fontWeight: FontWeight.w600, + ), + ), + ), + Padding( + padding: const EdgeInsets.all(12), + child: Row( + children: [ + CategoryIconBox( + iconKey: t.categoryIcon, + colorKey: t.categoryColor, + size: 36, + ), + SizedBox(width: 10), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '${t.isIncome ? '+' : '-'}¥${t.amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + color: t.isIncome ? AppTheme.primary : context.jz.text, + ), + ), + Text( + '${t.categoryName}${t.paymentMethod != null ? ' · ${t.paymentMethod}' : ''}', + style: TextStyle(fontSize: 10.5, color: context.jz.text2), + ), + ], + ), + ], + ), + ), + Divider(height: 0.5, color: context.jz.line), + Row( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 8), + child: Text( + '已入账', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 11.5, + color: AppTheme.primary, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + Container(width: 0.5, height: 32, color: context.jz.line), + Expanded( + child: InkWell( + onTap: () => u(t), + child: Padding( + padding: EdgeInsets.symmetric(vertical: 8), + child: Text( + '撤销', + textAlign: TextAlign.center, + style: TextStyle(fontSize: 11.5, color: context.jz.text2), + ), + ), + ), + ), + ], + ), + ], + ), + ); + } +} + +class ChatTabPage extends StatefulWidget { + const ChatTabPage({super.key}); + + @override + State createState() => _ChatTabPageState(); +} + +class _ChatTabPageState extends State { + final _chatController = ChatPageController(); + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: SessionStore.instance, + builder: (context, _) { + final accessState = currentAiAccessState(); + return ValueListenableBuilder( + valueListenable: PublicConfigApi.companionNotifier, + builder: (_, companion, __) { + final status = switch (accessState) { + AiAccessState.guest => '登录后可用', + AiAccessState.reauthenticate => '需要重新登录', + AiAccessState.cloudDisabled => '云连接已关闭', + null => '在线', + }; + final statusColor = accessState == null + ? AppTheme.primary + : AppTheme.orange; + return Scaffold( + appBar: AppBar( + title: Column( + children: [ + Text( + companion.name, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.w700, + ), + ), + Text( + status, + style: TextStyle(fontSize: 10, color: statusColor), + ), + ], + ), + actions: accessState == null + ? [ + Padding( + padding: const EdgeInsets.only(right: 10), + child: Tooltip( + message: '清理上下文', + child: Semantics( + button: true, + label: '清理聊天上下文', + child: Material( + color: context.jz.aiBackground, + shape: const CircleBorder(), + child: InkWell( + onTap: _chatController.clearContext, + customBorder: const CircleBorder(), + child: SizedBox( + width: 38, + height: 38, + child: Icon( + Icons.restart_alt_rounded, + size: 20, + color: AppTheme.ai, + ), + ), + ), + ), + ), + ), + ), + ] + : null, + ), + body: accessState == null + ? ChatPage(controller: _chatController) + : AiAccessGate(state: accessState), + ); + }, + ); + }, + ); + } +} diff --git a/frontend/lib/features/home/pages/home_page.dart b/frontend/lib/features/home/pages/home_page.dart new file mode 100644 index 0000000..7f2b391 --- /dev/null +++ b/frontend/lib/features/home/pages/home_page.dart @@ -0,0 +1,972 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/async_error_view.dart'; +import 'package:miaoji_zhang/features/home/pages/tx_detail_page.dart'; +import 'package:miaoji_zhang/features/home/pages/ledger_sheet.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +/// 首页明细(P1 / P20 空状态) +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => HomePageState(); +} + +class HomePageState extends State { + MonthSummary? _summary; + BudgetsData? _budgets; + bool _loading = true; + String? _error; + late DateTime _month; + + @override + void initState() { + super.initState(); + _month = ShanghaiTime.now; + PublicConfigApi.companionNotifier.addListener(_refreshCompanion); + TransactionEvents.revision.addListener(_refreshTransactions); + CurrentLedgerStore.instance.addListener(_refreshLedger); + refresh(); + } + + void _refreshCompanion() { + if (mounted) setState(() {}); + } + + void _refreshTransactions() { + if (mounted) refresh(); + } + + void _refreshLedger() { + if (mounted) refresh(); + } + + @override + void dispose() { + PublicConfigApi.companionNotifier.removeListener(_refreshCompanion); + TransactionEvents.revision.removeListener(_refreshTransactions); + CurrentLedgerStore.instance.removeListener(_refreshLedger); + super.dispose(); + } + + Future refresh() async { + setState(() { + _loading = true; + _error = null; + }); + try { + await CurrentLedgerStore.instance.ensureLoaded(); + final results = await Future.wait([ + TxApi.month(_month.year, _month.month), + BudgetApi.get(_month.year, _month.month), + ]); + if (mounted) { + setState(() { + _summary = results[0] as MonthSummary; + _budgets = results[1] as BudgetsData; + }); + } + } catch (error) { + try { + final summary = await TxApi.month(_month.year, _month.month); + if (mounted) setState(() => _summary = summary); + } catch (fallbackError) { + if (mounted) { + setState(() => _error = apiErrorMessage(fallbackError)); + } + } + } finally { + if (mounted) setState(() => _loading = false); + } + } + + @override + Widget build(BuildContext context) { + final s = _summary; + final budgets = _budgets; + final session = SessionStore.instance; + final showAiEntry = session.isGuest || session.aiEnabled; + final budgetsByCategory = { + for (final item in budgets?.categories ?? const []) + if (item.categoryId != null) item.categoryId!: item, + }; + if (!_loading && s == null && _error != null) { + return Scaffold( + body: SafeArea( + child: AsyncErrorView(message: _error!, onRetry: refresh), + ), + ); + } + return Scaffold( + body: SafeArea( + child: RefreshIndicator( + onRefresh: refresh, + color: AppTheme.primary, + child: NotificationListener( + onNotification: (notification) { + if (notification is ScrollStartNotification) { + _SwipeReveal.closeOpen(); + } + return false; + }, + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 16), + children: [ + SizedBox(height: 8), + Row( + children: [ + GestureDetector( + onTap: () { + _month = DateTime(_month.year, _month.month - 1); + refresh(); + }, + child: Transform( + alignment: Alignment.center, + transform: Matrix4.rotationY(3.1416), + child: AppIcons.icon( + AppIcons.chevronRight, + size: 16, + color: context.jz.text3, + ), + ), + ), + SizedBox(width: 6), + GestureDetector( + onTap: () => + LedgerSheet.show(context).then((_) => refresh()), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + CurrentLedgerStore.instance.currentName, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + ), + ), + AppIcons.icon( + AppIcons.chevronDown, + size: 16, + color: context.jz.text3, + ), + ], + ), + ), + SizedBox(width: 6), + GestureDetector( + onTap: () { + _month = DateTime(_month.year, _month.month + 1); + refresh(); + }, + child: AppIcons.icon( + AppIcons.chevronRight, + size: 16, + color: context.jz.text3, + ), + ), + Spacer(), + IconButton( + icon: AppIcons.icon( + AppIcons.search, + size: 20, + color: context.jz.text2, + ), + onPressed: () => context.push('/search'), + ), + ], + ), + Text( + '${_month.year}年${_month.month}月', + style: TextStyle(fontSize: 11, color: context.jz.text3), + ), + SizedBox(height: 6), + Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppTheme.primary, + borderRadius: BorderRadius.circular(18), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '${_month.month}月结余', + style: TextStyle( + fontSize: 12, + color: Colors.white.withValues(alpha: 0.85), + ), + ), + SizedBox(height: 5), + Text( + '¥ ${(s?.balance ?? 0).toStringAsFixed(2)}', + style: TextStyle( + fontSize: 30, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ), + SizedBox(height: 14), + Row( + children: [ + _HeroCol(label: '收入', value: s?.income ?? 0), + _HeroCol(label: '支出', value: s?.expense ?? 0), + _HeroCol( + label: '笔数', + value: (s?.count ?? 0).toDouble(), + isCount: true, + ), + ], + ), + ], + ), + ), + SizedBox(height: 12), + if (budgets != null) ...[ + _BudgetSummaryCard( + data: budgets, + onTap: () async { + await context.push('/budget'); + refresh(); + }, + ), + SizedBox(height: 12), + ], + if (showAiEntry) ...[ + GestureDetector( + onTap: () => context.go('/chat'), + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 13, + vertical: 11, + ), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Row( + children: [ + CircleAvatar( + radius: 19, + backgroundColor: AppTheme.ai, + child: AppIcons.icon( + AppIcons.avatarAsset( + PublicConfigApi.companionAvatarKey, + ), + size: 20, + color: Colors.white, + ), + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + PublicConfigApi.companionName, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w600, + ), + ), + Text( + SessionStore.instance.shouldUseLocalOnly + ? '登录并连接云端后可使用 AI 记账' + : '说句话就能记账', + style: TextStyle( + fontSize: 11, + color: context.jz.text2, + ), + ), + ], + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(16), + ), + child: Text( + '去聊天', + style: TextStyle( + fontSize: 12, + color: AppTheme.ai, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ), + ), + ), + SizedBox(height: 15), + ], + if (_loading && s == null) + Padding( + padding: EdgeInsets.only(top: 60), + child: Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ), + ) + else if (s == null || s.days.isEmpty) + _EmptyState( + aiEnabled: showAiEntry, + onAction: showAiEntry + ? () => context.go('/chat') + : () => context.push('/add'), + companionName: PublicConfigApi.companionName, + avatarKey: PublicConfigApi.companionAvatarKey, + ) + else ...[ + Padding( + padding: EdgeInsets.only(left: 2, bottom: 9), + child: Text( + '最近账单', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + ), + ), + ), + ...s.days.map( + (d) => _DayCard( + day: d, + onDeleted: refresh, + budgetsByCategory: budgetsByCategory, + ), + ), + ], + SizedBox(height: 12), + ], + ), + ), + ), + ), + ); + } +} + +class _BudgetSummaryCard extends StatelessWidget { + final BudgetsData data; + final VoidCallback onTap; + + const _BudgetSummaryCard({required this.data, required this.onTap}); + + @override + Widget build(BuildContext context) { + final total = data.total; + final amount = + total?.amount ?? + data.categories.fold(0, (sum, item) => sum + item.amount); + final spent = + total?.spent ?? + data.categories.fold(0, (sum, item) => sum + item.spent); + final rawRatio = amount <= 0 ? 0.0 : spent / amount; + final ratio = rawRatio.clamp(0.0, 1.0); + final warningColor = rawRatio >= 1 + ? AppTheme.red + : rawRatio >= 0.8 + ? AppTheme.orange + : AppTheme.primary; + + return Material( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(14), + child: Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: amount <= 0 + ? Row( + children: [ + Icon( + Icons.donut_small_rounded, + size: 22, + color: AppTheme.primary, + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '本月预算', + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + Text( + '设一个可执行的消费边界', + style: TextStyle( + fontSize: 11, + color: context.jz.text3, + ), + ), + ], + ), + ), + Text( + '去设置', + style: TextStyle( + fontSize: 12, + color: AppTheme.primary, + fontWeight: FontWeight.w700, + ), + ), + ], + ) + : Column( + children: [ + Row( + children: [ + Text( + total?.isRecurring == true ? '周期预算' : '本月预算', + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + Spacer(), + Text( + rawRatio >= 1 + ? '已超 ¥${(spent - amount).toStringAsFixed(0)}' + : '剩余 ¥${(amount - spent).toStringAsFixed(0)}', + style: TextStyle( + fontSize: 11.5, + color: warningColor, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + SizedBox(height: 9), + ClipRRect( + borderRadius: BorderRadius.circular(3), + child: LinearProgressIndicator( + value: ratio, + minHeight: 6, + backgroundColor: context.jz.line, + color: warningColor, + ), + ), + SizedBox(height: 7), + Row( + children: [ + Text( + '已用 ¥${spent.toStringAsFixed(0)}', + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + Spacer(), + Text( + '预算 ¥${amount.toStringAsFixed(0)} · ${(rawRatio * 100).toStringAsFixed(0)}%', + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} + +class _HeroCol extends StatelessWidget { + final String label; + final double value; + final bool isCount; + const _HeroCol({ + required this.label, + required this.value, + this.isCount = false, + }); + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: TextStyle( + fontSize: 11, + color: Colors.white.withValues(alpha: 0.85), + ), + ), + SizedBox(height: 2), + Text( + isCount + ? value.toInt().toString() + : '¥ ${value.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Colors.white, + ), + ), + ], + ), + ); + } +} + +class _EmptyState extends StatelessWidget { + final VoidCallback onAction; + final String companionName, avatarKey; + final bool aiEnabled; + + const _EmptyState({ + required this.onAction, + required this.aiEnabled, + required this.companionName, + required this.avatarKey, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 40), + child: Column( + children: [ + Container( + width: 100, + height: 100, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: aiEnabled + ? context.jz.aiBackground + : context.jz.primaryBackground, + ), + child: AppIcons.icon( + aiEnabled ? AppIcons.avatarAsset(avatarKey) : AppIcons.wallet, + size: 48, + color: aiEnabled ? AppTheme.ai : AppTheme.primary, + ), + ), + SizedBox(height: 16), + Text( + '还没有账单', + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w700), + ), + SizedBox(height: 6), + Text( + aiEnabled + ? '跟我说句话就能记账,比如\n"早饭包子豆浆 6 块" · "打车 45"' + : '点击下方按钮手动记录第一笔账单', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 11.5, + color: context.jz.text2, + height: 1.7, + ), + ), + SizedBox(height: 18), + ElevatedButton.icon( + style: ElevatedButton.styleFrom( + backgroundColor: aiEnabled ? AppTheme.ai : AppTheme.primary, + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + ), + onPressed: onAction, + icon: AppIcons.icon( + aiEnabled ? AppIcons.chat : AppIcons.plus, + size: 16, + color: Colors.white, + ), + label: Text(aiEnabled ? '和${companionName}聊聊' : '记一笔'), + ), + ], + ), + ); + } +} + +class _DayCard extends StatelessWidget { + final DayGroup day; + final VoidCallback onDeleted; + final Map budgetsByCategory; + const _DayCard({ + required this.day, + required this.onDeleted, + required this.budgetsByCategory, + }); + @override + Widget build(BuildContext context) { + final now = ShanghaiTime.now; + final isToday = + day.date.year == now.year && + day.date.month == now.month && + day.date.day == now.day; + return Container( + margin: const EdgeInsets.only(bottom: 10), + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 2), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 9), + child: Row( + children: [ + Text( + isToday + ? '今天 · ${day.date.month}月${day.date.day}日' + : '${day.date.month}月${day.date.day}日', + style: TextStyle(fontSize: 11, color: context.jz.text3), + ), + Spacer(), + Text( + [ + if (day.income > 0) '收 ¥${day.income.toStringAsFixed(2)}', + if (day.expense > 0) '支 ¥${day.expense.toStringAsFixed(2)}', + ].join(' · '), + style: TextStyle(fontSize: 11, color: context.jz.text3), + ), + ], + ), + ), + Divider(height: 0.5, color: context.jz.line), + ...day.items.map( + (t) => _TxRow( + tx: t, + onDeleted: onDeleted, + budget: budgetsByCategory[t.categoryId], + ), + ), + ], + ), + ); + } +} + +class _TxRow extends StatelessWidget { + final TxItem tx; + final VoidCallback onDeleted; + final BudgetItem? budget; + const _TxRow({required this.tx, required this.onDeleted, this.budget}); + + @override + Widget build(BuildContext context) { + final hh = + '${tx.occurredAt.hour.toString().padLeft(2, '0')}:${tx.occurredAt.minute.toString().padLeft(2, '0')}'; + return _SwipeReveal( + id: tx.id, + onTap: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => TxDetailPage(tx: tx)), + ), + onDelete: () async { + try { + await TxApi.delete(tx.id); + onDeleted(); + if (!context.mounted) return; + ScaffoldMessenger.of(context) + ..hideCurrentSnackBar() + ..showSnackBar( + SnackBar( + behavior: SnackBarBehavior.floating, + content: Text('已移入回收站'), + action: SnackBarAction( + label: '撤销', + textColor: AppTheme.primary, + onPressed: () async { + try { + await TxApi.restore(tx.id); + onDeleted(); + } catch (error) { + if (!context.mounted) return; + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text(apiErrorMessage(error))), + ); + } + }, + ), + ), + ); + } catch (error) { + if (context.mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } + }, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Row( + children: [ + CategoryIconBox( + iconKey: tx.categoryIcon, + colorKey: tx.categoryColor, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + tx.note ?? tx.categoryName, + style: TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w500, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + SizedBox(height: 2), + Row( + children: [ + Text( + hh, + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + if (!tx.isIncome && + budget != null && + budget!.amount > 0 && + budget!.spent / budget!.amount >= 0.8) ...[ + SizedBox(width: 5), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 1.5, + ), + decoration: BoxDecoration( + color: budget!.spent >= budget!.amount + ? context.jz.expenseBackground + : context.jz.warningBackground, + borderRadius: BorderRadius.circular(6), + ), + child: Text( + budget!.spent >= budget!.amount + ? '预算已超' + : '预算 ${(budget!.spent / budget!.amount * 100).toStringAsFixed(0)}%', + style: TextStyle( + fontSize: 9, + color: budget!.spent >= budget!.amount + ? AppTheme.red + : AppTheme.orange, + fontWeight: FontWeight.w700, + ), + ), + ), + ], + if (tx.isAi) ...[ + SizedBox(width: 5), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 1.5, + ), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(6), + ), + child: Text( + '✦ AI', + style: TextStyle( + fontSize: 9, + color: AppTheme.ai, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ], + ), + ], + ), + ), + Text( + '${tx.isIncome ? '+' : '-'}${tx.amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + color: tx.isIncome ? AppTheme.primary : context.jz.text, + ), + ), + ], + ), + ), + ); + } +} + +class _SwipeReveal extends StatefulWidget { + static const double actionWidth = 76; + static final ValueNotifier _openId = ValueNotifier(null); + + final int id; + final Widget child; + final VoidCallback onTap; + final Future Function() onDelete; + + const _SwipeReveal({ + required this.id, + required this.child, + required this.onTap, + required this.onDelete, + }); + + static void closeOpen() { + _openId.value = null; + } + + @override + State<_SwipeReveal> createState() => _SwipeRevealState(); +} + +class _SwipeRevealState extends State<_SwipeReveal> { + double _dragOffset = 0; + bool _dragging = false; + bool _deleting = false; + + void _startDrag(DragStartDetails details) { + _dragging = true; + _dragOffset = _SwipeReveal._openId.value == widget.id + ? -_SwipeReveal.actionWidth + : 0; + if (_SwipeReveal._openId.value != widget.id) { + _SwipeReveal.closeOpen(); + } + } + + void _updateDrag(DragUpdateDetails details) { + setState(() { + _dragOffset = (_dragOffset + details.delta.dx).clamp( + -_SwipeReveal.actionWidth, + 0, + ); + }); + } + + void _endDrag(DragEndDetails details) { + final reveal = + _dragOffset <= -36 || + (details.primaryVelocity != null && details.primaryVelocity! < -500); + _dragging = false; + _SwipeReveal._openId.value = reveal ? widget.id : null; + setState(() => _dragOffset = reveal ? -_SwipeReveal.actionWidth : 0); + } + + Future _delete() async { + if (_deleting) return; + setState(() => _deleting = true); + _SwipeReveal.closeOpen(); + try { + await widget.onDelete(); + } finally { + if (mounted) setState(() => _deleting = false); + } + } + + @override + Widget build(BuildContext context) { + return ValueListenableBuilder( + valueListenable: _SwipeReveal._openId, + builder: (_, openId, __) { + final target = _dragging + ? _dragOffset + : openId == widget.id + ? -_SwipeReveal.actionWidth + : 0.0; + return ClipRect( + child: Stack( + alignment: Alignment.centerRight, + children: [ + Positioned.fill( + child: Align( + alignment: Alignment.centerRight, + child: Semantics( + button: true, + label: '删除账单', + child: Material( + color: AppTheme.red, + child: InkWell( + onTap: _deleting ? null : _delete, + child: SizedBox( + width: _SwipeReveal.actionWidth, + child: Center( + child: _deleting + ? SizedBox( + width: 18, + height: 18, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : AppIcons.icon( + AppIcons.trash, + size: 20, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ), + ), + AnimatedContainer( + duration: _dragging + ? Duration.zero + : const Duration(milliseconds: 180), + curve: Curves.easeOutCubic, + transform: Matrix4.translationValues(target, 0, 0), + color: context.jz.card, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: openId == widget.id + ? _SwipeReveal.closeOpen + : widget.onTap, + onHorizontalDragStart: _startDrag, + onHorizontalDragUpdate: _updateDrag, + onHorizontalDragEnd: _endDrag, + onHorizontalDragCancel: () { + _dragging = false; + _SwipeReveal.closeOpen(); + }, + child: widget.child, + ), + ), + ], + ), + ); + }, + ); + } +} diff --git a/frontend/lib/features/home/pages/ledger_sheet.dart b/frontend/lib/features/home/pages/ledger_sheet.dart new file mode 100644 index 0000000..43427cb --- /dev/null +++ b/frontend/lib/features/home/pages/ledger_sheet.dart @@ -0,0 +1,289 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +/// P17 账本切换底部弹层 +class LedgerSheet extends StatefulWidget { + const LedgerSheet({super.key}); + + @override + State createState() => _LedgerSheetState(); + + static Future show(BuildContext context) => showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (_) => const LedgerSheet(), + ); +} + +class _LedgerSheetState extends State { + List _ledgers = []; + bool _loading = true; + + @override + void initState() { + super.initState(); + _load(); + } + + Future _load() async { + try { + await CurrentLedgerStore.instance.ensureLoaded(force: true); + if (mounted) { + setState(() { + _ledgers = CurrentLedgerStore.instance.ledgers; + _loading = false; + }); + } + } catch (error) { + if (mounted) { + setState(() => _loading = false); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } + } + + Future _setDefault(int id) async { + try { + await CurrentLedgerStore.instance.select(id); + if (mounted) Navigator.pop(context, true); + } catch (error) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } + } + + Future _create() async { + final name = await showJzTextInputSheet( + context, + title: '新建账本', + label: '账本名称', + maxLength: 12, + ); + if (name == null || name.isEmpty) return; + try { + await CurrentLedgerStore.instance.create(name); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _rename(LedgerInfo ledger) async { + final name = await showJzTextInputSheet( + context, + title: '重命名账本', + label: '账本名称', + initialValue: ledger.name, + maxLength: 12, + ); + if (name == null || name.isEmpty || name == ledger.name) return; + try { + await CurrentLedgerStore.instance.rename(ledger.id, name, ledger.iconKey); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _delete(LedgerInfo ledger) async { + final confirmed = await showJzConfirmSheet( + context, + title: '删除账本', + message: '仅能删除没有账单和预算的非默认账本。', + confirmLabel: '删除', + destructive: true, + ); + if (!confirmed) return; + try { + await CurrentLedgerStore.instance.delete(ledger.id); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _showActions(LedgerInfo ledger) async { + final action = await showJzOptionSheet( + context, + title: ledger.name, + options: [ + const JzOption(value: 'rename', label: '重命名'), + if (!ledger.isDefault) + const JzOption(value: 'delete', label: '删除账本', subtitle: '仅空账本可以删除'), + ], + ); + if (!mounted) return; + if (action == 'rename') await _rename(ledger); + if (action == 'delete') await _delete(ledger); + } + + void _showError(Object error) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(22)), + ), + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom + 12, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 36, + height: 5, + margin: const EdgeInsets.only(top: 10, bottom: 6), + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(3), + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 8), + child: Text( + '切换账本', + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w700), + ), + ), + if (_loading) + Padding( + padding: EdgeInsets.all(40), + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + else + ..._ledgers.map( + (l) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: 18, + vertical: 4, + ), + child: InkWell( + onTap: l.isDefault ? null : () => _setDefault(l.id), + child: Container( + padding: const EdgeInsets.all(13), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: l.isDefault ? AppTheme.primary : context.jz.line, + width: l.isDefault ? 1.5 : 0.5, + ), + ), + child: Row( + children: [ + Container( + width: 34, + height: 34, + decoration: BoxDecoration( + color: l.isDefault + ? context.jz.primaryBackground + : context.jz.background, + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: AppIcons.byKey( + l.iconKey, + size: 17, + color: l.isDefault + ? AppTheme.primary + : context.jz.text3, + ), + ), + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + l.name, + style: TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w600, + color: l.isDefault + ? AppTheme.primary + : context.jz.text, + ), + ), + Text( + '${l.transactionCount} 笔', + style: TextStyle( + fontSize: 11, + color: context.jz.text3, + ), + ), + ], + ), + ), + if (l.isDefault) + AppIcons.icon( + AppIcons.check, + size: 18, + color: AppTheme.primary, + ), + IconButton( + tooltip: '账本操作', + onPressed: () => _showActions(l), + icon: Icon(Icons.more_horiz_rounded, size: 19), + ), + ], + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 4), + child: InkWell( + onTap: _create, + child: Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(vertical: 12), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppIcons.icon( + AppIcons.plus, + size: 14, + color: context.jz.text2, + ), + SizedBox(width: 6), + Text( + '新建账本', + style: TextStyle(fontSize: 13, color: context.jz.text2), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/frontend/lib/features/home/pages/main_shell.dart b/frontend/lib/features/home/pages/main_shell.dart new file mode 100644 index 0000000..c06e4b5 --- /dev/null +++ b/frontend/lib/features/home/pages/main_shell.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +class MainShell extends StatefulWidget { + final StatefulNavigationShell shell; + const MainShell({super.key, required this.shell}); + + @override + State createState() => _MainShellState(); +} + +class _MainShellState extends State { + @override + void initState() { + super.initState(); + PublicConfigApi.refreshCompanion(); + } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: SessionStore.instance, + builder: (context, _) { + final session = SessionStore.instance; + final aiEnabled = session.aiEnabled; + final showAiEntry = session.isGuest || aiEnabled; + if (!showAiEntry && widget.shell.currentIndex == 2) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) widget.shell.goBranch(0); + }); + } + return Scaffold( + body: AnimatedSwitcher( + duration: const Duration(milliseconds: 200), + switchInCurve: Curves.easeOut, + switchOutCurve: Curves.easeIn, + child: KeyedSubtree( + key: ValueKey(widget.shell.currentIndex), + child: widget.shell, + ), + ), + bottomNavigationBar: Container( + decoration: BoxDecoration( + color: context.jz.card, + border: Border( + top: BorderSide(color: context.jz.line, width: 0.5), + ), + ), + child: SafeArea( + child: SizedBox( + height: 64, + child: Row( + children: [ + _tab('明细', AppIcons.home, 0), + _tab('统计', AppIcons.chart, 1), + SizedBox(width: 72, child: _fab()), + if (showAiEntry) + ValueListenableBuilder( + valueListenable: PublicConfigApi.companionNotifier, + builder: (_, companion, __) => + _tab(companion.name, AppIcons.chat, 2), + ), + _tab('我的', AppIcons.user, 3), + ], + ), + ), + ), + ), + ); + }, + ); + } + + Widget _tab(String label, String icon, int branch) { + final active = widget.shell.currentIndex == branch; + final color = active ? AppTheme.primary : context.jz.text3; + + return Expanded( + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: () => widget.shell.goBranch(branch), + child: SizedBox( + height: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppIcons.icon(icon, size: 21, color: color), + const SizedBox(height: 3), + Text( + label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10, + color: color, + fontWeight: active ? FontWeight.w600 : null, + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget _fab() { + return Material( + color: Colors.transparent, + child: InkWell( + onTap: () async { + final amount = await context.push('/add'); + if (!mounted || amount == null) return; + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('已记一笔 ¥${amount.toStringAsFixed(2)}')), + ); + }, + child: Center( + child: Container( + width: 46, + height: 46, + margin: const EdgeInsets.only(top: 4), + decoration: BoxDecoration( + color: AppTheme.primary, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: AppTheme.primary.withValues(alpha: 0.24), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: AppIcons.icon(AppIcons.plus, size: 22, color: Colors.white), + ), + ), + ), + ); + } +} diff --git a/frontend/lib/features/home/pages/search_page.dart b/frontend/lib/features/home/pages/search_page.dart new file mode 100644 index 0000000..2159e8d --- /dev/null +++ b/frontend/lib/features/home/pages/search_page.dart @@ -0,0 +1,260 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/async_error_view.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +/// 搜索页(P19) +class SearchPage extends StatefulWidget { + const SearchPage({super.key}); + + @override + State createState() => _SearchPageState(); +} + +class _SearchPageState extends State { + final _input = TextEditingController(); + List _results = []; + bool _aiOnly = false; + bool _searched = false; + bool _loading = false; + String? _error; + String? _timeFilter; // today | week | month + double? _minAmount, _maxAmount; + + Future _search() async { + final q = _input.text.trim(); + if (q.isEmpty && + !_aiOnly && + _timeFilter == null && + _minAmount == null && + _maxAmount == null) + return; + setState(() { + _loading = true; + _error = null; + }); + try { + final now = ShanghaiTime.now; + DateTime? from; + DateTime? to; + if (_timeFilter == 'today') { + from = DateTime(now.year, now.month, now.day); + to = from.add(const Duration(days: 1)); + } else if (_timeFilter == 'week') { + final today = DateTime(now.year, now.month, now.day); + from = today.subtract(Duration(days: today.weekday - 1)); + to = from.add(const Duration(days: 7)); + } else if (_timeFilter == 'month') { + from = DateTime(now.year, now.month); + to = DateTime(now.year, now.month + 1); + } + final list = await SearchApi.search( + q: q, + aiOnly: _aiOnly, + minAmount: _minAmount, + maxAmount: _maxAmount, + from: from, + to: to, + ); + if (mounted) + setState(() { + _results = list; + _searched = true; + }); + } catch (error) { + if (mounted) setState(() => _error = apiErrorMessage(error)); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + @override + Widget build(BuildContext context) { + final total = _results + .where((t) => !t.isIncome) + .fold(0, (s, t) => s + t.amount); + return Scaffold( + appBar: AppBar( + title: TextField( + controller: _input, + autofocus: true, + textInputAction: TextInputAction.search, + onSubmitted: (_) => _search(), + decoration: InputDecoration( + hintText: '搜备注 / 分类 / 你说过的话', + contentPadding: EdgeInsets.symmetric(horizontal: 14, vertical: 8), + ), + ), + actions: [TextButton(onPressed: _search, child: Text('搜索'))], + ), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Wrap( + spacing: 6, + runSpacing: 6, + children: [ + FilterChip( + label: Text('仅 AI 记账', style: TextStyle(fontSize: 11)), + selected: _aiOnly, + selectedColor: context.jz.aiBackground, + checkmarkColor: AppTheme.ai, + onSelected: (v) { + setState(() => _aiOnly = v); + _search(); + }, + ), + ...['today', 'week', 'month'].map( + (t) => FilterChip( + label: Text( + {'today': '今天', 'week': '本周', 'month': '本月'}[t]!, + style: TextStyle(fontSize: 11), + ), + selected: _timeFilter == t, + selectedColor: context.jz.primaryBackground, + onSelected: (v) { + setState(() => _timeFilter = v ? t : null); + _search(); + }, + ), + ), + if (_searched && !_loading) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + child: Text( + '${_results.length} 笔 · ¥${total.toStringAsFixed(2)}', + style: TextStyle(fontSize: 11, color: context.jz.text3), + ), + ), + ], + ), + ), + Expanded( + child: _loading + ? Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + : _error != null + ? AsyncErrorView(message: _error!, onRetry: _search) + : !_searched + ? Center( + child: Text( + '输入关键词搜账单\n也能搜到你和 AI 说过的原话', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12, + color: context.jz.text3, + height: 1.8, + ), + ), + ) + : _results.isEmpty + ? Center( + child: Text( + '没有找到相关账单', + style: TextStyle(fontSize: 12, color: context.jz.text3), + ), + ) + : ListView.builder( + padding: const EdgeInsets.symmetric(horizontal: 16), + itemCount: _results.length, + itemBuilder: (ctx, i) { + final t = _results[i]; + return Container( + margin: const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.symmetric( + horizontal: 13, + vertical: 10, + ), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: context.jz.line, + width: 0.5, + ), + ), + child: Row( + children: [ + CategoryIconBox( + iconKey: t.categoryIcon, + colorKey: t.categoryColor, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.note ?? t.categoryName, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + ), + ), + SizedBox(height: 2), + Row( + children: [ + Text( + '${t.occurredAt.month}月${t.occurredAt.day}日', + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + if (t.isAi) ...[ + SizedBox(width: 5), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 1.5, + ), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular( + 6, + ), + ), + child: Text( + '✦ AI', + style: TextStyle( + fontSize: 9, + color: AppTheme.ai, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ], + ), + ], + ), + ), + Text( + '${t.isIncome ? '+' : '-'}${t.amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: t.isIncome + ? AppTheme.primary + : context.jz.text, + ), + ), + ], + ), + ); + }, + ), + ), + ], + ), + ); + } +} diff --git a/frontend/lib/features/home/pages/transaction_edit_page.dart b/frontend/lib/features/home/pages/transaction_edit_page.dart new file mode 100644 index 0000000..7016091 --- /dev/null +++ b/frontend/lib/features/home/pages/transaction_edit_page.dart @@ -0,0 +1,288 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +class TransactionEditPage extends StatefulWidget { + final TxItem transaction; + + const TransactionEditPage({super.key, required this.transaction}); + + @override + State createState() => _TransactionEditPageState(); +} + +class _TransactionEditPageState extends State { + late final TextEditingController _amount; + late final TextEditingController _note; + late final TextEditingController _payment; + late String _type; + late int _ledgerId; + late int _categoryId; + late DateTime _occurredAt; + List _categories = const []; + bool _loading = true; + bool _saving = false; + + @override + void initState() { + super.initState(); + final transaction = widget.transaction; + _amount = TextEditingController( + text: transaction.amount.toStringAsFixed(2), + ); + _note = TextEditingController(text: transaction.note ?? ''); + _payment = TextEditingController(text: transaction.paymentMethod ?? ''); + _type = transaction.type; + _ledgerId = transaction.ledgerId; + _categoryId = transaction.categoryId; + _occurredAt = transaction.occurredAt; + _loadCategories(); + } + + @override + void dispose() { + _amount.dispose(); + _note.dispose(); + _payment.dispose(); + super.dispose(); + } + + Future _loadCategories() async { + setState(() => _loading = true); + try { + await CurrentLedgerStore.instance.ensureLoaded(); + final categories = await TxApi.categories(_type); + if (!categories.any((category) => category.id == _categoryId) && + categories.isNotEmpty) { + _categoryId = categories.first.id; + } + if (mounted) setState(() => _categories = categories); + } catch (error) { + if (mounted) _showError(error); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + Future _changeType(String type) async { + if (type == _type) return; + setState(() => _type = type); + await _loadCategories(); + } + + Future _pickDateTime() async { + final value = await showJzDateTimeSheet( + context, + initial: _occurredAt, + firstDate: DateTime(2000), + lastDate: ShanghaiTime.now.add(const Duration(days: 1)), + title: '选择发生时间', + ); + if (value != null && mounted) setState(() => _occurredAt = value); + } + + Future _selectCategory() async { + final value = await showJzOptionSheet( + context, + title: '选择分类', + options: _categories + .map( + (category) => JzOption( + value: category.id, + label: category.name, + leading: CategoryIconBox( + iconKey: category.iconKey, + colorKey: category.colorKey, + size: 32, + ), + ), + ) + .toList(), + selected: _categoryId, + ); + if (value != null && mounted) setState(() => _categoryId = value); + } + + Future _selectLedger() async { + final ledgers = CurrentLedgerStore.instance.ledgers; + final value = await showJzOptionSheet( + context, + title: '选择所属账本', + options: ledgers + .map( + (ledger) => JzOption( + value: ledger.id, + label: ledger.name, + subtitle: ledger.isDefault ? '当前默认账本' : null, + ), + ) + .toList(), + selected: _ledgerId, + ); + if (value != null && mounted) setState(() => _ledgerId = value); + } + + Future _save() async { + final amount = double.tryParse(_amount.text.trim()); + if (amount == null || amount <= 0) { + _showError(StateError('请输入正确金额')); + return; + } + setState(() => _saving = true); + try { + final updated = await TxApi.update( + widget.transaction.id, + ledgerId: _ledgerId, + categoryId: _categoryId, + type: _type, + amount: amount, + note: _note.text.trim(), + paymentMethod: _payment.text.trim(), + occurredAt: _occurredAt, + ); + if (mounted) Navigator.pop(context, updated); + } catch (error) { + if (mounted) _showError(error); + } finally { + if (mounted) setState(() => _saving = false); + } + } + + void _showError(Object error) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + + @override + Widget build(BuildContext context) { + final ledgers = CurrentLedgerStore.instance.ledgers; + return Scaffold( + appBar: AppBar(title: Text('编辑账单')), + body: _loading + ? Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + : ListView( + padding: const EdgeInsets.all(16), + children: [ + JzSegmentedControl( + value: _type, + options: const [ + JzOption(value: 'expense', label: '支出'), + JzOption(value: 'income', label: '收入'), + ], + onChanged: _changeType, + ), + SizedBox(height: 14), + TextField( + controller: _amount, + keyboardType: const TextInputType.numberWithOptions( + decimal: true, + ), + decoration: InputDecoration( + labelText: '金额', + prefixText: '¥ ', + ), + ), + SizedBox(height: 12), + _SelectField( + label: '分类', + value: + _categories + .where((category) => category.id == _categoryId) + .map((category) => category.name) + .firstOrNull ?? + '请选择', + onTap: _selectCategory, + ), + SizedBox(height: 12), + _SelectField( + label: '所属账本', + value: + ledgers + .where((ledger) => ledger.id == _ledgerId) + .map((ledger) => ledger.name) + .firstOrNull ?? + '请选择', + onTap: _selectLedger, + ), + SizedBox(height: 12), + TextField( + controller: _note, + maxLength: 50, + decoration: InputDecoration(labelText: '备注'), + ), + SizedBox(height: 4), + TextField( + controller: _payment, + maxLength: 20, + decoration: InputDecoration(labelText: '支付方式'), + ), + SizedBox(height: 4), + ListTile( + contentPadding: EdgeInsets.zero, + title: Text('发生时间'), + subtitle: Text(_occurredAt.toString().substring(0, 16)), + trailing: Icon(Icons.chevron_right), + onTap: _pickDateTime, + ), + if (widget.transaction.sourceText?.isNotEmpty == true) ...[ + SizedBox(height: 8), + InputDecorator( + decoration: InputDecoration(labelText: 'AI 原话(只读)'), + child: Text(widget.transaction.sourceText!), + ), + ], + SizedBox(height: 24), + FilledButton( + onPressed: _saving ? null : _save, + child: Text(_saving ? '保存中...' : '保存修改'), + ), + ], + ), + ); + } +} + +class _SelectField extends StatelessWidget { + final String label; + final String value; + final VoidCallback onTap; + + const _SelectField({ + required this.label, + required this.value, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(14), + child: InputDecorator( + decoration: InputDecoration(labelText: label), + child: Row( + children: [ + Expanded( + child: Text( + value, + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w600), + ), + ), + Icon(Icons.keyboard_arrow_down_rounded, color: context.jz.text3), + ], + ), + ), + ); + } +} diff --git a/frontend/lib/features/home/pages/tx_detail_page.dart b/frontend/lib/features/home/pages/tx_detail_page.dart new file mode 100644 index 0000000..17ab7e9 --- /dev/null +++ b/frontend/lib/features/home/pages/tx_detail_page.dart @@ -0,0 +1,214 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/features/home/pages/transaction_edit_page.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +/// P11 账单详情:金额、分类、来源追溯(AI 原话)、时间、支付方式 +class TxDetailPage extends StatelessWidget { + final TxItem tx; + const TxDetailPage({super.key, required this.tx}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('账单详情'), + actions: [ + IconButton( + icon: AppIcons.icon( + AppIcons.edit, + size: 18, + color: context.jz.text2, + ), + onPressed: () async { + final updated = await Navigator.push( + context, + MaterialPageRoute( + builder: (_) => TransactionEditPage(transaction: tx), + ), + ); + if (updated != null && context.mounted) { + TransactionEvents.notifyChanged(); + Navigator.pop(context, true); + } + }, + ), + IconButton( + icon: AppIcons.icon(AppIcons.trash, size: 18, color: AppTheme.red), + onPressed: () async { + await TxApi.delete(tx.id); + TransactionEvents.notifyChanged(); + if (context.mounted) { + Navigator.pop(context, true); + } + }, + ), + ], + ), + body: ListView( + padding: const EdgeInsets.all(16), + children: [ + // 金额头部 + Container( + padding: const EdgeInsets.symmetric(vertical: 28), + margin: const EdgeInsets.only(bottom: 14), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(18), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Column( + children: [ + Text( + '${tx.isIncome ? '+' : '-'}¥${tx.amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 32, + fontWeight: FontWeight.w800, + color: tx.isIncome ? AppTheme.primary : context.jz.text, + ), + ), + SizedBox(height: 6), + Text( + ShanghaiTime.formatCivil(tx.occurredAt), + style: TextStyle(fontSize: 12, color: context.jz.text3), + ), + ], + ), + ), + // 分类 + _Row( + k: '分类', + child: Row( + children: [ + CategoryIconBox( + iconKey: tx.categoryIcon, + colorKey: tx.categoryColor, + size: 30, + ), + SizedBox(width: 10), + Text( + tx.categoryName, + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w600), + ), + ], + ), + ), + // 类型 + _Row( + k: '类型', + child: Text( + tx.isIncome ? '收入' : '支出', + style: TextStyle(fontSize: 13.5), + ), + ), + // 备注 + if (tx.note != null && tx.note!.isNotEmpty) + _Row( + k: '备注', + child: Text(tx.note!, style: TextStyle(fontSize: 13.5)), + ), + // 支付方式 + if (tx.paymentMethod != null && tx.paymentMethod!.isNotEmpty) + _Row( + k: '支付方式', + child: Text(tx.paymentMethod!, style: TextStyle(fontSize: 13.5)), + ), + _Row( + k: '记账方式', + child: Row( + children: [ + if (tx.isAi || tx.isRecognition) ...[ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 7, + vertical: 2, + ), + decoration: BoxDecoration( + color: tx.isAi + ? context.jz.aiBackground + : context.jz.primaryBackground, + borderRadius: BorderRadius.circular(6), + ), + child: Text( + tx.isAi ? '✦ AI' : '智能识别', + style: TextStyle( + fontSize: 10, + color: tx.isAi ? AppTheme.ai : AppTheme.primary, + fontWeight: FontWeight.w600, + ), + ), + ), + SizedBox(width: 7), + ], + Text(tx.sourceLabel, style: TextStyle(fontSize: 13.5)), + ], + ), + ), + if ((tx.isAi || tx.isRecognition) && + tx.sourceText != null && + tx.sourceText!.isNotEmpty) + _Row( + k: tx.isAi ? 'AI 原话' : '识别依据', + child: Container( + width: double.infinity, + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: tx.isAi + ? context.jz.aiBackground + : context.jz.primaryBackground, + borderRadius: BorderRadius.circular(10), + ), + child: Text( + '"${tx.sourceText}"', + style: TextStyle( + fontSize: 12, + color: context.jz.text2, + height: 1.5, + ), + ), + ), + ), + // 来源标签 + _Row( + k: '来源', + child: Text(tx.sourceLabel, style: TextStyle(fontSize: 13.5)), + ), + ], + ), + ); + } +} + +class _Row extends StatelessWidget { + final String k; + final Widget child; + const _Row({required this.k, required this.child}); + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 13), + margin: const EdgeInsets.only(bottom: 9), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(13), + border: Border.all(color: context.jz.line, width: 0.5), + ), + child: Row( + children: [ + SizedBox( + width: 70, + child: Text( + k, + style: TextStyle(fontSize: 12, color: context.jz.text3), + ), + ), + Expanded(child: child), + ], + ), + ); + } +} diff --git a/frontend/lib/features/onboarding/pages/onboarding_page.dart b/frontend/lib/features/onboarding/pages/onboarding_page.dart new file mode 100644 index 0000000..212882d --- /dev/null +++ b/frontend/lib/features/onboarding/pages/onboarding_page.dart @@ -0,0 +1,436 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +/// 首次引导:选模式 → 选 AI 伙伴(P9 + P10) +/// 形象和性格从后台 API 动态拉取,管理员新增/修改即时生效 +class OnboardingPage extends StatefulWidget { + const OnboardingPage({super.key}); + @override + State createState() => _OnboardingPageState(); +} + +class _OnboardingPageState extends State { + int _step = 0; + String _mode = 'normal'; + String _avatar = 'cat'; + String _persona = 'sassy_cat'; + bool _saving = false; + List _avatars = []; + List _personas = []; + bool _loaded = false; + + @override + void initState() { + super.initState(); + _loadConfig(); + } + + Future _loadConfig() async { + try { + final avatars = await PublicConfigApi.avatars(); + final personas = await PublicConfigApi.personas(); + if (mounted) + setState(() { + _avatars = avatars; + _personas = personas; + if (avatars.isNotEmpty) _avatar = avatars.first.key; + if (personas.isNotEmpty) _persona = personas.first.key; + _loaded = true; + }); + } catch (_) { + // API 失败用硬编码兜底 + if (mounted) setState(() => _loaded = true); + } + } + + // 兜底数据(API 不可用时) + static const _fallbackAvatars = [ + ('cat', '小账喵', AppIcons.cat), + ('dog', '阿福汪', AppIcons.dog), + ('robot', '账小智', AppIcons.robot), + ]; + static const _fallbackPersonas = [ + ('sassy_cat', '毒舌猫娘', '乱花钱会被无情吐槽'), + ('gentle', '温柔小暖', '永远鼓励,温柔提醒'), + ('strict', '严格管家', '理性专业,数据说话'), + ('meme', '沙雕损友', '玩梗高手,快乐记账'), + ]; + + Future _finish() async { + setState(() => _saving = true); + try { + await AuthApi.completeOnboarding( + appMode: _mode, + avatarKey: _avatar, + personaKey: _persona, + ); + if (!mounted) return; + context.go(_mode == 'ai' ? '/ai-mode' : '/home'); + } catch (e) { + if (!mounted) return; + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } finally { + if (mounted) setState(() => _saving = false); + } + } + + @override + Widget build(BuildContext context) { + if (!_loaded) + return const Scaffold( + body: Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ), + ); + return Scaffold( + body: SafeArea( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 26), + child: _step == 0 ? _ModeStep() : _CompanionStep(), + ), + ), + ); + } + + Widget _ModeStep() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 8), + Row( + children: [ + Container( + width: 28, + height: 5, + decoration: BoxDecoration( + color: AppTheme.primary, + borderRadius: BorderRadius.circular(3), + ), + ), + SizedBox(width: 6), + Container( + width: 18, + height: 5, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(3), + ), + ), + ], + ), + SizedBox(height: 12), + Text( + '你想怎么用它?', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w800), + ), + SizedBox(height: 6), + Text( + '两种完全不同的体验,之后随时可以切换', + style: TextStyle(fontSize: 12, color: context.jz.text2), + ), + SizedBox(height: 18), + _ModeCard( + selected: _mode == 'normal', + iconAsset: AppIcons.wallet, + iconColor: AppTheme.primary, + title: '普通记账模式', + desc: '经典账本界面,手动记账、报表统计一应俱全,AI 助手随叫随到', + onTap: () => setState(() => _mode = 'normal'), + ), + SizedBox(height: 11), + _ModeCard( + selected: _mode == 'ai', + iconAsset: AppIcons.sparkle, + iconColor: AppTheme.ai, + title: '全 AI 模式', + desc: '没有复杂界面,打开就是和 AI 聊天,说句话就完成记账、查账、看报告', + onTap: () => setState(() => _mode = 'ai'), + ), + Spacer(), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => setState(() => _step = 1), + child: Text('继续'), + ), + ), + SizedBox(height: 16), + ], + ); + } + + Widget _CompanionStep() { + // 优先 API 数据,回退硬编码 + final avatars = _avatars.isNotEmpty + ? _avatars + .map( + (a) => ( + a.key, + a.defaultName, + a.key == 'dog' + ? AppIcons.dog + : a.key == 'robot' + ? AppIcons.robot + : AppIcons.cat, + ), + ) + .toList() + : _fallbackAvatars; + final personas = _personas.isNotEmpty + ? _personas.map((p) => (p.key, p.name, p.description)).toList() + : _fallbackPersonas; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 8), + Row( + children: [ + Container( + width: 18, + height: 5, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(3), + ), + ), + SizedBox(width: 6), + Container( + width: 28, + height: 5, + decoration: BoxDecoration( + color: AppTheme.primary, + borderRadius: BorderRadius.circular(3), + ), + ), + ], + ), + SizedBox(height: 12), + Text( + '认识你的 AI 伙伴', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w800), + ), + SizedBox(height: 6), + Text( + '选形象、挑性格 —— 它就是你的专属记账搭子', + style: TextStyle(fontSize: 12, color: context.jz.text2), + ), + SizedBox(height: 14), + SizedBox( + height: 96, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: avatars.map((a) { + final on = _avatar == a.$1; + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 11), + child: GestureDetector( + onTap: () => setState(() => _avatar = a.$1), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + AnimatedContainer( + duration: const Duration(milliseconds: 220), + curve: Curves.elasticOut, + width: 56, + height: 56, + child: Transform.scale( + scale: on ? 1.18 : 1.0, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: on ? AppTheme.ai : context.jz.aiBackground, + boxShadow: on + ? [ + BoxShadow( + color: AppTheme.ai.withValues( + alpha: 0.3, + ), + blurRadius: 14, + ), + ] + : null, + ), + child: Center( + child: AppIcons.icon( + a.$3, + size: on ? 28 : 24, + color: on ? Colors.white : context.jz.text3, + ), + ), + ), + ), + ), + SizedBox(height: 6), + Text( + a.$2, + style: TextStyle( + fontSize: 10, + color: on ? AppTheme.ai : context.jz.text3, + fontWeight: on ? FontWeight.w600 : null, + ), + ), + ], + ), + ), + ); + }).toList(), + ), + ), + SizedBox(height: 16), + Expanded( + child: GridView.count( + crossAxisCount: 2, + mainAxisSpacing: 10, + crossAxisSpacing: 10, + childAspectRatio: 1.5, + children: personas.map((p) { + final on = _persona == p.$1; + return GestureDetector( + onTap: () => setState(() => _persona = p.$1), + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + curve: Curves.easeOut, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: on ? context.jz.aiBackground : Colors.white, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: on ? AppTheme.ai : context.jz.line, + width: 1.5, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppIcons.icon( + AppIcons.chat, + size: 18, + color: on ? AppTheme.ai : context.jz.text3, + ), + SizedBox(height: 8), + Text( + p.$2, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 3), + Text( + p.$3, + style: TextStyle(fontSize: 10, color: context.jz.text2), + ), + ], + ), + ), + ); + }).toList(), + ), + ), + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: AppTheme.ai), + onPressed: _saving ? null : _finish, + child: _saving + ? SizedBox( + height: 20, + width: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : Text('开始记账之旅'), + ), + ), + SizedBox(height: 16), + ], + ); + } +} + +class _ModeCard extends StatelessWidget { + final bool selected; + final String iconAsset; + final Color iconColor; + final String title, desc; + final VoidCallback onTap; + const _ModeCard({ + required this.selected, + required this.iconAsset, + required this.iconColor, + required this.title, + required this.desc, + required this.onTap, + }); + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + curve: Curves.easeOut, + padding: const EdgeInsets.all(15), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(18), + border: Border.all( + color: selected ? AppTheme.primary : context.jz.line, + width: selected ? 2 : 1.5, + ), + ), + child: Row( + children: [ + AppIcons.icon(iconAsset, size: 22, color: iconColor), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + SizedBox(height: 4), + Text( + desc, + style: TextStyle(fontSize: 10.5, color: context.jz.text2), + ), + ], + ), + ), + SizedBox(width: 8), + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: selected ? AppTheme.primary : context.jz.line, + width: 1.5, + ), + color: selected ? AppTheme.primary : null, + ), + child: selected + ? AppIcons.icon(AppIcons.check, size: 13, color: Colors.white) + : null, + ), + ], + ), + ), + ); + } +} diff --git a/frontend/lib/features/settings/account_data_page.dart b/frontend/lib/features/settings/account_data_page.dart new file mode 100644 index 0000000..309386f --- /dev/null +++ b/frontend/lib/features/settings/account_data_page.dart @@ -0,0 +1,306 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:share_plus/share_plus.dart'; + +class AccountDataPage extends StatefulWidget { + const AccountDataPage({super.key}); + + @override + State createState() => _AccountDataPageState(); +} + +class _AccountDataPageState extends State { + UserProfile? _profile; + bool _busy = false; + + @override + void initState() { + super.initState(); + _cleanupStaleExports(); + _load(); + } + + Future _cleanupStaleExports() async { + try { + final directory = await getTemporaryDirectory(); + final cutoff = DateTime.now().subtract(const Duration(hours: 24)); + await for (final entity in directory.list()) { + if (entity is! File || + !entity.path.contains('jizhi-export-') || + !entity.path.endsWith('.zip')) { + continue; + } + final modified = await entity.lastModified(); + if (modified.isBefore(cutoff)) await entity.delete(); + } + } catch (_) { + // Export cleanup is best-effort and must not block the settings page. + } + } + + Future _load() async { + try { + final profile = await AuthApi.me(); + if (mounted) setState(() => _profile = profile); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _ask({ + required String title, + required String label, + bool obscure = false, + String? initialValue, + String? subtitle, + }) { + return showJzTextInputSheet( + context, + title: title, + label: label, + subtitle: subtitle, + initialValue: initialValue, + obscureText: obscure, + maxLength: obscure ? null : 32, + ); + } + + Future _editNickname() async { + final nickname = await _ask( + title: '修改昵称', + label: '昵称', + initialValue: _profile?.nickname ?? '', + ); + if (nickname == null) return; + try { + final profile = await AuthApi.updateProfile(nickname); + if (mounted) setState(() => _profile = profile); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _changePassword() async { + final current = await _ask(title: '验证当前密码', label: '当前密码', obscure: true); + if (current == null || current.isEmpty) return; + final next = await _ask( + title: '设置新密码', + label: '新密码(至少 6 位)', + obscure: true, + ); + if (next == null || next.isEmpty) return; + try { + await AuthApi.changePassword(current, next); + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('密码已修改,其他设备已退出登录'))); + } + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _export() async { + File? temporaryFile; + setState(() => _busy = true); + try { + final bytes = await AuthApi.exportData(); + if (bytes.isEmpty) throw StateError('导出文件为空'); + final directory = await getTemporaryDirectory(); + final name = + 'jizhi-export-' + + DateTime.now().millisecondsSinceEpoch.toString() + + '.zip'; + temporaryFile = File(directory.path + Platform.pathSeparator + name); + await temporaryFile.writeAsBytes(bytes, flush: true); + await SharePlus.instance.share( + ShareParams( + files: [XFile(temporaryFile.path, mimeType: 'application/zip')], + fileNameOverrides: [name], + title: '记之数据导出', + subject: '记之数据导出', + ), + ); + } catch (error) { + if (mounted) _showError(error); + } finally { + if (temporaryFile != null) { + try { + if (await temporaryFile.exists()) await temporaryFile.delete(); + } catch (_) { + // The operating system can briefly retain a shared file handle. + } + } + if (mounted) setState(() => _busy = false); + } + } + + Future _closeAccount() async { + final understood = await showJzConfirmSheet( + context, + title: '申请注销账号', + message: + '提交后会退出所有设备,并进入 15 天后悔期。期间使用正确账号密码登录会自动取消注销;到期后账本、账单、预算和聊天记录将永久删除。', + confirmLabel: '我已了解', + destructive: true, + content: Container( + width: double.infinity, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: context.jz.warningBackground, + borderRadius: BorderRadius.circular(12), + ), + child: Text( + '建议先导出数据。后悔期结束后,数据无法恢复。', + style: TextStyle( + fontSize: 11.5, + color: context.jz.text2, + height: 1.5, + ), + ), + ), + ); + if (!understood || !mounted) return; + + final password = await _ask( + title: '验证身份', + label: '输入登录密码', + obscure: true, + subtitle: '这是第二次确认,用于验证账号所有权', + ); + if (password == null || password.isEmpty || !mounted) return; + + final confirmation = await _ask( + title: '最后确认', + label: '输入“注销账号”', + subtitle: '提交后立即退出,15 天内重新登录可恢复账号', + ); + if (confirmation == null) return; + if (confirmation.trim() != '注销账号') { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('请输入完整的“注销账号”'))); + return; + } + + setState(() => _busy = true); + try { + final scheduledAt = await AuthApi.requestAccountClosure( + password, + confirmation, + ); + if (!mounted) return; + final notice = + '注销申请已提交,将于 ' + + scheduledAt.month.toString() + + '月' + + scheduledAt.day.toString() + + '日永久删除'; + context.go( + Uri(path: '/login', queryParameters: {'notice': notice}).toString(), + ); + } catch (error) { + if (mounted) _showError(error); + } finally { + if (mounted) setState(() => _busy = false); + } + } + + void _showError(Object error) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('账号与数据')), + body: ListView( + padding: const EdgeInsets.all(16), + children: [ + Card( + child: Column( + children: [ + ListTile( + title: Text('昵称'), + subtitle: Text(_profile?.nickname ?? '未设置'), + trailing: Icon(Icons.chevron_right_rounded), + onTap: _editNickname, + ), + if (!SessionStore.instance.isGuest) ...[ + Divider(height: 1), + ListTile( + title: Text('修改密码'), + trailing: Icon(Icons.chevron_right_rounded), + onTap: _changePassword, + ), + ], + ], + ), + ), + SizedBox(height: 12), + Card( + child: ListTile( + leading: Icon(Icons.archive_outlined, color: AppTheme.primary), + title: Text('导出全部数据'), + subtitle: Text('ZIP 包含交易/预算 CSV 和完整 JSON,不含密码与密钥'), + trailing: _busy + ? SizedBox( + width: 18, + height: 18, + child: CircularProgressIndicator(strokeWidth: 2), + ) + : Icon(Icons.ios_share_rounded), + onTap: _busy ? null : _export, + ), + ), + SizedBox(height: 12), + Card( + child: Column( + children: [ + _legalTile('用户协议', 'terms'), + Divider(height: 1), + _legalTile('隐私政策', 'privacy'), + Divider(height: 1), + _legalTile('权限用途说明', 'permissions'), + Divider(height: 1), + _legalTile('第三方 SDK 清单', 'sdk'), + ], + ), + ), + SizedBox(height: 12), + if (!SessionStore.instance.isGuest) + Card( + child: ListTile( + leading: Icon(Icons.person_off_outlined, color: AppTheme.red), + title: Text('注销账号', style: TextStyle(color: AppTheme.red)), + subtitle: Text('15 天后永久删除,可在后悔期内登录恢复'), + trailing: Icon( + Icons.chevron_right_rounded, + color: AppTheme.red, + ), + onTap: _busy ? null : _closeAccount, + ), + ), + ], + ), + ); + } + + Widget _legalTile(String title, String kind) => ListTile( + leading: Icon(Icons.verified_user_outlined, color: AppTheme.primary), + title: Text(title), + trailing: Icon(Icons.chevron_right_rounded), + onTap: () => context.push('/legal/' + kind), + ); +} diff --git a/frontend/lib/features/settings/appearance_page.dart b/frontend/lib/features/settings/appearance_page.dart new file mode 100644 index 0000000..84a32b7 --- /dev/null +++ b/frontend/lib/features/settings/appearance_page.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/theme/theme_store.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +class AppearancePage extends StatelessWidget { + const AppearancePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('外观设置')), + body: ListView( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 24), + children: [ + Card( + child: Padding( + padding: const EdgeInsets.all(16), + child: AnimatedBuilder( + animation: ThemeStore.instance, + builder: (context, _) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + '显示模式', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w800, + ), + ), + const SizedBox(height: 5), + Text( + '跟随系统会随手机的浅色与深色设置自动切换。', + style: TextStyle(color: context.jz.text2, fontSize: 11.5), + ), + const SizedBox(height: 14), + JzSegmentedControl( + value: ThemeStore.instance.preference, + options: const [ + JzOption( + value: JzThemePreference.system, + label: '跟随系统', + ), + JzOption(value: JzThemePreference.light, label: '浅色'), + JzOption(value: JzThemePreference.dark, label: '深色'), + ], + onChanged: ThemeStore.instance.setPreference, + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/frontend/lib/features/settings/budget_page.dart b/frontend/lib/features/settings/budget_page.dart new file mode 100644 index 0000000..8613cfe --- /dev/null +++ b/frontend/lib/features/settings/budget_page.dart @@ -0,0 +1,1123 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +class BudgetPage extends StatefulWidget { + const BudgetPage({super.key}); + + @override + State createState() => _BudgetPageState(); +} + +class _BudgetPageState extends State { + BudgetsData? _data; + List _categories = []; + bool _loading = true; + bool _aiLoading = false; + DateTime _month = DateTime(ShanghaiTime.now.year, ShanghaiTime.now.month); + + @override + void initState() { + super.initState(); + _load(); + } + + Future _load() async { + setState(() => _loading = true); + try { + final results = await Future.wait([ + BudgetApi.get(_month.year, _month.month), + TxApi.categories('expense'), + ]); + if (!mounted) return; + setState(() { + _data = results[0] as BudgetsData; + _categories = results[1] as List; + }); + } catch (e) { + if (mounted) _showError(e); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + Future _changeMonth(int offset) async { + setState(() { + _month = DateTime(_month.year, _month.month + offset); + _data = null; + }); + await _load(); + } + + Future _edit({ + int? categoryId, + String? categoryName, + double? current, + bool recurring = false, + }) async { + final controller = TextEditingController( + text: current == null || current == 0 ? '' : current.toStringAsFixed(0), + ); + var repeats = recurring; + final result = + await showModalBottomSheet<({double amount, bool recurring})>( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => StatefulBuilder( + builder: (context, setSheetState) => SafeArea( + child: Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.viewInsetsOf(context).bottom, + ), + child: Container( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 18), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical( + top: Radius.circular(24), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + JzSheetHeader( + title: categoryId == null + ? '总预算' + : '“' + (categoryName ?? '') + '”预算', + subtitle: '输入 0 可以删除当前预算', + ), + SizedBox(height: 16), + TextField( + controller: controller, + keyboardType: const TextInputType.numberWithOptions( + decimal: true, + ), + autofocus: true, + decoration: InputDecoration( + prefixText: '¥ ', + hintText: '输入预算金额', + ), + ), + SizedBox(height: 12), + InkWell( + onTap: () => setSheetState(() => repeats = !repeats), + borderRadius: BorderRadius.circular(14), + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 13, + vertical: 9, + ), + decoration: BoxDecoration( + color: repeats + ? context.jz.primaryBackground + : context.jz.background, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: repeats + ? AppTheme.primary + : context.jz.line, + ), + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '每月自动续期', + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 3), + Text( + '以后每个月沿用,可随时单独调整', + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + ], + ), + ), + Switch( + value: repeats, + onChanged: (value) => + setSheetState(() => repeats = value), + ), + ], + ), + ), + ), + SizedBox(height: 18), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '取消', + secondary: true, + onPressed: () => Navigator.pop(sheetContext), + ), + ), + SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: '保存', + onPressed: () => Navigator.pop(sheetContext, ( + amount: + double.tryParse(controller.text.trim()) ?? + 0, + recurring: repeats, + )), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ); + controller.dispose(); + if (result == null) return; + try { + await BudgetApi.upsert( + _month.year, + _month.month, + categoryId: categoryId, + amount: result.amount, + recurring: result.recurring, + ); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _openAiRecommendations() async { + if (_aiLoading) return; + setState(() => _aiLoading = true); + try { + var recommendation = await BudgetApi.recommendations( + _month.year, + _month.month, + ); + if (!mounted) return; + if (recommendation.items.isEmpty) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(recommendation.message))); + return; + } + + final totalController = TextEditingController( + text: recommendation.suggestedTotal.toStringAsFixed(0), + ); + final controllers = { + for (final item in recommendation.items) + item.categoryId: TextEditingController( + text: item.suggestedAmount.toStringAsFixed(0), + ), + }; + var recurring = true; + var refining = false; + final instructionController = TextEditingController(); + final history = []; + + Future refineDraft( + BuildContext sheetContext, + StateSetter setSheetState, + ) async { + final instruction = instructionController.text.trim(); + if (instruction.isEmpty || refining) return; + setSheetState(() => refining = true); + try { + final updated = await BudgetApi.refineRecommendation( + _month.year, + _month.month, + instruction: instruction, + suggestedTotal: + double.tryParse(totalController.text.trim()) ?? + recommendation.suggestedTotal, + amounts: { + for (final item in recommendation.items) + item.categoryId: + double.tryParse( + controllers[item.categoryId]?.text.trim() ?? '', + ) ?? + item.suggestedAmount, + }, + history: history, + ); + if (!sheetContext.mounted) return; + for (final item in updated.items) { + final controller = controllers.putIfAbsent( + item.categoryId, + () => TextEditingController(), + ); + controller.text = item.suggestedAmount.toStringAsFixed(0); + } + totalController.text = updated.suggestedTotal.toStringAsFixed(0); + final assistantText = updated.adjustmentSummary.isNotEmpty + ? updated.adjustmentSummary + : '预算草稿已按要求调整'; + setSheetState(() { + recommendation = updated; + history.add( + BudgetRefinementTurn(role: 'user', content: instruction), + ); + history.add( + BudgetRefinementTurn(role: 'assistant', content: assistantText), + ); + if (history.length > 12) { + history.removeRange(0, history.length - 12); + } + instructionController.clear(); + }); + } catch (error) { + if (sheetContext.mounted) { + ScaffoldMessenger.of( + sheetContext, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } finally { + if (sheetContext.mounted) { + setSheetState(() => refining = false); + } + } + } + + final result = + await showModalBottomSheet< + ({bool recurring, Map amounts}) + >( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => StatefulBuilder( + builder: (context, setSheetState) => FractionallySizedBox( + heightFactor: 0.9, + child: Material( + color: Theme.of(context).scaffoldBackgroundColor, + borderRadius: const BorderRadius.vertical( + top: Radius.circular(24), + ), + clipBehavior: Clip.antiAlias, + child: SafeArea( + top: false, + child: Column( + children: [ + SizedBox(height: 10), + Container( + width: 38, + height: 4, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(2), + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(20, 16, 20, 10), + child: Row( + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: context.jz.aiBackground, + shape: BoxShape.circle, + ), + child: Center( + child: AppIcons.icon( + AppIcons.sparkle, + size: 17, + color: AppTheme.ai, + ), + ), + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'AI 预算建议', + style: TextStyle( + fontSize: 17, + fontWeight: FontWeight.w800, + ), + ), + Text( + '确认前可以修改每一项金额', + style: TextStyle( + fontSize: 11.5, + color: context.jz.text3, + ), + ), + ], + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Container( + width: double.infinity, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + recommendation.adjustmentSummary.isNotEmpty + ? recommendation.adjustmentSummary + : recommendation.message, + style: TextStyle( + fontSize: 12, + height: 1.45, + color: context.jz.text2, + ), + ), + ...recommendation.warnings.map( + (warning) => Padding( + padding: const EdgeInsets.only(top: 5), + child: Text( + '· $warning', + style: TextStyle( + fontSize: 11, + color: AppTheme.orange, + ), + ), + ), + ), + ], + ), + ), + ), + SizedBox(height: 8), + Expanded( + child: ListView( + padding: const EdgeInsets.fromLTRB(20, 4, 20, 12), + children: [ + ...history.map( + (turn) => Align( + alignment: turn.role == 'user' + ? Alignment.centerRight + : Alignment.centerLeft, + child: Container( + constraints: const BoxConstraints( + maxWidth: 280, + ), + margin: const EdgeInsets.only(bottom: 7), + padding: const EdgeInsets.symmetric( + horizontal: 11, + vertical: 8, + ), + decoration: BoxDecoration( + color: turn.role == 'user' + ? AppTheme.ai + : Colors.white, + borderRadius: BorderRadius.circular(12), + border: turn.role == 'user' + ? null + : Border.all(color: context.jz.line), + ), + child: Text( + turn.content, + style: TextStyle( + fontSize: 11.5, + color: turn.role == 'user' + ? Colors.white + : context.jz.text2, + ), + ), + ), + ), + ), + _recommendationRow( + iconKey: 'wallet', + name: '本月总预算', + detail: '分类建议合计', + controller: totalController, + emphasized: true, + ), + ...recommendation.items.map( + (item) => _recommendationRow( + iconKey: item.categoryIcon, + colorKey: item.colorKey, + name: item.categoryName, + detail: + '近月均值 ¥${item.historicalAverage.toStringAsFixed(0)} · 已花 ¥${item.currentSpent.toStringAsFixed(0)} · ${_confidenceText(item.confidence)}', + controller: controllers[item.categoryId]!, + ), + ), + JzSwitchTile( + value: recurring, + title: '设为周期预算', + subtitle: '每月自动沿用这套预算', + onChanged: (value) => + setSheetState(() => recurring = value), + ), + SizedBox(height: 4), + Container( + padding: const EdgeInsets.fromLTRB(12, 6, 6, 6), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: TextField( + controller: instructionController, + enabled: !refining, + minLines: 1, + maxLines: 3, + maxLength: 500, + decoration: InputDecoration( + border: InputBorder.none, + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + counterText: '', + hintText: '继续调整,如:餐饮减少 200', + contentPadding: EdgeInsets.symmetric( + vertical: 8, + ), + ), + ), + ), + SizedBox(width: 8), + Material( + color: refining + ? context.jz.line + : AppTheme.ai, + borderRadius: BorderRadius.circular(11), + child: InkWell( + onTap: refining + ? null + : () => refineDraft( + sheetContext, + setSheetState, + ), + borderRadius: BorderRadius.circular(11), + child: SizedBox( + width: 46, + height: 40, + child: Center( + child: refining + ? SizedBox( + width: 17, + height: 17, + child: + CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : AppIcons.icon( + AppIcons.sparkle, + size: 17, + color: Colors.white, + ), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 12), + child: SizedBox( + width: double.infinity, + height: 46, + child: FilledButton( + onPressed: refining + ? null + : () { + final amounts = { + null: + double.tryParse( + totalController.text, + ) ?? + 0, + for (final item in recommendation.items) + item.categoryId: + double.tryParse( + controllers[item.categoryId]! + .text, + ) ?? + 0, + }; + Navigator.pop(sheetContext, ( + recurring: recurring, + amounts: amounts, + )); + }, + child: Text('应用这套预算'), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + totalController.dispose(); + for (final controller in controllers.values) { + controller.dispose(); + } + instructionController.dispose(); + if (result == null) return; + await BudgetApi.applyBatch( + _month.year, + _month.month, + recurring: result.recurring, + amounts: result.amounts, + ); + await _load(); + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('预算方案已应用'))); + } + } catch (e) { + if (mounted) _showError(e); + } finally { + if (mounted) setState(() => _aiLoading = false); + } + } + + Widget _recommendationRow({ + required String iconKey, + String? colorKey, + required String name, + required String detail, + required TextEditingController controller, + bool emphasized = false, + }) { + return Container( + margin: const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: emphasized ? context.jz.aiBackground : context.jz.card, + borderRadius: BorderRadius.circular(13), + border: Border.all(color: context.jz.line), + ), + child: Row( + children: [ + CategoryIconBox(iconKey: iconKey, colorKey: colorKey, size: 36), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name, + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w700), + ), + SizedBox(height: 2), + Text( + detail, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + ], + ), + ), + SizedBox(width: 8), + SizedBox( + width: 86, + child: TextField( + controller: controller, + textAlign: TextAlign.end, + keyboardType: const TextInputType.numberWithOptions( + decimal: true, + ), + decoration: InputDecoration( + prefixText: '¥', + isDense: true, + contentPadding: EdgeInsets.symmetric( + horizontal: 8, + vertical: 9, + ), + ), + ), + ), + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + final data = _data; + final total = data?.total; + return Scaffold( + appBar: AppBar(title: Text('预算管理')), + body: _loading && data == null + ? Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + : RefreshIndicator( + onRefresh: _load, + child: ListView( + padding: const EdgeInsets.all(16), + children: [ + _monthNavigator(), + SizedBox(height: 12), + _totalCard(total), + SizedBox(height: 10), + _budgetActions(data), + SizedBox(height: 10), + _categoryCard(data), + ], + ), + ), + ); + } + + Widget _monthNavigator() { + final now = ShanghaiTime.now; + final canGoNext = + _month.year < now.year || + (_month.year == now.year && _month.month < now.month); + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () => _changeMonth(-1), + icon: Icon(Icons.chevron_left_rounded), + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(18), + ), + child: Text( + '${_month.year} 年 ${_month.month} 月', + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + ), + IconButton( + onPressed: canGoNext ? () => _changeMonth(1) : null, + icon: Icon(Icons.chevron_right_rounded), + ), + ], + ); + } + + Widget _totalCard(BudgetItem? total) { + return Card( + child: InkWell( + onTap: () => _edit( + current: total?.amount, + recurring: total?.isRecurring ?? false, + ), + borderRadius: BorderRadius.circular(16), + child: Padding( + padding: const EdgeInsets.all(16), + child: total == null + ? Padding( + padding: EdgeInsets.symmetric(vertical: 18), + child: Center( + child: Text( + '点击设置总预算', + style: TextStyle(fontSize: 13, color: context.jz.text2), + ), + ), + ) + : Row( + children: [ + SizedBox( + width: 92, + height: 92, + child: Stack( + alignment: Alignment.center, + children: [ + SizedBox( + width: 92, + height: 92, + child: CircularProgressIndicator( + value: total.ratio, + strokeWidth: 9, + backgroundColor: context.jz.line, + color: total.ratio > 0.85 + ? AppTheme.red + : AppTheme.primary, + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '已用', + style: TextStyle( + fontSize: 9.5, + color: context.jz.text3, + ), + ), + Text( + '${(total.ratio * 100).toStringAsFixed(0)}%', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w800, + ), + ), + ], + ), + ], + ), + ), + SizedBox(width: 18), + Expanded( + child: Column( + children: [ + _keyValue( + total.isRecurring ? '周期总预算' : '本月总预算', + '¥${total.amount.toStringAsFixed(2)}', + ), + _keyValue( + '已使用', + '¥${total.spent.toStringAsFixed(2)}', + ), + _keyValue( + '剩余可用', + '¥${(total.amount - total.spent).toStringAsFixed(2)}', + color: AppTheme.primary, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + Widget _categoryCard(BudgetsData? data) { + final budgets = data?.categories ?? const []; + return Card( + child: Column( + children: [ + ...budgets.map( + (budget) => InkWell( + onTap: () => _edit( + categoryId: budget.categoryId, + categoryName: budget.categoryName, + current: budget.amount, + recurring: budget.isRecurring, + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 14, + vertical: 11, + ), + child: Row( + children: [ + CategoryIconBox( + iconKey: budget.categoryIcon ?? 'tag', + colorKey: budget.categoryColor, + size: 34, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Flexible( + child: Text( + budget.categoryName ?? '', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w600, + ), + ), + ), + if (budget.isRecurring) ...[ + SizedBox(width: 5), + _tag('每月'), + ], + Spacer(), + Text( + '¥${budget.spent.toStringAsFixed(0)} / ¥${budget.amount.toStringAsFixed(0)}', + style: TextStyle( + fontSize: 11.5, + color: context.jz.text3, + ), + ), + ], + ), + SizedBox(height: 6), + ClipRRect( + borderRadius: BorderRadius.circular(2), + child: LinearProgressIndicator( + value: budget.ratio, + minHeight: 4, + backgroundColor: context.jz.background, + color: budget.ratio > 0.85 + ? AppTheme.red + : budget.ratio > 0.7 + ? AppTheme.orange + : AppTheme.primary, + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } + + Widget _budgetActions(BudgetsData? data) { + final budgets = data?.categories ?? const []; + final existing = budgets.map((budget) => budget.categoryId).toSet(); + final canAdd = _categories.any( + (category) => !existing.contains(category.id), + ); + return Row( + children: [ + if (SessionStore.instance.aiEnabled) ...[ + Expanded( + child: _BudgetActionCard( + label: _aiLoading ? '正在分析…' : 'AI 订预算', + description: '参考近三个月消费', + icon: AppIcons.sparkle, + foreground: AppTheme.ai, + background: context.jz.aiBackground, + loading: _aiLoading, + onTap: _aiLoading ? null : _openAiRecommendations, + ), + ), + SizedBox(width: 10), + ], + Expanded( + child: _BudgetActionCard( + label: '添加分类预算', + description: canAdd ? '为单项消费设上限' : '分类预算已全部设置', + icon: AppIcons.plus, + foreground: AppTheme.primaryDeep, + background: context.jz.primaryBackground, + onTap: canAdd ? () => _addCategoryBudget(budgets) : null, + ), + ), + ], + ); + } + + Future _addCategoryBudget(List budgets) async { + final existing = budgets.map((budget) => budget.categoryId).toSet(); + final candidates = _categories + .where((category) => !existing.contains(category.id)) + .toList(); + if (candidates.isEmpty) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('所有支出分类都已设置预算'))); + return; + } + final category = await showJzOptionSheet( + context, + title: '添加分类预算', + subtitle: '选择一个尚未设置预算的支出分类', + options: candidates + .map( + (item) => JzOption( + value: item, + label: item.name, + leading: CategoryIconBox( + iconKey: item.iconKey, + colorKey: item.colorKey, + size: 34, + ), + ), + ) + .toList(), + ); + if (category != null) { + await _edit(categoryId: category.id, categoryName: category.name); + } + } + + Widget _tag(String text) => Container( + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(6), + ), + child: Text( + text, + style: TextStyle( + fontSize: 9, + color: AppTheme.ai, + fontWeight: FontWeight.w700, + ), + ), + ); + + String _confidenceText(String confidence) => switch (confidence) { + 'high' => '依据充分', + 'medium' => '依据一般', + _ => '初步估算', + }; + + Widget _keyValue(String key, String value, {Color? color}) => Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: Row( + children: [ + Text(key, style: TextStyle(fontSize: 12, color: context.jz.text2)), + Spacer(), + Text( + value, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w700, + color: color ?? context.jz.text, + ), + ), + ], + ), + ); + + void _showError(Object error) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } +} + +class _BudgetActionCard extends StatelessWidget { + final String label; + final String description; + final String icon; + final Color foreground; + final Color background; + final bool loading; + final VoidCallback? onTap; + + const _BudgetActionCard({ + required this.label, + required this.description, + required this.icon, + required this.foreground, + required this.background, + this.loading = false, + this.onTap, + }); + + @override + Widget build(BuildContext context) { + final enabled = onTap != null; + return Semantics( + button: true, + enabled: enabled, + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(14), + child: AnimatedOpacity( + duration: const Duration(milliseconds: 180), + opacity: enabled ? 1 : 0.48, + child: Container( + height: 68, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: background, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: foreground.withValues(alpha: 0.16)), + ), + child: Row( + children: [ + Container( + width: 34, + height: 34, + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: loading + ? SizedBox( + width: 16, + height: 16, + child: CircularProgressIndicator( + strokeWidth: 2, + color: foreground, + ), + ) + : AppIcons.icon(icon, size: 17, color: foreground), + ), + ), + SizedBox(width: 9), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.5, + color: foreground, + fontWeight: FontWeight.w800, + ), + ), + SizedBox(height: 3), + Text( + description, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 9.5, + color: context.jz.text3, + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/frontend/lib/features/settings/category_manage_page.dart b/frontend/lib/features/settings/category_manage_page.dart new file mode 100644 index 0000000..95b296e --- /dev/null +++ b/frontend/lib/features/settings/category_manage_page.dart @@ -0,0 +1,641 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; + +class CategoryManagePage extends StatefulWidget { + const CategoryManagePage({super.key}); + + @override + State createState() => _CategoryManagePageState(); +} + +class _CategoryManagePageState extends State { + String _type = 'expense'; + List _cats = const []; + bool _loading = true; + bool _reordering = false; + bool _savingOrder = false; + bool _orderDirty = false; + + List get _custom => + _cats.where((category) => category.isCustom).toList(); + + @override + void initState() { + super.initState(); + _load(); + } + + Future _load() async { + setState(() => _loading = true); + try { + final cats = await TxApi.categories(_type); + if (mounted) { + setState(() { + _cats = cats; + _orderDirty = false; + }); + } + } catch (error) { + if (mounted) _showError(error); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + Future _add() async { + final result = await _showEditor(); + if (result == null) return; + try { + await CategoryApi.create(result.name, result.icon, result.color, _type); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _edit(CategoryItem category) async { + final result = await _showEditor(category: category); + if (result == null) return; + try { + await CategoryApi.update( + category.id, + name: result.name, + iconKey: result.icon, + colorKey: result.color, + sortOrder: category.sortOrder, + ); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future<({String name, String icon, String color})?> _showEditor({ + CategoryItem? category, + }) async { + final controller = TextEditingController(text: category?.name ?? ''); + var iconKey = AppIcons.keyMap.containsKey(category?.iconKey) + ? category!.iconKey + : 'tag'; + var colorKey = category?.colorKey ?? 'mint'; + final result = + await showModalBottomSheet<({String name, String icon, String color})>( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => StatefulBuilder( + builder: (context, setSheetState) => FractionallySizedBox( + heightFactor: 0.88, + child: Container( + padding: EdgeInsets.only( + left: 18, + right: 18, + bottom: MediaQuery.viewInsetsOf(context).bottom + 14, + ), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: SafeArea( + top: false, + child: Column( + children: [ + JzSheetHeader( + title: category == null ? '新建分类' : '编辑分类', + subtitle: category == null + ? '选择一个容易辨认的名称和图标' + : '排序请返回列表后使用“调整顺序”', + ), + SizedBox(height: 14), + TextField( + controller: controller, + autofocus: category == null, + maxLength: 8, + decoration: InputDecoration( + labelText: '分类名称', + hintText: '1-8 个字', + ), + ), + SizedBox(height: 8), + Align( + alignment: Alignment.centerLeft, + child: Text( + '分类颜色', + style: TextStyle( + fontSize: 12, + color: context.jz.text2, + fontWeight: FontWeight.w700, + ), + ), + ), + SizedBox(height: 9), + SizedBox( + height: 48, + child: ListView.separated( + scrollDirection: Axis.horizontal, + itemCount: categoryColorCatalog.length, + separatorBuilder: (_, __) => SizedBox(width: 9), + itemBuilder: (_, index) { + final color = categoryColorCatalog[index]; + final selected = color.key == colorKey; + return Semantics( + button: true, + selected: selected, + label: color.label, + child: InkWell( + onTap: () => + setSheetState(() => colorKey = color.key), + borderRadius: BorderRadius.circular(15), + child: AnimatedContainer( + duration: const Duration(milliseconds: 150), + width: 48, + decoration: BoxDecoration( + color: color.background, + borderRadius: BorderRadius.circular(15), + border: Border.all( + color: selected + ? color.foreground + : Colors.transparent, + width: 2, + ), + ), + child: selected + ? Icon( + Icons.check_rounded, + size: 21, + color: color.foreground, + ) + : null, + ), + ), + ); + }, + ), + ), + SizedBox(height: 14), + Align( + alignment: Alignment.centerLeft, + child: Text( + '分类图标', + style: TextStyle( + fontSize: 12, + color: context.jz.text2, + fontWeight: FontWeight.w700, + ), + ), + ), + SizedBox(height: 2), + Expanded( + child: ListView( + children: _iconGroups.entries.map((entry) { + return Padding( + padding: const EdgeInsets.only( + top: 12, + bottom: 6, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + entry.key, + style: TextStyle( + fontSize: 11, + color: context.jz.text3, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 9), + GridView.builder( + shrinkWrap: true, + physics: + const NeverScrollableScrollPhysics(), + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 5, + mainAxisSpacing: 9, + crossAxisSpacing: 9, + childAspectRatio: 0.82, + ), + itemCount: entry.value.length, + itemBuilder: (_, index) { + final icon = entry.value[index]; + final selected = icon.key == iconKey; + return Semantics( + selected: selected, + label: icon.label, + button: true, + child: InkWell( + onTap: () => setSheetState( + () => iconKey = icon.key, + ), + borderRadius: BorderRadius.circular( + 13, + ), + child: AnimatedContainer( + duration: const Duration( + milliseconds: 160, + ), + decoration: BoxDecoration( + color: selected + ? context.jz.primaryBackground + : context.jz.background, + borderRadius: + BorderRadius.circular(13), + border: Border.all( + color: selected + ? AppTheme.primary + : context.jz.line, + width: selected ? 1.3 : 1, + ), + ), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + CategoryIconBox( + iconKey: icon.key, + colorKey: colorKey, + size: 32, + ), + SizedBox(height: 5), + Text( + icon.label, + maxLines: 1, + overflow: + TextOverflow.ellipsis, + style: TextStyle( + fontSize: 9.5, + color: selected + ? AppTheme.primaryDeep + : context.jz.text2, + fontWeight: selected + ? FontWeight.w700 + : FontWeight.w500, + ), + ), + ], + ), + ), + ), + ); + }, + ), + ], + ), + ); + }).toList(), + ), + ), + SizedBox(height: 12), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '取消', + secondary: true, + onPressed: () => Navigator.pop(sheetContext), + ), + ), + SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: category == null ? '添加' : '保存', + onPressed: () { + final name = controller.text.trim(); + if (name.isEmpty) return; + Navigator.pop(sheetContext, ( + name: name, + icon: iconKey, + color: colorKey, + )); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ); + controller.dispose(); + return result; + } + + Map> get _iconGroups { + final result = >{}; + for (final icon in AppIcons.categoryCatalog) { + result.putIfAbsent(icon.group, () => []).add(icon); + } + return result; + } + + Future _showActions(CategoryItem category) async { + final action = await showJzOptionSheet( + context, + title: category.name, + options: const [ + JzOption(value: 'edit', label: '编辑名称和图标'), + JzOption(value: 'delete', label: '删除分类', subtitle: '历史账单仍保留原分类'), + ], + ); + if (!mounted) return; + if (action == 'edit') await _edit(category); + if (action == 'delete') await _delete(category); + } + + Future _delete(CategoryItem category) async { + final confirmed = await showJzConfirmSheet( + context, + title: '删除“' + category.name + '”', + message: '删除后将不能再选择此分类,历史账单仍保留原分类。', + confirmLabel: '删除', + destructive: true, + ); + if (!confirmed) return; + try { + await CategoryApi.delete(category.id); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + void _reorder(int oldIndex, int newIndex) { + final items = _custom; + if (newIndex > oldIndex) newIndex--; + final item = items.removeAt(oldIndex); + items.insert(newIndex, item); + setState(() { + final system = _cats.where((category) => !category.isCustom).toList(); + _cats = [...system, ...items]; + _orderDirty = true; + }); + } + + Future _toggleReorder() async { + if (!_reordering) { + setState(() { + _reordering = true; + _orderDirty = false; + }); + return; + } + if (!_orderDirty) { + setState(() => _reordering = false); + return; + } + + final ids = _custom.map((category) => category.id).toList(); + setState(() => _savingOrder = true); + try { + await CategoryApi.reorder(_type, ids); + if (!mounted) return; + setState(() { + _reordering = false; + _orderDirty = false; + }); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('分类顺序已保存'))); + } catch (error) { + if (mounted) _showError(error); + } finally { + if (mounted) setState(() => _savingOrder = false); + } + } + + void _showError(Object error) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('分类管理'), + actions: [ + if (_custom.length > 1) + TextButton( + onPressed: _savingOrder ? null : _toggleReorder, + child: Text( + _savingOrder + ? '保存中' + : _reordering + ? '完成' + : '调整顺序', + ), + ), + ], + ), + body: Column( + children: [ + _typeSwitch(), + Padding( + padding: const EdgeInsets.fromLTRB(16, 10, 16, 8), + child: Row( + children: [ + Expanded( + child: Text( + _reordering ? '长按右侧把手调整自定义分类顺序' : '系统分类固定显示,自定义分类可编辑和排序', + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + ), + if (_savingOrder) + SizedBox( + width: 14, + height: 14, + child: CircularProgressIndicator(strokeWidth: 2), + ), + ], + ), + ), + Expanded( + child: _loading + ? Center(child: CircularProgressIndicator(strokeWidth: 2)) + : _reordering + ? _reorderList() + : _normalList(), + ), + ], + ), + floatingActionButton: _reordering + ? null + : FloatingActionButton.extended( + onPressed: _add, + backgroundColor: AppTheme.primary, + foregroundColor: Colors.white, + elevation: 0, + icon: AppIcons.icon(AppIcons.plus, size: 17, color: Colors.white), + label: Text('自定义分类'), + ), + ); + } + + Widget _typeSwitch() { + return Container( + width: 216, + margin: const EdgeInsets.only(top: 6), + padding: const EdgeInsets.all(3), + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: ['expense', 'income'].map((type) { + final selected = _type == type; + return Expanded( + child: InkWell( + onTap: _reordering || _savingOrder + ? null + : () { + if (_type == type) return; + setState(() => _type = type); + _load(); + }, + borderRadius: BorderRadius.circular(8), + child: AnimatedContainer( + duration: const Duration(milliseconds: 180), + padding: const EdgeInsets.symmetric(vertical: 7), + decoration: BoxDecoration( + color: selected ? Colors.white : Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), + child: Text( + type == 'expense' ? '支出' : '收入', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 13, + fontWeight: selected ? FontWeight.w700 : FontWeight.w500, + color: selected ? context.jz.text : context.jz.text2, + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } + + Widget _normalList() { + return ListView( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 90), + children: [ + Card(child: Column(children: _cats.map(_categoryRow).toList())), + ], + ); + } + + Widget _categoryRow(CategoryItem category) { + return InkWell( + onTap: category.isCustom ? () => _showActions(category) : null, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10), + child: Row( + children: [ + CategoryIconBox( + iconKey: category.iconKey, + colorKey: category.colorKey, + size: 34, + ), + SizedBox(width: 12), + Expanded( + child: Text( + category.name, + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w600), + ), + ), + if (category.isCustom) ...[ + Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: context.jz.primaryBackground, + borderRadius: BorderRadius.circular(6), + ), + child: Text( + '自定义', + style: TextStyle( + fontSize: 9, + color: AppTheme.primaryDeep, + fontWeight: FontWeight.w600, + ), + ), + ), + SizedBox(width: 5), + Icon( + Icons.chevron_right_rounded, + size: 19, + color: context.jz.text3, + ), + ], + ], + ), + ), + ); + } + + Widget _reorderList() { + final items = _custom; + if (items.isEmpty) { + return Center( + child: Text('还没有自定义分类', style: TextStyle(color: context.jz.text3)), + ); + } + return ReorderableListView.builder( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 24), + buildDefaultDragHandles: false, + itemCount: items.length, + onReorder: _reorder, + itemBuilder: (context, index) { + final category = items[index]; + return Container( + key: ValueKey(category.id), + margin: const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.fromLTRB(13, 9, 8, 9), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line), + ), + child: Row( + children: [ + CategoryIconBox( + iconKey: category.iconKey, + colorKey: category.colorKey, + size: 34, + ), + SizedBox(width: 11), + Expanded( + child: Text( + category.name, + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w600), + ), + ), + ReorderableDragStartListener( + index: index, + child: Padding( + padding: const EdgeInsets.all(10), + child: AppIcons.icon( + AppIcons.drag, + size: 18, + color: context.jz.text3, + ), + ), + ), + ], + ), + ); + }, + ); + } +} diff --git a/frontend/lib/features/settings/companion_page.dart b/frontend/lib/features/settings/companion_page.dart new file mode 100644 index 0000000..2a9ee50 --- /dev/null +++ b/frontend/lib/features/settings/companion_page.dart @@ -0,0 +1,283 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +/// AI 性格设置页(P5):形象/性格从后台 API 动态拉取 +class CompanionPage extends StatefulWidget { + const CompanionPage({super.key}); + @override + State createState() => _CompanionPageState(); +} + +class _CompanionPageState extends State { + String _avatar = 'cat', _persona = 'sassy_cat'; + double _roast = 60, _sticker = 70, _proactive = 40; + bool _saving = false, _loaded = false; + List _avatars = []; + List _personas = []; + + // 兜底 + static const _fallbackAvatars = [ + ('dog', '阿福汪', AppIcons.dog), + ('cat', '小账喵', AppIcons.cat), + ('robot', '账小智', AppIcons.robot), + ]; + static const _fallbackPersonas = [ + ('sassy_cat', '毒舌猫娘', '乱花钱会被无情吐槽', AppTheme.ai), + ('gentle', '温柔小暖', '永远鼓励,温柔提醒', AppTheme.primary), + ('strict', '严格管家', '理性专业,数据说话', AppTheme.ai), + ('meme', '沙雕损友', '玩梗高手,快乐记账', AppTheme.orange), + ]; + + @override + void initState() { + super.initState(); + _load(); + } + + Future _load() async { + try { + final p = await AuthApi.me(); + if (mounted && p.aiCompanion != null) + setState(() { + _avatar = p.aiCompanion!.avatarKey; + _persona = p.aiCompanion!.personaKey; + _roast = p.aiCompanion!.roastLevel.toDouble(); + _sticker = p.aiCompanion!.stickerFrequency.toDouble(); + _proactive = p.aiCompanion!.proactiveLevel.toDouble(); + }); + } catch (_) {} + try { + final av = await PublicConfigApi.avatars(); + final ps = await PublicConfigApi.personas(); + if (mounted) + setState(() { + _avatars = av; + _personas = ps; + }); + } catch (_) {} + if (mounted) setState(() => _loaded = true); + } + + Future _save() async { + setState(() => _saving = true); + try { + await AuthApi.updateCompanion( + avatarKey: _avatar, + personaKey: _persona, + roastLevel: _roast.round(), + stickerFrequency: _sticker.round(), + proactiveLevel: _proactive.round(), + ); + await PublicConfigApi.refreshCompanion(); + if (!mounted) return; + Navigator.pop(context); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('已保存'))); + } catch (e) { + if (mounted) + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } finally { + if (mounted) setState(() => _saving = false); + } + } + + @override + Widget build(BuildContext context) { + if (!_loaded) + return const Scaffold( + body: Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ), + ); + final avatars = _avatars.isNotEmpty + ? _avatars + .map( + (a) => ( + a.key, + a.defaultName, + a.key == 'dog' + ? AppIcons.dog + : a.key == 'robot' + ? AppIcons.robot + : AppIcons.cat, + ), + ) + .toList() + : _fallbackAvatars; + final personas = _personas.isNotEmpty + ? _personas + .map((p) => (p.key, p.name, p.description, AppTheme.ai)) + .toList() + : _fallbackPersonas; + + return Scaffold( + appBar: AppBar(title: Text('AI 性格设置')), + body: ListView( + padding: const EdgeInsets.all(16), + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: avatars.map((a) { + final on = a.$1 == _avatar; + return GestureDetector( + onTap: () => setState(() => _avatar = a.$1), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 11), + child: Column( + children: [ + AnimatedContainer( + duration: const Duration(milliseconds: 200), + width: on ? 66 : 52, + height: on ? 66 : 52, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: on ? AppTheme.ai : context.jz.aiBackground, + boxShadow: on + ? [ + BoxShadow( + color: AppTheme.ai.withValues(alpha: 0.3), + blurRadius: 14, + ), + ] + : null, + ), + child: Center( + child: AppIcons.icon( + a.$3, + size: on ? 30 : 24, + color: on ? Colors.white : context.jz.text3, + ), + ), + ), + SizedBox(height: 6), + Text( + a.$2, + style: TextStyle( + fontSize: 10, + color: on ? AppTheme.ai : context.jz.text3, + fontWeight: on ? FontWeight.w600 : null, + ), + ), + ], + ), + ), + ); + }).toList(), + ), + SizedBox(height: 16), + GridView.count( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + crossAxisCount: 2, + mainAxisSpacing: 10, + crossAxisSpacing: 10, + childAspectRatio: 1.9, + children: personas.map((p) { + final on = p.$1 == _persona; + return GestureDetector( + onTap: () => setState(() => _persona = p.$1), + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: on ? context.jz.aiBackground : context.jz.card, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: on ? AppTheme.ai : context.jz.line, + width: 1.5, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + p.$2, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 4), + Text( + p.$3, + style: TextStyle(fontSize: 10, color: context.jz.text2), + ), + ], + ), + ), + ); + }).toList(), + ), + SizedBox(height: 14), + Card( + child: Padding( + padding: const EdgeInsets.all(14), + child: Column( + children: [ + _slider('吐槽力度', _roast, (v) => setState(() => _roast = v)), + _slider( + '表情包频率', + _sticker, + (v) => setState(() => _sticker = v), + ), + ], + ), + ), + ), + SizedBox(height: 16), + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: AppTheme.ai), + onPressed: _saving ? null : _save, + child: _saving + ? SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : Text('保存设置'), + ), + ], + ), + ); + } + + Widget _slider(String label, double value, ValueChanged onChanged) => + Column( + children: [ + Row( + children: [ + Text( + label, + style: TextStyle(fontSize: 12, color: context.jz.text2), + ), + Spacer(), + Text( + '${value.round()}%', + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600), + ), + ], + ), + JzSlider( + value: value, + min: 0, + max: 100, + color: AppTheme.ai, + onChanged: onChanged, + ), + ], + ); +} diff --git a/frontend/lib/features/settings/legal_document_page.dart b/frontend/lib/features/settings/legal_document_page.dart new file mode 100644 index 0000000..a8982af --- /dev/null +++ b/frontend/lib/features/settings/legal_document_page.dart @@ -0,0 +1,192 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; + +enum LegalDocumentKind { + privacy('privacy', '隐私政策'), + terms('terms', '用户协议'), + permissions('permissions', '权限用途说明'), + sdk('sdk', '第三方 SDK 清单'); + + final String key; + final String title; + const LegalDocumentKind(this.key, this.title); + + static LegalDocumentKind fromKey(String? key) => + values.firstWhere((item) => item.key == key, orElse: () => privacy); +} + +class LegalDocumentPage extends StatelessWidget { + final LegalDocumentKind kind; + const LegalDocumentPage({super.key, required this.kind}); + + static const _effectiveDate = '2026 年 7 月 21 日'; + + @override + Widget build(BuildContext context) { + final sections = _sections(kind); + return Scaffold( + appBar: AppBar(title: Text(kind.title)), + body: SelectionArea( + child: ListView( + padding: const EdgeInsets.fromLTRB(18, 8, 18, 32), + children: [ + Text( + '更新及生效日期:$_effectiveDate', + style: TextStyle(fontSize: 12, color: context.jz.text3), + ), + SizedBox(height: 14), + ...sections.map( + (section) => Padding( + padding: const EdgeInsets.only(bottom: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + section.title, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w800, + color: context.jz.text, + ), + ), + SizedBox(height: 8), + Text( + section.body, + style: TextStyle( + fontSize: 13.5, + height: 1.75, + color: context.jz.text2, + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } + + static List<_LegalSection> _sections(LegalDocumentKind kind) => + switch (kind) { + LegalDocumentKind.privacy => _privacy, + LegalDocumentKind.terms => _terms, + LegalDocumentKind.permissions => _permissions, + LegalDocumentKind.sdk => _sdk, + }; + + static const _privacy = <_LegalSection>[ + _LegalSection( + '一、我们如何处理信息', + '记之由个人开发者丁伊文运营。我们重视你的个人信息与财务隐私。为提供账号、记账、统计、预算、AI 对话及数据导出功能,我们会处理你主动提交的账号名称、昵称、账本、分类、账单、预算、聊天文本,以及你主动选择的图片或截屏。密码仅以不可逆哈希形式保存在服务器,不保存明文密码。', + ), + _LegalSection( + '二、语音、图片与 AI 数据', + '使用语音记账时,麦克风音频由设备系统语音识别能力处理,记之接收识别后的文字;使用拍照或相册识别时,只有你主动选择的图片会用于本次识别。开启无障碍事件识别后,记之会在微信、支付宝疑似支付流程结束时按需截取当前页面,并由设备内置 OCR 在内存中识别,图片不落盘且处理后立即释放。只有你另行开启 AI 截图补全时,当前支付页图片才会发送至我们配置的火山方舟大模型服务。我们不会将完整账单历史无差别发送给模型,也不会把这些数据用于广告画像。', + ), + _LegalSection( + '三、设备、网络与日志', + '为保障登录和接口安全,服务器可能记录访问时间、网络地址、请求结果、应用版本及去标识化故障信息。故障日志不得记录密码、JWT、API Key、完整图片 Base64 或完整隐私内容。', + ), + _LegalSection( + '四、存储期限与安全', + '账号数据在你使用服务期间保存。你删除的账单进入 30 天回收站;截屏识别文件在完成、取消或失败后清理,遗留文件会在超过 24 小时后清理。账号注销进入 15 天后悔期,到期后永久删除账号关联数据。导出文件由你主动分享,应用会在分享完成或失败后清理临时副本。', + ), + _LegalSection( + '五、你的权利', + '你可以在应用内查询、更正和删除账单,导出数据,修改昵称或密码,撤回非必要权限,并申请注销账号。关闭麦克风、通知、相册选择、无障碍或截屏授权不会影响基础手工记账,但对应功能将无法使用。', + ), + _LegalSection( + '六、未成年人、变更与联系', + '未满 14 周岁的未成年人应在监护人同意和指导下使用。政策发生重要变化时,我们会通过应用内显著方式提示并重新征得必要同意。如对本政策、个人信息处理或账号注销有疑问,可发送邮件至 nanxun@nxsir.cn,或拨打 13607268374 联系运营者丁伊文。', + ), + ]; + + static const _terms = <_LegalSection>[ + _LegalSection( + '一、协议范围', + '本协议是你与记之运营者丁伊文之间关于使用记之记账、统计、预算、AI 助手及相关服务的约定。注册或继续使用前,请完整阅读本协议与隐私政策。', + ), + _LegalSection( + '二、账号使用', + '你应提供真实、合法且不侵害他人权益的账号信息,妥善保管登录凭据,并对账号内操作负责。发现账号异常时应及时修改密码。修改密码会使其他设备的既有登录状态失效。', + ), + _LegalSection( + '三、AI 功能说明', + 'AI 识别和建议可能存在误差。涉及金额、收支类型、分类、时间和预算时,请在确认页面核对。AI 不构成投资、税务、法律或其他专业建议,最终记账和资金决策由你自行确认。', + ), + _LegalSection( + '四、使用规范', + '不得利用服务上传违法内容、攻击系统、窃取他人数据、绕过安全截屏限制或干扰服务运行。因系统维护、网络、上游模型或设备权限导致的暂时不可用,我们会尽力恢复并提供明确错误提示。', + ), + _LegalSection( + '五、数据与注销', + '你保留对自己输入数据的权利,并可通过应用导出。申请注销后账号进入 15 天后悔期,期间重新登录可取消;等待期结束后数据将按规则永久删除且无法恢复。', + ), + ]; + + static const _permissions = <_LegalSection>[ + _LegalSection('麦克风', '仅在你主动长按语音输入或发起语音记账时使用,用于系统语音识别。拒绝后仍可使用键盘记账和文字聊天。'), + _LegalSection( + '相册与照片选择', + '仅在你主动选择账单截图或图片识别时读取所选文件。Android 新版本优先使用系统照片选择器,不会扫描整套相册。', + ), + _LegalSection( + '通知与振动', + '用于展示 AI 图片识别进度、智能识别候选、自动入账结果以及撤销入口。拒绝后本地识别仍可运行,但后台结果和确认提示可能不可见。', + ), + _LegalSection( + '无障碍服务', + '可选权限。用于快捷磁贴静默截屏,以及在你主动开启“无障碍事件识别”后,仅处理微信、支付宝的支付流程事件、当前页面可见文字和按需本地截图 OCR。不会监听或拦截音量键,不会保存完整控件树或本地 OCR 截图;关闭后基础手工记账仍可使用。', + ), + _LegalSection( + '屏幕录制 / 截屏授权', + '当无障碍截图不可用且你主动点击截屏记账时,系统会显示一次性授权。应用只截取一帧用于本次识别,完成后立即释放投屏会话;受保护页面不会尝试绕过系统限制。', + ), + _LegalSection('网络', '用于登录、同步账本、调用 AI 识别和获取配置。所有生产数据应通过受信任的 HTTPS 服务传输。'), + ]; + + static const _sdk = <_LegalSection>[ + _LegalSection( + 'Flutter(Google)', + '用于构建应用界面和跨平台运行。基础运行可能处理设备系统版本、界面状态及崩溃上下文;本项目未集成 Flutter 广告或行为分析 SDK。', + ), + _LegalSection( + 'Dio(开源网络库)', + '用于与记之后端进行 HTTPS 通信,传输登录凭据、账本数据、聊天文本和你主动提交的识别内容。', + ), + _LegalSection( + 'flutter_secure_storage', + '用于在设备安全存储中保存登录 Token。Android 使用系统加密存储能力,iOS 使用 Keychain。', + ), + _LegalSection( + 'sqlite3 / SQLCipher', + '用于在本机加密保存游客或账号的账本、分类、账单、预算及待同步操作。数据库密钥保存在系统安全存储中,本地数据库不会由该组件自行上传。', + ), + _LegalSection( + 'archive', + '用于在设备内存中生成 CSV 与 JSON 数据导出 ZIP,不连接网络、不收集数据;分享完成或失败后应用会清理临时 ZIP 文件。', + ), + _LegalSection('image_picker', '用于调用系统相册或照片选择器,只返回你主动选中的图片。'), + _LegalSection('share_plus', '用于调用系统分享面板导出 ZIP。接收方由你选择;分享流程结束后应用清理临时导出文件。'), + _LegalSection( + 'ML Kit 中文文字识别(Google)', + '用于在 Android 设备本地识别微信、支付宝支付结果页中的成功状态和金额。模型随应用安装,处理过程不需要登录或联网,不会由该 SDK 自行上传截图;图片仅在内存中使用并在完成后释放。', + ), + _LegalSection( + '火山方舟大模型服务(字节跳动)', + '用于 AI 对话、账单文本解析、图片识别及预算草稿调整。会处理完成对应请求所需的文本、图片和最小化财务上下文,不接收密码、JWT 或 API Key。', + ), + _LegalSection( + 'Android / iOS 系统能力', + '系统语音识别、照片选择器、通知、无障碍截图、MediaProjection 和系统分享属于操作系统能力,并非记之植入的广告或统计 SDK。', + ), + ]; +} + +class _LegalSection { + final String title; + final String body; + const _LegalSection(this.title, this.body); +} diff --git a/frontend/lib/features/settings/me_page.dart b/frontend/lib/features/settings/me_page.dart new file mode 100644 index 0000000..801036b --- /dev/null +++ b/frontend/lib/features/settings/me_page.dart @@ -0,0 +1,558 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/auth_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/sync_service.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/update/update_coordinator.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/version.dart'; + +/// 我的页(P6):模式切换 + 设置入口 + 退出登录 +class MePage extends StatefulWidget { + const MePage({super.key}); + + @override + State createState() => _MePageState(); +} + +class _MePageState extends State { + UserProfile? _profile; + + @override + void initState() { + super.initState(); + PublicConfigApi.companionNotifier.addListener(_refreshCompanion); + SessionStore.instance.addListener(_refreshSession); + SyncService.instance.refreshLocalStatus(); + _load(); + } + + void _refreshCompanion() { + if (mounted) setState(() {}); + } + + void _refreshSession() { + if (mounted) setState(() {}); + } + + @override + void dispose() { + PublicConfigApi.companionNotifier.removeListener(_refreshCompanion); + SessionStore.instance.removeListener(_refreshSession); + super.dispose(); + } + + Future _load() async { + try { + final p = await AuthApi.me(); + if (mounted) setState(() => _profile = p); + } catch (_) {} + } + + Future _checkUpdate() => + UpdateCoordinator.instance.checkManually(context); + + Future _switchMode(String mode) async { + if (_profile?.appMode == mode) return; + try { + final p = await AuthApi.switchMode(mode); + if (!mounted) return; + setState(() => _profile = p); + if (mode == 'ai') context.go('/ai-mode'); + } catch (e) { + if (mounted) + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(e)))); + } + } + + Future _logout() async { + final guest = SessionStore.instance.isGuest; + final ok = await showJzConfirmSheet( + context, + title: guest ? '退出游客模式' : '退出登录', + message: guest + ? '游客数据会继续加密保存在本机,下次进入游客模式仍可使用。' + : '账号本地数据会继续加密保存在本机,切换账号不会混用。', + confirmLabel: '退出', + destructive: true, + ); + if (!ok) return; + await AuthApi.logout(); + if (mounted) context.go('/login'); + } + + @override + Widget build(BuildContext context) { + final p = _profile; + final session = SessionStore.instance; + return Scaffold( + body: SafeArea( + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 16), + children: [ + // 用户头 + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Row( + children: [ + CircleAvatar( + radius: 27, + backgroundColor: context.jz.card, + child: AppIcons.icon( + AppIcons.user, + size: 26, + color: context.jz.text2, + ), + ), + SizedBox(width: 13), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + session.nickname ?? + p?.nickname ?? + p?.username ?? + (session.isGuest ? '游客' : '…'), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 3), + Text( + '@${p?.username ?? ''}', + style: TextStyle(fontSize: 11, color: context.jz.text3), + ), + ], + ), + ], + ), + ), + Card( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 8, + ), + child: session.isGuest + ? const GuestLocalStatusCard() + : Column( + children: [ + AnimatedBuilder( + animation: SyncService.instance, + builder: (context, _) { + final sync = SyncService.instance; + return JzSwitchTile( + value: session.cloudSyncEnabled, + title: '云同步', + subtitle: session.cloudSyncEnabled + ? sync.statusLabel + : '本地模式:数据不会发送到服务端', + onChanged: (value) async { + await session.setCloudSyncEnabled(value); + if (value) { + await sync.run(); + } else { + sync.refreshLocalStatus(); + } + if (mounted) setState(() {}); + }, + ); + }, + ), + if (session.needsReauth) + InkWell( + onTap: () => context.go('/login'), + borderRadius: BorderRadius.circular(10), + child: Container( + width: double.infinity, + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 8, + ), + decoration: BoxDecoration( + color: context.jz.warningBackground, + borderRadius: BorderRadius.circular(10), + ), + child: Text( + '云同步登录已过期,点击重新登录;本地记账不受影响', + style: TextStyle( + fontSize: 10.5, + color: context.jz.text2, + ), + ), + ), + ), + ], + ), + ), + ), + SizedBox(height: 12), + // 模式切换 + if (!session.isGuest && session.aiEnabled) ...[ + Card( + child: Padding( + padding: const EdgeInsets.all(15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'App 模式', + style: TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 3), + Text( + '选择你喜欢的使用方式,可随时切换', + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + SizedBox(height: 11), + Row( + children: [ + _ModeOpt( + title: '普通记账模式', + desc: '经典账本界面', + iconAsset: AppIcons.wallet, + color: AppTheme.primary, + selected: session.appMode != 'ai', + onTap: () => _switchMode('normal'), + ), + SizedBox(width: 10), + _ModeOpt( + title: '全 AI 模式', + desc: '对话作为主界面', + iconAsset: AppIcons.sparkle, + color: AppTheme.ai, + selected: session.appMode == 'ai', + onTap: () => _switchMode('ai'), + ), + ], + ), + ], + ), + ), + ), + SizedBox(height: 12), + ], // 设置入口 + Card( + child: Column( + children: [ + if (!session.isGuest && session.aiEnabled) + _row( + AppIcons.avatarAsset(PublicConfigApi.companionAvatarKey), + context.jz.aiBackground, + AppTheme.ai, + '${PublicConfigApi.companionName} 性格设置', + trailing: p?.aiCompanion?.personaKey, + onTap: () => context.push('/companion'), + ), + _row( + AppIcons.target, + context.jz.primaryBackground, + AppTheme.primary, + '预算管理', + onTap: () => context.push('/budget'), + ), + _row( + AppIcons.avatarAsset(PublicConfigApi.companionAvatarKey), + context.jz.aiBackground, + AppTheme.ai, + session.aiEnabled ? 'AI 报告' : '报告', + onTap: () => context.push('/report'), + ), + _row( + AppIcons.tag, + context.jz.primaryBackground, + AppTheme.primary, + '分类管理', + onTap: () => context.push('/categories'), + ), + if (!session.isGuest && PublicConfigApi.screenshotEnabled) + _row( + AppIcons.camera, + context.jz.primaryBackground, + AppTheme.red, + '智能识别', + trailing: '设置', + onTap: () => context.push('/screenshot-settings'), + ), + _row( + AppIcons.user, + context.jz.background, + context.jz.text2, + session.isGuest ? '本地数据' : '账号与数据', + onTap: () async { + await context.push('/account-data'); + _load(); + }, + ), + _row( + AppIcons.gear, + context.jz.background, + context.jz.text2, + '外观设置', + onTap: () => context.push('/appearance'), + ), + if (session.isAccount && + SyncService.instance.conflictCount > 0) + _row( + AppIcons.offline, + context.jz.warningBackground, + AppTheme.orange, + '同步冲突', + trailing: '${SyncService.instance.conflictCount} 项待处理', + onTap: () async { + await context.push('/sync-conflicts'); + if (mounted) setState(() {}); + }, + ), + AnimatedBuilder( + animation: UpdateCoordinator.instance, + builder: (context, _) => _row( + AppIcons.cloud, + context.jz.primaryBackground, + AppTheme.primary, + '检查更新', + trailing: UpdateCoordinator.instance.checking + ? '正在检查…' + : AppVersion.display, + onTap: UpdateCoordinator.instance.checking + ? () {} + : _checkUpdate, + ), + ), + _row( + AppIcons.trash, + context.jz.expenseBackground, + AppTheme.red, + '回收站', + trailing: '保留 30 天', + onTap: () => context.push('/recycle-bin'), + ), + ], + ), + ), + SizedBox(height: 12), + Card( + child: _row( + AppIcons.exportIcon, + context.jz.expenseBackground, + AppTheme.red, + session.isGuest ? '退出游客模式' : '退出登录', + onTap: _logout, + ), + ), + SizedBox(height: 16), + Center( + child: Text( + AppVersion.display, + style: TextStyle(fontSize: 10, color: context.jz.text3), + ), + ), + SizedBox(height: 12), + ], + ), + ), + ); + } + + Widget _row( + String iconAsset, + Color bg, + Color fg, + String label, { + String? trailing, + required VoidCallback onTap, + }) { + return InkWell( + onTap: onTap, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 13), + child: Row( + children: [ + Container( + width: 28, + height: 28, + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(8), + ), + child: Center( + child: AppIcons.icon(iconAsset, size: 15, color: fg), + ), + ), + SizedBox(width: 12), + Text(label, style: TextStyle(fontSize: 13.5)), + Spacer(), + if (trailing != null) + Text( + trailing, + style: TextStyle(fontSize: 11.5, color: context.jz.text3), + ), + AppIcons.icon( + AppIcons.chevronRight, + size: 16, + color: context.jz.text3, + ), + ], + ), + ), + ); + } +} + +class GuestLocalStatusCard extends StatelessWidget { + const GuestLocalStatusCard({super.key}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 7), + child: Row( + children: [ + Container( + width: 38, + height: 38, + decoration: BoxDecoration( + color: context.jz.primaryBackground, + borderRadius: BorderRadius.circular(12), + ), + child: Center( + child: AppIcons.icon( + AppIcons.check, + size: 19, + color: AppTheme.primaryDeep, + ), + ), + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '本机保存中', + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w700), + ), + SizedBox(height: 3), + Text( + '账单、分类、预算和统计仅保存在本机,不会自动上传', + style: TextStyle( + fontSize: 10.5, + height: 1.4, + color: context.jz.text2, + ), + ), + ], + ), + ), + SizedBox(width: 8), + DecoratedBox( + decoration: BoxDecoration( + color: context.jz.primaryBackground, + borderRadius: BorderRadius.all(Radius.circular(12)), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 9, vertical: 5), + child: Text( + '游客模式', + style: TextStyle( + color: AppTheme.primaryDeep, + fontSize: 10, + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], + ), + ); + } +} + +class _ModeOpt extends StatelessWidget { + final String title, desc; + final String iconAsset; + final Color color; + final bool selected; + final VoidCallback onTap; + const _ModeOpt({ + required this.title, + required this.desc, + required this.iconAsset, + required this.color, + required this.selected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Expanded( + child: GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(11), + decoration: BoxDecoration( + color: selected ? context.jz.primaryBackground : context.jz.card, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: selected ? AppTheme.primary : context.jz.line, + width: 1.5, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppIcons.icon(iconAsset, size: 20, color: color), + Spacer(), + Container( + width: 15, + height: 15, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: selected ? AppTheme.primary : context.jz.line, + width: 1.5, + ), + color: selected ? AppTheme.primary : null, + ), + child: selected + ? AppIcons.icon( + AppIcons.check, + size: 10, + color: Colors.white, + ) + : null, + ), + ], + ), + SizedBox(height: 7), + Text( + title, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w700), + ), + SizedBox(height: 3), + Text( + desc, + style: TextStyle(fontSize: 9, color: context.jz.text2), + ), + ], + ), + ), + ), + ); + } +} diff --git a/frontend/lib/features/settings/recycle_bin_page.dart b/frontend/lib/features/settings/recycle_bin_page.dart new file mode 100644 index 0000000..0eb1d13 --- /dev/null +++ b/frontend/lib/features/settings/recycle_bin_page.dart @@ -0,0 +1,153 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +class RecycleBinPage extends StatefulWidget { + const RecycleBinPage({super.key}); + + @override + State createState() => _RecycleBinPageState(); +} + +class _RecycleBinPageState extends State { + List _items = const []; + bool _loading = true; + + @override + void initState() { + super.initState(); + _load(); + } + + Future _load() async { + setState(() => _loading = true); + try { + await CurrentLedgerStore.instance.ensureLoaded(); + final items = await TxApi.recycleBin(); + if (mounted) setState(() => _items = items); + } catch (error) { + if (mounted) _showError(error); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + Future _restore(TxItem item) async { + try { + await TxApi.restore(item.id); + TransactionEvents.notifyChanged(); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _permanentDelete(TxItem item) async { + final confirmed = await _confirm('永久删除', '永久删除后无法恢复,聊天中的账单卡片会显示为已删除。'); + if (!confirmed) return; + try { + await TxApi.permanentlyDelete(item.id); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _clear() async { + if (_items.isEmpty) return; + final confirmed = await _confirm('清空回收站', '将永久删除当前账本回收站中的全部账单,无法恢复。'); + if (!confirmed) return; + try { + await TxApi.clearRecycleBin(); + await _load(); + } catch (error) { + if (mounted) _showError(error); + } + } + + Future _confirm(String title, String message) => showJzConfirmSheet( + context, + title: title, + message: message, + confirmLabel: '永久删除', + destructive: true, + ); + + Future _showActions(TxItem item) async { + final action = await showJzOptionSheet( + context, + title: item.note ?? item.categoryName, + options: const [ + JzOption(value: 'restore', label: '恢复账单'), + JzOption(value: 'delete', label: '永久删除', subtitle: '删除后无法恢复'), + ], + ); + if (action == 'restore') await _restore(item); + if (action == 'delete') await _permanentDelete(item); + } + + void _showError(Object error) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('${CurrentLedgerStore.instance.currentName} · 回收站'), + actions: [ + TextButton( + onPressed: _items.isEmpty ? null : _clear, + child: Text('清空'), + ), + ], + ), + body: _loading + ? Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + : _items.isEmpty + ? Center( + child: Text( + '回收站暂无账单\n删除的账单会保留 30 天', + textAlign: TextAlign.center, + style: TextStyle(color: context.jz.text3, height: 1.6), + ), + ) + : ListView.builder( + padding: const EdgeInsets.all(16), + itemCount: _items.length, + itemBuilder: (context, index) { + final item = _items[index]; + return Card( + child: ListTile( + leading: CategoryIconBox( + iconKey: item.categoryIcon, + colorKey: item.categoryColor, + ), + title: Text(item.note ?? item.categoryName), + subtitle: Text( + '${item.occurredAt.year}-${item.occurredAt.month.toString().padLeft(2, '0')}-${item.occurredAt.day.toString().padLeft(2, '0')}', + ), + trailing: IconButton( + tooltip: '账单操作', + onPressed: () => _showActions(item), + icon: Icon(Icons.more_horiz_rounded), + ), + ), + ); + }, + ), + ); + } +} diff --git a/frontend/lib/features/settings/screenshot_settings_page.dart b/frontend/lib/features/settings/screenshot_settings_page.dart new file mode 100644 index 0000000..76dadbc --- /dev/null +++ b/frontend/lib/features/settings/screenshot_settings_page.dart @@ -0,0 +1,993 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:miaoji_zhang/shared/services/recognition_diagnostic_formatter.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +class ScreenshotSettingsPage extends StatefulWidget { + const ScreenshotSettingsPage({super.key}); + + @override + State createState() => _ScreenshotSettingsPageState(); +} + +class _ScreenshotSettingsPageState extends State + with WidgetsBindingObserver { + RecognitionStatus? _status; + bool _checking = true; + bool _authorizing = false; + String? _pendingAuthorizationKey; + String? _error; + Timer? _diagnosticRefreshTimer; + Timer? _previewExpiryTimer; + bool _diagnosticRefreshInFlight = false; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + _check(); + _diagnosticRefreshTimer = Timer.periodic( + const Duration(seconds: 2), + (_) => _refreshRunningDiagnostic(), + ); + } + + @override + void dispose() { + _diagnosticRefreshTimer?.cancel(); + _previewExpiryTimer?.cancel(); + WidgetsBinding.instance.removeObserver(this); + super.dispose(); + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) { + Future.delayed( + const Duration(milliseconds: 500), + _resumeAuthorization, + ); + } + } + + void _refreshRunningDiagnostic() { + if (!mounted || + _diagnosticRefreshInFlight || + _status?.latestDiagnostic?.result != 'started') { + return; + } + _diagnosticRefreshInFlight = true; + _check().whenComplete(() => _diagnosticRefreshInFlight = false); + } + + Future _check() async { + try { + var status = await ScreenshotChannel.recognitionStatus(); + final invalid = [ + if (status.accessibilityEvents && + (!status.accessibilityAuthorized || + !status.postNotificationsGranted)) + 'accessibility_events', + if (status.notificationEvents && + (!status.notificationAuthorized || + !status.postNotificationsGranted)) + 'notification_events', + if (status.aiScreenshot && + (!status.accessibilityAuthorized || + !status.postNotificationsGranted)) + 'ai_screenshot', + ]; + for (final key in invalid) { + await ScreenshotChannel.setRecognitionToggle(key, false); + } + if (invalid.isNotEmpty) { + status = await ScreenshotChannel.recognitionStatus(); + } + if (!mounted) return; + setState(() { + _status = status; + _checking = false; + _error = null; + }); + _schedulePreviewExpiry(status); + } catch (_) { + if (!mounted) return; + setState(() { + _checking = false; + _error = '状态读取失败,请重试'; + }); + } + } + + void _schedulePreviewExpiry(RecognitionStatus status) { + _previewExpiryTimer?.cancel(); + final expiresAt = status.ocrDiagnosticPreviewExpiresAt; + if (!status.ocrDiagnosticPreview || expiresAt == null) return; + final remaining = expiresAt.difference(DateTime.now()); + if (remaining <= Duration.zero) { + unawaited(_check()); + return; + } + _previewExpiryTimer = Timer(remaining, _check); + } + + bool _hasSystemAuthorization(String key, RecognitionStatus status) { + return switch (key) { + 'notification_events' => status.notificationAuthorized, + 'accessibility_events' || + 'ai_screenshot' => status.accessibilityAuthorized, + _ => true, + }; + } + + Future _toggle(String key, bool enabled) async { + if (_authorizing) return; + if (key == 'ocr_diagnostic_preview') { + final changed = await ScreenshotChannel.setRecognitionToggle( + key, + enabled, + ); + if (!mounted) return; + if (!changed) { + _showMessage('设置保存失败,请重试'); + } else if (enabled) { + _showMessage('脱敏预览已开启,将在 10 分钟后自动关闭'); + } + await _check(); + return; + } + if (enabled && + key == 'accessibility_events' && + !await _confirmLocalOcrConsent()) { + return; + } + if (!enabled) { + _pendingAuthorizationKey = null; + final changed = await ScreenshotChannel.setRecognitionToggle(key, false); + if (!mounted) return; + if (!changed) { + _showMessage('设置保存失败,请重试'); + } + await _check(); + return; + } + + final status = _status ?? await ScreenshotChannel.recognitionStatus(); + if (!_hasSystemAuthorization(key, status)) { + await ScreenshotChannel.setRecognitionToggle(key, false); + _pendingAuthorizationKey = key; + await _check(); + if (!mounted) return; + if (key == 'notification_events') { + await ScreenshotChannel.openNotificationAccessSettings(); + } else { + await ScreenshotChannel.openAccessibilitySettings(); + } + return; + } + await _enableAfterAuthorization(key); + } + + Future _resumeAuthorization() async { + if (_authorizing) return; + await _check(); + final key = _pendingAuthorizationKey; + final status = _status; + if (key == null || status == null) return; + if (!_hasSystemAuthorization(key, status)) { + _pendingAuthorizationKey = null; + await ScreenshotChannel.setRecognitionToggle(key, false); + await _check(); + if (mounted) _showMessage('未完成系统授权,识别开关仍保持关闭'); + return; + } + await _enableAfterAuthorization(key); + } + + Future _enableAfterAuthorization(String key) async { + _authorizing = true; + try { + final notificationsAllowed = + await ScreenshotChannel.requestNotificationPermission(); + if (!notificationsAllowed) { + await ScreenshotChannel.setRecognitionToggle(key, false); + if (mounted) { + _showMessage('未允许结果通知,识别开关仍保持关闭'); + } + return; + } + final changed = await ScreenshotChannel.setRecognitionToggle(key, true); + if (!changed && mounted) { + _showMessage('设置保存失败,请重试'); + } + } finally { + _pendingAuthorizationKey = null; + _authorizing = false; + await _check(); + } + } + + Future _confirmLocalOcrConsent() async { + final preferences = await SharedPreferences.getInstance(); + if (preferences.getBool('local_ocr_consent_v1') == true) return true; + if (!mounted) return false; + final accepted = await showModalBottomSheet( + context: context, + useSafeArea: true, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => Container( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 20), + decoration: BoxDecoration( + color: sheetContext.jz.card, + borderRadius: const BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const JzSheetHeader(title: '启用本地视觉识别', subtitle: '请确认无障碍事件识别的截屏用途'), + const SizedBox(height: 12), + const _ConsentPoint( + icon: Icons.visibility_outlined, + text: '仅在微信、支付宝疑似支付流程结束时截取当前页面。', + ), + const _ConsentPoint( + icon: Icons.memory_rounded, + text: '图片只在内存中由本地 OCR 处理,完成后立即释放。', + ), + const _ConsentPoint( + icon: Icons.cloud_off_outlined, + text: '默认不会上传;只有你另行开启 AI 截图补全时才允许在线分析。', + ), + const SizedBox(height: 16), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '暂不开启', + secondary: true, + onPressed: () => Navigator.pop(sheetContext, false), + ), + ), + const SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: '同意并继续', + onPressed: () => Navigator.pop(sheetContext, true), + ), + ), + ], + ), + ], + ), + ), + ); + if (accepted == true) { + await preferences.setBool('local_ocr_consent_v1', true); + return true; + } + return false; + } + + void _showMessage(String message) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); + } + + @override + Widget build(BuildContext context) { + final palette = context.jz; + final status = _status; + final aiAvailable = + SessionStore.instance.isAccount && SessionStore.instance.aiEnabled; + return Scaffold( + appBar: AppBar(title: const Text('智能识别')), + body: RefreshIndicator( + onRefresh: _check, + child: ListView( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 28), + children: [ + Container( + padding: const EdgeInsets.all(18), + decoration: BoxDecoration( + color: palette.card, + borderRadius: BorderRadius.circular(20), + border: Border.all(color: palette.line), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: palette.primaryBackground, + borderRadius: BorderRadius.circular(14), + ), + child: const Icon( + Icons.auto_awesome_motion_rounded, + color: AppTheme.primary, + ), + ), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '微信、支付宝账单自动识别', + style: TextStyle( + color: palette.text, + fontSize: 16, + fontWeight: FontWeight.w800, + ), + ), + const SizedBox(height: 6), + Text( + '两路结果会先在本机合并去重。金额、方向和来源明确时自动入账,其他情况只通知你确认。', + style: TextStyle( + color: palette.text2, + fontSize: 12, + height: 1.55, + ), + ), + ], + ), + ), + ], + ), + ), + const SizedBox(height: 12), + if (_checking) + const Center( + child: Padding( + padding: EdgeInsets.all(30), + child: CircularProgressIndicator(), + ), + ) + else if (_error != null) + _ErrorCard(message: _error!, onRetry: _check) + else ...[ + _RecognitionCard( + icon: Icons.accessibility_new_rounded, + title: '无障碍事件识别', + description: + '仅在微信和支付宝疑似支付流程中读取可见文字,并按需在内存中进行本地截图 OCR;不保存图片、完整控件树,也不监听按键。', + authorized: status!.accessibilityAuthorized, + connected: status.accessibilityConnected, + onOpenSettings: ScreenshotChannel.openAccessibilitySettings, + child: Column( + children: [ + JzSwitchTile( + value: status.accessibilityEvents, + title: '识别开关', + subtitle: !status.accessibilityAuthorized + ? '开启后需要前往系统设置授权' + : !status.postNotificationsGranted + ? '识别已开启,还需允许记之显示结果通知' + : '系统权限已授权', + onChanged: (value) => + _toggle('accessibility_events', value), + ), + Divider(height: 1, color: context.jz.line), + JzSwitchTile( + value: status.ocrDiagnosticPreview, + title: 'OCR 诊断预览', + subtitle: '仅保留脱敏文字,10 分钟后自动关闭,不上传、不保存原图', + onChanged: status.accessibilityEvents + ? (value) => _toggle('ocr_diagnostic_preview', value) + : null, + ), + ], + ), + ), + const SizedBox(height: 10), + _RecognitionCard( + icon: Icons.notifications_active_outlined, + title: '通知识别', + description: '只处理开启后新产生的微信、支付宝通知,不读取通知历史;关闭识别不会撤销系统授权。', + authorized: status.notificationAuthorized, + connected: status.notificationConnected, + onOpenSettings: + ScreenshotChannel.openNotificationAccessSettings, + + child: JzSwitchTile( + value: status.notificationEvents, + title: '识别开关', + subtitle: !status.notificationAuthorized + ? '开启后需要前往系统设置授权' + : !status.postNotificationsGranted + ? '已允许读取,还需允许记之显示结果通知' + : '通知访问权限已授权', + onChanged: (value) => _toggle('notification_events', value), + ), + ), + const SizedBox(height: 10), + _RecognitionCard( + icon: Icons.document_scanner_outlined, + title: 'AI 截图补全', + description: '本地 OCR 已确认支付成功但字段仍不足时才在线分析。截图完成、失败或超时后立即释放。', + authorized: aiAvailable, + connected: aiAvailable && status.accessibilityConnected, + statusLabel: !aiAvailable ? 'AI 不可用' : null, + onOpenSettings: status.accessibilityAuthorized + ? null + : ScreenshotChannel.openAccessibilitySettings, + child: JzSwitchTile( + value: status.aiScreenshot, + title: '补全开关', + subtitle: !aiAvailable + ? '需要登录且账号具备 AI 权限' + : !status.accessibilityAuthorized + ? '需要先授权无障碍截屏能力' + : '默认关闭,仅在支付应用前台运行', + onChanged: !aiAvailable + ? null + : (value) => _toggle('ai_screenshot', value), + ), + ), + if (status.latestDiagnostic != null) ...[ + const SizedBox(height: 10), + _RecognitionDiagnosticCard( + diagnostic: status.latestDiagnostic!, + onClear: () async { + await ScreenshotChannel.clearRecognitionDiagnostic(); + await _check(); + }, + ), + ], + if (status.accessibilityEvents || + status.notificationEvents || + status.aiScreenshot) ...[ + const SizedBox(height: 10), + _BackgroundKeepAliveCard(status: status), + ], + const SizedBox(height: 10), + _RecognitionCard( + icon: Icons.grid_view_rounded, + title: '快捷磁贴截屏', + description: + '无障碍已连接时静默截屏;未连接时每次弹出 Android 一次性投屏授权。两种方式都不会占用音量键。', + authorized: status.accessibilityAuthorized, + connected: status.accessibilityConnected, + statusLabel: status.accessibilityConnected ? '免授权截屏' : '每次系统授权', + child: SizedBox( + width: double.infinity, + child: JzActionButton( + label: '添加截屏记账磁贴', + secondary: true, + icon: const Icon(Icons.tune_rounded, size: 18), + onPressed: ScreenshotChannel.openQuickSettings, + ), + ), + ), + ], + const SizedBox(height: 12), + Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: palette.warningBackground, + borderRadius: BorderRadius.circular(14), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Icon( + Icons.shield_outlined, + color: AppTheme.orange, + size: 20, + ), + const SizedBox(width: 9), + Expanded( + child: Text( + '银行密码页等安全窗口由系统禁止截屏,记之不会绕过限制。本地 OCR 图片仅在内存中处理;只有你开启 AI 截图补全时才会上传当前支付页。', + style: TextStyle( + color: palette.text2, + fontSize: 11.5, + height: 1.55, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} + +class _ConsentPoint extends StatelessWidget { + final IconData icon; + final String text; + + const _ConsentPoint({required this.icon, required this.text}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 7), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, size: 20, color: AppTheme.primary), + const SizedBox(width: 10), + Expanded( + child: Text( + text, + style: TextStyle(color: context.jz.text2, height: 1.5), + ), + ), + ], + ), + ); + } +} + +class _RecognitionDiagnosticCard extends StatelessWidget { + final RecognitionDiagnostic diagnostic; + final VoidCallback onClear; + + const _RecognitionDiagnosticCard({ + required this.diagnostic, + required this.onClear, + }); + + @override + Widget build(BuildContext context) { + final civil = ShanghaiTime.toCivil(diagnostic.at.toUtc()); + final time = + '${civil.month.toString().padLeft(2, '0')}-' + '${civil.day.toString().padLeft(2, '0')} ' + '${civil.hour.toString().padLeft(2, '0')}:' + '${civil.minute.toString().padLeft(2, '0')}'; + final display = RecognitionDiagnosticDisplay.from(diagnostic); + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(18), + border: Border.all(color: context.jz.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + const Icon(Icons.fact_check_outlined, color: AppTheme.primary), + const SizedBox(width: 9), + Expanded( + child: Text( + '最近一次识别', + style: TextStyle( + color: context.jz.text, + fontWeight: FontWeight.w800, + ), + ), + ), + Semantics( + button: true, + label: '清除识别诊断', + child: InkWell( + onTap: onClear, + borderRadius: BorderRadius.circular(10), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 7, + ), + child: Text( + '清除', + style: TextStyle( + color: AppTheme.primary, + fontSize: 12, + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ], + ), + const SizedBox(height: 8), + Text( + '${diagnostic.appName} · ${display.stageLabel} · ${display.summaryLabel}', + style: TextStyle( + color: context.jz.text, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: 5), + Text( + display.reasonLabel, + style: TextStyle(color: context.jz.text2, height: 1.45), + ), + if (display.recognitionKindLabel != null || + display.amountSourceLabel != null || + display.statusStrengthLabel != null || + diagnostic.expectedAmountMatched != null || + diagnostic.resultTransitionObserved != null) ...[ + const SizedBox(height: 9), + Wrap( + spacing: 7, + runSpacing: 7, + children: [ + _EvidencePill( + label: display.resultLabel, + positive: + diagnostic.result == 'matched' || + diagnostic.result == 'auto_ready', + ), + if (display.recognitionKindLabel != null) + _EvidencePill( + label: display.recognitionKindLabel!, + positive: true, + ), + if (display.amountSourceLabel != null) + _EvidencePill( + label: display.amountSourceLabel!, + positive: true, + ), + if (diagnostic.resultFingerprint != null) + _EvidencePill( + label: '结果指纹 ${diagnostic.resultFingerprint}', + positive: true, + ), + if (display.statusStrengthLabel != null) + _EvidencePill( + label: display.statusStrengthLabel!, + positive: display.statusStrengthPositive, + ), + if (diagnostic.expectedAmountMatched != null) + _EvidencePill( + label: diagnostic.expectedAmountMatched! ? '金额匹配' : '金额不匹配', + positive: diagnostic.expectedAmountMatched!, + ), + if (diagnostic.resultTransitionObserved != null) + _EvidencePill( + label: diagnostic.resultTransitionObserved! + ? '已观察到页面跳转' + : '未观察到页面跳转', + positive: diagnostic.resultTransitionObserved!, + ), + ], + ), + ], + if (diagnostic.ocrPreview.isNotEmpty) ...[ + const SizedBox(height: 10), + Container( + width: double.infinity, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: context.jz.background, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: context.jz.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'OCR 脱敏预览', + style: TextStyle( + color: context.jz.text, + fontSize: 12, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: 6), + ...diagnostic.ocrPreview.map( + (line) => Padding( + padding: const EdgeInsets.only(top: 2), + child: Text( + line, + style: TextStyle( + color: context.jz.text2, + fontSize: 12, + height: 1.35, + ), + ), + ), + ), + ], + ), + ), + ], + const SizedBox(height: 7), + Text( + '$time · 节点 ${diagnostic.nodeCount}' + '${diagnostic.ocrMs == null ? '' : ' · OCR ${diagnostic.ocrMs}ms'}' + '${diagnostic.amountCandidates == 0 ? '' : ' · 金额候选 ${diagnostic.amountCandidates}'}', + style: TextStyle(color: context.jz.text3, fontSize: 11), + ), + ], + ), + ); + } +} + +class _EvidencePill extends StatelessWidget { + final String label; + final bool positive; + + const _EvidencePill({required this.label, required this.positive}); + + @override + Widget build(BuildContext context) { + final color = positive ? AppTheme.primary : context.jz.text3; + return Container( + padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 5), + decoration: BoxDecoration( + color: positive ? context.jz.primaryBackground : context.jz.background, + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: positive ? AppTheme.primary : context.jz.line, + ), + ), + child: Text( + label, + style: TextStyle( + color: color, + fontSize: 10, + fontWeight: FontWeight.w700, + ), + ), + ); + } +} + +class _BackgroundKeepAliveCard extends StatelessWidget { + final RecognitionStatus status; + + const _BackgroundKeepAliveCard({required this.status}); + + @override + Widget build(BuildContext context) { + final isVivo = status.manufacturer.toLowerCase().contains('vivo'); + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(18), + border: Border.all(color: context.jz.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 38, + height: 38, + decoration: BoxDecoration( + color: context.jz.warningBackground, + borderRadius: BorderRadius.circular(12), + ), + child: const Icon( + Icons.battery_saver_outlined, + color: AppTheme.orange, + size: 21, + ), + ), + const SizedBox(width: 11), + const Expanded( + child: Text( + '后台识别保活', + style: TextStyle(fontWeight: FontWeight.w800), + ), + ), + Text( + status.batteryOptimizationIgnored ? '后台限制较少' : '需要设置', + style: TextStyle( + color: status.batteryOptimizationIgnored + ? AppTheme.primaryDeep + : AppTheme.orange, + fontSize: 10, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + const SizedBox(height: 10), + Text( + '无障碍和通知监听由 Android 独立轻量进程运行。请允许记之后台活动,' + '${isVivo ? '并在 OriginOS 中开启自启动,' : ''}' + '否则系统清理进程后可能暂时收不到支付事件。', + style: TextStyle( + color: context.jz.text2, + fontSize: 11.5, + height: 1.55, + ), + ), + const SizedBox(height: 12), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '电池优化', + secondary: true, + onPressed: ScreenshotChannel.openBatteryOptimizationSettings, + ), + ), + const SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: isVivo ? '自启动管理' : '后台设置', + secondary: true, + onPressed: ScreenshotChannel.openBackgroundStartupSettings, + ), + ), + ], + ), + ], + ), + ); + } +} + +class _RecognitionCard extends StatelessWidget { + final IconData icon; + final String title; + final String description; + final bool authorized; + final bool connected; + final String? statusLabel; + final Widget child; + final VoidCallback? onOpenSettings; + + const _RecognitionCard({ + required this.icon, + required this.title, + required this.description, + required this.authorized, + required this.connected, + required this.child, + this.statusLabel, + this.onOpenSettings, + }); + + @override + Widget build(BuildContext context) { + final palette = context.jz; + final color = connected ? AppTheme.primary : AppTheme.ai; + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: palette.card, + borderRadius: BorderRadius.circular(18), + border: Border.all(color: palette.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 38, + height: 38, + decoration: BoxDecoration( + color: connected + ? palette.primaryBackground + : palette.aiBackground, + borderRadius: BorderRadius.circular(12), + ), + child: Icon(icon, color: color, size: 21), + ), + const SizedBox(width: 11), + Expanded( + child: Text( + title, + style: TextStyle( + color: palette.text, + fontWeight: FontWeight.w800, + ), + ), + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 5), + decoration: BoxDecoration( + color: connected + ? palette.primaryBackground + : palette.aiBackground, + borderRadius: BorderRadius.circular(20), + ), + child: Text( + statusLabel ?? + (connected + ? '已连接' + : authorized + ? '等待连接' + : '未授权'), + style: TextStyle( + color: color, + fontSize: 10, + fontWeight: FontWeight.w700, + ), + ), + ), + ], + ), + const SizedBox(height: 10), + Text( + description, + style: TextStyle(color: palette.text2, fontSize: 12, height: 1.55), + ), + const SizedBox(height: 6), + child, + if (onOpenSettings != null) ...[ + const SizedBox(height: 6), + Align( + alignment: Alignment.centerLeft, + child: Semantics( + button: true, + label: '打开系统权限设置', + child: InkWell( + onTap: onOpenSettings, + borderRadius: BorderRadius.circular(10), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 8, + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.settings_outlined, + size: 17, + color: AppTheme.primary, + ), + const SizedBox(width: 6), + Text( + '系统权限设置', + style: TextStyle( + color: AppTheme.primary, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + ), + ), + ), + ), + ], + ], + ), + ); + } +} + +class _ErrorCard extends StatelessWidget { + final String message; + final VoidCallback onRetry; + + const _ErrorCard({required this.message, required this.onRetry}); + + @override + Widget build(BuildContext context) { + final palette = context.jz; + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: palette.card, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: palette.line), + ), + child: Column( + children: [ + Text(message, style: TextStyle(color: palette.text2)), + const SizedBox(height: 10), + JzActionButton(label: '重新读取', secondary: true, onPressed: onRetry), + ], + ), + ); + } +} diff --git a/frontend/lib/features/settings/sync_conflicts_page.dart b/frontend/lib/features/settings/sync_conflicts_page.dart new file mode 100644 index 0000000..8b0e172 --- /dev/null +++ b/frontend/lib/features/settings/sync_conflicts_page.dart @@ -0,0 +1,173 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/sync_service.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +class SyncConflictsPage extends StatefulWidget { + const SyncConflictsPage({super.key}); + + @override + State createState() => _SyncConflictsPageState(); +} + +class _SyncConflictsPageState extends State { + List> _items = const []; + int? _resolvingId; + + @override + void initState() { + super.initState(); + _load(); + } + + void _load() { + setState(() => _items = LocalDatabase.instance.conflicts()); + } + + Future _resolve( + Map item, { + required bool keepLocal, + }) async { + setState(() => _resolvingId = item['id'] as int); + try { + await SyncService.instance.resolveConflict(item, keepLocal: keepLocal); + if (mounted) _load(); + } catch (error) { + if (mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } finally { + if (mounted) setState(() => _resolvingId = null); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('同步冲突')), + body: _items.isEmpty + ? Center( + child: Text( + '没有需要处理的同步冲突', + style: TextStyle(color: context.jz.text3), + ), + ) + : ListView.separated( + padding: const EdgeInsets.all(16), + itemCount: _items.length, + separatorBuilder: (_, __) => SizedBox(height: 10), + itemBuilder: (context, index) => _conflictCard(_items[index]), + ), + ); + } + + Widget _conflictCard(Map item) { + final local = item['local'] as Map; + final remote = item['remote'] as Map; + final resolving = _resolvingId == item['id']; + return Card( + child: Padding( + padding: const EdgeInsets.all(14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.sync_problem_rounded, color: AppTheme.orange), + SizedBox(width: 8), + Expanded( + child: Text( + _operationLabel(item['operation'] as String), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w800), + ), + ), + ], + ), + SizedBox(height: 12), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: _version('本地版本', local, context.jz.primaryBackground), + ), + SizedBox(width: 9), + Expanded( + child: _version('云端版本', remote, context.jz.aiBackground), + ), + ], + ), + SizedBox(height: 12), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '使用云端', + secondary: true, + loading: resolving, + onPressed: resolving + ? null + : () => _resolve(item, keepLocal: false), + ), + ), + SizedBox(width: 9), + Expanded( + child: JzActionButton( + label: '保留本地', + loading: resolving, + onPressed: resolving + ? null + : () => _resolve(item, keepLocal: true), + ), + ), + ], + ), + ], + ), + ), + ); + } + + Widget _version(String title, Map value, Color background) { + final amount = value['amount']; + return Container( + constraints: const BoxConstraints(minHeight: 92), + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: background, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + SizedBox(height: 6), + if (amount != null) + Text( + '¥${(amount as num).toStringAsFixed(2)}', + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w800), + ), + SizedBox(height: 3), + Text( + (value['note'] ?? value['categoryName'] ?? '无可展示内容').toString(), + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 10.5, color: context.jz.text2), + ), + ], + ), + ); + } + + String _operationLabel(String operation) => switch (operation) { + 'delete' => '同一账单在云端有新修改,是否仍删除?', + 'restore' => '同一账单在云端有新修改,是否仍恢复?', + _ => '本地与云端都修改了同一账单', + }; +} diff --git a/frontend/lib/features/stats/report_page.dart b/frontend/lib/features/stats/report_page.dart new file mode 100644 index 0000000..edf54fc --- /dev/null +++ b/frontend/lib/features/stats/report_page.dart @@ -0,0 +1,564 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/api/config_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; +import 'package:miaoji_zhang/shared/widgets/async_error_view.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +enum _ReportKind { weekly, monthly, yearly } + +class ReportPage extends StatefulWidget { + const ReportPage({super.key}); + + @override + State createState() => _ReportPageState(); +} + +class _ReportPageState extends State { + PeriodReport? _report; + bool _loading = true; + String? _error; + DateTime _anchor = ShanghaiTime.now; + _ReportKind _kind = _ReportKind.monthly; + + @override + void initState() { + super.initState(); + PublicConfigApi.companionNotifier.addListener(_refreshCompanion); + CurrentLedgerStore.instance.addListener(_load); + _load(); + } + + @override + void dispose() { + PublicConfigApi.companionNotifier.removeListener(_refreshCompanion); + CurrentLedgerStore.instance.removeListener(_load); + super.dispose(); + } + + void _refreshCompanion() { + if (mounted) setState(() {}); + } + + Future _load() async { + setState(() { + _loading = true; + _error = null; + }); + try { + final report = switch (_kind) { + _ReportKind.weekly => await ReportApi.weekly(_anchor), + _ReportKind.monthly => await ReportApi.monthlyPeriod( + _anchor.year, + _anchor.month, + ), + _ReportKind.yearly => await ReportApi.yearly(_anchor.year), + }; + if (mounted) setState(() => _report = report); + } catch (error) { + if (mounted) setState(() => _error = apiErrorMessage(error)); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + void _selectKind(_ReportKind kind) { + if (_kind == kind) return; + setState(() { + _kind = kind; + _anchor = ShanghaiTime.now; + _report = null; + }); + _load(); + } + + void _move(int direction) { + final next = switch (_kind) { + _ReportKind.weekly => _anchor.add(Duration(days: 7 * direction)), + _ReportKind.monthly => DateTime(_anchor.year, _anchor.month + direction), + _ReportKind.yearly => DateTime(_anchor.year + direction), + }; + if (direction > 0 && _isFuture(next)) return; + setState(() { + _anchor = next; + _report = null; + }); + _load(); + } + + bool _isFuture(DateTime value) { + final now = ShanghaiTime.now; + return switch (_kind) { + _ReportKind.weekly => value.isAfter(now), + _ReportKind.monthly => + value.year > now.year || + (value.year == now.year && value.month > now.month), + _ReportKind.yearly => value.year > now.year, + }; + } + + @override + Widget build(BuildContext context) { + final report = _report; + return Scaffold( + appBar: AppBar( + title: Text(SessionStore.instance.aiEnabled ? 'AI 报告' : '报告'), + ), + body: Column( + children: [ + _periodTabs(), + _periodNavigator(), + Expanded( + child: !_loading && report == null && _error != null + ? AsyncErrorView(message: _error!, onRetry: _load) + : _loading && report == null + ? Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + : report == null + ? Center( + child: Text( + '暂无数据', + style: TextStyle(color: context.jz.text3), + ), + ) + : _reportBody(report), + ), + ], + ), + ); + } + + Widget _periodTabs() { + const labels = { + _ReportKind.weekly: '周报', + _ReportKind.monthly: '月报', + _ReportKind.yearly: '年报', + }; + return Container( + margin: const EdgeInsets.fromLTRB(16, 4, 16, 8), + padding: const EdgeInsets.all(3), + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(11), + ), + child: Row( + children: labels.entries.map((entry) { + final selected = entry.key == _kind; + return Expanded( + child: InkWell( + onTap: () => _selectKind(entry.key), + borderRadius: BorderRadius.circular(9), + child: AnimatedContainer( + duration: const Duration(milliseconds: 180), + padding: const EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + color: selected ? context.jz.card : Colors.transparent, + borderRadius: BorderRadius.circular(9), + ), + child: Text( + entry.value, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.5, + fontWeight: selected ? FontWeight.w800 : FontWeight.w500, + color: selected ? AppTheme.ai : context.jz.text2, + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } + + Widget _periodNavigator() { + final label = + _report?.periodLabel ?? + switch (_kind) { + _ReportKind.weekly => '本周', + _ReportKind.monthly => + _anchor.year.toString() + '年' + _anchor.month.toString() + '月', + _ReportKind.yearly => _anchor.year.toString() + '年', + }; + return Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + tooltip: '上一个周期', + onPressed: () => _move(-1), + icon: Icon(Icons.chevron_left_rounded), + ), + Container( + constraints: const BoxConstraints(minWidth: 150), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(18), + border: Border.all(color: context.jz.line), + ), + child: Text( + label, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 13, fontWeight: FontWeight.w700), + ), + ), + IconButton( + tooltip: '下一个周期', + onPressed: _isFuture(_nextAnchor()) ? null : () => _move(1), + icon: Icon(Icons.chevron_right_rounded), + ), + ], + ), + ); + } + + DateTime _nextAnchor() => switch (_kind) { + _ReportKind.weekly => _anchor.add(const Duration(days: 7)), + _ReportKind.monthly => DateTime(_anchor.year, _anchor.month + 1), + _ReportKind.yearly => DateTime(_anchor.year + 1), + }; + + Widget _reportBody(PeriodReport report) { + return RefreshIndicator( + onRefresh: _load, + child: ListView( + padding: const EdgeInsets.fromLTRB(16, 4, 16, 24), + children: [ + Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppTheme.ai, + borderRadius: BorderRadius.circular(18), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '✦ ' + PublicConfigApi.companionName + _kindLabel + '报告', + style: TextStyle( + fontSize: 11, + color: Colors.white.withValues(alpha: 0.85), + ), + ), + SizedBox(height: 8), + Text( + report.periodLabel + + ',一共支出 ¥' + + report.expense.toStringAsFixed(0), + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w800, + color: Colors.white, + ), + ), + SizedBox(height: 16), + Row( + children: [ + _num('收入', report.income), + _num('支出', report.expense), + _num('结余', report.balance), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '笔数', + style: TextStyle( + fontSize: 10, + color: Colors.white.withValues(alpha: 0.8), + ), + ), + SizedBox(height: 3), + Text( + report.count.toString(), + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + SizedBox(height: 10), + Card( + child: Column( + children: [ + if (report.peakLabel != null) + _highlight( + AppIcons.fire, + context.jz.expenseBackground, + AppTheme.red, + (_kind == _ReportKind.yearly ? '支出最高的月份:' : '最烧钱的一天:') + + report.peakLabel!, + '支出 ¥' + + report.peakAmount.toStringAsFixed(0) + + (report.peakNote != null + ? ',最大一笔是“' + report.peakNote! + '”' + : ''), + ), + + if (SessionStore.instance.aiEnabled) + _highlight( + AppIcons.chat, + context.jz.aiBackground, + AppTheme.ai, + PublicConfigApi.companionName + + '记账占比 ' + + report.aiRatio.toStringAsFixed(0) + + '%', + report.aiRatio > 50 ? '大部分账单都通过 AI 完成' : '可以试试用一句话完成记账', + ), + ], + ), + ), + if (report.categoryRanking.isNotEmpty) ...[ + SizedBox(height: 10), + _categoryRanking(report.categoryRanking), + ], + SizedBox(height: 10), + if (SessionStore.instance.aiEnabled) + Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: AppTheme.ai.withValues(alpha: 0.12)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppIcons.icon( + AppIcons.avatarAsset( + PublicConfigApi.companionAvatarKey, + ), + size: 15, + color: AppTheme.ai, + ), + SizedBox(width: 7), + Text( + PublicConfigApi.companionName + '点评', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w700, + color: AppTheme.ai, + ), + ), + ], + ), + SizedBox(height: 8), + Text( + '“' + report.commentary + '”', + style: TextStyle( + fontSize: 12.5, + height: 1.75, + color: context.jz.text2, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget _categoryRanking(List ranking) { + return Card( + child: Padding( + padding: const EdgeInsets.fromLTRB(14, 14, 14, 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '支出分类排行', + style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w800), + ), + SizedBox(height: 12), + ...ranking.indexed.map((entry) { + final index = entry.$1; + final item = entry.$2; + return Padding( + padding: const EdgeInsets.only(bottom: 11), + child: Row( + children: [ + SizedBox( + width: 22, + child: Text( + (index + 1).toString().padLeft(2, '0'), + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w800, + color: index == 0 + ? AppTheme.primary + : context.jz.text3, + ), + ), + ), + CategoryIconBox( + iconKey: item.iconKey, + colorKey: item.colorKey, + size: 32, + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Text( + item.name, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w700, + ), + ), + ), + Text( + '¥' + item.amount.toStringAsFixed(0), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(width: 7), + SizedBox( + width: 38, + child: Text( + item.percent.toStringAsFixed(0) + '%', + textAlign: TextAlign.right, + style: TextStyle( + fontSize: 10.5, + color: context.jz.text3, + ), + ), + ), + ], + ), + SizedBox(height: 6), + ClipRRect( + borderRadius: BorderRadius.circular(3), + child: LinearProgressIndicator( + minHeight: 5, + value: (item.percent / 100).clamp(0.0, 1.0), + backgroundColor: context.jz.line, + color: index == 0 + ? AppTheme.primary + : AppTheme.primaryLight, + ), + ), + ], + ), + ), + ], + ), + ); + }), + ], + ), + ), + ); + } + + String get _kindLabel => switch (_kind) { + _ReportKind.weekly => '周', + _ReportKind.monthly => '月', + _ReportKind.yearly => '年', + }; + + Widget _num(String label, double value) { + return Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: TextStyle( + fontSize: 10, + color: Colors.white.withValues(alpha: 0.8), + ), + ), + SizedBox(height: 3), + Text( + '¥' + value.toStringAsFixed(0), + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ), + ], + ), + ); + } + + Widget _highlight( + String iconAsset, + Color background, + Color foreground, + String title, + String description, + ) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + color: background, + borderRadius: BorderRadius.circular(9), + ), + child: Center( + child: AppIcons.icon(iconAsset, size: 16, color: foreground), + ), + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w600), + ), + SizedBox(height: 3), + Text( + description, + style: TextStyle( + fontSize: 11, + color: context.jz.text2, + height: 1.55, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/frontend/lib/features/stats/stats_page.dart b/frontend/lib/features/stats/stats_page.dart new file mode 100644 index 0000000..5480af5 --- /dev/null +++ b/frontend/lib/features/stats/stats_page.dart @@ -0,0 +1,605 @@ +import 'dart:math' as math; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/async_error_view.dart'; +import 'package:miaoji_zhang/shared/widgets/category_icon.dart'; + +class StatsPage extends StatefulWidget { + const StatsPage({super.key}); + + @override + State createState() => _StatsPageState(); +} + +class _StatsPageState extends State { + String _period = 'month'; + DateTime _anchor = ShanghaiTime.now; + PeriodStats? _stats; + String? _error; + bool _loading = true; + + @override + void initState() { + super.initState(); + CurrentLedgerStore.instance.addListener(_load); + _load(); + } + + @override + void dispose() { + CurrentLedgerStore.instance.removeListener(_load); + super.dispose(); + } + + Future _load() async { + if (mounted) { + setState(() { + _loading = true; + _error = null; + }); + } + try { + final stats = await TxApi.periodStats(_period, _anchor); + if (mounted) setState(() => _stats = stats); + } catch (error) { + if (mounted) setState(() => _error = apiErrorMessage(error)); + } finally { + if (mounted) setState(() => _loading = false); + } + } + + void _selectPeriod(String value) { + if (_period == value) return; + setState(() { + _period = value; + _anchor = ShanghaiTime.now; + _stats = null; + }); + _load(); + } + + void _shift(int direction) { + final next = switch (_period) { + 'week' => _anchor.add(Duration(days: 7 * direction)), + 'year' => DateTime(_anchor.year + direction, 1, 1), + _ => DateTime(_anchor.year, _anchor.month + direction, 1), + }; + if (direction > 0 && _isAfterCurrentPeriod(next)) return; + setState(() { + _anchor = next; + _stats = null; + }); + _load(); + } + + bool _isAfterCurrentPeriod(DateTime value) { + final now = ShanghaiTime.now; + return switch (_period) { + 'week' => value.isAfter(now), + 'year' => value.year > now.year, + _ => + value.year > now.year || + (value.year == now.year && value.month > now.month), + }; + } + + @override + Widget build(BuildContext context) { + final stats = _stats; + return Scaffold( + appBar: AppBar(title: Text('统计')), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(16, 4, 16, 8), + child: JzSegmentedControl( + value: _period, + options: const [ + JzOption(value: 'week', label: '周'), + JzOption(value: 'month', label: '月'), + JzOption(value: 'year', label: '年'), + ], + onChanged: _loading ? null : _selectPeriod, + ), + ), + Expanded( + child: _loading && stats == null + ? Center( + child: CircularProgressIndicator( + color: AppTheme.primary, + strokeWidth: 2, + ), + ) + : stats == null && _error != null + ? AsyncErrorView(message: _error!, onRetry: _load) + : RefreshIndicator( + onRefresh: _load, + child: ListView( + physics: const AlwaysScrollableScrollPhysics(), + padding: const EdgeInsets.fromLTRB(16, 0, 16, 24), + children: [ + _periodNavigator(stats?.periodLabel ?? ''), + if (_loading) + LinearProgressIndicator( + minHeight: 2, + color: AppTheme.primary, + backgroundColor: context.jz.primaryBackground, + ), + if (_error != null) _refreshNotice(_error!), + if (stats != null) ...[ + SizedBox(height: 10), + _summaryCard(stats), + SizedBox(height: 10), + if (stats.totalExpense == 0 && stats.totalIncome == 0) + _emptyCard() + else ...[ + _categoryCard(stats), + SizedBox(height: 10), + if (stats.analysis case final analysis?) + _analysisCard(analysis), + SizedBox(height: 10), + _trendCard(stats), + if (stats.byCategory.isNotEmpty) ...[ + SizedBox(height: 10), + _rankingCard(stats), + ], + ], + ], + ], + ), + ), + ), + ], + ), + ); + } + + Widget _periodNavigator(String label) { + final nextAnchor = switch (_period) { + 'week' => _anchor.add(const Duration(days: 7)), + 'year' => DateTime(_anchor.year + 1, 1, 1), + _ => DateTime(_anchor.year, _anchor.month + 1, 1), + }; + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + tooltip: '上一个周期', + onPressed: _loading ? null : () => _shift(-1), + icon: Icon(Icons.chevron_left_rounded), + ), + SizedBox( + width: 170, + child: Text( + label, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w700), + ), + ), + IconButton( + tooltip: '下一个周期', + onPressed: _loading || _isAfterCurrentPeriod(nextAnchor) + ? null + : () => _shift(1), + icon: Icon(Icons.chevron_right_rounded), + ), + ], + ); + } + + Widget _summaryCard(PeriodStats stats) { + return Card( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 17), + child: Row( + children: [ + _summaryValue('支出', stats.totalExpense, AppTheme.red), + _divider(), + _summaryValue('收入', stats.totalIncome, AppTheme.primaryDeep), + _divider(), + _summaryValue( + '结余', + stats.balance, + stats.balance < 0 ? AppTheme.red : context.jz.text, + ), + ], + ), + ), + ); + } + + Widget _summaryValue(String label, double amount, Color color) { + return Expanded( + child: Column( + children: [ + Text( + label, + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + SizedBox(height: 5), + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '¥${amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w800, + color: color, + ), + ), + ), + ], + ), + ); + } + + Widget _divider() => Container(width: 1, height: 34, color: context.jz.line); + + Widget _emptyCard() { + return Card( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 48), + child: Center( + child: Text( + '这个周期还没有账单记录', + style: TextStyle(fontSize: 13, color: context.jz.text3), + ), + ), + ), + ); + } + + Widget _categoryCard(PeriodStats stats) { + return Card( + child: Padding( + padding: const EdgeInsets.fromLTRB(16, 18, 16, 16), + child: Column( + children: [ + SizedBox( + height: 178, + child: _CategoryDonut( + categories: stats.byCategory, + total: stats.totalExpense, + ), + ), + SizedBox(height: 12), + Wrap( + spacing: 12, + runSpacing: 8, + children: stats.byCategory.take(8).map((category) { + final color = categoryColorMeta(category.colorKey).foreground; + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 9, + height: 9, + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(3), + ), + ), + SizedBox(width: 5), + Text( + '${category.name} ${category.percent.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 10.5, color: context.jz.text2), + ), + ], + ); + }).toList(), + ), + ], + ), + ), + ); + } + + Widget _analysisCard(String text) { + return Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: AppTheme.ai.withValues(alpha: 0.12)), + ), + child: Row( + children: [ + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(10), + ), + child: Icon( + Icons.auto_awesome_rounded, + size: 16, + color: AppTheme.ai, + ), + ), + SizedBox(width: 10), + Expanded( + child: Text( + text, + style: TextStyle( + fontSize: 12, + color: context.jz.text2, + height: 1.5, + ), + ), + ), + ], + ), + ); + } + + Widget _trendCard(PeriodStats stats) { + final title = switch (_period) { + 'week' => '每日支出趋势', + 'year' => '每月支出趋势', + _ => '每日支出趋势', + }; + return Card( + child: Padding( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(fontSize: 13, fontWeight: FontWeight.w700), + ), + SizedBox(height: 16), + SizedBox( + height: 116, + child: _TrendBars(points: stats.trend, period: _period), + ), + ], + ), + ), + ); + } + + Widget _rankingCard(PeriodStats stats) { + final maxAmount = stats.byCategory.first.amount; + return Card( + child: Padding( + padding: const EdgeInsets.fromLTRB(14, 8, 14, 8), + child: Column( + children: stats.byCategory.take(8).map((category) { + final color = categoryColorMeta(category.colorKey).foreground; + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Row( + children: [ + CategoryIconBox( + iconKey: category.iconKey, + colorKey: category.colorKey, + size: 34, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + category.name, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w600, + ), + ), + Spacer(), + Text( + '¥${category.amount.toStringAsFixed(2)}', + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + SizedBox(height: 6), + ClipRRect( + borderRadius: BorderRadius.circular(3), + child: LinearProgressIndicator( + value: maxAmount == 0 + ? 0 + : category.amount / maxAmount, + minHeight: 4, + backgroundColor: context.jz.background, + color: color, + ), + ), + ], + ), + ), + ], + ), + ); + }).toList(), + ), + ), + ); + } + + Widget _refreshNotice(String message) { + return Container( + margin: const EdgeInsets.only(top: 8), + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 9), + decoration: BoxDecoration( + color: context.jz.warningBackground, + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + Icon(Icons.info_outline_rounded, size: 16, color: AppTheme.orange), + SizedBox(width: 8), + Expanded( + child: Text( + message, + style: TextStyle(fontSize: 11, color: context.jz.text2), + ), + ), + TextButton(onPressed: _load, child: Text('重试')), + ], + ), + ); + } +} + +class _CategoryDonut extends StatelessWidget { + final List categories; + final double total; + + const _CategoryDonut({required this.categories, required this.total}); + + @override + Widget build(BuildContext context) { + return CustomPaint( + painter: _DonutPainter(categories.take(8).toList(), context.jz.line), + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '周期支出', + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + SizedBox(height: 3), + Text( + '¥${total.toStringAsFixed(0)}', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w800), + ), + ], + ), + ), + ); + } +} + +class _DonutPainter extends CustomPainter { + final List categories; + final Color lineColor; + + _DonutPainter(this.categories, this.lineColor); + + @override + void paint(Canvas canvas, Size size) { + final center = Offset(size.width / 2, size.height / 2); + final radius = math.min(size.width, size.height) / 2 - 12; + const strokeWidth = 22.0; + final rect = Rect.fromCircle(center: center, radius: radius); + canvas.drawCircle( + center, + radius, + Paint() + ..color = lineColor + ..style = PaintingStyle.stroke + ..strokeWidth = strokeWidth, + ); + final total = categories.fold(0, (sum, item) => sum + item.amount); + if (total == 0) return; + var start = -math.pi / 2; + for (final category in categories) { + final sweep = category.amount / total * math.pi * 2; + final gap = math.min(0.025, sweep / 4); + canvas.drawArc( + rect, + start + gap, + math.max(0, sweep - gap * 2), + false, + Paint() + ..color = categoryColorMeta(category.colorKey).foreground + ..style = PaintingStyle.stroke + ..strokeWidth = strokeWidth + ..strokeCap = StrokeCap.round, + ); + start += sweep; + } + } + + @override + bool shouldRepaint(covariant _DonutPainter oldDelegate) => true; +} + +class _TrendBars extends StatelessWidget { + final List points; + final String period; + + const _TrendBars({required this.points, required this.period}); + + @override + Widget build(BuildContext context) { + final maxValue = points.fold( + 0, + (maximum, point) => math.max(maximum, point.expense), + ); + return Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: points.indexed.map((entry) { + final index = entry.$1; + final point = entry.$2; + final height = maxValue == 0 + ? 2.0 + : math.max(2.0, point.expense / maxValue * 78).toDouble(); + final showLabel = + period != 'month' || + index == 0 || + index == points.length - 1 || + (index + 1) % 5 == 0; + return Expanded( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: period == 'month' ? 1 : 3, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Tooltip( + message: + '${point.label} ¥${point.expense.toStringAsFixed(2)}', + child: Container( + height: height, + decoration: BoxDecoration( + color: point.expense == maxValue && maxValue > 0 + ? AppTheme.primary + : context.jz.primaryBackground, + borderRadius: const BorderRadius.vertical( + top: Radius.circular(4), + ), + ), + ), + ), + SizedBox(height: 6), + SizedBox( + height: 14, + child: showLabel + ? FittedBox( + fit: BoxFit.scaleDown, + child: Text( + point.label, + style: TextStyle( + fontSize: 9, + color: context.jz.text3, + ), + ), + ) + : null, + ), + ], + ), + ), + ); + }).toList(), + ); + } +} diff --git a/frontend/lib/main.dart b/frontend/lib/main.dart new file mode 100644 index 0000000..2edd743 --- /dev/null +++ b/frontend/lib/main.dart @@ -0,0 +1,23 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/app/app.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/theme/theme_store.dart'; +import 'package:miaoji_zhang/shared/update/update_coordinator.dart'; +import 'package:miaoji_zhang/shared/version.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Future.wait([ + SessionStore.instance.initialize(), + ThemeStore.instance.initialize(), + AppVersion.initialize(), + ]); + runApp(const MiaoJiApp()); + unawaited( + UpdateCoordinator.instance.initialize().catchError((_) { + // Update cache cleanup is optional and must never prevent app startup. + }), + ); +} diff --git a/frontend/lib/shared/api/api_client.dart b/frontend/lib/shared/api/api_client.dart new file mode 100644 index 0000000..d489605 --- /dev/null +++ b/frontend/lib/shared/api/api_client.dart @@ -0,0 +1,131 @@ +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:dio/io.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +class ApiClient { + ApiClient._(); + static final ApiClient instance = ApiClient._(); + + static const _storage = FlutterSecureStorage(); + static const _tokenKey = 'auth_token'; + static final sessionExpired = ValueNotifier(0); + static bool _handlingUnauthorized = false; + static const _internalBuild = bool.fromEnvironment('INTERNAL_BUILD'); + static const _internalTestBaseUrl = 'https://lt.frp-say.com:38012'; + static const _configuredBaseUrl = String.fromEnvironment('API_BASE_URL'); + static const _temporaryFrpHost = 'lt.frp-say.com'; + static const _temporaryFrpPort = 38012; + static const _temporaryFrpCertificateSha1 = + '509C3210161E72FB9DA5183D3D2152F63871C31F'; + + static const String baseUrl = _configuredBaseUrl != '' + ? _configuredBaseUrl + : _internalBuild + ? _internalTestBaseUrl + : 'https://api.invalid'; + + static bool get isInternalBuild => _internalBuild; + + late final Dio dio = _createDio(); + + Dio _createDio() { + final client = + Dio( + BaseOptions( + baseUrl: baseUrl, + connectTimeout: const Duration(seconds: 10), + receiveTimeout: const Duration(seconds: 120), + ), + ) + ..interceptors.add( + InterceptorsWrapper( + onRequest: (options, handler) async { + final token = await _storage.read(key: _tokenKey); + if (token != null) { + options.headers['Authorization'] = 'Bearer $token'; + } + handler.next(options); + }, + onError: (error, handler) async { + final unauthorized = error.response?.statusCode == 401; + final data = error.response?.data; + final aiDenied = + error.response?.statusCode == 403 && + data is Map && + data['code'] == 'AI_PERMISSION_DENIED'; + if (aiDenied) { + await SessionStore.instance.setAiEnabled(false); + } + final isAuthRequest = error.requestOptions.path.startsWith( + '/api/auth/', + ); + if (unauthorized && !isAuthRequest && !_handlingUnauthorized) { + _handlingUnauthorized = true; + await SessionStore.instance.markNeedsReauth(); + sessionExpired.value++; + Future.delayed( + const Duration(seconds: 1), + () => _handlingUnauthorized = false, + ); + } + handler.next(error); + }, + ), + ); + + final apiUri = Uri.tryParse(baseUrl); + if (_internalBuild && + apiUri?.scheme == 'https' && + apiUri?.host == _temporaryFrpHost && + apiUri?.port == _temporaryFrpPort) { + client.httpClientAdapter = IOHttpClientAdapter( + createHttpClient: () { + final httpClient = HttpClient(); + httpClient.badCertificateCallback = (certificate, host, port) { + final certificateSha1 = certificate.sha1 + .map((byte) => byte.toRadixString(16).padLeft(2, '0')) + .join() + .toUpperCase(); + return host == _temporaryFrpHost && + port == _temporaryFrpPort && + certificateSha1 == _temporaryFrpCertificateSha1; + }; + return httpClient; + }, + ); + } + + return client; + } + + Future saveToken(String token) => + _storage.write(key: _tokenKey, value: token); + Future readToken() => _storage.read(key: _tokenKey); + Future clearToken() => _storage.delete(key: _tokenKey); +} + +bool isConnectivityError(Object error) => + error is DioException && + (error.type == DioExceptionType.connectionTimeout || + error.type == DioExceptionType.connectionError || + error.type == DioExceptionType.receiveTimeout || + error.type == DioExceptionType.sendTimeout); +String apiErrorMessage(Object e) { + if (e is OnlineFeatureRequiredException) return e.message; + if (e is StateError) return e.message; + if (e is DioException) { + final data = e.response?.data; + if (data is Map && data['message'] != null) + return data['message'] as String; + if (e.type == DioExceptionType.connectionTimeout || + e.type == DioExceptionType.connectionError || + e.type == DioExceptionType.receiveTimeout) { + return '无法连接服务器,请检查网络'; + } + } + return '出错了,请稍后再试'; +} diff --git a/frontend/lib/shared/api/auth_api.dart b/frontend/lib/shared/api/auth_api.dart new file mode 100644 index 0000000..9a76899 --- /dev/null +++ b/frontend/lib/shared/api/auth_api.dart @@ -0,0 +1,265 @@ +import 'package:dio/dio.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/local_export_service.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +class AiCompanion { + final String avatarKey; + final String personaKey; + final String? customName; + final int roastLevel, stickerFrequency, proactiveLevel; + + AiCompanion.fromJson(Map json) + : avatarKey = json['avatarKey'] as String, + personaKey = json['personaKey'] as String, + customName = json['customName'] as String?, + roastLevel = json['roastLevel'] as int, + stickerFrequency = json['stickerFrequency'] as int, + proactiveLevel = json['proactiveLevel'] as int; +} + +class UserProfile { + final int userId; + final String username; + final String? nickname; + final String appMode; + final AiCompanion? aiCompanion; + final bool onboardingDone; + final bool aiEnabled; + + UserProfile.fromJson(Map json) + : userId = (json['userId'] as num).toInt(), + username = json['username'] as String, + nickname = json['nickname'] as String?, + appMode = json['appMode'] as String, + aiCompanion = json['aiCompanion'] == null + ? null + : AiCompanion.fromJson(json['aiCompanion'] as Map), + onboardingDone = json['onboardingDone'] as bool, + aiEnabled = + ((json['permissions'] as Map?)?['ai'] as bool?) ?? + true; + + const UserProfile.local({ + required this.userId, + required this.username, + required this.nickname, + required this.appMode, + required this.onboardingDone, + this.aiEnabled = false, + }) : aiCompanion = null; +} + +class AuthApi { + static final _dio = ApiClient.instance.dio; + + static Future register( + String username, + String password, { + required bool agreedToTerms, + }) async { + final response = await _dio.post( + '/api/auth/register', + data: { + 'username': username, + 'password': password, + 'agreedToTerms': agreedToTerms, + }, + ); + await ApiClient.instance.saveToken(response.data['token'] as String); + await me(); + } + + static Future login(String username, String password) async { + final response = await _dio.post( + '/api/auth/login', + data: {'username': username, 'password': password}, + ); + await ApiClient.instance.saveToken(response.data['token'] as String); + return response.data['accountClosureCancelled'] as bool? ?? false; + } + + static Future me() async { + final session = SessionStore.instance; + if (session.isGuest || (session.isAccount && session.shouldUseLocalOnly)) { + return _localProfile(); + } + try { + final response = await _dio.get('/api/users/me'); + final profile = UserProfile.fromJson( + response.data as Map, + ); + await _cacheProfile(profile); + return profile; + } catch (error) { + if (session.isAccount && + (isConnectivityError(error) || session.needsReauth)) { + return _localProfile(); + } + rethrow; + } + } + + static Future completeOnboarding({ + required String appMode, + required String avatarKey, + required String personaKey, + String? customName, + }) async { + SessionStore.instance.requireOnline('完成账号初始化需要连接网络'); + final response = await _dio.post( + '/api/users/me/onboarding', + data: { + 'appMode': appMode, + 'avatarKey': avatarKey, + 'personaKey': personaKey, + 'customName': customName, + }, + ); + final profile = UserProfile.fromJson(response.data as Map); + await _cacheProfile(profile); + return profile; + } + + static Future switchMode(String appMode) async { + SessionStore.instance.requireOnline('切换 AI 模式需要登录并连接网络'); + final response = await _dio.put( + '/api/users/me/mode', + data: {'appMode': appMode}, + ); + final profile = UserProfile.fromJson(response.data as Map); + await _cacheProfile(profile); + return profile; + } + + static Future updateCompanion({ + String? avatarKey, + String? personaKey, + String? customName, + int? roastLevel, + int? stickerFrequency, + int? proactiveLevel, + }) async { + SessionStore.instance.requireOnline('AI 伙伴设置需要登录并连接网络'); + final response = await _dio.put( + '/api/users/me/companion', + data: { + 'avatarKey': avatarKey, + 'personaKey': personaKey, + 'customName': customName, + 'roastLevel': roastLevel, + 'stickerFrequency': stickerFrequency, + 'proactiveLevel': proactiveLevel, + }, + ); + final profile = UserProfile.fromJson(response.data as Map); + await _cacheProfile(profile); + return profile; + } + + static Future updateProfile(String nickname) async { + final session = SessionStore.instance; + final normalized = nickname.trim(); + if (session.isGuest) { + await session.updateNickname(normalized); + return _localProfile(); + } + session.requireOnline('修改云端资料需要连接网络'); + final previous = session.nickname; + await session.updateNickname(normalized); + try { + final response = await _dio.put( + '/api/users/me/profile', + data: {'nickname': normalized}, + ); + final profile = UserProfile.fromJson( + response.data as Map, + ); + await _cacheProfile(profile); + return profile; + } catch (_) { + await session.updateNickname(previous); + rethrow; + } + } + + static Future changePassword( + String currentPassword, + String newPassword, + ) async { + SessionStore.instance.requireOnline('修改密码需要连接网络'); + final response = await _dio.put( + '/api/users/me/password', + data: {'currentPassword': currentPassword, 'newPassword': newPassword}, + ); + await ApiClient.instance.saveToken(response.data['token'] as String); + } + + static Future> exportData() async { + if (SessionStore.instance.shouldUseLocalOnly) { + return LocalExportService.buildZip(); + } + try { + final response = await _dio.get>( + '/api/users/me/export', + options: Options(responseType: ResponseType.bytes), + ); + return response.data ?? const []; + } catch (error) { + if (isConnectivityError(error)) return LocalExportService.buildZip(); + rethrow; + } + } + + static Future requestAccountClosure( + String password, + String confirmationText, + ) async { + SessionStore.instance.requireOnline('注销账号需要连接网络'); + final response = await _dio.post( + '/api/users/me/closure', + data: {'password': password, 'confirmationText': confirmationText}, + ); + final scheduledAt = ShanghaiTime.parseCivil( + response.data['scheduledAt'] as String, + ); + await logout(); + return scheduledAt; + } + + static Future deleteAccount(String password) async { + SessionStore.instance.requireOnline('注销账号需要连接网络'); + await _dio.delete('/api/users/me', data: {'password': password}); + await logout(); + } + + static Future logout() async { + CurrentLedgerStore.instance.clear(); + await ApiClient.instance.clearToken(); + await SessionStore.instance.clearActiveSession(); + } + + static UserProfile _localProfile() { + final session = SessionStore.instance; + return UserProfile.local( + userId: session.userId ?? 0, + username: session.username ?? '游客', + nickname: session.nickname, + appMode: session.isGuest ? 'normal' : session.appMode, + onboardingDone: session.isGuest || session.onboardingDone, + aiEnabled: session.aiEnabled, + ); + } + + static Future _cacheProfile(UserProfile profile) => + SessionStore.instance.activateAccount( + userId: profile.userId, + username: profile.username, + nickname: profile.nickname, + appMode: profile.appMode, + onboardingDone: profile.onboardingDone, + aiEnabled: profile.aiEnabled, + ); +} diff --git a/frontend/lib/shared/api/business_api.dart b/frontend/lib/shared/api/business_api.dart new file mode 100644 index 0000000..d031d5b --- /dev/null +++ b/frontend/lib/shared/api/business_api.dart @@ -0,0 +1,1519 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/sse_frame_accumulator.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class TxItem { + final int id, ledgerId, categoryId; + final String categoryName, categoryIcon, categoryColor, type, source; + final double amount; + final String? note, paymentMethod, sourceText; + final DateTime occurredAt, updatedAt; + final bool isDeleted; + + TxItem.fromJson(Map j) + : id = (j['id'] as num).toInt(), + ledgerId = (j['ledgerId'] as num).toInt(), + categoryId = (j['categoryId'] as num).toInt(), + categoryName = j['categoryName'] as String, + categoryIcon = j['categoryIcon'] as String, + categoryColor = j['categoryColor'] as String? ?? 'mint', + type = j['type'] as String, + amount = (j['amount'] as num).toDouble(), + note = j['note'] as String?, + paymentMethod = j['paymentMethod'] as String?, + source = j['source'] as String, + sourceText = j['sourceText'] as String?, + occurredAt = ShanghaiTime.parseCivil(j['occurredAt'] as String), + updatedAt = DateTime.parse( + j['updatedAt'] as String? ?? j['occurredAt'] as String, + ).toUtc(), + isDeleted = j['isDeleted'] as bool? ?? false; + + bool get isAi => const { + 'ai_chat', + 'voice', + 'ocr', + 'screenshot', + 'recognition_ai', + }.contains(source); + bool get isRecognition => + source == 'accessibility' || + source == 'notification' || + source == 'local_ocr'; + bool get isIncome => type == 'income'; + + String get sourceLabel => switch (source) { + 'ai_chat' => 'AI 聊天', + 'voice' => 'AI 语音解析', + 'ocr' => 'AI 图片识别', + 'screenshot' => 'AI 截屏识别', + 'recognition_ai' => '智能识别 · AI 补全', + 'accessibility' => '智能识别 · 页面事件', + 'notification' => '智能识别 · 通知', + 'local_ocr' => '智能识别 · 本地视觉', + _ => '手动记账', + }; +} + +class DayGroup { + final DateTime date; + final double expense, income; + final List items; + + DayGroup.fromJson(Map j) + : date = DateTime.parse(j['date'] as String), + expense = (j['expense'] as num).toDouble(), + income = (j['income'] as num).toDouble(), + items = (j['items'] as List) + .map((e) => TxItem.fromJson(e as Map)) + .toList(); +} + +class MonthSummary { + final int year, month, count; + final double income, expense, balance; + final List days; + + MonthSummary.fromJson(Map j) + : year = j['year'] as int, + month = j['month'] as int, + count = j['count'] as int, + income = (j['income'] as num).toDouble(), + expense = (j['expense'] as num).toDouble(), + balance = (j['balance'] as num).toDouble(), + days = (j['days'] as List) + .map((e) => DayGroup.fromJson(e as Map)) + .toList(); +} + +class CategoryItem { + final int id, sortOrder; + final String name, iconKey, colorKey, type; + final bool isCustom; + + CategoryItem.fromJson(Map j) + : id = (j['id'] as num).toInt(), + name = j['name'] as String, + iconKey = j['iconKey'] as String, + colorKey = j['colorKey'] as String? ?? 'mint', + type = j['type'] as String, + sortOrder = j['sortOrder'] as int, + isCustom = j['isCustom'] as bool; +} + +class CategoryStat { + final int categoryId; + final String name, iconKey, colorKey; + final double amount, percent; + + CategoryStat.fromJson(Map j) + : categoryId = (j['categoryId'] as num).toInt(), + name = j['name'] as String, + iconKey = j['iconKey'] as String, + colorKey = j['colorKey'] as String? ?? 'mint', + amount = (j['amount'] as num).toDouble(), + percent = (j['percent'] as num).toDouble(); +} + +class MonthStats { + final int year, month; + final double totalExpense, totalIncome; + final List byCategory; + final List dailyExpenses; + final String? aiAnalysis; + + MonthStats.fromJson(Map j) + : year = j['year'] as int, + month = j['month'] as int, + totalExpense = (j['totalExpense'] as num).toDouble(), + totalIncome = (j['totalIncome'] as num).toDouble(), + byCategory = (j['byCategory'] as List) + .map((e) => CategoryStat.fromJson(e as Map)) + .toList(), + dailyExpenses = (j['dailyExpenses'] as List) + .map((e) => (e as num).toDouble()) + .toList(), + aiAnalysis = j['aiAnalysis'] as String?; +} + +class PeriodTrendPoint { + final String label; + final DateTime date; + final double expense, income; + + PeriodTrendPoint.fromJson(Map json) + : label = json['label'] as String, + date = DateTime.parse(json['date'] as String), + expense = (json['expense'] as num).toDouble(), + income = (json['income'] as num).toDouble(); +} + +class PeriodStats { + final String periodType, periodLabel; + final DateTime startDate, endDate; + final double totalExpense, totalIncome, balance; + final int count; + final List byCategory; + final List trend; + final String? analysis; + + PeriodStats.fromJson(Map json) + : periodType = json['periodType'] as String, + periodLabel = json['periodLabel'] as String, + startDate = DateTime.parse(json['startDate'] as String), + endDate = DateTime.parse(json['endDate'] as String), + totalExpense = (json['totalExpense'] as num).toDouble(), + totalIncome = (json['totalIncome'] as num).toDouble(), + balance = (json['balance'] as num).toDouble(), + count = (json['count'] as num).toInt(), + byCategory = (json['byCategory'] as List) + .map((item) => CategoryStat.fromJson(item as Map)) + .toList(), + trend = (json['trend'] as List) + .map( + (item) => PeriodTrendPoint.fromJson(item as Map), + ) + .toList(), + analysis = json['analysis'] as String?; +} + +class TxApi { + static final _dio = ApiClient.instance.dio; + + static int get _ledgerId => CurrentLedgerStore.instance.currentId ?? 1; + static bool get _queueOfflineChanges => + SessionStore.instance.isAccount && SessionStore.instance.cloudSyncEnabled; + + static Future month(int year, int month) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + return MonthSummary.fromJson( + LocalDatabase.instance.monthSummary(year, month, _ledgerId), + ); + } + try { + final response = await _dio.get( + '/api/transactions/month', + queryParameters: {'year': year, 'month': month, 'ledgerId': _ledgerId}, + ); + final json = response.data as Map; + LocalDatabase.instance.cacheMonthSummary(json); + return MonthSummary.fromJson(json); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + return MonthSummary.fromJson( + LocalDatabase.instance.monthSummary(year, month, _ledgerId), + ); + } + } + + static Future stats(int year, int month) async { + final session = SessionStore.instance; + if (!session.shouldUseLocalOnly) { + try { + final response = await _dio.get( + '/api/transactions/stats', + queryParameters: { + 'year': year, + 'month': month, + 'ledgerId': _ledgerId, + }, + ); + return MonthStats.fromJson(response.data as Map); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + } + } + final local = LocalDatabase.instance.periodStats( + 'month', + DateTime(year, month, 1), + _ledgerId, + ); + return MonthStats.fromJson({ + 'year': year, + 'month': month, + 'totalExpense': local['totalExpense'], + 'totalIncome': local['totalIncome'], + 'byCategory': local['byCategory'], + 'dailyExpenses': (local['trend'] as List) + .map((item) => (item as Map)['expense']) + .toList(), + 'aiAnalysis': local['analysis'], + }); + } + + static Future periodStats(String period, DateTime anchor) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + return PeriodStats.fromJson( + LocalDatabase.instance.periodStats(period, anchor, _ledgerId), + ); + } + try { + final response = await _dio.get( + '/api/transactions/stats/period', + queryParameters: { + 'period': period, + 'anchor': + '${anchor.year.toString().padLeft(4, '0')}-' + '${anchor.month.toString().padLeft(2, '0')}-' + '${anchor.day.toString().padLeft(2, '0')}', + 'ledgerId': _ledgerId, + }, + ); + return PeriodStats.fromJson(response.data as Map); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + return PeriodStats.fromJson( + LocalDatabase.instance.periodStats(period, anchor, _ledgerId), + ); + } + } + + static Future> categories(String type) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + return LocalDatabase.instance + .categories(type) + .map(CategoryItem.fromJson) + .toList(); + } + try { + final response = await _dio.get( + '/api/categories', + queryParameters: {'type': type}, + ); + final values = response.data as List; + LocalDatabase.instance.cacheCategories(values, replaceType: type); + return values + .map((item) => CategoryItem.fromJson(item as Map)) + .toList(); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + return LocalDatabase.instance + .categories(type) + .map(CategoryItem.fromJson) + .toList(); + } + } + + static Future create({ + required int categoryId, + required String type, + required double amount, + String? note, + String? paymentMethod, + String? source, + String? sourceText, + DateTime? occurredAt, + String? clientRequestId, + }) async { + final payload = { + 'ledgerId': _ledgerId, + 'categoryId': categoryId, + 'type': type, + 'amount': amount, + 'note': note, + 'paymentMethod': paymentMethod, + 'source': source, + 'sourceText': sourceText, + 'occurredAt': ShanghaiTime.civilToUtc( + occurredAt ?? ShanghaiTime.now, + ).toIso8601String(), + if (clientRequestId != null) 'clientRequestId': clientRequestId, + }; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || categoryId < 0 || _ledgerId < 0) { + final local = LocalDatabase.instance.createTransaction(payload); + if (_queueOfflineChanges) { + LocalDatabase.instance.enqueueSync( + 'transaction', + local['id'] as int, + 'create', + payload, + ); + } + return TxItem.fromJson(local); + } + try { + final response = await _dio.post('/api/transactions', data: payload); + final json = response.data as Map; + LocalDatabase.instance.cacheTransaction(json); + return TxItem.fromJson(json); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + final local = LocalDatabase.instance.createTransaction(payload); + LocalDatabase.instance.enqueueSync( + 'transaction', + local['id'] as int, + 'create', + payload, + ); + return TxItem.fromJson(local); + } + } + + static Future delete(int id) async { + final baseUpdatedAt = LocalDatabase.instance.transaction( + id, + includeDeleted: true, + )?['updatedAt']; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + LocalDatabase.instance.softDeleteTransaction(id); + if (_queueOfflineChanges) { + LocalDatabase.instance.enqueueSync('transaction', id, 'delete', { + 'id': id, + 'baseUpdatedAt': baseUpdatedAt, + }); + } + return; + } + try { + await _dio.delete('/api/transactions/$id'); + LocalDatabase.instance.softDeleteTransaction(id); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + LocalDatabase.instance.softDeleteTransaction(id); + LocalDatabase.instance.enqueueSync('transaction', id, 'delete', { + 'id': id, + }); + } + } + + static Future update( + int id, { + required int ledgerId, + required int categoryId, + required String type, + required double amount, + required DateTime occurredAt, + String? note, + String? paymentMethod, + }) async { + final baseUpdatedAt = LocalDatabase.instance.transaction( + id, + includeDeleted: true, + )?['updatedAt']; + final payload = { + 'ledgerId': ledgerId, + 'categoryId': categoryId, + 'type': type, + 'amount': amount, + 'note': note, + 'paymentMethod': paymentMethod, + 'occurredAt': ShanghaiTime.civilToUtc(occurredAt).toIso8601String(), + if (baseUpdatedAt != null) 'baseUpdatedAt': baseUpdatedAt, + }; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || + id < 0 || + categoryId < 0 || + ledgerId < 0) { + final local = LocalDatabase.instance.updateTransaction(id, payload); + if (_queueOfflineChanges) { + LocalDatabase.instance.enqueueSync( + 'transaction', + id, + 'update', + payload, + ); + } + return TxItem.fromJson(local); + } + try { + final response = await _dio.put('/api/transactions/$id', data: payload); + final json = response.data as Map; + LocalDatabase.instance.cacheTransaction(json); + return TxItem.fromJson(json); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + final local = LocalDatabase.instance.updateTransaction(id, payload); + LocalDatabase.instance.enqueueSync('transaction', id, 'update', payload); + return TxItem.fromJson(local); + } + } + + static Future> recycleBin() async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + return LocalDatabase.instance + .recycleBin(_ledgerId) + .map(TxItem.fromJson) + .toList(); + } + try { + final response = await _dio.get( + '/api/transactions/recycle-bin', + queryParameters: {'ledgerId': _ledgerId}, + ); + final values = response.data as List; + LocalDatabase.instance.cacheTransactions(values); + return values + .map((item) => TxItem.fromJson(item as Map)) + .toList(); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + return LocalDatabase.instance + .recycleBin(_ledgerId) + .map(TxItem.fromJson) + .toList(); + } + } + + static Future restore(int id) async { + final baseUpdatedAt = LocalDatabase.instance.transaction( + id, + includeDeleted: true, + )?['updatedAt']; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + final local = LocalDatabase.instance.restoreTransaction(id); + if (_queueOfflineChanges) { + LocalDatabase.instance.enqueueSync('transaction', id, 'restore', { + 'id': id, + 'baseUpdatedAt': baseUpdatedAt, + }); + } + return TxItem.fromJson(local); + } + try { + final response = await _dio.post('/api/transactions/$id/restore'); + final json = response.data as Map; + LocalDatabase.instance.cacheTransaction(json); + return TxItem.fromJson(json); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + final local = LocalDatabase.instance.restoreTransaction(id); + LocalDatabase.instance.enqueueSync('transaction', id, 'restore', { + 'id': id, + }); + return TxItem.fromJson(local); + } + } + + static Future permanentlyDelete(int id) async { + if (SessionStore.instance.shouldUseLocalOnly || id < 0) { + LocalDatabase.instance.permanentlyDeleteTransaction(id); + return; + } + await _dio.delete('/api/transactions/$id/permanent'); + LocalDatabase.instance.permanentlyDeleteTransaction(id); + } + + static Future clearRecycleBin() async { + if (SessionStore.instance.shouldUseLocalOnly) { + LocalDatabase.instance.clearRecycleBin(_ledgerId); + return; + } + await _dio.delete( + '/api/transactions/recycle-bin', + queryParameters: {'ledgerId': _ledgerId}, + ); + LocalDatabase.instance.clearRecycleBin(_ledgerId); + } +} + +class ChatMsg { + final int id; + final String role, type, content; + final TxItem? transaction; + final DateTime createdAt; + + ChatMsg.fromJson(Map j) + : id = (j['id'] as num).toInt(), + role = j['role'] as String, + type = j['type'] as String, + content = j['content'] as String, + transaction = j['transaction'] == null + ? null + : TxItem.fromJson(j['transaction'] as Map), + createdAt = ShanghaiTime.parseCivil(j['createdAt'] as String); +} + +class ChatApi { + static final _dio = ApiClient.instance.dio; + + static Future> history({int limit = 50}) async { + SessionStore.instance.requireOnline('AI 聊天需要登录并连接网络'); + final res = await _dio.get( + '/api/chat/messages', + queryParameters: {'limit': limit}, + ); + return (res.data as List) + .map((e) => ChatMsg.fromJson(e as Map)) + .toList(); + } + + static Future clearContext() async { + SessionStore.instance.requireOnline('AI 聊天需要登录并连接网络'); + await _dio.post('/api/chat/context/clear'); + } + + static Future> send( + String content, { + String type = 'text', + }) async { + SessionStore.instance.requireOnline('AI 聊天需要登录并连接网络'); + final res = await _dio.post( + '/api/chat/messages', + data: { + 'content': content, + 'type': type, + if (CurrentLedgerStore.instance.currentId case final id?) + 'ledgerId': id, + }, + ); + return (res.data['messages'] as List) + .map((e) => ChatMsg.fromJson(e as Map)) + .toList(); + } + + static Future sendStream( + String content, { + required void Function(String full) onToken, + void Function(List msgs)? onDone, + void Function(String err)? onError, + }) async { + SessionStore.instance.requireOnline('AI 聊天需要登录并连接网络'); + try { + final resp = await _dio.post( + '/api/chat/messages/stream', + data: { + 'content': content, + if (CurrentLedgerStore.instance.currentId case final id?) + 'ledgerId': id, + }, + options: Options( + responseType: ResponseType.stream, + receiveTimeout: const Duration(minutes: 3), + headers: {'Accept': 'text/event-stream'}, + ), + ); + + final stream = (resp.data as ResponseBody).stream.map>( + (bytes) => bytes, + ); + final completer = Completer(); + final frames = SseFrameAccumulator(); + var fullText = ''; + int? messageId; + String? streamError; + List? completedMessages; + + void handleEvent(String event) { + final parsed = _parseSseEvent(event, fullText); + fullText = parsed.$1; + if (parsed.$2) onToken(fullText); + if (parsed.$3 != null) messageId = parsed.$3; + if (parsed.$5 != null) completedMessages = parsed.$5; + if (parsed.$4 != null) { + streamError = parsed.$4; + onError?.call(parsed.$4!); + } + } + + stream + .transform(const Utf8Decoder(allowMalformed: true)) + .listen( + (chunk) { + for (final event in frames.add(chunk)) { + handleEvent(event); + } + }, + onDone: () { + for (final event in frames.close()) { + handleEvent(event); + } + if (!completer.isCompleted) completer.complete(); + }, + onError: (e) { + onError?.call(e.toString()); + if (!completer.isCompleted) completer.completeError(e); + }, + ); + + await completer.future; + + if (completedMessages != null) { + onDone?.call(completedMessages!); + return; + } + + if (fullText.isEmpty) { + if (streamError == null) onError?.call('未收到 AI 回复,请稍后重试'); + return; + } + + final message = ChatMsg.fromJson({ + 'id': messageId ?? -1, + 'role': 'assistant', + 'type': 'text', + 'content': fullText, + 'transaction': null, + 'createdAt': DateTime.now().toUtc().toIso8601String(), + }); + onDone?.call([message]); + } catch (e) { + onError?.call(e.toString()); + } + } + + static (String, bool, int?, String?, List?) _parseSseEvent( + String event, + String currentText, + ) { + final payload = StringBuffer(); + for (final rawLine in event.split('\n')) { + final line = rawLine.trimRight(); + if (line.startsWith('data:')) { + payload.write(line.substring(5).trimLeft()); + } + } + if (payload.isEmpty) return (currentText, false, null, null, null); + + try { + final data = jsonDecode(payload.toString()); + if (data is Map) { + if (data['t'] != null) { + return (currentText + data['t'].toString(), true, null, null, null); + } + if (data['done'] != null) { + var full = currentText; + int? id; + List? messages; + final rawMessages = data['messages']; + if (rawMessages is List) { + messages = rawMessages + .map( + (item) => + ChatMsg.fromJson(Map.from(item as Map)), + ) + .toList(); + for (final message in messages) { + if (message.type == 'text' && message.role == 'assistant') { + full = message.content; + id = message.id; + } + } + } else { + final done = data['done']; + if (done is bool && done) { + if (data['c'] != null) full = data['c'].toString(); + id = (data['id'] as num?)?.toInt(); + } else { + final rawDone = done.toString(); + final splitIndex = rawDone.lastIndexOf('|'); + if (splitIndex > -1) { + full = rawDone.substring(0, splitIndex); + id = int.tryParse(rawDone.substring(splitIndex + 1)); + if (id == null) full = rawDone; + } else { + full = rawDone; + } + } + } + return (full, false, id, null, messages); + } + if (data['error'] != null) { + return (currentText, false, null, data['error'].toString(), null); + } + } + } catch (_) {} + + return (currentText, false, null, null, null); + } +} + +class BudgetItem { + final int? categoryId; + final String? categoryName, categoryIcon, categoryColor; + final double amount, spent; + final bool isRecurring; + + BudgetItem.fromJson(Map j) + : categoryId = (j['categoryId'] as num?)?.toInt(), + categoryName = j['categoryName'] as String?, + categoryIcon = j['categoryIcon'] as String?, + categoryColor = j['categoryColor'] as String? ?? 'mint', + amount = (j['amount'] as num).toDouble(), + spent = (j['spent'] as num).toDouble(), + isRecurring = j['isRecurring'] as bool? ?? false; + + double get ratio => amount == 0 ? 0 : (spent / amount).clamp(0, 1); +} + +class BudgetsData { + final BudgetItem? total; + final List categories; + + BudgetsData.fromJson(Map j) + : total = j['total'] == null + ? null + : BudgetItem.fromJson(j['total'] as Map), + categories = (j['categories'] as List) + .map((e) => BudgetItem.fromJson(e as Map)) + .toList(); +} + +class BudgetRecommendationItem { + final int categoryId; + final String categoryName, categoryIcon, colorKey, confidence; + final double suggestedAmount, currentSpent, historicalAverage; + + BudgetRecommendationItem.fromJson(Map j) + : categoryId = (j['categoryId'] as num).toInt(), + categoryName = j['categoryName'] as String, + categoryIcon = j['categoryIcon'] as String, + colorKey = j['colorKey'] as String? ?? 'mint', + suggestedAmount = (j['suggestedAmount'] as num).toDouble(), + currentSpent = (j['currentSpent'] as num).toDouble(), + historicalAverage = (j['historicalAverage'] as num).toDouble(), + confidence = j['confidence'] as String; +} + +class BudgetRecommendations { + final int year, month; + final double suggestedTotal; + final String message, adjustmentSummary; + final List warnings; + final List items; + + BudgetRecommendations.fromJson(Map j) + : year = (j['year'] as num).toInt(), + month = (j['month'] as num).toInt(), + suggestedTotal = (j['suggestedTotal'] as num).toDouble(), + message = j['message'] as String, + adjustmentSummary = j['adjustmentSummary'] as String? ?? '', + warnings = (j['warnings'] as List? ?? const []) + .map((item) => item.toString()) + .toList(), + items = (j['items'] as List) + .map( + (e) => BudgetRecommendationItem.fromJson(e as Map), + ) + .toList(); +} + +class BudgetRefinementTurn { + final String role, content; + + const BudgetRefinementTurn({required this.role, required this.content}); + + Map toJson() => {'role': role, 'content': content}; +} + +class BudgetApi { + static final _dio = ApiClient.instance.dio; + static int get _ledgerId => CurrentLedgerStore.instance.currentId ?? 1; + + static Future get(int year, int month) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + return BudgetsData.fromJson( + LocalDatabase.instance.budgets(year, month, _ledgerId), + ); + } + try { + final response = await _dio.get( + '/api/budgets', + queryParameters: {'year': year, 'month': month, 'ledgerId': _ledgerId}, + ); + return BudgetsData.fromJson(response.data as Map); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + return BudgetsData.fromJson( + LocalDatabase.instance.budgets(year, month, _ledgerId), + ); + } + } + + static Future upsert( + int year, + int month, { + int? categoryId, + required double amount, + bool recurring = false, + }) async { + final payload = { + 'categoryId': categoryId, + 'amount': amount, + 'recurring': recurring, + }; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || (categoryId ?? 0) < 0 || _ledgerId < 0) { + LocalDatabase.instance.upsertBudget( + year, + month, + _ledgerId, + categoryId, + amount, + recurring, + ); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync( + 'budget', + categoryId ?? 0, + 'upsert', + {...payload, 'year': year, 'month': month, 'ledgerId': _ledgerId}, + ); + } + return; + } + try { + await _dio.put( + '/api/budgets', + queryParameters: {'year': year, 'month': month, 'ledgerId': _ledgerId}, + data: payload, + ); + LocalDatabase.instance.upsertBudget( + year, + month, + _ledgerId, + categoryId, + amount, + recurring, + ); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + LocalDatabase.instance.upsertBudget( + year, + month, + _ledgerId, + categoryId, + amount, + recurring, + ); + LocalDatabase.instance.enqueueSync('budget', categoryId ?? 0, 'upsert', { + ...payload, + 'year': year, + 'month': month, + 'ledgerId': _ledgerId, + }); + } + } + + static Future recommendations( + int year, + int month, + ) async { + SessionStore.instance.requireOnline('AI 预算建议需要登录并连接网络'); + final response = await _dio.get( + '/api/budgets/recommendations', + queryParameters: {'year': year, 'month': month, 'ledgerId': _ledgerId}, + ); + return BudgetRecommendations.fromJson( + response.data as Map, + ); + } + + static Future refineRecommendation( + int year, + int month, { + required String instruction, + required double suggestedTotal, + required Map amounts, + required List history, + }) async { + SessionStore.instance.requireOnline('调整 AI 预算建议需要登录并连接网络'); + final response = await _dio.post( + '/api/budgets/recommendations/refine', + data: { + 'ledgerId': _ledgerId, + 'year': year, + 'month': month, + 'instruction': instruction, + 'currentDraft': { + 'suggestedTotal': suggestedTotal, + 'items': amounts.entries + .map((entry) => {'categoryId': entry.key, 'amount': entry.value}) + .toList(), + }, + 'history': history.take(12).map((turn) => turn.toJson()).toList(), + }, + ); + return BudgetRecommendations.fromJson( + response.data as Map, + ); + } + + static Future applyBatch( + int year, + int month, { + required bool recurring, + required Map amounts, + }) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || _ledgerId < 0) { + LocalDatabase.instance.applyBudgets( + year, + month, + _ledgerId, + recurring, + amounts, + ); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('budget', 0, 'batch', { + 'year': year, + 'month': month, + 'ledgerId': _ledgerId, + 'recurring': recurring, + 'items': amounts.entries + .map((entry) => {'categoryId': entry.key, 'amount': entry.value}) + .toList(), + }); + } + return; + } + await _dio.put( + '/api/budgets/batch', + queryParameters: {'year': year, 'month': month, 'ledgerId': _ledgerId}, + data: { + 'recurring': recurring, + 'items': amounts.entries + .map((entry) => {'categoryId': entry.key, 'amount': entry.value}) + .toList(), + }, + ); + LocalDatabase.instance.applyBudgets( + year, + month, + _ledgerId, + recurring, + amounts, + ); + } +} + +class ReportCategoryRank { + final String name; + final String iconKey; + final String colorKey; + final double amount; + final double percent; + + const ReportCategoryRank({ + required this.name, + required this.iconKey, + required this.colorKey, + required this.amount, + required this.percent, + }); + + factory ReportCategoryRank.fromJson(Map json) => + ReportCategoryRank( + name: json['name'] as String, + iconKey: json['iconKey'] as String? ?? 'tag', + colorKey: json['colorKey'] as String? ?? 'mint', + amount: (json['amount'] as num).toDouble(), + percent: (json['percent'] as num).toDouble(), + ); + + static List fromReport(Map json) { + final values = (json['categoryRanking'] as List? ?? const []) + .map( + (item) => ReportCategoryRank.fromJson(item as Map), + ) + .toList(); + if (values.isNotEmpty || json['topCategory'] == null) return values; + return [ + ReportCategoryRank( + name: json['topCategory'] as String, + iconKey: 'tag', + colorKey: 'mint', + amount: (json['topCategoryAmount'] as num).toDouble(), + percent: (json['topCategoryPercent'] as num).toDouble(), + ), + ]; + } +} + +class MonthlyReport { + final int year, month, count; + final double income, + expense, + balance, + aiRatio, + topDayAmount, + topCategoryAmount, + topCategoryPercent; + final String? topDay, topDayNote, topCategory; + final List categoryRanking; + final String roast; + + MonthlyReport.fromJson(Map j) + : year = j['year'] as int, + month = j['month'] as int, + count = j['count'] as int, + income = (j['income'] as num).toDouble(), + expense = (j['expense'] as num).toDouble(), + balance = (j['balance'] as num).toDouble(), + aiRatio = (j['aiRatio'] as num).toDouble(), + topDay = j['topDay'] as String?, + topDayAmount = (j['topDayAmount'] as num).toDouble(), + topDayNote = j['topDayNote'] as String?, + topCategory = j['topCategory'] as String?, + topCategoryAmount = (j['topCategoryAmount'] as num).toDouble(), + topCategoryPercent = (j['topCategoryPercent'] as num).toDouble(), + categoryRanking = ReportCategoryRank.fromReport(j), + roast = j['roast'] as String; +} + +class PeriodReport { + final String periodType, periodLabel; + final DateTime startDate, endDate; + final int count; + final double income, + expense, + balance, + aiRatio, + peakAmount, + topCategoryAmount, + topCategoryPercent; + final String? peakLabel, peakNote, topCategory; + final List categoryRanking; + final String commentary; + + PeriodReport.fromJson(Map j) + : periodType = j['periodType'] as String, + periodLabel = j['periodLabel'] as String, + startDate = DateTime.parse(j['startDate'] as String), + endDate = DateTime.parse(j['endDate'] as String), + count = (j['count'] as num).toInt(), + income = (j['income'] as num).toDouble(), + expense = (j['expense'] as num).toDouble(), + balance = (j['balance'] as num).toDouble(), + aiRatio = (j['aiRatio'] as num).toDouble(), + peakLabel = j['peakLabel'] as String?, + peakAmount = (j['peakAmount'] as num).toDouble(), + peakNote = j['peakNote'] as String?, + topCategory = j['topCategory'] as String?, + topCategoryAmount = (j['topCategoryAmount'] as num).toDouble(), + topCategoryPercent = (j['topCategoryPercent'] as num).toDouble(), + categoryRanking = ReportCategoryRank.fromReport(j), + commentary = j['commentary'] as String; + + PeriodReport.fromMonthly(MonthlyReport report) + : periodType = 'monthly', + periodLabel = '${report.year}年${report.month}月', + startDate = DateTime(report.year, report.month), + endDate = DateTime(report.year, report.month + 1), + count = report.count, + income = report.income, + expense = report.expense, + balance = report.balance, + aiRatio = report.aiRatio, + peakLabel = report.topDay, + peakAmount = report.topDayAmount, + peakNote = report.topDayNote, + topCategory = report.topCategory, + topCategoryAmount = report.topCategoryAmount, + topCategoryPercent = report.topCategoryPercent, + categoryRanking = report.categoryRanking, + commentary = report.roast; +} + +class ReportApi { + static final _dio = ApiClient.instance.dio; + static int get _ledgerId => CurrentLedgerStore.instance.currentId ?? 1; + + static Future weekly(DateTime date) async { + if (SessionStore.instance.shouldUseLocalOnly) { + return _localPeriod('week', date); + } + try { + final value = + '${date.year.toString().padLeft(4, '0')}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}'; + final response = await _dio.get( + '/api/reports/weekly', + queryParameters: {'date': value, 'ledgerId': _ledgerId}, + ); + return PeriodReport.fromJson(response.data as Map); + } catch (error) { + if (!isConnectivityError(error) || !SessionStore.instance.isAccount) + rethrow; + return _localPeriod('week', date); + } + } + + static Future monthlyPeriod(int year, int month) async { + if (SessionStore.instance.shouldUseLocalOnly) { + return _localPeriod('month', DateTime(year, month, 1)); + } + try { + return PeriodReport.fromMonthly(await monthly(year, month)); + } catch (error) { + if (!isConnectivityError(error) || !SessionStore.instance.isAccount) + rethrow; + return _localPeriod('month', DateTime(year, month, 1)); + } + } + + static Future yearly(int year) async { + if (SessionStore.instance.shouldUseLocalOnly) { + return _localPeriod('year', DateTime(year, 1, 1)); + } + try { + final response = await _dio.get( + '/api/reports/yearly', + queryParameters: {'year': year, 'ledgerId': _ledgerId}, + ); + return PeriodReport.fromJson(response.data as Map); + } catch (error) { + if (!isConnectivityError(error) || !SessionStore.instance.isAccount) + rethrow; + return _localPeriod('year', DateTime(year, 1, 1)); + } + } + + static Future monthly(int year, int month) async { + final response = await _dio.get( + '/api/reports/monthly', + queryParameters: {'year': year, 'month': month, 'ledgerId': _ledgerId}, + ); + return MonthlyReport.fromJson(response.data as Map); + } + + static PeriodReport _localPeriod(String period, DateTime anchor) => + PeriodReport.fromJson( + LocalDatabase.instance.periodReport(period, anchor, _ledgerId), + ); +} + +class SearchApi { + static final _dio = ApiClient.instance.dio; + + static Future> search({ + String? q, + bool aiOnly = false, + int? categoryId, + String? type, + double? minAmount, + double? maxAmount, + DateTime? from, + DateTime? to, + DateTime? beforeOccurredAt, + int? beforeId, + int limit = 50, + }) async { + final ledgerId = CurrentLedgerStore.instance.currentId ?? 1; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + return LocalDatabase.instance + .searchTransactions( + ledgerId: ledgerId, + query: q, + aiOnly: aiOnly, + categoryId: categoryId, + type: type, + minAmount: minAmount, + maxAmount: maxAmount, + from: from, + to: to, + beforeOccurredAt: beforeOccurredAt, + beforeId: beforeId, + limit: limit, + ) + .map(TxItem.fromJson) + .toList(); + } + try { + final response = await _dio.get( + '/api/search', + queryParameters: { + if (q != null && q.isNotEmpty) 'q': q, + 'ledgerId': ledgerId, + if (categoryId != null) 'categoryId': categoryId, + if (type != null) 'type': type, + if (aiOnly) 'aiOnly': true, + if (minAmount != null) 'minAmount': minAmount, + if (maxAmount != null) 'maxAmount': maxAmount, + if (from != null) + 'from': ShanghaiTime.civilToUtc(from).toIso8601String(), + if (to != null) 'to': ShanghaiTime.civilToUtc(to).toIso8601String(), + if (beforeOccurredAt != null) + 'beforeOccurredAt': ShanghaiTime.civilToUtc( + beforeOccurredAt, + ).toIso8601String(), + if (beforeId != null) 'beforeId': beforeId, + 'limit': limit, + }, + ); + final values = response.data as List; + LocalDatabase.instance.cacheTransactions(values); + return values + .map((item) => TxItem.fromJson(item as Map)) + .toList(); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + return LocalDatabase.instance + .searchTransactions( + ledgerId: ledgerId, + query: q, + aiOnly: aiOnly, + categoryId: categoryId, + type: type, + minAmount: minAmount, + maxAmount: maxAmount, + from: from, + to: to, + beforeOccurredAt: beforeOccurredAt, + beforeId: beforeId, + limit: limit, + ) + .map(TxItem.fromJson) + .toList(); + } + } +} + +class StickerItem { + final String key, label, groupKey; + StickerItem.fromJson(Map j) + : key = j['key'] as String, + label = j['label'] as String, + groupKey = j['groupKey'] as String; +} + +class StickerApi { + static final _dio = ApiClient.instance.dio; + static const _cacheKey = 'global_stickers_v1'; + static const _fallback = >[ + {'key': 'salary', 'label': '发工资啦', 'groupKey': 'default'}, + {'key': 'forgive', 'label': '求原谅', 'groupKey': 'default'}, + {'key': 'fire', 'label': '剁手警告', 'groupKey': 'default'}, + {'key': 'empty_wallet', 'label': '钱包空空', 'groupKey': 'default'}, + {'key': 'angry', 'label': '生气', 'groupKey': 'default'}, + {'key': 'happy', 'label': '开心', 'groupKey': 'default'}, + {'key': 'treat', 'label': '犒劳自己', 'groupKey': 'default'}, + {'key': 'shopping_joy', 'label': '购物狂喜', 'groupKey': 'default'}, + ]; + + static Future> list() async { + final preferences = await SharedPreferences.getInstance(); + try { + final res = await _dio.get('/api/stickers'); + final values = (res.data as List) + .map((e) => StickerItem.fromJson(e as Map)) + .toList(); + if (values.isNotEmpty) { + await preferences.setString( + _cacheKey, + jsonEncode( + values + .map( + (item) => { + 'key': item.key, + 'label': item.label, + 'groupKey': item.groupKey, + }, + ) + .toList(), + ), + ); + return values; + } + } catch (_) {} + + final cached = preferences.getString(_cacheKey); + if (cached != null) { + try { + final values = (jsonDecode(cached) as List) + .map( + (item) => + StickerItem.fromJson(Map.from(item as Map)), + ) + .toList(); + if (values.isNotEmpty) return values; + } catch (_) { + await preferences.remove(_cacheKey); + } + } + return _fallback.map(StickerItem.fromJson).toList(); + } +} + +class ParsedDraft { + final bool matched; + final int categoryId; + final String categoryName, categoryIcon, note, type; + final double amount; + final String? paymentMethod; + + ParsedDraft.fromJson(Map j) + : matched = j['matched'] as bool, + categoryId = (j['categoryId'] as num).toInt(), + categoryName = j['categoryName'] as String, + categoryIcon = j['categoryIcon'] as String, + amount = (j['amount'] as num).toDouble(), + paymentMethod = j['paymentMethod'] as String?, + note = j['note'] as String, + type = switch (j['type']?.toString().toLowerCase()) { + 'income' => 'income', + 'expense' => 'expense', + _ => 'unknown', + }; +} + +class ParseApi { + static final _dio = ApiClient.instance.dio; + + static Future parse(String text, {String? source}) async { + SessionStore.instance.requireOnline('AI 文本和语音解析需要登录并连接网络'); + final res = await _dio.post( + '/api/parse', + data: {'text': text, if (source != null) 'source': source}, + ); + return ParsedDraft.fromJson(res.data as Map); + } + + static Future confirm( + ParsedDraft d, + String source, + String sourceText, + ) async { + if (d.type != 'income' && d.type != 'expense') { + throw StateError('请先确认收入或支出类型'); + } + return TxApi.create( + categoryId: d.categoryId, + type: d.type, + amount: d.amount, + note: d.note, + paymentMethod: d.paymentMethod, + source: source, + sourceText: sourceText, + ); + } +} + +class CategoryApi { + static final _dio = ApiClient.instance.dio; + + static Future create( + String name, + String iconKey, + String colorKey, + String type, + ) async { + final payload = { + 'name': name, + 'iconKey': iconKey, + 'colorKey': colorKey, + 'type': type, + }; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + final local = LocalDatabase.instance.createCategory( + name, + iconKey, + colorKey, + type, + ); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync( + 'category', + local['id'] as int, + 'create', + payload, + ); + } + return CategoryItem.fromJson(local); + } + try { + final response = await _dio.post('/api/categories', data: payload); + final json = response.data as Map; + LocalDatabase.instance.cacheCategories([json]); + return CategoryItem.fromJson(json); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + final local = LocalDatabase.instance.createCategory( + name, + iconKey, + colorKey, + type, + ); + LocalDatabase.instance.enqueueSync( + 'category', + local['id'] as int, + 'create', + payload, + ); + return CategoryItem.fromJson(local); + } + } + + static Future update( + int id, { + required String name, + required String iconKey, + required String colorKey, + required int sortOrder, + }) async { + final payload = { + 'name': name, + 'iconKey': iconKey, + 'colorKey': colorKey, + 'sortOrder': sortOrder, + }; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + final local = LocalDatabase.instance.updateCategory( + id, + name, + iconKey, + colorKey, + sortOrder, + ); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('category', id, 'update', payload); + } + return CategoryItem.fromJson(local); + } + final response = await _dio.put('/api/categories/$id', data: payload); + final json = response.data as Map; + LocalDatabase.instance.cacheCategories([json]); + return CategoryItem.fromJson(json); + } + + static Future reorder(String type, List categoryIds) async { + LocalDatabase.instance.reorderCategories(type, categoryIds); + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || categoryIds.any((id) => id < 0)) { + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('category', 0, 'reorder', { + 'type': type, + 'categoryIds': categoryIds, + }); + } + return; + } + await _dio.put( + '/api/categories/reorder', + data: {'type': type, 'categoryIds': categoryIds}, + ); + } + + static Future delete(int id) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + LocalDatabase.instance.deleteCategory(id); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('category', id, 'delete', { + 'id': id, + }); + } + return; + } + await _dio.delete('/api/categories/$id'); + LocalDatabase.instance.deleteCategory(id); + } +} diff --git a/frontend/lib/shared/api/config_api.dart b/frontend/lib/shared/api/config_api.dart new file mode 100644 index 0000000..2a98446 --- /dev/null +++ b/frontend/lib/shared/api/config_api.dart @@ -0,0 +1,165 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +class BrandConfig { + final String appName, slogan, logoUrl; + final bool voiceEnabled; + final bool imageEnabled; + final bool screenshotEnabled; + final bool stickersEnabled; + final bool aiAutoBookEnabled; + + BrandConfig.fromJson(Map j) + : appName = _appName(j['appName']), + slogan = j['slogan'] as String? ?? '', + logoUrl = j['logoUrl'] as String? ?? '', + voiceEnabled = _feature(j, 'voice'), + imageEnabled = _feature(j, 'image'), + screenshotEnabled = _feature(j, 'screenshot'), + stickersEnabled = _feature(j, 'stickers'), + aiAutoBookEnabled = _feature(j, 'aiAutoBook'); + + static String _appName(Object? value) { + final name = value?.toString().trim(); + return name == null || name.isEmpty || name == '喵记账' || name == '喵记' + ? '记之' + : name; + } + + static bool _feature(Map json, String key) { + final features = json['features']; + return features is Map ? features[key] as bool? ?? true : true; + } +} + +class AvatarItem { + final String key, defaultName, speechTic; + final String? imageUrl; + AvatarItem.fromJson(Map j) + : key = j['key'] as String, + defaultName = j['defaultName'] as String, + speechTic = j['speechTic'] as String? ?? '', + imageUrl = j['imageUrl'] as String?; +} + +class PersonaItem { + final String key, name, description, sampleLine; + PersonaItem.fromJson(Map j) + : key = j['key'] as String, + name = j['name'] as String, + description = j['description'] as String? ?? '', + sampleLine = j['sampleLine'] as String? ?? ''; +} + +class CompanionDisplay { + final String name; + final String avatarKey; + + const CompanionDisplay({required this.name, required this.avatarKey}); +} + +class PublicConfigApi { + static final _dio = ApiClient.instance.dio; + static BrandConfig? _cachedBrand; + + static Future init() async { + if (!SessionStore.instance.isGuest) { + try { + final b = await _dio.get('/api/public/brand'); + _cachedBrand = BrandConfig.fromJson(b.data as Map); + } catch (_) {} + } + await refreshCompanion(); + } + + static String get appName => _cachedBrand?.appName ?? '记之'; + static String get slogan => _cachedBrand?.slogan ?? ''; + static bool get voiceEnabled => _cachedBrand?.voiceEnabled ?? true; + static bool get imageEnabled => _cachedBrand?.imageEnabled ?? true; + static bool get screenshotEnabled => _cachedBrand?.screenshotEnabled ?? true; + static bool get stickersEnabled => _cachedBrand?.stickersEnabled ?? true; + static bool get aiAutoBookEnabled => _cachedBrand?.aiAutoBookEnabled ?? true; + + static final companionNotifier = ValueNotifier( + const CompanionDisplay(name: 'AI', avatarKey: 'cat'), + ); + + static String get companionName => companionNotifier.value.name; + static String get companionAvatarKey => companionNotifier.value.avatarKey; + + static Future refreshCompanion() async { + final session = SessionStore.instance; + if (!session.isAccount || session.shouldUseLocalOnly) { + companionNotifier.value = const CompanionDisplay( + name: 'AI', + avatarKey: 'cat', + ); + return; + } + try { + final responses = await Future.wait([ + _dio.get('/api/users/me'), + _dio.get('/api/public/avatars'), + ]); + final profile = responses[0].data as Map; + final avatars = responses[1].data as List; + final companion = profile['aiCompanion'] as Map?; + final selectedAvatarKey = companion?['avatarKey'] as String?; + final customName = _normalizeName(companion?['customName'] as String?); + + var avatarKey = selectedAvatarKey; + String? defaultName; + + for (final item in avatars) { + final avatar = item as Map; + final key = avatar['key'] as String?; + if ((avatarKey == null || avatarKey.isEmpty) && + key != null && + key.isNotEmpty) { + avatarKey = key; + } + if (key == selectedAvatarKey) { + defaultName = _normalizeName(avatar['defaultName'] as String?); + break; + } + } + + companionNotifier.value = CompanionDisplay( + name: customName ?? defaultName ?? '小账喵', + avatarKey: avatarKey ?? 'cat', + ); + } catch (_) { + try { + final a = await _dio.get('/api/public/avatars'); + final list = a.data as List; + if (list.isEmpty) return; + final first = list.first as Map; + companionNotifier.value = CompanionDisplay( + name: _normalizeName(first['defaultName'] as String?) ?? '小账喵', + avatarKey: first['key'] as String? ?? 'cat', + ); + } catch (_) {} + } + } + + static Future> avatars() async { + final res = await _dio.get('/api/public/avatars'); + return (res.data as List) + .map((e) => AvatarItem.fromJson(e as Map)) + .toList(); + } + + static Future> personas() async { + final res = await _dio.get('/api/public/personas'); + return (res.data as List) + .map((e) => PersonaItem.fromJson(e as Map)) + .toList(); + } + + static String? _normalizeName(String? value) { + final text = value?.trim(); + if (text == null || text.isEmpty) return null; + return text; + } +} diff --git a/frontend/lib/shared/api/sse_frame_accumulator.dart b/frontend/lib/shared/api/sse_frame_accumulator.dart new file mode 100644 index 0000000..774ac0a --- /dev/null +++ b/frontend/lib/shared/api/sse_frame_accumulator.dart @@ -0,0 +1,22 @@ +class SseFrameAccumulator { + String _pending = ''; + + List add(String chunk) { + _pending = (_pending + chunk).replaceAll('\r\n', '\n'); + final frames = []; + var separator = _pending.indexOf('\n\n'); + while (separator >= 0) { + final frame = _pending.substring(0, separator); + _pending = _pending.substring(separator + 2); + if (frame.trim().isNotEmpty) frames.add(frame); + separator = _pending.indexOf('\n\n'); + } + return frames; + } + + List close() { + final trailing = _pending.trim(); + _pending = ''; + return trailing.isEmpty ? const [] : [trailing]; + } +} diff --git a/frontend/lib/shared/services/current_ledger_store.dart b/frontend/lib/shared/services/current_ledger_store.dart new file mode 100644 index 0000000..73465e0 --- /dev/null +++ b/frontend/lib/shared/services/current_ledger_store.dart @@ -0,0 +1,192 @@ +import 'package:flutter/foundation.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +class LedgerInfo { + final int id; + final String name; + final String iconKey; + final bool isDefault; + final int transactionCount; + + const LedgerInfo({ + required this.id, + required this.name, + required this.iconKey, + required this.isDefault, + required this.transactionCount, + }); + + factory LedgerInfo.fromJson(Map json) => LedgerInfo( + id: (json['id'] as num).toInt(), + name: json['name'] as String, + iconKey: json['iconKey'] as String? ?? 'wallet', + isDefault: json['isDefault'] as bool? ?? false, + transactionCount: (json['txCount'] as num?)?.toInt() ?? 0, + ); +} + +class CurrentLedgerStore extends ChangeNotifier { + CurrentLedgerStore._(); + + static final instance = CurrentLedgerStore._(); + final _dio = ApiClient.instance.dio; + + List _ledgers = const []; + LedgerInfo? _current; + Future? _loading; + + List get ledgers => List.unmodifiable(_ledgers); + LedgerInfo? get current => _current; + int? get currentId => _current?.id; + String get currentName => _current?.name ?? '账本'; + + Future ensureLoaded({bool force = false}) { + if (!force && _current != null) return Future.value(); + return _loading ??= _load().whenComplete(() => _loading = null); + } + + Future loadCached({bool force = false}) { + if (!force && _current != null) return Future.value(); + return _loading ??= _loadCached().whenComplete(() => _loading = null); + } + + Future _loadCached() async { + _apply(LocalDatabase.instance.ledgers()); + } + + Future _load() async { + final session = SessionStore.instance; + List values; + if (session.shouldUseLocalOnly) { + values = LocalDatabase.instance.ledgers(); + } else { + try { + final response = await _dio.get('/api/ledgers'); + values = response.data as List; + LocalDatabase.instance.cacheLedgers(values); + } catch (error) { + if (!isConnectivityError(error) || !session.isAccount) rethrow; + values = LocalDatabase.instance.ledgers(); + } + } + _apply(values); + } + + void _apply(List values) { + final items = values + .map((item) => LedgerInfo.fromJson(item as Map)) + .toList(); + _ledgers = items; + _current = + items.where((item) => item.isDefault).firstOrNull ?? + (items.isEmpty ? null : items.first); + notifyListeners(); + } + + Future select(int id) async { + if (_current?.id == id) return; + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + LocalDatabase.instance.selectLedger(id); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('ledger', id, 'select', {'id': id}); + } + await ensureLoaded(force: true); + return; + } + try { + await _dio.put('/api/ledgers/$id/default'); + } catch (error) { + if (!isConnectivityError(error)) rethrow; + LocalDatabase.instance.selectLedger(id); + LocalDatabase.instance.enqueueSync('ledger', id, 'select', {'id': id}); + } + await ensureLoaded(force: true); + } + + Future create(String name) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly) { + final id = LocalDatabase.instance.createLedger(name.trim()); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('ledger', id, 'create', { + 'name': name.trim(), + 'iconKey': 'wallet', + }); + } + await ensureLoaded(force: true); + return; + } + try { + await _dio.post( + '/api/ledgers', + data: {'name': name.trim(), 'iconKey': 'wallet'}, + ); + } catch (error) { + if (!isConnectivityError(error)) rethrow; + final id = LocalDatabase.instance.createLedger(name.trim()); + LocalDatabase.instance.enqueueSync('ledger', id, 'create', { + 'name': name.trim(), + 'iconKey': 'wallet', + }); + } + await ensureLoaded(force: true); + } + + Future rename(int id, String name, String iconKey) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + LocalDatabase.instance.renameLedger(id, name.trim(), iconKey); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('ledger', id, 'update', { + 'name': name.trim(), + 'iconKey': iconKey, + }); + } + await ensureLoaded(force: true); + return; + } + try { + await _dio.put( + '/api/ledgers/$id', + data: {'name': name.trim(), 'iconKey': iconKey}, + ); + } catch (error) { + if (!isConnectivityError(error)) rethrow; + LocalDatabase.instance.renameLedger(id, name.trim(), iconKey); + LocalDatabase.instance.enqueueSync('ledger', id, 'update', { + 'name': name.trim(), + 'iconKey': iconKey, + }); + } + await ensureLoaded(force: true); + } + + Future delete(int id) async { + final session = SessionStore.instance; + if (session.shouldUseLocalOnly || id < 0) { + LocalDatabase.instance.deleteLedger(id); + if (session.isAccount && session.cloudSyncEnabled) { + LocalDatabase.instance.enqueueSync('ledger', id, 'delete', {'id': id}); + } + await ensureLoaded(force: true); + return; + } + try { + await _dio.delete('/api/ledgers/$id'); + } catch (error) { + if (!isConnectivityError(error)) rethrow; + LocalDatabase.instance.deleteLedger(id); + LocalDatabase.instance.enqueueSync('ledger', id, 'delete', {'id': id}); + } + await ensureLoaded(force: true); + } + + void clear() { + _ledgers = const []; + _current = null; + notifyListeners(); + } +} diff --git a/frontend/lib/shared/services/guest_merge_service.dart b/frontend/lib/shared/services/guest_merge_service.dart new file mode 100644 index 0000000..b0550e3 --- /dev/null +++ b/frontend/lib/shared/services/guest_merge_service.dart @@ -0,0 +1,149 @@ +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +class GuestMergeResult { + final int ledgerId; + final int transactionCount; + + const GuestMergeResult({ + required this.ledgerId, + required this.transactionCount, + }); +} + +class GuestMergeService { + GuestMergeService._(); + + static final _dio = ApiClient.instance.dio; + + static Future merge(Map snapshot) async { + final ledgerResponse = await _dio.post( + '/api/ledgers', + data: {'name': '游客数据', 'iconKey': 'wallet'}, + ); + final ledgerId = (ledgerResponse.data['id'] as num).toInt(); + final categoryMap = {}; + final available = >[]; + for (final type in ['expense', 'income']) { + final response = await _dio.get( + '/api/categories', + queryParameters: {'type': type}, + ); + available.addAll( + (response.data as List).map((item) => item as Map), + ); + } + + for (final value in snapshot['categories'] as List? ?? const []) { + final category = value as Map; + final existing = available.where( + (item) => + item['type'] == category['type'] && + item['name'] == category['name'], + ); + Map remote; + if (existing.isNotEmpty) { + remote = existing.first; + } else { + final response = await _dio.post( + '/api/categories', + data: { + 'name': category['name'], + 'iconKey': category['iconKey'], + 'colorKey': category['colorKey'], + 'type': category['type'], + }, + ); + remote = response.data as Map; + available.add(remote); + } + categoryMap[(category['id'] as num).toInt()] = (remote['id'] as num) + .toInt(); + } + + int mapCategory(Map transaction) { + final oldId = (transaction['categoryId'] as num).toInt(); + final custom = categoryMap[oldId]; + if (custom != null) return custom; + final exact = available.where( + (item) => + item['type'] == transaction['type'] && + item['name'] == transaction['categoryName'], + ); + if (exact.isNotEmpty) return (exact.first['id'] as num).toInt(); + final fallback = available.firstWhere( + (item) => item['type'] == transaction['type'] && item['name'] == '其他', + ); + return (fallback['id'] as num).toInt(); + } + + var transactionCount = 0; + for (final value + in snapshot['transactions'] as List? ?? const []) { + final transaction = value as Map; + await _dio.post( + '/api/transactions', + data: { + 'ledgerId': ledgerId, + 'categoryId': mapCategory(transaction), + 'type': transaction['type'], + 'amount': transaction['amount'], + 'note': transaction['note'], + 'paymentMethod': transaction['paymentMethod'], + 'occurredAt': transaction['occurredAt'], + 'source': 'manual', + 'sourceText': null, + }, + ); + transactionCount++; + } + + for (final value in snapshot['budgets'] as List? ?? const []) { + final budget = value as Map; + final period = (budget['period'] as num).toInt(); + final recurring = budget['recurring'] == true || period == 0; + final current = ShanghaiTime.now; + final year = period == 0 ? current.year : period ~/ 100; + final month = period == 0 ? current.month : period % 100; + final oldCategoryId = (budget['categoryId'] as num?)?.toInt(); + await _dio.put( + '/api/budgets', + queryParameters: {'year': year, 'month': month, 'ledgerId': ledgerId}, + data: { + 'categoryId': oldCategoryId == null + ? null + : categoryMap[oldCategoryId] ?? + _findMappedDefault(available, snapshot, oldCategoryId), + 'amount': budget['amount'], + 'recurring': recurring, + }, + ); + } + + await CurrentLedgerStore.instance.ensureLoaded(force: true); + await CurrentLedgerStore.instance.select(ledgerId); + return GuestMergeResult( + ledgerId: ledgerId, + transactionCount: transactionCount, + ); + } + + static int? _findMappedDefault( + List> available, + Map snapshot, + int oldCategoryId, + ) { + final transaction = (snapshot['transactions'] as List? ?? const []) + .cast>() + .where((item) => item['categoryId'] == oldCategoryId) + .firstOrNull; + if (transaction == null) return null; + final match = available.where( + (item) => + item['type'] == transaction['type'] && + item['name'] == transaction['categoryName'], + ); + return match.isEmpty ? null : (match.first['id'] as num).toInt(); + } +} diff --git a/frontend/lib/shared/services/local_database.dart b/frontend/lib/shared/services/local_database.dart new file mode 100644 index 0000000..82762f1 --- /dev/null +++ b/frontend/lib/shared/services/local_database.dart @@ -0,0 +1,1516 @@ +import 'dart:convert'; +import 'dart:math'; + +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:path/path.dart' as p; +import 'package:path_provider/path_provider.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:sqlite3/sqlite3.dart'; + +class LocalDatabase { + LocalDatabase._(); + + static final instance = LocalDatabase._(); + static const _secureStorage = FlutterSecureStorage(); + + Database? _database; + String? _namespace; + + String? get namespace => _namespace; + Database get _db { + final database = _database; + if (database == null) throw StateError('本地数据库尚未初始化'); + return database; + } + + Future openNamespace(String namespace) async { + if (_namespace == namespace && _database != null) return; + close(); + final safeNamespace = namespace.replaceAll(RegExp(r'[^a-zA-Z0-9_-]'), '_'); + final directory = await getApplicationSupportDirectory(); + final databasePath = p.join(directory.path, 'jizhi_$safeNamespace.db'); + final keyName = 'local_db_key_$safeNamespace'; + var key = await _secureStorage.read(key: keyName); + if (key == null) { + final random = Random.secure(); + key = List.generate( + 32, + (_) => random.nextInt(256), + ).map((value) => value.toRadixString(16).padLeft(2, '0')).join(); + await _secureStorage.write(key: keyName, value: key); + } + + final database = sqlite3.open(databasePath); + try { + database.execute("PRAGMA key = \"x'$key'\""); + database.execute('PRAGMA foreign_keys = ON'); + database.execute('PRAGMA journal_mode = WAL'); + database.execute('PRAGMA cipher_memory_security = ON'); + database.select('SELECT count(*) FROM sqlite_master'); + _database = database; + _namespace = namespace; + _migrate(); + if (namespace == 'guest') _seedDefaults(); + } catch (_) { + database.close(); + rethrow; + } + } + + void close() { + _database?.close(); + _database = null; + _namespace = null; + } + + void _migrate() { + _db.execute(''' + CREATE TABLE IF NOT EXISTS local_meta ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL + ) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS ledgers ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + icon_key TEXT NOT NULL DEFAULT 'wallet', + is_default INTEGER NOT NULL DEFAULT 0, + transaction_count INTEGER NOT NULL DEFAULT 0, + updated_at TEXT NOT NULL + ) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS categories ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + icon_key TEXT NOT NULL, + color_key TEXT NOT NULL DEFAULT 'mint', + type TEXT NOT NULL, + sort_order INTEGER NOT NULL, + is_custom INTEGER NOT NULL DEFAULT 0, + is_deleted INTEGER NOT NULL DEFAULT 0, + updated_at TEXT NOT NULL + ) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS transactions ( + id INTEGER PRIMARY KEY, + ledger_id INTEGER NOT NULL, + category_id INTEGER NOT NULL, + type TEXT NOT NULL, + amount REAL NOT NULL, + note TEXT, + payment_method TEXT, + source TEXT NOT NULL DEFAULT 'manual', + source_text TEXT, + client_request_id TEXT, + occurred_at TEXT NOT NULL, + is_deleted INTEGER NOT NULL DEFAULT 0, + deleted_at TEXT, + sync_state TEXT NOT NULL DEFAULT 'local', + updated_at TEXT NOT NULL + ) + '''); + _db.execute(''' + CREATE INDEX IF NOT EXISTS ix_local_transactions_period + ON transactions (ledger_id, occurred_at) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS budgets ( + ledger_id INTEGER NOT NULL, + period INTEGER NOT NULL, + category_key INTEGER NOT NULL, + amount REAL NOT NULL, + is_recurring INTEGER NOT NULL DEFAULT 0, + updated_at TEXT NOT NULL, + PRIMARY KEY (ledger_id, period, category_key) + ) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS sync_queue ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + entity_type TEXT NOT NULL, + entity_id INTEGER NOT NULL, + operation TEXT NOT NULL, + payload TEXT NOT NULL, + created_at TEXT NOT NULL, + retry_count INTEGER NOT NULL DEFAULT 0 + ) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS sync_conflicts ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + entity_type TEXT NOT NULL, + entity_id INTEGER NOT NULL, + operation TEXT NOT NULL DEFAULT 'update', + local_payload TEXT NOT NULL, + remote_payload TEXT NOT NULL, + created_at TEXT NOT NULL, + resolved_at TEXT + ) + '''); + _db.execute(''' + CREATE TABLE IF NOT EXISTS local_id_map ( + entity_type TEXT NOT NULL, + local_id INTEGER NOT NULL, + remote_id INTEGER NOT NULL, + PRIMARY KEY (entity_type, local_id) + ) + '''); + final transactionColumns = _db + .select('PRAGMA table_info(transactions)') + .map((row) => row['name']) + .toSet(); + if (!transactionColumns.contains('client_request_id')) { + _db.execute('ALTER TABLE transactions ADD COLUMN client_request_id TEXT'); + } + _db.execute(''' + CREATE UNIQUE INDEX IF NOT EXISTS ux_local_transactions_client_request + ON transactions (client_request_id) + WHERE client_request_id IS NOT NULL + '''); + final conflictColumns = _db + .select('PRAGMA table_info(sync_conflicts)') + .map((row) => row['name']) + .toSet(); + if (!conflictColumns.contains('operation')) { + _db.execute( + "ALTER TABLE sync_conflicts ADD COLUMN operation TEXT NOT NULL DEFAULT 'update'", + ); + } + final recognitionTimestampRepaired = _db.select( + "SELECT 1 FROM local_meta WHERE key = 'recognition_timestamp_repair_v1'", + ); + if (recognitionTimestampRepaired.isEmpty) { + _db.execute("""UPDATE transactions + SET occurred_at = updated_at + WHERE source IN ('accessibility', 'notification', 'recognition_ai') + AND occurred_at < '2000-01-01T00:00:00Z'"""); + _db.execute("""INSERT OR REPLACE INTO local_meta (key, value) + VALUES ('recognition_timestamp_repair_v1', 'done')"""); + } + } + + void _seedDefaults() { + final now = DateTime.now().toUtc().toIso8601String(); + _db.execute( + '''INSERT OR IGNORE INTO ledgers + (id, name, icon_key, is_default, transaction_count, updated_at) + VALUES (1, '日常账本', 'wallet', 1, 0, ?)''', + [now], + ); + const defaults = <(int, String, String, String, String, int)>[ + (1, '餐饮', 'food', 'coral', 'expense', 10), + (2, '饮品', 'drink', 'cyan', 'expense', 20), + (3, '购物', 'cart', 'blue', 'expense', 30), + (4, '交通', 'metro', 'teal', 'expense', 40), + (5, '住房', 'house', 'sand', 'expense', 50), + (6, '娱乐', 'game', 'violet', 'expense', 60), + (7, '医疗', 'medical', 'red', 'expense', 70), + (8, '学习', 'book', 'indigo', 'expense', 80), + (9, '服饰', 'clothes', 'plum', 'expense', 90), + (10, '人情', 'gift', 'rose', 'expense', 100), + (11, '旅行', 'travel', 'sky', 'expense', 110), + (12, '其他', 'tag', 'graphite', 'expense', 120), + (101, '工资', 'money', 'mint', 'income', 10), + (102, '兼职', 'parttime', 'forest', 'income', 20), + (103, '理财', 'invest', 'navy', 'income', 30), + (104, '红包', 'redpacket', 'orange', 'income', 40), + (105, '报销', 'reimburse', 'amber', 'income', 50), + (106, '奖金', 'bonus', 'aqua', 'income', 60), + (107, '其他', 'tag', 'lime', 'income', 70), + ]; + final statement = _db.prepare(''' + INSERT OR IGNORE INTO categories + (id, name, icon_key, color_key, type, sort_order, is_custom, is_deleted, updated_at) + VALUES (?, ?, ?, ?, ?, ?, 0, 0, ?) + '''); + try { + for (final item in defaults) { + statement.execute([ + item.$1, + item.$2, + item.$3, + item.$4, + item.$5, + item.$6, + now, + ]); + } + } finally { + statement.close(); + } + } + + Map guestSnapshot() { + final customCategories = _db + .select(''' + SELECT * FROM categories + WHERE is_custom = 1 AND is_deleted = 0 + ORDER BY type, sort_order + ''') + .map(_categoryMap) + .toList(); + final transactions = _db + .select(''' + SELECT t.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM transactions t JOIN categories c ON c.id = t.category_id + WHERE t.is_deleted = 0 + ORDER BY t.occurred_at, t.id + ''') + .map(_transactionMap) + .toList(); + final budgets = _db + .select('SELECT * FROM budgets ORDER BY period, category_key') + .map( + (row) => { + 'period': (row['period'] as num).toInt(), + 'categoryId': (row['category_key'] as num).toInt() == 0 + ? null + : (row['category_key'] as num).toInt(), + 'amount': (row['amount'] as num).toDouble(), + 'recurring': (row['is_recurring'] as num).toInt() == 1, + }, + ) + .toList(); + return { + 'hasData': + transactions.isNotEmpty || + customCategories.isNotEmpty || + budgets.isNotEmpty || + ledgers().length > 1, + 'categories': customCategories, + 'transactions': transactions, + 'budgets': budgets, + }; + } + + Map exportSnapshot() { + final ledgers = _db + .select('SELECT * FROM ledgers ORDER BY is_default DESC, id') + .map( + (row) => { + 'id': (row['id'] as num).toInt(), + 'name': row['name'] as String, + 'iconKey': row['icon_key'] as String, + 'isDefault': (row['is_default'] as num).toInt() == 1, + 'updatedAt': row['updated_at'] as String, + }, + ) + .toList(); + final categories = _db + .select('SELECT * FROM categories ORDER BY type, sort_order, id') + .map( + (row) => { + ..._categoryMap(row), + 'isDeleted': (row['is_deleted'] as num).toInt() == 1, + 'updatedAt': row['updated_at'] as String, + }, + ) + .toList(); + final transactions = _db + .select(''' + SELECT t.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM transactions t + JOIN categories c ON c.id = t.category_id + ORDER BY t.occurred_at, t.id + ''') + .map( + (row) => { + ..._transactionMap(row), + 'deletedAt': row['deleted_at'] as String?, + }, + ) + .toList(); + final budgets = _db + .select( + 'SELECT * FROM budgets ORDER BY period, ledger_id, category_key', + ) + .map( + (row) => { + 'ledgerId': (row['ledger_id'] as num).toInt(), + 'period': (row['period'] as num).toInt(), + 'categoryId': (row['category_key'] as num).toInt() == 0 + ? null + : (row['category_key'] as num).toInt(), + 'amount': (row['amount'] as num).toDouble(), + 'recurring': (row['is_recurring'] as num).toInt() == 1, + 'updatedAt': row['updated_at'] as String, + }, + ) + .toList(); + return { + 'schemaVersion': 1, + 'exportedAt': DateTime.now().toUtc().toIso8601String(), + 'ledgers': ledgers, + 'categories': categories, + 'transactions': transactions, + 'budgets': budgets, + }; + } + + List> ledgers() { + final counts = {}; + for (final row in _db.select(''' + SELECT ledger_id, COUNT(*) AS tx_count + FROM transactions WHERE is_deleted = 0 GROUP BY ledger_id + ''')) { + counts[(row['ledger_id'] as num).toInt()] = (row['tx_count'] as num) + .toInt(); + } + return _db + .select('SELECT * FROM ledgers ORDER BY is_default DESC, id') + .map( + (row) => { + 'id': (row['id'] as num).toInt(), + 'name': row['name'] as String, + 'iconKey': row['icon_key'] as String, + 'isDefault': (row['is_default'] as num).toInt() == 1, + 'txCount': counts[(row['id'] as num).toInt()] ?? 0, + }, + ) + .toList(); + } + + void cacheLedgers(List values) { + final now = DateTime.now().toUtc().toIso8601String(); + _db.execute('BEGIN'); + try { + final incomingIds = values + .map( + (value) => ((value as Map)['id'] as num).toInt(), + ) + .toSet(); + for (final row in _db.select('SELECT id FROM ledgers WHERE id > 0')) { + final id = (row['id'] as num).toInt(); + if (incomingIds.contains(id)) continue; + final references = + _db + .select( + ''' + SELECT + (SELECT COUNT(*) FROM transactions WHERE ledger_id = ?) + + (SELECT COUNT(*) FROM budgets WHERE ledger_id = ?) + + (SELECT COUNT(*) FROM sync_queue + WHERE entity_type = 'ledger' AND entity_id = ?) AS value + ''', + [id, id, id], + ) + .first['value'] + as int; + if (references == 0) { + _db.execute('DELETE FROM ledgers WHERE id = ?', [id]); + } + } + for (final value in values) { + final item = value as Map; + _db.execute( + ''' + INSERT INTO ledgers + (id, name, icon_key, is_default, transaction_count, updated_at) + VALUES (?, ?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET + name = excluded.name, + icon_key = excluded.icon_key, + is_default = excluded.is_default, + transaction_count = excluded.transaction_count, + updated_at = excluded.updated_at + ''', + [ + item['id'], + item['name'], + item['iconKey'] ?? 'wallet', + item['isDefault'] == true ? 1 : 0, + item['txCount'] ?? 0, + now, + ], + ); + } + _db.execute('COMMIT'); + } catch (_) { + _db.execute('ROLLBACK'); + rethrow; + } + } + + int createLedger(String name) { + final id = _nextNegativeId('ledgers'); + _db.execute( + ''' + INSERT INTO ledgers + (id, name, icon_key, is_default, transaction_count, updated_at) + VALUES (?, ?, 'wallet', 0, 0, ?) + ''', + [id, name, DateTime.now().toUtc().toIso8601String()], + ); + return id; + } + + void selectLedger(int id) { + _db.execute('UPDATE ledgers SET is_default = 0'); + _db.execute('UPDATE ledgers SET is_default = 1 WHERE id = ?', [id]); + } + + void renameLedger(int id, String name, String iconKey) { + _db.execute( + 'UPDATE ledgers SET name = ?, icon_key = ?, updated_at = ? WHERE id = ?', + [name, iconKey, DateTime.now().toUtc().toIso8601String(), id], + ); + } + + void deleteLedger(int id) { + final count = + _db.select( + 'SELECT COUNT(*) AS value FROM transactions WHERE ledger_id = ?', + [id], + ).first['value'] + as int; + final budgetCount = + _db.select( + 'SELECT COUNT(*) AS value FROM budgets WHERE ledger_id = ?', + [id], + ).first['value'] + as int; + if (count > 0 || budgetCount > 0) { + throw StateError('仅可删除没有账单和预算的账本'); + } + _db.execute('DELETE FROM ledgers WHERE id = ? AND is_default = 0', [id]); + } + + List> categories(String type) => _db + .select( + '''SELECT * FROM categories + WHERE type = ? AND is_deleted = 0 + ORDER BY is_custom, sort_order, id''', + [type], + ) + .map(_categoryMap) + .toList(); + + void cacheCategories(List values, {String? replaceType}) { + final now = DateTime.now().toUtc().toIso8601String(); + if (replaceType != null) { + final incomingIds = values + .map( + (value) => ((value as Map)['id'] as num).toInt(), + ) + .toSet(); + for (final row in _db.select( + 'SELECT id FROM categories WHERE id > 0 AND type = ?', + [replaceType], + )) { + final id = (row['id'] as num).toInt(); + if (!incomingIds.contains(id)) { + _db.execute( + 'UPDATE categories SET is_deleted = 1, updated_at = ? WHERE id = ?', + [now, id], + ); + } + } + } + for (final value in values) { + final item = value as Map; + _db.execute( + ''' + INSERT INTO categories + (id, name, icon_key, color_key, type, sort_order, is_custom, is_deleted, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, 0, ?) + ON CONFLICT(id) DO UPDATE SET + name = excluded.name, + icon_key = excluded.icon_key, + color_key = excluded.color_key, + type = excluded.type, + sort_order = excluded.sort_order, + is_custom = excluded.is_custom, + is_deleted = 0, + updated_at = excluded.updated_at + ''', + [ + item['id'], + item['name'], + item['iconKey'] ?? 'tag', + item['colorKey'] ?? 'mint', + item['type'], + item['sortOrder'] ?? 0, + item['isCustom'] == true ? 1 : 0, + now, + ], + ); + } + } + + Map createCategory( + String name, + String iconKey, + String colorKey, + String type, + ) { + final id = _nextNegativeId('categories'); + final sortOrder = + (_db.select( + 'SELECT MAX(sort_order) AS value FROM categories WHERE type = ?', + [type], + ).first['value'] + as num?) + ?.toInt() ?? + 0; + _db.execute( + ''' + INSERT INTO categories + (id, name, icon_key, color_key, type, sort_order, is_custom, is_deleted, updated_at) + VALUES (?, ?, ?, ?, ?, ?, 1, 0, ?) + ''', + [ + id, + name, + iconKey, + colorKey, + type, + sortOrder + 10, + DateTime.now().toUtc().toIso8601String(), + ], + ); + return _categoryMap( + _db.select('SELECT * FROM categories WHERE id = ?', [id]).first, + ); + } + + Map updateCategory( + int id, + String name, + String iconKey, + String colorKey, + int sortOrder, + ) { + _db.execute( + ''' + UPDATE categories SET name = ?, icon_key = ?, color_key = ?, + sort_order = ?, updated_at = ? WHERE id = ? AND is_custom = 1 + ''', + [ + name, + iconKey, + colorKey, + sortOrder, + DateTime.now().toUtc().toIso8601String(), + id, + ], + ); + return _categoryMap( + _db.select('SELECT * FROM categories WHERE id = ?', [id]).first, + ); + } + + void reorderCategories(String type, List ids) { + _db.execute('BEGIN'); + try { + for (var index = 0; index < ids.length; index++) { + _db.execute( + 'UPDATE categories SET sort_order = ? WHERE id = ? AND type = ? AND is_custom = 1', + [(index + 1) * 10, ids[index], type], + ); + } + _db.execute('COMMIT'); + } catch (_) { + _db.execute('ROLLBACK'); + rethrow; + } + } + + void deleteCategory(int id) { + _db.execute( + 'UPDATE categories SET is_deleted = 1, updated_at = ? WHERE id = ? AND is_custom = 1', + [DateTime.now().toUtc().toIso8601String(), id], + ); + } + + void cacheMonthSummary(Map summary) { + for (final day in summary['days'] as List? ?? const []) { + final group = day as Map; + for (final value in group['items'] as List? ?? const []) { + cacheTransaction(value as Map); + } + } + } + + void cacheTransactions(Iterable values) { + for (final value in values) { + cacheTransaction(value as Map); + } + } + + void cacheTransaction(Map value) { + final categoryId = (value['categoryId'] as num).toInt(); + final categoryExists = _db.select('SELECT 1 FROM categories WHERE id = ?', [ + categoryId, + ]).isNotEmpty; + if (!categoryExists) { + _db.execute( + ''' + INSERT INTO categories + (id, name, icon_key, color_key, type, sort_order, is_custom, is_deleted, updated_at) + VALUES (?, ?, ?, ?, ?, 999, 0, 0, ?) + ''', + [ + categoryId, + value['categoryName'] ?? '其他', + value['categoryIcon'] ?? 'tag', + value['categoryColor'] ?? 'mint', + value['type'], + DateTime.now().toUtc().toIso8601String(), + ], + ); + } + _db.execute( + ''' + INSERT INTO transactions + (id, ledger_id, category_id, type, amount, note, payment_method, + source, source_text, occurred_at, is_deleted, deleted_at, sync_state, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, 'synced', ?) + ON CONFLICT(id) DO UPDATE SET + ledger_id = excluded.ledger_id, + category_id = excluded.category_id, + type = excluded.type, + amount = excluded.amount, + note = excluded.note, + payment_method = excluded.payment_method, + source = excluded.source, + source_text = excluded.source_text, + occurred_at = excluded.occurred_at, + is_deleted = excluded.is_deleted, + sync_state = 'synced', + updated_at = excluded.updated_at + ''', + [ + value['id'], + value['ledgerId'], + categoryId, + value['type'], + value['amount'], + value['note'], + value['paymentMethod'], + value['source'] ?? 'manual', + value['sourceText'], + DateTime.parse(value['occurredAt'] as String).toUtc().toIso8601String(), + value['isDeleted'] == true ? 1 : 0, + value['updatedAt'] ?? DateTime.now().toUtc().toIso8601String(), + ], + ); + } + + void replaceLocalTransaction(int localId, Map remote) { + final remoteId = (remote['id'] as num).toInt(); + _db.execute('DELETE FROM transactions WHERE id = ?', [localId]); + _saveIdMap('transaction', localId, remoteId); + cacheTransaction(remote); + } + + void enqueueSync( + String entityType, + int entityId, + String operation, + Map payload, + ) { + _db.execute( + ''' + INSERT INTO sync_queue + (entity_type, entity_id, operation, payload, created_at, retry_count) + VALUES (?, ?, ?, ?, ?, 0) + ''', + [ + entityType, + entityId, + operation, + jsonEncode(payload), + DateTime.now().toUtc().toIso8601String(), + ], + ); + } + + int? remoteId(String entityType, int localId) { + if (localId >= 0) return localId; + final rows = _db.select( + 'SELECT remote_id FROM local_id_map WHERE entity_type = ? AND local_id = ?', + [entityType, localId], + ); + return rows.isEmpty ? null : (rows.first['remote_id'] as num).toInt(); + } + + void remapLedger(int localId, Map remote) { + final newId = (remote['id'] as num).toInt(); + _db.execute('BEGIN'); + try { + _db.execute( + ''' + INSERT OR REPLACE INTO ledgers + (id, name, icon_key, is_default, transaction_count, updated_at) + SELECT ?, ?, ?, is_default, transaction_count, ? + FROM ledgers WHERE id = ? + ''', + [ + newId, + remote['name'], + remote['iconKey'] ?? 'wallet', + DateTime.now().toUtc().toIso8601String(), + localId, + ], + ); + _db.execute('UPDATE transactions SET ledger_id = ? WHERE ledger_id = ?', [ + newId, + localId, + ]); + _db.execute('UPDATE budgets SET ledger_id = ? WHERE ledger_id = ?', [ + newId, + localId, + ]); + _db.execute('DELETE FROM ledgers WHERE id = ?', [localId]); + _saveIdMap('ledger', localId, newId); + _db.execute('COMMIT'); + } catch (_) { + _db.execute('ROLLBACK'); + rethrow; + } + } + + void remapCategory(int localId, Map remote) { + final newId = (remote['id'] as num).toInt(); + _db.execute('BEGIN'); + try { + _db.execute( + ''' + INSERT OR REPLACE INTO categories + (id, name, icon_key, color_key, type, sort_order, is_custom, is_deleted, updated_at) + SELECT ?, ?, ?, ?, type, sort_order, 1, 0, ? + FROM categories WHERE id = ? + ''', + [ + newId, + remote['name'], + remote['iconKey'] ?? 'tag', + remote['colorKey'] ?? 'mint', + DateTime.now().toUtc().toIso8601String(), + localId, + ], + ); + _db.execute( + 'UPDATE transactions SET category_id = ? WHERE category_id = ?', + [newId, localId], + ); + _db.execute( + 'UPDATE budgets SET category_key = ? WHERE category_key = ?', + [newId, localId], + ); + _db.execute('DELETE FROM categories WHERE id = ?', [localId]); + _saveIdMap('category', localId, newId); + _db.execute('COMMIT'); + } catch (_) { + _db.execute('ROLLBACK'); + rethrow; + } + } + + void _saveIdMap(String entityType, int localId, int remoteId) { + _db.execute( + ''' + INSERT INTO local_id_map (entity_type, local_id, remote_id) + VALUES (?, ?, ?) + ON CONFLICT(entity_type, local_id) DO UPDATE SET remote_id = excluded.remote_id + ''', + [entityType, localId, remoteId], + ); + } + + List> pendingSync() => _db + .select('SELECT * FROM sync_queue ORDER BY id') + .map( + (row) => { + 'id': (row['id'] as num).toInt(), + 'entityType': row['entity_type'] as String, + 'entityId': (row['entity_id'] as num).toInt(), + 'operation': row['operation'] as String, + 'payload': + jsonDecode(row['payload'] as String) as Map, + 'retryCount': (row['retry_count'] as num).toInt(), + }, + ) + .toList(); + + void completeSync(int queueId) { + _db.execute('DELETE FROM sync_queue WHERE id = ?', [queueId]); + } + + void failSync(int queueId) { + _db.execute( + 'UPDATE sync_queue SET retry_count = retry_count + 1 WHERE id = ?', + [queueId], + ); + } + + void addConflict( + String entityType, + int entityId, + String operation, + Map local, + Map remote, + ) { + _db.execute( + ''' + INSERT INTO sync_conflicts + (entity_type, entity_id, operation, local_payload, remote_payload, created_at) + VALUES (?, ?, ?, ?, ?, ?) + ''', + [ + entityType, + entityId, + operation, + jsonEncode(local), + jsonEncode(remote), + DateTime.now().toUtc().toIso8601String(), + ], + ); + } + + List> conflicts() => _db + .select( + 'SELECT * FROM sync_conflicts WHERE resolved_at IS NULL ORDER BY id DESC', + ) + .map( + (row) => { + 'id': (row['id'] as num).toInt(), + 'entityType': row['entity_type'] as String, + 'entityId': (row['entity_id'] as num).toInt(), + 'operation': row['operation'] as String, + 'local': + jsonDecode(row['local_payload'] as String) + as Map, + 'remote': + jsonDecode(row['remote_payload'] as String) + as Map, + 'createdAt': row['created_at'] as String, + }, + ) + .toList(); + + void resolveConflict(int id) { + _db.execute('UPDATE sync_conflicts SET resolved_at = ? WHERE id = ?', [ + DateTime.now().toUtc().toIso8601String(), + id, + ]); + } + + Map createTransaction(Map value) { + final clientRequestId = value['clientRequestId'] as String?; + if (clientRequestId != null && clientRequestId.isNotEmpty) { + final existing = _db.select( + 'SELECT id FROM transactions WHERE client_request_id = ? LIMIT 1', + [clientRequestId], + ); + if (existing.isNotEmpty) { + return transaction( + (existing.first['id'] as num).toInt(), + includeDeleted: true, + )!; + } + } + final categoryId = (value['categoryId'] as num).toInt(); + final category = _db.select( + 'SELECT * FROM categories WHERE id = ? AND is_deleted = 0', + [categoryId], + ); + if (category.isEmpty || category.first['type'] != value['type']) { + throw StateError('分类与收支类型不一致'); + } + final id = _nextNegativeId('transactions'); + final now = DateTime.now().toUtc().toIso8601String(); + final occurredAt = (value['occurredAt'] as String?) ?? now; + _db.execute( + ''' + INSERT INTO transactions + (id, ledger_id, category_id, type, amount, note, payment_method, + source, source_text, client_request_id, occurred_at, is_deleted, sync_state, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, 'local', ?) + ''', + [ + id, + value['ledgerId'] ?? 1, + categoryId, + value['type'], + value['amount'], + value['note'], + value['paymentMethod'], + value['source'] ?? 'manual', + value['sourceText'], + clientRequestId, + occurredAt, + now, + ], + ); + return transaction(id, includeDeleted: true)!; + } + + Map? transaction(int id, {bool includeDeleted = false}) { + final rows = _db.select( + ''' + SELECT t.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM transactions t JOIN categories c ON c.id = t.category_id + WHERE t.id = ? ${includeDeleted ? '' : 'AND t.is_deleted = 0'} + ''', + [id], + ); + return rows.isEmpty ? null : _transactionMap(rows.first); + } + + Map updateTransaction(int id, Map value) { + final category = _db.select( + 'SELECT type FROM categories WHERE id = ? AND is_deleted = 0', + [value['categoryId']], + ); + if (category.isEmpty || category.first['type'] != value['type']) { + throw StateError('分类与收支类型不一致'); + } + _db.execute( + ''' + UPDATE transactions SET ledger_id = ?, category_id = ?, type = ?, + amount = ?, note = ?, payment_method = ?, occurred_at = ?, + sync_state = 'local', updated_at = ? WHERE id = ? + ''', + [ + value['ledgerId'], + value['categoryId'], + value['type'], + value['amount'], + value['note'], + value['paymentMethod'], + value['occurredAt'], + DateTime.now().toUtc().toIso8601String(), + id, + ], + ); + return transaction(id, includeDeleted: true)!; + } + + void softDeleteTransaction(int id) { + final now = DateTime.now().toUtc().toIso8601String(); + _db.execute( + ''' + UPDATE transactions SET is_deleted = 1, deleted_at = ?, + sync_state = 'local', updated_at = ? WHERE id = ? + ''', + [now, now, id], + ); + } + + Map restoreTransaction(int id) { + _db.execute( + ''' + UPDATE transactions SET is_deleted = 0, deleted_at = NULL, + sync_state = 'local', updated_at = ? WHERE id = ? + ''', + [DateTime.now().toUtc().toIso8601String(), id], + ); + return transaction(id, includeDeleted: true)!; + } + + void permanentlyDeleteTransaction(int id) { + _db.execute('DELETE FROM transactions WHERE id = ? AND is_deleted = 1', [ + id, + ]); + } + + void clearRecycleBin(int ledgerId) { + _db.execute( + 'DELETE FROM transactions WHERE ledger_id = ? AND is_deleted = 1', + [ledgerId], + ); + } + + List> recycleBin(int ledgerId) => _db + .select( + ''' + SELECT t.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM transactions t JOIN categories c ON c.id = t.category_id + WHERE t.ledger_id = ? AND t.is_deleted = 1 + ORDER BY t.deleted_at DESC, t.id DESC + ''', + [ledgerId], + ) + .map(_transactionMap) + .toList(); + + Map monthSummary(int year, int month, int ledgerId) { + final range = ShanghaiTime.monthRangeUtc(year, month); + final start = range.start; + final end = range.end; + final items = _transactionsBetween(ledgerId, start, end); + final groups = >>{}; + for (final item in items) { + final occurredAt = ShanghaiTime.parseCivil(item['occurredAt'] as String); + final date = DateTime(occurredAt.year, occurredAt.month, occurredAt.day); + groups.putIfAbsent(date, () => []).add(item); + } + final days = groups.entries.toList() + ..sort((a, b) => b.key.compareTo(a.key)); + final income = _sumType(items, 'income'); + final expense = _sumType(items, 'expense'); + return { + 'year': year, + 'month': month, + 'income': income, + 'expense': expense, + 'balance': income - expense, + 'count': items.length, + 'days': days + .map( + (entry) => { + 'date': entry.key.toIso8601String(), + 'expense': _sumType(entry.value, 'expense'), + 'income': _sumType(entry.value, 'income'), + 'items': entry.value, + }, + ) + .toList(), + }; + } + + Map periodStats( + String period, + DateTime anchor, + int ledgerId, + ) { + late DateTime start; + late DateTime end; + late String label; + if (period == 'week') { + final offset = (anchor.weekday - DateTime.monday) % 7; + start = DateTime( + anchor.year, + anchor.month, + anchor.day, + ).subtract(Duration(days: offset)); + end = start.add(const Duration(days: 7)); + label = + '${_monthDay(start)} - ${_monthDay(end.subtract(const Duration(days: 1)))}'; + } else if (period == 'year') { + start = DateTime(anchor.year, 1, 1); + end = DateTime(anchor.year + 1, 1, 1); + label = '${anchor.year}年'; + } else { + start = DateTime(anchor.year, anchor.month, 1); + end = DateTime(anchor.year, anchor.month + 1, 1); + label = '${anchor.year}年${anchor.month}月'; + } + final items = _transactionsBetween( + ledgerId, + ShanghaiTime.civilToUtc(start), + ShanghaiTime.civilToUtc(end), + ); + final expenses = items.where((item) => item['type'] == 'expense').toList(); + final expense = _sumType(items, 'expense'); + final income = _sumType(items, 'income'); + final categories = >{}; + for (final item in expenses) { + final categoryId = item['categoryId'] as int; + final aggregate = categories.putIfAbsent( + categoryId, + () => { + 'categoryId': categoryId, + 'name': item['categoryName'], + 'iconKey': item['categoryIcon'], + 'colorKey': item['categoryColor'], + 'amount': 0.0, + }, + ); + aggregate['amount'] = + (aggregate['amount'] as double) + (item['amount'] as num).toDouble(); + } + final byCategory = + categories.values.map((item) { + final amount = item['amount'] as double; + return { + ...item, + 'percent': expense == 0 ? 0.0 : amount / expense * 100, + }; + }).toList()..sort( + (a, b) => (b['amount'] as double).compareTo(a['amount'] as double), + ); + final trend = >[]; + if (period == 'year') { + for (var month = 1; month <= 12; month++) { + final pointItems = items + .where( + (item) => + ShanghaiTime.parseCivil(item['occurredAt'] as String).month == + month, + ) + .toList(); + trend.add({ + 'label': '$month月', + 'date': DateTime(anchor.year, month, 1).toIso8601String(), + 'expense': _sumType(pointItems, 'expense'), + 'income': _sumType(pointItems, 'income'), + }); + } + } else { + final dayCount = end.difference(start).inDays; + const weekLabels = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']; + for (var index = 0; index < dayCount; index++) { + final date = start.add(Duration(days: index)); + final pointItems = items.where((item) { + final local = ShanghaiTime.parseCivil(item['occurredAt'] as String); + return local.year == date.year && + local.month == date.month && + local.day == date.day; + }).toList(); + trend.add({ + 'label': period == 'week' ? weekLabels[index] : '${date.day}日', + 'date': date.toIso8601String(), + 'expense': _sumType(pointItems, 'expense'), + 'income': _sumType(pointItems, 'income'), + }); + } + } + final top = byCategory.isEmpty ? null : byCategory.first; + return { + 'periodType': period, + 'periodLabel': label, + 'startDate': start.toIso8601String(), + 'endDate': end.toIso8601String(), + 'totalExpense': expense, + 'totalIncome': income, + 'balance': income - expense, + 'count': items.length, + 'byCategory': byCategory, + 'trend': trend, + 'analysis': top == null + ? '这个周期还没有支出记录' + : '${top['name']}支出最多,共 ¥${(top['amount'] as double).toStringAsFixed(0)}', + }; + } + + Map periodReport( + String period, + DateTime anchor, + int ledgerId, + ) { + final stats = periodStats(period, anchor, ledgerId); + final start = DateTime.parse(stats['startDate'] as String); + final end = DateTime.parse(stats['endDate'] as String); + final items = _transactionsBetween( + ledgerId, + ShanghaiTime.civilToUtc(start), + ShanghaiTime.civilToUtc(end), + ); + final expenses = items.where((item) => item['type'] == 'expense').toList(); + final grouped = >>{}; + for (final item in expenses) { + final local = ShanghaiTime.parseCivil(item['occurredAt'] as String); + final key = period == 'year' + ? DateTime(local.year, local.month) + : DateTime(local.year, local.month, local.day); + grouped.putIfAbsent(key, () => []).add(item); + } + final peaks = grouped.entries.toList() + ..sort( + (a, b) => _sumType( + b.value, + 'expense', + ).compareTo(_sumType(a.value, 'expense')), + ); + final peak = peaks.isEmpty ? null : peaks.first; + final ranking = (stats['byCategory'] as List).map((item) { + final category = item as Map; + return { + 'name': category['name'], + 'iconKey': category['iconKey'], + 'colorKey': category['colorKey'], + 'amount': category['amount'], + 'percent': category['percent'], + }; + }).toList(); + final top = ranking.isEmpty ? null : ranking.first; + const aiSources = { + 'ai_chat', + 'voice', + 'ocr', + 'screenshot', + 'recognition_ai', + }; + final aiCount = items + .where((item) => aiSources.contains(item['source'])) + .length; + return { + 'periodType': period == 'month' ? 'monthly' : '${period}ly', + 'periodLabel': stats['periodLabel'], + 'startDate': stats['startDate'], + 'endDate': stats['endDate'], + 'income': stats['totalIncome'], + 'expense': stats['totalExpense'], + 'balance': stats['balance'], + 'count': stats['count'], + 'aiRatio': items.isEmpty ? 0.0 : aiCount / items.length * 100, + 'peakLabel': peak == null + ? null + : period == 'year' + ? '${peak.key.month}月' + : '${peak.key.month}月${peak.key.day}日', + 'peakAmount': peak == null ? 0.0 : _sumType(peak.value, 'expense'), + 'peakNote': peak?.value.first['note'], + 'topCategory': top?['name'], + 'topCategoryAmount': top?['amount'] ?? 0.0, + 'topCategoryPercent': top?['percent'] ?? 0.0, + 'categoryRanking': ranking, + 'commentary': stats['analysis'] ?? '本地统计已生成', + }; + } + + List> searchTransactions({ + required int ledgerId, + String? query, + bool aiOnly = false, + int? categoryId, + String? type, + double? minAmount, + double? maxAmount, + DateTime? from, + DateTime? to, + DateTime? beforeOccurredAt, + int? beforeId, + int limit = 50, + }) { + final values = _db + .select( + ''' + SELECT t.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM transactions t JOIN categories c ON c.id = t.category_id + WHERE t.ledger_id = ? AND t.is_deleted = 0 + ORDER BY t.occurred_at DESC, t.id DESC + ''', + [ledgerId], + ) + .map(_transactionMap) + .where((item) { + final occurredAt = DateTime.parse(item['occurredAt'] as String); + final amount = (item['amount'] as num).toDouble(); + final keyword = query?.trim().toLowerCase(); + if (keyword != null && keyword.isNotEmpty) { + final haystack = + '${item['note'] ?? ''} ${item['categoryName']} ${item['sourceText'] ?? ''}' + .toLowerCase(); + if (!haystack.contains(keyword)) return false; + } + if (aiOnly && item['source'] == 'manual') return false; + if (categoryId != null && item['categoryId'] != categoryId) + return false; + if (type != null && item['type'] != type) return false; + if (minAmount != null && amount < minAmount) return false; + if (maxAmount != null && amount > maxAmount) return false; + if (from != null && + occurredAt.isBefore(ShanghaiTime.civilToUtc(from))) { + return false; + } + if (to != null && !occurredAt.isBefore(ShanghaiTime.civilToUtc(to))) { + return false; + } + if (beforeOccurredAt != null) { + final cursor = ShanghaiTime.civilToUtc(beforeOccurredAt); + if (occurredAt.isAfter(cursor)) return false; + if (occurredAt.isAtSameMomentAs(cursor) && + beforeId != null && + (item['id'] as int) >= beforeId) { + return false; + } + } + return true; + }) + .take(limit) + .toList(); + return values; + } + + Map budgets(int year, int month, int ledgerId) { + final period = year * 100 + month; + final rows = _db.select( + ''' + SELECT b.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM budgets b LEFT JOIN categories c ON c.id = b.category_key + WHERE b.ledger_id = ? AND b.period IN (0, ?) + ORDER BY b.period DESC + ''', + [ledgerId, period], + ); + final chosen = {}; + for (final row in rows) { + chosen.putIfAbsent((row['category_key'] as num).toInt(), () => row); + } + final monthItems = _transactionsBetween( + ledgerId, + ShanghaiTime.monthRangeUtc(year, month).start, + ShanghaiTime.monthRangeUtc(year, month).end, + ); + Map mapBudget(Row row) { + final categoryKey = (row['category_key'] as num).toInt(); + final spent = monthItems + .where( + (item) => + item['type'] == 'expense' && + (categoryKey == 0 || item['categoryId'] == categoryKey), + ) + .fold( + 0, + (sum, item) => sum + (item['amount'] as num).toDouble(), + ); + return { + 'categoryId': categoryKey == 0 ? null : categoryKey, + 'categoryName': row['category_name'], + 'categoryIcon': row['category_icon'], + 'categoryColor': row['category_color'] ?? 'mint', + 'amount': (row['amount'] as num).toDouble(), + 'spent': spent, + 'isRecurring': (row['is_recurring'] as num).toInt() == 1, + }; + } + + final total = chosen.remove(0); + final categoryRows = chosen.values.map(mapBudget).toList(); + return { + 'year': year, + 'month': month, + 'total': total == null ? null : mapBudget(total), + 'categories': categoryRows, + }; + } + + void upsertBudget( + int year, + int month, + int ledgerId, + int? categoryId, + double amount, + bool recurring, + ) { + final period = recurring ? 0 : year * 100 + month; + final categoryKey = categoryId ?? 0; + if (amount <= 0) { + _db.execute( + 'DELETE FROM budgets WHERE ledger_id = ? AND period = ? AND category_key = ?', + [ledgerId, period, categoryKey], + ); + return; + } + _db.execute( + ''' + INSERT INTO budgets + (ledger_id, period, category_key, amount, is_recurring, updated_at) + VALUES (?, ?, ?, ?, ?, ?) + ON CONFLICT(ledger_id, period, category_key) DO UPDATE SET + amount = excluded.amount, + is_recurring = excluded.is_recurring, + updated_at = excluded.updated_at + ''', + [ + ledgerId, + period, + categoryKey, + amount, + recurring ? 1 : 0, + DateTime.now().toUtc().toIso8601String(), + ], + ); + } + + void applyBudgets( + int year, + int month, + int ledgerId, + bool recurring, + Map values, + ) { + _db.execute('BEGIN'); + try { + for (final entry in values.entries) { + upsertBudget(year, month, ledgerId, entry.key, entry.value, recurring); + } + _db.execute('COMMIT'); + } catch (_) { + _db.execute('ROLLBACK'); + rethrow; + } + } + + List> _transactionsBetween( + int ledgerId, + DateTime start, + DateTime end, + ) => _db + .select( + ''' + SELECT t.*, c.name AS category_name, c.icon_key AS category_icon, + c.color_key AS category_color + FROM transactions t JOIN categories c ON c.id = t.category_id + WHERE t.ledger_id = ? AND t.is_deleted = 0 + AND t.occurred_at >= ? AND t.occurred_at < ? + ORDER BY t.occurred_at DESC, t.id DESC + ''', + [ + start.toIso8601String(), + end.toIso8601String(), + ].insertAtStart(ledgerId), + ) + .map(_transactionMap) + .toList(); + + int _nextNegativeId(String table) { + final value = + _db.select('SELECT MIN(id) AS value FROM $table').first['value'] + as num?; + final minimum = value?.toInt() ?? 0; + return minimum <= 0 ? minimum - 1 : -1; + } + + Map _categoryMap(Row row) => { + 'id': (row['id'] as num).toInt(), + 'name': row['name'] as String, + 'iconKey': row['icon_key'] as String, + 'colorKey': row['color_key'] as String? ?? 'mint', + 'type': row['type'] as String, + 'sortOrder': (row['sort_order'] as num).toInt(), + 'isCustom': (row['is_custom'] as num).toInt() == 1, + }; + + Map _transactionMap(Row row) => { + 'id': (row['id'] as num).toInt(), + 'ledgerId': (row['ledger_id'] as num).toInt(), + 'categoryId': (row['category_id'] as num).toInt(), + 'categoryName': row['category_name'] as String, + 'categoryIcon': row['category_icon'] as String, + 'categoryColor': row['category_color'] as String? ?? 'mint', + 'type': row['type'] as String, + 'amount': (row['amount'] as num).toDouble(), + 'note': row['note'] as String?, + 'paymentMethod': row['payment_method'] as String?, + 'source': row['source'] as String, + 'sourceText': row['source_text'] as String?, + 'clientRequestId': row['client_request_id'] as String?, + 'occurredAt': row['occurred_at'] as String, + 'isDeleted': (row['is_deleted'] as num).toInt() == 1, + 'updatedAt': row['updated_at'] as String, + }; + + double _sumType(List> items, String type) => items + .where((item) => item['type'] == type) + .fold(0, (sum, item) => sum + (item['amount'] as num).toDouble()); + + String _monthDay(DateTime date) => + '${date.month.toString().padLeft(2, '0')}月${date.day.toString().padLeft(2, '0')}日'; +} + +extension _ParameterList on List { + List insertAtStart(Object? value) => [value, ...this]; +} diff --git a/frontend/lib/shared/services/local_export_service.dart b/frontend/lib/shared/services/local_export_service.dart new file mode 100644 index 0000000..602f8d2 --- /dev/null +++ b/frontend/lib/shared/services/local_export_service.dart @@ -0,0 +1,130 @@ +import 'dart:convert'; + +import 'package:archive/archive.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +class LocalExportService { + const LocalExportService._(); + + static List buildZip() { + final snapshot = LocalDatabase.instance.exportSnapshot(); + final session = SessionStore.instance; + return buildZipFromSnapshot( + snapshot, + profile: { + 'mode': session.isGuest ? 'guest' : 'account', + 'userId': session.userId, + 'username': session.username, + 'nickname': session.nickname, + }, + ); + } + + static List buildZipFromSnapshot( + Map snapshot, { + Map profile = const {}, + }) { + final document = {...snapshot, 'profile': profile}; + final ledgers = _indexById(snapshot['ledgers'] as List); + final categories = _indexById(snapshot['categories'] as List); + final transactions = (snapshot['transactions'] as List) + .cast>(); + final budgets = (snapshot['budgets'] as List) + .cast>(); + + final archive = Archive(); + archive.addFile( + ArchiveFile.bytes( + 'transactions.csv', + _utf8Bom( + _csv([ + const [ + 'id', + 'ledger', + 'type', + 'amount', + 'category', + 'note', + 'payment_method', + 'source', + 'occurred_at', + 'is_deleted', + 'updated_at', + ], + for (final item in transactions) + [ + item['id'], + ledgers[item['ledgerId']]?['name'], + item['type'], + (item['amount'] as num).toStringAsFixed(2), + item['categoryName'], + item['note'], + item['paymentMethod'], + item['source'], + item['occurredAt'], + item['isDeleted'], + item['updatedAt'], + ], + ]), + ), + ), + ); + archive.addFile( + ArchiveFile.bytes( + 'budgets.csv', + _utf8Bom( + _csv([ + const [ + 'ledger', + 'period', + 'category', + 'amount', + 'recurring', + 'updated_at', + ], + for (final item in budgets) + [ + ledgers[item['ledgerId']]?['name'], + item['period'], + item['categoryId'] == null + ? 'total' + : categories[item['categoryId']]?['name'], + (item['amount'] as num).toStringAsFixed(2), + item['recurring'], + item['updatedAt'], + ], + ]), + ), + ), + ); + archive.addFile( + ArchiveFile.string( + 'jizhi-backup.json', + const JsonEncoder.withIndent(' ').convert(document), + ), + ); + return ZipEncoder().encode(archive); + } + + static Map> _indexById(List items) => { + for (final item in items.cast>()) + item['id'] as int: item, + }; + + static List _utf8Bom(String value) => [ + 0xef, + 0xbb, + 0xbf, + ...utf8.encode(value), + ]; + + static String _csv(List> rows) => + rows.map((row) => row.map(_csvCell).join(',')).join('\r\n'); + + static String _csvCell(Object? value) { + final text = value?.toString() ?? ''; + if (!text.contains(RegExp('[,"\r\n]'))) return text; + return '"${text.replaceAll('"', '""')}"'; + } +} diff --git a/frontend/lib/shared/services/recognition_diagnostic_formatter.dart b/frontend/lib/shared/services/recognition_diagnostic_formatter.dart new file mode 100644 index 0000000..d6ee682 --- /dev/null +++ b/frontend/lib/shared/services/recognition_diagnostic_formatter.dart @@ -0,0 +1,176 @@ +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; + +class RecognitionDiagnosticDisplay { + final String stageLabel; + final String resultLabel; + final String summaryLabel; + final String reasonLabel; + final String? recognitionKindLabel; + final String? amountSourceLabel; + final String? statusStrengthLabel; + final bool statusStrengthPositive; + + const RecognitionDiagnosticDisplay({ + required this.stageLabel, + required this.resultLabel, + required this.summaryLabel, + required this.reasonLabel, + this.recognitionKindLabel, + this.amountSourceLabel, + this.statusStrengthLabel, + this.statusStrengthPositive = false, + }); + + factory RecognitionDiagnosticDisplay.from(RecognitionDiagnostic diagnostic) { + final reason = diagnostic.reason; + return RecognitionDiagnosticDisplay( + stageLabel: _stageLabel(diagnostic.stage), + resultLabel: _resultLabel(diagnostic.result), + summaryLabel: _summaryLabel(diagnostic.result, reason), + reasonLabel: _reasonLabel(reason), + recognitionKindLabel: _recognitionKindLabel(diagnostic.recognitionKind), + amountSourceLabel: _amountSourceLabel(diagnostic.amountSource), + statusStrengthLabel: _statusStrengthLabel(diagnostic.statusStrength), + statusStrengthPositive: diagnostic.statusStrength == 'strong', + ); + } + + static String _stageLabel(String value) { + return switch (value) { + 'capture' => '本地截屏', + 'ocr' => '本地 OCR', + 'tree' => '控件树识别', + _ => '无障碍事件', + }; + } + + static String _resultLabel(String value) { + return switch (value) { + 'matched' || 'auto_ready' => '已识别', + 'confirm' => '待确认', + 'started' => '处理中', + 'failed' => '失败', + _ => '未触发入账', + }; + } + + static String _summaryLabel(String result, String reason) { + if (reason == 'duplicate_result_surface') return '已合并'; + if (_captureFailureReasons.contains(reason)) return '截图失败'; + if (_ocrNoResultReasons.contains(reason)) return 'OCR 无结果'; + if (_ruleRejectedReasons.contains(reason) || result == 'rejected') { + return '规则拒绝'; + } + return switch (result) { + 'matched' || 'auto_ready' => '已识别', + 'confirm' => '待确认', + 'started' => '处理中', + 'failed' => '失败', + _ => '没事件', + }; + } + + static String _reasonLabel(String reason) { + return switch (reason) { + 'history_page' => '当前是账单或交易历史页', + 'blocked_status' => '当前状态为失败、处理中或已取消', + 'no_text' => '截图中没有识别到文字', + 'no_success_status' => '没有找到明确或弱完成状态,可开启诊断预览查看脱敏结果', + 'payment_input_page' => '当前仍是付款输入或确认页面,已拒绝入账', + 'direction_unknown' => '识别到完成状态,但无法确认收支方向', + 'missing_amount' => '成功状态已识别,但没有找到金额', + 'expected_amount_missing' => '结果页没有金额,且付款前金额不唯一或未捕获', + 'expected_amount_fallback' => '结果页金额缺失,已使用付款前确认的唯一金额', + 'red_packet_not_settled' => '红包尚未明确到账或退回,不会自动入账', + 'duplicate_result_surface' => '同一结果页已处理,本次刷新已忽略', + 'weak_status_confirm' => '只识别到弱完成状态,组合证据不足,需确认后入账', + 'combined_high_confidence' => '弱完成状态已通过流程、跳转和金额组合校验', + 'ambiguous_or_unarmed' => '金额存在歧义或未捕获到完整支付流程', + 'secure_window' => '当前页面被系统禁止截屏', + 'window_fallback' => '单窗口截图失败,正在切换整屏截图', + 'invalid_window' => '支付页面窗口已切换,单窗口截图已失效', + 'internal_error' => '系统单窗口截图失败,请停留在成功页重试', + 'display_capture_start_failed' => '整屏截图请求无法启动', + 'invalid_display' => '当前屏幕暂时无法截取', + 'capture_timeout' => '系统截屏长时间没有返回结果,已自动结束', + 'capture_start_failed' => '系统截屏请求无法启动', + 'ocr_timeout' => '本地 OCR 超时,已自动结束,可在支付成功页重试', + 'ocr_start_failed' => '本地 OCR 请求无法启动', + 'ocr_init_failed' => '本地 OCR 组件初始化失败,请重新开启无障碍服务', + 'ocr_model_unavailable' => '本地中文识别模型不可用,请重新安装内测包', + 'ocr_unavailable' => '本地 OCR 服务暂不可用,请稍后重试', + 'ocr_failed' => '本地 OCR 识别失败,请停留在支付成功页重试', + 'ocr_parse_failed' => '本地 OCR 结果处理失败', + 'operation_interrupted' => '识别进程曾被系统中断,任务已自动结束', + 'interval_short' => '系统限制了过于频繁的截屏', + 'accessibility_unavailable' => '无障碍截屏能力暂不可用', + 'image_encode_failed' => '截图结果编码失败,请重试', + 'success' || 'high_confidence' => '成功状态和金额均已确认', + _ => reason.isEmpty ? '等待新的支付事件' : reason, + }; + } + + static String? _recognitionKindLabel(String? value) { + return switch (value) { + 'payment' => '扫码支付', + 'transfer' => '转账', + 'red_packet_send' => '发出红包', + 'red_packet_receive' => '红包到账', + 'red_packet_refund' => '红包退回', + _ => null, + }; + } + + static String? _amountSourceLabel(String? value) { + return switch (value) { + 'expected' => '使用付款前金额', + 'result' => '使用结果页金额', + _ => null, + }; + } + + static String? _statusStrengthLabel(String value) { + return switch (value) { + 'strong' => '明确成功状态', + 'weak' => '弱完成状态', + _ => null, + }; + } + + static const _captureFailureReasons = { + 'secure_window', + 'invalid_window', + 'internal_error', + 'display_capture_start_failed', + 'invalid_display', + 'capture_timeout', + 'capture_start_failed', + 'interval_short', + 'accessibility_unavailable', + 'image_encode_failed', + }; + + static const _ocrNoResultReasons = { + 'no_text', + 'ocr_timeout', + 'ocr_start_failed', + 'ocr_init_failed', + 'ocr_model_unavailable', + 'ocr_unavailable', + 'ocr_failed', + 'ocr_parse_failed', + }; + + static const _ruleRejectedReasons = { + 'history_page', + 'blocked_status', + 'no_success_status', + 'payment_input_page', + 'direction_unknown', + 'missing_amount', + 'expected_amount_missing', + 'red_packet_not_settled', + 'weak_status_confirm', + 'ambiguous_or_unarmed', + }; +} diff --git a/frontend/lib/shared/services/recognition_import_service.dart b/frontend/lib/shared/services/recognition_import_service.dart new file mode 100644 index 0000000..ff3a995 --- /dev/null +++ b/frontend/lib/shared/services/recognition_import_service.dart @@ -0,0 +1,286 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/features/home/pages/transaction_edit_page.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:miaoji_zhang/shared/services/transaction_events.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +class RecognitionImportService { + RecognitionImportService._(); + + static bool _processing = false; + + static Future configureNativeContext() async { + final session = SessionStore.instance; + await ScreenshotChannel.configureRecognitionContext( + hasAccount: session.isAccount, + aiAllowed: session.aiEnabled, + baseUrl: ApiClient.baseUrl, + token: session.isAccount ? await ApiClient.instance.readToken() : null, + ); + } + + static Future importAutomatic() async { + if (_processing || !SessionStore.instance.hasSession) return; + _processing = true; + try { + await CurrentLedgerStore.instance.ensureLoaded(); + final candidates = await ScreenshotChannel.drainRecognitionCandidates(); + for (final candidate in candidates.where((item) => item.canAutoImport)) { + await _import(candidate); + } + } finally { + _processing = false; + } + } + + static Future handleAction( + BuildContext context, + Map action, + ) async { + final kind = action['action']?.toString(); + if (kind == 'ready') { + await importAutomatic(); + return; + } + if (kind == 'recognition_undo') { + final transactionId = (action['transactionId'] as num?)?.toInt(); + final candidateId = action['candidateId']?.toString(); + if (transactionId == null || candidateId == null) return; + try { + await TxApi.delete(transactionId); + await ScreenshotChannel.acknowledgeRecognitionCandidate( + candidateId, + 'undone', + ); + TransactionEvents.notifyChanged(); + if (context.mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('已撤销这笔智能识别账单'))); + } + } catch (error) { + if (context.mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } + return; + } + if (kind == 'recognition_edit') { + final transactionId = (action['transactionId'] as num?)?.toInt(); + final cached = transactionId == null + ? null + : LocalDatabase.instance.transaction(transactionId); + if (!context.mounted) return; + if (cached == null) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('这笔账单尚未同步到本机,请稍后重试'))); + return; + } + final updated = await Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => + TransactionEditPage(transaction: TxItem.fromJson(cached)), + ), + ); + if (updated != null) TransactionEvents.notifyChanged(); + return; + } + if (kind != 'recognition_confirm' || !context.mounted) return; + + await CurrentLedgerStore.instance.ensureLoaded(); + final candidates = await ScreenshotChannel.drainRecognitionCandidates(); + if (!context.mounted) return; + final requestedId = action['candidateId']?.toString(); + final candidate = candidates.where((item) { + return item.state == 'pending_confirm' && + (requestedId == null || item.id == requestedId); + }).firstOrNull; + if (candidate == null) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('这条识别结果已处理或已过期'))); + return; + } + final confirmed = await _showConfirmation(context, candidate); + if (confirmed != true) return; + try { + await _import(candidate); + if (context.mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('识别结果已入账'))); + } + } catch (error) { + if (context.mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(apiErrorMessage(error)))); + } + } + } + + static Future _import(RecognitionCandidate candidate) async { + if (candidate.type != 'income' && candidate.type != 'expense') { + throw StateError('识别结果缺少明确的收支类型'); + } + final categories = await TxApi.categories(candidate.type); + if (categories.isEmpty) throw StateError('当前账本没有可用分类'); + final category = + categories + .where((item) => item.name == candidate.categoryHint) + .firstOrNull ?? + categories.where((item) => item.name == '其他').firstOrNull ?? + categories.first; + final occurredUtc = validOccurredAtUtc(candidate.occurredAtEpochMs); + final transaction = await TxApi.create( + categoryId: category.id, + type: candidate.type, + amount: candidate.amount, + note: candidate.merchant?.trim().isNotEmpty == true + ? candidate.merchant!.trim() + : (candidate.note ?? '智能识别'), + paymentMethod: candidate.appName, + source: candidate.source, + sourceText: candidate.sourceText, + occurredAt: ShanghaiTime.toCivil(occurredUtc), + clientRequestId: candidate.clientRequestId, + ); + await ScreenshotChannel.acknowledgeRecognitionCandidate( + candidate.id, + 'imported', + transactionId: transaction.id, + ); + TransactionEvents.notifyChanged(); + return transaction; + } + + static DateTime validOccurredAtUtc(int epochMs, {DateTime? now}) { + final current = (now ?? DateTime.now()).toUtc(); + final parsed = DateTime.fromMillisecondsSinceEpoch(epochMs, isUtc: true); + final oldest = current.subtract(const Duration(days: 1)); + final newest = current.add(const Duration(minutes: 5)); + return parsed.isBefore(oldest) || parsed.isAfter(newest) ? current : parsed; + } + + static Future _showConfirmation( + BuildContext context, + RecognitionCandidate candidate, + ) { + final palette = context.jz; + return showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (sheetContext) => SafeArea( + child: Container( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 20), + decoration: BoxDecoration( + color: palette.card, + borderRadius: const BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const JzSheetHeader( + title: '确认识别结果', + subtitle: '信息来自本机解析,确认后才会写入账本', + ), + const SizedBox(height: 14), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: palette.background, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: palette.line), + ), + child: Row( + children: [ + Container( + width: 42, + height: 42, + decoration: BoxDecoration( + color: candidate.type == 'income' + ? palette.primaryBackground + : palette.expenseBackground, + borderRadius: BorderRadius.circular(13), + ), + child: Icon( + candidate.type == 'income' + ? Icons.south_west_rounded + : Icons.north_east_rounded, + color: candidate.type == 'income' + ? AppTheme.primary + : AppTheme.red, + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + candidate.merchant ?? candidate.appName, + style: TextStyle( + color: palette.text, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: 4), + Text( + '${candidate.appName} · ${candidate.type == 'income' ? '收入' : '支出'}', + style: TextStyle( + color: palette.text2, + fontSize: 12, + ), + ), + ], + ), + ), + Text( + '${candidate.type == 'income' ? '+' : '-'}¥${candidate.amount.toStringAsFixed(2)}', + style: TextStyle( + color: candidate.type == 'income' + ? AppTheme.primary + : AppTheme.red, + fontSize: 18, + fontWeight: FontWeight.w800, + ), + ), + ], + ), + ), + const SizedBox(height: 16), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '稍后处理', + secondary: true, + onPressed: () => Navigator.pop(sheetContext, false), + ), + ), + const SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: '确认入账', + onPressed: () => Navigator.pop(sheetContext, true), + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/frontend/lib/shared/services/screenshot_channel.dart b/frontend/lib/shared/services/screenshot_channel.dart new file mode 100644 index 0000000..2c3ceeb --- /dev/null +++ b/frontend/lib/shared/services/screenshot_channel.dart @@ -0,0 +1,481 @@ +import 'dart:convert'; + +import 'package:flutter/services.dart'; + +class RecognitionDiagnostic { + final DateTime at; + final String appName, stage, result, reason, statusStrength; + final String? recognitionKind, amountSource, resultFingerprint; + final int nodeCount, amountCandidates; + final int? ocrMs; + final bool? expectedAmountMatched, resultTransitionObserved; + final List ocrPreview; + final DateTime? previewExpiresAt; + + const RecognitionDiagnostic({ + required this.at, + required this.appName, + required this.stage, + required this.result, + required this.reason, + required this.nodeCount, + required this.amountCandidates, + this.ocrMs, + this.statusStrength = 'none', + this.recognitionKind, + this.amountSource, + this.resultFingerprint, + this.expectedAmountMatched, + this.resultTransitionObserved, + this.ocrPreview = const [], + this.previewExpiresAt, + }); + + factory RecognitionDiagnostic.fromJson(Map value) { + final epoch = (value['at'] as num?)?.toInt() ?? 0; + return RecognitionDiagnostic( + at: DateTime.fromMillisecondsSinceEpoch(epoch), + appName: value['appName']?.toString() ?? '支付应用', + stage: value['stage']?.toString() ?? 'event', + result: value['result']?.toString() ?? 'unknown', + reason: value['reason']?.toString() ?? '', + nodeCount: (value['nodeCount'] as num?)?.toInt() ?? 0, + amountCandidates: (value['amountCandidates'] as num?)?.toInt() ?? 0, + ocrMs: (value['ocrMs'] as num?)?.toInt(), + statusStrength: value['statusStrength']?.toString() ?? 'none', + recognitionKind: value['recognitionKind']?.toString(), + amountSource: value['amountSource']?.toString(), + resultFingerprint: value['resultFingerprint']?.toString(), + expectedAmountMatched: value['expectedAmountMatched'] as bool?, + resultTransitionObserved: value['resultTransitionObserved'] as bool?, + ocrPreview: + (value['ocrPreview'] as List?) + ?.map((item) => item.toString()) + .toList(growable: false) ?? + const [], + previewExpiresAt: (value['previewExpiresAt'] as num?) == null + ? null + : DateTime.fromMillisecondsSinceEpoch( + (value['previewExpiresAt'] as num).toInt(), + ), + ); + } +} + +class RecognitionStatus { + final bool accessibilityAuthorized; + final bool accessibilityConnected; + final bool notificationAuthorized; + final bool notificationConnected; + final bool postNotificationsGranted; + final bool accessibilityEvents; + final bool notificationEvents; + final bool aiScreenshot; + final bool ocrDiagnosticPreview; + final DateTime? ocrDiagnosticPreviewExpiresAt; + final bool batteryOptimizationIgnored; + final String manufacturer; + final String? latestStatus; + final RecognitionDiagnostic? latestDiagnostic; + + const RecognitionStatus({ + required this.accessibilityAuthorized, + required this.accessibilityConnected, + required this.notificationAuthorized, + required this.notificationConnected, + required this.postNotificationsGranted, + required this.accessibilityEvents, + required this.notificationEvents, + required this.aiScreenshot, + this.ocrDiagnosticPreview = false, + this.ocrDiagnosticPreviewExpiresAt, + this.batteryOptimizationIgnored = false, + this.manufacturer = '', + this.latestStatus, + this.latestDiagnostic, + }); + + factory RecognitionStatus.fromMap(Map value) { + final rawSettings = value['settings']?.toString(); + final rawDiagnostic = value['latestDiagnostic']?.toString(); + final settings = rawSettings == null || rawSettings.isEmpty + ? const {} + : jsonDecode(rawSettings) as Map; + return RecognitionStatus( + accessibilityAuthorized: + value['accessibilityAuthorized'] as bool? ?? false, + accessibilityConnected: value['accessibilityConnected'] as bool? ?? false, + notificationAuthorized: value['notificationAuthorized'] as bool? ?? false, + notificationConnected: value['notificationConnected'] as bool? ?? false, + postNotificationsGranted: + value['postNotificationsGranted'] as bool? ?? true, + accessibilityEvents: settings['accessibilityEvents'] as bool? ?? false, + notificationEvents: settings['notificationEvents'] as bool? ?? false, + aiScreenshot: settings['aiScreenshot'] as bool? ?? false, + ocrDiagnosticPreview: settings['ocrDiagnosticPreview'] as bool? ?? false, + ocrDiagnosticPreviewExpiresAt: + (settings['ocrDiagnosticPreviewExpiresAt'] as num?) == null + ? null + : DateTime.fromMillisecondsSinceEpoch( + (settings['ocrDiagnosticPreviewExpiresAt'] as num).toInt(), + ), + batteryOptimizationIgnored: + value['batteryOptimizationIgnored'] as bool? ?? false, + manufacturer: value['manufacturer']?.toString() ?? '', + latestStatus: value['latestStatus']?.toString(), + latestDiagnostic: rawDiagnostic == null || rawDiagnostic.isEmpty + ? null + : RecognitionDiagnostic.fromJson( + jsonDecode(rawDiagnostic) as Map, + ), + ); + } +} + +class RecognitionCandidate { + final String id, clientRequestId, state, confidence, type, source, appName; + final double amount; + final String? merchant, orderId, sourceText, note; + final String recognitionKind, amountSource; + final String? categoryHint, resultFingerprint; + final int occurredAtEpochMs; + + RecognitionCandidate.fromJson(Map value) + : id = value['id'] as String, + clientRequestId = value['clientRequestId'] as String, + state = value['state'] as String, + confidence = value['confidence'] as String, + type = value['type'] as String, + source = value['source'] as String, + appName = value['appName'] as String? ?? '支付应用', + amount = (value['amount'] as num).toDouble(), + merchant = value['merchant'] as String?, + orderId = value['orderId'] as String?, + sourceText = value['sourceText'] as String?, + note = value['note'] as String?, + recognitionKind = value['recognitionKind']?.toString() ?? 'payment', + categoryHint = value['categoryHint']?.toString(), + amountSource = value['amountSource']?.toString() ?? 'result', + resultFingerprint = value['resultFingerprint']?.toString(), + occurredAtEpochMs = (value['occurredAtEpochMs'] as num).toInt(); + + bool get canAutoImport => state == 'auto_ready' && confidence == 'auto'; +} + +class SpeechEvent { + final String type; + final String? text; + final double rms; + + const SpeechEvent({required this.type, this.text, this.rms = 0}); +} + +/// Android native capabilities for screenshots, AI progress and speech. +class ScreenshotChannel { + static const _channel = MethodChannel('com.miaoji/screenshot'); + static void Function(String path)? _screenshotReady; + static void Function(String error)? _screenshotError; + static void Function(SpeechEvent event)? _speechEvent; + static void Function(Map action)? _recognitionAction; + static bool _handlerInstalled = false; + + static Future cleanupStaleScreenshots() async { + try { + await _channel.invokeMethod('cleanupStaleScreenshots'); + } on PlatformException { + // Cleanup is best-effort and will run again on the next launch. + } on MissingPluginException { + // Screenshot storage is Android-only. + } + } + + static Future capture() async { + try { + return await _channel.invokeMethod('captureScreenshot'); + } on PlatformException catch (e) { + throw Exception(e.message ?? '截屏失败,请重试'); + } on MissingPluginException { + return null; + } + } + + static Future startAiProgress() async { + try { + await _channel.invokeMethod('startAiProgress'); + } on MissingPluginException { + // Non-Android platforms do not expose native progress notifications. + } + } + + static Future updateAiProgress(int count) async { + try { + await _channel.invokeMethod('updateAiProgress', {'count': count}); + } on MissingPluginException { + // Non-Android platforms do not expose native progress notifications. + } + } + + static Future finishAiProgress(int count, double total) async { + try { + await _channel.invokeMethod('finishAiProgress', { + 'count': count, + 'total': total, + }); + } on MissingPluginException { + // Non-Android platforms do not expose native progress notifications. + } + } + + static Future failAiProgress(String message) async { + try { + await _channel.invokeMethod('failAiProgress', {'message': message}); + } on MissingPluginException { + // Non-Android platforms do not expose native progress notifications. + } + } + + static Future recognizeSpeech() async { + try { + return await _channel.invokeMethod('recognizeSpeech'); + } on PlatformException catch (e) { + throw Exception(e.message ?? '语音识别不可用'); + } on MissingPluginException { + return null; + } + } + + static Future startSpeechRecognition( + void Function(SpeechEvent event) onEvent, + ) async { + _speechEvent = onEvent; + _installHandler(); + try { + await _channel.invokeMethod('startSpeechRecognition'); + } on PlatformException catch (e) { + _speechEvent = null; + throw Exception(e.message ?? '语音识别不可用'); + } on MissingPluginException { + _speechEvent = null; + throw Exception('当前设备不支持语音识别'); + } + } + + static Future stopSpeechRecognition() async { + try { + await _channel.invokeMethod('stopSpeechRecognition'); + } on MissingPluginException { + // No native recognizer to stop. + } + } + + static Future cancelSpeechRecognition() async { + _speechEvent = null; + try { + await _channel.invokeMethod('cancelSpeechRecognition'); + } on MissingPluginException { + // No native recognizer to cancel. + } + } + + static Future isAccessibilityEnabled() async { + try { + return await _channel.invokeMethod('isAccessibilityEnabled') ?? + false; + } on MissingPluginException { + return false; + } + } + + static Future openAccessibilitySettings() async { + try { + await _channel.invokeMethod('openAccessibilitySettings'); + } on MissingPluginException { + // Accessibility shortcut is Android-only. + } + } + + static Future openQuickSettings() async { + try { + await _channel.invokeMethod('openQuickSettings'); + } on MissingPluginException { + // Quick settings tiles are Android-only. + } + } + + static Future recognitionStatus() async { + try { + final raw = await _channel.invokeMethod>( + 'getRecognitionStatus', + ); + return RecognitionStatus.fromMap(raw ?? const {}); + } on MissingPluginException { + return const RecognitionStatus( + accessibilityAuthorized: false, + accessibilityConnected: false, + notificationAuthorized: false, + notificationConnected: false, + postNotificationsGranted: true, + accessibilityEvents: false, + notificationEvents: false, + aiScreenshot: false, + ); + } + } + + static Future clearRecognitionDiagnostic() async { + try { + return await _channel.invokeMethod('clearRecognitionDiagnostic') ?? + false; + } on MissingPluginException { + return false; + } + } + + static Future setRecognitionToggle(String key, bool enabled) async { + try { + return await _channel.invokeMethod('setRecognitionToggle', { + 'key': key, + 'enabled': enabled, + }) ?? + false; + } on MissingPluginException { + return false; + } + } + + static Future configureRecognitionContext({ + required bool hasAccount, + required bool aiAllowed, + required String baseUrl, + String? token, + }) async { + try { + await _channel.invokeMethod('configureRecognitionContext', { + 'hasAccount': hasAccount, + 'aiAllowed': aiAllowed, + 'baseUrl': baseUrl, + 'token': token, + }); + } on MissingPluginException { + // Native background recognition is Android-only. + } + } + + static Future> drainRecognitionCandidates() async { + try { + final values = + await _channel.invokeMethod>( + 'drainRecognitionCandidates', + ) ?? + const []; + return values + .whereType() + .map( + (value) => RecognitionCandidate.fromJson( + jsonDecode(value) as Map, + ), + ) + .toList(); + } on MissingPluginException { + return const []; + } + } + + static Future acknowledgeRecognitionCandidate( + String id, + String state, { + int? transactionId, + }) async { + try { + return await _channel.invokeMethod('ackRecognitionCandidate', { + 'id': id, + 'state': state, + if (transactionId != null) 'transactionId': transactionId, + }) ?? + false; + } on MissingPluginException { + return false; + } + } + + static Future requestNotificationPermission() async { + try { + return await _channel.invokeMethod( + 'requestNotificationPermission', + ) ?? + false; + } on MissingPluginException { + return true; + } + } + + static Future openNotificationAccessSettings() async { + try { + await _channel.invokeMethod('openNotificationAccessSettings'); + } on MissingPluginException { + // Notification access is Android-only. + } + } + + static Future openBatteryOptimizationSettings() async { + try { + await _channel.invokeMethod('openBatteryOptimizationSettings'); + } on MissingPluginException { + // Background battery settings are Android-only. + } + } + + static Future openBackgroundStartupSettings() async { + try { + await _channel.invokeMethod('openBackgroundStartupSettings'); + } on MissingPluginException { + // Vendor background startup settings are Android-only. + } + } + + static void onRecognitionAction( + void Function(Map action) callback, + ) { + _recognitionAction = callback; + _installHandler(); + } + + static Future onScreenshotReady( + void Function(String path) callback, { + void Function(String error)? onError, + }) async { + _screenshotReady = callback; + _screenshotError = onError; + _installHandler(); + } + + static void _installHandler() { + if (_handlerInstalled) return; + _handlerInstalled = true; + _channel.setMethodCallHandler((call) async { + if (call.method == 'onScreenshotReady') { + final path = call.arguments as String?; + if (path != null) _screenshotReady?.call(path); + } else if (call.method == 'onScreenshotError') { + _screenshotError?.call(call.arguments?.toString() ?? '截屏失败,请重试'); + } else if (call.method == 'onSpeechEvent') { + final raw = Map.from(call.arguments as Map); + final type = raw['type']?.toString() ?? 'error'; + final event = SpeechEvent( + type: type, + text: raw['text']?.toString(), + rms: (raw['rms'] as num?)?.toDouble() ?? 0, + ); + _speechEvent?.call(event); + if (type == 'final' || type == 'error' || type == 'cancelled') { + _speechEvent = null; + } + } else if (call.method == 'onRecognitionAction') { + final raw = Map.from(call.arguments as Map); + _recognitionAction?.call( + raw.map((key, value) => MapEntry(key.toString(), value)), + ); + } + }); + } +} diff --git a/frontend/lib/shared/services/session_store.dart b/frontend/lib/shared/services/session_store.dart new file mode 100644 index 0000000..4abe5fb --- /dev/null +++ b/frontend/lib/shared/services/session_store.dart @@ -0,0 +1,205 @@ +import 'package:flutter/foundation.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; + +class OnlineFeatureRequiredException implements Exception { + final String message; + const OnlineFeatureRequiredException([this.message = '此功能需要登录并连接网络后使用']); + + @override + String toString() => message; +} + +class SessionStore extends ChangeNotifier { + SessionStore._(); + + static final instance = SessionStore._(); + + SharedPreferences? _preferences; + String _mode = 'none'; + int? _userId; + String? _username; + String? _nickname; + String _appMode = 'normal'; + bool _onboardingDone = true; + bool _cloudSyncEnabled = true; + bool _needsReauth = false; + bool _aiEnabled = false; + + bool get isGuest => _mode == 'guest'; + bool get isAccount => _mode == 'account' && _userId != null; + bool get hasSession => isGuest || isAccount; + bool get cloudSyncEnabled => isAccount && _cloudSyncEnabled; + bool get needsReauth => _needsReauth; + bool get aiEnabled => isAccount && _aiEnabled; + bool get shouldUseLocalOnly => isGuest || !cloudSyncEnabled || needsReauth; + int? get userId => _userId; + String? get username => _username; + String? get nickname => _nickname; + String get appMode => _appMode; + bool get onboardingDone => _onboardingDone; + String get namespace => isGuest ? 'guest' : 'user_${_userId ?? 'none'}'; + + Future initialize() async { + _preferences ??= await SharedPreferences.getInstance(); + final preferences = _preferences!; + _mode = preferences.getString('session_mode') ?? 'none'; + _userId = preferences.getInt('session_user_id'); + _username = preferences.getString('session_username'); + _nickname = preferences.getString('session_nickname'); + _appMode = preferences.getString('session_app_mode') ?? 'normal'; + _onboardingDone = preferences.getBool('session_onboarding_done') ?? true; + _cloudSyncEnabled = preferences.getBool('session_cloud_sync') ?? true; + _needsReauth = preferences.getBool('session_needs_reauth') ?? false; + _aiEnabled = + preferences.getBool('session_ai_enabled') ?? (_mode == 'account'); + if (hasSession) { + await LocalDatabase.instance.openNamespace(namespace); + } else if (_mode != 'none') { + _mode = 'none'; + await preferences.setString('session_mode', 'none'); + } + } + + Future startGuest() async { + final preferences = _preferences ??= await SharedPreferences.getInstance(); + _mode = 'guest'; + _userId = null; + _username = '游客'; + _nickname = '游客'; + _appMode = 'normal'; + _onboardingDone = true; + _cloudSyncEnabled = false; + _needsReauth = false; + _aiEnabled = false; + await preferences.setString('session_mode', _mode); + await preferences.remove('session_user_id'); + await preferences.setString('session_username', _username!); + await preferences.setString('session_nickname', _nickname!); + await preferences.setString('session_app_mode', _appMode); + await preferences.setBool('session_onboarding_done', true); + await preferences.setBool('session_cloud_sync', false); + await preferences.setBool('session_needs_reauth', false); + await LocalDatabase.instance.openNamespace(namespace); + notifyListeners(); + } + + Future activateAccount({ + required int userId, + required String username, + String? nickname, + required String appMode, + required bool onboardingDone, + required bool aiEnabled, + }) async { + final preferences = _preferences ??= await SharedPreferences.getInstance(); + _mode = 'account'; + _userId = userId; + _username = username; + _nickname = nickname; + _appMode = appMode; + _onboardingDone = onboardingDone; + _aiEnabled = aiEnabled; + _cloudSyncEnabled = preferences.getBool('cloud_sync_user_$userId') ?? true; + _needsReauth = false; + await preferences.setString('session_mode', _mode); + await preferences.setInt('session_user_id', userId); + await preferences.setString('session_username', username); + if (nickname == null) { + await preferences.remove('session_nickname'); + } else { + await preferences.setString('session_nickname', nickname); + } + await preferences.setString('session_app_mode', appMode); + await preferences.setBool('session_onboarding_done', onboardingDone); + await preferences.setBool('session_ai_enabled', aiEnabled); + await preferences.setBool('session_cloud_sync', _cloudSyncEnabled); + await preferences.setBool('session_needs_reauth', false); + await LocalDatabase.instance.openNamespace(namespace); + notifyListeners(); + } + + Future updateNickname(String? nickname) async { + _nickname = nickname; + notifyListeners(); + final preferences = _preferences ??= await SharedPreferences.getInstance(); + if (nickname == null) { + await preferences.remove('session_nickname'); + } else { + await preferences.setString('session_nickname', nickname); + } + } + + Future updateCachedProfile({ + required String appMode, + required bool onboardingDone, + String? nickname, + bool? aiEnabled, + }) async { + _appMode = appMode; + _onboardingDone = onboardingDone; + _nickname = nickname ?? _nickname; + _aiEnabled = aiEnabled ?? _aiEnabled; + final preferences = _preferences ??= await SharedPreferences.getInstance(); + await preferences.setString('session_app_mode', _appMode); + await preferences.setBool('session_onboarding_done', _onboardingDone); + await preferences.setBool('session_ai_enabled', _aiEnabled); + if (_nickname != null) { + await preferences.setString('session_nickname', _nickname!); + } + notifyListeners(); + } + + Future setAiEnabled(bool enabled) async { + if (_aiEnabled == enabled) return; + _aiEnabled = enabled; + if (!enabled) _appMode = 'normal'; + final preferences = _preferences ??= await SharedPreferences.getInstance(); + await preferences.setBool('session_ai_enabled', enabled); + if (!enabled) await preferences.setString('session_app_mode', 'normal'); + notifyListeners(); + } + + Future setCloudSyncEnabled(bool enabled) async { + if (!isAccount) return; + _cloudSyncEnabled = enabled; + final preferences = _preferences ??= await SharedPreferences.getInstance(); + await preferences.setBool('session_cloud_sync', enabled); + await preferences.setBool('cloud_sync_user_$_userId', enabled); + notifyListeners(); + } + + Future markNeedsReauth() async { + if (!isAccount || _needsReauth) return; + _needsReauth = true; + final preferences = _preferences ??= await SharedPreferences.getInstance(); + await preferences.setBool('session_needs_reauth', true); + notifyListeners(); + } + + Future clearActiveSession() async { + final preferences = _preferences ??= await SharedPreferences.getInstance(); + _mode = 'none'; + _userId = null; + _username = null; + _nickname = null; + _appMode = 'normal'; + _onboardingDone = true; + _cloudSyncEnabled = true; + _needsReauth = false; + _aiEnabled = false; + await preferences.setString('session_mode', 'none'); + await preferences.remove('session_user_id'); + await preferences.remove('session_username'); + await preferences.remove('session_nickname'); + await preferences.remove('session_needs_reauth'); + LocalDatabase.instance.close(); + notifyListeners(); + } + + void requireOnline([String? message]) { + if (shouldUseLocalOnly) { + throw OnlineFeatureRequiredException(message ?? '此功能需要登录并连接网络后使用'); + } + } +} diff --git a/frontend/lib/shared/services/shanghai_time.dart b/frontend/lib/shared/services/shanghai_time.dart new file mode 100644 index 0000000..1d09c54 --- /dev/null +++ b/frontend/lib/shared/services/shanghai_time.dart @@ -0,0 +1,88 @@ +class ShanghaiTime { + ShanghaiTime._(); + + static const offset = Duration(hours: 8); + + /// A device-timezone-independent civil clock for Asia/Shanghai. + static DateTime get now => toCivil(DateTime.now()); + + static DateTime toCivil(DateTime instant) { + final shifted = instant.toUtc().add(offset); + return DateTime( + shifted.year, + shifted.month, + shifted.day, + shifted.hour, + shifted.minute, + shifted.second, + shifted.millisecond, + shifted.microsecond, + ); + } + + static DateTime civilToUtc(DateTime civil) => DateTime.utc( + civil.year, + civil.month, + civil.day, + civil.hour, + civil.minute, + civil.second, + civil.millisecond, + civil.microsecond, + ).subtract(offset); + + /// Parses API/cache instants. Legacy values without a zone were stored as UTC. + static DateTime parseUtcInstant(String value) { + final parsed = DateTime.parse(value); + if (value.endsWith('Z') || RegExp(r'[+-]\d{2}:?\d{2}$').hasMatch(value)) { + return parsed.toUtc(); + } + return DateTime.utc( + parsed.year, + parsed.month, + parsed.day, + parsed.hour, + parsed.minute, + parsed.second, + parsed.millisecond, + parsed.microsecond, + ); + } + + static DateTime parseCivil(String value) => toCivil(parseUtcInstant(value)); + + static DateTime startOfDayUtc(DateTime civil) => + civilToUtc(DateTime(civil.year, civil.month, civil.day)); + + static ({DateTime start, DateTime end}) monthRangeUtc(int year, int month) => + ( + start: civilToUtc(DateTime(year, month, 1)), + end: civilToUtc(DateTime(year, month + 1, 1)), + ); + + static ({DateTime start, DateTime end}) yearRangeUtc(int year) => ( + start: civilToUtc(DateTime(year, 1, 1)), + end: civilToUtc(DateTime(year + 1, 1, 1)), + ); + + static ({DateTime start, DateTime end}) weekRangeUtc(DateTime civil) { + final date = DateTime(civil.year, civil.month, civil.day); + final start = date.subtract(Duration(days: date.weekday - DateTime.monday)); + return ( + start: civilToUtc(start), + end: civilToUtc(start.add(const Duration(days: 7))), + ); + } + + static String formatCivil(DateTime value) => + '${value.year.toString().padLeft(4, '0')}-' + '${value.month.toString().padLeft(2, '0')}-' + '${value.day.toString().padLeft(2, '0')} ' + '${value.hour.toString().padLeft(2, '0')}:' + '${value.minute.toString().padLeft(2, '0')}'; + + static String formatDateTime(DateTime instant) { + final value = toCivil(instant); + return formatCivil(value); + } +} diff --git a/frontend/lib/shared/services/sync_service.dart b/frontend/lib/shared/services/sync_service.dart new file mode 100644 index 0000000..ee94b0c --- /dev/null +++ b/frontend/lib/shared/services/sync_service.dart @@ -0,0 +1,399 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; +import 'package:miaoji_zhang/shared/api/api_client.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/services/local_database.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; + +enum CloudSyncPhase { + idle, + syncing, + synced, + pending, + offline, + disabled, + reauthenticate, + failed, +} + +class SyncService extends ChangeNotifier { + SyncService._(); + + static final instance = SyncService._(); + static final conflictRevision = ValueNotifier(0); + + final _dio = ApiClient.instance.dio; + Future? _running; + CloudSyncPhase _phase = CloudSyncPhase.idle; + DateTime? _lastSyncedAt; + int _pendingCount = 0; + bool _connectivityInterrupted = false; + bool _hadFailures = false; + + int get conflictCount => LocalDatabase.instance.conflicts().length; + CloudSyncPhase get phase => _phase; + DateTime? get lastSyncedAt => _lastSyncedAt; + int get pendingCount => _pendingCount; + + String get statusLabel => switch (_phase) { + CloudSyncPhase.syncing => '正在同步', + CloudSyncPhase.synced => '已同步', + CloudSyncPhase.pending => '$_pendingCount 项待同步', + CloudSyncPhase.offline => '网络不可用,$_pendingCount 项待同步', + CloudSyncPhase.disabled => '云同步已关闭', + CloudSyncPhase.reauthenticate => '登录已过期,等待重新登录', + CloudSyncPhase.failed => '同步失败,点击重试', + CloudSyncPhase.idle => _pendingCount > 0 ? '$_pendingCount 项待同步' : '等待同步', + }; + + void refreshLocalStatus() { + final session = SessionStore.instance; + if (!session.isAccount || !session.cloudSyncEnabled) { + _setPhase(CloudSyncPhase.disabled, 0); + return; + } + if (session.needsReauth) { + _setPhase(CloudSyncPhase.reauthenticate, _safePendingCount()); + return; + } + final pending = _safePendingCount(); + _setPhase( + pending > 0 ? CloudSyncPhase.pending : CloudSyncPhase.idle, + pending, + ); + } + + Future run() { + final session = SessionStore.instance; + if (!session.isAccount || !session.cloudSyncEnabled) { + _setPhase(CloudSyncPhase.disabled, 0); + return Future.value(); + } + if (session.needsReauth) { + _setPhase(CloudSyncPhase.reauthenticate, _safePendingCount()); + return Future.value(); + } + final active = _running; + if (active != null) return active; + _connectivityInterrupted = false; + _hadFailures = false; + _setPhase(CloudSyncPhase.syncing, _safePendingCount()); + return _running = _execute().whenComplete(() => _running = null); + } + + Future _execute() async { + try { + await _runCore(); + if (SessionStore.instance.needsReauth) { + _setPhase(CloudSyncPhase.reauthenticate, _safePendingCount()); + return; + } + final pending = _safePendingCount(); + if (_connectivityInterrupted) { + _setPhase(CloudSyncPhase.offline, pending); + } else if (_hadFailures) { + _setPhase(CloudSyncPhase.failed, pending); + } else if (pending > 0) { + _setPhase(CloudSyncPhase.pending, pending); + } else { + _lastSyncedAt = DateTime.now(); + _setPhase(CloudSyncPhase.synced, 0); + } + } catch (error) { + final pending = _safePendingCount(); + _setPhase( + isConnectivityError(error) + ? CloudSyncPhase.offline + : CloudSyncPhase.failed, + pending, + ); + } + } + + int _safePendingCount() { + try { + return LocalDatabase.instance.pendingSync().length; + } catch (_) { + return 0; + } + } + + void _setPhase(CloudSyncPhase phase, int pending) { + if (_phase == phase && _pendingCount == pending) return; + _phase = phase; + _pendingCount = pending; + notifyListeners(); + } + + Future _runCore() async { + final database = LocalDatabase.instance; + for (final item in database.pendingSync()) { + final queueId = item['id'] as int; + try { + await _process(item); + database.completeSync(queueId); + } on _DependencyPending { + continue; + } on DioException catch (error) { + if (error.response?.statusCode == 409) { + final data = error.response?.data; + final remote = data is Map && data['server'] is Map + ? Map.from(data['server'] as Map) + : {}; + database.addConflict( + item['entityType'] as String, + item['entityId'] as int, + item['operation'] as String, + item['payload'] as Map, + remote, + ); + database.completeSync(queueId); + conflictRevision.value++; + continue; + } + if (error.response?.statusCode == 401) { + await SessionStore.instance.markNeedsReauth(); + return; + } + if (isConnectivityError(error)) { + _connectivityInterrupted = true; + return; + } + database.failSync(queueId); + _hadFailures = true; + } catch (_) { + database.failSync(queueId); + _hadFailures = true; + } + } + await CurrentLedgerStore.instance.ensureLoaded(force: true); + } + + Future _process(Map item) async { + final entityType = item['entityType'] as String; + final entityId = item['entityId'] as int; + final operation = item['operation'] as String; + final payload = Map.from( + item['payload'] as Map, + ); + switch (entityType) { + case 'ledger': + await _syncLedger(entityId, operation, payload); + return; + case 'category': + await _syncCategory(entityId, operation, payload); + return; + case 'transaction': + await _syncTransaction(entityId, operation, payload); + return; + case 'budget': + await _syncBudget(operation, payload); + return; + } + } + + Future _syncLedger( + int entityId, + String operation, + Map payload, + ) async { + if (operation == 'create') { + final response = await _dio.post('/api/ledgers', data: payload); + LocalDatabase.instance.remapLedger( + entityId, + Map.from(response.data as Map), + ); + return; + } + final remoteId = _resolvedId('ledger', entityId); + if (operation == 'update') { + await _dio.put('/api/ledgers/$remoteId', data: payload); + } else if (operation == 'delete') { + await _dio.delete('/api/ledgers/$remoteId'); + } else if (operation == 'select') { + await _dio.put('/api/ledgers/$remoteId/default'); + } + } + + Future _syncCategory( + int entityId, + String operation, + Map payload, + ) async { + if (operation == 'create') { + final response = await _dio.post('/api/categories', data: payload); + LocalDatabase.instance.remapCategory( + entityId, + Map.from(response.data as Map), + ); + return; + } + if (operation == 'reorder') { + final ids = (payload['categoryIds'] as List) + .map((value) => _resolvedId('category', (value as num).toInt())) + .toList(); + await _dio.put( + '/api/categories/reorder', + data: {'type': payload['type'], 'categoryIds': ids}, + ); + return; + } + final remoteId = _resolvedId('category', entityId); + if (operation == 'update') { + await _dio.put('/api/categories/$remoteId', data: payload); + } else if (operation == 'delete') { + await _dio.delete('/api/categories/$remoteId'); + } + } + + Future _syncTransaction( + int entityId, + String operation, + Map payload, + ) async { + final data = Map.from(payload); + if (data['ledgerId'] is num) { + data['ledgerId'] = _resolvedId( + 'ledger', + (data['ledgerId'] as num).toInt(), + ); + } + if (data['categoryId'] is num) { + data['categoryId'] = _resolvedId( + 'category', + (data['categoryId'] as num).toInt(), + ); + } + if (operation == 'create') { + final response = await _dio.post('/api/transactions', data: data); + LocalDatabase.instance.replaceLocalTransaction( + entityId, + Map.from(response.data as Map), + ); + return; + } + final remoteId = _resolvedId('transaction', entityId); + if (operation == 'update') { + final response = await _dio.put( + '/api/transactions/$remoteId', + data: data, + ); + LocalDatabase.instance.cacheTransaction( + Map.from(response.data as Map), + ); + } else if (operation == 'delete') { + await _dio.delete( + '/api/transactions/$remoteId', + queryParameters: { + if (data['baseUpdatedAt'] != null) + 'baseUpdatedAt': data['baseUpdatedAt'], + }, + ); + } else if (operation == 'restore') { + final response = await _dio.post( + '/api/transactions/$remoteId/restore', + queryParameters: { + if (data['baseUpdatedAt'] != null) + 'baseUpdatedAt': data['baseUpdatedAt'], + }, + ); + LocalDatabase.instance.cacheTransaction( + Map.from(response.data as Map), + ); + } + } + + Future _syncBudget( + String operation, + Map payload, + ) async { + final ledgerId = _resolvedId( + 'ledger', + (payload['ledgerId'] as num).toInt(), + ); + if (operation == 'batch') { + final items = (payload['items'] as List).map((value) { + final item = Map.from(value as Map); + if (item['categoryId'] is num) { + item['categoryId'] = _resolvedId( + 'category', + (item['categoryId'] as num).toInt(), + ); + } + return item; + }).toList(); + await _dio.put( + '/api/budgets/batch', + queryParameters: { + 'year': payload['year'], + 'month': payload['month'], + 'ledgerId': ledgerId, + }, + data: {'recurring': payload['recurring'], 'items': items}, + ); + return; + } + final categoryId = payload['categoryId'] is num + ? _resolvedId('category', (payload['categoryId'] as num).toInt()) + : null; + await _dio.put( + '/api/budgets', + queryParameters: { + 'year': payload['year'], + 'month': payload['month'], + 'ledgerId': ledgerId, + }, + data: { + 'categoryId': categoryId, + 'amount': payload['amount'], + 'recurring': payload['recurring'], + }, + ); + } + + int _resolvedId(String entityType, int value) { + final resolved = LocalDatabase.instance.remoteId(entityType, value); + if (resolved == null) throw const _DependencyPending(); + return resolved; + } + + Future resolveConflict( + Map conflict, { + required bool keepLocal, + }) async { + final database = LocalDatabase.instance; + final remote = conflict['remote'] as Map; + if (keepLocal && conflict['entityType'] == 'transaction') { + final entityId = conflict['entityId'] as int; + final remoteId = _resolvedId('transaction', entityId); + final operation = conflict['operation'] as String; + final payload = Map.from( + conflict['local'] as Map, + )..remove('baseUpdatedAt'); + if (operation == 'update') { + final response = await _dio.put( + '/api/transactions/$remoteId', + data: payload, + ); + database.cacheTransaction( + Map.from(response.data as Map), + ); + } else if (operation == 'delete') { + await _dio.delete('/api/transactions/$remoteId'); + } else if (operation == 'restore') { + final response = await _dio.post('/api/transactions/$remoteId/restore'); + database.cacheTransaction( + Map.from(response.data as Map), + ); + } + } else if (!keepLocal && remote.isNotEmpty) { + database.cacheTransaction(remote); + } + database.resolveConflict(conflict['id'] as int); + conflictRevision.value++; + } +} + +class _DependencyPending implements Exception { + const _DependencyPending(); +} diff --git a/frontend/lib/shared/services/transaction_events.dart b/frontend/lib/shared/services/transaction_events.dart new file mode 100644 index 0000000..e2412e7 --- /dev/null +++ b/frontend/lib/shared/services/transaction_events.dart @@ -0,0 +1,9 @@ +import 'package:flutter/foundation.dart'; + +class TransactionEvents { + static final ValueNotifier revision = ValueNotifier(0); + + static void notifyChanged() { + revision.value++; + } +} diff --git a/frontend/lib/shared/theme/app_theme.dart b/frontend/lib/shared/theme/app_theme.dart new file mode 100644 index 0000000..ebd5cf1 --- /dev/null +++ b/frontend/lib/shared/theme/app_theme.dart @@ -0,0 +1,359 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +@immutable +class JzPalette extends ThemeExtension { + final Color text; + final Color text2; + final Color text3; + final Color background; + final Color card; + final Color line; + final Color primaryBackground; + final Color aiBackground; + final Color expenseBackground; + final Color warningBackground; + + const JzPalette({ + required this.text, + required this.text2, + required this.text3, + required this.background, + required this.card, + required this.line, + required this.primaryBackground, + required this.aiBackground, + required this.expenseBackground, + required this.warningBackground, + }); + + @override + JzPalette copyWith({ + Color? text, + Color? text2, + Color? text3, + Color? background, + Color? card, + Color? line, + Color? primaryBackground, + Color? aiBackground, + Color? expenseBackground, + Color? warningBackground, + }) => JzPalette( + text: text ?? this.text, + text2: text2 ?? this.text2, + text3: text3 ?? this.text3, + background: background ?? this.background, + card: card ?? this.card, + line: line ?? this.line, + primaryBackground: primaryBackground ?? this.primaryBackground, + aiBackground: aiBackground ?? this.aiBackground, + expenseBackground: expenseBackground ?? this.expenseBackground, + warningBackground: warningBackground ?? this.warningBackground, + ); + + @override + JzPalette lerp(covariant JzPalette? other, double t) { + if (other == null) return this; + return JzPalette( + text: Color.lerp(text, other.text, t)!, + text2: Color.lerp(text2, other.text2, t)!, + text3: Color.lerp(text3, other.text3, t)!, + background: Color.lerp(background, other.background, t)!, + card: Color.lerp(card, other.card, t)!, + line: Color.lerp(line, other.line, t)!, + primaryBackground: Color.lerp( + primaryBackground, + other.primaryBackground, + t, + )!, + aiBackground: Color.lerp(aiBackground, other.aiBackground, t)!, + expenseBackground: Color.lerp( + expenseBackground, + other.expenseBackground, + t, + )!, + warningBackground: Color.lerp( + warningBackground, + other.warningBackground, + t, + )!, + ); + } +} + +extension JzThemeContext on BuildContext { + JzPalette get jz => Theme.of(this).extension()!; +} + +class AppTheme { + AppTheme._(); + + static const Color primary = Color(0xFF00B386); + static const Color primaryDeep = Color(0xFF009973); + static const Color primaryBg = Color(0xFFE6F7F1); + static const Color primaryMid = Color(0xFF4DA6FF); + static const Color primaryLight = Color(0xFF80DCC2); + static const Color ai = Color(0xFF5B6BF5); + static const Color aiBg = Color(0xFFEEF0FE); + static const Color red = Color(0xFFF0642D); + static const Color redBg = Color(0xFFFFF3EC); + static const Color orange = Color(0xFFF5A623); + static const Color orangeBg = Color(0xFFFFF7E8); + static const Color text = Color(0xFF191F26); + static const Color text2 = Color(0xFF5E6772); + static const Color text3 = Color(0xFF9AA3AD); + static const Color bg = Color(0xFFF6F7F9); + static const Color card = Colors.white; + static const Color line = Color(0xFFEEF0F3); + + static const _lightPalette = JzPalette( + text: text, + text2: text2, + text3: text3, + background: bg, + card: card, + line: line, + primaryBackground: primaryBg, + aiBackground: aiBg, + expenseBackground: redBg, + warningBackground: orangeBg, + ); + + static const _darkPalette = JzPalette( + text: Color(0xFFE8EFED), + text2: Color(0xFFAAB6B2), + text3: Color(0xFF74817D), + background: Color(0xFF111615), + card: Color(0xFF1B2220), + line: Color(0xFF2B3532), + primaryBackground: Color(0xFF143A31), + aiBackground: Color(0xFF272B4A), + expenseBackground: Color(0xFF40251F), + warningBackground: Color(0xFF3B2E1B), + ); + + static ThemeData get light => _build(Brightness.light, _lightPalette); + static ThemeData get dark => _build(Brightness.dark, _darkPalette); + + static ThemeData _build(Brightness brightness, JzPalette p) { + final dark = brightness == Brightness.dark; + final scheme = dark + ? ColorScheme.dark( + primary: primary, + secondary: ai, + surface: p.card, + error: red, + onPrimary: Colors.white, + onSecondary: Colors.white, + onSurface: p.text, + primaryContainer: p.primaryBackground, + onPrimaryContainer: const Color(0xFF9BE7D1), + secondaryContainer: p.aiBackground, + onSecondaryContainer: const Color(0xFFC5CAFF), + outline: p.line, + outlineVariant: p.line, + ) + : ColorScheme.light( + primary: primary, + secondary: ai, + surface: p.card, + error: red, + onPrimary: Colors.white, + onSecondary: Colors.white, + onSurface: p.text, + primaryContainer: p.primaryBackground, + onPrimaryContainer: primaryDeep, + secondaryContainer: p.aiBackground, + onSecondaryContainer: ai, + outline: p.line, + outlineVariant: p.line, + ); + final baseText = ThemeData( + brightness: brightness, + ).textTheme.apply(bodyColor: p.text, displayColor: p.text); + + return ThemeData( + useMaterial3: true, + brightness: brightness, + colorScheme: scheme, + scaffoldBackgroundColor: p.background, + fontFamily: 'PingFang SC', + textTheme: baseText, + extensions: [p], + dividerColor: p.line, + disabledColor: p.text3, + appBarTheme: AppBarTheme( + backgroundColor: Colors.transparent, + foregroundColor: p.text, + elevation: 0, + centerTitle: true, + titleTextStyle: TextStyle( + color: p.text, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + systemOverlayStyle: dark + ? SystemUiOverlayStyle.light + : SystemUiOverlayStyle.dark, + ), + bottomNavigationBarTheme: BottomNavigationBarThemeData( + backgroundColor: p.card, + selectedItemColor: primary, + unselectedItemColor: p.text3, + type: BottomNavigationBarType.fixed, + elevation: 0, + ), + cardTheme: CardThemeData( + color: p.card, + surfaceTintColor: Colors.transparent, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14), + side: BorderSide(color: p.line, width: 0.5), + ), + ), + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: p.card, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: BorderSide(color: p.line), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: BorderSide(color: p.line), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: primary, width: 1.4), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: red), + ), + hintStyle: TextStyle(color: p.text3, fontSize: 13.5), + labelStyle: TextStyle(color: p.text2, fontSize: 13), + contentPadding: const EdgeInsets.symmetric( + horizontal: 14, + vertical: 13, + ), + ), + elevatedButtonTheme: ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + backgroundColor: primary, + foregroundColor: Colors.white, + disabledBackgroundColor: p.line, + disabledForegroundColor: p.text3, + elevation: 0, + minimumSize: const Size(0, 46), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14), + ), + padding: const EdgeInsets.symmetric(vertical: 14), + textStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600), + ), + ), + filledButtonTheme: FilledButtonThemeData( + style: FilledButton.styleFrom( + backgroundColor: primary, + foregroundColor: Colors.white, + disabledBackgroundColor: p.line, + disabledForegroundColor: p.text3, + elevation: 0, + minimumSize: const Size(0, 46), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14), + ), + textStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + ), + outlinedButtonTheme: OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + foregroundColor: p.text, + side: BorderSide(color: p.line), + minimumSize: const Size(0, 46), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14), + ), + textStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w600), + ), + ), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom( + foregroundColor: dark ? const Color(0xFF77D7BD) : primaryDeep, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + textStyle: const TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w600, + ), + ), + ), + iconButtonTheme: IconButtonThemeData( + style: IconButton.styleFrom( + foregroundColor: p.text2, + highlightColor: p.primaryBackground, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + checkboxTheme: CheckboxThemeData( + fillColor: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.selected) ? primary : p.card, + ), + side: BorderSide(color: p.text3), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)), + ), + switchTheme: SwitchThemeData( + trackColor: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.selected) + ? p.primaryBackground + : p.line, + ), + thumbColor: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.selected) ? primary : p.text3, + ), + trackOutlineColor: const WidgetStatePropertyAll(Colors.transparent), + ), + dialogTheme: DialogThemeData( + backgroundColor: p.card, + surfaceTintColor: Colors.transparent, + elevation: 0, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(22)), + titleTextStyle: TextStyle( + color: p.text, + fontSize: 18, + fontWeight: FontWeight.w800, + ), + contentTextStyle: TextStyle( + color: p.text2, + fontSize: 13.5, + height: 1.6, + ), + ), + bottomSheetTheme: BottomSheetThemeData( + backgroundColor: p.card, + modalBackgroundColor: p.card, + surfaceTintColor: Colors.transparent, + showDragHandle: false, + ), + snackBarTheme: SnackBarThemeData( + backgroundColor: dark ? const Color(0xFFE8EFED) : p.text, + contentTextStyle: TextStyle( + color: dark ? const Color(0xFF111615) : Colors.white, + fontSize: 13, + ), + behavior: SnackBarBehavior.floating, + elevation: 0, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + ), + navigationBarTheme: NavigationBarThemeData( + backgroundColor: p.card, + indicatorColor: p.primaryBackground, + ), + ); + } +} diff --git a/frontend/lib/shared/theme/theme_store.dart b/frontend/lib/shared/theme/theme_store.dart new file mode 100644 index 0000000..73e9067 --- /dev/null +++ b/frontend/lib/shared/theme/theme_store.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +enum JzThemePreference { system, light, dark } + +class ThemeStore extends ChangeNotifier { + ThemeStore._(); + + static final instance = ThemeStore._(); + static const _key = 'theme_preference'; + static const _channel = MethodChannel('com.miaoji/screenshot'); + + JzThemePreference _preference = JzThemePreference.system; + + JzThemePreference get preference => _preference; + + ThemeMode get themeMode => switch (_preference) { + JzThemePreference.light => ThemeMode.light, + JzThemePreference.dark => ThemeMode.dark, + JzThemePreference.system => ThemeMode.system, + }; + + Future initialize() async { + final value = (await SharedPreferences.getInstance()).getString(_key); + _preference = JzThemePreference.values.firstWhere( + (item) => item.name == value, + orElse: () => JzThemePreference.system, + ); + await _syncNativeTheme(); + } + + Future setPreference(JzThemePreference value) async { + if (_preference == value) return; + _preference = value; + notifyListeners(); + await (await SharedPreferences.getInstance()).setString(_key, value.name); + await _syncNativeTheme(); + } + + Future _syncNativeTheme() async { + try { + await _channel.invokeMethod('setThemeMode', { + 'mode': _preference.name, + }); + } on MissingPluginException { + // Native startup themes are Android-only. + } + } +} diff --git a/frontend/lib/shared/update/update_api.dart b/frontend/lib/shared/update/update_api.dart new file mode 100644 index 0000000..c4d98a4 --- /dev/null +++ b/frontend/lib/shared/update/update_api.dart @@ -0,0 +1,86 @@ +import 'package:dio/dio.dart'; +import 'package:miaoji_zhang/shared/update/update_config.dart'; +import 'package:miaoji_zhang/shared/update/update_models.dart'; + +enum UpdateFailureKind { unavailable, rateLimited, network, invalidResponse } + +class UpdateCheckException implements Exception { + final UpdateFailureKind kind; + final String message; + + const UpdateCheckException(this.kind, this.message); + + @override + String toString() => message; +} + +class UpdateApi { + UpdateApi({Dio? dio}) + : _dio = + dio ?? + Dio( + BaseOptions( + baseUrl: UpdateConfig.baseUrl, + connectTimeout: const Duration(seconds: 8), + receiveTimeout: const Duration(seconds: 15), + sendTimeout: const Duration(seconds: 8), + ), + ); + + final Dio _dio; + + Future check({ + required String platform, + required String channel, + required int currentBuild, + }) async { + try { + final response = await _dio.get( + '/api/client/v1/update', + queryParameters: { + 'appKey': UpdateConfig.appKey, + 'platform': platform, + 'channel': channel, + 'currentBuild': currentBuild, + }, + ); + final data = response.data; + if (data is! Map) { + throw const UpdateCheckException( + UpdateFailureKind.invalidResponse, + '更新服务返回格式异常', + ); + } + return UpdateCheckResponse.fromJson(Map.from(data)); + } on DioException catch (error) { + switch (error.response?.statusCode) { + case 404: + throw const UpdateCheckException( + UpdateFailureKind.unavailable, + '当前版本尚未配置更新渠道', + ); + case 429: + throw const UpdateCheckException( + UpdateFailureKind.rateLimited, + '检查更新过于频繁,请稍后再试', + ); + } + throw const UpdateCheckException( + UpdateFailureKind.network, + '暂时无法连接更新服务,请检查网络后重试', + ); + } on UpdateCheckException { + rethrow; + } on FormatException catch (error) { + throw UpdateCheckException( + UpdateFailureKind.invalidResponse, + error.message.toString(), + ); + } catch (_) { + throw const UpdateCheckException( + UpdateFailureKind.invalidResponse, + '更新服务返回格式异常', + ); + } + } +} diff --git a/frontend/lib/shared/update/update_config.dart b/frontend/lib/shared/update/update_config.dart new file mode 100644 index 0000000..68b2608 --- /dev/null +++ b/frontend/lib/shared/update/update_config.dart @@ -0,0 +1,27 @@ +import 'dart:io'; + +class UpdateConfig { + UpdateConfig._(); + + static const baseUrl = String.fromEnvironment( + 'UPDATE_BASE_URL', + defaultValue: 'https://version.nxsir.cn', + ); + static const appKey = String.fromEnvironment( + 'UPDATE_APP_KEY', + defaultValue: 'MvSyHJ7d8mlLbylIub04epC7g5AsCSqB', + ); + static const internalBuild = bool.fromEnvironment('INTERNAL_BUILD'); + + static String? get platform { + if (Platform.isAndroid) return 'android'; + if (Platform.isIOS) return 'ios'; + return null; + } + + static String get channel => internalBuild ? 'beta' : 'stable'; + + static bool get supportsUpdates => platform != null; + + static bool get canInstallInApp => Platform.isAndroid && internalBuild; +} diff --git a/frontend/lib/shared/update/update_coordinator.dart b/frontend/lib/shared/update/update_coordinator.dart new file mode 100644 index 0000000..d2497b3 --- /dev/null +++ b/frontend/lib/shared/update/update_coordinator.dart @@ -0,0 +1,168 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:miaoji_zhang/shared/update/update_api.dart'; +import 'package:miaoji_zhang/shared/update/update_config.dart'; +import 'package:miaoji_zhang/shared/update/update_downloader.dart'; +import 'package:miaoji_zhang/shared/update/update_models.dart'; +import 'package:miaoji_zhang/shared/update/update_prompt.dart'; +import 'package:miaoji_zhang/shared/version.dart'; + +class UpdateCoordinator extends ChangeNotifier { + UpdateCoordinator({UpdateApi? api}) : _api = api ?? UpdateApi(); + + static final instance = UpdateCoordinator(); + + final UpdateApi _api; + SharedPreferences? _preferences; + GlobalKey? _navigatorKey; + Future? _inFlight; + bool _startupScheduled = false; + bool _showingPrompt = false; + bool _checking = false; + AppRelease? _forcedRelease; + + bool get checking => _checking; + + Future initialize() async { + _preferences ??= await SharedPreferences.getInstance(); + await UpdateDownloader().cleanupStale(); + } + + void bindNavigator(GlobalKey navigatorKey) { + _navigatorKey = navigatorKey; + } + + void scheduleStartupCheck() { + if (_startupScheduled || !UpdateConfig.supportsUpdates) return; + _startupScheduled = true; + WidgetsBinding.instance.addPostFrameCallback((_) { + Future.delayed( + const Duration(milliseconds: 350), + _checkAutomatically, + ); + }); + } + + Future checkManually(BuildContext context) async { + if (!UpdateConfig.supportsUpdates) { + _message(context, '当前平台暂不支持应用内更新检查'); + return; + } + try { + final response = await _check(); + final release = _availableRelease(response); + if (release == null) { + if (context.mounted) _message(context, '已是最新版'); + return; + } + if (response.forceUpdate) _forcedRelease = release; + if (context.mounted) { + await _present(context, release, response.forceUpdate); + } + } on UpdateCheckException catch (error) { + if (context.mounted) _message(context, error.message); + } + } + + Future _checkAutomatically() async { + try { + final response = await _check(); + final release = _availableRelease(response); + if (release == null) return; + final ignoredId = await _ignoredReleaseId(); + if (!UpdatePolicy.shouldPresent( + release: release, + forced: response.forceUpdate, + manual: false, + ignoredReleaseId: ignoredId, + )) { + return; + } + if (response.forceUpdate) _forcedRelease = release; + final context = _navigatorKey?.currentContext; + if (context != null && context.mounted) { + await _present(context, release, response.forceUpdate); + } + } catch (_) { + // Automatic checks never block startup when the update service is unavailable. + } + } + + @visibleForTesting + Future debugCheck({required String platform}) => + _check(platformOverride: platform); + + Future _check({String? platformOverride}) { + final existing = _inFlight; + if (existing != null) return existing; + _checking = true; + notifyListeners(); + final future = _api + .check( + platform: platformOverride ?? UpdateConfig.platform!, + channel: UpdateConfig.channel, + currentBuild: AppVersion.buildNumber, + ) + .whenComplete(() { + _inFlight = null; + _checking = false; + notifyListeners(); + }); + _inFlight = future; + return future; + } + + AppRelease? _availableRelease(UpdateCheckResponse response) => + UpdatePolicy.availableRelease( + response, + currentBuild: AppVersion.buildNumber, + ); + + Future _ignoredReleaseId() async { + final preferences = _preferences ??= await SharedPreferences.getInstance(); + return preferences.getString(_ignoredKey); + } + + Future _ignore(AppRelease release) async { + final preferences = _preferences ??= await SharedPreferences.getInstance(); + await preferences.setString(_ignoredKey, release.id); + } + + String get _ignoredKey => + 'ignored_update_${UpdateConfig.platform}_${UpdateConfig.channel}'; + + Future _present( + BuildContext context, + AppRelease release, + bool forced, + ) async { + if (_showingPrompt) return; + _showingPrompt = true; + try { + await showUpdatePrompt( + context, + release: release, + forced: forced, + onIgnore: () => _ignore(release), + ); + } finally { + _showingPrompt = false; + if (forced && _forcedRelease != null) { + WidgetsBinding.instance.addPostFrameCallback((_) { + final retryContext = _navigatorKey?.currentContext; + if (retryContext != null && retryContext.mounted) { + unawaited(_present(retryContext, _forcedRelease!, true)); + } + }); + } + } + } + + void _message(BuildContext context, String message) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); + } +} diff --git a/frontend/lib/shared/update/update_downloader.dart b/frontend/lib/shared/update/update_downloader.dart new file mode 100644 index 0000000..880808b --- /dev/null +++ b/frontend/lib/shared/update/update_downloader.dart @@ -0,0 +1,190 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:crypto/crypto.dart'; +import 'package:dio/dio.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:miaoji_zhang/shared/update/update_installer.dart'; +import 'package:miaoji_zhang/shared/update/update_models.dart'; + +class UpdateDownloadProgress { + final int received; + final int total; + final double bytesPerSecond; + + const UpdateDownloadProgress({ + required this.received, + required this.total, + required this.bytesPerSecond, + }); + + double? get fraction => total > 0 ? (received / total).clamp(0, 1) : null; +} + +class UpdateDownloadException implements Exception { + final String message; + const UpdateDownloadException(this.message); + + @override + String toString() => message; +} + +class UpdateDownloader { + UpdateDownloader({Dio? dio}) + : _dio = + dio ?? + Dio( + BaseOptions( + connectTimeout: const Duration(seconds: 15), + receiveTimeout: const Duration(minutes: 10), + followRedirects: true, + maxRedirects: 5, + ), + ); + + final Dio _dio; + CancelToken? _cancelToken; + + bool get isDownloading => _cancelToken != null; + + void cancel() => _cancelToken?.cancel('用户取消下载'); + + Future cleanupStale() async { + if (!Platform.isAndroid) return; + final directory = await _updateDirectory(); + if (!await directory.exists()) return; + final cutoff = DateTime.now().subtract(const Duration(hours: 24)); + await for (final entity in directory.list()) { + if (entity is! File) continue; + final stat = await entity.stat(); + if (entity.path.endsWith('.part') || stat.modified.isBefore(cutoff)) { + await _delete(entity); + } + } + } + + Future downloadAndVerify( + AppRelease release, { + required void Function(UpdateDownloadProgress progress) onProgress, + }) async { + if (_cancelToken != null) { + throw const UpdateDownloadException('更新包正在下载中'); + } + final uri = Uri.tryParse(release.downloadUrl); + if (uri == null || uri.scheme != 'https' || uri.host.isEmpty) { + throw const UpdateDownloadException('更新包地址无效,必须使用 HTTPS'); + } + final expectedSha = release.sha256?.trim().toLowerCase(); + if (expectedSha == null || + !RegExp(r'^[0-9a-f]{64}$').hasMatch(expectedSha)) { + throw const UpdateDownloadException('发布记录缺少有效的 SHA-256,已禁止安装'); + } + + final directory = await _updateDirectory(); + await directory.create(recursive: true); + final partial = File( + '${directory.path}${Platform.pathSeparator}jizhi-${release.buildNumber}.apk.part', + ); + final target = File( + '${directory.path}${Platform.pathSeparator}jizhi-${release.buildNumber}.apk', + ); + await _delete(partial); + await _delete(target); + + final token = CancelToken(); + _cancelToken = token; + final stopwatch = Stopwatch()..start(); + var lastBytes = 0; + var lastElapsed = Duration.zero; + var keepTarget = false; + try { + await _dio.download( + release.downloadUrl, + partial.path, + cancelToken: token, + deleteOnError: true, + onReceiveProgress: (received, total) { + final elapsed = stopwatch.elapsed; + final deltaMicros = (elapsed - lastElapsed).inMicroseconds; + final speed = deltaMicros <= 0 + ? 0.0 + : (received - lastBytes) * + Duration.microsecondsPerSecond / + deltaMicros; + if (elapsed - lastElapsed >= const Duration(milliseconds: 250) || + received == total) { + lastBytes = received; + lastElapsed = elapsed; + onProgress( + UpdateDownloadProgress( + received: received, + total: total > 0 ? total : release.fileSize ?? 0, + bytesPerSecond: speed, + ), + ); + } + }, + ); + + final actualSize = await partial.length(); + if (release.fileSize case final expectedSize? + when expectedSize > 0 && actualSize != expectedSize) { + throw UpdateDownloadException( + '更新包大小不一致(预期 $expectedSize 字节,实际 $actualSize 字节)', + ); + } + final actualSha = (await sha256.bind(partial.openRead()).first) + .toString(); + if (actualSha.toLowerCase() != expectedSha) { + throw const UpdateDownloadException('更新包完整性校验失败,文件已删除'); + } + await partial.rename(target.path); + final inspection = await UpdateInstaller.inspect( + path: target.path, + expectedBuild: release.buildNumber, + ); + if (!inspection.valid) { + throw UpdateDownloadException(inspection.message ?? '更新包身份校验失败,文件已删除'); + } + keepTarget = true; + return target.path; + } on DioException catch (error) { + if (CancelToken.isCancel(error)) { + throw const UpdateDownloadException('下载已取消'); + } + throw const UpdateDownloadException('更新包下载失败,请检查网络后重试'); + } on UpdateDownloadException { + rethrow; + } catch (_) { + throw const UpdateDownloadException('更新包处理失败,请重新下载'); + } finally { + _cancelToken = null; + stopwatch.stop(); + if (!keepTarget) { + await _delete(partial); + await _delete(target); + } + } + } + + Future deleteFile(String path) => _delete(File(path)); + + Future scheduleCleanup(String path) async { + unawaited( + Future.delayed(const Duration(minutes: 10), () async { + await _delete(File(path)); + }), + ); + } + + Future _updateDirectory() async { + final temporary = await getTemporaryDirectory(); + return Directory('${temporary.path}${Platform.pathSeparator}updates'); + } + + Future _delete(File file) async { + try { + if (await file.exists()) await file.delete(); + } catch (_) {} + } +} diff --git a/frontend/lib/shared/update/update_installer.dart b/frontend/lib/shared/update/update_installer.dart new file mode 100644 index 0000000..ad1113b --- /dev/null +++ b/frontend/lib/shared/update/update_installer.dart @@ -0,0 +1,45 @@ +import 'package:flutter/services.dart'; + +enum ApkInstallStatus { launched, permissionRequested, unsupported } + +class ApkInspection { + final bool valid; + final String? message; + + const ApkInspection({required this.valid, this.message}); +} + +class UpdateInstaller { + UpdateInstaller._(); + + static const _channel = MethodChannel('com.nx.miaoji/update'); + + static Future inspect({ + required String path, + required int expectedBuild, + }) async { + final result = await _channel.invokeMapMethod( + 'inspectApk', + {'path': path, 'expectedBuild': expectedBuild}, + ); + return ApkInspection( + valid: result?['valid'] == true, + message: result?['message']?.toString(), + ); + } + + static Future install({ + required String path, + required int expectedBuild, + }) async { + final result = await _channel.invokeMapMethod( + 'installApk', + {'path': path, 'expectedBuild': expectedBuild}, + ); + return switch (result?['status']) { + 'launched' => ApkInstallStatus.launched, + 'permission_requested' => ApkInstallStatus.permissionRequested, + _ => ApkInstallStatus.unsupported, + }; + } +} diff --git a/frontend/lib/shared/update/update_models.dart b/frontend/lib/shared/update/update_models.dart new file mode 100644 index 0000000..9aee3f6 --- /dev/null +++ b/frontend/lib/shared/update/update_models.dart @@ -0,0 +1,99 @@ +class AppRelease { + final String id; + final String versionName; + final int buildNumber; + final String downloadUrl; + final String releaseNotes; + final String? sha256; + final int? fileSize; + final DateTime? publishedAt; + + const AppRelease({ + required this.id, + required this.versionName, + required this.buildNumber, + required this.downloadUrl, + required this.releaseNotes, + required this.sha256, + required this.fileSize, + required this.publishedAt, + }); + + factory AppRelease.fromJson(Map json) { + final id = json['id']?.toString().trim() ?? ''; + final versionName = json['versionName']?.toString().trim() ?? ''; + final buildNumber = (json['buildNumber'] as num?)?.toInt() ?? -1; + final downloadUrl = json['downloadUrl']?.toString().trim() ?? ''; + if (id.isEmpty || + versionName.isEmpty || + buildNumber < 0 || + downloadUrl.isEmpty) { + throw const FormatException('更新服务返回了不完整的版本信息'); + } + return AppRelease( + id: id, + versionName: versionName, + buildNumber: buildNumber, + downloadUrl: downloadUrl, + releaseNotes: json['releaseNotes']?.toString().trim() ?? '', + sha256: json['sha256']?.toString().trim().nullIfEmpty, + fileSize: (json['fileSize'] as num?)?.toInt(), + publishedAt: DateTime.tryParse(json['publishedAt']?.toString() ?? ''), + ); + } +} + +class UpdateCheckResponse { + final bool hasUpdate; + final bool forceUpdate; + final AppRelease? release; + + const UpdateCheckResponse({ + required this.hasUpdate, + required this.forceUpdate, + required this.release, + }); + + factory UpdateCheckResponse.fromJson(Map json) { + final releaseJson = json['release']; + final release = releaseJson is Map + ? AppRelease.fromJson(Map.from(releaseJson)) + : null; + final hasUpdate = json['hasUpdate'] == true; + if (hasUpdate && release == null) { + throw const FormatException('更新服务未返回目标版本'); + } + return UpdateCheckResponse( + hasUpdate: hasUpdate, + forceUpdate: json['forceUpdate'] == true, + release: release, + ); + } +} + +extension on String { + String? get nullIfEmpty => isEmpty ? null : this; +} + +class UpdatePolicy { + UpdatePolicy._(); + + static AppRelease? availableRelease( + UpdateCheckResponse response, { + required int currentBuild, + }) { + final release = response.release; + if (!response.hasUpdate || release == null) return null; + return release.buildNumber > currentBuild ? release : null; + } + + static bool shouldPresent({ + required AppRelease release, + required bool forced, + required bool manual, + required String? ignoredReleaseId, + }) { + if (forced || manual) return true; + return ignoredReleaseId != release.id; + } +} diff --git a/frontend/lib/shared/update/update_prompt.dart b/frontend/lib/shared/update/update_prompt.dart new file mode 100644 index 0000000..f172a57 --- /dev/null +++ b/frontend/lib/shared/update/update_prompt.dart @@ -0,0 +1,376 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/update/update_config.dart'; +import 'package:miaoji_zhang/shared/update/update_downloader.dart'; +import 'package:miaoji_zhang/shared/update/update_installer.dart'; +import 'package:miaoji_zhang/shared/update/update_models.dart'; +import 'package:miaoji_zhang/shared/version.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; + +Future showUpdatePrompt( + BuildContext context, { + required AppRelease release, + required bool forced, + required Future Function() onIgnore, +}) { + return showModalBottomSheet( + context: context, + useRootNavigator: true, + isScrollControlled: true, + isDismissible: false, + enableDrag: false, + backgroundColor: Colors.transparent, + builder: (_) => + UpdatePromptSheet(release: release, forced: forced, onIgnore: onIgnore), + ); +} + +class UpdatePromptSheet extends StatefulWidget { + final AppRelease release; + final bool forced; + final Future Function() onIgnore; + + const UpdatePromptSheet({ + super.key, + required this.release, + required this.forced, + required this.onIgnore, + }); + + @override + State createState() => _UpdatePromptSheetState(); +} + +class _UpdatePromptSheetState extends State { + final _downloader = UpdateDownloader(); + UpdateDownloadProgress? _progress; + bool _working = false; + String? _status; + String? _error; + String? _downloadedPath; + + @override + void dispose() { + _downloader.cancel(); + super.dispose(); + } + + Future _ignore() async { + if (_working) return; + await widget.onIgnore(); + if (mounted) Navigator.pop(context); + } + + Future _update() async { + if (_working) return; + final uri = Uri.tryParse(widget.release.downloadUrl); + if (uri == null || uri.scheme != 'https' || uri.host.isEmpty) { + setState(() => _error = '更新地址无效,必须使用 HTTPS'); + return; + } + if (!UpdateConfig.canInstallInApp) { + setState(() { + _working = true; + _error = null; + _status = '正在打开更新页面…'; + }); + try { + final opened = await launchUrl( + uri, + mode: LaunchMode.externalApplication, + ); + if (!opened) throw StateError('无法打开更新页面'); + if (!widget.forced && mounted) Navigator.pop(context); + if (mounted && widget.forced) { + setState(() => _status = '更新页面已打开,完成更新后重新打开记之'); + } + } catch (_) { + if (mounted) setState(() => _error = '无法打开更新页面,请稍后重试'); + } finally { + if (mounted) setState(() => _working = false); + } + return; + } + + setState(() { + _working = true; + _error = null; + _status = '正在下载更新包…'; + _progress = null; + }); + String? path; + try { + final cachedPath = _downloadedPath; + if (cachedPath != null && await File(cachedPath).exists()) { + path = cachedPath; + } else { + _downloadedPath = null; + path = await _downloader.downloadAndVerify( + widget.release, + onProgress: (progress) { + if (!mounted) return; + setState(() { + _progress = progress; + _status = '正在下载更新包…'; + }); + }, + ); + _downloadedPath = path; + } + if (!mounted) return; + setState(() { + _status = '校验完成,正在打开安装界面…'; + _progress = null; + }); + final status = await UpdateInstaller.install( + path: path, + expectedBuild: widget.release.buildNumber, + ); + if (!mounted) return; + setState(() { + _status = switch (status) { + ApkInstallStatus.launched => '安装界面已打开,完成后重新启动记之', + ApkInstallStatus.permissionRequested => '请允许安装未知应用,返回后将继续安装', + ApkInstallStatus.unsupported => '当前设备无法调起安装,请重新下载', + }; + if (status == ApkInstallStatus.unsupported) { + _error = _status; + } + }); + if (status == ApkInstallStatus.launched) { + await _downloader.scheduleCleanup(path); + } else if (status == ApkInstallStatus.unsupported) { + await _downloader.deleteFile(path); + _downloadedPath = null; + } + } on UpdateDownloadException catch (error) { + if (mounted) setState(() => _error = error.message); + } catch (_) { + if (mounted) setState(() => _error = '更新失败,请重新尝试'); + } finally { + if (mounted) setState(() => _working = false); + } + } + + void _cancelDownload() { + _downloader.cancel(); + setState(() => _status = '正在取消下载…'); + } + + @override + Widget build(BuildContext context) { + final release = widget.release; + return PopScope( + canPop: false, + child: SafeArea( + child: Container( + constraints: BoxConstraints( + maxHeight: MediaQuery.sizeOf(context).height * 0.84, + ), + padding: const EdgeInsets.fromLTRB(20, 0, 20, 18), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: const BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + JzSheetHeader( + title: widget.forced ? '必须更新后继续使用' : '发现新版本', + subtitle: + 'v${release.versionName} (${release.buildNumber}) · 当前 ${AppVersion.display}', + ), + if (widget.forced) + Container( + width: double.infinity, + margin: const EdgeInsets.only(top: 12), + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 10, + ), + decoration: BoxDecoration( + color: context.jz.warningBackground, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: AppTheme.orange.withValues(alpha: 0.35), + ), + ), + child: Text( + '此版本已停止支持,更新完成前暂时不能进入 App。', + style: TextStyle( + fontSize: 12, + color: context.jz.text2, + height: 1.45, + ), + ), + ), + const SizedBox(height: 14), + Flexible( + child: Container( + width: double.infinity, + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: context.jz.background, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line), + ), + child: SingleChildScrollView( + child: MarkdownBody( + data: release.releaseNotes.isEmpty + ? '本次更新包含体验优化与问题修复。' + : release.releaseNotes, + selectable: true, + styleSheet: MarkdownStyleSheet( + p: TextStyle( + fontSize: 13, + color: context.jz.text2, + height: 1.65, + ), + h1: TextStyle( + fontSize: 17, + fontWeight: FontWeight.w800, + color: context.jz.text, + ), + h2: TextStyle( + fontSize: 15, + fontWeight: FontWeight.w800, + color: context.jz.text, + ), + listBullet: TextStyle( + fontSize: 13, + color: AppTheme.primaryDeep, + ), + code: TextStyle( + fontSize: 12, + color: context.jz.text, + backgroundColor: context.jz.card, + ), + blockquoteDecoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(8), + border: const Border( + left: BorderSide(color: AppTheme.ai, width: 3), + ), + ), + ), + ), + ), + ), + ), + if (_progress != null || _status != null || _error != null) ...[ + const SizedBox(height: 14), + if (_progress != null) _UpdateProgressBar(progress: _progress!), + if (_progress != null) const SizedBox(height: 8), + Align( + alignment: Alignment.centerLeft, + child: Text( + _error ?? _status ?? '', + style: TextStyle( + fontSize: 11.5, + color: _error == null ? context.jz.text2 : AppTheme.red, + ), + ), + ), + ], + const SizedBox(height: 18), + if (_working && _downloader.isDownloading && !widget.forced) + SizedBox( + width: double.infinity, + child: JzActionButton( + label: '取消下载', + secondary: true, + onPressed: _cancelDownload, + ), + ) + else + Row( + children: [ + if (!widget.forced) ...[ + Expanded( + child: JzActionButton( + label: '忽略此版本', + secondary: true, + onPressed: _working ? null : _ignore, + ), + ), + const SizedBox(width: 10), + ], + Expanded( + child: JzActionButton( + label: UpdateConfig.canInstallInApp + ? (_downloadedPath == null ? '下载并安装' : '继续安装') + : '立即更新', + loading: _working, + onPressed: _working ? null : _update, + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} + +class _UpdateProgressBar extends StatelessWidget { + final UpdateDownloadProgress progress; + const _UpdateProgressBar({required this.progress}); + + @override + Widget build(BuildContext context) { + final fraction = progress.fraction ?? 0; + return Column( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: SizedBox( + height: 7, + child: Stack( + fit: StackFit.expand, + children: [ + ColoredBox(color: context.jz.line), + FractionallySizedBox( + alignment: Alignment.centerLeft, + widthFactor: fraction, + child: const ColoredBox(color: AppTheme.primary), + ), + ], + ), + ), + ), + const SizedBox(height: 6), + Row( + children: [ + Text( + progress.total > 0 + ? '${(fraction * 100).toStringAsFixed(0)}%' + : _formatBytes(progress.received), + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + const Spacer(), + Text( + '${_formatBytes(progress.bytesPerSecond.round())}/s', + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + ], + ), + ], + ); + } +} + +String _formatBytes(int bytes) { + if (bytes >= 1024 * 1024) { + return '${(bytes / 1024 / 1024).toStringAsFixed(1)} MB'; + } + if (bytes >= 1024) { + return '${(bytes / 1024).toStringAsFixed(1)} KB'; + } + return '$bytes B'; +} diff --git a/frontend/lib/shared/version.dart b/frontend/lib/shared/version.dart new file mode 100644 index 0000000..e70da08 --- /dev/null +++ b/frontend/lib/shared/version.dart @@ -0,0 +1,23 @@ +import 'package:package_info_plus/package_info_plus.dart'; + +class AppVersion { + AppVersion._(); + + static const String buildId = String.fromEnvironment( + 'APP_VERSION', + defaultValue: 'dev', + ); + + static PackageInfo? _packageInfo; + + static Future initialize() async { + _packageInfo ??= await PackageInfo.fromPlatform(); + } + + static String get versionName => _packageInfo?.version ?? '0.0.0'; + + static int get buildNumber => + int.tryParse(_packageInfo?.buildNumber ?? '') ?? 0; + + static String get display => 'v$versionName ($buildNumber)'; +} diff --git a/frontend/lib/shared/widgets/ai_access_gate.dart b/frontend/lib/shared/widgets/ai_access_gate.dart new file mode 100644 index 0000000..771a5b6 --- /dev/null +++ b/frontend/lib/shared/widgets/ai_access_gate.dart @@ -0,0 +1,143 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:miaoji_zhang/shared/services/session_store.dart'; +import 'package:miaoji_zhang/shared/services/sync_service.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +enum AiAccessState { guest, reauthenticate, cloudDisabled } + +AiAccessState? currentAiAccessState() { + final session = SessionStore.instance; + if (session.isGuest) return AiAccessState.guest; + if (session.needsReauth) return AiAccessState.reauthenticate; + if (!session.cloudSyncEnabled) return AiAccessState.cloudDisabled; + return null; +} + +class AiAccessGate extends StatefulWidget { + final AiAccessState state; + final Future Function()? onAction; + + const AiAccessGate({super.key, required this.state, this.onAction}); + + @override + State createState() => _AiAccessGateState(); +} + +class _AiAccessGateState extends State { + bool _busy = false; + + String get _title => switch (widget.state) { + AiAccessState.guest => '登录后使用 AI 助手', + AiAccessState.reauthenticate => '登录状态已过期', + AiAccessState.cloudDisabled => 'AI 功能需要云连接', + }; + + String get _message => switch (widget.state) { + AiAccessState.guest => '游客账单会继续安全保存在本机。登录后即可使用 AI 聊天、语音解析和图片识别。', + AiAccessState.reauthenticate => '本地记账不受影响。重新登录后可以继续使用 AI 和云同步。', + AiAccessState.cloudDisabled => '当前账号仅使用本地数据。开启云同步后才能发送 AI 消息。', + }; + + String get _actionLabel => switch (widget.state) { + AiAccessState.guest => '登录后使用', + AiAccessState.reauthenticate => '重新登录', + AiAccessState.cloudDisabled => '开启云同步', + }; + + Future _act() async { + if (_busy) return; + if (widget.onAction != null) { + await widget.onAction!(); + return; + } + if (widget.state != AiAccessState.cloudDisabled) { + if (mounted) { + context.go( + Uri(path: '/login', queryParameters: {'notice': _title}).toString(), + ); + } + return; + } + + setState(() => _busy = true); + try { + await SessionStore.instance.setCloudSyncEnabled(true); + await SyncService.instance.run(); + } finally { + if (mounted) setState(() => _busy = false); + } + } + + @override + Widget build(BuildContext context) { + return Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(28), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 420), + child: Card( + child: Padding( + padding: const EdgeInsets.fromLTRB(24, 28, 24, 24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 62, + height: 62, + decoration: BoxDecoration( + color: context.jz.aiBackground, + borderRadius: BorderRadius.circular(20), + ), + child: Center( + child: AppIcons.icon( + AppIcons.sparkle, + size: 29, + color: AppTheme.ai, + ), + ), + ), + SizedBox(height: 18), + Text( + _title, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.w800), + ), + SizedBox(height: 9), + Text( + _message, + textAlign: TextAlign.center, + style: TextStyle( + color: context.jz.text2, + fontSize: 12.5, + height: 1.6, + ), + ), + SizedBox(height: 22), + SizedBox( + width: double.infinity, + child: JzActionButton( + label: _actionLabel, + loading: _busy, + onPressed: _busy ? null : _act, + ), + ), + if (widget.state == AiAccessState.guest) ...[ + SizedBox(height: 12), + Text( + '无需登录也可以继续手动记账、管理预算和查看统计', + textAlign: TextAlign.center, + style: TextStyle(fontSize: 10.5, color: context.jz.text3), + ), + ], + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/frontend/lib/shared/widgets/app_controls.dart b/frontend/lib/shared/widgets/app_controls.dart new file mode 100644 index 0000000..729464d --- /dev/null +++ b/frontend/lib/shared/widgets/app_controls.dart @@ -0,0 +1,769 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; + +class JzSheetHeader extends StatelessWidget { + final String title; + final String? subtitle; + const JzSheetHeader({super.key, required this.title, this.subtitle}); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + width: 38, + height: 4, + margin: const EdgeInsets.only(top: 10, bottom: 18), + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(2), + ), + ), + Text( + title, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.w800), + ), + if (subtitle != null) ...[ + SizedBox(height: 6), + Text( + subtitle!, + textAlign: TextAlign.center, + style: TextStyle( + color: context.jz.text2, + fontSize: 12.5, + height: 1.5, + ), + ), + ], + ], + ); + } +} + +class JzActionButton extends StatelessWidget { + final String label; + final VoidCallback? onPressed; + final bool secondary; + final bool destructive; + final bool loading; + final Widget? icon; + + const JzActionButton({ + super.key, + required this.label, + required this.onPressed, + this.secondary = false, + this.destructive = false, + this.loading = false, + this.icon, + }); + + @override + Widget build(BuildContext context) { + final foreground = destructive ? AppTheme.red : AppTheme.primaryDeep; + final indicator = loading + ? SizedBox( + width: 17, + height: 17, + child: CircularProgressIndicator(strokeWidth: 2, color: foreground), + ) + : icon ?? const SizedBox.shrink(); + if (secondary) { + return OutlinedButton.icon( + onPressed: loading ? null : onPressed, + icon: indicator, + label: Text(label), + style: OutlinedButton.styleFrom( + foregroundColor: foreground, + backgroundColor: destructive + ? context.jz.expenseBackground + : context.jz.card, + side: BorderSide( + color: destructive + ? AppTheme.red.withValues(alpha: 0.25) + : context.jz.line, + ), + ), + ); + } + return FilledButton.icon( + onPressed: loading ? null : onPressed, + icon: loading + ? SizedBox( + width: 17, + height: 17, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : indicator, + label: Text(label), + style: FilledButton.styleFrom( + backgroundColor: destructive ? AppTheme.red : AppTheme.primary, + ), + ); + } +} + +class JzOption { + final T value; + final String label; + final String? subtitle; + final Widget? leading; + + const JzOption({ + required this.value, + required this.label, + this.subtitle, + this.leading, + }); +} + +Future showJzOptionSheet( + BuildContext context, { + required String title, + String? subtitle, + required List> options, + T? selected, +}) { + return showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => SafeArea( + child: Container( + constraints: BoxConstraints( + maxHeight: MediaQuery.sizeOf(sheetContext).height * 0.72, + ), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: JzSheetHeader(title: title, subtitle: subtitle), + ), + Flexible( + child: ListView.separated( + shrinkWrap: true, + padding: const EdgeInsets.fromLTRB(16, 12, 16, 20), + itemCount: options.length, + separatorBuilder: (_, __) => SizedBox(height: 7), + itemBuilder: (_, index) { + final option = options[index]; + final active = option.value == selected; + return Semantics( + selected: active, + button: true, + child: InkWell( + onTap: () => Navigator.pop(sheetContext, option.value), + borderRadius: BorderRadius.circular(14), + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 14, + vertical: 12, + ), + decoration: BoxDecoration( + color: active + ? context.jz.primaryBackground + : context.jz.background, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: active ? AppTheme.primary : context.jz.line, + ), + ), + child: Row( + children: [ + if (option.leading != null) ...[ + option.leading!, + SizedBox(width: 11), + ], + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + option.label, + style: TextStyle( + fontSize: 13.5, + fontWeight: active + ? FontWeight.w700 + : FontWeight.w600, + color: active + ? AppTheme.primaryDeep + : context.jz.text, + ), + ), + if (option.subtitle != null) ...[ + SizedBox(height: 3), + Text( + option.subtitle!, + style: TextStyle( + fontSize: 11, + color: context.jz.text3, + ), + ), + ], + ], + ), + ), + if (active) + Icon( + Icons.check_rounded, + color: AppTheme.primary, + size: 20, + ), + ], + ), + ), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ); +} + +Future showJzConfirmSheet( + BuildContext context, { + required String title, + required String message, + String confirmLabel = '确定', + String cancelLabel = '取消', + bool destructive = false, + Widget? content, +}) async { + final result = await showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => SafeArea( + child: Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.viewInsetsOf(sheetContext).bottom, + ), + child: Container( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 18), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + JzSheetHeader(title: title, subtitle: message), + if (content != null) ...[SizedBox(height: 14), content], + SizedBox(height: 20), + Row( + children: [ + Expanded( + child: JzActionButton( + label: cancelLabel, + secondary: true, + onPressed: () => Navigator.pop(sheetContext, false), + ), + ), + SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: confirmLabel, + destructive: destructive, + onPressed: () => Navigator.pop(sheetContext, true), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + return result == true; +} + +Future showJzTextInputSheet( + BuildContext context, { + required String title, + required String label, + String? subtitle, + String? initialValue, + bool obscureText = false, + int? maxLength, + String confirmLabel = '确定', +}) async { + final controller = TextEditingController(text: initialValue); + final result = await showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) => SafeArea( + child: Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.viewInsetsOf(sheetContext).bottom, + ), + child: Container( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 18), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + JzSheetHeader(title: title, subtitle: subtitle), + SizedBox(height: 16), + TextField( + controller: controller, + autofocus: true, + obscureText: obscureText, + maxLength: maxLength, + textInputAction: TextInputAction.done, + onSubmitted: (_) => + Navigator.pop(sheetContext, controller.text.trim()), + decoration: InputDecoration(labelText: label), + ), + SizedBox(height: 14), + SizedBox( + width: double.infinity, + child: JzActionButton( + label: confirmLabel, + onPressed: () => + Navigator.pop(sheetContext, controller.text.trim()), + ), + ), + ], + ), + ), + ), + ), + ); + controller.dispose(); + return result; +} + +Future showJzDateTimeSheet( + BuildContext context, { + required DateTime initial, + DateTime? firstDate, + DateTime? lastDate, + String title = '选择日期和时间', +}) { + final minimum = firstDate ?? DateTime(2000); + final maximum = lastDate ?? ShanghaiTime.now.add(const Duration(days: 365)); + return showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (sheetContext) { + var date = DateUtils.dateOnly(initial); + var hour = initial.hour; + var minute = initial.minute; + return StatefulBuilder( + builder: (context, setSheetState) => SafeArea( + child: Container( + constraints: BoxConstraints( + maxHeight: MediaQuery.sizeOf(context).height * 0.86, + ), + padding: const EdgeInsets.fromLTRB(16, 0, 16, 16), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + JzSheetHeader(title: title), + Flexible( + child: CalendarDatePicker( + initialDate: date.isBefore(minimum) + ? minimum + : date.isAfter(maximum) + ? maximum + : date, + firstDate: minimum, + lastDate: maximum, + onDateChanged: (value) => setSheetState(() => date = value), + ), + ), + Container( + height: 92, + padding: const EdgeInsets.symmetric(horizontal: 18), + decoration: BoxDecoration( + color: context.jz.background, + borderRadius: BorderRadius.circular(14), + border: Border.all(color: context.jz.line), + ), + child: Row( + children: [ + Text( + '时间', + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w700, + ), + ), + Spacer(), + _TimeWheel( + value: hour, + count: 24, + onChanged: (value) => setSheetState(() => hour = value), + ), + Text( + ':', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w800, + ), + ), + _TimeWheel( + value: minute, + count: 60, + onChanged: (value) => + setSheetState(() => minute = value), + ), + ], + ), + ), + SizedBox(height: 14), + Row( + children: [ + Expanded( + child: JzActionButton( + label: '取消', + secondary: true, + onPressed: () => Navigator.pop(sheetContext), + ), + ), + SizedBox(width: 10), + Expanded( + child: JzActionButton( + label: '完成', + onPressed: () => Navigator.pop( + sheetContext, + DateTime( + date.year, + date.month, + date.day, + hour, + minute, + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ); + }, + ); +} + +class JzSegmentedControl extends StatelessWidget { + final T value; + final List> options; + final ValueChanged? onChanged; + + const JzSegmentedControl({ + super.key, + required this.value, + required this.options, + required this.onChanged, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(3), + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: options.map((option) { + final selected = option.value == value; + return Expanded( + child: Semantics( + selected: selected, + button: true, + child: InkWell( + onTap: onChanged == null + ? null + : () => onChanged!(option.value), + borderRadius: BorderRadius.circular(10), + child: AnimatedContainer( + duration: const Duration(milliseconds: 180), + curve: Curves.easeOutCubic, + padding: const EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + color: selected ? context.jz.card : Colors.transparent, + borderRadius: BorderRadius.circular(10), + border: Border.all( + color: selected ? context.jz.line : Colors.transparent, + ), + ), + child: Text( + option.label, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 13.5, + fontWeight: selected ? FontWeight.w800 : FontWeight.w500, + color: selected + ? value == 'income' + ? AppTheme.primaryDeep + : context.jz.text + : context.jz.text2, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } +} + +class JzSwitchTile extends StatelessWidget { + final bool value; + final String title; + final String? subtitle; + final ValueChanged? onChanged; + + const JzSwitchTile({ + super.key, + required this.value, + required this.title, + this.subtitle, + required this.onChanged, + }); + + @override + Widget build(BuildContext context) { + return Semantics( + toggled: value, + button: true, + label: title, + child: InkWell( + onTap: onChanged == null ? null : () => onChanged!(!value), + borderRadius: BorderRadius.circular(14), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + ), + ), + if (subtitle != null) ...[ + SizedBox(height: 3), + Text( + subtitle!, + style: TextStyle( + fontSize: 11.5, + color: context.jz.text3, + ), + ), + ], + ], + ), + ), + SizedBox(width: 12), + AnimatedContainer( + duration: const Duration(milliseconds: 180), + width: 46, + height: 27, + padding: const EdgeInsets.all(3), + decoration: BoxDecoration( + color: value ? context.jz.primaryBackground : context.jz.line, + borderRadius: BorderRadius.circular(14), + border: Border.all( + color: value ? AppTheme.primary : context.jz.text3, + ), + ), + child: AnimatedAlign( + duration: const Duration(milliseconds: 180), + curve: Curves.easeOutCubic, + alignment: value + ? Alignment.centerRight + : Alignment.centerLeft, + child: Container( + width: 19, + height: 19, + decoration: BoxDecoration( + color: value ? AppTheme.primary : context.jz.card, + shape: BoxShape.circle, + ), + ), + ), + ), + ], + ), + ), + ), + ); + } +} + +class JzSlider extends StatelessWidget { + final double value; + final double min; + final double max; + final Color color; + final ValueChanged? onChanged; + + const JzSlider({ + super.key, + required this.value, + this.min = 0, + this.max = 100, + this.color = AppTheme.primary, + required this.onChanged, + }); + + double get _fraction => + max <= min ? 0 : ((value - min) / (max - min)).clamp(0.0, 1.0); + + @override + Widget build(BuildContext context) { + void update(double x, double width) { + if (onChanged == null || width <= 0) return; + final fraction = (x / width).clamp(0.0, 1.0); + onChanged!(min + (max - min) * fraction); + } + + return Semantics( + slider: true, + value: value.round().toString(), + increasedValue: (value + 5).clamp(min, max).round().toString(), + decreasedValue: (value - 5).clamp(min, max).round().toString(), + onIncrease: onChanged == null + ? null + : () => onChanged!((value + 5).clamp(min, max)), + onDecrease: onChanged == null + ? null + : () => onChanged!((value - 5).clamp(min, max)), + child: LayoutBuilder( + builder: (context, constraints) { + final width = constraints.maxWidth; + final thumbLeft = (width - 24) * _fraction; + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTapDown: onChanged == null + ? null + : (details) => update(details.localPosition.dx, width), + onHorizontalDragUpdate: onChanged == null + ? null + : (details) => update(details.localPosition.dx, width), + child: SizedBox( + height: 36, + child: Stack( + alignment: Alignment.centerLeft, + children: [ + Container( + height: 6, + decoration: BoxDecoration( + color: context.jz.line, + borderRadius: BorderRadius.circular(3), + ), + ), + FractionallySizedBox( + widthFactor: _fraction, + child: Container( + height: 6, + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(3), + ), + ), + ), + Positioned( + left: thumbLeft, + child: Container( + width: 24, + height: 24, + decoration: BoxDecoration( + color: context.jz.card, + shape: BoxShape.circle, + border: Border.all(color: color, width: 2), + boxShadow: const [ + BoxShadow( + color: Color(0x1A191F26), + blurRadius: 5, + offset: Offset(0, 2), + ), + ], + ), + ), + ), + ], + ), + ), + ); + }, + ), + ); + } +} + +class _TimeWheel extends StatelessWidget { + final int value; + final int count; + final ValueChanged onChanged; + const _TimeWheel({ + required this.value, + required this.count, + required this.onChanged, + }); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 52, + child: ListWheelScrollView.useDelegate( + controller: FixedExtentScrollController(initialItem: value), + itemExtent: 34, + physics: const FixedExtentScrollPhysics(), + onSelectedItemChanged: (index) { + HapticFeedback.selectionClick(); + onChanged(index); + }, + childDelegate: ListWheelChildBuilderDelegate( + childCount: count, + builder: (_, index) => Center( + child: Text( + index.toString().padLeft(2, '0'), + style: TextStyle( + fontSize: index == value ? 18 : 13, + fontWeight: index == value ? FontWeight.w800 : FontWeight.w500, + color: index == value ? AppTheme.primaryDeep : context.jz.text3, + ), + ), + ), + ), + ), + ); + } +} diff --git a/frontend/lib/shared/widgets/app_icons.dart b/frontend/lib/shared/widgets/app_icons.dart new file mode 100644 index 0000000..547a779 --- /dev/null +++ b/frontend/lib/shared/widgets/app_icons.dart @@ -0,0 +1,183 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CategoryIconMeta { + final String key; + final String label; + final String group; + + const CategoryIconMeta(this.key, this.label, this.group); +} + +/// 全套自绘 SVG 图标(来自 design/ui-mockup.html v0.5) +/// 使用方式:AppIcons.cat → SvgPicture.asset(AppIcons.cat, colorFilter: ..., width: 24) +class AppIcons { + AppIcons._(); + + static const _p = 'assets/icons/'; + + // AI 形象 + static const cat = '${_p}i-cat.svg'; + static const dog = '${_p}i-dog.svg'; + static const robot = '${_p}i-robot.svg'; + + // 底部导航 + static const home = '${_p}i-home.svg'; + static const chart = '${_p}i-chart.svg'; + static const chat = '${_p}i-chat.svg'; + static const user = '${_p}i-user.svg'; + static const plus = '${_p}i-plus.svg'; + + // 分类图标 + static const food = '${_p}i-food.svg'; + static const cup = '${_p}i-cup.svg'; + static const cart = '${_p}i-cart.svg'; + static const metro = '${_p}i-metro.svg'; + static const house = '${_p}i-house.svg'; + static const game = '${_p}i-game.svg'; + static const pill = '${_p}i-pill.svg'; + static const book = '${_p}i-book.svg'; + static const shirt = '${_p}i-shirt.svg'; + static const gift = '${_p}i-gift.svg'; + static const plane = '${_p}i-plane.svg'; + static const money = '${_p}i-money.svg'; + static const tag = '${_p}i-tag.svg'; + + // 扩展 + static const wallet = '${_p}i-wallet.svg'; + static const target = '${_p}i-target.svg'; + static const sparkle = '${_p}i-sparkle.svg'; + static const briefcase = '${_p}i-briefcase.svg'; + static const cardIcon = '${_p}i-card.svg'; + static const search = '${_p}i-search.svg'; + static const bell = '${_p}i-bell.svg'; + static const eye = '${_p}i-eye.svg'; + static const gear = '${_p}i-gear.svg'; + static const mic = '${_p}i-mic.svg'; + static const smile = '${_p}i-smile.svg'; + static const camera = '${_p}i-camera.svg'; + static const fire = '${_p}i-fire.svg'; + static const chevronDown = '${_p}i-chev-d.svg'; + static const chevronRight = '${_p}i-chev-r.svg'; + static const close = '${_p}i-close.svg'; + static const check = '${_p}i-check.svg'; + static const exportIcon = '${_p}i-export.svg'; + static const cloud = '${_p}i-cloud.svg'; + static const swap = '${_p}i-swap.svg'; + static const receipt = '${_p}i-receipt.svg'; + static const edit = '${_p}i-edit.svg'; + static const trash = '${_p}i-trash.svg'; + static const drag = '${_p}i-drag.svg'; + static const offline = '${_p}i-offline.svg'; + static const wave = '${_p}i-wave.svg'; + static const scan = '${_p}i-scan.svg'; + + // 扩展分类图标 + static const car = '${_p}i-car.svg'; + static const baby = '${_p}i-baby.svg'; + static const pet = '${_p}i-pet.svg'; + static const phone = '${_p}i-phone.svg'; + static const wifi = '${_p}i-wifi.svg'; + static const sport = '${_p}i-sport.svg'; + static const beauty = '${_p}i-beauty.svg'; + static const insurance = '${_p}i-shield.svg'; + static const tax = '${_p}i-tax.svg'; + static const rent = '${_p}i-rent.svg'; + static const refund = '${_p}i-refund.svg'; + static const interest = '${_p}i-interest.svg'; + + // 映射 iconKey → asset path + static const keyMap = { + 'food': food, + 'cup': cup, + 'cart': cart, + 'metro': metro, + 'house': house, + 'game': game, + 'pill': pill, + 'book': book, + 'shirt': shirt, + 'gift': gift, + 'plane': plane, + 'tag': tag, + 'money': money, + 'briefcase': briefcase, + 'chart': chart, + 'card': cardIcon, + 'sparkle': sparkle, + 'wallet': wallet, + 'cat': cat, + 'dog': dog, + 'robot': robot, + 'target': target, + 'camera': camera, + 'receipt': receipt, + 'car': car, + 'baby': baby, + 'pet': pet, + 'phone': phone, + 'wifi': wifi, + 'sport': sport, + 'beauty': beauty, + 'insurance': insurance, + 'tax': tax, + 'rent': rent, + 'refund': refund, + 'interest': interest, + }; + + static const categoryCatalog = [ + CategoryIconMeta('food', '餐饮', '日常生活'), + CategoryIconMeta('cup', '饮品', '日常生活'), + CategoryIconMeta('cart', '购物', '日常生活'), + CategoryIconMeta('house', '住房', '日常生活'), + CategoryIconMeta('rent', '房租', '日常生活'), + CategoryIconMeta('metro', '公交地铁', '交通出行'), + CategoryIconMeta('car', '汽车', '交通出行'), + CategoryIconMeta('plane', '旅行', '交通出行'), + CategoryIconMeta('phone', '手机数码', '日常生活'), + CategoryIconMeta('wifi', '网络通信', '日常生活'), + CategoryIconMeta('shirt', '服饰', '日常生活'), + CategoryIconMeta('beauty', '美容', '日常生活'), + CategoryIconMeta('pill', '医疗', '健康成长'), + CategoryIconMeta('sport', '运动', '健康成长'), + CategoryIconMeta('book', '学习', '健康成长'), + CategoryIconMeta('baby', '育儿', '健康成长'), + CategoryIconMeta('pet', '宠物', '健康成长'), + CategoryIconMeta('game', '娱乐', '休闲人情'), + CategoryIconMeta('gift', '礼物人情', '休闲人情'), + CategoryIconMeta('wallet', '钱包', '资金收入'), + CategoryIconMeta('money', '工资', '资金收入'), + CategoryIconMeta('briefcase', '工作兼职', '资金收入'), + CategoryIconMeta('chart', '投资理财', '资金收入'), + CategoryIconMeta('interest', '利息收益', '资金收入'), + CategoryIconMeta('refund', '退款', '资金收入'), + CategoryIconMeta('card', '银行卡', '资金收入'), + CategoryIconMeta('insurance', '保险', '资金收入'), + CategoryIconMeta('tax', '税费', '资金收入'), + CategoryIconMeta('receipt', '票据账单', '其他'), + CategoryIconMeta('camera', '摄影', '其他'), + CategoryIconMeta('target', '目标', '其他'), + CategoryIconMeta('sparkle', '奖励', '其他'), + CategoryIconMeta('tag', '其他', '其他'), + ]; + + static String avatarAsset(String key) => keyMap[key] ?? cat; + + /// 返回 SvgPicture widget + static Widget icon(String asset, {double size = 24, Color? color}) { + return SvgPicture.asset( + asset, + width: size, + height: size, + colorFilter: color != null + ? ColorFilter.mode(color, BlendMode.srcIn) + : null, + ); + } + + /// 按 iconKey 返回 SvgPicture + static Widget byKey(String key, {double size = 24, Color? color}) { + return icon(keyMap[key] ?? tag, size: size, color: color); + } +} diff --git a/frontend/lib/shared/widgets/async_error_view.dart b/frontend/lib/shared/widgets/async_error_view.dart new file mode 100644 index 0000000..9487023 --- /dev/null +++ b/frontend/lib/shared/widgets/async_error_view.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; + +class AsyncErrorView extends StatelessWidget { + final String message; + final Future Function() onRetry; + + const AsyncErrorView({ + super.key, + required this.message, + required this.onRetry, + }); + + @override + Widget build(BuildContext context) { + return Center( + child: Padding( + padding: const EdgeInsets.all(32), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.cloud_off_outlined, size: 42, color: context.jz.text3), + SizedBox(height: 14), + Text( + message, + textAlign: TextAlign.center, + style: TextStyle( + color: context.jz.text2, + fontSize: 13, + height: 1.5, + ), + ), + SizedBox(height: 16), + FilledButton.icon( + onPressed: onRetry, + icon: Icon(Icons.refresh, size: 18), + label: Text('重试'), + ), + ], + ), + ), + ); + } +} diff --git a/frontend/lib/shared/widgets/brand_logo.dart b/frontend/lib/shared/widgets/brand_logo.dart new file mode 100644 index 0000000..e7d4381 --- /dev/null +++ b/frontend/lib/shared/widgets/brand_logo.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; + +class BrandLogo extends StatelessWidget { + final double size; + final bool framed; + + const BrandLogo({super.key, this.size = 88, this.framed = true}); + + @override + Widget build(BuildContext context) { + final image = ClipRRect( + borderRadius: BorderRadius.circular(size * 0.24), + child: Image.asset( + 'assets/branding/jizhi-app-icon-centered.png', + width: size, + height: size, + fit: BoxFit.cover, + filterQuality: FilterQuality.high, + semanticLabel: '记之', + ), + ); + if (!framed) return image; + return Container( + padding: const EdgeInsets.all(2), + decoration: BoxDecoration( + color: context.jz.card, + borderRadius: BorderRadius.circular(size * 0.26), + border: Border.all(color: context.jz.line), + boxShadow: [ + BoxShadow( + color: context.jz.text.withValues(alpha: 0.08), + blurRadius: 18, + offset: const Offset(0, 8), + ), + ], + ), + child: image, + ); + } +} diff --git a/frontend/lib/shared/widgets/category_icon.dart b/frontend/lib/shared/widgets/category_icon.dart new file mode 100644 index 0000000..f4f5008 --- /dev/null +++ b/frontend/lib/shared/widgets/category_icon.dart @@ -0,0 +1,213 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +class CategoryColorMeta { + final String key; + final String label; + final Color background; + final Color foreground; + + const CategoryColorMeta({ + required this.key, + required this.label, + required this.background, + required this.foreground, + }); +} + +const categoryColorCatalog = [ + CategoryColorMeta( + key: 'mint', + label: '薄荷', + background: Color(0xFFE3F7F0), + foreground: Color(0xFF008E69), + ), + CategoryColorMeta( + key: 'teal', + label: '青绿', + background: Color(0xFFE1F3F1), + foreground: Color(0xFF087F72), + ), + CategoryColorMeta( + key: 'aqua', + label: '水绿', + background: Color(0xFFE4F6F5), + foreground: Color(0xFF168C87), + ), + CategoryColorMeta( + key: 'cyan', + label: '青蓝', + background: Color(0xFFE3F4F7), + foreground: Color(0xFF187F91), + ), + CategoryColorMeta( + key: 'sky', + label: '天蓝', + background: Color(0xFFE7F2FA), + foreground: Color(0xFF327EAD), + ), + CategoryColorMeta( + key: 'blue', + label: '蓝色', + background: Color(0xFFE8EFFB), + foreground: Color(0xFF416FAE), + ), + CategoryColorMeta( + key: 'navy', + label: '海军蓝', + background: Color(0xFFE8ECF3), + foreground: Color(0xFF425A7B), + ), + CategoryColorMeta( + key: 'indigo', + label: '靛蓝', + background: Color(0xFFEBEDFA), + foreground: Color(0xFF5864B1), + ), + CategoryColorMeta( + key: 'violet', + label: '紫罗兰', + background: Color(0xFFF0EBF8), + foreground: Color(0xFF7656A8), + ), + CategoryColorMeta( + key: 'plum', + label: '梅紫', + background: Color(0xFFF5EAF2), + foreground: Color(0xFF94547E), + ), + CategoryColorMeta( + key: 'orchid', + label: '兰紫', + background: Color(0xFFF6EAF4), + foreground: Color(0xFFA45291), + ), + CategoryColorMeta( + key: 'rose', + label: '玫瑰', + background: Color(0xFFF9E9EE), + foreground: Color(0xFFB94E6B), + ), + CategoryColorMeta( + key: 'coral', + label: '珊瑚', + background: Color(0xFFFBEAE6), + foreground: Color(0xFFC45B49), + ), + CategoryColorMeta( + key: 'red', + label: '朱红', + background: Color(0xFFFBE9E8), + foreground: Color(0xFFC4473F), + ), + CategoryColorMeta( + key: 'orange', + label: '橙色', + background: Color(0xFFFCEDE2), + foreground: Color(0xFFBE681F), + ), + CategoryColorMeta( + key: 'amber', + label: '琥珀', + background: Color(0xFFFAF0DB), + foreground: Color(0xFFA66B0E), + ), + CategoryColorMeta( + key: 'peach', + label: '桃色', + background: Color(0xFFFBEDE6), + foreground: Color(0xFFB96B45), + ), + CategoryColorMeta( + key: 'sand', + label: '沙金', + background: Color(0xFFF5F0E4), + foreground: Color(0xFF8C7442), + ), + CategoryColorMeta( + key: 'lime', + label: '青柠', + background: Color(0xFFF0F5E2), + foreground: Color(0xFF71852D), + ), + CategoryColorMeta( + key: 'olive', + label: '橄榄', + background: Color(0xFFEEF0E3), + foreground: Color(0xFF68723C), + ), + CategoryColorMeta( + key: 'forest', + label: '森林', + background: Color(0xFFE6F1E9), + foreground: Color(0xFF39764A), + ), + CategoryColorMeta( + key: 'slate', + label: '石板', + background: Color(0xFFEBEFF0), + foreground: Color(0xFF5F7074), + ), + CategoryColorMeta( + key: 'cocoa', + label: '可可', + background: Color(0xFFF1ECE8), + foreground: Color(0xFF796154), + ), + CategoryColorMeta( + key: 'graphite', + label: '石墨', + background: Color(0xFFEDEEEE), + foreground: Color(0xFF5D6261), + ), +]; + +CategoryColorMeta categoryColorMeta(String? key) => + categoryColorCatalog.firstWhere( + (item) => item.key == key, + orElse: () => categoryColorCatalog.first, + ); + +(Color bg, Color fg) categoryColors(String? colorKey) { + final meta = categoryColorMeta(colorKey); + return (meta.background, meta.foreground); +} + +class CategoryIconBox extends StatelessWidget { + final String iconKey; + final String? colorKey; + final double size; + + const CategoryIconBox({ + super.key, + required this.iconKey, + this.colorKey, + this.size = 36, + }); + + @override + Widget build(BuildContext context) { + final (bg, fg) = categoryColors(colorKey); + return Container( + width: size, + height: size, + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(size * 0.3), + ), + child: Center( + child: AppIcons.byKey(iconKey, size: size * 0.5, color: fg), + ), + ); + } +} + +Widget categoryIconSvg( + String key, { + double size = 24, + Color? color, + String? colorKey, +}) { + final (_, fg) = categoryColors(colorKey); + return AppIcons.byKey(key, size: size, color: color ?? fg); +} diff --git a/frontend/lib/shared/widgets/offline_bar.dart b/frontend/lib/shared/widgets/offline_bar.dart new file mode 100644 index 0000000..4a82fd9 --- /dev/null +++ b/frontend/lib/shared/widgets/offline_bar.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +/// P24 离线状态:顶部提示条 + AI 入口/tab 控制 +class OfflineBar extends StatelessWidget { + const OfflineBar({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8), + color: AppTheme.orange, + child: Row( + children: [ + AppIcons.icon(AppIcons.offline, size: 16, color: Colors.white), + const SizedBox(width: 8), + const Expanded( + child: Text( + '当前无网络 · AI 功能暂不可用 · 手动记账正常', + style: TextStyle(fontSize: 10.5, color: Colors.white), + ), + ), + ], + ), + ); + } +} + +/// 检测是否有网络连接(简化版:同时 ping 后端) +class ConnectivityChecker { + static bool _lastKnown = true; + + static bool get isOnline => _lastKnown; + + static Future check() async { + // 简化实现:future 如果需要真正的网络检测,用 connectivity_plus 包 + // 当前返回上次已知状态 + return _lastKnown; + } + + static void setOffline() => _lastKnown = false; + static void setOnline() => _lastKnown = true; +} diff --git a/frontend/pubspec.lock b/frontend/pubspec.lock new file mode 100644 index 0000000..94f3dc3 --- /dev/null +++ b/frontend/pubspec.lock @@ -0,0 +1,1185 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "8d7ff3948166b8ec5da0fbb5962000926b8e02f2ed9b3e51d1738905fbd4c98d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "93.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: de7148ed2fcec579b19f122c1800933dfa028f6d9fd38a152b04b1516cec120b + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.0.1" + archive: + dependency: "direct main" + description: + name: archive + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.0.9" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.13.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "45d14a0fb23e018d8287c32fc98d726ce466b231928ed9b9200f29bd3ccd39ae" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.0.7" + build_config: + dependency: transitive + description: + name: build_config + sha256: f2c223156a26eea323e6244b85141d76413a80aeee9fe0b380773789fabaf8ae + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: fd754058c342243718d5171a95f352cfc9fcf0cba8cfa26df67cb13a5836db78 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "5367e521935b102bdf1e735d2aab461e36b2edca6517662d088dd04cc39f8d16" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.15.1" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "34e4067d30ce212937df995f03b69992eea683539ceeac7f679a1f1eba055b56" + url: "https://pub.flutter-io.cn" + source: hosted + version: "8.12.6" + characters: + dependency: transitive + description: + name: characters + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.4" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.2" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "92c9c43c383bfa1c32079d3bc492d55d6d4318044b7b47edaff8971cbb555c51" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.5+4" + crypto: + dependency: "direct main" + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.9" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "29f7ecc274a86d32920b1d9cfc7502fa87220da41ec60b55f329559d5732e2b2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.7" + dio: + dependency: "direct main" + description: + name: dio + sha256: ea2bad3c89a27635ce2d85cce4d6b199da49a5a48ec77b03e45b65a3b90922b0 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.10.0" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: dd58dc3861eb36edb13b217efc006a1c21e5bbc341de8c229b85634fa5e362e4 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + ffi_leak_tracker: + dependency: transitive + description: + name: ffi_leak_tracker + sha256: "4093d4ef9ca06ffe2786e73bfb25e22aa92112b9bb4ec941f11e3e6b61489a97" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.2" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "2567f398e06ac72dcf2e98a0c95df2a9edd03c2c2e0cacd4780f20cdf56263a0" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.4" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "5e0bbe9c312416f1787a68259ea1505b52f258c587f12920422671807c4d618a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.5" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "35e0bd61ebcdb91a3505813b055b09b79dfdc7d0aee9c09a7ba59ae4bb13dc85" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.7.0" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "62197474ae75893a62df75939c777763d39c2bc5f73ce5b88497208bc269abfd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.3+5" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_driver: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.0.0" + flutter_markdown_plus: + dependency: "direct main" + description: + name: flutter_markdown_plus + sha256: fce641d6c2106cc495de1cd603f97a4f9d615a97a64011928ded380dbdade935 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.12" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "3854fe5e3bff0b113c658f260b90c95dea17c92db0f2addeac2e343dd9969785" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.35" + flutter_secure_storage: + dependency: "direct main" + description: + name: flutter_secure_storage + sha256: "7686b1d6a29985dcbb808c59518226e603e3bfa7c0ddfd1a0d00e4cda77c868e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.3.1" + flutter_secure_storage_darwin: + dependency: transitive + description: + name: flutter_secure_storage_darwin + sha256: "82329fa5cdf343773b1b6897dea959105a29f092454259edff92f9f6637e8149" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.2" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: a5f35ddab43cf5c8215d2feb4ce1957851f28c5c37e6f04335066a0602087bf5 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: "073a62b3aeb866ab4ce795f960413948e51e5a42a9b0c8333b6daf5bb3208a1c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: "471951813a97006d899db4948acc654a4f28c440083ea08178935ce20b173ec1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.2.2" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.3" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: "5922b2861e2235a3504896f0d6fa07d84141b480cf52eecd2f42cd25585a9e8a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "17.3.0" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.2" + hooks: + dependency: transitive + description: + name: hooks + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.2" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.6.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: d8402284df184bc05f4a2210c6c23983b0720f4cd87cbd05c5390a78af602667 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.3" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: d5b3e1774af29c9ab00103afb0d4614070f924d2e0057ac867ec98800114793f + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.8.13+17" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "66257a3191ab360d23a55c8241c91a6e329d31e94efa7be9cf7a212e65850214" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.1" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: b9c4a438a9ff4f60808c9cf0039b93a42bb6c2211ef6ebb647394b2b3fa84588 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.8.13+6" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "1f81c5f2046b9ab724f85523e4af65be1d47b038160a8c8deed909762c308ed4" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "86f0f15a309de7e1a552c12df9ce5b59fe927e71385329355aec4776c6a8ec91" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "567e056716333a1647c64bb6bd873cff7622233a5c3f694be28a583d4715690c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.11.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: d248c86554a72b5495a31c56f060cf73a41c7ff541689327b1a7dbccc33adfae + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.5" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.0" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.1" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.12.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: ffcd10cde35a93b2abbbcc26bd9971f4ca93763e8abe78d855e3c4177797e501 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.14.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.flutter-io.cn" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.1.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: ee85086ad7698b42522c6ad42fe195f1b9898e4d974a1af4576c1a3a176cada9 + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.3.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.18" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.13.0" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.17.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: f9c168717100ae6d9fee9ffb0be379bf1f8b26b0f6bcbd4fdddcd931993a6a72 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.19.2" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" + url: "https://pub.flutter-io.cn" + source: hosted + version: "9.4.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: "127e1751e37ffb2ff4658beeaca77bad0c27bf5f932bd3a501c2296926d4b481" + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.2.1" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: db762cb2f4f25ee60fb6359773861b0f199e00b90d237bd85a76a1e806b46ef4 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.0" + path: + dependency: "direct main" + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.6" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.1" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.2" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.2" + posix: + dependency: transitive + description: + name: posix + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.5.0" + process: + dependency: transitive + description: + name: process + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.0.5" + provider: + dependency: "direct main" + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.0" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.6.0" + share_plus: + dependency: "direct main" + description: + name: share_plus + sha256: "02180b01c1237b9706b663d9402b2cf2402b3407f48cce99cc19e3200f095b8a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "13.2.1" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "7f7ae28cf400d13f811e297ff37742dba83b79e0a6f5dce14eec0248274e6ce9" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.1.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.5" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: e8d4762b1e2e8578fc4d0fd548cebf24afd24f49719c08974df92834565e2c53 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.23" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.2" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: ec37cc0e6694374cbef59ed79685572c870a54ede6fa30a3e420feb3adffea02 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.2.3" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "4227d54ceefd0bb8ca4c8fcb96e1719dc53f1ee1b6e2ca9d7a6069da160e4eae" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.12" + source_span: + dependency: transitive + description: + name: source_span + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.10.2" + sqlite3: + dependency: "direct main" + description: + name: sqlite3 + sha256: c73fd75df1332d76a6257f4823ae4df9c791f522b97e4a60cbcad214de1becf4 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.5.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.1" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.8" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.2" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "17bc677f0b301615530dd1d67e0a9828cafa2d0b6b6eae4cd3679b7eac4a273c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.30" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.4.1" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.2" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.5" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.3" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.5" + uuid: + dependency: transitive + description: + name: uuid + sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.6.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "2306c03da2ba81724afeb589c351ebbc0aa7d86005925be8f8735856dbe5e42d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.2" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "142a9146f447d15b10bdc00e21d5f4d83e5b32bb5f8f8f5a04c75311344923a3" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.6" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" + url: "https://pub.flutter-io.cn" + source: hosted + version: "15.2.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.3" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" + win32: + dependency: transitive + description: + name: win32 + sha256: ba6f4bba816c8d7e3c1580e170f3786d216951cc6b94babc3b814c08d2cb2738 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: "67f0aff7be013d107995e9b75bf4e7f2c3ef2dfdb2c8e68024bba0a7fd5756a4" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.11.0 <4.0.0" + flutter: ">=3.38.4" diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml new file mode 100644 index 0000000..22ce866 --- /dev/null +++ b/frontend/pubspec.yaml @@ -0,0 +1,114 @@ +name: miaoji_zhang +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.2.5+132 + +environment: + sdk: ^3.11.0 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + dio: ^5.10.0 + provider: ^6.1.5+1 + go_router: ^17.3.0 + shared_preferences: ^2.5.5 + flutter_secure_storage: ^10.3.1 + json_annotation: ^4.12.0 + flutter_svg: ^2.3.0 + image_picker: ^1.2.3 + path_provider: ^2.1.6 + share_plus: ^13.2.1 + archive: ^4.0.9 + path: ^1.9.1 + sqlite3: ^3.4.0 + crypto: ^3.0.7 + package_info_plus: ^10.2.1 + url_launcher: ^6.3.2 + flutter_markdown_plus: ^1.0.12 + +dev_dependencies: + flutter_test: + sdk: flutter + integration_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^6.0.0 + json_serializable: ^6.14.0 + build_runner: ^2.15.1 + +hooks: + user_defines: + sqlite3: + source: sqlcipher +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + assets: + - assets/icons/ + - assets/branding/ + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package + diff --git a/frontend/test/api_models_test.dart b/frontend/test/api_models_test.dart new file mode 100644 index 0000000..93a0d67 --- /dev/null +++ b/frontend/test/api_models_test.dart @@ -0,0 +1,137 @@ +import 'dart:convert'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/api/sse_frame_accumulator.dart'; +import 'package:miaoji_zhang/shared/services/current_ledger_store.dart'; +import 'package:miaoji_zhang/shared/widgets/app_icons.dart'; + +void main() { + test( + 'SSE framing preserves split UTF-8 characters and trailing events', + () async { + const source = 'data: {"t":"收入"}\r\n\r\ndata: {"done":true,"c":"收入100"}'; + final bytes = utf8.encode(source); + final chunks = >[ + bytes.sublist(0, 13), + bytes.sublist(13, 14), + bytes.sublist(14, 21), + bytes.sublist(21), + ]; + final accumulator = SseFrameAccumulator(); + final frames = []; + + await for (final chunk in Stream>.fromIterable( + chunks, + ).transform(const Utf8Decoder())) { + frames.addAll(accumulator.add(chunk)); + } + frames.addAll(accumulator.close()); + + expect(frames, hasLength(2)); + expect(frames.first, contains('收入')); + expect(frames.last, contains('"done":true')); + }, + ); + + test('transaction and ledger DTOs retain type, deletion and UTC instant', () { + final transaction = TxItem.fromJson({ + 'id': 7, + 'ledgerId': 3, + 'categoryId': 5, + 'categoryName': '工资', + 'categoryIcon': 'money', + 'type': 'income', + 'amount': 100, + 'note': '七月工资', + 'paymentMethod': '银行卡', + 'source': 'ai_chat', + 'sourceText': '我赚了100', + 'occurredAt': '2026-06-30T16:30:00Z', + 'isDeleted': true, + }); + final ledger = LedgerInfo.fromJson({ + 'id': 3, + 'name': '家庭账本', + 'iconKey': 'wallet', + 'isDefault': true, + 'txCount': 9, + }); + + expect(transaction.isIncome, isTrue); + expect(transaction.isDeleted, isTrue); + expect(transaction.occurredAt.toUtc(), DateTime.utc(2026, 6, 30, 16, 30)); + expect(ledger.name, '家庭账本'); + expect(ledger.transactionCount, 9); + }); + + test('budget refinement DTO keeps conversation summary and constraints', () { + final recommendation = BudgetRecommendations.fromJson({ + 'year': 2026, + 'month': 7, + 'suggestedTotal': 130, + 'message': '草稿已调整', + 'adjustmentSummary': '餐饮预算已降低', + 'warnings': ['餐饮不能低于已花 ¥80'], + 'items': [ + { + 'categoryId': 1, + 'categoryName': '餐饮', + 'categoryIcon': 'food', + 'suggestedAmount': 80, + 'currentSpent': 80, + 'historicalAverage': 120, + 'confidence': 'high', + }, + { + 'categoryId': 2, + 'categoryName': '交通', + 'categoryIcon': 'transport', + 'suggestedAmount': 50, + 'currentSpent': 20, + 'historicalAverage': 60, + 'confidence': 'medium', + }, + ], + }); + + expect(recommendation.suggestedTotal, 130); + expect(recommendation.adjustmentSummary, '餐饮预算已降低'); + expect(recommendation.warnings, contains('餐饮不能低于已花 ¥80')); + expect(recommendation.items, hasLength(2)); + }); + test('周报与年报 DTO 保留周期、峰值和 AI 占比', () { + final report = PeriodReport.fromJson({ + 'periodType': 'yearly', + 'periodLabel': '2026年', + 'startDate': '2026-01-01T00:00:00', + 'endDate': '2027-01-01T00:00:00', + 'count': 12, + 'income': 8000, + 'expense': 5600, + 'balance': 2400, + 'aiRatio': 75, + 'peakLabel': '7月', + 'peakAmount': 1300, + 'peakNote': '旅行', + 'topCategory': '餐饮', + 'topCategoryAmount': 1600, + 'topCategoryPercent': 28.57, + 'commentary': '这一年记录得很完整。', + }); + + expect(report.periodType, 'yearly'); + expect(report.peakLabel, '7月'); + expect(report.aiRatio, 75); + expect(report.balance, 2400); + }); + + test('分类图标目录至少 32 个且键值不重复', () { + final keys = AppIcons.categoryCatalog.map((item) => item.key).toList(); + expect(keys.length, greaterThanOrEqualTo(32)); + expect(keys.toSet().length, keys.length); + expect(keys, containsAll(['cart', 'metro', 'house', 'money'])); + expect(keys, isNot(contains('shopping'))); + expect(keys, isNot(contains('transport'))); + }); +} diff --git a/frontend/test/local_export_service_test.dart b/frontend/test/local_export_service_test.dart new file mode 100644 index 0000000..38c666c --- /dev/null +++ b/frontend/test/local_export_service_test.dart @@ -0,0 +1,89 @@ +import 'dart:convert'; + +import 'package:archive/archive.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:miaoji_zhang/shared/services/local_export_service.dart'; + +void main() { + test('local export creates readable CSV and privacy-safe JSON', () { + final bytes = LocalExportService.buildZipFromSnapshot( + { + 'schemaVersion': 1, + 'exportedAt': '2026-07-21T00:00:00.000Z', + 'ledgers': [ + { + 'id': 1, + 'name': '日常账本', + 'iconKey': 'wallet', + 'isDefault': true, + 'updatedAt': '2026-07-21T00:00:00.000Z', + }, + ], + 'categories': [ + { + 'id': 2, + 'name': '餐饮', + 'iconKey': 'food', + 'colorKey': 'coral', + 'type': 'expense', + 'sortOrder': 10, + 'isCustom': false, + 'isDeleted': false, + 'updatedAt': '2026-07-21T00:00:00.000Z', + }, + ], + 'transactions': [ + { + 'id': 3, + 'ledgerId': 1, + 'categoryId': 2, + 'categoryName': '餐饮', + 'categoryIcon': 'food', + 'categoryColor': 'coral', + 'type': 'expense', + 'amount': 12.5, + 'note': '午饭,"套餐"\n已报销', + 'paymentMethod': '微信', + 'source': 'manual', + 'sourceText': null, + 'occurredAt': '2026-07-21T04:00:00.000Z', + 'isDeleted': false, + 'updatedAt': '2026-07-21T04:00:00.000Z', + }, + ], + 'budgets': [ + { + 'ledgerId': 1, + 'period': 202607, + 'categoryId': 2, + 'amount': 800.0, + 'recurring': true, + 'updatedAt': '2026-07-21T00:00:00.000Z', + }, + ], + }, + profile: const {'mode': 'guest', 'nickname': '游客'}, + ); + + final archive = ZipDecoder().decodeBytes(bytes); + expect( + archive.map((file) => file.name), + containsAll(['transactions.csv', 'budgets.csv', 'jizhi-backup.json']), + ); + + final transactionCsv = utf8.decode( + archive.findFile('transactions.csv')!.readBytes()!, + ); + expect(transactionCsv, contains('12.50')); + expect(transactionCsv, contains('"午饭,""套餐""\n已报销"')); + + final json = utf8.decode( + archive.findFile('jizhi-backup.json')!.readBytes()!, + ); + final document = jsonDecode(json) as Map; + expect(document['transactions'], hasLength(1)); + expect((document['profile'] as Map)['mode'], 'guest'); + expect(json, isNot(contains('passwordHash'))); + expect(json, isNot(contains('local_db_key'))); + }); +} diff --git a/frontend/test/theme_and_time_test.dart b/frontend/test/theme_and_time_test.dart new file mode 100644 index 0000000..3ae902a --- /dev/null +++ b/frontend/test/theme_and_time_test.dart @@ -0,0 +1,132 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:miaoji_zhang/shared/services/recognition_import_service.dart'; +import 'package:miaoji_zhang/shared/services/recognition_diagnostic_formatter.dart'; +import 'package:miaoji_zhang/shared/services/screenshot_channel.dart'; +import 'package:miaoji_zhang/shared/services/shanghai_time.dart'; +import 'package:miaoji_zhang/shared/theme/theme_store.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + test('上海时区周期边界不受设备时区影响', () { + final civil = ShanghaiTime.toCivil(DateTime.utc(2026, 6, 30, 16, 30)); + expect(civil, DateTime(2026, 7, 1, 0, 30)); + + final month = ShanghaiTime.monthRangeUtc(2026, 7); + expect(month.start, DateTime.utc(2026, 6, 30, 16)); + expect(month.end, DateTime.utc(2026, 7, 31, 16)); + + final week = ShanghaiTime.weekRangeUtc(DateTime(2026, 7, 19)); + expect(week.start, DateTime.utc(2026, 7, 12, 16)); + expect(week.end, DateTime.utc(2026, 7, 19, 16)); + }); + + test('无障碍运行时长不会被当作 Unix 时间戳', () { + final now = DateTime.utc(2026, 7, 22, 8, 30); + expect(RecognitionImportService.validOccurredAtUtc(1234, now: now), now); + expect( + RecognitionImportService.validOccurredAtUtc( + DateTime.utc(2026, 7, 22, 8).millisecondsSinceEpoch, + now: now, + ), + DateTime.utc(2026, 7, 22, 8), + ); + }); + + test('三态主题从本地恢复并持久化', () async { + SharedPreferences.setMockInitialValues({'theme_preference': 'dark'}); + await ThemeStore.instance.initialize(); + expect(ThemeStore.instance.preference, JzThemePreference.dark); + expect(ThemeStore.instance.themeMode, ThemeMode.dark); + + await ThemeStore.instance.setPreference(JzThemePreference.light); + final preferences = await SharedPreferences.getInstance(); + expect(preferences.getString('theme_preference'), 'light'); + expect(ThemeStore.instance.themeMode, ThemeMode.light); + }); + + test('旧版无时区接口时间按 UTC 解释后显示上海时间', () { + expect( + ShanghaiTime.parseUtcInstant('2026-07-22T14:35:00'), + DateTime.utc(2026, 7, 22, 14, 35), + ); + expect( + ShanghaiTime.parseCivil('2026-07-22T14:35:00'), + DateTime(2026, 7, 22, 22, 35), + ); + expect( + ShanghaiTime.parseCivil('2026-07-22T14:35:00Z'), + DateTime(2026, 7, 22, 22, 35), + ); + }); + + test('原生识别候选保留红包分类与金额来源', () { + final candidate = RecognitionCandidate.fromJson({ + 'id': 'candidate-1', + 'clientRequestId': 'recognition-candidate-1', + 'state': 'auto_ready', + 'confidence': 'auto', + 'type': 'income', + 'source': 'local_ocr', + 'appName': '微信', + 'amount': 8.88, + 'occurredAtEpochMs': DateTime.utc( + 2026, + 7, + 22, + 14, + 35, + ).millisecondsSinceEpoch, + 'recognitionKind': 'red_packet_receive', + 'categoryHint': '红包', + 'amountSource': 'result', + 'resultFingerprint': 'abc123', + }); + + expect(candidate.recognitionKind, 'red_packet_receive'); + expect(candidate.categoryHint, '红包'); + expect(candidate.amountSource, 'result'); + expect(candidate.resultFingerprint, 'abc123'); + }); + + test('智能识别诊断摘要能区分关键失败类型', () { + RecognitionDiagnostic diagnostic(String result, String reason) { + return RecognitionDiagnostic( + at: DateTime.utc(2026, 7, 22, 14, 35), + appName: '微信', + stage: 'ocr', + result: result, + reason: reason, + nodeCount: 12, + amountCandidates: 1, + ); + } + + expect( + RecognitionDiagnosticDisplay.from( + diagnostic('failed', 'capture_timeout'), + ).summaryLabel, + '截图失败', + ); + expect( + RecognitionDiagnosticDisplay.from( + diagnostic('failed', 'no_text'), + ).summaryLabel, + 'OCR 无结果', + ); + expect( + RecognitionDiagnosticDisplay.from( + diagnostic('rejected', 'payment_input_page'), + ).summaryLabel, + '规则拒绝', + ); + expect( + RecognitionDiagnosticDisplay.from( + diagnostic('ignored', 'duplicate_result_surface'), + ).summaryLabel, + '已合并', + ); + }); +} diff --git a/frontend/test/update_test.dart b/frontend/test/update_test.dart new file mode 100644 index 0000000..8e37955 --- /dev/null +++ b/frontend/test/update_test.dart @@ -0,0 +1,269 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/update/update_api.dart'; +import 'package:miaoji_zhang/shared/update/update_coordinator.dart'; +import 'package:miaoji_zhang/shared/update/update_downloader.dart'; +import 'package:miaoji_zhang/shared/update/update_models.dart'; +import 'package:miaoji_zhang/shared/update/update_prompt.dart'; +import 'package:miaoji_zhang/shared/version.dart'; +import 'package:package_info_plus/package_info_plus.dart'; + +void main() { + const release = AppRelease( + id: 'release-7', + versionName: '1.2.2', + buildNumber: 7, + downloadUrl: 'https://downloads.example.com/jizhi-7.apk', + releaseNotes: '## 本次更新\n\n- 修复识别问题\n- 优化更新体验', + sha256: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + fileSize: 1024, + publishedAt: null, + ); + + test('使用原生 versionName 和 buildNumber 展示版本', () async { + PackageInfo.setMockInitialValues( + appName: '记之', + packageName: 'com.nx.miaoji.internal', + version: '1.2.1-internal', + buildNumber: '6', + buildSignature: '', + ); + await AppVersion.initialize(); + + expect(AppVersion.versionName, '1.2.1-internal'); + expect(AppVersion.buildNumber, 6); + expect(AppVersion.display, 'v1.2.1-internal (6)'); + }); + test('更新响应保留发布信息并且只按 buildNumber 判断新旧', () { + final response = UpdateCheckResponse.fromJson({ + 'hasUpdate': true, + 'forceUpdate': false, + 'release': { + 'id': 'release-7', + 'versionName': '0.1.0', + 'buildNumber': 7, + 'downloadUrl': 'https://downloads.example.com/jizhi-7.apk', + 'releaseNotes': '测试版本', + 'sha256': release.sha256, + 'fileSize': 1024, + 'publishedAt': '2026-07-21T12:00:00Z', + }, + }); + + expect(UpdatePolicy.availableRelease(response, currentBuild: 6), isNotNull); + expect(UpdatePolicy.availableRelease(response, currentBuild: 7), isNull); + expect(response.release?.versionName, '0.1.0'); + }); + + test('忽略普通版本但不影响手动检查和强制更新', () { + expect( + UpdatePolicy.shouldPresent( + release: release, + forced: false, + manual: false, + ignoredReleaseId: release.id, + ), + isFalse, + ); + expect( + UpdatePolicy.shouldPresent( + release: release, + forced: false, + manual: true, + ignoredReleaseId: release.id, + ), + isTrue, + ); + expect( + UpdatePolicy.shouldPresent( + release: release, + forced: true, + manual: false, + ignoredReleaseId: release.id, + ), + isTrue, + ); + }); + + test('UpdateApi 发送公开参数且不附带登录请求配置', () async { + final adapter = _FakeAdapter( + statusCode: 200, + body: jsonEncode({ + 'hasUpdate': true, + 'forceUpdate': false, + 'release': { + 'id': release.id, + 'versionName': release.versionName, + 'buildNumber': release.buildNumber, + 'downloadUrl': release.downloadUrl, + 'releaseNotes': release.releaseNotes, + 'sha256': release.sha256, + 'fileSize': release.fileSize, + 'publishedAt': '2026-07-21T12:00:00Z', + }, + }), + ); + final dio = Dio(BaseOptions(baseUrl: 'https://version.test')) + ..httpClientAdapter = adapter; + + final result = await UpdateApi( + dio: dio, + ).check(platform: 'android', channel: 'beta', currentBuild: 6); + + expect(result.release?.buildNumber, 7); + expect(adapter.request?.path, '/api/client/v1/update'); + expect(adapter.request?.queryParameters['platform'], 'android'); + expect(adapter.request?.queryParameters['channel'], 'beta'); + expect(adapter.request?.queryParameters['currentBuild'], 6); + expect(adapter.request?.headers['Authorization'], isNull); + }); + + test('协调器合并并发检查请求', () async { + final adapter = _FakeAdapter( + statusCode: 200, + body: '{"hasUpdate":false,"forceUpdate":false,"release":null}', + delay: const Duration(milliseconds: 20), + ); + final dio = Dio(BaseOptions(baseUrl: 'https://version.test')) + ..httpClientAdapter = adapter; + final coordinator = UpdateCoordinator(api: UpdateApi(dio: dio)); + + await Future.wait([ + coordinator.debugCheck(platform: 'android'), + coordinator.debugCheck(platform: 'android'), + ]); + + expect(adapter.callCount, 1); + }); + + test('Internal 更新缺少 SHA-256 时在下载前拒绝', () async { + const unsafeRelease = AppRelease( + id: 'unsafe', + versionName: '1.2.2', + buildNumber: 7, + downloadUrl: 'https://downloads.example.com/jizhi-7.apk', + releaseNotes: '', + sha256: null, + fileSize: null, + publishedAt: null, + ); + + await expectLater( + UpdateDownloader().downloadAndVerify(unsafeRelease, onProgress: (_) {}), + throwsA( + isA().having( + (error) => error.message, + 'message', + contains('SHA-256'), + ), + ), + ); + }); + test('UpdateApi 将 404 和 429 转换为稳定错误', () async { + for (final entry in { + 404: UpdateFailureKind.unavailable, + 429: UpdateFailureKind.rateLimited, + }.entries) { + final dio = Dio(BaseOptions(baseUrl: 'https://version.test')) + ..httpClientAdapter = _FakeAdapter(statusCode: entry.key, body: '{}'); + await expectLater( + UpdateApi( + dio: dio, + ).check(platform: 'ios', channel: 'stable', currentBuild: 6), + throwsA( + isA().having( + (error) => error.kind, + 'kind', + entry.value, + ), + ), + ); + } + }); + + testWidgets('普通更新面板展示说明并允许忽略', (tester) async { + var ignored = false; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: Scaffold( + body: UpdatePromptSheet( + release: release, + forced: false, + onIgnore: () async => ignored = true, + ), + ), + ), + ); + + expect(find.text('发现新版本'), findsOneWidget); + expect(find.textContaining('修复识别问题'), findsOneWidget); + expect(find.text('本次更新'), findsOneWidget); + expect(find.byType(MarkdownBody), findsOneWidget); + expect(find.text('忽略此版本'), findsOneWidget); + await tester.tap(find.text('忽略此版本')); + await tester.pump(); + expect(ignored, isTrue); + }); + + testWidgets('强制更新面板没有忽略入口并适配深色主题', (tester) async { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.dark, + home: Scaffold( + body: UpdatePromptSheet( + release: release, + forced: true, + onIgnore: () async {}, + ), + ), + ), + ); + + expect(find.text('必须更新后继续使用'), findsOneWidget); + expect(find.text('忽略此版本'), findsNothing); + expect(find.text('立即更新'), findsOneWidget); + expect(tester.takeException(), isNull); + }); +} + +class _FakeAdapter implements HttpClientAdapter { + final int statusCode; + final String body; + RequestOptions? request; + int callCount = 0; + final Duration delay; + + _FakeAdapter({ + required this.statusCode, + required this.body, + this.delay = Duration.zero, + }); + + @override + Future fetch( + RequestOptions options, + Stream? requestStream, + Future? cancelFuture, + ) async { + request = options; + callCount++; + if (delay > Duration.zero) await Future.delayed(delay); + return ResponseBody.fromString( + body, + statusCode, + headers: { + Headers.contentTypeHeader: ['application/json'], + }, + ); + } + + @override + void close({bool force = false}) {} +} diff --git a/frontend/test/visual_contract_test.dart b/frontend/test/visual_contract_test.dart new file mode 100644 index 0000000..8a4a2fc --- /dev/null +++ b/frontend/test/visual_contract_test.dart @@ -0,0 +1,204 @@ +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('启动页只读取本地缓存,不等待远程接口', () { + final source = File( + 'lib/features/auth/pages/splash_page.dart', + ).readAsStringSync(); + + expect(source, contains('loadCached')); + expect(source, isNot(contains('PublicConfigApi'))); + expect(source, isNot(contains('AuthApi.me'))); + expect(source, isNot(contains('ensureLoaded'))); + }); + test('业务页面不再直接使用系统感强的控件或旧青绿色板', () { + final banned = [ + 'AlertDialog(', + 'DropdownButtonFormField', + 'showDatePicker(', + 'showTimePicker(', + 'PopupMenuButton', + 'LinearGradient(', + 'RadialGradient(', + 'SweepGradient(', + 'BackdropFilter(', + '0xFF087F6D', + '0xFF066B5C', + '0xFFE3F2EF', + ]; + final violations = []; + for (final file + in Directory('lib/features') + .listSync(recursive: true) + .whereType() + .where((file) => file.path.endsWith('.dart'))) { + final source = file.readAsStringSync(); + for (final token in banned) { + if (source.contains(token)) { + violations.add('${file.path}: $token'); + } + } + } + expect(violations, isEmpty, reason: violations.join('\n')); + }); + + test('深色模式的选中与未选中状态使用语义色板', () { + final controls = File( + 'lib/shared/widgets/app_controls.dart', + ).readAsStringSync(); + final addPage = File('lib/features/add/add_page.dart').readAsStringSync(); + final chat = File('lib/features/chat/chat_page.dart').readAsStringSync(); + final companion = File( + 'lib/features/settings/companion_page.dart', + ).readAsStringSync(); + final me = File('lib/features/settings/me_page.dart').readAsStringSync(); + final report = File( + 'lib/features/stats/report_page.dart', + ).readAsStringSync(); + + expect(controls, contains(': context.jz.card')); + expect(addPage, isNot(contains('selected ? _activeColor : Colors.white'))); + expect(chat, isNot(contains('isMe ? AppTheme.primary : Colors.white'))); + expect( + companion, + isNot(contains('context.jz.aiBackground : Colors.white')), + ); + expect(me, isNot(contains('context.jz.primaryBackground : Colors.white'))); + expect(report, isNot(contains('selected ? Colors.white'))); + }); + + test('聊天附件只保留拍照和相册导入', () { + final source = File('lib/features/chat/chat_page.dart').readAsStringSync(); + + expect(source, contains('ImageSource.camera')); + expect(source, contains('ImageSource.gallery')); + expect(source, isNot(contains('截屏记账'))); + expect(source, isNot(contains('手动输入文字'))); + expect(source, isNot(contains('ScreenshotChannel.capture'))); + }); + + test('表情包具备离线缓存、内置兜底和展开刷新', () { + final api = File('lib/shared/api/business_api.dart').readAsStringSync(); + final chat = File('lib/features/chat/chat_page.dart').readAsStringSync(); + + expect(api, contains('global_stickers_v1')); + expect(api, contains('_fallback')); + expect(api, contains('SharedPreferences.getInstance')); + expect( + chat, + contains('setState(() => _composerPanel = _ComposerPanel.stickers)'), + ); + expect(chat, contains('_stkLoad();')); + }); + + test('无障碍只解析明确成功页且使用墙钟时间', () { + final parser = File( + 'android/app/src/main/kotlin/com/nx/miaoji/PaymentParser.kt', + ).readAsStringSync(); + + expect(parser, contains('occurredAt = System.currentTimeMillis()')); + expect(parser, contains('historyTitles')); + expect(parser, contains('"扫码支付成功"')); + expect(parser, contains('"转账已完成"')); + expect(parser, contains('STANDALONE_AMOUNT')); + expect(parser, contains('MAX_PAYMENT_SCAN_LINES = 48')); + expect(parser, isNot(contains('listOf("收款成功", "已收款", "到账"'))); + expect(parser, isNot(contains('"支出", "消费成功"'))); + expect(parser, isNot(contains('listOf("微信支付", "支付宝", "交易成功")'))); + final service = File( + 'android/app/src/main/kotlin/com/nx/miaoji/ScreenshotAccessibilityService.kt', + ).readAsStringSync(); + expect(service, contains('AccessibilityEvent.TYPE_WINDOWS_CHANGED')); + expect(service, contains('AccessibilityEvent.TYPE_VIEW_CLICKED')); + expect(service, contains('PaymentFlow(')); + expect(service, contains('PAYMENT_FLOW_TTL_MS = 90_000L')); + expect(service, contains('VISUAL_STABILITY_DELAY_MS = 700L')); + expect(service, contains('takeScreenshotOfWindow')); + expect(service, contains('bitmap.recycle()')); + expect(service, contains('CAPTURE_CALLBACK_TIMEOUT_MS = 6_000L')); + expect(service, contains('OCR_CALLBACK_TIMEOUT_MS = 12_000L')); + + final localOcr = File( + 'android/app/src/main/kotlin/com/nx/miaoji/LocalPaymentOcr.kt', + ).readAsStringSync(); + expect(localOcr, contains('ChineseTextRecognizerOptions')); + expect(localOcr, contains('InputImage.fromBitmap')); + expect(localOcr, contains('distinctCents.size == 1')); + expect(localOcr, contains('evidenceConfidence = if (highConfidence)')); + + final store = File( + 'android/app/src/main/kotlin/com/nx/miaoji/RecognitionStore.kt', + ).readAsStringSync(); + expect(store, contains('"local_ocr" -> 8')); + expect(store, contains('flowSessionId')); + expect(store, contains('ACCESSIBILITY_NOTIFICATION_MASK')); + + final gradle = File('android/app/build.gradle.kts').readAsStringSync(); + expect( + gradle, + contains('com.google.mlkit:text-recognition-chinese:16.0.1'), + ); + }); + + test('本地 OCR 需要一次性用途确认并提供无隐私诊断', () { + final settings = File( + 'lib/features/settings/screenshot_settings_page.dart', + ).readAsStringSync(); + final legal = File( + 'lib/features/settings/legal_document_page.dart', + ).readAsStringSync(); + final diagnostics = File( + 'android/app/src/main/kotlin/com/nx/miaoji/RecognitionDiagnostics.kt', + ).readAsStringSync(); + final formatter = File( + 'lib/shared/services/recognition_diagnostic_formatter.dart', + ).readAsStringSync(); + + expect(settings, contains('local_ocr_consent_v1')); + expect(settings, contains('图片只在内存中由本地 OCR 处理')); + expect(settings, contains('_RecognitionDiagnosticCard')); + expect(settings, contains('Timer.periodic')); + expect(formatter, contains('operation_interrupted')); + expect(formatter, contains('截图失败')); + expect(formatter, contains('OCR 无结果')); + expect(formatter, contains('规则拒绝')); + expect(formatter, contains('已合并')); + expect(legal, contains('ML Kit 中文文字识别(Google)')); + expect(diagnostics, isNot(contains('sourceText'))); + expect(diagnostics, isNot(contains('image'))); + expect(diagnostics, contains('STALE_OPERATION_MS = 20_000L')); + final service = File( + 'android/app/src/main/kotlin/com/nx/miaoji/ScreenshotAccessibilityService.kt', + ).readAsStringSync(); + expect(service, contains('resolveAccessibilityWindowId')); + final localOcr = File( + 'android/app/src/main/kotlin/com/nx/miaoji/LocalPaymentOcr.kt', + ).readAsStringSync(); + expect(localOcr, contains('MlKitContext.initializeIfNeeded')); + expect(localOcr, contains('ocr_model_unavailable')); + expect(localOcr, contains('OcrDiagnosticRedactor')); + expect(localOcr, contains('qualifiesWeakAuto')); + expect(settings, contains('OCR 诊断预览')); + expect(settings, contains('10 分钟后自动关闭')); + expect(diagnostics, contains('statusStrength')); + expect(diagnostics, contains('expectedAmountMatched')); + expect(diagnostics, contains('resultTransitionObserved')); + expect(diagnostics, contains('ocrPreview')); + expect(service, contains('shouldFallbackToDisplay')); + expect(service, contains('ERROR_TAKE_SCREENSHOT_INVALID_WINDOW')); + expect(service, contains('WINDOW_CAPTURE_FALLBACK_DELAY_MS = 450L')); + }); + + test('智能识别授权未完成时不会提前打开开关', () { + final source = File( + 'lib/features/settings/screenshot_settings_page.dart', + ).readAsStringSync(); + + expect(source, contains('_pendingAuthorizationKey')); + expect(source, contains('未完成系统授权,识别开关仍保持关闭')); + expect(source, contains('setRecognitionToggle(key, false)')); + expect(source, contains('_BackgroundKeepAliveCard')); + }); +} diff --git a/frontend/test/widget_test.dart b/frontend/test/widget_test.dart new file mode 100644 index 0000000..fb58b0b --- /dev/null +++ b/frontend/test/widget_test.dart @@ -0,0 +1,139 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:miaoji_zhang/features/ai_mode/pages/ai_mode_page.dart'; +import 'package:miaoji_zhang/features/auth/pages/login_page.dart'; +import 'package:miaoji_zhang/features/settings/me_page.dart'; +import 'package:miaoji_zhang/shared/api/business_api.dart'; +import 'package:miaoji_zhang/shared/theme/app_theme.dart'; +import 'package:miaoji_zhang/shared/widgets/ai_access_gate.dart'; +import 'package:miaoji_zhang/shared/widgets/app_controls.dart'; +import 'package:miaoji_zhang/shared/widgets/async_error_view.dart'; +import 'package:miaoji_zhang/shared/widgets/brand_logo.dart'; + +void main() { + testWidgets('错误状态无需真实 API 即可重试', (tester) async { + var retries = 0; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: Scaffold( + body: AsyncErrorView( + message: '网络开小差了', + onRetry: () async => retries++, + ), + ), + ), + ); + + expect(find.text('网络开小差了'), findsOneWidget); + await tester.tap(find.text('重试')); + await tester.pump(); + expect(retries, 1); + }); + + testWidgets('全 AI 模式预算条展示未设置状态并可进入设置', (tester) async { + var taps = 0; + final data = BudgetsData.fromJson({'total': null, 'categories': []}); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: Scaffold( + body: AiBudgetStrip(data: data, onTap: () => taps++), + ), + ), + ); + + expect(find.text('本月还没设置预算'), findsOneWidget); + expect(find.text('去设置'), findsOneWidget); + await tester.tap(find.byType(AiBudgetStrip)); + expect(taps, 1); + }); + + testWidgets('全 AI 模式预算条明确展示超支金额', (tester) async { + final data = BudgetsData.fromJson({ + 'total': { + 'categoryId': null, + 'categoryName': null, + 'categoryIcon': null, + 'amount': 1000, + 'spent': 1250, + 'isRecurring': false, + }, + 'categories': [], + }); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: Scaffold( + body: AiBudgetStrip(data: data, onTap: () {}), + ), + ), + ); + + expect(find.text('已超 ¥250'), findsOneWidget); + expect(find.text('已用 ¥1250'), findsOneWidget); + expect(find.text('总额 ¥1000'), findsOneWidget); + }); + + testWidgets('登录与启动页共用的新品牌图标可加载', (tester) async { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: const Scaffold(body: Center(child: BrandLogo(size: 64))), + ), + ); + await tester.pumpAndSettle(); + + expect(find.byType(BrandLogo), findsOneWidget); + expect(tester.takeException(), isNull); + }); + + testWidgets('登录页合规入口只展示协议和隐私政策', (tester) async { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: const Scaffold(body: LoginLegalLinks()), + ), + ); + + expect(find.text('用户协议'), findsOneWidget); + expect(find.text('隐私政策'), findsOneWidget); + expect(find.text('权限用途'), findsNothing); + expect(find.text('第三方 SDK'), findsNothing); + }); + + testWidgets('游客本地状态是信息卡而不是禁用开关', (tester) async { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: const Scaffold(body: GuestLocalStatusCard()), + ), + ); + + expect(find.text('本机保存中'), findsOneWidget); + expect(find.text('游客模式'), findsOneWidget); + expect(find.byType(JzSwitchTile), findsNothing); + }); + + testWidgets('游客 AI 页面只展示登录引导', (tester) async { + var actions = 0; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.light, + home: Scaffold( + body: AiAccessGate( + state: AiAccessState.guest, + onAction: () async => actions++, + ), + ), + ), + ); + await tester.pumpAndSettle(); + + expect(find.text('登录后使用 AI 助手'), findsOneWidget); + expect(find.text('登录后使用'), findsOneWidget); + await tester.tap(find.text('登录后使用')); + await tester.pump(); + expect(actions, 1); + }); +} diff --git a/handoff/jizhi-session-handoff-2026-07-23.md b/handoff/jizhi-session-handoff-2026-07-23.md new file mode 100644 index 0000000..e7f09e2 --- /dev/null +++ b/handoff/jizhi-session-handoff-2026-07-23.md @@ -0,0 +1,243 @@ +# 记之项目交接档案 + +生成时间:2026-07-23 +项目路径:`C:\Users\nanxun\Documents\dsworkspace\jizhang` + +## 1. 项目概况 + +这是一个记账 App 项目,当前品牌名为“记之”。项目包含: + +- Flutter 客户端:`frontend` +- Android 原生能力:`frontend/android/app/src/main/kotlin/com/nx/miaoji` +- .NET 后端:`backend` +- 当前内测服务地址:`https://lt.frp-say.com:38012` +- 当前内测包名:`com.nx.miaoji.internal` +- 正式生产包名:`com.nx.miaoji` + +当前测试主线集中在:AI 记账、截屏/OCR 记账、无障碍/通知智能识别、游客离线、本地数据安全、更新检测和深色模式。 + +## 2. 当前最近版本 + +最近成功构建版本: + +```text +包名:com.nx.miaoji.internal +显示名称:记之·内测 +显示版本号:1.2.5-internal +构建版本号:132 +APK 路径:C:\Users\nanxun\Documents\dsworkspace\jizhang\release\JiZhi-1.2.5-internal-132.apk +APK SHA-256:2BE1DF66A92FC2D35F41197CDEEEC3240B568EFADE3FCA7A5442DC914AFC5316 +签名证书 SHA-256:dc625141f914c86e30001a2c6187eb4a73babcd62e739d4b053f1fc7e93d3e6c +``` + +对应更新说明: + +```text +C:\Users\nanxun\Documents\dsworkspace\jizhang\release-notes\JiZhi-1.2.5-internal-132.md +``` + +ADB 当时未发现在线设备,所以没有自动覆盖安装。 + +## 3. 最近已实现重点 + +### 3.1 无障碍支付识别与本地 OCR + +最近一轮实现目标:修复微信/支付宝红包、支付去重和识别时间问题。 + +主要实现点: + +- 支付流程状态支持 `payment`、`transfer`、`red_packet_send`。 +- 微信、支付宝红包资金变化支持: + - 发红包:支出,默认分类提示 `人情` + - 红包到账:收入,默认分类提示 `红包` + - 红包退回:收入,默认分类提示 `红包` + - 普通红包消息、未领取红包、他人领取消息不自动入账 +- 微信支付结果页如果缺金额,在严格证据成立时使用付款前唯一金额入账。 +- 支付宝成功页刷新、返回重进、通知和 OCR 同时到达时合并为同一个候选,降低重复入账。 +- 连续两笔真实相同金额交易仍通过新提交动作生成新流程 ID,不会被错误合并。 +- 本地 OCR 图片只在内存中处理,不保存原图,不上传。 +- 诊断信息新增:流程类型、金额来源、结果页指纹、拒绝原因等。 + +关键文件: + +```text +frontend/android/app/src/main/kotlin/com/nx/miaoji/PaymentParser.kt +frontend/android/app/src/main/kotlin/com/nx/miaoji/LocalPaymentOcr.kt +frontend/android/app/src/main/kotlin/com/nx/miaoji/ScreenshotAccessibilityService.kt +frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionDiagnostics.kt +frontend/android/app/src/main/kotlin/com/nx/miaoji/RecognitionStore.kt +frontend/lib/shared/services/screenshot_channel.dart +frontend/lib/shared/services/recognition_import_service.dart +frontend/lib/features/settings/screenshot_settings_page.dart +``` + +### 3.2 时间修复 + +用户反馈无障碍入账时间显示成 1970 或 14 点,实际应为上海时间 22 点。 + +已做修复: + +- 后端 EF 读取 MySQL `DateTime` 时统一恢复 `DateTimeKind.Utc`。 +- 后端 JSON 输出 UTC 时间时应稳定带 `Z`。 +- Flutter 新增旧格式兼容:无时区字符串按 UTC 解释,再转换为上海时间显示。 +- 不迁移数据库已有值,已有 `14:xx` UTC 值修复后显示为上海时间 `22:xx`。 + +关键文件: + +```text +backend/MiaoJiZhang.Infrastructure/Persistence/AppDbContext.cs +frontend/lib/shared/services/shanghai_time.dart +frontend/test/theme_and_time_test.dart +``` + +### 3.3 更新检测 + +已接入 VersionFlow: + +```text +更新接口根地址:https://version.nxsir.cn +接口路径:/api/client/v1/update +Android/iOS AppKey:已配置在项目中,但交接时不要外传到公开渠道 +Internal 渠道:beta +Production 渠道:stable +``` + +功能点: + +- 启动后自动检查一次。 +- “我的”页面支持手动检查更新。 +- 非强制更新支持忽略版本。 +- 强制更新阻止继续使用。 +- Android Internal 支持前台下载 APK、SHA-256 校验、包名/版本/签名校验和安装。 +- Android Production 和 iOS 走外链,不内置 APK 自更新安装权限。 + +### 3.4 内测环境 + +当前约定: + +- 只构建 `com.nx.miaoji.internal` 内测包。 +- Internal 注入: + +```text +INTERNAL_BUILD=true +API_BASE_URL=https://lt.frp-say.com:38012 +APP_VERSION=20260722-132 +``` + +- 之前误装过正式包 `com.nx.miaoji`,测试阶段应优先使用 `com.nx.miaoji.internal`。 +- 后端应监听 `127.0.0.1:3000`,由 FRP 映射到 `https://lt.frp-say.com:38012`。 + +## 4. 已完成过的重要功能方向 + +这些内容在本会话中多轮推进过,后续 AI 需要沿着现有实现继续,不要重做: + +- App 改名为“记之”。 +- 正式包名锁定 `com.nx.miaoji`,Internal 包名 `com.nx.miaoji.internal`。 +- 正式备案用 Release Key 已生成过,Debug MD5 不用于备案。 +- 图标资源已换成用户提供的黑白记事本/笔图标方向。 +- AI Agent 已从正则意图迁移到工具调用方向,收入/支出类型不能硬编码为支出。 +- AI 查询应读取账本实时数据,不凭空回答金额。 +- 截屏记账走一次性截图/授权,不保留长期 MediaProjection。 +- 磁贴截图不应强制依赖无障碍;无障碍可用则静默,否则走一次性授权。 +- 音量键快捷触发已放弃,系统音量键应恢复原生调音量。 +- 游客模式应能离线记账、统计、预算和导出;游客不能使用 AI。 +- AI 权限支持按用户关闭,关闭后所有 AI 入口不可见。 +- 深色模式已加入三态:跟随系统、浅色、深色。 +- 智能识别包含无障碍事件识别、通知识别、AI 截图补全三个开关。 + +## 5. 当前验证结果 + +最近一次验证结果: + +```text +Android 单元测试:通过 +Flutter theme_and_time_test:通过 +后端 dotnet build:通过,0 warning / 0 error +Flutter analyze:无 error/warning,剩余 82 条 info 级既有风格提示 +Android Internal Release 构建:通过 +``` + +未完成验证: + +- 后端集成测试依赖 Docker Desktop / Docker Linux Engine,当时 Docker 未启动,无法跑完。 +- ADB 没有在线设备,因此未自动覆盖安装 APK。 +- 微信/支付宝红包和支付流程仍需 Vivo 真机继续验收。 + +## 6. 常用命令 + +### Android Internal 单测 + +```powershell +cd C:\Users\nanxun\Documents\dsworkspace\jizhang\frontend\android +$env:FLUTTER_ALREADY_LOCKED='true' +$defs=@('INTERNAL_BUILD=true','API_BASE_URL=https://lt.frp-say.com:38012','APP_VERSION=20260722-132') | ForEach-Object { [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($_)) } +.\gradlew.bat --no-daemon :app:testInternalReleaseUnitTest "-Pdart-defines=$($defs -join ',')" +``` + +### Flutter 测试 + +```powershell +cd C:\Users\nanxun\Documents\dsworkspace\jizhang\frontend +C:\Users\nanxun\Documents\flutter\bin\cache\dart-sdk\bin\dart.exe C:\Users\nanxun\Documents\flutter\bin\cache\flutter_tools.snapshot test --no-pub test\theme_and_time_test.dart +``` + +### Flutter 静态检查 + +```powershell +cd C:\Users\nanxun\Documents\dsworkspace\jizhang\frontend +C:\Users\nanxun\Documents\flutter\bin\cache\dart-sdk\bin\dart.exe C:\Users\nanxun\Documents\flutter\bin\cache\flutter_tools.snapshot analyze --no-pub +``` + +### 后端编译 + +```powershell +cd C:\Users\nanxun\Documents\dsworkspace\jizhang\backend +dotnet build MiaoJiZhang.sln --no-restore +``` + +### 构建 Internal Release APK + +```powershell +cd C:\Users\nanxun\Documents\dsworkspace\jizhang\frontend\android +$env:FLUTTER_ALREADY_LOCKED='true' +$defs=@('INTERNAL_BUILD=true','API_BASE_URL=https://lt.frp-say.com:38012','APP_VERSION=20260722-132') | ForEach-Object { [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($_)) } +.\gradlew.bat --no-daemon :app:assembleInternalRelease "-Pdart-defines=$($defs -join ',')" +``` + +### 查看 APK 信息和 SHA-256 + +```powershell +cd C:\Users\nanxun\Documents\dsworkspace\jizhang +C:\Users\nanxun\AppData\Local\Android\Sdk\build-tools\36.1.0\aapt.exe dump badging release\JiZhi-1.2.5-internal-132.apk +C:\Users\nanxun\AppData\Local\Android\Sdk\build-tools\36.1.0\apksigner.bat verify --print-certs release\JiZhi-1.2.5-internal-132.apk +Get-FileHash release\JiZhi-1.2.5-internal-132.apk -Algorithm SHA256 +``` + +### ADB 安装 + +```powershell +C:\Users\nanxun\Documents\platform-tools\adb.exe devices +C:\Users\nanxun\Documents\platform-tools\adb.exe install -r C:\Users\nanxun\Documents\dsworkspace\jizhang\release\JiZhi-1.2.5-internal-132.apk +``` + +## 7. 下一步建议 + +优先级从高到低: + +1. Vivo 真机继续验收微信/支付宝红包、扫码支付、转账、通知与 OCR 双通道去重。 +2. 启动 Docker Desktop 后补跑后端集成测试,尤其是 UTC 时间序列化、幂等入账、用户隔离和账本隔离。 +3. 检查更新弹窗对 Markdown 的渲染能力;若仍无法解析,建议把更新说明限制为纯文本 Markdown 子集:标题、短横列表、空行。 +4. 清理 Flutter analyze 的 82 条 info 级提示,至少优先清掉本轮触碰过的文件。 +5. 继续优化智能识别诊断页,让“没事件、截图失败、OCR 无结果、规则拒绝、已入账、已合并”一眼能分清。 +6. 把隐私政策、权限用途和第三方 SDK 清单里的 ML Kit 本地 OCR 描述补齐,方便后续上架审查。 +7. 测试游客离线、登录同步、AI 权限关闭、AI 对话次数限制和深色模式全页面一致性。 + +## 8. 注意事项 + +- 不要把正式备案包 `com.nx.miaoji` 和内测包 `com.nx.miaoji.internal` 混用。 +- 测试阶段不要构建或安装 Production,除非用户明确要求。 +- 不要恢复音量键快捷截图,用户已经要求恢复系统原生音量键。 +- 不要绕过 `FLAG_SECURE` 或支付 App 的安全截屏限制。 +- 不要保存、上传或记录完整 OCR 原文、控件树、截图图片、API Key、JWT 或签名密码。 +- 数据库里已有 UTC 墙钟时间不要迁移,当前策略是在读取和显示层修复。 +- 若用户继续反馈“识别不到”,优先看智能识别最近诊断:事件是否收到、流程类型、金额来源、拒绝原因、OCR 是否 capture_failed。 diff --git a/release-notes/JiZhi-1.2.1-internal-20260722-0330.md b/release-notes/JiZhi-1.2.1-internal-20260722-0330.md new file mode 100644 index 0000000..6857a8b --- /dev/null +++ b/release-notes/JiZhi-1.2.1-internal-20260722-0330.md @@ -0,0 +1,30 @@ +# 记之 1.2.1 Internal 更新说明 + +## 版本信息 + +- 渠道:Internal / Beta +- 包名:`com.nx.miaoji.internal` +- 显示版本号:`1.2.1-internal` +- 构建版本号:`6` +- SHA-256:`390902402E63E8C34DB5809D4F5CF62DA5769DEB9C46F63E1CD8782B19C14380` + +## 本次更新 + +- 修改昵称后立即刷新“我的”页面,云端保存失败时自动恢复原昵称。 +- 修复深色模式下记一笔、AI 回复气泡、外观选择、App 模式、AI 性格和统计周期等状态显示异常。 +- 将外观设置收纳到独立二级页面,支持跟随系统、浅色和深色三种模式。 +- 完善智能识别授权流程:未完成无障碍、通知访问或通知权限授权时,识别开关保持关闭。 +- 增加后台识别保活引导,可前往电池优化和 Vivo/OriginOS 自启动管理页面。 +- 云同步现在会显示正在同步、已同步、待同步、离线、失败和登录过期等状态。 +- 增加用户级 AI 对话次数限制,支持按天、周或月重置;后台可单独调整用户额度及新用户默认额度。 +- 重构 AI 聊天附件入口,拍照和相册导入统一为“附件”;移除聊天页面中的截屏记账和手动文字识别入口。 + +## 稳定性 + +- 修复 AI 配额数据库迁移的 MySQL 兼容问题。 +- 修复同步登录过期后状态被错误覆盖的问题。 +- 修复 Vivo 后台保活说明和 Android 原生设置跳转编译问题。 +- 后端、管理后台、Flutter 静态分析及 Internal Release 构建均已通过。 +- Flutter 29 项测试和后端 10 项真实 MySQL 测试全部通过。 + +> 这是内测版本,仅用于功能验证。安装包使用 Internal 包名和测试签名,不用于应用市场正式发布。 diff --git a/release-notes/JiZhi-1.2.5-internal-127.md b/release-notes/JiZhi-1.2.5-internal-127.md new file mode 100644 index 0000000..1682e2e --- /dev/null +++ b/release-notes/JiZhi-1.2.5-internal-127.md @@ -0,0 +1,28 @@ +# 记之 1.2.5 内测版(构建 127) + +## 本次更新 + +- 重构微信、支付宝无障碍支付识别,增加支付流程状态机,不再只依赖无障碍控件树中的成功文案。 +- 内置 ML Kit 中文本地 OCR,支持 WebView、Canvas 等控件树无法读取的支付成功页面,断网也可识别。 +- 支持微信扫码支付、微信转账、支付宝扫码支付和支付宝转账的支付结果识别。 +- 严格区分支付成功、收款成功和退款成功;支付失败、处理中、等待收款、交易关闭及已撤销不会自动入账。 +- 控件树、通知和本地 OCR 统一进入候选队列,并通过支付流程 ID、订单号和时间窗口防止重复入账。 +- 高置信结果可自动入账;金额冲突、方向不明确或流程证据不足时改为通知确认。 +- AI 截图补全继续默认关闭,只有本地 OCR 已确认成功页但字段不足时才会按用户开关兜底,AI 单独结果不会自动入账。 +- 智能识别设置新增首次用途确认与“最近一次识别”诊断,可查看事件、截图、OCR 耗时、金额候选和拒绝原因。 +- 更新隐私政策、权限用途与第三方 SDK 清单,说明本地 OCR 图片仅在内存处理,不保存原图。 + +## 建议重点测试 + +1. 分别完成微信扫码支付、微信转账、支付宝扫码支付和支付宝转账,观察自动入账或确认通知。 +2. 浏览聊天、账单列表、交易详情、输入金额、支付处理中和支付失败页面,确认不会误入账。 +3. 连续完成两笔相同金额的支付,确认生成两笔;同一成功页刷新或停留,确认只生成一笔。 +4. 断网后完成支付,确认本地 OCR 与离线候选队列仍可工作。 +5. 在“我的 → 智能识别”查看最近诊断,区分未触发、系统禁止截屏、OCR 无结果和规则拒绝。 + +## 版本信息 + +- 显示版本:1.2.5-internal +- 构建号:127 +- 后端版本:20260722-127 +- 包名:com.nx.miaoji.internal \ No newline at end of file diff --git a/release-notes/JiZhi-1.2.5-internal-128.md b/release-notes/JiZhi-1.2.5-internal-128.md new file mode 100644 index 0000000..7fbbb87 --- /dev/null +++ b/release-notes/JiZhi-1.2.5-internal-128.md @@ -0,0 +1,18 @@ +# 记之 1.2.5 内测版(构建 128) + +## 修复内容 + +- 修复“最近一次识别”可能永久停留在“处理中”的问题。 +- 系统截屏超过 6 秒没有回调时自动结束,并显示“系统截屏超时”。 +- 本地 OCR 超过 12 秒没有回调时自动结束,并显示“OCR 超时”。 +- 识别进程被系统回收或任务中断后,遗留状态超过 20 秒会自动转为“流程已中断”。 +- 超时后会解除忙状态,后续支付识别可以继续触发。 +- 设置页处理期间每 2 秒刷新一次诊断,完成、拒绝或失败后立即停止刷新。 +- 增加截屏同步异常、OCR 启动异常、OCR 解析异常及迟到回调保护。 + +## 版本信息 + +- 显示版本:1.2.5-internal +- 构建号:128 +- 后端版本:20260722-127 +- 包名:com.nx.miaoji.internal \ No newline at end of file diff --git a/release-notes/JiZhi-1.2.5-internal-129.md b/release-notes/JiZhi-1.2.5-internal-129.md new file mode 100644 index 0000000..3aef67e --- /dev/null +++ b/release-notes/JiZhi-1.2.5-internal-129.md @@ -0,0 +1,18 @@ +# 记之 1.2.5-internal(129) + +## 本次修复 + +- 修复无障碍本地 OCR 截图失败只显示 `capture_failed`、无法定位原因的问题。 +- Android 14 及以上截图前重新校验当前活动支付窗口,避免使用支付页切换前的失效窗口 ID。 +- 单窗口截图遇到系统内部错误或窗口失效时,自动延迟 450ms 降级为整屏截图。 +- 安全窗口、无障碍权限缺失和无效屏幕仍按系统限制处理,不尝试绕过安全策略。 +- 最近一次识别新增窗口失效、系统内部错误、整屏截图启动失败等明确说明。 +- 截图失败日志增加截图模式、窗口 ID、系统错误码和标准化原因,不记录支付页面文字或图片。 + +## 验证 + +- Flutter 测试:33 项全部通过。 +- Android Internal 单元测试:全部通过。 +- APK 包名:`com.nx.miaoji.internal`。 +- 显示版本:`1.2.5-internal`。 +- 构建号:`129`。 \ No newline at end of file diff --git a/release-notes/JiZhi-1.2.5-internal-130.md b/release-notes/JiZhi-1.2.5-internal-130.md new file mode 100644 index 0000000..e72ad6c --- /dev/null +++ b/release-notes/JiZhi-1.2.5-internal-130.md @@ -0,0 +1,18 @@ +# 记之 1.2.5-internal(130) + +## 本次修复 + +- 修复独立识别进程中本地中文 OCR 无法启动的问题。 +- 在 `:recognition` 进程创建 OCR 客户端前显式初始化 ML Kit,不再依赖仅在主进程运行的自动初始化 Provider。 +- 区分 OCR 初始化失败、模型不可用、服务暂不可用和识别运行失败,最近一次识别会显示明确原因。 +- OCR 异常日志只记录异常类型和 ML Kit 错误码,不记录支付页面文字或截图。 +- 保留上一版本的活动窗口校验与单窗口截图失败后整屏截图降级。 + +## 验证 + +- Flutter 测试:33 项全部通过。 +- Kotlin Internal Release 编译:通过。 +- Android Internal 单元测试:通过。 +- APK 包名:`com.nx.miaoji.internal`。 +- 显示版本:`1.2.5-internal`。 +- 构建号:`130`。 \ No newline at end of file diff --git a/release-notes/JiZhi-1.2.5-internal-131.md b/release-notes/JiZhi-1.2.5-internal-131.md new file mode 100644 index 0000000..3a9057f --- /dev/null +++ b/release-notes/JiZhi-1.2.5-internal-131.md @@ -0,0 +1,24 @@ +# 记之 1.2.5 内测版(构建 131) + +## 本次更新 + +- 重构微信、支付宝支付识别流程,保留付款前金额、收支方向、来源窗口和提交时间。 +- UI 树识别兼容“转 账 成 功”等带空格状态,以及“完成”“已完成”等弱完成状态。 +- 弱完成状态必须同时满足支付流程有效、结果页跳转、金额唯一且与付款前一致、方向明确,才会自动入账。 +- 组合证据不完整、金额冲突或方向不明时改为通知确认,避免普通数字页和付款输入页误入账。 +- 新增 OCR 脱敏诊断预览,默认关闭,开启 10 分钟后自动关闭;不保存原图、不上传原始文字。 +- 最近一次识别新增状态强度、付款前金额匹配和页面跳转证据,便于定位真机识别失败原因。 +- 修复 OCR 详细诊断被队列结果覆盖的问题,并补充输入页、失败页、历史页拒绝规则。 + +## 测试建议 + +- 请分别测试微信转账、微信扫码支付、支付宝转账和支付宝扫码支付。 +- 若仍未识别,可在“我的 → 智能识别”临时开启“OCR 诊断预览”,支付后查看最近一次识别的脱敏文字与组合证据。 +- 请验证付款输入页、密码页、账单详情、处理中和失败页面不会自动入账。 + +## 构建信息 + +- 包名:`com.nx.miaoji.internal` +- 显示版本:`1.2.5-internal` +- 构建号:`131` +- APK SHA-256:`2DAF5D7E7F21220DE5BE4A7B40D2FC3406D3A0C2614E30A86545CDE4FCE5B9B8` \ No newline at end of file diff --git a/release-notes/JiZhi-1.2.5-internal-132.md b/release-notes/JiZhi-1.2.5-internal-132.md new file mode 100644 index 0000000..593f866 --- /dev/null +++ b/release-notes/JiZhi-1.2.5-internal-132.md @@ -0,0 +1,21 @@ +# 记之 1.2.5-internal (132) + +## 本次重点 + +- 修复微信、支付宝无障碍识别的时间显示问题,旧接口和本地缓存里的无时区时间会按 UTC 解释后显示为上海时间,避免 22 点识别成 14 点。 +- 支持红包资金变化识别:发红包记为支出,红包到账和红包退回记为收入;普通红包消息、未领取红包和他人领取消息不会自动入账。 +- 优化微信支付成功页识别:当结果页没有金额,但支付前金额唯一且支付流程证据完整时,可使用付款前金额入账。 +- 修复支付宝成功页刷新、返回重进、通知和 OCR 同时到达时可能重复入账的问题。 + +## 智能识别 + +- 新增流程类型、金额来源、结果页指纹等诊断信息,方便区分扫码支付、转账、发红包、红包到账和红包退回。 +- 对支付失败、处理中、等待收款、交易关闭、账单详情等页面继续拒绝自动入账。 +- 本地 OCR 仍只在微信、支付宝疑似支付流程中运行,图片只在内存处理,不保存原图,不上传;AI 截图补全仍需用户主动开启。 + +## 验证建议 + +- 微信:扫码支付、转账、发红包、红包到账、红包退回。 +- 支付宝:扫码支付、转账、红包相关流程。 +- 重复场景:同一成功页停留、返回重进、通知和 OCR 同时触发、连续两笔相同金额交易。 +- 时间场景:确认首页明细、统计和编辑页都按上海时间展示。 diff --git a/scripts/dev-env.sh b/scripts/dev-env.sh new file mode 100755 index 0000000..5cb8bfa --- /dev/null +++ b/scripts/dev-env.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Linux toolchain environment for the JiZhi workspace. +export JAVA_HOME=/home/nanxunai/.local/lib/jvm/zulu-21 +export ANDROID_HOME=/home/nanxunai/Android/Sdk +export ANDROID_SDK_ROOT=/home/nanxunai/Android/Sdk +export DOTNET_ROOT=/home/nanxunai/.dotnet +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_NOLOGO=1 +export FLUTTER_ROOT=/home/nanxunai/flutter +export GIT_EXEC_PATH=/home/nanxunai/.local/usr/lib/git-core +export LD_LIBRARY_PATH="/home/nanxunai/.local/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + +# The Flutter mirrors keep dependency resolution reliable from mainland China. +export PUB_HOSTED_URL=https://pub.flutter-io.cn +export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn + +export PATH="/home/nanxunai/.local/bin:/home/nanxunai/.dotnet:/home/nanxunai/flutter/bin:/home/nanxunai/Android/Sdk/platform-tools:/home/nanxunai/Android/Sdk/cmdline-tools/latest/bin:$PATH"