diff --git a/.github/update.log b/.github/update.log index b6271d5f8f..94f546aa4a 100644 --- a/.github/update.log +++ b/.github/update.log @@ -1238,3 +1238,4 @@ Update On Tue Jan 6 19:44:08 CET 2026 Update On Wed Jan 7 19:44:04 CET 2026 Update On Thu Jan 8 19:40:15 CET 2026 Update On Fri Jan 9 19:44:47 CET 2026 +Update On Sat Jan 10 19:39:24 CET 2026 diff --git a/bbdown/BBDown.Core/Fetcher/MediaListFetcher.cs b/bbdown/BBDown.Core/Fetcher/MediaListFetcher.cs index a7d490c8bb..a34f3b8dd0 100644 --- a/bbdown/BBDown.Core/Fetcher/MediaListFetcher.cs +++ b/bbdown/BBDown.Core/Fetcher/MediaListFetcher.cs @@ -18,7 +18,27 @@ public class MediaListFetcher : IFetcher var api = $"https://api.bilibili.com/x/v1/medialist/info?type=8&biz_id={id}&tid=0"; var json = await GetWebSourceAsync(api); using var infoJson = JsonDocument.Parse(json); - var data = infoJson.RootElement.GetProperty("data"); + var root = infoJson.RootElement; + var data = root.GetProperty("data"); + if (data.ValueKind != JsonValueKind.Object) + { + // 部分情况下(合集被删除、设为私密或无权访问)data 会是 null + // 也有可能是“系列”却被误识别为合集,这里优先尝试按系列解析 + try + { + return await new SeriesListFetcher().FetchAsync($"seriesBizId:{id}"); + } + catch + { + var code = root.TryGetProperty("code", out var codeElem) && codeElem.ValueKind == JsonValueKind.Number + ? codeElem.GetInt32() + : 0; + var message = root.TryGetProperty("message", out var msgElem) && msgElem.ValueKind == JsonValueKind.String + ? msgElem.GetString() + : "未知错误"; + throw new Exception($"获取合集信息失败(code={code}): {message}"); + } + } var listTitle = data.GetProperty("title").GetString()!; var intro = data.GetProperty("intro").GetString()!; long pubTime = data.GetProperty("ctime").GetInt64()!; @@ -32,10 +52,25 @@ public class MediaListFetcher : IFetcher var listApi = $"https://api.bilibili.com/x/v2/medialist/resource/list?type=8&oid={oid}&otype=2&biz_id={id}&with_current=true&mobi_app=web&ps=20&direction=false&sort_field=1&tid=0&desc=false"; json = await GetWebSourceAsync(listApi); using var listJson = JsonDocument.Parse(json); - data = listJson.RootElement.GetProperty("data"); + var listRoot = listJson.RootElement; + data = listRoot.GetProperty("data"); + if (data.ValueKind != JsonValueKind.Object) + { + var code = listRoot.TryGetProperty("code", out var codeElem) && codeElem.ValueKind == JsonValueKind.Number + ? codeElem.GetInt32() + : 0; + var message = listRoot.TryGetProperty("message", out var msgElem) && msgElem.ValueKind == JsonValueKind.String + ? msgElem.GetString() + : "未知错误"; + throw new Exception($"获取合集视频列表失败(code={code}): {message}"); + } hasMore = data.GetProperty("has_more").GetBoolean(); foreach (var m in data.GetProperty("media_list").EnumerateArray()) { + // 只处理未失效的视频条目(与收藏夹解析逻辑保持一致) + if (m.TryGetProperty("attr", out var attrElem) && attrElem.GetInt32() != 0) + continue; + var pageCount = m.GetProperty("page").GetInt32(); var desc = m.GetProperty("intro").GetString()!; var ownerName = m.GetProperty("upper").GetProperty("name").ToString(); diff --git a/bbdown/BBDown.Core/Fetcher/SeriesListFetcher.cs b/bbdown/BBDown.Core/Fetcher/SeriesListFetcher.cs index 3ec71e257f..96781f67fb 100644 --- a/bbdown/BBDown.Core/Fetcher/SeriesListFetcher.cs +++ b/bbdown/BBDown.Core/Fetcher/SeriesListFetcher.cs @@ -37,6 +37,10 @@ public class SeriesListFetcher : IFetcher hasMore = data.GetProperty("has_more").GetBoolean(); foreach (var m in data.GetProperty("media_list").EnumerateArray()) { + // 只处理未失效的视频条目(与收藏夹解析逻辑保持一致) + if (m.TryGetProperty("attr", out var attrElem) && attrElem.GetInt32() != 0) + continue; + var pageCount = m.GetProperty("page").GetInt32(); var desc = m.GetProperty("intro").GetString()!; var ownerName = m.GetProperty("upper").GetProperty("name").ToString(); diff --git a/bbdown/BBDown/BBDownUtil.cs b/bbdown/BBDown/BBDownUtil.cs index 3cf1066637..d339dc8ec3 100644 --- a/bbdown/BBDown/BBDownUtil.cs +++ b/bbdown/BBDown/BBDownUtil.cs @@ -100,6 +100,31 @@ static partial class BBDownUtil string bizId = GetQueryString("sid", input); avid = $"seriesBizId:{bizId}"; } + // 新版个人空间合集/系列链接兼容: + // 例如: + // 合集: https://space.bilibili.com/392959666/lists/1560264?type=season + // 系列: https://space.bilibili.com/392959666/lists/1560264?type=series + else if (input.Contains("/space.bilibili.com/") && input.Contains("/lists/")) + { + var type = GetQueryString("type", input).ToLower(); + // path 最后一个 / 后到 ? 前即为 sid + var path = input.Split('?', '#')[0]; + var sidPart = path[(path.LastIndexOf('/') + 1)..]; + + if (type == "season") + { + avid = $"listBizId:{sidPart}"; + } + else if (type == "series") + { + avid = $"seriesBizId:{sidPart}"; + } + else + { + // 未知类型按合集处理,至少不会识别失败 + avid = $"listBizId:{sidPart}"; + } + } else if (input.Contains("/space.bilibili.com/") && input.Contains("/favlist")) { string mid = UidRegex().Match(input).Groups[1].Value; diff --git a/clash-nyanpasu/frontend/interface/src/ipc/bindings.ts b/clash-nyanpasu/frontend/interface/src/ipc/bindings.ts index a42d64d1a3..fa4e5bd7a2 100644 --- a/clash-nyanpasu/frontend/interface/src/ipc/bindings.ts +++ b/clash-nyanpasu/frontend/interface/src/ipc/bindings.ts @@ -422,11 +422,11 @@ export const commands = { else return { status: 'error', error: e as any } } }, - async saveWindowSizeState(): Promise> { + async saveMainWindowSizeState(): Promise> { try { return { status: 'ok', - data: await TAURI_INVOKE('save_window_size_state'), + data: await TAURI_INVOKE('save_main_window_size_state'), } } catch (e) { if (e instanceof Error) throw e diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/layout/layout-control.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/layout/layout-control.tsx index 808c51e7c4..1f4e9aefd9 100644 --- a/clash-nyanpasu/frontend/nyanpasu/src/components/layout/layout-control.tsx +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/layout/layout-control.tsx @@ -9,7 +9,7 @@ import { PushPinOutlined, } from '@mui/icons-material' import { Button, ButtonProps } from '@mui/material' -import { saveWindowSizeState, useSetting } from '@nyanpasu/interface' +import { commands, useSetting } from '@nyanpasu/interface' import { alpha, cn } from '@nyanpasu/ui' import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query' import { listen, TauriEvent, UnlistenFn } from '@tauri-apps/api/event' @@ -98,7 +98,7 @@ export const LayoutControl = ({ className }: { className?: string }) => { { if (platform.current === 'windows') { - saveWindowSizeState().finally(() => { + commands.saveMainWindowSizeState().finally(() => { appWindow.close() }) } else { diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/ui/scroll-area.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/ui/scroll-area.tsx index 5c6249bacf..d36916f4d8 100644 --- a/clash-nyanpasu/frontend/nyanpasu/src/components/ui/scroll-area.tsx +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/ui/scroll-area.tsx @@ -4,6 +4,7 @@ import { cn } from '@nyanpasu/ui' import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area' interface ScrollAreaContextValue { + isScrolling: boolean isTop: boolean isBottom: boolean scrollDirection: 'up' | 'down' | 'left' | 'right' | 'none' @@ -23,6 +24,7 @@ export function useScrollArea() { } function useScrollTracking(threshold = 50) { + const [isScrolling, setIsScrolling] = useState(false) const [isTop, setIsTop] = useState(true) const [isBottom, setIsBottom] = useState(false) const [scrollDirection, setScrollDirection] = useState< @@ -32,10 +34,18 @@ function useScrollTracking(threshold = 50) { const lastScrollTop = useRef(0) const lastScrollLeft = useRef(0) + const timeoutRef = useRef | null>(null) + const handleScroll = (e: React.UIEvent) => { const target = e.currentTarget as HTMLElement const { scrollTop, scrollLeft, scrollHeight, clientHeight } = target + if (timeoutRef.current) { + clearTimeout(timeoutRef.current) + } + + setIsScrolling(true) + setIsTop(scrollTop === 0) // check if is at bottom, allow a small threshold @@ -62,9 +72,17 @@ function useScrollTracking(threshold = 50) { lastScrollTop.current = scrollTop lastScrollLeft.current = scrollLeft + + timeoutRef.current = setTimeout(() => { + if (timeoutRef.current) { + clearTimeout(timeoutRef.current) + } + + setIsScrolling(false) + }, threshold) } - return { isTop, isBottom, scrollDirection, handleScroll } + return { isTop, isBottom, scrollDirection, handleScroll, isScrolling } } export function Viewport({ @@ -151,11 +169,13 @@ export function AppContentScrollArea({ }: React.ComponentProps) { const viewportRef = useRef(null) - const { isTop, isBottom, scrollDirection, handleScroll } = useScrollTracking() + const { isTop, isBottom, scrollDirection, handleScroll, isScrolling } = + useScrollTracking() return ( =4.8.4 <5.9.0' - '@typescript-eslint/eslint-plugin@8.51.0': - resolution: {integrity: sha512-XtssGWJvypyM2ytBnSnKtHYOGT+4ZwTnBVl36TA4nRO2f4PRNGz5/1OszHzcZCvcBMh+qb7I06uoCmLTRdR9og==} + '@typescript-eslint/eslint-plugin@8.52.0': + resolution: {integrity: sha512-okqtOgqu2qmZJ5iN4TWlgfF171dZmx2FzdOv2K/ixL2LZWDStL8+JgQerI2sa8eAEfoydG9+0V96m7V+P8yE1Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.51.0 + '@typescript-eslint/parser': ^8.52.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' @@ -1316,8 +1331,8 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/project-service@8.51.0': - resolution: {integrity: sha512-Luv/GafO07Z7HpiI7qeEW5NW8HUtZI/fo/kE0YbtQEFpJRUuR0ajcWfCE5bnMvL7QQFrmT/odMe8QZww8X2nfQ==} + '@typescript-eslint/project-service@8.52.0': + resolution: {integrity: sha512-xD0MfdSdEmeFa3OmVqonHi+Cciab96ls1UhIF/qX/O/gPu5KXD0bY9lu33jj04fjzrXHcuvjBcBC+D3SNSadaw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' @@ -1330,8 +1345,8 @@ packages: resolution: {integrity: sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.51.0': - resolution: {integrity: sha512-JhhJDVwsSx4hiOEQPeajGhCWgBMBwVkxC/Pet53EpBVs7zHHtayKefw1jtPaNRXpI9RA2uocdmpdfE7T+NrizA==} + '@typescript-eslint/scope-manager@8.52.0': + resolution: {integrity: sha512-ixxqmmCcc1Nf8S0mS0TkJ/3LKcC8mruYJPOU6Ia2F/zUUR4pApW7LzrpU3JmtePbRUTes9bEqRc1Gg4iyRnDzA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/tsconfig-utils@8.37.0': @@ -1346,8 +1361,8 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/tsconfig-utils@8.51.0': - resolution: {integrity: sha512-Qi5bSy/vuHeWyir2C8u/uqGMIlIDu8fuiYWv48ZGlZ/k+PRPHtaAu7erpc7p5bzw2WNNSniuxoMSO4Ar6V9OXw==} + '@typescript-eslint/tsconfig-utils@8.52.0': + resolution: {integrity: sha512-jl+8fzr/SdzdxWJznq5nvoI7qn2tNYV/ZBAEcaFMVXf+K6jmXvAFrgo/+5rxgnL152f//pDEAYAhhBAZGrVfwg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' @@ -1359,8 +1374,8 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/type-utils@8.51.0': - resolution: {integrity: sha512-0XVtYzxnobc9K0VU7wRWg1yiUrw4oQzexCG2V2IDxxCxhqBMSMbjB+6o91A+Uc0GWtgjCa3Y8bi7hwI0Tu4n5Q==} + '@typescript-eslint/type-utils@8.52.0': + resolution: {integrity: sha512-JD3wKBRWglYRQkAtsyGz1AewDu3mTc7NtRjR/ceTyGoPqmdS5oCdx/oZMWD5Zuqmo6/MpsYs0wp6axNt88/2EQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1374,8 +1389,8 @@ packages: resolution: {integrity: sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.51.0': - resolution: {integrity: sha512-TizAvWYFM6sSscmEakjY3sPqGwxZRSywSsPEiuZF6d5GmGD9Gvlsv0f6N8FvAAA0CD06l3rIcWNbsN1e5F/9Ag==} + '@typescript-eslint/types@8.52.0': + resolution: {integrity: sha512-LWQV1V4q9V4cT4H5JCIx3481iIFxH1UkVk+ZkGGAV1ZGcjGI9IoFOfg3O6ywz8QqCDEp7Inlg6kovMofsNRaGg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@8.37.0': @@ -1390,8 +1405,8 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/typescript-estree@8.51.0': - resolution: {integrity: sha512-1qNjGqFRmlq0VW5iVlcyHBbCjPB7y6SxpBkrbhNWMy/65ZoncXCEPJxkRZL8McrseNH6lFhaxCIaX+vBuFnRng==} + '@typescript-eslint/typescript-estree@8.52.0': + resolution: {integrity: sha512-XP3LClsCc0FsTK5/frGjolyADTh3QmsLp6nKd476xNI9CsSsLnmn4f0jrzNoAulmxlmNIpeXuHYeEQv61Q6qeQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' @@ -1403,8 +1418,8 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/utils@8.51.0': - resolution: {integrity: sha512-11rZYxSe0zabiKaCP2QAwRf/dnmgFgvTmeDTtZvUvXG3UuAdg/GU02NExmmIXzz3vLGgMdtrIosI84jITQOxUA==} + '@typescript-eslint/utils@8.52.0': + resolution: {integrity: sha512-wYndVMWkweqHpEpwPhwqE2lnD2DxC6WVLupU/DOt/0/v+/+iQbbzO3jOHjmBMnhu0DgLULvOaU4h4pwHYi2oRQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1418,8 +1433,8 @@ packages: resolution: {integrity: sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/visitor-keys@8.51.0': - resolution: {integrity: sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==} + '@typescript-eslint/visitor-keys@8.52.0': + resolution: {integrity: sha512-ink3/Zofus34nmBsPjow63FP5M7IGff0RKAgqR6+CFpdk22M7aLwC9gOcLGYqr7MczLPzZVERW9hRog3O4n1sQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@videojs/http-streaming@3.17.2': @@ -1499,8 +1514,8 @@ packages: typescript: optional: true - '@vue/language-core@3.2.1': - resolution: {integrity: sha512-g6oSenpnGMtpxHGAwKuu7HJJkNZpemK/zg3vZzZbJ6cnnXq1ssxuNrXSsAHYM3NvH8p4IkTw+NLmuxyeYz4r8A==} + '@vue/language-core@3.2.2': + resolution: {integrity: sha512-5DAuhxsxBN9kbriklh3Q5AMaJhyOCNiQJvCskN9/30XOpdLiqZU9Q+WvjArP17ubdGEyZtBzlIeG5nIjEbNOrQ==} '@vue/reactivity@3.5.26': resolution: {integrity: sha512-9EnYB1/DIiUYYnzlnUBgwU32NNvLp/nhxLXeWRhHUEeWNTn1ECxX8aGO7RTXeX6PPcxe3LLuNBFoJbV4QZ+CFQ==} @@ -2421,8 +2436,8 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rollup@4.54.0: - resolution: {integrity: sha512-3nk8Y3a9Ea8szgKhinMlGMhGMw89mqule3KWczxhIzqudyHdCIOHw8WJlj/r329fACjKLEh13ZSk7oE22kyeIw==} + rollup@4.55.1: + resolution: {integrity: sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -2618,8 +2633,8 @@ packages: vite-plugin-compression2@2.4.0: resolution: {integrity: sha512-8J4CBF1+dM1I06azba/eXJuJHinLF0Am7lUvRH8AZpu0otJoBaDEnxrIEr5iPZJSwH0AEglJGYCveh7pN52jCg==} - vite@7.3.0: - resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==} + vite@7.3.1: + resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -2697,8 +2712,8 @@ packages: peerDependencies: vue: ^3.0.2 - vue-tsc@3.2.1: - resolution: {integrity: sha512-I23Rk8dkQfmcSbxDO0dmg9ioMLjKA1pjlU3Lz6Jfk2pMGu3Uryu9810XkcZH24IzPbhzPCnkKo2rEMRX0skSrw==} + vue-tsc@3.2.2: + resolution: {integrity: sha512-r9YSia/VgGwmbbfC06hDdAatH634XJ9nVl6Zrnz1iK4ucp8Wu78kawplXnIDa3MSu1XdQQePTHLXYwPDWn+nyQ==} hasBin: true peerDependencies: typescript: '>=5.0.0' @@ -3649,13 +3664,13 @@ snapshots: '@intlify/shared@11.2.8': {} - '@intlify/unplugin-vue-i18n@11.0.3(@vue/compiler-dom@3.5.26)(eslint@9.39.2)(rollup@4.54.0)(typescript@5.9.3)(vue-i18n@11.2.8(vue@3.5.26(typescript@5.9.3)))(vue@3.5.26(typescript@5.9.3))': + '@intlify/unplugin-vue-i18n@11.0.3(@vue/compiler-dom@3.5.26)(eslint@9.39.2)(rollup@4.55.1)(typescript@5.9.3)(vue-i18n@11.2.8(vue@3.5.26(typescript@5.9.3)))(vue@3.5.26(typescript@5.9.3))': dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2) '@intlify/bundle-utils': 11.0.3(vue-i18n@11.2.8(vue@3.5.26(typescript@5.9.3))) '@intlify/shared': 11.2.2 '@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.2.2)(@vue/compiler-dom@3.5.26)(vue-i18n@11.2.8(vue@3.5.26(typescript@5.9.3)))(vue@3.5.26(typescript@5.9.3)) - '@rollup/pluginutils': 5.3.0(rollup@4.54.0) + '@rollup/pluginutils': 5.3.0(rollup@4.55.1) '@typescript-eslint/scope-manager': 8.49.0 '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) debug: 4.4.3 @@ -3722,78 +3737,87 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.53': {} - '@rollup/pluginutils@5.3.0(rollup@4.54.0)': + '@rollup/pluginutils@5.3.0(rollup@4.55.1)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.54.0 + rollup: 4.55.1 - '@rollup/rollup-android-arm-eabi@4.54.0': + '@rollup/rollup-android-arm-eabi@4.55.1': optional: true - '@rollup/rollup-android-arm64@4.54.0': + '@rollup/rollup-android-arm64@4.55.1': optional: true - '@rollup/rollup-darwin-arm64@4.54.0': + '@rollup/rollup-darwin-arm64@4.55.1': optional: true - '@rollup/rollup-darwin-x64@4.54.0': + '@rollup/rollup-darwin-x64@4.55.1': optional: true - '@rollup/rollup-freebsd-arm64@4.54.0': + '@rollup/rollup-freebsd-arm64@4.55.1': optional: true - '@rollup/rollup-freebsd-x64@4.54.0': + '@rollup/rollup-freebsd-x64@4.55.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.54.0': + '@rollup/rollup-linux-arm-gnueabihf@4.55.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.54.0': + '@rollup/rollup-linux-arm-musleabihf@4.55.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.54.0': + '@rollup/rollup-linux-arm64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.54.0': + '@rollup/rollup-linux-arm64-musl@4.55.1': optional: true - '@rollup/rollup-linux-loong64-gnu@4.54.0': + '@rollup/rollup-linux-loong64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.54.0': + '@rollup/rollup-linux-loong64-musl@4.55.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.54.0': + '@rollup/rollup-linux-ppc64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.54.0': + '@rollup/rollup-linux-ppc64-musl@4.55.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.54.0': + '@rollup/rollup-linux-riscv64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.54.0': + '@rollup/rollup-linux-riscv64-musl@4.55.1': optional: true - '@rollup/rollup-linux-x64-musl@4.54.0': + '@rollup/rollup-linux-s390x-gnu@4.55.1': optional: true - '@rollup/rollup-openharmony-arm64@4.54.0': + '@rollup/rollup-linux-x64-gnu@4.55.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.54.0': + '@rollup/rollup-linux-x64-musl@4.55.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.54.0': + '@rollup/rollup-openbsd-x64@4.55.1': optional: true - '@rollup/rollup-win32-x64-gnu@4.54.0': + '@rollup/rollup-openharmony-arm64@4.55.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.54.0': + '@rollup/rollup-win32-arm64-msvc@4.55.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.55.1': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.55.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.55.1': optional: true '@tsconfig/node24@24.0.3': {} @@ -3812,7 +3836,7 @@ snapshots: '@types/lodash@4.17.13': {} - '@types/node@24.10.4': + '@types/node@24.10.6': dependencies: undici-types: 7.16.0 @@ -3838,14 +3862,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.51.0(@typescript-eslint/parser@8.37.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)': + '@typescript-eslint/eslint-plugin@8.52.0(@typescript-eslint/parser@8.37.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.2 '@typescript-eslint/parser': 8.37.0(eslint@9.39.2)(typescript@5.9.3) - '@typescript-eslint/scope-manager': 8.51.0 - '@typescript-eslint/type-utils': 8.51.0(eslint@9.39.2)(typescript@5.9.3) - '@typescript-eslint/utils': 8.51.0(eslint@9.39.2)(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.51.0 + '@typescript-eslint/scope-manager': 8.52.0 + '@typescript-eslint/type-utils': 8.52.0(eslint@9.39.2)(typescript@5.9.3) + '@typescript-eslint/utils': 8.52.0(eslint@9.39.2)(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.52.0 eslint: 9.39.2 ignore: 7.0.5 natural-compare: 1.4.0 @@ -3884,10 +3908,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.51.0(typescript@5.9.3)': + '@typescript-eslint/project-service@8.52.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.51.0(typescript@5.9.3) - '@typescript-eslint/types': 8.51.0 + '@typescript-eslint/tsconfig-utils': 8.52.0(typescript@5.9.3) + '@typescript-eslint/types': 8.52.0 debug: 4.4.3 typescript: 5.9.3 transitivePeerDependencies: @@ -3903,10 +3927,10 @@ snapshots: '@typescript-eslint/types': 8.49.0 '@typescript-eslint/visitor-keys': 8.49.0 - '@typescript-eslint/scope-manager@8.51.0': + '@typescript-eslint/scope-manager@8.52.0': dependencies: - '@typescript-eslint/types': 8.51.0 - '@typescript-eslint/visitor-keys': 8.51.0 + '@typescript-eslint/types': 8.52.0 + '@typescript-eslint/visitor-keys': 8.52.0 '@typescript-eslint/tsconfig-utils@8.37.0(typescript@5.9.3)': dependencies: @@ -3916,7 +3940,7 @@ snapshots: dependencies: typescript: 5.9.3 - '@typescript-eslint/tsconfig-utils@8.51.0(typescript@5.9.3)': + '@typescript-eslint/tsconfig-utils@8.52.0(typescript@5.9.3)': dependencies: typescript: 5.9.3 @@ -3932,11 +3956,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.51.0(eslint@9.39.2)(typescript@5.9.3)': + '@typescript-eslint/type-utils@8.52.0(eslint@9.39.2)(typescript@5.9.3)': dependencies: - '@typescript-eslint/types': 8.51.0 - '@typescript-eslint/typescript-estree': 8.51.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.51.0(eslint@9.39.2)(typescript@5.9.3) + '@typescript-eslint/types': 8.52.0 + '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.52.0(eslint@9.39.2)(typescript@5.9.3) debug: 4.4.3 eslint: 9.39.2 ts-api-utils: 2.4.0(typescript@5.9.3) @@ -3948,7 +3972,7 @@ snapshots: '@typescript-eslint/types@8.49.0': {} - '@typescript-eslint/types@8.51.0': {} + '@typescript-eslint/types@8.52.0': {} '@typescript-eslint/typescript-estree@8.37.0(typescript@5.9.3)': dependencies: @@ -3981,12 +4005,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.51.0(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.52.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/project-service': 8.51.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.51.0(typescript@5.9.3) - '@typescript-eslint/types': 8.51.0 - '@typescript-eslint/visitor-keys': 8.51.0 + '@typescript-eslint/project-service': 8.52.0(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.52.0(typescript@5.9.3) + '@typescript-eslint/types': 8.52.0 + '@typescript-eslint/visitor-keys': 8.52.0 debug: 4.4.3 minimatch: 9.0.5 semver: 7.7.3 @@ -4007,12 +4031,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.51.0(eslint@9.39.2)(typescript@5.9.3)': + '@typescript-eslint/utils@8.52.0(eslint@9.39.2)(typescript@5.9.3)': dependencies: '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2) - '@typescript-eslint/scope-manager': 8.51.0 - '@typescript-eslint/types': 8.51.0 - '@typescript-eslint/typescript-estree': 8.51.0(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.52.0 + '@typescript-eslint/types': 8.52.0 + '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.9.3) eslint: 9.39.2 typescript: 5.9.3 transitivePeerDependencies: @@ -4028,9 +4052,9 @@ snapshots: '@typescript-eslint/types': 8.49.0 eslint-visitor-keys: 4.2.1 - '@typescript-eslint/visitor-keys@8.51.0': + '@typescript-eslint/visitor-keys@8.52.0': dependencies: - '@typescript-eslint/types': 8.51.0 + '@typescript-eslint/types': 8.52.0 eslint-visitor-keys: 4.2.1 '@videojs/http-streaming@3.17.2(video.js@8.23.4)': @@ -4055,7 +4079,7 @@ snapshots: global: 4.4.0 is-function: 1.0.2 - '@vitejs/plugin-legacy@7.2.1(terser@5.44.1)(vite@7.3.0(@types/node@24.10.4)(terser@5.44.1)(yaml@2.8.2))': + '@vitejs/plugin-legacy@7.2.1(terser@5.44.1)(vite@7.3.1(@types/node@24.10.6)(terser@5.44.1)(yaml@2.8.2))': dependencies: '@babel/core': 7.28.5 '@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.28.5) @@ -4070,14 +4094,14 @@ snapshots: regenerator-runtime: 0.14.1 systemjs: 6.15.1 terser: 5.44.1 - vite: 7.3.0(@types/node@24.10.4)(terser@5.44.1)(yaml@2.8.2) + vite: 7.3.1(@types/node@24.10.6)(terser@5.44.1)(yaml@2.8.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@6.0.3(vite@7.3.0(@types/node@24.10.4)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))': + '@vitejs/plugin-vue@6.0.3(vite@7.3.1(@types/node@24.10.6)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.53 - vite: 7.3.0(@types/node@24.10.4)(terser@5.44.1)(yaml@2.8.2) + vite: 7.3.1(@types/node@24.10.6)(terser@5.44.1)(yaml@2.8.2) vue: 3.5.26(typescript@5.9.3) '@volar/language-core@2.4.27': @@ -4164,7 +4188,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vue/language-core@3.2.1': + '@vue/language-core@3.2.2': dependencies: '@volar/language-core': 2.4.27 '@vue/compiler-dom': 3.5.26 @@ -5068,32 +5092,35 @@ snapshots: rfdc@1.4.1: {} - rollup@4.54.0: + rollup@4.55.1: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.54.0 - '@rollup/rollup-android-arm64': 4.54.0 - '@rollup/rollup-darwin-arm64': 4.54.0 - '@rollup/rollup-darwin-x64': 4.54.0 - '@rollup/rollup-freebsd-arm64': 4.54.0 - '@rollup/rollup-freebsd-x64': 4.54.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.54.0 - '@rollup/rollup-linux-arm-musleabihf': 4.54.0 - '@rollup/rollup-linux-arm64-gnu': 4.54.0 - '@rollup/rollup-linux-arm64-musl': 4.54.0 - '@rollup/rollup-linux-loong64-gnu': 4.54.0 - '@rollup/rollup-linux-ppc64-gnu': 4.54.0 - '@rollup/rollup-linux-riscv64-gnu': 4.54.0 - '@rollup/rollup-linux-riscv64-musl': 4.54.0 - '@rollup/rollup-linux-s390x-gnu': 4.54.0 - '@rollup/rollup-linux-x64-gnu': 4.54.0 - '@rollup/rollup-linux-x64-musl': 4.54.0 - '@rollup/rollup-openharmony-arm64': 4.54.0 - '@rollup/rollup-win32-arm64-msvc': 4.54.0 - '@rollup/rollup-win32-ia32-msvc': 4.54.0 - '@rollup/rollup-win32-x64-gnu': 4.54.0 - '@rollup/rollup-win32-x64-msvc': 4.54.0 + '@rollup/rollup-android-arm-eabi': 4.55.1 + '@rollup/rollup-android-arm64': 4.55.1 + '@rollup/rollup-darwin-arm64': 4.55.1 + '@rollup/rollup-darwin-x64': 4.55.1 + '@rollup/rollup-freebsd-arm64': 4.55.1 + '@rollup/rollup-freebsd-x64': 4.55.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.55.1 + '@rollup/rollup-linux-arm-musleabihf': 4.55.1 + '@rollup/rollup-linux-arm64-gnu': 4.55.1 + '@rollup/rollup-linux-arm64-musl': 4.55.1 + '@rollup/rollup-linux-loong64-gnu': 4.55.1 + '@rollup/rollup-linux-loong64-musl': 4.55.1 + '@rollup/rollup-linux-ppc64-gnu': 4.55.1 + '@rollup/rollup-linux-ppc64-musl': 4.55.1 + '@rollup/rollup-linux-riscv64-gnu': 4.55.1 + '@rollup/rollup-linux-riscv64-musl': 4.55.1 + '@rollup/rollup-linux-s390x-gnu': 4.55.1 + '@rollup/rollup-linux-x64-gnu': 4.55.1 + '@rollup/rollup-linux-x64-musl': 4.55.1 + '@rollup/rollup-openbsd-x64': 4.55.1 + '@rollup/rollup-openharmony-arm64': 4.55.1 + '@rollup/rollup-win32-arm64-msvc': 4.55.1 + '@rollup/rollup-win32-ia32-msvc': 4.55.1 + '@rollup/rollup-win32-x64-gnu': 4.55.1 + '@rollup/rollup-win32-x64-msvc': 4.55.1 fsevents: 2.3.3 run-parallel@1.2.0: @@ -5282,23 +5309,23 @@ snapshots: dependencies: global: 4.4.0 - vite-plugin-compression2@2.4.0(rollup@4.54.0): + vite-plugin-compression2@2.4.0(rollup@4.55.1): dependencies: - '@rollup/pluginutils': 5.3.0(rollup@4.54.0) + '@rollup/pluginutils': 5.3.0(rollup@4.55.1) tar-mini: 0.2.0 transitivePeerDependencies: - rollup - vite@7.3.0(@types/node@24.10.4)(terser@5.44.1)(yaml@2.8.2): + vite@7.3.1(@types/node@24.10.6)(terser@5.44.1)(yaml@2.8.2): dependencies: esbuild: 0.27.2 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.54.0 + rollup: 4.55.1 tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 24.10.4 + '@types/node': 24.10.6 fsevents: 2.3.3 terser: 5.44.1 yaml: 2.8.2 @@ -5346,10 +5373,10 @@ snapshots: dependencies: vue: 3.5.26(typescript@5.9.3) - vue-tsc@3.2.1(typescript@5.9.3): + vue-tsc@3.2.2(typescript@5.9.3): dependencies: '@volar/typescript': 2.4.27 - '@vue/language-core': 3.2.1 + '@vue/language-core': 3.2.2 typescript: 5.9.3 vue@3.5.26(typescript@5.9.3): diff --git a/filebrowser/frontend/src/components/prompts/Copy.vue b/filebrowser/frontend/src/components/prompts/Copy.vue index 9b5e4c638c..09040e0a44 100644 --- a/filebrowser/frontend/src/components/prompts/Copy.vue +++ b/filebrowser/frontend/src/components/prompts/Copy.vue @@ -109,7 +109,8 @@ export default { return; } - this.$router.push({ path: this.dest }); + if (this.user.redirectAfterCopyMove) + this.$router.push({ path: this.dest }); }) .catch((e) => { buttons.done("copy"); diff --git a/filebrowser/frontend/src/components/prompts/Move.vue b/filebrowser/frontend/src/components/prompts/Move.vue index d92e4b6ec0..0fec867962 100644 --- a/filebrowser/frontend/src/components/prompts/Move.vue +++ b/filebrowser/frontend/src/components/prompts/Move.vue @@ -79,7 +79,7 @@ export default { computed: { ...mapState(useFileStore, ["req", "selected"]), ...mapState(useAuthStore, ["user"]), - ...mapWritableState(useFileStore, ["preselect"]), + ...mapWritableState(useFileStore, ["reload", "preselect"]), excludedFolders() { return this.selected .filter((idx) => this.req.items[idx].isDir) @@ -108,7 +108,9 @@ export default { .then(() => { buttons.success("move"); this.preselect = removePrefix(items[0].to); - this.$router.push({ path: this.dest }); + if (this.user.redirectAfterCopyMove) + this.$router.push({ path: this.dest }); + else this.reload = true; }) .catch((e) => { buttons.done("move"); diff --git a/filebrowser/frontend/src/i18n/ar.json b/filebrowser/frontend/src/i18n/ar.json index b6d1d39b17..bbe174611a 100644 --- a/filebrowser/frontend/src/i18n/ar.json +++ b/filebrowser/frontend/src/i18n/ar.json @@ -24,7 +24,7 @@ "ok": "موافق", "permalink": "الحصول على رابط دائم", "previous": "السابق", - "preview": "Preview", + "preview": "معاينة", "publish": "نشر", "rename": "إعادة تسمية", "replace": "استبدال", @@ -43,11 +43,11 @@ "upload": "رفع", "openFile": "فتح الملف", "discardChanges": "إلغاء التغييرات", - "stopSearch": "Stop searching", - "saveChanges": "Save changes", - "editAsText": "Edit as Text", - "increaseFontSize": "Increase font size", - "decreaseFontSize": "Decrease font size" + "stopSearch": "توقف عن البحث", + "saveChanges": "حفظ التغييرات", + "editAsText": "تعديل على شكل نص", + "increaseFontSize": "زيادة حجم الخط", + "decreaseFontSize": "تصغير حجم الخط" }, "download": { "downloadFile": "تحميل الملف", @@ -80,7 +80,7 @@ "sortByName": "الترتيب باﻹسم", "sortBySize": "الترتيب بالحجم", "noPreview": "لا يوجد عرض مسبق لهذا الملف.", - "csvTooLarge": "CSV file is too large for preview (>5MB). Please download to view.", + "csvTooLarge": "حجم الملف اكبر من (<5MB), يرجى تحميل الملف للمعاينة", "csvLoadFailed": "Failed to load CSV file.", "showingRows": "Showing {count} row(s)", "columnSeparator": "Column Separator", @@ -138,7 +138,7 @@ "filesSelected": "تم تحديد {count} ملفات.", "lastModified": "آخر تعديل", "move": "نقل", - "moveMessage": "إختر مكان جديد للملفات أو المجلدات المراد نقلها:", + "moveMessage": "اختر منزلاً جديداً لملفك (ملفاتك)/مجلدك (مجلداتك):", "newArchetype": "إنشاء منشور من المنشور اﻷصلي. الملف سيتم انشاءه في مجلد المحتويات.", "newDir": "مجلد جديد", "newDirMessage": "أدخل اسم المجلد الجديد.", @@ -189,15 +189,15 @@ "commandRunner": "منفذ اﻷوامر", "commandRunnerHelp": "هنا بإمكانك تعيين اﻷوامر التي سيتم تنفيذها في اﻷحداث المسماة. يجب كتابة أمر واحد في كل سطر. ستكون المتغيرات البيئية (env) {0} و {1} متاحة، حيث {0} نسبي لـ {1}. لمزيد من المعلومات حول هذه الميزة و المتغيرات البيئية المتاحة، يرجى قراءة {2}.", "commandsUpdated": "تم تحديث اﻷوامر", - "createUserDir": "إنشاء مجلد المستخدم (home) تلقائياً عند إنشاء مستخدم جديد", + "createUserDir": "إنشاء مجلد المستخدم الرئيسي تلقائياً عند إنشاء مستخدم جديد", "minimumPasswordLength": "Minimum password length", "tusUploads": "التحميلات المتقطعة", "tusUploadsHelp": "يدعم متصفح الملفات تحميل الملفات المتقطعة، مما يسمح بتحميلات الملفات بشكل فعال و موثوق و قابلة للمتابغة و متقطعة حتى على الشبكات غير الموثوقة.", "tusUploadsChunkSize": "يشير إلى الحد اﻷقصى لحجم الطلب (سيتم استخدام التحميل المباشر للتحميلات صغيرة الخحم). يمكنك إدخال عدد صحيح عادي يدل على الحجم بوحدة البايت أو نمظ مثل10MB, 1GB, إلخ.", "tusUploadsRetryCount": "عدد مرات إعادة المحاولة إذا فشلت عملية تحميل القطعة.", - "userHomeBasePath": "المسار الرئيسي لمجلد المستخدم (home)", + "userHomeBasePath": "المسار الرئيسي لمجلد المستخدم الرئيسي", "userScopeGenerationPlaceholder": "سيتم تعيين نطاق المستخدم تلقائياً", - "createUserHomeDirectory": "إنشاء مجلد المستخدم (home)", + "createUserHomeDirectory": "إنشاء مجلد المستخدم الرئيسي", "customStylesheet": "ستايل مخصص", "defaultUserDescription": "هذه اﻹعدادات اﻹفتراضية للمستخدمين الجدد.", "disableExternalLinks": "تعطيل الروابط الخارجية (بإسثناء الوثائق)", @@ -258,7 +258,8 @@ "userManagement": "إدارة المستخدمين", "userUpdated": "تم تعديل المستخدم", "username": "إسم المستخدم", - "users": "المستخدمين" + "users": "المستخدمين", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "مساعدة", diff --git a/filebrowser/frontend/src/i18n/bg.json b/filebrowser/frontend/src/i18n/bg.json index 2f1b2a0621..afbd8a9c55 100644 --- a/filebrowser/frontend/src/i18n/bg.json +++ b/filebrowser/frontend/src/i18n/bg.json @@ -258,7 +258,8 @@ "userManagement": "Управление на потребители", "userUpdated": "Потребителя е обновен!", "username": "Потребителско име", - "users": "Потребители" + "users": "Потребители", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Помощ", diff --git a/filebrowser/frontend/src/i18n/ca.json b/filebrowser/frontend/src/i18n/ca.json index f269f06b4f..a8e8849857 100644 --- a/filebrowser/frontend/src/i18n/ca.json +++ b/filebrowser/frontend/src/i18n/ca.json @@ -258,7 +258,8 @@ "userManagement": "Administració d'usuaris", "userUpdated": "Usuari actualitzat!", "username": "Usuari", - "users": "Usuaris" + "users": "Usuaris", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Ajuda", diff --git a/filebrowser/frontend/src/i18n/cs.json b/filebrowser/frontend/src/i18n/cs.json index dce412dd2b..6f489c53a4 100644 --- a/filebrowser/frontend/src/i18n/cs.json +++ b/filebrowser/frontend/src/i18n/cs.json @@ -258,7 +258,8 @@ "userManagement": "Správa uživatelů", "userUpdated": "Uživatel aktualizován!", "username": "Uživatelské jméno", - "users": "Uživatelé" + "users": "Uživatelé", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Nápověda", diff --git a/filebrowser/frontend/src/i18n/de.json b/filebrowser/frontend/src/i18n/de.json index 4f398cfab9..815fbd1fa8 100644 --- a/filebrowser/frontend/src/i18n/de.json +++ b/filebrowser/frontend/src/i18n/de.json @@ -43,11 +43,11 @@ "upload": "Upload", "openFile": "Datei öffnen", "discardChanges": "Verwerfen", - "stopSearch": "Stop searching", + "stopSearch": "Suche abbrechen", "saveChanges": "Änderungen speichern", "editAsText": "Als Text bearbeiten", - "increaseFontSize": "Increase font size", - "decreaseFontSize": "Decrease font size" + "increaseFontSize": "Schriftgröße vergrößern", + "decreaseFontSize": "Schriftgröße verkleinern" }, "download": { "downloadFile": "Download Datei", @@ -82,12 +82,12 @@ "noPreview": "Für diese Datei ist keine Vorschau verfügbar.", "csvTooLarge": "Die CSV-Datei ist zu groß für die Vorschau (>5 MB). Bitte herunterladen, um sie anzuzeigen.", "csvLoadFailed": "Fehler beim Laden der CSV-Datei.", - "showingRows": "Showing {count} row(s)", - "columnSeparator": "Column Separator", + "showingRows": "{count} Zeile(n) werden angezeigt", + "columnSeparator": "Spaltentrennzeichen", "csvSeparators": { - "comma": "Comma (,)", - "semicolon": "Semicolon (;)", - "both": "Both (,) and (;)" + "comma": "Komma (,)", + "semicolon": "Semikolon (;)", + "both": "Sowohl (,) als auch (;)" } }, "help": { @@ -214,7 +214,7 @@ "instanceName": "Instanzname", "language": "Sprache", "lockPassword": "Verhindere, dass der Benutzer sein Passwort ändert", - "newPassword": "Ihr neues Passwort.", + "newPassword": "Ihr neues Passwort", "newPasswordConfirm": "Bestätigen Sie Ihr neues Passwort", "newUser": "Neuer Benutzer", "password": "Passwort", @@ -258,7 +258,8 @@ "userManagement": "Benutzerverwaltung", "userUpdated": "Benutzer aktualisiert!", "username": "Nutzername", - "users": "Nutzer" + "users": "Nutzer", + "currentPassword": "Ihr aktuelles Passwort" }, "sidebar": { "help": "Hilfe", diff --git a/filebrowser/frontend/src/i18n/el.json b/filebrowser/frontend/src/i18n/el.json index 8f61e53825..121452a117 100644 --- a/filebrowser/frontend/src/i18n/el.json +++ b/filebrowser/frontend/src/i18n/el.json @@ -258,7 +258,8 @@ "userManagement": "Διαχείριση χρηστών", "userUpdated": "Ο χρήστης ενημερώθηκε!", "username": "Όνομα χρήστη", - "users": "Χρήστες" + "users": "Χρήστες", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Βοήθεια", diff --git a/filebrowser/frontend/src/i18n/en.json b/filebrowser/frontend/src/i18n/en.json index 60fe527f1f..3fcdf6351c 100644 --- a/filebrowser/frontend/src/i18n/en.json +++ b/filebrowser/frontend/src/i18n/en.json @@ -232,6 +232,7 @@ "permissions": "Permissions", "permissionsHelp": "You can set the user to be an administrator or choose the permissions individually. If you select \"Administrator\", all of the other options will be automatically checked. The management of users remains a privilege of an administrator.\n", "profileSettings": "Profile Settings", + "redirectAfterCopyMove": "Redirect to destination after copy/move", "ruleExample1": "prevents the access to any dotfile (such as .git, .gitignore) in every folder.\n", "ruleExample2": "blocks the access to the file named Caddyfile on the root of the scope.", "rules": "Rules", diff --git a/filebrowser/frontend/src/i18n/es.json b/filebrowser/frontend/src/i18n/es.json index a60f84a063..28338c98cc 100644 --- a/filebrowser/frontend/src/i18n/es.json +++ b/filebrowser/frontend/src/i18n/es.json @@ -258,7 +258,8 @@ "userManagement": "Administración de usuarios", "userUpdated": "¡Usuario actualizado!", "username": "Usuario", - "users": "Usuarios" + "users": "Usuarios", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Ayuda", diff --git a/filebrowser/frontend/src/i18n/fa.json b/filebrowser/frontend/src/i18n/fa.json index fb26f19cf4..4af7f2055c 100644 --- a/filebrowser/frontend/src/i18n/fa.json +++ b/filebrowser/frontend/src/i18n/fa.json @@ -258,7 +258,8 @@ "userManagement": "مدیریت کاربران", "userUpdated": "کاربر به روز شد!", "username": "نام کاربری", - "users": "کاربران" + "users": "کاربران", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "راهنما", diff --git a/filebrowser/frontend/src/i18n/fr.json b/filebrowser/frontend/src/i18n/fr.json index 1710b63715..148306e5f0 100644 --- a/filebrowser/frontend/src/i18n/fr.json +++ b/filebrowser/frontend/src/i18n/fr.json @@ -43,11 +43,11 @@ "upload": "Importer", "openFile": "Ouvrir le fichier", "discardChanges": "Annuler", - "stopSearch": "Stop searching", - "saveChanges": "Save changes", - "editAsText": "Edit as Text", - "increaseFontSize": "Increase font size", - "decreaseFontSize": "Decrease font size" + "stopSearch": "Arrêter recherche", + "saveChanges": "Enregistrer changements", + "editAsText": "Editer comme Texte", + "increaseFontSize": "Augmenter taille police", + "decreaseFontSize": "Réduire taille police" }, "download": { "downloadFile": "Télécharger le fichier", @@ -80,14 +80,14 @@ "sortByName": "Trier par nom", "sortBySize": "Trier par taille", "noPreview": "L'aperçu n'est pas disponible pour ce fichier.", - "csvTooLarge": "CSV file is too large for preview (>5MB). Please download to view.", - "csvLoadFailed": "Failed to load CSV file.", - "showingRows": "Showing {count} row(s)", - "columnSeparator": "Column Separator", + "csvTooLarge": "Le fichier CSV est trop volumineux pour être prévisualisé (>5MB). Veuillez le télécharger pour le voir.", + "csvLoadFailed": "Impossible de charger le fichier CSV.", + "showingRows": "Affichage de {count} ligne(s)", + "columnSeparator": "Séparateur de Colonnes", "csvSeparators": { - "comma": "Comma (,)", - "semicolon": "Semicolon (;)", - "both": "Both (,) and (;)" + "comma": "Virgule (,)", + "semicolon": "Point-virgule (;)", + "both": "Les (,) et (;)" } }, "help": { @@ -115,9 +115,9 @@ "username": "Utilisateur·ice", "usernameTaken": "Le nom d'utilisateur·ice est déjà pris", "wrongCredentials": "Identifiants incorrects !", - "passwordTooShort": "Password must be at least {min} characters", + "passwordTooShort": "Le mot de passe doit contenir au moins {min} caractères", "logout_reasons": { - "inactivity": "You have been logged out due to inactivity." + "inactivity": "Vous avez été déconnecté(e) en raison d'une inactivité prolongée." } }, "permanent": "Permanent", @@ -172,7 +172,7 @@ "video": "Vidéo" }, "settings": { - "aceEditorTheme": "Ace editor theme", + "aceEditorTheme": "Éditeur de Thème Ace", "admin": "Admin", "administrator": "Administrateur·ice", "allowCommands": "Exécuter des commandes", @@ -180,7 +180,7 @@ "allowNew": "Créer de nouveaux fichiers et dossiers", "allowPublish": "Publier de nouveaux posts et pages", "allowSignup": "Autoriser les utilisateur·ices à s'inscrire", - "hideLoginButton": "Hide the login button from public pages", + "hideLoginButton": "Cacher le bouton d’identification sur les pages publiques", "avoidChanges": "(Laisser vide pour conserver l'actuel)", "branding": "Image de marque", "brandingDirectoryPath": "Chemin du dossier d'image de marque", @@ -258,7 +258,8 @@ "userManagement": "Gestion des utilisateur·ices", "userUpdated": "Utilisateur·ice mis à jour !", "username": "Nom d'utilisateur·ice", - "users": "Utilisateur·ices" + "users": "Utilisateur·ices", + "currentPassword": "Mot de Passe Actuel" }, "sidebar": { "help": "Aide", diff --git a/filebrowser/frontend/src/i18n/he.json b/filebrowser/frontend/src/i18n/he.json index 1f896bcf48..d2deb93889 100644 --- a/filebrowser/frontend/src/i18n/he.json +++ b/filebrowser/frontend/src/i18n/he.json @@ -258,7 +258,8 @@ "userManagement": "ניהול משתמש", "userUpdated": "המשתמש עודכן!", "username": "שם משתמש", - "users": "משתמשים" + "users": "משתמשים", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "עזרה", diff --git a/filebrowser/frontend/src/i18n/hr.json b/filebrowser/frontend/src/i18n/hr.json index 42fa9beabb..1a467cc053 100644 --- a/filebrowser/frontend/src/i18n/hr.json +++ b/filebrowser/frontend/src/i18n/hr.json @@ -258,7 +258,8 @@ "userManagement": "Upravljanje Korisnicima", "userUpdated": "Korisnik ažuriran!", "username": "Korisničko ime", - "users": "Korisnici" + "users": "Korisnici", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Pomoć", diff --git a/filebrowser/frontend/src/i18n/hu.json b/filebrowser/frontend/src/i18n/hu.json index 3a0b047a80..0f2abeefe0 100644 --- a/filebrowser/frontend/src/i18n/hu.json +++ b/filebrowser/frontend/src/i18n/hu.json @@ -258,7 +258,8 @@ "userManagement": "Felhasználókezelés", "userUpdated": "Felhasználó frissítve!", "username": "Felhasználói név", - "users": "Felhasználók" + "users": "Felhasználók", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Súgó", diff --git a/filebrowser/frontend/src/i18n/is.json b/filebrowser/frontend/src/i18n/is.json index 595098a186..2752b60f48 100644 --- a/filebrowser/frontend/src/i18n/is.json +++ b/filebrowser/frontend/src/i18n/is.json @@ -258,7 +258,8 @@ "userManagement": "Notendastýring", "userUpdated": "Notandastillingar vistaðar!", "username": "Notendanafn", - "users": "Notendur" + "users": "Notendur", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Hjálp", diff --git a/filebrowser/frontend/src/i18n/it.json b/filebrowser/frontend/src/i18n/it.json index 297983598b..29863efa4f 100644 --- a/filebrowser/frontend/src/i18n/it.json +++ b/filebrowser/frontend/src/i18n/it.json @@ -258,7 +258,8 @@ "userManagement": "Gestione degli utenti", "userUpdated": "Utente aggiornato!", "username": "Nome utente", - "users": "Utenti" + "users": "Utenti", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Aiuto", diff --git a/filebrowser/frontend/src/i18n/ja.json b/filebrowser/frontend/src/i18n/ja.json index 0a94d2e112..f6f2b88691 100644 --- a/filebrowser/frontend/src/i18n/ja.json +++ b/filebrowser/frontend/src/i18n/ja.json @@ -42,7 +42,6 @@ "update": "更新", "upload": "アップロード", "openFile": "ファイルを開く", - "stopSearch": "検索を停止", "discardChanges": "Discard", "stopSearch": "Stop searching", "saveChanges": "Save changes", @@ -259,7 +258,8 @@ "userManagement": "ユーザー管理", "userUpdated": "ユーザーを更新しました!", "username": "ユーザー名", - "users": "ユーザー" + "users": "ユーザー", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "ヘルプ", diff --git a/filebrowser/frontend/src/i18n/ko.json b/filebrowser/frontend/src/i18n/ko.json index acbdac9554..fe1e6ec28a 100644 --- a/filebrowser/frontend/src/i18n/ko.json +++ b/filebrowser/frontend/src/i18n/ko.json @@ -41,7 +41,6 @@ "toggleSidebar": "사이드바 전환", "update": "업데이트", "upload": "업로드", - "stopSearch": "검색 중지", "openFile": "파일 열기", "discardChanges": "변경 사항 취소", "stopSearch": "Stop searching", @@ -259,7 +258,8 @@ "userManagement": "사용자 관리", "userUpdated": "사용자 수정됨!", "username": "사용자 이름", - "users": "사용자" + "users": "사용자", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "도움말", diff --git a/filebrowser/frontend/src/i18n/lv.json b/filebrowser/frontend/src/i18n/lv.json index 8a57f578ef..fabd4a86c9 100644 --- a/filebrowser/frontend/src/i18n/lv.json +++ b/filebrowser/frontend/src/i18n/lv.json @@ -258,7 +258,8 @@ "userManagement": "Lietotāju pārvaldība", "userUpdated": "Lietotājs atjaunināts!", "username": "Lietotājvārds", - "users": "Lietotāji" + "users": "Lietotāji", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Palīdzība", diff --git a/filebrowser/frontend/src/i18n/lv_LV.json b/filebrowser/frontend/src/i18n/lv_LV.json index 8a57f578ef..fabd4a86c9 100644 --- a/filebrowser/frontend/src/i18n/lv_LV.json +++ b/filebrowser/frontend/src/i18n/lv_LV.json @@ -258,7 +258,8 @@ "userManagement": "Lietotāju pārvaldība", "userUpdated": "Lietotājs atjaunināts!", "username": "Lietotājvārds", - "users": "Lietotāji" + "users": "Lietotāji", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Palīdzība", diff --git a/filebrowser/frontend/src/i18n/nl-be.json b/filebrowser/frontend/src/i18n/nl-be.json index b78ff204cd..6b2b53843a 100644 --- a/filebrowser/frontend/src/i18n/nl-be.json +++ b/filebrowser/frontend/src/i18n/nl-be.json @@ -258,7 +258,8 @@ "userManagement": "Gebruikersbeheer", "userUpdated": "Gebruiker bijgewerkt!", "username": "Gebruikersnaam", - "users": "Gebruikers" + "users": "Gebruikers", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Help", diff --git a/filebrowser/frontend/src/i18n/no.json b/filebrowser/frontend/src/i18n/no.json index eb1a1c1232..79b6f9583d 100644 --- a/filebrowser/frontend/src/i18n/no.json +++ b/filebrowser/frontend/src/i18n/no.json @@ -258,7 +258,8 @@ "userManagement": "Brukeradministrasjon", "userUpdated": "Bruker opprettet!", "username": "Brukernavn", - "users": "Bruker" + "users": "Bruker", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Hjelp", diff --git a/filebrowser/frontend/src/i18n/pl.json b/filebrowser/frontend/src/i18n/pl.json index 79cbb5d88a..2d43d91ad5 100644 --- a/filebrowser/frontend/src/i18n/pl.json +++ b/filebrowser/frontend/src/i18n/pl.json @@ -258,7 +258,8 @@ "userManagement": "Zarządzanie użytkownikami", "userUpdated": "Użytkownik zapisany!", "username": "Nazwa użytkownika", - "users": "Użytkownicy" + "users": "Użytkownicy", + "currentPassword": "Twoje aktualne hasło" }, "sidebar": { "help": "Pomoc", diff --git a/filebrowser/frontend/src/i18n/pt-br.json b/filebrowser/frontend/src/i18n/pt-br.json index d994cbaac9..2f56335478 100644 --- a/filebrowser/frontend/src/i18n/pt-br.json +++ b/filebrowser/frontend/src/i18n/pt-br.json @@ -258,7 +258,8 @@ "userManagement": "Gerenciamento de usuários", "userUpdated": "Usuário atualizado!", "username": "Nome do usuário", - "users": "Usuários" + "users": "Usuários", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Ajuda", diff --git a/filebrowser/frontend/src/i18n/pt.json b/filebrowser/frontend/src/i18n/pt.json index 249a775a36..4c076622fc 100644 --- a/filebrowser/frontend/src/i18n/pt.json +++ b/filebrowser/frontend/src/i18n/pt.json @@ -258,7 +258,8 @@ "userManagement": "Gestão de utilizadores", "userUpdated": "Utilizador atualizado!", "username": "Nome de utilizador", - "users": "Utilizadores" + "users": "Utilizadores", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Ajuda", diff --git a/filebrowser/frontend/src/i18n/ro.json b/filebrowser/frontend/src/i18n/ro.json index d5184d6349..82b5c388ab 100644 --- a/filebrowser/frontend/src/i18n/ro.json +++ b/filebrowser/frontend/src/i18n/ro.json @@ -258,7 +258,8 @@ "userManagement": "Gestionare utilizatori", "userUpdated": "Utilizator actualizat!", "username": "Utilizator", - "users": "Utilizatori" + "users": "Utilizatori", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Ajutor", diff --git a/filebrowser/frontend/src/i18n/ru.json b/filebrowser/frontend/src/i18n/ru.json index 48e9fde61f..359fd228ca 100644 --- a/filebrowser/frontend/src/i18n/ru.json +++ b/filebrowser/frontend/src/i18n/ru.json @@ -42,7 +42,6 @@ "update": "Обновить", "upload": "Загрузить", "openFile": "Открыть файл", - "stopSearch": "Прекратить поиск", "discardChanges": "Отказаться", "stopSearch": "Stop searching", "saveChanges": "Сохранить", @@ -259,7 +258,8 @@ "userManagement": "Управление пользователями", "userUpdated": "Пользователь изменен!", "username": "Имя пользователя", - "users": "Пользователи" + "users": "Пользователи", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Помощь", diff --git a/filebrowser/frontend/src/i18n/sk.json b/filebrowser/frontend/src/i18n/sk.json index ee85b1d564..0031b73000 100644 --- a/filebrowser/frontend/src/i18n/sk.json +++ b/filebrowser/frontend/src/i18n/sk.json @@ -258,7 +258,8 @@ "userManagement": "Správa používateľov", "userUpdated": "Používateľ upravený!", "username": "Meno používateľa", - "users": "Používatelia" + "users": "Používatelia", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Pomoc", diff --git a/filebrowser/frontend/src/i18n/sv-se.json b/filebrowser/frontend/src/i18n/sv-se.json index 3e1f82cfb5..8e823b43ae 100644 --- a/filebrowser/frontend/src/i18n/sv-se.json +++ b/filebrowser/frontend/src/i18n/sv-se.json @@ -258,7 +258,8 @@ "userManagement": "Användarehantering", "userUpdated": "Användare uppdaterad!", "username": "Användarnamn", - "users": "Användare" + "users": "Användare", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Hjälp", diff --git a/filebrowser/frontend/src/i18n/tr.json b/filebrowser/frontend/src/i18n/tr.json index cdaf8e250a..ac18f211ad 100644 --- a/filebrowser/frontend/src/i18n/tr.json +++ b/filebrowser/frontend/src/i18n/tr.json @@ -258,7 +258,8 @@ "userManagement": "Kullanıcı yönetimi", "userUpdated": "Kullanıcı güncellendi!", "username": "Kullanıcı adı", - "users": "Kullanıcılar" + "users": "Kullanıcılar", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Yardım", diff --git a/filebrowser/frontend/src/i18n/uk.json b/filebrowser/frontend/src/i18n/uk.json index e53adc319f..2ae93f00a7 100644 --- a/filebrowser/frontend/src/i18n/uk.json +++ b/filebrowser/frontend/src/i18n/uk.json @@ -258,7 +258,8 @@ "userManagement": "Керування користувачами", "userUpdated": "Користувача змінено!", "username": "Ім'я користувача", - "users": "Користувачі" + "users": "Користувачі", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Допомога", diff --git a/filebrowser/frontend/src/i18n/vi.json b/filebrowser/frontend/src/i18n/vi.json index 8a71150d77..793f21204f 100644 --- a/filebrowser/frontend/src/i18n/vi.json +++ b/filebrowser/frontend/src/i18n/vi.json @@ -258,7 +258,8 @@ "userManagement": "Quản lý người dùng", "userUpdated": "Người dùng đã được cập nhật!", "username": "Tên người dùng", - "users": "Người dùng" + "users": "Người dùng", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "Trợ giúp", diff --git a/filebrowser/frontend/src/i18n/zh-cn.json b/filebrowser/frontend/src/i18n/zh-cn.json index d7bb63c648..5717891106 100644 --- a/filebrowser/frontend/src/i18n/zh-cn.json +++ b/filebrowser/frontend/src/i18n/zh-cn.json @@ -42,7 +42,6 @@ "update": "更新", "upload": "上传", "openFile": "打开文件", - "stopSearch": "停止搜索", "discardChanges": "放弃更改", "stopSearch": "Stop searching", "saveChanges": "保存更改", @@ -259,7 +258,8 @@ "userManagement": "用户管理", "userUpdated": "用户已更新!", "username": "用户名", - "users": "用户" + "users": "用户", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "帮助", diff --git a/filebrowser/frontend/src/i18n/zh-tw.json b/filebrowser/frontend/src/i18n/zh-tw.json index e5a32801a0..d8630129ee 100644 --- a/filebrowser/frontend/src/i18n/zh-tw.json +++ b/filebrowser/frontend/src/i18n/zh-tw.json @@ -42,7 +42,6 @@ "update": "更新", "upload": "上傳", "openFile": "開啟檔案", - "stopSearch": "停止搜尋", "discardChanges": "放棄變更", "stopSearch": "Stop searching", "saveChanges": "Save changes", @@ -259,7 +258,8 @@ "userManagement": "使用者管理", "userUpdated": "使用者已更新!", "username": "使用者名稱", - "users": "使用者" + "users": "使用者", + "currentPassword": "Your Current Password" }, "sidebar": { "help": "幫助", diff --git a/filebrowser/frontend/src/types/settings.d.ts b/filebrowser/frontend/src/types/settings.d.ts index c213e016f6..18672bdf71 100644 --- a/filebrowser/frontend/src/types/settings.d.ts +++ b/filebrowser/frontend/src/types/settings.d.ts @@ -18,6 +18,7 @@ interface SettingsDefaults { locale: string; viewMode: ViewModeType; singleClick: boolean; + redirectAfterCopyMove: boolean; sorting: Sorting; perm: Permissions; commands: any[]; diff --git a/filebrowser/frontend/src/types/user.d.ts b/filebrowser/frontend/src/types/user.d.ts index 40c453c502..317f1e43a6 100644 --- a/filebrowser/frontend/src/types/user.d.ts +++ b/filebrowser/frontend/src/types/user.d.ts @@ -10,6 +10,7 @@ interface IUser { lockPassword: boolean; hideDotfiles: boolean; singleClick: boolean; + redirectAfterCopyMove: boolean; dateFormat: boolean; viewMode: ViewModeType; sorting?: Sorting; @@ -30,6 +31,7 @@ interface IUserForm { lockPassword?: boolean; hideDotfiles?: boolean; singleClick?: boolean; + redirectAfterCopyMove?: boolean; dateFormat?: boolean; } diff --git a/filebrowser/frontend/src/views/files/FileListing.vue b/filebrowser/frontend/src/views/files/FileListing.vue index 409c78aa2b..62a6819ff3 100644 --- a/filebrowser/frontend/src/views/files/FileListing.vue +++ b/filebrowser/frontend/src/views/files/FileListing.vue @@ -159,6 +159,7 @@ ref="listing" class="file-icons" :class="authStore.user?.viewMode ?? ''" + @click="handleEmptyAreaClick" >
@@ -1051,4 +1052,18 @@ const showContextMenu = (event: MouseEvent) => { const hideContextMenu = () => { isContextMenuVisible.value = false; }; + +const handleEmptyAreaClick = (e: MouseEvent) => { + const target = e.target; + if (!(target instanceof HTMLElement)) return; + + if (target.closest("item") || target.closest(".item")) return; + + fileStore.selected = []; +}; + diff --git a/filebrowser/frontend/src/views/settings/Profile.vue b/filebrowser/frontend/src/views/settings/Profile.vue index 328b2f1a96..ffb20f0d3a 100644 --- a/filebrowser/frontend/src/views/settings/Profile.vue +++ b/filebrowser/frontend/src/views/settings/Profile.vue @@ -15,6 +15,14 @@ {{ t("settings.singleClick") }}

+

+ + {{ t("settings.redirectAfterCopyMove") }} +

{{ t("settings.setDateFormat") }} @@ -44,7 +52,7 @@

-
+
import { useAuthStore } from "@/stores/auth"; import { useLayoutStore } from "@/stores/layout"; -import { users as api, settings } from "@/api"; +import { users as api } from "@/api"; import AceEditorTheme from "@/components/settings/AceEditorTheme.vue"; import Languages from "@/components/settings/Languages.vue"; import { computed, inject, onMounted, ref } from "vue"; import { useI18n } from "vue-i18n"; +import { authMethod, noAuth } from "@/utils/constants"; const layoutStore = useLayoutStore(); const authStore = useAuthStore(); @@ -115,6 +124,7 @@ const currentPassword = ref(""); const isCurrentPasswordRequired = ref(false); const hideDotfiles = ref(false); const singleClick = ref(false); +const redirectAfterCopyMove = ref(false); const dateFormat = ref(false); const locale = ref(""); const aceEditorTheme = ref(""); @@ -139,10 +149,10 @@ onMounted(async () => { locale.value = authStore.user.locale; hideDotfiles.value = authStore.user.hideDotfiles; singleClick.value = authStore.user.singleClick; + redirectAfterCopyMove.value = authStore.user.redirectAfterCopyMove; dateFormat.value = authStore.user.dateFormat; aceEditorTheme.value = authStore.user.aceEditorTheme; layoutStore.loading = false; - const { authMethod } = await settings.get(); isCurrentPasswordRequired.value = authMethod == "json"; return true; @@ -187,6 +197,7 @@ const updateSettings = async (event: Event) => { locale: locale.value, hideDotfiles: hideDotfiles.value, singleClick: singleClick.value, + redirectAfterCopyMove: redirectAfterCopyMove.value, dateFormat: dateFormat.value, aceEditorTheme: aceEditorTheme.value, }; @@ -195,6 +206,7 @@ const updateSettings = async (event: Event) => { "locale", "hideDotfiles", "singleClick", + "redirectAfterCopyMove", "dateFormat", "aceEditorTheme", ]); diff --git a/filebrowser/go.mod b/filebrowser/go.mod index 434b8b2a5c..44741833ab 100644 --- a/filebrowser/go.mod +++ b/filebrowser/go.mod @@ -26,7 +26,7 @@ require ( github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce golang.org/x/crypto v0.46.0 golang.org/x/image v0.34.0 - golang.org/x/text v0.32.0 + golang.org/x/text v0.33.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/filebrowser/go.sum b/filebrowser/go.sum index 337906032f..443fb17ce7 100644 --- a/filebrowser/go.sum +++ b/filebrowser/go.sum @@ -372,8 +372,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= -golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/filebrowser/http/auth.go b/filebrowser/http/auth.go index 5a483a8df7..4eceeafe31 100644 --- a/filebrowser/http/auth.go +++ b/filebrowser/http/auth.go @@ -23,17 +23,18 @@ const ( ) type userInfo struct { - ID uint `json:"id"` - Locale string `json:"locale"` - ViewMode users.ViewMode `json:"viewMode"` - SingleClick bool `json:"singleClick"` - Perm users.Permissions `json:"perm"` - Commands []string `json:"commands"` - LockPassword bool `json:"lockPassword"` - HideDotfiles bool `json:"hideDotfiles"` - DateFormat bool `json:"dateFormat"` - Username string `json:"username"` - AceEditorTheme string `json:"aceEditorTheme"` + ID uint `json:"id"` + Locale string `json:"locale"` + ViewMode users.ViewMode `json:"viewMode"` + SingleClick bool `json:"singleClick"` + RedirectAfterCopyMove bool `json:"redirectAfterCopyMove"` + Perm users.Permissions `json:"perm"` + Commands []string `json:"commands"` + LockPassword bool `json:"lockPassword"` + HideDotfiles bool `json:"hideDotfiles"` + DateFormat bool `json:"dateFormat"` + Username string `json:"username"` + AceEditorTheme string `json:"aceEditorTheme"` } type authToken struct { @@ -204,17 +205,18 @@ func renewHandler(tokenExpireTime time.Duration) handleFunc { func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.User, tokenExpirationTime time.Duration) (int, error) { claims := &authToken{ User: userInfo{ - ID: user.ID, - Locale: user.Locale, - ViewMode: user.ViewMode, - SingleClick: user.SingleClick, - Perm: user.Perm, - LockPassword: user.LockPassword, - Commands: user.Commands, - HideDotfiles: user.HideDotfiles, - DateFormat: user.DateFormat, - Username: user.Username, - AceEditorTheme: user.AceEditorTheme, + ID: user.ID, + Locale: user.Locale, + ViewMode: user.ViewMode, + SingleClick: user.SingleClick, + RedirectAfterCopyMove: user.RedirectAfterCopyMove, + Perm: user.Perm, + LockPassword: user.LockPassword, + Commands: user.Commands, + HideDotfiles: user.HideDotfiles, + DateFormat: user.DateFormat, + Username: user.Username, + AceEditorTheme: user.AceEditorTheme, }, RegisteredClaims: jwt.RegisteredClaims{ IssuedAt: jwt.NewNumericDate(time.Now()), diff --git a/filebrowser/http/resource.go b/filebrowser/http/resource.go index 9fe4caa6f6..0a8da271c6 100644 --- a/filebrowser/http/resource.go +++ b/filebrowser/http/resource.go @@ -280,6 +280,12 @@ func writeFile(afs afero.Fs, dst string, in io.Reader, fileMode, dirMode fs.File return nil, err } + // Sync the file to ensure all data is written to storage. + // to prevent file corruption. + if err := file.Sync(); err != nil { + return nil, err + } + // Gets the info about the file. info, err := file.Stat() if err != nil { diff --git a/filebrowser/http/tus_handlers.go b/filebrowser/http/tus_handlers.go index d11920ae74..498d776f10 100644 --- a/filebrowser/http/tus_handlers.go +++ b/filebrowser/http/tus_handlers.go @@ -256,6 +256,12 @@ func tusPatchHandler() handleFunc { return http.StatusInternalServerError, fmt.Errorf("could not write to file: %w", err) } + // Sync the file to ensure all data is written to storage + // to prevent file corruption. + if err := openFile.Sync(); err != nil { + return http.StatusInternalServerError, fmt.Errorf("could not sync file: %w", err) + } + newOffset := uploadOffset + bytesWritten w.Header().Set("Upload-Offset", strconv.FormatInt(newOffset, 10)) diff --git a/filebrowser/settings/defaults.go b/filebrowser/settings/defaults.go index 5b6c3f2a5c..4602417909 100644 --- a/filebrowser/settings/defaults.go +++ b/filebrowser/settings/defaults.go @@ -8,16 +8,17 @@ import ( // UserDefaults is a type that holds the default values // for some fields on User. type UserDefaults struct { - Scope string `json:"scope"` - Locale string `json:"locale"` - ViewMode users.ViewMode `json:"viewMode"` - SingleClick bool `json:"singleClick"` - Sorting files.Sorting `json:"sorting"` - Perm users.Permissions `json:"perm"` - Commands []string `json:"commands"` - HideDotfiles bool `json:"hideDotfiles"` - DateFormat bool `json:"dateFormat"` - AceEditorTheme string `json:"aceEditorTheme"` + Scope string `json:"scope"` + Locale string `json:"locale"` + ViewMode users.ViewMode `json:"viewMode"` + SingleClick bool `json:"singleClick"` + RedirectAfterCopyMove bool `json:"redirectAfterCopyMove"` + Sorting files.Sorting `json:"sorting"` + Perm users.Permissions `json:"perm"` + Commands []string `json:"commands"` + HideDotfiles bool `json:"hideDotfiles"` + DateFormat bool `json:"dateFormat"` + AceEditorTheme string `json:"aceEditorTheme"` } // Apply applies the default options to a user. @@ -26,6 +27,7 @@ func (d *UserDefaults) Apply(u *users.User) { u.Locale = d.Locale u.ViewMode = d.ViewMode u.SingleClick = d.SingleClick + u.RedirectAfterCopyMove = d.RedirectAfterCopyMove u.Perm = d.Perm u.Sorting = d.Sorting u.Commands = d.Commands diff --git a/filebrowser/users/users.go b/filebrowser/users/users.go index 0fcc26d8fe..7181b299e6 100644 --- a/filebrowser/users/users.go +++ b/filebrowser/users/users.go @@ -20,22 +20,23 @@ const ( // User describes a user. type User struct { - ID uint `storm:"id,increment" json:"id"` - Username string `storm:"unique" json:"username"` - Password string `json:"password"` - Scope string `json:"scope"` - Locale string `json:"locale"` - LockPassword bool `json:"lockPassword"` - ViewMode ViewMode `json:"viewMode"` - SingleClick bool `json:"singleClick"` - Perm Permissions `json:"perm"` - Commands []string `json:"commands"` - Sorting files.Sorting `json:"sorting"` - Fs afero.Fs `json:"-" yaml:"-"` - Rules []rules.Rule `json:"rules"` - HideDotfiles bool `json:"hideDotfiles"` - DateFormat bool `json:"dateFormat"` - AceEditorTheme string `json:"aceEditorTheme"` + ID uint `storm:"id,increment" json:"id"` + Username string `storm:"unique" json:"username"` + Password string `json:"password"` + Scope string `json:"scope"` + Locale string `json:"locale"` + LockPassword bool `json:"lockPassword"` + ViewMode ViewMode `json:"viewMode"` + SingleClick bool `json:"singleClick"` + RedirectAfterCopyMove bool `json:"redirectAfterCopyMove"` + Perm Permissions `json:"perm"` + Commands []string `json:"commands"` + Sorting files.Sorting `json:"sorting"` + Fs afero.Fs `json:"-" yaml:"-"` + Rules []rules.Rule `json:"rules"` + HideDotfiles bool `json:"hideDotfiles"` + DateFormat bool `json:"dateFormat"` + AceEditorTheme string `json:"aceEditorTheme"` } // GetRules implements rules.Provider. diff --git a/filebrowser/www/docs/cli/filebrowser-config-init.md b/filebrowser/www/docs/cli/filebrowser-config-init.md index f4ff829fe1..0f16efa76b 100644 --- a/filebrowser/www/docs/cli/filebrowser-config-init.md +++ b/filebrowser/www/docs/cli/filebrowser-config-init.md @@ -61,6 +61,7 @@ filebrowser config init [flags] --recaptcha.host string use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com") --recaptcha.key string ReCaptcha site key --recaptcha.secret string ReCaptcha secret + --redirectAfterCopyMove redirect to destination after copy/move -r, --root string root to prepend to relative paths (default ".") --scope string scope for users (default ".") --shell string shell command to which other commands should be appended diff --git a/filebrowser/www/docs/cli/filebrowser-config-set.md b/filebrowser/www/docs/cli/filebrowser-config-set.md index 5b166d7da8..603bb506bc 100644 --- a/filebrowser/www/docs/cli/filebrowser-config-set.md +++ b/filebrowser/www/docs/cli/filebrowser-config-set.md @@ -58,6 +58,7 @@ filebrowser config set [flags] --recaptcha.host string use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com") --recaptcha.key string ReCaptcha site key --recaptcha.secret string ReCaptcha secret + --redirectAfterCopyMove redirect to destination after copy/move -r, --root string root to prepend to relative paths (default ".") --scope string scope for users (default ".") --shell string shell command to which other commands should be appended diff --git a/filebrowser/www/docs/cli/filebrowser-users-add.md b/filebrowser/www/docs/cli/filebrowser-users-add.md index c6c5b53dba..1de95e4d26 100644 --- a/filebrowser/www/docs/cli/filebrowser-users-add.md +++ b/filebrowser/www/docs/cli/filebrowser-users-add.md @@ -28,6 +28,7 @@ filebrowser users add [flags] --perm.modify modify perm for users (default true) --perm.rename rename perm for users (default true) --perm.share share perm for users (default true) + --redirectAfterCopyMove redirect to destination after copy/move --scope string scope for users (default ".") --singleClick use single clicks only --sorting.asc sorting by ascending order diff --git a/filebrowser/www/docs/cli/filebrowser-users-update.md b/filebrowser/www/docs/cli/filebrowser-users-update.md index 996bdac79b..4ba7d60860 100644 --- a/filebrowser/www/docs/cli/filebrowser-users-update.md +++ b/filebrowser/www/docs/cli/filebrowser-users-update.md @@ -30,6 +30,7 @@ filebrowser users update [flags] --perm.modify modify perm for users (default true) --perm.rename rename perm for users (default true) --perm.share share perm for users (default true) + --redirectAfterCopyMove redirect to destination after copy/move --scope string scope for users (default ".") --singleClick use single clicks only --sorting.asc sorting by ascending order diff --git a/geoip/README.md b/geoip/README.md index b6277b2bb3..54d32f010a 100644 --- a/geoip/README.md +++ b/geoip/README.md @@ -1,4 +1,4 @@ -# 简介 +# GeoIP 简介 [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Loyalsoldier/geoip) 本项目每周四自动生成多种格式 GeoIP 文件,同时提供命令行界面(CLI)工具供用户自行定制 GeoIP 文件,包括但不限于 V2Ray `dat` 格式文件 `geoip.dat`、MaxMind `mmdb` 格式文件 `Country.mmdb`、sing-box `SRS` 格式文件、mihomo `MRS` 格式文件、Clash ruleset 和 Surge ruleset。 diff --git a/mieru/test/deploy/singbox/Dockerfile b/mieru/test/deploy/singbox/Dockerfile index ba034ff583..bc08bc5ccb 100644 --- a/mieru/test/deploy/singbox/Dockerfile +++ b/mieru/test/deploy/singbox/Dockerfile @@ -21,8 +21,13 @@ WORKDIR /test # Copy binaries, data and test script into the container. COPY bin/sing-box bin/mita bin/httpserver bin/sockshttpclient bin/socksudpclient bin/udpserver \ + test/deploy/singbox/client_tcp.json \ + test/deploy/singbox/client_tcp_no_wait.json \ + test/deploy/singbox/client_udp.json \ + test/deploy/singbox/client_udp_no_wait.json \ test/deploy/singbox/singbox-client-config-tcp.json \ test/deploy/singbox/singbox-client-config-udp.json \ + test/deploy/singbox/singbox-server-config.json \ test/deploy/singbox/server_tcp.json \ test/deploy/singbox/server_udp.json \ test/deploy/singbox/libtest.sh \ diff --git a/mieru/test/deploy/singbox/client_tcp.json b/mieru/test/deploy/singbox/client_tcp.json new file mode 100644 index 0000000000..a92ebca904 --- /dev/null +++ b/mieru/test/deploy/singbox/client_tcp.json @@ -0,0 +1,32 @@ +{ + "profiles": [ + { + "profileName": "default", + "user": { + "name": "baozi", + "password": "manlianpenfen" + }, + "servers": [ + { + "ipAddress": "127.0.0.1", + "portBindings": [ + { + "port": 8966, + "protocol": "TCP" + } + ] + } + ], + "multiplexing": { + "level": "MULTIPLEXING_HIGH" + } + } + ], + "activeProfile": "default", + "rpcPort": 8989, + "socks5Port": 1082, + "advancedSettings": { + "noCheckUpdate": true + }, + "loggingLevel": "INFO" +} diff --git a/mieru/test/deploy/singbox/client_tcp_no_wait.json b/mieru/test/deploy/singbox/client_tcp_no_wait.json new file mode 100644 index 0000000000..6cab5227a7 --- /dev/null +++ b/mieru/test/deploy/singbox/client_tcp_no_wait.json @@ -0,0 +1,33 @@ +{ + "profiles": [ + { + "profileName": "default", + "user": { + "name": "baozi", + "password": "manlianpenfen" + }, + "servers": [ + { + "ipAddress": "127.0.0.1", + "portBindings": [ + { + "port": 8966, + "protocol": "TCP" + } + ] + } + ], + "multiplexing": { + "level": "MULTIPLEXING_HIGH" + }, + "handshakeMode": "HANDSHAKE_NO_WAIT" + } + ], + "activeProfile": "default", + "rpcPort": 8989, + "socks5Port": 1082, + "advancedSettings": { + "noCheckUpdate": true + }, + "loggingLevel": "INFO" +} diff --git a/mieru/test/deploy/singbox/client_udp.json b/mieru/test/deploy/singbox/client_udp.json new file mode 100644 index 0000000000..1241c3965b --- /dev/null +++ b/mieru/test/deploy/singbox/client_udp.json @@ -0,0 +1,32 @@ +{ + "profiles": [ + { + "profileName": "default", + "user": { + "name": "baozi", + "password": "manlianpenfen" + }, + "servers": [ + { + "ipAddress": "127.0.0.1", + "portBindings": [ + { + "port": 8966, + "protocol": "UDP" + } + ] + } + ], + "multiplexing": { + "level": "MULTIPLEXING_HIGH" + } + } + ], + "activeProfile": "default", + "rpcPort": 8989, + "socks5Port": 1085, + "advancedSettings": { + "noCheckUpdate": true + }, + "loggingLevel": "INFO" +} diff --git a/mieru/test/deploy/singbox/client_udp_no_wait.json b/mieru/test/deploy/singbox/client_udp_no_wait.json new file mode 100644 index 0000000000..41ab3120ea --- /dev/null +++ b/mieru/test/deploy/singbox/client_udp_no_wait.json @@ -0,0 +1,33 @@ +{ + "profiles": [ + { + "profileName": "default", + "user": { + "name": "baozi", + "password": "manlianpenfen" + }, + "servers": [ + { + "ipAddress": "127.0.0.1", + "portBindings": [ + { + "port": 8966, + "protocol": "UDP" + } + ] + } + ], + "multiplexing": { + "level": "MULTIPLEXING_HIGH" + }, + "handshakeMode": "HANDSHAKE_NO_WAIT" + } + ], + "activeProfile": "default", + "rpcPort": 8989, + "socks5Port": 1085, + "advancedSettings": { + "noCheckUpdate": true + }, + "loggingLevel": "INFO" +} diff --git a/mieru/test/deploy/singbox/singbox-server-config.json b/mieru/test/deploy/singbox/singbox-server-config.json new file mode 100644 index 0000000000..1640d3a03f --- /dev/null +++ b/mieru/test/deploy/singbox/singbox-server-config.json @@ -0,0 +1,35 @@ +{ + "inbounds": [ + { + "type": "mieru", + "tag": "mieru-tcp", + "listen": "127.0.0.1", + "listen_port": 8966, + "transport": "TCP", + "users": [ + { + "name": "baozi", + "password": "manlianpenfen" + } + ] + }, + { + "type": "mieru", + "tag": "mieru-udp", + "listen": "127.0.0.1", + "listen_port": 8966, + "transport": "UDP", + "users": [ + { + "name": "baozi", + "password": "manlianpenfen" + } + ] + } + ], + "outbounds": [], + "route": {}, + "log": { + "level": "warn" + } +} diff --git a/openwrt-packages/filebrowser/Makefile b/openwrt-packages/filebrowser/Makefile index c434abcf0f..82881eada9 100644 --- a/openwrt-packages/filebrowser/Makefile +++ b/openwrt-packages/filebrowser/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=filebrowser -PKG_VERSION:=2.53.1 +PKG_VERSION:=2.54.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/filebrowser/filebrowser/tar.gz/v${PKG_VERSION}? -PKG_HASH:=68f55a90cf25c4e147dc50d45de2a619f4b24e9c2f6fa7c7de05130ca0b4e123 +PKG_HASH:=0752cc7444e2f327cb4beefe6eb40493bfd2f5a077daa2e5dbf6ace013cfc34d PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/openwrt-packages/luci-app-ddnsto/Makefile b/openwrt-packages/luci-app-ddnsto/Makefile index cdd7ce4a31..f51d692cee 100644 --- a/openwrt-packages/luci-app-ddnsto/Makefile +++ b/openwrt-packages/luci-app-ddnsto/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for ddnsto LUCI_DEPENDS:=+ddnsto +block-mount LUCI_PKGARCH:=all -PKG_VERSION:=3.2.0-r4 +PKG_VERSION:=3.2.0-r5 PKG_RELEASE:= include $(TOPDIR)/feeds/luci/luci.mk diff --git a/openwrt-packages/luci-app-ddnsto/root/www/luci-static/ddnsto/index.js b/openwrt-packages/luci-app-ddnsto/root/www/luci-static/ddnsto/index.js index 00f09f6af7..3f0ff7c549 100644 --- a/openwrt-packages/luci-app-ddnsto/root/www/luci-static/ddnsto/index.js +++ b/openwrt-packages/luci-app-ddnsto/root/www/luci-static/ddnsto/index.js @@ -1,4 +1,4 @@ -(function(){const E=document.createElement("link").relList;if(E&&E.supports&&E.supports("modulepreload"))return;for(const T of document.querySelectorAll('link[rel="modulepreload"]'))A(T);new MutationObserver(T=>{for(const L of T)if(L.type==="childList")for(const W of L.addedNodes)W.tagName==="LINK"&&W.rel==="modulepreload"&&A(W)}).observe(document,{childList:!0,subtree:!0});function d(T){const L={};return T.integrity&&(L.integrity=T.integrity),T.referrerPolicy&&(L.referrerPolicy=T.referrerPolicy),T.crossOrigin==="use-credentials"?L.credentials="include":T.crossOrigin==="anonymous"?L.credentials="omit":L.credentials="same-origin",L}function A(T){if(T.ep)return;T.ep=!0;const L=d(T);fetch(T.href,L)}})();function Vd(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Mi={exports:{}},Nr={},Oi={exports:{}},Z={};/** +(function(){const E=document.createElement("link").relList;if(E&&E.supports&&E.supports("modulepreload"))return;for(const T of document.querySelectorAll('link[rel="modulepreload"]'))U(T);new MutationObserver(T=>{for(const L of T)if(L.type==="childList")for(const B of L.addedNodes)B.tagName==="LINK"&&B.rel==="modulepreload"&&U(B)}).observe(document,{childList:!0,subtree:!0});function d(T){const L={};return T.integrity&&(L.integrity=T.integrity),T.referrerPolicy&&(L.referrerPolicy=T.referrerPolicy),T.crossOrigin==="use-credentials"?L.credentials="include":T.crossOrigin==="anonymous"?L.credentials="omit":L.credentials="same-origin",L}function U(T){if(T.ep)return;T.ep=!0;const L=d(T);fetch(T.href,L)}})();function Vd(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Mi={exports:{}},Nr={},Oi={exports:{}},J={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Iu;function Wd(){if(Iu)return Z;Iu=1;var y=Symbol.for("react.element"),E=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),W=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),Q=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),B=Symbol.iterator;function $(u){return u===null||typeof u!="object"?null:(u=B&&u[B]||u["@@iterator"],typeof u=="function"?u:null)}var q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ie=Object.assign,V={};function K(u,v,M){this.props=u,this.context=v,this.refs=V,this.updater=M||q}K.prototype.isReactComponent={},K.prototype.setState=function(u,v){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,v,"setState")},K.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};function Ce(){}Ce.prototype=K.prototype;function xe(u,v,M){this.props=u,this.context=v,this.refs=V,this.updater=M||q}var Se=xe.prototype=new Ce;Se.constructor=xe,ie(Se,K.prototype),Se.isPureReactComponent=!0;var pe=Array.isArray,ee=Object.prototype.hasOwnProperty,Ne={current:null},Re={key:!0,ref:!0,__self:!0,__source:!0};function he(u,v,M){var U,X={},O=null,re=null;if(v!=null)for(U in v.ref!==void 0&&(re=v.ref),v.key!==void 0&&(O=""+v.key),v)ee.call(v,U)&&!Re.hasOwnProperty(U)&&(X[U]=v[U]);var J=arguments.length-2;if(J===1)X.children=M;else if(1>>1,v=x[u];if(0>>1;uT(X,g))OT(re,X)?(x[u]=re,x[O]=g,u=O):(x[u]=X,x[U]=g,u=U);else if(OT(re,g))x[u]=re,x[O]=g,u=O;else break e}}return I}function T(x,I){var g=x.sortIndex-I.sortIndex;return g!==0?g:x.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var L=performance;y.unstable_now=function(){return L.now()}}else{var W=Date,G=W.now();y.unstable_now=function(){return W.now()-G}}var b=[],Q=[],Y=1,B=null,$=3,q=!1,ie=!1,V=!1,K=typeof setTimeout=="function"?setTimeout:null,Ce=typeof clearTimeout=="function"?clearTimeout:null,xe=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Se(x){for(var I=d(Q);I!==null;){if(I.callback===null)A(Q);else if(I.startTime<=x)A(Q),I.sortIndex=I.expirationTime,E(b,I);else break;I=d(Q)}}function pe(x){if(V=!1,Se(x),!ie)if(d(b)!==null)ie=!0,je(ee);else{var I=d(Q);I!==null&&ae(pe,I.startTime-x)}}function ee(x,I){ie=!1,V&&(V=!1,Ce(he),he=-1),q=!0;var g=$;try{for(Se(I),B=d(b);B!==null&&(!(B.expirationTime>I)||x&&!Qe());){var u=B.callback;if(typeof u=="function"){B.callback=null,$=B.priorityLevel;var v=u(B.expirationTime<=I);I=y.unstable_now(),typeof v=="function"?B.callback=v:B===d(b)&&A(b),Se(I)}else A(b);B=d(b)}if(B!==null)var M=!0;else{var U=d(Q);U!==null&&ae(pe,U.startTime-I),M=!1}return M}finally{B=null,$=g,q=!1}}var Ne=!1,Re=null,he=-1,we=5,ue=-1;function Qe(){return!(y.unstable_now()-uex||125u?(x.sortIndex=g,E(Q,x),d(b)===null&&x===d(Q)&&(V?(Ce(he),he=-1):V=!0,ae(pe,g-u))):(x.sortIndex=v,E(b,x),ie||q||(ie=!0,je(ee))),x},y.unstable_shouldYield=Qe,y.unstable_wrapCallback=function(x){var I=$;return function(){var g=$;$=I;try{return x.apply(this,arguments)}finally{$=g}}}})(bi)),bi}var bu;function Xd(){return bu||(bu=1,Fi.exports=Yd()),Fi.exports}/** + */var Fu;function Yd(){return Fu||(Fu=1,(function(y){function E(x,I){var g=x.length;x.push(I);e:for(;0>>1,v=x[u];if(0>>1;uT(X,g))OT(re,X)?(x[u]=re,x[O]=g,u=O):(x[u]=X,x[b]=g,u=b);else if(OT(re,g))x[u]=re,x[O]=g,u=O;else break e}}return I}function T(x,I){var g=x.sortIndex-I.sortIndex;return g!==0?g:x.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var L=performance;y.unstable_now=function(){return L.now()}}else{var B=Date,G=B.now();y.unstable_now=function(){return B.now()-G}}var A=[],Q=[],Z=1,W=null,H=3,q=!1,ae=!1,V=!1,Y=typeof setTimeout=="function"?setTimeout:null,we=typeof clearTimeout=="function"?clearTimeout:null,ze=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ke(x){for(var I=d(Q);I!==null;){if(I.callback===null)U(Q);else if(I.startTime<=x)U(Q),I.sortIndex=I.expirationTime,E(A,I);else break;I=d(Q)}}function fe(x){if(V=!1,ke(x),!ae)if(d(A)!==null)ae=!0,Ne(Ce);else{var I=d(Q);I!==null&&ie(fe,I.startTime-x)}}function Ce(x,I){ae=!1,V&&(V=!1,we(he),he=-1),q=!0;var g=H;try{for(ke(I),W=d(A);W!==null&&(!(W.expirationTime>I)||x&&!Qe());){var u=W.callback;if(typeof u=="function"){W.callback=null,H=W.priorityLevel;var v=u(W.expirationTime<=I);I=y.unstable_now(),typeof v=="function"?W.callback=v:W===d(A)&&U(A),ke(I)}else U(A);W=d(A)}if(W!==null)var M=!0;else{var b=d(Q);b!==null&&ie(fe,b.startTime-I),M=!1}return M}finally{W=null,H=g,q=!1}}var K=!1,Re=null,he=-1,xe=5,ue=-1;function Qe(){return!(y.unstable_now()-uex||125u?(x.sortIndex=g,E(Q,x),d(A)===null&&x===d(Q)&&(V?(we(he),he=-1):V=!0,ie(fe,g-u))):(x.sortIndex=v,E(A,x),ae||q||(ae=!0,Ne(Ce))),x},y.unstable_shouldYield=Qe,y.unstable_wrapCallback=function(x){var I=H;return function(){var g=H;H=I;try{return x.apply(this,arguments)}finally{H=g}}}})(bi)),bi}var bu;function Xd(){return bu||(bu=1,Fi.exports=Yd()),Fi.exports}/** * @license React * react-dom.production.min.js * @@ -30,19 +30,19 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Uu;function Gd(){if(Uu)return Je;Uu=1;var y=Ai(),E=Xd();function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),b=Object.prototype.hasOwnProperty,Q=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Y={},B={};function $(e){return b.call(B,e)?!0:b.call(Y,e)?!1:Q.test(e)?B[e]=!0:(Y[e]=!0,!1)}function q(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ie(e,t,n,r){if(t===null||typeof t>"u"||q(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function V(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){K[e]=new V(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];K[t]=new V(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){K[e]=new V(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){K[e]=new V(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){K[e]=new V(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){K[e]=new V(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){K[e]=new V(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){K[e]=new V(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){K[e]=new V(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ce=/[\-:]([a-z])/g;function xe(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ce,xe);K[t]=new V(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ce,xe);K[t]=new V(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ce,xe);K[t]=new V(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){K[e]=new V(e,1,!1,e.toLowerCase(),null,!1,!1)}),K.xlinkHref=new V("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){K[e]=new V(e,1,!1,e.toLowerCase(),null,!0,!0)});function Se(e,t,n,r){var l=K.hasOwnProperty(t)?K[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),A=Object.prototype.hasOwnProperty,Q=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Z={},W={};function H(e){return A.call(W,e)?!0:A.call(Z,e)?!1:Q.test(e)?W[e]=!0:(Z[e]=!0,!1)}function q(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ae(e,t,n,r){if(t===null||typeof t>"u"||q(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function V(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Y[e]=new V(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Y[t]=new V(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Y[e]=new V(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Y[e]=new V(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Y[e]=new V(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Y[e]=new V(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Y[e]=new V(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Y[e]=new V(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Y[e]=new V(e,5,!1,e.toLowerCase(),null,!1,!1)});var we=/[\-:]([a-z])/g;function ze(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(we,ze);Y[t]=new V(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(we,ze);Y[t]=new V(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(we,ze);Y[t]=new V(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Y[e]=new V(e,1,!1,e.toLowerCase(),null,!1,!1)}),Y.xlinkHref=new V("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Y[e]=new V(e,1,!1,e.toLowerCase(),null,!0,!0)});function ke(e,t,n,r){var l=Y.hasOwnProperty(t)?Y[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{M=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?v(e):""}function X(e){switch(e.tag){case 5:return v(e.type);case 16:return v("Lazy");case 13:return v("Suspense");case 19:return v("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1),e;case 11:return e=U(e.type.render,!1),e;case 1:return e=U(e.type,!0),e;default:return""}}function O(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Re:return"Fragment";case Ne:return"Portal";case we:return"Profiler";case he:return"StrictMode";case me:return"Suspense";case ge:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qe:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case Le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ie:return t=e.displayName||null,t!==null?t:O(e.type)||"Memo";case je:t=e._payload,e=e._init;try{return O(e(t))}catch{}}return null}function re(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(t);case 8:return t===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function J(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ue(e){var t=oe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fn(e){e._valueTracker||(e._valueTracker=Ue(e))}function Un(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=oe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function An(e,t){var n=t.checked;return g({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zt(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=J(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $i(e,t){t=t.checked,t!=null&&Se(e,"checked",t,!1)}function $l(e,t){$i(e,t);var n=J(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Hl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Hl(e,t.type,J(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Hl(e,t,n){(t!=="number"||Tt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $n=Array.isArray;function pn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Pr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ku=["Webkit","ms","Moz","O"];Object.keys(Vn).forEach(function(e){Ku.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vn[t]=Vn[e]})});function Yi(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vn.hasOwnProperty(e)&&Vn[e]?(""+t).trim():t+"px"}function Xi(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Yi(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Yu=g({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bl(e,t){if(t){if(Yu[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(d(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(d(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(d(61))}if(t.style!=null&&typeof t.style!="object")throw Error(d(62))}}function Ql(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kl=null;function Yl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xl=null,hn=null,mn=null;function Gi(e){if(e=dr(e)){if(typeof Xl!="function")throw Error(d(280));var t=e.stateNode;t&&(t=Jr(t),Xl(e.stateNode,e.type,t))}}function Zi(e){hn?mn?mn.push(e):mn=[e]:hn=e}function Ji(){if(hn){var e=hn,t=mn;if(mn=hn=null,Gi(e),t)for(e=0;e>>=0,e===0?32:31-(oc(e)/ic|0)|0}var Mr=64,Or=4194304;function Kn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=Kn(a):(o&=i,o!==0&&(r=Kn(o)))}else i=n&~l,i!==0?r=Kn(i):o!==0&&(r=Kn(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function cc(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=nr),Na=" ",ja=!1;function za(e,t){switch(e){case"keyup":return bc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function Ac(e,t){switch(e){case"compositionend":return Pa(t);case"keypress":return t.which!==32?null:(ja=!0,Na);case"textInput":return e=t.data,e===Na&&ja?null:e;default:return null}}function $c(e,t){if(yn)return e==="compositionend"||!ho&&za(e,t)?(e=ka(),$r=ao=Ot=null,yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Da(n)}}function ba(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ba(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ua(){for(var e=window,t=Tt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tt(e.document)}return t}function vo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Gc(e){var t=Ua(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ba(n.ownerDocument.documentElement,n)){if(r!==null&&vo(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Fa(n,o);var i=Fa(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,wn=null,yo=null,ir=null,wo=!1;function Aa(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wo||wn==null||wn!==Tt(r)||(r=wn,"selectionStart"in r&&vo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ir&&or(ir,r)||(ir=r,r=Xr(yo,"onSelect"),0En||(e.current=Ro[En],Ro[En]=null,En--)}function se(e,t){En++,Ro[En]=e.current,e.current=t}var Ut={},Ae=bt(Ut),Ke=bt(!1),en=Ut;function Cn(e,t){var n=e.type.contextTypes;if(!n)return Ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ye(e){return e=e.childContextTypes,e!=null}function qr(){de(Ke),de(Ae)}function ts(e,t,n){if(Ae.current!==Ut)throw Error(d(168));se(Ae,t),se(Ke,n)}function ns(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(d(108,re(e)||"Unknown",l));return g({},n,r)}function el(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ut,en=Ae.current,se(Ae,e),se(Ke,Ke.current),!0}function rs(e,t,n){var r=e.stateNode;if(!r)throw Error(d(169));n?(e=ns(e,t,en),r.__reactInternalMemoizedMergedChildContext=e,de(Ke),de(Ae),se(Ae,e)):de(Ke),se(Ke,n)}var _t=null,tl=!1,Lo=!1;function ls(e){_t===null?_t=[e]:_t.push(e)}function sd(e){tl=!0,ls(e)}function At(){if(!Lo&&_t!==null){Lo=!0;var e=0,t=le;try{var n=_t;for(le=1;e>=i,l-=i,Et=1<<32-ut(t)+l|n<H?(De=F,F=null):De=F.sibling;var ne=w(f,F,p[H],_);if(ne===null){F===null&&(F=De);break}e&&F&&ne.alternate===null&&t(f,F),c=o(ne,c,H),D===null?R=ne:D.sibling=ne,D=ne,F=De}if(H===p.length)return n(f,F),fe&&nn(f,H),R;if(F===null){for(;HH?(De=F,F=null):De=F.sibling;var Xt=w(f,F,ne.value,_);if(Xt===null){F===null&&(F=De);break}e&&F&&Xt.alternate===null&&t(f,F),c=o(Xt,c,H),D===null?R=Xt:D.sibling=Xt,D=Xt,F=De}if(ne.done)return n(f,F),fe&&nn(f,H),R;if(F===null){for(;!ne.done;H++,ne=p.next())ne=S(f,ne.value,_),ne!==null&&(c=o(ne,c,H),D===null?R=ne:D.sibling=ne,D=ne);return fe&&nn(f,H),R}for(F=r(f,F);!ne.done;H++,ne=p.next())ne=N(F,f,H,ne.value,_),ne!==null&&(e&&ne.alternate!==null&&F.delete(ne.key===null?H:ne.key),c=o(ne,c,H),D===null?R=ne:D.sibling=ne,D=ne);return e&&F.forEach(function(Hd){return t(f,Hd)}),fe&&nn(f,H),R}function Ee(f,c,p,_){if(typeof p=="object"&&p!==null&&p.type===Re&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case ee:e:{for(var R=p.key,D=c;D!==null;){if(D.key===R){if(R=p.type,R===Re){if(D.tag===7){n(f,D.sibling),c=l(D,p.props.children),c.return=f,f=c;break e}}else if(D.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===je&&cs(R)===D.type){n(f,D.sibling),c=l(D,p.props),c.ref=fr(f,D,p),c.return=f,f=c;break e}n(f,D);break}else t(f,D);D=D.sibling}p.type===Re?(c=dn(p.props.children,f.mode,_,p.key),c.return=f,f=c):(_=Pl(p.type,p.key,p.props,null,f.mode,_),_.ref=fr(f,c,p),_.return=f,f=_)}return i(f);case Ne:e:{for(D=p.key;c!==null;){if(c.key===D)if(c.tag===4&&c.stateNode.containerInfo===p.containerInfo&&c.stateNode.implementation===p.implementation){n(f,c.sibling),c=l(c,p.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=Pi(p,f.mode,_),c.return=f,f=c}return i(f);case je:return D=p._init,Ee(f,c,D(p._payload),_)}if($n(p))return z(f,c,p,_);if(I(p))return P(f,c,p,_);ol(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,p),c.return=f,f=c):(n(f,c),c=zi(p,f.mode,_),c.return=f,f=c),i(f)):n(f,c)}return Ee}var Pn=ds(!0),fs=ds(!1),il=bt(null),al=null,Tn=null,bo=null;function Uo(){bo=Tn=al=null}function Ao(e){var t=il.current;de(il),e._currentValue=t}function $o(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Rn(e,t){al=e,bo=Tn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Xe=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if(bo!==e)if(e={context:e,memoizedValue:t,next:null},Tn===null){if(al===null)throw Error(d(308));Tn=e,al.dependencies={lanes:0,firstContext:e}}else Tn=Tn.next=e;return t}var rn=null;function Ho(e){rn===null?rn=[e]:rn.push(e)}function ps(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ho(t)):(n.next=l.next,l.next=n),t.interleaved=n,Nt(e,r)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var $t=!1;function Vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ht(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(te&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Nt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ho(r)):(t.next=l.next,l.next=t),r.interleaved=t,Nt(e,n)}function sl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,no(e,n)}}function ms(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ul(e,t,n,r){var l=e.updateQueue;$t=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,h=s.next;s.next=null,i===null?o=h:i.next=h,i=s;var k=e.alternate;k!==null&&(k=k.updateQueue,a=k.lastBaseUpdate,a!==i&&(a===null?k.firstBaseUpdate=h:a.next=h,k.lastBaseUpdate=s))}if(o!==null){var S=l.baseState;i=0,k=h=s=null,a=o;do{var w=a.lane,N=a.eventTime;if((r&w)===w){k!==null&&(k=k.next={eventTime:N,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var z=e,P=a;switch(w=t,N=n,P.tag){case 1:if(z=P.payload,typeof z=="function"){S=z.call(N,S,w);break e}S=z;break e;case 3:z.flags=z.flags&-65537|128;case 0:if(z=P.payload,w=typeof z=="function"?z.call(N,S,w):z,w==null)break e;S=g({},S,w);break e;case 2:$t=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,w=l.effects,w===null?l.effects=[a]:w.push(a))}else N={eventTime:N,lane:w,tag:a.tag,payload:a.payload,callback:a.callback,next:null},k===null?(h=k=N,s=S):k=k.next=N,i|=w;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;w=a,a=w.next,w.next=null,l.lastBaseUpdate=w,l.shared.pending=null}}while(!0);if(k===null&&(s=S),l.baseState=s,l.firstBaseUpdate=h,l.lastBaseUpdate=k,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);an|=i,e.lanes=i,e.memoizedState=S}}function gs(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yo.transition;Yo.transition={};try{e(!1),t()}finally{le=n,Yo.transition=r}}function Os(){return it().memoizedState}function fd(e,t,n){var r=Qt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e))Fs(t,n);else if(n=ps(e,t,n,r),n!==null){var l=Be();mt(n,e,r,l),bs(n,t,r)}}function pd(e,t,n){var r=Qt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Fs(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,ct(a,i)){var s=t.interleaved;s===null?(l.next=l,Ho(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=ps(e,t,l,r),n!==null&&(l=Be(),mt(n,e,r,l),bs(n,t,r))}}function Ds(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Fs(e,t){gr=fl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bs(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,no(e,n)}}var ml={readContext:ot,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},hd={readContext:ot,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:js,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pl(4194308,4,Ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pl(4194308,4,e,t)},useInsertionEffect:function(e,t){return pl(4,2,e,t)},useMemo:function(e,t){var n=kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=kt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fd.bind(null,ye,e),[r.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:Cs,useDebugValue:ti,useDeferredValue:function(e){return kt().memoizedState=e},useTransition:function(){var e=Cs(!1),t=e[0];return e=dd.bind(null,e[1]),kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ye,l=kt();if(fe){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),Oe===null)throw Error(d(349));(on&30)!==0||ks(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,js(Ss.bind(null,r,o,e),[e]),r.flags|=2048,wr(9,xs.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=kt(),t=Oe.identifierPrefix;if(fe){var n=Ct,r=Et;n=(r&~(1<<32-ut(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vr++,0")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{M=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?v(e):""}function X(e){switch(e.tag){case 5:return v(e.type);case 16:return v("Lazy");case 13:return v("Suspense");case 19:return v("SuspenseList");case 0:case 2:case 15:return e=b(e.type,!1),e;case 11:return e=b(e.type.render,!1),e;case 1:return e=b(e.type,!0),e;default:return""}}function O(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Re:return"Fragment";case K:return"Portal";case xe:return"Profiler";case he:return"StrictMode";case me:return"Suspense";case ge:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qe:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case Le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ie:return t=e.displayName||null,t!==null?t:O(e.type)||"Memo";case Ne:t=e._payload,e=e._init;try{return O(e(t))}catch{}}return null}function re(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(t);case 8:return t===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ee(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ue(e){var t=oe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fn(e){e._valueTracker||(e._valueTracker=Ue(e))}function Un(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=oe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function An(e,t){var n=t.checked;return g({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zt(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ee(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $i(e,t){t=t.checked,t!=null&&ke(e,"checked",t,!1)}function $l(e,t){$i(e,t);var n=ee(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Hl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Hl(e,t.type,ee(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Hl(e,t,n){(t!=="number"||Tt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $n=Array.isArray;function pn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Pr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ku=["Webkit","ms","Moz","O"];Object.keys(Vn).forEach(function(e){Ku.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vn[t]=Vn[e]})});function Yi(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vn.hasOwnProperty(e)&&Vn[e]?(""+t).trim():t+"px"}function Xi(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Yi(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Yu=g({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bl(e,t){if(t){if(Yu[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(d(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(d(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(d(61))}if(t.style!=null&&typeof t.style!="object")throw Error(d(62))}}function Ql(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kl=null;function Yl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xl=null,hn=null,mn=null;function Gi(e){if(e=dr(e)){if(typeof Xl!="function")throw Error(d(280));var t=e.stateNode;t&&(t=Jr(t),Xl(e.stateNode,e.type,t))}}function Zi(e){hn?mn?mn.push(e):mn=[e]:hn=e}function Ji(){if(hn){var e=hn,t=mn;if(mn=hn=null,Gi(e),t)for(e=0;e>>=0,e===0?32:31-(oc(e)/ic|0)|0}var Mr=64,Or=4194304;function Kn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=Kn(a):(o&=i,o!==0&&(r=Kn(o)))}else i=n&~l,i!==0?r=Kn(i):o!==0&&(r=Kn(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function cc(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=nr),Na=" ",ja=!1;function za(e,t){switch(e){case"keyup":return bc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function Ac(e,t){switch(e){case"compositionend":return Pa(t);case"keypress":return t.which!==32?null:(ja=!0,Na);case"textInput":return e=t.data,e===Na&&ja?null:e;default:return null}}function $c(e,t){if(yn)return e==="compositionend"||!ho&&za(e,t)?(e=ka(),$r=ao=Ot=null,yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Da(n)}}function ba(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ba(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ua(){for(var e=window,t=Tt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tt(e.document)}return t}function vo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Gc(e){var t=Ua(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ba(n.ownerDocument.documentElement,n)){if(r!==null&&vo(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Fa(n,o);var i=Fa(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,wn=null,yo=null,ir=null,wo=!1;function Aa(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wo||wn==null||wn!==Tt(r)||(r=wn,"selectionStart"in r&&vo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ir&&or(ir,r)||(ir=r,r=Xr(yo,"onSelect"),0En||(e.current=Ro[En],Ro[En]=null,En--)}function se(e,t){En++,Ro[En]=e.current,e.current=t}var Ut={},Ae=bt(Ut),Ke=bt(!1),en=Ut;function Cn(e,t){var n=e.type.contextTypes;if(!n)return Ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ye(e){return e=e.childContextTypes,e!=null}function qr(){de(Ke),de(Ae)}function ts(e,t,n){if(Ae.current!==Ut)throw Error(d(168));se(Ae,t),se(Ke,n)}function ns(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(d(108,re(e)||"Unknown",l));return g({},n,r)}function el(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ut,en=Ae.current,se(Ae,e),se(Ke,Ke.current),!0}function rs(e,t,n){var r=e.stateNode;if(!r)throw Error(d(169));n?(e=ns(e,t,en),r.__reactInternalMemoizedMergedChildContext=e,de(Ke),de(Ae),se(Ae,e)):de(Ke),se(Ke,n)}var _t=null,tl=!1,Lo=!1;function ls(e){_t===null?_t=[e]:_t.push(e)}function sd(e){tl=!0,ls(e)}function At(){if(!Lo&&_t!==null){Lo=!0;var e=0,t=le;try{var n=_t;for(le=1;e>=i,l-=i,Et=1<<32-ut(t)+l|n<$?(De=F,F=null):De=F.sibling;var ne=w(f,F,p[$],_);if(ne===null){F===null&&(F=De);break}e&&F&&ne.alternate===null&&t(f,F),c=o(ne,c,$),D===null?R=ne:D.sibling=ne,D=ne,F=De}if($===p.length)return n(f,F),pe&&nn(f,$),R;if(F===null){for(;$$?(De=F,F=null):De=F.sibling;var Xt=w(f,F,ne.value,_);if(Xt===null){F===null&&(F=De);break}e&&F&&Xt.alternate===null&&t(f,F),c=o(Xt,c,$),D===null?R=Xt:D.sibling=Xt,D=Xt,F=De}if(ne.done)return n(f,F),pe&&nn(f,$),R;if(F===null){for(;!ne.done;$++,ne=p.next())ne=S(f,ne.value,_),ne!==null&&(c=o(ne,c,$),D===null?R=ne:D.sibling=ne,D=ne);return pe&&nn(f,$),R}for(F=r(f,F);!ne.done;$++,ne=p.next())ne=N(F,f,$,ne.value,_),ne!==null&&(e&&ne.alternate!==null&&F.delete(ne.key===null?$:ne.key),c=o(ne,c,$),D===null?R=ne:D.sibling=ne,D=ne);return e&&F.forEach(function(Hd){return t(f,Hd)}),pe&&nn(f,$),R}function Ee(f,c,p,_){if(typeof p=="object"&&p!==null&&p.type===Re&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Ce:e:{for(var R=p.key,D=c;D!==null;){if(D.key===R){if(R=p.type,R===Re){if(D.tag===7){n(f,D.sibling),c=l(D,p.props.children),c.return=f,f=c;break e}}else if(D.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Ne&&cs(R)===D.type){n(f,D.sibling),c=l(D,p.props),c.ref=fr(f,D,p),c.return=f,f=c;break e}n(f,D);break}else t(f,D);D=D.sibling}p.type===Re?(c=dn(p.props.children,f.mode,_,p.key),c.return=f,f=c):(_=Pl(p.type,p.key,p.props,null,f.mode,_),_.ref=fr(f,c,p),_.return=f,f=_)}return i(f);case K:e:{for(D=p.key;c!==null;){if(c.key===D)if(c.tag===4&&c.stateNode.containerInfo===p.containerInfo&&c.stateNode.implementation===p.implementation){n(f,c.sibling),c=l(c,p.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=Pi(p,f.mode,_),c.return=f,f=c}return i(f);case Ne:return D=p._init,Ee(f,c,D(p._payload),_)}if($n(p))return z(f,c,p,_);if(I(p))return P(f,c,p,_);ol(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,p),c.return=f,f=c):(n(f,c),c=zi(p,f.mode,_),c.return=f,f=c),i(f)):n(f,c)}return Ee}var Pn=ds(!0),fs=ds(!1),il=bt(null),al=null,Tn=null,bo=null;function Uo(){bo=Tn=al=null}function Ao(e){var t=il.current;de(il),e._currentValue=t}function $o(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Rn(e,t){al=e,bo=Tn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Xe=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if(bo!==e)if(e={context:e,memoizedValue:t,next:null},Tn===null){if(al===null)throw Error(d(308));Tn=e,al.dependencies={lanes:0,firstContext:e}}else Tn=Tn.next=e;return t}var rn=null;function Ho(e){rn===null?rn=[e]:rn.push(e)}function ps(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ho(t)):(n.next=l.next,l.next=n),t.interleaved=n,Nt(e,r)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var $t=!1;function Vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ht(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(te&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Nt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ho(r)):(t.next=l.next,l.next=t),r.interleaved=t,Nt(e,n)}function sl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,no(e,n)}}function ms(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ul(e,t,n,r){var l=e.updateQueue;$t=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,h=s.next;s.next=null,i===null?o=h:i.next=h,i=s;var k=e.alternate;k!==null&&(k=k.updateQueue,a=k.lastBaseUpdate,a!==i&&(a===null?k.firstBaseUpdate=h:a.next=h,k.lastBaseUpdate=s))}if(o!==null){var S=l.baseState;i=0,k=h=s=null,a=o;do{var w=a.lane,N=a.eventTime;if((r&w)===w){k!==null&&(k=k.next={eventTime:N,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var z=e,P=a;switch(w=t,N=n,P.tag){case 1:if(z=P.payload,typeof z=="function"){S=z.call(N,S,w);break e}S=z;break e;case 3:z.flags=z.flags&-65537|128;case 0:if(z=P.payload,w=typeof z=="function"?z.call(N,S,w):z,w==null)break e;S=g({},S,w);break e;case 2:$t=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,w=l.effects,w===null?l.effects=[a]:w.push(a))}else N={eventTime:N,lane:w,tag:a.tag,payload:a.payload,callback:a.callback,next:null},k===null?(h=k=N,s=S):k=k.next=N,i|=w;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;w=a,a=w.next,w.next=null,l.lastBaseUpdate=w,l.shared.pending=null}}while(!0);if(k===null&&(s=S),l.baseState=s,l.firstBaseUpdate=h,l.lastBaseUpdate=k,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);an|=i,e.lanes=i,e.memoizedState=S}}function gs(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yo.transition;Yo.transition={};try{e(!1),t()}finally{le=n,Yo.transition=r}}function Os(){return it().memoizedState}function fd(e,t,n){var r=Qt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e))Fs(t,n);else if(n=ps(e,t,n,r),n!==null){var l=Be();mt(n,e,r,l),bs(n,t,r)}}function pd(e,t,n){var r=Qt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Fs(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,ct(a,i)){var s=t.interleaved;s===null?(l.next=l,Ho(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=ps(e,t,l,r),n!==null&&(l=Be(),mt(n,e,r,l),bs(n,t,r))}}function Ds(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Fs(e,t){gr=fl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bs(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,no(e,n)}}var ml={readContext:ot,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},hd={readContext:ot,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:js,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pl(4194308,4,Ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pl(4194308,4,e,t)},useInsertionEffect:function(e,t){return pl(4,2,e,t)},useMemo:function(e,t){var n=kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=kt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fd.bind(null,ye,e),[r.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:Cs,useDebugValue:ti,useDeferredValue:function(e){return kt().memoizedState=e},useTransition:function(){var e=Cs(!1),t=e[0];return e=dd.bind(null,e[1]),kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ye,l=kt();if(pe){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),Oe===null)throw Error(d(349));(on&30)!==0||ks(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,js(Ss.bind(null,r,o,e),[e]),r.flags|=2048,wr(9,xs.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=kt(),t=Oe.identifierPrefix;if(pe){var n=Ct,r=Et;n=(r&~(1<<32-ut(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[yt]=t,e[cr]=r,lu(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ql(n,r),n){case"dialog":ce("cancel",e),ce("close",e),l=r;break;case"iframe":case"object":case"embed":ce("load",e),l=r;break;case"video":case"audio":for(l=0;lDn&&(t.flags|=128,r=!0,kr(o,!1),t.lanes=4194304)}else{if(!r)if(e=cl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!fe)return He(t),null}else 2*_e()-o.renderingStartTime>Dn&&n!==1073741824&&(t.flags|=128,r=!0,kr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=ve.current,se(ve,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return Ci(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(nt&1073741824)!==0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(d(156,t.tag))}function Sd(e,t){switch(Mo(t),t.tag){case 1:return Ye(t.type)&&qr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(),de(Ke),de(Ae),Ko(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Bo(t),null;case 13:if(de(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(ve),null;case 4:return Ln(),null;case 10:return Ao(t.type._context),null;case 22:case 23:return Ci(),null;case 24:return null;default:return null}}var wl=!1,Ve=!1,_d=typeof WeakSet=="function"?WeakSet:Set,j=null;function Mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ke(e,t,r)}else n.current=null}function pi(e,t,n){try{n()}catch(r){ke(e,t,r)}}var au=!1;function Ed(e,t){if(Co=Ur,e=Ua(),vo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,s=-1,h=0,k=0,S=e,w=null;t:for(;;){for(var N;S!==n||l!==0&&S.nodeType!==3||(a=i+l),S!==o||r!==0&&S.nodeType!==3||(s=i+r),S.nodeType===3&&(i+=S.nodeValue.length),(N=S.firstChild)!==null;)w=S,S=N;for(;;){if(S===e)break t;if(w===n&&++h===l&&(a=i),w===o&&++k===r&&(s=i),(N=S.nextSibling)!==null)break;S=w,w=S.parentNode}S=N}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(No={focusedElem:e,selectionRange:n},Ur=!1,j=t;j!==null;)if(t=j,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,j=e;else for(;j!==null;){t=j;try{var z=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(z!==null){var P=z.memoizedProps,Ee=z.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?P:ft(t.type,P),Ee);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(d(163))}}catch(_){ke(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,j=e;break}j=t.return}return z=au,au=!1,z}function xr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&pi(t,n,o)}l=l.next}while(l!==r)}}function kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function su(e){var t=e.alternate;t!==null&&(e.alternate=null,su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yt],delete t[cr],delete t[To],delete t[id],delete t[ad])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function uu(e){return e.tag===5||e.tag===3||e.tag===4}function cu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zr));else if(r!==4&&(e=e.child,e!==null))for(mi(e,t,n),e=e.sibling;e!==null;)mi(e,t,n),e=e.sibling}function gi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(gi(e,t,n),e=e.sibling;e!==null;)gi(e,t,n),e=e.sibling}var Fe=null,pt=!1;function Vt(e,t,n){for(n=n.child;n!==null;)du(e,t,n),n=n.sibling}function du(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ir,n)}catch{}switch(n.tag){case 5:Ve||Mn(n,t);case 6:var r=Fe,l=pt;Fe=null,Vt(e,t,n),Fe=r,pt=l,Fe!==null&&(pt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(pt?(e=Fe,n=n.stateNode,e.nodeType===8?Po(e.parentNode,n):e.nodeType===1&&Po(e,n),qn(e)):Po(Fe,n.stateNode));break;case 4:r=Fe,l=pt,Fe=n.stateNode.containerInfo,pt=!0,Vt(e,t,n),Fe=r,pt=l;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&((o&2)!==0||(o&4)!==0)&&pi(n,t,i),l=l.next}while(l!==r)}Vt(e,t,n);break;case 1:if(!Ve&&(Mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ke(n,t,a)}Vt(e,t,n);break;case 21:Vt(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,Vt(e,t,n),Ve=r):Vt(e,t,n);break;default:Vt(e,t,n)}}function fu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _d),t.forEach(function(r){var l=Id.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Nd(r/1960))-r,10e?16:e,Bt===null)var r=!1;else{if(e=Bt,Bt=null,Cl=0,(te&6)!==0)throw Error(d(331));var l=te;for(te|=4,j=e.current;j!==null;){var o=j,i=o.child;if((j.flags&16)!==0){var a=o.deletions;if(a!==null){for(var s=0;s_e()-wi?un(e,0):yi|=n),Ze(e,t)}function Cu(e,t){t===0&&((e.mode&1)===0?t=1:(t=Or,Or<<=1,(Or&130023424)===0&&(Or=4194304)));var n=Be();e=Nt(e,t),e!==null&&(Yn(e,t,n),Ze(e,n))}function Ld(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cu(e,n)}function Id(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(d(314))}r!==null&&r.delete(t),Cu(e,n)}var Nu;Nu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ke.current)Xe=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Xe=!1,kd(e,t,n);Xe=(e.flags&131072)!==0}else Xe=!1,fe&&(t.flags&1048576)!==0&&os(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yl(e,t),e=t.pendingProps;var l=Cn(t,Ae.current);Rn(t,n),l=Go(null,t,r,e,l,n);var o=Zo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(o=!0,el(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Vo(t),l.updater=gl,t.stateNode=l,l._reactInternals=t,ri(t,r,e,n),t=ai(null,t,r,!0,o,n)):(t.tag=0,fe&&o&&Io(t),We(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Od(r),e=ft(r,e),l){case 0:t=ii(null,t,r,e,n);break e;case 1:t=Js(null,t,r,e,n);break e;case 11:t=Ks(null,t,r,e,n);break e;case 14:t=Ys(null,t,r,ft(r.type,e),n);break e}throw Error(d(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),ii(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),Js(e,t,r,l,n);case 3:e:{if(qs(t),e===null)throw Error(d(387));r=t.pendingProps,o=t.memoizedState,l=o.element,hs(e,t),ul(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=In(Error(d(423)),t),t=eu(e,t,r,n,l);break e}else if(r!==l){l=In(Error(d(424)),t),t=eu(e,t,r,n,l);break e}else for(tt=Ft(t.stateNode.containerInfo.firstChild),et=t,fe=!0,dt=null,n=fs(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zn(),r===l){t=zt(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return vs(t),e===null&&Do(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,jo(r,l)?i=null:o!==null&&jo(r,o)&&(t.flags|=32),Zs(e,t),We(e,t,i,n),t.child;case 6:return e===null&&Do(t),null;case 13:return tu(e,t,n);case 4:return Wo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pn(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),Ks(e,t,r,l,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,se(il,r._currentValue),r._currentValue=i,o!==null)if(ct(o.value,i)){if(o.children===l.children&&!Ke.current){t=zt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=jt(-1,n&-n),s.tag=2;var h=o.updateQueue;if(h!==null){h=h.shared;var k=h.pending;k===null?s.next=s:(s.next=k.next,k.next=s),h.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),$o(o.return,n,t),a.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(d(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),$o(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}We(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Rn(t,n),l=ot(l),r=r(l),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,l=ft(r,t.pendingProps),l=ft(r.type,l),Ys(e,t,r,l,n);case 15:return Xs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),yl(e,t),t.tag=1,Ye(r)?(e=!0,el(t)):e=!1,Rn(t,n),As(t,r,l),ri(t,r,l,n),ai(null,t,r,!0,e,n);case 19:return ru(e,t,n);case 22:return Gs(e,t,n)}throw Error(d(156,t.tag))};function ju(e,t){return ia(e,t)}function Md(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function st(e,t,n,r){return new Md(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Od(e){if(typeof e=="function")return ji(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Le)return 11;if(e===Ie)return 14}return 2}function Yt(e,t){var n=e.alternate;return n===null?(n=st(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")ji(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Re:return dn(n.children,l,o,t);case he:i=8,l|=8;break;case we:return e=st(12,n,t,l|2),e.elementType=we,e.lanes=o,e;case me:return e=st(13,n,t,l),e.elementType=me,e.lanes=o,e;case ge:return e=st(19,n,t,l),e.elementType=ge,e.lanes=o,e;case ae:return Tl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:i=10;break e;case Qe:i=9;break e;case Le:i=11;break e;case Ie:i=14;break e;case je:i=16,r=null;break e}throw Error(d(130,e==null?e:typeof e,""))}return t=st(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function dn(e,t,n,r){return e=st(7,e,r,t),e.lanes=n,e}function Tl(e,t,n,r){return e=st(22,e,r,t),e.elementType=ae,e.lanes=n,e.stateNode={isHidden:!1},e}function zi(e,t,n){return e=st(6,e,null,t),e.lanes=n,e}function Pi(e,t,n){return t=st(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Dd(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=to(0),this.expirationTimes=to(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=to(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ti(e,t,n,r,l,o,i,a,s){return e=new Dd(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=st(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vo(o),e}function Fd(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(E){console.error(E)}}return y(),Di.exports=Gd(),Di.exports}var $u;function Jd(){if($u)return Fl;$u=1;var y=Zd();return Fl.createRoot=y.createRoot,Fl.hydrateRoot=y.hydrateRoot,Fl}var qd=Jd();/** +`+o.stack}return{value:e,source:t,stack:l,digest:null}}function li(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function oi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var vd=typeof WeakMap=="function"?WeakMap:Map;function Hs(e,t,n){n=jt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_l||(_l=!0,ki=r),oi(e,t)},n}function Vs(e,t,n){n=jt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){oi(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){oi(e,t),typeof r!="function"&&(Wt===null?Wt=new Set([this]):Wt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Ws(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new vd;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Rd.bind(null,e,t,n),t.then(e,e))}function Bs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qs(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=jt(-1,1),t.tag=2,Ht(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var yd=fe.ReactCurrentOwner,Xe=!1;function We(e,t,n,r){t.child=e===null?fs(t,null,n,r):Pn(t,e.child,n,r)}function Ks(e,t,n,r,l){n=n.render;var o=t.ref;return Rn(t,l),r=Go(e,t,n,r,o,l),n=Zo(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,zt(e,t,l)):(pe&&n&&Io(t),t.flags|=1,We(e,t,r,l),t.child)}function Ys(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!ji(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Xs(e,t,o,r,l)):(e=Pl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,(e.lanes&l)===0){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:or,n(i,r)&&e.ref===t.ref)return zt(e,t,l)}return t.flags|=1,e=Yt(o,r),e.ref=t.ref,e.return=t,t.child=e}function Xs(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(or(o,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=o,(e.lanes&l)!==0)(e.flags&131072)!==0&&(Xe=!0);else return t.lanes=e.lanes,zt(e,t,l)}return ii(e,t,n,r,l)}function Gs(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},se(On,nt),nt|=n;else{if((n&1073741824)===0)return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,se(On,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,se(On,nt),nt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,se(On,nt),nt|=r;return We(e,t,l,n),t.child}function Zs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ii(e,t,n,r,l){var o=Ye(n)?en:Ae.current;return o=Cn(t,o),Rn(t,l),n=Go(e,t,n,r,o,l),r=Zo(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,zt(e,t,l)):(pe&&r&&Io(t),t.flags|=1,We(e,t,n,l),t.child)}function Js(e,t,n,r,l){if(Ye(n)){var o=!0;el(t)}else o=!1;if(Rn(t,l),t.stateNode===null)yl(e,t),As(t,n,r),ri(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var s=i.context,h=n.contextType;typeof h=="object"&&h!==null?h=ot(h):(h=Ye(n)?en:Ae.current,h=Cn(t,h));var k=n.getDerivedStateFromProps,S=typeof k=="function"||typeof i.getSnapshotBeforeUpdate=="function";S||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||s!==h)&&$s(t,i,r,h),$t=!1;var w=t.memoizedState;i.state=w,ul(t,r,i,l),s=t.memoizedState,a!==r||w!==s||Ke.current||$t?(typeof k=="function"&&(ni(t,n,k,r),s=t.memoizedState),(a=$t||Us(t,n,a,r,w,s,h))?(S||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=h,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,hs(e,t),a=t.memoizedProps,h=t.type===t.elementType?a:ft(t.type,a),i.props=h,S=t.pendingProps,w=i.context,s=n.contextType,typeof s=="object"&&s!==null?s=ot(s):(s=Ye(n)?en:Ae.current,s=Cn(t,s));var N=n.getDerivedStateFromProps;(k=typeof N=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==S||w!==s)&&$s(t,i,r,s),$t=!1,w=t.memoizedState,i.state=w,ul(t,r,i,l);var z=t.memoizedState;a!==S||w!==z||Ke.current||$t?(typeof N=="function"&&(ni(t,n,N,r),z=t.memoizedState),(h=$t||Us(t,n,h,r,w,z,s)||!1)?(k||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,z,s),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,z,s)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=z),i.props=r,i.state=z,i.context=s,r=h):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),r=!1)}return ai(e,t,n,r,o,l)}function ai(e,t,n,r,l,o){Zs(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&rs(t,n,!1),zt(e,t,o);r=t.stateNode,yd.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Pn(t,e.child,null,o),t.child=Pn(t,null,a,o)):We(e,t,a,o),t.memoizedState=r.state,l&&rs(t,n,!0),t.child}function qs(e){var t=e.stateNode;t.pendingContext?ts(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ts(e,t.context,!1),Wo(e,t.containerInfo)}function eu(e,t,n,r,l){return zn(),Fo(l),t.flags|=256,We(e,t,n,r),t.child}var si={dehydrated:null,treeContext:null,retryLane:0};function ui(e){return{baseLanes:e,cachePool:null,transitions:null}}function tu(e,t,n){var r=t.pendingProps,l=ve.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),se(ve,l&1),e===null)return Do(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=i):o=Tl(i,r,0,null),e=dn(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=ui(n),t.memoizedState=si,e):ci(t,i));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return wd(e,t,i,r,a,l,n);if(o){o=r.fallback,i=t.mode,l=e.child,a=l.sibling;var s={mode:"hidden",children:r.children};return(i&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=Yt(l,s),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?o=Yt(a,o):(o=dn(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?ui(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=si,r}return o=e.child,e=o.sibling,r=Yt(o,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ci(e,t){return t=Tl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vl(e,t,n,r){return r!==null&&Fo(r),Pn(t,e.child,null,n),e=ci(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wd(e,t,n,r,l,o,i){if(n)return t.flags&256?(t.flags&=-257,r=li(Error(d(422))),vl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=Tl({mode:"visible",children:r.children},l,0,null),o=dn(o,l,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,(t.mode&1)!==0&&Pn(t,e.child,null,i),t.child.memoizedState=ui(i),t.memoizedState=si,o);if((t.mode&1)===0)return vl(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(d(419)),r=li(o,r,void 0),vl(e,t,i,r)}if(a=(i&e.childLanes)!==0,Xe||a){if(r=Oe,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(r.suspendedLanes|i))!==0?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,Nt(e,l),mt(r,e,l,-1))}return Ni(),r=li(Error(d(421))),vl(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Ld.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,tt=Ft(l.nextSibling),et=t,pe=!0,dt=null,e!==null&&(rt[lt++]=Et,rt[lt++]=Ct,rt[lt++]=tn,Et=e.id,Ct=e.overflow,tn=t),t=ci(t,r.children),t.flags|=4096,t)}function nu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$o(e.return,t,n)}function di(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function ru(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if(We(e,t,r.children,n),r=ve.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nu(e,n,t);else if(e.tag===19)nu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(se(ve,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&cl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),di(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&cl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}di(t,!0,n,null,o);break;case"together":di(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),an|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,n=Yt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kd(e,t,n){switch(t.tag){case 3:qs(t),zn();break;case 5:vs(t);break;case 1:Ye(t.type)&&el(t);break;case 4:Wo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;se(il,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(se(ve,ve.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?tu(e,t,n):(se(ve,ve.current&1),e=zt(e,t,n),e!==null?e.sibling:null);se(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return ru(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),se(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,Gs(e,t,n)}return zt(e,t,n)}var lu,fi,ou,iu;lu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},fi=function(){},ou=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,ln(wt.current);var o=null;switch(n){case"input":l=An(e,l),r=An(e,r),o=[];break;case"select":l=g({},l,{value:void 0}),r=g({},r,{value:void 0}),o=[];break;case"textarea":l=Vl(e,l),r=Vl(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zr)}Bl(n,r);var i;n=null;for(h in l)if(!r.hasOwnProperty(h)&&l.hasOwnProperty(h)&&l[h]!=null)if(h==="style"){var a=l[h];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else h!=="dangerouslySetInnerHTML"&&h!=="children"&&h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(T.hasOwnProperty(h)?o||(o=[]):(o=o||[]).push(h,null));for(h in r){var s=r[h];if(a=l?.[h],r.hasOwnProperty(h)&&s!==a&&(s!=null||a!=null))if(h==="style")if(a){for(i in a)!a.hasOwnProperty(i)||s&&s.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in s)s.hasOwnProperty(i)&&a[i]!==s[i]&&(n||(n={}),n[i]=s[i])}else n||(o||(o=[]),o.push(h,n)),n=s;else h==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,a=a?a.__html:void 0,s!=null&&a!==s&&(o=o||[]).push(h,s)):h==="children"?typeof s!="string"&&typeof s!="number"||(o=o||[]).push(h,""+s):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&(T.hasOwnProperty(h)?(s!=null&&h==="onScroll"&&ce("scroll",e),o||a===s||(o=[])):(o=o||[]).push(h,s))}n&&(o=o||[]).push("style",n);var h=o;(t.updateQueue=h)&&(t.flags|=4)}},iu=function(e,t,n,r){n!==r&&(t.flags|=4)};function kr(e,t){if(!pe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xd(e,t,n){var r=t.pendingProps;switch(Mo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return Ye(t.type)&&qr(),He(t),null;case 3:return r=t.stateNode,Ln(),de(Ke),de(Ae),Ko(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ll(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,dt!==null&&(_i(dt),dt=null))),fi(e,t),He(t),null;case 5:Bo(t);var l=ln(mr.current);if(n=t.type,e!==null&&t.stateNode!=null)ou(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(d(166));return He(t),null}if(e=ln(wt.current),ll(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[yt]=t,r[cr]=o,e=(t.mode&1)!==0,n){case"dialog":ce("cancel",r),ce("close",r);break;case"iframe":case"object":case"embed":ce("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[yt]=t,e[cr]=r,lu(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ql(n,r),n){case"dialog":ce("cancel",e),ce("close",e),l=r;break;case"iframe":case"object":case"embed":ce("load",e),l=r;break;case"video":case"audio":for(l=0;lDn&&(t.flags|=128,r=!0,kr(o,!1),t.lanes=4194304)}else{if(!r)if(e=cl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!pe)return He(t),null}else 2*_e()-o.renderingStartTime>Dn&&n!==1073741824&&(t.flags|=128,r=!0,kr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=ve.current,se(ve,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return Ci(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(nt&1073741824)!==0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(d(156,t.tag))}function Sd(e,t){switch(Mo(t),t.tag){case 1:return Ye(t.type)&&qr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(),de(Ke),de(Ae),Ko(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Bo(t),null;case 13:if(de(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(ve),null;case 4:return Ln(),null;case 10:return Ao(t.type._context),null;case 22:case 23:return Ci(),null;case 24:return null;default:return null}}var wl=!1,Ve=!1,_d=typeof WeakSet=="function"?WeakSet:Set,j=null;function Mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function pi(e,t,n){try{n()}catch(r){Se(e,t,r)}}var au=!1;function Ed(e,t){if(Co=Ur,e=Ua(),vo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,s=-1,h=0,k=0,S=e,w=null;t:for(;;){for(var N;S!==n||l!==0&&S.nodeType!==3||(a=i+l),S!==o||r!==0&&S.nodeType!==3||(s=i+r),S.nodeType===3&&(i+=S.nodeValue.length),(N=S.firstChild)!==null;)w=S,S=N;for(;;){if(S===e)break t;if(w===n&&++h===l&&(a=i),w===o&&++k===r&&(s=i),(N=S.nextSibling)!==null)break;S=w,w=S.parentNode}S=N}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(No={focusedElem:e,selectionRange:n},Ur=!1,j=t;j!==null;)if(t=j,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,j=e;else for(;j!==null;){t=j;try{var z=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(z!==null){var P=z.memoizedProps,Ee=z.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?P:ft(t.type,P),Ee);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(d(163))}}catch(_){Se(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,j=e;break}j=t.return}return z=au,au=!1,z}function xr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&pi(t,n,o)}l=l.next}while(l!==r)}}function kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function su(e){var t=e.alternate;t!==null&&(e.alternate=null,su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yt],delete t[cr],delete t[To],delete t[id],delete t[ad])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function uu(e){return e.tag===5||e.tag===3||e.tag===4}function cu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zr));else if(r!==4&&(e=e.child,e!==null))for(mi(e,t,n),e=e.sibling;e!==null;)mi(e,t,n),e=e.sibling}function gi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(gi(e,t,n),e=e.sibling;e!==null;)gi(e,t,n),e=e.sibling}var Fe=null,pt=!1;function Vt(e,t,n){for(n=n.child;n!==null;)du(e,t,n),n=n.sibling}function du(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ir,n)}catch{}switch(n.tag){case 5:Ve||Mn(n,t);case 6:var r=Fe,l=pt;Fe=null,Vt(e,t,n),Fe=r,pt=l,Fe!==null&&(pt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(pt?(e=Fe,n=n.stateNode,e.nodeType===8?Po(e.parentNode,n):e.nodeType===1&&Po(e,n),qn(e)):Po(Fe,n.stateNode));break;case 4:r=Fe,l=pt,Fe=n.stateNode.containerInfo,pt=!0,Vt(e,t,n),Fe=r,pt=l;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&((o&2)!==0||(o&4)!==0)&&pi(n,t,i),l=l.next}while(l!==r)}Vt(e,t,n);break;case 1:if(!Ve&&(Mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Se(n,t,a)}Vt(e,t,n);break;case 21:Vt(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,Vt(e,t,n),Ve=r):Vt(e,t,n);break;default:Vt(e,t,n)}}function fu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _d),t.forEach(function(r){var l=Id.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Nd(r/1960))-r,10e?16:e,Bt===null)var r=!1;else{if(e=Bt,Bt=null,Cl=0,(te&6)!==0)throw Error(d(331));var l=te;for(te|=4,j=e.current;j!==null;){var o=j,i=o.child;if((j.flags&16)!==0){var a=o.deletions;if(a!==null){for(var s=0;s_e()-wi?un(e,0):yi|=n),Ze(e,t)}function Cu(e,t){t===0&&((e.mode&1)===0?t=1:(t=Or,Or<<=1,(Or&130023424)===0&&(Or=4194304)));var n=Be();e=Nt(e,t),e!==null&&(Yn(e,t,n),Ze(e,n))}function Ld(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cu(e,n)}function Id(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(d(314))}r!==null&&r.delete(t),Cu(e,n)}var Nu;Nu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ke.current)Xe=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Xe=!1,kd(e,t,n);Xe=(e.flags&131072)!==0}else Xe=!1,pe&&(t.flags&1048576)!==0&&os(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yl(e,t),e=t.pendingProps;var l=Cn(t,Ae.current);Rn(t,n),l=Go(null,t,r,e,l,n);var o=Zo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(o=!0,el(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Vo(t),l.updater=gl,t.stateNode=l,l._reactInternals=t,ri(t,r,e,n),t=ai(null,t,r,!0,o,n)):(t.tag=0,pe&&o&&Io(t),We(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Od(r),e=ft(r,e),l){case 0:t=ii(null,t,r,e,n);break e;case 1:t=Js(null,t,r,e,n);break e;case 11:t=Ks(null,t,r,e,n);break e;case 14:t=Ys(null,t,r,ft(r.type,e),n);break e}throw Error(d(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),ii(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),Js(e,t,r,l,n);case 3:e:{if(qs(t),e===null)throw Error(d(387));r=t.pendingProps,o=t.memoizedState,l=o.element,hs(e,t),ul(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=In(Error(d(423)),t),t=eu(e,t,r,n,l);break e}else if(r!==l){l=In(Error(d(424)),t),t=eu(e,t,r,n,l);break e}else for(tt=Ft(t.stateNode.containerInfo.firstChild),et=t,pe=!0,dt=null,n=fs(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zn(),r===l){t=zt(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return vs(t),e===null&&Do(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,jo(r,l)?i=null:o!==null&&jo(r,o)&&(t.flags|=32),Zs(e,t),We(e,t,i,n),t.child;case 6:return e===null&&Do(t),null;case 13:return tu(e,t,n);case 4:return Wo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pn(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),Ks(e,t,r,l,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,se(il,r._currentValue),r._currentValue=i,o!==null)if(ct(o.value,i)){if(o.children===l.children&&!Ke.current){t=zt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=jt(-1,n&-n),s.tag=2;var h=o.updateQueue;if(h!==null){h=h.shared;var k=h.pending;k===null?s.next=s:(s.next=k.next,k.next=s),h.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),$o(o.return,n,t),a.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(d(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),$o(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}We(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Rn(t,n),l=ot(l),r=r(l),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,l=ft(r,t.pendingProps),l=ft(r.type,l),Ys(e,t,r,l,n);case 15:return Xs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),yl(e,t),t.tag=1,Ye(r)?(e=!0,el(t)):e=!1,Rn(t,n),As(t,r,l),ri(t,r,l,n),ai(null,t,r,!0,e,n);case 19:return ru(e,t,n);case 22:return Gs(e,t,n)}throw Error(d(156,t.tag))};function ju(e,t){return ia(e,t)}function Md(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function st(e,t,n,r){return new Md(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Od(e){if(typeof e=="function")return ji(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Le)return 11;if(e===Ie)return 14}return 2}function Yt(e,t){var n=e.alternate;return n===null?(n=st(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")ji(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Re:return dn(n.children,l,o,t);case he:i=8,l|=8;break;case xe:return e=st(12,n,t,l|2),e.elementType=xe,e.lanes=o,e;case me:return e=st(13,n,t,l),e.elementType=me,e.lanes=o,e;case ge:return e=st(19,n,t,l),e.elementType=ge,e.lanes=o,e;case ie:return Tl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:i=10;break e;case Qe:i=9;break e;case Le:i=11;break e;case Ie:i=14;break e;case Ne:i=16,r=null;break e}throw Error(d(130,e==null?e:typeof e,""))}return t=st(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function dn(e,t,n,r){return e=st(7,e,r,t),e.lanes=n,e}function Tl(e,t,n,r){return e=st(22,e,r,t),e.elementType=ie,e.lanes=n,e.stateNode={isHidden:!1},e}function zi(e,t,n){return e=st(6,e,null,t),e.lanes=n,e}function Pi(e,t,n){return t=st(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Dd(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=to(0),this.expirationTimes=to(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=to(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ti(e,t,n,r,l,o,i,a,s){return e=new Dd(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=st(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vo(o),e}function Fd(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(E){console.error(E)}}return y(),Di.exports=Gd(),Di.exports}var $u;function Jd(){if($u)return Fl;$u=1;var y=Zd();return Fl.createRoot=y.createRoot,Fl.hydrateRoot=y.hydrateRoot,Fl}var qd=Jd();/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ef=y=>y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tf=y=>y.replace(/^([A-Z])|[\s-_]+(\w)/g,(E,d,A)=>A?A.toUpperCase():d.toLowerCase()),Hu=y=>{const E=tf(y);return E.charAt(0).toUpperCase()+E.slice(1)},Wu=(...y)=>y.filter((E,d,A)=>!!E&&E.trim()!==""&&A.indexOf(E)===d).join(" ").trim();/** + */const ef=y=>y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tf=y=>y.replace(/^([A-Z])|[\s-_]+(\w)/g,(E,d,U)=>U?U.toUpperCase():d.toLowerCase()),Hu=y=>{const E=tf(y);return E.charAt(0).toUpperCase()+E.slice(1)},Wu=(...y)=>y.filter((E,d,U)=>!!E&&E.trim()!==""&&U.indexOf(E)===d).join(" ").trim();/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. @@ -52,12 +52,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rf=C.forwardRef(({color:y="currentColor",size:E=24,strokeWidth:d=2,absoluteStrokeWidth:A,className:T="",children:L,iconNode:W,...G},b)=>C.createElement("svg",{ref:b,...nf,width:E,height:E,stroke:y,strokeWidth:A?Number(d)*24/Number(E):d,className:Wu("lucide",T),...G},[...W.map(([Q,Y])=>C.createElement(Q,Y)),...Array.isArray(L)?L:[L]]));/** + */const rf=C.forwardRef(({color:y="currentColor",size:E=24,strokeWidth:d=2,absoluteStrokeWidth:U,className:T="",children:L,iconNode:B,...G},A)=>C.createElement("svg",{ref:A,...nf,width:E,height:E,stroke:y,strokeWidth:U?Number(d)*24/Number(E):d,className:Wu("lucide",T),...G},[...B.map(([Q,Z])=>C.createElement(Q,Z)),...Array.isArray(L)?L:[L]]));/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gt=(y,E)=>{const d=C.forwardRef(({className:A,...T},L)=>C.createElement(rf,{ref:L,iconNode:E,className:Wu(`lucide-${ef(Hu(y))}`,`lucide-${y}`,A),...T}));return d.displayName=Hu(y),d};/** + */const Gt=(y,E)=>{const d=C.forwardRef(({className:U,...T},L)=>C.createElement(rf,{ref:L,iconNode:E,className:Wu(`lucide-${ef(Hu(y))}`,`lucide-${y}`,U),...T}));return d.displayName=Hu(y),d};/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. @@ -97,6 +97,6 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vf=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Vu=Gt("smartphone",vf);function yf(){return m.jsx("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:m.jsx("div",{className:"flex items-start",children:m.jsxs("div",{className:"flex-1",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[m.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center",children:m.jsx(Bu,{className:"w-6 h-6 text-blue-600"})}),m.jsx("h2",{className:"text-slate-800",children:"DDNSTO 远程访问"})]}),m.jsx("p",{className:"text-slate-600 text-sm mb-2",children:"DDNSTO 远程访问,不需要公网 IP、不需要开放端口。只需一个链接,即可从任何地方安全访问您的 NAS、路由器和桌面。"}),m.jsxs("a",{href:"https://www.ddnsto.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:underline",children:["了解更多",m.jsx(Al,{className:"w-3 h-3"})]})]})})})}function wf({isRunning:y,isConfigured:E,hostname:d,address:A,deviceId:T,version:L,featEnabled:W,tunnelOk:G,onRefreshStatus:b}){const[Q,Y]=C.useState(!1),B={label:y?"运行中":"已停止",bgColor:y?"bg-green-100":"bg-slate-200",textColor:y?"text-green-700":"text-slate-600"},$=A&&A.trim().length>0?A:"未配置",q=Q,ie=G===!0,V=q?"检查中...":G===!0?"正常":G===!1?"无法连接服务器":"未知",K=W==="1"||W===!0?"已开启":"未开启",Ce=T||"-",xe=async()=>{if(b){Y(!0);try{await b()}finally{Y(!1)}}};return m.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[m.jsx("h3",{className:"text-slate-800 mb-4",children:"运行状态"}),m.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-slate-100",children:[m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${B.bgColor} ${B.textColor}`,children:B.label}),E&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-sm text-slate-500",children:"远程访问域名:"}),A&&A.trim().length>0?m.jsxs("a",{href:$,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:underline flex items-center gap-1",children:[$,m.jsx(Al,{className:"w-3 h-3"})]}):m.jsx("span",{className:"text-sm text-slate-500",children:$})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsxs("button",{onClick:xe,className:"px-3 py-2 rounded-md text-blue-600 text-sm hover:bg-blue-50 transition-colors flex items-center gap-1",children:[m.jsx(hf,{className:"w-4 h-4"}),"刷新状态"]})})]}),m.jsx("div",{className:"mt-6",children:m.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[m.jsx(Bu,{className:"w-4 h-4 text-slate-400"}),q&&m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300 border-t-blue-600 animate-spin"}),m.jsxs("h4",{className:"text-sm text-slate-700",children:["服务器连接:",ie?m.jsx("span",{className:"text-green-600",children:V}):m.jsx("span",{children:V}),"| 设备 ID:",Ce," | 拓展功能:",K,L?` | 版本:${L}`:""]})]})})]})}function Qu({checked:y,onChange:E,label:d,id:A,disabled:T,containerClassName:L,...W}){return m.jsxs("div",{className:`ddnsto-toggle-container ${L||""}`,children:[d&&m.jsx("label",{htmlFor:A,className:"text-sm text-slate-700 mr-3 whitespace-nowrap",children:d}),m.jsxs("label",{className:"ddnsto-toggle-switch","aria-label":d||"toggle",children:[m.jsx("input",{id:A,type:"checkbox",checked:y,disabled:T,onChange:G=>E(G.target.checked),...W}),m.jsx("span",{className:"ddnsto-toggle-slider","aria-hidden":!0})]})]})}function kf({onSave:y,isInTab:E,token:d,enabled:A,advancedConfig:T,onRegisterSave:L,onTokenChange:W,onEnabledChange:G}){const[b,Q]=C.useState(d||""),[Y,B]=C.useState(A);C.useEffect(()=>{Q(d||"")},[d]),C.useEffect(()=>{B(A)},[T,A]);const $=()=>{b.trim()&&y(b,Y?"1":"0",T)};return C.useEffect(()=>{L&&L(()=>$())},[L,b,Y,T]),m.jsxs("div",{className:E?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!E&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"text-slate-800 mb-2",children:"手动配置"}),m.jsx("p",{className:"text-xs text-slate-400 mb-6",children:"如果您已经在 DDNSTO 控制台获取了令牌,可以直接在此填写并启动插件。"})]}),m.jsxs("div",{className:"space-y-5",children:[m.jsx("div",{className:"pb-4",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h4",{className:"text-sm text-slate-700",children:"启用 DDNSTO"}),m.jsx(Qu,{checked:Y,onChange:q=>{B(q),G?.(q)},"aria-label":"启用 DDNSTO",containerClassName:"ml-6"})]})}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsxs("label",{className:"text-sm text-slate-700",children:["用户令牌(Token) ",m.jsx("span",{className:"text-red-500",children:"*"})]}),m.jsxs("a",{href:"https://www.ddnsto.com/docs/guide/token.html",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 hover:underline flex items-center gap-1",children:["如何查看用户令牌",m.jsx(Al,{className:"w-3 h-3"})]})]}),m.jsx("div",{className:"relative",children:m.jsx("input",{type:"text",value:b,onChange:q=>{Q(q.target.value),W?.(q.target.value)},placeholder:"请输入您的 DDNSTO 令牌",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})}),m.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"令牌将保存在路由器本地,请勿泄露。"})]})]})]})}function xf({token:y,enabled:E,advancedConfig:d,onSave:A,isInTab:T,onRegisterSave:L}){const[W,G]=C.useState(d.feat_enabled==="1"),[b,Q]=C.useState(d.feat_disk_path_selected||"/mnt/sda1"),[Y,B]=C.useState(d.feat_port||"3033"),[$,q]=C.useState(d.feat_username||"ddnsto"),[ie,V]=C.useState(d.feat_password||""),[K,Ce]=C.useState(!1),[xe,Se]=C.useState(d.index||"");C.useEffect(()=>{G(d.feat_enabled==="1"),d.feat_disk_path_selected&&Q(d.feat_disk_path_selected),d.feat_port&&B(d.feat_port),d.feat_username&&q(d.feat_username),d.feat_password&&V(d.feat_password),d.index!==void 0&&Se(d.index)},[d]);const pe=()=>{A(y,E?"1":"0",{feat_enabled:W?"1":"0",feat_port:Y,feat_username:$,feat_password:ie,feat_disk_path_selected:b,mounts:d.mounts,index:xe})};return C.useEffect(()=>{L&&L(()=>pe())},[L,y,E,W,b,Y,$,ie,xe,d.mounts]),m.jsxs("div",{className:T?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!T&&m.jsx("h3",{className:"text-slate-800 mb-4",children:"高级功能"}),m.jsxs("div",{className:"space-y-5",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-700 mb-2",children:"设备编号(可选)"}),m.jsx("input",{type:"text",value:xe,onChange:ee=>Se(ee.target.value),placeholder:"",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),m.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"如有多台设备id重复,请修改此编号(0~100),正常情况不需要修改"})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h4",{className:"text-sm text-slate-700",children:"启用拓展功能"}),m.jsx(Qu,{checked:W,onChange:ee=>G(ee),"aria-label":"启用拓展功能",containerClassName:"ml-6"})]}),m.jsxs("div",{className:"flex items-center gap-2 -mt-2",children:[m.jsx("p",{className:"text-xs text-slate-400",children:"启用后可支持控制台的「文件管理」及「远程开机」功能"}),m.jsxs("a",{href:"https://www.ddnsto.com/docs/guide/advanced.html",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 hover:underline flex items-center gap-1 whitespace-nowrap",children:["查看教程",m.jsx(Al,{className:"w-3 h-3"})]})]}),W&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(ff,{className:"w-4 h-4 text-slate-600"}),m.jsx("h5",{className:"text-sm text-slate-700",children:"WebDAV 服务配置"})]}),m.jsxs("div",{className:"space-y-4 pl-6",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"可访问的文件目录"}),m.jsx("select",{value:b,onChange:ee=>Q(ee.target.value),className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white",children:d.mounts&&d.mounts.length>0?d.mounts.map(ee=>m.jsx("option",{value:ee,children:ee},ee)):m.jsx("option",{value:"",disabled:!0,children:"未检测到挂载点"})}),m.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"控制台上的文件管理将只能看到此目录及其子目录。"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"服务端口"}),m.jsx("input",{type:"text",value:Y,onChange:ee=>B(ee.target.value),placeholder:"3033",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"授权用户名"}),m.jsx("input",{type:"text",value:$,onChange:ee=>q(ee.target.value),placeholder:"ddnsto",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"授权用户密码"}),m.jsxs("div",{className:"relative",children:[m.jsx("input",{type:K?"text":"password",value:ie,onChange:ee=>V(ee.target.value),placeholder:"设置访问密码",className:"w-full px-3 py-2 pr-10 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),m.jsx("button",{type:"button",onClick:()=>Ce(!K),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:K?m.jsx(sf,{className:"w-4 h-4"}):m.jsx(cf,{className:"w-4 h-4"})})]})]})]})]})]})]})}function Sf({ddnstoToken:y,ddnstoEnabled:E,advancedConfig:d,onSave:A,saveBanner:T}){const[L,W]=C.useState("basic"),G=C.useRef(null),b=C.useRef(),Q=C.useRef(),[Y,B]=C.useState(y||""),[$,q]=C.useState(E==="1");C.useEffect(()=>{B(y||"")},[y]),C.useEffect(()=>{q(E==="1")},[E]);const ie=()=>{L==="basic"?b.current?.():Q.current?.()};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 mb-4",children:[m.jsx("div",{className:"border-b border-slate-200 px-6",children:m.jsx("div",{className:"flex items-center justify-between",children:m.jsxs("div",{className:"flex items-center -mb-px",children:[m.jsx("button",{onClick:()=>W("basic"),className:`px-4 py-4 text-sm border-b-2 transition-colors ${L==="basic"?"border-blue-600 text-blue-600":"border-transparent text-slate-600 hover:text-slate-800"}`,children:"基础配置"}),m.jsx("button",{onClick:()=>W("advanced"),className:`px-4 py-4 text-sm border-b-2 transition-colors ${L==="advanced"?"border-blue-600 text-blue-600":"border-transparent text-slate-600 hover:text-slate-800"}`,children:"高级功能"})]})})}),m.jsxs("div",{ref:G,className:"p-6",children:[L==="basic"&&m.jsx(kf,{token:Y,enabled:$,advancedConfig:d,onSave:A,isInTab:!0,onRegisterSave:V=>{b.current=V},onTokenChange:B,onEnabledChange:q}),L==="advanced"&&m.jsx(xf,{token:Y,enabled:$,advancedConfig:d,onSave:A,isInTab:!0,onRegisterSave:V=>{Q.current=V}})]})]}),m.jsx("div",{className:"flex justify-end gap-3 mt-4",children:m.jsxs("button",{onClick:ie,disabled:!Y.trim(),className:"ddnsto-btn ddnsto-btn-primary",children:[m.jsx(gf,{className:"ddnsto-btn-icon"}),"保存配置并应用"]})}),T.state!=="idle"&&m.jsxs("div",{className:["mt-2 rounded-md border px-3 py-2 text-sm",T.state==="loading"?"bg-blue-50 border-blue-200 text-blue-800":"",T.state==="success"?"bg-emerald-50 border-emerald-200 text-emerald-800":"",T.state==="error"?"bg-red-50 border-red-200 text-red-800":""].join(" "),children:[m.jsx("div",{className:"font-medium",children:T.message}),T.description&&m.jsx("div",{className:"text-xs mt-1 opacity-80 break-words",children:T.description})]})]})}const bn={auth:0,starting:1,binding:2,domain:3,checking:4};function _f({apiBase:y,csrfToken:E,deviceId:d,onboardingBase:A,onComplete:T,onRefreshStatus:L,isInTab:W}){const[G,b]=C.useState(!1),[Q,Y]=C.useState(A||"https://www.kooldns.cn/bind"),[B,$]=C.useState(`${A||"https://www.kooldns.cn/bind"}/#/auth?send=1&source=openwrt&callback=*`),[q,ie]=C.useState("auth"),[V,K]=C.useState(d||""),[Ce,xe]=C.useState(""),[Se,pe]=C.useState(""),[ee,Ne]=C.useState(!1),[Re,he]=C.useState(null),we=C.useRef("auth"),ue=E||(typeof window<"u"?window.ddnstoCsrfToken:""),Qe=C.useCallback(g=>{ie(u=>bn[g]>bn[u]?g:u)},[]);C.useEffect(()=>{we.current=q},[q]),C.useEffect(()=>{console.log("Onboarding iframe url:",B)},[B]);const Le=C.useCallback(()=>{ie("auth"),xe(""),pe(""),he(null),K(d||""),$(`${Q}/#/auth?send=1&source=openwrt&callback=*`)},[Qe,d,Q]);C.useEffect(()=>{const g="/#/auth?send=1&source=openwrt&callback=*",u=A||"https://www.kooldns.cn/bind";Y(u),$(`${u}${g}`)},[A]),C.useEffect(()=>{K(d||"")},[d]);const me=C.useCallback(async()=>{for(let v=0;v<20;v+=1){const M=await fetch(`${y}/admin/services/ddnsto/api/status`,{credentials:"same-origin"});if(M.ok){const X=(await M.json())?.data||{},O=X.deviceId||X.device_id||"";if(O&&K(O),X.running)return{running:!0,deviceId:O}}await new Promise(U=>setTimeout(U,2e3))}throw new Error("ddnsto not running")},[y]),ge=C.useCallback(async g=>{const u={url:g};ue&&(u.token=ue);const v=await fetch(`${y}/admin/services/ddnsto/api/onboarding/address`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",...ue?{"X-LuCI-Token":ue}:{}},body:JSON.stringify(u)});if(!v.ok)throw new Error(`HTTP ${v.status}`);const M=await v.json();if(!M?.ok)throw new Error(M?.error||"save address failed")},[y,ue]),Ie=C.useCallback(async(g,u)=>{Ne(!0),he(null);const v=V||d||"",M=`${Q}/#/bind?status=starting&token=${encodeURIComponent(g)}&sign=${encodeURIComponent(u)}${v?`&routerId=${encodeURIComponent(v)}`:""}`;$(M),Qe("starting");try{const U=await fetch(`${y}/admin/services/ddnsto/api/onboarding/start`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",...ue?{"X-LuCI-Token":ue}:{}},body:JSON.stringify({token:g})});if(!U.ok)throw new Error(`HTTP ${U.status}`);const X=await U.json();if(!X?.ok)throw new Error(X?.error||"start failed");L&&await L();const re=(await me())?.deviceId||V||d||"";if(bn[we.current]>=bn.domain)return;const J=`${Q}/#/bind?status=starting&routerId=${encodeURIComponent(re)}&token=${encodeURIComponent(g)}&sign=${encodeURIComponent(u)}`;$(J),Qe("binding"),K(re)}catch{he("启动失败,请稍后重试")}finally{Ne(!1)}},[Qe,y,d,ue,Q,L,me,Le,V]),je=C.useCallback(g=>{const u=g||V;if(!Ce||!Se||!u)return;const v=`${Q}/#/domain?sign=${encodeURIComponent(Se)}&token=${encodeURIComponent(Ce)}&routerId=${encodeURIComponent(u)}&netaddr=127.0.0.1&source=openwrt`;$(v),ie("domain")},[Se,Ce,Q,V]),ae=C.useCallback(async g=>{$(`${Q}/#/check?url=${encodeURIComponent(g)}`),ie("checking"),T();try{await ge(g),L&&await L()}catch{he("保存域名失败,请重试")}},[Q,T,L,ge]),x=C.useCallback(()=>{b(!0),Le()},[Le]);C.useEffect(()=>{const g=u=>{if(!G)return;console.log("Onboarding message:",u.data);const v=u.data;let M=v;if(typeof v=="string")try{M=JSON.parse(v)}catch{return}if(!M||typeof M!="object")return;const U=M.data,O=U&&typeof U=="object"?U:M;if((typeof O.auth=="string"?O.auth:"")!=="ddnsto")return;const J=typeof O.sign=="string"?O.sign:"",oe=typeof O.token=="string"?O.token:"",Ue=typeof O.step=="string"?O.step:"",fn=typeof O.status=="string"?O.status:"",Un=typeof O.url=="string"?O.url:"",Tt=O.success,An=typeof Tt=="number"?Tt:Number(Tt);if(J&&oe&&q==="auth"&&!ee){xe(oe),pe(J),Ie(oe,J);return}if(Ue==="bind"&&fn==="success"){const Zt=typeof O.router_uid=="string"?O.router_uid:V;Zt&&K(Zt),je(Zt);return}Ue==="domain"&&Un&&An===0&&bn[we.current]window.removeEventListener("message",g)},[je,ae,ee,Ie,G,q]);const I=()=>m.jsx("div",{className:"flex items-center justify-between mb-6",children:m.jsx("h3",{className:"text-slate-800",children:"快速向导"})});return G?m.jsxs("div",{className:W?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!W&&I(),m.jsx("div",{className:"rounded-lg border border-slate-200 overflow-hidden",children:m.jsx("iframe",{src:B,title:"快速向导",className:"w-full",style:{width:"100%",height:"70vh",maxHeight:"400px",border:0},loading:"lazy"})})]}):m.jsxs("div",{className:W?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!W&&I(),m.jsxs("div",{className:"text-center py-8",children:[m.jsx("div",{className:"mb-4 flex justify-center",children:m.jsx("div",{className:"w-16 h-16 rounded-full bg-blue-50 flex items-center justify-center",children:m.jsx(Vu,{className:"w-8 h-8 text-blue-600"})})}),m.jsx("h4",{className:"text-slate-800 mb-2",children:"欢迎使用 DDNSTO!"}),m.jsx("p",{className:"text-sm text-slate-600 mb-6 max-w-md mx-auto",children:"通过微信扫码登录,我们将引导您完成插件配置"}),m.jsxs("button",{onClick:x,className:"ddnsto-btn ddnsto-btn-primary",children:[m.jsx(Vu,{className:"ddnsto-btn-icon"}),"开始配置"]})]})]})}function Ef({config:y}){const[E,d]=C.useState(!1),[A,T]=C.useState(!1),[L,W]=C.useState("OpenWrt"),[G,b]=C.useState(""),[Q,Y]=C.useState(""),[B,$]=C.useState(""),[q,ie]=C.useState(""),[V,K]=C.useState("1"),[Ce,xe]=C.useState({feat_enabled:"0",feat_port:"",feat_username:"",feat_password:"",feat_disk_path_selected:"",mounts:[],index:""}),[,Se]=C.useState(null),[pe,ee]=C.useState(null),[Ne,Re]=C.useState({state:"idle",message:""}),he=C.useRef(),we=(y?.api_base||"/cgi-bin/luci").replace(/\/$/,""),ue=y?.token||"",Qe=(y?.onboarding_base||"https://www.kooldns.cn/bind").replace(/\/$/,""),Le=C.useCallback((x,I,g,u)=>{he.current&&window.clearTimeout(he.current),Re({state:x,message:I,description:g}),u&&(he.current=window.setTimeout(()=>{Re({state:"idle",message:""})},u))},[]);C.useEffect(()=>()=>{he.current&&window.clearTimeout(he.current)},[]);const me=C.useCallback(async()=>{try{const x=await fetch(`${we}/admin/services/ddnsto/api/config`,{credentials:"same-origin"});if(!x.ok)throw new Error(`HTTP ${x.status}`);const g=(await x.json())?.data||{};g.address&&b(g.address),g.device_id!==void 0?Y(g.device_id):g.deviceId!==void 0&&Y(g.deviceId),g.version!==void 0&&$(g.version),g.token&&ie(g.token),g.enabled!==void 0&&K(g.enabled),xe({feat_enabled:g.feat_enabled||"0",feat_port:g.feat_port||"",feat_username:g.feat_username||"",feat_password:g.feat_password||"",feat_disk_path_selected:g.feat_disk_path_selected||"",mounts:g.mounts||[],index:g.index||""})}catch(x){console.error("Failed to fetch ddnsto config",x)}},[we]),ge=C.useCallback(async()=>{try{const x=await fetch(`${we}/admin/services/ddnsto/api/status`,{credentials:"same-origin"});if(!x.ok)throw new Error(`HTTP ${x.status}`);const g=(await x.json())?.data||{};d(!!g.running),g.token_set&&T(!0),g.hostname&&W(g.hostname),g.device_id!==void 0?Y(g.device_id):g.deviceId!==void 0&&Y(g.deviceId),g.address&&b(g.address),g.version!==void 0&&$(g.version),Se(null)}catch(x){console.error("Failed to fetch ddnsto status",x),Se("无法获取运行状态")}},[we]),Ie=C.useCallback(async()=>{try{const x=await fetch(`${we}/admin/services/ddnsto/api/connectivity`,{credentials:"same-origin"});if(!x.ok)throw new Error(`HTTP ${x.status}`);const g=(await x.json())?.data||{};g.tunnel_ok!==void 0&&g.tunnel_ok!==null?ee(g.tunnel_ok===!0):ee(null)}catch(x){console.error("Failed to fetch ddnsto connectivity",x),ee(null)}},[we]),je=C.useCallback(async()=>{await me(),await ge(),await Ie()},[me,ge,Ie]),ae=C.useCallback(async(x,I,g)=>{Le("loading","正在保存配置...","正在将配置写入路由器,请稍候");try{const u=new URLSearchParams;ue&&u.append("token",ue),u.append("ddnsto_token",x),u.append("enabled",I),u.append("feat_enabled",g.feat_enabled),u.append("feat_port",g.feat_port),u.append("feat_username",g.feat_username),u.append("feat_password",g.feat_password),u.append("feat_disk_path_selected",g.feat_disk_path_selected),u.append("index",g.index||"");const v=await fetch(`${we}/admin/services/ddnsto/api/config`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",...ue?{"X-LuCI-Token":ue}:{}},body:u});if(!v.ok)throw new Error(`HTTP ${v.status}`);const M=await v.json();if(!M?.ok)throw new Error(M?.error||"Save failed");Le("success","配置已保存并生效",void 0,3e3),T(!0),await me(),await ge()}catch(u){console.error("Failed to save config",u);const v=u instanceof Error?u.message:String(u);Le("error","保存失败,请重试",v,4e3)}},[we,ue,me,ge]);return C.useEffect(()=>{me(),ge(),Ie()},[me,ge,Ie]),C.useEffect(()=>{const x=window.setInterval(ge,5e3);return()=>{window.clearInterval(x)}},[ge]),m.jsx("div",{className:"min-h-screen bg-slate-50",children:m.jsx("main",{children:m.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-8",children:[m.jsx(yf,{}),m.jsx(wf,{isRunning:E,isConfigured:A,hostname:L,address:G,deviceId:Q,version:B,featEnabled:Ce.feat_enabled,tunnelOk:pe,onRefreshStatus:je}),m.jsx(_f,{apiBase:we,csrfToken:ue,deviceId:Q,onboardingBase:Qe,onRefreshStatus:je,onComplete:()=>T(!0)}),m.jsx(Sf,{ddnstoToken:q,ddnstoEnabled:V,advancedConfig:Ce,onSave:ae,saveBanner:Ne})]})})})}const Cf='/*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */*,:before,:after,::backdrop{--tw-border-style: solid}@layer properties{@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-rotate-x: rotateX(0);--tw-rotate-y: rotateY(0);--tw-rotate-z: rotateZ(0);--tw-skew-x: skewX(0);--tw-skew-y: skewY(0);--tw-space-y-reverse: 0;--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500: oklch(.637 .237 25.331);--color-amber-50: oklch(.987 .022 95.277);--color-amber-200: oklch(.924 .12 95.746);--color-amber-600: oklch(.666 .179 58.318);--color-green-50: oklch(.982 .018 155.826);--color-green-100: oklch(.962 .044 156.743);--color-green-200: oklch(.925 .084 155.995);--color-green-600: oklch(.627 .194 149.214);--color-green-700: oklch(.527 .154 150.069);--color-green-800: oklch(.448 .119 151.328);--color-blue-50: oklch(.97 .014 254.604);--color-blue-200: oklch(.882 .059 254.128);--color-blue-500: oklch(.623 .214 259.815);--color-blue-600: oklch(.546 .245 262.881);--color-blue-700: oklch(.488 .243 264.376);--color-slate-50: oklch(.984 .003 247.858);--color-slate-100: oklch(.968 .007 247.896);--color-slate-200: oklch(.929 .013 255.508);--color-slate-300: oklch(.869 .022 252.894);--color-slate-400: oklch(.704 .04 256.788);--color-slate-500: oklch(.554 .046 257.417);--color-slate-600: oklch(.446 .043 257.281);--color-slate-700: oklch(.372 .044 257.287);--color-slate-800: oklch(.279 .041 260.031);--color-white: #fff;--spacing: .25rem;--container-md: 28rem;--container-5xl: 64rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--font-weight-normal: 400;--font-weight-medium: 500;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-font-feature-settings: var(--font-sans--font-feature-settings);--default-font-variation-settings: var(--font-sans--font-variation-settings);--default-mono-font-family: var(--font-mono);--default-mono-font-feature-settings: var(--font-mono--font-feature-settings);--default-mono-font-variation-settings: var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:currentColor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--background);color:var(--foreground)}*{border-color:var(--border);outline-color:var(--ring)}@supports (color: color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-size:var(--text-2xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-size:var(--text-xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-size:var(--text-lg);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-1\\/2{top:50%}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-auto{margin-inline:auto}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-full{width:100%}.max-w-5xl{max-width:var(--container-5xl)}.max-w-md{max-width:var(--container-md)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.translate-x-1{--tw-translate-x: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x: calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.grid-rows-8{grid-template-rows:repeat(8,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-600{border-color:var(--color-blue-600)}.border-green-200{border-color:var(--color-green-200)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-transparent{border-color:#0000}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-600{background-color:var(--color-green-600)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-7{padding-left:calc(var(--spacing) * 7)}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-red-500{color:var(--color-red-500)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-white{color:var(--color-white)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}@media(hover:hover){.hover\\:bg-blue-50:hover{background-color:var(--color-blue-50)}}@media(hover:hover){.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}}@media(hover:hover){.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}}@media(hover:hover){.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}}@media(hover:hover){.hover\\:text-slate-600:hover{color:var(--color-slate-600)}}@media(hover:hover){.hover\\:text-slate-800:hover{color:var(--color-slate-800)}}@media(hover:hover){.hover\\:underline:hover{text-decoration-line:underline}}.focus\\:ring-2:focus{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500:focus{--tw-ring-color: var(--color-blue-500)}.focus\\:outline-none:focus{--tw-outline-style: none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-slate-300:disabled{background-color:var(--color-slate-300)}}:root,:host{--font-size: 16px;--background: #fff;--foreground: oklch(.145 0 0);--card: #fff;--card-foreground: oklch(.145 0 0);--popover: oklch(1 0 0);--popover-foreground: oklch(.145 0 0);--primary: #030213;--primary-foreground: oklch(1 0 0);--secondary: oklch(.95 .0058 264.53);--secondary-foreground: #030213;--muted: #ececf0;--muted-foreground: #717182;--accent: #e9ebef;--accent-foreground: #030213;--destructive: #d4183d;--destructive-foreground: #fff;--border: #0000001a;--input: transparent;--input-background: #f3f3f5;--switch-background: #cbced4;--font-weight-medium: 500;--font-weight-normal: 400;--ring: oklch(.708 0 0);--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08);--radius: .625rem;--sidebar: oklch(.985 0 0);--sidebar-foreground: oklch(.145 0 0);--sidebar-primary: #030213;--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.97 0 0);--sidebar-accent-foreground: oklch(.205 0 0);--sidebar-border: oklch(.922 0 0);--sidebar-ring: oklch(.708 0 0)}.dark{--background: oklch(.145 0 0);--foreground: oklch(.985 0 0);--card: oklch(.145 0 0);--card-foreground: oklch(.985 0 0);--popover: oklch(.145 0 0);--popover-foreground: oklch(.985 0 0);--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--secondary: oklch(.269 0 0);--secondary-foreground: oklch(.985 0 0);--muted: oklch(.269 0 0);--muted-foreground: oklch(.708 0 0);--accent: oklch(.269 0 0);--accent-foreground: oklch(.985 0 0);--destructive: oklch(.396 .141 25.723);--destructive-foreground: oklch(.637 .237 25.331);--border: oklch(.269 0 0);--input: oklch(.269 0 0);--ring: oklch(.439 0 0);--font-weight-medium: 500;--font-weight-normal: 400;--chart-1: oklch(.488 .243 264.376);--chart-2: oklch(.696 .17 162.48);--chart-3: oklch(.769 .188 70.08);--chart-4: oklch(.627 .265 303.9);--chart-5: oklch(.645 .246 16.439);--sidebar: oklch(.205 0 0);--sidebar-foreground: oklch(.985 0 0);--sidebar-primary: oklch(.488 .243 264.376);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.269 0 0);--sidebar-accent-foreground: oklch(.985 0 0);--sidebar-border: oklch(.269 0 0);--sidebar-ring: oklch(.439 0 0)}html{font-size:var(--font-size);font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-rotate-x{syntax: "*"; inherits: false; initial-value: rotateX(0);}@property --tw-rotate-y{syntax: "*"; inherits: false; initial-value: rotateY(0);}@property --tw-rotate-z{syntax: "*"; inherits: false; initial-value: rotateZ(0);}@property --tw-skew-x{syntax: "*"; inherits: false; initial-value: skewX(0);}@property --tw-skew-y{syntax: "*"; inherits: false; initial-value: skewY(0);}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false}@property --tw-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false}@property --tw-inset-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false}@property --tw-ring-offset-width{syntax: ""; inherits: false; initial-value: 0;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}:root,:host{--ddn-bg: #f8fafc;--ddn-surface: #ffffff;--ddn-surface-muted: #f1f5f9;--ddn-border: #e2e8f0;--ddn-border-strong: #cbd5e1;--ddn-text-primary: #0f172a;--ddn-text-secondary: #475569;--ddn-text-muted: #64748b;--ddn-primary: #2563eb;--ddn-primary-strong: #1d4ed8;--ddn-input-bg: #ffffff;--ddn-disabled-bg: #e2e8f0;--ddn-disabled-text: #94a3b8;--ddn-divider: #e2e8f0;--ddn-spinner: #94a3b8}[data-darkmode=true],:host([data-darkmode="true"]){--ddn-bg: #0f172a;--ddn-surface: #111827;--ddn-surface-muted: #1f2937;--ddn-border: #334155;--ddn-border-strong: #475569;--ddn-text-primary: #e5e7eb;--ddn-text-secondary: #cbd5e1;--ddn-text-muted: #94a3b8;--ddn-primary: #3b82f6;--ddn-primary-strong: #2563eb;--ddn-input-bg: #0b1220;--ddn-disabled-bg: #1f2937;--ddn-disabled-text: #64748b;--ddn-divider: #1f2937;--ddn-spinner: #cbd5e1}[data-darkmode=true],:host([data-darkmode="true"]){color:var(--ddn-text-primary)}[data-darkmode=true] .bg-slate-50,:host([data-darkmode="true"]) .bg-slate-50{background-color:var(--ddn-bg)!important}[data-darkmode=true] .bg-white,:host([data-darkmode="true"]) .bg-white{background-color:var(--ddn-surface)!important;color:var(--ddn-text-primary)}[data-darkmode=true] .border-slate-200,:host([data-darkmode="true"]) .border-slate-200,[data-darkmode=true] .border-slate-100,:host([data-darkmode="true"]) .border-slate-100{border-color:var(--ddn-border)!important}[data-darkmode=true] .border-slate-300,:host([data-darkmode="true"]) .border-slate-300{border-color:var(--ddn-border-strong)!important}[data-darkmode=true] .text-slate-800,:host([data-darkmode="true"]) .text-slate-800,[data-darkmode=true] .text-slate-700,:host([data-darkmode="true"]) .text-slate-700{color:var(--ddn-text-primary)!important}[data-darkmode=true] .text-slate-600,:host([data-darkmode="true"]) .text-slate-600,[data-darkmode=true] .text-slate-500,:host([data-darkmode="true"]) .text-slate-500{color:var(--ddn-text-secondary)!important}[data-darkmode=true] .text-slate-400,:host([data-darkmode="true"]) .text-slate-400{color:var(--ddn-text-muted)!important}[data-darkmode=true] .bg-blue-50,:host([data-darkmode="true"]) .bg-blue-50{background-color:#2563eb1f!important;color:var(--ddn-text-primary)}[data-darkmode=true] .bg-emerald-50,:host([data-darkmode="true"]) .bg-emerald-50{background-color:#10b98124!important;color:var(--ddn-text-primary)}[data-darkmode=true] .bg-red-50,:host([data-darkmode="true"]) .bg-red-50{background-color:#f871711f!important;color:var(--ddn-text-primary)}[data-darkmode=true] .border-b,:host([data-darkmode="true"]) .border-b{border-color:var(--ddn-divider)!important}[data-darkmode=true] input,:host([data-darkmode="true"]) input,[data-darkmode=true] select,:host([data-darkmode="true"]) select,[data-darkmode=true] textarea,:host([data-darkmode="true"]) textarea{background-color:var(--ddn-input-bg);color:var(--ddn-text-primary)}[data-darkmode=true] .animate-spin,:host([data-darkmode="true"]) .animate-spin{border-color:var(--ddn-spinner)!important}',Nf=".ddnsto-host{padding:16px 20px;background-color:#f8fafc;border-radius:16px;overflow:hidden}.ddnsto-host[data-darkmode=true]{background-color:#0b1220}.ddnsto-host #app{display:block}",jf='.ddnsto-toggle-container{display:inline-flex;align-items:center}.ddnsto-toggle-switch{position:relative;display:inline-block;width:44px;height:22px;cursor:pointer}.ddnsto-toggle-switch input{opacity:0;width:0;height:0;position:absolute;inset:0;margin:0}.ddnsto-toggle-slider{position:absolute;cursor:pointer;inset:0;background-color:#e5e7eb;transition:.2s ease;border-radius:22px;border:1px solid #cbd5e1;box-shadow:0 1px 2px #0000000a inset}.ddnsto-toggle-slider:before{position:absolute;content:"";height:16px;width:16px;left:2px;top:2px;background-color:#fff;transition:.2s ease;border-radius:50%;box-shadow:0 1px 2px #0003}.ddnsto-toggle-switch input:checked+.ddnsto-toggle-slider{background-color:#3b82f6;border-color:#3b82f6}.ddnsto-toggle-switch input:checked+.ddnsto-toggle-slider:before{transform:translate(22px)}.ddnsto-toggle-switch input:focus-visible+.ddnsto-toggle-slider{box-shadow:0 0 0 3px #3b82f640}.ddnsto-toggle-switch input:disabled+.ddnsto-toggle-slider{opacity:.6;cursor:not-allowed}',zf=".ddnsto-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.625rem 1.25rem;border-radius:.5rem;border:1px solid transparent;font-size:.875rem;font-weight:600;line-height:1.2;text-decoration:none;cursor:pointer;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease,border-color .15s ease;user-select:none}.ddnsto-btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.ddnsto-btn-primary{background-color:var(--ddn-primary);color:#fff;border-color:var(--ddn-primary-strong);box-shadow:0 1px 2px #00000014}.ddnsto-btn-primary:hover:not(:disabled){background-color:var(--ddn-primary-strong)}.ddnsto-btn-primary:active:not(:disabled){background-color:#1e3a8a}.ddnsto-btn:disabled,.ddnsto-btn[aria-disabled=true]{background-color:var(--ddn-disabled-bg);border-color:var(--ddn-border);color:var(--ddn-disabled-text);cursor:not-allowed;box-shadow:none}.ddnsto-btn-icon{width:1rem;height:1rem}",Pf="ddnsto-theme",Tf=y=>{const E=y.match(/\d+/g);if(E&&E.length>=3)return{r:parseInt(E[0],10),g:parseInt(E[1],10),b:parseInt(E[2],10)};if(y.startsWith("#")){const d=y.replace("#","");if(d.length===3)return{r:parseInt(d[0]+d[0],16),g:parseInt(d[1]+d[1],16),b:parseInt(d[2]+d[2],16)};if(d.length===6)return{r:parseInt(d.slice(0,2),16),g:parseInt(d.slice(2,4),16),b:parseInt(d.slice(4,6),16)}}return null},Rf=()=>{try{const y=localStorage.getItem(Pf);if(y==="dark"||y==="light")return y}catch{}if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";try{const y=getComputedStyle(document.body).backgroundColor,E=Tf(y);if(E)return .2126*E.r+.7152*E.g+.0722*E.b<128?"dark":"light"}catch{}return"light"},bl=(y,E)=>{y&&(E==="dark"?y.setAttribute("data-darkmode","true"):y.removeAttribute("data-darkmode"))},jr={token:"",prefix:"",api_base:"/cgi-bin/luci",lang:"zh-cn",onboarding_base:"https://web.ddnsto.com/openwrt-bind"},zr=typeof window<"u"&&window.ddnstoConfig||{},Lf={token:zr.token??jr.token,prefix:zr.prefix??jr.prefix,api_base:zr.api_base??jr.api_base,lang:zr.lang??jr.lang,onboarding_base:zr.onboarding_base??jr.onboarding_base},gt=document.getElementById("root")||document.getElementById("app"),If=()=>{if(!document.head.querySelector("style[data-ddnsto-host]")){const y=document.createElement("style");y.setAttribute("data-ddnsto-host","true"),y.textContent=Nf,document.head.appendChild(y)}},Mf=gt?.hasAttribute("data-ddnsto-shadow")||gt?.dataset.shadow==="true";let Ui=gt;const Ul=typeof window<"u"?Rf():"light";if(gt){If();const y=`${Cf} + */const vf=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Vu=Gt("smartphone",vf);function yf(){return m.jsx("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:m.jsx("div",{className:"flex items-start",children:m.jsxs("div",{className:"flex-1",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[m.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center",children:m.jsx(Bu,{className:"w-6 h-6 text-blue-600"})}),m.jsx("h2",{className:"text-slate-800",children:"DDNSTO 远程访问"})]}),m.jsx("p",{className:"text-slate-600 text-sm mb-2",children:"DDNSTO 远程访问,不需要公网 IP、不需要开放端口。只需一个链接,即可从任何地方安全访问您的 NAS、路由器和桌面。"}),m.jsxs("a",{href:"https://www.ddnsto.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:underline",children:["了解更多",m.jsx(Al,{className:"w-3 h-3"})]})]})})})}function wf({isRunning:y,isConfigured:E,hostname:d,address:U,deviceId:T,version:L,featEnabled:B,tunnelOk:G,onRefreshStatus:A}){const[Q,Z]=C.useState(!1),W={label:y?"运行中":"已停止",bgColor:y?"bg-green-100":"bg-slate-200",textColor:y?"text-green-700":"text-slate-600"},H=U&&U.trim().length>0?U:"未配置",q=Q,ae=G===!0,V=q?"检查中...":G===!0?"正常":G===!1?"无法连接服务器":"未知",Y=B==="1"||B===!0?"已开启":"未开启",we=T||"-",ze=async()=>{if(A){Z(!0);try{await A()}finally{Z(!1)}}};return m.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[m.jsx("h3",{className:"text-slate-800 mb-4",children:"运行状态"}),m.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-slate-100",children:[m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${W.bgColor} ${W.textColor}`,children:W.label}),E&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-sm text-slate-500",children:"远程访问域名:"}),U&&U.trim().length>0?m.jsxs("a",{href:H,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:underline flex items-center gap-1",children:[H,m.jsx(Al,{className:"w-3 h-3"})]}):m.jsx("span",{className:"text-sm text-slate-500",children:H})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsxs("button",{onClick:ze,className:"px-3 py-2 rounded-md text-blue-600 text-sm hover:bg-blue-50 transition-colors flex items-center gap-1",children:[m.jsx(hf,{className:"w-4 h-4"}),"刷新状态"]})})]}),m.jsx("div",{className:"mt-6",children:m.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[m.jsx(Bu,{className:"w-4 h-4 text-slate-400"}),q&&m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300 border-t-blue-600 animate-spin"}),m.jsxs("h4",{className:"text-sm text-slate-700",children:["服务器连接:",ae?m.jsx("span",{className:"text-green-600",children:V}):m.jsx("span",{children:V}),"| 设备 ID:",we," | 拓展功能:",Y,L?` | 版本:${L}`:""]})]})})]})}function Qu({checked:y,onChange:E,label:d,id:U,disabled:T,containerClassName:L,...B}){return m.jsxs("div",{className:`ddnsto-toggle-container ${L||""}`,children:[d&&m.jsx("label",{htmlFor:U,className:"text-sm text-slate-700 mr-3 whitespace-nowrap",children:d}),m.jsxs("label",{className:"ddnsto-toggle-switch","aria-label":d||"toggle",children:[m.jsx("input",{id:U,type:"checkbox",checked:y,disabled:T,onChange:G=>E(G.target.checked),...B}),m.jsx("span",{className:"ddnsto-toggle-slider","aria-hidden":!0})]})]})}function kf({onSave:y,isInTab:E,token:d,enabled:U,advancedConfig:T,onRegisterSave:L,onTokenChange:B,onEnabledChange:G}){const[A,Q]=C.useState(d||""),[Z,W]=C.useState(U);C.useEffect(()=>{Q(d||"")},[d]),C.useEffect(()=>{W(U)},[T,U]);const H=()=>{A.trim()&&y(A,Z?"1":"0",T)};return C.useEffect(()=>{L&&L(()=>H())},[L,A,Z,T]),m.jsxs("div",{className:E?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!E&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"text-slate-800 mb-2",children:"手动配置"}),m.jsx("p",{className:"text-xs text-slate-400 mb-6",children:"如果您已经在 DDNSTO 控制台获取了令牌,可以直接在此填写并启动插件。"})]}),m.jsxs("div",{className:"space-y-5",children:[m.jsx("div",{className:"pb-4",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h4",{className:"text-sm text-slate-700",children:"启用 DDNSTO"}),m.jsx(Qu,{checked:Z,onChange:q=>{W(q),G?.(q)},"aria-label":"启用 DDNSTO",containerClassName:"ml-6"})]})}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsxs("label",{className:"text-sm text-slate-700",children:["用户令牌(Token) ",m.jsx("span",{className:"text-red-500",children:"*"})]}),m.jsxs("a",{href:"https://www.ddnsto.com/docs/guide/token.html",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 hover:underline flex items-center gap-1",children:["如何查看用户令牌",m.jsx(Al,{className:"w-3 h-3"})]})]}),m.jsx("div",{className:"relative",children:m.jsx("input",{type:"text",value:A,onChange:q=>{Q(q.target.value),B?.(q.target.value)},placeholder:"请输入您的 DDNSTO 令牌",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})}),m.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"令牌将保存在路由器本地,请勿泄露。"})]})]})]})}function xf({token:y,enabled:E,advancedConfig:d,onSave:U,isInTab:T,onRegisterSave:L}){const[B,G]=C.useState(d.feat_enabled==="1"),A=K=>K.feat_disk_path_selected?K.feat_disk_path_selected:K.mounts&&K.mounts.length>0?K.mounts[0]:"",[Q,Z]=C.useState(A(d)),[W,H]=C.useState(d.feat_port||"3033"),[q,ae]=C.useState(d.feat_username||"ddnsto"),[V,Y]=C.useState(d.feat_password||""),[we,ze]=C.useState(!1),[ke,fe]=C.useState(d.index||"");C.useEffect(()=>{G(d.feat_enabled==="1"),Z(A(d)),d.feat_port&&H(d.feat_port),d.feat_username&&ae(d.feat_username),d.feat_password&&Y(d.feat_password),d.index!==void 0&&fe(d.index)},[d]);const Ce=()=>{U(y,E?"1":"0",{feat_enabled:B?"1":"0",feat_port:W,feat_username:q,feat_password:V,feat_disk_path_selected:Q,mounts:d.mounts,index:ke})};return C.useEffect(()=>{L&&L(()=>Ce())},[L,y,E,B,Q,W,q,V,ke,d.mounts]),m.jsxs("div",{className:T?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!T&&m.jsx("h3",{className:"text-slate-800 mb-4",children:"高级功能"}),m.jsxs("div",{className:"space-y-5",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-700 mb-2",children:"设备编号(可选)"}),m.jsx("input",{type:"text",value:ke,onChange:K=>fe(K.target.value),placeholder:"",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),m.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"如有多台设备id重复,请修改此编号(0~100),正常情况不需要修改"})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h4",{className:"text-sm text-slate-700",children:"启用拓展功能"}),m.jsx(Qu,{checked:B,onChange:K=>G(K),"aria-label":"启用拓展功能",containerClassName:"ml-6"})]}),m.jsxs("div",{className:"flex items-center gap-2 -mt-2",children:[m.jsx("p",{className:"text-xs text-slate-400",children:"启用后可支持控制台的「文件管理」及「远程开机」功能"}),m.jsxs("a",{href:"https://www.ddnsto.com/docs/guide/advanced.html",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 hover:underline flex items-center gap-1 whitespace-nowrap",children:["查看教程",m.jsx(Al,{className:"w-3 h-3"})]})]}),B&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(ff,{className:"w-4 h-4 text-slate-600"}),m.jsx("h5",{className:"text-sm text-slate-700",children:"WebDAV 服务配置"})]}),m.jsxs("div",{className:"space-y-4 pl-6",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"可访问的文件目录"}),m.jsx("select",{value:Q,onChange:K=>Z(K.target.value),className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white",children:d.mounts&&d.mounts.length>0?d.mounts.map(K=>m.jsx("option",{value:K,children:K},K)):m.jsx("option",{value:"",disabled:!0,children:"未检测到挂载点"})}),m.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"控制台上的文件管理将只能看到此目录及其子目录。"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"服务端口"}),m.jsx("input",{type:"text",value:W,onChange:K=>H(K.target.value),placeholder:"3033",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"授权用户名"}),m.jsx("input",{type:"text",value:q,onChange:K=>ae(K.target.value),placeholder:"ddnsto",className:"w-full px-3 py-2 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm text-slate-600 mb-2",children:"授权用户密码"}),m.jsxs("div",{className:"relative",children:[m.jsx("input",{type:we?"text":"password",value:V,onChange:K=>Y(K.target.value),placeholder:"设置访问密码",className:"w-full px-3 py-2 pr-10 border border-slate-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),m.jsx("button",{type:"button",onClick:()=>ze(!we),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:we?m.jsx(sf,{className:"w-4 h-4"}):m.jsx(cf,{className:"w-4 h-4"})})]})]})]})]})]})]})}function Sf({ddnstoToken:y,ddnstoEnabled:E,advancedConfig:d,onSave:U,saveBanner:T}){const[L,B]=C.useState("basic"),G=C.useRef(null),A=C.useRef(),Q=C.useRef(),[Z,W]=C.useState(y||""),[H,q]=C.useState(E==="1");C.useEffect(()=>{W(y||"")},[y]),C.useEffect(()=>{q(E==="1")},[E]);const ae=()=>{L==="basic"?A.current?.():Q.current?.()};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 mb-4",children:[m.jsx("div",{className:"border-b border-slate-200 px-6",children:m.jsx("div",{className:"flex items-center justify-between",children:m.jsxs("div",{className:"flex items-center -mb-px",children:[m.jsx("button",{onClick:()=>B("basic"),className:`px-4 py-4 text-sm border-b-2 transition-colors ${L==="basic"?"border-blue-600 text-blue-600":"border-transparent text-slate-600 hover:text-slate-800"}`,children:"基础配置"}),m.jsx("button",{onClick:()=>B("advanced"),className:`px-4 py-4 text-sm border-b-2 transition-colors ${L==="advanced"?"border-blue-600 text-blue-600":"border-transparent text-slate-600 hover:text-slate-800"}`,children:"高级功能"})]})})}),m.jsxs("div",{ref:G,className:"p-6",children:[L==="basic"&&m.jsx(kf,{token:Z,enabled:H,advancedConfig:d,onSave:U,isInTab:!0,onRegisterSave:V=>{A.current=V},onTokenChange:W,onEnabledChange:q}),L==="advanced"&&m.jsx(xf,{token:Z,enabled:H,advancedConfig:d,onSave:U,isInTab:!0,onRegisterSave:V=>{Q.current=V}})]})]}),m.jsx("div",{className:"flex justify-end gap-3 mt-4",children:m.jsxs("button",{onClick:ae,disabled:!Z.trim(),className:"ddnsto-btn ddnsto-btn-primary",children:[m.jsx(gf,{className:"ddnsto-btn-icon"}),"保存配置并应用"]})}),T.state!=="idle"&&m.jsxs("div",{className:["mt-2 rounded-md border px-3 py-2 text-sm",T.state==="loading"?"bg-blue-50 border-blue-200 text-blue-800":"",T.state==="success"?"bg-emerald-50 border-emerald-200 text-emerald-800":"",T.state==="error"?"bg-red-50 border-red-200 text-red-800":""].join(" "),children:[m.jsx("div",{className:"font-medium",children:T.message}),T.description&&m.jsx("div",{className:"text-xs mt-1 opacity-80 break-words",children:T.description})]})]})}const bn={auth:0,starting:1,binding:2,domain:3,checking:4};function _f({apiBase:y,csrfToken:E,deviceId:d,onboardingBase:U,onComplete:T,onRefreshStatus:L,isInTab:B}){const[G,A]=C.useState(!1),[Q,Z]=C.useState(U||"https://www.kooldns.cn/bind"),[W,H]=C.useState(`${U||"https://www.kooldns.cn/bind"}/#/auth?send=1&source=openwrt&callback=*`),[q,ae]=C.useState("auth"),[V,Y]=C.useState(d||""),[we,ze]=C.useState(""),[ke,fe]=C.useState(""),[Ce,K]=C.useState(!1),[Re,he]=C.useState(null),xe=C.useRef("auth"),ue=E||(typeof window<"u"?window.ddnstoCsrfToken:""),Qe=C.useCallback(g=>{ae(u=>bn[g]>bn[u]?g:u)},[]);C.useEffect(()=>{xe.current=q},[q]),C.useEffect(()=>{console.log("Onboarding iframe url:",W)},[W]);const Le=C.useCallback(()=>{ae("auth"),ze(""),fe(""),he(null),Y(d||""),H(`${Q}/#/auth?send=1&source=openwrt&callback=*`)},[Qe,d,Q]);C.useEffect(()=>{const g="/#/auth?send=1&source=openwrt&callback=*",u=U||"https://www.kooldns.cn/bind";Z(u),H(`${u}${g}`)},[U]),C.useEffect(()=>{Y(d||"")},[d]);const me=C.useCallback(async()=>{for(let v=0;v<20;v+=1){const M=await fetch(`${y}/admin/services/ddnsto/api/status`,{credentials:"same-origin"});if(M.ok){const X=(await M.json())?.data||{},O=X.deviceId||X.device_id||"";if(O&&Y(O),X.running)return{running:!0,deviceId:O}}await new Promise(b=>setTimeout(b,2e3))}throw new Error("ddnsto not running")},[y]),ge=C.useCallback(async g=>{const u={url:g};ue&&(u.token=ue);const v=await fetch(`${y}/admin/services/ddnsto/api/onboarding/address`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",...ue?{"X-LuCI-Token":ue}:{}},body:JSON.stringify(u)});if(!v.ok)throw new Error(`HTTP ${v.status}`);const M=await v.json();if(!M?.ok)throw new Error(M?.error||"save address failed")},[y,ue]),Ie=C.useCallback(async(g,u)=>{K(!0),he(null);const v=V||d||"",M=`${Q}/#/bind?status=starting&token=${encodeURIComponent(g)}&sign=${encodeURIComponent(u)}${v?`&routerId=${encodeURIComponent(v)}`:""}`;H(M),Qe("starting");try{const b=await fetch(`${y}/admin/services/ddnsto/api/onboarding/start`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",...ue?{"X-LuCI-Token":ue}:{}},body:JSON.stringify({token:g})});if(!b.ok)throw new Error(`HTTP ${b.status}`);const X=await b.json();if(!X?.ok)throw new Error(X?.error||"start failed");L&&await L();const re=(await me())?.deviceId||V||d||"";if(bn[xe.current]>=bn.domain)return;const ee=`${Q}/#/bind?status=starting&routerId=${encodeURIComponent(re)}&token=${encodeURIComponent(g)}&sign=${encodeURIComponent(u)}`;H(ee),Qe("binding"),Y(re)}catch{he("启动失败,请稍后重试")}finally{K(!1)}},[Qe,y,d,ue,Q,L,me,Le,V]),Ne=C.useCallback(g=>{const u=g||V;if(!we||!ke||!u)return;const v=`${Q}/#/domain?sign=${encodeURIComponent(ke)}&token=${encodeURIComponent(we)}&routerId=${encodeURIComponent(u)}&netaddr=127.0.0.1&source=openwrt`;H(v),ae("domain")},[ke,we,Q,V]),ie=C.useCallback(async g=>{H(`${Q}/#/check?url=${encodeURIComponent(g)}`),ae("checking"),T();try{await ge(g),L&&await L()}catch{he("保存域名失败,请重试")}},[Q,T,L,ge]),x=C.useCallback(()=>{A(!0),Le()},[Le]);C.useEffect(()=>{const g=u=>{if(!G)return;console.log("Onboarding message:",u.data);const v=u.data;let M=v;if(typeof v=="string")try{M=JSON.parse(v)}catch{return}if(!M||typeof M!="object")return;const b=M.data,O=b&&typeof b=="object"?b:M;if((typeof O.auth=="string"?O.auth:"")!=="ddnsto")return;const ee=typeof O.sign=="string"?O.sign:"",oe=typeof O.token=="string"?O.token:"",Ue=typeof O.step=="string"?O.step:"",fn=typeof O.status=="string"?O.status:"",Un=typeof O.url=="string"?O.url:"",Tt=O.success,An=typeof Tt=="number"?Tt:Number(Tt);if(ee&&oe&&q==="auth"&&!Ce){ze(oe),fe(ee),Ie(oe,ee);return}if(Ue==="bind"&&fn==="success"){const Zt=typeof O.router_uid=="string"?O.router_uid:V;Zt&&Y(Zt),Ne(Zt);return}Ue==="domain"&&Un&&An===0&&bn[xe.current]window.removeEventListener("message",g)},[Ne,ie,Ce,Ie,G,q]);const I=()=>m.jsx("div",{className:"flex items-center justify-between mb-6",children:m.jsx("h3",{className:"text-slate-800",children:"快速向导"})});return G?m.jsxs("div",{className:B?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!B&&I(),m.jsx("div",{className:"rounded-lg border border-slate-200 overflow-hidden",children:m.jsx("iframe",{src:W,title:"快速向导",className:"w-full",style:{width:"100%",height:"70vh",maxHeight:"400px",border:0},loading:"lazy"})})]}):m.jsxs("div",{className:B?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!B&&I(),m.jsxs("div",{className:"text-center py-8",children:[m.jsx("div",{className:"mb-4 flex justify-center",children:m.jsx("div",{className:"w-16 h-16 rounded-full bg-blue-50 flex items-center justify-center",children:m.jsx(Vu,{className:"w-8 h-8 text-blue-600"})})}),m.jsx("h4",{className:"text-slate-800 mb-2",children:"欢迎使用 DDNSTO!"}),m.jsx("p",{className:"text-sm text-slate-600 mb-6 max-w-md mx-auto",children:"通过微信扫码登录,我们将引导您完成插件配置"}),m.jsxs("button",{onClick:x,className:"ddnsto-btn ddnsto-btn-primary",children:[m.jsx(Vu,{className:"ddnsto-btn-icon"}),"开始配置"]})]})]})}function Ef({config:y}){const[E,d]=C.useState(!1),[U,T]=C.useState(!1),[L,B]=C.useState("OpenWrt"),[G,A]=C.useState(""),[Q,Z]=C.useState(""),[W,H]=C.useState(""),[q,ae]=C.useState(""),[V,Y]=C.useState("1"),[we,ze]=C.useState({feat_enabled:"0",feat_port:"",feat_username:"",feat_password:"",feat_disk_path_selected:"",mounts:[],index:""}),[,ke]=C.useState(null),[fe,Ce]=C.useState(null),[K,Re]=C.useState({state:"idle",message:""}),he=C.useRef(),xe=(y?.api_base||"/cgi-bin/luci").replace(/\/$/,""),ue=y?.token||"",Qe=(y?.onboarding_base||"https://www.kooldns.cn/bind").replace(/\/$/,""),Le=C.useCallback((x,I,g,u)=>{he.current&&window.clearTimeout(he.current),Re({state:x,message:I,description:g}),u&&(he.current=window.setTimeout(()=>{Re({state:"idle",message:""})},u))},[]);C.useEffect(()=>()=>{he.current&&window.clearTimeout(he.current)},[]);const me=C.useCallback(async()=>{try{const x=await fetch(`${xe}/admin/services/ddnsto/api/config`,{credentials:"same-origin"});if(!x.ok)throw new Error(`HTTP ${x.status}`);const g=(await x.json())?.data||{};g.address&&A(g.address),g.device_id!==void 0?Z(g.device_id):g.deviceId!==void 0&&Z(g.deviceId),g.version!==void 0&&H(g.version),g.token&&ae(g.token),g.enabled!==void 0&&Y(g.enabled),ze({feat_enabled:g.feat_enabled||"0",feat_port:g.feat_port||"",feat_username:g.feat_username||"",feat_password:g.feat_password||"",feat_disk_path_selected:g.feat_disk_path_selected||"",mounts:g.mounts||[],index:g.index||""})}catch(x){console.error("Failed to fetch ddnsto config",x)}},[xe]),ge=C.useCallback(async()=>{try{const x=await fetch(`${xe}/admin/services/ddnsto/api/status`,{credentials:"same-origin"});if(!x.ok)throw new Error(`HTTP ${x.status}`);const g=(await x.json())?.data||{};d(!!g.running),g.token_set&&T(!0),g.hostname&&B(g.hostname),g.device_id!==void 0?Z(g.device_id):g.deviceId!==void 0&&Z(g.deviceId),g.address&&A(g.address),g.version!==void 0&&H(g.version),ke(null)}catch(x){console.error("Failed to fetch ddnsto status",x),ke("无法获取运行状态")}},[xe]),Ie=C.useCallback(async()=>{try{const x=await fetch(`${xe}/admin/services/ddnsto/api/connectivity`,{credentials:"same-origin"});if(!x.ok)throw new Error(`HTTP ${x.status}`);const g=(await x.json())?.data||{};g.tunnel_ok!==void 0&&g.tunnel_ok!==null?Ce(g.tunnel_ok===!0):Ce(null)}catch(x){console.error("Failed to fetch ddnsto connectivity",x),Ce(null)}},[xe]),Ne=C.useCallback(async()=>{await me(),await ge(),await Ie()},[me,ge,Ie]),ie=C.useCallback(async(x,I,g)=>{Le("loading","正在保存配置...","正在将配置写入路由器,请稍候");try{const u=new URLSearchParams;ue&&u.append("token",ue),u.append("ddnsto_token",x),u.append("enabled",I),u.append("feat_enabled",g.feat_enabled),u.append("feat_port",g.feat_port),u.append("feat_username",g.feat_username),u.append("feat_password",g.feat_password),u.append("feat_disk_path_selected",g.feat_disk_path_selected),u.append("index",g.index||"");const v=await fetch(`${xe}/admin/services/ddnsto/api/config`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",...ue?{"X-LuCI-Token":ue}:{}},body:u});if(!v.ok)throw new Error(`HTTP ${v.status}`);const M=await v.json();if(!M?.ok)throw new Error(M?.error||"Save failed");Le("success","配置已保存并生效",void 0,3e3),T(!0),await me(),await ge()}catch(u){console.error("Failed to save config",u);const v=u instanceof Error?u.message:String(u);Le("error","保存失败,请重试",v,4e3)}},[xe,ue,me,ge]);return C.useEffect(()=>{me(),ge(),Ie()},[me,ge,Ie]),C.useEffect(()=>{const x=window.setInterval(ge,5e3);return()=>{window.clearInterval(x)}},[ge]),m.jsx("div",{className:"min-h-screen bg-slate-50",children:m.jsx("main",{children:m.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-8",children:[m.jsx(yf,{}),m.jsx(wf,{isRunning:E,isConfigured:U,hostname:L,address:G,deviceId:Q,version:W,featEnabled:we.feat_enabled,tunnelOk:fe,onRefreshStatus:Ne}),m.jsx(_f,{apiBase:xe,csrfToken:ue,deviceId:Q,onboardingBase:Qe,onRefreshStatus:Ne,onComplete:()=>T(!0)}),m.jsx(Sf,{ddnstoToken:q,ddnstoEnabled:V,advancedConfig:we,onSave:ie,saveBanner:K})]})})})}const Cf='/*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */*,:before,:after,::backdrop{--tw-border-style: solid}@layer properties{@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-rotate-x: rotateX(0);--tw-rotate-y: rotateY(0);--tw-rotate-z: rotateZ(0);--tw-skew-x: skewX(0);--tw-skew-y: skewY(0);--tw-space-y-reverse: 0;--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500: oklch(.637 .237 25.331);--color-amber-50: oklch(.987 .022 95.277);--color-amber-200: oklch(.924 .12 95.746);--color-amber-600: oklch(.666 .179 58.318);--color-green-50: oklch(.982 .018 155.826);--color-green-100: oklch(.962 .044 156.743);--color-green-200: oklch(.925 .084 155.995);--color-green-600: oklch(.627 .194 149.214);--color-green-700: oklch(.527 .154 150.069);--color-green-800: oklch(.448 .119 151.328);--color-blue-50: oklch(.97 .014 254.604);--color-blue-200: oklch(.882 .059 254.128);--color-blue-500: oklch(.623 .214 259.815);--color-blue-600: oklch(.546 .245 262.881);--color-blue-700: oklch(.488 .243 264.376);--color-slate-50: oklch(.984 .003 247.858);--color-slate-100: oklch(.968 .007 247.896);--color-slate-200: oklch(.929 .013 255.508);--color-slate-300: oklch(.869 .022 252.894);--color-slate-400: oklch(.704 .04 256.788);--color-slate-500: oklch(.554 .046 257.417);--color-slate-600: oklch(.446 .043 257.281);--color-slate-700: oklch(.372 .044 257.287);--color-slate-800: oklch(.279 .041 260.031);--color-white: #fff;--spacing: .25rem;--container-md: 28rem;--container-5xl: 64rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--font-weight-normal: 400;--font-weight-medium: 500;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-font-feature-settings: var(--font-sans--font-feature-settings);--default-font-variation-settings: var(--font-sans--font-variation-settings);--default-mono-font-family: var(--font-mono);--default-mono-font-feature-settings: var(--font-mono--font-feature-settings);--default-mono-font-variation-settings: var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:currentColor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--background);color:var(--foreground)}*{border-color:var(--border);outline-color:var(--ring)}@supports (color: color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-size:var(--text-2xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-size:var(--text-xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-size:var(--text-lg);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-1\\/2{top:50%}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-auto{margin-inline:auto}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-full{width:100%}.max-w-5xl{max-width:var(--container-5xl)}.max-w-md{max-width:var(--container-md)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.translate-x-1{--tw-translate-x: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x: calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.grid-rows-8{grid-template-rows:repeat(8,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-600{border-color:var(--color-blue-600)}.border-green-200{border-color:var(--color-green-200)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-transparent{border-color:#0000}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-600{background-color:var(--color-green-600)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-7{padding-left:calc(var(--spacing) * 7)}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-red-500{color:var(--color-red-500)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-white{color:var(--color-white)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}@media(hover:hover){.hover\\:bg-blue-50:hover{background-color:var(--color-blue-50)}}@media(hover:hover){.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}}@media(hover:hover){.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}}@media(hover:hover){.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}}@media(hover:hover){.hover\\:text-slate-600:hover{color:var(--color-slate-600)}}@media(hover:hover){.hover\\:text-slate-800:hover{color:var(--color-slate-800)}}@media(hover:hover){.hover\\:underline:hover{text-decoration-line:underline}}.focus\\:ring-2:focus{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500:focus{--tw-ring-color: var(--color-blue-500)}.focus\\:outline-none:focus{--tw-outline-style: none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-slate-300:disabled{background-color:var(--color-slate-300)}}:root,:host{--font-size: 16px;--background: #fff;--foreground: oklch(.145 0 0);--card: #fff;--card-foreground: oklch(.145 0 0);--popover: oklch(1 0 0);--popover-foreground: oklch(.145 0 0);--primary: #030213;--primary-foreground: oklch(1 0 0);--secondary: oklch(.95 .0058 264.53);--secondary-foreground: #030213;--muted: #ececf0;--muted-foreground: #717182;--accent: #e9ebef;--accent-foreground: #030213;--destructive: #d4183d;--destructive-foreground: #fff;--border: #0000001a;--input: transparent;--input-background: #f3f3f5;--switch-background: #cbced4;--font-weight-medium: 500;--font-weight-normal: 400;--ring: oklch(.708 0 0);--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08);--radius: .625rem;--sidebar: oklch(.985 0 0);--sidebar-foreground: oklch(.145 0 0);--sidebar-primary: #030213;--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.97 0 0);--sidebar-accent-foreground: oklch(.205 0 0);--sidebar-border: oklch(.922 0 0);--sidebar-ring: oklch(.708 0 0)}.dark{--background: oklch(.145 0 0);--foreground: oklch(.985 0 0);--card: oklch(.145 0 0);--card-foreground: oklch(.985 0 0);--popover: oklch(.145 0 0);--popover-foreground: oklch(.985 0 0);--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--secondary: oklch(.269 0 0);--secondary-foreground: oklch(.985 0 0);--muted: oklch(.269 0 0);--muted-foreground: oklch(.708 0 0);--accent: oklch(.269 0 0);--accent-foreground: oklch(.985 0 0);--destructive: oklch(.396 .141 25.723);--destructive-foreground: oklch(.637 .237 25.331);--border: oklch(.269 0 0);--input: oklch(.269 0 0);--ring: oklch(.439 0 0);--font-weight-medium: 500;--font-weight-normal: 400;--chart-1: oklch(.488 .243 264.376);--chart-2: oklch(.696 .17 162.48);--chart-3: oklch(.769 .188 70.08);--chart-4: oklch(.627 .265 303.9);--chart-5: oklch(.645 .246 16.439);--sidebar: oklch(.205 0 0);--sidebar-foreground: oklch(.985 0 0);--sidebar-primary: oklch(.488 .243 264.376);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.269 0 0);--sidebar-accent-foreground: oklch(.985 0 0);--sidebar-border: oklch(.269 0 0);--sidebar-ring: oklch(.439 0 0)}html{font-size:var(--font-size);font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-rotate-x{syntax: "*"; inherits: false; initial-value: rotateX(0);}@property --tw-rotate-y{syntax: "*"; inherits: false; initial-value: rotateY(0);}@property --tw-rotate-z{syntax: "*"; inherits: false; initial-value: rotateZ(0);}@property --tw-skew-x{syntax: "*"; inherits: false; initial-value: skewX(0);}@property --tw-skew-y{syntax: "*"; inherits: false; initial-value: skewY(0);}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false}@property --tw-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false}@property --tw-inset-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false}@property --tw-ring-offset-width{syntax: ""; inherits: false; initial-value: 0;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}:root,:host{--ddn-bg: #f8fafc;--ddn-surface: #ffffff;--ddn-surface-muted: #f1f5f9;--ddn-border: #e2e8f0;--ddn-border-strong: #cbd5e1;--ddn-text-primary: #0f172a;--ddn-text-secondary: #475569;--ddn-text-muted: #64748b;--ddn-primary: #2563eb;--ddn-primary-strong: #1d4ed8;--ddn-input-bg: #ffffff;--ddn-disabled-bg: #e2e8f0;--ddn-disabled-text: #94a3b8;--ddn-divider: #e2e8f0;--ddn-spinner: #94a3b8}[data-darkmode=true],:host([data-darkmode="true"]){--ddn-bg: #0f172a;--ddn-surface: #111827;--ddn-surface-muted: #1f2937;--ddn-border: #334155;--ddn-border-strong: #475569;--ddn-text-primary: #e5e7eb;--ddn-text-secondary: #cbd5e1;--ddn-text-muted: #94a3b8;--ddn-primary: #3b82f6;--ddn-primary-strong: #2563eb;--ddn-input-bg: #0b1220;--ddn-disabled-bg: #1f2937;--ddn-disabled-text: #64748b;--ddn-divider: #1f2937;--ddn-spinner: #cbd5e1}[data-darkmode=true],:host([data-darkmode="true"]){color:var(--ddn-text-primary)}[data-darkmode=true] .bg-slate-50,:host([data-darkmode="true"]) .bg-slate-50{background-color:var(--ddn-bg)!important}[data-darkmode=true] .bg-white,:host([data-darkmode="true"]) .bg-white{background-color:var(--ddn-surface)!important;color:var(--ddn-text-primary)}[data-darkmode=true] .border-slate-200,:host([data-darkmode="true"]) .border-slate-200,[data-darkmode=true] .border-slate-100,:host([data-darkmode="true"]) .border-slate-100{border-color:var(--ddn-border)!important}[data-darkmode=true] .border-slate-300,:host([data-darkmode="true"]) .border-slate-300{border-color:var(--ddn-border-strong)!important}[data-darkmode=true] .text-slate-800,:host([data-darkmode="true"]) .text-slate-800,[data-darkmode=true] .text-slate-700,:host([data-darkmode="true"]) .text-slate-700{color:var(--ddn-text-primary)!important}[data-darkmode=true] .text-slate-600,:host([data-darkmode="true"]) .text-slate-600,[data-darkmode=true] .text-slate-500,:host([data-darkmode="true"]) .text-slate-500{color:var(--ddn-text-secondary)!important}[data-darkmode=true] .text-slate-400,:host([data-darkmode="true"]) .text-slate-400{color:var(--ddn-text-muted)!important}[data-darkmode=true] .bg-blue-50,:host([data-darkmode="true"]) .bg-blue-50{background-color:#2563eb1f!important;color:var(--ddn-text-primary)}[data-darkmode=true] .bg-emerald-50,:host([data-darkmode="true"]) .bg-emerald-50{background-color:#10b98124!important;color:var(--ddn-text-primary)}[data-darkmode=true] .bg-red-50,:host([data-darkmode="true"]) .bg-red-50{background-color:#f871711f!important;color:var(--ddn-text-primary)}[data-darkmode=true] .border-b,:host([data-darkmode="true"]) .border-b{border-color:var(--ddn-divider)!important}[data-darkmode=true] input,:host([data-darkmode="true"]) input,[data-darkmode=true] select,:host([data-darkmode="true"]) select,[data-darkmode=true] textarea,:host([data-darkmode="true"]) textarea{background-color:var(--ddn-input-bg);color:var(--ddn-text-primary)}[data-darkmode=true] .animate-spin,:host([data-darkmode="true"]) .animate-spin{border-color:var(--ddn-spinner)!important}',Nf=".ddnsto-host{padding:16px 20px;background-color:#f8fafc;border-radius:16px;overflow:hidden}.ddnsto-host[data-darkmode=true]{background-color:#0b1220}.ddnsto-host #app{display:block}",jf='.ddnsto-toggle-container{display:inline-flex;align-items:center}.ddnsto-toggle-switch{position:relative;display:inline-block;width:44px;height:22px;cursor:pointer}.ddnsto-toggle-switch input{opacity:0;width:0;height:0;position:absolute;inset:0;margin:0}.ddnsto-toggle-slider{position:absolute;cursor:pointer;inset:0;background-color:#e5e7eb;transition:.2s ease;border-radius:22px;border:1px solid #cbd5e1;box-shadow:0 1px 2px #0000000a inset}.ddnsto-toggle-slider:before{position:absolute;content:"";height:16px;width:16px;left:2px;top:2px;background-color:#fff;transition:.2s ease;border-radius:50%;box-shadow:0 1px 2px #0003}.ddnsto-toggle-switch input:checked+.ddnsto-toggle-slider{background-color:#3b82f6;border-color:#3b82f6}.ddnsto-toggle-switch input:checked+.ddnsto-toggle-slider:before{transform:translate(22px)}.ddnsto-toggle-switch input:focus-visible+.ddnsto-toggle-slider{box-shadow:0 0 0 3px #3b82f640}.ddnsto-toggle-switch input:disabled+.ddnsto-toggle-slider{opacity:.6;cursor:not-allowed}',zf=".ddnsto-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.625rem 1.25rem;border-radius:.5rem;border:1px solid transparent;font-size:.875rem;font-weight:600;line-height:1.2;text-decoration:none;cursor:pointer;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease,border-color .15s ease;user-select:none}.ddnsto-btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.ddnsto-btn-primary{background-color:var(--ddn-primary);color:#fff;border-color:var(--ddn-primary-strong);box-shadow:0 1px 2px #00000014}.ddnsto-btn-primary:hover:not(:disabled){background-color:var(--ddn-primary-strong)}.ddnsto-btn-primary:active:not(:disabled){background-color:#1e3a8a}.ddnsto-btn:disabled,.ddnsto-btn[aria-disabled=true]{background-color:var(--ddn-disabled-bg);border-color:var(--ddn-border);color:var(--ddn-disabled-text);cursor:not-allowed;box-shadow:none}.ddnsto-btn-icon{width:1rem;height:1rem}",Pf="ddnsto-theme",Tf=y=>{const E=y.match(/\d+/g);if(E&&E.length>=3)return{r:parseInt(E[0],10),g:parseInt(E[1],10),b:parseInt(E[2],10)};if(y.startsWith("#")){const d=y.replace("#","");if(d.length===3)return{r:parseInt(d[0]+d[0],16),g:parseInt(d[1]+d[1],16),b:parseInt(d[2]+d[2],16)};if(d.length===6)return{r:parseInt(d.slice(0,2),16),g:parseInt(d.slice(2,4),16),b:parseInt(d.slice(4,6),16)}}return null},Rf=()=>{try{const y=localStorage.getItem(Pf);if(y==="dark"||y==="light")return y}catch{}if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";try{const y=getComputedStyle(document.body).backgroundColor,E=Tf(y);if(E)return .2126*E.r+.7152*E.g+.0722*E.b<128?"dark":"light"}catch{}return"light"},bl=(y,E)=>{y&&(E==="dark"?y.setAttribute("data-darkmode","true"):y.removeAttribute("data-darkmode"))},jr={token:"",prefix:"",api_base:"/cgi-bin/luci",lang:"zh-cn",onboarding_base:"https://web.ddnsto.com/openwrt-bind"},zr=typeof window<"u"&&window.ddnstoConfig||{},Lf={token:zr.token??jr.token,prefix:zr.prefix??jr.prefix,api_base:zr.api_base??jr.api_base,lang:zr.lang??jr.lang,onboarding_base:zr.onboarding_base??jr.onboarding_base},gt=document.getElementById("root")||document.getElementById("app"),If=()=>{if(!document.head.querySelector("style[data-ddnsto-host]")){const y=document.createElement("style");y.setAttribute("data-ddnsto-host","true"),y.textContent=Nf,document.head.appendChild(y)}},Mf=gt?.hasAttribute("data-ddnsto-shadow")||gt?.dataset.shadow==="true";let Ui=gt;const Ul=typeof window<"u"?Rf():"light";if(gt){If();const y=`${Cf} ${jf} ${zf}`;if(Mf&>.attachShadow){const E=gt.shadowRoot||gt.attachShadow({mode:"open"});if(!E.querySelector("style[data-ddnsto-style]")){const d=document.createElement("style");d.setAttribute("data-ddnsto-style","true"),d.textContent=y,E.appendChild(d)}Ui=E,bl(gt,Ul),bl(gt.parentElement,Ul)}else{if(!document.head.querySelector("style[data-ddnsto-style]")){const E=document.createElement("style");E.setAttribute("data-ddnsto-style","true"),E.textContent=y,document.head.appendChild(E)}bl(gt,Ul),bl(gt.parentElement,Ul)}Ui&&qd.createRoot(Ui).render(m.jsx(Kd.StrictMode,{children:m.jsx(Ef,{config:Lf})}))} diff --git a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/haproxy/js.htm b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/haproxy/js.htm index 9f43847976..5493b813fa 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/haproxy/js.htm +++ b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/haproxy/js.htm @@ -4,10 +4,12 @@ local api = require "luci.passwall.api" diff --git a/small/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm b/small/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm index dbe8aff219..5f3077a67a 100644 --- a/small/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm +++ b/small/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm @@ -1,6 +1,7 @@ <% local api = require "luci.passwall.api" -%> +
@@ -116,5 +136,97 @@ local api = require "luci.passwall.api" } ); } + + //分流规则添加拖拽排序 + (function () { + function initSortableForTable() { + var section = document.getElementById("cbi-<%=api.appname%>-shunt_rules"); + if (!section) return; + + // === 插入 drag handle === + var delBtns = section.getElementsByClassName("cbi-button-remove"); + for (var i = 0; i < delBtns.length; i++) { + var btn = delBtns[i]; + var parent = btn && btn.parentNode; + if (!parent || parent.getElementsByClassName("drag-handle").length) + continue; + var handle = document.createElement("span"); + handle.className = "drag-handle center"; + handle.title = "<%:Drag to reorder%>"; + handle.innerHTML = "⠿"; + parent.insertBefore(handle, btn.nextSibling); + } + + // === 初始化 Sortable === + var table = section.getElementsByTagName("table")[0]; + if (!table) return; + var root = table.tBodies[0] || table; + if (root._sortable_initialized) return root._sortable_instance; + root._sortable_initialized = true; + + // 保存原始顺序 + root._origOrder = getCurrentOrder(root); + + try { + root._sortable_instance = Sortable.create(root, { + handle: ".drag-handle", + draggable: "tr.cbi-section-table-row", + animation: 150, + ghostClass: "dragging-row", + fallbackOnBody: true, + forceFallback: false, + swapThreshold: 0.65, + onEnd: function (evt) { + updateHiddenInput(root, section); + } + }); + return root._sortable_instance; + } catch (e) { + root._sortable_initialized = false; + console.error("Sortable init failed:", e); + } + } + + // 获取 table 当前行顺序 + function getCurrentOrder(root) { + var order = []; + var rows = root.querySelectorAll("tr.cbi-section-table-row"); + rows.forEach(function (tr) { + var id = tr.id || ""; + if (id.startsWith("cbi-<%=api.appname%>-")) + id = id.replace("cbi-<%=api.appname%>-", ""); + order.push(id); + }); + return order; + } + + // 拖拽完成后更新 hidden input + function updateHiddenInput(root, section) { + var newOrder = getCurrentOrder(root); + var changed = newOrder.join(" ") !== root._origOrder.join(" "); + var hiddenInput = section.querySelector('input[type="hidden"][id^="cbi.sts."]'); + if (hiddenInput) { + hiddenInput.value = changed ? newOrder.join(" ") : ""; + } + } + + // === 等待 TypedSection 行稳定 === + (function waitStable() { + var last = 0, stable = 0; + var THRESHOLD = 5; + function tick() { + var count = document.querySelectorAll("tr.cbi-section-table-row").length; + if (count && count === last) stable++; + else stable = 0; + + last = count; + if (stable >= THRESHOLD) + initSortableForTable(); + else + requestAnimationFrame(tick); + } + tick(); + })(); + })(); //]]> diff --git a/small/luci-app-passwall/root/usr/share/passwall/app.sh b/small/luci-app-passwall/root/usr/share/passwall/app.sh index 1375aa1a88..f7b8178ad0 100755 --- a/small/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/small/luci-app-passwall/root/usr/share/passwall/app.sh @@ -691,7 +691,7 @@ run_socks() { case "$type" in socks) - local _socks_address _socks_port _socks_username _socks_password _extra_param microsocks_fwd + local _socks_address _socks_port _socks_username _socks_password if [ "$node2socks_port" = "0" ]; then _socks_address=$(config_n_get $node address) _socks_port=$(config_n_get $node port) @@ -701,24 +701,13 @@ run_socks() { _socks_address="127.0.0.1" _socks_port=$node2socks_port fi - if [ "$http_port" != "0" ]; then + [ "$http_port" != "0" ] && { http_flag=1 config_file="${config_file//SOCKS/HTTP_SOCKS}" - _extra_param="-local_http_address $bind -local_http_port $http_port" - else - # 仅 passwall-packages 专用的 microsocks 才支持 socks 转发规则! - microsocks_fwd="$($(first_type microsocks) -V 2>/dev/null | grep -i forward)" - fi + local _extra_param="-local_http_address $bind -local_http_port $http_port" + } local bin=$(first_type $(config_t_get global_app sing_box_file) sing-box) - if [ -n "$microsocks_fwd" ]; then - local ext_name=$(echo "$config_file" | sed "s|^${TMP_PATH}/||; s|\.json\$||; s|/|_|g") - if [ -n "$_socks_username" ] && [ -n "$_socks_password" ]; then - _extra_param="-f \"0.0.0.0:0,${_socks_username}:${_socks_password}@${_socks_address}:${_socks_port},0.0.0.0:0\"" - else - _extra_param="-f \"0.0.0.0:0,${_socks_address}:${_socks_port},0.0.0.0:0\"" - fi - ln_run "$(first_type microsocks)" "microsocks_${ext_name}" $log_file -i $bind -p $socks_port ${_extra_param} - elif [ -n "$bin" ]; then + if [ -n "$bin" ]; then type="sing-box" lua $UTIL_SINGBOX gen_proto_config -local_socks_address $bind -local_socks_port $socks_port ${_extra_param} -server_proto socks -server_address ${_socks_address} -server_port ${_socks_port} -server_username ${_socks_username} -server_password ${_socks_password} > $config_file ln_run "$bin" ${type} $log_file run -c "$config_file" diff --git a/small/v2ray-geodata/Makefile b/small/v2ray-geodata/Makefile index 19281dee0d..dc4b57d33f 100644 --- a/small/v2ray-geodata/Makefile +++ b/small/v2ray-geodata/Makefile @@ -21,13 +21,13 @@ define Download/geoip HASH:=ed2de9add79623e2e5dbc5930ee39cc7037a7c6e0ecd58ba528b6f73d61457b5 endef -GEOSITE_VER:=20260109015452 +GEOSITE_VER:=20260110084845 GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER) define Download/geosite URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/ URL_FILE:=dlc.dat FILE:=$(GEOSITE_FILE) - HASH:=379bee918c0241df853bac6855d0fafa188c6cae262fc6c9639f1afcd5f6121e + HASH:=274d189c37b7af64bd14d4ac76bc05a56683d9b502e01bc68a34df25711e11f1 endef GEOSITE_IRAN_VER:=202601050049 diff --git a/v2rayn/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayn/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 0bbdb208fd..0e141b7419 100644 --- a/v2rayn/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayn/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -56,7 +56,8 @@ public class ProfilesViewModel : MyReactiveObject public ReactiveCommand MoveUpCmd { get; } public ReactiveCommand MoveDownCmd { get; } - public ReactiveCommand MoveBottomCmd { get; } + public ReactiveCommand MoveBottomCmd { get; } + public ReactiveCommand MoveToGroupCmd { get; } //servers ping public ReactiveCommand MixedTestServerCmd { get; } @@ -179,6 +180,10 @@ public class ProfilesViewModel : MyReactiveObject { await MoveServer(EMove.Bottom); }, canEditRemove); + MoveToGroupCmd = ReactiveCommand.CreateFromTask(async sub => + { + SelectedMoveToGroup = sub; + }); //servers ping FastRealPingCmd = ReactiveCommand.CreateFromTask(async () => diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml b/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml index dc5f2e86ba..116f35fa0c 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml @@ -7,6 +7,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib" xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib" + x:Name="Root" d:DesignHeight="450" d:DesignWidth="800" x:DataType="vms:ProfilesViewModel" @@ -141,19 +142,18 @@ InputGesture="Ctrl+T" /> - - - - - - - - + + + + + + //servers move //this.OneWayBind(ViewModel, vm => vm.SubItems, v => v.cmbMoveToGroup.ItemsSource).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.SelectedMoveToGroup, v => v.cmbMoveToGroup.SelectedItem).DisposeWith(disposables); + //this.Bind(ViewModel, vm => vm.SelectedMoveToGroup, v => v.cmbMoveToGroup.SelectedItem).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.MoveTopCmd, v => v.menuMoveTop).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.MoveUpCmd, v => v.menuMoveUp).DisposeWith(disposables); diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/AngApplication.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/AngApplication.kt index 44f680b35c..de459673ec 100644 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/AngApplication.kt +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/AngApplication.kt @@ -34,6 +34,8 @@ class AngApplication : MultiDexApplication() { MMKV.initialize(this) + // Ensure critical preference defaults are present in MMKV early + SettingsManager.ensureDefaultSettings() SettingsManager.setNightMode() // Initialize WorkManager with the custom configuration WorkManager.initialize(this, workManagerConfiguration) diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvManager.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvManager.kt index 659bdd16be..d97afd1093 100644 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvManager.kt +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvManager.kt @@ -493,6 +493,28 @@ object MmkvManager { return settingsStorage.encode(key, value) } + /** + * Encodes the settings. + * + * @param key The settings key. + * @param value The settings value. + * @return Whether the encoding was successful. + */ + fun encodeSettings(key: String, value: Long): Boolean { + return settingsStorage.encode(key, value) + } + + /** + * Encodes the settings. + * + * @param key The settings key. + * @param value The settings value. + * @return Whether the encoding was successful. + */ + fun encodeSettings(key: String, value: Float): Boolean { + return settingsStorage.encode(key, value) + } + /** * Encodes the settings. * @@ -536,6 +558,39 @@ object MmkvManager { return settingsStorage.decodeString(key, defaultValue) } + /** + * Decodes the settings integer. + * + * @param key The settings key. + * @param defaultValue The default value. + * @return The settings value. + */ + fun decodeSettingsInt(key: String, defaultValue: Int): Int { + return settingsStorage.decodeInt(key, defaultValue) + } + + /** + * Decodes the settings long. + * + * @param key The settings key. + * @param defaultValue The default value. + * @return The settings value. + */ + fun decodeSettingsLong(key: String, defaultValue: Long): Long { + return settingsStorage.decodeLong(key, defaultValue) + } + + /** + * Decodes the settings float. + * + * @param key The settings key. + * @param defaultValue The default value. + * @return The settings value. + */ + fun decodeSettingsFloat(key: String, defaultValue: Float): Float { + return settingsStorage.decodeFloat(key, defaultValue) + } + /** * Decodes the settings boolean. * diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvPreferenceDataStore.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvPreferenceDataStore.kt new file mode 100644 index 0000000000..2d8b26fafc --- /dev/null +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/MmkvPreferenceDataStore.kt @@ -0,0 +1,80 @@ +package com.v2ray.ang.handler + +import androidx.preference.PreferenceDataStore +import com.v2ray.ang.AppConfig + +/** + * PreferenceDataStore implementation that bridges AndroidX Preference framework to MMKV storage. + * This ensures that all Preference UI operations read/write directly from/to MMKV, + * avoiding inconsistencies between SharedPreferences and MMKV. + */ +class MmkvPreferenceDataStore : PreferenceDataStore() { + + override fun putString(key: String, value: String?) { + MmkvManager.encodeSettings(key, value) + notifySettingChanged(key) + } + + override fun getString(key: String, defaultValue: String?): String? { + return MmkvManager.decodeSettingsString(key, defaultValue) + } + + override fun putInt(key: String, value: Int) { + MmkvManager.encodeSettings(key, value) + notifySettingChanged(key) + } + + override fun getInt(key: String, defaultValue: Int): Int { + return MmkvManager.decodeSettingsInt(key, defaultValue) + } + + override fun putLong(key: String, value: Long) { + MmkvManager.encodeSettings(key, value) + notifySettingChanged(key) + } + + override fun getLong(key: String, defaultValue: Long): Long { + return MmkvManager.decodeSettingsLong(key, defaultValue) + } + + override fun putFloat(key: String, value: Float) { + MmkvManager.encodeSettings(key, value) + notifySettingChanged(key) + } + + override fun getFloat(key: String, defaultValue: Float): Float { + return MmkvManager.decodeSettingsFloat(key, defaultValue) + } + + override fun putBoolean(key: String, value: Boolean) { + MmkvManager.encodeSettings(key, value) + notifySettingChanged(key) + } + + override fun getBoolean(key: String, defaultValue: Boolean): Boolean { + return MmkvManager.decodeSettingsBool(key, defaultValue) + } + + override fun putStringSet(key: String, values: MutableSet?) { + if (values == null) { + MmkvManager.encodeSettings(key, null as String?) + } else { + MmkvManager.encodeSettings(key, values) + } + notifySettingChanged(key) + } + + override fun getStringSet(key: String, defaultValues: MutableSet?): MutableSet? { + return MmkvManager.decodeSettingsStringSet(key) ?: defaultValues + } + + // Internal helper: notify other modules about setting changes + private fun notifySettingChanged(key: String) { + // Call SettingsManager.setNightMode if UI mode changed + if (key == AppConfig.PREF_UI_MODE_NIGHT) { + SettingsManager.setNightMode() + } + // Notify listeners that require service restart or reinit + SettingsChangeManager.makeRestartService() + } +} \ No newline at end of file diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/SettingsManager.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/SettingsManager.kt index e2ddfab67b..c1550c136d 100644 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/SettingsManager.kt +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/handler/SettingsManager.kt @@ -377,4 +377,31 @@ object SettingsManager { fun getVpnMtu(): Int { return Utils.parseInt(MmkvManager.decodeSettingsString(AppConfig.PREF_VPN_MTU), AppConfig.VPN_MTU) } + + /** + * Ensure default settings are present in MMKV. + */ + fun ensureDefaultSettings() { + // Write defaults in the exact order requested by the user + ensureDefaultValue(AppConfig.PREF_MODE, AppConfig.VPN) + ensureDefaultValue(AppConfig.PREF_VPN_DNS, AppConfig.DNS_VPN) + ensureDefaultValue(AppConfig.PREF_VPN_MTU, AppConfig.VPN_MTU.toString()) + ensureDefaultValue(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL, AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL) + ensureDefaultValue(AppConfig.PREF_SOCKS_PORT, AppConfig.PORT_SOCKS.toString()) + ensureDefaultValue(AppConfig.PREF_REMOTE_DNS, AppConfig.DNS_PROXY) + ensureDefaultValue(AppConfig.PREF_DOMESTIC_DNS, AppConfig.DNS_DIRECT) + ensureDefaultValue(AppConfig.PREF_DELAY_TEST_URL, AppConfig.DELAY_TEST_URL) + ensureDefaultValue(AppConfig.PREF_IP_API_URL, AppConfig.IP_API_URL) + ensureDefaultValue(AppConfig.PREF_HEV_TUNNEL_RW_TIMEOUT, AppConfig.HEVTUN_RW_TIMEOUT) + ensureDefaultValue(AppConfig.PREF_MUX_CONCURRENCY, "8") + ensureDefaultValue(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8") + ensureDefaultValue(AppConfig.PREF_FRAGMENT_LENGTH, "50-100") + ensureDefaultValue(AppConfig.PREF_FRAGMENT_INTERVAL, "10-20") + } + + private fun ensureDefaultValue(key: String, default: String) { + if (MmkvManager.decodeSettingsString(key).isNullOrEmpty()) { + MmkvManager.encodeSettings(key, default) + } + } } diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/service/V2RayTestService.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/service/V2RayTestService.kt index f441af2b29..6f343c573b 100644 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/service/V2RayTestService.kt +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/service/V2RayTestService.kt @@ -36,6 +36,7 @@ class V2RayTestService : Service() { // simple counter for currently running tasks private val realTestRunningCount = AtomicInteger(0) + private val realTestCount = AtomicInteger(0) /** * Initializes the V2Ray environment. @@ -56,15 +57,22 @@ class V2RayTestService : Service() { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { when (intent?.getIntExtra("key", 0)) { MSG_MEASURE_CONFIG -> { - val guid = intent.serializable("content") ?: "" - realTestScope.launch { - realTestRunningCount.incrementAndGet() - try { - val result = startRealPing(guid) - MessageUtil.sendMsg2UI(this@V2RayTestService, MSG_MEASURE_CONFIG_SUCCESS, Pair(guid, result)) - } finally { - val left = realTestRunningCount.decrementAndGet() - MessageUtil.sendMsg2UI(this@V2RayTestService, AppConfig.MSG_MEASURE_CONFIG_FINISH, left.toString()) + val guidsList = intent.serializable>("content") + if (guidsList == null || guidsList.isEmpty()) { + return super.onStartCommand(intent, flags, startId) + } + for (guid in guidsList) { + realTestCount.incrementAndGet() + realTestScope.launch { + realTestRunningCount.incrementAndGet() + try { + val result = startRealPing(guid) + MessageUtil.sendMsg2UI(this@V2RayTestService, MSG_MEASURE_CONFIG_SUCCESS, Pair(guid, result)) + } finally { + val count = realTestCount.decrementAndGet() + val left = realTestRunningCount.decrementAndGet() + MessageUtil.sendMsg2UI(this@V2RayTestService, AppConfig.MSG_MEASURE_CONFIG_FINISH, "$left / $count") + } } } } diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/FragmentAdapter.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/FragmentAdapter.kt deleted file mode 100644 index deeb43c318..0000000000 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/FragmentAdapter.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.v2ray.ang.ui - -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentActivity -import androidx.viewpager2.adapter.FragmentStateAdapter - -class FragmentAdapter(fragmentActivity: FragmentActivity, private val mFragments: List) : - FragmentStateAdapter(fragmentActivity) { - - override fun createFragment(position: Int): Fragment { - return mFragments[position] - } - - override fun getItemCount(): Int { - return mFragments.size - } -} diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/SettingsActivity.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/SettingsActivity.kt index 6543ea28f6..f44dfa4a02 100644 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/SettingsActivity.kt +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/ui/SettingsActivity.kt @@ -3,7 +3,6 @@ package com.v2ray.ang.ui import android.os.Bundle import android.text.TextUtils import android.view.View -import androidx.activity.viewModels import androidx.preference.CheckBoxPreference import androidx.preference.EditTextPreference import androidx.preference.ListPreference @@ -17,20 +16,20 @@ import com.v2ray.ang.AppConfig.VPN import com.v2ray.ang.R import com.v2ray.ang.extension.toLongEx import com.v2ray.ang.handler.MmkvManager +import com.v2ray.ang.handler.MmkvPreferenceDataStore import com.v2ray.ang.handler.SubscriptionUpdater import com.v2ray.ang.util.Utils -import com.v2ray.ang.viewmodel.SettingsViewModel import java.util.concurrent.TimeUnit class SettingsActivity : BaseActivity() { - private val settingsViewModel: SettingsViewModel by viewModels() + //private val settingsViewModel: SettingsViewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) //setContentView(R.layout.activity_settings) setContentViewWithToolbar(R.layout.activity_settings, showHomeAsUp = true, title = getString(R.string.title_settings)) - settingsViewModel.startListenPreferenceChange() + //settingsViewModel.startListenPreferenceChange() } class SettingsFragment : PreferenceFragmentCompat() { @@ -58,21 +57,27 @@ class SettingsActivity : BaseActivity() { private val autoUpdateCheck by lazy { findPreference(AppConfig.SUBSCRIPTION_AUTO_UPDATE) } private val autoUpdateInterval by lazy { findPreference(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL) } - private val socksPort by lazy { findPreference(AppConfig.PREF_SOCKS_PORT) } - private val remoteDns by lazy { findPreference(AppConfig.PREF_REMOTE_DNS) } - private val domesticDns by lazy { findPreference(AppConfig.PREF_DOMESTIC_DNS) } - private val dnsHosts by lazy { findPreference(AppConfig.PREF_DNS_HOSTS) } - private val delayTestUrl by lazy { findPreference(AppConfig.PREF_DELAY_TEST_URL) } - private val ipApiUrl by lazy { findPreference(AppConfig.PREF_IP_API_URL) } +// private val socksPort by lazy { findPreference(AppConfig.PREF_SOCKS_PORT) } +// private val remoteDns by lazy { findPreference(AppConfig.PREF_REMOTE_DNS) } +// private val domesticDns by lazy { findPreference(AppConfig.PREF_DOMESTIC_DNS) } +// private val dnsHosts by lazy { findPreference(AppConfig.PREF_DNS_HOSTS) } +// private val delayTestUrl by lazy { findPreference(AppConfig.PREF_DELAY_TEST_URL) } +// private val ipApiUrl by lazy { findPreference(AppConfig.PREF_IP_API_URL) } private val mode by lazy { findPreference(AppConfig.PREF_MODE) } - private val hevTunLogLevel by lazy { findPreference(AppConfig.PREF_HEV_TUNNEL_LOGLEVEL) } - private val hevTunRwTimeout by lazy { findPreference(AppConfig.PREF_HEV_TUNNEL_RW_TIMEOUT) } +// private val hevTunLogLevel by lazy { findPreference(AppConfig.PREF_HEV_TUNNEL_LOGLEVEL) } +// private val hevTunRwTimeout by lazy { findPreference(AppConfig.PREF_HEV_TUNNEL_RW_TIMEOUT) } // private val useHevTun by lazy { findPreference(AppConfig.PREF_USE_HEV_TUNNEL) } override fun onCreatePreferences(bundle: Bundle?, s: String?) { + // Use MMKV as the storage backend for all Preferences + // This prevents inconsistencies between SharedPreferences and MMKV + preferenceManager.preferenceDataStore = MmkvPreferenceDataStore() + addPreferencesFromResource(R.xml.pref_settings) + initPreferenceSummaries() + // perAppProxy?.setOnPreferenceClickListener { // startActivity(Intent(activity, PerAppProxyActivity::class.java)) // perAppProxy?.isChecked = true @@ -87,16 +92,16 @@ class SettingsActivity : BaseActivity() { // localDnsPort?.summary = nval.ifEmpty { AppConfig.PORT_LOCAL_DNS } // true // } - vpnDns?.setOnPreferenceChangeListener { _, any -> - vpnDns?.summary = any as String - true - } +// vpnDns?.setOnPreferenceChangeListener { _, any -> +// vpnDns?.summary = any as String +// true +// } - vpnMtu?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - vpnMtu?.summary = nval.ifEmpty { AppConfig.VPN_MTU.toString() } - true - } +// vpnMtu?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// vpnMtu?.summary = nval.ifEmpty { AppConfig.VPN_MTU.toString() } +// true +// } mux?.setOnPreferenceChangeListener { _, newValue -> updateMux(newValue as Boolean) @@ -115,18 +120,18 @@ class SettingsActivity : BaseActivity() { updateFragment(newValue as Boolean) true } - fragmentPackets?.setOnPreferenceChangeListener { _, newValue -> - updateFragmentPackets(newValue as String) - true - } - fragmentLength?.setOnPreferenceChangeListener { _, newValue -> - updateFragmentLength(newValue as String) - true - } - fragmentInterval?.setOnPreferenceChangeListener { _, newValue -> - updateFragmentInterval(newValue as String) - true - } +// fragmentPackets?.setOnPreferenceChangeListener { _, newValue -> +// updateFragmentPackets(newValue as String) +// true +// } +// fragmentLength?.setOnPreferenceChangeListener { _, newValue -> +// updateFragmentLength(newValue as String) +// true +// } +// fragmentInterval?.setOnPreferenceChangeListener { _, newValue -> +// updateFragmentInterval(newValue as String) +// true +// } autoUpdateCheck?.setOnPreferenceChangeListener { _, newValue -> val value = newValue as Boolean @@ -137,48 +142,48 @@ class SettingsActivity : BaseActivity() { } true } - autoUpdateInterval?.setOnPreferenceChangeListener { _, any -> - var nval = any as String +// autoUpdateInterval?.setOnPreferenceChangeListener { _, any -> +// var nval = any as String +// +// // It must be greater than 15 minutes because WorkManager couldn't run tasks under 15 minutes intervals +// nval = +// if (TextUtils.isEmpty(nval) || nval.toLongEx() < 15) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval +// autoUpdateInterval?.summary = nval +// configureUpdateTask(nval.toLongEx()) +// true +// } - // It must be greater than 15 minutes because WorkManager couldn't run tasks under 15 minutes intervals - nval = - if (TextUtils.isEmpty(nval) || nval.toLongEx() < 15) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval - autoUpdateInterval?.summary = nval - configureUpdateTask(nval.toLongEx()) - true - } - - socksPort?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - socksPort?.summary = nval.ifEmpty { AppConfig.PORT_SOCKS } - true - } - - remoteDns?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - remoteDns?.summary = nval.ifEmpty { AppConfig.DNS_PROXY } - true - } - domesticDns?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - domesticDns?.summary = nval.ifEmpty { AppConfig.DNS_DIRECT } - true - } - dnsHosts?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - dnsHosts?.summary = nval - true - } - delayTestUrl?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - delayTestUrl?.summary = nval.ifEmpty { AppConfig.DELAY_TEST_URL } - true - } - ipApiUrl?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - ipApiUrl?.summary = nval.ifEmpty { AppConfig.IP_API_URL } - true - } +// socksPort?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// socksPort?.summary = nval.ifEmpty { AppConfig.PORT_SOCKS } +// true +// } +// +// remoteDns?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// remoteDns?.summary = nval.ifEmpty { AppConfig.DNS_PROXY } +// true +// } +// domesticDns?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// domesticDns?.summary = nval.ifEmpty { AppConfig.DNS_DIRECT } +// true +// } +// dnsHosts?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// dnsHosts?.summary = nval +// true +// } +// delayTestUrl?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// delayTestUrl?.summary = nval.ifEmpty { AppConfig.DELAY_TEST_URL } +// true +// } +// ipApiUrl?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// ipApiUrl?.summary = nval.ifEmpty { AppConfig.IP_API_URL } +// true +// } mode?.setOnPreferenceChangeListener { _, newValue -> updateMode(newValue.toString()) true @@ -191,113 +196,151 @@ class SettingsActivity : BaseActivity() { // true // } - hevTunRwTimeout?.setOnPreferenceChangeListener { _, any -> - val nval = any as String - hevTunRwTimeout?.summary = nval.ifEmpty { AppConfig.HEVTUN_RW_TIMEOUT } - true +// hevTunRwTimeout?.setOnPreferenceChangeListener { _, any -> +// val nval = any as String +// hevTunRwTimeout?.summary = nval.ifEmpty { AppConfig.HEVTUN_RW_TIMEOUT } +// true +// } + } + + private fun initPreferenceSummaries() { + fun updateSummary(pref: androidx.preference.Preference) { + when (pref) { + is EditTextPreference -> { + pref.summary = pref.text.orEmpty() + pref.setOnPreferenceChangeListener { p, newValue -> + p.summary = (newValue as? String).orEmpty() + true + } + } + is ListPreference -> { + pref.summary = pref.entry ?: "" + pref.setOnPreferenceChangeListener { p, newValue -> + val lp = p as ListPreference + val idx = lp.findIndexOfValue(newValue as? String) + lp.summary = (if (idx >= 0) lp.entries[idx] else newValue) as CharSequence? + true + } + } + is CheckBoxPreference, is androidx.preference.SwitchPreferenceCompat -> { + } + } } + + fun traverse(group: androidx.preference.PreferenceGroup) { + for (i in 0 until group.preferenceCount) { + val p = group.getPreference(i) + when (p) { + is androidx.preference.PreferenceGroup -> traverse(p) + else -> updateSummary(p) + } + } + } + + preferenceScreen?.let { traverse(it) } } override fun onStart() { super.onStart() + // Initialize mode-dependent UI states updateMode(MmkvManager.decodeSettingsString(AppConfig.PREF_MODE, VPN)) - localDns?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_LOCAL_DNS_ENABLED, false) - fakeDns?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_FAKE_DNS_ENABLED, false) - appendHttpProxy?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_APPEND_HTTP_PROXY, false) -// localDnsPort?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_LOCAL_DNS_PORT, AppConfig.PORT_LOCAL_DNS) - vpnDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_VPN_DNS, AppConfig.DNS_VPN) - vpnMtu?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_VPN_MTU, AppConfig.VPN_MTU.toString()) + // Initialize mux-dependent UI states updateMux(MmkvManager.decodeSettingsBool(AppConfig.PREF_MUX_ENABLED, false)) - mux?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_MUX_ENABLED, false) - muxConcurrency?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_MUX_CONCURRENCY, "8") - muxXudpConcurrency?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8") + // Initialize fragment-dependent UI states updateFragment(MmkvManager.decodeSettingsBool(AppConfig.PREF_FRAGMENT_ENABLED, false)) - fragment?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_FRAGMENT_ENABLED, false) - fragmentPackets?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_PACKETS, "tlshello") - fragmentLength?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_LENGTH, "50-100") - fragmentInterval?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_INTERVAL, "10-20") - autoUpdateCheck?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.SUBSCRIPTION_AUTO_UPDATE, false) - autoUpdateInterval?.summary = - MmkvManager.decodeSettingsString(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL, AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL) + // Initialize auto-update interval state autoUpdateInterval?.isEnabled = MmkvManager.decodeSettingsBool(AppConfig.SUBSCRIPTION_AUTO_UPDATE, false) - socksPort?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_SOCKS_PORT, AppConfig.PORT_SOCKS) - remoteDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_REMOTE_DNS, AppConfig.DNS_PROXY) - domesticDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DOMESTIC_DNS, AppConfig.DNS_DIRECT) - dnsHosts?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DNS_HOSTS) - delayTestUrl?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DELAY_TEST_URL, AppConfig.DELAY_TEST_URL) - ipApiUrl?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_IP_API_URL, AppConfig.IP_API_URL) +// localDns?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_LOCAL_DNS_ENABLED, false) +// fakeDns?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_FAKE_DNS_ENABLED, false) +// appendHttpProxy?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_APPEND_HTTP_PROXY, false) +// vpnDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_VPN_DNS, AppConfig.DNS_VPN) +// vpnMtu?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_VPN_MTU, AppConfig.VPN_MTU.toString()) +// mux?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_MUX_ENABLED, false) +// muxConcurrency?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_MUX_CONCURRENCY, "8") +// muxXudpConcurrency?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_MUX_XUDP_CONCURRENCY, "8") +// fragment?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_FRAGMENT_ENABLED, false) +// fragmentPackets?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_PACKETS, "tlshello") +// fragmentLength?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_LENGTH, "50-100") +// fragmentInterval?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_INTERVAL, "10-20") +// autoUpdateCheck?.isChecked = MmkvManager.decodeSettingsBool(AppConfig.SUBSCRIPTION_AUTO_UPDATE, false) +// autoUpdateInterval?.summary = +// MmkvManager.decodeSettingsString(AppConfig.SUBSCRIPTION_AUTO_UPDATE_INTERVAL, AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL) +// socksPort?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_SOCKS_PORT, AppConfig.PORT_SOCKS) +// remoteDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_REMOTE_DNS, AppConfig.DNS_PROXY) +// domesticDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DOMESTIC_DNS, AppConfig.DNS_DIRECT) +// dnsHosts?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DNS_HOSTS) +// delayTestUrl?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DELAY_TEST_URL, AppConfig.DELAY_TEST_URL) +// ipApiUrl?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_IP_API_URL, AppConfig.IP_API_URL) +// hevTunRwTimeout?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_HEV_TUNNEL_RW_TIMEOUT, AppConfig.HEVTUN_RW_TIMEOUT) - //updateHevTunSettings(MmkvManager.decodeSettingsBool(AppConfig.PREF_USE_HEV_TUNNEL, true)) - hevTunRwTimeout?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_HEV_TUNNEL_RW_TIMEOUT, AppConfig.HEVTUN_RW_TIMEOUT) - - initSharedPreference() + // initSharedPreference() } private fun initSharedPreference() { - listOf( - //localDnsPort, - vpnDns, - vpnMtu, - muxConcurrency, - muxXudpConcurrency, - fragmentLength, - fragmentInterval, - autoUpdateInterval, - socksPort, - remoteDns, - domesticDns, - delayTestUrl, - ipApiUrl, - hevTunRwTimeout - ).forEach { key -> - key?.text = key.summary.toString() - } +// listOf( +// //localDnsPort, +// vpnDns, +// vpnMtu, +// muxConcurrency, +// muxXudpConcurrency, +// fragmentLength, +// fragmentInterval, +// autoUpdateInterval, +// socksPort, +// remoteDns, +// domesticDns, +// delayTestUrl, +// ipApiUrl, +// hevTunRwTimeout +// ).forEach { key -> +// key?.summary = key.text.toString() +// } - listOf( - AppConfig.PREF_SNIFFING_ENABLED, - AppConfig.PREF_USE_HEV_TUNNEL - ).forEach { key -> - findPreference(key)?.isChecked = - MmkvManager.decodeSettingsBool(key, true) - } - - listOf( - AppConfig.PREF_ROUTE_ONLY_ENABLED, - AppConfig.PREF_IS_BOOTED, - AppConfig.PREF_BYPASS_APPS, - AppConfig.PREF_SPEED_ENABLED, - AppConfig.PREF_CONFIRM_REMOVE, - AppConfig.PREF_START_SCAN_IMMEDIATE, - AppConfig.PREF_DOUBLE_COLUMN_DISPLAY, - AppConfig.PREF_PREFER_IPV6, - AppConfig.PREF_PROXY_SHARING, - AppConfig.PREF_ALLOW_INSECURE - ).forEach { key -> - findPreference(key)?.isChecked = - MmkvManager.decodeSettingsBool(key, false) - } - - listOf( - AppConfig.PREF_VPN_BYPASS_LAN, - AppConfig.PREF_VPN_INTERFACE_ADDRESS_CONFIG_INDEX, - AppConfig.PREF_ROUTING_DOMAIN_STRATEGY, - AppConfig.PREF_MUX_XUDP_QUIC, - AppConfig.PREF_FRAGMENT_PACKETS, - AppConfig.PREF_LANGUAGE, - AppConfig.PREF_UI_MODE_NIGHT, - AppConfig.PREF_LOGLEVEL, - AppConfig.PREF_OUTBOUND_DOMAIN_RESOLVE_METHOD, - AppConfig.PREF_MODE, - AppConfig.PREF_HEV_TUNNEL_LOGLEVEL - ).forEach { key -> - if (MmkvManager.decodeSettingsString(key) != null) { - findPreference(key)?.value = MmkvManager.decodeSettingsString(key) - } - } +// listOf( +// AppConfig.PREF_SNIFFING_ENABLED, +// AppConfig.PREF_USE_HEV_TUNNEL +// ).forEach { key -> +// findPreference(key)?.isChecked = +// MmkvManager.decodeSettingsBool(key, true) +// } +// +// listOf( +// AppConfig.PREF_ROUTE_ONLY_ENABLED, +// AppConfig.PREF_IS_BOOTED, +// AppConfig.PREF_BYPASS_APPS, +// AppConfig.PREF_SPEED_ENABLED, +// AppConfig.PREF_CONFIRM_REMOVE, +// AppConfig.PREF_START_SCAN_IMMEDIATE, +// AppConfig.PREF_DOUBLE_COLUMN_DISPLAY, +// AppConfig.PREF_PREFER_IPV6, +// AppConfig.PREF_PROXY_SHARING, +// AppConfig.PREF_ALLOW_INSECURE +// ).forEach { key -> +// findPreference(key)?.isChecked = +// MmkvManager.decodeSettingsBool(key, false) +// } +// +// listOf( +// AppConfig.PREF_VPN_BYPASS_LAN, +// AppConfig.PREF_VPN_INTERFACE_ADDRESS_CONFIG_INDEX, +// AppConfig.PREF_ROUTING_DOMAIN_STRATEGY, +// AppConfig.PREF_MUX_XUDP_QUIC, +// AppConfig.PREF_FRAGMENT_PACKETS, +// AppConfig.PREF_LANGUAGE, +// AppConfig.PREF_UI_MODE_NIGHT, +// AppConfig.PREF_LOGLEVEL, +// AppConfig.PREF_OUTBOUND_DOMAIN_RESOLVE_METHOD, +// AppConfig.PREF_MODE, +// AppConfig.PREF_HEV_TUNNEL_LOGLEVEL +// ).forEach { key -> +// if (MmkvManager.decodeSettingsString(key) != null) { +// findPreference(key)?.value = MmkvManager.decodeSettingsString(key) +// } +// } } private fun updateMode(mode: String?) { @@ -381,29 +424,29 @@ class SettingsActivity : BaseActivity() { fragmentPackets?.isEnabled = enabled fragmentLength?.isEnabled = enabled fragmentInterval?.isEnabled = enabled - if (enabled) { - updateFragmentPackets(MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_PACKETS, "tlshello")) - updateFragmentLength(MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_LENGTH, "50-100")) - updateFragmentInterval(MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_INTERVAL, "10-20")) - } - } - - private fun updateFragmentPackets(value: String?) { - fragmentPackets?.summary = value.toString() - } - - private fun updateFragmentLength(value: String?) { - fragmentLength?.summary = value.toString() - } - - private fun updateFragmentInterval(value: String?) { - fragmentInterval?.summary = value.toString() - } - - private fun updateHevTunSettings(enabled: Boolean) { - hevTunLogLevel?.isEnabled = enabled - hevTunRwTimeout?.isEnabled = enabled +// if (enabled) { +// updateFragmentPackets(MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_PACKETS, "tlshello")) +// updateFragmentLength(MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_LENGTH, "50-100")) +// updateFragmentInterval(MmkvManager.decodeSettingsString(AppConfig.PREF_FRAGMENT_INTERVAL, "10-20")) +// } } +// +// private fun updateFragmentPackets(value: String?) { +// fragmentPackets?.summary = value.toString() +// } +// +// private fun updateFragmentLength(value: String?) { +// fragmentLength?.summary = value.toString() +// } +// +// private fun updateFragmentInterval(value: String?) { +// fragmentInterval?.summary = value.toString() +// } +// +// private fun updateHevTunSettings(enabled: Boolean) { +// hevTunLogLevel?.isEnabled = enabled +// hevTunRwTimeout?.isEnabled = enabled +// } } fun onModeHelpClicked(view: View) { diff --git a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/viewmodel/MainViewModel.kt b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/viewmodel/MainViewModel.kt index 1568861df2..b909a0785c 100644 --- a/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/viewmodel/MainViewModel.kt +++ b/v2rayng/V2rayNG/app/src/main/java/com/v2ray/ang/viewmodel/MainViewModel.kt @@ -237,9 +237,11 @@ class MainViewModel(application: Application) : AndroidViewModel(application) { val serversCopy = serversCache.toList() viewModelScope.launch(Dispatchers.Default) { - for (item in serversCopy) { - MessageUtil.sendMsg2TestService(getApplication(), AppConfig.MSG_MEASURE_CONFIG, item.guid) + val guids = ArrayList(serversCopy.map { it.guid }) + if (guids.isEmpty()) { + return@launch } + MessageUtil.sendMsg2TestService(getApplication(), AppConfig.MSG_MEASURE_CONFIG, guids) } }